diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..8a4060e6 --- /dev/null +++ b/.gitignore @@ -0,0 +1,6 @@ +/.tox/ +/build/ +/dist/ +*.egg-info +__pycache__/ + diff --git a/.nojekyll b/.nojekyll new file mode 100644 index 00000000..e69de29b diff --git a/CNAME b/CNAME new file mode 100644 index 00000000..eb646012 --- /dev/null +++ b/CNAME @@ -0,0 +1 @@ +atomistic-cookbook.org diff --git a/_datasets/0fd93139cc9bd74c89c8b652cf382a3bff4b16dc1755e0474898bf7d1778e38b-fig_sample-selection_001.json.gz b/_datasets/0fd93139cc9bd74c89c8b652cf382a3bff4b16dc1755e0474898bf7d1778e38b-fig_sample-selection_001.json.gz new file mode 100644 index 00000000..d7b882f2 Binary files /dev/null and b/_datasets/0fd93139cc9bd74c89c8b652cf382a3bff4b16dc1755e0474898bf7d1778e38b-fig_sample-selection_001.json.gz differ diff --git a/_datasets/2bbb4d29b4cd2443a26d66b6c2ff06457324458cb13c3175ab402e10dbec5973-fig_path-integrals_001.json.gz b/_datasets/2bbb4d29b4cd2443a26d66b6c2ff06457324458cb13c3175ab402e10dbec5973-fig_path-integrals_001.json.gz new file mode 100644 index 00000000..1ad53f27 Binary files /dev/null and b/_datasets/2bbb4d29b4cd2443a26d66b6c2ff06457324458cb13c3175ab402e10dbec5973-fig_path-integrals_001.json.gz differ diff --git a/_datasets/35df339228e2e63776628889c0333974667fada87190573097488a0054e3456d-fig_roy-gch_001.json.gz b/_datasets/35df339228e2e63776628889c0333974667fada87190573097488a0054e3456d-fig_roy-gch_001.json.gz new file mode 100644 index 00000000..514f70e7 Binary files /dev/null and b/_datasets/35df339228e2e63776628889c0333974667fada87190573097488a0054e3456d-fig_roy-gch_001.json.gz differ diff --git a/_datasets/468d4cc452ea267b5e632d74b20530d1b593b26ea25eea7dc3c68a0197a76268-fig_pi-metad_002.json.gz b/_datasets/468d4cc452ea267b5e632d74b20530d1b593b26ea25eea7dc3c68a0197a76268-fig_pi-metad_002.json.gz new file mode 100644 index 00000000..d6a58a86 Binary files /dev/null and b/_datasets/468d4cc452ea267b5e632d74b20530d1b593b26ea25eea7dc3c68a0197a76268-fig_pi-metad_002.json.gz differ diff --git a/_datasets/4a9ca899f0ff3dd7fcc9b212c0ae6e3bfa2ebb14a4ec9f3de82ad2a9a9a24770-fig_roy-gch_002.json.gz b/_datasets/4a9ca899f0ff3dd7fcc9b212c0ae6e3bfa2ebb14a4ec9f3de82ad2a9a9a24770-fig_roy-gch_002.json.gz new file mode 100644 index 00000000..5f4368bf Binary files /dev/null and b/_datasets/4a9ca899f0ff3dd7fcc9b212c0ae6e3bfa2ebb14a4ec9f3de82ad2a9a9a24770-fig_roy-gch_002.json.gz differ diff --git a/_datasets/57070049f5de292905210a9ead356d31d4e71ffb7084d9b98c9a9444317fe78d-fig_pi-metad_001.json.gz b/_datasets/57070049f5de292905210a9ead356d31d4e71ffb7084d9b98c9a9444317fe78d-fig_pi-metad_001.json.gz new file mode 100644 index 00000000..5e6553d3 Binary files /dev/null and b/_datasets/57070049f5de292905210a9ead356d31d4e71ffb7084d9b98c9a9444317fe78d-fig_pi-metad_001.json.gz differ diff --git a/_datasets/62128ccf3006012fd631e71c698d9deb53d6e7a7fe149ce74eec3fddce71afae-fig_path-integrals_002.json.gz b/_datasets/62128ccf3006012fd631e71c698d9deb53d6e7a7fe149ce74eec3fddce71afae-fig_path-integrals_002.json.gz new file mode 100644 index 00000000..dadf10f9 Binary files /dev/null and b/_datasets/62128ccf3006012fd631e71c698d9deb53d6e7a7fe149ce74eec3fddce71afae-fig_path-integrals_002.json.gz differ diff --git a/_datasets/91eab446d45c5e1a0a9eee1557fd5ea7f853ee07e318fbb55ddf4843e2b67851-fig_gaas-map_001.json.gz b/_datasets/91eab446d45c5e1a0a9eee1557fd5ea7f853ee07e318fbb55ddf4843e2b67851-fig_gaas-map_001.json.gz new file mode 100644 index 00000000..6560a806 Binary files /dev/null and b/_datasets/91eab446d45c5e1a0a9eee1557fd5ea7f853ee07e318fbb55ddf4843e2b67851-fig_gaas-map_001.json.gz differ diff --git a/_datasets/a799a7b06e0657ae053e9a0d99160ad9d935efc4258ebb3a0af940d75dba421a-fig_pi-metad_003.json.gz b/_datasets/a799a7b06e0657ae053e9a0d99160ad9d935efc4258ebb3a0af940d75dba421a-fig_pi-metad_003.json.gz new file mode 100644 index 00000000..a9422cb5 Binary files /dev/null and b/_datasets/a799a7b06e0657ae053e9a0d99160ad9d935efc4258ebb3a0af940d75dba421a-fig_pi-metad_003.json.gz differ diff --git a/_datasets/fe36798f4ae0c1b41ccd83d5cdff19d406b729a8f1ecee01dbb53642b1720db4-fig_thermostats_001.json.gz b/_datasets/fe36798f4ae0c1b41ccd83d5cdff19d406b729a8f1ecee01dbb53642b1720db4-fig_thermostats_001.json.gz new file mode 100644 index 00000000..02acc85e Binary files /dev/null and b/_datasets/fe36798f4ae0c1b41ccd83d5cdff19d406b729a8f1ecee01dbb53642b1720db4-fig_thermostats_001.json.gz differ diff --git a/_downloads/0130684eda9cbadbd32996a06a9e61b5/periodic-hamiltonian.py b/_downloads/0130684eda9cbadbd32996a06a9e61b5/periodic-hamiltonian.py new file mode 100644 index 00000000..2076e536 --- /dev/null +++ b/_downloads/0130684eda9cbadbd32996a06a9e61b5/periodic-hamiltonian.py @@ -0,0 +1,1071 @@ +""" +Periodic Hamiltonian learning +============================= + +:Authors: Paolo Pegolo `@ppegolo `__, + Jigyasa Nigam `@curiosity54 `__ + +This tutorial explains how to train a machine learning model for the +electronic Hamiltonian of a periodic system. Even though we focus on +periodic systems, the code and techniques presented here can be directly +transferred to molecules. +""" + +# %% +# First, import the necessary packages +# + +import os +import warnings +import zipfile + +import matplotlib.image as mpimg +import matplotlib.pyplot as plt +import numpy as np +import requests +import torch +from matplotlib.animation import FuncAnimation +from mlelec.data.derived_properties import compute_eigenvalues +from mlelec.data.mldataset import MLDataset +from mlelec.data.qmdataset import QMDataset +from mlelec.models.equivariant_lightning import LitEquivariantModel, MSELoss +from mlelec.utils.pbc_utils import blocks_to_matrix +from mlelec.utils.plot_utils import plot_bands_frame + + +warnings.filterwarnings("ignore") +torch.set_default_dtype(torch.float64) + +# sphinx_gallery_thumbnail_number = 3 + + +# %% +# Get Data and Prepare Data Set +# ----------------------------- +# + + +# %% +# The data set contains 35 distorted graphene unit cells containing 2 +# atoms. The reference density functional theory (DFT) calculations are +# performed with `CP2K `__ using a minimal +# `STO-3G `__ basis and +# the `PBE `__ functional. +# The Kohn-Sham equations are solved on a Monkhorst-Pack grid of +# :math:`15\times 15\times 1` points in the Brillouin zone of the crystal. +# + + +# %% +# Obtain structures and DFT data +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Generating training structures requires running a suitable DFT code, +# and converting the output data in a format that can be processed by +# the ML library ``mlelec``. Given that it takes some time to run even +# these small calculations, we provide pre-computed data, but you can +# also find instructions on how to generate data from scratch. + +# %% +# Run your own cp2k calculations +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +# +# If you have computational resources, you can run the DFT calculations +# needed to produce the data set. `This other +# tutorial `__ in the atomistic cookbook can +# help you set up the CP2K calculations for this data set, using the +# ``reftraj_hamiltonian.cp2k`` file provided in ``data/``. To do the same +# for another data set, adapt the reftraj file. +# We will provide here some of the functions in the `batch-cp2k +# tutorial `__ that need to be adapted to the +# current data set. Note however you will have to modify these and combine +# them with other tutorials to actually generate the data. + + +# %% +# Start by importing all the modules from the `batch-cp2k +# tutorial `__ and run the cell to install +# CP2K. Run also the cells up to the one defining ``write_cp2k_in``. +# The following code snippet defines a slighly modified version of that function, +# allowing for non-orthorombic supercell, and accounting for the reftraj file +# name change. +# + +# %% +# .. code:: python +# +# def write_cp2k_in( +# fname: str, +# project_name: str, +# last_snapshot: int, +# cell_a: List[float], +# cell_b: List[float], +# cell_c: List[float], +# ) -> None: +# """Writes a cp2k input file from a template. +# +# Importantly, it writes the location of the basis set definitions, +# determined from the path of the system CP2K install to the input file. +# """ +# +# cp2k_in = open("reftraj_hamiltonian.cp2k", "r").read() +# +# cp2k_in = cp2k_in.replace("//PROJECT//", project_name) +# cp2k_in = cp2k_in.replace("//LAST_SNAPSHOT//", str(last_snapshot)) +# cp2k_in = cp2k_in.replace("//CELL_A//", " ".join([f"{c:.6f}" for c in cell_a])) +# cp2k_in = cp2k_in.replace("//CELL_B//", " ".join([f"{c:.6f}" for c in cell_b])) +# cp2k_in = cp2k_in.replace("//CELL_C//", " ".join([f"{c:.6f}" for c in cell_c])) +# +# with open(fname, "w") as f: +# f.write(cp2k_in) +# + + +# %% +# Unlike the `batch-cp2k tutorial `__, the +# current data set includes a single stoichiometry, :math:`\mathrm{C_2}`. +# Therefore, you can run this cell to set the calculation scripts up. +# + +# %% +# .. code:: python +# +# project_name = 'graphene' +# frames = ase_read('C2.xyz', index=':') +# os.makedirs(project_name, exist_ok=True) +# os.makedirs(f"{project_name}/FOCK", exist_ok=True) +# os.makedirs(f"{project_name}/OVER", exist_ok=True) +# +# write_cp2k_in( +# f"{project_name}/in.cp2k", +# project_name=project_name, +# last_snapshot=len(frames), +# cell_a=frames[0].cell.array[0], +# cell_b=frames[0].cell.array[1], +# cell_c=frames[0].cell.array[2], +# ) +# +# ase_write(f"{project_name}/init.xyz", frames[0]) +# write_reftraj(f"{project_name}/reftraj.xyz", frames) +# write_cellfile(f"{project_name}/reftraj.cell", frames) +# + + +# %% +# The CP2K calculations can be simply run using: +# + + +# %% +# .. code:: python +# +# subprocess.run(( +# f"cp2k.ssmp -i {project_name}/in.cp2k " +# "> {project_name}/out.cp2k" +# ), +# shell=True) +# + + +# %% +# Once the calculations are done, we can parse the results with: +# + + +# %% +# .. code:: python +# +# from scipy.sparse import csr_matrix +# +# nao = 10 +# ifr = 1 +# fock = [] +# over = [] +# with open(f"{project_name}/out.cp2k", "r") as outfile: +# T_lists = [] # List to hold all T_list instances +# while True: +# line = outfile.readline() +# if not line: +# break +# if line.strip().split()[:3] != ["KS", "CSR", "write|"]: +# continue +# else: +# nT = int(line.strip().split()[3]) +# outfile.readline() # Skip the next line if necessary +# T_list = [] # Initialize a new T_list for this block +# for _ in range(nT): +# line = outfile.readline() +# if not line: +# break +# T_list.append([np.int32(j) for j in line.strip().split()[1:4]]) +# T_list = np.array(T_list) +# T_lists.append(T_list) # Append the T_list to T_lists +# fock_ = {} +# over_ = {} +# for iT, T in enumerate( +# T_list +# ): # Loop through the translations and load matrices +# T = T.tolist() +# r, c, data = np.loadtxt( +# ( +# f"{project_name}/FOCK/{project_name}" +# f"-KS_SPIN_1_R_{iT+1}-1_{ifr}.csr" +# ), +# unpack=True, +# ) +# r = np.int32(r - 1) +# c = np.int32(c - 1) +# fock_[tuple(T)] = csr_matrix( +# (data, (r, c)), shape=(nao, nao) +# ).toarray() +# +# r, c, data = np.loadtxt( +# ( +# f"{project_name}/OVER/{project_name}" +# f"-S_SPIN_1_R_{iT+1}-1_{ifr}.csr" +# ), +# unpack=True, +# ) +# r = np.int32(r - 1) +# c = np.int32(c - 1) +# over_[tuple(T)] = csr_matrix( +# (data, (r, c)), shape=(nao, nao) +# ).toarray() +# fock.append(fock_) +# over.append(over_) +# ifr += 1 +# + + +# %% +# You can now save the matrices to ``.npy`` files, and a file with the +# k-grids used in the calculations. +# + + +# %% +# .. code:: python +# +# os.makedirs("data", exist_ok=True) +# # Save the Hamiltonians +# np.save("data/graphene_fock.npy", fock) +# # Save the overlaps +# np.save("data/graphene_ovlp.npy", over) +# # Write a file with the k-grids, one line per structure +# np.savetxt('data/kmesh.dat', [[15,15,1]]*len(frames), fmt='%d') +# + + +# %% +# Download precomputed data +# ^^^^^^^^^^^^^^^^^^^^^^^^^ +# + + +# %% +# For the sake of simplicity, you can also download precomputed data and +# run just the machine learning part of the notebook using these data. +# + +filename = "precomputed.zip" +if not os.path.exists(filename): + url = ( + "https://github.com/curiosity54/mlelec/raw/" + "tutorial_periodic/examples/periodic_tutorial/precomputed.zip" + ) + response = requests.get(url) + response.raise_for_status() + with open(filename, "wb") as f: + f.write(response.content) + +with zipfile.ZipFile(filename, "r") as zip_ref: + zip_ref.extractall("./") + + +# %% +# Periodic Hamiltonians in real and reciprocal space +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +# +# The DFT calculations for the dataset above were performed using a +# *minimal* STO-3G basis. The basis set is specified for each species +# using three quantum numbers, :math:`n`, :math:`l`, :math:`m`. :math:`n` +# is usually a natural number relating to the *radial* extent or +# resolution whereas :math:`l` and :math:`m` specify the *angular +# components* determining the shape of the orbital and its orientation in +# space. For example, :math:`1s` orbitals correspond to :math:`n=1`, +# :math:`l=0` and :math:`m=0`, while a :math:`2p_z` orbital corresponds to +# :math:`n=2`, :math:`l=1` and :math:`m=0`. For the STO-3G basis-set, +# these quantum numbers for Carbon (identified by its atomic number) are +# given as follows. +# + +basis = "sto-3g" +orbitals = { + "sto-3g": {6: [[1, 0, 0], [2, 0, 0], [2, 1, -1], [2, 1, 0], [2, 1, 1]]}, +} + + +# %% +# For each *frame* which of either train and test structures, the QM data +# comprises the configuration, along with the corresponding *overlap* and +# *Hamiltonian* (used interchangeably with *Fock*) matrices in the basis +# specified above, as well as the :math:`k`-point grid that was used for the +# calculation. +# +# Note that we are currently specifying these matrices in *real-space*, +# :math:`\mathbf{H}(\mathbf{t})` , such that the element +# :math:`\langle \mathbf{0} i nlm| \hat{H}| \mathbf{t} i' n'l'm'\rangle` +# indicates the interaction between orbital :math:`nlm` on atom :math:`i` +# in the undisplaced cell (denoted by the null lattice translation, +# :math:`\mathbf{t}=\mathbf{0}`) and orbital :math:`n'l'm'` on atom +# :math:`i'` in a periodic copy of the unit cell translated by +# :math:`\mathbf{t}`. A short-hand notation for +# :math:`\langle \mathbf{0} i nlm| \hat{H}| \mathbf{t} i' n'l'm'\rangle` +# is :math:`H_{\small\substack{i,nlm\\i',n'l'm'}}(\mathbf{t})` +# + +# %% +# .. figure:: graphene_lattice.png +# :alt: Representation of a graphene unit cell and some replicas. +# :width: 600px +# +# Representation of a graphene unit cell and its +# :math:`3 \times 3 \times 1` replicas in real space. The central cell +# is denoted by :math:`\mathbf{t}=(0,0,0)`, while the cells translated +# by a single lattice vector along directions 1 and 2 are denoted by +# :math:`\mathbf{t}=(1,0,0)` and :math:`\mathbf{t}=(0,1,0)`, +# respectively. The Hamiltonian matrix element between the :math:`1s` +# orbital on atom :math:`i` in the central unit cell and the +# :math:`2p_z` orbital on atom :math:`i'` in the +# :math:`\mathbf{t}=(1,0,0)` cell is schematically represented. +# + + +# %% +# Alternatively, we can provide the matrices in *reciprocal* (or +# Fourier, :math:`k`) space. These are related to the real-space matrices +# by a *Bloch sum*, +# +# .. math:: +# +# \mathbf{H}(\mathbf{k})=\sum_{\mathbf{t}}\ +# e^{i\mathbf{k}\cdot\mathbf{t}} \mathbf{H}(\mathbf{t}). +# +# +# In the case the input matrices are in reciprocal space, there should be +# one matrix per :math:`k`-point in the grid. +# + +# %% +# A ``QMDataset`` to store the DFT data +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +# The ``QMDataset`` class holds all the relevant data +# obtained from a quantum-mechanical (in this case, DFT) calculation, +# combining information from the files containing structures, +# Hamiltonians and overlap matrices, and :math:`k`-point mesh. + +qmdata = QMDataset.from_file( + # File containing the atomistic structures + frames_path="data/C2.xyz", + # File containing the Hamiltonian (of Fock) matrices + fock_realspace_path="graphene_fock.npy", + # File containing the overlap matrices + overlap_realspace_path="graphene_ovlp.npy", + # File containing the k-point grids used for the DFT calculations + kmesh_path="kmesh.dat", + # Physical dimensionality of the system. Graphene is a 2D material + dimension=2, + # Device where to run the calculations + # (can be 'cpu' or 'cuda', if GPUs are available) + device="cpu", + # Name of the basis set used for the calculations + orbs_name=basis, + # List of quantum numbers associated with the basis set orbitals + orbs=orbitals[basis], +) + + +# %% +# Quantities stored in ``QMDataset`` can be accessed as attributes, +# e.g. ``qmdata.fock_realspace`` is a list (one element per structure) of +# dictionaries labeled by the indices of the unit cell real-space +# translations containing ``torch.Tensor``. +# + +structure_idx = 0 +realspace_translation = 0, 0, 0 +print(f"The real-space Hamiltonian matrix for structure {structure_idx} labeled by") +print(f"translation T={realspace_translation} is:") +print(f"{qmdata.fock_realspace[structure_idx][realspace_translation]}") + + +# %% +# Machine learning data set +# ~~~~~~~~~~~~~~~~~~~~~~~~~ +# + + +# %% +# Symmetries of the Hamiltonian matrix +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +# + + +# %% +# The data stored in ``QMDataset`` can be transformed into a format that +# is optimal for machine learning modeling by leveraging the underlying +# *physical symmetries* that characterize the atomistic structure, the +# basis set, and their associated matrices. +# +# The Hamiltonian matrix is a complex learning target, indexed by two +# atoms and the orbitals centered on them. Each +# :math:`\mathbf{H}(\mathbf{k})` is a *Hermitian* matrix, while in real +# space, periodicity introduces a *symmetry over translation pairs* such +# that :math:`\mathbf{H}(-\mathbf{t}) = \mathbf{H}(\mathbf{t})^\dagger`, +# where the dagger, :math:`\dagger`, denotes Hermitian conjugation. +# +# To address the symmetries associated with swapping atomic indices or +# orbital labels, we divide the matrix into *blocks labeled by pairs of +# atom types*. +# +# - ``block_type = 0``, or *on-site* blocks, consist of elements +# corresponding to the interaction of orbitals on the same atom, +# :math:`i = i'`. +# +# - ``block_type = 2``, or *cross-species* blocks, consist of elements +# corresponding to orbitals centered on atoms of distinct species. +# Since the two atoms can be distinguished, they can be consistently +# arranged in a predetermined order. +# +# - ``block_type = 1, -1``, or *same-species* blocks, consist of +# elements corresponding to orbitals centered on distinct atoms of the +# same species. As these atoms are indistinguishable and cannot be +# ordered definitively, the pair must be symmetrized for permutations. +# We construct symmetric and antisymmetric combinations +# :math:`(\mathbf{H}_{\small\substack{i,nlm\\i',n'l'm'}}(\mathbf{t})\pm\ +# \mathbf{H}_{\small\substack{i',nlm\\i,n'l'm'}}(\mathbf{-t}))` +# that correspond to ``block_type`` :math:`+1` and :math:`-1`, +# respectively. +# + + +# %% +# Equivariant structure of the Hamiltonians +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +# + + +# %% +# Even though the Hamiltonian operator under consideration is invariant, +# *its representation transforms under the action of structural rotations +# and inversions* due to the choice of the basis functions. Each of the +# blocks has elements of the form +# :math:`\langle\mathbf{0}inlm|\hat{H}|\mathbf{t}i'n'l'm'\rangle`, which +# are in an *uncoupled* representation and transform as a product of +# (real) spherical harmonics, :math:`Y_l^m \otimes Y_{l'}^{m'}`. +# +# This product can be decomposed into a direct sum of irreducible +# representations (irreps) of :math:`\mathrm{SO(3)}`, +# +# .. math:: \lambda \mu:\lambda \in [|l_1-l_2|,l_1+l_2],\mu \in [-\lambda,\lambda], +# +# which express the Hamiltonian blocks in terms of contributions that +# rotate independently and can be modeled using a feature that +# geometrically describes the pair of atoms under consideration and shares +# the same symmetry. We use the notation +# :math:`H_{ii';nn'll'}^{\lambda\mu}` to indicate the elements of the +# Hamiltonian in this coupled basis. +# +# The resulting irreps form a *coupled* representation, each of which +# transforms as a spherical harmonic :math:`Y^\mu_\lambda` under +# :math:`\mathrm{SO(3)}` rotations, but may exhibit more complex behavior +# under inversions. For example, spherical harmonics transform under +# inversion, :math:`\hat{i}`, as polar tensors: +# +# .. math:: \hat{i}Y^\mu_\lambda = (-1)^\lambda Y^\mu_\lambda. +# +# Some of the coupled basis terms transform like :math:`Y^\mu_\lambda`, +# while others instead transform as pseudotensors, +# +# .. math:: \hat{i}H^{\lambda\mu}=(-1)^{\lambda+1}H^{\lambda\mu} +# +# where we omit for simplicity the indices that are not directly associated +# with inversion and rotation symmetry. For more details about the block +# decomposition, please refer to `Nigam et al., J. Chem. Phys. 156, 014115 +# (2022) `__. +# +# The following is an animation of a trajectory along a `Lissajous +# curve `__ in 3D space, +# alongside a colormap representing the values of the real-space +# Hamiltonian matrix elements of the graphene unit cell in a minimal +# STO-3G basis. From the animation, it is evident how invariant elements, +# such as those associated with interactions between :math:`s` orbitals, +# do not change under structural rotations. On the other hand, +# interactions allowing for equivariant components, such as the +# :math:`s`-:math:`p` block, change under rotations. +# + +image_files = sorted( + [ + f"frames/{f}" + for f in os.listdir("./frames") + if f.startswith("rot_") and f.endswith(".png") + ] +) +images = [mpimg.imread(img) for img in image_files] +fig, ax = plt.subplots() +img_display = ax.imshow(images[0]) +ax.axis("off") + + +def update(frame): + img_display.set_data(images[frame]) + return [img_display] + + +ani = FuncAnimation(fig, update, frames=len(images), interval=20, blit=True) + + +# %% +# .. code:: python +# +# from IPython.display import HTML +# HTML(ani.to_jshtml()) +# + + +# %% +# Mapping geometric features to Hamiltonian targets +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +# + + +# %% +# Each Hamiltonian block obtained from the procedure `described +# above <#symmetries-of-the-hamiltonian-matrix>`__ can be modeled using +# symmetrized features. +# +# Elements of ``block_type=0`` are indexed by a single atom and are best +# described by a symmetrized atom-centered density correlation +# (`ACDC `__), denoted by +# :math:`|\overline{\rho_{i}^{\otimes \nu}; \sigma; \lambda\mu }\rangle`, +# where :math:`\nu` refers to the correlation (body)-order, and—just as +# for the blocks—:math:`\lambda \mu` indicate the :math:`\mathrm{SO(3)}` +# irrep to which the feature is symmetrized. The symbol :math:`\sigma` +# denotes the inversion parity. +# +# For other blocks, such as ``block_type=2``, which explicitly reference +# two atoms, we use `two-center `__ +# ACDCs, :math:`|\overline{\rho_{ii'}^{\otimes \nu}; \lambda\mu }\rangle`. +# +# For ``block_type=1, -1``, we ensure equivariance with respect to atom +# index permutation by constructing symmetric and antisymmetric pair +# features: +# :math:`(|\overline{\rho_{ii'}^{\otimes \nu};\lambda\mu }\rangle\pm\ +# |\overline{\rho_{i'i}^{\otimes \nu};\lambda\mu }\rangle)`. +# + + +# %% +# The features are discretized on a basis of radial functions and +# spherical harmonics, and their performance may depend on the +# *resolution* of the functions included in the model. There are +# additional hyperparameters, such as the *cutoff* radius, which +# controls the extent of the atomic environment, and Gaussian widths. In +# the following, we allow for flexibility in discretizing the +# atom-centered and two-centered ACDCs by defining the hyperparameters for +# the single-center (SC) :math:`\lambda`-SOAP and two-center (TC) ACDC +# descriptors. +# +# The single and two-center descriptors have very similar hyperparameters, +# except for the cutoff radius, which is larger for the two-center +# descriptors to explicitly include distant pairs of atoms. +# +# Note that the descriptors of pairs of atoms separated by distances +# greater than the cutoff radius are identically zero. Thus, any model +# based on these descriptors would predict an identically zero value for +# these pairs. +# + +SC_HYPERS = { + "cutoff": 3.0, + "max_radial": 6, + "max_angular": 6, + "atomic_gaussian_width": 0.5, + "center_atom_weight": 1, + "radial_basis": {"Gto": {}}, + "cutoff_function": {"ShiftedCosine": {"width": 0.5}}, +} + +TC_HYPERS = { + "cutoff": 6.0, + "max_radial": 6, + "max_angular": 6, + "atomic_gaussian_width": 0.3, + "center_atom_weight": 1.0, + "radial_basis": {"Gto": {}}, + "cutoff_function": {"ShiftedCosine": {"width": 0.5}}, +} + + +# %% +# We then use the above defined hyperparameters to compute the descriptor +# and initialize a ``MLDataset`` instance, which contains, among other +# things, the Hamiltonian block decomposition and the geometric features +# described above. +# +# In addition to computing the descriptors, ``MLDataset`` takes the data +# stored in the ``QMDataset`` instance and puts it in a form required to +# train a ML model. +# + + +# %% +# The ``item_names`` argument is a list of names of the quantities we want +# to compute and target in the ML model training, or that we want to be +# able to access later. +# +# For example, ``fock_blocks`` is a +# `metatensor.Tensormap `__ containing the +# Hamiltonian coupled blocks. We also want to access the overlap matrices +# in :math:`k`-space (``overlap_kspace``) to be able to compute the +# Hamiltonian eigenvalues in the :math:`k`-grid. +# + + +mldata = MLDataset( + # A QMDataset instance + qmdata, + # The names of the quantities to compute/initialize for the training + item_names=["fock_blocks", "overlap_kspace"], + # Hypers for the SC descriptors + hypers_atom=SC_HYPERS, + # Hypers for the TC descriptors + hypers_pair=TC_HYPERS, + # Cutoff for the angular quantum number to use in the Clebsh-Gordan iterations + lcut=4, + # Fraction of structures in the training set + train_frac=0.7, + # Fraction of structures in the validation set + val_frac=0.2, + # Fraction of structures in the test set + test_frac=0.1, + # Whether to shuffle or not the structure indices before splitting the data set + shuffle=True, +) + + +# %% +# The matrix decomposition into blocks and the calculations of geometric +# features is performed by the ``MLDataset`` class. +# + + +# %% +# ``mldata.features`` is ``metatensor.TensorMap`` containing the +# stuctures’ descriptors +# + +mldata.features + + +# %% +# ``mldata.items`` is a ``namedtuple`` containing the quantities defined +# in ``item_names``. e.g. the coupled Hamiltonian blocks: +# + +print("The TensorMap containing the Hamiltonian coupled blocks is") +mldata.items.fock_blocks + + +# %% +# Or the overlap matrices: +# + +structure_idx = 0 +k_idx = 0 +print(f"The overlap matrix for structure {structure_idx} at the {k_idx}-th k-point is") +mldata.items.overlap_kspace[structure_idx][k_idx] + + +# %% +# A machine learning model for the electronic Hamiltonian of graphene +# ------------------------------------------------------------------- +# + + +# %% +# Linear model +# ~~~~~~~~~~~~ +# +# In simple cases, such as the present one, it is convenient to start with +# a linear model that directly maps the geometric descriptors to the +# target coupled blocks. This can be achieved using `Ridge regression +# `__ +# as implemented in `scikit-learn `__. +# +# The linear regression model is expressed as +# +# .. math:: +# +# +# H_{ii',\mathbf{Q}}^{\lambda\mu}(\mathbf{t}) = \ +# \sum_\mathbf{q} w_{\mathbf{q}}^{\mathbf{Q},\lambda} \ +# (\rho_{ii'}^{\otimes \nu}(\mathbf{t}))_{\mathbf{q}}^{\lambda\mu}, +# +# where a shorthand notation for the features has been introduced. Here, +# :math:`\mathbf{Q}` includes all labels indicating the involved orbitals, +# atomic species, and permutation symmetry, while :math:`\mathbf{q}` +# represents the feature dimension. The quantities +# :math:`w_{\mathbf{q}}^{\mathbf{Q},\lambda}` are the model’s weights. +# Note that different weights are associated with different values of +# :math:`\mathbf{Q}` and :math:`\lambda`, but not with specific atom pairs +# or the translation vector, whose dependence arises only through the +# descriptors. +# + + +# %% +# In ``mlelec``, a linear model can be trained through the +# ``LitEquivariantModel`` class, which accepts an ``init_from_ridge`` +# keyword. When set to ``True``, this initializes the weights of a more +# general ``torch.nn.Module`` with the weights provided by Ridge +# regression. +# + + +# %% +# We will pass other keyword arguments to ``LitEquivariantModel``, to be +# able to further train the weights on top to the initial Ridge +# regression. +# + +model = LitEquivariantModel( + mldata=mldata, # a MLDataset instance + nlayers=0, # The number of hidden layers + nhidden=1, # The number of neurons in each hidden layer + init_from_ridge=True, # If True, initialize the weights and biases of the + # purely linear model from Ridge regression + optimizer="LBFGS", # Type of optimizer. Adam is likely better for + # a more general neural network + activation="SiLU", # The nonlinear activation function + learning_rate=1e-3, # Initial learning rate (LR) + lr_scheduler_patience=10, + lr_scheduler_factor=0.7, + lr_scheduler_min_lr=1e-6, + loss_fn=MSELoss(), # Use the mean square error as loss function +) + + +# %% +# Model’s accuracy in reproducing derived properties +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +# + + +# %% +# The Hamiltonian coupled blocks predicted by the ML model can be accessed +# from ``model.forward()`` +# + +predicted_blocks = model.forward(mldata.features) + + +# %% +# The real-space blocks can be transformed to Hamiltonian matrices via the +# ``mlelec.utils.pbc_utils.blocks_to_matrix`` function. The resulting +# real-space Hamiltonians can be Fourier transformed to give the +# :math:`k`-space ones. +# + +HT = blocks_to_matrix( + predicted_blocks, + orbitals["sto-3g"], + {A: qmdata.structures[A] for A in range(len(qmdata))}, + detach=True, +) +Hk = qmdata.bloch_sum(HT, is_tensor=True) + + +# %% +# Kohn-Sham eigenvalues +# ''''''''''''''''''''' +# + + +# %% +# We can then compute the eigenvalues on the :math:`k`-grid used for the +# calculation to assess the model accuracy in predicting band energies. +# + +target_eigenvalues = compute_eigenvalues(qmdata.fock_kspace, qmdata.overlap_kspace) +predicted_eigenvalues = compute_eigenvalues(Hk, qmdata.overlap_kspace) + +Hartree = 27.211386024367243 # eV + +plt.rcParams["font.size"] = 14 +fig, ax = plt.subplots() +ax.set_aspect("equal") + +x_text = 0.38 +y_text = 0.2 +d = 0.06 + +for i, (idx, label) in enumerate( + zip( + [mldata.train_idx, mldata.val_idx, mldata.test_idx], + ["train", "validation", "test"], + ) +): + + target = ( + torch.stack([target_eigenvalues[i] for i in idx]).flatten().detach() * Hartree + ) + prediction = ( + torch.stack([predicted_eigenvalues[i] for i in idx]).flatten().detach() + * Hartree + ) + + non_core_states = target > -100 + rmse = np.sqrt( + np.mean( + (target.numpy()[non_core_states] - prediction.numpy()[non_core_states]) ** 2 + ) + ) + ax.scatter(target, prediction, marker=".", label=label, alpha=0.5) + ax.text( + x=x_text, + y=y_text - d * i, + s=rf"$\mathrm{{RMSE_{{{label}}}={rmse:.2f}\,eV}}$", + transform=ax.transAxes, + ) + +xmin, xmax = ax.get_xlim() +ax.plot([xmin, xmax], [xmin, xmax], "--k") +ax.set_xlim(xmin, xmax) +ax.set_ylim(xmin, xmax) +ax.legend() +ax.set_xlabel("Target eigenvalues (eV)") +ax.set_ylabel("Predicted eigenvalues (eV)") + + +# %% +# Graphene band structure +# ''''''''''''''''''''''' +# + + +# %% +# Apart from the eigenvalues on a mesh in the Brillouin zone, we can use +# the real-space Hamiltonians predicted by the model to compute the band +# structure along high-symmetry paths. +# + +fig, ax = plt.subplots(figsize=(8, 4.8)) + +idx = 0 + +handles = [] + +with warnings.catch_warnings(): + warnings.filterwarnings("ignore", category=DeprecationWarning) + + # Plot reference + ax, h_ref = plot_bands_frame( + qmdata.fock_realspace[idx], idx, qmdata, ax=ax, color="blue", lw=2 + ) + + # Plot prediction + ax, h_pred = plot_bands_frame( + HT[idx], idx, qmdata, ax=ax, color="lime", ls="--", lw=2 + ) + +ax.set_ylim(-30, 30) +ax.legend( + [h_ref, h_pred], + ["Reference", "Prediction"], + loc="center left", + bbox_to_anchor=(1, 0.5), +) +fig.tight_layout() + + +# %% +# Adding nonlinearities +# --------------------- +# + + +# %% +# The model used above consists of several submodels, one for each Hamiltonian +# coupled block. Each submodel can be extended to a `multilayer +# perceptron `__ +# (MLP) that maps the corresponding set of geometric features to the +# Hamiltonian coupled block. Nonlinearities are applied to the invariants +# constructed from each equivariant feature block using the +# ``EquivariantNonlinearity`` module. This section outlines the process to +# modify the model to introduce non-linear terms. Given that the time +# to train and evaluate the model would then increase, this section +# includes snippets of code, but is not a complete implementation and +# is not executed when running this example. + + +# %% +# The architecture of ``EquivariantNonlinearity`` can be visualized with +# ``torchviz`` with the following snippet: +# +# .. code:: python +# +# import torch +# from mlelec.models.equivariant_model import EquivariantNonLinearity +# from torchviz import make_dot +# m = EquivariantNonLinearity(torch.nn.SiLU(), layersize = 10) +# y = m.forward(torch.randn(3,3,10)) +# dot = make_dot(y, dict(m.named_parameters())) +# dot.graph_attr.update(size='150,150') +# dot.render("equivariantnonlinear", format="png") +# dot +# + + +# %% +# .. figure:: equivariantnonlinear.png +# :alt: Graph representing the architecture of EquivariantNonLinearity +# :width: 300px +# +# Graph representing the architecture of EquivariantNonLinearity +# + + +# %% +# The global architecture of the MLP, implemented in ``simpleMLP``, can be +# visualized with +# +# .. code:: python +# +# import torch +# from mlelec.models.equivariant_model import simpleMLP +# from torchviz import make_dot +# mlp = simpleMLP( +# nin=10, +# nout=1, +# nhidden=1, +# nlayers=1, +# bias=True, +# activation='SiLU', +# apply_layer_norm=True +# ) +# y = mlp.forward(torch.randn(1,1,10)) +# dot = make_dot(y, dict(mlp.named_parameters())) +# dot.graph_attr.update(size='150,150') +# dot.render("simpleMLP", format="png") +# dot +# + + +# %% +# .. figure:: simpleMLP.png +# :alt: Graph representing the architecture of simpleMLP +# :width: 600px +# +# Graph representing the architecture of simpleMLP +# + + +# %% +# Set up the training loop for stochastic gradient descent +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +# + + +# %% +# Import additional modules needed to monitor the training. +# + + +# %% +# .. code:: python +# +# import lightning.pytorch as pl +# from lightning.pytorch.callbacks import EarlyStopping +# from mlelec.callbacks.logging import LoggingCallback +# from mlelec.models.equivariant_lightning import MLDatasetDataModule +# + + +# %% +# We set up a callback for logging training information such as the +# training and validation losses. +# + + +# %% +# .. code:: python +# +# logger_callback = LoggingCallback(log_every_n_epochs=5) +# + + +# %% +# We set up an early stopping criterion to stop the training when the +# validation loss function stops decreasing. +# + + +# %% +# .. code:: python +# +# early_stopping = EarlyStopping( +# monitor="val_loss", min_delta=1e-3, patience=10, verbose=False, mode="min" +# ) +# + + +# %% +# We define a ``lighting.pytorch.Trainer`` instance to handle the training +# loop. For example, we can further optimize the weights for 50 epochs using +# the `LBFGS `__ +# optimizer. +# +# Note that PyTorch Lightning requires the definition of a data module to +# instantiate DataLoaders to be used during the training. +# + + +# %% +# .. code:: python +# +# data_module = MLDatasetDataModule(mldata, batch_size=16, num_workers=0) +# +# trainer = pl.Trainer( +# max_epochs=50, +# accelerator="cpu", +# check_val_every_n_epoch=10, +# callbacks=[early_stopping, logger_callback], +# logger=False, +# enable_checkpointing=False, +# ) +# +# trainer.fit(model, data_module) +# + + +# %% +# We compute the test set loss to assess the model accuracy on an unseen +# set of structures +# + + +# %% +# .. code:: python +# +# trainer.test(model, data_module) +# + + +# %% +# In this case, Ridge regression already provides good accuracy, so +# further optimizing the weights offers limited improvement. However, for +# more complex datasets, the benefits of additional optimization can be +# significant. +# diff --git a/_downloads/09625016882c3624ff36e3486ce6c8c2/dos-align.zip b/_downloads/09625016882c3624ff36e3486ce6c8c2/dos-align.zip new file mode 100644 index 00000000..0cc89b62 Binary files /dev/null and b/_downloads/09625016882c3624ff36e3486ce6c8c2/dos-align.zip differ diff --git a/_downloads/184bee2944e6bfa0af8580936f246718/thermostats.zip b/_downloads/184bee2944e6bfa0af8580936f246718/thermostats.zip new file mode 100644 index 00000000..eb53c8ab Binary files /dev/null and b/_downloads/184bee2944e6bfa0af8580936f246718/thermostats.zip differ diff --git a/_downloads/2c684432538bab3d8a6f8db14f3827bf/heat-capacity.ipynb b/_downloads/2c684432538bab3d8a6f8db14f3827bf/heat-capacity.ipynb new file mode 100644 index 00000000..d938c757 --- /dev/null +++ b/_downloads/2c684432538bab3d8a6f8db14f3827bf/heat-capacity.ipynb @@ -0,0 +1,208 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "\n# Quantum heat capacity of water\n\n:Authors:\n Filippo Bigi [@frostedoyster](https://github.com/frostedoyster/);\n Michele Ceriotti [@ceriottm](https://github.com/ceriottm/)\n\nThis example shows how to estimate the heat capacity of liquid water\nfrom a path integral molecular dynamics simulation. The dynamics are\nrun with [i-PI](http://ipi-code.org), and\n[LAMMPS](http://lammps.org) is used\nas the driver to simulate the [q-TIP4P/f water\nmodel](http://doi.org/10.1063/1.3167790).\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "import os\nimport subprocess\nimport time\nimport xml.etree.ElementTree as ET\n\nimport ipi\nimport matplotlib.pyplot as plt\nimport numpy as np" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## A non-trivial energy estimator\n\nAs introduced in the\n[path-integrals example](http://lab-cosmo.github.io/atomistic-cookbook/latest/examples/path-integrals),\npath-integral estimators\nfor observables that depend on momenta are generally not trivial to compute.\n\nIn this example, we will focus on the constant-volume heat capacity,\n$c_V$, which is one such\nobservable, and we will calculate it for liquid water at room temperature.\nBecause of the presence of high-frequency vibrations, many of the nuclear\ndegrees of freedom are trapped in the vibrational ground state, which reduces\nsubstantially the heat capacity from the value that would be obtained\nin the classical limit. See [this review](http://doi.org/10.1021/acs.chemrev.5b00674)\nfor an overview of the impact of quantum nuclei on the properties of water.\nFrom a computational perspective, this means that it is necessary to use\nspecialized simulations and estimators to evaluate the correct value.\n\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Running the PIMD calculation\n\nThis follows the same steps as the ``path-integrals`` example. One important\ndifference is that we will request the ``scaledcoords`` output to the relevant\nsection of the ``i-PI`` input XML file, which\ncontains estimators that can be used to calculate the total energy and\nheat capacity as following\n[Yamamoto, J. Chem. Phys. (2005)](https://arxiv.org/abs/physics/0505109).\n\nThe input file is shown below. It should be noted that ``scaledcoords``\nis given a finite differences displacement as a parameter. This is necessary\nas the estimators require higher order derivatives of the potential energy,\nwhich are calculated using finite differences. This also means that\nevaluating the estimator adds substantial overhead (so it is wise to only\ncompute it every few simulation steps, to eliminate correlations between\nsnapshots) and that one should be careful to use well-converged simulation\nparameters to avoid discontinuities and noise (for instance, we increase\nthe accuracy of the particle-mesh electrostatic calculation, and use a\nshifted Lennard-Jones potential to avoid a discontinuity at the cutoff).\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "# Open and show the relevant part of the input\nxmlroot = ET.parse(\"data/input.xml\").getroot()\nprint(\" \" + ET.tostring(xmlroot.find(\".//properties\"), encoding=\"unicode\"))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We launch the i-PI and LAMMPS processes, exactly as in the\n``path-integrals`` example.\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "# don't rerun if the outputs already exist\nipi_process = None\nif not os.path.exists(\"water-cv.out\"):\n ipi_process = subprocess.Popen([\"i-pi\", \"data/input.xml\"])\n time.sleep(2) # wait for i-PI to start\n lmp_process = [subprocess.Popen([\"lmp\", \"-in\", \"data/in.lmp\"]) for i in range(2)]" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Skip this cell if you want to run in the background\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "if ipi_process is not None:\n ipi_process.wait()\n lmp_process[0].wait()\n lmp_process[1].wait()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Analyzing the results\nLet's plot the potential and conserved energy as a function of time,\njust to check that the simulation ran sensibly.\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "output_data, output_desc = ipi.read_output(\"water-cv.out\")\nfix, ax = plt.subplots(1, 1, figsize=(4, 3), constrained_layout=True)\nax.plot(\n output_data[\"time\"],\n output_data[\"potential\"] - output_data[\"potential\"][0],\n \"b-\",\n label=\"Potential, $V$\",\n)\nax.plot(\n output_data[\"time\"],\n output_data[\"conserved\"] - output_data[\"conserved\"][0],\n \"r-\",\n label=\"Conserved, $H$\",\n)\nax.set_xlabel(r\"$t$ / ps\")\nax.set_ylabel(r\"energy / a.u.\")\nax.legend()\nplt.show()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "As described in the [i-PI documentation](https://ipi-code.org/i-pi/output-tags.html),\nthe two quantities returned by the ``scaledcoords`` output are ``eps_v``\nand ``eps_v'``, defined in the aforementioned\n[paper](https://arxiv.org/abs/physics/0505109).\n\nThese estimators ($\\epsilon_v$ and $\\epsilon_v'$) are derived in the\n\"scaled coordinates\" formalism, which is a useful trick to avoid the\ngrowth of the error in the instantaneous values of the estimators with\nthe number of beads used in the path integral simulation.\n\nThe same paper contains the formulas to calculate the total energy and\nheat capacity from these estimators:\n\n\\begin{align}E = \\langle \\epsilon_v \\rangle \\quad\n C_V = k_B \\beta^2 \\left( \\langle \\epsilon_v^2 \\rangle - \\langle\n \\epsilon_v \\rangle^2 - \\langle \\epsilon_v' \\rangle \\right)\\end{align}\n\nFirst the energy, whose estimator will be compared to the total energy\ncalculated as the sum of the potential and kinetic energy estimators.\nSince the kinetic energy is itself calculated from a scaled-coordinates\nestimator (the \"centroid virial\" estimator), the two total energies are\nthe same.\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "eps_v = output_data[\"scaledcoords(fd_delta=5e-3)\"][:, 0]\neps_v_prime = output_data[\"scaledcoords(fd_delta=5e-3)\"][:, 1]\n\nenergy_estimator = eps_v # first formula\n\nfix, ax = plt.subplots(1, 1, figsize=(4, 3), constrained_layout=True)\nax.plot(\n output_data[\"time\"],\n energy_estimator - energy_estimator[0],\n \"b-\",\n label=\"scaled coordinates estimator\",\n)\nax.plot(\n output_data[\"time\"][:],\n (\n output_data[\"potential\"]\n - output_data[\"potential\"][0]\n + output_data[\"kinetic_cv\"]\n - output_data[\"kinetic_cv\"][0]\n ),\n \"r.\",\n label=\"potential + virial kinetic\",\n)\nax.set_xlabel(r\"$t$ / ps\")\nax.set_ylabel(r\"total energy / a.u.\")\nax.legend()\nplt.show()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "And, finally, the heat capacity. Note that normally the simulation\nrequires a few ps for equilibration. Here we discard a few dozen steps\nto eliminate the initial jump, which is due to the relaxation of the\nring polymers starting from a single atomic configuration.\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "# i-PI scaledcoords outputs are in atomic units (see docs)\nkB = 3.16681e-6 # Boltzmann constant in atomic units\nT = 298.0 # temperature in K, as defined in the input file\nbeta = 1.0 / (kB * T)\n\nskip = 20\nheat_capacity = ( # second formula\n kB\n * (beta**2)\n * (\n np.mean(eps_v[skip:] ** 2)\n - np.mean(eps_v[skip:]) ** 2\n - np.mean(eps_v_prime[skip:])\n )\n)\nheat_capacity_per_molecule = heat_capacity / 32 # 32 molecules in the simulation\nprint(f\"Heat capacity (per water molecule): {(heat_capacity_per_molecule/kB):.2f} kB\")" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "You may recognize that the first part of the estimator is reminiscent\nof the classical estimator for the heat capacity as the fluctuations of the\n(quantum) total energy, which in this case however requires a correction given\nby the mean of the second part of the scaled-coordinates estimator.\n\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Estimating the statistical error\n\nEspecially with such an underconverged simulation, it is important to\nestimate the statistical error in the heat capacity.\n\nGenerally, errors on measurements are computed\nas \"standard errors\", i.e. the standard deviation of a series of data points\ndivided by the square root of the number of data points. In our case,\nhowever, this is made more complicated by the correlation between\nclose steps in the molecular dynamics trajectory, which would lead to an\noverestimation of the number of independent samples. To fix this, we can\ncalculate the autocorrelation time of the estimators whose errors we\nwant to estimate, and apply a correction factor to the number of samples.\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "def autocorrelate(x):\n n = len(x)\n xo = x - x.mean() # remove mean\n acov = (np.correlate(xo, xo, \"full\"))[n - 1 :]\n return acov[: len(acov) // 2]\n\n\ndef autocorrelation_time(x):\n acov = autocorrelate(x)\n return 1.0 + np.sum(acov) / acov[0]" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Using these helper functions, we can now calculate the error on the various\nparts of the heat capacity estimator. Note also the autocorrelation times, that\nare just a little larger than one, indicating that the stride used to print out\nthe estimators is appropriate (as there is little correlation between the samples).\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "# Autocorrelation times (i.e. number of steps needed to have independent samples)\nautocorr_time_error_delta_eps_v = autocorrelation_time(\n (eps_v[skip:] - eps_v[skip:].mean()) ** 2\n)\nautocorr_time_error_eps_v_prime = autocorrelation_time(eps_v_prime[skip:])\n\nprint(\n f\"\"\"\nAutocorrelation times (in number of samples):\n(eps-)^2: {autocorr_time_error_delta_eps_v:.2f}\neps': {autocorr_time_error_eps_v_prime:.2f}\n\"\"\"\n)\n\n# Effective number of samples\neffective_samples_delta_eps_v = len(eps_v[skip:]) / autocorr_time_error_delta_eps_v\neffective_samples_eps_v_prime = len(eps_v[skip:]) / autocorr_time_error_eps_v_prime\n\n# Standard errors using the effective number of samples\nerror_delta_eps_v = np.std((eps_v[skip:] - eps_v[skip:].mean()) ** 2) / np.sqrt(\n effective_samples_delta_eps_v\n)\nerror_eps_v_prime = np.std(eps_v_prime[skip:]) / np.sqrt(effective_samples_eps_v_prime)\n\n# Error on the heat capacity (assuming quadrature sum)\nerror_heat_capacity = (\n kB * (beta**2) * np.sqrt(error_delta_eps_v**2 + error_eps_v_prime**2)\n)\n\nerror_heat_capacity_per_molecule = (\n error_heat_capacity / 32\n) # 32 molecules in the simulation\n\nprint(\n \"Error on the heat capacity (per water molecule): \"\n f\"{(error_heat_capacity_per_molecule/kB):.2f} kB\"\n)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The obtained heat capacity is consistent with the values from the literature\n(see e.g. [Ceriotti et al., J. Chem. Phys. (2011)](http://doi.org/10.1063/1.3556661)\nwhere the convergence of the heat capacity with number of beads is shown for the same\nwater model used in this example).\nHowever, the error is quite large, which is expected given the short simulation time.\nTo reduce the error, one would need to run a longer simulation. Other important error\nsources, which are not accounted for in the error estimate, are the finite size of the\nsystem and number of beads. Both of these are too small in this example to give\nreliable results.\n\nIn a realistic simulation, up to a few 100s of picoseconds might be needed to reduce\nthe sampling error to a small value (1-2% of the heat capacity). For water at room\ntemperature, you will need 32 beads at the very least (8 were used in this example).\nIt is more difficult to give a general rule for the system size: (quantum) energy\nfluctuations are usually localized, but to guarantee accurate sampling of the\nliquid structure, a few hundred water molecules would be a reasonable guess\n(32 were used in this example).\n\n" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.11.10" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} \ No newline at end of file diff --git a/_downloads/3237a57d8246eaec10a69b4e251f623d/environment.yml b/_downloads/3237a57d8246eaec10a69b4e251f623d/environment.yml new file mode 100644 index 00000000..fafbc008 --- /dev/null +++ b/_downloads/3237a57d8246eaec10a69b4e251f623d/environment.yml @@ -0,0 +1,8 @@ +channels: + - conda-forge +dependencies: + - python=3.11 + - pip + - pip: + - ase + - matplotlib diff --git a/_downloads/328f2a3eeccb4e902f81e5646c33e2e8/environment.yml b/_downloads/328f2a3eeccb4e902f81e5646c33e2e8/environment.yml new file mode 100644 index 00000000..b436b4a5 --- /dev/null +++ b/_downloads/328f2a3eeccb4e902f81e5646c33e2e8/environment.yml @@ -0,0 +1,14 @@ +channels: + - conda-forge +dependencies: + - python=3.11 + - pip + - rust >=1.65 + - pip: + - ase==3.22.1 + - chemiscope>=0.7 + - matplotlib + - metatensor + - rascaline @ git+https://github.com/Luthaf/rascaline@ca957642f512e141c7570e987aadc05c7ac71983 + - skmatter + - equisolve @ git+https://github.com/lab-cosmo/equisolve.git@c858bedef4b2799eb445e4c92535ee387224089a diff --git a/_downloads/360e0a4751205a155ce4949942081de0/pi-metad.ipynb b/_downloads/360e0a4751205a155ce4949942081de0/pi-metad.ipynb new file mode 100644 index 00000000..96464d3d --- /dev/null +++ b/_downloads/360e0a4751205a155ce4949942081de0/pi-metad.ipynb @@ -0,0 +1,589 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "\n# Path integral metadynamics\n\n:Authors: Michele Ceriotti [@ceriottm](https://github.com/ceriottm/)\n\nThis example shows how to run a free-energy sampling calculation that\ncombines path integral molecular dynamics to model nuclear quantum effects\nand metadynamics to accelerate sampling of the high-free-energy regions.\n\nThe rather complicated setup combines [i-PI](http://ipi-code.org)\nto perform path integral\nMD, its built-in driver to compute energy and forces for the Zundel\n$\\mathrm{H_5O_2^+}$ cation, and [PLUMED](http://plumed.org/)\nto perform metadynamics.\nIf you want to see an example in a more realistic scenario, you can look at\n[this paper (Rossi et al., JCTC (2020))](http://doi.org/10.1021/acs.jctc.0c00362),\nin which this\nmethodology is used to simulate the decomposition of methanesulphonic\nacid in a solution of phenol and hydrogen peroxide.\n\nNote also that, in order to keep the execution time of this example as\nlow as possible, several parameters are set to values that would not be\nsuitable for an accurate, converged simulation.\nThey will be highlighted and more reasonable values will be provided.\n\"High-quality\" runs can also be realized substituting the input files\nused in this example with those labeled with the ``_hiq`` suffix, that\nare also provided in the ``data/`` folder.\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "import bz2\nimport os\nimport subprocess\nimport time\nimport xml.etree.ElementTree as ET\n\nimport ase\nimport ase.io\nimport chemiscope\nimport ipi\nimport matplotlib.pyplot as plt\nimport numpy as np" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Metadynamics for the Zundel cation\n\nMetadynamics is a method to accelerate sampling of rare events - microscopic processes\nthat are too infrequent to be observed over the time scale (ns-\u00b5s) accessible to\nmolecular dynamics simulations. You can read one of the many excellent reviews\non metadynamics (see e.g.\n[Bussi and Branduardi (2015)](https://doi.org/10.1002/9781118889886.ch1)),\nor follow a\n[lecture from the PLUMED masterclass](https://www.plumed-tutorials.org/lessons/21/004/data/NAVIGATION.html).\nIn short, during a metadynamics simulation an adaptive biasing potential is\nbuilt as a superimposition of Gaussians centered over configurations that have\nbeen previously visited by the trajectory. This discourages the system from remaining\nin high-probability configurations and accelerates sampling of free-energy barriers.\n\n.. figure:: metad-scheme.png\n :align: center\n :width: 600px\n\n A schematic representation of how metadynamics work by adaptively building\n a repulsive bias based on the trajectory of a molecule, compensating for\n low-energy regions in the free energy surface.\n\nCrucially, the bias is *not* built relative to the Cartesian coordinates of the atoms,\nbut relative to a lower-dimensional description of the system (so-called collective\nvariables) that are suited to describe the processes being studied.\n\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The Zundel cation $\\mathrm{H_5O_2^+}$ is one of the limiting\nstructures of the solvated proton, and in the gas phase leads to a\nstable structure, with the additional proton shared between two water\nmolecules (see the structure below).\nWe will use a potential fitted on high-end quantum-chemistry calculations\n[Huang et al. (2005)](http://doi.org/10.1063/1.1834500) to compute energy\nand forces acting on the atoms.\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "zundel = ase.io.read(\"data/h5o2+.xyz\", \":\")\nchemiscope.show(frames=zundel, mode=\"structure\")" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "As the two water molecules are separated, the proton remains attached\nto one of the two, effectively leading to a dissociated\n$\\mathrm{H_2O+H_3O^+}$ configuration. Thus, two natural\ncoordinates to describe the physics of this system are the distance\nbetween the O atoms, and the difference in coordination number of\nthe two O atoms, which is 0 for a shared proton and \u00b11 for the\ndissociated system.\n\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Running metadynamics calculations with ``i-PI`` and ``PLUMED``\n\nThe client-server architecture [i-PI](http://ipi-code.org) is based on makes it easy\nto combine multiple programs to realize complicated simulation workflows.\nIn this case we will use an implementation of the Zundel potential in a simple\ndriver code that is available in the i-PI repository, and use\n[PLUMED](http://plumed.org/) to compute collective variables and build\nthe adaptive bias. We will then perform some post-processing to\nestimate the free energy.\n\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Installing the Python driver\n\ni-PI comes with a FORTRAN driver, which however has to be installed\nfrom source. We use a utility function to compile it. Note that this requires\na functioning build system with `gfortran` and `make`.\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "ipi.install_driver()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Defining the molecular dynamics setup\nThe `input-md.xml` file defines the way the MD simulation is performed.\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "xmlroot = ET.parse(\"data/input-md.xml\").getroot()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The `` block describe the way communication will occur with the\ndriver code\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "print(\" \" + ET.tostring(xmlroot.find(\"ffsocket\"), encoding=\"unicode\"))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "... and the `` section describes the MD setup.\nThis is a relatively standard NVT setup, with an efficient\ngeneralized Langevin equation thermostat (important to\ncompensate for the non-equilibrium nature of metadynamics).\nNote that the time step is rather long (the recommended value for\naqueous systems is around 0.5 fs). This is done to improve\nefficiency for this example, but you should check if it\naffects results in a realistic scenario.\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "print(\" \" + ET.tostring(xmlroot.find(\".//motion\"), encoding=\"unicode\"))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The metadynamics setup requires three ingredients:\na `` forcefield that defines what input to use\n(more on that later) and the file from which to initialize\nthe structural information (number of atoms, ...);\n`` is an advanced feature, available from\nPLUMED 2.10, that allows extracting internal variables\nfrom plumed and integrate them into the outputs of\ni-PI.\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "print(\" \" + ET.tostring(xmlroot.find(\"ffplumed\"), encoding=\"unicode\"))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The `` section contains a `` key that\nspecifies that energy and forces from PLUMED should be\ntreated as a bias (so that e.g. are not included in the\npotential, even though they're used to propagate the\ntrajectory).\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "print(\" \" + ET.tostring(xmlroot.find(\".//ensemble\"), encoding=\"unicode\"))\n\n# The `` section contains a `` class that\n# instructs i-PI to call the PLUMED action that adds hills\n# along the trajectory.\n\nprint(\" \" + ET.tostring(xmlroot.find(\"smotion\"), encoding=\"unicode\"))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### CVs and metadynamics\n\nThe calculation of the collective variables and the\nmetadynamics bias is delegated to PLUMED, and controlled by\na separate `plumed-md.dat` input file.\nWithout going in detail into the syntax, one can recognize the\ncalculation of the distance between the O atoms `doo`,\nthe coordination of the two oxygens `co1` and `co2`,\nand the difference between the two, `dc`.\nThe `METAD` action specifies the CVs to be used, the pace of\nhill depositon (which is way too frequent here, but suitable for\nthis example), the width along the two CVs and the initial\nheight of the repulsive Gaussians (which are both too large to\nguarantee high resolution in CV and energy). The `BIASFACTOR` keyword specifies\nthat the height of the hills will be progressively reduced\naccording to the \"well-tempered metadynamics\" protocol, see\n[Barducci et al., Phys. Rev. Lett. (2008)](http://doi.org/10.1103/PhysRevLett.100.020603).\nA repulsive static bias (`UPPER_WALLS`) prevents complete dissociation of the\ncation by limiting the range of the O-O distance.\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "with open(\"data/plumed-md.dat\", \"r\") as file:\n plumed_dat = file.read()\nprint(plumed_dat)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Running the simulations\n\nNow we can launch the actual calculations. On the the command line,\nthis requires launching i-PI first, and then the built-in driver,\nspecifying the appropriate communication mode, and the `zundel` potential.\nPLUMED is called from within i-PI as a library, so there is no need to\nlaunch a separate process. Note that the Zundel potential requires some data\nfiles, with a hard-coded location in the current working directory,\nwhich is why the driver should be run from within the ``data/`` folder.\n\n```bash\ni-pi data/input-md.xml > log &\nsleep 2\ncd data; i-pi-driver -u -a zundel -m zundel\n```\nThe same can be achieved from Python using ``subprocess.Popen``\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "ipi_process = None\nif not os.path.exists(\"meta-md.out\"):\n # don't rerun if the outputs already exist\n ipi_process = subprocess.Popen([\"i-pi\", \"data/input-md.xml\"])\n time.sleep(2) # wait for i-PI to start\n driver_process = [\n subprocess.Popen(\n [\"i-pi-driver\", \"-u\", \"-a\", \"zundel\", \"-m\", \"zundel\"], cwd=\"data/\"\n )\n for i in range(1)\n ]" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "If you run this in a notebook, you can go ahead and start loading\noutput files *before* i-PI has finished running by skipping this cell\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "# wait for simulations to finish\nif ipi_process is not None:\n ipi_process.wait()\n for process in driver_process:\n process.wait()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Trajectory post-processing\n\nWe can now post-process the simulation to see metadynamics in action.\n\nFirst, we read the trajectory outputs. Note that these have all been\nprinted with the same stride\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "output_data, output_desc = ipi.read_output(\"meta-md.out\")\ncolvar_data = ipi.read_trajectory(\"meta-md.colvar_0\", format=\"extras\")[\n \"doo,dc,mtd.bias\"\n]\ntraj_data = ipi.read_trajectory(\"meta-md.pos_0.xyz\")" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "then, assemble a visualization\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "chemiscope.show(\n frames=traj_data,\n properties=dict(\n d_OO=10 * colvar_data[:, 0], # nm to \u00c5\n delta_coord=colvar_data[:, 1],\n bias=27.211386 * output_data[\"ensemble_bias\"], # Ha to eV\n time=2.4188843e-05 * output_data[\"time\"], # atomictime to ps\n ), # attime to ps\n settings=chemiscope.quick_settings(\n x=\"d_OO\", y=\"delta_coord\", z=\"bias\", color=\"time\", trajectory=True\n ),\n mode=\"default\",\n)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The visualization above shows how the growing metadynamics bias pushes\nprogressively the atoms towards geometries with larger O-O separations,\nand that for these distorted configurations the proton is not shared\nsymmetrically between the O atoms, but is preferentially attached to\none of the two water molecules.\n\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### Trajectory diagnostics\n\nThe time history of the bias is instructive, as it shows how the\nbias grows until the trajectory gets pushed in a new region (where the\nbias is zero) and then grows again. The envelope of the bias increase\nslows down over time, because the \"well-tempered\" deposition strategy\nreduces the height of the hills deposited in high-bias regions.\n\nNote that the potential energy has fluctuations that are larger than\nthe magnitude of the bias, although it shows a tendency to reach higher\nvalues as the simulation progresses. This is because only two degrees\nof freedom are affected by the bias, while all degrees of freedom\nundergo thermal fluctuations, which are dominant even for this\nsmall system.\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "fig, ax = plt.subplots(1, 1, figsize=(4, 3), constrained_layout=True)\n\nax.plot(\n 2.4188843e-05 * output_data[\"time\"],\n 27.211386 * output_data[\"potential\"],\n \"r\",\n label=\"potential\",\n)\nax.plot(\n 2.4188843e-05 * output_data[\"time\"],\n 27.211386 * output_data[\"ensemble_bias\"],\n \"b\",\n label=\"bias\",\n)\n\nax.set_xlabel(r\"$t$ / ps\")\nax.set_ylabel(r\"energy / eV\")\nax.legend(loc=\"upper left\", ncols=1)\nplt.show()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "It's important to keep in mind that the growing metadynamics bias can\nlead to deviations from the quasi-equilibrium sampling that is necessary\nto recover the correct properties of the rare event. It is not easy\nto verify this condition, but one simple diagnostics that can highlight\nthe most evident problems is looking at the kinetic temperature of different\nportions of the system, computing a moving average to have a clearer signal.\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "def moving_average(arr, window_size):\n # Create a window of the specified size with equal weights\n window = np.ones(window_size) / window_size\n # Use the 'valid' mode to only return elements where the window fully\n # overlaps with the data\n return np.convolve(arr, window, mode=\"valid\")\n\n\nfig, ax = plt.subplots(1, 1, figsize=(4, 3), constrained_layout=True)\n\nax.plot(\n 2.4188843e-05 * output_data[\"time\"][50:-49],\n moving_average(output_data[\"temperature(O)\"], 100),\n \"r\",\n label=r\"$T_\\mathrm{O}$\",\n)\nax.plot(\n 2.4188843e-05 * output_data[\"time\"][50:-49],\n moving_average(output_data[\"temperature(H)\"], 100),\n \"gray\",\n label=r\"$T_\\mathrm{H}$\",\n)\nax.plot(\n 2.4188843e-05 * output_data[\"time\"][50:-49],\n moving_average(output_data[\"temperature\"], 100),\n \"b\",\n label=\"T\",\n)\n\nax.set_xlabel(r\"$t$ / ps\")\nax.set_ylabel(r\"temperature / K\")\nax.legend(loc=\"upper left\", ncols=2)\nplt.show()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "It is clear that the very high rate of biasing used in this demonstrative\nexample leads to a temperature that is consistently higher than the target,\nwith spikes up to 380 K and O and H atoms reaching different temperatures\n(i.e. equipartition is broken). While this does not affect the qualitative\nnature of the results, these parameters are unsuitable for a production run.\nNB: especially for small systems, the instantaneous kinetic temperature\ncan deviate by a large amount from the target temperature: only the mean\nvalue has actual meaning. However, a kinetic temperature that is consistently\nabove the target value indicates that the thermostat cannot dissipate\nefficiently the energy due to the growing bias.\n\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### Free energy profiles\n\nOne of the advantages of metadynamics is that it allows one to easily\nestimate the free-energy associated with the collective variables\nthat are used to accelerate sampling by summing the repulsive hills\nthat have been deposited during the run and taking the negative of\nthe total bias at the end of the trajectory.\n\nEven though more sophisticated strategies exist that provide explicit\nweighting factors to estimate the unbiased Boltzmann distribution\n(see e.g.\n[Giberti et al., JCTC 2020](http://doi.org/10.1021/acs.jctc.9b00907)),\nthis simple approach is good enough for this example, and can be\nrealized as a post-processing step using the ``plumed sum_hills`` module,\nthat also applies a (simple) correction to the negative bias that\nis needed when using the well-tempered bias scaling protocol.\nOn the command line,\n\n```bash\nplumed sum_hills --hills HILLS-md --min 0.21,-1 --max 0.31,1 --bin 100,100 \\\n --outfile FES-md --stride 100 --mintozero < data/plumed-md.dat\n```\nThe ``--stride`` option generates a series of files showing the estimates\nof $F$ at different times along the trajectory.\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "with open(\"data/plumed-md.dat\", \"r\") as file:\n subprocess.run(\n [\n \"plumed\",\n \"sum_hills\",\n \"--hills\",\n \"HILLS-md\",\n \"--min\",\n \"0.21,-1\",\n \"--max\",\n \"0.31,1\",\n \"--bin\",\n \"100,100\",\n \"--outfile\",\n \"FES-md\",\n \"--stride\",\n \"100\",\n \"--mintozero\",\n ],\n stdin=file,\n text=True,\n )\n\n# rearrange data and converts to \u00c5 and eV\ndata = np.loadtxt(\"FES-md0.dat\", comments=\"#\")[:, :3]\nxyz_0 = np.array([10, 1, 0.01036427])[:, np.newaxis, np.newaxis] * data.T.reshape(\n 3, 101, 101\n)\ndata = np.loadtxt(\"FES-md2.dat\", comments=\"#\")[:, :3]\nxyz_2 = np.array([10, 1, 0.01036427])[:, np.newaxis, np.newaxis] * data.T.reshape(\n 3, 101, 101\n)\ndata = np.loadtxt(\"FES-md5.dat\", comments=\"#\")[:, :3]\nxyz_5 = np.array([10, 1, 0.01036427])[:, np.newaxis, np.newaxis] * data.T.reshape(\n 3, 101, 101\n)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The plots show, left-to-right, the accumulation of the\nmetadynamics bias as simulation progresses.\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "fig, ax = plt.subplots(\n 1, 3, figsize=(8, 3), sharex=True, sharey=True, constrained_layout=True\n)\n\ncf_0 = ax[0].contourf(*xyz_0)\ncf_1 = ax[1].contourf(*xyz_2)\ncf_2 = ax[2].contourf(*xyz_5)\nfig.colorbar(cf_2, ax=ax, orientation=\"vertical\", label=r\"$F$ / eV\")\nax[0].set_ylabel(r\"$\\Delta C_\\mathrm{H}$\")\nax[0].set_xlabel(r\"$d_\\mathrm{OO}$ / \u00c5\")\nax[1].set_xlabel(r\"$d_\\mathrm{OO}$ / \u00c5\")\nax[2].set_xlabel(r\"$d_\\mathrm{OO}$ / \u00c5\")\nax[0].set_title(r\"$t=0.8$ ps\")\nax[1].set_title(r\"$t=2.5$ ps\")\nax[2].set_title(r\"$t=5.0$ ps\")\nplt.show()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Biasing a path integral calculation\n\nYou can see [this recipe](http://lab-cosmo.github.io/atomistic-cookbook/examples/latest/path-integrals)\nfor a brief introduction to path integral simulations with `i-PI`.\nFrom a practical perspective, very little needs to change with respect\nto the classical case.\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "xmlroot = ET.parse(\"data/input-pimd.xml\").getroot()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The `nbeads` option determines the number of path integral\nreplicas. The value of 8 used here is not sufficient to converge\nquantum statistics at 300 K (a more typical value would be\naround 32). There are methods to reduce the number of replicas\nneeded for convergence, see e.g.\n[Ceriotti and Markland, Nat. Rev. Chem. (2018)](http://doi.org/10.1038/s41570-017-0109)\nbut we keep it simple here.\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "print(\" \" + ET.tostring(xmlroot.find(\".//initialize\"), encoding=\"unicode\")[:23])" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Centroid bias\n\nAnother detail worth discussing is that the metadynamics bias\nis computed exclusively on the *centroid*, the mean position of\nthe ring-polymer beads. This is an extreme form of\nring polymer contraction\n[(Markland and Manolopoulos, J. Chem. Phys. (2008)](http://doi.org/10.1063/1.2953308)\nthat avoids computing for each replica the slowly-varying\nparts of the potential, but is not applied for computational\nsavings. When performing a quantum free-energy calculation it\nis important to distinguish between the free-energy computed\nas the logarithm of the probability of observing a given\nconfiguration (that depends on the distribution of the\nreplicas) and the free-energy taken as a tool to estimate\nreaction rates $k$ in a transition-state theory\nfashion $k\\propto e^{-\\Delta E^\\ddagger/kT}$,\nwhere the energy barrier $\\Delta E^\\ddagger$\nis better estimated from the distribution of the centroid.\nSee e.g.\n[Habershon et al., Annu. Rev. Phys. Chem. (2013)](http://doi.org/10.1146/annurev-physchem-040412-110122)\nfor a discussion of the subtleties involved in estimating\ntransition rates.\nIn practice, performing this contraction step is very easy\nin `i-PI`, because for each `` section - including\nthat corresponding to the bias - it is possible to specify\na different number of replicas. The configurations will\nbe automatically computed by Fourier interpolation.\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "print(\" \" + ET.tostring(xmlroot.find(\".//bias\"), encoding=\"unicode\"))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Running the calculation\n\nThe other changes are purely cosmetic, and the calculation\ncan be launched very easily, using several drivers to parallelize\nthe energy evaluation over the beads (although this kind of calculations\nis not limited by the evaluation of the forces).\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "# don't rerun if the outputs already exist\nipi_process = None\nif not os.path.exists(\"meta-pimd.out\"):\n ipi_process = subprocess.Popen([\"i-pi\", \"data/input-pimd.xml\"])\n time.sleep(2) # wait for i-PI to start\n driver_process = [\n subprocess.Popen(\n [\"i-pi-driver\", \"-u\", \"-a\", \"zundel\", \"-m\", \"zundel\"], cwd=\"data/\"\n )\n for i in range(4)\n ]" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "If you run this in a notebook, you can go ahead and start loading\noutput files _before_ i-PI has finished running by skipping this cell\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "# wait for simulations to finish\nif ipi_process is not None:\n ipi_process.wait()\n for process in driver_process:\n process.wait()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Analysis of the simulation\n\nA path integral simulation evolves multiple configurations at the same\ntime, forming a `ring polymer`. Each replica provides a sample of the\nquantum mechanical configuration distribution of the atoms. To provide\nan overall visualization of the path integral dynamics, we load all the\nreplicas and combine them using a utility function from the\n`chemiscope` library.`\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "output_data, output_desc = ipi.read_output(\"meta-pimd.out\")\ncolvar_data = ipi.read_trajectory(\"meta-pimd.colvar_0\", format=\"extras\")[\n \"doo,dc,mtd.bias\"\n]\npimd_traj_data = [ipi.read_trajectory(f\"meta-pimd.pos_{i}.xyz\") for i in range(8)]\n\n# combines the PI beads and sets up the visualization options\ntraj_pimd = chemiscope.ase_merge_pi_frames(pimd_traj_data)\ntraj_pimd[\"shapes\"][\"paths\"][\"parameters\"][\"global\"][\"radius\"] = 0.05\ntraj_pimd[\"properties\"] = dict(\n d_OO=10 * colvar_data[:, 0], # nm to \u00c5\n delta_coord=colvar_data[:, 1],\n bias=27.211386 * output_data[\"ensemble_bias\"], # Ha to eV\n time=2.4188843e-05 * output_data[\"time\"],\n)\ntraj_pimd[\"settings\"] = chemiscope.quick_settings(\n x=\"d_OO\",\n y=\"delta_coord\",\n z=\"bias\",\n color=\"time\",\n trajectory=True,\n structure_settings=dict(\n bonds=False,\n atoms=False,\n keepOrientation=True,\n unitCell=False,\n shape=[\n \"paths\",\n ],\n ),\n)\ntraj_pimd[\"settings\"][\"target\"] = \"structure\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Visualize the trajectory. Note the similar behavior as for the classical\ntrajectory, and the delocalization of the protons\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "chemiscope.show(**traj_pimd)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Free energy plots\n\nThe free energy profiles relative to $\\Delta C_\\mathrm{H}$\nand $d_\\mathrm{OO}$ can be computed exactly as for the\nclassical trajectory, using the `sum_hills` module.\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "with open(\"data/plumed-pimd.dat\", \"r\") as file:\n subprocess.run(\n [\n \"plumed\",\n \"sum_hills\",\n \"--hills\",\n \"HILLS-pimd\",\n \"--min\",\n \"0.21,-1\",\n \"--max\",\n \"0.31,1\",\n \"--bin\",\n \"100,100\",\n \"--outfile\",\n \"FES-pimd\",\n \"--stride\",\n \"100\",\n \"--mintozero\",\n ],\n stdin=file,\n text=True,\n )\n\n# rearrange data and converts to \u00c5 and eV\ndata = np.loadtxt(\"FES-pimd0.dat\", comments=\"#\")[:, :3]\nxyz_pi_0 = np.array([10, 1, 0.01036427])[:, np.newaxis, np.newaxis] * data.T.reshape(\n 3, 101, 101\n)\ndata = np.loadtxt(\"FES-pimd2.dat\", comments=\"#\")[:, :3]\nxyz_pi_2 = np.array([10, 1, 0.01036427])[:, np.newaxis, np.newaxis] * data.T.reshape(\n 3, 101, 101\n)\ndata = np.loadtxt(\"FES-pimd5.dat\", comments=\"#\")[:, :3]\nxyz_pi_5 = np.array([10, 1, 0.01036427])[:, np.newaxis, np.newaxis] * data.T.reshape(\n 3, 101, 101\n)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Just as for a classical run, the metadynamics bias progressively\npushes the centroid (and the beads that are distributed around it)\nto sample a wider portion of the collective-variable space.\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "fig, ax = plt.subplots(\n 1, 3, figsize=(8, 3), sharex=True, sharey=True, constrained_layout=True\n)\n\ncf_0 = ax[0].contourf(*xyz_pi_0)\ncf_1 = ax[1].contourf(*xyz_pi_2)\ncf_2 = ax[2].contourf(*xyz_pi_5)\nfig.colorbar(cf_2, ax=ax, orientation=\"vertical\", label=r\"$F$ / eV\")\nax[0].set_ylabel(r\"$\\Delta C_\\mathrm{H}$\")\nax[0].set_xlabel(r\"$d_\\mathrm{OO}$ / \u00c5\")\nax[1].set_xlabel(r\"$d_\\mathrm{OO}$ / \u00c5\")\nax[2].set_xlabel(r\"$d_\\mathrm{OO}$ / \u00c5\")\nax[0].set_title(r\"$t=0.8$ ps\")\nax[1].set_title(r\"$t=2.5$ ps\")\nax[2].set_title(r\"$t=5.0$ ps\")\nplt.show()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Assessing quantum nuclear effects\n\nThe effect of nuclear quantization on the centroid free-energy\nis relatively small, despite the large delocalization of the\nprotons in the PIMD calculation. Looking more\ncarefully at the two distributions, one can notice that\nin the high-$d_\\mathrm{OO}$ region there is higher\ndelocalisation of the proton.\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "fig, ax = plt.subplots(\n 1, 1, figsize=(4, 3), sharex=True, sharey=True, constrained_layout=True\n)\n\nlevels = np.linspace(0, 0.5, 6)\ncp1 = ax.contour(*xyz_5, colors=\"b\", levels=levels)\ncp2 = ax.contour(*xyz_pi_5, colors=\"r\", levels=levels)\nax.set_ylabel(r\"$\\Delta C_\\mathrm{H}$\")\nax.set_xlabel(r\"$d_\\mathrm{OO}$ / \u00c5\")\nax.legend(\n handles=[\n plt.Line2D([0], [0], color=\"b\", label=\"MD\"),\n plt.Line2D([0], [0], color=\"r\", label=\"PIMD\"),\n ]\n)\nplt.show()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "To get a clear signal, we need better-converged calculations;\nthe `data/` folder contains inputs for these \"high quality\" runs,\nand free-energies obtained from them.\nThe results confirm the lowering of the free-energy barrier for\nthe $\\mathrm{H_3O^+ + H_2O} \\rightarrow \\mathrm{H_2O + H_3O^+}$\ntransition.\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "with bz2.open(\"data/FES-md_hiq.bz2\", \"rt\") as f:\n data = np.loadtxt(f, comments=\"#\")[:, :3]\nxyz_md_hiq = np.array([10, 1, 0.01036427])[:, np.newaxis, np.newaxis] * data.T.reshape(\n 3, 101, 101\n)\nwith bz2.open(\"data/FES-pimd_hiq.bz2\", \"rt\") as f:\n data = np.loadtxt(f, comments=\"#\")[:, :3]\nxyz_pi_hiq = np.array([10, 1, 0.01036427])[:, np.newaxis, np.newaxis] * data.T.reshape(\n 3, 101, 101\n)\n\nfig, ax = plt.subplots(\n 1, 1, figsize=(4, 3), sharex=True, sharey=True, constrained_layout=True\n)\n\nlevels = np.linspace(0, 0.5, 6)\ncp1 = ax.contour(*xyz_md_hiq, colors=\"b\", levels=levels)\ncp2 = ax.contour(*xyz_pi_hiq, colors=\"r\", levels=levels)\nax.set_ylabel(r\"$\\Delta C_\\mathrm{H}$\")\nax.set_xlabel(r\"$d_\\mathrm{OO}$ / \u00c5\")\nax.legend(\n handles=[\n plt.Line2D([0], [0], color=\"b\", label=\"MD\"),\n plt.Line2D([0], [0], color=\"r\", label=\"PIMD\"),\n ]\n)\nplt.show()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The lowering of the barrier for proton hopping is clearly\nseen by taking 1D slices of the free energy at different O-O separations.\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "fig, ax = plt.subplots(\n 1, 1, figsize=(4, 3), sharex=True, sharey=True, constrained_layout=True\n)\n\nax.plot(\n xyz_md_hiq[1, :, 50], xyz_md_hiq[2, :, 50], \"b\", label=r\"MD, $d_\\mathrm{OO}=2.6 $\u00c5\"\n)\nax.plot(\n xyz_pi_hiq[1, :, 50],\n xyz_pi_hiq[2, :, 50],\n \"r\",\n label=r\"PIMD, $d_\\mathrm{OO}=2.6 $\u00c5\",\n)\nax.plot(\n xyz_md_hiq[1, :, 60],\n xyz_md_hiq[2, :, 60],\n \"b--\",\n label=r\"MD, $d_\\mathrm{OO}=2.7 $\u00c5\",\n)\nax.plot(\n xyz_pi_hiq[1, :, 60],\n xyz_pi_hiq[2, :, 60],\n \"r--\",\n label=r\"PIMD, $d_\\mathrm{OO}=2.7 $\u00c5\",\n)\nax.set_ylim(0.08, 0.6)\nax.legend(ncols=2, loc=\"upper right\", fontsize=9)\nax.set_ylabel(r\"$F$ / eV\")\nax.set_xlabel(r\"$\\Delta C_\\mathrm{H}$\")\nplt.show()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "This model system is representative of the behavior of protons\nalong a hydrogen bond in different conditions, where the environment\ndetermines the typical O-O separation, and whether the proton is shared\n(as in high pressure ice X) or preferentially attached to one of the two\nmolecules. Zero-point energy (and to a lesser extent tunneling)\nincreases the delocalization, and reduces the barrier for an excess\nproton to hop between water molecues.\n\n" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.11.10" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} \ No newline at end of file diff --git a/_downloads/372c6744f93b866ccf802a12006619bb/roy-gch.py b/_downloads/372c6744f93b866ccf802a12006619bb/roy-gch.py new file mode 100644 index 00000000..46ee05e5 --- /dev/null +++ b/_downloads/372c6744f93b866ccf802a12006619bb/roy-gch.py @@ -0,0 +1,304 @@ +""" +Generalized Convex Hull construction for the polymorphs of ROY +============================================================== + +:Authors: Michele Ceriotti `@ceriottm `_ + +This notebook analyzes the structures of 264 polymorphs of ROY, from +`Beran et Al, Chemical Science (2022) `__, +comparing the conventional density-energy convex hull with a Generalized Convex Hull +(GCH) analysis (see `Anelli et al., Phys. Rev. Materials +(2018) `__). +It uses features computed with `rascaline `__ +and uses the directional convex hull function from +`scikit-matter `__ +to make the figure. + +The GCH construction aims at determining structures, among a collection of +candidate configurations, that are stable or have the potential of being stabilized +by appropriate thermodynamic boundary conditions (pressure, doping, external fields, +...). It does so by using microscopic descriptors to determine the diversity of +structures, and assumes that configurations that are stable relative to other +configurations with similar descriptors are those that could be made +"locally" stable by suitable synthesis conditions. +""" + +# sphinx_gallery_thumbnail_number = 3 +import chemiscope +import matplotlib.tri +import numpy as np +from matplotlib import pyplot as plt +from metatensor import mean_over_samples +from rascaline import SoapPowerSpectrum +from sklearn.decomposition import PCA +from skmatter.datasets import load_roy_dataset +from skmatter.sample_selection import DirectionalConvexHull + + +# %% +# Loads the structures (that also contain properties in the ``info`` field) + +roy_data = load_roy_dataset() + +structures = roy_data["structures"] + +density = np.array([s.info["density"] for s in structures]) +energy = np.array([s.info["energy"] for s in structures]) +structype = np.array([s.info["type"] for s in structures]) +iknown = np.where(structype == "known")[0] +iothers = np.where(structype != "known")[0] + + +# %% +# Energy-density hull +# ------------------- +# +# The Directional Convex Hull routines can be used to compute a +# conventional density-energy hull (see +# `Hautier (2014) +# `_ for a pedagogic +# introduction to the convex hull construction in the context +# of atomistic simulations). + +dch_builder = DirectionalConvexHull(low_dim_idx=[0]) +dch_builder.fit(density.reshape(-1, 1), energy) + +# %% +# We can get the indices of the selection, and compute the distance from +# the hull + +sel = dch_builder.selected_idx_ +dch_dist = dch_builder.score_samples(density.reshape(-1, 1), energy) + + +# %% +# +# Hull energies +# ^^^^^^^^^^^^^ +# +# Structures on the hull are stable with respect to synthesis at constant +# molar volume. Any other structure would lower the energy by decomposing +# into a mixture of the two nearest structures along the hull. Given that +# the lattice energy is an imperfect proxy for the free energy, and that +# synthesis can be performed in other ways than by fixing the density, +# structures that are not exactly on the hull might also be stable. One +# can compute a “hull energy” as an indication of how close these +# structures are to being stable. + +fig, ax = plt.subplots(1, 1, figsize=(6, 4)) +ax.scatter(density, energy, c=dch_dist, marker=".") +ssel = sel[np.argsort(density[sel])] +ax.plot(density[ssel], energy[ssel], "k--") +ax.set_xlabel("density / g/cm$^3$") +ax.set_ylabel("energy / kJ/mol") +plt.show() + +print( + f"Mean hull energy for 'known' stable structures {dch_dist[iknown].mean()} kJ/mol" +) +print(f"Mean hull energy for 'other' structures {dch_dist[iothers].mean()} kJ/mol") + + +# %% +# Interactive visualization +# ^^^^^^^^^^^^^^^^^^^^^^^^^ +# +# You can also visualize the hull with ``chemiscope`` in a juptyer notebook. +# + +cs = chemiscope.show( + structures, + dict( + energy=energy, + density=density, + hull_energy=dch_dist, + structure_type=structype, + ), + settings={ + "map": { + "x": {"property": "density"}, + "y": {"property": "energy"}, + "color": {"property": "hull_energy"}, + "symbol": "structure_type", + "size": {"factor": 35}, + }, + "structure": [{"unitCell": True, "supercell": {"0": 2, "1": 2, "2": 2}}], + }, +) +cs + +# %% +# +# Save chemiscope file in a format that can be shared and viewed on `chemiscope.org` +cs.save("roy_ch.json.gz") + +# %% +# Generalized Convex Hull +# ----------------------- +# +# A GCH is a similar construction, in which generic structural descriptors +# are used in lieu of composition, density or other thermodynamic +# constraints. The idea is that configurations that are found close to the +# GCH are locally stable with respect to structurally-similar +# configurations. In other terms, one can hope to find a thermodynamic +# constraint (i.e. synthesis conditions) that act differently on these +# structures in comparison with the others, and may potentially stabilize +# them. +# + + +# %% +# Compute structural descriptors +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +# +# A first step is to computes suitable ML descriptors. Here we have used +# ``rascaline`` to evaluate average SOAP features for the structures. +# If you don't want to install these dependencies for this example you +# can also use the pre-computed features, but you can use this as a stub +# to apply this analysis to other chemical systems + +hypers = { + "cutoff": 4, + "max_radial": 6, + "max_angular": 4, + "atomic_gaussian_width": 0.7, + "cutoff_function": {"ShiftedCosine": {"width": 0.5}}, + "radial_basis": {"Gto": {"accuracy": 1e-6}}, + "center_atom_weight": 1.0, +} +calculator = SoapPowerSpectrum(**hypers) +rho2i = calculator.compute(structures) +rho2i = rho2i.keys_to_samples(["species_center"]).keys_to_properties( + ["species_neighbor_1", "species_neighbor_2"] +) +rho2i_structure = mean_over_samples(rho2i, sample_names=["center", "species_center"]) +np.savez("roy_features.npz", feats=rho2i_structure.block(0).values) + + +# features = roy_data["features"] +features = rho2i_structure.block(0).values + + +# %% +# PCA projection +# ^^^^^^^^^^^^^^ +# +# Computes PCA projection to generate low-dimensional descriptors that +# reflect structural diversity. Any other dimensionality reduction scheme +# could be used in a similar fashion. + +pca = PCA(n_components=4) +pca_features = pca.fit_transform(features) + +fig, ax = plt.subplots(1, 1, figsize=(6, 4)) +scatter = ax.scatter(pca_features[:, 0], pca_features[:, 1], c=energy) +ax.set_xlabel("PCA[1]") +ax.set_ylabel("PCA[2]") +cbar = fig.colorbar(scatter, ax=ax) +cbar.set_label("energy / kJ/mol") +plt.show() + + +# %% +# Builds the Generalized Convex Hull +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +# +# Builds a convex hull on the first two PCA features + +dch_builder = DirectionalConvexHull(low_dim_idx=[0, 1]) +dch_builder.fit(pca_features, energy) +sel = dch_builder.selected_idx_ +dch_dist = dch_builder.score_samples(pca_features, energy) + + +# %% +# Generates a 3D Plot +# + +triang = matplotlib.tri.Triangulation(pca_features[sel, 0], pca_features[sel, 1]) +fig = plt.figure(figsize=(7, 5), tight_layout=True) +ax = fig.add_subplot(projection="3d") +ax.plot_trisurf(triang, energy[sel], color="gray") +ax.scatter(pca_features[:, 0], pca_features[:, 1], energy, c=dch_dist) +ax.set_xlabel("PCA[1]") +ax.set_ylabel("PCA[2]") +ax.set_zlabel("energy / kJ/mol\n \n", labelpad=11) +ax.view_init(25, 110) +plt.show() + + +# %% +# The GCH construction improves the separation between the hull energies +# of “known” and hypothetical polymorphs (compare with the density-energy +# values above) + +print( + f"Mean hull energy for 'known' stable structures {dch_dist[iknown].mean()} kJ/mol" +) +print(f"Mean hull energy for 'other' structures {dch_dist[iothers].mean()} kJ/mol") + + +# %% +# Visualize in a ``chemiscope`` widget + +for i, f in enumerate(structures): + for j in range(len(pca_features[i])): + f.info["pca_" + str(j + 1)] = pca_features[i, j] +structure_properties = chemiscope.extract_properties(structures) +structure_properties.update({"per_atom_energy": energy, "hull_energy": dch_dist}) + +# You can save a chemiscope file to disk (for viewing on chemiscope.org) + +chemiscope.write_input( + "roy_gch.json.gz", + frames=structures, + properties=structure_properties, + meta={ + "name": "GCH for ROY polymorphs", + "description": """ +Demonstration of the Generalized Convex Hull construction for +polymorphs of the ROY molecule. Molecules that are closest to +the hull built on PCA-based structural descriptors and having the +internal energy predicted by electronic-structure calculations as +the z axis are the most thermodynamically stable. Indeed most of the +known polymorphs of ROY are on (or very close) to this hull. +""", + "authors": ["Michele Ceriotti "], + "references": [ + 'A. Anelli, E. A. Engel, C. J. Pickard, and M. Ceriotti, \ + "Generalized convex hull construction for materials discovery," \ + Physical Review Materials 2(10), 103804 (2018).', + 'G. J. O. Beran, I. J. Sugden, C. Greenwell, D. H. Bowskill, \ + C. C. Pantelides, and C. S. Adjiman, "How many more polymorphs of \ + ROY remain undiscovered," Chem. Sci. 13(5), 1288–1297 (2022).', + ], + }, + settings={ + "map": { + "x": {"property": "pca_1"}, + "y": {"property": "pca_2"}, + "z": {"property": "energy"}, + "symbol": "type", + "color": {"property": "hull_energy"}, + "size": { + "factor": 35, + "mode": "linear", + "property": "", + "reverse": True, + }, + }, + "structure": [ + { + "bonds": True, + "unitCell": True, + "keepOrientation": True, + } + ], + }, +) + +# %% +# +# ... and also load one as an interactive viewer + +chemiscope.show_input("roy_gch.json.gz") diff --git a/_downloads/4a472fb66c1181d9511af7fde6c7f57c/gaas-map.zip b/_downloads/4a472fb66c1181d9511af7fde6c7f57c/gaas-map.zip new file mode 100644 index 00000000..d83fbc98 Binary files /dev/null and b/_downloads/4a472fb66c1181d9511af7fde6c7f57c/gaas-map.zip differ diff --git a/_downloads/4cc6d7251cc20e13dd91e533c7271a6a/charge-charge.xyz b/_downloads/4cc6d7251cc20e13dd91e533c7271a6a/charge-charge.xyz new file mode 100644 index 00000000..a988fbef --- /dev/null +++ b/_downloads/4cc6d7251cc20e13dd91e533c7271a6a/charge-charge.xyz @@ -0,0 +1,2834 @@ +23 +Lattice="30.0 0.0 0.0 0.0 30.0 0.0 0.0 0.0 30.0" Properties=species:S:1:pos:R:3:forces:R:3 energy=-13961.0350892859 label=CC chargeA=1 energyA=-7738.76386157005 chargeB=-1 energyB=-6220.47808514827 distance=5.690705127008064 pbc="T T T" +C -23.00700000 -14.39400000 -25.47600000 -0.69902091 -0.75330680 0.65287932 +C -23.86700000 -15.59000000 -25.01000000 0.54022160 0.53450759 2.35559299 +C -22.00600000 -15.99600000 -27.05600000 -0.00837973 1.27218157 0.31933751 +N -22.00900000 -14.81000000 -26.46800000 -0.50291940 -0.34870639 -0.02343831 +N -22.97400000 -16.87300000 -26.85700000 -0.57339954 -1.76724206 -1.26909466 +N -21.03500000 -16.32600000 -27.87900000 1.83030176 -0.47050530 -1.21950425 +H -23.65000000 -13.61700000 -25.89000000 0.06849366 0.32652106 0.12670392 +H -22.47300000 -13.98600000 -24.61600000 -0.10233027 0.49301737 0.10937452 +H -23.24100000 -16.45200000 -24.76000000 -0.01467466 -0.39767784 -1.07630033 +H -24.75600000 -15.73900000 -25.63000000 -0.11033169 -0.31861290 0.30138773 +H -21.30800000 -14.13600000 -26.74300000 0.10855604 0.19049848 0.00342126 +H -23.91000000 -16.51500000 -26.79400000 -0.22091234 -0.23467575 0.19009341 +H -22.88300000 -17.78900000 -27.27300000 0.01703936 -0.08269867 -0.25912284 +H -20.27200000 -15.69400000 -28.06100000 0.31374409 -0.01402229 0.04784428 +H -20.98400000 -17.25100000 -28.27500000 0.03445105 -0.04352040 -0.18461387 +H -24.16288000 -15.59000000 -23.95054000 -0.77852330 1.71978297 -0.03157711 +C -22.52196163 -10.66596984 -22.58440081 0.67844879 0.45513050 0.69215040 +C -23.75496163 -11.32196984 -23.10140081 -1.41995788 0.36313342 0.41516871 +O -23.59396163 -12.32196984 -23.84240081 0.39560261 -1.34439497 -0.95728857 +O -24.85896163 -10.80696984 -22.79340081 -0.21273266 0.08620314 0.02113320 +H -22.77396163 -9.97896984 -21.77140081 0.06436973 0.13775077 0.08472735 +H -22.12296163 -10.08296984 -23.41640081 0.46007946 0.12838107 -0.09540760 +H -21.78879163 -11.39985984 -22.21854081 0.13187423 0.06825543 -0.20346705 +23 +Lattice="30.0 0.0 0.0 0.0 30.0 0.0 0.0 0.0 30.0" Properties=species:S:1:pos:R:3:forces:R:3 energy=-13960.96607249 label=CC chargeA=1 energyA=-7738.76386157005 chargeB=-1 energyB=-6220.47808514827 distance=5.938169769300996 pbc="T T T" +C -23.00700000 -14.39400000 -25.47600000 -0.71626918 -0.62875277 0.74237584 +C -23.86700000 -15.59000000 -25.01000000 0.52146335 0.54145183 2.37445557 +C -22.00600000 -15.99600000 -27.05600000 0.00393734 1.11123760 0.32053830 +N -22.00900000 -14.81000000 -26.46800000 -0.49389956 -0.15183579 0.05331357 +N -22.97400000 -16.87300000 -26.85700000 -0.58367599 -1.76230288 -1.24239030 +N -21.03500000 -16.32600000 -27.87900000 1.82846171 -0.44531577 -1.21831345 +H -23.65000000 -13.61700000 -25.89000000 0.03729579 0.33371354 0.09958739 +H -22.47300000 -13.98600000 -24.61600000 -0.07541075 0.46959704 0.14304573 +H -23.24100000 -16.45200000 -24.76000000 -0.01656850 -0.38322802 -1.08039145 +H -24.75600000 -15.73900000 -25.63000000 -0.09568127 -0.31448025 0.29896098 +H -21.30800000 -14.13600000 -26.74300000 0.10666562 0.19232739 -0.00310737 +H -23.91000000 -16.51500000 -26.79400000 -0.24997072 -0.23959417 0.15674722 +H -22.88300000 -17.78900000 -27.27300000 0.01486768 -0.08399832 -0.26191257 +H -20.27200000 -15.69400000 -28.06100000 0.31981202 -0.00432644 0.03592510 +H -20.98400000 -17.25100000 -28.27500000 0.02957950 -0.03933131 -0.18534281 +H -24.16288000 -15.59000000 -23.95054000 -0.77958345 1.71121348 -0.02134425 +C -22.53898081 -10.46498492 -22.43670041 0.66644017 0.46625930 0.69552265 +C -23.77198081 -11.12098492 -22.95370041 -1.21986379 0.20100662 0.28916554 +O -23.61098081 -12.12098492 -23.69470041 0.36676191 -1.43014162 -1.03444633 +O -24.87598081 -10.60598492 -22.64570041 -0.30788599 0.11486968 0.04462620 +H -22.79098081 -9.77798492 -21.62370041 0.06685115 0.14662875 0.09341913 +H -22.13998081 -9.88198492 -23.26870041 0.45616763 0.12659108 -0.09362564 +H -21.80581081 -11.19887492 -22.07084041 0.12050533 0.06841100 -0.20680905 +23 +Lattice="30.0 0.0 0.0 0.0 30.0 0.0 0.0 0.0 30.0" Properties=species:S:1:pos:R:3:forces:R:3 energy=-13960.8603277197 label=CC chargeA=1 energyA=-7738.76386157005 chargeB=-1 energyB=-6220.47808514827 distance=6.1858383159671995 pbc="T T T" +C -23.00700000 -14.39400000 -25.47600000 -0.70547678 -0.58427283 0.76671805 +C -23.86700000 -15.59000000 -25.01000000 0.50693550 0.54781072 2.38910848 +C -22.00600000 -15.99600000 -27.05600000 0.02060908 0.97210181 0.32119482 +N -22.00900000 -14.81000000 -26.46800000 -0.48832579 0.00467286 0.11241690 +N -22.97400000 -16.87300000 -26.85700000 -0.59347735 -1.75953655 -1.21571875 +N -21.03500000 -16.32600000 -27.87900000 1.83002452 -0.42569276 -1.22144544 +H -23.65000000 -13.61700000 -25.89000000 0.01697074 0.32672377 0.06652661 +H -22.47300000 -13.98600000 -24.61600000 -0.04178485 0.42205364 0.14926218 +H -23.24100000 -16.45200000 -24.76000000 -0.01743056 -0.37181913 -1.08460068 +H -24.75600000 -15.73900000 -25.63000000 -0.08491410 -0.31186775 0.29600139 +H -21.30800000 -14.13600000 -26.74300000 0.10464933 0.19244052 -0.00945134 +H -23.91000000 -16.51500000 -26.79400000 -0.27822575 -0.24340234 0.12529564 +H -22.88300000 -17.78900000 -27.27300000 0.01291253 -0.08520727 -0.26480484 +H -20.27200000 -15.69400000 -28.06100000 0.32532711 0.00475613 0.02483899 +H -20.98400000 -17.25100000 -28.27500000 0.02564346 -0.03771626 -0.18724774 +H -24.16288000 -15.59000000 -23.95054000 -0.78078009 1.70101486 -0.01218748 +C -22.55600000 -10.26400000 -22.28900000 0.65505122 0.47353723 0.69573435 +C -23.78900000 -10.92000000 -22.80600000 -1.06277215 0.08294978 0.19952989 +O -23.62800000 -11.92000000 -23.54700000 0.30723446 -1.39073858 -1.01161090 +O -24.89300000 -10.40500000 -22.49800000 -0.38491795 0.13597450 0.06185559 +H -22.80800000 -9.57700000 -21.47600000 0.06827835 0.15314491 0.10013787 +H -22.15700000 -9.68100000 -23.12100000 0.45285394 0.12505242 -0.09226530 +H -21.82283000 -10.99789000 -21.92314000 0.11161512 0.06802031 -0.20928827 +23 +Lattice="30.0 0.0 0.0 0.0 30.0 0.0 0.0 0.0 30.0" Properties=species:S:1:pos:R:3:forces:R:3 energy=-13960.7507448301 label=CC chargeA=1 energyA=-7738.76386157005 chargeB=-1 energyB=-6220.47808514827 distance=6.433687211666039 pbc="T T T" +C -23.00700000 -14.39400000 -25.47600000 -0.68476151 -0.57599922 0.76274801 +C -23.86700000 -15.59000000 -25.01000000 0.49548813 0.55399478 2.40090980 +C -22.00600000 -15.99600000 -27.05600000 0.03752905 0.85183262 0.32181887 +N -22.00900000 -14.81000000 -26.46800000 -0.48521588 0.13398972 0.16123563 +N -22.97400000 -16.87300000 -26.85700000 -0.60253400 -1.75854863 -1.19052420 +N -21.03500000 -16.32600000 -27.87900000 1.83456967 -0.41031061 -1.22799791 +H -23.65000000 -13.61700000 -25.89000000 0.00228684 0.31623853 0.03643256 +H -22.47300000 -13.98600000 -24.61600000 -0.01218289 0.37379521 0.14584601 +H -23.24100000 -16.45200000 -24.76000000 -0.01777484 -0.36280174 -1.08865745 +H -24.75600000 -15.73900000 -25.63000000 -0.07682597 -0.31032845 0.29286134 +H -21.30800000 -14.13600000 -26.74300000 0.10226063 0.19134244 -0.01534518 +H -23.91000000 -16.51500000 -26.79400000 -0.30474037 -0.24637973 0.09631972 +H -22.88300000 -17.78900000 -27.27300000 0.01111682 -0.08590484 -0.26726353 +H -20.27200000 -15.69400000 -28.06100000 0.32974542 0.01252088 0.01483242 +H -20.98400000 -17.25100000 -28.27500000 0.02262799 -0.03694988 -0.18907464 +H -24.16288000 -15.59000000 -23.95054000 -0.78186517 1.69074235 -0.00420570 +C -22.57301919 -10.06301508 -22.14129959 0.64497964 0.47721485 0.69335910 +C -23.80601919 -10.71901508 -22.65829959 -0.93707216 0.00010578 0.13817158 +O -23.64501919 -11.71901508 -23.39929959 0.24524802 -1.31252213 -0.95695555 +O -24.91001919 -10.20401508 -22.35029959 -0.44663559 0.14899386 0.07242799 +H -22.82501919 -9.37601508 -21.32829959 0.06851378 0.15778750 0.10536343 +H -22.17401919 -9.48001508 -22.97329959 0.45024377 0.12384684 -0.09123206 +H -21.83984919 -10.79690508 -21.77543959 0.10499860 0.06733986 -0.21107026 +23 +Lattice="30.0 0.0 0.0 0.0 30.0 0.0 0.0 0.0 30.0" Properties=species:S:1:pos:R:3:forces:R:3 energy=-13960.6493933514 label=CC chargeA=1 energyA=-7738.76386157005 chargeB=-1 energyB=-6220.47808514827 distance=6.681696379133143 pbc="T T T" +C -23.00700000 -14.39400000 -25.47600000 -0.66195394 -0.58328058 0.74742585 +C -23.86700000 -15.59000000 -25.01000000 0.48640282 0.55997206 2.41067572 +C -22.00600000 -15.99600000 -27.05600000 0.05305687 0.74839629 0.32225233 +N -22.00900000 -14.81000000 -26.46800000 -0.48364856 0.24241464 0.20269700 +N -22.97400000 -16.87300000 -26.85700000 -0.61033992 -1.75857087 -1.16740477 +N -21.03500000 -16.32600000 -27.87900000 1.84059345 -0.39801217 -1.23603199 +H -23.65000000 -13.61700000 -25.89000000 -0.00921016 0.30621217 0.01130738 +H -22.47300000 -13.98600000 -24.61600000 0.01163295 0.33201812 0.14013720 +H -23.24100000 -16.45200000 -24.76000000 -0.01784286 -0.35569530 -1.09244773 +H -24.75600000 -15.73900000 -25.63000000 -0.07067116 -0.30952773 0.28969258 +H -21.30800000 -14.13600000 -26.74300000 0.09981870 0.18971171 -0.02069580 +H -23.91000000 -16.51500000 -26.79400000 -0.32916115 -0.24869515 0.07029520 +H -22.88300000 -17.78900000 -27.27300000 0.00946701 -0.08631773 -0.26930136 +H -20.27200000 -15.69400000 -28.06100000 0.33331702 0.01902783 0.00595183 +H -20.98400000 -17.25100000 -28.27500000 0.02038113 -0.03658373 -0.19064609 +H -24.16288000 -15.59000000 -23.95054000 -0.78278831 1.68110543 0.00266012 +C -22.59003837 -9.86203016 -21.99359919 0.63656811 0.47819749 0.68947325 +C -23.82303837 -10.51803016 -22.51059919 -0.83607798 -0.05719009 0.09676844 +O -23.66203837 -11.51803016 -23.25159919 0.18986082 -1.22938460 -0.89722547 +O -24.92703837 -10.00303016 -22.20259919 -0.49557835 0.15572437 0.07793578 +H -22.84203837 -9.17503016 -21.18059919 0.06784851 0.16096417 0.10933931 +H -22.19103837 -9.27903016 -22.82559919 0.44822726 0.12284057 -0.09041154 +H -21.85686837 -10.59592016 -21.62773919 0.10009773 0.06667311 -0.21244724 +23 +Lattice="30.0 0.0 0.0 0.0 30.0 0.0 0.0 0.0 30.0" Properties=species:S:1:pos:R:3:forces:R:3 energy=-13960.5595813796 label=CC chargeA=1 energyA=-7738.76386157005 chargeB=-1 energyB=-6220.47808514827 distance=6.929848617797843 pbc="T T T" +C -23.00700000 -14.39400000 -25.47600000 -0.64008304 -0.59620009 0.72920693 +C -23.86700000 -15.59000000 -25.01000000 0.47932023 0.56581458 2.41903695 +C -22.00600000 -15.99600000 -27.05600000 0.06668602 0.65841712 0.32269886 +N -22.00900000 -14.81000000 -26.46800000 -0.48235712 0.33513921 0.23830875 +N -22.97400000 -16.87300000 -26.85700000 -0.61660321 -1.75910056 -1.14626097 +N -21.03500000 -16.32600000 -27.87900000 1.84742471 -0.38787908 -1.24481239 +H -23.65000000 -13.61700000 -25.89000000 -0.01864106 0.29776901 -0.00906174 +H -22.47300000 -13.98600000 -24.61600000 0.02998949 0.29732975 0.13412940 +H -23.24100000 -16.45200000 -24.76000000 -0.01776794 -0.35001365 -1.09589830 +H -24.75600000 -15.73900000 -25.63000000 -0.06596081 -0.30931833 0.28642907 +H -21.30800000 -14.13600000 -26.74300000 0.09732741 0.18757829 -0.02535566 +H -23.91000000 -16.51500000 -26.79400000 -0.35184487 -0.25049123 0.04696045 +H -22.88300000 -17.78900000 -27.27300000 0.00794878 -0.08650499 -0.27095000 +H -20.27200000 -15.69400000 -28.06100000 0.33618957 0.02449654 -0.00196501 +H -20.98400000 -17.25100000 -28.27500000 0.01860219 -0.03637924 -0.19202150 +H -24.16288000 -15.59000000 -23.95054000 -0.78355704 1.67240161 0.00850732 +C -22.60705756 -9.66104525 -21.84589878 0.62949184 0.47750625 0.68479653 +C -23.84005756 -10.31704525 -22.36289878 -0.75317229 -0.09732489 0.06855334 +O -23.67905756 -11.31704525 -23.10389878 0.14236631 -1.15285980 -0.84167504 +O -24.94405756 -9.80204525 -22.05489878 -0.53502529 0.15838894 0.08023232 +H -22.85905756 -8.97404525 -21.03289878 0.06663558 0.16316133 0.11241672 +H -22.20805756 -9.07804525 -22.67789878 0.44665845 0.12197991 -0.08975935 +H -21.87388756 -10.39493525 -21.48003878 0.09637208 0.06608934 -0.21351668 +23 +Lattice="30.0 0.0 0.0 0.0 30.0 0.0 0.0 0.0 30.0" Properties=species:S:1:pos:R:3:forces:R:3 energy=-13960.481386365 label=CC chargeA=1 energyA=-7738.76386157005 chargeB=-1 energyB=-6220.47808514827 distance=7.17812909420908 pbc="T T T" +C -23.00700000 -14.39400000 -25.47600000 -0.62017865 -0.61009750 0.71230305 +C -23.86700000 -15.59000000 -25.01000000 0.47399619 0.57157018 2.42629536 +C -22.00600000 -15.99600000 -27.05600000 0.07823437 0.57906109 0.32309125 +N -22.00900000 -14.81000000 -26.46800000 -0.48028528 0.41602952 0.26923682 +N -22.97400000 -16.87300000 -26.85700000 -0.62115639 -1.75981053 -1.12676156 +N -21.03500000 -16.32600000 -27.87900000 1.85464139 -0.37919095 -1.25387685 +H -23.65000000 -13.61700000 -25.89000000 -0.02673980 0.29105364 -0.02547279 +H -22.47300000 -13.98600000 -24.61600000 0.04356398 0.26868861 0.12800013 +H -23.24100000 -16.45200000 -24.76000000 -0.01761369 -0.34546262 -1.09905935 +H -24.75600000 -15.73900000 -25.63000000 -0.06237400 -0.30959899 0.28305932 +H -21.30800000 -14.13600000 -26.74300000 0.09474106 0.18486830 -0.02925328 +H -23.91000000 -16.51500000 -26.79400000 -0.37321448 -0.25191997 0.02595313 +H -22.88300000 -17.78900000 -27.27300000 0.00654285 -0.08654616 -0.27225052 +H -20.27200000 -15.69400000 -28.06100000 0.33852216 0.02913080 -0.00909490 +H -20.98400000 -17.25100000 -28.27500000 0.01706885 -0.03630397 -0.19335016 +H -24.16288000 -15.59000000 -23.95054000 -0.78425421 1.66472578 0.01353677 +C -22.62407675 -9.46006033 -21.69819838 0.62353674 0.47574605 0.67979094 +C -23.85707675 -10.11606033 -22.21519837 -0.68421115 -0.12574346 0.04908345 +O -23.69607675 -11.11606033 -22.95619837 0.10254849 -1.08616333 -0.79300852 +O -24.96107675 -9.60106033 -21.90719838 -0.56734209 0.15844511 0.08051510 +H -22.87607675 -8.77306033 -20.88519838 0.06509633 0.16465624 0.11480690 +H -22.22507675 -8.87706033 -22.53019838 0.44539130 0.12122287 -0.08921919 +H -21.89090675 -10.19395033 -21.33233837 0.09348603 0.06563930 -0.21432509 +23 +Lattice="30.0 0.0 0.0 0.0 30.0 0.0 0.0 0.0 30.0" Properties=species:S:1:pos:R:3:forces:R:3 energy=-13960.4138280991 label=CC chargeA=1 energyA=-7738.76386157005 chargeB=-1 energyB=-6220.47808514827 distance=7.426524940834331 pbc="T T T" +C -23.00700000 -14.39400000 -25.47600000 -0.60222955 -0.62327841 0.69662702 +C -23.86700000 -15.59000000 -25.01000000 0.46981137 0.57696393 2.43272206 +C -22.00600000 -15.99600000 -27.05600000 0.08825387 0.50999638 0.32350356 +N -22.00900000 -14.81000000 -26.46800000 -0.47873745 0.48591354 0.29656668 +N -22.97400000 -16.87300000 -26.85700000 -0.62490013 -1.76071942 -1.10914518 +N -21.03500000 -16.32600000 -27.87900000 1.86185284 -0.37204672 -1.26264824 +H -23.65000000 -13.61700000 -25.89000000 -0.03379493 0.28589148 -0.03846988 +H -22.47300000 -13.98600000 -24.61600000 0.05380654 0.24584240 0.12287815 +H -23.24100000 -16.45200000 -24.76000000 -0.01748063 -0.34180168 -1.10196073 +H -24.75600000 -15.73900000 -25.63000000 -0.05949445 -0.31010511 0.27988215 +H -21.30800000 -14.13600000 -26.74300000 0.09233792 0.18226022 -0.03278756 +H -23.91000000 -16.51500000 -26.79400000 -0.39262716 -0.25301586 0.00723835 +H -22.88300000 -17.78900000 -27.27300000 0.00525947 -0.08653037 -0.27338994 +H -20.27200000 -15.69400000 -28.06100000 0.34046252 0.03311969 -0.01544643 +H -20.98400000 -17.25100000 -28.27500000 0.01582744 -0.03623806 -0.19451013 +H -24.16288000 -15.59000000 -23.95054000 -0.78480075 1.65803809 0.01791924 +C -22.64109593 -9.25907541 -21.55049797 0.61865057 0.47309260 0.67466794 +C -23.87409593 -9.91507541 -22.06749797 -0.62707783 -0.14472566 0.03663413 +O -23.71309593 -10.91507541 -22.80849797 0.06937417 -1.03056292 -0.75229081 +O -24.97809593 -9.40007541 -21.75949797 -0.59353357 0.15648274 0.07909394 +H -22.89309593 -8.57207541 -20.73749797 0.06337223 0.16555420 0.11664152 +H -22.24209593 -8.67607541 -22.38249797 0.44440124 0.12051808 -0.08875259 +H -21.90792593 -9.99296541 -21.18463797 0.09126629 0.06535088 -0.21497325 +23 +Lattice="30.0 0.0 0.0 0.0 30.0 0.0 0.0 0.0 30.0" Properties=species:S:1:pos:R:3:forces:R:3 energy=-13960.3555221732 label=CC chargeA=1 energyA=-7738.76386157005 chargeB=-1 energyB=-6220.47808514827 distance=7.675024962343216 pbc="T T T" +C -23.00700000 -14.39400000 -25.47600000 -0.58598204 -0.63537898 0.68129553 +C -23.86700000 -15.59000000 -25.01000000 0.46623023 0.58163875 2.43816496 +C -22.00600000 -15.99600000 -27.05600000 0.09755859 0.45064052 0.32445514 +N -22.00900000 -14.81000000 -26.46800000 -0.47897342 0.54555830 0.32110623 +N -22.97400000 -16.87300000 -26.85700000 -0.62869232 -1.76184832 -1.09366922 +N -21.03500000 -16.32600000 -27.87900000 1.86875150 -0.36653748 -1.27090824 +H -23.65000000 -13.61700000 -25.89000000 -0.03986340 0.28191972 -0.04859707 +H -22.47300000 -13.98600000 -24.61600000 0.06198432 0.22825553 0.11952419 +H -23.24100000 -16.45200000 -24.76000000 -0.01742389 -0.33887194 -1.10465863 +H -24.75600000 -15.73900000 -25.63000000 -0.05703351 -0.31062899 0.27713125 +H -21.30800000 -14.13600000 -26.74300000 0.09034559 0.18029627 -0.03637560 +H -23.91000000 -16.51500000 -26.79400000 -0.40965322 -0.25377779 -0.00928174 +H -22.88300000 -17.78900000 -27.27300000 0.00412883 -0.08646444 -0.27446931 +H -20.27200000 -15.69400000 -28.06100000 0.34208903 0.03667262 -0.02101609 +H -20.98400000 -17.25100000 -28.27500000 0.01490253 -0.03603347 -0.19533711 +H -24.16288000 -15.59000000 -23.95054000 -0.78517651 1.65227676 0.02186449 +C -22.65811512 -9.05809049 -21.40279756 0.61463604 0.46999669 0.66962347 +C -23.89111512 -9.71409049 -21.91979756 -0.57867033 -0.15631088 0.02986932 +O -23.73011512 -10.71409049 -22.66079756 0.04105244 -0.98548362 -0.71918575 +O -24.99511512 -9.19909049 -21.61179756 -0.61481587 0.15295411 0.07627671 +H -22.91011512 -8.37109049 -20.58979756 0.06150334 0.16607312 0.11807822 +H -22.25911512 -8.47509049 -22.23479756 0.44359667 0.11987176 -0.08837101 +H -21.92494512 -9.79198049 -21.03693756 0.08950541 0.06518177 -0.21551974 +23 +Lattice="30.0 0.0 0.0 0.0 30.0 0.0 0.0 0.0 30.0" Properties=species:S:1:pos:R:3:forces:R:3 energy=-13960.3049514433 label=CC chargeA=1 energyA=-7738.76386157005 chargeB=-1 energyB=-6220.47808514827 distance=7.923619347117433 pbc="T T T" +C -23.00700000 -14.39400000 -25.47600000 -0.57138678 -0.64639787 0.66621438 +C -23.86700000 -15.59000000 -25.01000000 0.46307460 0.58567496 2.44289863 +C -22.00600000 -15.99600000 -27.05600000 0.10647737 0.40001414 0.32584042 +N -22.00900000 -14.81000000 -26.46800000 -0.48105578 0.59579812 0.34296525 +N -22.97400000 -16.87300000 -26.85700000 -0.63248693 -1.76288834 -1.08027952 +N -21.03500000 -16.32600000 -27.87900000 1.87477776 -0.36233754 -1.27807537 +H -23.65000000 -13.61700000 -25.89000000 -0.04506127 0.27891177 -0.05644408 +H -22.47300000 -13.98600000 -24.61600000 0.06882184 0.21494426 0.11789997 +H -23.24100000 -16.45200000 -24.76000000 -0.01745173 -0.33652491 -1.10715766 +H -24.75600000 -15.73900000 -25.63000000 -0.05488625 -0.31110280 0.27482686 +H -21.30800000 -14.13600000 -26.74300000 0.08893635 0.17918301 -0.04005838 +H -23.91000000 -16.51500000 -26.79400000 -0.42438994 -0.25420285 -0.02367633 +H -22.88300000 -17.78900000 -27.27300000 0.00315301 -0.08648275 -0.27561592 +H -20.27200000 -15.69400000 -28.06100000 0.34360080 0.03998675 -0.02588091 +H -20.98400000 -17.25100000 -28.27500000 0.01420917 -0.03582350 -0.19596792 +H -24.16288000 -15.59000000 -23.95054000 -0.78538152 1.64736049 0.02548846 +C -22.67513431 -8.85710557 -21.25509716 0.61130087 0.46672057 0.66491409 +C -23.90813431 -9.51310557 -21.77209716 -0.53739031 -0.16288203 0.02684169 +O -23.74713431 -10.51310557 -22.51309716 0.01655816 -0.94912746 -0.69244703 +O -25.01213431 -8.99810557 -21.46409716 -0.63205298 0.14846400 0.07256879 +H -22.92713431 -8.17010557 -20.44209716 0.05966563 0.16633241 0.11920264 +H -22.27613431 -8.27410557 -22.08709716 0.44292695 0.11925481 -0.08803883 +H -21.94196431 -9.59099557 -20.88923716 0.08804098 0.06512478 -0.21601923 +23 +Lattice="30.0 0.0 0.0 0.0 30.0 0.0 0.0 0.0 30.0" Properties=species:S:1:pos:R:3:forces:R:3 energy=-13960.2606417846 label=CC chargeA=1 energyA=-7738.76386157005 chargeB=-1 energyB=-6220.47808514827 distance=8.172299487318071 pbc="T T T" +C -23.00700000 -14.39400000 -25.47600000 -0.55843067 -0.65628138 0.65167889 +C -23.86700000 -15.59000000 -25.01000000 0.46030499 0.58909421 2.44698443 +C -22.00600000 -15.99600000 -27.05600000 0.11512831 0.35646699 0.32772534 +N -22.00900000 -14.81000000 -26.46800000 -0.48454006 0.63830213 0.36238061 +N -22.97400000 -16.87300000 -26.85700000 -0.63622293 -1.76378992 -1.06871782 +N -21.03500000 -16.32600000 -27.87900000 1.87994711 -0.35916174 -1.28427551 +H -23.65000000 -13.61700000 -25.89000000 -0.04952912 0.27662451 -0.06255188 +H -22.47300000 -13.98600000 -24.61600000 0.07471526 0.20504050 0.11777345 +H -23.24100000 -16.45200000 -24.76000000 -0.01753986 -0.33463643 -1.10947963 +H -24.75600000 -15.73900000 -25.63000000 -0.05297433 -0.31154512 0.27285380 +H -21.30800000 -14.13600000 -26.74300000 0.08803113 0.17874660 -0.04381618 +H -23.91000000 -16.51500000 -26.79400000 -0.43722125 -0.25435837 -0.03627358 +H -22.88300000 -17.78900000 -27.27300000 0.00232740 -0.08657439 -0.27681572 +H -20.27200000 -15.69400000 -28.06100000 0.34502789 0.04312722 -0.03015474 +H -20.98400000 -17.25100000 -28.27500000 0.01367386 -0.03560975 -0.19643988 +H -24.16288000 -15.59000000 -23.95054000 -0.78545573 1.64317687 0.02880207 +C -22.69215350 -8.65612066 -21.10739675 0.60842442 0.46342708 0.66053496 +C -23.92515350 -9.31212066 -21.62439675 -0.50128231 -0.16607654 0.02628681 +O -23.76415350 -10.31212066 -22.36539675 -0.00515640 -0.91956843 -0.67069845 +O -25.02915350 -8.79712066 -21.31639675 -0.64628308 0.14338771 0.06833935 +H -22.94415350 -7.96912066 -20.29439675 0.05793303 0.16643937 0.12011776 +H -22.29315350 -8.07312066 -21.93939675 0.44235020 0.11866386 -0.08775864 +H -21.95898350 -9.39001066 -20.74153675 0.08677214 0.06510503 -0.21649541 +23 +Lattice="30.0 0.0 0.0 0.0 30.0 0.0 0.0 0.0 30.0" Properties=species:S:1:pos:R:3:forces:R:3 energy=-13960.2213962842 label=CC chargeA=1 energyA=-7738.76386157005 chargeB=-1 energyB=-6220.47808514827 distance=8.421057793623207 pbc="T T T" +C -23.00700000 -14.39400000 -25.47600000 -0.54693588 -0.66506306 0.63792631 +C -23.86700000 -15.59000000 -25.01000000 0.45785906 0.59203519 2.45053631 +C -22.00600000 -15.99600000 -27.05600000 0.12348087 0.31877257 0.32995114 +N -22.00900000 -14.81000000 -26.46800000 -0.48893428 0.67435420 0.37955969 +N -22.97400000 -16.87300000 -26.85700000 -0.63975809 -1.76448675 -1.05871776 +N -21.03500000 -16.32600000 -27.87900000 1.88424257 -0.35671815 -1.28951341 +H -23.65000000 -13.61700000 -25.89000000 -0.05334176 0.27478396 -0.06737561 +H -22.47300000 -13.98600000 -24.61600000 0.07986155 0.19760934 0.11863866 +H -23.24100000 -16.45200000 -24.76000000 -0.01767196 -0.33311125 -1.11162741 +H -24.75600000 -15.73900000 -25.63000000 -0.05129175 -0.31196296 0.27113235 +H -21.30800000 -14.13600000 -26.74300000 0.08755411 0.17886153 -0.04757566 +H -23.91000000 -16.51500000 -26.79400000 -0.44849779 -0.25431021 -0.04731553 +H -22.88300000 -17.78900000 -27.27300000 0.00163138 -0.08676074 -0.27806563 +H -20.27200000 -15.69400000 -28.06100000 0.34641564 0.04613908 -0.03392833 +H -20.98400000 -17.25100000 -28.27500000 0.01323905 -0.03544127 -0.19682850 +H -24.16288000 -15.59000000 -23.95054000 -0.78545213 1.63959371 0.03188073 +C -22.70917268 -8.45513574 -20.95969634 0.60587659 0.46026295 0.65651729 +C -23.94217268 -9.11113574 -21.47669634 -0.46922584 -0.16708173 0.02730668 +O -23.78117268 -10.11113574 -22.21769634 -0.02461664 -0.89517586 -0.65280536 +O -25.04617268 -8.59613574 -21.16869634 -0.65816630 0.13802219 0.06388094 +H -22.96117268 -7.76813574 -20.14669634 0.05630500 0.16645034 0.12087478 +H -22.31017268 -7.87213574 -21.79169634 0.44181528 0.11809898 -0.08750787 +H -21.97600268 -9.18902574 -20.59383634 0.08561133 0.06512794 -0.21694382 +23 +Lattice="30.0 0.0 0.0 0.0 30.0 0.0 0.0 0.0 30.0" Properties=species:S:1:pos:R:3:forces:R:3 energy=-13960.1863991973 label=CC chargeA=1 energyA=-7738.76386157005 chargeB=-1 energyB=-6220.47808514827 distance=8.66988752780838 pbc="T T T" +C -23.00700000 -14.39400000 -25.47600000 -0.53673052 -0.67296236 0.62511120 +C -23.86700000 -15.59000000 -25.01000000 0.45573037 0.59458549 2.45372114 +C -22.00600000 -15.99600000 -27.05600000 0.13150622 0.28573323 0.33249909 +N -22.00900000 -14.81000000 -26.46800000 -0.49382060 0.70531780 0.39474295 +N -22.97400000 -16.87300000 -26.85700000 -0.64301524 -1.76496214 -1.04997970 +N -21.03500000 -16.32600000 -27.87900000 1.88783692 -0.35480473 -1.29400868 +H -23.65000000 -13.61700000 -25.89000000 -0.05666182 0.27334560 -0.07121152 +H -22.47300000 -13.98600000 -24.61600000 0.08436408 0.19184761 0.12004352 +H -23.24100000 -16.45200000 -24.76000000 -0.01782941 -0.33184931 -1.11361488 +H -24.75600000 -15.73900000 -25.63000000 -0.04979994 -0.31235824 0.26958918 +H -21.30800000 -14.13600000 -26.74300000 0.08738034 0.17932953 -0.05124162 +H -23.91000000 -16.51500000 -26.79400000 -0.45855222 -0.25407636 -0.05707936 +H -22.88300000 -17.78900000 -27.27300000 0.00104698 -0.08699287 -0.27932095 +H -20.27200000 -15.69400000 -28.06100000 0.34775153 0.04902795 -0.03729019 +H -20.98400000 -17.25100000 -28.27500000 0.01286436 -0.03529542 -0.19714973 +H -24.16288000 -15.59000000 -23.95054000 -0.78538928 1.63653120 0.03470286 +C -22.72619187 -8.25415082 -20.81199594 0.60353015 0.45725253 0.65280571 +C -23.95919187 -8.91015082 -21.32899594 -0.44028562 -0.16657505 0.02939262 +O -23.79819187 -9.91015082 -22.06999594 -0.04229297 -0.87479017 -0.63794649 +O -25.06319187 -8.39515082 -21.02099594 -0.66827740 0.13253483 0.05933952 +H -22.97819187 -7.56715082 -19.99899594 0.05479071 0.16641521 0.12152328 +H -22.32719187 -7.67115082 -21.64399594 0.44131444 0.11756688 -0.08727917 +H -21.99302187 -8.98804082 -20.44613594 0.08453894 0.06517880 -0.21734877 +20 +Lattice="30.0 0.0 0.0 0.0 30.0 0.0 0.0 0.0 30.0" Properties=species:S:1:pos:R:3:forces:R:3 energy=-12893.2536467192 label=CC chargeA=1 energyA=-6669.20645149176 chargeB=-1 energyB=-6220.48400518575 distance=4.757384076215318 pbc="T T T" +C -23.00700000 -14.39400000 -25.47600000 0.46704201 -0.03983473 -0.24562320 +C -22.00600000 -15.99600000 -27.05600000 1.66391618 0.22064471 -1.54156675 +N -21.03500000 -16.32600000 -27.87900000 -0.63664611 0.78933999 -0.41746617 +N -22.00900000 -14.81000000 -26.46800000 -0.92009781 0.71643666 0.85550961 +N -22.97400000 -16.87300000 -26.85700000 -1.49956884 -1.23795130 0.81955374 +H -20.27200000 -15.69400000 -28.06100000 0.86940879 -0.29312383 0.34150156 +H -20.98400000 -17.25100000 -28.27500000 0.52504776 -0.23739517 0.03455365 +H -21.30800000 -14.13600000 -26.74300000 0.21333428 -0.00007333 0.03900492 +H -23.91000000 -16.51500000 -26.79400000 -0.42832907 -0.05632656 0.18398620 +H -22.88300000 -17.78900000 -27.27300000 0.00720252 -0.06895854 -0.06978714 +H -23.65000000 -13.61700000 -25.89000000 -0.27183123 0.16800967 -0.05271055 +H -22.47300000 -13.98600000 -24.61600000 -0.04260650 0.04239585 0.25431125 +H -23.61928000 -15.24549000 -25.14423000 0.23811495 0.13020756 -0.04203499 +C -16.70261563 -18.18981609 -27.33383433 0.87620755 -0.80061141 -0.07577325 +C -17.78861563 -17.17981609 -27.26383433 0.21318894 0.85632542 0.25474292 +O -18.97661563 -17.54281609 -27.25883433 -2.27086765 -2.08638034 -0.28552868 +O -17.47461563 -15.99081609 -27.17283433 1.06630481 2.45378448 -0.04069842 +H -16.76661563 -18.73181609 -28.28083433 0.00556479 -0.23604465 -0.16393823 +H -16.85661563 -18.90781609 -26.52683433 0.08395533 -0.32973933 0.13463769 +H -15.69915563 -17.74717609 -27.24931433 -0.15934070 0.00929485 0.01732586 +20 +Lattice="30.0 0.0 0.0 0.0 30.0 0.0 0.0 0.0 30.0" Properties=species:S:1:pos:R:3:forces:R:3 energy=-12893.1677077876 label=CC chargeA=1 energyA=-6669.20645149176 chargeB=-1 energyB=-6220.48400518575 distance=5.006824184225634 pbc="T T T" +C -23.00700000 -14.39400000 -25.47600000 0.43459402 -0.03173257 -0.22774235 +C -22.00600000 -15.99600000 -27.05600000 1.49835516 0.25958179 -1.29451915 +N -21.03500000 -16.32600000 -27.87900000 -0.18717521 0.52843518 -0.38081269 +N -22.00900000 -14.81000000 -26.46800000 -0.91183757 0.61930150 0.77731645 +N -22.97400000 -16.87300000 -26.85700000 -1.41850674 -1.15378383 0.75038878 +H -20.27200000 -15.69400000 -28.06100000 0.89823352 -0.29221301 0.29907890 +H -20.98400000 -17.25100000 -28.27500000 0.52133713 -0.25459785 -0.00899593 +H -21.30800000 -14.13600000 -26.74300000 0.21577552 0.01551702 0.03570694 +H -23.91000000 -16.51500000 -26.79400000 -0.43871202 -0.05582822 0.20362604 +H -22.88300000 -17.78900000 -27.27300000 0.00061863 -0.08455770 -0.07419726 +H -23.65000000 -13.61700000 -25.89000000 -0.26262378 0.16254165 -0.05603738 +H -22.47300000 -13.98600000 -24.61600000 -0.03637901 0.03977624 0.24647374 +H -23.61928000 -15.24549000 -25.14423000 0.23946776 0.13125252 -0.04208502 +C -16.47380781 -18.28640804 -27.36241716 0.87627377 -0.81692989 -0.07414438 +C -17.55980781 -17.27640804 -27.29241716 0.05112542 0.94756008 0.24418272 +O -18.74780781 -17.63940804 -27.28741716 -2.57880759 -1.90639979 -0.36739250 +O -17.24580781 -16.08740804 -27.20141716 1.16233982 2.45323382 -0.01960352 +H -16.53780781 -18.82840804 -28.30941716 0.00616419 -0.23738196 -0.16645320 +H -16.62780781 -19.00440804 -26.55541716 0.08651762 -0.33337084 0.13703914 +H -15.47034781 -17.84376804 -27.27789716 -0.15676063 0.00959585 0.01817065 +20 +Lattice="30.0 0.0 0.0 0.0 30.0 0.0 0.0 0.0 30.0" Properties=species:S:1:pos:R:3:forces:R:3 energy=-12893.0140684553 label=CC chargeA=1 energyA=-6669.20645149176 chargeB=-1 energyB=-6220.48400518575 distance=5.256317487073673 pbc="T T T" +C -23.00700000 -14.39400000 -25.47600000 0.41158763 -0.02468405 -0.21547798 +C -22.00600000 -15.99600000 -27.05600000 1.35062895 0.28656367 -1.09642632 +N -21.03500000 -16.32600000 -27.87900000 0.10613625 0.37195257 -0.40298376 +N -22.00900000 -14.81000000 -26.46800000 -0.89997220 0.56344393 0.72730295 +N -22.97400000 -16.87300000 -26.85700000 -1.35266404 -1.10133591 0.70012725 +H -20.27200000 -15.69400000 -28.06100000 0.88088158 -0.26483479 0.24977420 +H -20.98400000 -17.25100000 -28.27500000 0.48237148 -0.25272983 -0.05354677 +H -21.30800000 -14.13600000 -26.74300000 0.21253444 0.03101796 0.03137098 +H -23.91000000 -16.51500000 -26.79400000 -0.46009605 -0.05154162 0.21301411 +H -22.88300000 -17.78900000 -27.27300000 -0.00807123 -0.09671485 -0.07872654 +H -23.65000000 -13.61700000 -25.89000000 -0.25621082 0.15799530 -0.05757257 +H -22.47300000 -13.98600000 -24.61600000 -0.03152778 0.03933612 0.24259566 +H -23.61928000 -15.24549000 -25.14423000 0.24017265 0.13179811 -0.04285599 +C -16.24500000 -18.38300000 -27.39100000 0.87427010 -0.82974543 -0.07750313 +C -17.33100000 -17.37300000 -27.32100000 -0.05515903 0.98217868 0.24061288 +O -18.51900000 -17.73600000 -27.31600000 -2.65661035 -1.83634477 -0.36663795 +O -17.01700000 -16.18400000 -27.23000000 1.22001474 2.45621565 -0.00269790 +H -16.30900000 -18.92500000 -28.33800000 0.00717407 -0.23836723 -0.16838877 +H -16.39900000 -19.10100000 -26.58400000 0.08827673 -0.33523638 0.13920060 +H -15.24154000 -17.94036000 -27.30648000 -0.15373712 0.01103285 0.01881904 +20 +Lattice="30.0 0.0 0.0 0.0 30.0 0.0 0.0 0.0 30.0" Properties=species:S:1:pos:R:3:forces:R:3 energy=-12892.8432321992 label=CC chargeA=1 energyA=-6669.20645149176 chargeB=-1 energyB=-6220.48400518575 distance=5.505856757751566 pbc="T T T" +C -23.00700000 -14.39400000 -25.47600000 0.39916149 -0.01775610 -0.21100499 +C -22.00600000 -15.99600000 -27.05600000 1.21187915 0.28761816 -0.90582456 +N -21.03500000 -16.32600000 -27.87900000 0.34247310 0.26248459 -0.47747201 +N -22.00900000 -14.81000000 -26.46800000 -0.88620730 0.55585509 0.70173161 +N -22.97400000 -16.87300000 -26.85700000 -1.29678044 -1.07783474 0.66445600 +H -20.27200000 -15.69400000 -28.06100000 0.83115590 -0.23044869 0.20069474 +H -20.98400000 -17.25100000 -28.27500000 0.43044640 -0.23523314 -0.08845599 +H -21.30800000 -14.13600000 -26.74300000 0.20135023 0.04548187 0.02640477 +H -23.91000000 -16.51500000 -26.79400000 -0.50312557 -0.04176843 0.21021251 +H -22.88300000 -17.78900000 -27.27300000 -0.01922541 -0.10311262 -0.08309552 +H -23.65000000 -13.61700000 -25.89000000 -0.25273296 0.15369223 -0.05628033 +H -22.47300000 -13.98600000 -24.61600000 -0.02768290 0.04167217 0.24354047 +H -23.61928000 -15.24549000 -25.14423000 0.23987710 0.13146855 -0.04487909 +C -16.01619219 -18.47959196 -27.41958284 0.86839836 -0.83356499 -0.08342671 +C -17.10219219 -17.46959196 -27.34958284 -0.10983998 0.92858483 0.23620820 +O -18.29019219 -17.83259196 -27.34458284 -2.61015343 -1.77460085 -0.33681106 +O -16.78819219 -16.28059196 -27.25858284 1.23294218 2.46681259 0.01294300 +H -16.08019219 -19.02159196 -28.36658284 0.00825872 -0.23771487 -0.16954308 +H -16.17019219 -19.19759196 -26.61258284 0.08918367 -0.33456246 0.14121553 +H -15.01273219 -18.03695196 -27.33506284 -0.14937828 0.01292680 0.01938652 +20 +Lattice="30.0 0.0 0.0 0.0 30.0 0.0 0.0 0.0 30.0" Properties=species:S:1:pos:R:3:forces:R:3 energy=-12892.6802966608 label=CC chargeA=1 energyA=-6669.20645149176 chargeB=-1 energyB=-6220.48400518575 distance=5.755436022115563 pbc="T T T" +C -23.00700000 -14.39400000 -25.47600000 0.39585643 -0.01166427 -0.21145672 +C -22.00600000 -15.99600000 -27.05600000 1.08143934 0.27259669 -0.73119528 +N -21.03500000 -16.32600000 -27.87900000 0.54949599 0.17811848 -0.58285530 +N -22.00900000 -14.81000000 -26.46800000 -0.86892282 0.58540200 0.69671693 +N -22.97400000 -16.87300000 -26.85700000 -1.25394322 -1.07622043 0.64104568 +H -20.27200000 -15.69400000 -28.06100000 0.76691508 -0.19973567 0.15755589 +H -20.98400000 -17.25100000 -28.27500000 0.37995502 -0.21128882 -0.11200805 +H -21.30800000 -14.13600000 -26.74300000 0.18458223 0.05677178 0.02271150 +H -23.91000000 -16.51500000 -26.79400000 -0.55527662 -0.03120370 0.19863231 +H -22.88300000 -17.78900000 -27.27300000 -0.03142416 -0.10372944 -0.08477388 +H -23.65000000 -13.61700000 -25.89000000 -0.25157037 0.15013553 -0.05349515 +H -22.47300000 -13.98600000 -24.61600000 -0.02566511 0.04540745 0.24755385 +H -23.61928000 -15.24549000 -25.14423000 0.23889101 0.13049322 -0.04735936 +C -15.78738437 -18.57618391 -27.44816567 0.86382406 -0.82897871 -0.08976581 +C -16.87338437 -17.56618391 -27.37816567 -0.14106434 0.81436523 0.22889266 +O -18.06138437 -17.92918391 -27.37316567 -2.50953910 -1.70118986 -0.30090879 +O -16.55938437 -16.37718391 -27.28716567 1.22186878 2.48367929 0.02804914 +H -15.85138437 -19.11818391 -28.39516567 0.00888631 -0.23532718 -0.17000482 +H -15.94138437 -19.29418391 -26.64116567 0.08908399 -0.33153462 0.14289505 +H -14.78392437 -18.13354391 -27.36364567 -0.14339249 0.01390302 0.01977016 +20 +Lattice="30.0 0.0 0.0 0.0 30.0 0.0 0.0 0.0 30.0" Properties=species:S:1:pos:R:3:forces:R:3 energy=-12892.5339723581 label=CC chargeA=1 energyA=-6669.20645149176 chargeB=-1 energyB=-6220.48400518575 distance=6.005050284242796 pbc="T T T" +C -23.00700000 -14.39400000 -25.47600000 0.39689196 -0.00686499 -0.21320060 +C -22.00600000 -15.99600000 -27.05600000 0.96523630 0.25576767 -0.58668993 +N -21.03500000 -16.32600000 -27.87900000 0.72567633 0.11171094 -0.68853059 +N -22.00900000 -14.81000000 -26.46800000 -0.85011706 0.62809883 0.70282425 +N -22.97400000 -16.87300000 -26.85700000 -1.22368477 -1.08502279 0.62644191 +H -20.27200000 -15.69400000 -28.06100000 0.70342904 -0.17413269 0.12248202 +H -20.98400000 -17.25100000 -28.27500000 0.33607645 -0.18855338 -0.12800625 +H -21.30800000 -14.13600000 -26.74300000 0.16738239 0.06537495 0.02022106 +H -23.91000000 -16.51500000 -26.79400000 -0.60243318 -0.02280613 0.18450814 +H -22.88300000 -17.78900000 -27.27300000 -0.04277174 -0.10200798 -0.08437340 +H -23.65000000 -13.61700000 -25.89000000 -0.25150594 0.14750779 -0.05068322 +H -22.47300000 -13.98600000 -24.61600000 -0.02508880 0.04909797 0.25223791 +H -23.61928000 -15.24549000 -25.14423000 0.23781440 0.12943566 -0.04954432 +C -15.55857656 -18.67277587 -27.47674851 0.86192402 -0.82106256 -0.09545328 +C -16.64457656 -17.66277587 -27.40674851 -0.16282297 0.68844292 0.22099805 +O -17.83257656 -18.02577587 -27.40174851 -2.40075290 -1.62967567 -0.26849785 +O -16.33057656 -16.47377587 -27.31574851 1.20426760 2.50088031 0.04123542 +H -15.62257656 -19.21477587 -28.42374851 0.00911333 -0.23247144 -0.17018306 +H -15.71257656 -19.39077587 -26.66974851 0.08842270 -0.32780174 0.14422008 +H -14.55511656 -18.23013587 -27.39222851 -0.13705716 0.01408233 0.01999365 +20 +Lattice="30.0 0.0 0.0 0.0 30.0 0.0 0.0 0.0 30.0" Properties=species:S:1:pos:R:3:forces:R:3 energy=-12892.4055809716 label=CC chargeA=1 energyA=-6669.20645149176 chargeB=-1 energyB=-6220.48400518575 distance=6.254695358424409 pbc="T T T" +C -23.00700000 -14.39400000 -25.47600000 0.39953935 -0.00299888 -0.21528385 +C -22.00600000 -15.99600000 -27.05600000 0.86458025 0.23955575 -0.46770449 +N -21.03500000 -16.32600000 -27.87900000 0.87395583 0.05815390 -0.78518880 +N -22.00900000 -14.81000000 -26.46800000 -0.83193864 0.67290016 0.71364403 +N -22.97400000 -16.87300000 -26.85700000 -1.20127527 -1.09772419 0.61723851 +H -20.27200000 -15.69400000 -28.06100000 0.64634932 -0.15310071 0.09442263 +H -20.98400000 -17.25100000 -28.27500000 0.29927973 -0.16844914 -0.13883028 +H -21.30800000 -14.13600000 -26.74300000 0.15156478 0.07225845 0.01835971 +H -23.91000000 -16.51500000 -26.79400000 -0.64372570 -0.01601356 0.17038524 +H -22.88300000 -17.78900000 -27.27300000 -0.05284621 -0.09958786 -0.08318201 +H -23.65000000 -13.61700000 -25.89000000 -0.25191530 0.14548234 -0.04810467 +H -22.47300000 -13.98600000 -24.61600000 -0.02518228 0.05250554 0.25688219 +H -23.61928000 -15.24549000 -25.14423000 0.23673788 0.12846061 -0.05142423 +C -15.32976875 -18.76936783 -27.50533135 0.86193304 -0.81204704 -0.10022343 +C -16.41576875 -17.75936783 -27.43533135 -0.17827399 0.56582351 0.21310211 +O -17.60376875 -18.12236783 -27.43033135 -2.29888822 -1.56195371 -0.24156360 +O -16.10176875 -16.57036783 -27.34433135 1.18448726 2.51650990 0.05224500 +H -15.39376875 -19.31136783 -28.45233135 0.00903563 -0.22953644 -0.17023660 +H -15.48376875 -19.48736783 -26.69833135 0.08749948 -0.32401895 0.14530842 +H -14.32630875 -18.32672783 -27.42081135 -0.13091695 0.01378031 0.02015411 +20 +Lattice="30.0 0.0 0.0 0.0 30.0 0.0 0.0 0.0 30.0" Properties=species:S:1:pos:R:3:forces:R:3 energy=-12892.2940038267 label=CC chargeA=1 energyA=-6669.20645149176 chargeB=-1 energyB=-6220.48400518575 distance=6.504367695780043 pbc="T T T" +C -23.00700000 -14.39400000 -25.47600000 0.40220503 0.00038620 -0.21770373 +C -22.00600000 -15.99600000 -27.05600000 0.77965074 0.22295095 -0.36584244 +N -21.03500000 -16.32600000 -27.87900000 0.99772235 0.01382563 -0.87045310 +N -22.00900000 -14.81000000 -26.46800000 -0.81618073 0.71430208 0.72495303 +N -22.97400000 -16.87300000 -26.85700000 -1.18237162 -1.11049799 0.61065966 +H -20.27200000 -15.69400000 -28.06100000 0.59745735 -0.13525144 0.07154627 +H -20.98400000 -17.25100000 -28.27500000 0.26852095 -0.15060917 -0.14615601 +H -21.30800000 -14.13600000 -26.74300000 0.13776989 0.07835927 0.01640100 +H -23.91000000 -16.51500000 -26.79400000 -0.68142259 -0.00959743 0.15735459 +H -22.88300000 -17.78900000 -27.27300000 -0.06167584 -0.09725480 -0.08236416 +H -23.65000000 -13.61700000 -25.89000000 -0.25242442 0.14368223 -0.04564938 +H -22.47300000 -13.98600000 -24.61600000 -0.02519567 0.05573715 0.26132899 +H -23.61928000 -15.24549000 -25.14423000 0.23566621 0.12761077 -0.05315764 +C -15.10096094 -18.86595979 -27.53391418 0.86251015 -0.80275378 -0.10412090 +C -16.18696094 -17.85595979 -27.46391418 -0.18670198 0.45092710 0.20550798 +O -17.37496094 -18.21895979 -27.45891418 -2.20848540 -1.49759882 -0.21985699 +O -15.87296094 -16.66695979 -27.37291418 1.16291050 2.52960146 0.06125702 +H -15.16496094 -19.40795979 -28.48091418 0.00879190 -0.22668912 -0.17024868 +H -15.25496094 -19.58395979 -26.72691418 0.08649815 -0.32042983 0.14625022 +H -14.09750094 -18.42331979 -27.44939418 -0.12524497 0.01329954 0.02029427 +20 +Lattice="30.0 0.0 0.0 0.0 30.0 0.0 0.0 0.0 30.0" Properties=species:S:1:pos:R:3:forces:R:3 energy=-12892.197751642 label=CC chargeA=1 energyA=-6669.20645149176 chargeB=-1 energyB=-6220.48400518575 distance=6.754064280802951 pbc="T T T" +C -23.00700000 -14.39400000 -25.47600000 0.40400951 0.00343135 -0.22054431 +C -22.00600000 -15.99600000 -27.05600000 0.71177254 0.20638074 -0.27691827 +N -21.03500000 -16.32600000 -27.87900000 1.10090951 -0.02364758 -0.94100700 +N -22.00900000 -14.81000000 -26.46800000 -0.80415099 0.74896781 0.73424430 +N -22.97400000 -16.87300000 -26.85700000 -1.16653463 -1.12206883 0.60551292 +H -20.27200000 -15.69400000 -28.06100000 0.55688604 -0.11860021 0.05224756 +H -20.98400000 -17.25100000 -28.27500000 0.24200218 -0.13489310 -0.15207903 +H -21.30800000 -14.13600000 -26.74300000 0.12652209 0.08460412 0.01365610 +H -23.91000000 -16.51500000 -26.79400000 -0.71513904 -0.00302406 0.14611771 +H -22.88300000 -17.78900000 -27.27300000 -0.06925562 -0.09568847 -0.08291832 +H -23.65000000 -13.61700000 -25.89000000 -0.25288266 0.14195932 -0.04323936 +H -22.47300000 -13.98600000 -24.61600000 -0.02476313 0.05876782 0.26535824 +H -23.61928000 -15.24549000 -25.14423000 0.23473242 0.12696447 -0.05478713 +C -14.87215312 -18.96255174 -27.56249702 0.86142660 -0.79509014 -0.10736012 +C -15.95815312 -17.95255174 -27.49249702 -0.18405997 0.35280421 0.19895104 +O -17.14615312 -18.31555174 -27.48749702 -2.13392745 -1.44075963 -0.20268495 +O -15.64415312 -16.76355174 -27.40149702 1.13882622 2.53854930 0.06817521 +H -14.93615312 -19.50455174 -28.50949702 0.00865789 -0.22438435 -0.17030191 +H -15.02615312 -19.68055174 -26.75549702 0.08574245 -0.31758612 0.14710002 +H -13.86869312 -18.51991174 -27.47797702 -0.12077395 0.01331335 0.02047731 +20 +Lattice="30.0 0.0 0.0 0.0 30.0 0.0 0.0 0.0 30.0" Properties=species:S:1:pos:R:3:forces:R:3 energy=-12892.1146266445 label=CC chargeA=1 energyA=-6669.20645149176 chargeB=-1 energyB=-6220.48400518575 distance=7.003782507908067 pbc="T T T" +C -23.00700000 -14.39400000 -25.47600000 0.40518715 0.00610771 -0.22358198 +C -22.00600000 -15.99600000 -27.05600000 0.65800758 0.19074523 -0.19981885 +N -21.03500000 -16.32600000 -27.87900000 1.18781631 -0.05570305 -0.99875100 +N -22.00900000 -14.81000000 -26.46800000 -0.79513011 0.77778003 0.74180506 +N -22.97400000 -16.87300000 -26.85700000 -1.15393191 -1.13274083 0.60161844 +H -20.27200000 -15.69400000 -28.06100000 0.52329199 -0.10308997 0.03588731 +H -20.98400000 -17.25100000 -28.27500000 0.21903688 -0.12120639 -0.15717378 +H -21.30800000 -14.13600000 -26.74300000 0.11741457 0.09083881 0.01036549 +H -23.91000000 -16.51500000 -26.79400000 -0.74455621 0.00338389 0.13650909 +H -22.88300000 -17.78900000 -27.27300000 -0.07572741 -0.09473217 -0.08449395 +H -23.65000000 -13.61700000 -25.89000000 -0.25328384 0.14034423 -0.04091483 +H -22.47300000 -13.98600000 -24.61600000 -0.02404759 0.06154357 0.26895157 +H -23.61928000 -15.24549000 -25.14423000 0.23397468 0.12649261 -0.05627295 +C -14.64334531 -19.05914370 -27.59107986 0.85886853 -0.78934905 -0.11002960 +C -15.72934531 -18.04914370 -27.52107986 -0.17363782 0.27207620 0.19346736 +O -16.91734531 -18.41214370 -27.51607986 -2.07384912 -1.39217323 -0.18911137 +O -15.41534531 -16.86014370 -27.43007986 1.11415688 2.54394316 0.07337092 +H -14.70734531 -19.60114370 -28.53807986 0.00862741 -0.22259695 -0.17040025 +H -14.79734531 -19.77714370 -26.78407986 0.08523012 -0.31545791 0.14787677 +H -13.63988531 -18.61650370 -27.50655986 -0.11744807 0.01379411 0.02069656 +20 +Lattice="30.0 0.0 0.0 0.0 30.0 0.0 0.0 0.0 30.0" Properties=species:S:1:pos:R:3:forces:R:3 energy=-12892.0423757153 label=CC chargeA=1 energyA=-6669.20645149176 chargeB=-1 energyB=-6220.48400518575 distance=7.253520146110052 pbc="T T T" +C -23.00700000 -14.39400000 -25.47600000 0.40594325 0.00843692 -0.22659869 +C -22.00600000 -15.99600000 -27.05600000 0.61499923 0.17645209 -0.13329925 +N -21.03500000 -16.32600000 -27.87900000 1.26124616 -0.08320451 -1.04635254 +N -22.00900000 -14.81000000 -26.46800000 -0.78830588 0.80187238 0.74814004 +N -22.97400000 -16.87300000 -26.85700000 -1.14395319 -1.14249604 0.59872877 +H -20.27200000 -15.69400000 -28.06100000 0.49564480 -0.08902593 0.02210883 +H -20.98400000 -17.25100000 -28.27500000 0.19932915 -0.10947395 -0.16155152 +H -21.30800000 -14.13600000 -26.74300000 0.10997363 0.09685930 0.00684815 +H -23.91000000 -16.51500000 -26.79400000 -0.77006938 0.00939249 0.12828739 +H -22.88300000 -17.78900000 -27.27300000 -0.08125841 -0.09416850 -0.08662819 +H -23.65000000 -13.61700000 -25.89000000 -0.25365325 0.13887875 -0.03874626 +H -22.47300000 -13.98600000 -24.61600000 -0.02321979 0.06407154 0.27214809 +H -23.61928000 -15.24549000 -25.14423000 0.23333309 0.12615880 -0.05760007 +C -14.41453750 -19.15573566 -27.61966269 0.85560410 -0.78500721 -0.11219418 +C -15.50053750 -18.14573566 -27.54966269 -0.15977293 0.20569993 0.18869983 +O -16.68853750 -18.50873566 -27.54466269 -2.02499867 -1.35087255 -0.17835032 +O -15.18653750 -16.95673566 -27.45866269 1.09063827 2.54677632 0.07734492 +H -14.47853750 -19.69773566 -28.56666269 0.00863049 -0.22111645 -0.17050005 +H -14.56853750 -19.87373566 -26.81266269 0.08487203 -0.31378060 0.14858018 +H -13.41107750 -18.71309566 -27.53514269 -0.11498270 0.01454722 0.02093488 +20 +Lattice="30.0 0.0 0.0 0.0 30.0 0.0 0.0 0.0 30.0" Properties=species:S:1:pos:R:3:forces:R:3 energy=-12891.9790977749 label=CC chargeA=1 energyA=-6669.20645149176 chargeB=-1 energyB=-6220.48400518575 distance=7.503275268555756 pbc="T T T" +C -23.00700000 -14.39400000 -25.47600000 0.40638588 0.01046042 -0.22951060 +C -22.00600000 -15.99600000 -27.05600000 0.58032544 0.16343747 -0.07557086 +N -21.03500000 -16.32600000 -27.87900000 1.32345992 -0.10696109 -1.08600098 +N -22.00900000 -14.81000000 -26.46800000 -0.78316506 0.82206752 0.75347464 +N -22.97400000 -16.87300000 -26.85700000 -1.13586690 -1.15121262 0.59652640 +H -20.27200000 -15.69400000 -28.06100000 0.47301248 -0.07638548 0.01047380 +H -20.98400000 -17.25100000 -28.27500000 0.18247461 -0.09949056 -0.16529332 +H -21.30800000 -14.13600000 -26.74300000 0.10388532 0.10253966 0.00325707 +H -23.91000000 -16.51500000 -26.79400000 -0.79233772 0.01496042 0.12122890 +H -22.88300000 -17.78900000 -27.27300000 -0.08598903 -0.09388519 -0.08906118 +H -23.65000000 -13.61700000 -25.89000000 -0.25397198 0.13754339 -0.03674904 +H -22.47300000 -13.98600000 -24.61600000 -0.02232651 0.06636538 0.27498928 +H -23.61928000 -15.24549000 -25.14423000 0.23278647 0.12592457 -0.05879412 +C -14.18572968 -19.25232762 -27.64824553 0.85210772 -0.78165919 -0.11394346 +C -15.27172968 -18.24232762 -27.57824553 -0.14520282 0.15082281 0.18456141 +O -16.45972968 -18.60532762 -27.57324553 -1.98470925 -1.31552534 -0.16980311 +O -14.95772968 -17.05332762 -27.48724553 1.06904064 2.54781462 0.08042895 +H -14.24972968 -19.79432762 -28.59524553 0.00862223 -0.21982524 -0.17059389 +H -14.33972968 -19.97032762 -26.84124553 0.08459992 -0.31239507 0.14921124 +H -13.18226968 -18.80968762 -27.56372553 -0.11313136 0.01540350 0.02116887 +20 +Lattice="30.0 0.0 0.0 0.0 30.0 0.0 0.0 0.0 30.0" Properties=species:S:1:pos:R:3:forces:R:3 energy=-12891.9232148018 label=CC chargeA=1 energyA=-6669.20645149176 chargeB=-1 energyB=-6220.48400518575 distance=7.753046163349467 pbc="T T T" +C -23.00700000 -14.39400000 -25.47600000 0.40654714 0.01223187 -0.23226766 +C -22.00600000 -15.99600000 -27.05600000 0.55221727 0.15157930 -0.02509914 +N -21.03500000 -16.32600000 -27.87900000 1.37621044 -0.12759814 -1.11925263 +N -22.00900000 -14.81000000 -26.46800000 -0.77940039 0.83891969 0.75790966 +N -22.97400000 -16.87300000 -26.85700000 -1.12913732 -1.15882431 0.59476385 +H -20.27200000 -15.69400000 -28.06100000 0.45438155 -0.06488567 0.00052484 +H -20.98400000 -17.25100000 -28.27500000 0.16795737 -0.09100135 -0.16852461 +H -21.30800000 -14.13600000 -26.74300000 0.09892791 0.10788269 -0.00032066 +H -23.91000000 -16.51500000 -26.79400000 -0.81193389 0.02012717 0.11517325 +H -22.88300000 -17.78900000 -27.27300000 -0.09003959 -0.09382681 -0.09166970 +H -23.65000000 -13.61700000 -25.89000000 -0.25423753 0.13631859 -0.03490068 +H -22.47300000 -13.98600000 -24.61600000 -0.02138898 0.06844753 0.27753199 +H -23.61928000 -15.24549000 -25.14423000 0.23230863 0.12576843 -0.05985997 +C -13.95692187 -19.34891957 -27.67682837 0.84864266 -0.77905687 -0.11534825 +C -15.04292187 -18.33891957 -27.60682837 -0.13077907 0.10486906 0.18094197 +O -16.23092187 -18.70191957 -27.60182837 -1.95098282 -1.28502217 -0.16294364 +O -14.72892187 -17.14991957 -27.51582837 1.04946204 2.54761573 0.08281733 +H -14.02092187 -19.89091957 -28.62382837 0.00859288 -0.21864627 -0.17066608 +H -14.11092187 -20.06691957 -26.86982837 0.08438080 -0.31120311 0.14978517 +H -12.95346187 -18.90627957 -27.59230837 -0.11172908 0.01630464 0.02140497 +20 +Lattice="30.0 0.0 0.0 0.0 30.0 0.0 0.0 0.0 30.0" Properties=species:S:1:pos:R:3:forces:R:3 energy=-12893.7854046654 label=CC chargeA=1 energyA=-6669.20645149176 chargeB=-1 energyB=-6220.48400518575 distance=4.169831093811181 pbc="T T T" +C 12.78700000 35.93500000 8.14300000 0.06990787 -0.17685370 -0.19036263 +C 12.50200000 35.31700000 5.75900000 1.40153631 -1.42415412 0.49266099 +N 13.33700000 34.30300000 5.87400000 -1.77378893 2.39057157 -1.89035931 +N 12.22000000 36.09300000 6.79800000 -0.25583760 0.77562824 0.99548626 +N 11.93800000 35.55500000 4.59100000 -1.15466944 0.81960625 -1.55275017 +H 13.73100000 34.01500000 6.77000000 1.15708786 -1.28425261 1.45116420 +H 13.57300000 33.74600000 5.07200000 0.06603431 -0.26617592 -0.12233835 +H 11.60800000 36.88200000 6.64200000 -0.09461352 -0.01015467 0.01063562 +H 11.31200000 36.33700000 4.47600000 -0.09418678 0.04881645 -0.25688032 +H 12.19300000 35.00900000 3.78400000 -0.06203831 0.01366501 -0.12933965 +H 12.75000000 36.88800000 8.67500000 -0.15758637 0.11788689 -0.06214826 +H 13.83900000 35.65300000 8.06400000 0.15699889 -0.18360150 0.07973422 +H 12.25752000 35.16852000 8.72794600 0.04646349 0.02598078 -0.07165629 +C 13.40355816 31.21451667 8.58561965 0.20503098 -0.34846444 -0.05087109 +C 14.31455816 32.43651667 8.49761965 0.75751356 -0.11434983 2.56531413 +O 14.41755816 33.00851667 7.38861965 0.38171586 -0.25719196 -1.43453057 +O 14.90855816 32.84051667 9.52061965 -0.28958907 -0.29080009 0.40282403 +H 13.60955816 30.55151667 7.74161965 -0.03634911 -0.14276449 -0.22895696 +H 12.36755816 31.54351667 8.49061965 -0.33471873 0.03289626 0.00997757 +H 13.52358816 30.63377667 9.51207965 0.01108872 0.27371190 -0.01760341 +20 +Lattice="30.0 0.0 0.0 0.0 30.0 0.0 0.0 0.0 30.0" Properties=species:S:1:pos:R:3:forces:R:3 energy=-12893.8928427033 label=CC chargeA=1 energyA=-6669.20645149176 chargeB=-1 energyB=-6220.48400518575 distance=4.41568261761627 pbc="T T T" +C 12.78700000 35.93500000 8.14300000 0.06074110 -0.19442319 -0.14713490 +C 12.50200000 35.31700000 5.75900000 1.17847026 -1.10377940 0.72902239 +N 13.33700000 34.30300000 5.87400000 -0.76842058 1.24633289 -0.67847781 +N 12.22000000 36.09300000 6.79800000 -0.20204879 0.67677610 0.91548796 +N 11.93800000 35.55500000 4.59100000 -1.00467213 0.69524642 -1.46523217 +H 13.73100000 34.01500000 6.77000000 1.00583324 -1.36000377 1.13805591 +H 13.57300000 33.74600000 5.07200000 0.10037594 -0.32066066 -0.09165506 +H 11.60800000 36.88200000 6.64200000 -0.10229299 -0.00487636 0.00392576 +H 11.31200000 36.33700000 4.47600000 -0.07831889 0.04403933 -0.23509207 +H 12.19300000 35.00900000 3.78400000 -0.07122643 0.00317275 -0.15550044 +H 12.75000000 36.88800000 8.67500000 -0.15090405 0.11559264 -0.06939287 +H 13.83900000 35.65300000 8.06400000 0.16814267 -0.17581282 0.08284082 +H 12.25752000 35.16852000 8.72794600 0.04771037 0.02579786 -0.08258382 +C 13.46977908 31.00525834 8.70530982 0.18028299 -0.38470245 -0.03477122 +C 14.38077908 32.22725834 8.61730982 0.70160868 0.11206593 2.13237768 +O 14.48377908 32.79925834 7.50830982 -0.49478014 0.78137643 -2.40075389 +O 14.97477908 32.63125834 9.64030982 -0.20822175 -0.29923480 0.57983147 +H 13.67577908 30.34225834 7.86130982 -0.03530167 -0.14412599 -0.22732823 +H 12.43377908 31.33425834 8.61030982 -0.33303101 0.03091557 0.01436199 +H 13.58980908 30.42451834 9.63176982 0.00605319 0.25630352 -0.00798147 +20 +Lattice="30.0 0.0 0.0 0.0 30.0 0.0 0.0 0.0 30.0" Properties=species:S:1:pos:R:3:forces:R:3 energy=-12893.7226339314 label=CC chargeA=1 energyA=-6669.20645149176 chargeB=-1 energyB=-6220.48400518575 distance=4.6619754095544765 pbc="T T T" +C 12.78700000 35.93500000 8.14300000 0.04831058 -0.20660842 -0.12353301 +C 12.50200000 35.31700000 5.75900000 0.99753844 -0.86262700 0.85385801 +N 13.33700000 34.30300000 5.87400000 -0.24744139 0.60854695 -0.10178887 +N 12.22000000 36.09300000 6.79800000 -0.16079261 0.60643679 0.86471234 +N 11.93800000 35.55500000 4.59100000 -0.89813542 0.61010616 -1.39475844 +H 13.73100000 34.01500000 6.77000000 0.75855209 -1.16640088 0.82801878 +H 13.57300000 33.74600000 5.07200000 0.11756340 -0.35443868 -0.08696340 +H 11.60800000 36.88200000 6.64200000 -0.10884580 0.00034048 0.00022271 +H 11.31200000 36.33700000 4.47600000 -0.07324854 0.04540823 -0.22279593 +H 12.19300000 35.00900000 3.78400000 -0.07814894 -0.00484925 -0.17480180 +H 12.75000000 36.88800000 8.67500000 -0.14383282 0.11186488 -0.07265111 +H 13.83900000 35.65300000 8.06400000 0.17621416 -0.15728766 0.08517367 +H 12.25752000 35.16852000 8.72794600 0.04465929 0.02640740 -0.08717925 +C 13.53600000 30.79600000 8.82500000 0.15911221 -0.40897513 -0.02023662 +C 14.44700000 32.01800000 8.73700000 0.66340735 0.25780530 1.81621061 +O 14.55000000 32.59000000 7.62800000 -0.74693881 1.07046139 -2.67447860 +O 15.04100000 32.42200000 9.76000000 -0.14318544 -0.30327619 0.71979599 +H 13.74200000 30.13300000 7.98100000 -0.03421153 -0.14472515 -0.22633218 +H 12.50000000 31.12500000 8.73000000 -0.33250326 0.02926547 0.01720684 +H 13.65603000 30.21526000 9.75146000 0.00192705 0.24254528 0.00032025 +20 +Lattice="30.0 0.0 0.0 0.0 30.0 0.0 0.0 0.0 30.0" Properties=species:S:1:pos:R:3:forces:R:3 energy=-12893.4738142045 label=CC chargeA=1 energyA=-6669.20645149176 chargeB=-1 energyB=-6220.48400518575 distance=4.908643036894216 pbc="T T T" +C 12.78700000 35.93500000 8.14300000 0.03388287 -0.21565397 -0.11420084 +C 12.50200000 35.31700000 5.75900000 0.85505530 -0.67261095 0.91105836 +N 13.33700000 34.30300000 5.87400000 0.04675998 0.23215382 0.19300604 +N 12.22000000 36.09300000 6.79800000 -0.12922847 0.55628259 0.83824206 +N 11.93800000 35.55500000 4.59100000 -0.82125812 0.54971716 -1.33978547 +H 13.73100000 34.01500000 6.77000000 0.53912770 -0.92620950 0.56757542 +H 13.57300000 33.74600000 5.07200000 0.12493700 -0.37421211 -0.09633163 +H 11.60800000 36.88200000 6.64200000 -0.11548088 0.00574833 -0.00175461 +H 11.31200000 36.33700000 4.47600000 -0.07537974 0.05007156 -0.21523871 +H 12.19300000 35.00900000 3.78400000 -0.08342180 -0.01182594 -0.18974212 +H 12.75000000 36.88800000 8.67500000 -0.13735327 0.10777393 -0.07310087 +H 13.83900000 35.65300000 8.06400000 0.18264087 -0.13507132 0.08546422 +H 12.25752000 35.16852000 8.72794600 0.03907927 0.02807481 -0.08721817 +C 13.60222092 30.58674166 8.94469018 0.14188322 -0.42478482 -0.00549583 +C 14.51322092 31.80874166 8.85669018 0.62969373 0.34935027 1.55919906 +O 14.61622092 32.38074166 7.74769018 -0.77800875 1.06699784 -2.66555079 +O 15.10722092 32.21274166 9.87969018 -0.08654672 -0.30113701 0.83256988 +H 13.80822092 29.92374166 8.10069018 -0.03263262 -0.14410327 -0.22543553 +H 12.56622092 30.91574166 8.84969018 -0.33201714 0.02837143 0.01915216 +H 13.72225092 30.00600166 9.87115018 -0.00173241 0.23106715 0.00758736 +20 +Lattice="30.0 0.0 0.0 0.0 30.0 0.0 0.0 0.0 30.0" Properties=species:S:1:pos:R:3:forces:R:3 energy=-12893.2236393787 label=CC chargeA=1 energyA=-6669.20645149176 chargeB=-1 energyB=-6220.48400518575 distance=5.155631685807265 pbc="T T T" +C 12.78700000 35.93500000 8.14300000 0.01668301 -0.22393470 -0.11742629 +C 12.50200000 35.31700000 5.75900000 0.74579141 -0.50511208 0.92253707 +N 13.33700000 34.30300000 5.87400000 0.23618893 -0.02064479 0.36418774 +N 12.22000000 36.09300000 6.79800000 -0.10242486 0.51744745 0.83690392 +N 11.93800000 35.55500000 4.59100000 -0.76036900 0.50189584 -1.29600466 +H 13.73100000 34.01500000 6.77000000 0.36514194 -0.70734887 0.35925323 +H 13.57300000 33.74600000 5.07200000 0.12579504 -0.38522412 -0.11450360 +H 11.60800000 36.88200000 6.64200000 -0.12661511 0.01429431 -0.00449645 +H 11.31200000 36.33700000 4.47600000 -0.08784592 0.06191251 -0.20863132 +H 12.19300000 35.00900000 3.78400000 -0.08704686 -0.02204468 -0.20385405 +H 12.75000000 36.88800000 8.67500000 -0.13224187 0.10444248 -0.07143746 +H 13.83900000 35.65300000 8.06400000 0.18820004 -0.11258797 0.08338766 +H 12.25752000 35.16852000 8.72794600 0.03250063 0.03106753 -0.08328690 +C 13.66844184 30.37748333 9.06438035 0.12960861 -0.43187420 0.01186273 +C 14.57944184 31.59948333 8.97638035 0.57947305 0.38982992 1.31532504 +O 14.68244184 32.17148333 7.86738035 -0.72927298 0.96602282 -2.52910929 +O 15.17344184 32.00348333 9.99938035 -0.02882387 -0.28631835 0.92392022 +H 13.87444184 29.71448333 8.22038035 -0.02953631 -0.14122651 -0.22374509 +H 12.63244184 30.70648333 8.96938035 -0.33003436 0.02857311 0.02095541 +H 13.78847184 29.79674333 9.99084035 -0.00517153 0.22083030 0.01416210 +20 +Lattice="30.0 0.0 0.0 0.0 30.0 0.0 0.0 0.0 30.0" Properties=species:S:1:pos:R:3:forces:R:3 energy=-12892.9993584234 label=CC chargeA=1 energyA=-6669.20645149176 chargeB=-1 energyB=-6220.48400518575 distance=5.402897354813886 pbc="T T T" +C 12.78700000 35.93500000 8.14300000 -0.00110551 -0.23405947 -0.12964229 +C 12.50200000 35.31700000 5.75900000 0.65678054 -0.34464517 0.90136182 +N 13.33700000 34.30300000 5.87400000 0.36946528 -0.20847160 0.48022556 +N 12.22000000 36.09300000 6.79800000 -0.06868728 0.47195187 0.85156904 +N 11.93800000 35.55500000 4.59100000 -0.69884535 0.45481154 -1.24585979 +H 13.73100000 34.01500000 6.77000000 0.23170432 -0.52518459 0.19760647 +H 13.57300000 33.74600000 5.07200000 0.12182941 -0.39053286 -0.14101929 +H 11.60800000 36.88200000 6.64200000 -0.14886182 0.03315851 -0.01272847 +H 11.31200000 36.33700000 4.47600000 -0.11535635 0.09021345 -0.20007080 +H 12.19300000 35.00900000 3.78400000 -0.08664618 -0.04163778 -0.22321209 +H 12.75000000 36.88800000 8.67500000 -0.12927856 0.10307108 -0.06884708 +H 13.83900000 35.65300000 8.06400000 0.19300536 -0.09151808 0.07965748 +H 12.25752000 35.16852000 8.72794600 0.02568620 0.03536330 -0.07658480 +C 13.73466276 30.16822499 9.18407053 0.12302743 -0.42925553 0.03199809 +C 14.64566276 31.39022499 9.09607053 0.50381350 0.37970005 1.06697445 +O 14.74866276 31.96222499 7.98707053 -0.65063382 0.84575121 -2.32923071 +O 15.23966276 31.79422499 10.11907053 0.03274916 -0.25419942 0.99591658 +H 13.94066276 29.50522499 8.34007053 -0.02438421 -0.13602586 -0.22115788 +H 12.69866276 30.49722499 9.08907053 -0.32603593 0.02988371 0.02313221 +H 13.85469276 29.58748499 10.11053053 -0.00822620 0.21162563 0.01991150 +20 +Lattice="30.0 0.0 0.0 0.0 30.0 0.0 0.0 0.0 30.0" Properties=species:S:1:pos:R:3:forces:R:3 energy=-12892.8071395579 label=CC chargeA=1 energyA=-6669.20645149176 chargeB=-1 energyB=-6220.48400518575 distance=5.650403657431074 pbc="T T T" +C 12.78700000 35.93500000 8.14300000 -0.01510686 -0.24491575 -0.14383599 +C 12.50200000 35.31700000 5.75900000 0.57584340 -0.20455484 0.86756718 +N 13.33700000 34.30300000 5.87400000 0.46427009 -0.34516843 0.56204377 +N 12.22000000 36.09300000 6.79800000 -0.02821288 0.41834707 0.86723767 +N 11.93800000 35.55500000 4.59100000 -0.63793821 0.40838198 -1.18608153 +H 13.73100000 34.01500000 6.77000000 0.13396526 -0.38235923 0.07992456 +H 13.57300000 33.74600000 5.07200000 0.11619291 -0.39175091 -0.17160657 +H 11.60800000 36.88200000 6.64200000 -0.17699770 0.06019238 -0.02519916 +H 11.31200000 36.33700000 4.47600000 -0.14859979 0.12888783 -0.19093385 +H 12.19300000 35.00900000 3.78400000 -0.08158943 -0.06624299 -0.24700627 +H 12.75000000 36.88800000 8.67500000 -0.12799610 0.10325799 -0.06640284 +H 13.83900000 35.65300000 8.06400000 0.19713997 -0.07325430 0.07588030 +H 12.25752000 35.16852000 8.72794600 0.01870899 0.04001729 -0.06973249 +C 13.80088368 29.95896666 9.30376071 0.11974623 -0.42069828 0.04913041 +C 14.71188368 31.18096666 9.21576071 0.42471610 0.34219486 0.84932484 +O 14.81488368 31.75296666 8.10676071 -0.57184392 0.73723429 -2.12913014 +O 15.30588368 31.58496666 10.23876071 0.08883936 -0.21430102 1.04770599 +H 14.00688368 29.29596666 8.45976071 -0.01897360 -0.13103354 -0.21881227 +H 12.76488368 30.28796666 9.20876071 -0.32193338 0.03140562 0.02530873 +H 13.92091368 29.37822666 10.23022071 -0.01023044 0.20435999 0.02461767 +20 +Lattice="30.0 0.0 0.0 0.0 30.0 0.0 0.0 0.0 30.0" Properties=species:S:1:pos:R:3:forces:R:3 energy=-12892.6447062465 label=CC chargeA=1 energyA=-6669.20645149176 chargeB=-1 energyB=-6220.48400518575 distance=5.898120314460774 pbc="T T T" +C 12.78700000 35.93500000 8.14300000 -0.02320110 -0.25204725 -0.15930411 +C 12.50200000 35.31700000 5.75900000 0.48229462 -0.10616813 0.84040354 +N 13.33700000 34.30300000 5.87400000 0.54583311 -0.44801227 0.61790001 +N 12.22000000 36.09300000 6.79800000 0.01094197 0.37604280 0.88600319 +N 11.93800000 35.55500000 4.59100000 -0.59235042 0.36809692 -1.13306466 +H 13.73100000 34.01500000 6.77000000 0.06360007 -0.27200055 -0.00608961 +H 13.57300000 33.74600000 5.07200000 0.11263493 -0.38788191 -0.20048945 +H 11.60800000 36.88200000 6.64200000 -0.19986427 0.09009064 -0.03822269 +H 11.31200000 36.33700000 4.47600000 -0.17331740 0.16719115 -0.18419056 +H 12.19300000 35.00900000 3.78400000 -0.07144319 -0.08649894 -0.27156542 +H 12.75000000 36.88800000 8.67500000 -0.12696300 0.10340387 -0.06441010 +H 13.83900000 35.65300000 8.06400000 0.20060338 -0.05754684 0.07407749 +H 12.25752000 35.16852000 8.72794600 0.01065406 0.04315474 -0.06422181 +C 13.86710460 29.74970832 9.42345089 0.11777134 -0.40952196 0.06077980 +C 14.77810460 30.97170832 9.33545089 0.35562779 0.29539817 0.67729419 +O 14.88110460 31.54370832 8.22645089 -0.50419221 0.64590046 -1.95551209 +O 15.37210460 31.37570832 10.35845089 0.13528377 -0.17414187 1.08239147 +H 14.07310460 29.08670832 8.57945089 -0.01435867 -0.12742858 -0.21727410 +H 12.83110460 30.07870832 9.32845089 -0.31860576 0.03271467 0.02716351 +H 13.98713460 29.16896832 10.34991089 -0.01094903 0.19925490 0.02833139 +20 +Lattice="30.0 0.0 0.0 0.0 30.0 0.0 0.0 0.0 30.0" Properties=species:S:1:pos:R:3:forces:R:3 energy=-12892.5086361853 label=CC chargeA=1 energyA=-6669.20645149176 chargeB=-1 energyB=-6220.48400518575 distance=6.146021878892945 pbc="T T T" +C 12.78700000 35.93500000 8.14300000 -0.02097832 -0.24773868 -0.18148748 +C 12.50200000 35.31700000 5.75900000 0.32401811 -0.08982086 0.84512506 +N 13.33700000 34.30300000 5.87400000 0.65173958 -0.53645624 0.65058430 +N 12.22000000 36.09300000 6.79800000 0.04390051 0.37707711 0.92091203 +N 11.93800000 35.55500000 4.59100000 -0.58353856 0.33964815 -1.11024945 +H 13.73100000 34.01500000 6.77000000 0.01296828 -0.18347559 -0.07807125 +H 13.57300000 33.74600000 5.07200000 0.11798761 -0.37379482 -0.22207755 +H 11.60800000 36.88200000 6.64200000 -0.20315932 0.12206693 -0.04973922 +H 11.31200000 36.33700000 4.47600000 -0.17068191 0.19778710 -0.18400926 +H 12.19300000 35.00900000 3.78400000 -0.05162477 -0.09043743 -0.29539248 +H 12.75000000 36.88800000 8.67500000 -0.12365439 0.10054478 -0.06321870 +H 13.83900000 35.65300000 8.06400000 0.20300063 -0.04265622 0.07818092 +H 12.25752000 35.16852000 8.72794600 -0.00158513 0.04069981 -0.06123205 +C 13.93332552 29.54044998 9.54314106 0.11639007 -0.39702832 0.06679567 +C 14.84432552 30.76244998 9.45514106 0.30064041 0.24798095 0.54666103 +O 14.94732552 31.33444998 8.34614106 -0.45011430 0.56734370 -1.81131217 +O 15.43832552 31.16644998 10.47814106 0.17176443 -0.13613153 1.10515943 +H 14.13932552 28.87744998 8.69914106 -0.01064396 -0.12536323 -0.21650453 +H 12.89732552 29.86944998 9.44814106 -0.31600325 0.03373764 0.02868921 +H 14.05335552 28.95970998 10.46960106 -0.01042572 0.19601675 0.03118650 +20 +Lattice="30.0 0.0 0.0 0.0 30.0 0.0 0.0 0.0 30.0" Properties=species:S:1:pos:R:3:forces:R:3 energy=-12892.3948027872 label=CC chargeA=1 energyA=-6669.20645149176 chargeB=-1 energyB=-6220.48400518575 distance=6.39408684611913 pbc="T T T" +C 12.78700000 35.93500000 8.14300000 -0.01766446 -0.24085947 -0.20374689 +C 12.50200000 35.31700000 5.75900000 0.17577043 -0.09422127 0.85492474 +N 13.33700000 34.30300000 5.87400000 0.74776549 -0.61181756 0.67345688 +N 12.22000000 36.09300000 6.79800000 0.06963267 0.39182226 0.95802618 +N 11.93800000 35.55500000 4.59100000 -0.58566394 0.32001467 -1.10159433 +H 13.73100000 34.01500000 6.77000000 -0.02387524 -0.11507083 -0.13452792 +H 13.57300000 33.74600000 5.07200000 0.12523081 -0.35912616 -0.23945246 +H 11.60800000 36.88200000 6.64200000 -0.20105148 0.14879688 -0.05829534 +H 11.31200000 36.33700000 4.47600000 -0.16228509 0.22053214 -0.18543049 +H 12.19300000 35.00900000 3.78400000 -0.03327904 -0.08969005 -0.31472613 +H 12.75000000 36.88800000 8.67500000 -0.12027037 0.09744811 -0.06215271 +H 13.83900000 35.65300000 8.06400000 0.20496836 -0.03010153 0.08284091 +H 12.25752000 35.16852000 8.72794600 -0.01335833 0.03710148 -0.05867742 +C 13.99954644 29.33119165 9.66283124 0.11509613 -0.38558817 0.06947516 +C 14.91054644 30.55319165 9.57483124 0.25623692 0.20480479 0.45033307 +O 15.01354644 31.12519165 8.46583124 -0.40653383 0.50541677 -1.69564060 +O 15.50454644 30.95719165 10.59783124 0.20043383 -0.10394727 1.11809603 +H 14.20554644 28.66819165 8.81883124 -0.00789997 -0.12410955 -0.21604063 +H 12.96354644 29.66019165 9.56783124 -0.31387186 0.03452290 0.02976592 +H 14.11957644 28.75045165 10.58929124 -0.00938103 0.19407186 0.03336602 +20 +Lattice="30.0 0.0 0.0 0.0 30.0 0.0 0.0 0.0 30.0" Properties=species:S:1:pos:R:3:forces:R:3 energy=-12892.29873128 label=CC chargeA=1 energyA=-6669.20645149176 chargeB=-1 energyB=-6220.48400518575 distance=6.642296918599837 pbc="T T T" +C 12.78700000 35.93500000 8.14300000 -0.01511531 -0.23429258 -0.22418866 +C 12.50200000 35.31700000 5.75900000 0.05232253 -0.10101692 0.86230120 +N 13.33700000 34.30300000 5.87400000 0.82835895 -0.67601277 0.69175862 +N 12.22000000 36.09300000 6.79800000 0.09032688 0.40886258 0.99335003 +N 11.93800000 35.55500000 4.59100000 -0.58995029 0.30563416 -1.09876551 +H 13.73100000 34.01500000 6.77000000 -0.05151677 -0.06211267 -0.17837238 +H 13.57300000 33.74600000 5.07200000 0.13180595 -0.34605157 -0.25420255 +H 11.60800000 36.88200000 6.64200000 -0.19856134 0.17049287 -0.06492345 +H 11.31200000 36.33700000 4.47600000 -0.15474007 0.23821547 -0.18671049 +H 12.19300000 35.00900000 3.78400000 -0.01817799 -0.08836067 -0.33019172 +H 12.75000000 36.88800000 8.67500000 -0.11753242 0.09491711 -0.06118806 +H 13.83900000 35.65300000 8.06400000 0.20653406 -0.01980753 0.08675605 +H 12.25752000 35.16852000 8.72794600 -0.02360296 0.03378243 -0.05622836 +C 14.06576736 29.12193331 9.78252142 0.11408843 -0.37511540 0.07031475 +C 14.97676736 30.34393331 9.69452142 0.21712748 0.16356892 0.37823636 +O 15.07976736 30.91593331 8.58552142 -0.36984120 0.45838873 -1.60204618 +O 15.57076736 30.74793331 10.71752142 0.22425524 -0.07600218 1.12419560 +H 14.27176736 28.45893331 8.93852142 -0.00572715 -0.12327635 -0.21580468 +H 13.02976736 29.45093331 9.68752142 -0.31202231 0.03526631 0.03053077 +H 14.18579736 28.54119331 10.70898142 -0.00803171 0.19292006 0.03517866 +20 +Lattice="30.0 0.0 0.0 0.0 30.0 0.0 0.0 0.0 30.0" Properties=species:S:1:pos:R:3:forces:R:3 energy=-12892.2168235929 label=CC chargeA=1 energyA=-6669.20645149176 chargeB=-1 energyB=-6220.48400518575 distance=6.89063640189919 pbc="T T T" +C 12.78700000 35.93500000 8.14300000 -0.01335346 -0.22864111 -0.24214162 +C 12.50200000 35.31700000 5.75900000 -0.04754046 -0.10608141 0.86640891 +N 13.33700000 34.30300000 5.87400000 0.89365510 -0.72965672 0.70723282 +N 12.22000000 36.09300000 6.79800000 0.10740139 0.42389479 1.02454679 +N 11.93800000 35.55500000 4.59100000 -0.59354545 0.29462263 -1.09728289 +H 13.73100000 34.01500000 6.77000000 -0.07240448 -0.02094746 -0.21204151 +H 13.57300000 33.74600000 5.07200000 0.13741327 -0.33518642 -0.26741047 +H 11.60800000 36.88200000 6.64200000 -0.19697119 0.18839070 -0.07013859 +H 11.31200000 36.33700000 4.47600000 -0.14927784 0.25261478 -0.18762504 +H 12.19300000 35.00900000 3.78400000 -0.00589482 -0.08770571 -0.34294042 +H 12.75000000 36.88800000 8.67500000 -0.11541889 0.09306068 -0.06027720 +H 13.83900000 35.65300000 8.06400000 0.20791333 -0.01149586 0.08984473 +H 12.25752000 35.16852000 8.72794600 -0.03227005 0.03092612 -0.05387919 +C 14.13198828 28.91267498 9.90221159 0.11332216 -0.36591438 0.07016476 +C 15.04298828 30.13467497 9.81421159 0.18352516 0.12689287 0.32344314 +O 15.14598828 30.70667497 8.70521159 -0.33925155 0.42221297 -1.52584073 +O 15.63698828 30.53867497 10.83721159 0.24369936 -0.05251778 1.12581849 +H 14.33798828 28.24967498 9.05821159 -0.00403013 -0.12266965 -0.21561322 +H 13.09598828 29.24167497 9.80721159 -0.31032183 0.03591167 0.03110253 +H 14.25201828 28.33193497 10.82867159 -0.00664962 0.19228930 0.03662870 +20 +Lattice="30.0 0.0 0.0 0.0 30.0 0.0 0.0 0.0 30.0" Properties=species:S:1:pos:R:3:forces:R:3 energy=-12892.1462454998 label=CC chargeA=1 energyA=-6669.20645149176 chargeB=-1 energyB=-6220.48400518575 distance=7.139091798074071 pbc="T T T" +C 12.78700000 35.93500000 8.14300000 -0.01212884 -0.22402504 -0.25760757 +C 12.50200000 35.31700000 5.75900000 -0.12805809 -0.10875171 0.86762839 +N 13.33700000 34.30300000 5.87400000 0.94578127 -0.77382602 0.72086420 +N 12.22000000 36.09300000 6.79800000 0.12221456 0.43552016 1.05118074 +N 11.93800000 35.55500000 4.59100000 -0.59547688 0.28575250 -1.09507374 +H 13.73100000 34.01500000 6.77000000 -0.08837701 0.01149879 -0.23790529 +H 13.57300000 33.74600000 5.07200000 0.14210402 -0.32656632 -0.27980034 +H 11.60800000 36.88200000 6.64200000 -0.19663265 0.20359134 -0.07451880 +H 11.31200000 36.33700000 4.47600000 -0.14606530 0.26507165 -0.18806708 +H 12.19300000 35.00900000 3.78400000 0.00421805 -0.08812489 -0.35378877 +H 12.75000000 36.88800000 8.67500000 -0.11389326 0.09185342 -0.05948652 +H 13.83900000 35.65300000 8.06400000 0.20909560 -0.00480072 0.09218596 +H 12.25752000 35.16852000 8.72794600 -0.03955012 0.02854896 -0.05172631 +C 14.19820920 28.70341664 10.02190177 0.11280996 -0.35778359 0.06945968 +C 15.10920920 29.92541664 9.93390177 0.15360337 0.09354648 0.28126945 +O 15.21220920 30.49741664 8.82490177 -0.31296488 0.39452982 -1.46281826 +O 15.70320920 30.32941664 10.95690177 0.25997992 -0.03240543 1.12437065 +H 14.40420920 28.04041664 9.17790177 -0.00264994 -0.12214997 -0.21547680 +H 13.16220920 29.03241664 9.92690177 -0.30873082 0.03654846 0.03151866 +H 14.31823920 28.12267664 10.94836177 -0.00527896 0.19197213 0.03779176 +15 +Lattice="30.0 0.0 0.0 0.0 30.0 0.0 0.0 0.0 30.0" Properties=species:S:1:pos:R:3:forces:R:3 energy=-8843.17939441773 label=CC chargeA=1 energyA=-2617.69985845671 chargeB=-1 energyB=-6220.46984312555 distance=3.6724529766326075 pbc="T T T" +C 9.12400000 -6.69000000 22.74000000 0.40746773 0.29747564 0.47079174 +N 7.96000000 -6.55600000 21.83900000 -0.57387493 -0.81380253 2.83617368 +H 8.24600000 -6.67200000 20.86300000 0.90699854 0.67531803 -2.75174464 +H 7.55700000 -5.63000000 21.88900000 -0.09993156 0.63338325 -0.13775987 +H 7.23800000 -7.23200000 22.05200000 -0.47010459 -0.29670214 0.37623674 +H 9.98100000 -6.18400000 22.28300000 -0.12104733 0.10119776 -0.17680947 +H 9.39500000 -7.74000000 22.88700000 -0.20260583 -0.04307181 -0.07106855 +H 8.91513100 -6.21360700 23.70924000 -0.00497881 -0.17568191 -0.08543737 +C 7.98350924 -5.26600874 17.56955611 -0.26752230 -0.68147795 -0.56611454 +C 8.54350924 -5.05900874 18.96355611 0.54464488 2.19622657 0.64249524 +O 8.74450924 -6.08900874 19.65755611 0.07009357 -3.37059713 -0.32617580 +O 8.83650924 -3.96200874 19.46955611 -0.41922618 1.42451488 -0.79628583 +H 7.05450924 -5.82900874 17.69255611 -0.21970298 -0.25066759 -0.02057564 +H 8.66750924 -5.94800874 17.05855611 0.12963246 -0.27327296 -0.10745433 +H 7.75328024 -4.48120174 16.83397611 0.32015733 0.57715791 0.71372864 +15 +Lattice="30.0 0.0 0.0 0.0 30.0 0.0 0.0 0.0 30.0" Properties=species:S:1:pos:R:3:forces:R:3 energy=-8843.07650806844 label=CC chargeA=1 energyA=-2617.69985845671 chargeB=-1 energyB=-6220.46984312555 distance=3.9205187003526993 pbc="T T T" +C 9.12400000 -6.69000000 22.74000000 0.54812534 0.27540558 0.51544675 +N 7.96000000 -6.55600000 21.83900000 -0.06067138 -0.54472055 1.47589351 +H 8.24600000 -6.67200000 20.86300000 0.71357011 0.67446814 -2.48421272 +H 7.55700000 -5.63000000 21.88900000 -0.13732947 0.67735084 -0.16143501 +H 7.23800000 -7.23200000 22.05200000 -0.46440763 -0.32070373 0.24175500 +H 9.98100000 -6.18400000 22.28300000 -0.11658090 0.09966175 -0.16086919 +H 9.39500000 -7.74000000 22.88700000 -0.20533470 -0.03823069 -0.07816330 +H 8.91513100 -6.21360700 23.70924000 -0.03626796 -0.17498244 -0.11527447 +C 7.96475462 -5.18650437 17.33327806 -0.26812990 -0.69031791 -0.59508119 +C 8.52475462 -4.97950437 18.72727806 0.59762984 1.95215844 0.93232784 +O 8.72575462 -6.00950437 19.42127806 -0.39722459 -3.60342175 0.69265250 +O 8.81775462 -3.88250437 19.23327806 -0.40216503 1.62861663 -0.82973478 +H 7.03575462 -5.74950437 17.45627806 -0.21791878 -0.24585297 -0.01791503 +H 8.64875462 -5.86850437 16.82227806 0.12939239 -0.27141376 -0.11302176 +H 7.73452562 -4.40169737 16.59769806 0.31731266 0.58198241 0.69763185 +15 +Lattice="30.0 0.0 0.0 0.0 30.0 0.0 0.0 0.0 30.0" Properties=species:S:1:pos:R:3:forces:R:3 energy=-8842.78849688106 label=CC chargeA=1 energyA=-2617.69985845671 chargeB=-1 energyB=-6220.46984312555 distance=4.168815535073765 pbc="T T T" +C 9.12400000 -6.69000000 22.74000000 0.64774412 0.25668288 0.54941939 +N 7.96000000 -6.55600000 21.83900000 0.18202216 -0.37980439 0.75844397 +H 8.24600000 -6.67200000 20.86300000 0.51292151 0.53902424 -2.11029287 +H 7.55700000 -5.63000000 21.88900000 -0.17907264 0.71311489 -0.16113871 +H 7.23800000 -7.23200000 22.05200000 -0.47528399 -0.34206048 0.16039896 +H 9.98100000 -6.18400000 22.28300000 -0.10860071 0.09824887 -0.14349252 +H 9.39500000 -7.74000000 22.88700000 -0.20752633 -0.03556506 -0.08285730 +H 8.91513100 -6.21360700 23.70924000 -0.05754685 -0.17336874 -0.13577409 +C 7.94600000 -5.10700000 17.09700000 -0.27418356 -0.69440530 -0.61993680 +C 8.50600000 -4.90000000 18.49100000 0.64604293 1.74010010 1.14954230 +O 8.70700000 -5.93000000 19.18500000 -0.52588423 -3.59185276 0.94253094 +O 8.79900000 -3.80300000 18.99700000 -0.38590898 1.79491832 -0.85688799 +H 7.01700000 -5.67000000 17.22000000 -0.21740770 -0.24239732 -0.01562195 +H 8.63000000 -5.78900000 16.58600000 0.12945317 -0.26916200 -0.11701609 +H 7.71577100 -4.32219300 16.36142000 0.31323110 0.58652673 0.68268277 +15 +Lattice="30.0 0.0 0.0 0.0 30.0 0.0 0.0 0.0 30.0" Properties=species:S:1:pos:R:3:forces:R:3 energy=-8842.4565332665 label=CC chargeA=1 energyA=-2617.69985845671 chargeB=-1 energyB=-6220.46984312555 distance=4.417304501123408 pbc="T T T" +C 9.12400000 -6.69000000 22.74000000 0.72003425 0.24211448 0.57661482 +N 7.96000000 -6.55600000 21.83900000 0.30455446 -0.28001401 0.36785462 +H 8.24600000 -6.67200000 20.86300000 0.35992237 0.38534256 -1.75969783 +H 7.55700000 -5.63000000 21.88900000 -0.22032949 0.74306367 -0.14609954 +H 7.23800000 -7.23200000 22.05200000 -0.49477121 -0.36258151 0.11254981 +H 9.98100000 -6.18400000 22.28300000 -0.09980091 0.09686244 -0.12695898 +H 9.39500000 -7.74000000 22.88700000 -0.20932759 -0.03426544 -0.08612859 +H 8.91513100 -6.21360700 23.70924000 -0.07205299 -0.17152876 -0.14993600 +C 7.92724538 -5.02749563 16.86072194 -0.28329447 -0.69308950 -0.64266724 +C 8.48724538 -4.82049563 18.25472194 0.68765089 1.53754768 1.31630832 +O 8.68824538 -5.85049563 18.94872194 -0.54475303 -3.48465745 0.87958791 +O 8.78024538 -3.72349563 18.76072194 -0.36940292 1.93626686 -0.87793532 +H 6.99824538 -5.59049563 16.98372194 -0.21687147 -0.23941790 -0.01302497 +H 8.61124538 -5.70949563 16.34972194 0.12982837 -0.26639370 -0.11911015 +H 7.69701638 -4.24268863 16.12514194 0.30861374 0.59075057 0.66864312 +15 +Lattice="30.0 0.0 0.0 0.0 30.0 0.0 0.0 0.0 30.0" Properties=species:S:1:pos:R:3:forces:R:3 energy=-8842.13744870909 label=CC chargeA=1 energyA=-2617.69985845671 chargeB=-1 energyB=-6220.46984312555 distance=4.665954893108933 pbc="T T T" +C 9.12400000 -6.69000000 22.74000000 0.77549461 0.23142476 0.59885428 +N 7.96000000 -6.55600000 21.83900000 0.37855809 -0.21657085 0.14426968 +H 8.24600000 -6.67200000 20.86300000 0.25290152 0.24767983 -1.47168891 +H 7.55700000 -5.63000000 21.88900000 -0.26059053 0.77137473 -0.12133384 +H 7.23800000 -7.23200000 22.05200000 -0.52241703 -0.38716676 0.08604644 +H 9.98100000 -6.18400000 22.28300000 -0.09167839 0.09512682 -0.11153279 +H 9.39500000 -7.74000000 22.88700000 -0.21128831 -0.03423650 -0.08854748 +H 8.91513100 -6.21360700 23.70924000 -0.08267146 -0.16960697 -0.15964246 +C 7.90849076 -4.94799126 16.62444389 -0.29396286 -0.68311190 -0.66481105 +C 8.46849076 -4.74099126 18.01844389 0.71623630 1.31116537 1.44129558 +O 8.66949076 -5.77099126 18.71244389 -0.53109846 -3.32605451 0.70878563 +O 8.76149076 -3.64399126 18.52444389 -0.34837868 2.06410203 -0.88924900 +H 6.97949076 -5.51099126 16.74744389 -0.21519048 -0.23591940 -0.00887228 +H 8.59249076 -5.62999126 16.11344389 0.13072098 -0.26252610 -0.11830781 +H 7.67826176 -4.16318426 15.88886389 0.30336471 0.59431946 0.65473402 +15 +Lattice="30.0 0.0 0.0 0.0 30.0 0.0 0.0 0.0 30.0" Properties=species:S:1:pos:R:3:forces:R:3 energy=-8841.85170585896 label=CC chargeA=1 energyA=-2617.69985845671 chargeB=-1 energyB=-6220.46984312555 distance=4.914742227116861 pbc="T T T" +C 9.12400000 -6.69000000 22.74000000 0.82437430 0.22607920 0.61297675 +N 7.96000000 -6.55600000 21.83900000 0.45851501 -0.16368776 -0.00439814 +H 8.24600000 -6.67200000 20.86300000 0.17563529 0.12726944 -1.23604553 +H 7.55700000 -5.63000000 21.88900000 -0.30517729 0.80712766 -0.08420595 +H 7.23800000 -7.23200000 22.05200000 -0.57436453 -0.43533799 0.07856918 +H 9.98100000 -6.18400000 22.28300000 -0.08482225 0.09219269 -0.09498728 +H 9.39500000 -7.74000000 22.88700000 -0.21515732 -0.03708693 -0.09064185 +H 8.91513100 -6.21360700 23.70924000 -0.09344173 -0.16669544 -0.16531000 +C 7.88973614 -4.86848689 16.38816583 -0.30408848 -0.65071799 -0.68528607 +C 8.44973614 -4.66148689 17.78216583 0.70486499 0.97606763 1.48930070 +O 8.65073614 -5.69148689 18.47616583 -0.49807056 -3.06806079 0.51992508 +O 8.74273614 -3.56448689 18.28816583 -0.30633267 2.18237148 -0.86557739 +H 6.96073614 -5.43148689 16.51116583 -0.21075819 -0.22988312 -0.00022253 +H 8.57373614 -5.55048689 15.87716583 0.13321911 -0.25552192 -0.11173140 +H 7.65950714 -4.08367989 15.65258583 0.29560433 0.59588383 0.63763443 +15 +Lattice="30.0 0.0 0.0 0.0 30.0 0.0 0.0 0.0 30.0" Properties=species:S:1:pos:R:3:forces:R:3 energy=-8841.6098275333 label=CC chargeA=1 energyA=-2617.69985845671 chargeB=-1 energyB=-6220.46984312555 distance=5.1636466922846544 pbc="T T T" +C 9.12400000 -6.69000000 22.74000000 0.87825891 0.22390718 0.61768678 +N 7.96000000 -6.55600000 21.83900000 0.59321339 -0.09997745 -0.14573967 +H 8.24600000 -6.67200000 20.86300000 0.12104425 0.02693960 -1.01973371 +H 7.55700000 -5.63000000 21.88900000 -0.35800741 0.86582123 -0.03085598 +H 7.23800000 -7.23200000 22.05200000 -0.68388969 -0.54112307 0.11439831 +H 9.98100000 -6.18400000 22.28300000 -0.08015467 0.08976506 -0.07752276 +H 9.39500000 -7.74000000 22.88700000 -0.22378701 -0.04508525 -0.09188898 +H 8.91513100 -6.21360700 23.70924000 -0.11026215 -0.16122666 -0.16624893 +C 7.87098152 -4.78898252 16.15188778 -0.31050779 -0.63940539 -0.66950481 +C 8.43098152 -4.58198252 17.54588778 0.66183417 0.77842571 1.34225243 +O 8.63198152 -5.61198252 18.23988778 -0.44566668 -2.77309147 0.37421893 +O 8.72398152 -3.48498252 18.05188778 -0.26063067 2.16045573 -0.77151558 +H 6.94198152 -5.35198252 16.27488778 -0.21187272 -0.22679236 0.00197496 +H 8.55498152 -5.47098252 15.64088778 0.13771604 -0.25258775 -0.11013374 +H 7.64075252 -4.00417552 15.41630778 0.29271205 0.59397489 0.63261274 +15 +Lattice="30.0 0.0 0.0 0.0 30.0 0.0 0.0 0.0 30.0" Properties=species:S:1:pos:R:3:forces:R:3 energy=-8841.41457610454 label=CC chargeA=1 energyA=-2617.69985845671 chargeB=-1 energyB=-6220.46984312555 distance=5.412652146732347 pbc="T T T" +C 9.12400000 -6.69000000 22.74000000 0.92201804 0.21935019 0.62739256 +N 7.96000000 -6.55600000 21.83900000 0.68941340 -0.06309745 -0.22989421 +H 8.24600000 -6.67200000 20.86300000 0.09139508 -0.04888169 -0.87626260 +H 7.55700000 -5.63000000 21.88900000 -0.40332886 0.92228456 0.01436725 +H 7.23800000 -7.23200000 22.05200000 -0.76923102 -0.62306613 0.14501826 +H 9.98100000 -6.18400000 22.28300000 -0.07663673 0.08857951 -0.06528276 +H 9.39500000 -7.74000000 22.88700000 -0.23009505 -0.05074169 -0.09301661 +H 8.91513100 -6.21360700 23.70924000 -0.12277075 -0.15677957 -0.16712058 +C 7.85222690 -4.70947815 15.91560972 -0.31510743 -0.63508705 -0.64976259 +C 8.41222690 -4.50247815 17.30960972 0.62143319 0.64943159 1.18822378 +O 8.61322690 -5.53247815 18.00360972 -0.40221967 -2.53377437 0.26705063 +O 8.70522690 -3.40547815 17.81560972 -0.22385026 2.11606646 -0.68332862 +H 6.92322690 -5.27247815 16.03860972 -0.21388217 -0.22503540 0.00216490 +H 8.53622690 -5.39147815 15.40460972 0.14162848 -0.25128073 -0.11018508 +H 7.62199790 -3.92467115 15.18002972 0.29123374 0.59203178 0.63063567 +15 +Lattice="30.0 0.0 0.0 0.0 30.0 0.0 0.0 0.0 30.0" Properties=species:S:1:pos:R:3:forces:R:3 energy=-8841.25689226691 label=CC chargeA=1 energyA=-2617.69985845671 chargeB=-1 energyB=-6220.46984312555 distance=5.661745248606425 pbc="T T T" +C 9.12400000 -6.69000000 22.74000000 0.95542590 0.21370102 0.64013150 +N 7.96000000 -6.55600000 21.83900000 0.75220813 -0.04497492 -0.27078171 +H 8.24600000 -6.67200000 20.86300000 0.07718661 -0.10680136 -0.78896074 +H 7.55700000 -5.63000000 21.88900000 -0.44048916 0.97127065 0.05025132 +H 7.23800000 -7.23200000 22.05200000 -0.83010789 -0.68105479 0.16633331 +H 9.98100000 -6.18400000 22.28300000 -0.07377726 0.08811779 -0.05723168 +H 9.39500000 -7.74000000 22.88700000 -0.23421691 -0.05417766 -0.09400649 +H 8.91513100 -6.21360700 23.70924000 -0.13114381 -0.15368544 -0.16822250 +C 7.83347228 -4.62997378 15.67933167 -0.31813130 -0.62876149 -0.63338286 +C 8.39347228 -4.42297378 17.07333167 0.58105721 0.53509716 1.05383528 +O 8.59447228 -5.45297378 17.76733167 -0.36604656 -2.33300249 0.18893382 +O 8.68647228 -3.32597378 17.57933167 -0.19134877 2.07724439 -0.60846830 +H 6.90447228 -5.19297378 15.80233167 -0.21511829 -0.22335202 0.00291625 +H 8.51747228 -5.31197378 15.16833167 0.14492105 -0.24997186 -0.10968661 +H 7.60324328 -3.84516678 14.94375167 0.28958106 0.59035103 0.62833941 +15 +Lattice="30.0 0.0 0.0 0.0 30.0 0.0 0.0 0.0 30.0" Properties=species:S:1:pos:R:3:forces:R:3 energy=-8841.12862125546 label=CC chargeA=1 energyA=-2617.69985845671 chargeB=-1 energyB=-6220.46984312555 distance=5.910914934526397 pbc="T T T" +C 9.12400000 -6.69000000 22.74000000 0.98039135 0.20784383 0.65378493 +N 7.96000000 -6.55600000 21.83900000 0.79252864 -0.03760861 -0.28410172 +H 8.24600000 -6.67200000 20.86300000 0.07220453 -0.15129169 -0.73974234 +H 7.55700000 -5.63000000 21.88900000 -0.47041804 1.01227401 0.07797136 +H 7.23800000 -7.23200000 22.05200000 -0.87357192 -0.72203922 0.18096794 +H 9.98100000 -6.18400000 22.28300000 -0.07134261 0.08815780 -0.05214669 +H 9.39500000 -7.74000000 22.88700000 -0.23679433 -0.05608811 -0.09474408 +H 8.91513100 -6.21360700 23.70924000 -0.13655288 -0.15170370 -0.16939514 +C 7.81471766 -4.55046941 15.44305361 -0.31991754 -0.62066830 -0.62068308 +C 8.37471766 -4.34346941 16.83705361 0.54176178 0.43202167 0.94036629 +O 8.57571766 -5.37346941 17.53105361 -0.33544519 -2.16463188 0.13284808 +O 8.66771766 -3.24646941 17.34305361 -0.16267374 2.04497903 -0.54668903 +H 6.88571766 -5.11346941 15.56605361 -0.21561421 -0.22163280 0.00434242 +H 8.49871766 -5.23246941 14.93205361 0.14765766 -0.24852546 -0.10857215 +H 7.58448866 -3.76566241 14.70747361 0.28778648 0.58891342 0.62579320 +15 +Lattice="30.0 0.0 0.0 0.0 30.0 0.0 0.0 0.0 30.0" Properties=species:S:1:pos:R:3:forces:R:3 energy=-8841.0230520496 label=CC chargeA=1 energyA=-2617.69985845671 chargeB=-1 energyB=-6220.46984312555 distance=6.160151893959503 pbc="T T T" +C 9.12400000 -6.69000000 22.74000000 0.99880688 0.20228146 0.66702899 +N 7.96000000 -6.55600000 21.83900000 0.81818717 -0.03614648 -0.28081085 +H 8.24600000 -6.67200000 20.86300000 0.07257315 -0.18551308 -0.71544014 +H 7.55700000 -5.63000000 21.88900000 -0.49434497 1.04597750 0.09905022 +H 7.23800000 -7.23200000 22.05200000 -0.90496499 -0.75132394 0.19113609 +H 9.98100000 -6.18400000 22.28300000 -0.06926411 0.08845546 -0.04905032 +H 9.39500000 -7.74000000 22.88700000 -0.23833029 -0.05701763 -0.09523325 +H 8.91513100 -6.21360700 23.70924000 -0.13992636 -0.15052965 -0.17053214 +C 7.79596304 -4.47096504 15.20677556 -0.32087668 -0.61165770 -0.61125505 +C 8.35596304 -4.26396504 16.60077556 0.50465262 0.33998271 0.84611657 +O 8.55696304 -5.29396504 17.29477556 -0.30923199 -2.02371960 0.09305910 +O 8.64896304 -3.16696504 17.10677556 -0.13761568 2.01837523 -0.49657092 +H 6.86696304 -5.03396504 15.32977556 -0.21556359 -0.21990432 0.00631511 +H 8.47996304 -5.15296504 14.69577556 0.14992580 -0.24696666 -0.10701752 +H 7.56573404 -3.68615804 14.47119556 0.28597303 0.58770670 0.62320408 +15 +Lattice="30.0 0.0 0.0 0.0 30.0 0.0 0.0 0.0 30.0" Properties=species:S:1:pos:R:3:forces:R:3 energy=-8840.93510219809 label=CC chargeA=1 energyA=-2617.69985845671 chargeB=-1 energyB=-6220.46984312555 distance=6.409448296386224 pbc="T T T" +C 9.12400000 -6.69000000 22.74000000 1.01236474 0.19722218 0.67922393 +N 7.96000000 -6.55600000 21.83900000 0.83444611 -0.03786511 -0.26808493 +H 8.24600000 -6.67200000 20.86300000 0.07585743 -0.21216835 -0.70676198 +H 7.55700000 -5.63000000 21.88900000 -0.51346972 1.07363216 0.11505371 +H 7.23800000 -7.23200000 22.05200000 -0.92801907 -0.77246748 0.19825712 +H 9.98100000 -6.18400000 22.28300000 -0.06746238 0.08885868 -0.04721492 +H 9.39500000 -7.74000000 22.88700000 -0.23918014 -0.05736288 -0.09549417 +H 8.91513100 -6.21360700 23.70924000 -0.14195225 -0.14989289 -0.17154052 +C 7.77720842 -4.39146067 14.97049750 -0.32123871 -0.60258101 -0.60435810 +C 8.33720842 -4.18446067 16.36449750 0.47034456 0.25943928 0.76786903 +O 8.53820842 -5.21446067 17.05849750 -0.28669362 -1.90584957 0.06486696 +O 8.63020842 -3.08746067 16.87049750 -0.11600802 1.99597804 -0.45604424 +H 6.84820842 -4.95446067 15.09349750 -0.21514474 -0.21821635 0.00864446 +H 8.46120842 -5.07346067 14.45949750 0.15185670 -0.24540766 -0.10520761 +H 7.54697942 -3.60665367 14.23491750 0.28429911 0.58668098 0.62079125 +15 +Lattice="30.0 0.0 0.0 0.0 30.0 0.0 0.0 0.0 30.0" Properties=species:S:1:pos:R:3:forces:R:3 energy=-8840.86093540257 label=CC chargeA=1 energyA=-2617.69985845671 chargeB=-1 energyB=-6220.46984312555 distance=6.658797447914187 pbc="T T T" +C 9.12400000 -6.69000000 22.74000000 1.02242634 0.19276023 0.69009719 +N 7.96000000 -6.55600000 21.83900000 0.84470249 -0.04109437 -0.25060115 +H 8.24600000 -6.67200000 20.86300000 0.08065637 -0.23306627 -0.70758217 +H 7.55700000 -5.63000000 21.88900000 -0.52886986 1.09641136 0.12732508 +H 7.23800000 -7.23200000 22.05200000 -0.94528858 -0.78808615 0.20346985 +H 9.98100000 -6.18400000 22.28300000 -0.06591994 0.08931362 -0.04621500 +H 9.39500000 -7.74000000 22.88700000 -0.23959724 -0.05738984 -0.09562062 +H 8.91513100 -6.21360700 23.70924000 -0.14315947 -0.14957435 -0.17241809 +C 7.75845380 -4.31195630 14.73421945 -0.32123249 -0.59420243 -0.59916849 +C 8.31845380 -4.10495630 16.12821945 0.43942449 0.19085698 0.70260448 +O 8.51945380 -5.13495630 16.82221945 -0.26731479 -1.80756239 0.04476866 +O 8.61145380 -3.00795630 16.63421945 -0.09760420 1.97633991 -0.42305189 +H 6.82945380 -4.87495630 14.85721945 -0.21456238 -0.21662830 0.01105290 +H 8.44245380 -4.99395630 14.22321945 0.15350223 -0.24391784 -0.10338040 +H 7.52822480 -3.52714930 13.99863945 0.28283702 0.58583985 0.61871965 +20 +Lattice="30.0 0.0 0.0 0.0 30.0 0.0 0.0 0.0 30.0" Properties=species:S:1:pos:R:3:forces:R:3 energy=-12894.1967352065 label=CC chargeA=-1 energyA=-6220.48891391419 chargeB=1 energyB=-6669.20926086133 distance=4.05795004937235 pbc="T T T" +C 34.44500000 12.62500000 24.95900000 0.09596403 0.15255510 0.05400508 +C 33.70500000 11.92700000 26.09800000 2.83373346 0.95364648 1.97596119 +O 32.60000000 11.42900000 25.81100000 -0.92649065 -0.50553497 -2.94148067 +O 34.21200000 11.87200000 27.24800000 -0.07613523 0.25968668 -0.56152555 +H 33.75000000 13.28700000 24.44000000 -0.16357722 0.13194912 -0.20479328 +H 34.76300000 11.86300000 24.24500000 0.11998623 -0.14168116 -0.24527435 +H 35.32079000 13.21299000 25.27085000 -0.12216062 -0.22743281 0.16978040 +C 30.51697621 11.41297253 28.35997957 0.08565697 -0.61685292 -0.42877017 +C 30.16897621 9.79197253 26.50897957 0.60343895 2.15410928 1.48065485 +N 30.79097621 10.81897253 27.04797957 -3.66416739 -0.84971192 2.61568844 +N 29.15897621 9.19897253 27.11897957 -1.55395699 -1.41582101 0.25064672 +N 30.54197621 9.36997253 25.32397957 -0.10503581 -1.36240184 -1.83284048 +H 31.59297621 11.18497253 26.53097957 2.07128206 0.76246596 -0.74650431 +H 31.44097621 11.87297253 28.71697957 0.23203588 0.05709405 -0.09157744 +H 30.26097621 10.63497253 29.08197957 -0.12066892 -0.14241685 0.33583627 +H 28.84197621 9.53397253 28.01297957 -0.17909829 -0.03347993 0.10973836 +H 28.66897621 8.43897253 26.64597957 0.04338233 0.26423010 0.50750842 +H 31.31397621 9.83297253 24.86997957 0.41795808 0.23537352 -0.24998174 +H 29.98497621 8.65997253 24.84397957 0.51089590 0.38950867 0.06083216 +H 29.73228621 12.18382253 28.36726957 -0.10304274 -0.06528555 -0.25790390 +20 +Lattice="30.0 0.0 0.0 0.0 30.0 0.0 0.0 0.0 30.0" Properties=species:S:1:pos:R:3:forces:R:3 energy=-12894.4106882566 label=CC chargeA=-1 energyA=-6220.48891391419 chargeB=1 energyB=-6669.20926086133 distance=4.3057211284280745 pbc="T T T" +C 34.44500000 12.62500000 24.95900000 0.12677755 0.17294793 0.02621724 +C 33.70500000 11.92700000 26.09800000 2.28488395 0.71268902 1.93532021 +O 32.60000000 11.42900000 25.81100000 -2.69264398 -1.06148470 -1.62569457 +O 34.21200000 11.87200000 27.24800000 0.11420749 0.28699666 -0.39755942 +H 33.75000000 13.28700000 24.44000000 -0.16210101 0.13508546 -0.20479421 +H 34.76300000 11.86300000 24.24500000 0.12227685 -0.13991225 -0.24444028 +H 35.32079000 13.21299000 25.27085000 -0.11039968 -0.21439235 0.16263254 +C 30.30998811 11.30148626 28.44498978 0.16755655 -0.47643389 -0.34426973 +C 29.96198811 9.68048626 26.59398978 0.52342111 1.79372014 1.12575180 +N 30.58398811 10.70748626 27.13298978 -1.80508966 -0.15064038 1.53837691 +N 28.95198811 9.08748626 27.20398978 -1.42650939 -1.26122220 0.25763596 +N 30.33498811 9.25848626 25.40898978 -0.10022213 -1.23453464 -1.65580923 +H 31.38598811 11.07348626 26.61598978 2.08663810 0.77829344 -0.82484725 +H 31.23398811 11.76148626 28.80198978 0.21441133 0.05336081 -0.10043201 +H 30.05398811 10.52348626 29.16698978 -0.10025681 -0.15405788 0.27433054 +H 28.63498811 9.42248626 28.09798978 -0.19093850 -0.04048683 0.12487170 +H 28.46198811 8.32748626 26.73098978 0.05584200 0.27782763 0.49229983 +H 31.10698811 9.72148626 24.95498978 0.45197766 0.21577684 -0.30268485 +H 29.77798811 8.54848626 24.92898978 0.52309851 0.38471884 0.04731413 +H 29.52529811 12.07233626 28.45227978 -0.08292993 -0.07825166 -0.28421932 +20 +Lattice="30.0 0.0 0.0 0.0 30.0 0.0 0.0 0.0 30.0" Properties=species:S:1:pos:R:3:forces:R:3 energy=-12894.2327176419 label=CC chargeA=-1 energyA=-6220.48891391419 chargeB=1 energyB=-6669.20926086133 distance=4.553735864227719 pbc="T T T" +C 34.44500000 12.62500000 24.95900000 0.15339310 0.19396425 0.00357428 +C 33.70500000 11.92700000 26.09800000 1.88604410 0.53380831 1.89714902 +O 32.60000000 11.42900000 25.81100000 -3.17425174 -1.23706404 -1.22029190 +O 34.21200000 11.87200000 27.24800000 0.26723492 0.30860333 -0.27420580 +H 33.75000000 13.28700000 24.44000000 -0.16133506 0.13770826 -0.20483260 +H 34.76300000 11.86300000 24.24500000 0.12399168 -0.13931820 -0.24352590 +H 35.32079000 13.21299000 25.27085000 -0.09848164 -0.20210491 0.15638205 +C 30.10300000 11.19000000 28.53000000 0.20676249 -0.38141943 -0.27137453 +C 29.75500000 9.56900000 26.67900000 0.44547743 1.53236715 0.89175696 +N 30.37700000 10.59600000 27.21800000 -0.85094689 0.24486238 1.05533267 +N 28.74500000 8.97600000 27.28900000 -1.32511891 -1.14784488 0.25506355 +N 30.12800000 9.14700000 25.49400000 -0.09334150 -1.14654773 -1.54035708 +H 31.17900000 10.96200000 26.70100000 1.73385682 0.70731707 -0.63980266 +H 31.02700000 11.65000000 28.88700000 0.19882782 0.05351958 -0.09986070 +H 29.84700000 10.41200000 29.25200000 -0.08572171 -0.16256749 0.23636145 +H 28.42800000 9.31100000 28.18300000 -0.20048190 -0.04443449 0.13713395 +H 28.25500000 8.21600000 26.81600000 0.06079211 0.28160167 0.48048799 +H 30.90000000 9.61000000 25.04000000 0.45000344 0.17553284 -0.34944199 +H 29.57100000 8.43700000 25.01400000 0.53161793 0.37842667 0.03317835 +H 29.31831000 11.96085000 28.53729000 -0.06832250 -0.08641032 -0.30272709 +20 +Lattice="30.0 0.0 0.0 0.0 30.0 0.0 0.0 0.0 30.0" Properties=species:S:1:pos:R:3:forces:R:3 energy=-12893.9362699469 label=CC chargeA=-1 energyA=-6220.48891391419 chargeB=1 energyB=-6669.20926086133 distance=4.801956498056273 pbc="T T T" +C 34.44500000 12.62500000 24.95900000 0.17759417 0.21395224 -0.01458299 +C 33.70500000 11.92700000 26.09800000 1.58115037 0.39798793 1.85539350 +O 32.60000000 11.42900000 25.81100000 -3.17118630 -1.23616714 -1.12653995 +O 34.21200000 11.87200000 27.24800000 0.39242751 0.32624318 -0.17715378 +H 33.75000000 13.28700000 24.44000000 -0.16098163 0.13959278 -0.20459917 +H 34.76300000 11.86300000 24.24500000 0.12507379 -0.13939182 -0.24254670 +H 35.32079000 13.21299000 25.27085000 -0.08720083 -0.19105308 0.15085592 +C 29.89601189 11.07851374 28.61501022 0.22337661 -0.31627090 -0.21247484 +C 29.54801189 9.45751374 26.76401022 0.37139372 1.33987015 0.73929747 +N 30.17001189 10.48451374 27.30301022 -0.33830685 0.47677755 0.83372148 +N 28.53801189 8.86451374 27.37401022 -1.24457314 -1.06420692 0.24729619 +N 29.92101189 9.03551374 25.57901022 -0.08543396 -1.08518262 -1.46324957 +H 30.97201189 10.85051374 26.78601022 1.34382302 0.60648469 -0.43811532 +H 30.82001189 11.53851374 28.97201022 0.18522753 0.05549477 -0.09378384 +H 29.64001189 10.30051374 29.33701022 -0.07487552 -0.16789587 0.21220875 +H 28.22101189 9.19951374 28.26801022 -0.20839002 -0.04658746 0.14712836 +H 28.04801189 8.10451374 26.90101022 0.06158585 0.28043917 0.47112663 +H 30.69301189 9.49851374 25.12501022 0.42989847 0.13036786 -0.38827642 +H 29.36401189 8.32551374 25.09901022 0.53695483 0.37115754 0.01948519 +H 29.11132189 11.84936374 28.62230022 -0.05755761 -0.09161207 -0.31519091 +20 +Lattice="30.0 0.0 0.0 0.0 30.0 0.0 0.0 0.0 30.0" Properties=species:S:1:pos:R:3:forces:R:3 energy=-12893.6272234885 label=CC chargeA=-1 energyA=-6220.48891391419 chargeB=1 energyB=-6669.20926086133 distance=5.05035266446833 pbc="T T T" +C 34.44500000 12.62500000 24.95900000 0.20038562 0.23237943 -0.02834430 +C 33.70500000 11.92700000 26.09800000 1.33488111 0.29192980 1.80396066 +O 32.60000000 11.42900000 25.81100000 -3.00238466 -1.16610089 -1.12786282 +O 34.21200000 11.87200000 27.24800000 0.49679178 0.34079941 -0.09646774 +H 33.75000000 13.28700000 24.44000000 -0.16098506 0.14067625 -0.20369900 +H 34.76300000 11.86300000 24.24500000 0.12560099 -0.13991843 -0.24131018 +H 35.32079000 13.21299000 25.27085000 -0.07673916 -0.18123972 0.14586673 +C 29.68902379 10.96702747 28.70002043 0.22849011 -0.27031880 -0.16653350 +C 29.34102379 9.34602747 26.84902043 0.30266235 1.19197852 0.63871736 +N 29.96302379 10.37302747 27.38802043 -0.04348732 0.62218610 0.72842417 +N 28.33102379 8.75302747 27.45902043 -1.17921075 -1.00027194 0.23783424 +N 29.71402379 8.92402747 25.66402043 -0.07657454 -1.04100162 -1.40966930 +H 30.76502379 10.73902747 26.87102043 1.00785409 0.50695394 -0.27482113 +H 30.61302379 11.42702747 29.05702043 0.17337848 0.05805346 -0.08485322 +H 29.43302379 10.18902747 29.42202043 -0.06656037 -0.17088774 0.19635273 +H 28.01402379 9.08802747 28.35302043 -0.21548968 -0.04746849 0.15578140 +H 27.84102379 7.99302747 26.98602043 0.05961216 0.27611878 0.46255307 +H 30.48602379 9.38702747 25.21002043 0.40249877 0.08839189 -0.41922660 +H 29.15702379 8.21402747 25.18402043 0.53879745 0.36281187 0.00653803 +H 28.90433379 11.73787747 28.70731043 -0.04952138 -0.09507183 -0.32324060 +20 +Lattice="30.0 0.0 0.0 0.0 30.0 0.0 0.0 0.0 30.0" Properties=species:S:1:pos:R:3:forces:R:3 energy=-12893.3428113505 label=CC chargeA=-1 energyA=-6220.48891391419 chargeB=1 energyB=-6669.20926086133 distance=5.298899690066014 pbc="T T T" +C 34.44500000 12.62500000 24.95900000 0.22358625 0.24910193 -0.03573556 +C 33.70500000 11.92700000 26.09800000 1.11966275 0.20810561 1.72518491 +O 32.60000000 11.42900000 25.81100000 -2.78572228 -1.07573462 -1.13785499 +O 34.21200000 11.87200000 27.24800000 0.58466631 0.35121202 -0.02263007 +H 33.75000000 13.28700000 24.44000000 -0.16142566 0.14058869 -0.20102662 +H 34.76300000 11.86300000 24.24500000 0.12561553 -0.14075263 -0.23900365 +H 35.32079000 13.21299000 25.27085000 -0.06677027 -0.17217878 0.14079085 +C 29.48203568 10.85554121 28.78503065 0.22846074 -0.23621421 -0.13283664 +C 29.13403568 9.23454121 26.93403065 0.24052674 1.06652370 0.57177460 +N 29.75603568 10.26154121 27.47303065 0.14180422 0.72702704 0.67816192 +N 28.12403568 8.64154121 27.54403065 -1.12403762 -0.94794312 0.23047674 +N 29.50703568 8.81254121 25.74903065 -0.06348843 -1.00654642 -1.37185921 +H 30.55803568 10.62754121 26.95603065 0.73980378 0.41999885 -0.15386355 +H 30.40603568 11.31554121 29.14203065 0.16295967 0.06071738 -0.07463633 +H 29.22603568 10.07754121 29.50703065 -0.06037661 -0.17258896 0.18560065 +H 27.80703568 8.97654121 28.43803065 -0.22298191 -0.04642603 0.16466587 +H 27.63403568 7.88154121 27.07103065 0.05400220 0.26771554 0.45092416 +H 30.27903568 9.27554121 25.29503065 0.37294859 0.05340207 -0.44381961 +H 28.95003568 8.10254121 25.26903065 0.53421022 0.35154059 -0.00666637 +H 28.69734568 11.62639121 28.79232065 -0.04344423 -0.09754866 -0.32764708 +20 +Lattice="30.0 0.0 0.0 0.0 30.0 0.0 0.0 0.0 30.0" Properties=species:S:1:pos:R:3:forces:R:3 energy=-12893.093822762 label=CC chargeA=-1 energyA=-6220.48891391419 chargeB=1 energyB=-6669.20926086133 distance=5.547577292653992 pbc="T T T" +C 34.44500000 12.62500000 24.95900000 0.24955379 0.26281744 -0.03059913 +C 33.70500000 11.92700000 26.09800000 0.91407621 0.14989443 1.57178808 +O 32.60000000 11.42900000 25.81100000 -2.54457017 -0.98238518 -1.10561234 +O 34.21200000 11.87200000 27.24800000 0.65207969 0.35038473 0.05883232 +H 33.75000000 13.28700000 24.44000000 -0.16269121 0.13865580 -0.19449129 +H 34.76300000 11.86300000 24.24500000 0.12501701 -0.14189723 -0.23413162 +H 35.32079000 13.21299000 25.27085000 -0.05648092 -0.16295964 0.13449153 +C 29.27504757 10.74405495 28.87004087 0.22823046 -0.20774040 -0.11433068 +C 28.92704757 9.12305495 27.01904087 0.18616515 0.93377730 0.53210867 +N 29.54904757 10.15005495 27.55804087 0.27972182 0.83384150 0.65787340 +N 27.91704757 8.53005495 27.62904087 -1.07582101 -0.90166553 0.23263615 +N 29.30004757 8.70105495 25.83404087 -0.03542975 -0.97465434 -1.35168432 +H 30.35104757 10.51605495 27.04104087 0.52208657 0.34386190 -0.06219683 +H 30.19904757 11.20405495 29.22704087 0.15249094 0.06332756 -0.06344695 +H 29.01904757 9.96605495 29.59204087 -0.05703793 -0.17483834 0.17844318 +H 27.60004757 8.86505495 28.52304087 -0.23322155 -0.04174058 0.17562626 +H 27.42704757 7.77005495 27.15604087 0.03958420 0.25162478 0.42838383 +H 30.07204757 9.16405495 25.38004087 0.33950664 0.02540473 -0.46304717 +H 28.74304757 7.99105495 25.35404087 0.51594035 0.33386166 -0.02328015 +H 28.49035757 11.51490495 28.87733087 -0.03920030 -0.09957059 -0.32736293 +20 +Lattice="30.0 0.0 0.0 0.0 30.0 0.0 0.0 0.0 30.0" Properties=species:S:1:pos:R:3:forces:R:3 energy=-12892.8818535478 label=CC chargeA=-1 energyA=-6220.48891391419 chargeB=1 energyB=-6669.20926086133 distance=5.796368659594933 pbc="T T T" +C 34.44500000 12.62500000 24.95900000 0.27228437 0.27102798 -0.01562898 +C 33.70500000 11.92700000 26.09800000 0.74295234 0.12400795 1.36432653 +O 32.60000000 11.42900000 25.81100000 -2.30919976 -0.89914903 -1.03218822 +O 34.21200000 11.87200000 27.24800000 0.68905494 0.33493382 0.14217442 +H 33.75000000 13.28700000 24.44000000 -0.16437219 0.13642433 -0.18663589 +H 34.76300000 11.86300000 24.24500000 0.12454083 -0.14305864 -0.22857444 +H 35.32079000 13.21299000 25.27085000 -0.04661718 -0.15409448 0.12806145 +C 29.06805947 10.63256868 28.95505108 0.23023971 -0.18245888 -0.11032731 +C 28.72005947 9.01156868 27.10405108 0.14138891 0.79340333 0.51484451 +N 29.34205947 10.03856868 27.64305108 0.39604929 0.95486726 0.65680482 +N 27.71005947 8.41856868 27.71405108 -1.03948408 -0.86594508 0.24592752 +N 29.09305947 8.58956868 25.91905108 0.00646566 -0.94676323 -1.35417270 +H 30.14405947 10.40456868 27.12605108 0.34463306 0.27845549 0.00985037 +H 29.99205947 11.09256868 29.31205108 0.14141589 0.06548840 -0.05206413 +H 28.81205947 9.85456868 29.67705108 -0.05613934 -0.17833406 0.17418277 +H 27.39305947 8.75356868 28.60805108 -0.24501117 -0.03563513 0.18552900 +H 27.22005947 7.65856868 27.24105108 0.01834548 0.23301672 0.39943044 +H 29.86505947 9.05256868 25.46505108 0.30086589 -0.00009940 -0.47617043 +H 28.53605947 7.87956868 25.43905108 0.48944553 0.31486633 -0.04234863 +H 28.28336947 11.40341868 28.96234108 -0.03685819 -0.10095366 -0.32302109 +20 +Lattice="30.0 0.0 0.0 0.0 30.0 0.0 0.0 0.0 30.0" Properties=species:S:1:pos:R:3:forces:R:3 energy=-12892.7032612584 label=CC chargeA=-1 energyA=-6220.48891391419 chargeB=1 energyB=-6669.20926086133 distance=6.045259757225575 pbc="T T T" +C 34.44500000 12.62500000 24.95900000 0.28204096 0.27139536 -0.00131447 +C 33.70500000 11.92700000 26.09800000 0.64595500 0.13069910 1.17252926 +O 32.60000000 11.42900000 25.81100000 -2.11404875 -0.83310908 -0.95299350 +O 34.21200000 11.87200000 27.24800000 0.69084474 0.30838080 0.20841025 +H 33.75000000 13.28700000 24.44000000 -0.16542414 0.13590792 -0.18188273 +H 34.76300000 11.86300000 24.24500000 0.12479687 -0.14370019 -0.22519778 +H 35.32079000 13.21299000 25.27085000 -0.03976138 -0.14763889 0.12467458 +C 28.86107136 10.52108242 29.04006130 0.23278800 -0.16009525 -0.11280737 +C 28.51307136 8.90008242 27.18906130 0.10233042 0.65926268 0.51228017 +N 29.13507136 9.92708242 27.72806130 0.49244191 1.07070171 0.66712951 +N 27.50307136 8.30708242 27.79906130 -1.00684380 -0.83282641 0.26304112 +N 28.88607136 8.47808242 26.00406130 0.05308922 -0.92087685 -1.36859514 +H 29.93707136 10.29308242 27.21106130 0.20382814 0.22635204 0.06421928 +H 29.78507136 10.98108242 29.39706130 0.13142627 0.06733317 -0.04193324 +H 28.60507136 9.74308242 29.76206130 -0.05647250 -0.18212668 0.17128550 +H 27.18607136 8.64208242 28.69306130 -0.25581213 -0.02972708 0.19427574 +H 27.01307136 7.54708242 27.32606130 -0.00775156 0.21077231 0.36642475 +H 29.65807136 8.94108242 25.55006130 0.26169527 -0.02475908 -0.48208220 +H 28.32907136 7.76808242 25.52406130 0.46044582 0.29609445 -0.06076750 +H 28.07638136 11.29193242 29.04735130 -0.03556835 -0.10204005 -0.31669623 +20 +Lattice="30.0 0.0 0.0 0.0 30.0 0.0 0.0 0.0 30.0" Properties=species:S:1:pos:R:3:forces:R:3 energy=-12892.5541097392 label=CC chargeA=-1 energyA=-6220.48891391419 chargeB=1 energyB=-6669.20926086133 distance=6.294238740464477 pbc="T T T" +C 34.44500000 12.62500000 24.95900000 0.28112699 0.26662576 0.00895844 +C 33.70500000 11.92700000 26.09800000 0.60810956 0.15570400 1.02000819 +O 32.60000000 11.42900000 25.81100000 -1.96415658 -0.78367510 -0.88374008 +O 34.21200000 11.87200000 27.24800000 0.67145598 0.27866475 0.25472000 +H 33.75000000 13.28700000 24.44000000 -0.16577869 0.13676313 -0.18014957 +H 34.76300000 11.86300000 24.24500000 0.12548679 -0.14384833 -0.22382116 +H 35.32079000 13.21299000 25.27085000 -0.03588994 -0.14361758 0.12428119 +C 28.65408326 10.40959616 29.12507152 0.23355202 -0.14102288 -0.11653362 +C 28.30608326 8.78859616 27.27407152 0.07064863 0.54009464 0.51729150 +N 28.92808326 9.81559616 27.81307152 0.56721498 1.16783716 0.68189694 +N 27.29608326 8.19559616 27.88407152 -0.97693021 -0.80023998 0.27785834 +N 28.67908326 8.36659616 26.08907152 0.09634369 -0.89754288 -1.38322767 +H 29.73008326 10.18159616 27.29607152 0.09569514 0.18712089 0.10244753 +H 29.57808326 10.86959616 29.48207152 0.12406120 0.06926285 -0.03357271 +H 28.39808326 9.63159616 29.84707152 -0.05726221 -0.18550218 0.16890269 +H 26.97908326 8.53059616 28.77807152 -0.26507467 -0.02385619 0.20281213 +H 26.80608326 7.43559616 27.41107152 -0.03378719 0.18744895 0.33339558 +H 29.45108326 8.82959616 25.63507152 0.22812147 -0.04443558 -0.48427610 +H 28.12208326 7.65659616 25.60907152 0.43143317 0.27738415 -0.07732331 +H 27.86939326 11.18044616 29.13236152 -0.03437013 -0.10316558 -0.30992831 +20 +Lattice="30.0 0.0 0.0 0.0 30.0 0.0 0.0 0.0 30.0" Properties=species:S:1:pos:R:3:forces:R:3 energy=-12892.4294141671 label=CC chargeA=-1 energyA=-6220.48891391419 chargeB=1 energyB=-6669.20926086133 distance=6.543295591227622 pbc="T T T" +C 34.44500000 12.62500000 24.95900000 0.27886581 0.26146631 0.01798379 +C 33.70500000 11.92700000 26.09800000 0.58839560 0.18310720 0.89060892 +O 32.60000000 11.42900000 25.81100000 -1.84608960 -0.74692893 -0.81995802 +O 34.21200000 11.87200000 27.24800000 0.64896858 0.25186697 0.29033722 +H 33.75000000 13.28700000 24.44000000 -0.16609520 0.13762921 -0.17895563 +H 34.76300000 11.86300000 24.24500000 0.12607699 -0.14394351 -0.22287097 +H 35.32079000 13.21299000 25.27085000 -0.03292703 -0.14042950 0.12428503 +C 28.44709515 10.29810989 29.21008173 0.23284009 -0.12565334 -0.12094915 +C 28.09909515 8.67710990 27.35908173 0.04803283 0.43992029 0.52456950 +N 28.72109515 9.70410990 27.89808173 0.62417490 1.24750093 0.69706924 +N 27.08909515 8.08410990 27.96908173 -0.95608662 -0.77469308 0.28974248 +N 28.47209515 8.25510990 26.17408173 0.13225042 -0.88027283 -1.39610574 +H 29.52309515 10.07010989 27.38108173 0.01409910 0.15726350 0.12906794 +H 29.37109515 10.75810990 29.56708173 0.11883081 0.07111770 -0.02651389 +H 28.19109515 9.52010990 29.93208173 -0.05811827 -0.18824810 0.16715658 +H 26.77209515 8.41910990 28.86308173 -0.27310983 -0.01846811 0.21020280 +H 26.59909515 7.32410990 27.49608173 -0.05456552 0.16902813 0.30636388 +H 29.24409515 8.71810990 25.72008173 0.20218496 -0.05713356 -0.48674303 +H 27.91509515 7.54510990 25.69408173 0.40557995 0.26102345 -0.09171917 +H 27.66240515 11.06895990 29.21737173 -0.03330795 -0.10415274 -0.30357179 +20 +Lattice="30.0 0.0 0.0 0.0 30.0 0.0 0.0 0.0 30.0" Properties=species:S:1:pos:R:3:forces:R:3 energy=-12892.3242671172 label=CC chargeA=-1 energyA=-6220.48891391419 chargeB=1 energyB=-6669.20926086133 distance=6.792421743531683 pbc="T T T" +C 34.44500000 12.62500000 24.95900000 0.27713178 0.25678691 0.02626196 +C 33.70500000 11.92700000 26.09800000 0.57557534 0.20903733 0.77834247 +O 32.60000000 11.42900000 25.81100000 -1.75109155 -0.71910547 -0.76127557 +O 34.21200000 11.87200000 27.24800000 0.62750776 0.22868713 0.31888917 +H 33.75000000 13.28700000 24.44000000 -0.16648832 0.13824975 -0.17771510 +H 34.76300000 11.86300000 24.24500000 0.12650847 -0.14408928 -0.22194567 +H 35.32079000 13.21299000 25.27085000 -0.03039716 -0.13769190 0.12419576 +C 28.24010704 10.18662363 29.29509195 0.23101225 -0.11340096 -0.12530067 +C 27.89210704 8.56562363 27.44409195 0.03198110 0.35639080 0.53232861 +N 28.51410704 9.59262363 27.98309195 0.66726098 1.31191194 0.71157774 +N 26.88210704 7.97262363 28.05409195 -0.94133069 -0.75409548 0.29899221 +N 28.26510704 8.14362363 26.25909195 0.16127474 -0.86764955 -1.40612998 +H 29.31610704 9.95862363 27.46609195 -0.04748983 0.13444625 0.14725618 +H 29.16410704 10.64662363 29.65209195 0.11530177 0.07284590 -0.02065490 +H 27.98410704 9.40862363 30.01709195 -0.05894440 -0.19035780 0.16583792 +H 26.56510704 8.30762363 28.94809195 -0.28004687 -0.01355564 0.21667798 +H 26.39210704 7.21262363 27.58109195 -0.07104990 0.15420450 0.28422335 +H 29.03710704 8.60662363 25.80509195 0.18287597 -0.06419835 -0.48969186 +H 27.70810704 7.43362363 25.77909195 0.38278753 0.24664154 -0.10404461 +H 27.45541704 10.95747363 29.30238195 -0.03237896 -0.10505761 -0.29782499 +20 +Lattice="30.0 0.0 0.0 0.0 30.0 0.0 0.0 0.0 30.0" Properties=species:S:1:pos:R:3:forces:R:3 energy=-12892.2347035084 label=CC chargeA=-1 energyA=-6220.48891391419 chargeB=1 energyB=-6669.20926086133 distance=7.041609824729907 pbc="T T T" +C 34.44500000 12.62500000 24.95900000 0.27599875 0.25269523 0.03375284 +C 33.70500000 11.92700000 26.09800000 0.56603163 0.23227723 0.68114442 +O 32.60000000 11.42900000 25.81100000 -1.67343429 -0.69750892 -0.70845425 +O 34.21200000 11.87200000 27.24800000 0.60799781 0.20892873 0.34199464 +H 33.75000000 13.28700000 24.44000000 -0.16693773 0.13862907 -0.17633818 +H 34.76300000 11.86300000 24.24500000 0.12680674 -0.14428208 -0.22096438 +H 35.32079000 13.21299000 25.27085000 -0.02821235 -0.13533772 0.12402072 +C 28.03311894 10.07513737 29.38010217 0.22842656 -0.10364073 -0.12920875 +C 27.68511894 8.45413737 27.52910217 0.02036697 0.28676369 0.53982052 +N 28.30711894 9.48113737 28.06810217 0.69956216 1.36340293 0.72526948 +N 26.67511894 7.86113737 28.13910217 -0.93016014 -0.73663251 0.30595560 +N 28.05811894 8.03213737 26.34410217 0.18444056 -0.85836094 -1.41317791 +H 29.10911894 9.84713737 27.55110217 -0.09387802 0.11713094 0.15913065 +H 28.95711894 10.53513737 29.73710217 0.11310006 0.07448553 -0.01582396 +H 27.77711894 9.29713737 30.10210217 -0.05969446 -0.19192111 0.16479446 +H 26.35811894 8.19613737 29.03310217 -0.28598595 -0.00908837 0.22247774 +H 26.18511894 7.10113737 27.66610217 -0.08443872 0.14169433 0.26567785 +H 28.83011894 8.49513737 25.89010217 0.16886290 -0.06716863 -0.49284753 +H 27.50111894 7.32213737 25.86410217 0.36269104 0.23383206 -0.11451176 +H 27.24842894 10.84598737 29.38739217 -0.03154351 -0.10589872 -0.29271220 +20 +Lattice="30.0 0.0 0.0 0.0 30.0 0.0 0.0 0.0 30.0" Properties=species:S:1:pos:R:3:forces:R:3 energy=-12894.9081401654 label=CC chargeA=1 energyA=-6669.20645149176 chargeB=-1 energyB=-6220.48400518575 distance=3.8469731647434418 pbc="T T T" +C 0.01900000 -12.24500000 2.37200000 0.27871526 0.83805596 -0.08501017 +C 0.22300000 -9.83900000 1.84900000 0.75686203 -1.64218955 -0.34753908 +N 0.66900000 -11.08600000 1.75700000 -2.47585134 0.59150633 0.75754521 +N -0.87800000 -9.57200000 2.52900000 -1.40186327 0.54489228 0.86122298 +N 0.87600000 -8.85300000 1.26400000 -0.05259618 0.90846800 -0.15170747 +H 1.57500000 -11.24100000 1.31700000 2.00780774 -0.85537331 -0.61464997 +H 0.56800000 -13.14900000 2.09900000 0.19107998 0.09063558 -0.05904077 +H -1.00300000 -12.34300000 1.99900000 -0.32550022 -0.13290884 -0.00963159 +H -1.44200000 -10.32000000 2.89200000 -0.17968762 -0.09757325 0.15115497 +H -1.21900000 -8.62500000 2.58900000 -0.18650498 0.01409089 0.07628546 +H 1.72400000 -9.06300000 0.75200000 1.20344768 -0.42954919 -0.49675778 +H 0.52800000 -7.90900000 1.29900000 -0.01331460 0.12686702 0.00167823 +H 0.01611679 -12.14697000 3.46761900 -0.06319372 -0.13675644 0.07364080 +C 5.22238506 -11.13416331 1.22314191 0.11556106 0.15913358 -0.28653108 +C 3.74238506 -10.97116331 0.90714191 0.50154241 0.42455941 -0.42503432 +O 2.95038506 -11.86716331 1.27514191 -0.16053482 -1.59349250 0.62578125 +O 3.36238506 -9.95116331 0.29014191 -0.23870651 1.48865656 -0.42578625 +H 5.56238506 -12.11816331 0.89214191 0.06385927 -0.21641990 0.06217914 +H 5.36138506 -11.06516331 2.30514191 0.09449032 -0.04180280 0.18136849 +H 5.82695106 -10.36379331 0.72211221 -0.11561249 -0.04079983 0.11083195 +20 +Lattice="30.0 0.0 0.0 0.0 30.0 0.0 0.0 0.0 30.0" Properties=species:S:1:pos:R:3:forces:R:3 energy=-12894.7856852073 label=CC chargeA=1 energyA=-6669.20645149176 chargeB=-1 energyB=-6220.48400518575 distance=4.09611684385743 pbc="T T T" +C 0.01900000 -12.24500000 2.37200000 0.25491825 0.72592295 -0.04404492 +C 0.22300000 -9.83900000 1.84900000 0.79406799 -1.43290988 -0.35208236 +N 0.66900000 -11.08600000 1.75700000 -1.38027710 0.10461000 0.45682441 +N -0.87800000 -9.57200000 2.52900000 -1.29412298 0.45795589 0.78255904 +N 0.87600000 -8.85300000 1.26400000 0.15869282 0.70185850 -0.24460526 +H 1.57500000 -11.24100000 1.31700000 1.83358777 -0.62122385 -0.51212069 +H 0.56800000 -13.14900000 2.09900000 0.18440642 0.09199461 -0.05556416 +H -1.00300000 -12.34300000 1.99900000 -0.30295145 -0.11780312 -0.01989939 +H -1.44200000 -10.32000000 2.89200000 -0.18552092 -0.10248745 0.16372461 +H -1.21900000 -8.62500000 2.58900000 -0.18062966 0.01566042 0.06742378 +H 1.72400000 -9.06300000 0.75200000 1.06995869 -0.27772880 -0.42048099 +H 0.52800000 -7.90900000 1.29900000 0.03556961 0.13987524 -0.02365366 +H 0.01611679 -12.14697000 3.46761900 -0.04864065 -0.12559934 0.05599310 +C 5.46519253 -11.16558166 1.17257095 0.15568265 0.14569168 -0.29126635 +C 3.98519253 -11.00258166 0.85657095 0.05438858 0.39468804 -0.39556537 +O 3.19319253 -11.89858166 1.22457095 -0.92220637 -1.40708597 0.89318804 +O 3.60519253 -9.98258166 0.23957095 -0.29071724 1.60351670 -0.41372977 +H 5.80519253 -12.14958166 0.84157095 0.07049872 -0.21827959 0.06139273 +H 5.60419253 -11.09658166 2.25457095 0.09655392 -0.04026474 0.18218849 +H 6.06975853 -10.39521166 0.67154125 -0.10325907 -0.03839130 0.10971870 +20 +Lattice="30.0 0.0 0.0 0.0 30.0 0.0 0.0 0.0 30.0" Properties=species:S:1:pos:R:3:forces:R:3 energy=-12894.4793121379 label=CC chargeA=1 energyA=-6669.20645149176 chargeB=-1 energyB=-6220.48400518575 distance=4.345358884358125 pbc="T T T" +C 0.01900000 -12.24500000 2.37200000 0.23199080 0.64503438 -0.01176249 +C 0.22300000 -9.83900000 1.84900000 0.78382393 -1.27256677 -0.33936878 +N 0.66900000 -11.08600000 1.75700000 -0.79158783 -0.15386765 0.28736116 +N -0.87800000 -9.57200000 2.52900000 -1.20687295 0.39676234 0.72083339 +N 0.87600000 -8.85300000 1.26400000 0.28269201 0.57890389 -0.29839661 +H 1.57500000 -11.24100000 1.31700000 1.51140510 -0.42355706 -0.42542087 +H 0.56800000 -13.14900000 2.09900000 0.17403801 0.08766981 -0.05139897 +H -1.00300000 -12.34300000 1.99900000 -0.28550229 -0.10780310 -0.02832798 +H -1.44200000 -10.32000000 2.89200000 -0.19120436 -0.10646360 0.17331055 +H -1.21900000 -8.62500000 2.58900000 -0.17869759 0.02047459 0.06337946 +H 1.72400000 -9.06300000 0.75200000 0.91866532 -0.15025521 -0.35171983 +H 0.52800000 -7.90900000 1.29900000 0.06583088 0.15368490 -0.04005130 +H 0.01611679 -12.14697000 3.46761900 -0.03756462 -0.11793908 0.04316551 +C 5.70800000 -11.19700000 1.12200000 0.19224199 0.13903683 -0.28731225 +C 4.22800000 -11.03400000 0.80600000 -0.24424548 0.37507589 -0.39011169 +O 3.43600000 -11.93000000 1.17400000 -1.07880010 -1.40109161 1.01601713 +O 3.84800000 -10.01400000 0.18900000 -0.22835513 1.63175584 -0.43369923 +H 6.04800000 -12.18100000 0.79100000 0.07533486 -0.21992801 0.06021524 +H 5.84700000 -11.12800000 2.20400000 0.09936409 -0.03928974 0.18441278 +H 6.31256600 -10.42663000 0.62097030 -0.09255665 -0.03563665 0.10887476 +20 +Lattice="30.0 0.0 0.0 0.0 30.0 0.0 0.0 0.0 30.0" Properties=species:S:1:pos:R:3:forces:R:3 energy=-12894.1362840472 label=CC chargeA=1 energyA=-6669.20645149176 chargeB=-1 energyB=-6220.48400518575 distance=4.594683282918175 pbc="T T T" +C 0.01900000 -12.24500000 2.37200000 0.21187625 0.58536858 0.01400584 +C 0.22300000 -9.83900000 1.84900000 0.75015433 -1.14897869 -0.31917633 +N 0.66900000 -11.08600000 1.75700000 -0.45410179 -0.30003416 0.18452044 +N -0.87800000 -9.57200000 2.52900000 -1.13473989 0.35207481 0.67108242 +N 0.87600000 -8.85300000 1.26400000 0.35988417 0.50190798 -0.33127802 +H 1.57500000 -11.24100000 1.31700000 1.19422426 -0.28270454 -0.34897591 +H 0.56800000 -13.14900000 2.09900000 0.16283712 0.08102074 -0.04739034 +H -1.00300000 -12.34300000 1.99900000 -0.27181339 -0.10131339 -0.03515917 +H -1.44200000 -10.32000000 2.89200000 -0.19665080 -0.10978085 0.18093258 +H -1.21900000 -8.62500000 2.58900000 -0.17887294 0.02665003 0.06193576 +H 1.72400000 -9.06300000 0.75200000 0.78434189 -0.05224822 -0.29705991 +H 0.52800000 -7.90900000 1.29900000 0.08498385 0.16727850 -0.05112246 +H 0.01611679 -12.14697000 3.46761900 -0.02928296 -0.11268443 0.03358914 +C 5.95080747 -11.22841834 1.07142905 0.22494613 0.13654844 -0.27916908 +C 4.47080747 -11.06541834 0.75542905 -0.45389516 0.35947509 -0.39420639 +O 3.67880747 -11.96141834 1.12342905 -1.01869764 -1.43876663 1.06508204 +O 4.09080747 -10.04541834 0.13842905 -0.13307559 1.62934801 -0.46189776 +H 6.29080747 -12.21241834 0.74042905 0.07884203 -0.22160090 0.05889935 +H 6.08980747 -11.15941834 2.15342905 0.10238580 -0.03872416 0.18724363 +H 6.55537347 -10.45804834 0.57039935 -0.08334567 -0.03283622 0.10814417 +20 +Lattice="30.0 0.0 0.0 0.0 30.0 0.0 0.0 0.0 30.0" Properties=species:S:1:pos:R:3:forces:R:3 energy=-12893.8103597466 label=CC chargeA=1 energyA=-6669.20645149176 chargeB=-1 energyB=-6220.48400518575 distance=4.844077326852206 pbc="T T T" +C 0.01900000 -12.24500000 2.37200000 0.19484373 0.54023270 0.03483092 +C 0.22300000 -9.83900000 1.84900000 0.70635610 -1.05243339 -0.29650765 +N 0.66900000 -11.08600000 1.75700000 -0.24829009 -0.38899989 0.11867135 +N -0.87800000 -9.57200000 2.52900000 -1.07386264 0.31795944 0.63010618 +N 0.87600000 -8.85300000 1.26400000 0.41107338 0.45141540 -0.35227953 +H 1.57500000 -11.24100000 1.31700000 0.92876135 -0.18821418 -0.28450865 +H 0.56800000 -13.14900000 2.09900000 0.15211577 0.07383949 -0.04387704 +H -1.00300000 -12.34300000 1.99900000 -0.26087269 -0.09713053 -0.04066304 +H -1.44200000 -10.32000000 2.89200000 -0.20186661 -0.11274337 0.18721374 +H -1.21900000 -8.62500000 2.58900000 -0.18017728 0.03350505 0.06188431 +H 1.72400000 -9.06300000 0.75200000 0.67448778 0.02160489 -0.25596588 +H 0.52800000 -7.90900000 1.29900000 0.09730845 0.18031163 -0.05890711 +H 0.01611679 -12.14697000 3.46761900 -0.02307157 -0.10909262 0.02628397 +C 6.19361494 -11.25983669 1.02085809 0.25374746 0.13641898 -0.26914728 +C 4.71361494 -11.09683669 0.70485809 -0.60585840 0.34512657 -0.40097059 +O 3.92161494 -11.99283669 1.07285809 -0.89901259 -1.47720995 1.07858794 +O 4.33361494 -10.07683669 0.08785809 -0.03713262 1.61721277 -0.48994733 +H 6.53361494 -12.24383669 0.68985809 0.08145174 -0.22335860 0.05752385 +H 6.33261494 -11.19083669 2.10285809 0.10538798 -0.03835977 0.19026034 +H 6.79818094 -10.48946669 0.51982839 -0.07538927 -0.03008460 0.10741150 +20 +Lattice="30.0 0.0 0.0 0.0 30.0 0.0 0.0 0.0 30.0" Properties=species:S:1:pos:R:3:forces:R:3 energy=-12893.5175321924 label=CC chargeA=1 energyA=-6669.20645149176 chargeB=-1 energyB=-6220.48400518575 distance=5.093530768699262 pbc="T T T" +C 0.01900000 -12.24500000 2.37200000 0.18065925 0.50533632 0.05185515 +C 0.22300000 -9.83900000 1.84900000 0.65920699 -0.97579775 -0.27357359 +N 0.66900000 -11.08600000 1.75700000 -0.11558934 -0.44778056 0.07452684 +N -0.87800000 -9.57200000 2.52900000 -1.02190775 0.29085691 0.59603204 +N 0.87600000 -8.85300000 1.26400000 0.44778176 0.41713067 -0.36648453 +H 1.57500000 -11.24100000 1.31700000 0.72009955 -0.12579905 -0.23210568 +H 0.56800000 -13.14900000 2.09900000 0.14242202 0.06694356 -0.04095650 +H -1.00300000 -12.34300000 1.99900000 -0.25200223 -0.09440450 -0.04507038 +H -1.44200000 -10.32000000 2.89200000 -0.20700827 -0.11557129 0.19252082 +H -1.21900000 -8.62500000 2.58900000 -0.18209514 0.04095679 0.06262700 +H 1.72400000 -9.06300000 0.75200000 0.58665376 0.07743150 -0.22577561 +H 0.52800000 -7.90900000 1.29900000 0.10507333 0.19284196 -0.06450385 +H 0.01611679 -12.14697000 3.46761900 -0.01847636 -0.10666892 0.02064770 +C 6.43642240 -11.29125503 0.97028714 0.27869209 0.13781936 -0.25856043 +C 4.95642240 -11.12825503 0.65428714 -0.71877295 0.33078100 -0.40717513 +O 4.16442240 -12.02425503 1.02228714 -0.77657072 -1.50603337 1.07534924 +O 4.57642240 -10.10825503 0.03728714 0.04881952 1.60263482 -0.51537380 +H 6.77642240 -12.27525503 0.63928714 0.08335611 -0.22514572 0.05612747 +H 6.57542240 -11.22225503 2.05228714 0.10819445 -0.03810727 0.19321012 +H 7.04098840 -10.52088503 0.46925744 -0.06853608 -0.02742447 0.10668311 +20 +Lattice="30.0 0.0 0.0 0.0 30.0 0.0 0.0 0.0 30.0" Properties=species:S:1:pos:R:3:forces:R:3 energy=-12893.2597247755 label=CC chargeA=1 energyA=-6669.20645149176 chargeB=-1 energyB=-6220.48400518575 distance=5.343035312018525 pbc="T T T" +C 0.01900000 -12.24500000 2.37200000 0.16944016 0.47837498 0.06506596 +C 0.22300000 -9.83900000 1.84900000 0.61156187 -0.91306944 -0.24910022 +N 0.66900000 -11.08600000 1.75700000 -0.02375924 -0.49442608 0.04137971 +N -0.87800000 -9.57200000 2.52900000 -0.97911968 0.26924563 0.56911735 +N 0.87600000 -8.85300000 1.26400000 0.47898003 0.39576555 -0.37839335 +H 1.57500000 -11.24100000 1.31700000 0.55802502 -0.08376926 -0.18877884 +H 0.56800000 -13.14900000 2.09900000 0.13371388 0.06059650 -0.03849119 +H -1.00300000 -12.34300000 1.99900000 -0.24470080 -0.09263366 -0.04844279 +H -1.44200000 -10.32000000 2.89200000 -0.21282501 -0.11856896 0.19668450 +H -1.21900000 -8.62500000 2.58900000 -0.18421827 0.04899149 0.06383088 +H 1.72400000 -9.06300000 0.75200000 0.51495515 0.12039127 -0.20418663 +H 0.52800000 -7.90900000 1.29900000 0.10921543 0.20505579 -0.06884771 +H 0.01611679 -12.14697000 3.46761900 -0.01532505 -0.10515189 0.01664628 +C 6.67922987 -11.32267338 0.91971619 0.29959559 0.14039102 -0.24823353 +C 5.19922987 -11.15967338 0.60371619 -0.79990729 0.31344175 -0.40981500 +O 4.40722987 -12.05567338 0.97171619 -0.66828993 -1.52204206 1.06259369 +O 4.81922987 -10.13967338 -0.01328381 0.12006977 1.58689108 -0.53745230 +H 7.01922987 -12.30667338 0.58871619 0.08453174 -0.22678956 0.05464426 +H 6.81822987 -11.25367338 2.00171619 0.11062746 -0.03781801 0.19585916 +H 7.28379587 -10.55230338 0.41868649 -0.06257083 -0.02487616 0.10591977 +20 +Lattice="30.0 0.0 0.0 0.0 30.0 0.0 0.0 0.0 30.0" Properties=species:S:1:pos:R:3:forces:R:3 energy=-12893.0362784048 label=CC chargeA=1 energyA=-6669.20645149176 chargeB=-1 energyB=-6220.48400518575 distance=5.592584108580483 pbc="T T T" +C 0.01900000 -12.24500000 2.37200000 0.16831355 0.46505913 0.06474451 +C 0.22300000 -9.83900000 1.84900000 0.56110563 -0.85273512 -0.20016527 +N 0.66900000 -11.08600000 1.75700000 0.07162184 -0.59395285 -0.00644920 +N -0.87800000 -9.57200000 2.52900000 -0.97734329 0.26445506 0.57163380 +N 0.87600000 -8.85300000 1.26400000 0.54054164 0.41949058 -0.41500056 +H 1.57500000 -11.24100000 1.31700000 0.41193190 -0.05304473 -0.13880030 +H 0.56800000 -13.14900000 2.09900000 0.12341992 0.05453220 -0.03538503 +H -1.00300000 -12.34300000 1.99900000 -0.23961836 -0.09319367 -0.04955163 +H -1.44200000 -10.32000000 2.89200000 -0.22265234 -0.11881532 0.19533430 +H -1.21900000 -8.62500000 2.58900000 -0.18640106 0.05123369 0.06434747 +H 1.72400000 -9.06300000 0.75200000 0.43775442 0.16031591 -0.18650669 +H 0.52800000 -7.90900000 1.29900000 0.11127671 0.21289031 -0.07632241 +H 0.01611679 -12.14697000 3.46761900 -0.01538372 -0.10471238 0.01857574 +C 6.92203734 -11.35409172 0.86914523 0.30676639 0.14469313 -0.23711566 +C 5.44203734 -11.19109172 0.55314523 -0.79133285 0.28175194 -0.39426286 +O 4.65003734 -12.08709172 0.92114523 -0.58957174 -1.49788618 1.02245850 +O 5.06203734 -10.17109172 -0.06385477 0.14991436 1.54662940 -0.55190651 +H 7.26203734 -12.33809172 0.53814523 0.08455048 -0.22773721 0.05235331 +H 7.06103734 -11.28509172 1.95114523 0.11291567 -0.03698868 0.19755732 +H 7.52660334 -10.58372172 0.36811553 -0.05780915 -0.02198520 0.10446117 +20 +Lattice="30.0 0.0 0.0 0.0 30.0 0.0 0.0 0.0 30.0" Properties=species:S:1:pos:R:3:forces:R:3 energy=-12892.8479373626 label=CC chargeA=1 energyA=-6669.20645149176 chargeB=-1 energyB=-6220.48400518575 distance=5.84217148588387 pbc="T T T" +C 0.01900000 -12.24500000 2.37200000 0.17869348 0.46563235 0.05252726 +C 0.22300000 -9.83900000 1.84900000 0.50682943 -0.79724078 -0.13944070 +N 0.66900000 -11.08600000 1.75700000 0.18267041 -0.75185983 -0.06041678 +N -0.87800000 -9.57200000 2.52900000 -1.02280238 0.27773256 0.60730366 +N 0.87600000 -8.85300000 1.26400000 0.63176732 0.49060771 -0.48228664 +H 1.57500000 -11.24100000 1.31700000 0.27365439 -0.02998609 -0.08775623 +H 0.56800000 -13.14900000 2.09900000 0.11171108 0.04895178 -0.03182754 +H -1.00300000 -12.34300000 1.99900000 -0.23802456 -0.09668886 -0.04888891 +H -1.44200000 -10.32000000 2.89200000 -0.23085674 -0.11230169 0.19016857 +H -1.21900000 -8.62500000 2.58900000 -0.18979825 0.04454146 0.06256199 +H 1.72400000 -9.06300000 0.75200000 0.35529877 0.20072245 -0.16294764 +H 0.52800000 -7.90900000 1.29900000 0.11615783 0.21216133 -0.08644051 +H 0.01611679 -12.14697000 3.46761900 -0.01834418 -0.10500978 0.02558714 +C 7.16484481 -11.38551007 0.81857428 0.30041631 0.14982025 -0.22657267 +C 5.68484481 -11.22251007 0.50257428 -0.69704796 0.24073050 -0.35940348 +O 4.89284481 -12.11851007 0.87057428 -0.54594407 -1.43817654 0.95590175 +O 5.30484481 -10.20251007 -0.11442572 0.14000176 1.48277404 -0.55888250 +H 7.50484481 -12.36951007 0.48757428 0.08412973 -0.22805545 0.04963771 +H 7.30384481 -11.31651007 1.90057428 0.11531425 -0.03572598 0.19854906 +H 7.76941081 -10.61514007 0.31754458 -0.05382660 -0.01862943 0.10262647 +20 +Lattice="30.0 0.0 0.0 0.0 30.0 0.0 0.0 0.0 30.0" Properties=species:S:1:pos:R:3:forces:R:3 energy=-12892.690310812 label=CC chargeA=1 energyA=-6669.20645149176 chargeB=-1 energyB=-6220.48400518575 distance=6.0917926914911416 pbc="T T T" +C 0.01900000 -12.24500000 2.37200000 0.18940231 0.46893452 0.03919691 +C 0.22300000 -9.83900000 1.84900000 0.46065519 -0.75068723 -0.08196819 +N 0.66900000 -11.08600000 1.75700000 0.27724825 -0.89832732 -0.10604519 +N -0.87800000 -9.57200000 2.52900000 -1.07024616 0.29200411 0.64447949 +N 0.87600000 -8.85300000 1.26400000 0.71488716 0.56104845 -0.54709227 +H 1.57500000 -11.24100000 1.31700000 0.16140222 -0.01299473 -0.04770598 +H 0.56800000 -13.14900000 2.09900000 0.10138901 0.04427428 -0.02901039 +H -1.00300000 -12.34300000 1.99900000 -0.23686390 -0.10077037 -0.04751407 +H -1.44200000 -10.32000000 2.89200000 -0.23739565 -0.10562697 0.18547946 +H -1.21900000 -8.62500000 2.58900000 -0.19431330 0.03844501 0.05905206 +H 1.72400000 -9.06300000 0.75200000 0.28585002 0.23388847 -0.14107102 +H 0.52800000 -7.90900000 1.29900000 0.11989167 0.21016805 -0.09548777 +H 0.01611679 -12.14697000 3.46761900 -0.02163759 -0.10487630 0.03296324 +C 7.40765227 -11.41692841 0.76800333 0.29171574 0.15458204 -0.21802825 +C 5.92765227 -11.25392841 0.45200333 -0.59490336 0.20272401 -0.32334818 +O 5.13565227 -12.14992841 0.82000333 -0.51962673 -1.37896830 0.89227427 +O 5.54765227 -10.23392841 -0.16499667 0.12167092 1.42446101 -0.56364163 +H 7.74765227 -12.40092841 0.43700333 0.08375221 -0.22842239 0.04714620 +H 7.54665227 -11.34792841 1.85000333 0.11737027 -0.03449468 0.19944266 +H 8.01221827 -10.64655841 0.26697363 -0.05024828 -0.01536167 0.10087866 +20 +Lattice="30.0 0.0 0.0 0.0 30.0 0.0 0.0 0.0 30.0" Properties=species:S:1:pos:R:3:forces:R:3 energy=-12892.5579822972 label=CC chargeA=1 energyA=-6669.20645149176 chargeB=-1 energyB=-6220.48400518575 distance=6.3414437515680655 pbc="T T T" +C 0.01900000 -12.24500000 2.37200000 0.19672700 0.47058428 0.02677320 +C 0.22300000 -9.83900000 1.84900000 0.42683777 -0.70963639 -0.02347742 +N 0.66900000 -11.08600000 1.75700000 0.34919017 -1.01592302 -0.14538482 +N -0.87800000 -9.57200000 2.52900000 -1.10304379 0.30091889 0.67135156 +N 0.87600000 -8.85300000 1.26400000 0.78246428 0.61505312 -0.59857853 +H 1.57500000 -11.24100000 1.31700000 0.07482433 -0.00058210 -0.01773273 +H 0.56800000 -13.14900000 2.09900000 0.09294074 0.04025670 -0.02713966 +H -1.00300000 -12.34300000 1.99900000 -0.23494415 -0.10473019 -0.04579002 +H -1.44200000 -10.32000000 2.89200000 -0.24542935 -0.10297140 0.18221639 +H -1.21900000 -8.62500000 2.58900000 -0.20029266 0.03768293 0.05413116 +H 1.72400000 -9.06300000 0.75200000 0.23109900 0.25873892 -0.12623238 +H 0.52800000 -7.90900000 1.29900000 0.11980221 0.21163400 -0.10346127 +H 0.01611679 -12.14697000 3.46761900 -0.02450779 -0.10383654 0.04010354 +C 7.65045974 -11.44834676 0.71743238 0.28330100 0.15842143 -0.21098962 +C 6.17045974 -11.28534676 0.40143238 -0.50691588 0.17223905 -0.29330929 +O 5.37845974 -12.18134676 0.76943238 -0.50104615 -1.32706045 0.83842532 +O 5.79045974 -10.26534676 -0.21556762 0.10357001 1.37412089 -0.56570268 +H 7.99045974 -12.43234676 0.38643238 0.08360380 -0.22870225 0.04521270 +H 7.78945974 -11.37934676 1.79943238 0.11922170 -0.03345633 0.20009488 +H 8.25502574 -10.67797676 0.21640268 -0.04740223 -0.01275152 0.09948966 +20 +Lattice="30.0 0.0 0.0 0.0 30.0 0.0 0.0 0.0 30.0" Properties=species:S:1:pos:R:3:forces:R:3 energy=-12892.4458455952 label=CC chargeA=1 energyA=-6669.20645149176 chargeB=-1 energyB=-6220.48400518575 distance=6.591121264724983 pbc="T T T" +C 0.01900000 -12.24500000 2.37200000 0.20079415 0.47089814 0.01453532 +C 0.22300000 -9.83900000 1.84900000 0.40449073 -0.67137989 0.03928867 +N 0.66900000 -11.08600000 1.75700000 0.40406813 -1.11234425 -0.18175670 +N -0.87800000 -9.57200000 2.52900000 -1.12445840 0.30485611 0.68980861 +N 0.87600000 -8.85300000 1.26400000 0.83858941 0.65555883 -0.63996828 +H 1.57500000 -11.24100000 1.31700000 0.00606558 0.00931846 0.00535103 +H 0.56800000 -13.14900000 2.09900000 0.08594250 0.03693497 -0.02610333 +H -1.00300000 -12.34300000 1.99900000 -0.23188516 -0.10858825 -0.04336800 +H -1.44200000 -10.32000000 2.89200000 -0.25480534 -0.10361776 0.17957438 +H -1.21900000 -8.62500000 2.58900000 -0.20746595 0.04188755 0.04754512 +H 1.72400000 -9.06300000 0.75200000 0.18671109 0.27678957 -0.11726342 +H 0.52800000 -7.90900000 1.29900000 0.11562405 0.21595767 -0.11047764 +H 0.01611679 -12.14697000 3.46761900 -0.02710037 -0.10187204 0.04696485 +C 7.89326721 -11.47976510 0.66686142 0.27452727 0.16138362 -0.20511345 +C 6.41326721 -11.31676510 0.35086142 -0.42407604 0.14662122 -0.26666535 +O 5.62126721 -12.21276510 0.71886142 -0.48982031 -1.28085954 0.79190373 +O 6.03326721 -10.29676510 -0.26613858 0.08389369 1.33036312 -0.56634942 +H 8.23326721 -12.46376510 0.33586142 0.08345693 -0.22906646 0.04339697 +H 8.03226721 -11.41076510 1.74886142 0.12063989 -0.03247313 0.20062866 +H 8.49783321 -10.70939510 0.16583172 -0.04519186 -0.01036794 0.09806826 +20 +Lattice="30.0 0.0 0.0 0.0 30.0 0.0 0.0 0.0 30.0" Properties=species:S:1:pos:R:3:forces:R:3 energy=-12892.3502094055 label=CC chargeA=1 energyA=-6669.20645149176 chargeB=-1 energyB=-6220.48400518575 distance=6.840822332851757 pbc="T T T" +C 0.01900000 -12.24500000 2.37200000 0.20171431 0.46937381 0.00343342 +C 0.22300000 -9.83900000 1.84900000 0.39095826 -0.63518641 0.10344824 +N 0.66900000 -11.08600000 1.75700000 0.44433145 -1.18751832 -0.21400308 +N -0.87800000 -9.57200000 2.52900000 -1.13342234 0.30289572 0.69882410 +N 0.87600000 -8.85300000 1.26400000 0.88330443 0.68157361 -0.67084088 +H 1.57500000 -11.24100000 1.31700000 -0.04837342 0.01738490 0.02219075 +H 0.56800000 -13.14900000 2.09900000 0.08036152 0.03411721 -0.02582823 +H -1.00300000 -12.34300000 1.99900000 -0.22803668 -0.11220655 -0.04056073 +H -1.44200000 -10.32000000 2.89200000 -0.26518225 -0.10751286 0.17802857 +H -1.21900000 -8.62500000 2.58900000 -0.21568250 0.05153275 0.03986342 +H 1.72400000 -9.06300000 0.75200000 0.15174450 0.28921488 -0.11329110 +H 0.52800000 -7.90900000 1.29900000 0.10779590 0.22365360 -0.11634670 +H 0.01611679 -12.14697000 3.46761900 -0.02927588 -0.09914488 0.05316309 +C 8.13607468 -11.51118345 0.61629047 0.26612719 0.16366842 -0.20026703 +C 6.65607468 -11.34818345 0.30029047 -0.35026230 0.12508483 -0.24368593 +O 5.86407468 -12.24418345 0.66829047 -0.48246824 -1.24010348 0.75213565 +O 6.27607468 -10.32818345 -0.31670953 0.06497741 1.29237407 -0.56573821 +H 8.47607468 -12.49518345 0.28529047 0.08327780 -0.22934906 0.04175715 +H 8.27507468 -11.44218345 1.69829047 0.12164936 -0.03153099 0.20096322 +H 8.74064068 -10.74081345 0.11526077 -0.04353852 -0.00832125 0.09675427 +20 +Lattice="30.0 0.0 0.0 0.0 30.0 0.0 0.0 0.0 30.0" Properties=species:S:1:pos:R:3:forces:R:3 energy=-12894.1115388962 label=CC chargeA=1 energyA=-6669.20645149176 chargeB=-1 energyB=-6220.48400518575 distance=4.704493481824777 pbc="T T T" +C 3.69000000 1.17800000 9.65700000 0.40439544 0.08914220 0.57535744 +C 5.89300000 2.10500000 10.26700000 0.16019653 -2.31726166 -0.64039693 +N 6.46800000 0.95000000 9.98900000 -3.11130508 0.82437598 0.74434870 +N 4.58400000 2.24900000 10.11300000 -1.79074637 0.31341570 -0.30796675 +N 6.62900000 3.10900000 10.69900000 0.29120695 1.70245664 0.55313784 +H 5.91600000 0.16800000 9.69300000 -0.31680885 -0.21576103 -0.14273722 +H 7.49000000 0.89000000 9.89100000 2.63842974 -0.52530405 -0.10186304 +H 4.18700000 3.12900000 10.38500000 -0.36890377 0.31839094 0.07850719 +H 6.22600000 4.01600000 10.92500000 0.21336658 -0.31717796 -0.10944353 +H 7.61200000 2.96300000 10.84200000 0.53745365 -0.09515022 0.02705853 +H 3.74200000 0.36200000 10.38300000 -0.12380943 -0.29276866 0.12196133 +H 4.02000000 0.78400000 8.69500000 -0.06822676 0.05875477 -0.34612732 +H 2.63834300 1.49675000 9.60785000 0.34621342 0.25978349 -0.06359272 +C 10.78436703 -0.25434056 8.77464597 0.22825679 0.93541833 -0.28019153 +C 9.75136703 0.15865944 9.81364597 1.51591460 -1.15509802 2.11686077 +O 8.73736703 0.78465944 9.43564597 -0.71510592 1.46641871 -2.18779487 +O 9.94136703 -0.14134056 11.01164597 0.43822550 -0.29227316 0.13684542 +H 10.76336703 0.47265944 7.96064597 -0.05849142 0.15445200 -0.33131613 +H 10.52736703 -1.20934056 8.33264597 0.01263351 -0.55869397 -0.01546639 +H 11.81150703 -0.23918246 9.16803397 -0.23289509 -0.35312002 0.17281920 +20 +Lattice="30.0 0.0 0.0 0.0 30.0 0.0 0.0 0.0 30.0" Properties=species:S:1:pos:R:3:forces:R:3 energy=-12894.1325079383 label=CC chargeA=1 energyA=-6669.20645149176 chargeB=-1 energyB=-6220.48400518575 distance=4.953620894759154 pbc="T T T" +C 3.69000000 1.17800000 9.65700000 0.37888400 0.04463359 0.55514750 +C 5.89300000 2.10500000 10.26700000 0.15154001 -1.80967718 -0.53664104 +N 6.46800000 0.95000000 9.98900000 -1.29274741 0.53900417 0.33856233 +N 4.58400000 2.24900000 10.11300000 -1.62538969 0.18499881 -0.29948065 +N 6.62900000 3.10900000 10.69900000 0.23297236 1.55684924 0.49712791 +H 5.91600000 0.16800000 9.69300000 -0.19213749 -0.26823870 -0.16142720 +H 7.49000000 0.89000000 9.89100000 2.26787578 -0.57861006 -0.20911902 +H 4.18700000 3.12900000 10.38500000 -0.34249680 0.31696609 0.09170678 +H 6.22600000 4.01600000 10.92500000 0.21086533 -0.30546035 -0.10983505 +H 7.61200000 2.96300000 10.84200000 0.57923186 -0.07742589 0.03881227 +H 3.74200000 0.36200000 10.38300000 -0.13217237 -0.28473010 0.12532683 +H 4.02000000 0.78400000 8.69500000 -0.07251918 0.06538812 -0.34952809 +H 2.63834300 1.49675000 9.60785000 0.35275626 0.25410894 -0.06426086 +C 11.01568351 -0.34017028 8.73432298 0.26795480 0.91517326 -0.29836194 +C 9.98268351 0.07282972 9.77332298 1.06981857 -0.91336664 2.00851760 +O 8.96868351 0.69882972 9.39532298 -2.15803649 1.50820145 -1.74604301 +O 10.17268351 -0.22717028 10.97132298 0.56024954 -0.38590733 0.29878620 +H 10.99468351 0.38682972 7.92032298 -0.05659098 0.15655890 -0.33104201 +H 10.75868351 -1.29517028 8.29232298 0.01621570 -0.56297290 -0.01553040 +H 12.04282351 -0.32501218 9.12771098 -0.21627379 -0.35549340 0.16728187 +20 +Lattice="30.0 0.0 0.0 0.0 30.0 0.0 0.0 0.0 30.0" Properties=species:S:1:pos:R:3:forces:R:3 energy=-12893.8976680601 label=CC chargeA=1 energyA=-6669.20645149176 chargeB=-1 energyB=-6220.48400518575 distance=5.202832026952576 pbc="T T T" +C 3.69000000 1.17800000 9.65700000 0.35925429 0.01074807 0.54026134 +C 5.89300000 2.10500000 10.26700000 0.11243039 -1.45123740 -0.45959956 +N 6.46800000 0.95000000 9.98900000 -0.35156154 0.32046186 0.13504399 +N 4.58400000 2.24900000 10.11300000 -1.49915397 0.09575973 -0.29694833 +N 6.62900000 3.10900000 10.69900000 0.19864494 1.45229206 0.45801406 +H 5.91600000 0.16800000 9.69300000 -0.12415238 -0.30899058 -0.17400101 +H 7.49000000 0.89000000 9.89100000 1.70787868 -0.56381673 -0.16040867 +H 4.18700000 3.12900000 10.38500000 -0.32692571 0.32076929 0.10003298 +H 6.22600000 4.01600000 10.92500000 0.21056084 -0.29340729 -0.10849500 +H 7.61200000 2.96300000 10.84200000 0.60170260 -0.05010476 0.05564895 +H 3.74200000 0.36200000 10.38300000 -0.13761320 -0.27870287 0.12814576 +H 4.02000000 0.78400000 8.69500000 -0.07639135 0.07047833 -0.35204344 +H 2.63834300 1.49675000 9.60785000 0.35714911 0.25082701 -0.06483867 +C 11.24700000 -0.42600000 8.69400000 0.30148954 0.89447292 -0.31361860 +C 10.21400000 -0.01300000 9.73300000 0.75193029 -0.73064867 1.91589351 +O 9.20000000 0.61300000 9.35500000 -2.49982183 1.48654937 -1.64298006 +O 10.40400000 -0.31300000 10.93100000 0.65286275 -0.45957319 0.42380868 +H 11.22600000 0.30100000 7.88000000 -0.05536759 0.15836486 -0.33049230 +H 10.99000000 -1.38100000 8.25200000 0.01903172 -0.56707172 -0.01648819 +H 12.27414000 -0.41084190 9.08738800 -0.20194758 -0.35717031 0.16306455 +20 +Lattice="30.0 0.0 0.0 0.0 30.0 0.0 0.0 0.0 30.0" Properties=species:S:1:pos:R:3:forces:R:3 energy=-12893.6002785534 label=CC chargeA=1 energyA=-6669.20645149176 chargeB=-1 energyB=-6220.48400518575 distance=5.4521153909805475 pbc="T T T" +C 3.69000000 1.17800000 9.65700000 0.34414440 -0.01502930 0.52899160 +C 5.89300000 2.10500000 10.26700000 0.05705550 -1.19428300 -0.40130021 +N 6.46800000 0.95000000 9.98900000 0.16331685 0.15975693 0.02717455 +N 4.58400000 2.24900000 10.11300000 -1.40154337 0.03264753 -0.29688434 +N 6.62900000 3.10900000 10.69900000 0.18061872 1.37697758 0.43020242 +H 5.91600000 0.16800000 9.69300000 -0.08912151 -0.33969764 -0.18227821 +H 7.49000000 0.89000000 9.89100000 1.20022936 -0.51698942 -0.09157667 +H 4.18700000 3.12900000 10.38500000 -0.31796585 0.32683760 0.10559126 +H 6.22600000 4.01600000 10.92500000 0.21108064 -0.28161129 -0.10641640 +H 7.61200000 2.96300000 10.84200000 0.61044778 -0.01989693 0.07322318 +H 3.74200000 0.36200000 10.38300000 -0.14136851 -0.27421738 0.13060811 +H 4.02000000 0.78400000 8.69500000 -0.07979265 0.07439611 -0.35393197 +H 2.63834300 1.49675000 9.60785000 0.36011547 0.24889686 -0.06531599 +C 11.47831649 -0.51182972 8.65367702 0.33097677 0.87492896 -0.32549802 +C 10.44531649 -0.09882972 9.69267702 0.51360441 -0.58583595 1.82877328 +O 9.43131649 0.52717028 9.31467702 -2.44451601 1.42145593 -1.63801061 +O 10.63531649 -0.39882972 10.89067702 0.72596925 -0.51889098 0.52407775 +H 11.45731649 0.21517028 7.83967702 -0.05486274 0.15985913 -0.32942705 +H 11.22131649 -1.46682972 8.21167702 0.02108925 -0.57071547 -0.01767102 +H 12.50545649 -0.49667162 9.04706502 -0.18947775 -0.35858929 0.15966835 +20 +Lattice="30.0 0.0 0.0 0.0 30.0 0.0 0.0 0.0 30.0" Properties=species:S:1:pos:R:3:forces:R:3 energy=-12893.3115292232 label=CC chargeA=1 energyA=-6669.20645149176 chargeB=-1 energyB=-6220.48400518575 distance=5.7014615040648895 pbc="T T T" +C 3.69000000 1.17800000 9.65700000 0.33341623 -0.03316118 0.52044273 +C 5.89300000 2.10500000 10.26700000 -0.00653237 -1.00453795 -0.35331860 +N 6.46800000 0.95000000 9.98900000 0.47104796 0.03291116 -0.03767565 +N 4.58400000 2.24900000 10.11300000 -1.33084774 -0.01286014 -0.29962581 +N 6.62900000 3.10900000 10.69900000 0.17778874 1.32678990 0.41154460 +H 5.91600000 0.16800000 9.69300000 -0.07205139 -0.36226978 -0.18775851 +H 7.49000000 0.89000000 9.89100000 0.79353080 -0.46154196 -0.03588224 +H 4.18700000 3.12900000 10.38500000 -0.31301525 0.33351272 0.10946953 +H 6.22600000 4.01600000 10.92500000 0.21187158 -0.27058884 -0.10435613 +H 7.61200000 2.96300000 10.84200000 0.60915547 0.00976008 0.08927126 +H 3.74200000 0.36200000 10.38300000 -0.14410078 -0.27151816 0.13304260 +H 4.02000000 0.78400000 8.69500000 -0.08294422 0.07716246 -0.35547103 +H 2.63834300 1.49675000 9.60785000 0.36206729 0.24772247 -0.06576772 +C 11.70963297 -0.59765944 8.61335403 0.35744935 0.85657248 -0.33287152 +C 10.67663297 -0.18465944 9.65235403 0.32753481 -0.46546125 1.73372422 +O 9.66263297 0.44134056 9.27435403 -2.26754680 1.33658044 -1.64321075 +O 10.86663297 -0.48465944 10.85035403 0.78426036 -0.56660461 0.60764578 +H 11.68863297 0.12934056 7.79935403 -0.05531267 0.16119141 -0.32723107 +H 11.45263297 -1.55265944 8.17135403 0.02252734 -0.57372773 -0.01858201 +H 12.73677297 -0.58250134 9.00674203 -0.17829873 -0.35993152 0.15661032 +20 +Lattice="30.0 0.0 0.0 0.0 30.0 0.0 0.0 0.0 30.0" Properties=species:S:1:pos:R:3:forces:R:3 energy=-12893.0558351795 label=CC chargeA=1 energyA=-6669.20645149176 chargeB=-1 energyB=-6220.48400518575 distance=5.950862494024427 pbc="T T T" +C 3.69000000 1.17800000 9.65700000 0.33239374 -0.03260084 0.51995435 +C 5.89300000 2.10500000 10.26700000 -0.08240113 -0.85131495 -0.31501166 +N 6.46800000 0.95000000 9.98900000 0.71457998 -0.12870005 -0.09229459 +N 4.58400000 2.24900000 10.11300000 -1.33308522 -0.03750281 -0.31340883 +N 6.62900000 3.10900000 10.69900000 0.21857970 1.33470233 0.41498292 +H 5.91600000 0.16800000 9.69300000 -0.06045866 -0.37491968 -0.18873586 +H 7.49000000 0.89000000 9.89100000 0.45312926 -0.40473079 -0.00077446 +H 4.18700000 3.12900000 10.38500000 -0.30993549 0.33319002 0.11196196 +H 6.22600000 4.01600000 10.92500000 0.21621137 -0.26563177 -0.10149813 +H 7.61200000 2.96300000 10.84200000 0.58985666 0.04153468 0.10490527 +H 3.74200000 0.36200000 10.38300000 -0.14768959 -0.27431826 0.13580133 +H 4.02000000 0.78400000 8.69500000 -0.08604623 0.07695946 -0.35861025 +H 2.63834300 1.49675000 9.60785000 0.36291639 0.24577354 -0.06636495 +C 11.94094946 -0.68348916 8.57303105 0.37943500 0.83634352 -0.32615146 +C 10.90794946 -0.27048916 9.61203105 0.19272743 -0.35793831 1.55409552 +O 9.89394946 0.35551084 9.23403105 -2.04870609 1.22741194 -1.58383376 +O 11.09794946 -0.57048916 10.81003105 0.81030589 -0.59456990 0.69107617 +H 11.91994946 0.04351084 7.75903105 -0.05847885 0.16319620 -0.32061736 +H 11.68394946 -1.63848916 8.13103105 0.02369628 -0.57563579 -0.01834808 +H 12.96808946 -0.66833106 8.96641905 -0.16703044 -0.36124852 0.15287188 +20 +Lattice="30.0 0.0 0.0 0.0 30.0 0.0 0.0 0.0 30.0" Properties=species:S:1:pos:R:3:forces:R:3 energy=-12892.8404623106 label=CC chargeA=1 energyA=-6669.20645149176 chargeB=-1 energyB=-6220.48400518575 distance=6.20031171854279 pbc="T T T" +C 3.69000000 1.17800000 9.65700000 0.33839452 -0.01941137 0.52991258 +C 5.89300000 2.10500000 10.26700000 -0.15818724 -0.71530628 -0.31094276 +N 6.46800000 0.95000000 9.98900000 0.92241453 -0.32109975 -0.12772385 +N 4.58400000 2.24900000 10.11300000 -1.38870820 -0.04868368 -0.33334668 +N 6.62900000 3.10900000 10.69900000 0.28932217 1.38260043 0.43651110 +H 5.91600000 0.16800000 9.69300000 -0.05062105 -0.38049547 -0.18508076 +H 7.49000000 0.89000000 9.89100000 0.17521852 -0.35396026 0.01908812 +H 4.18700000 3.12900000 10.38500000 -0.30831020 0.32768769 0.11597183 +H 6.22600000 4.01600000 10.92500000 0.22119804 -0.26493482 -0.09362987 +H 7.61200000 2.96300000 10.84200000 0.55905558 0.07204777 0.12176243 +H 3.74200000 0.36200000 10.38300000 -0.15316018 -0.28052822 0.13687446 +H 4.02000000 0.78400000 8.69500000 -0.08716849 0.07462977 -0.36441078 +H 2.63834300 1.49675000 9.60785000 0.36293453 0.24312416 -0.06651286 +C 12.17226594 -0.76931887 8.53270807 0.39153733 0.81704238 -0.30866266 +C 11.13926594 -0.35631887 9.57170807 0.11187139 -0.26881974 1.31963101 +O 10.12526594 0.26968113 9.19370807 -1.83072233 1.11143527 -1.48263349 +O 11.32926594 -0.65631887 10.76970807 0.79896296 -0.60288334 0.77475475 +H 12.15126594 -0.04231887 7.71870807 -0.06241186 0.16605810 -0.31297256 +H 11.91526594 -1.72431887 8.09070807 0.02499737 -0.57673609 -0.01791320 +H 13.19940594 -0.75416077 8.92609607 -0.15661738 -0.36176655 0.14932322 +20 +Lattice="30.0 0.0 0.0 0.0 30.0 0.0 0.0 0.0 30.0" Properties=species:S:1:pos:R:3:forces:R:3 energy=-12892.6614529744 label=CC chargeA=1 energyA=-6669.20645149176 chargeB=-1 energyB=-6220.48400518575 distance=6.44980360654561 pbc="T T T" +C 3.69000000 1.17800000 9.65700000 0.34578585 -0.00383099 0.53906116 +C 5.89300000 2.10500000 10.26700000 -0.22774561 -0.60987211 -0.30451012 +N 6.46800000 0.95000000 9.98900000 1.07968766 -0.49217433 -0.15109173 +N 4.58400000 2.24900000 10.11300000 -1.44889759 -0.05444518 -0.35354415 +N 6.62900000 3.10900000 10.69900000 0.35859479 1.43343715 0.46283321 +H 5.91600000 0.16800000 9.69300000 -0.04385167 -0.38298999 -0.18086601 +H 7.49000000 0.89000000 9.89100000 -0.02951935 -0.31255280 0.02776123 +H 4.18700000 3.12900000 10.38500000 -0.30728099 0.32365742 0.11591371 +H 6.22600000 4.01600000 10.92500000 0.22576028 -0.26421628 -0.08769937 +H 7.61200000 2.96300000 10.84200000 0.52857041 0.09847872 0.13514679 +H 3.74200000 0.36200000 10.38300000 -0.15691221 -0.28683225 0.13860407 +H 4.02000000 0.78400000 8.69500000 -0.08906844 0.07162956 -0.36993109 +H 2.63834300 1.49675000 9.60785000 0.36270046 0.24100626 -0.06698838 +C 12.40358243 -0.85514859 8.49238508 0.39568919 0.80214417 -0.29190314 +C 11.37058243 -0.44214859 9.53138508 0.06861251 -0.20391619 1.11285359 +O 10.35658243 0.18385141 9.15338508 -1.64709792 1.01248660 -1.39145650 +O 11.56058243 -0.74214859 10.72938508 0.77245197 -0.60206212 0.84460441 +H 12.38258243 -0.12814859 7.67838508 -0.06515899 0.16892689 -0.30779636 +H 12.14658243 -1.81014859 8.05038508 0.02620888 -0.57748656 -0.01799426 +H 13.43072243 -0.83999049 8.88577308 -0.14852921 -0.36138795 0.14700297 +20 +Lattice="30.0 0.0 0.0 0.0 30.0 0.0 0.0 0.0 30.0" Properties=species:S:1:pos:R:3:forces:R:3 energy=-12892.5130935556 label=CC chargeA=1 energyA=-6669.20645149176 chargeB=-1 energyB=-6220.48400518575 distance=6.69933336882864 pbc="T T T" +C 3.69000000 1.17800000 9.65700000 0.35374022 0.01218831 0.54194124 +C 5.89300000 2.10500000 10.26700000 -0.29365954 -0.53888379 -0.26987506 +N 6.46800000 0.95000000 9.98900000 1.19829668 -0.63007213 -0.17751501 +N 4.58400000 2.24900000 10.11300000 -1.50186573 -0.05806003 -0.37392216 +N 6.62900000 3.10900000 10.69900000 0.42040056 1.47911109 0.48810210 +H 5.91600000 0.16800000 9.69300000 -0.03978192 -0.38349495 -0.17825621 +H 7.49000000 0.89000000 9.89100000 -0.17609655 -0.27872691 0.02815756 +H 4.18700000 3.12900000 10.38500000 -0.30671580 0.32328042 0.11033049 +H 6.22600000 4.01600000 10.92500000 0.23039129 -0.26256523 -0.08808989 +H 7.61200000 2.96300000 10.84200000 0.50118675 0.12110309 0.14309914 +H 3.74200000 0.36200000 10.38300000 -0.15760594 -0.29298710 0.14263788 +H 4.02000000 0.78400000 8.69500000 -0.09345589 0.06838630 -0.37344316 +H 2.63834300 1.49675000 9.60785000 0.36234278 0.23982147 -0.06826090 +C 12.63489891 -0.94097831 8.45206210 0.39576870 0.79090710 -0.27773254 +C 11.60189891 -0.52797831 9.49106210 0.05213831 -0.16092360 0.94349705 +O 10.58789891 0.09802169 9.11306210 -1.50490665 0.93376099 -1.30990758 +O 11.79189891 -0.82797831 10.68906210 0.74205155 -0.59557770 0.89657890 +H 12.61389891 -0.21397831 7.63806210 -0.06699924 0.17141020 -0.30450809 +H 12.37789891 -1.89597831 8.01006210 0.02718557 -0.57802938 -0.01837073 +H 13.66203891 -0.92582021 8.84545010 -0.14241516 -0.36064813 0.14553697 +20 +Lattice="30.0 0.0 0.0 0.0 30.0 0.0 0.0 0.0 30.0" Properties=species:S:1:pos:R:3:forces:R:3 energy=-12892.389301489 label=CC chargeA=1 energyA=-6669.20645149176 chargeB=-1 energyB=-6220.48400518575 distance=6.948896944752651 pbc="T T T" +C 3.69000000 1.17800000 9.65700000 0.36201778 0.02632900 0.53765622 +C 5.89300000 2.10500000 10.26700000 -0.35735533 -0.49500614 -0.20594762 +N 6.46800000 0.95000000 9.98900000 1.28614612 -0.73396490 -0.20909149 +N 4.58400000 2.24900000 10.11300000 -1.53801286 -0.06556456 -0.39436338 +N 6.62900000 3.10900000 10.69900000 0.47213638 1.51154539 0.50865186 +H 5.91600000 0.16800000 9.69300000 -0.03863434 -0.38298168 -0.17793478 +H 7.49000000 0.89000000 9.89100000 -0.27860140 -0.25035947 0.02359613 +H 4.18700000 3.12900000 10.38500000 -0.30757421 0.33048744 0.10134203 +H 6.22600000 4.01600000 10.92500000 0.23248318 -0.25697632 -0.09433757 +H 7.61200000 2.96300000 10.84200000 0.47859576 0.13977947 0.14587069 +H 3.74200000 0.36200000 10.38300000 -0.15542504 -0.29858462 0.14884982 +H 4.02000000 0.78400000 8.69500000 -0.10034840 0.06523998 -0.37457863 +H 2.63834300 1.49675000 9.60785000 0.36148485 0.24017084 -0.07013562 +C 12.86621540 -1.02680803 8.41173911 0.39401719 0.78212346 -0.26548929 +C 11.83321540 -0.61380803 9.45073911 0.05137299 -0.13270778 0.80246933 +O 10.81921540 0.01219197 9.07273911 -1.39567559 0.87103837 -1.23523439 +O 12.02321540 -0.91380803 10.64873911 0.71156854 -0.58595215 0.93498178 +H 12.84521540 -0.29980803 7.59773911 -0.06842743 0.17355678 -0.30211152 +H 12.60921540 -1.98180803 7.96973911 0.02792528 -0.57837258 -0.01873862 +H 13.89335540 -1.01164993 8.80512711 -0.13769347 -0.35980051 0.14454506 +20 +Lattice="30.0 0.0 0.0 0.0 30.0 0.0 0.0 0.0 30.0" Properties=species:S:1:pos:R:3:forces:R:3 energy=-12892.2850015633 label=CC chargeA=1 energyA=-6669.20645149176 chargeB=-1 energyB=-6220.48400518575 distance=7.198490797924341 pbc="T T T" +C 3.69000000 1.17800000 9.65700000 0.37025873 0.03679320 0.52726109 +C 5.89300000 2.10500000 10.26700000 -0.41874010 -0.46961901 -0.12040590 +N 6.46800000 0.95000000 9.98900000 1.34751112 -0.80634360 -0.24293597 +N 4.58400000 2.24900000 10.11300000 -1.55215781 -0.08038552 -0.41480523 +N 6.62900000 3.10900000 10.69900000 0.51246308 1.52573121 0.52245485 +H 5.91600000 0.16800000 9.69300000 -0.04051190 -0.38227501 -0.17992099 +H 7.49000000 0.89000000 9.89100000 -0.34726553 -0.22579504 0.01649408 +H 4.18700000 3.12900000 10.38500000 -0.31033252 0.34691896 0.09153114 +H 6.22600000 4.01600000 10.92500000 0.22989670 -0.24535900 -0.10444081 +H 7.61200000 2.96300000 10.84200000 0.46163630 0.15441190 0.14439421 +H 3.74200000 0.36200000 10.38300000 -0.15109713 -0.30323069 0.15641170 +H 4.02000000 0.78400000 8.69500000 -0.10900300 0.06248358 -0.37354656 +H 2.63834300 1.49675000 9.60785000 0.35989764 0.24229754 -0.07224353 +C 13.09753188 -1.11263775 8.37141613 0.39169488 0.77482976 -0.25428975 +C 12.06453188 -0.69963775 9.41041613 0.05855810 -0.11324835 0.68078827 +O 11.05053188 -0.07363775 9.03241613 -1.31009938 0.81985723 -1.16603783 +O 12.25453188 -0.99963775 10.60841613 0.68249918 -0.57500845 0.96441802 +H 13.07653188 -0.38563775 7.55741613 -0.06978467 0.17546626 -0.29992190 +H 12.84053188 -2.06763775 7.92941613 0.02845336 -0.57854165 -0.01893824 +H 14.12467188 -1.09747965 8.76480413 -0.13387705 -0.35898331 0.14373335 +20 +Lattice="30.0 0.0 0.0 0.0 30.0 0.0 0.0 0.0 30.0" Properties=species:S:1:pos:R:3:forces:R:3 energy=-12892.1962812111 label=CC chargeA=1 energyA=-6669.20645149176 chargeB=-1 energyB=-6220.48400518575 distance=7.448111902988495 pbc="T T T" +C 3.69000000 1.17800000 9.65700000 0.37754720 0.04359837 0.51512072 +C 5.89300000 2.10500000 10.26700000 -0.47367109 -0.45303108 -0.03487791 +N 6.46800000 0.95000000 9.98900000 1.38861066 -0.85680080 -0.27239639 +N 4.58400000 2.24900000 10.11300000 -1.55122778 -0.09896012 -0.43428794 +N 6.62900000 3.10900000 10.69900000 0.54284081 1.52685641 0.53011787 +H 5.91600000 0.16800000 9.69300000 -0.04442488 -0.38195291 -0.18311568 +H 7.49000000 0.89000000 9.89100000 -0.39197710 -0.20464706 0.00900612 +H 4.18700000 3.12900000 10.38500000 -0.31420362 0.36755733 0.08382543 +H 6.22600000 4.01600000 10.92500000 0.22365429 -0.23011075 -0.11440689 +H 7.61200000 2.96300000 10.84200000 0.44973989 0.16517788 0.14117202 +H 3.74200000 0.36200000 10.38300000 -0.14643947 -0.30690576 0.16358271 +H 4.02000000 0.78400000 8.69500000 -0.11741531 0.06036758 -0.37152548 +H 2.63834300 1.49675000 9.60785000 0.35787965 0.24533246 -0.07406850 +C 13.32884837 -1.19846747 8.33109315 0.38951719 0.76854351 -0.24401572 +C 12.29584837 -0.78546747 9.37009315 0.06823686 -0.09870700 0.57508989 +O 11.28184837 -0.15946747 8.99209315 -1.24176287 0.77751437 -1.10303557 +O 12.48584837 -1.08546747 10.56809315 0.65619671 -0.56414546 0.98744130 +H 13.30784837 -0.47146747 7.51709315 -0.07118391 0.17716960 -0.29769075 +H 13.07184837 -2.15346747 7.88909315 0.02879423 -0.57858633 -0.01892994 +H 14.35598837 -1.18330937 8.72448115 -0.13071147 -0.35827024 0.14299471 +20 +Lattice="30.0 0.0 0.0 0.0 30.0 0.0 0.0 0.0 30.0" Properties=species:S:1:pos:R:3:forces:R:3 energy=-12892.1201126211 label=CC chargeA=1 energyA=-6669.20645149176 chargeB=-1 energyB=-6220.48400518575 distance=7.697757592338221 pbc="T T T" +C 3.69000000 1.17800000 9.65700000 0.38350043 0.04787129 0.50399312 +C 5.89300000 2.10500000 10.26700000 -0.52018448 -0.44024597 0.03892637 +N 6.46800000 0.95000000 9.98900000 1.41572337 -0.89417673 -0.29492878 +N 4.58400000 2.24900000 10.11300000 -1.54381014 -0.11717377 -0.45207714 +N 6.62900000 3.10900000 10.69900000 0.56579697 1.52207410 0.53385264 +H 5.91600000 0.16800000 9.69300000 -0.04928940 -0.38205144 -0.18657280 +H 7.49000000 0.89000000 9.89100000 -0.42072231 -0.18652066 0.00197465 +H 4.18700000 3.12900000 10.38500000 -0.31823617 0.38776721 0.07881884 +H 6.22600000 4.01600000 10.92500000 0.21581989 -0.21424380 -0.12238360 +H 7.61200000 2.96300000 10.84200000 0.44168674 0.17276817 0.13778616 +H 3.74200000 0.36200000 10.38300000 -0.14240354 -0.30984250 0.16956974 +H 4.02000000 0.78400000 8.69500000 -0.12455528 0.05884660 -0.36934326 +H 2.63834300 1.49675000 9.60785000 0.35581531 0.24846438 -0.07543273 +C 13.56016485 -1.28429719 8.29077016 0.38748686 0.76318281 -0.23499964 +C 12.52716485 -0.87129719 9.32977016 0.07871107 -0.08787234 0.48493287 +O 11.51316485 -0.24529719 8.95177016 -1.18652256 0.74248316 -1.04749047 +O 12.71716485 -1.17129719 10.52777016 0.63287983 -0.55387046 1.00532110 +H 13.53916485 -0.55729719 7.47677016 -0.07253754 0.17868370 -0.29555378 +H 13.30316485 -2.23929719 7.84877016 0.02897402 -0.57854115 -0.01876909 +H 14.58730485 -1.26913909 8.68415816 -0.12813309 -0.35760260 0.14237580 +20 +Lattice="30.0 0.0 0.0 0.0 30.0 0.0 0.0 0.0 30.0" Properties=species:S:1:pos:R:3:forces:R:3 energy=-12894.434099606 label=CC chargeA=-1 energyA=-6220.48891391419 chargeB=1 energyB=-6669.20926086133 distance=4.234635908871504 pbc="T T T" +C 25.65400000 -5.20500000 -2.23100000 0.01478298 -0.02673130 -0.06649977 +C 25.43700000 -3.85300000 -1.56500000 -2.19596691 -0.40845873 -0.24091970 +O 26.43300000 -3.22700000 -1.14000000 2.95246173 0.09947169 0.01044332 +O 24.27400000 -3.40300000 -1.47500000 -0.61717201 -0.07186745 -0.23253201 +H 26.34900000 -5.06000000 -3.05900000 0.34482881 -0.12896995 -0.16052409 +H 24.71500000 -5.57700000 -2.64500000 -0.14184215 -0.08356096 0.07285538 +H 26.07672000 -5.94638300 -1.53698600 0.05570445 0.10000252 -0.02955307 +C 25.01868999 0.94028982 1.66744602 -0.33311378 -0.17561577 -0.54357879 +C 25.44768999 -0.19971018 -0.47955398 0.73865200 -1.41414437 1.40217655 +N 25.98668999 -1.23271018 0.14444602 -0.41403746 2.77828796 1.25253205 +N 24.98468999 0.83728982 0.20644602 -0.45419181 1.50420659 0.82713143 +N 25.36468999 -0.21271018 -1.79455398 -0.10012869 0.42692558 -1.37512881 +H 26.14768999 -1.20471018 1.13444602 -0.16631449 0.09122990 0.34376481 +H 26.25868999 -2.06271018 -0.39055398 0.26146095 -2.30380404 -1.30570976 +H 24.60468999 1.61828982 -0.31055398 -0.05992581 0.06060549 0.01899363 +H 25.01468999 0.59228982 -2.29355398 -0.04795805 -0.12465318 -0.11495049 +H 25.78768999 -0.97071018 -2.31055398 -0.08126554 -0.33622536 -0.05168432 +H 24.80868999 1.97128982 1.96044602 -0.04016367 0.08190611 -0.06323108 +H 26.00868999 0.68128982 2.04844602 0.17548997 -0.05440713 0.11839257 +H 24.25272999 0.28405892 2.10637702 0.10869947 -0.01419760 0.13802216 +20 +Lattice="30.0 0.0 0.0 0.0 30.0 0.0 0.0 0.0 30.0" Properties=species:S:1:pos:R:3:forces:R:3 energy=-12894.4095196711 label=CC chargeA=-1 energyA=-6220.48891391419 chargeB=1 energyB=-6669.20926086133 distance=4.484376426240713 pbc="T T T" +C 25.65400000 -5.20500000 -2.23100000 0.00273026 -0.06174100 -0.08231323 +C 25.43700000 -3.85300000 -1.56500000 -1.81793911 -0.07845036 -0.05356085 +O 26.43300000 -3.22700000 -1.14000000 2.62227439 1.03002551 0.59781226 +O 24.27400000 -3.40300000 -1.47500000 -0.84403718 -0.04452061 -0.24893233 +H 26.34900000 -5.06000000 -3.05900000 0.34135003 -0.12680825 -0.16074181 +H 24.71500000 -5.57700000 -2.64500000 -0.14454553 -0.09783094 0.06523007 +H 26.07672000 -5.94638300 -1.53698600 0.05243828 0.09605397 -0.02907044 +C 25.00884500 1.16864491 1.76872301 -0.33555583 -0.18236146 -0.49605107 +C 25.43784500 0.02864491 -0.37827699 0.58372835 -1.17442642 1.04663712 +N 25.97684500 -1.00435509 0.24572301 -0.09256694 1.41052472 0.51007664 +N 24.97484500 1.06564491 0.30772301 -0.37042039 1.35013080 0.82855842 +N 25.35484500 0.01564491 -1.69327699 -0.08450647 0.38053229 -1.23111975 +H 26.13784500 -0.97635509 1.23572301 -0.11643521 -0.03844047 0.30546144 +H 26.24884500 -1.83435509 -0.28927699 0.13851684 -2.02093547 -1.02508585 +H 24.59484500 1.84664491 -0.20927699 -0.04913269 0.04519536 0.00257139 +H 25.00484500 0.82064491 -2.19227699 -0.05461016 -0.11775466 -0.12248771 +H 25.77784500 -0.74235509 -2.20927699 -0.07967461 -0.39083589 -0.09935094 +H 24.79884500 2.19964491 2.06172301 -0.03379450 0.07387408 -0.06191496 +H 25.99884500 0.90964491 2.14972301 0.17708496 -0.04464721 0.12127108 +H 24.24288500 0.51241401 2.20765401 0.10509551 -0.00758397 0.13301053 +20 +Lattice="30.0 0.0 0.0 0.0 30.0 0.0 0.0 0.0 30.0" Properties=species:S:1:pos:R:3:forces:R:3 energy=-12894.1715863393 label=CC chargeA=-1 energyA=-6220.48891391419 chargeB=1 energyB=-6669.20926086133 distance=4.734144335052735 pbc="T T T" +C 25.65400000 -5.20500000 -2.23100000 -0.00720444 -0.09229022 -0.09735001 +C 25.43700000 -3.85300000 -1.56500000 -1.54048458 0.16397162 0.08479951 +O 26.43300000 -3.22700000 -1.14000000 2.46330385 1.19829533 0.71225161 +O 24.27400000 -3.40300000 -1.47500000 -1.01079428 -0.04135087 -0.26208442 +H 26.34900000 -5.06000000 -3.05900000 0.33869880 -0.12485425 -0.16116924 +H 24.71500000 -5.57700000 -2.64500000 -0.14782331 -0.10965738 0.05846671 +H 26.07672000 -5.94638300 -1.53698600 0.05013175 0.09318524 -0.02808354 +C 24.99900000 1.39700000 1.87000000 -0.33619998 -0.18683754 -0.45816277 +C 25.42800000 0.25700000 -0.27700000 0.46832267 -0.97267440 0.82186186 +N 25.96700000 -0.77600000 0.34700000 0.06757647 0.67119693 0.15651319 +N 24.96500000 1.29400000 0.40900000 -0.30904297 1.23247290 0.82032107 +N 25.34500000 0.24400000 -1.59200000 -0.07478063 0.34361838 -1.13265661 +H 26.12800000 -0.74800000 1.33700000 -0.08394056 -0.11621515 0.29214431 +H 26.23900000 -1.60600000 -0.18800000 0.05142474 -1.60578117 -0.70496041 +H 24.58500000 2.07500000 -0.10800000 -0.04377883 0.03941582 -0.01019538 +H 24.99500000 1.04900000 -2.09100000 -0.05891874 -0.11196327 -0.13300817 +H 25.76800000 -0.51400000 -2.10800000 -0.07705718 -0.40911834 -0.14881912 +H 24.78900000 2.42800000 2.16300000 -0.02975249 0.06857294 -0.06153557 +H 25.98900000 1.13800000 2.25100000 0.17795814 -0.03760176 0.12273814 +H 24.23304000 0.74076910 2.30893100 0.10236157 -0.00238481 0.12892885 +20 +Lattice="30.0 0.0 0.0 0.0 30.0 0.0 0.0 0.0 30.0" Properties=species:S:1:pos:R:3:forces:R:3 energy=-12893.8815163103 label=CC chargeA=-1 energyA=-6220.48891391419 chargeB=1 energyB=-6669.20926086133 distance=4.983935517010137 pbc="T T T" +C 25.65400000 -5.20500000 -2.23100000 -0.01628402 -0.11935261 -0.11233664 +C 25.43700000 -3.85300000 -1.56500000 -1.32446867 0.34499724 0.18986761 +O 26.43300000 -3.22700000 -1.14000000 2.36636784 1.10438470 0.67714523 +O 24.27400000 -3.40300000 -1.47500000 -1.13936889 -0.05125087 -0.27278601 +H 26.34900000 -5.06000000 -3.05900000 0.33676363 -0.12311210 -0.16167538 +H 24.71500000 -5.57700000 -2.64500000 -0.15126033 -0.11971344 0.05236338 +H 26.07672000 -5.94638300 -1.53698600 0.04850762 0.09109153 -0.02686815 +C 24.98915500 1.62535509 1.97127699 -0.33583574 -0.18990243 -0.42749986 +C 25.41815500 0.48535509 -0.17572301 0.38089171 -0.80276037 0.67964239 +N 25.95715500 -0.54764491 0.44827699 0.15428052 0.24205869 -0.01982784 +N 24.95515500 1.52235509 0.51027699 -0.26272221 1.13981087 0.80712334 +N 25.33515500 0.47235509 -1.49072301 -0.06919197 0.31168821 -1.06489448 +H 26.11815500 -0.51964491 1.43827699 -0.06168949 -0.16292551 0.29095501 +H 26.22915500 -1.37764491 -0.08672301 -0.00108426 -1.22736215 -0.43940677 +H 24.57515500 2.30335509 -0.00672301 -0.04144604 0.03862284 -0.02034127 +H 24.98515500 1.27735509 -1.98972301 -0.06187873 -0.10687129 -0.14467866 +H 25.75815500 -0.28564491 -2.00672301 -0.07319776 -0.40375402 -0.19414486 +H 24.77915500 2.65635509 2.26427699 -0.02709212 0.06487330 -0.06161683 +H 25.97915500 1.36635509 2.35227699 0.17852724 -0.03232098 0.12339590 +H 24.22319500 0.96912419 2.41020799 0.10018167 0.00179838 0.12558389 +20 +Lattice="30.0 0.0 0.0 0.0 30.0 0.0 0.0 0.0 30.0" Properties=species:S:1:pos:R:3:forces:R:3 energy=-12893.5976487247 label=CC chargeA=-1 energyA=-6220.48891391419 chargeB=1 energyB=-6669.20926086133 distance=5.233746639606387 pbc="T T T" +C 25.65400000 -5.20500000 -2.23100000 -0.02457583 -0.14287467 -0.12667042 +C 25.43700000 -3.85300000 -1.56500000 -1.15024785 0.48192575 0.27112924 +O 26.43300000 -3.22700000 -1.14000000 2.29370442 0.94059550 0.60532708 +O 24.27400000 -3.40300000 -1.47500000 -1.24157638 -0.06804811 -0.28187319 +H 26.34900000 -5.06000000 -3.05900000 0.33543428 -0.12157948 -0.16227024 +H 24.71500000 -5.57700000 -2.64500000 -0.15462966 -0.12830728 0.04690626 +H 26.07672000 -5.94638300 -1.53698600 0.04738910 0.08948846 -0.02548417 +C 24.97931001 1.85371018 2.07255398 -0.33498138 -0.19215461 -0.40221457 +C 25.40831001 0.71371018 -0.07444602 0.31332548 -0.65862905 0.58879798 +N 25.94731001 -0.31928982 0.54955398 0.20462919 -0.02606294 -0.11121301 +N 24.94531001 1.75071018 0.61155398 -0.22652446 1.06428609 0.79205350 +N 25.32531001 0.70071018 -1.38944602 -0.06647447 0.28276270 -1.01819820 +H 26.10831001 -0.29128982 1.53955398 -0.04553189 -0.19128515 0.29543094 +H 26.21931001 -1.14928982 0.01455398 -0.02858454 -0.92366379 -0.23850401 +H 24.56531001 2.53171018 0.09455398 -0.04096362 0.04070778 -0.02880251 +H 24.97531001 1.50571018 -1.88844602 -0.06414620 -0.10195896 -0.15637197 +H 25.74831001 -0.05728982 -1.90544602 -0.06824883 -0.38457340 -0.23259449 +H 24.76931001 2.88471018 2.36555398 -0.02535085 0.06228181 -0.06192792 +H 25.96931001 1.59471018 2.45355398 0.17897296 -0.02822307 0.12362162 +H 24.21335001 1.19747928 2.51148498 0.09838052 0.00531242 0.12285808 +20 +Lattice="30.0 0.0 0.0 0.0 30.0 0.0 0.0 0.0 30.0" Properties=species:S:1:pos:R:3:forces:R:3 energy=-12893.3385023881 label=CC chargeA=-1 energyA=-6220.48891391419 chargeB=1 energyB=-6669.20926086133 distance=5.483574974256216 pbc="T T T" +C 25.65400000 -5.20500000 -2.23100000 -0.03179903 -0.16367972 -0.14063061 +C 25.43700000 -3.85300000 -1.56500000 -1.00776979 0.58684647 0.33490802 +O 26.43300000 -3.22700000 -1.14000000 2.23286206 0.77721388 0.53437628 +O 24.27400000 -3.40300000 -1.47500000 -1.32358341 -0.08816560 -0.28971796 +H 26.34900000 -5.06000000 -3.05900000 0.33452822 -0.12031318 -0.16289057 +H 24.71500000 -5.57700000 -2.64500000 -0.15786723 -0.13558667 0.04214258 +H 26.07672000 -5.94638300 -1.53698600 0.04659999 0.08817127 -0.02394025 +C 24.96946501 2.08206527 2.17383096 -0.33395748 -0.19402607 -0.38110997 +C 25.39846501 0.94206527 0.02683096 0.26045338 -0.53503745 0.53019406 +N 25.93746501 -0.09093473 0.65083096 0.23535818 -0.20539944 -0.15910069 +N 24.93546501 1.97906527 0.71283096 -0.19738079 1.00074262 0.77720470 +N 25.31546501 0.92906527 -1.28816904 -0.06582195 0.25574602 -0.98650037 +H 26.09846501 -0.06293473 1.64083096 -0.03316942 -0.20869137 0.30241715 +H 26.20946501 -0.92093473 0.11583096 -0.04012098 -0.69141430 -0.09193791 +H 24.55546501 2.76006527 0.19583096 -0.04177162 0.04485904 -0.03642289 +H 24.96546501 1.73406527 -1.78716904 -0.06617361 -0.09678583 -0.16746794 +H 25.73846501 0.17106527 -1.80416904 -0.06245884 -0.35846910 -0.26344718 +H 24.75946501 3.11306527 2.46683096 -0.02424537 0.06059665 -0.06240015 +H 25.95946501 1.82306527 2.55483096 0.17943472 -0.02496715 0.12363763 +H 24.20350501 1.42583437 2.61276196 0.09688298 0.00835993 0.12068609 +20 +Lattice="30.0 0.0 0.0 0.0 30.0 0.0 0.0 0.0 30.0" Properties=species:S:1:pos:R:3:forces:R:3 energy=-12893.1076496113 label=CC chargeA=-1 energyA=-6220.48891391419 chargeB=1 energyB=-6669.20926086133 distance=5.733418286779269 pbc="T T T" +C 25.65400000 -5.20500000 -2.23100000 -0.03777314 -0.18073865 -0.15283819 +C 25.43700000 -3.85300000 -1.56500000 -0.88773952 0.66251515 0.38374356 +O 26.43300000 -3.22700000 -1.14000000 2.17605209 0.63439949 0.47262313 +O 24.27400000 -3.40300000 -1.47500000 -1.38753233 -0.10665508 -0.29504592 +H 26.34900000 -5.06000000 -3.05900000 0.33377386 -0.11920578 -0.16358126 +H 24.71500000 -5.57700000 -2.64500000 -0.16100694 -0.14153399 0.03803804 +H 26.07672000 -5.94638300 -1.53698600 0.04594276 0.08717550 -0.02240545 +C 24.95962002 2.31042037 2.27510795 -0.33278054 -0.19593390 -0.36478750 +C 25.38862002 1.17042037 0.12810795 0.21747811 -0.42529171 0.49234322 +N 25.92762002 0.13742037 0.75210795 0.25582104 -0.34037708 -0.18139179 +N 24.92562002 2.20742037 0.81410795 -0.17417951 0.94917803 0.76663104 +N 25.30562002 1.15742037 -1.18689205 -0.06822013 0.22810978 -0.97065838 +H 26.08862002 0.16542037 1.74210795 -0.02306738 -0.21933524 0.30996659 +H 26.19962002 -0.69257963 0.21710795 -0.04185409 -0.51295236 0.01539898 +H 24.54562002 2.98842037 0.29710795 -0.04296012 0.05178889 -0.04401425 +H 24.95562002 1.96242037 -1.68589205 -0.06766195 -0.09098860 -0.17750288 +H 25.72862002 0.39942037 -1.70289205 -0.05604282 -0.32840941 -0.28677314 +H 24.74962002 3.34142037 2.56810795 -0.02358620 0.05979909 -0.06297609 +H 25.94962002 2.05142037 2.65610795 0.17985177 -0.02221663 0.12393525 +H 24.19366002 1.65418947 2.71403895 0.09548503 0.01067252 0.11929501 +20 +Lattice="30.0 0.0 0.0 0.0 30.0 0.0 0.0 0.0 30.0" Properties=species:S:1:pos:R:3:forces:R:3 energy=-12892.9073116316 label=CC chargeA=-1 energyA=-6220.48891391419 chargeB=1 energyB=-6669.20926086133 distance=5.983274680706614 pbc="T T T" +C 25.65400000 -5.20500000 -2.23100000 -0.04697711 -0.17864904 -0.15518480 +C 25.43700000 -3.85300000 -1.56500000 -0.72530526 0.60405922 0.37206550 +O 26.43300000 -3.22700000 -1.14000000 2.04035619 0.53956199 0.42669274 +O 24.27400000 -3.40300000 -1.47500000 -1.40770419 -0.07921543 -0.27002536 +H 26.34900000 -5.06000000 -3.05900000 0.33105578 -0.11695696 -0.16402126 +H 24.71500000 -5.57700000 -2.64500000 -0.16596953 -0.14771955 0.03273865 +H 26.07672000 -5.94638300 -1.53698600 0.04320332 0.08795534 -0.02080123 +C 24.94977502 2.53877546 2.37638494 -0.32482020 -0.19427369 -0.37457700 +C 25.37877502 1.39877546 0.22938494 0.12605606 -0.32510601 0.47145518 +N 25.91777502 0.36577546 0.85338494 0.32746196 -0.53348284 -0.15948086 +N 24.91577502 2.43577546 0.91538494 -0.17445264 0.95928571 0.79830500 +N 25.29577502 1.38577546 -1.08561506 -0.07873289 0.18322050 -1.03749556 +H 26.07877502 0.39377546 1.84338494 -0.00779484 -0.22572562 0.30856380 +H 26.18977502 -0.46422454 0.31838494 -0.04256240 -0.33638276 0.12095249 +H 24.53577502 3.21677546 0.39838494 -0.03501628 0.06578787 -0.05124595 +H 24.94577502 2.19077546 -1.58461506 -0.05847545 -0.07583416 -0.18883457 +H 25.71877502 0.62777546 -1.60161506 -0.04742696 -0.27470674 -0.29907204 +H 24.73977502 3.56977546 2.66938494 -0.02180874 0.05983711 -0.06255187 +H 25.93977502 2.27977546 2.75738494 0.17887311 -0.01804756 0.13047981 +H 24.18381502 1.88254456 2.81531594 0.09004007 0.00639264 0.12203734 +20 +Lattice="30.0 0.0 0.0 0.0 30.0 0.0 0.0 0.0 30.0" Properties=species:S:1:pos:R:3:forces:R:3 energy=-12892.7385235753 label=CC chargeA=-1 energyA=-6220.48891391419 chargeB=1 energyB=-6669.20926086133 distance=6.233142590610293 pbc="T T T" +C 25.65400000 -5.20500000 -2.23100000 -0.05580857 -0.17108762 -0.15378602 +C 25.43700000 -3.85300000 -1.56500000 -0.58131702 0.51109991 0.33964965 +O 26.43300000 -3.22700000 -1.14000000 1.90181014 0.47931435 0.39802489 +O 24.27400000 -3.40300000 -1.47500000 -1.40785744 -0.04363963 -0.23943019 +H 26.34900000 -5.06000000 -3.05900000 0.32846862 -0.11484266 -0.16463427 +H 24.71500000 -5.57700000 -2.64500000 -0.17072528 -0.15318664 0.02760716 +H 26.07672000 -5.94638300 -1.53698600 0.04051124 0.08872440 -0.01949925 +C 24.93993003 2.76713055 2.47766193 -0.31509757 -0.19157025 -0.38930336 +C 25.36893003 1.62713055 0.33066193 0.02798797 -0.24639176 0.46036261 +N 25.90793003 0.59413055 0.95466193 0.40814117 -0.70515029 -0.12851091 +N 24.90593003 2.66413055 1.01666193 -0.18011326 0.98079719 0.83549321 +N 25.28593003 1.61413055 -0.98433807 -0.08651364 0.14011066 -1.11429129 +H 26.06893003 0.62213055 1.94466193 0.00721208 -0.22943826 0.30588142 +H 26.17993003 -0.23586945 0.41966193 -0.04441689 -0.19281672 0.20676410 +H 24.52593003 3.44513055 0.49966193 -0.02713037 0.07930055 -0.05830437 +H 24.93593003 2.41913055 -1.48333807 -0.04840547 -0.05633948 -0.20070586 +H 25.70893003 0.85613055 -1.50033807 -0.03837376 -0.22167502 -0.30623660 +H 24.72993003 3.79813055 2.77066193 -0.02003956 0.06016482 -0.06202049 +H 25.92993003 2.50813055 2.85866193 0.17765801 -0.01428161 0.13769663 +H 24.17397003 2.11089965 2.91659293 0.08400960 0.00090806 0.12524293 +20 +Lattice="30.0 0.0 0.0 0.0 30.0 0.0 0.0 0.0 30.0" Properties=species:S:1:pos:R:3:forces:R:3 energy=-12892.5961329345 label=CC chargeA=-1 energyA=-6220.48891391419 chargeB=1 energyB=-6669.20926086133 distance=6.48302068543071 pbc="T T T" +C 25.65400000 -5.20500000 -2.23100000 -0.06303104 -0.16249435 -0.15099462 +C 25.43700000 -3.85300000 -1.56500000 -0.46299967 0.41553878 0.30336215 +O 26.43300000 -3.22700000 -1.14000000 1.78280394 0.43911967 0.37890457 +O 24.27400000 -3.40300000 -1.47500000 -1.40217679 -0.00869193 -0.21064581 +H 26.34900000 -5.06000000 -3.05900000 0.32641089 -0.11289306 -0.16555923 +H 24.71500000 -5.57700000 -2.64500000 -0.17532078 -0.15767561 0.02314488 +H 26.07672000 -5.94638300 -1.53698600 0.03829224 0.08916945 -0.01819089 +C 24.93008503 2.99548564 2.57893892 -0.30554053 -0.18940464 -0.40305294 +C 25.35908503 1.85548564 0.43193892 -0.06026893 -0.18323461 0.45475419 +N 25.89808503 0.82248564 1.05593892 0.47910854 -0.84670485 -0.09780572 +N 24.89608503 2.89248564 1.11793892 -0.18517059 1.00140448 0.86982123 +N 25.27608503 1.84248564 -0.88306108 -0.09314183 0.10068928 -1.18331049 +H 26.05908503 0.85048564 2.04593892 0.02016475 -0.23080588 0.30356841 +H 26.17008503 -0.00751436 0.52093892 -0.04528960 -0.08029537 0.27207594 +H 24.51608503 3.67348564 0.60093892 -0.02033887 0.09204692 -0.06543985 +H 24.92608503 2.64748564 -1.38206108 -0.03971947 -0.03640469 -0.21113276 +H 25.69908503 1.08448564 -1.39906108 -0.02953805 -0.17518621 -0.30980275 +H 24.72008503 4.02648564 2.87193892 -0.01868199 0.06079203 -0.06182397 +H 25.92008503 2.73648564 2.95993892 0.17586066 -0.01080067 0.14413321 +H 24.16412503 2.33925474 3.01786992 0.07857712 -0.00416875 0.12799445 +20 +Lattice="30.0 0.0 0.0 0.0 30.0 0.0 0.0 0.0 30.0" Properties=species:S:1:pos:R:3:forces:R:3 energy=-12892.4753909764 label=CC chargeA=-1 energyA=-6220.48891391419 chargeB=1 energyB=-6669.20926086133 distance=6.732907830696661 pbc="T T T" +C 25.65400000 -5.20500000 -2.23100000 -0.06874745 -0.15532656 -0.14871687 +C 25.43700000 -3.85300000 -1.56500000 -0.37059648 0.34096991 0.27492736 +O 26.43300000 -3.22700000 -1.14000000 1.68474690 0.40744213 0.36365850 +O 24.27400000 -3.40300000 -1.47500000 -1.39254489 0.01869988 -0.18749397 +H 26.34900000 -5.06000000 -3.05900000 0.32470813 -0.11164204 -0.16612752 +H 24.71500000 -5.57700000 -2.64500000 -0.17849777 -0.16129036 0.01957414 +H 26.07672000 -5.94638300 -1.53698600 0.03649125 0.08944626 -0.01745855 +C 24.92024004 3.22384073 2.68021591 -0.29691993 -0.18784774 -0.41277065 +C 25.34924004 2.08384073 0.53321591 -0.13495099 -0.13206680 0.45151490 +N 25.88824004 1.05084073 1.15721591 0.53289749 -0.95506663 -0.07370039 +N 24.88624004 3.12084073 1.21921591 -0.18547521 1.01091849 0.89545232 +N 25.26624004 2.07084073 -0.78178409 -0.09869449 0.06665803 -1.23369191 +H 26.04924004 1.07884073 2.14721591 0.03117697 -0.23131608 0.30487829 +H 26.16024004 0.22084073 0.62221591 -0.04416944 0.00478574 0.31981766 +H 24.50624004 3.90184073 0.70221591 -0.01621432 0.10547350 -0.07344623 +H 24.91624004 2.87584073 -1.28078409 -0.03400802 -0.01624068 -0.22160120 +H 25.68924004 1.31284073 -1.29778409 -0.02028770 -0.13888479 -0.31270429 +H 24.71024004 4.25484073 2.97321591 -0.01745588 0.06187800 -0.06172835 +H 25.91024004 2.96484073 3.06121591 0.17472244 -0.00797236 0.14948695 +H 24.15428004 2.56760983 3.11914691 0.07381939 -0.00861789 0.13012980 +20 +Lattice="30.0 0.0 0.0 0.0 30.0 0.0 0.0 0.0 30.0" Properties=species:S:1:pos:R:3:forces:R:3 energy=-12892.3722607997 label=CC chargeA=-1 energyA=-6220.48891391419 chargeB=1 energyB=-6669.20926086133 distance=6.982803051457227 pbc="T T T" +C 25.65400000 -5.20500000 -2.23100000 -0.07341265 -0.14803780 -0.14575823 +C 25.43700000 -3.85300000 -1.56500000 -0.29297357 0.26850244 0.24610376 +O 26.43300000 -3.22700000 -1.14000000 1.60027063 0.38605706 0.35292650 +O 24.27400000 -3.40300000 -1.47500000 -1.38161765 0.04465404 -0.16637260 +H 26.34900000 -5.06000000 -3.05900000 0.32322971 -0.11028653 -0.16679780 +H 24.71500000 -5.57700000 -2.64500000 -0.18161418 -0.16426097 0.01648803 +H 26.07672000 -5.94638300 -1.53698600 0.03489391 0.08968838 -0.01660099 +C 24.91039504 3.45219582 2.78149289 -0.28820582 -0.18681857 -0.42121584 +C 25.33939504 2.31219582 0.63449289 -0.20388508 -0.09139960 0.45013052 +N 25.87839504 1.27919582 1.25849289 0.57970589 -1.04478346 -0.05138096 +N 24.87639504 3.34919582 1.32049289 -0.18424074 1.01861396 0.91878489 +N 25.25639504 2.29919582 -0.68050711 -0.10344678 0.03594690 -1.27646054 +H 26.03939504 1.30719582 2.24849289 0.04077274 -0.23041907 0.30632760 +H 26.15039504 0.44919582 0.72349289 -0.04239163 0.07290146 0.35612796 +H 24.49639504 4.13019582 0.80349289 -0.01262108 0.11856202 -0.08177028 +H 24.90639504 3.10419582 -1.17950711 -0.02934563 0.00427515 -0.23080539 +H 25.67939504 1.54119582 -1.19650711 -0.01102302 -0.10843248 -0.31380274 +H 24.70039504 4.48319582 3.07449289 -0.01651246 0.06319122 -0.06195931 +H 25.90039504 3.19319582 3.16249289 0.17289808 -0.00519888 0.15424830 +H 24.14443504 2.79596492 3.22042389 0.06951933 -0.01275528 0.13178712 +20 +Lattice="30.0 0.0 0.0 0.0 30.0 0.0 0.0 0.0 30.0" Properties=species:S:1:pos:R:3:forces:R:3 energy=-12892.283584221 label=CC chargeA=-1 energyA=-6220.48891391419 chargeB=1 energyB=-6669.20926086133 distance=7.232705517383349 pbc="T T T" +C 25.65400000 -5.20500000 -2.23100000 -0.07701164 -0.14144769 -0.14280134 +C 25.43700000 -3.85300000 -1.56500000 -0.22954974 0.20492092 0.22045168 +O 26.43300000 -3.22700000 -1.14000000 1.52868993 0.37040271 0.34462456 +O 24.27400000 -3.40300000 -1.47500000 -1.36979711 0.06708799 -0.14825066 +H 26.34900000 -5.06000000 -3.05900000 0.32191463 -0.10900815 -0.16738145 +H 24.71500000 -5.57700000 -2.64500000 -0.18428671 -0.16659603 0.01392968 +H 26.07672000 -5.94638300 -1.53698600 0.03347384 0.08995873 -0.01583419 +C 24.90055005 3.68055091 2.88276988 -0.27967752 -0.18626508 -0.42746477 +C 25.32955005 2.54055091 0.73576988 -0.26637601 -0.05916111 0.44949244 +N 25.86855005 1.50755091 1.35976988 0.61775732 -1.11624141 -0.03256894 +N 24.86655005 3.57755091 1.42176988 -0.18025487 1.02148660 0.93806925 +N 25.24655005 2.52755091 -0.57923012 -0.10744427 0.00894870 -1.30882863 +H 26.02955005 1.53555091 2.34976988 0.04912671 -0.22873752 0.30893427 +H 26.14055005 0.67755091 0.82476988 -0.03959243 0.12672612 0.38287074 +H 24.48655005 4.35855091 0.90476988 -0.01002740 0.13167916 -0.09057240 +H 24.89655005 3.33255091 -1.07823012 -0.02615095 0.02497777 -0.23928534 +H 25.66955005 1.76955091 -1.09523012 -0.00152467 -0.08439543 -0.31424625 +H 24.69055005 4.71155091 3.17576988 -0.01575815 0.06476085 -0.06241988 +H 25.89055005 3.42155091 3.26376988 0.17081394 -0.00258637 0.15834054 +H 24.13459005 3.02432001 3.32170088 0.06567511 -0.01651077 0.13294069 +20 +Lattice="30.0 0.0 0.0 0.0 30.0 0.0 0.0 0.0 30.0" Properties=species:S:1:pos:R:3:forces:R:3 energy=-12894.2894487694 label=CC chargeA=1 energyA=-6669.20645149176 chargeB=-1 energyB=-6220.48400518575 distance=3.911637245564241 pbc="T T T" +C 32.59000000 -10.26800000 58.76100000 -0.91749302 -0.01307912 0.97976456 +C 31.01900000 -11.54600000 60.23100000 0.15930957 1.14094872 -1.01979669 +N 29.86200000 -11.49700000 60.84900000 -1.23949050 -0.99774146 1.18252303 +N 31.29100000 -10.55900000 59.39400000 2.78575208 -2.02478630 -1.05462080 +N 31.82000000 -12.58200000 60.45800000 0.70977221 -0.85360608 0.33862873 +H 29.30600000 -10.65300000 60.75300000 -0.34430883 0.92659963 -0.10477047 +H 29.60200000 -12.19700000 61.53200000 0.01447233 0.03338724 -0.07806569 +H 30.57700000 -9.82700000 59.36500000 -1.41575420 1.35014656 0.57428387 +H 32.67200000 -12.69900000 59.93600000 0.12649005 -0.18983316 0.02378014 +H 31.49700000 -13.30000000 61.09500000 0.33426279 -0.07741387 -0.15765094 +H 32.42700000 -9.97000000 57.72400000 0.03030579 0.01446144 -0.14272433 +H 33.27200000 -11.11900000 58.79900000 0.19682963 -0.06530720 -0.06155264 +H 32.99285000 -9.42516400 59.34181000 0.44226853 -0.00741592 -0.31050909 +C 29.25927182 -8.35837272 57.78753400 0.28862041 0.37609784 -0.48575306 +C 28.87927182 -8.31037272 59.24853400 -2.99015733 2.07112234 -1.13011838 +O 29.49027182 -9.07537272 60.01553400 1.28772129 -1.43524387 1.80178795 +O 27.90127182 -7.60237272 59.55853400 0.22997245 0.08453952 0.03079462 +H 28.71627182 -9.18237272 57.31853400 -0.12557445 -0.15546186 -0.14890725 +H 30.32527182 -8.55737272 57.68153400 0.39825686 -0.01187292 -0.30469341 +H 28.99992182 -7.42286772 57.27026400 0.02874434 -0.16554152 0.06759986 +20 +Lattice="30.0 0.0 0.0 0.0 30.0 0.0 0.0 0.0 30.0" Properties=species:S:1:pos:R:3:forces:R:3 energy=-12894.3603857223 label=CC chargeA=1 energyA=-6669.20645149176 chargeB=-1 energyB=-6220.48400518575 distance=4.158329697640593 pbc="T T T" +C 32.59000000 -10.26800000 58.76100000 -0.90172371 0.12871010 0.92032356 +C 31.01900000 -11.54600000 60.23100000 0.17600159 1.01636289 -0.93118290 +N 29.86200000 -11.49700000 60.84900000 -1.24451297 -0.57300723 1.03535432 +N 31.29100000 -10.55900000 59.39400000 1.94256997 -1.35900971 -0.72477895 +N 31.82000000 -12.58200000 60.45800000 0.64149945 -0.76740453 0.29703589 +H 29.30600000 -10.65300000 60.75300000 -0.40832903 0.83122077 -0.10602299 +H 29.60200000 -12.19700000 61.53200000 -0.04405607 0.08643057 -0.06936744 +H 30.57700000 -9.82700000 59.36500000 -1.36441762 1.42380935 0.28936412 +H 32.67200000 -12.69900000 59.93600000 0.13211265 -0.19358611 0.02260982 +H 31.49700000 -13.30000000 61.09500000 0.33184594 -0.08539067 -0.15573867 +H 32.42700000 -9.97000000 57.72400000 0.02059284 0.01689826 -0.13274990 +H 33.27200000 -11.11900000 58.79900000 0.13770921 -0.06887196 -0.04132607 +H 32.99285000 -9.42516400 59.34181000 0.43186679 -0.01598132 -0.31629966 +C 29.11013591 -8.17968636 57.69626700 0.28731099 0.37458746 -0.51406445 +C 28.73013591 -8.13168636 59.15726700 -2.61724985 1.69236590 -1.03996204 +O 29.34113591 -8.89668636 59.92426700 2.05590837 -2.34871777 1.78653479 +O 27.75213591 -7.42368636 59.46726700 0.11966767 0.18560274 0.04988769 +H 28.56713591 -9.00368636 57.22726700 -0.13385219 -0.15498115 -0.15039346 +H 30.17613591 -8.37868636 57.59026700 0.41480759 -0.03474115 -0.25924159 +H 28.85078591 -7.24418136 57.17899700 0.02224841 -0.15429644 0.04001794 +20 +Lattice="30.0 0.0 0.0 0.0 30.0 0.0 0.0 0.0 30.0" Properties=species:S:1:pos:R:3:forces:R:3 energy=-12894.1700065143 label=CC chargeA=1 energyA=-6669.20645149176 chargeB=-1 energyB=-6220.48400518575 distance=4.40539507967846 pbc="T T T" +C 32.59000000 -10.26800000 58.76100000 -0.87100741 0.22908970 0.86816072 +C 31.01900000 -11.54600000 60.23100000 0.18443116 0.90051754 -0.85458082 +N 29.86200000 -11.49700000 60.84900000 -1.25285790 -0.33649210 0.95389649 +N 31.29100000 -10.55900000 59.39400000 1.42094902 -0.91036104 -0.56976584 +N 31.82000000 -12.58200000 60.45800000 0.58348227 -0.68449169 0.26050929 +H 29.30600000 -10.65300000 60.75300000 -0.44451662 0.67564855 -0.06876312 +H 29.60200000 -12.19700000 61.53200000 -0.08655168 0.11454391 -0.06068137 +H 30.57700000 -9.82700000 59.36500000 -1.13455971 1.30397346 0.04296863 +H 32.67200000 -12.69900000 59.93600000 0.13836881 -0.19653967 0.02032466 +H 31.49700000 -13.30000000 61.09500000 0.32825666 -0.09280612 -0.15195979 +H 32.42700000 -9.97000000 57.72400000 0.01358948 0.01721160 -0.12458035 +H 33.27200000 -11.11900000 58.79900000 0.09502809 -0.07214661 -0.02615546 +H 32.99285000 -9.42516400 59.34181000 0.42405268 -0.02278433 -0.32054946 +C 28.96100000 -8.00100000 57.60500000 0.28842676 0.38067258 -0.55285192 +C 28.58100000 -7.95300000 59.06600000 -2.31597445 1.39380103 -0.93543962 +O 29.19200000 -8.71800000 59.83300000 2.33878729 -2.64306908 1.81861959 +O 27.60300000 -7.24500000 59.37600000 0.00203537 0.28858500 0.06466103 +H 28.41800000 -8.82500000 57.13600000 -0.13894671 -0.15551101 -0.15334135 +H 30.02700000 -8.20000000 57.49900000 0.41252555 -0.04603752 -0.23067550 +H 28.70165000 -7.06549500 57.08773000 0.01448134 -0.14380421 0.02020421 +20 +Lattice="30.0 0.0 0.0 0.0 30.0 0.0 0.0 0.0 30.0" Properties=species:S:1:pos:R:3:forces:R:3 energy=-12893.8790231591 label=CC chargeA=1 energyA=-6669.20645149176 chargeB=-1 energyB=-6220.48400518575 distance=4.652773983572788 pbc="T T T" +C 32.59000000 -10.26800000 58.76100000 -0.83526613 0.29950260 0.82425804 +C 31.01900000 -11.54600000 60.23100000 0.19323442 0.79824747 -0.79242718 +N 29.86200000 -11.49700000 60.84900000 -1.26086408 -0.19966722 0.90778704 +N 31.29100000 -10.55900000 59.39400000 1.10377667 -0.61579259 -0.50382294 +N 31.82000000 -12.58200000 60.45800000 0.53487977 -0.60919410 0.22971529 +H 29.30600000 -10.65300000 60.75300000 -0.45751204 0.51621801 -0.01867909 +H 29.60200000 -12.19700000 61.53200000 -0.11773083 0.12807091 -0.05198146 +H 30.57700000 -9.82700000 59.36500000 -0.86179519 1.11018593 -0.12781882 +H 32.67200000 -12.69900000 59.93600000 0.14477215 -0.19884630 0.01745339 +H 31.49700000 -13.30000000 61.09500000 0.32392248 -0.10079831 -0.14614695 +H 32.42700000 -9.97000000 57.72400000 0.00876132 0.01653565 -0.11836809 +H 33.27200000 -11.11900000 58.79900000 0.06464319 -0.07433943 -0.01515722 +H 32.99285000 -9.42516400 59.34181000 0.41905905 -0.02804159 -0.32357040 +C 28.81186409 -7.82231364 57.51373300 0.29197922 0.38824577 -0.59010748 +C 28.43186409 -7.77431364 58.97473300 -2.07095515 1.15553756 -0.83449341 +O 29.04286409 -8.53931364 59.74173300 2.36361062 -2.62866791 1.82892596 +O 27.45386409 -7.06631364 59.28473300 -0.11190680 0.38513074 0.07798340 +H 28.26886409 -8.64631364 57.04473300 -0.14203949 -0.15647777 -0.15658864 +H 29.87786409 -8.02131364 57.40773300 0.40220156 -0.05148013 -0.21244290 +H 28.55251409 -6.88680864 56.99646300 0.00722927 -0.13436929 0.00548146 +20 +Lattice="30.0 0.0 0.0 0.0 30.0 0.0 0.0 0.0 30.0" Properties=species:S:1:pos:R:3:forces:R:3 energy=-12893.5702881476 label=CC chargeA=1 energyA=-6669.20645149176 chargeB=-1 energyB=-6220.48400518575 distance=4.900418928698813 pbc="T T T" +C 32.59000000 -10.26800000 58.76100000 -0.79966515 0.34917884 0.78818312 +C 31.01900000 -11.54600000 60.23100000 0.20578081 0.70768154 -0.74257051 +N 29.86200000 -11.49700000 60.84900000 -1.26809388 -0.11633240 0.88004502 +N 31.29100000 -10.55900000 59.39400000 0.91017946 -0.42237577 -0.48101333 +N 31.82000000 -12.58200000 60.45800000 0.49440814 -0.54107819 0.20282650 +H 29.30600000 -10.65300000 60.75300000 -0.45550678 0.37758047 0.03005677 +H 29.60200000 -12.19700000 61.53200000 -0.14074351 0.13202686 -0.04269193 +H 30.57700000 -9.82700000 59.36500000 -0.61137768 0.90970119 -0.23130381 +H 32.67200000 -12.69900000 59.93600000 0.15145228 -0.20063354 0.01408882 +H 31.49700000 -13.30000000 61.09500000 0.31807652 -0.11102448 -0.13704734 +H 32.42700000 -9.97000000 57.72400000 0.00554855 0.01548165 -0.11415784 +H 33.27200000 -11.11900000 58.79900000 0.04276203 -0.07507642 -0.00737357 +H 32.99285000 -9.42516400 59.34181000 0.41645736 -0.03204815 -0.32549582 +C 28.66272818 -7.64362728 57.42246600 0.29636601 0.39534135 -0.62149377 +C 28.28272818 -7.59562728 58.88346600 -1.86416250 0.95868067 -0.74606550 +O 28.89372818 -8.36062728 59.65046600 2.27064035 -2.48234520 1.80654346 +O 27.30472818 -6.88762728 59.19346600 -0.21801292 0.47247527 0.09280700 +H 28.11972818 -8.46762728 56.95346600 -0.14391037 -0.15748904 -0.15942968 +H 29.72872818 -7.84262728 57.31646600 0.38883778 -0.05386563 -0.19997531 +H 28.40337818 -6.70812228 56.90519600 0.00096353 -0.12587902 -0.00593228 +20 +Lattice="30.0 0.0 0.0 0.0 30.0 0.0 0.0 0.0 30.0" Properties=species:S:1:pos:R:3:forces:R:3 energy=-12893.2810237195 label=CC chargeA=1 energyA=-6669.20645149176 chargeB=-1 energyB=-6220.48400518575 distance=5.148291523570566 pbc="T T T" +C 32.59000000 -10.26800000 58.76100000 -0.76642732 0.38517155 0.75871653 +C 31.01900000 -11.54600000 60.23100000 0.22295109 0.62361295 -0.70056300 +N 29.86200000 -11.49700000 60.84900000 -1.27538847 -0.06100909 0.86086519 +N 31.29100000 -10.55900000 59.39400000 0.79006408 -0.29182939 -0.47996261 +N 31.82000000 -12.58200000 60.45800000 0.46045961 -0.47519486 0.17603910 +H 29.30600000 -10.65300000 60.75300000 -0.44466307 0.26628662 0.07170912 +H 29.60200000 -12.19700000 61.53200000 -0.15725325 0.12741491 -0.03149843 +H 30.57700000 -9.82700000 59.36500000 -0.40505101 0.73166711 -0.28666056 +H 32.67200000 -12.69900000 59.93600000 0.16013025 -0.20193247 0.00908375 +H 31.49700000 -13.30000000 61.09500000 0.30796338 -0.12716287 -0.12088727 +H 32.42700000 -9.97000000 57.72400000 0.00345050 0.01434229 -0.11203416 +H 33.27200000 -11.11900000 58.79900000 0.02630155 -0.07428898 -0.00187481 +H 32.99285000 -9.42516400 59.34181000 0.41584524 -0.03496600 -0.32630742 +C 28.51359227 -7.46494092 57.33119900 0.29886075 0.40196018 -0.64498167 +C 28.13359227 -7.41694092 58.79219900 -1.67367778 0.78362585 -0.67721402 +O 28.74459227 -8.18194092 59.55919900 2.12820022 -2.28804172 1.75866015 +O 27.15559227 -6.70894092 59.10219900 -0.31695946 0.55094860 0.11339635 +H 27.97059227 -8.28894092 56.86219900 -0.14496588 -0.15806069 -0.16135899 +H 29.57959227 -7.66394092 57.22519900 0.37436291 -0.05440806 -0.18979288 +H 28.25424227 -6.52943592 56.81392900 -0.00420335 -0.11813593 -0.01533436 +20 +Lattice="30.0 0.0 0.0 0.0 30.0 0.0 0.0 0.0 30.0" Properties=species:S:1:pos:R:3:forces:R:3 energy=-12893.0250648029 label=CC chargeA=1 energyA=-6669.20645149176 chargeB=-1 energyB=-6220.48400518575 distance=5.396360398172885 pbc="T T T" +C 32.59000000 -10.26800000 58.76100000 -0.73702783 0.41307297 0.73428376 +C 31.01900000 -11.54600000 60.23100000 0.24650699 0.53960751 -0.65997370 +N 29.86200000 -11.49700000 60.84900000 -1.28393199 -0.01795957 0.84392951 +N 31.29100000 -10.55900000 59.39400000 0.71266265 -0.19712316 -0.49218280 +N 31.82000000 -12.58200000 60.45800000 0.42959576 -0.40417716 0.14564445 +H 29.30600000 -10.65300000 60.75300000 -0.42923901 0.18053110 0.10490997 +H 29.60200000 -12.19700000 61.53200000 -0.16811410 0.11349872 -0.01717985 +H 30.57700000 -9.82700000 59.36500000 -0.24212000 0.58238843 -0.31090727 +H 32.67200000 -12.69900000 59.93600000 0.17484675 -0.20308260 -0.00035795 +H 31.49700000 -13.30000000 61.09500000 0.29017382 -0.15392282 -0.09322909 +H 32.42700000 -9.97000000 57.72400000 0.00220386 0.01305681 -0.11189160 +H 33.27200000 -11.11900000 58.79900000 0.01334698 -0.07301651 0.00235286 +H 32.99285000 -9.42516400 59.34181000 0.41688868 -0.03687851 -0.32586982 +C 28.36445636 -7.28625456 57.23993200 0.29598510 0.40883590 -0.65877894 +C 27.98445636 -7.23825456 58.70093200 -1.47891402 0.61319768 -0.63261512 +O 28.59545636 -8.00325456 59.46793200 1.96284126 -2.07732544 1.69251224 +O 27.00645636 -6.53025456 59.01093200 -0.41208647 0.62208698 0.14389820 +H 27.82145636 -8.11025456 56.77093200 -0.14554446 -0.15783212 -0.16189161 +H 29.43045636 -7.48525456 57.13393200 0.36009813 -0.05387210 -0.17919288 +H 28.10510636 -6.35074956 56.72266200 -0.00817211 -0.11108612 -0.02346035 +20 +Lattice="30.0 0.0 0.0 0.0 30.0 0.0 0.0 0.0 30.0" Properties=species:S:1:pos:R:3:forces:R:3 energy=-12892.8051596708 label=CC chargeA=1 energyA=-6669.20645149176 chargeB=-1 energyB=-6220.48400518575 distance=5.6445996742594495 pbc="T T T" +C 32.59000000 -10.26800000 58.76100000 -0.71341569 0.43614239 0.71404428 +C 31.01900000 -11.54600000 60.23100000 0.27679472 0.45797867 -0.61668560 +N 29.86200000 -11.49700000 60.84900000 -1.29447375 0.01918983 0.82785179 +N 31.29100000 -10.55900000 59.39400000 0.66052126 -0.12402373 -0.51293902 +N 31.82000000 -12.58200000 60.45800000 0.39880414 -0.32991500 0.11387645 +H 29.30600000 -10.65300000 60.75300000 -0.41249575 0.11452297 0.13084679 +H 29.60200000 -12.19700000 61.53200000 -0.17499845 0.09374845 -0.00145217 +H 30.57700000 -9.82700000 59.36500000 -0.11618746 0.46090719 -0.31757379 +H 32.67200000 -12.69900000 59.93600000 0.19619265 -0.20468174 -0.01485454 +H 31.49700000 -13.30000000 61.09500000 0.26662391 -0.18827466 -0.05837366 +H 32.42700000 -9.97000000 57.72400000 0.00175158 0.01155821 -0.11322541 +H 33.27200000 -11.11900000 58.79900000 0.00332296 -0.07265593 0.00594588 +H 32.99285000 -9.42516400 59.34181000 0.41908751 -0.03781941 -0.32431010 +C 28.21532045 -7.10756820 57.14866500 0.28753211 0.41510978 -0.66309397 +C 27.83532045 -7.05956820 58.60966500 -1.28651775 0.45137298 -0.60913816 +O 28.44632045 -7.82456820 59.37666500 1.79668971 -1.87311633 1.61778377 +O 26.85732045 -6.35156820 58.91966500 -0.50075767 0.68459614 0.18120303 +H 27.67232045 -7.93156820 56.67966500 -0.14587412 -0.15689988 -0.16140570 +H 29.28132045 -7.30656820 57.04266500 0.34831318 -0.05307887 -0.16820781 +H 27.95597045 -6.17206320 56.63139500 -0.01091309 -0.10466108 -0.03029206 +20 +Lattice="30.0 0.0 0.0 0.0 30.0 0.0 0.0 0.0 30.0" Properties=species:S:1:pos:R:3:forces:R:3 energy=-12892.6187222884 label=CC chargeA=1 energyA=-6669.20645149176 chargeB=-1 energyB=-6220.48400518575 distance=5.892987817628019 pbc="T T T" +C 32.59000000 -10.26800000 58.76100000 -0.69578274 0.45507072 0.69757015 +C 31.01900000 -11.54600000 60.23100000 0.31102319 0.38600186 -0.57097927 +N 29.86200000 -11.49700000 60.84900000 -1.30622107 0.05044476 0.81358437 +N 31.29100000 -10.55900000 59.39400000 0.62471507 -0.06759684 -0.53811556 +N 31.82000000 -12.58200000 60.45800000 0.36907741 -0.26084889 0.08494493 +H 29.30600000 -10.65300000 60.75300000 -0.39708639 0.06424461 0.15051835 +H 29.60200000 -12.19700000 61.53200000 -0.17963305 0.07284470 0.01326890 +H 30.57700000 -9.82700000 59.36500000 -0.02135687 0.36497238 -0.31554307 +H 32.67200000 -12.69900000 59.93600000 0.22008330 -0.20702850 -0.03183463 +H 31.49700000 -13.30000000 61.09500000 0.24228397 -0.22314818 -0.02449740 +H 32.42700000 -9.97000000 57.72400000 0.00209260 0.00974930 -0.11518223 +H 33.27200000 -11.11900000 58.79900000 -0.00416539 -0.07316804 0.00887730 +H 32.99285000 -9.42516400 59.34181000 0.42186746 -0.03796336 -0.32197359 +C 28.06618454 -6.92888184 57.05739800 0.27708708 0.41898586 -0.66060350 +C 27.68618454 -6.88088184 58.51839800 -1.11632586 0.31220609 -0.59993626 +O 28.29718454 -7.64588184 59.28539800 1.64827593 -1.69317091 1.54474468 +O 26.70818454 -6.17288184 58.82839800 -0.57745808 0.73584055 0.21922462 +H 27.52318454 -7.75288184 56.58839800 -0.14600652 -0.15575964 -0.16044485 +H 29.13218454 -7.12788184 56.95139800 0.34021068 -0.05269692 -0.15828856 +H 27.80683454 -5.99337684 56.54012800 -0.01268072 -0.09897955 -0.03533438 +20 +Lattice="30.0 0.0 0.0 0.0 30.0 0.0 0.0 0.0 30.0" Properties=species:S:1:pos:R:3:forces:R:3 energy=-12892.4610685095 label=CC chargeA=1 energyA=-6669.20645149176 chargeB=-1 energyB=-6220.48400518575 distance=6.141506759716005 pbc="T T T" +C 32.59000000 -10.26800000 58.76100000 -0.68333797 0.46999934 0.68424615 +C 31.01900000 -11.54600000 60.23100000 0.34783159 0.32738940 -0.52287693 +N 29.86200000 -11.49700000 60.84900000 -1.31927437 0.07591202 0.80205960 +N 31.29100000 -10.55900000 59.39400000 0.59953176 -0.02397709 -0.56611966 +N 31.82000000 -12.58200000 60.45800000 0.34214774 -0.20160055 0.06018444 +H 29.30600000 -10.65300000 60.75300000 -0.38408029 0.02588988 0.16497004 +H 29.60200000 -12.19700000 61.53200000 -0.18312841 0.05320462 0.02581607 +H 30.57700000 -9.82700000 59.36500000 0.04937226 0.28998742 -0.30992996 +H 32.67200000 -12.69900000 59.93600000 0.24322269 -0.21010667 -0.04926215 +H 31.49700000 -13.30000000 61.09500000 0.21951807 -0.25518371 0.00455295 +H 32.42700000 -9.97000000 57.72400000 0.00318239 0.00761205 -0.11719264 +H 33.27200000 -11.11900000 58.79900000 -0.00979166 -0.07382722 0.01106741 +H 32.99285000 -9.42516400 59.34181000 0.42496558 -0.03728320 -0.31902491 +C 27.91704864 -6.75019548 56.96613100 0.26693544 0.42040020 -0.65397015 +C 27.53704864 -6.70219548 58.42713100 -0.97521493 0.19954534 -0.60011525 +O 28.14804864 -7.46719548 59.19413100 1.52346396 -1.54249538 1.47878760 +O 26.55904864 -5.99419548 58.73713100 -0.64079166 0.77604896 0.25482319 +H 27.37404864 -7.57419548 56.49713100 -0.14598836 -0.15465307 -0.15934813 +H 28.98304864 -6.94919548 56.86013100 0.33525464 -0.05280325 -0.15007651 +H 27.65769864 -5.81469048 56.44886100 -0.01381846 -0.09405908 -0.03859114 +20 +Lattice="30.0 0.0 0.0 0.0 30.0 0.0 0.0 0.0 30.0" Properties=species:S:1:pos:R:3:forces:R:3 energy=-12892.3275196466 label=CC chargeA=1 energyA=-6669.20645149176 chargeB=-1 energyB=-6220.48400518575 distance=6.3901412514497204 pbc="T T T" +C 32.59000000 -10.26800000 58.76100000 -0.67556998 0.48114604 0.67347096 +C 31.01900000 -11.54600000 60.23100000 0.38828894 0.28425424 -0.47011248 +N 29.86200000 -11.49700000 60.84900000 -1.33538414 0.09614740 0.79443829 +N 31.29100000 -10.55900000 59.39400000 0.58084385 0.01058843 -0.59785043 +N 31.82000000 -12.58200000 60.45800000 0.31923276 -0.15448540 0.03963439 +H 29.30600000 -10.65300000 60.75300000 -0.37336100 -0.00462049 0.17515359 +H 29.60200000 -12.19700000 61.53200000 -0.18609565 0.03626210 0.03522690 +H 30.57700000 -9.82700000 59.36500000 0.10239633 0.23070009 -0.30375034 +H 32.67200000 -12.69900000 59.93600000 0.26375376 -0.21403760 -0.06626089 +H 31.49700000 -13.30000000 61.09500000 0.19904988 -0.28348659 0.02706955 +H 32.42700000 -9.97000000 57.72400000 0.00503816 0.00513439 -0.11888807 +H 33.27200000 -11.11900000 58.79900000 -0.01416576 -0.07410003 0.01249732 +H 32.99285000 -9.42516400 59.34181000 0.42838078 -0.03557061 -0.31543481 +C 27.76791273 -6.57150912 56.87486400 0.25802719 0.41988910 -0.64518376 +C 27.38791273 -6.52350912 58.33586400 -0.86125989 0.11045906 -0.60585572 +O 27.99891273 -7.28850912 59.10286400 1.42097744 -1.41874006 1.42112226 +O 26.40991273 -5.81550912 58.64586400 -0.69223185 0.80717743 0.28685402 +H 27.22491273 -7.39550912 56.40586400 -0.14584059 -0.15369059 -0.15820966 +H 28.83391273 -6.77050912 56.76886400 0.33245571 -0.05321003 -0.14350648 +H 27.50856273 -5.63600412 56.35759400 -0.01453594 -0.08981689 -0.04041461 +20 +Lattice="30.0 0.0 0.0 0.0 30.0 0.0 0.0 0.0 30.0" Properties=species:S:1:pos:R:3:forces:R:3 energy=-12892.214086767 label=CC chargeA=1 energyA=-6669.20645149176 chargeB=-1 energyB=-6220.48400518575 distance=6.638878304932434 pbc="T T T" +C 32.59000000 -10.26800000 58.76100000 -0.67313950 0.48939384 0.66604829 +C 31.01900000 -11.54600000 60.23100000 0.43282771 0.25632200 -0.41267337 +N 29.86200000 -11.49700000 60.84900000 -1.36179148 0.11119109 0.79418219 +N 31.29100000 -10.55900000 59.39400000 0.56605728 0.04407773 -0.63863942 +N 31.82000000 -12.58200000 60.45800000 0.30504744 -0.12688244 0.02555156 +H 29.30600000 -10.65300000 60.75300000 -0.36385494 -0.03155397 0.18292552 +H 29.60200000 -12.19700000 61.53200000 -0.18888442 0.02469834 0.04044140 +H 30.57700000 -9.82700000 59.36500000 0.14409190 0.18210800 -0.29829108 +H 32.67200000 -12.69900000 59.93600000 0.27891798 -0.21905009 -0.08105782 +H 31.49700000 -13.30000000 61.09500000 0.18306222 -0.30547520 0.04019923 +H 32.42700000 -9.97000000 57.72400000 0.00789150 0.00236691 -0.12015259 +H 33.27200000 -11.11900000 58.79900000 -0.01765861 -0.07374205 0.01319539 +H 32.99285000 -9.42516400 59.34181000 0.43282367 -0.03286116 -0.31155952 +C 27.61877682 -6.39282276 56.78359700 0.25049808 0.41803862 -0.63555507 +C 27.23877682 -6.34482276 58.24459700 -0.76936472 0.03994866 -0.61400106 +O 27.84977682 -7.10982276 59.01159700 1.33738234 -1.31731664 1.37097444 +O 26.26077682 -5.63682276 58.55459700 -0.73431825 0.83155262 0.31485757 +H 27.07577682 -7.21682276 56.31459700 -0.14561116 -0.15287019 -0.15701509 +H 28.68477682 -6.59182276 56.67759700 0.33102850 -0.05378677 -0.13821878 +H 27.35942682 -5.45731776 56.26632700 -0.01500554 -0.08615931 -0.04121179 +20 +Lattice="30.0 0.0 0.0 0.0 30.0 0.0 0.0 0.0 30.0" Properties=species:S:1:pos:R:3:forces:R:3 energy=-12892.1173661601 label=CC chargeA=1 energyA=-6669.20645149176 chargeB=-1 energyB=-6220.48400518575 distance=6.887706811428899 pbc="T T T" +C 32.59000000 -10.26800000 58.76100000 -0.67547662 0.49796535 0.66590576 +C 31.01900000 -11.54600000 60.23100000 0.46521004 0.22648834 -0.37384505 +N 29.86200000 -11.49700000 60.84900000 -1.40736197 0.12035287 0.80438725 +N 31.29100000 -10.55900000 59.39400000 0.55668522 0.09258687 -0.69156763 +N 31.82000000 -12.58200000 60.45800000 0.31136931 -0.13106384 0.02447997 +H 29.30600000 -10.65300000 60.75300000 -0.35299860 -0.05510572 0.19301531 +H 29.60200000 -12.19700000 61.53200000 -0.19068326 0.02157441 0.04430828 +H 30.57700000 -9.82700000 59.36500000 0.18089925 0.14212448 -0.29102685 +H 32.67200000 -12.69900000 59.93600000 0.28439606 -0.22365073 -0.08737639 +H 31.49700000 -13.30000000 61.09500000 0.17777444 -0.31322752 0.04305616 +H 32.42700000 -9.97000000 57.72400000 0.01150713 0.00006915 -0.12186087 +H 33.27200000 -11.11900000 58.79900000 -0.02002494 -0.07333594 0.01365877 +H 32.99285000 -9.42516400 59.34181000 0.43975783 -0.03147117 -0.30989358 +C 27.46964091 -6.21413640 56.69232999 0.24398758 0.41570973 -0.62611045 +C 27.08964091 -6.16613640 58.15332999 -0.69450481 -0.01714453 -0.62155422 +O 27.70064091 -6.93113640 58.92032999 1.26904250 -1.23366099 1.32712521 +O 26.11164091 -5.45813640 58.46332999 -0.76948126 0.85136322 0.33848566 +H 26.92664091 -7.03813640 56.22332999 -0.14533983 -0.15216913 -0.15583608 +H 28.53564091 -6.41313640 56.58632999 0.33050273 -0.05443052 -0.13385341 +H 27.21029091 -5.27863140 56.17505999 -0.01526082 -0.08297435 -0.04149787 +20 +Lattice="30.0 0.0 0.0 0.0 30.0 0.0 0.0 0.0 30.0" Properties=species:S:1:pos:R:3:forces:R:3 energy=-12893.9246626702 label=CC chargeA=-1 energyA=-6220.48891391419 chargeB=1 energyB=-6669.20926086133 distance=3.7613583409405105 pbc="T T T" +C 12.98100000 17.69200000 25.94800000 -0.52452169 -0.28619317 0.72096010 +C 12.12100000 17.80500000 24.71700000 2.21408214 2.18812285 -0.75915466 +O 11.25200000 16.92500000 24.47100000 2.11413223 -1.98302672 2.53485071 +O 12.41100000 18.73500000 23.94100000 -0.31893391 0.09595292 -0.18811490 +H 13.24200000 18.68100000 26.32900000 0.04176507 0.11901159 -0.01327467 +H 13.90100000 17.18800000 25.64900000 0.20824339 -0.20295969 0.07853017 +H 12.47004000 17.11600000 26.73359000 0.23600879 -0.11427064 0.10019126 +C 9.28616557 17.04075360 21.75593517 0.01022189 -0.12868529 0.99347384 +C 8.54316557 16.94475360 24.13793517 0.94362085 -0.02263722 -1.95547121 +N 9.48016557 16.99175360 23.21193517 -4.76491835 0.16219278 -3.78728209 +N 7.24016557 16.97575360 23.84493517 -1.08905422 0.01892054 -0.14788854 +N 8.95616557 16.84975360 25.37793517 -1.26679211 -0.10628742 2.36376708 +H 10.43916557 16.97275360 23.55593517 1.83562408 0.22322149 0.42177608 +H 6.93016557 16.99275360 22.88193517 -0.03790231 0.01379012 0.18836515 +H 6.55916557 16.94475360 24.58693517 -0.20231265 0.01379429 -0.07250211 +H 9.96316557 16.79375360 25.50893517 0.79494405 -0.07357183 0.02776080 +H 8.29516557 16.74375360 26.13893517 0.12777807 0.02702250 -0.07874070 +H 8.24616557 17.20875360 21.47893517 -0.22676782 0.23887852 -0.26094684 +H 9.58716557 16.07675360 21.34093517 0.06292919 -0.20953657 -0.23925543 +H 9.93345657 17.81936360 21.32608517 -0.15814667 0.02626095 0.07295594 +20 +Lattice="30.0 0.0 0.0 0.0 30.0 0.0 0.0 0.0 30.0" Properties=species:S:1:pos:R:3:forces:R:3 energy=-12894.5346918468 label=CC chargeA=-1 energyA=-6220.48891391419 chargeB=1 energyB=-6669.20926086133 distance=4.008434058469108 pbc="T T T" +C 12.98100000 17.69200000 25.94800000 -0.45717832 -0.30604280 0.73336053 +C 12.12100000 17.80500000 24.71700000 1.66946977 1.86026438 -0.88454898 +O 11.25200000 16.92500000 24.47100000 -0.81338486 -1.85076209 0.84621153 +O 12.41100000 18.73500000 23.94100000 -0.19513729 0.28617674 -0.23703278 +H 13.24200000 18.68100000 26.32900000 0.04877554 0.12391231 -0.00905760 +H 13.90100000 17.18800000 25.64900000 0.22160478 -0.19708773 0.08591396 +H 12.47004000 17.11600000 26.73359000 0.22814364 -0.10946904 0.08665593 +C 9.06558278 16.99637680 21.64696759 0.23083977 -0.14607193 0.87946333 +C 8.32258278 16.90037680 24.02896759 0.76661121 -0.04386949 -1.49594302 +N 9.25958278 16.94737680 23.10296759 -2.48404797 0.09573326 -2.43095769 +N 7.01958278 16.93137680 23.73596759 -0.92983502 0.02406594 -0.22286162 +N 8.73558278 16.80537680 25.26896759 -0.92892864 -0.11999976 1.89718002 +H 10.21858278 16.92837680 23.44696759 1.93394680 0.24604376 0.85246024 +H 6.70958278 16.94837680 22.77296759 -0.05777762 0.01691414 0.18881534 +H 6.33858278 16.90037680 24.47796759 -0.18649488 0.01245309 -0.06367508 +H 9.74258278 16.74937680 25.39996759 1.03561195 0.02643897 0.13224594 +H 8.07458278 16.69937680 26.02996759 0.20468454 0.02546569 -0.04866066 +H 8.02558278 17.16437680 21.36996759 -0.18146010 0.23442168 -0.15601577 +H 9.36658278 16.03237680 21.23196759 0.06194954 -0.19564380 -0.23116086 +H 9.71287378 17.77498680 21.21711759 -0.16739282 0.01705669 0.07760723 +20 +Lattice="30.0 0.0 0.0 0.0 30.0 0.0 0.0 0.0 30.0" Properties=species:S:1:pos:R:3:forces:R:3 energy=-12894.5274231876 label=CC chargeA=-1 energyA=-6220.48891391419 chargeB=1 energyB=-6669.20926086133 distance=4.255851334685677 pbc="T T T" +C 12.98100000 17.69200000 25.94800000 -0.40132950 -0.31446027 0.74982442 +C 12.12100000 17.80500000 24.71700000 1.26542010 1.58882507 -0.97075617 +O 11.25200000 16.92500000 24.47100000 -1.96690723 -1.81005264 0.30919771 +O 12.41100000 18.73500000 23.94100000 -0.09240703 0.45134851 -0.28006818 +H 13.24200000 18.68100000 26.32900000 0.05565854 0.12994510 -0.00223809 +H 13.90100000 17.18800000 25.64900000 0.23155387 -0.19346702 0.09088397 +H 12.47004000 17.11600000 26.73359000 0.22145245 -0.10632285 0.07844984 +C 8.84500000 16.95200000 21.53800000 0.36092414 -0.15640932 0.77987018 +C 8.10200000 16.85600000 23.92000000 0.61176197 -0.05370538 -1.21445212 +N 9.03900000 16.90300000 22.99400000 -1.34600571 0.10282110 -1.80568371 +N 6.79900000 16.88700000 23.62700000 -0.79340257 0.02368493 -0.25965070 +N 8.51500000 16.76100000 25.16000000 -0.64408202 -0.12590001 1.62094082 +H 9.99800000 16.88400000 23.33800000 1.70755109 0.26043800 0.74690600 +H 6.48900000 16.90400000 22.66400000 -0.07036194 0.01965125 0.18574545 +H 6.11800000 16.85600000 24.36900000 -0.18206345 0.01110527 -0.05461514 +H 9.52200000 16.70500000 25.29100000 1.04864592 0.08905143 0.27528163 +H 7.85400000 16.65500000 25.92100000 0.26447430 0.02552964 -0.01551448 +H 7.80500000 17.12000000 21.26100000 -0.15696822 0.23294433 -0.09273930 +H 9.14600000 15.98800000 21.12300000 0.06102331 -0.18657038 -0.22259280 +H 9.49229100 17.73061000 21.10815000 -0.17493800 0.01154325 0.08121065 +20 +Lattice="30.0 0.0 0.0 0.0 30.0 0.0 0.0 0.0 30.0" Properties=species:S:1:pos:R:3:forces:R:3 energy=-12894.280031935 label=CC chargeA=-1 energyA=-6220.48891391419 chargeB=1 energyB=-6669.20926086133 distance=4.503553881387339 pbc="T T T" +C 12.98100000 17.69200000 25.94800000 -0.35575176 -0.31589437 0.76694120 +C 12.12100000 17.80500000 24.71700000 0.95525929 1.35221535 -1.03847820 +O 11.25200000 16.92500000 24.47100000 -2.29128963 -1.76045920 0.18225512 +O 12.41100000 18.73500000 23.94100000 -0.00507030 0.59766514 -0.31911878 +H 13.24200000 18.68100000 26.32900000 0.06184794 0.13602021 0.00537219 +H 13.90100000 17.18800000 25.64900000 0.23907087 -0.19129135 0.09412720 +H 12.47004000 17.11600000 26.73359000 0.21582576 -0.10429758 0.07343542 +C 8.62441722 16.90762320 21.42903241 0.43728495 -0.16337958 0.69830249 +C 7.88141722 16.81162320 23.81103241 0.48126016 -0.05831989 -1.04739221 +N 8.81841722 16.85862320 22.88503241 -0.75736343 0.12568904 -1.51508035 +N 6.57841722 16.84262320 23.51803241 -0.67959141 0.02106224 -0.27391103 +N 8.29441722 16.71662320 25.05103241 -0.42916165 -0.12687640 1.46400579 +H 9.77741722 16.83962320 23.22903241 1.40546307 0.25034604 0.53613276 +H 6.26841722 16.85962320 22.55503241 -0.07861232 0.02166134 0.18113630 +H 5.89741722 16.81162320 24.26003241 -0.18333030 0.01006571 -0.04607384 +H 9.30141722 16.66062320 25.18203241 0.94051350 0.11892595 0.40858788 +H 7.63341722 16.61062320 25.81203241 0.30730104 0.02617990 0.01633883 +H 7.58441722 17.07562320 21.15203241 -0.14223176 0.23278413 -0.05381600 +H 8.92541722 15.94362320 21.01403241 0.05994826 -0.18056810 -0.21551611 +H 9.27170822 17.68623320 20.99918241 -0.18137227 0.00847143 0.08275133 +20 +Lattice="30.0 0.0 0.0 0.0 30.0 0.0 0.0 0.0 30.0" Properties=species:S:1:pos:R:3:forces:R:3 energy=-12893.9610992283 label=CC chargeA=-1 energyA=-6220.48891391419 chargeB=1 energyB=-6669.20926086133 distance=4.751497090066203 pbc="T T T" +C 12.98100000 17.69200000 25.94800000 -0.31869302 -0.31248010 0.78320767 +C 12.12100000 17.80500000 24.71700000 0.71018168 1.13963358 -1.09219769 +O 11.25200000 16.92500000 24.47100000 -2.25709526 -1.69050868 0.19641113 +O 12.41100000 18.73500000 23.94100000 0.07062387 0.72734557 -0.35525506 +H 13.24200000 18.68100000 26.32900000 0.06746731 0.14181234 0.01316363 +H 13.90100000 17.18800000 25.64900000 0.24491367 -0.19001164 0.09616522 +H 12.47004000 17.11600000 26.73359000 0.21099152 -0.10297925 0.07020133 +C 8.40383443 16.86324640 21.32006483 0.48319671 -0.16876882 0.63280836 +C 7.66083443 16.76724640 23.70206483 0.36970116 -0.06073945 -0.94869559 +N 8.59783443 16.81424640 22.77606483 -0.43251767 0.14817694 -1.37459707 +N 6.35783443 16.79824640 23.40906483 -0.58448359 0.01785566 -0.27639383 +N 8.07383443 16.67224640 24.94206483 -0.27499824 -0.12486786 1.37605163 +H 9.55683443 16.79524640 23.12006483 1.12161120 0.22682018 0.33822668 +H 6.04783443 16.81524640 22.44606483 -0.08459904 0.02298974 0.17570959 +H 5.67683443 16.76724640 24.15106483 -0.18741804 0.00927191 -0.03797811 +H 9.08083443 16.61624640 25.07306483 0.78528118 0.12602404 0.51473331 +H 7.41283443 16.56624640 25.70306483 0.33636392 0.02683060 0.04507434 +H 7.36383443 17.03124640 21.04306483 -0.13226724 0.23318188 -0.02908268 +H 8.70483443 15.89924640 20.90506483 0.05871704 -0.17654692 -0.21013258 +H 9.05112543 17.64185640 20.89021483 -0.18697717 0.00696028 0.08257973 +20 +Lattice="30.0 0.0 0.0 0.0 30.0 0.0 0.0 0.0 30.0" Properties=species:S:1:pos:R:3:forces:R:3 energy=-12893.6417526352 label=CC chargeA=-1 energyA=-6220.48891391419 chargeB=1 energyB=-6669.20926086133 distance=4.999645142729246 pbc="T T T" +C 12.98100000 17.69200000 25.94800000 -0.28811898 -0.30568602 0.79825392 +C 12.12100000 17.80500000 24.71700000 0.51062320 0.94459191 -1.13281032 +O 11.25200000 16.92500000 24.47100000 -2.08743016 -1.60679740 0.25293453 +O 12.41100000 18.73500000 23.94100000 0.13685490 0.84193762 -0.38925819 +H 13.24200000 18.68100000 26.32900000 0.07265372 0.14721934 0.02075202 +H 13.90100000 17.18800000 25.64900000 0.24961557 -0.18922421 0.09726704 +H 12.47004000 17.11600000 26.73359000 0.20655691 -0.10197987 0.06754006 +C 8.18325165 16.81886961 21.21109724 0.51198318 -0.17337082 0.58036133 +C 7.44025165 16.72286961 23.59309724 0.27233828 -0.06193547 -0.88954246 +N 8.37725165 16.76986961 22.66709724 -0.24015890 0.16707170 -1.30390492 +N 6.13725165 16.75386961 23.30009724 -0.50409794 0.01481735 -0.27340795 +N 7.85325165 16.62786961 24.83309724 -0.16654766 -0.12103506 1.32695728 +H 9.33625165 16.75086961 23.01109724 0.88659457 0.19894469 0.18147458 +H 5.82725165 16.77086961 22.33709724 -0.08964785 0.02370175 0.16945893 +H 5.45625165 16.72286961 24.04209724 -0.19305701 0.00855014 -0.02985300 +H 8.86025165 16.57186961 24.96409724 0.62652264 0.11967150 0.59125694 +H 7.19225165 16.52186961 25.59409724 0.35482764 0.02711708 0.07030344 +H 7.14325165 16.98686961 20.93409724 -0.12485611 0.23377607 -0.01275032 +H 8.48425165 15.85486961 20.79609724 0.05730635 -0.17382975 -0.20622745 +H 8.83054265 17.59747961 20.78124724 -0.19196235 0.00645945 0.08119454 +20 +Lattice="30.0 0.0 0.0 0.0 30.0 0.0 0.0 0.0 30.0" Properties=species:S:1:pos:R:3:forces:R:3 energy=-12893.3487761903 label=CC chargeA=-1 energyA=-6220.48891391419 chargeB=1 energyB=-6669.20926086133 distance=5.247968996564185 pbc="T T T" +C 12.98100000 17.69200000 25.94800000 -0.26214910 -0.29555882 0.81086678 +C 12.12100000 17.80500000 24.71700000 0.34186037 0.75825628 -1.15724763 +O 11.25200000 16.92500000 24.47100000 -1.88051904 -1.51331328 0.31440509 +O 12.41100000 18.73500000 23.94100000 0.19510784 0.94356250 -0.42263603 +H 13.24200000 18.68100000 26.32900000 0.07766337 0.15218788 0.02817619 +H 13.90100000 17.18800000 25.64900000 0.25343543 -0.18864217 0.09766410 +H 12.47004000 17.11600000 26.73359000 0.20204296 -0.10081794 0.06426360 +C 7.96266886 16.77449281 21.10212966 0.53134956 -0.17766572 0.53829803 +C 7.21966886 16.67849281 23.48412966 0.18455214 -0.06057164 -0.85264148 +N 8.15666886 16.72549281 22.55812966 -0.11680591 0.18210251 -1.26840912 +N 5.91666886 16.70949281 23.19112966 -0.43434197 0.01216932 -0.26831748 +N 7.63266886 16.58349281 24.72412966 -0.08919987 -0.11582051 1.30018792 +H 9.11566886 16.70649281 22.90212966 0.70177637 0.17135634 0.06539813 +H 5.60666886 16.72649281 22.22812966 -0.09476899 0.02359951 0.16112187 +H 5.23566886 16.67849281 23.93312966 -0.20022341 0.00745750 -0.02026001 +H 8.63966886 16.52749281 24.85512966 0.48526670 0.10605556 0.64255380 +H 6.97166886 16.47749281 25.48512966 0.36461892 0.02660435 0.09258376 +H 6.92266886 16.94249281 20.82512966 -0.11906271 0.23433519 -0.00143067 +H 8.26366886 15.81049281 20.68712966 0.05569782 -0.17197901 -0.20355794 +H 8.60995986 17.55310281 20.67227966 -0.19630050 0.00668215 0.07898108 +20 +Lattice="30.0 0.0 0.0 0.0 30.0 0.0 0.0 0.0 30.0" Properties=species:S:1:pos:R:3:forces:R:3 energy=-12893.0896501194 label=CC chargeA=-1 energyA=-6220.48891391419 chargeB=1 energyB=-6669.20926086133 distance=5.496444811251947 pbc="T T T" +C 12.98100000 17.69200000 25.94800000 -0.23863500 -0.28001340 0.81897402 +C 12.12100000 17.80500000 24.71700000 0.19187624 0.55994359 -1.14972697 +O 11.25200000 16.92500000 24.47100000 -1.66813568 -1.40103290 0.36259613 +O 12.41100000 18.73500000 23.94100000 0.24473620 1.03550299 -0.46193218 +H 13.24200000 18.68100000 26.32900000 0.08308216 0.15686928 0.03592068 +H 13.90100000 17.18800000 25.64900000 0.25641209 -0.18791731 0.09729401 +H 12.47004000 17.11600000 26.73359000 0.19654636 -0.09850820 0.05818435 +C 7.74208608 16.73011601 20.99316207 0.54694955 -0.18261069 0.50494457 +C 6.99908608 16.63411601 23.37516207 0.09704433 -0.04896869 -0.82700123 +N 7.93608608 16.68111601 22.44916207 -0.02368459 0.19196933 -1.25552057 +N 5.69608608 16.66511601 23.08216207 -0.37051152 0.00996477 -0.26284114 +N 7.41208608 16.53911601 24.61516207 -0.02700958 -0.10945606 1.28969508 +H 8.89508608 16.66211601 22.79316207 0.55455688 0.14546255 -0.02003825 +H 5.38608608 16.68211601 22.11916207 -0.10180087 0.02141181 0.14613025 +H 5.01508608 16.63411601 23.82416207 -0.21099944 0.00445347 -0.00511924 +H 8.41908608 16.48311601 24.74616207 0.36587270 0.08701041 0.67466966 +H 6.75108608 16.43311601 25.37616207 0.36538692 0.02420252 0.11322315 +H 6.70208608 16.89811601 20.71616207 -0.11519815 0.23460244 0.00709593 +H 8.04308608 15.76611601 20.57816207 0.05336809 -0.17049229 -0.20242199 +H 8.38937708 17.50872601 20.56331207 -0.19985670 0.00760640 0.07587373 +20 +Lattice="30.0 0.0 0.0 0.0 30.0 0.0 0.0 0.0 30.0" Properties=species:S:1:pos:R:3:forces:R:3 energy=-12892.8656952745 label=CC chargeA=-1 energyA=-6220.48891391419 chargeB=1 energyB=-6669.20926086133 distance=5.74505288404184 pbc="T T T" +C 12.98100000 17.69200000 25.94800000 -0.21841617 -0.25773311 0.81765747 +C 12.12100000 17.80500000 24.71700000 0.06368914 0.33431113 -1.08389305 +O 11.25200000 16.92500000 24.47100000 -1.45620914 -1.25698468 0.38285305 +O 12.41100000 18.73500000 23.94100000 0.27780293 1.11619368 -0.51722346 +H 13.24200000 18.68100000 26.32900000 0.08908107 0.16152544 0.04447157 +H 13.90100000 17.18800000 25.64900000 0.25855307 -0.18697689 0.09638655 +H 12.47004000 17.11600000 26.73359000 0.18943276 -0.09461980 0.04862264 +C 7.52150329 16.68573921 20.88419448 0.56460656 -0.19020991 0.48159778 +C 6.77850329 16.58973921 23.26619448 -0.00253807 -0.01159939 -0.80686964 +N 7.71550329 16.63673921 22.34019448 0.07338768 0.19333257 -1.26744401 +N 5.47550329 16.62073921 22.97319448 -0.31713790 0.00911639 -0.25859072 +N 7.19150329 16.49473921 24.50619448 0.03874044 -0.10410267 1.30382415 +H 8.67450329 16.61773921 22.68419448 0.42772330 0.12144033 -0.08727429 +H 5.16550329 16.63773921 22.01019448 -0.11217448 0.01440414 0.12198086 +H 4.79450329 16.58973921 23.71519448 -0.22680930 -0.00335257 0.01716738 +H 8.19850329 16.43873921 24.63719448 0.25981863 0.06206905 0.69279918 +H 6.53050329 16.38873921 25.26719448 0.35828146 0.01810604 0.13237445 +H 6.48150329 16.85373921 20.60719448 -0.11472301 0.23436341 0.01432358 +H 7.82250329 15.72173921 20.46919448 0.04917858 -0.16859704 -0.20403341 +H 8.16879429 17.46434921 20.45434448 -0.20228754 0.00931389 0.07126991 +20 +Lattice="30.0 0.0 0.0 0.0 30.0 0.0 0.0 0.0 30.0" Properties=species:S:1:pos:R:3:forces:R:3 energy=-12892.6773656391 label=CC chargeA=-1 energyA=-6220.48891391419 chargeB=1 energyB=-6669.20926086133 distance=5.9937767370030866 pbc="T T T" +C 12.98100000 17.69200000 25.94800000 -0.17755875 -0.18954708 0.72681690 +C 12.12100000 17.80500000 24.71700000 0.12093818 -0.05925948 -0.47097423 +O 11.25200000 16.92500000 24.47100000 -1.26513527 -1.01531755 0.20007969 +O 12.41100000 18.73500000 23.94100000 0.23840123 1.22876233 -0.77880250 +H 13.24200000 18.68100000 26.32900000 0.09707844 0.19379480 0.05660562 +H 13.90100000 17.18800000 25.64900000 0.26455416 -0.19502315 0.08302623 +H 12.47004000 17.11600000 26.73359000 0.14235947 -0.09265902 0.03773811 +C 7.30092051 16.64136241 20.77522690 0.62197895 -0.22450392 0.49211641 +C 6.55792051 16.54536241 23.15722690 -0.16883942 0.24378298 -0.77252562 +N 7.49492051 16.59236241 22.23122690 0.32085341 0.10585654 -1.41364654 +N 5.25492051 16.57636241 22.86422690 -0.34687004 -0.00326828 -0.27834801 +N 6.97092051 16.45036241 24.39722690 0.21696832 -0.14119585 1.45930807 +H 8.45392051 16.57336241 22.57522690 0.22136113 0.09804013 -0.15989885 +H 4.94492051 16.59336241 21.90122690 -0.13229592 -0.02571329 0.07775715 +H 4.57392051 16.54536241 23.60622690 -0.23688651 -0.04037733 0.06031952 +H 7.97792051 16.39436241 24.52822690 0.09671188 0.00322368 0.68294141 +H 6.30992051 16.34436241 25.15822690 0.31762238 0.00394836 0.10795693 +H 6.26092051 16.80936241 20.49822690 -0.13305450 0.23694503 0.03834569 +H 7.60192051 15.67736241 20.36022690 0.01212386 -0.13895713 -0.21175425 +H 7.94821151 17.41997241 20.34537690 -0.21031101 0.01146825 0.06293827 +20 +Lattice="30.0 0.0 0.0 0.0 30.0 0.0 0.0 0.0 30.0" Properties=species:S:1:pos:R:3:forces:R:3 energy=-12892.5157633701 label=CC chargeA=-1 energyA=-6220.48891391419 chargeB=1 energyB=-6669.20926086133 distance=6.242602554777832 pbc="T T T" +C 12.98100000 17.69200000 25.94800000 -0.19902086 -0.21962487 0.79759456 +C 12.12100000 17.80500000 24.71700000 -0.07212314 -0.04678756 -0.86501817 +O 11.25200000 16.92500000 24.47100000 -1.10840021 -0.97359089 0.36308635 +O 12.41100000 18.73500000 23.94100000 0.28353617 1.21417220 -0.64199958 +H 13.24200000 18.68100000 26.32900000 0.09755719 0.16998956 0.05852058 +H 13.90100000 17.18800000 25.64900000 0.26133120 -0.18608930 0.09462405 +H 12.47004000 17.11600000 26.73359000 0.17708639 -0.08818795 0.03422642 +C 7.08033772 16.59698561 20.66625931 0.60250224 -0.21079416 0.46195515 +C 6.33733772 16.50098561 23.04825931 -0.19954284 0.10334833 -0.78388242 +N 7.27433772 16.54798561 22.12225931 0.28330326 0.18351434 -1.34550810 +N 5.03433772 16.53198561 22.75525931 -0.28067357 0.01214492 -0.25972692 +N 6.75033772 16.40598561 24.28825931 0.17517426 -0.10358347 1.40189714 +H 8.23333772 16.52898561 22.46625931 0.22866139 0.08124412 -0.18486193 +H 4.72433772 16.54898561 21.79225931 -0.13145976 -0.00628563 0.08230926 +H 4.35333772 16.50098561 23.49725931 -0.25482322 -0.02607318 0.05285152 +H 7.75733772 16.34998561 24.41925931 0.07905647 0.01324028 0.70439672 +H 6.08933772 16.29998561 25.04925931 0.34399691 0.00023920 0.15957650 +H 6.04033772 16.76498561 20.38925931 -0.11863734 0.23346324 0.02503616 +H 7.38133772 15.63298561 20.25125931 0.03751118 -0.16408846 -0.21421672 +H 7.72762872 17.37559561 20.23640931 -0.20503571 0.01374927 0.05913944 +20 +Lattice="30.0 0.0 0.0 0.0 30.0 0.0 0.0 0.0 30.0" Properties=species:S:1:pos:R:3:forces:R:3 energy=-12892.3810554246 label=CC chargeA=-1 energyA=-6220.48891391419 chargeB=1 energyB=-6669.20926086133 distance=6.49151858631955 pbc="T T T" +C 12.98100000 17.69200000 25.94800000 -0.20049264 -0.21222207 0.78578852 +C 12.12100000 17.80500000 24.71700000 -0.08114254 -0.16115964 -0.76188208 +O 11.25200000 16.92500000 24.47100000 -0.98509251 -0.86818306 0.34591765 +O 12.41100000 18.73500000 23.94100000 0.26454304 1.23176054 -0.69412000 +H 13.24200000 18.68100000 26.32900000 0.09825999 0.17334000 0.06188686 +H 13.90100000 17.18800000 25.64900000 0.26194532 -0.18634940 0.09387513 +H 12.47004000 17.11600000 26.73359000 0.17371919 -0.08685246 0.03241141 +C 6.85975494 16.55260882 20.55729173 0.61783355 -0.22130036 0.45552224 +C 6.11675494 16.45660882 22.93929173 -0.28356764 0.16168982 -0.77976292 +N 7.05375494 16.50360882 22.01329173 0.36629609 0.17819733 -1.38439953 +N 4.81375494 16.48760882 22.64629173 -0.26694977 0.01236471 -0.26285313 +N 6.52975494 16.36160882 24.17929173 0.23442561 -0.10523413 1.45146182 +H 8.01275494 16.48460882 22.35729173 0.15921619 0.06282215 -0.21722171 +H 4.50375494 16.50460882 21.68329173 -0.13920475 -0.01489227 0.06483187 +H 4.13275494 16.45660882 23.38829173 -0.27045244 -0.03830225 0.07291924 +H 7.53675494 16.30560882 24.31029173 0.01014500 -0.00506237 0.70163248 +H 5.86875494 16.25560882 24.94029173 0.33376884 -0.00869694 0.17022065 +H 5.81975494 16.72060882 20.28029173 -0.12073234 0.23283155 0.02921484 +H 7.16075494 15.58860882 20.14229173 0.03197443 -0.16152666 -0.21925355 +H 7.50704594 17.33121882 20.12744173 -0.20449260 0.01677551 0.05381023 +20 +Lattice="30.0 0.0 0.0 0.0 30.0 0.0 0.0 0.0 30.0" Properties=species:S:1:pos:R:3:forces:R:3 energy=-12892.2676780833 label=CC chargeA=-1 energyA=-6220.48891391419 chargeB=1 energyB=-6669.20926086133 distance=6.7405148650607 pbc="T T T" +C 12.98100000 17.69200000 25.94800000 -0.20465684 -0.20879396 0.77489349 +C 12.12100000 17.80500000 24.71700000 -0.07406187 -0.24280278 -0.67109250 +O 11.25200000 16.92500000 24.47100000 -0.88911534 -0.78339650 0.32763136 +O 12.41100000 18.73500000 23.94100000 0.24234614 1.23858709 -0.73741840 +H 13.24200000 18.68100000 26.32900000 0.09790387 0.17615115 0.06389835 +H 13.90100000 17.18800000 25.64900000 0.26225113 -0.18674535 0.09316017 +H 12.47004000 17.11600000 26.73359000 0.17139489 -0.08603439 0.03199290 +C 6.63917215 16.50823202 20.44832414 0.62928346 -0.23076605 0.44868090 +C 5.89617215 16.41223202 22.83032414 -0.35358521 0.21491756 -0.77655509 +N 6.83317215 16.45923202 21.90432414 0.42730570 0.17333066 -1.41507016 +N 4.59317215 16.44323202 22.53732414 -0.24885732 0.01007956 -0.26579087 +N 6.30917215 16.31723202 24.07032414 0.28102862 -0.10445439 1.48792934 +H 7.79217215 16.44023202 22.24832414 0.10759492 0.04630070 -0.23998216 +H 4.28317215 16.46023202 21.57432414 -0.14595726 -0.02196272 0.04750568 +H 3.91217215 16.41223202 23.27932414 -0.28573770 -0.04903540 0.09395175 +H 7.31617215 16.26123202 24.20132414 -0.03970395 -0.02142110 0.69643279 +H 5.64817215 16.21123202 24.83132414 0.32055445 -0.01705460 0.18072457 +H 5.59917215 16.67623202 20.17132414 -0.12215852 0.23214034 0.03270120 +H 6.94017215 15.54423202 20.03332414 0.02732817 -0.15908053 -0.22313365 +H 7.28646315 17.28684202 20.01847414 -0.20315733 0.02004071 0.04954034 diff --git a/_downloads/4dd8b470da0d1f3672e0a6f90c77c550/sample-selection.py b/_downloads/4dd8b470da0d1f3672e0a6f90c77c550/sample-selection.py new file mode 100644 index 00000000..01aa8dc0 --- /dev/null +++ b/_downloads/4dd8b470da0d1f3672e0a6f90c77c550/sample-selection.py @@ -0,0 +1,360 @@ +""" +Sample and Feature Selection with FPS and CUR +============================================= + +:Authors: Davide Tisi `@DavideTisi `_ + +In this tutorial we generate descriptors using rascaline, then select a subset +of structures using both the farthest-point sampling (FPS) and CUR algorithms +implemented in scikit-matter. Finally, we also generate a selection of +the most important features using the same techniques. + +First, import all the necessary packages +""" + +# %% + +import ase.io +import chemiscope +import metatensor +import numpy as np +from equisolve.numpy import feature_selection, sample_selection +from matplotlib import pyplot as plt +from rascaline import SoapPowerSpectrum +from sklearn.decomposition import PCA +from skmatter import feature_selection as skfeat_selection + + +# %% +# Load molecular data +# ------------------- +# +# Load 500 example BTO structures from file, reading them using +# `ASE `_. + +# Load a subset of :download:`structures ` of the example dataset +n_frames = 500 +frames = ase.io.read("input-fps.xyz", f":{n_frames}", format="extxyz") + +# %% +# Compute SOAP descriptors using rascaline +# ---------------------------------------- +# +# First, define the rascaline hyperparameters used to compute SOAP. + + +# rascaline hyperparameters +hypers = { + "cutoff": 6.0, + "max_radial": 8, + "max_angular": 6, + "atomic_gaussian_width": 0.3, + "cutoff_function": {"ShiftedCosine": {"width": 0.5}}, + "radial_basis": {"Gto": {"accuracy": 1e-6}}, + "radial_scaling": {"Willatt2018": {"exponent": 4, "rate": 1, "scale": 3.5}}, + "center_atom_weight": 1.0, +} + +# Generate a SOAP power spectrum +calculator = SoapPowerSpectrum(**hypers) +rho2i = calculator.compute(frames) + + +# Makes a dense block +atom_soap = rho2i.keys_to_properties(["species_neighbor_1", "species_neighbor_2"]) + +atom_soap_single_block = atom_soap.keys_to_samples(keys_to_move=["species_center"]) + +# Sum over atomic centers to compute structure features +struct_soap = metatensor.sum_over_samples( + atom_soap_single_block, sample_names=["center", "species_center"] +) + + +print("atom feature descriptor shape:", atom_soap.block(0).values.shape) +print( + "atom feature descriptor (all in one block) shape:", + atom_soap_single_block.block(0).values.shape, +) +print("structure feature descriptor shape:", struct_soap.block(0).values.shape) + + +# %% +# Perform atomic environment (i.e. sample) selection +# --------------------------------------------------- +# +# Using FPS and CUR algorithms, we can perform selection of atomic environments. +# These are implemented in equisolve, which provides a wrapper around +# scikit-matter to allow for interfacing with data stored in the metatensor +# format. +# +# Suppose we want to select the 10 most diverse environments for each chemical +# species. +# +# First, we can use the `keys_to_properties` operation in metatensor to move the +# neighbour species indices to the properties of the TensorBlocks. The resulting +# descriptor will be a TensorMap comprised of three blocks, one for each +# chemical species, where the chemical species indices are solely present in the +# keys. + + +print("----Atomic environment selection-----") +# Define the number of structures to select using FPS/CUR +n_envs = 25 + +print(atom_soap) +print(atom_soap.block(0)) + +# %% Now let's perform sample selection on the atomic environments. We want to +# select 10 atomic environments for each chemical species. + +# Define the number of structures *per block* to select using FPS +n_envs = 10 + +# FPS sample selection +selector_atomic_fps = sample_selection.FPS(n_to_select=n_envs, initialize="random").fit( + atom_soap +) + +# Print the selected envs for each block +print("atomic envs selected with FPS:\n") +for key, block in selector_atomic_fps.support.items(): + print("species_center:", key, "\n(struct_idx, atom_idx)\n", block.samples.values) + +selector_atomic_cur = sample_selection.CUR(n_to_select=n_envs).fit(atom_soap) +# Print the selected envs for each block +print("atomic envs selected with CUR:\n") +for key, block in selector_atomic_cur.support.items(): + print("species_center:", key, "\n(struct_idx, atom_idx)\n", block.samples.values) + + +# %% +# Selecting from a combined pool of atomic environments +# ----------------------------------------------------- +# +# One can also select from a combined pool of atomic environments and +# structures, instead of selecting an equal number of atomic environments for +# each chemical species. In this case, we can move the 'species_center' key to samples +# such that our descriptor is a TensorMap consisting of a single block. Upon +# sample selection, the most diverse atomic environments will be selected, +# regardless of their chemical species. +print("----All atomic environment selection-----") + +print("keys", atom_soap.keys) +print("blocks", atom_soap[0]) +print("samples in first block", atom_soap[0].samples) + +# Using the original SOAP descriptor, move all keys to properties. + + +# Define the number of structures to select using FPS +n_envs = 10 + +# FPS sample selection +selector_atomic_fps = sample_selection.FPS(n_to_select=n_envs, initialize="random").fit( + atom_soap_single_block +) +print( + "atomic envs selected with FPS: \n (struct_idx, atom_idx, species_center) \n", + selector_atomic_fps.support.block(0).samples.values, +) + + +# %% +# Perform structure (i.e. sample) selection with FPS/CUR +# --------------------------------------------------------- +# +# Instead of atomic environments, one can also select diverse structures. We can +# use the `sum_over_samples` operation in metatensor to define features in the +# structural basis instead of the atomic basis. This is done by summing over the +# atomic environments, labeled by the 'center' index in the samples of the +# TensorMap. +# +# Alternatively, one could use the `mean_over_samples` operation, depending on +# the specific inhomogeneity of the size of the structures in the training set. + +print("----Structure selection-----") + +# Define the number of structures to select *per block* using FPS +n_structures = 10 + +# FPS structure selection +selector_struct_fps = sample_selection.FPS( + n_to_select=n_structures, initialize="random" +).fit(struct_soap) +struct_fps_idxs = selector_struct_fps.support.block(0).samples.values.flatten() + +print("structures selected with FPS:\n", struct_fps_idxs) + +# CUR structure selection +selector_struct_cur = sample_selection.CUR(n_to_select=n_structures).fit(struct_soap) +struct_cur_idxs = selector_struct_cur.support.block(0).samples.values.flatten() +print("structures selected with CUR:\n", struct_cur_idxs) + + +# Slice structure descriptor along axis 0 to contain only the selected structures +struct_soap_fps = struct_soap.block(0).values[struct_fps_idxs, :] +struct_soap_cur = struct_soap.block(0).values[struct_cur_idxs, :] +assert struct_soap_fps.shape == struct_soap_cur.shape + +print("Structure descriptor shape before selection ", struct_soap.block(0).values.shape) +print("Structure descriptor shape after selection (FPS)", struct_soap_fps.shape) +print("Structure descriptor shape after selection (CUR)", struct_soap_cur.shape) + + +# %% +# Visualize selected structures +# ----------------------------- +# +# sklearn can be used to perform PCA dimensionality reduction on the SOAP +# descriptors. The resulting PC coordinates can be used to visualize the the +# data alongside their structures in a chemiscope widget. +# + +# Generate a structure PCA +struct_soap_pca = PCA(n_components=2).fit_transform(struct_soap.block(0).values) +assert struct_soap_pca.shape == (n_frames, 2) + + +# %% +# Plot the PCA map +# ~~~~~~~~~~~~~~~~ +# +# Notice how the selected points avoid the densely-sampled area, and cover +# the periphery of the dataset + +# Matplotlib plot +fig, ax = plt.subplots(1, 1, figsize=(6, 4)) +scatter = ax.scatter(struct_soap_pca[:, 0], struct_soap_pca[:, 1], c="red") +ax.plot( + struct_soap_pca[struct_cur_idxs, 0], + struct_soap_pca[struct_cur_idxs, 1], + "ko", + fillstyle="none", + label="FPS selection", +) +ax.set_xlabel("PCA[1]") +ax.set_ylabel("PCA[2]") +ax.legend() +fig.show() + + +# %% +# Creates a chemiscope viewer +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# + +# Selected level +selection_levels = [] +for i in range(len(frames)): + level = 0 + if i in struct_cur_idxs: + level += 1 + if i in struct_fps_idxs: + level += 2 + if level == 0: + level = "Not selected" + elif level == 1: + level = "CUR" + elif level == 2: + level = "FPS" + else: + level = "FPS+CUR" + selection_levels.append(level) + +properties = chemiscope.extract_properties(frames) + +properties.update( + { + "PC1": struct_soap_pca[:, 0], + "PC2": struct_soap_pca[:, 1], + "selection": np.array(selection_levels), + } +) + +widget = chemiscope.show( + frames, + properties=properties, + settings={ + "map": { + "x": {"property": "PC1"}, + "y": {"property": "PC2"}, + "color": {"property": "energy"}, + "symbol": "selection", + "size": {"factor": 50}, + }, + "structure": [{"unitCell": True}], + }, +) +widget.save("sample-selection.json.gz") + +# display, if in notebook or sphinx +widget + +# %% +# Perform feature selection +# ------------------------- +# +# Now perform feature selection. In this example we will go back to using the +# descriptor decomposed into atomic environments, as opposed to the one +# decomposed into structure environments, but only use FPS for brevity. +print("----Feature selection-----") + +# Define the number of features to select +n_features = 200 + +# FPS feature selection +feat_fps = feature_selection.FPS(n_to_select=n_features, initialize="random").fit( + atom_soap_single_block +) + +# Slice atomic descriptor along axis 1 to contain only the selected features +# atom_soap_single_block_fps = atom_soap_single_block.block(0).values[:, feat_fps_idxs] +atom_soap_single_block_fps = metatensor.slice( + atom_soap_single_block, + axis="properties", + labels=feat_fps.support.block(0).properties, +) + +print( + "atomic descriptor shape before selection ", + atom_soap_single_block.block(0).values.shape, +) +print( + "atomic descriptor shape after selection ", + atom_soap_single_block_fps.block(0).values.shape, +) + +# %% + +# %% +# Perform feature selection (skmatter) +# ------------------------------------ +# +# Now perform feature selection. In this example we will go back to using the +# descriptor decomposed into atomic environments, as opposed to the one +# decomposed into structure environments, but only use FPS for brevity. + +print("----Feature selection (skmatter)-----") + +# Define the number of features to select +n_features = 200 + +# FPS feature selection +feat_fps = skfeat_selection.FPS(n_to_select=n_features, initialize="random").fit( + atom_soap_single_block.block(0).values +) +feat_fps_idxs = feat_fps.selected_idx_ + +print("Feature indices obtained with FPS ", feat_fps_idxs) + +# Slice atomic descriptor along axis 1 to contain only the selected features +atom_dscrptr_fps = atom_soap_single_block.block(0).values[:, feat_fps_idxs] + +print( + "atomic descriptor shape before selection ", + atom_soap_single_block.block(0).values.shape, +) +print("atomic descriptor shape after selection ", atom_dscrptr_fps.shape) + +# %% diff --git a/_downloads/5277b730cb28e8c8301658e8d74988d3/thermostats.py b/_downloads/5277b730cb28e8c8301658e8d74988d3/thermostats.py new file mode 100644 index 00000000..606c5a22 --- /dev/null +++ b/_downloads/5277b730cb28e8c8301658e8d74988d3/thermostats.py @@ -0,0 +1,903 @@ +""" +Constant-temperature MD and thermostats +======================================= + +:Authors: Michele Ceriotti `@ceriottm `_ + +This recipe gives a practical introduction to finite-temperature +molecular dynamics simulations, and provides a guide to choose the +most appropriate thermostat for the simulation at hand. + +As for other examples in the cookbook, a small simulation of liquid +water is used as an archetypal example. Molecular dynamics, sampling, +and constant-temperature simulations are discussed in much detail in +the book "Understanding Molecular Simulations" by Daan Frenkel and Berend Smit. +This +`seminal paper by H.C.Andersen `_ +provides a good historical introduction to the problem of +thermostatting, and this +`PhD thesis +`_ +provides a more detailed background to several of the techniques +discussed in this recipe. +""" + +import os + +# %% +import subprocess +import time +import xml.etree.ElementTree as ET + +import chemiscope +import ipi +import matplotlib as mpl +import matplotlib.pyplot as plt +import numpy as np +from ipi.utils.tools.acf_xyz import compute_acf_xyz +from ipi.utils.tools.gle import get_gle_matrices, gle_frequency_kernel, isra_deconvolute + + +# %% +# Constant-temperature sampling of (thermo)dynamics +# ------------------------------------------------- +# +# Even though Hamilton's equations in classical mechanics conserve the total +# energy of the group of atoms in a simulation, experimental boundary conditions +# usually involve exchange of heat with the surroundings, especially when considering +# the relatively small supercells that are often used in simulations. +# +# The goal of a constant-temperature MD simulation is to compute efficiently thermal +# averages of the form :math:`\langle A(q,p)\rangle_\beta`, where the average +# of the observable :math:`A(q,p)` is +# evaluated over the Boltzmann distribution at inverse temperature +# :math:`\beta=1/k_\mathrm{B}T`, +# :math:`P(q,p)=Q^{-1} \exp(-\beta(p^2/2m + V(q)))` +# In all these scenarios, optimizing the simulation involves reducing as much as +# possible the *autocorrelation time* of the observable. +# +# Constant-temperature sampling is also important when one wants to compute +# *dynamical* properties. In principle these would require +# constant-energy trajectories, as any thermostatting procedure modifies +# the dynamics of the system. However, the initial conditions +# should usually be determined from constant-temperature conditions, +# averaging over multiple constant-energy trajectories. +# As we shall see, this protocol can often be simplified greatly, by choosing +# thermostats that don't interfere with the natural microscopic dynamics. + +# %% +# Running simulations +# ~~~~~~~~~~~~~~~~~~~ +# +# We use `i-PI `_ together with a ``LAMMPS`` driver to run +# all the simulations in this recipe. The two codes need to be run separately, +# and communicate atomic positions, energy and forces through a socket interface. +# +# The LAMMPS input defines the parameters of the +# `q-TIP4P/f water model `_, +# while the XML-formatted input of i-PI describes the setup of the +# MD simulation. +# +# We begin running a constant-energy calculation, that +# we will use to illustrate the metrics that can be applied to +# assess the performance of a thermostatting scheme. If it is the +# first time you see an ``i-PI`` input, you may want to look at +# the input file side-by-sidewith the +# `input reference `_. + +# Open and read the XML file +with open("data/input_nve.xml", "r") as file: + xml_content = file.read() +print(xml_content) + +# %% +# The part of the input that describes the molecular dynamics integrator +# is the ``motion`` class. For this run, it specifies an *NVE* ensemble, and +# a ``timestep`` of 1 fs for the integrator. + +xmlroot = ET.parse("data/input_nve.xml").getroot() +print(" " + ET.tostring(xmlroot.find(".//motion"), encoding="unicode")) + +# %% +# Note that this -- and other runs in this example -- are too short to +# provide quantitative results, and you may want to increase the +# ```` parameter so that the simulation runs for at least +# a few tens of ps. The time step of 1 fs is also at the limit of what +# is acceptable for running simulations of water. 0.5 fs would be a +# safer, stabler value. + + +# %% +# To launch i-PI and LAMMPS from the command line you can just +# execute the following commands +# +# .. code-block:: bash +# +# i-pi data/input_nve.xml > log & +# sleep 2 +# lmp -in data/in.lmp & +# +# To launch the external processes from a Python script +# proceed as follows: + +ipi_process = None +if not os.path.exists("simulation_nve.out"): + ipi_process = subprocess.Popen(["i-pi", "data/input_nve.xml"]) + time.sleep(4) # wait for i-PI to start + lmp_process = [subprocess.Popen(["lmp", "-in", "data/in.lmp"]) for i in range(1)] + +# %% +# If you run this in a notebook, you can go ahead and start loading +# output files *before* i-PI and LAMMPS have finished running, by +# skipping this cell + +if ipi_process is not None: + ipi_process.wait() + lmp_process[0].wait() + + +# %% +# Analyzing the simulation +# ~~~~~~~~~~~~~~~~~~~~~~~~ +# +# After the simulation is finished, we can look at the outputs. +# The outputs include the trajectory of positions, the velocities +# and a number of energetic observables + +output_data, output_desc = ipi.read_output("simulation_nve.out") +traj_data = ipi.read_trajectory("simulation_nve.pos_0.xyz") + +# %% +# The trajectory shows mostly local vibrations on this short time scale, +# but if you re-run with a longer ```` settings you should be +# able to observe diffusing molecules in the liquid. + +chemiscope.show( + traj_data, + mode="structure", + settings=chemiscope.quick_settings( + trajectory=True, structure_settings={"unitCell": True} + ), +) + +# %% +# Potential and kinetic energy fluctuate, but the total energy is +# (almost) constant, the small fluctuations being due to integration +# errors, that are quite large with the long time step used for this +# example. If you run with smaller ```` values, you should +# see that the energy conservation condition is fulfilled with higher +# accuracy. + +fig, ax = plt.subplots(1, 1, figsize=(4, 3), constrained_layout=True) +ax.plot( + output_data["time"], + output_data["potential"] - output_data["potential"][0], + "b-", + label="Potential, $V$", +) +ax.plot( + output_data["time"], + output_data["kinetic_md"], + "r-", + label="Kinetic, $K$", +) +ax.plot( + output_data["time"], + output_data["conserved"] - output_data["conserved"][0], + "k-", + label="Conserved, $H$", +) +ax.set_xlabel(r"$t$ / ps") +ax.set_ylabel(r"energy / eV") +ax.legend() +plt.show() + +# %% +# In a classical MD simulation, based on the momentum :math:`\mathbf{p}` +# of each atom, it is possible to evaluate its *kinetic temperature +# estimator* :math:`T=\langle \mathbf{p}^2/m \rangle /3k_B` the average is to +# be intended over a converged trajectory. Keep in mind that +# +# 1. The *instantaneous* value of this estimator is meaningless +# 2. It is only well-defined in a constant-temperature simulation, so here +# it only gives a sense of whether atomic momenta are close to what one +# would expect at 300 K. +# +# With these caveats in mind, we can observe that the simulation has higher +# velocities than expected at 300 K, and that there is no equipartition, the +# O atoms having on average a higher energy than the H atoms. + +fig, ax = plt.subplots(1, 1, figsize=(4, 3), constrained_layout=True) +ax.plot( + output_data["time"], + output_data["temperature(O)"], + "r-", + label="O atoms", +) +ax.plot( + output_data["time"], + output_data["temperature(H)"], + "c-", + label="H atoms", +) +ax.plot(output_data["time"], output_data["temperature"], "k-", label="All atoms") +ax.set_xlabel(r"$t$ / ps") +ax.set_ylabel(r"$\tilde{T}$ / K") +ax.legend() +plt.show() + +# %% +# In order to investigate the dynamics more carefully, we +# compute the velocity-velocity autocorrelation function +# :math:`c_{vv}(t)=\sum_i \langle \mathbf{v}_i(t) \cdot \mathbf{v}_i(0) \rangle`. +# We use a utility function that reads the outputs of ``i-PI`` +# and computes both the autocorrelation function and its Fourier +# transform. +# :math:`c_{vv}(t)` contains information on the time scale and amplitude +# of molecular motion, and is closely related to the vibrational density +# of states and to spectroscopic observables such as IR and Raman spectra. + +acf_nve = compute_acf_xyz( + "simulation_nve.vel_0.xyz", + maximum_lag=600, + length_zeropadding=2000, + spectral_windowing="cosine-blackman", + timestep=1, + time_units="femtosecond", + skip=100, +) + +fig, ax = plt.subplots(1, 1, figsize=(4, 3), constrained_layout=True) +ax.plot( + acf_nve[0][:1200] * 2.4188843e-05, # atomic time to ps + acf_nve[1][:1200] * 1e5, + "r-", +) +ax.set_xlabel(r"$t$ / ps$") +ax.set_ylabel(r"$c_{vv}$ / arb. units") +plt.show() + +# %% +# The power spectrum (that can be computed as the Fourier transform of +# :math:`c_{vv}`) reveals the frequencies of stretching, bending and libration +# modes of water; the :math:`\omega\rightarrow 0` limit is proportional +# to the diffusion coefficient. +# We also load the results from a reference calculation (average of 8 +# trajectories initiated from NVT-equilibrated samples, shown as the +# confidence interval). You can see how to run these reference calculations +# from the script ``data/run_traj.sh``. +# The differences are due to the short trajectory, and to the fact that the +# NVE trajectory is not equilibrated at 300 K. + +ha2cm1 = 219474.63 + +# Loads reference trajectory +acf_ref = np.loadtxt("data/traj-all_facf.data") + +fig, ax = plt.subplots(1, 1, figsize=(4, 3), constrained_layout=True) + +ax.fill_between( + acf_ref[:1200, 0] * ha2cm1, + (acf_ref[:1200, 1] - acf_ref[:1200, 2]) * 1e5, + (acf_ref[:1200, 1] + acf_ref[:1200, 2]) * 1e5, + color="gray", + label="reference", +) + +ax.loglog(acf_nve[3][:1200] * ha2cm1, acf_nve[4][:1200] * 1e5, "r-", label="NVE") +ax.set_xlabel(r"$\omega$ / cm$^{-1}$") +ax.set_ylabel(r"$\hat{c}_{vv}$ / arb. units") +ax.legend() +plt.show() + +# %% +# Langevin thermostatting +# ----------------------- +# +# In order to perform a simulations that samples configurations +# consistent with a Boltzmann distribution :math:`e^{-V(x)/k_B T}` +# one needs to modify the equations of motion. There are many +# different approaches to do this, some of which lead to deterministic +# dynamics; the two more widely used deterministic thermostats +# are the +# `Berendsen thermostat `_ +# which does not sample the Boltzmann distribution exactly and +# should never be used given the many more rigorous alternatives, +# and the Nosé-Hoover thermostat, that requires a +# `"chain" implementation `_ +# to be ergodic, which amounts essentially to a complicated way +# to generate poor-quality pseudo-random numbers. +# +# Given the limitations of deterministic thermostats, in this +# recipe we focus on stochastic thermostats, that model the +# coupling to the chaotic dynamics of an external bath through +# explicit random numbers. Langevin dynamics amounts to adding +# to Hamilton's equations of motion, for each degree of freedom, +# a term of the form +# +# .. math:: +# +# \dot{p} = -\gamma p + \sqrt{2\gamma m k_B T} \, \xi(t) +# +# where :math:` +# \gamma` is a friction coefficient, and :math:`\xi` +# uncorrelated random numbers that mimic collisions with the bath +# particles. The friction can be seen as the inverse of a +# characteristic *coupling time scale* +# :math:`\tau=1/\gamma` that describes how strongly the bath +# interacts with the system. + +# %% +# Setting up a thermostat in ``i-PI`` +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# In order to set up a thermostat in ``i-PI``, one simply needs +# to adjust the ```` block, to perform ``nvt`` dynamics +# and include an appropriate ```` section. +# Here we use a very-strongly coupled Langevin thermostat, +# with :math:`\tau=10~fs`. + +xmlroot = ET.parse("data/input_higamma.xml").getroot() +print(" " + ET.tostring(xmlroot.find(".//dynamics"), encoding="unicode")) + +# %% +# ``i-PI`` and ``LAMMPS`` are launched as above ... + +ipi_process = None +if not os.path.exists("simulation_higamma.out"): + ipi_process = subprocess.Popen(["i-pi", "data/input_higamma.xml"]) + time.sleep(4) # wait for i-PI to start + lmp_process = [subprocess.Popen(["lmp", "-in", "data/in.lmp"]) for i in range(1)] + +# %% +# ... and you should probably wait until they're done, +# it'll take less than a minute. + +if ipi_process is not None: + ipi_process.wait() + lmp_process[0].wait() + +# %% +# Analysis of the trajectory +# ~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# The temperature converges very quickly to the target value +# (fluctuations are to be expected, given that as discussed above +# the temperature estimator is just the instantaneous kinetic energy, +# that is not constant). There is also equipartition between O and H. + +output_data, output_desc = ipi.read_output("simulation_higamma.out") +traj_data = ipi.read_trajectory("simulation_higamma.pos_0.xyz") + +fig, ax = plt.subplots(1, 1, figsize=(4, 3), constrained_layout=True) +ax.plot( + output_data["time"], + output_data["temperature(O)"], + "r-", + label="O atoms", +) +ax.plot( + output_data["time"], + output_data["temperature(H)"], + "c-", + label="H atoms", +) +ax.plot(output_data["time"], output_data["temperature"], "k-", label="All atoms") +ax.set_xlabel(r"$t$ / ps") +ax.set_ylabel(r"$\tilde{T}$ / K") +ax.legend() +plt.show() + + +# %% +# The velocity-velocity correlation function shows how much +# this thermostat affects the system dynamics. The high-frequency peaks, +# corresponding to stretches and bending, are +# greatly broadened, and the :math:`\omega\rightarrow 0` +# limit of :math:`\hat{c}_{vv}`, corresponding to the +# diffusion coefficient, is reduced by almost a factor of 5. +# This last observation highlights that a too-aggressive +# thermostat is not only disrupting the dynamics: +# it also slows down diffusion through phase space, +# making the dynamics less efficient at sampling slow, +# collective motions. We shall see further down various +# methods to counteract this effect, but in general one should +# use a weaker coupling, that improves the sampling of configuration +# space even though it slows down the convergence of the +# kinetic energy. If you want a thermostat that equilibrates +# aggressively the temperature while disturbing less the diffusive +# modes, you may try the *fast-forward Langevin* thermostat +# `(Hijazi et al., JCP (2018)) `_ +# that can be activated with the option ``mode="ffl"``. + +# compute the v-v acf +acf_higamma = compute_acf_xyz( + "simulation_higamma.vel_0.xyz", + maximum_lag=600, + length_zeropadding=2000, + spectral_windowing="cosine-blackman", + timestep=1, + time_units="femtosecond", + skip=100, +) + +# and plot +fig, ax = plt.subplots(1, 1, figsize=(4, 3), constrained_layout=True) +ax.fill_between( + acf_ref[:1200, 0] * ha2cm1, + (acf_ref[:1200, 1] - acf_ref[:1200, 2]) * 1e5, + (acf_ref[:1200, 1] + acf_ref[:1200, 2]) * 1e5, + color="gray", + label="reference", +) +ax.loglog( + acf_higamma[3][:1200] * ha2cm1, + acf_higamma[4][:1200] * 1e5, + "b-", + label=r"Langevin, $\tau=10$fs", +) +ax.set_xlabel(r"$\omega$ / cm$^{-1}$") +ax.set_ylabel(r"$\hat{c}_{vv}$ / arb. units") +ax.legend() +plt.show() + +# %% +# Global thermostats: stochastic velocity rescaling +# ------------------------------------------------- +# +# An alternative approach to sample the canonical Boltzmann +# distribution while introducing fewer disturbances to the system +# dynamics is to use a *global* thermostat, i.e. a scheme that +# targets the *total* kinetic energy of the system, rather than that +# of individual degrees of freedom. +# We recommend the "stochastic velocity rescaling" thermostat +# `(Bussi, Donadio, Parrinello, JCP (2007)) `_ +# that acts by rescaling the total momentum vector, adding a +# suitably distributed random noise term. + + +# %% +# Setting up a thermostat in ``i-PI`` +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Stochastic velocity rescaling is implemented in ``i-PI`` +# can be selected by setting ``mode="svr"``, and has a +# ``tau`` parameter that corresponds to the time scale of the +# coupling. + +xmlroot = ET.parse("data/input_svr.xml").getroot() +print(" " + ET.tostring(xmlroot.find(".//thermostat"), encoding="unicode")) + +# %% +# We run a simulation with the usual set up ... + +ipi_process = None +if not os.path.exists("simulation_svr.out"): + ipi_process = subprocess.Popen(["i-pi", "data/input_svr.xml"]) + time.sleep(4) # wait for i-PI to start + lmp_process = [subprocess.Popen(["lmp", "-in", "data/in.lmp"]) for i in range(1)] + +# %% +# ... and wait for it to finish. + +if ipi_process is not None: + ipi_process.wait() + lmp_process[0].wait() + +# %% +# Analysis of the trajectory +# ~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# The kinetic temperature of the trajectory equilibrates very +# rapidly to the target value. However, it takes a bit longer +# (approximately 0.5 ps) to reach equipartition between O and H +# atoms. This is an important shortcoming of global thermostats: +# since they only target the total kinetic energy, they must rely +# on internal energy redistribution to reach equilibrium between +# different degrees of freedom. +# Liquid water is a very ergodic system, in which all degrees of +# freedom are strongly coupled, so this is not a major issue. However +# care must be taken when modeling a quasi-harmonic crystal (e.g. +# diamond, a metal, or an inorganic crystal), or a molecular system +# in which the coupling between molecules is weaker (e.g. methane, +# or another apolar compound). + +output_data, output_desc = ipi.read_output("simulation_svr.out") +traj_data = ipi.read_trajectory("simulation_svr.pos_0.xyz") + +fig, ax = plt.subplots(1, 1, figsize=(4, 3), constrained_layout=True) +ax.plot( + output_data["time"], + output_data["temperature(O)"], + "r-", + label="O atoms", +) +ax.plot( + output_data["time"], + output_data["temperature(H)"], + "c-", + label="H atoms", +) +ax.plot(output_data["time"], output_data["temperature"], "k-", label="All atoms") +ax.set_xlabel(r"$t$ / ps") +ax.set_ylabel(r"$\tilde{T}$ / K") +ax.legend() +plt.show() + + +# %% +# The velocity-velocity autocorrelation function is +# essentially indistinguishable from the reference, computed +# with an ensemble of NVE trajectories starting from canonical +# samples. In fact, the small discrepancies are mostly due to +# incomplete convergence of the averages in the short trajectory. +# +# This highlights the advantages of a global thermostat, that +# does not disrupt the natural diffusion in configuration space, +# and can often be used to compute dynamical, time-dependent +# observables out of a single trajectory -- which is far more +# practical than performing a collection of NVE trajectories. + +acf_svr = compute_acf_xyz( + "simulation_svr.vel_0.xyz", + maximum_lag=600, + length_zeropadding=2000, + spectral_windowing="cosine-blackman", + timestep=1, + time_units="femtosecond", + skip=100, +) + +fig, ax = plt.subplots(1, 1, figsize=(4, 3), constrained_layout=True) +ax.fill_between( + acf_ref[:1200, 0] * ha2cm1, + (acf_ref[:1200, 1] - acf_ref[:1200, 2]) * 1e5, + (acf_ref[:1200, 1] + acf_ref[:1200, 2]) * 1e5, + color="gray", + label="reference", +) +ax.loglog( + acf_svr[3][:1200] * ha2cm1, + acf_svr[4][:1200] * 1e5, + "b-", + label=r"SVR, $\tau=10$fs", +) +ax.set_xlabel(r"$\omega$ / cm$^{-1}$") +ax.set_ylabel(r"$\hat{c}_{vv}$ / arb. units") +ax.legend() +plt.show() + +# %% +# Generalized Langevin Equation thermostat +# ---------------------------------------- +# +# The issue with a Langevin thermostat is that, for a given coupling +# time :math:`\tau`, only molecular motions with a comparable time scale +# are sampled efficiently: faster modes are *underdamped*, and slower modes +# are *overdamped*, cf. the slowing down of diffusive behavior. +# +# A possible solution to this problem is using a +# *Generalized Langevin Equation (GLE)* thermostat. A GLE +# thermostat uses a matrix generalization of the Langevin term, +# in which the physical momentum is supplemented by a few fictitious +# momenta :math:`\mathbf{s}`, i.e. +# +# .. math:: +# +# (\dot{p},\dot{\mathbf{s}}) = -\mathbf{A}_p (p,\mathbf{s})\ +# +\mathbf{B}_p (\xi,\boldsymbol{\xi}) +# +# +# Here :math:`\mathbf{A}_p` is the *drift matrix* and :math:`\mathbf{B}_p` +# is a diffusion matrix which, for canonical sampling, is determined by the target +# temperature and the drift matrix through a fluctuation-dissipation relation. +# The key idea is that :math:`\mathbf{A}_p` provides a lot of flexibility in defining +# the behavior of the GLE, that can be tuned to achieve near-optimal sampling +# for every degree of freedom (effectively acting as if the coupling constant was +# tuned separately for slow and fast molecular motions). +# The general idea and the practical implementation are discussed in +# `(Ceriotti et al. JCTC (2010)) `_ +# which also discusses other applications of the same principle, including +# performing simulations with a non-equilibrium *quantum thermostat* that +# mimics the quantum the quantum mechanical behavior of light nuclei. + +# %% +# Setting up a thermostat in ``i-PI`` +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# A GLE thermostat can be activated using ``mode="gle"``. +# The drift matrix used here has been generated from the +# `GLE4MD website `_, using parameters that +# aim for the most efficient sampling possible with the short +# simulation time (2 ps). The `online generator +# `_ +# can be tuned to provide the best possible sampling for the system +# of interest, the most important parameter being the slowest time scale +# that one is interested in sampling (typically a fraction of the total +# simulation time). The range of frequencies that is optimized can then +# be tuned so as to reach, roughly, the maximum frequency present in the +# system. + +xmlroot = ET.parse("data/input_gle.xml").getroot() +print(" " + ET.tostring(xmlroot.find(".//thermostat"), encoding="unicode")) + +# %% +# We launch ``i-PI`` as usual ... + +ipi_process = None +if not os.path.exists("simulation_gle.out"): + ipi_process = subprocess.Popen(["i-pi", "data/input_gle.xml"]) + time.sleep(4) # wait for i-PI to start + lmp_process = [subprocess.Popen(["lmp", "-in", "data/in.lmp"]) for i in range(1)] + +# %% +# ... and wait for simulations to finish. + +if ipi_process is not None: + ipi_process.wait() + lmp_process[0].wait() + +# %% +# Analysis of the trajectory +# ~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# The kinetic temperature equilibrates quickly to the target value. +# Since the GLE is a local thermostat, targeting each degree of freedom +# separately, equipartition is also reached quickly. Sampling is less +# fast than with an aggressive Langevin thermostat, because the GLE targets +# each vibrational frequency separately, to minimize the impact on diffusion. +output_data, output_desc = ipi.read_output("simulation_gle.out") +traj_data = ipi.read_trajectory("simulation_gle.pos_0.xyz") + +fig, ax = plt.subplots(1, 1, figsize=(4, 3), constrained_layout=True) +ax.plot( + output_data["time"], + output_data["temperature(O)"], + "r-", + label="O atoms", +) +ax.plot( + output_data["time"], + output_data["temperature(H)"], + "c-", + label="H atoms", +) +ax.plot(output_data["time"], output_data["temperature"], "k-", label="All atoms") +ax.set_xlabel(r"$t$ / ps") +ax.set_ylabel(r"$\tilde{T}$ / K") +ax.legend() +plt.show() + + +# %% +# :math:`\hat{c}_{vv}` reflects the adaptive behavior of the GLE. +# The fast modes are damped aggressively, leading to a large +# broadening of the high frequency peaks, but librations and diffusive +# modes are much less dampened than in the high-coupling Langevin case. +# An optimal-coupling GLE is a safe choice to sample any system, from +# molecular liquids to harmonic crystals, although a stochastic velocity +# rescaling is preferable if one is interested in preserving the natural +# dynamics. + +acf_gle = compute_acf_xyz( + "simulation_gle.vel_0.xyz", + maximum_lag=600, + length_zeropadding=2000, + spectral_windowing="cosine-blackman", + timestep=1, + time_units="femtosecond", + skip=100, +) + +fig, ax = plt.subplots(1, 1, figsize=(4, 3), constrained_layout=True) +ax.fill_between( + acf_ref[:1200, 0] * ha2cm1, + (acf_ref[:1200, 1] - acf_ref[:1200, 2]) * 1e5, + (acf_ref[:1200, 1] + acf_ref[:1200, 2]) * 1e5, + color="gray", + label="reference", +) +ax.loglog( + acf_gle[3][:1200] * ha2cm1, + acf_gle[4][:1200] * 1e5, + "b-", + label=r"GLE", +) +ax.set_xlabel(r"$\omega$ / cm$^{-1}$") +ax.set_ylabel(r"$\hat{c}_{vv}$ / arb. units") +ax.legend() +plt.show() + +# %% +# R-L purification +# ~~~~~~~~~~~~~~~~ +# +# What if you also want to extract dynamical information from a GLE +# (or Langevin) trajectory? It is actually possible to post-process the +# power spectrum, performing a deconvolution based on the amount of +# disturbance introduced by the GLE, that can be predicted analytically +# in the harmonic limit. +# The idea, discussed in `(Rossi et al., JCP (2018)) +# `_ +# is that if :math:`\hat{y}(\omega)` is the "natural" NVE power +# spectrum, and :math:`k_{\mathrm{GLE}}(\omega_0, \omega)` is the power +# spectrum predicted for a harmonic oscillator of frequency :math:`\omega_0`, +# then the spectrum from the GLE dynamics will be approximately +# +# .. math:: +# +# \hat{y}_{\mathrm{GLE}}(\omega) = \int \mathrm{d}\omega' +# k_{\mathrm{GLE}}(\omega', \omega) \hat{y}(\omega') +# +# The kernel can be computed analytically for all frequencies that +# are relevant for the power spectrum, based on the GLE parameters +# extracted from the input of ``i-PI``. + +n_omega = 1200 +Ap, Cp, Dp = get_gle_matrices("data/input_gle.xml") +gle_kernel = gle_frequency_kernel(acf_gle[3][:n_omega], Ap, Dp) + + +lomega = acf_gle[3][:n_omega] * ha2cm1 +fig, ax = plt.subplots(1, 1, figsize=(4, 3), constrained_layout=True) +levels = np.logspace(np.log10(gle_kernel.min()), np.log10(gle_kernel.max()), num=50) +contour = ax.contourf(lomega, lomega, gle_kernel, norm=mpl.colors.LogNorm()) +ax.set_xscale("log") +ax.set_yscale("log") +ax.set_xlabel(r"$\omega_0$ / cm$^{-1}$") +ax.set_ylabel(r"$\omega$ / cm$^{-1}$") +ax.set_xlim(10, 5000) +ax.set_ylim(10, 5000) +cbar = fig.colorbar(contour, ticks=[1e1, 1e3, 1e5, 1e7]) + +# %% +# The deconvolution is based on the Iterative Image Space +# Reconstruction Algorithm, which preserves the positive-definiteness +# of the spectrum + +isra_acf, history, errors, laplace = isra_deconvolute( + acf_gle[3][:n_omega], acf_gle[4][:n_omega], gle_kernel, 64, 4 +) + +# %% +# Even though the ISRA algorithm is less prone to enhancing noise than +# other deconvolution algorithms, successive iterations sharpen the spectrum +# but introduce higher and higher levles of noise, particularly on the +# low-frequency end of the spectrum so one has to choose when to stop. + +fig, ax = plt.subplots(1, 1, figsize=(4, 3), constrained_layout=True) +ax.loglog( + acf_gle[3][:1200] * ha2cm1, + acf_gle[4][:1200] * 1e5, + "b-", + label=r"GLE", +) +ax.loglog( + acf_gle[3][:1200] * ha2cm1, + history[0] * 1e5, + ":", + color="#4000D0", + label=r"iter[1]", +) +ax.loglog( + acf_gle[3][:1200] * ha2cm1, + history[2] * 1e5, + ":", + color="#A000A0", + label=r"iter[9]", +) +ax.loglog( + acf_gle[3][:1200] * ha2cm1, + history[4] * 1e5, + ":", + color="#D00040", + label=r"iter[17]", +) +ax.loglog( + acf_gle[3][:1200] * ha2cm1, + history[12] * 1e5, + ":", + color="#FF0000", + label=r"iter[49]", +) + +ax.set_xlabel(r"$\omega$ / cm$^{-1}$") +ax.set_ylabel(r"$\hat{c}_{vv}$ / arb. units") +ax.legend() +plt.show() + +# %% +# Especially in the high-frequency region, the deconvolution +# algorithm succees in recovering the underlying NVE dynamics, +# which can be useful whenever one wants to optimize statistical +# efficiency while still being able to estimate dynamical +# properties. + +fig, ax = plt.subplots(1, 1, figsize=(4, 3), constrained_layout=True) +ax.fill_between( + acf_ref[:1200, 0] * ha2cm1, + (acf_ref[:1200, 1] - acf_ref[:1200, 2]) * 1e5, + (acf_ref[:1200, 1] + acf_ref[:1200, 2]) * 1e5, + color="gray", + label="reference", +) +ax.loglog( + acf_gle[3][:1200] * ha2cm1, + acf_gle[4][:1200] * 1e5, + "b-", + label=r"GLE", +) +ax.loglog( + acf_gle[3][:1200] * ha2cm1, + history[2] * 1e5, + "r-", + label=r"GLE$\rightarrow$ NVE (iter[5])", +) +ax.set_xlabel(r"$\omega$ / cm$^{-1}$") +ax.set_ylabel(r"$\hat{c}_{vv}$ / arb. units") +ax.legend() +plt.show() + + +# %% +# Running with LAMMPS +# ~~~~~~~~~~~~~~~~~~~ +# +# GLE thermostats (as well as conventional Langevin, and +# stochastic velocity rescaling) are also implemented natively +# in ``LAMMPS``. +# +# An example of ``LAMMPS`` input containing a GLE thermostat can +# be found in ``data/gle.lmp``. See also the +# `documentation of the fix gle command +# `_ +# +# .. code-block:: text +# +# fix 1 all gle 6 300 300 31415 data/smart.A +# +# The drift matrix can be obtained from the same website, simply +# asking to output the matrix in raw format, choosing units consistent +# with the ``LAMMPS`` settings, e.g. for this `optimal sampling setup +# `_ +# + +# %% +# We can run ``LAMMPS`` from the command line +# +# .. code-block:: bash +# +# lmp -in data/gle.lmp & +# +# or from Python + +lmp_process = None +if not os.path.exists("lammps_out.dat"): + lmp_process = subprocess.Popen(["lmp", "-in", "data/gle.lmp"]) + +# %% +# ... and wait +# + +if lmp_process is not None: + lmp_process.wait() + +# %% +# The simulation is much faster (for such a small system and +# cheap potential the overhead of ``i-PI``'s client-server mechanism +# is substantial) and leads to similar results for the kinetic temperature +# + +traj_data = np.loadtxt("lammps_out.dat") + +fig, ax = plt.subplots(1, 1, figsize=(4, 3), constrained_layout=True) +ax.plot( + traj_data[:, 0] * 1e-3, + traj_data[:, 1], + "k-", + label="All atoms", +) +ax.set_xlabel(r"$t$ / ps") +ax.set_ylabel(r"$\tilde{T}$ / K") +ax.legend() +plt.show() diff --git a/_downloads/54cb049367bea2b1604e2df18dc055b4/sample-selection.ipynb b/_downloads/54cb049367bea2b1604e2df18dc055b4/sample-selection.ipynb new file mode 100644 index 00000000..f406c136 --- /dev/null +++ b/_downloads/54cb049367bea2b1604e2df18dc055b4/sample-selection.ipynb @@ -0,0 +1,241 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "\n# Sample and Feature Selection with FPS and CUR\n\n:Authors: Davide Tisi [@DavideTisi](https://github.com/DavideTisi)\n\nIn this tutorial we generate descriptors using rascaline, then select a subset\nof structures using both the farthest-point sampling (FPS) and CUR algorithms\nimplemented in scikit-matter. Finally, we also generate a selection of\nthe most important features using the same techniques.\n\nFirst, import all the necessary packages\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "import ase.io\nimport chemiscope\nimport metatensor\nimport numpy as np\nfrom equisolve.numpy import feature_selection, sample_selection\nfrom matplotlib import pyplot as plt\nfrom rascaline import SoapPowerSpectrum\nfrom sklearn.decomposition import PCA\nfrom skmatter import feature_selection as skfeat_selection" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Load molecular data\n\nLoad 500 example BTO structures from file, reading them using\n[ASE](https://wiki.fysik.dtu.dk/ase/).\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "# Load a subset of :download:`structures ` of the example dataset\nn_frames = 500\nframes = ase.io.read(\"input-fps.xyz\", f\":{n_frames}\", format=\"extxyz\")" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Compute SOAP descriptors using rascaline\n\nFirst, define the rascaline hyperparameters used to compute SOAP.\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "# rascaline hyperparameters\nhypers = {\n \"cutoff\": 6.0,\n \"max_radial\": 8,\n \"max_angular\": 6,\n \"atomic_gaussian_width\": 0.3,\n \"cutoff_function\": {\"ShiftedCosine\": {\"width\": 0.5}},\n \"radial_basis\": {\"Gto\": {\"accuracy\": 1e-6}},\n \"radial_scaling\": {\"Willatt2018\": {\"exponent\": 4, \"rate\": 1, \"scale\": 3.5}},\n \"center_atom_weight\": 1.0,\n}\n\n# Generate a SOAP power spectrum\ncalculator = SoapPowerSpectrum(**hypers)\nrho2i = calculator.compute(frames)\n\n\n# Makes a dense block\natom_soap = rho2i.keys_to_properties([\"species_neighbor_1\", \"species_neighbor_2\"])\n\natom_soap_single_block = atom_soap.keys_to_samples(keys_to_move=[\"species_center\"])\n\n# Sum over atomic centers to compute structure features\nstruct_soap = metatensor.sum_over_samples(\n atom_soap_single_block, sample_names=[\"center\", \"species_center\"]\n)\n\n\nprint(\"atom feature descriptor shape:\", atom_soap.block(0).values.shape)\nprint(\n \"atom feature descriptor (all in one block) shape:\",\n atom_soap_single_block.block(0).values.shape,\n)\nprint(\"structure feature descriptor shape:\", struct_soap.block(0).values.shape)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Perform atomic environment (i.e. sample) selection\n\nUsing FPS and CUR algorithms, we can perform selection of atomic environments.\nThese are implemented in equisolve, which provides a wrapper around\nscikit-matter to allow for interfacing with data stored in the metatensor\nformat.\n\nSuppose we want to select the 10 most diverse environments for each chemical\nspecies.\n\nFirst, we can use the `keys_to_properties` operation in metatensor to move the\nneighbour species indices to the properties of the TensorBlocks. The resulting\ndescriptor will be a TensorMap comprised of three blocks, one for each\nchemical species, where the chemical species indices are solely present in the\nkeys.\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "print(\"----Atomic environment selection-----\")\n# Define the number of structures to select using FPS/CUR\nn_envs = 25\n\nprint(atom_soap)\nprint(atom_soap.block(0))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "select 10 atomic environments for each chemical species.\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "# Define the number of structures *per block* to select using FPS\nn_envs = 10\n\n# FPS sample selection\nselector_atomic_fps = sample_selection.FPS(n_to_select=n_envs, initialize=\"random\").fit(\n atom_soap\n)\n\n# Print the selected envs for each block\nprint(\"atomic envs selected with FPS:\\n\")\nfor key, block in selector_atomic_fps.support.items():\n print(\"species_center:\", key, \"\\n(struct_idx, atom_idx)\\n\", block.samples.values)\n\nselector_atomic_cur = sample_selection.CUR(n_to_select=n_envs).fit(atom_soap)\n# Print the selected envs for each block\nprint(\"atomic envs selected with CUR:\\n\")\nfor key, block in selector_atomic_cur.support.items():\n print(\"species_center:\", key, \"\\n(struct_idx, atom_idx)\\n\", block.samples.values)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Selecting from a combined pool of atomic environments\n\nOne can also select from a combined pool of atomic environments and\nstructures, instead of selecting an equal number of atomic environments for\neach chemical species. In this case, we can move the 'species_center' key to samples\nsuch that our descriptor is a TensorMap consisting of a single block. Upon\nsample selection, the most diverse atomic environments will be selected,\nregardless of their chemical species.\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "print(\"----All atomic environment selection-----\")\n\nprint(\"keys\", atom_soap.keys)\nprint(\"blocks\", atom_soap[0])\nprint(\"samples in first block\", atom_soap[0].samples)\n\n# Using the original SOAP descriptor, move all keys to properties.\n\n\n# Define the number of structures to select using FPS\nn_envs = 10\n\n# FPS sample selection\nselector_atomic_fps = sample_selection.FPS(n_to_select=n_envs, initialize=\"random\").fit(\n atom_soap_single_block\n)\nprint(\n \"atomic envs selected with FPS: \\n (struct_idx, atom_idx, species_center) \\n\",\n selector_atomic_fps.support.block(0).samples.values,\n)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Perform structure (i.e. sample) selection with FPS/CUR\n\nInstead of atomic environments, one can also select diverse structures. We can\nuse the `sum_over_samples` operation in metatensor to define features in the\nstructural basis instead of the atomic basis. This is done by summing over the\natomic environments, labeled by the 'center' index in the samples of the\nTensorMap.\n\nAlternatively, one could use the `mean_over_samples` operation, depending on\nthe specific inhomogeneity of the size of the structures in the training set.\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "print(\"----Structure selection-----\")\n\n# Define the number of structures to select *per block* using FPS\nn_structures = 10\n\n# FPS structure selection\nselector_struct_fps = sample_selection.FPS(\n n_to_select=n_structures, initialize=\"random\"\n).fit(struct_soap)\nstruct_fps_idxs = selector_struct_fps.support.block(0).samples.values.flatten()\n\nprint(\"structures selected with FPS:\\n\", struct_fps_idxs)\n\n# CUR structure selection\nselector_struct_cur = sample_selection.CUR(n_to_select=n_structures).fit(struct_soap)\nstruct_cur_idxs = selector_struct_cur.support.block(0).samples.values.flatten()\nprint(\"structures selected with CUR:\\n\", struct_cur_idxs)\n\n\n# Slice structure descriptor along axis 0 to contain only the selected structures\nstruct_soap_fps = struct_soap.block(0).values[struct_fps_idxs, :]\nstruct_soap_cur = struct_soap.block(0).values[struct_cur_idxs, :]\nassert struct_soap_fps.shape == struct_soap_cur.shape\n\nprint(\"Structure descriptor shape before selection \", struct_soap.block(0).values.shape)\nprint(\"Structure descriptor shape after selection (FPS)\", struct_soap_fps.shape)\nprint(\"Structure descriptor shape after selection (CUR)\", struct_soap_cur.shape)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Visualize selected structures\n\nsklearn can be used to perform PCA dimensionality reduction on the SOAP\ndescriptors. The resulting PC coordinates can be used to visualize the the\ndata alongside their structures in a chemiscope widget.\n\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "# Generate a structure PCA\nstruct_soap_pca = PCA(n_components=2).fit_transform(struct_soap.block(0).values)\nassert struct_soap_pca.shape == (n_frames, 2)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Plot the PCA map\n\nNotice how the selected points avoid the densely-sampled area, and cover\nthe periphery of the dataset\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "# Matplotlib plot\nfig, ax = plt.subplots(1, 1, figsize=(6, 4))\nscatter = ax.scatter(struct_soap_pca[:, 0], struct_soap_pca[:, 1], c=\"red\")\nax.plot(\n struct_soap_pca[struct_cur_idxs, 0],\n struct_soap_pca[struct_cur_idxs, 1],\n \"ko\",\n fillstyle=\"none\",\n label=\"FPS selection\",\n)\nax.set_xlabel(\"PCA[1]\")\nax.set_ylabel(\"PCA[2]\")\nax.legend()\nfig.show()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Creates a chemiscope viewer\n\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "# Selected level\nselection_levels = []\nfor i in range(len(frames)):\n level = 0\n if i in struct_cur_idxs:\n level += 1\n if i in struct_fps_idxs:\n level += 2\n if level == 0:\n level = \"Not selected\"\n elif level == 1:\n level = \"CUR\"\n elif level == 2:\n level = \"FPS\"\n else:\n level = \"FPS+CUR\"\n selection_levels.append(level)\n\nproperties = chemiscope.extract_properties(frames)\n\nproperties.update(\n {\n \"PC1\": struct_soap_pca[:, 0],\n \"PC2\": struct_soap_pca[:, 1],\n \"selection\": np.array(selection_levels),\n }\n)\n\nwidget = chemiscope.show(\n frames,\n properties=properties,\n settings={\n \"map\": {\n \"x\": {\"property\": \"PC1\"},\n \"y\": {\"property\": \"PC2\"},\n \"color\": {\"property\": \"energy\"},\n \"symbol\": \"selection\",\n \"size\": {\"factor\": 50},\n },\n \"structure\": [{\"unitCell\": True}],\n },\n)\nwidget.save(\"sample-selection.json.gz\")\n\n# display, if in notebook or sphinx\nwidget" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Perform feature selection\n\nNow perform feature selection. In this example we will go back to using the\ndescriptor decomposed into atomic environments, as opposed to the one\ndecomposed into structure environments, but only use FPS for brevity.\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "print(\"----Feature selection-----\")\n\n# Define the number of features to select\nn_features = 200\n\n# FPS feature selection\nfeat_fps = feature_selection.FPS(n_to_select=n_features, initialize=\"random\").fit(\n atom_soap_single_block\n)\n\n# Slice atomic descriptor along axis 1 to contain only the selected features\n# atom_soap_single_block_fps = atom_soap_single_block.block(0).values[:, feat_fps_idxs]\natom_soap_single_block_fps = metatensor.slice(\n atom_soap_single_block,\n axis=\"properties\",\n labels=feat_fps.support.block(0).properties,\n)\n\nprint(\n \"atomic descriptor shape before selection \",\n atom_soap_single_block.block(0).values.shape,\n)\nprint(\n \"atomic descriptor shape after selection \",\n atom_soap_single_block_fps.block(0).values.shape,\n)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Perform feature selection (skmatter)\n\nNow perform feature selection. In this example we will go back to using the\ndescriptor decomposed into atomic environments, as opposed to the one\ndecomposed into structure environments, but only use FPS for brevity.\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "print(\"----Feature selection (skmatter)-----\")\n\n# Define the number of features to select\nn_features = 200\n\n# FPS feature selection\nfeat_fps = skfeat_selection.FPS(n_to_select=n_features, initialize=\"random\").fit(\n atom_soap_single_block.block(0).values\n)\nfeat_fps_idxs = feat_fps.selected_idx_\n\nprint(\"Feature indices obtained with FPS \", feat_fps_idxs)\n\n# Slice atomic descriptor along axis 1 to contain only the selected features\natom_dscrptr_fps = atom_soap_single_block.block(0).values[:, feat_fps_idxs]\n\nprint(\n \"atomic descriptor shape before selection \",\n atom_soap_single_block.block(0).values.shape,\n)\nprint(\"atomic descriptor shape after selection \", atom_dscrptr_fps.shape)" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.11.10" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} \ No newline at end of file diff --git a/_downloads/579a8571a79bc457a528f6ee99701555/data.zip b/_downloads/579a8571a79bc457a528f6ee99701555/data.zip new file mode 100644 index 00000000..0f7f0f4a Binary files /dev/null and b/_downloads/579a8571a79bc457a528f6ee99701555/data.zip differ diff --git a/_downloads/58547081d5f0a1a26f167e9bb3a01b2c/thermostats.ipynb b/_downloads/58547081d5f0a1a26f167e9bb3a01b2c/thermostats.ipynb new file mode 100644 index 00000000..dcca2ef3 --- /dev/null +++ b/_downloads/58547081d5f0a1a26f167e9bb3a01b2c/thermostats.ipynb @@ -0,0 +1,672 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "\n# Constant-temperature MD and thermostats\n\n:Authors: Michele Ceriotti [@ceriottm](https://github.com/ceriottm/)\n\nThis recipe gives a practical introduction to finite-temperature\nmolecular dynamics simulations, and provides a guide to choose the\nmost appropriate thermostat for the simulation at hand.\n\nAs for other examples in the cookbook, a small simulation of liquid\nwater is used as an archetypal example. Molecular dynamics, sampling,\nand constant-temperature simulations are discussed in much detail in\nthe book \"Understanding Molecular Simulations\" by Daan Frenkel and Berend Smit.\nThis\n[seminal paper by H.C.Andersen](https://doi.org/10.1063/1.439486)\nprovides a good historical introduction to the problem of\nthermostatting, and this\n[PhD thesis](https://www.research-collection.ethz.ch/handle/20.500.11850/152344)\nprovides a more detailed background to several of the techniques\ndiscussed in this recipe.\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "import os" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "import subprocess\nimport time\nimport xml.etree.ElementTree as ET\n\nimport chemiscope\nimport ipi\nimport matplotlib as mpl\nimport matplotlib.pyplot as plt\nimport numpy as np\nfrom ipi.utils.tools.acf_xyz import compute_acf_xyz\nfrom ipi.utils.tools.gle import get_gle_matrices, gle_frequency_kernel, isra_deconvolute" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Constant-temperature sampling of (thermo)dynamics\n\nEven though Hamilton's equations in classical mechanics conserve the total\nenergy of the group of atoms in a simulation, experimental boundary conditions\nusually involve exchange of heat with the surroundings, especially when considering\nthe relatively small supercells that are often used in simulations.\n\nThe goal of a constant-temperature MD simulation is to compute efficiently thermal\naverages of the form $\\langle A(q,p)\\rangle_\\beta$, where the average\nof the observable $A(q,p)$ is\nevaluated over the Boltzmann distribution at inverse temperature\n$\\beta=1/k_\\mathrm{B}T$,\n$P(q,p)=Q^{-1} \\exp(-\\beta(p^2/2m + V(q)))$\nIn all these scenarios, optimizing the simulation involves reducing as much as\npossible the *autocorrelation time* of the observable.\n\nConstant-temperature sampling is also important when one wants to compute\n*dynamical* properties. In principle these would require\nconstant-energy trajectories, as any thermostatting procedure modifies\nthe dynamics of the system. However, the initial conditions\nshould usually be determined from constant-temperature conditions,\naveraging over multiple constant-energy trajectories.\nAs we shall see, this protocol can often be simplified greatly, by choosing\nthermostats that don't interfere with the natural microscopic dynamics.\n\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Running simulations\n\nWe use [i-PI](http://ipi-code.org) together with a ``LAMMPS`` driver to run\nall the simulations in this recipe. The two codes need to be run separately,\nand communicate atomic positions, energy and forces through a socket interface.\n\nThe LAMMPS input defines the parameters of the\n[q-TIP4P/f water model](http://doi.org/10.1063/1.3167790),\nwhile the XML-formatted input of i-PI describes the setup of the\nMD simulation.\n\nWe begin running a constant-energy calculation, that\nwe will use to illustrate the metrics that can be applied to\nassess the performance of a thermostatting scheme. If it is the\nfirst time you see an ``i-PI`` input, you may want to look at\nthe input file side-by-sidewith the\n[input reference](https://docs.ipi-code.org/input-tags.html).\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "# Open and read the XML file\nwith open(\"data/input_nve.xml\", \"r\") as file:\n xml_content = file.read()\nprint(xml_content)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The part of the input that describes the molecular dynamics integrator\nis the ``motion`` class. For this run, it specifies an *NVE* ensemble, and\na ``timestep`` of 1 fs for the integrator.\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "xmlroot = ET.parse(\"data/input_nve.xml\").getroot()\nprint(\" \" + ET.tostring(xmlroot.find(\".//motion\"), encoding=\"unicode\"))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Note that this -- and other runs in this example -- are too short to\nprovide quantitative results, and you may want to increase the\n```` parameter so that the simulation runs for at least\na few tens of ps. The time step of 1 fs is also at the limit of what\nis acceptable for running simulations of water. 0.5 fs would be a\nsafer, stabler value.\n\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "To launch i-PI and LAMMPS from the command line you can just\nexecute the following commands\n\n```bash\ni-pi data/input_nve.xml > log &\nsleep 2\nlmp -in data/in.lmp &\n```\nTo launch the external processes from a Python script\nproceed as follows:\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "ipi_process = None\nif not os.path.exists(\"simulation_nve.out\"):\n ipi_process = subprocess.Popen([\"i-pi\", \"data/input_nve.xml\"])\n time.sleep(4) # wait for i-PI to start\n lmp_process = [subprocess.Popen([\"lmp\", \"-in\", \"data/in.lmp\"]) for i in range(1)]" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "If you run this in a notebook, you can go ahead and start loading\noutput files *before* i-PI and LAMMPS have finished running, by\nskipping this cell\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "if ipi_process is not None:\n ipi_process.wait()\n lmp_process[0].wait()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Analyzing the simulation\n\nAfter the simulation is finished, we can look at the outputs.\nThe outputs include the trajectory of positions, the velocities\nand a number of energetic observables\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "output_data, output_desc = ipi.read_output(\"simulation_nve.out\")\ntraj_data = ipi.read_trajectory(\"simulation_nve.pos_0.xyz\")" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The trajectory shows mostly local vibrations on this short time scale,\nbut if you re-run with a longer ```` settings you should be\nable to observe diffusing molecules in the liquid.\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "chemiscope.show(\n traj_data,\n mode=\"structure\",\n settings=chemiscope.quick_settings(\n trajectory=True, structure_settings={\"unitCell\": True}\n ),\n)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Potential and kinetic energy fluctuate, but the total energy is\n(almost) constant, the small fluctuations being due to integration\nerrors, that are quite large with the long time step used for this\nexample. If you run with smaller ```` values, you should\nsee that the energy conservation condition is fulfilled with higher\naccuracy.\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "fig, ax = plt.subplots(1, 1, figsize=(4, 3), constrained_layout=True)\nax.plot(\n output_data[\"time\"],\n output_data[\"potential\"] - output_data[\"potential\"][0],\n \"b-\",\n label=\"Potential, $V$\",\n)\nax.plot(\n output_data[\"time\"],\n output_data[\"kinetic_md\"],\n \"r-\",\n label=\"Kinetic, $K$\",\n)\nax.plot(\n output_data[\"time\"],\n output_data[\"conserved\"] - output_data[\"conserved\"][0],\n \"k-\",\n label=\"Conserved, $H$\",\n)\nax.set_xlabel(r\"$t$ / ps\")\nax.set_ylabel(r\"energy / eV\")\nax.legend()\nplt.show()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "In a classical MD simulation, based on the momentum $\\mathbf{p}$\nof each atom, it is possible to evaluate its *kinetic temperature\nestimator* $T=\\langle \\mathbf{p}^2/m \\rangle /3k_B$ the average is to\nbe intended over a converged trajectory. Keep in mind that\n\n1. The *instantaneous* value of this estimator is meaningless\n2. It is only well-defined in a constant-temperature simulation, so here\n it only gives a sense of whether atomic momenta are close to what one\n would expect at 300 K.\n\nWith these caveats in mind, we can observe that the simulation has higher\nvelocities than expected at 300 K, and that there is no equipartition, the\nO atoms having on average a higher energy than the H atoms.\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "fig, ax = plt.subplots(1, 1, figsize=(4, 3), constrained_layout=True)\nax.plot(\n output_data[\"time\"],\n output_data[\"temperature(O)\"],\n \"r-\",\n label=\"O atoms\",\n)\nax.plot(\n output_data[\"time\"],\n output_data[\"temperature(H)\"],\n \"c-\",\n label=\"H atoms\",\n)\nax.plot(output_data[\"time\"], output_data[\"temperature\"], \"k-\", label=\"All atoms\")\nax.set_xlabel(r\"$t$ / ps\")\nax.set_ylabel(r\"$\\tilde{T}$ / K\")\nax.legend()\nplt.show()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "In order to investigate the dynamics more carefully, we\ncompute the velocity-velocity autocorrelation function\n$c_{vv}(t)=\\sum_i \\langle \\mathbf{v}_i(t) \\cdot \\mathbf{v}_i(0) \\rangle$.\nWe use a utility function that reads the outputs of ``i-PI``\nand computes both the autocorrelation function and its Fourier\ntransform.\n$c_{vv}(t)$ contains information on the time scale and amplitude\nof molecular motion, and is closely related to the vibrational density\nof states and to spectroscopic observables such as IR and Raman spectra.\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "acf_nve = compute_acf_xyz(\n \"simulation_nve.vel_0.xyz\",\n maximum_lag=600,\n length_zeropadding=2000,\n spectral_windowing=\"cosine-blackman\",\n timestep=1,\n time_units=\"femtosecond\",\n skip=100,\n)\n\nfig, ax = plt.subplots(1, 1, figsize=(4, 3), constrained_layout=True)\nax.plot(\n acf_nve[0][:1200] * 2.4188843e-05, # atomic time to ps\n acf_nve[1][:1200] * 1e5,\n \"r-\",\n)\nax.set_xlabel(r\"$t$ / ps$\")\nax.set_ylabel(r\"$c_{vv}$ / arb. units\")\nplt.show()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The power spectrum (that can be computed as the Fourier transform of\n$c_{vv}$) reveals the frequencies of stretching, bending and libration\nmodes of water; the $\\omega\\rightarrow 0$ limit is proportional\nto the diffusion coefficient.\nWe also load the results from a reference calculation (average of 8\ntrajectories initiated from NVT-equilibrated samples, shown as the\nconfidence interval). You can see how to run these reference calculations\nfrom the script ``data/run_traj.sh``.\nThe differences are due to the short trajectory, and to the fact that the\nNVE trajectory is not equilibrated at 300 K.\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "ha2cm1 = 219474.63\n\n# Loads reference trajectory\nacf_ref = np.loadtxt(\"data/traj-all_facf.data\")\n\nfig, ax = plt.subplots(1, 1, figsize=(4, 3), constrained_layout=True)\n\nax.fill_between(\n acf_ref[:1200, 0] * ha2cm1,\n (acf_ref[:1200, 1] - acf_ref[:1200, 2]) * 1e5,\n (acf_ref[:1200, 1] + acf_ref[:1200, 2]) * 1e5,\n color=\"gray\",\n label=\"reference\",\n)\n\nax.loglog(acf_nve[3][:1200] * ha2cm1, acf_nve[4][:1200] * 1e5, \"r-\", label=\"NVE\")\nax.set_xlabel(r\"$\\omega$ / cm$^{-1}$\")\nax.set_ylabel(r\"$\\hat{c}_{vv}$ / arb. units\")\nax.legend()\nplt.show()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Langevin thermostatting\n\nIn order to perform a simulations that samples configurations\nconsistent with a Boltzmann distribution $e^{-V(x)/k_B T}$\none needs to modify the equations of motion. There are many\ndifferent approaches to do this, some of which lead to deterministic\ndynamics; the two more widely used deterministic thermostats\nare the\n[Berendsen thermostat](https://doi.org/10.1063/1.448118)\nwhich does not sample the Boltzmann distribution exactly and\nshould never be used given the many more rigorous alternatives,\nand the Nos\u00e9-Hoover thermostat, that requires a\n[\"chain\" implementation](https://doi.org/10.1063/1.463940)\nto be ergodic, which amounts essentially to a complicated way\nto generate poor-quality pseudo-random numbers.\n\nGiven the limitations of deterministic thermostats, in this\nrecipe we focus on stochastic thermostats, that model the\ncoupling to the chaotic dynamics of an external bath through\nexplicit random numbers. Langevin dynamics amounts to adding\nto Hamilton's equations of motion, for each degree of freedom,\na term of the form\n\n\\begin{align}\\dot{p} = -\\gamma p + \\sqrt{2\\gamma m k_B T} \\, \\xi(t)\\end{align}\n\nwhere $\n\\gamma$ is a friction coefficient, and $\\xi$\nuncorrelated random numbers that mimic collisions with the bath\nparticles. The friction can be seen as the inverse of a\ncharacteristic *coupling time scale*\n$\\tau=1/\\gamma$ that describes how strongly the bath\ninteracts with the system.\n\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Setting up a thermostat in ``i-PI``\n\nIn order to set up a thermostat in ``i-PI``, one simply needs\nto adjust the ```` block, to perform ``nvt`` dynamics\nand include an appropriate ```` section.\nHere we use a very-strongly coupled Langevin thermostat,\nwith $\\tau=10~fs$.\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "xmlroot = ET.parse(\"data/input_higamma.xml\").getroot()\nprint(\" \" + ET.tostring(xmlroot.find(\".//dynamics\"), encoding=\"unicode\"))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "``i-PI`` and ``LAMMPS`` are launched as above ...\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "ipi_process = None\nif not os.path.exists(\"simulation_higamma.out\"):\n ipi_process = subprocess.Popen([\"i-pi\", \"data/input_higamma.xml\"])\n time.sleep(4) # wait for i-PI to start\n lmp_process = [subprocess.Popen([\"lmp\", \"-in\", \"data/in.lmp\"]) for i in range(1)]" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "... and you should probably wait until they're done,\nit'll take less than a minute.\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "if ipi_process is not None:\n ipi_process.wait()\n lmp_process[0].wait()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Analysis of the trajectory\n\nThe temperature converges very quickly to the target value\n(fluctuations are to be expected, given that as discussed above\nthe temperature estimator is just the instantaneous kinetic energy,\nthat is not constant). There is also equipartition between O and H.\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "output_data, output_desc = ipi.read_output(\"simulation_higamma.out\")\ntraj_data = ipi.read_trajectory(\"simulation_higamma.pos_0.xyz\")\n\nfig, ax = plt.subplots(1, 1, figsize=(4, 3), constrained_layout=True)\nax.plot(\n output_data[\"time\"],\n output_data[\"temperature(O)\"],\n \"r-\",\n label=\"O atoms\",\n)\nax.plot(\n output_data[\"time\"],\n output_data[\"temperature(H)\"],\n \"c-\",\n label=\"H atoms\",\n)\nax.plot(output_data[\"time\"], output_data[\"temperature\"], \"k-\", label=\"All atoms\")\nax.set_xlabel(r\"$t$ / ps\")\nax.set_ylabel(r\"$\\tilde{T}$ / K\")\nax.legend()\nplt.show()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The velocity-velocity correlation function shows how much\nthis thermostat affects the system dynamics. The high-frequency peaks,\ncorresponding to stretches and bending, are\ngreatly broadened, and the $\\omega\\rightarrow 0$\nlimit of $\\hat{c}_{vv}$, corresponding to the\ndiffusion coefficient, is reduced by almost a factor of 5.\nThis last observation highlights that a too-aggressive\nthermostat is not only disrupting the dynamics:\nit also slows down diffusion through phase space,\nmaking the dynamics less efficient at sampling slow,\ncollective motions. We shall see further down various\nmethods to counteract this effect, but in general one should\nuse a weaker coupling, that improves the sampling of configuration\nspace even though it slows down the convergence of the\nkinetic energy. If you want a thermostat that equilibrates\naggressively the temperature while disturbing less the diffusive\nmodes, you may try the *fast-forward Langevin* thermostat\n[(Hijazi et al., JCP (2018))](https://doi.org/10.1063/1.5029833)\nthat can be activated with the option ``mode=\"ffl\"``.\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "# compute the v-v acf\nacf_higamma = compute_acf_xyz(\n \"simulation_higamma.vel_0.xyz\",\n maximum_lag=600,\n length_zeropadding=2000,\n spectral_windowing=\"cosine-blackman\",\n timestep=1,\n time_units=\"femtosecond\",\n skip=100,\n)\n\n# and plot\nfig, ax = plt.subplots(1, 1, figsize=(4, 3), constrained_layout=True)\nax.fill_between(\n acf_ref[:1200, 0] * ha2cm1,\n (acf_ref[:1200, 1] - acf_ref[:1200, 2]) * 1e5,\n (acf_ref[:1200, 1] + acf_ref[:1200, 2]) * 1e5,\n color=\"gray\",\n label=\"reference\",\n)\nax.loglog(\n acf_higamma[3][:1200] * ha2cm1,\n acf_higamma[4][:1200] * 1e5,\n \"b-\",\n label=r\"Langevin, $\\tau=10$fs\",\n)\nax.set_xlabel(r\"$\\omega$ / cm$^{-1}$\")\nax.set_ylabel(r\"$\\hat{c}_{vv}$ / arb. units\")\nax.legend()\nplt.show()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Global thermostats: stochastic velocity rescaling\n\nAn alternative approach to sample the canonical Boltzmann\ndistribution while introducing fewer disturbances to the system\ndynamics is to use a *global* thermostat, i.e. a scheme that\ntargets the *total* kinetic energy of the system, rather than that\nof individual degrees of freedom.\nWe recommend the \"stochastic velocity rescaling\" thermostat\n[(Bussi, Donadio, Parrinello, JCP (2007))](https://doi.org/10.1063/1.2408420)\nthat acts by rescaling the total momentum vector, adding a\nsuitably distributed random noise term.\n\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Setting up a thermostat in ``i-PI``\n\nStochastic velocity rescaling is implemented in ``i-PI``\ncan be selected by setting ``mode=\"svr\"``, and has a\n``tau`` parameter that corresponds to the time scale of the\ncoupling.\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "xmlroot = ET.parse(\"data/input_svr.xml\").getroot()\nprint(\" \" + ET.tostring(xmlroot.find(\".//thermostat\"), encoding=\"unicode\"))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We run a simulation with the usual set up ...\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "ipi_process = None\nif not os.path.exists(\"simulation_svr.out\"):\n ipi_process = subprocess.Popen([\"i-pi\", \"data/input_svr.xml\"])\n time.sleep(4) # wait for i-PI to start\n lmp_process = [subprocess.Popen([\"lmp\", \"-in\", \"data/in.lmp\"]) for i in range(1)]" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "... and wait for it to finish.\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "if ipi_process is not None:\n ipi_process.wait()\n lmp_process[0].wait()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Analysis of the trajectory\n\nThe kinetic temperature of the trajectory equilibrates very\nrapidly to the target value. However, it takes a bit longer\n(approximately 0.5 ps) to reach equipartition between O and H\natoms. This is an important shortcoming of global thermostats:\nsince they only target the total kinetic energy, they must rely\non internal energy redistribution to reach equilibrium between\ndifferent degrees of freedom.\nLiquid water is a very ergodic system, in which all degrees of\nfreedom are strongly coupled, so this is not a major issue. However\ncare must be taken when modeling a quasi-harmonic crystal (e.g.\ndiamond, a metal, or an inorganic crystal), or a molecular system\nin which the coupling between molecules is weaker (e.g. methane,\nor another apolar compound).\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "output_data, output_desc = ipi.read_output(\"simulation_svr.out\")\ntraj_data = ipi.read_trajectory(\"simulation_svr.pos_0.xyz\")\n\nfig, ax = plt.subplots(1, 1, figsize=(4, 3), constrained_layout=True)\nax.plot(\n output_data[\"time\"],\n output_data[\"temperature(O)\"],\n \"r-\",\n label=\"O atoms\",\n)\nax.plot(\n output_data[\"time\"],\n output_data[\"temperature(H)\"],\n \"c-\",\n label=\"H atoms\",\n)\nax.plot(output_data[\"time\"], output_data[\"temperature\"], \"k-\", label=\"All atoms\")\nax.set_xlabel(r\"$t$ / ps\")\nax.set_ylabel(r\"$\\tilde{T}$ / K\")\nax.legend()\nplt.show()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The velocity-velocity autocorrelation function is\nessentially indistinguishable from the reference, computed\nwith an ensemble of NVE trajectories starting from canonical\nsamples. In fact, the small discrepancies are mostly due to\nincomplete convergence of the averages in the short trajectory.\n\nThis highlights the advantages of a global thermostat, that\ndoes not disrupt the natural diffusion in configuration space,\nand can often be used to compute dynamical, time-dependent\nobservables out of a single trajectory -- which is far more\npractical than performing a collection of NVE trajectories.\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "acf_svr = compute_acf_xyz(\n \"simulation_svr.vel_0.xyz\",\n maximum_lag=600,\n length_zeropadding=2000,\n spectral_windowing=\"cosine-blackman\",\n timestep=1,\n time_units=\"femtosecond\",\n skip=100,\n)\n\nfig, ax = plt.subplots(1, 1, figsize=(4, 3), constrained_layout=True)\nax.fill_between(\n acf_ref[:1200, 0] * ha2cm1,\n (acf_ref[:1200, 1] - acf_ref[:1200, 2]) * 1e5,\n (acf_ref[:1200, 1] + acf_ref[:1200, 2]) * 1e5,\n color=\"gray\",\n label=\"reference\",\n)\nax.loglog(\n acf_svr[3][:1200] * ha2cm1,\n acf_svr[4][:1200] * 1e5,\n \"b-\",\n label=r\"SVR, $\\tau=10$fs\",\n)\nax.set_xlabel(r\"$\\omega$ / cm$^{-1}$\")\nax.set_ylabel(r\"$\\hat{c}_{vv}$ / arb. units\")\nax.legend()\nplt.show()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Generalized Langevin Equation thermostat\n\nThe issue with a Langevin thermostat is that, for a given coupling\ntime $\\tau$, only molecular motions with a comparable time scale\nare sampled efficiently: faster modes are *underdamped*, and slower modes\nare *overdamped*, cf. the slowing down of diffusive behavior.\n\nA possible solution to this problem is using a\n*Generalized Langevin Equation (GLE)* thermostat. A GLE\nthermostat uses a matrix generalization of the Langevin term,\nin which the physical momentum is supplemented by a few fictitious\nmomenta $\\mathbf{s}$, i.e.\n\n\\begin{align}(\\dot{p},\\dot{\\mathbf{s}}) = -\\mathbf{A}_p (p,\\mathbf{s})\\\n +\\mathbf{B}_p (\\xi,\\boldsymbol{\\xi})\\end{align}\n\n\nHere $\\mathbf{A}_p$ is the *drift matrix* and $\\mathbf{B}_p$\nis a diffusion matrix which, for canonical sampling, is determined by the target\ntemperature and the drift matrix through a fluctuation-dissipation relation.\nThe key idea is that $\\mathbf{A}_p$ provides a lot of flexibility in defining\nthe behavior of the GLE, that can be tuned to achieve near-optimal sampling\nfor every degree of freedom (effectively acting as if the coupling constant was\ntuned separately for slow and fast molecular motions).\nThe general idea and the practical implementation are discussed in\n[(Ceriotti et al. JCTC (2010))](http://doi.org/10.1021/ct900563s)\nwhich also discusses other applications of the same principle, including\nperforming simulations with a non-equilibrium *quantum thermostat* that\nmimics the quantum the quantum mechanical behavior of light nuclei.\n\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Setting up a thermostat in ``i-PI``\n\nA GLE thermostat can be activated using ``mode=\"gle\"``.\nThe drift matrix used here has been generated from the\n[GLE4MD website](http://gle4md.org), using parameters that\naim for the most efficient sampling possible with the short\nsimulation time (2 ps). The [online generator](https://gle4md.org/index.html?page=matrix&kind=smart&tslow=1&utslow=ps&smrange=6-2&outmode=ipi&aunits=ps)\ncan be tuned to provide the best possible sampling for the system\nof interest, the most important parameter being the slowest time scale\nthat one is interested in sampling (typically a fraction of the total\nsimulation time). The range of frequencies that is optimized can then\nbe tuned so as to reach, roughly, the maximum frequency present in the\nsystem.\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "xmlroot = ET.parse(\"data/input_gle.xml\").getroot()\nprint(\" \" + ET.tostring(xmlroot.find(\".//thermostat\"), encoding=\"unicode\"))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We launch ``i-PI`` as usual ...\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "ipi_process = None\nif not os.path.exists(\"simulation_gle.out\"):\n ipi_process = subprocess.Popen([\"i-pi\", \"data/input_gle.xml\"])\n time.sleep(4) # wait for i-PI to start\n lmp_process = [subprocess.Popen([\"lmp\", \"-in\", \"data/in.lmp\"]) for i in range(1)]" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "... and wait for simulations to finish.\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "if ipi_process is not None:\n ipi_process.wait()\n lmp_process[0].wait()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Analysis of the trajectory\n\nThe kinetic temperature equilibrates quickly to the target value.\nSince the GLE is a local thermostat, targeting each degree of freedom\nseparately, equipartition is also reached quickly. Sampling is less\nfast than with an aggressive Langevin thermostat, because the GLE targets\neach vibrational frequency separately, to minimize the impact on diffusion.\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "output_data, output_desc = ipi.read_output(\"simulation_gle.out\")\ntraj_data = ipi.read_trajectory(\"simulation_gle.pos_0.xyz\")\n\nfig, ax = plt.subplots(1, 1, figsize=(4, 3), constrained_layout=True)\nax.plot(\n output_data[\"time\"],\n output_data[\"temperature(O)\"],\n \"r-\",\n label=\"O atoms\",\n)\nax.plot(\n output_data[\"time\"],\n output_data[\"temperature(H)\"],\n \"c-\",\n label=\"H atoms\",\n)\nax.plot(output_data[\"time\"], output_data[\"temperature\"], \"k-\", label=\"All atoms\")\nax.set_xlabel(r\"$t$ / ps\")\nax.set_ylabel(r\"$\\tilde{T}$ / K\")\nax.legend()\nplt.show()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$\\hat{c}_{vv}$ reflects the adaptive behavior of the GLE.\nThe fast modes are damped aggressively, leading to a large\nbroadening of the high frequency peaks, but librations and diffusive\nmodes are much less dampened than in the high-coupling Langevin case.\nAn optimal-coupling GLE is a safe choice to sample any system, from\nmolecular liquids to harmonic crystals, although a stochastic velocity\nrescaling is preferable if one is interested in preserving the natural\ndynamics.\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "acf_gle = compute_acf_xyz(\n \"simulation_gle.vel_0.xyz\",\n maximum_lag=600,\n length_zeropadding=2000,\n spectral_windowing=\"cosine-blackman\",\n timestep=1,\n time_units=\"femtosecond\",\n skip=100,\n)\n\nfig, ax = plt.subplots(1, 1, figsize=(4, 3), constrained_layout=True)\nax.fill_between(\n acf_ref[:1200, 0] * ha2cm1,\n (acf_ref[:1200, 1] - acf_ref[:1200, 2]) * 1e5,\n (acf_ref[:1200, 1] + acf_ref[:1200, 2]) * 1e5,\n color=\"gray\",\n label=\"reference\",\n)\nax.loglog(\n acf_gle[3][:1200] * ha2cm1,\n acf_gle[4][:1200] * 1e5,\n \"b-\",\n label=r\"GLE\",\n)\nax.set_xlabel(r\"$\\omega$ / cm$^{-1}$\")\nax.set_ylabel(r\"$\\hat{c}_{vv}$ / arb. units\")\nax.legend()\nplt.show()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### R-L purification\n\nWhat if you also want to extract dynamical information from a GLE\n(or Langevin) trajectory? It is actually possible to post-process the\npower spectrum, performing a deconvolution based on the amount of\ndisturbance introduced by the GLE, that can be predicted analytically\nin the harmonic limit.\nThe idea, discussed in [(Rossi et al., JCP (2018))](http://doi.org/10.1063/1.499053610.1063/1.4990536)\nis that if $\\hat{y}(\\omega)$ is the \"natural\" NVE power\nspectrum, and $k_{\\mathrm{GLE}}(\\omega_0, \\omega)$ is the power\nspectrum predicted for a harmonic oscillator of frequency $\\omega_0$,\nthen the spectrum from the GLE dynamics will be approximately\n\n\\begin{align}\\hat{y}_{\\mathrm{GLE}}(\\omega) = \\int \\mathrm{d}\\omega'\n k_{\\mathrm{GLE}}(\\omega', \\omega) \\hat{y}(\\omega')\\end{align}\n\nThe kernel can be computed analytically for all frequencies that\nare relevant for the power spectrum, based on the GLE parameters\nextracted from the input of ``i-PI``.\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "n_omega = 1200\nAp, Cp, Dp = get_gle_matrices(\"data/input_gle.xml\")\ngle_kernel = gle_frequency_kernel(acf_gle[3][:n_omega], Ap, Dp)\n\n\nlomega = acf_gle[3][:n_omega] * ha2cm1\nfig, ax = plt.subplots(1, 1, figsize=(4, 3), constrained_layout=True)\nlevels = np.logspace(np.log10(gle_kernel.min()), np.log10(gle_kernel.max()), num=50)\ncontour = ax.contourf(lomega, lomega, gle_kernel, norm=mpl.colors.LogNorm())\nax.set_xscale(\"log\")\nax.set_yscale(\"log\")\nax.set_xlabel(r\"$\\omega_0$ / cm$^{-1}$\")\nax.set_ylabel(r\"$\\omega$ / cm$^{-1}$\")\nax.set_xlim(10, 5000)\nax.set_ylim(10, 5000)\ncbar = fig.colorbar(contour, ticks=[1e1, 1e3, 1e5, 1e7])" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The deconvolution is based on the Iterative Image Space\nReconstruction Algorithm, which preserves the positive-definiteness\nof the spectrum\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "isra_acf, history, errors, laplace = isra_deconvolute(\n acf_gle[3][:n_omega], acf_gle[4][:n_omega], gle_kernel, 64, 4\n)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Even though the ISRA algorithm is less prone to enhancing noise than\nother deconvolution algorithms, successive iterations sharpen the spectrum\nbut introduce higher and higher levles of noise, particularly on the\nlow-frequency end of the spectrum so one has to choose when to stop.\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "fig, ax = plt.subplots(1, 1, figsize=(4, 3), constrained_layout=True)\nax.loglog(\n acf_gle[3][:1200] * ha2cm1,\n acf_gle[4][:1200] * 1e5,\n \"b-\",\n label=r\"GLE\",\n)\nax.loglog(\n acf_gle[3][:1200] * ha2cm1,\n history[0] * 1e5,\n \":\",\n color=\"#4000D0\",\n label=r\"iter[1]\",\n)\nax.loglog(\n acf_gle[3][:1200] * ha2cm1,\n history[2] * 1e5,\n \":\",\n color=\"#A000A0\",\n label=r\"iter[9]\",\n)\nax.loglog(\n acf_gle[3][:1200] * ha2cm1,\n history[4] * 1e5,\n \":\",\n color=\"#D00040\",\n label=r\"iter[17]\",\n)\nax.loglog(\n acf_gle[3][:1200] * ha2cm1,\n history[12] * 1e5,\n \":\",\n color=\"#FF0000\",\n label=r\"iter[49]\",\n)\n\nax.set_xlabel(r\"$\\omega$ / cm$^{-1}$\")\nax.set_ylabel(r\"$\\hat{c}_{vv}$ / arb. units\")\nax.legend()\nplt.show()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Especially in the high-frequency region, the deconvolution\nalgorithm succees in recovering the underlying NVE dynamics,\nwhich can be useful whenever one wants to optimize statistical\nefficiency while still being able to estimate dynamical\nproperties.\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "fig, ax = plt.subplots(1, 1, figsize=(4, 3), constrained_layout=True)\nax.fill_between(\n acf_ref[:1200, 0] * ha2cm1,\n (acf_ref[:1200, 1] - acf_ref[:1200, 2]) * 1e5,\n (acf_ref[:1200, 1] + acf_ref[:1200, 2]) * 1e5,\n color=\"gray\",\n label=\"reference\",\n)\nax.loglog(\n acf_gle[3][:1200] * ha2cm1,\n acf_gle[4][:1200] * 1e5,\n \"b-\",\n label=r\"GLE\",\n)\nax.loglog(\n acf_gle[3][:1200] * ha2cm1,\n history[2] * 1e5,\n \"r-\",\n label=r\"GLE$\\rightarrow$ NVE (iter[5])\",\n)\nax.set_xlabel(r\"$\\omega$ / cm$^{-1}$\")\nax.set_ylabel(r\"$\\hat{c}_{vv}$ / arb. units\")\nax.legend()\nplt.show()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Running with LAMMPS\n\nGLE thermostats (as well as conventional Langevin, and\nstochastic velocity rescaling) are also implemented natively\nin ``LAMMPS``.\n\nAn example of ``LAMMPS`` input containing a GLE thermostat can\nbe found in ``data/gle.lmp``. See also the\n[documentation of the fix gle command](https://docs.lammps.org/fix_gle.html)\n\n```text\nfix 1 all gle 6 300 300 31415 data/smart.A\n```\nThe drift matrix can be obtained from the same website, simply\nasking to output the matrix in raw format, choosing units consistent\nwith the ``LAMMPS`` settings, e.g. for this [optimal sampling setup](https://gle4md.org/index.html?page=matrix&kind=smart&tslow=1&utslow=ps&smrange=6-2&outmode=raw&aunits=fs)\n\n\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We can run ``LAMMPS`` from the command line\n\n```bash\nlmp -in data/gle.lmp &\n```\nor from Python\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "lmp_process = None\nif not os.path.exists(\"lammps_out.dat\"):\n lmp_process = subprocess.Popen([\"lmp\", \"-in\", \"data/gle.lmp\"])" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "... and wait\n\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "if lmp_process is not None:\n lmp_process.wait()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The simulation is much faster (for such a small system and\ncheap potential the overhead of ``i-PI``'s client-server mechanism\nis substantial) and leads to similar results for the kinetic temperature\n\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "traj_data = np.loadtxt(\"lammps_out.dat\")\n\nfig, ax = plt.subplots(1, 1, figsize=(4, 3), constrained_layout=True)\nax.plot(\n traj_data[:, 0] * 1e-3,\n traj_data[:, 1],\n \"k-\",\n label=\"All atoms\",\n)\nax.set_xlabel(r\"$t$ / ps\")\nax.set_ylabel(r\"$\\tilde{T}$ / K\")\nax.legend()\nplt.show()" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.11.10" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} \ No newline at end of file diff --git a/_downloads/58f311a250ec4f9cd7abf17b492ae2f6/pi-metad.py b/_downloads/58f311a250ec4f9cd7abf17b492ae2f6/pi-metad.py new file mode 100644 index 00000000..52a17382 --- /dev/null +++ b/_downloads/58f311a250ec4f9cd7abf17b492ae2f6/pi-metad.py @@ -0,0 +1,783 @@ +r""" +Path integral metadynamics +========================== + +:Authors: Michele Ceriotti `@ceriottm `_ + +This example shows how to run a free-energy sampling calculation that +combines path integral molecular dynamics to model nuclear quantum effects +and metadynamics to accelerate sampling of the high-free-energy regions. + +The rather complicated setup combines `i-PI `_ +to perform path integral +MD, its built-in driver to compute energy and forces for the Zundel +:math:`\mathrm{H_5O_2^+}` cation, and `PLUMED `_ +to perform metadynamics. +If you want to see an example in a more realistic scenario, you can look at +`this paper (Rossi et al., JCTC (2020)) +`_, +in which this +methodology is used to simulate the decomposition of methanesulphonic +acid in a solution of phenol and hydrogen peroxide. + +Note also that, in order to keep the execution time of this example as +low as possible, several parameters are set to values that would not be +suitable for an accurate, converged simulation. +They will be highlighted and more reasonable values will be provided. +"High-quality" runs can also be realized substituting the input files +used in this example with those labeled with the ``_hiq`` suffix, that +are also provided in the ``data/`` folder. +""" + +# %% + +import bz2 +import os +import subprocess +import time +import xml.etree.ElementTree as ET + +import ase +import ase.io +import chemiscope +import ipi +import matplotlib.pyplot as plt +import numpy as np + + +# %% +# Metadynamics for the Zundel cation +# ---------------------------------- +# +# Metadynamics is a method to accelerate sampling of rare events - microscopic processes +# that are too infrequent to be observed over the time scale (ns-µs) accessible to +# molecular dynamics simulations. You can read one of the many excellent reviews +# on metadynamics (see e.g. +# `Bussi and Branduardi (2015) `_), +# or follow a +# `lecture from the PLUMED masterclass +# `_. +# In short, during a metadynamics simulation an adaptive biasing potential is +# built as a superimposition of Gaussians centered over configurations that have +# been previously visited by the trajectory. This discourages the system from remaining +# in high-probability configurations and accelerates sampling of free-energy barriers. +# +# .. figure:: metad-scheme.png +# :align: center +# :width: 600px +# +# A schematic representation of how metadynamics work by adaptively building +# a repulsive bias based on the trajectory of a molecule, compensating for +# low-energy regions in the free energy surface. +# +# Crucially, the bias is *not* built relative to the Cartesian coordinates of the atoms, +# but relative to a lower-dimensional description of the system (so-called collective +# variables) that are suited to describe the processes being studied. + +# %% +# +# The Zundel cation :math:`\mathrm{H_5O_2^+}` is one of the limiting +# structures of the solvated proton, and in the gas phase leads to a +# stable structure, with the additional proton shared between two water +# molecules (see the structure below). +# We will use a potential fitted on high-end quantum-chemistry calculations +# `Huang et al. (2005) `_ to compute energy +# and forces acting on the atoms. + +zundel = ase.io.read("data/h5o2+.xyz", ":") +chemiscope.show(frames=zundel, mode="structure") + +# %% +# +# As the two water molecules are separated, the proton remains attached +# to one of the two, effectively leading to a dissociated +# :math:`\mathrm{H_2O+H_3O^+}` configuration. Thus, two natural +# coordinates to describe the physics of this system are the distance +# between the O atoms, and the difference in coordination number of +# the two O atoms, which is 0 for a shared proton and ±1 for the +# dissociated system. + +# %% +# Running metadynamics calculations with ``i-PI`` and ``PLUMED`` +# -------------------------------------------------------------- +# +# The client-server architecture `i-PI `_ is based on makes it easy +# to combine multiple programs to realize complicated simulation workflows. +# In this case we will use an implementation of the Zundel potential in a simple +# driver code that is available in the i-PI repository, and use +# `PLUMED `_ to compute collective variables and build +# the adaptive bias. We will then perform some post-processing to +# estimate the free energy. + + +# %% +# Installing the Python driver +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# i-PI comes with a FORTRAN driver, which however has to be installed +# from source. We use a utility function to compile it. Note that this requires +# a functioning build system with `gfortran` and `make`. + +ipi.install_driver() + +# %% +# Defining the molecular dynamics setup +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# The `input-md.xml` file defines the way the MD simulation is performed. + +xmlroot = ET.parse("data/input-md.xml").getroot() + +# %% +# The `` block describe the way communication will occur with the +# driver code + +print(" " + ET.tostring(xmlroot.find("ffsocket"), encoding="unicode")) + +# %% +# ... and the `` section describes the MD setup. +# This is a relatively standard NVT setup, with an efficient +# generalized Langevin equation thermostat (important to +# compensate for the non-equilibrium nature of metadynamics). +# Note that the time step is rather long (the recommended value for +# aqueous systems is around 0.5 fs). This is done to improve +# efficiency for this example, but you should check if it +# affects results in a realistic scenario. + +print(" " + ET.tostring(xmlroot.find(".//motion"), encoding="unicode")) + +# %% +# The metadynamics setup requires three ingredients: +# a `` forcefield that defines what input to use +# (more on that later) and the file from which to initialize +# the structural information (number of atoms, ...); +# `` is an advanced feature, available from +# PLUMED 2.10, that allows extracting internal variables +# from plumed and integrate them into the outputs of +# i-PI. + +print(" " + ET.tostring(xmlroot.find("ffplumed"), encoding="unicode")) + +# %% +# The `` section contains a `` key that +# specifies that energy and forces from PLUMED should be +# treated as a bias (so that e.g. are not included in the +# potential, even though they're used to propagate the +# trajectory). + +print(" " + ET.tostring(xmlroot.find(".//ensemble"), encoding="unicode")) + +# The `` section contains a `` class that +# instructs i-PI to call the PLUMED action that adds hills +# along the trajectory. + +print(" " + ET.tostring(xmlroot.find("smotion"), encoding="unicode")) + + +# %% +# CVs and metadynamics +# ~~~~~~~~~~~~~~~~~~~~ +# +# The calculation of the collective variables and the +# metadynamics bias is delegated to PLUMED, and controlled by +# a separate `plumed-md.dat` input file. +# Without going in detail into the syntax, one can recognize the +# calculation of the distance between the O atoms `doo`, +# the coordination of the two oxygens `co1` and `co2`, +# and the difference between the two, `dc`. +# The `METAD` action specifies the CVs to be used, the pace of +# hill depositon (which is way too frequent here, but suitable for +# this example), the width along the two CVs and the initial +# height of the repulsive Gaussians (which are both too large to +# guarantee high resolution in CV and energy). The `BIASFACTOR` keyword specifies +# that the height of the hills will be progressively reduced +# according to the "well-tempered metadynamics" protocol, see +# `Barducci et al., Phys. Rev. Lett. (2008) +# `_. +# A repulsive static bias (`UPPER_WALLS`) prevents complete dissociation of the +# cation by limiting the range of the O-O distance. + +with open("data/plumed-md.dat", "r") as file: + plumed_dat = file.read() +print(plumed_dat) + +# %% +# Running the simulations +# ~~~~~~~~~~~~~~~~~~~~~~~ +# +# Now we can launch the actual calculations. On the the command line, +# this requires launching i-PI first, and then the built-in driver, +# specifying the appropriate communication mode, and the `zundel` potential. +# PLUMED is called from within i-PI as a library, so there is no need to +# launch a separate process. Note that the Zundel potential requires some data +# files, with a hard-coded location in the current working directory, +# which is why the driver should be run from within the ``data/`` folder. +# +# .. code-block:: bash +# +# i-pi data/input-md.xml > log & +# sleep 2 +# cd data; i-pi-driver -u -a zundel -m zundel +# +# The same can be achieved from Python using ``subprocess.Popen`` + +ipi_process = None +if not os.path.exists("meta-md.out"): + # don't rerun if the outputs already exist + ipi_process = subprocess.Popen(["i-pi", "data/input-md.xml"]) + time.sleep(2) # wait for i-PI to start + driver_process = [ + subprocess.Popen( + ["i-pi-driver", "-u", "-a", "zundel", "-m", "zundel"], cwd="data/" + ) + for i in range(1) + ] + +# %% +# If you run this in a notebook, you can go ahead and start loading +# output files *before* i-PI has finished running by skipping this cell + +# wait for simulations to finish +if ipi_process is not None: + ipi_process.wait() + for process in driver_process: + process.wait() + +# %% +# Trajectory post-processing +# ~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# We can now post-process the simulation to see metadynamics in action. +# +# First, we read the trajectory outputs. Note that these have all been +# printed with the same stride + +output_data, output_desc = ipi.read_output("meta-md.out") +colvar_data = ipi.read_trajectory("meta-md.colvar_0", format="extras")[ + "doo,dc,mtd.bias" +] +traj_data = ipi.read_trajectory("meta-md.pos_0.xyz") + +# %% +# then, assemble a visualization +chemiscope.show( + frames=traj_data, + properties=dict( + d_OO=10 * colvar_data[:, 0], # nm to Å + delta_coord=colvar_data[:, 1], + bias=27.211386 * output_data["ensemble_bias"], # Ha to eV + time=2.4188843e-05 * output_data["time"], # atomictime to ps + ), # attime to ps + settings=chemiscope.quick_settings( + x="d_OO", y="delta_coord", z="bias", color="time", trajectory=True + ), + mode="default", +) + + +# %% +# The visualization above shows how the growing metadynamics bias pushes +# progressively the atoms towards geometries with larger O-O separations, +# and that for these distorted configurations the proton is not shared +# symmetrically between the O atoms, but is preferentially attached to +# one of the two water molecules. + +# %% +# Trajectory diagnostics +# ...................... +# +# The time history of the bias is instructive, as it shows how the +# bias grows until the trajectory gets pushed in a new region (where the +# bias is zero) and then grows again. The envelope of the bias increase +# slows down over time, because the "well-tempered" deposition strategy +# reduces the height of the hills deposited in high-bias regions. +# +# Note that the potential energy has fluctuations that are larger than +# the magnitude of the bias, although it shows a tendency to reach higher +# values as the simulation progresses. This is because only two degrees +# of freedom are affected by the bias, while all degrees of freedom +# undergo thermal fluctuations, which are dominant even for this +# small system. + + +fig, ax = plt.subplots(1, 1, figsize=(4, 3), constrained_layout=True) + +ax.plot( + 2.4188843e-05 * output_data["time"], + 27.211386 * output_data["potential"], + "r", + label="potential", +) +ax.plot( + 2.4188843e-05 * output_data["time"], + 27.211386 * output_data["ensemble_bias"], + "b", + label="bias", +) + +ax.set_xlabel(r"$t$ / ps") +ax.set_ylabel(r"energy / eV") +ax.legend(loc="upper left", ncols=1) +plt.show() + +# %% +# +# It's important to keep in mind that the growing metadynamics bias can +# lead to deviations from the quasi-equilibrium sampling that is necessary +# to recover the correct properties of the rare event. It is not easy +# to verify this condition, but one simple diagnostics that can highlight +# the most evident problems is looking at the kinetic temperature of different +# portions of the system, computing a moving average to have a clearer signal. + + +def moving_average(arr, window_size): + # Create a window of the specified size with equal weights + window = np.ones(window_size) / window_size + # Use the 'valid' mode to only return elements where the window fully + # overlaps with the data + return np.convolve(arr, window, mode="valid") + + +fig, ax = plt.subplots(1, 1, figsize=(4, 3), constrained_layout=True) + +ax.plot( + 2.4188843e-05 * output_data["time"][50:-49], + moving_average(output_data["temperature(O)"], 100), + "r", + label=r"$T_\mathrm{O}$", +) +ax.plot( + 2.4188843e-05 * output_data["time"][50:-49], + moving_average(output_data["temperature(H)"], 100), + "gray", + label=r"$T_\mathrm{H}$", +) +ax.plot( + 2.4188843e-05 * output_data["time"][50:-49], + moving_average(output_data["temperature"], 100), + "b", + label="T", +) + +ax.set_xlabel(r"$t$ / ps") +ax.set_ylabel(r"temperature / K") +ax.legend(loc="upper left", ncols=2) +plt.show() + +# %% +# It is clear that the very high rate of biasing used in this demonstrative +# example leads to a temperature that is consistently higher than the target, +# with spikes up to 380 K and O and H atoms reaching different temperatures +# (i.e. equipartition is broken). While this does not affect the qualitative +# nature of the results, these parameters are unsuitable for a production run. +# NB: especially for small systems, the instantaneous kinetic temperature +# can deviate by a large amount from the target temperature: only the mean +# value has actual meaning. However, a kinetic temperature that is consistently +# above the target value indicates that the thermostat cannot dissipate +# efficiently the energy due to the growing bias. + +# %% +# Free energy profiles +# .................... +# +# One of the advantages of metadynamics is that it allows one to easily +# estimate the free-energy associated with the collective variables +# that are used to accelerate sampling by summing the repulsive hills +# that have been deposited during the run and taking the negative of +# the total bias at the end of the trajectory. +# +# Even though more sophisticated strategies exist that provide explicit +# weighting factors to estimate the unbiased Boltzmann distribution +# (see e.g. +# `Giberti et al., JCTC 2020 +# `_), +# this simple approach is good enough for this example, and can be +# realized as a post-processing step using the ``plumed sum_hills`` module, +# that also applies a (simple) correction to the negative bias that +# is needed when using the well-tempered bias scaling protocol. +# On the command line, +# +# .. code-block:: bash +# +# plumed sum_hills --hills HILLS-md --min 0.21,-1 --max 0.31,1 --bin 100,100 \ +# --outfile FES-md --stride 100 --mintozero < data/plumed-md.dat +# +# The ``--stride`` option generates a series of files showing the estimates +# of :math:`F` at different times along the trajectory. + +with open("data/plumed-md.dat", "r") as file: + subprocess.run( + [ + "plumed", + "sum_hills", + "--hills", + "HILLS-md", + "--min", + "0.21,-1", + "--max", + "0.31,1", + "--bin", + "100,100", + "--outfile", + "FES-md", + "--stride", + "100", + "--mintozero", + ], + stdin=file, + text=True, + ) + +# rearrange data and converts to Å and eV +data = np.loadtxt("FES-md0.dat", comments="#")[:, :3] +xyz_0 = np.array([10, 1, 0.01036427])[:, np.newaxis, np.newaxis] * data.T.reshape( + 3, 101, 101 +) +data = np.loadtxt("FES-md2.dat", comments="#")[:, :3] +xyz_2 = np.array([10, 1, 0.01036427])[:, np.newaxis, np.newaxis] * data.T.reshape( + 3, 101, 101 +) +data = np.loadtxt("FES-md5.dat", comments="#")[:, :3] +xyz_5 = np.array([10, 1, 0.01036427])[:, np.newaxis, np.newaxis] * data.T.reshape( + 3, 101, 101 +) + +# %% +# The plots show, left-to-right, the accumulation of the +# metadynamics bias as simulation progresses. + +fig, ax = plt.subplots( + 1, 3, figsize=(8, 3), sharex=True, sharey=True, constrained_layout=True +) + +cf_0 = ax[0].contourf(*xyz_0) +cf_1 = ax[1].contourf(*xyz_2) +cf_2 = ax[2].contourf(*xyz_5) +fig.colorbar(cf_2, ax=ax, orientation="vertical", label=r"$F$ / eV") +ax[0].set_ylabel(r"$\Delta C_\mathrm{H}$") +ax[0].set_xlabel(r"$d_\mathrm{OO}$ / Å") +ax[1].set_xlabel(r"$d_\mathrm{OO}$ / Å") +ax[2].set_xlabel(r"$d_\mathrm{OO}$ / Å") +ax[0].set_title(r"$t=0.8$ ps") +ax[1].set_title(r"$t=2.5$ ps") +ax[2].set_title(r"$t=5.0$ ps") +plt.show() + +# %% +# Biasing a path integral calculation +# ----------------------------------- +# +# You can see `this recipe +# `_ +# for a brief introduction to path integral simulations with `i-PI`. +# From a practical perspective, very little needs to change with respect +# to the classical case. + +xmlroot = ET.parse("data/input-pimd.xml").getroot() + +# %% +# The `nbeads` option determines the number of path integral +# replicas. The value of 8 used here is not sufficient to converge +# quantum statistics at 300 K (a more typical value would be +# around 32). There are methods to reduce the number of replicas +# needed for convergence, see e.g. +# `Ceriotti and Markland, Nat. Rev. Chem. (2018) +# `_ +# but we keep it simple here. + +print(" " + ET.tostring(xmlroot.find(".//initialize"), encoding="unicode")[:23]) + +# %% +# Centroid bias +# ~~~~~~~~~~~~~ +# +# Another detail worth discussing is that the metadynamics bias +# is computed exclusively on the *centroid*, the mean position of +# the ring-polymer beads. This is an extreme form of +# ring polymer contraction +# `(Markland and Manolopoulos, J. Chem. Phys. (2008) +# `_ +# that avoids computing for each replica the slowly-varying +# parts of the potential, but is not applied for computational +# savings. When performing a quantum free-energy calculation it +# is important to distinguish between the free-energy computed +# as the logarithm of the probability of observing a given +# configuration (that depends on the distribution of the +# replicas) and the free-energy taken as a tool to estimate +# reaction rates :math:`k` in a transition-state theory +# fashion :math:`k\propto e^{-\Delta E^\ddagger/kT}`, +# where the energy barrier :math:`\Delta E^\ddagger` +# is better estimated from the distribution of the centroid. +# See e.g. +# `Habershon et al., Annu. Rev. Phys. Chem. (2013) +# `_ +# for a discussion of the subtleties involved in estimating +# transition rates. +# In practice, performing this contraction step is very easy +# in `i-PI`, because for each `` section - including +# that corresponding to the bias - it is possible to specify +# a different number of replicas. The configurations will +# be automatically computed by Fourier interpolation. + +print(" " + ET.tostring(xmlroot.find(".//bias"), encoding="unicode")) + +# %% +# Running the calculation +# ~~~~~~~~~~~~~~~~~~~~~~~ +# +# The other changes are purely cosmetic, and the calculation +# can be launched very easily, using several drivers to parallelize +# the energy evaluation over the beads (although this kind of calculations +# is not limited by the evaluation of the forces). + +# don't rerun if the outputs already exist +ipi_process = None +if not os.path.exists("meta-pimd.out"): + ipi_process = subprocess.Popen(["i-pi", "data/input-pimd.xml"]) + time.sleep(2) # wait for i-PI to start + driver_process = [ + subprocess.Popen( + ["i-pi-driver", "-u", "-a", "zundel", "-m", "zundel"], cwd="data/" + ) + for i in range(4) + ] + +# %% +# +# If you run this in a notebook, you can go ahead and start loading +# output files _before_ i-PI has finished running by skipping this cell + +# wait for simulations to finish +if ipi_process is not None: + ipi_process.wait() + for process in driver_process: + process.wait() + +# %% +# Analysis of the simulation +# ~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# A path integral simulation evolves multiple configurations at the same +# time, forming a `ring polymer`. Each replica provides a sample of the +# quantum mechanical configuration distribution of the atoms. To provide +# an overall visualization of the path integral dynamics, we load all the +# replicas and combine them using a utility function from the +# `chemiscope` library.` + + +output_data, output_desc = ipi.read_output("meta-pimd.out") +colvar_data = ipi.read_trajectory("meta-pimd.colvar_0", format="extras")[ + "doo,dc,mtd.bias" +] +pimd_traj_data = [ipi.read_trajectory(f"meta-pimd.pos_{i}.xyz") for i in range(8)] + +# combines the PI beads and sets up the visualization options +traj_pimd = chemiscope.ase_merge_pi_frames(pimd_traj_data) +traj_pimd["shapes"]["paths"]["parameters"]["global"]["radius"] = 0.05 +traj_pimd["properties"] = dict( + d_OO=10 * colvar_data[:, 0], # nm to Å + delta_coord=colvar_data[:, 1], + bias=27.211386 * output_data["ensemble_bias"], # Ha to eV + time=2.4188843e-05 * output_data["time"], +) +traj_pimd["settings"] = chemiscope.quick_settings( + x="d_OO", + y="delta_coord", + z="bias", + color="time", + trajectory=True, + structure_settings=dict( + bonds=False, + atoms=False, + keepOrientation=True, + unitCell=False, + shape=[ + "paths", + ], + ), +) +traj_pimd["settings"]["target"] = "structure" + +# %% +# +# Visualize the trajectory. Note the similar behavior as for the classical +# trajectory, and the delocalization of the protons + +chemiscope.show(**traj_pimd) + + +# %% +# Free energy plots +# ~~~~~~~~~~~~~~~~~ +# +# The free energy profiles relative to :math:`\Delta C_\mathrm{H}` +# and :math:`d_\mathrm{OO}` can be computed exactly as for the +# classical trajectory, using the `sum_hills` module. + +with open("data/plumed-pimd.dat", "r") as file: + subprocess.run( + [ + "plumed", + "sum_hills", + "--hills", + "HILLS-pimd", + "--min", + "0.21,-1", + "--max", + "0.31,1", + "--bin", + "100,100", + "--outfile", + "FES-pimd", + "--stride", + "100", + "--mintozero", + ], + stdin=file, + text=True, + ) + +# rearrange data and converts to Å and eV +data = np.loadtxt("FES-pimd0.dat", comments="#")[:, :3] +xyz_pi_0 = np.array([10, 1, 0.01036427])[:, np.newaxis, np.newaxis] * data.T.reshape( + 3, 101, 101 +) +data = np.loadtxt("FES-pimd2.dat", comments="#")[:, :3] +xyz_pi_2 = np.array([10, 1, 0.01036427])[:, np.newaxis, np.newaxis] * data.T.reshape( + 3, 101, 101 +) +data = np.loadtxt("FES-pimd5.dat", comments="#")[:, :3] +xyz_pi_5 = np.array([10, 1, 0.01036427])[:, np.newaxis, np.newaxis] * data.T.reshape( + 3, 101, 101 +) + +# %% +# Just as for a classical run, the metadynamics bias progressively +# pushes the centroid (and the beads that are distributed around it) +# to sample a wider portion of the collective-variable space. + +fig, ax = plt.subplots( + 1, 3, figsize=(8, 3), sharex=True, sharey=True, constrained_layout=True +) + +cf_0 = ax[0].contourf(*xyz_pi_0) +cf_1 = ax[1].contourf(*xyz_pi_2) +cf_2 = ax[2].contourf(*xyz_pi_5) +fig.colorbar(cf_2, ax=ax, orientation="vertical", label=r"$F$ / eV") +ax[0].set_ylabel(r"$\Delta C_\mathrm{H}$") +ax[0].set_xlabel(r"$d_\mathrm{OO}$ / Å") +ax[1].set_xlabel(r"$d_\mathrm{OO}$ / Å") +ax[2].set_xlabel(r"$d_\mathrm{OO}$ / Å") +ax[0].set_title(r"$t=0.8$ ps") +ax[1].set_title(r"$t=2.5$ ps") +ax[2].set_title(r"$t=5.0$ ps") +plt.show() + +# %% +# Assessing quantum nuclear effects +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# The effect of nuclear quantization on the centroid free-energy +# is relatively small, despite the large delocalization of the +# protons in the PIMD calculation. Looking more +# carefully at the two distributions, one can notice that +# in the high-:math:`d_\mathrm{OO}` region there is higher +# delocalisation of the proton. + +fig, ax = plt.subplots( + 1, 1, figsize=(4, 3), sharex=True, sharey=True, constrained_layout=True +) + +levels = np.linspace(0, 0.5, 6) +cp1 = ax.contour(*xyz_5, colors="b", levels=levels) +cp2 = ax.contour(*xyz_pi_5, colors="r", levels=levels) +ax.set_ylabel(r"$\Delta C_\mathrm{H}$") +ax.set_xlabel(r"$d_\mathrm{OO}$ / Å") +ax.legend( + handles=[ + plt.Line2D([0], [0], color="b", label="MD"), + plt.Line2D([0], [0], color="r", label="PIMD"), + ] +) +plt.show() + +# %% +# +# To get a clear signal, we need better-converged calculations; +# the `data/` folder contains inputs for these "high quality" runs, +# and free-energies obtained from them. +# The results confirm the lowering of the free-energy barrier for +# the :math:`\mathrm{H_3O^+ + H_2O} \rightarrow \mathrm{H_2O + H_3O^+}` +# transition. + +with bz2.open("data/FES-md_hiq.bz2", "rt") as f: + data = np.loadtxt(f, comments="#")[:, :3] +xyz_md_hiq = np.array([10, 1, 0.01036427])[:, np.newaxis, np.newaxis] * data.T.reshape( + 3, 101, 101 +) +with bz2.open("data/FES-pimd_hiq.bz2", "rt") as f: + data = np.loadtxt(f, comments="#")[:, :3] +xyz_pi_hiq = np.array([10, 1, 0.01036427])[:, np.newaxis, np.newaxis] * data.T.reshape( + 3, 101, 101 +) + +fig, ax = plt.subplots( + 1, 1, figsize=(4, 3), sharex=True, sharey=True, constrained_layout=True +) + +levels = np.linspace(0, 0.5, 6) +cp1 = ax.contour(*xyz_md_hiq, colors="b", levels=levels) +cp2 = ax.contour(*xyz_pi_hiq, colors="r", levels=levels) +ax.set_ylabel(r"$\Delta C_\mathrm{H}$") +ax.set_xlabel(r"$d_\mathrm{OO}$ / Å") +ax.legend( + handles=[ + plt.Line2D([0], [0], color="b", label="MD"), + plt.Line2D([0], [0], color="r", label="PIMD"), + ] +) +plt.show() + +# %% +# +# The lowering of the barrier for proton hopping is clearly +# seen by taking 1D slices of the free energy at different O-O separations. + +fig, ax = plt.subplots( + 1, 1, figsize=(4, 3), sharex=True, sharey=True, constrained_layout=True +) + +ax.plot( + xyz_md_hiq[1, :, 50], xyz_md_hiq[2, :, 50], "b", label=r"MD, $d_\mathrm{OO}=2.6 $Å" +) +ax.plot( + xyz_pi_hiq[1, :, 50], + xyz_pi_hiq[2, :, 50], + "r", + label=r"PIMD, $d_\mathrm{OO}=2.6 $Å", +) +ax.plot( + xyz_md_hiq[1, :, 60], + xyz_md_hiq[2, :, 60], + "b--", + label=r"MD, $d_\mathrm{OO}=2.7 $Å", +) +ax.plot( + xyz_pi_hiq[1, :, 60], + xyz_pi_hiq[2, :, 60], + "r--", + label=r"PIMD, $d_\mathrm{OO}=2.7 $Å", +) +ax.set_ylim(0.08, 0.6) +ax.legend(ncols=2, loc="upper right", fontsize=9) +ax.set_ylabel(r"$F$ / eV") +ax.set_xlabel(r"$\Delta C_\mathrm{H}$") +plt.show() + +# %% +# This model system is representative of the behavior of protons +# along a hydrogen bond in different conditions, where the environment +# determines the typical O-O separation, and whether the proton is shared +# (as in high pressure ice X) or preferentially attached to one of the two +# molecules. Zero-point energy (and to a lesser extent tunneling) +# increases the delocalization, and reduces the barrier for an excess +# proton to hop between water molecues. diff --git a/_downloads/597d3fbd5c13b3195d61c3c1381648e5/lode-linear.zip b/_downloads/597d3fbd5c13b3195d61c3c1381648e5/lode-linear.zip new file mode 100644 index 00000000..3a078ee0 Binary files /dev/null and b/_downloads/597d3fbd5c13b3195d61c3c1381648e5/lode-linear.zip differ diff --git a/_downloads/59a2e54bf0c573fdc3c0b810a05c930c/data.zip b/_downloads/59a2e54bf0c573fdc3c0b810a05c930c/data.zip new file mode 100644 index 00000000..4fa50ae7 Binary files /dev/null and b/_downloads/59a2e54bf0c573fdc3c0b810a05c930c/data.zip differ diff --git a/_downloads/5b1c4e22a9037fdd90b3ffe8aaf577e9/environment.yml b/_downloads/5b1c4e22a9037fdd90b3ffe8aaf577e9/environment.yml new file mode 100644 index 00000000..58e31a11 --- /dev/null +++ b/_downloads/5b1c4e22a9037fdd90b3ffe8aaf577e9/environment.yml @@ -0,0 +1,13 @@ +channels: + - conda-forge +dependencies: + - python=3.11 + - pip + - rust > 1.65 + - pip: + - ase==3.22.1 + - matplotlib + - rascaline @ git+https://github.com/Luthaf/rascaline@ca957642f512e141c7570e987aadc05c7ac71983 + - torch + - scipy + - numpy diff --git a/_downloads/5ca4686e07e3a8416afa68821d23425c/environment.yml b/_downloads/5ca4686e07e3a8416afa68821d23425c/environment.yml new file mode 100644 index 00000000..b8d7a9a8 --- /dev/null +++ b/_downloads/5ca4686e07e3a8416afa68821d23425c/environment.yml @@ -0,0 +1,20 @@ +channels: + - plumed/label/nightly + - conda-forge +dependencies: + - python=3.11 + - pip + - gfortran + - make + - git + - plumed + - py-plumed + - pip: + - ase==3.22.1 + - chemiscope + - git+https://github.com/i-pi/i-pi.git@main#egg=ipi + - matplotlib + - skmatter +variables: + PYTHONPATH: + PLUMED_KERNEL: diff --git a/_downloads/61cac41226274764c3aff5e112f310da/roy-gch.ipynb b/_downloads/61cac41226274764c3aff5e112f310da/roy-gch.ipynb new file mode 100644 index 00000000..ecf30235 --- /dev/null +++ b/_downloads/61cac41226274764c3aff5e112f310da/roy-gch.ipynb @@ -0,0 +1,284 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "\n# Generalized Convex Hull construction for the polymorphs of ROY\n\n:Authors: Michele Ceriotti [@ceriottm](https://github.com/ceriottm/)\n\nThis notebook analyzes the structures of 264 polymorphs of ROY, from\n[Beran et Al, Chemical Science (2022)](https://doi.org/10.1039/D1SC06074K)_,\ncomparing the conventional density-energy convex hull with a Generalized Convex Hull\n(GCH) analysis (see [Anelli et al., Phys. Rev. Materials\n(2018)](https://doi.org/10.1103/PhysRevMaterials.2.103804)_).\nIt uses features computed with [rascaline](https://github.com/lab-cosmo/rascaline)_\nand uses the directional convex hull function from\n[scikit-matter](https://github.com/lab-cosmo/scikit-matter)_\nto make the figure.\n\nThe GCH construction aims at determining structures, among a collection of\ncandidate configurations, that are stable or have the potential of being stabilized\nby appropriate thermodynamic boundary conditions (pressure, doping, external fields,\n...). It does so by using microscopic descriptors to determine the diversity of\nstructures, and assumes that configurations that are stable relative to other\nconfigurations with similar descriptors are those that could be made\n\"locally\" stable by suitable synthesis conditions.\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "# sphinx_gallery_thumbnail_number = 3\nimport chemiscope\nimport matplotlib.tri\nimport numpy as np\nfrom matplotlib import pyplot as plt\nfrom metatensor import mean_over_samples\nfrom rascaline import SoapPowerSpectrum\nfrom sklearn.decomposition import PCA\nfrom skmatter.datasets import load_roy_dataset\nfrom skmatter.sample_selection import DirectionalConvexHull" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Loads the structures (that also contain properties in the ``info`` field)\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "roy_data = load_roy_dataset()\n\nstructures = roy_data[\"structures\"]\n\ndensity = np.array([s.info[\"density\"] for s in structures])\nenergy = np.array([s.info[\"energy\"] for s in structures])\nstructype = np.array([s.info[\"type\"] for s in structures])\niknown = np.where(structype == \"known\")[0]\niothers = np.where(structype != \"known\")[0]" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Energy-density hull\n\nThe Directional Convex Hull routines can be used to compute a\nconventional density-energy hull (see\n[Hautier (2014)](http://doi.org/10.1007/128_2013_486) for a pedagogic\nintroduction to the convex hull construction in the context\nof atomistic simulations).\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "dch_builder = DirectionalConvexHull(low_dim_idx=[0])\ndch_builder.fit(density.reshape(-1, 1), energy)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We can get the indices of the selection, and compute the distance from\nthe hull\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "sel = dch_builder.selected_idx_\ndch_dist = dch_builder.score_samples(density.reshape(-1, 1), energy)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Hull energies\n\nStructures on the hull are stable with respect to synthesis at constant\nmolar volume. Any other structure would lower the energy by decomposing\ninto a mixture of the two nearest structures along the hull. Given that\nthe lattice energy is an imperfect proxy for the free energy, and that\nsynthesis can be performed in other ways than by fixing the density,\nstructures that are not exactly on the hull might also be stable. One\ncan compute a \u201chull energy\u201d as an indication of how close these\nstructures are to being stable.\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "fig, ax = plt.subplots(1, 1, figsize=(6, 4))\nax.scatter(density, energy, c=dch_dist, marker=\".\")\nssel = sel[np.argsort(density[sel])]\nax.plot(density[ssel], energy[ssel], \"k--\")\nax.set_xlabel(\"density / g/cm$^3$\")\nax.set_ylabel(\"energy / kJ/mol\")\nplt.show()\n\nprint(\n f\"Mean hull energy for 'known' stable structures {dch_dist[iknown].mean()} kJ/mol\"\n)\nprint(f\"Mean hull energy for 'other' structures {dch_dist[iothers].mean()} kJ/mol\")" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Interactive visualization\n\nYou can also visualize the hull with ``chemiscope`` in a juptyer notebook.\n\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "cs = chemiscope.show(\n structures,\n dict(\n energy=energy,\n density=density,\n hull_energy=dch_dist,\n structure_type=structype,\n ),\n settings={\n \"map\": {\n \"x\": {\"property\": \"density\"},\n \"y\": {\"property\": \"energy\"},\n \"color\": {\"property\": \"hull_energy\"},\n \"symbol\": \"structure_type\",\n \"size\": {\"factor\": 35},\n },\n \"structure\": [{\"unitCell\": True, \"supercell\": {\"0\": 2, \"1\": 2, \"2\": 2}}],\n },\n)\ncs" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Save chemiscope file in a format that can be shared and viewed on `chemiscope.org`\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "cs.save(\"roy_ch.json.gz\")" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Generalized Convex Hull\n\nA GCH is a similar construction, in which generic structural descriptors\nare used in lieu of composition, density or other thermodynamic\nconstraints. The idea is that configurations that are found close to the\nGCH are locally stable with respect to structurally-similar\nconfigurations. In other terms, one can hope to find a thermodynamic\nconstraint (i.e.\u00a0synthesis conditions) that act differently on these\nstructures in comparison with the others, and may potentially stabilize\nthem.\n\n\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Compute structural descriptors\n\nA first step is to computes suitable ML descriptors. Here we have used\n``rascaline`` to evaluate average SOAP features for the structures.\nIf you don't want to install these dependencies for this example you\ncan also use the pre-computed features, but you can use this as a stub\nto apply this analysis to other chemical systems\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "hypers = {\n \"cutoff\": 4,\n \"max_radial\": 6,\n \"max_angular\": 4,\n \"atomic_gaussian_width\": 0.7,\n \"cutoff_function\": {\"ShiftedCosine\": {\"width\": 0.5}},\n \"radial_basis\": {\"Gto\": {\"accuracy\": 1e-6}},\n \"center_atom_weight\": 1.0,\n}\ncalculator = SoapPowerSpectrum(**hypers)\nrho2i = calculator.compute(structures)\nrho2i = rho2i.keys_to_samples([\"species_center\"]).keys_to_properties(\n [\"species_neighbor_1\", \"species_neighbor_2\"]\n)\nrho2i_structure = mean_over_samples(rho2i, sample_names=[\"center\", \"species_center\"])\nnp.savez(\"roy_features.npz\", feats=rho2i_structure.block(0).values)\n\n\n# features = roy_data[\"features\"]\nfeatures = rho2i_structure.block(0).values" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### PCA projection\n\nComputes PCA projection to generate low-dimensional descriptors that\nreflect structural diversity. Any other dimensionality reduction scheme\ncould be used in a similar fashion.\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "pca = PCA(n_components=4)\npca_features = pca.fit_transform(features)\n\nfig, ax = plt.subplots(1, 1, figsize=(6, 4))\nscatter = ax.scatter(pca_features[:, 0], pca_features[:, 1], c=energy)\nax.set_xlabel(\"PCA[1]\")\nax.set_ylabel(\"PCA[2]\")\ncbar = fig.colorbar(scatter, ax=ax)\ncbar.set_label(\"energy / kJ/mol\")\nplt.show()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Builds the Generalized Convex Hull\n\nBuilds a convex hull on the first two PCA features\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "dch_builder = DirectionalConvexHull(low_dim_idx=[0, 1])\ndch_builder.fit(pca_features, energy)\nsel = dch_builder.selected_idx_\ndch_dist = dch_builder.score_samples(pca_features, energy)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Generates a 3D Plot\n\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "triang = matplotlib.tri.Triangulation(pca_features[sel, 0], pca_features[sel, 1])\nfig = plt.figure(figsize=(7, 5), tight_layout=True)\nax = fig.add_subplot(projection=\"3d\")\nax.plot_trisurf(triang, energy[sel], color=\"gray\")\nax.scatter(pca_features[:, 0], pca_features[:, 1], energy, c=dch_dist)\nax.set_xlabel(\"PCA[1]\")\nax.set_ylabel(\"PCA[2]\")\nax.set_zlabel(\"energy / kJ/mol\\n \\n\", labelpad=11)\nax.view_init(25, 110)\nplt.show()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The GCH construction improves the separation between the hull energies\nof \u201cknown\u201d and hypothetical polymorphs (compare with the density-energy\nvalues above)\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "print(\n f\"Mean hull energy for 'known' stable structures {dch_dist[iknown].mean()} kJ/mol\"\n)\nprint(f\"Mean hull energy for 'other' structures {dch_dist[iothers].mean()} kJ/mol\")" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Visualize in a ``chemiscope`` widget\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "for i, f in enumerate(structures):\n for j in range(len(pca_features[i])):\n f.info[\"pca_\" + str(j + 1)] = pca_features[i, j]\nstructure_properties = chemiscope.extract_properties(structures)\nstructure_properties.update({\"per_atom_energy\": energy, \"hull_energy\": dch_dist})\n\n# You can save a chemiscope file to disk (for viewing on chemiscope.org)\n\nchemiscope.write_input(\n \"roy_gch.json.gz\",\n frames=structures,\n properties=structure_properties,\n meta={\n \"name\": \"GCH for ROY polymorphs\",\n \"description\": \"\"\"\nDemonstration of the Generalized Convex Hull construction for\npolymorphs of the ROY molecule. Molecules that are closest to\nthe hull built on PCA-based structural descriptors and having the\ninternal energy predicted by electronic-structure calculations as\nthe z axis are the most thermodynamically stable. Indeed most of the\nknown polymorphs of ROY are on (or very close) to this hull.\n\"\"\",\n \"authors\": [\"Michele Ceriotti \"],\n \"references\": [\n 'A. Anelli, E. A. Engel, C. J. Pickard, and M. Ceriotti, \\\n \"Generalized convex hull construction for materials discovery,\" \\\n Physical Review Materials 2(10), 103804 (2018).',\n 'G. J. O. Beran, I. J. Sugden, C. Greenwell, D. H. Bowskill, \\\n C. C. Pantelides, and C. S. Adjiman, \"How many more polymorphs of \\\n ROY remain undiscovered,\" Chem. Sci. 13(5), 1288\u20131297 (2022).',\n ],\n },\n settings={\n \"map\": {\n \"x\": {\"property\": \"pca_1\"},\n \"y\": {\"property\": \"pca_2\"},\n \"z\": {\"property\": \"energy\"},\n \"symbol\": \"type\",\n \"color\": {\"property\": \"hull_energy\"},\n \"size\": {\n \"factor\": 35,\n \"mode\": \"linear\",\n \"property\": \"\",\n \"reverse\": True,\n },\n },\n \"structure\": [\n {\n \"bonds\": True,\n \"unitCell\": True,\n \"keepOrientation\": True,\n }\n ],\n },\n)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "... and also load one as an interactive viewer\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "chemiscope.show_input(\"roy_gch.json.gz\")" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.11.10" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} \ No newline at end of file diff --git a/_downloads/62b1217b7f64a94ea92cd43a62433b84/dos-align.ipynb b/_downloads/62b1217b7f64a94ea92cd43a62433b84/dos-align.ipynb new file mode 100644 index 00000000..d7a4892f --- /dev/null +++ b/_downloads/62b1217b7f64a94ea92cd43a62433b84/dos-align.ipynb @@ -0,0 +1,543 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "\n# A ML model for the electron density of states\n:Authors: How Wei Bin [@HowWeiBin](https://github.com/HowWeiBin/)\n\nThis tutorial would go through the entire machine learning framework for the electronic\ndensity of states (DOS). It will cover the construction of the DOS and SOAP\ndescriptors from ase Atoms and eigenenergy results. A simple neural network will\nthen be constructed and the model parameters, along with the energy reference will be\noptimized during training. A total of three energy reference will be used, the average\nHartree potential, the Fermi level, and an optimized energy reference starting from\nthe Fermi level energy reference. The performance of each model is then compared.\n\nFirst, lets begin by importing the necessary packages and helper functions\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "import os\nimport zipfile\n\nimport ase\nimport ase.io\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport requests\nimport torch\nfrom rascaline import SoapPowerSpectrum\nfrom scipy.interpolate import CubicHermiteSpline, interp1d\nfrom scipy.optimize import brentq\nfrom torch.utils.data import BatchSampler, DataLoader, Dataset, RandomSampler" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Step 0: Load Structures and Eigenenergies\n1) Downloading and Extracting Data\n2) Loading Data\n3) Find range of eigenenergies\n\nWe take a small subset of 104 structures in the Si dataset from `Bartok et al.,\n2018 `.\nEach structure in the dataset contains two atoms.\n\n\n\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### 1) Downloading and Extracting Data\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "filename = \"dataset.zip\"\nif not os.path.exists(filename):\n url = \"https://github.com/HowWeiBin/datasets/archive/refs/tags/Silicon-Diamonds.zip\"\n response = requests.get(url)\n response.raise_for_status()\n with open(filename, \"wb\") as f:\n f.write(response.content)\n\nwith zipfile.ZipFile(\"./dataset.zip\", \"r\") as zip_ref:\n zip_ref.extractall(\"./\")" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### 2) Loading Data\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "structures = ase.io.read(\"./datasets-Silicon-Diamonds/diamonds.xyz\", \":\")\nn_structures = len(structures)\nn_atoms = torch.tensor([len(i) for i in structures])\neigenenergies = torch.load(\"./datasets-Silicon-Diamonds/diamond_energies.pt\")\nk_normalization = torch.tensor(\n [len(i) for i in eigenenergies]\n) # Calculates number of kpoints sampled per structure\nprint(f\"Total number of structures: {len(structures)}\")" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### 3) Find range of eigenenergies\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "# Process eigenenergies to flattened torch tensors\n\ntotal_eigenenergies = [torch.flatten(torch.tensor(i)) for i in eigenenergies]\n\n# Get lowest and highest value of eigenenergies to know the range of eigenenergies\n\nall_eigenenergies = torch.hstack(total_eigenenergies)\nminE = torch.min(all_eigenenergies)\nmaxE = torch.max(all_eigenenergies)\nprint(f\"The lowest eigenenergy in the dataset is {minE:.3}\")\nprint(f\"The highest eigenenergy in the dataset is {maxE:.3}\")" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Step 1: Constructing the DOS with different energy references\n1) Construct the DOS using the original reference\n2) Calculate the Fermi level from the DOS\n3) Build a set of eigenenergies, with the energy reference set to the fermi level\n4) Truncate the DOS energy window so that the DOS is well-defined at each point\n5) Construct the DOS in the truncated energy window under both references\n6) Construct Splines for the DOS to facilitate interpolation during model training\n\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### 1) Construct the DOS using the original reference\nThe DOS will first be constructed from the full set of eigenenergies to\ndetermine the Fermi level of each structure. The original reference is the\nAverage Hartree Potential in this example.\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "# To ensure that all the eigenenergies are fully represented after\n# gaussian broadening, the energy axis of the DOS extends\n# 3eV wider than the range of values for the eigenenergies\nenergy_lower_bound = minE - 1.5\nenergy_upper_bound = maxE + 1.5\n\n# Gaussian Smearing for the eDOS, 0.3eV is the appropriate value for this dataset\n\nsigma = torch.tensor(0.3)\nenergy_interval = 0.05\n# energy axis, with a grid interval of 0.05 eV\n\nx_dos = torch.arange(energy_lower_bound, energy_upper_bound, energy_interval)\nprint(\n f\"The energy axis ranges from {energy_lower_bound:.3} to \\\n{energy_upper_bound:.3}, consisting of {len(x_dos)} grid points\"\n)\n\n# normalization factor for each DOS, factor of 2 is included\n# because each eigenenergy can be occupied by 2 electrons\n\nnormalization = 2 * (\n 1 / torch.sqrt(2 * torch.tensor(np.pi) * sigma**2) / n_atoms / k_normalization\n)\n\ntotal_edos = []\n\nfor structure_eigenenergies in total_eigenenergies:\n e_dos = torch.sum(\n # Builds a gaussian on each eigenenergy\n # and calculates the value on each grid point\n torch.exp(-0.5 * ((x_dos - structure_eigenenergies.view(-1, 1)) / sigma) ** 2),\n dim=0,\n )\n total_edos.append(e_dos)\n\ntotal_edos = torch.vstack(total_edos)\ntotal_edos = (total_edos.T * normalization).T\n\nprint(f\"The final shape of all the DOS in the dataset is: {list(total_edos.shape)}\")" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### 2) Calculate the Fermi level from the DOS\nNow we integration the DOS, and then use cubic interpolation and brentq\nto calculate the fermi level. Since only the 4 valence electrons in Silicon\nare represented in this energy range, we take the point where the DOS integrates\nto 4 as the fermi level.\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "fermi_levels = []\ntotal_i_edos = torch.cumulative_trapezoid(\n total_edos, x_dos, axis=1\n) # Integrate the DOS along the energy axis\nfor i in total_i_edos:\n interpolated = interp1d(\n x_dos[:-1], i - 4, kind=\"cubic\", copy=True, assume_sorted=True\n ) # We use i-4 because Silicon has 4 electrons in this energy range\n Ef = brentq(\n interpolated, x_dos[0] + 0.1, x_dos[-1] - 0.1\n ) # Fermi Level is the point where the (integrated DOS - 4) = 0\n # 0.1 is added and subtracted to prevent brentq from going out of range\n fermi_levels.append(Ef)\nfermi_levels = torch.tensor(fermi_levels)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### 3) Build a set of eigenenergies, with the energy reference set to the fermi level\nUsing the fermi levels, we are now able to change the energy reference\nof the eigenenergies to the fermi level\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "total_eigenenergies_Ef = []\nfor index, energies in enumerate(total_eigenenergies):\n total_eigenenergies_Ef.append(energies - fermi_levels[index])\n\nall_eigenenergies_Ef = torch.hstack(total_eigenenergies_Ef)\n\nminE_Ef = torch.min(all_eigenenergies_Ef)\nmaxE_Ef = torch.max(all_eigenenergies_Ef)\nprint(f\"The lowest eigenenergy using the fermi level energy reference is {minE_Ef:.3}\")\nprint(f\"The highest eigenenergy using the fermi level energy reference is {maxE_Ef:.3}\")" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### 4) Truncate the DOS energy window so that the DOS is well-defined at each point\nWith the fermi levels, we can also truncate the energy window for DOS prediction.\nIn this example, we truncate the energy window such that it is 3eV above\nthe highest Fermi level in the dataset.\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "# For the Average Hartree Potential energy reference\nx_dos_H = torch.arange(minE - 1.5, max(fermi_levels) + 3, energy_interval)\n\n# For the Fermi Level Energy Reference, all the Fermi levels in the dataset is 0eV\nx_dos_Ef = torch.arange(minE_Ef - 1.5, 3, energy_interval)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### 5) Construct the DOS in the truncated energy window under both references\nHere we construct 2 different targets where they differ in the energy reference\nchosen. These targets will then be treated as different datasets for the model\nto learn on.\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "# For the Average Hartree Potential energy reference\n\ntotal_edos_H = []\n\nfor structure_eigenenergies_H in total_eigenenergies:\n e_dos = torch.sum(\n torch.exp(\n -0.5 * ((x_dos_H - structure_eigenenergies_H.view(-1, 1)) / sigma) ** 2\n ),\n dim=0,\n )\n total_edos_H.append(e_dos)\n\ntotal_edos_H = torch.vstack(total_edos_H)\ntotal_edos_H = (total_edos_H.T * normalization).T\n\n\n# For the Fermi Level Energy Reference\n\ntotal_edos_Ef = []\n\nfor structure_eigenenergies_Ef in total_eigenenergies_Ef:\n e_dos = torch.sum(\n torch.exp(\n -0.5 * ((x_dos_Ef - structure_eigenenergies_Ef.view(-1, 1)) / sigma) ** 2\n ),\n dim=0,\n )\n total_edos_Ef.append(e_dos)\n\ntotal_edos_Ef = torch.vstack(total_edos_Ef)\ntotal_edos_Ef = (total_edos_Ef.T * normalization).T" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### 6) Construct Splines for the DOS to facilitate interpolation during model training\nBuilding Cubic Hermite Splines on the DOS on the truncated energy window\nto facilitate interpolation during training. Cubic Hermite Splines takes\nin information on the value and derivative of a function at a point to build splines.\nThus, we will have to compute both the value and derivative at each spline position\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "# Functions to compute the value and derivative of the DOS at each energy value, x\ndef edos_value(x, eigenenergies, normalization):\n e_dos_E = (\n torch.sum(\n torch.exp(-0.5 * ((x - eigenenergies.view(-1, 1)) / sigma) ** 2), dim=0\n )\n * normalization\n )\n\n return e_dos_E\n\n\ndef edos_derivative(x, eigenenergies, normalization):\n dfn_dos_E = (\n torch.sum(\n torch.exp(-0.5 * ((x - eigenenergies.view(-1, 1)) / sigma) ** 2)\n * (-1 * ((x - eigenenergies.view(-1, 1)) / sigma) ** 2),\n dim=0,\n )\n * normalization\n )\n\n return dfn_dos_E\n\n\ntotal_splines_H = []\n# the splines have a higher energy range in case the shift is high\nspline_positions_H = torch.arange(minE - 2, max(fermi_levels) + 6, energy_interval)\n\nfor index, structure_eigenenergies_H in enumerate(total_eigenenergies):\n e_dos_H = edos_value(\n spline_positions_H, structure_eigenenergies_H, normalization[index]\n )\n e_dos_H_grad = edos_derivative(\n spline_positions_H, structure_eigenenergies_H, normalization[index]\n )\n spliner = CubicHermiteSpline(spline_positions_H, e_dos_H, e_dos_H_grad)\n total_splines_H.append(torch.tensor(spliner.c))\n\ntotal_splines_H = torch.stack(total_splines_H)\n\ntotal_splines_Ef = []\nspline_positions_Ef = torch.arange(minE_Ef - 2, 6, energy_interval)\n\nfor index, structure_eigenenergies_Ef in enumerate(total_eigenenergies_Ef):\n e_dos_Ef = edos_value(\n spline_positions_Ef, structure_eigenenergies_Ef, normalization[index]\n )\n e_dos_Ef_grad = edos_derivative(\n spline_positions_Ef, structure_eigenenergies_Ef, normalization[index]\n )\n spliner = CubicHermiteSpline(spline_positions_Ef, e_dos_Ef, e_dos_Ef_grad)\n total_splines_Ef.append(torch.tensor(spliner.c))\n\ntotal_splines_Ef = torch.stack(total_splines_Ef)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We have stored the splines coefficients (spliner.c) as torch tensors,\nas such as we will need to write a function to evaluate the DOS from\nthe splines positions and coefficients.\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "def evaluate_spline(spline_coefs, spline_positions, x):\n \"\"\"\n spline_coefs: shape of (n x 4 x spline_positions)\n\n return value: shape of (n x x)\n\n x : shape of (n x n_points)\n \"\"\"\n interval = torch.round(\n spline_positions[1] - spline_positions[0], decimals=4\n ) # get spline grid intervals\n x = torch.clamp(\n x, min=spline_positions[0], max=spline_positions[-1] - 0.0005\n ) # restrict x to fall within the spline interval\n # 0.0005 is substracted to combat errors arising from precision\n indexes = torch.floor(\n (x - spline_positions[0]) / interval\n ).long() # Obtain the index for the appropriate spline coefficients\n expanded_index = indexes.unsqueeze(dim=1).expand(-1, 4, -1)\n x_1 = x - spline_positions[indexes]\n x_2 = x_1 * x_1\n x_3 = x_2 * x_1\n x_0 = torch.ones_like(x_1)\n x_powers = torch.stack([x_3, x_2, x_1, x_0]).permute(1, 0, 2)\n value = torch.sum(\n torch.mul(x_powers, torch.gather(spline_coefs, 2, expanded_index)), axis=1\n )\n\n return value # returns the value of the DOS at the energy positions, x." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Lets look at the accuracy of the splines.\nTest 1: Ability to reproduce the correct values at the default x_dos positions\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "shifts = torch.zeros(n_structures)\nx_dos_splines = x_dos_H + shifts.view(-1, 1)\nspline_dos_H = evaluate_spline(total_splines_H, spline_positions_H, x_dos_splines)\n\nplt.plot(x_dos_H, total_edos_H[0], color=\"red\", label=\"True DOS\")\nplt.plot(x_dos_H, spline_dos_H[0], color=\"blue\", linestyle=\"--\", label=\"Spline DOS\")\nplt.legend()\nplt.xlabel(\"Energy [eV]\")\nplt.ylabel(\"DOS\")\nprint(\"Both lines lie on each other\")" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Test 2: Ability to reproduce the correct values at the shifted x_dos positions\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "shifts = torch.zeros(n_structures) + 0.3\nx_dos_splines = x_dos_Ef + shifts.view(-1, 1)\nspline_dos_Ef = evaluate_spline(total_splines_Ef, spline_positions_Ef, x_dos_splines)\n\nplt.plot(x_dos_Ef, total_edos_Ef[0], color=\"red\", label=\"True DOS\")\nplt.plot(x_dos_Ef, spline_dos_Ef[0], color=\"blue\", linestyle=\"--\", label=\"Spline DOS\")\nplt.legend()\nplt.xlabel(\"Energy [eV]\")\nplt.ylabel(\"DOS\")\nprint(\"Both spectras look very similar\")" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Step 2: Compute SOAP power spectrum for the dataset\n\nWe first define the hyperparameters to compute the\nSOAP power spectrum using rascaline.\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "HYPER_PARAMETERS = {\n \"cutoff\": 4.0,\n \"max_radial\": 8,\n \"max_angular\": 6,\n \"atomic_gaussian_width\": 0.45,\n \"center_atom_weight\": 1.0,\n \"radial_basis\": {\"Gto\": {}},\n \"cutoff_function\": {\n \"Step\": {},\n },\n \"radial_scaling\": {\n \"Willatt2018\": {\n \"exponent\": 5,\n \"rate\": 1,\n \"scale\": 3.0,\n },\n },\n}" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We feed the Hyperparameters into rascaline to compute the SOAP Power spectrum\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "calculator = SoapPowerSpectrum(**HYPER_PARAMETERS)\nR_total_soap = calculator.compute(structures)\n# Transform the tensormap to a single block containing a dense representation\nR_total_soap.keys_to_samples(\"species_center\")\nR_total_soap.keys_to_properties([\"species_neighbor_1\", \"species_neighbor_2\"])\n\n# Now we extract the data tensor from the single block\ntotal_atom_soap = []\nfor structure_i in range(n_structures):\n a_i = R_total_soap.block(0).samples[\"structure\"] == structure_i\n total_atom_soap.append(torch.tensor(R_total_soap.block(0).values[a_i, :]))\n\ntotal_soap = torch.stack(total_atom_soap)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Step 3: Building a Simple MLP Model\n\n1) Split the data into Training, Validation and Test\n2) Define the dataloader and the Model Architecture\n3) Define relevant loss functions for training and inference\n4) Define the training loop\n5) Evaluate the model\n\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### 1) Split the data into Training, Validation and Test\nWe will first split the data in a 7:1:2 manner, corresponding to train, val and test.\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "np.random.seed(0)\ntrain_index = np.arange(n_structures)\nnp.random.shuffle(train_index)\ntest_mark = int(0.8 * n_structures)\nval_mark = int(0.7 * n_structures)\ntest_index = train_index[test_mark:]\nval_index = train_index[val_mark:test_mark]\ntrain_index = train_index[:val_mark]" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### 2) Define the dataloader and the Model Architecture\nWe will now build a dataloader and dataset to facillitate training the model batchwise\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "def generate_atomstructure_index(n_atoms_per_structure):\n \"\"\"Generate a sequence of indices for each atom in the structure.\n The indices correspond to index of the structure that the atom belongs to\n\n Args:\n n_atoms_per_structure ([array]):\n [Array containing the number of atoms each structure contains]\n\n Return s:\n [tensor]: [Total index, matching atoms to structure]\n \"\"\"\n # n_structures = len(n_atoms_per_structure)\n total_index = []\n for i, atoms in enumerate(n_atoms_per_structure):\n indiv_index = torch.zeros(atoms) + i\n total_index.append(indiv_index)\n total_index = torch.hstack(total_index)\n return total_index.long()\n\n\nclass AtomicDataset(Dataset):\n def __init__(self, features, n_atoms_per_structure):\n self.features = features\n self.n_structures = len(n_atoms_per_structure)\n self.n_atoms_per_structure = n_atoms_per_structure\n self.index = generate_atomstructure_index(self.n_atoms_per_structure)\n assert torch.sum(n_atoms_per_structure) == len(features)\n\n def __len__(self):\n return self.n_structures\n\n def __getitem__(self, idx):\n if isinstance(idx, list): # If a list of indexes is given\n feature_indexes = []\n\n for i in idx:\n feature_indexes.append((self.index == i).nonzero(as_tuple=True)[0])\n\n feature_indexes = torch.hstack(feature_indexes)\n\n return (\n self.features[feature_indexes],\n idx,\n generate_atomstructure_index(self.n_atoms_per_structure[idx]),\n )\n\n else:\n feature_indexes = (self.index == idx).nonzero(as_tuple=True)[0]\n return (\n self.features[feature_indexes],\n idx,\n self.n_atoms_per_structure[idx],\n )\n\n\ndef collate(\n batch,\n): # Defines how to collate the outputs of the __getitem__ function at each batch\n for x, idx, index in batch:\n return (x, idx, index)\n\n\nx_train = torch.flatten(total_soap[train_index], 0, 1).float()\ntotal_atomic_soaps = torch.vstack(total_atom_soap).float()\ntrain_features = AtomicDataset(x_train, n_atoms[train_index])\nfull_atomstructure_index = generate_atomstructure_index(n_atoms)\n# Will be required later to collate atomic predictions into structural predictions\n\n# Build a Dataloader that samples from the AtomicDataset in random batches\nSampler = RandomSampler(train_features)\nBSampler = BatchSampler(Sampler, batch_size=32, drop_last=False)\ntraindata_loader = DataLoader(train_features, sampler=BSampler, collate_fn=collate)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We will now define a simple three layer MLP model, consisting of three layers.\nThe align keyword is used to indicate that the energy reference will be optimized\nduring training. The alignment parameter refers to the adjustments made to the\ninitial energy referenced and will be initialized as zeros.\n\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "class SOAP_NN(torch.nn.Module):\n def __init__(self, input_dims, L1, n_train, target_dims, align):\n super(SOAP_NN, self).__init__()\n self.target_dims = target_dims\n self.fc1 = torch.nn.Linear(input_dims, L1)\n self.fc2 = torch.nn.Linear(L1, target_dims)\n self.silu = torch.nn.SiLU()\n self.align = align\n if align:\n initial_alignment = torch.zeros(n_train)\n self.alignment = torch.nn.parameter.Parameter(initial_alignment)\n\n def forward(self, x):\n result = self.fc1(x)\n result = self.silu(result)\n result = self.fc2(result)\n return result" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We will use a small network architecture, whereby the input layer corresponds\nto the size of the SOAP features, 448, the intermediate layer corresponds to\na tenth size of the input layer and the final layer corresponds\nto the number of outputs.\n\nAs a shorthand, the model that optimizes the energy reference during\ntraining will be called the alignment model\n\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "n_outputs_H = len(x_dos_H)\nn_outputs_Ef = len(x_dos_Ef)\n\n\nModel_H = SOAP_NN(\n x_train.shape[1],\n x_train.shape[1] // 10,\n len(train_index),\n n_outputs_H,\n align=False,\n)\nModel_Ef = SOAP_NN(\n x_train.shape[1],\n x_train.shape[1] // 10,\n len(train_index),\n n_outputs_Ef,\n align=False,\n)\nModel_Align = SOAP_NN(\n x_train.shape[1],\n x_train.shape[1] // 10,\n len(train_index),\n n_outputs_Ef,\n align=True,\n)\n# The alignment model takes the fermi level energy reference as the starting point" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### 3) Define relevant loss functions for training and inference\nWe will now define some loss functions that will be useful when we implement\nthe model training loop later and during model evaluation on the test set.\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "def t_get_mse(a, b, xdos):\n \"\"\"Compute mean error between two Density of States.\n The mean error is integrated across the entire energy grid\n to provide a single value to characterize the error\n\n Args:\n a ([tensor]): [Predicted DOS]\n b ([tensor]): [True DOS]\n xdos ([tensor], optional): [Energy axis of DOS]\n\n Returns:\n [float]: [MSE]\n \"\"\"\n if len(a.size()) > 1:\n mse = (torch.trapezoid((a - b) ** 2, xdos, axis=1)).mean()\n else:\n mse = (torch.trapezoid((a - b) ** 2, xdos, axis=0)).mean()\n return mse\n\n\ndef t_get_rmse(a, b, xdos):\n \"\"\"Compute root mean squared error between two Density of States .\n\n Args:\n a ([tensor]): [Predicted DOS]\n b ([tensor]): [True DOS]\n xdos ([tensor], optional): [Energy axis of DOS]\n\n Raises:\n ValueError: [Occurs if tensor shapes are mismatched]\n\n Returns:\n [float]: [RMSE or %RMSE]\n \"\"\"\n\n if len(a.size()) > 1:\n rmse = torch.sqrt((torch.trapezoid((a - b) ** 2, xdos, axis=1)).mean())\n else:\n rmse = torch.sqrt((torch.trapezoid((a - b) ** 2, xdos, axis=0)).mean())\n return rmse\n\n\ndef Opt_RMSE_spline(y_pred, xdos, target_splines, spline_positions, n_epochs):\n \"\"\"Evaluates RMSE on the optimal shift of energy axis.\n The optimal shift is found via gradient descent after a gridsearch is performed.\n\n Args:\n y_pred ([tensor]): [Prediction/s of DOS]\n xdos ([tensor]): [Energy axis]\n target_splines ([tensor]): [Contains spline coefficients]\n spline_positions ([tensor]): [Contains spline positions]\n n_epochs ([int]): [Number of epochs to run for Gradient Descent]\n\n Returns:\n [rmse([float]), optimal_shift[tensor]]:\n [RMSE on optimal shift, the optimal shift itself]\n\n \"\"\"\n optim_search_mse = []\n offsets = torch.arange(-2, 2, 0.1)\n # Grid-search is first done to reduce number of epochs needed for\n # gradient descent, typically 50 epochs will be sufficient\n # if searching within 0.1\n with torch.no_grad():\n for offset in offsets:\n shifts = torch.zeros(y_pred.shape[0]) + offset\n shifted_target = evaluate_spline(\n target_splines, spline_positions, xdos + shifts.view(-1, 1)\n )\n loss_i = ((y_pred - shifted_target) ** 2).mean(dim=1)\n optim_search_mse.append(loss_i)\n optim_search_mse = torch.vstack(optim_search_mse)\n min_index = torch.argmin(optim_search_mse, dim=0)\n optimal_offset = offsets[min_index]\n\n offset = optimal_offset\n\n shifts = torch.nn.parameter.Parameter(offset.float())\n opt_adam = torch.optim.Adam([shifts], lr=1e-2)\n best_error = torch.zeros(len(shifts)) + 100\n best_shifts = shifts.clone()\n for _ in range(n_epochs):\n shifted_target = evaluate_spline(\n target_splines, spline_positions, xdos + shifts.view(-1, 1)\n ).detach()\n\n def closure():\n opt_adam.zero_grad()\n shifted_target = evaluate_spline(\n target_splines, spline_positions, xdos + shifts.view(-1, 1)\n )\n loss_i = ((y_pred - shifted_target) ** 2).mean()\n loss_i.backward(gradient=torch.tensor(1), inputs=shifts)\n return loss_i\n\n opt_adam.step(closure)\n\n with torch.no_grad():\n each_loss = ((y_pred - shifted_target) ** 2).mean(dim=1).float()\n index = each_loss < best_error\n best_error[index] = each_loss[index].clone()\n best_shifts[index] = shifts[index].clone()\n\n # Evaluate\n\n optimal_shift = best_shifts\n shifted_target = evaluate_spline(\n target_splines, spline_positions, xdos + optimal_shift.view(-1, 1)\n )\n rmse = t_get_rmse(y_pred, shifted_target, xdos)\n return rmse, optimal_shift" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### 4) Define the training loop\n\nWe will now define the model training loop, for simplicity we will only\ntrain each model for a fixed number of epochs, learning rate, and batch_size.\nThe training and validation error at each epoch will be saved.\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "def train_model(model_to_train, fixed_DOS, structure_splines, spline_positions, x_dos):\n \"\"\"Trains a model for 500 epochs\n\n Args:\n model_to_train ([torch.nn.Module]): [ML Model]\n fixed_DOS ([tensor]): [Contains the DOS at a fixed energy reference,\n useful for models that don't optimize the energy reference]\n structure_splines ([tensor]): [Contains spline coefficients]\n spline_positions ([tensor]): [Contains spline positions]\n x_dos ([tensor]): [Energy axis for the prediction]\n\n Returns:\n [train_loss_history([tensor]),\n val_loss_history[tensor],\n structure_results[tensor]]:\n\n [Respective loss histories and final structure predictions]\n \"\"\"\n lr = 1e-2\n n_epochs = 500\n\n opt = torch.optim.Adam(model_to_train.parameters(), lr=lr)\n\n train_loss_history = []\n val_loss_history = []\n\n for _epoch in range(n_epochs):\n for x_data, idx, index in traindata_loader:\n opt.zero_grad()\n predictions = model_to_train.forward(x_data)\n structure_results = torch.zeros([len(idx), model_to_train.target_dims])\n # Sum atomic predictions in each structure\n structure_results = structure_results.index_add_(\n 0, index, predictions\n ) / n_atoms[train_index[idx]].view(-1, 1)\n if model_to_train.align:\n alignment = model_to_train.alignment\n alignment = alignment - torch.mean(alignment)\n # Enforce that the alignments have a mean of zero since a constant\n # value across the dataset is meaningless when optimizing the\n # relative energy reference\n target = evaluate_spline(\n structure_splines[train_index[idx]],\n spline_positions,\n x_dos + alignment[idx].view(-1, 1),\n ) # Shifts the target based on the alignment value\n pred_loss = t_get_mse(structure_results, target, x_dos)\n pred_loss.backward()\n else:\n pred_loss = t_get_mse(\n structure_results, fixed_DOS[train_index[idx]], x_dos\n )\n pred_loss.backward()\n\n opt.step()\n with torch.no_grad():\n all_pred = model_to_train.forward(total_atomic_soaps.float())\n structure_results = torch.zeros([n_structures, model_to_train.target_dims])\n structure_results = structure_results.index_add_(\n 0, full_atomstructure_index, all_pred\n ) / (n_atoms).view(-1, 1)\n if model_to_train.align:\n # Evaluate model on optimal shift as there is no information\n # regarding the shift from the fermi level energy reference\n # during inference\n\n alignment = model_to_train.alignment\n alignment = alignment - torch.mean(alignment)\n target = evaluate_spline(\n structure_splines[train_index],\n spline_positions,\n x_dos + alignment.view(-1, 1),\n )\n\n train_loss = t_get_rmse(structure_results[train_index], target, x_dos)\n val_loss, val_shifts = Opt_RMSE_spline(\n structure_results[val_index],\n x_dos,\n structure_splines[val_index],\n spline_positions,\n 50,\n )\n\n else:\n train_loss = t_get_rmse(\n structure_results[train_index], fixed_DOS[train_index], x_dos\n )\n val_loss = t_get_rmse(\n structure_results[val_index], fixed_DOS[val_index], x_dos\n )\n\n train_loss_history.append(train_loss)\n val_loss_history.append(val_loss)\n train_loss_history = torch.tensor(train_loss_history)\n val_loss_history = torch.tensor(val_loss_history)\n return (\n train_loss_history,\n val_loss_history,\n structure_results,\n )\n # returns the loss history and the final set of predictions" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "H_trainloss, H_valloss, H_predictions = train_model(\n Model_H, total_edos_H, total_splines_H, spline_positions_H, x_dos_H\n)\n\nEf_trainloss, Ef_valloss, Ef_predictions = train_model(\n Model_Ef, total_edos_Ef, total_splines_Ef, spline_positions_Ef, x_dos_Ef\n)\n\nAlign_trainloss, Align_valloss, Align_predictions = train_model(\n Model_Align, total_edos_Ef, total_splines_Ef, spline_positions_Ef, x_dos_Ef\n)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Lets plot the train loss histories to compare their learning behaviour\n\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "epochs = np.arange(500)\n\n\nplt.plot(epochs, H_trainloss, color=\"red\", label=\"Avg Hartree Potential\")\nplt.plot(epochs, Ef_trainloss, color=\"blue\", label=\"Fermi Level\")\nplt.plot(epochs, Align_trainloss, color=\"green\", label=\"Optimized Reference\")\nplt.legend()\nplt.yscale(value=\"log\")\nplt.xlabel(\"Epochs\")\nplt.ylabel(\"RMSE\")\nplt.title(\"Train Loss vs Epoch\")\nplt.show()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Lets plot the val loss histories to compare their learning behaviour\n\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "plt.plot(epochs, H_valloss, color=\"red\", label=\"Avg Hartree Potential\")\nplt.plot(epochs, Ef_valloss, color=\"blue\", label=\"Fermi Level\")\nplt.plot(epochs, Align_valloss, color=\"green\", label=\"Optimized Reference\")\nplt.legend()\nplt.yscale(value=\"log\")\nplt.xlabel(\"Epochs\")\nplt.ylabel(\"RMSE\")\nplt.title(\"Validation Loss vs Epoch\")\nplt.show()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### 5) Evaluate the model\nWe will now evaluate the model performance on the test set\nbased on the model predictions we obtained previously\n\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "H_testloss = Opt_RMSE_spline(\n H_predictions[test_index],\n x_dos_H,\n total_splines_H[test_index],\n spline_positions_H,\n 200,\n) # We use 200 epochs just so it the error a little bit more converged\nEf_testloss = Opt_RMSE_spline(\n Ef_predictions[test_index],\n x_dos_Ef,\n total_splines_Ef[test_index],\n spline_positions_Ef,\n 200,\n) # We use 200 epochs just so it the error a little bit more converged\nAlign_testloss = Opt_RMSE_spline(\n Align_predictions[test_index],\n x_dos_Ef,\n total_splines_Ef[test_index],\n spline_positions_Ef,\n 200,\n) # We use 200 epochs just so it the error a little bit more converged\n\nprint(f\"Test RMSE for average Hartree Potential: {H_testloss[0].item():.3}\")\nprint(f\"Test RMSE for Fermi Level: {Ef_testloss[0].item():.3}\")\nprint(f\"Test RMSE for Optimized Reference: {Align_testloss[0].item():.3}\")\n\nprint(\n \"The difference in effectiveness between the Optimized Reference \\\nand the Fermi Level will increase with more epochs\"\n)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Plot Training DOSes at different energy reference to visualize\nthe impact of the energy reference. From the plots we can see\nthat the optimized energy reference has better alignment of\ncommon spectral patterns across the dataset\n\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nAverage Hartree Energy Reference\n\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "for i in total_edos_H[train_index]:\n plt.plot(x_dos_H, i, color=\"C0\", alpha=0.6)\nplt.title(\"Energy Reference - Average Hartree Potential\")\nplt.xlabel(\"Energy [eV]\")\nplt.ylabel(\"DOS\")\nplt.show()\nprint(\"The DOSes, despite looking similar, are offset along the energy axis\")" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Fermi Level Energy Reference\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "for i in total_edos_Ef[train_index]:\n plt.plot(x_dos_Ef, i, color=\"C0\", alpha=0.6)\nplt.title(\"Energy Reference - Fermi Level\")\nplt.xlabel(\"Energy [eV]\")\nplt.ylabel(\"DOS\")\nplt.show()\n\nprint(\"It is better aligned but still quite some offset\")" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Optimized Energy Reference\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "shifts = Model_Align.alignment.detach()\nshifts = shifts - torch.mean(shifts)\nx_dos_splines = x_dos_Ef + shifts.view(-1, 1)\ntotal_edos_align = evaluate_spline(\n total_splines_Ef[train_index], spline_positions_Ef, x_dos_splines\n)\n\nfor i in total_edos_align:\n plt.plot(x_dos_Ef, i, color=\"C0\", alpha=0.6)\nplt.title(\"Energy Reference - Optimized\")\nplt.xlabel(\"Energy [eV]\")\nplt.ylabel(\"DOS\")\nplt.show()\nprint(\"The DOS alignment is better under the optimized energy reference\")\nprint(\"The difference will increase with more training epochs\")" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.11.10" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} \ No newline at end of file diff --git a/_downloads/64137e0eebfcb548a6786ce728aa41b4/environment.yml b/_downloads/64137e0eebfcb548a6786ce728aa41b4/environment.yml new file mode 100644 index 00000000..6d18827e --- /dev/null +++ b/_downloads/64137e0eebfcb548a6786ce728aa41b4/environment.yml @@ -0,0 +1,12 @@ +channels: + - conda-forge +dependencies: + - python=3.11 + - pip + - lammps + - pip: + - ase==3.22.1 + - chemiscope>=0.7 + - git+https://github.com/i-pi/i-pi.git@main + - matplotlib + - skmatter diff --git a/_downloads/6cadff1f3492fc92f1615765051399cd/environment.yml b/_downloads/6cadff1f3492fc92f1615765051399cd/environment.yml new file mode 100644 index 00000000..27cf94ce --- /dev/null +++ b/_downloads/6cadff1f3492fc92f1615765051399cd/environment.yml @@ -0,0 +1,12 @@ +channels: + - conda-forge +dependencies: + - python=3.11 + - pip + - rust >=1.65 + - pip: + - ase==3.22.1 + - equisolve @ git+https://github.com/lab-cosmo/equisolve.git@c858bedef4b2799eb445e4c92535ee387224089a + - matplotlib + - metatensor + - rascaline @ git+https://github.com/Luthaf/rascaline@ca957642f512e141c7570e987aadc05c7ac71983 diff --git a/_downloads/6e397e9158b2a5505af1904db0846a5c/run_calcs.sh b/_downloads/6e397e9158b2a5505af1904db0846a5c/run_calcs.sh new file mode 100644 index 00000000..59a8ff53 --- /dev/null +++ b/_downloads/6e397e9158b2a5505af1904db0846a5c/run_calcs.sh @@ -0,0 +1,7 @@ +#! /bin/bash + +for i in $(find ./production/ -mindepth 1 -type d); do + cd $i + cp2k.ssmp -i in.cp2k + cd - +done diff --git a/_downloads/71c5cdd3040f0ebf209e70539664ca89/environment.yml b/_downloads/71c5cdd3040f0ebf209e70539664ca89/environment.yml new file mode 100644 index 00000000..6d18827e --- /dev/null +++ b/_downloads/71c5cdd3040f0ebf209e70539664ca89/environment.yml @@ -0,0 +1,12 @@ +channels: + - conda-forge +dependencies: + - python=3.11 + - pip + - lammps + - pip: + - ase==3.22.1 + - chemiscope>=0.7 + - git+https://github.com/i-pi/i-pi.git@main + - matplotlib + - skmatter diff --git a/_downloads/8052f55b323764c2ee21cbfef5187bf4/lpr.ipynb b/_downloads/8052f55b323764c2ee21cbfef5187bf4/lpr.ipynb new file mode 100644 index 00000000..d3792473 --- /dev/null +++ b/_downloads/8052f55b323764c2ee21cbfef5187bf4/lpr.ipynb @@ -0,0 +1,201 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "\n# Local Prediction Rigidity analysis\n\n:Authors: Sanggyu \"Raymond\" Chong [@SanggyuChong](https://github.com/sanggyuChong/);\n Federico Grasselli [@fgrassel](https://github.com/fgrassel/)\n\nIn this tutorial, we calculate the SOAP descriptors of an amorphous\nsilicon dataset using rascaline, then compute the local prediction\nrigidity (LPR) for the atoms of a \"test\" set before and after\nmodifications to the \"training\" dataset has been made.\n\nFirst, we import all the necessary packages:\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "import os\nimport tarfile\n\nimport numpy as np\nimport requests\nfrom ase.io import read\nfrom matplotlib import pyplot as plt\nfrom matplotlib.colors import LogNorm\nfrom rascaline import SoapPowerSpectrum\nfrom sklearn.decomposition import PCA\nfrom skmatter.metrics import local_prediction_rigidity as lpr" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Load and prepare amorphous silicon data\n\n\nWe first download the dataset associated with LPR\nanalysis from Materials Cloud and load the the amorphous\nsilicon structures using [ASE](https://wiki.fysik.dtu.dk/ase/).\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "filename = \"LPR_supp_notebook_dataset.tar.gz\"\nif not os.path.exists(filename):\n url = \"https://rb.gy/wxsrug\" # shortened URL\n response = requests.get(url)\n response.raise_for_status()\n with open(filename, \"wb\") as f:\n f.write(response.content)\n\nwith tarfile.open(filename) as tar:\n tar.extractall(path=\".\")\n\nframes_pristine = read(\"datasets/Si_amo_defect_free.xyz\", \":\")\nframes_defect = read(\"datasets/Si_amo_defect_containing.xyz\", \":\")\n\n# Randomly shuffle the structures\n\nnp.random.seed(20230215)\n\nids = list(range(len(frames_pristine)))\nnp.random.shuffle(ids)\nframes_pristine = [frames_pristine[ii] for ii in ids]\n\nids = list(range(len(frames_defect)))\nnp.random.shuffle(ids)\nframes_defect = [frames_defect[ii] for ii in ids]" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We now further refine the loaded datasets according the the\nnumber of coordinated atoms that each atomic environment exhibits.\n\"Pristine\" refers to structures where all of the atoms have strictly\n4 coordinating atoms. \"Defect\" refers to structures that contain\natoms with coordination numbers other than 4.\n\nWe use :code:`get_all_distances` funciton of :code:`ase.Atoms` to detect the\nnumber of coordinated atoms.\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "cur_cutoff = 2.7\nrefined_pristine_frames = []\nfor frame in frames_pristine:\n neighs = (frame.get_all_distances(mic=True) < cur_cutoff).sum(axis=0) - 1\n if neighs.max() > 4 or neighs.min() < 4:\n continue\n else:\n refined_pristine_frames.append(frame)\n\nrefined_defect_frames = []\nfor frame in frames_defect:\n neighs = (frame.get_all_distances(mic=True) < cur_cutoff).sum(axis=0) - 1\n num_defects = (neighs > 4).sum() + (neighs < 4).sum()\n if num_defects > 4:\n refined_defect_frames.append(frame)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Compute SOAP descriptors using rascaline\n\nNow, we move on and compute the SOAP descriptors for the refined\nstructures. First, define the rascaline hyperparameters used to\ncompute SOAP. Among the hypers, notice that the cutoff is chosen\nto be 2.85 \u00c5, and the radial scaling is turned off. These were\nheuristic choices made to accentuate the difference in the LPR\nbased on the nearest-neighbor coordination. (Do not blindly\nuse this set of hypers for production-quality model training!)\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "# Hypers dictionary\nhypers = {\n \"cutoff\": 2.85,\n \"max_radial\": 10,\n \"max_angular\": 12,\n \"atomic_gaussian_width\": 0.5,\n \"center_atom_weight\": 1.0,\n \"radial_basis\": {\"Gto\": {\"spline_accuracy\": 1e-8}},\n \"cutoff_function\": {\"ShiftedCosine\": {\"width\": 0.1}},\n \"radial_scaling\": None,\n}\n# Define rascaline calculator\ncalculator = SoapPowerSpectrum(**hypers)\n\n# Calculate the SOAP power spectrum\nXlist_pristine = []\nfor frame in refined_pristine_frames:\n descriptor = calculator.compute(frame)\n Xlist_pristine.append(np.array(descriptor.block().values))\n\nXlist_defect = []\nfor frame in refined_defect_frames:\n descriptor = calculator.compute(frame)\n Xlist_defect.append(np.array(descriptor.block().values))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Organize structures into \"training\" and \"test\" sets\n\nNow we move on and compute the SOAP descriptors for the refined\nstructures. First, define the rascaline hyperparameters used to\ncompute SOAP.\n\nNotice that the format in which we handle the descriptors is as a\nlist of :code:`np.array` descriptor blocks. This is to ensure\ncompatibility with how things have been implemented in the LPR\nmodule of :code:`scikit-matter`.\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "n_train = 400\nn_add = 50\nn_test = 50\n\nX_pristine = [Xlist for Xlist in Xlist_pristine[: n_train + n_add]]\nX_defect = [Xlist for Xlist in Xlist_defect[:n_add]]\nX_test = [Xlist for Xlist in Xlist_defect[n_add : n_add + n_test]]\n\n# Save coordination values for visualization\ntest_coord = []\nfor frame in refined_defect_frames[n_add : n_add + n_test]:\n coord = (frame.get_all_distances(mic=True) < cur_cutoff - 0.05).sum(axis=0) - 1\n test_coord += coord.tolist()\ntest_coord = np.array(test_coord)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Compute the LPR for the test set\n\nNext, we will use the :code:`local_prediction_rigidity` module of\n[scikit-matter](https://scikit-matter.readthedocs.io/en/latest/)\nto compute the LPRs for the test set that we have set apart.\n\nLPR reflects how the ML model perceives a local environment,\ngiven a collection of other structures, similar or different.\nIt should then carry over some of the details involved in training\nthe model, in this case the regularization strength.\n\nFor this example, we have foregone on the actual model training,\nand so we define an arbitrary value for the alpha.\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "alpha = 1e-4\nLPR_test, rank = lpr(X_pristine, X_test, alpha)\nLPR_test = np.hstack(LPR_test)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Visualizing the LPR on a PCA map\n\nWe now visualize the LPRs of the test set on a PCA map,\nwhere the PCA is performed on the SOAP descriptors of\ndefect-containing dataset.\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "pca = PCA(n_components=5)\ndescriptors_all = calculator.compute(refined_defect_frames)\npca.fit_transform(descriptors_all.block().values)\nPCA_test = pca.transform(np.vstack(X_test))\n\nrmin = np.log10(LPR_test.min()) + 0.5\nrmax = np.log10(LPR_test.max()) - 0.5\n\nfig = plt.figure(figsize=(5, 4), dpi=200)\nax = fig.add_subplot()\nim = ax.scatter(\n PCA_test[:, 0],\n PCA_test[:, 1],\n c=LPR_test,\n s=20,\n linewidths=0,\n norm=LogNorm(vmin=10**rmin, vmax=10**rmax),\n cmap=\"viridis\",\n)\n\nax.set_xlabel(\"PC1\")\nax.set_ylabel(\"PC2\")\nfig.colorbar(im, ax=ax, label=\"LPR\")\nax.tick_params(left=False, bottom=False, labelleft=False, labelbottom=False)\nplt.show()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "In the PCA map, where each point corresponds to an\natomic environment of the test set structures, one\ncan observe 4 different clusters of points, arranged\nalong PC1. This corresponds to the coordination numbers\nranging from 3 to 6. Since the training set contains\nstructures exclusively composed of 4-coordinated atoms,\nLPR is distinctly high for the second, main cluster of\npoints, and quite low for the three other clusters.\n\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Studying the LPR after dataset modification\n\nWe now want to see what would happen when defect structures\nare included into the training set of the model. For this,\nwe first create a modified dataset that incorporates in the\ndefect structures, and recompute the LPR.\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "X_new = X_pristine[:n_train] + X_defect[:n_add]\nLPR_test_new, rank = lpr(X_new, X_test, alpha)\nLPR_test_new = np.hstack(LPR_test_new)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We then visualize the change in the LPR with the\nmodification of the dataset by plotting the same PCA\nmap, but now colored by the ratio of new set of LPR\nvalues (after dataset modification) over the original\none.\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "fig = plt.figure(figsize=(5, 4), dpi=200)\nax = fig.add_subplot()\nim = ax.scatter(\n PCA_test[:, 0],\n PCA_test[:, 1],\n c=LPR_test_new / LPR_test,\n s=20,\n linewidths=0,\n # norm=LogNorm(vmin=10**rmin, vmax=10**rmax),\n cmap=\"OrRd\",\n)\nax.set_xlabel(\"PC1\")\nax.set_ylabel(\"PC2\")\nfig.colorbar(im, ax=ax, label=r\"LPR$_{\\mathrm{new}}$ / LPR$_{\\mathrm{old}}$\")\nax.tick_params(left=False, bottom=False, labelleft=False, labelbottom=False)\nplt.show()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "It is apparent that while the LPR stays more or less consistent for the\n4-coordinated atoms, it is significantly enhanced for the defective environments\nas a result of the inclusion of defective structures in the training set.\n\n" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.11.10" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} \ No newline at end of file diff --git a/_downloads/87860011d67b243cba3a72df0fa64d08/lode-linear.ipynb b/_downloads/87860011d67b243cba3a72df0fa64d08/lode-linear.ipynb new file mode 100644 index 00000000..d31e6771 --- /dev/null +++ b/_downloads/87860011d67b243cba3a72df0fa64d08/lode-linear.ipynb @@ -0,0 +1,446 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "\n# Long-distance Equivariants: a tutorial\n\n:Authors: Philip Loche [@PicoCentauri](https://github.com/PicoCentauri/),\n Kevin Huguenin-Dumittan [@kvhuguenin](https://github.com/kvhuguenin)\n\nThis tutorial explains how Long range equivariant descriptors can be constructed using\nrascaline and the resulting descriptors be used to construct a linear model with\nequisolve\n\nFirst, import all the necessary packages\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "import ase.io\nimport matplotlib.pyplot as plt\nimport metatensor\nimport numpy as np\nfrom equisolve.numpy.models.linear_model import Ridge\nfrom equisolve.utils.convert import ase_to_tensormap\nfrom rascaline import AtomicComposition, LodeSphericalExpansion, SphericalExpansion\nfrom rascaline.utils import PowerSpectrum" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Step 0: Prepare Data Set\n\n### Get structures\n\nWe take a small subset of the dimer dataset from [A. Grisafi et al.,\n2021](https://pubs.rsc.org/en/content/articlelanding/2021/sc/d0sc04934d)\nfor which we additionally calculated the forces. Each structure in the\ndataset contains two small organic molecules which are extended along a\ncertain direction in the subsequent structures.\n\nFor speeding up the calculations we already selected the first 130\n:download:`structures ` of the charge-charge molecule\npairs.\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "frames = ase.io.read(\"charge-charge.xyz\", \":\")" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Convert target properties to metatensor format\n\nIf we want to train models using the\n[equisolve](https://github.com/lab-cosmo/equisolve) package, we need to\nconvert the target properties (in this case, the energies and forces)\ninto the appropriate format #justequistorethings\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "y = ase_to_tensormap(frames, energy=\"energy\", forces=\"forces\")" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Step 1: Compute short-range and LODE features\n\nDefine hypers and get the expansion coefficients $\\langle anlm | \\rho_i \\rangle$\nand $\\langle anlm | V_i \\rangle$\n\nThe short-range and long-range descriptors have very similar hyperparameters. We\nhighlight the differences below.\n\nWe first define the hyperparameters for the short-range (SR) part. These will be used\nto create SOAP features.\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "SR_HYPERS = {\n \"cutoff\": 3.0,\n \"max_radial\": 6,\n \"max_angular\": 2,\n \"atomic_gaussian_width\": 0.3,\n \"center_atom_weight\": 1.0,\n \"radial_basis\": {\"Gto\": {}},\n \"cutoff_function\": {\"ShiftedCosine\": {\"width\": 0.5}},\n}" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "And next the hyperparaters for the LODE / long-range (LR) part\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "LR_HYPERS = {\n # Cutoff on which to project potential density\n \"cutoff\": 3.0,\n # keep max_radial slightly smaller than for SR part\n \"max_radial\": 3,\n # max_angular should be <= 4, more precisely, max_angular + potential_exponent < 10\n \"max_angular\": 2,\n # keep at >=1, WARNING: CUBIC SCALING, do not use values <0.5\n \"atomic_gaussian_width\": 3.0,\n \"center_atom_weight\": 1.0,\n \"radial_basis\": {\"Gto\": {}},\n # the exponent p that determines the 1/r^p potential\n \"potential_exponent\": 1,\n}" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We then use the above defined hyperparaters to define the per atom short range (sr)\nand long range (sr) descriptors.\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "calculator_sr = SphericalExpansion(**SR_HYPERS)\ncalculator_lr = LodeSphericalExpansion(**LR_HYPERS)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Note that LODE requires periodic systems. Therefore, if the data set does not come\nwith periodic boundary conditions by default you can not use the data set and you will\nface an error if you try to compute the features.\n\nAs you notices the calculation of the long range features takes significant more time\ncompared to the sr features.\n\nTaking a look at the output we find that the resulting\n:py:class:`metatensor.TensorMap` are quite similar in their structure. The short range\n:py:class:`metatensor.TensorMap` contains more blocks due to the higher\n``max_angular`` paramater we choosed above.\n\n### Generate the rotational invariants (power spectra)\n\nRotationally invariant features can be obtained by taking two of the calculators that\nwere defines above.\n\nFor the short-range part, we use the SOAP vector which is obtained by computing the\ninvariant combinations of the form $\\rho \\otimes \\rho$.\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "ps_calculator_sr = PowerSpectrum(calculator_sr, calculator_sr)\nps_sr = ps_calculator_sr.compute(frames, gradients=[\"positions\"])" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We calculate gradients with respect to pistions by providing the\n``gradients=[\"positions\"]`` option to the\n:py:meth:`rascaline.calculators.CalculatorBase.compute()` method.\n\nFor the long-range part, we combine the long-range descriptor $V$ with one a\nshort-range density $\\rho$ to get $\\rho \\otimes V$ features.\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "ps_calculator_lr = PowerSpectrum(calculator_sr, calculator_lr)\nps_lr = ps_calculator_lr.compute(systems=frames, gradients=[\"positions\"])" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Step 2: Building a Simple Linear SR + LR Model with energy baselining\n\n### Preprocessing (model dependent)\n\nFor our current model, we do not wish to treat the individual center and\nneighbor species separately. Thus, we move the ``\"species_center\"`` key\ninto the ``sample`` direction, over which we will later sum over.\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "ps_sr = ps_sr.keys_to_samples(\"species_center\")\nps_lr = ps_lr.keys_to_samples(\"species_center\")" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "For linear models only: Sum features up over atoms (``samples``) in the same\nstructure.\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "sample_names_to_sum = [\"center\", \"species_center\"]\n\nps_sr = metatensor.sum_over_samples(ps_sr, sample_names=sample_names_to_sum)\nps_lr = metatensor.sum_over_samples(ps_lr, sample_names=sample_names_to_sum)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Initialize tensormaps for energy baselining\n\nWe add a simple extra descriptor :py:class:`rascaline.AtomicComposition` that stores\nhow many atoms of each chemical species are contained in the structures. This is used\nfor energy baselining.\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "calculator_co = AtomicComposition(per_structure=False)\ndescriptor_co = calculator_co.compute(frames, gradients=[\"positions\"])\n\nco = descriptor_co.keys_to_properties([\"species_center\"])\nco = metatensor.sum_over_samples(co, sample_names=[\"center\"])" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The :py:class:`rascaline.AtomicComposition` calculator also allows to directly perform\nthe the sum over center atoms by using the following lines.\n\n.. code:: python\n\n descriptor_co = AtomicComposition(per_structure=True).compute(**compute_args)\n co = descriptor_co.keys_to_properties([\"species_center\"])\n\n### Stack all the features together for linear model\n\nA linear model on SR + LR features can be thought of as a linear model\nbuilt on a feature vector that is simply the concatenation of the SR and\nLR features.\n\nFurthermore, energy baselining can be performed by concatenating the information about\nchemical species as well. There is an metatensor function called\n:py:func:`metatensor.join()` for this purpose. Formally, we can write for the SR\nmodel.\n\nX_sr: $1 \\oplus \\left(\\rho \\otimes \\rho\\right)$\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "X_sr = metatensor.join([co, ps_sr], axis=\"properties\")" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We used the ``axis=\"properties\"`` parameter since we want to concatenate along the\nfeatures/properties dimensions.\n\nFor the long range model we can formerly write\n\nX_lr: $1 \\oplus \\left(\\rho \\otimes \\rho\\right) \\oplus \\left(\\rho \\otimes\nV\\right)$\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "X_lr = metatensor.join([co, ps_sr, ps_lr], axis=\"properties\")" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The features are now ready! Let us now perform some actual learning. Below we\ninitialize two instances of the :py:class:`equisolve.numpy.models.linear_model.Ridge`\nclass. :py:class:`equisolve.numpy.models.linear_model.Ridge` will perform a regression\nwith respect to ``\"values\"`` (energies) and ``\"positions\"`` gradients (forces).\n\nIf you only want a fit with respect to energies you can remove the gradients with\n``metatensor.remove_gradients()``\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "clf_sr = Ridge()\nclf_lr = Ridge()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Split training and target data into train and test dat\n\nSplit the training and the test data by the distance $r_{\\rm\ntrain}=6\\,\\mathrm{\u00c5}$ between the center of mass of the two molecules. A structure\nwith a $r_{\\rm train}<6 {\\rm \u00c5}$ is used for training.\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "r_cut = 6.0" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We calculate the indices from the dataset by list comprehension. The center of mass\ndistance is stored in the ``\"distance\"\"`` attribute.\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "idx_train = [i for i, f in enumerate(frames) if f.info[\"distance\"] < r_cut]\nidx_test = [i for i, f in enumerate(frames) if f.info[\"distance\"] >= r_cut]" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "For doing the split we define two ``Labels`` instances and combine them in a\n:py:class:`List`.\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "samples_train = metatensor.Labels([\"structure\"], np.reshape(idx_train, (-1, 1)))\nsamples_test = metatensor.Labels([\"structure\"], np.reshape(idx_test, (-1, 1)))\ngrouped_labels = [samples_train, samples_test]" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "That we use as input to the :py:func:`metatensor.split()` function\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "X_sr_train, X_sr_test = metatensor.split(\n X_sr, axis=\"samples\", grouped_labels=grouped_labels\n)\n\nX_lr_train, X_lr_test = metatensor.split(\n X_lr, axis=\"samples\", grouped_labels=grouped_labels\n)\n\ny_train, y_test = metatensor.split(y, axis=\"samples\", grouped_labels=grouped_labels)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Fit the model\n\nFor this model, we use a very simple regularization scheme where all features are\nregularized in the same way (the amount being controlled by the parameter ``alpha``).\nFor more advanced regularization schemes (regularizing energies and forces differently\nand/or the SR and LR parts differently), see further down.\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "clf_sr.fit(X_sr_train, y_train, alpha=1e-6)\nclf_lr.fit(X_lr_train, y_train, alpha=1e-6)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Evaluation\n\nFor evaluating the model we calculate the RMSEs using the ``score()`` method. With the\n``parameter_key`` parameter we select which RMSE should be calculated.\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "print(\n \"SR: RMSE energies = \"\n f\"{clf_sr.score(X_sr_test, y_test, parameter_key='values')[0]:.3f} eV\"\n)\nprint(\n \"SR: RMSE forces = \"\n f\"{clf_sr.score(X_sr_test, y_test, parameter_key='positions')[0]:.3f} eV/\u00c5\"\n)\n\nprint(\n \"LR: RMSE energies = \"\n f\"{clf_lr.score(X_lr_test, y_test, parameter_key='values')[0]:.3f} eV\"\n)\nprint(\n \"LR: RMSE forces = \"\n f\"{clf_lr.score(X_lr_test, y_test, parameter_key='positions')[0]:.3f} eV/\u00c5\"\n)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We find that the RMSE of the energy and the force of the LR model is smaller compared\nto the SR model. From this we conclude that the LR model performs better for the\nselection of the dataset.\n\nWe additionally, can plot of the binding energy as a function of the distance. For the\nplot we select some properties from the dataset\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "dist = np.array([f.info[\"distance\"] for f in frames])\nenergies = np.array([f.info[\"energy\"] for f in frames])\nmonomer_energies = np.array([f.info[\"energyA\"] + f.info[\"energyB\"] for f in frames])" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "and select only the indices corresponding to our test set.\n\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Next we calculate the predicted SR and LR ``TensorMaps``.\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "y_sr_pred = clf_sr.predict(X_sr)\ny_lr_pred = clf_lr.predict(X_lr)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "And, finally perform the plot.\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "plt.scatter(\n dist, y.block().values[:, 0] - monomer_energies, label=\"target data\", color=\"black\"\n)\n\nplt.scatter(\n dist,\n y_sr_pred.block().values[:, 0] - monomer_energies,\n label=\"short range model\",\n marker=\"x\",\n)\n\nplt.scatter(\n dist,\n y_lr_pred.block().values[:, 0] - monomer_energies,\n label=\"long range model\",\n marker=\"s\",\n facecolor=\"None\",\n edgecolor=\"orange\",\n)\n\nplt.xlabel(\"center of mass distance in \u00c5\")\nplt.ylabel(r\"$E - E_\\mathrm{monomer}$ in eV\")\nplt.axvline(r_cut, c=\"red\", label=r\"$r_\\mathrm{train}$\")\n\nplt.legend()\nplt.tight_layout()\nplt.show()" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.11.10" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} \ No newline at end of file diff --git a/_downloads/89f739150c737d83b9f5bb306c62ba22/lode-linear.py b/_downloads/89f739150c737d83b9f5bb306c62ba22/lode-linear.py new file mode 100644 index 00000000..6ac4c0b8 --- /dev/null +++ b/_downloads/89f739150c737d83b9f5bb306c62ba22/lode-linear.py @@ -0,0 +1,395 @@ +""" +Long-distance Equivariants: a tutorial +====================================== + +:Authors: Philip Loche `@PicoCentauri `_, + Kevin Huguenin-Dumittan `@kvhuguenin `_ + +This tutorial explains how Long range equivariant descriptors can be constructed using +rascaline and the resulting descriptors be used to construct a linear model with +equisolve + +First, import all the necessary packages +""" + +# %% + +import ase.io +import matplotlib.pyplot as plt +import metatensor +import numpy as np +from equisolve.numpy.models.linear_model import Ridge +from equisolve.utils.convert import ase_to_tensormap +from rascaline import AtomicComposition, LodeSphericalExpansion, SphericalExpansion +from rascaline.utils import PowerSpectrum + + +# %% +# +# Step 0: Prepare Data Set +# ------------------------ +# +# Get structures +# ~~~~~~~~~~~~~~ +# +# We take a small subset of the dimer dataset from `A. Grisafi et al., +# 2021 `_ +# for which we additionally calculated the forces. Each structure in the +# dataset contains two small organic molecules which are extended along a +# certain direction in the subsequent structures. +# +# For speeding up the calculations we already selected the first 130 +# :download:`structures ` of the charge-charge molecule +# pairs. + +frames = ase.io.read("charge-charge.xyz", ":") + + +# %% +# +# Convert target properties to metatensor format +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# If we want to train models using the +# `equisolve `_ package, we need to +# convert the target properties (in this case, the energies and forces) +# into the appropriate format #justequistorethings + +y = ase_to_tensormap(frames, energy="energy", forces="forces") + + +# %% +# +# Step 1: Compute short-range and LODE features +# --------------------------------------------- +# +# Define hypers and get the expansion coefficients :math:`\langle anlm | \rho_i \rangle` +# and :math:`\langle anlm | V_i \rangle` +# +# The short-range and long-range descriptors have very similar hyperparameters. We +# highlight the differences below. +# +# We first define the hyperparameters for the short-range (SR) part. These will be used +# to create SOAP features. + +SR_HYPERS = { + "cutoff": 3.0, + "max_radial": 6, + "max_angular": 2, + "atomic_gaussian_width": 0.3, + "center_atom_weight": 1.0, + "radial_basis": {"Gto": {}}, + "cutoff_function": {"ShiftedCosine": {"width": 0.5}}, +} + + +# %% +# +# And next the hyperparaters for the LODE / long-range (LR) part + + +LR_HYPERS = { + # Cutoff on which to project potential density + "cutoff": 3.0, + # keep max_radial slightly smaller than for SR part + "max_radial": 3, + # max_angular should be <= 4, more precisely, max_angular + potential_exponent < 10 + "max_angular": 2, + # keep at >=1, WARNING: CUBIC SCALING, do not use values <0.5 + "atomic_gaussian_width": 3.0, + "center_atom_weight": 1.0, + "radial_basis": {"Gto": {}}, + # the exponent p that determines the 1/r^p potential + "potential_exponent": 1, +} + + +# %% +# We then use the above defined hyperparaters to define the per atom short range (sr) +# and long range (sr) descriptors. + +calculator_sr = SphericalExpansion(**SR_HYPERS) +calculator_lr = LodeSphericalExpansion(**LR_HYPERS) + + +# %% +# +# Note that LODE requires periodic systems. Therefore, if the data set does not come +# with periodic boundary conditions by default you can not use the data set and you will +# face an error if you try to compute the features. +# +# As you notices the calculation of the long range features takes significant more time +# compared to the sr features. +# +# Taking a look at the output we find that the resulting +# :py:class:`metatensor.TensorMap` are quite similar in their structure. The short range +# :py:class:`metatensor.TensorMap` contains more blocks due to the higher +# ``max_angular`` paramater we choosed above. +# +# Generate the rotational invariants (power spectra) +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Rotationally invariant features can be obtained by taking two of the calculators that +# were defines above. +# +# For the short-range part, we use the SOAP vector which is obtained by computing the +# invariant combinations of the form :math:`\rho \otimes \rho`. + +ps_calculator_sr = PowerSpectrum(calculator_sr, calculator_sr) +ps_sr = ps_calculator_sr.compute(frames, gradients=["positions"]) + + +# %% +# +# We calculate gradients with respect to pistions by providing the +# ``gradients=["positions"]`` option to the +# :py:meth:`rascaline.calculators.CalculatorBase.compute()` method. +# +# For the long-range part, we combine the long-range descriptor :math:`V` with one a +# short-range density :math:`\rho` to get :math:`\rho \otimes V` features. + +ps_calculator_lr = PowerSpectrum(calculator_sr, calculator_lr) +ps_lr = ps_calculator_lr.compute(systems=frames, gradients=["positions"]) + + +# %% +# +# Step 2: Building a Simple Linear SR + LR Model with energy baselining +# --------------------------------------------------------------------- +# +# Preprocessing (model dependent) +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# For our current model, we do not wish to treat the individual center and +# neighbor species separately. Thus, we move the ``"species_center"`` key +# into the ``sample`` direction, over which we will later sum over. + +ps_sr = ps_sr.keys_to_samples("species_center") +ps_lr = ps_lr.keys_to_samples("species_center") + + +# %% +# +# For linear models only: Sum features up over atoms (``samples``) in the same +# structure. + +sample_names_to_sum = ["center", "species_center"] + +ps_sr = metatensor.sum_over_samples(ps_sr, sample_names=sample_names_to_sum) +ps_lr = metatensor.sum_over_samples(ps_lr, sample_names=sample_names_to_sum) + + +# %% +# +# Initialize tensormaps for energy baselining +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# We add a simple extra descriptor :py:class:`rascaline.AtomicComposition` that stores +# how many atoms of each chemical species are contained in the structures. This is used +# for energy baselining. + +calculator_co = AtomicComposition(per_structure=False) +descriptor_co = calculator_co.compute(frames, gradients=["positions"]) + +co = descriptor_co.keys_to_properties(["species_center"]) +co = metatensor.sum_over_samples(co, sample_names=["center"]) + +# %% +# +# The :py:class:`rascaline.AtomicComposition` calculator also allows to directly perform +# the the sum over center atoms by using the following lines. +# +# .. code:: python +# +# descriptor_co = AtomicComposition(per_structure=True).compute(**compute_args) +# co = descriptor_co.keys_to_properties(["species_center"]) +# +# Stack all the features together for linear model +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# A linear model on SR + LR features can be thought of as a linear model +# built on a feature vector that is simply the concatenation of the SR and +# LR features. +# +# Furthermore, energy baselining can be performed by concatenating the information about +# chemical species as well. There is an metatensor function called +# :py:func:`metatensor.join()` for this purpose. Formally, we can write for the SR +# model. +# +# X_sr: :math:`1 \oplus \left(\rho \otimes \rho\right)` + +X_sr = metatensor.join([co, ps_sr], axis="properties") + + +# %% +# +# We used the ``axis="properties"`` parameter since we want to concatenate along the +# features/properties dimensions. +# +# For the long range model we can formerly write +# +# X_lr: :math:`1 \oplus \left(\rho \otimes \rho\right) \oplus \left(\rho \otimes +# V\right)` + +X_lr = metatensor.join([co, ps_sr, ps_lr], axis="properties") + + +# %% +# +# The features are now ready! Let us now perform some actual learning. Below we +# initialize two instances of the :py:class:`equisolve.numpy.models.linear_model.Ridge` +# class. :py:class:`equisolve.numpy.models.linear_model.Ridge` will perform a regression +# with respect to ``"values"`` (energies) and ``"positions"`` gradients (forces). +# +# If you only want a fit with respect to energies you can remove the gradients with +# ``metatensor.remove_gradients()`` + +clf_sr = Ridge() +clf_lr = Ridge() + + +# %% +# +# Split training and target data into train and test dat +# ------------------------------------------------------ +# +# Split the training and the test data by the distance :math:`r_{\rm +# train}=6\,\mathrm{Å}` between the center of mass of the two molecules. A structure +# with a :math:`r_{\rm train}<6 {\rm Å}` is used for training. + +r_cut = 6.0 + + +# %% +# +# We calculate the indices from the dataset by list comprehension. The center of mass +# distance is stored in the ``"distance""`` attribute. + +idx_train = [i for i, f in enumerate(frames) if f.info["distance"] < r_cut] +idx_test = [i for i, f in enumerate(frames) if f.info["distance"] >= r_cut] + + +# %% +# +# For doing the split we define two ``Labels`` instances and combine them in a +# :py:class:`List`. + +samples_train = metatensor.Labels(["structure"], np.reshape(idx_train, (-1, 1))) +samples_test = metatensor.Labels(["structure"], np.reshape(idx_test, (-1, 1))) +grouped_labels = [samples_train, samples_test] + + +# %% +# +# That we use as input to the :py:func:`metatensor.split()` function + +X_sr_train, X_sr_test = metatensor.split( + X_sr, axis="samples", grouped_labels=grouped_labels +) + +X_lr_train, X_lr_test = metatensor.split( + X_lr, axis="samples", grouped_labels=grouped_labels +) + +y_train, y_test = metatensor.split(y, axis="samples", grouped_labels=grouped_labels) + + +# %% +# +# Fit the model +# ------------- +# +# For this model, we use a very simple regularization scheme where all features are +# regularized in the same way (the amount being controlled by the parameter ``alpha``). +# For more advanced regularization schemes (regularizing energies and forces differently +# and/or the SR and LR parts differently), see further down. + +clf_sr.fit(X_sr_train, y_train, alpha=1e-6) +clf_lr.fit(X_lr_train, y_train, alpha=1e-6) + + +# %% +# +# Evaluation +# ---------- +# +# For evaluating the model we calculate the RMSEs using the ``score()`` method. With the +# ``parameter_key`` parameter we select which RMSE should be calculated. + +print( + "SR: RMSE energies = " + f"{clf_sr.score(X_sr_test, y_test, parameter_key='values')[0]:.3f} eV" +) +print( + "SR: RMSE forces = " + f"{clf_sr.score(X_sr_test, y_test, parameter_key='positions')[0]:.3f} eV/Å" +) + +print( + "LR: RMSE energies = " + f"{clf_lr.score(X_lr_test, y_test, parameter_key='values')[0]:.3f} eV" +) +print( + "LR: RMSE forces = " + f"{clf_lr.score(X_lr_test, y_test, parameter_key='positions')[0]:.3f} eV/Å" +) + + +# %% +# +# We find that the RMSE of the energy and the force of the LR model is smaller compared +# to the SR model. From this we conclude that the LR model performs better for the +# selection of the dataset. +# +# We additionally, can plot of the binding energy as a function of the distance. For the +# plot we select some properties from the dataset + +dist = np.array([f.info["distance"] for f in frames]) +energies = np.array([f.info["energy"] for f in frames]) +monomer_energies = np.array([f.info["energyA"] + f.info["energyB"] for f in frames]) + + +# %% +# +# and select only the indices corresponding to our test set. + + +# %% +# +# Next we calculate the predicted SR and LR ``TensorMaps``. + +y_sr_pred = clf_sr.predict(X_sr) +y_lr_pred = clf_lr.predict(X_lr) + + +# %% +# +# And, finally perform the plot. + +plt.scatter( + dist, y.block().values[:, 0] - monomer_energies, label="target data", color="black" +) + +plt.scatter( + dist, + y_sr_pred.block().values[:, 0] - monomer_energies, + label="short range model", + marker="x", +) + +plt.scatter( + dist, + y_lr_pred.block().values[:, 0] - monomer_energies, + label="long range model", + marker="s", + facecolor="None", + edgecolor="orange", +) + +plt.xlabel("center of mass distance in Å") +plt.ylabel(r"$E - E_\mathrm{monomer}$ in eV") +plt.axvline(r_cut, c="red", label=r"$r_\mathrm{train}$") + +plt.legend() +plt.tight_layout() +plt.show() diff --git a/_downloads/94018b4b1798aa421f0916f03cd04ae9/data.zip b/_downloads/94018b4b1798aa421f0916f03cd04ae9/data.zip new file mode 100644 index 00000000..08f83947 Binary files /dev/null and b/_downloads/94018b4b1798aa421f0916f03cd04ae9/data.zip differ diff --git a/_downloads/9686437d3cc3327b109d561fa42242c0/pi-metad.zip b/_downloads/9686437d3cc3327b109d561fa42242c0/pi-metad.zip new file mode 100644 index 00000000..42752323 Binary files /dev/null and b/_downloads/9686437d3cc3327b109d561fa42242c0/pi-metad.zip differ diff --git a/_downloads/9ae4cdde3e7099e2bf76d10302eae3e8/environment.yml b/_downloads/9ae4cdde3e7099e2bf76d10302eae3e8/environment.yml new file mode 100644 index 00000000..c2d0ea1e --- /dev/null +++ b/_downloads/9ae4cdde3e7099e2bf76d10302eae3e8/environment.yml @@ -0,0 +1,12 @@ +channels: + - conda-forge +dependencies: + - python=3.11 + - pip + - lammps + - pip: + - ase==3.22.1 + - chemiscope>=0.7 + - ipi + - matplotlib + - skmatter diff --git a/_downloads/a00b581f2f0e1dd89a20b5a5d0f66025/environment.yml b/_downloads/a00b581f2f0e1dd89a20b5a5d0f66025/environment.yml new file mode 100644 index 00000000..ac282979 --- /dev/null +++ b/_downloads/a00b581f2f0e1dd89a20b5a5d0f66025/environment.yml @@ -0,0 +1,26 @@ +channels: + - conda-forge +dependencies: + - python>=3.11 + - pip + - graphviz + - pyscf=2.3.0 + - rust>=1.65 + - pip: + - pyscfad @ git+https://github.com/fishjojo/pyscfad.git@ml#egg=pyscfad + - ase==3.22.1 + - seekpath + - requests + - metatensor + - metatensor-core + - metatensor-learn + - metatensor-operations + - metatensor-torch + - --extra-index-url https://download.pytorch.org/whl/cpu + - rascaline-torch @ git+https://github.com/luthaf/rascaline#subdirectory=python/rascaline-torch + - lightning + - xitorch + - keras_core + - tensorboard + - torchviz + - mlelec @ git+https://github.com/curiosity54/mlelec.git@tutorial_periodic#egg=mlelec diff --git a/_downloads/a17a480a207dc60b848e8b91a240947d/periodic-hamiltonian.ipynb b/_downloads/a17a480a207dc60b848e8b91a240947d/periodic-hamiltonian.ipynb new file mode 100644 index 00000000..1567410b --- /dev/null +++ b/_downloads/a17a480a207dc60b848e8b91a240947d/periodic-hamiltonian.ipynb @@ -0,0 +1,677 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "\n# Periodic Hamiltonian learning\n\n:Authors: Paolo Pegolo [@ppegolo](https://github.com/ppegolo)_,\n Jigyasa Nigam [@curiosity54](https://github.com/curiosity54)_\n\nThis tutorial explains how to train a machine learning model for the\nelectronic Hamiltonian of a periodic system. Even though we focus on\nperiodic systems, the code and techniques presented here can be directly\ntransferred to molecules.\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "First, import the necessary packages\n\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "import os\nimport warnings\nimport zipfile\n\nimport matplotlib.image as mpimg\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport requests\nimport torch\nfrom matplotlib.animation import FuncAnimation\nfrom mlelec.data.derived_properties import compute_eigenvalues\nfrom mlelec.data.mldataset import MLDataset\nfrom mlelec.data.qmdataset import QMDataset\nfrom mlelec.models.equivariant_lightning import LitEquivariantModel, MSELoss\nfrom mlelec.utils.pbc_utils import blocks_to_matrix\nfrom mlelec.utils.plot_utils import plot_bands_frame\n\n\nwarnings.filterwarnings(\"ignore\")\ntorch.set_default_dtype(torch.float64)\n\n# sphinx_gallery_thumbnail_number = 3" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Get Data and Prepare Data Set\n\n\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The data set contains 35 distorted graphene unit cells containing 2\natoms. The reference density functional theory (DFT) calculations are\nperformed with [CP2K](https://www.cp2k.org/)_ using a minimal\n[STO-3G](https://en.wikipedia.org/wiki/STO-nG_basis_sets)_ basis and\nthe [PBE](https://doi.org/10.1103/PhysRevLett.77.3865)_ functional.\nThe Kohn-Sham equations are solved on a Monkhorst-Pack grid of\n$15\\times 15\\times 1$ points in the Brillouin zone of the crystal.\n\n\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Obtain structures and DFT data\n\nGenerating training structures requires running a suitable DFT code,\nand converting the output data in a format that can be processed by\nthe ML library ``mlelec``. Given that it takes some time to run even\nthese small calculations, we provide pre-computed data, but you can\nalso find instructions on how to generate data from scratch.\n\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### Run your own cp2k calculations\n\nIf you have computational resources, you can run the DFT calculations\nneeded to produce the data set. [This other\ntutorial](https://tinyurl.com/cp2krun)_ in the atomistic cookbook can\nhelp you set up the CP2K calculations for this data set, using the\n``reftraj_hamiltonian.cp2k`` file provided in ``data/``. To do the same\nfor another data set, adapt the reftraj file.\nWe will provide here some of the functions in the [batch-cp2k\ntutorial](https://tinyurl.com/cp2krun)_ that need to be adapted to the\ncurrent data set. Note however you will have to modify these and combine\nthem with other tutorials to actually generate the data.\n\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Start by importing all the modules from the [batch-cp2k\ntutorial](https://tinyurl.com/cp2krun)_ and run the cell to install\nCP2K. Run also the cells up to the one defining ``write_cp2k_in``.\nThe following code snippet defines a slighly modified version of that function,\nallowing for non-orthorombic supercell, and accounting for the reftraj file\nname change.\n\n\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + ".. code:: python\n\n def write_cp2k_in(\n fname: str,\n project_name: str,\n last_snapshot: int,\n cell_a: List[float],\n cell_b: List[float],\n cell_c: List[float],\n ) -> None:\n \"\"\"Writes a cp2k input file from a template.\n\n Importantly, it writes the location of the basis set definitions,\n determined from the path of the system CP2K install to the input file.\n \"\"\"\n\n cp2k_in = open(\"reftraj_hamiltonian.cp2k\", \"r\").read()\n\n cp2k_in = cp2k_in.replace(\"//PROJECT//\", project_name)\n cp2k_in = cp2k_in.replace(\"//LAST_SNAPSHOT//\", str(last_snapshot))\n cp2k_in = cp2k_in.replace(\"//CELL_A//\", \" \".join([f\"{c:.6f}\" for c in cell_a]))\n cp2k_in = cp2k_in.replace(\"//CELL_B//\", \" \".join([f\"{c:.6f}\" for c in cell_b]))\n cp2k_in = cp2k_in.replace(\"//CELL_C//\", \" \".join([f\"{c:.6f}\" for c in cell_c]))\n\n with open(fname, \"w\") as f:\n f.write(cp2k_in)\n\n\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Unlike the [batch-cp2k tutorial](https://tinyurl.com/cp2krun)_, the\ncurrent data set includes a single stoichiometry, $\\mathrm{C_2}$.\nTherefore, you can run this cell to set the calculation scripts up.\n\n\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + ".. code:: python\n\n project_name = 'graphene'\n frames = ase_read('C2.xyz', index=':')\n os.makedirs(project_name, exist_ok=True)\n os.makedirs(f\"{project_name}/FOCK\", exist_ok=True)\n os.makedirs(f\"{project_name}/OVER\", exist_ok=True)\n\n write_cp2k_in(\n f\"{project_name}/in.cp2k\",\n project_name=project_name,\n last_snapshot=len(frames),\n cell_a=frames[0].cell.array[0],\n cell_b=frames[0].cell.array[1],\n cell_c=frames[0].cell.array[2],\n )\n\n ase_write(f\"{project_name}/init.xyz\", frames[0])\n write_reftraj(f\"{project_name}/reftraj.xyz\", frames)\n write_cellfile(f\"{project_name}/reftraj.cell\", frames)\n\n\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The CP2K calculations can be simply run using:\n\n\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + ".. code:: python\n\n subprocess.run((\n f\"cp2k.ssmp -i {project_name}/in.cp2k \"\n \"> {project_name}/out.cp2k\"\n ),\n shell=True)\n\n\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Once the calculations are done, we can parse the results with:\n\n\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + ".. code:: python\n\n from scipy.sparse import csr_matrix\n\n nao = 10\n ifr = 1\n fock = []\n over = []\n with open(f\"{project_name}/out.cp2k\", \"r\") as outfile:\n T_lists = [] # List to hold all T_list instances\n while True:\n line = outfile.readline()\n if not line:\n break\n if line.strip().split()[:3] != [\"KS\", \"CSR\", \"write|\"]:\n continue\n else:\n nT = int(line.strip().split()[3])\n outfile.readline() # Skip the next line if necessary\n T_list = [] # Initialize a new T_list for this block\n for _ in range(nT):\n line = outfile.readline()\n if not line:\n break\n T_list.append([np.int32(j) for j in line.strip().split()[1:4]])\n T_list = np.array(T_list)\n T_lists.append(T_list) # Append the T_list to T_lists\n fock_ = {}\n over_ = {}\n for iT, T in enumerate(\n T_list\n ): # Loop through the translations and load matrices\n T = T.tolist()\n r, c, data = np.loadtxt(\n (\n f\"{project_name}/FOCK/{project_name}\"\n f\"-KS_SPIN_1_R_{iT+1}-1_{ifr}.csr\"\n ),\n unpack=True,\n )\n r = np.int32(r - 1)\n c = np.int32(c - 1)\n fock_[tuple(T)] = csr_matrix(\n (data, (r, c)), shape=(nao, nao)\n ).toarray()\n\n r, c, data = np.loadtxt(\n (\n f\"{project_name}/OVER/{project_name}\"\n f\"-S_SPIN_1_R_{iT+1}-1_{ifr}.csr\"\n ),\n unpack=True,\n )\n r = np.int32(r - 1)\n c = np.int32(c - 1)\n over_[tuple(T)] = csr_matrix(\n (data, (r, c)), shape=(nao, nao)\n ).toarray()\n fock.append(fock_)\n over.append(over_)\n ifr += 1\n\n\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "You can now save the matrices to ``.npy`` files, and a file with the\nk-grids used in the calculations.\n\n\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + ".. code:: python\n\n os.makedirs(\"data\", exist_ok=True)\n # Save the Hamiltonians\n np.save(\"data/graphene_fock.npy\", fock)\n # Save the overlaps\n np.save(\"data/graphene_ovlp.npy\", over)\n # Write a file with the k-grids, one line per structure\n np.savetxt('data/kmesh.dat', [[15,15,1]]*len(frames), fmt='%d')\n\n\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### Download precomputed data\n\n\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "For the sake of simplicity, you can also download precomputed data and\nrun just the machine learning part of the notebook using these data.\n\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "filename = \"precomputed.zip\"\nif not os.path.exists(filename):\n url = (\n \"https://github.com/curiosity54/mlelec/raw/\"\n \"tutorial_periodic/examples/periodic_tutorial/precomputed.zip\"\n )\n response = requests.get(url)\n response.raise_for_status()\n with open(filename, \"wb\") as f:\n f.write(response.content)\n\nwith zipfile.ZipFile(filename, \"r\") as zip_ref:\n zip_ref.extractall(\"./\")" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### Periodic Hamiltonians in real and reciprocal space\n\nThe DFT calculations for the dataset above were performed using a\n*minimal* STO-3G basis. The basis set is specified for each species\nusing three quantum numbers, $n$, $l$, $m$. $n$\nis usually a natural number relating to the *radial* extent or\nresolution whereas $l$ and $m$ specify the *angular\ncomponents* determining the shape of the orbital and its orientation in\nspace. For example, $1s$ orbitals correspond to $n=1$,\n$l=0$ and $m=0$, while a $2p_z$ orbital corresponds to\n$n=2$, $l=1$ and $m=0$. For the STO-3G basis-set,\nthese quantum numbers for Carbon (identified by its atomic number) are\ngiven as follows.\n\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "basis = \"sto-3g\"\norbitals = {\n \"sto-3g\": {6: [[1, 0, 0], [2, 0, 0], [2, 1, -1], [2, 1, 0], [2, 1, 1]]},\n}" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "For each *frame* which of either train and test structures, the QM data\ncomprises the configuration, along with the corresponding *overlap* and\n*Hamiltonian* (used interchangeably with *Fock*) matrices in the basis\nspecified above, as well as the $k$-point grid that was used for the\ncalculation.\n\nNote that we are currently specifying these matrices in *real-space*,\n$\\mathbf{H}(\\mathbf{t})$ , such that the element\n$\\langle \\mathbf{0} i nlm| \\hat{H}| \\mathbf{t} i' n'l'm'\\rangle$\nindicates the interaction between orbital $nlm$ on atom $i$\nin the undisplaced cell (denoted by the null lattice translation,\n$\\mathbf{t}=\\mathbf{0}$) and orbital $n'l'm'$ on atom\n$i'$ in a periodic copy of the unit cell translated by\n$\\mathbf{t}$. A short-hand notation for\n$\\langle \\mathbf{0} i nlm| \\hat{H}| \\mathbf{t} i' n'l'm'\\rangle$\nis $H_{\\small\\substack{i,nlm\\\\i',n'l'm'}}(\\mathbf{t})$\n\n\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + ".. figure:: graphene_lattice.png\n :alt: Representation of a graphene unit cell and some replicas.\n :width: 600px\n\n Representation of a graphene unit cell and its\n $3 \\times 3 \\times 1$ replicas in real space. The central cell\n is denoted by $\\mathbf{t}=(0,0,0)$, while the cells translated\n by a single lattice vector along directions 1 and 2 are denoted by\n $\\mathbf{t}=(1,0,0)$ and $\\mathbf{t}=(0,1,0)$,\n respectively. The Hamiltonian matrix element between the $1s$\n orbital on atom $i$ in the central unit cell and the\n $2p_z$ orbital on atom $i'$ in the\n $\\mathbf{t}=(1,0,0)$ cell is schematically represented.\n\n\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Alternatively, we can provide the matrices in *reciprocal* (or\nFourier, $k$) space. These are related to the real-space matrices\nby a *Bloch sum*,\n\n\\begin{align}\\mathbf{H}(\\mathbf{k})=\\sum_{\\mathbf{t}}\\\n e^{i\\mathbf{k}\\cdot\\mathbf{t}} \\mathbf{H}(\\mathbf{t}).\\end{align}\n\n\nIn the case the input matrices are in reciprocal space, there should be\none matrix per $k$-point in the grid.\n\n\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### A ``QMDataset`` to store the DFT data\nThe ``QMDataset`` class holds all the relevant data\nobtained from a quantum-mechanical (in this case, DFT) calculation,\ncombining information from the files containing structures,\nHamiltonians and overlap matrices, and $k$-point mesh.\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "qmdata = QMDataset.from_file(\n # File containing the atomistic structures\n frames_path=\"data/C2.xyz\",\n # File containing the Hamiltonian (of Fock) matrices\n fock_realspace_path=\"graphene_fock.npy\",\n # File containing the overlap matrices\n overlap_realspace_path=\"graphene_ovlp.npy\",\n # File containing the k-point grids used for the DFT calculations\n kmesh_path=\"kmesh.dat\",\n # Physical dimensionality of the system. Graphene is a 2D material\n dimension=2,\n # Device where to run the calculations\n # (can be 'cpu' or 'cuda', if GPUs are available)\n device=\"cpu\",\n # Name of the basis set used for the calculations\n orbs_name=basis,\n # List of quantum numbers associated with the basis set orbitals\n orbs=orbitals[basis],\n)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Quantities stored in ``QMDataset`` can be accessed as attributes,\ne.g.\u00a0``qmdata.fock_realspace`` is a list (one element per structure) of\ndictionaries labeled by the indices of the unit cell real-space\ntranslations containing ``torch.Tensor``.\n\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "structure_idx = 0\nrealspace_translation = 0, 0, 0\nprint(f\"The real-space Hamiltonian matrix for structure {structure_idx} labeled by\")\nprint(f\"translation T={realspace_translation} is:\")\nprint(f\"{qmdata.fock_realspace[structure_idx][realspace_translation]}\")" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Machine learning data set\n\n\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### Symmetries of the Hamiltonian matrix\n\n\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The data stored in ``QMDataset`` can be transformed into a format that\nis optimal for machine learning modeling by leveraging the underlying\n*physical symmetries* that characterize the atomistic structure, the\nbasis set, and their associated matrices.\n\nThe Hamiltonian matrix is a complex learning target, indexed by two\natoms and the orbitals centered on them. Each\n$\\mathbf{H}(\\mathbf{k})$ is a *Hermitian* matrix, while in real\nspace, periodicity introduces a *symmetry over translation pairs* such\nthat $\\mathbf{H}(-\\mathbf{t}) = \\mathbf{H}(\\mathbf{t})^\\dagger$,\nwhere the dagger, $\\dagger$, denotes Hermitian conjugation.\n\nTo address the symmetries associated with swapping atomic indices or\norbital labels, we divide the matrix into *blocks labeled by pairs of\natom types*.\n\n- ``block_type = 0``, or *on-site* blocks, consist of elements\n corresponding to the interaction of orbitals on the same atom,\n $i = i'$.\n\n- ``block_type = 2``, or *cross-species* blocks, consist of elements\n corresponding to orbitals centered on atoms of distinct species.\n Since the two atoms can be distinguished, they can be consistently\n arranged in a predetermined order.\n\n- ``block_type = 1, -1``, or *same-species* blocks, consist of\n elements corresponding to orbitals centered on distinct atoms of the\n same species. As these atoms are indistinguishable and cannot be\n ordered definitively, the pair must be symmetrized for permutations.\n We construct symmetric and antisymmetric combinations\n $(\\mathbf{H}_{\\small\\substack{i,nlm\\\\i',n'l'm'}}(\\mathbf{t})\\pm\\\n \\mathbf{H}_{\\small\\substack{i',nlm\\\\i,n'l'm'}}(\\mathbf{-t}))$\n that correspond to ``block_type`` $+1$ and $-1$,\n respectively.\n\n\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### Equivariant structure of the Hamiltonians\n\n\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Even though the Hamiltonian operator under consideration is invariant,\n*its representation transforms under the action of structural rotations\nand inversions* due to the choice of the basis functions. Each of the\nblocks has elements of the form\n$\\langle\\mathbf{0}inlm|\\hat{H}|\\mathbf{t}i'n'l'm'\\rangle$, which\nare in an *uncoupled* representation and transform as a product of\n(real) spherical harmonics, $Y_l^m \\otimes Y_{l'}^{m'}$.\n\nThis product can be decomposed into a direct sum of irreducible\nrepresentations (irreps) of $\\mathrm{SO(3)}$,\n\n\\begin{align}\\lambda \\mu:\\lambda \\in [|l_1-l_2|,l_1+l_2],\\mu \\in [-\\lambda,\\lambda],\\end{align}\n\nwhich express the Hamiltonian blocks in terms of contributions that\nrotate independently and can be modeled using a feature that\ngeometrically describes the pair of atoms under consideration and shares\nthe same symmetry. We use the notation\n$H_{ii';nn'll'}^{\\lambda\\mu}$ to indicate the elements of the\nHamiltonian in this coupled basis.\n\nThe resulting irreps form a *coupled* representation, each of which\ntransforms as a spherical harmonic $Y^\\mu_\\lambda$ under\n$\\mathrm{SO(3)}$ rotations, but may exhibit more complex behavior\nunder inversions. For example, spherical harmonics transform under\ninversion, $\\hat{i}$, as polar tensors:\n\n\\begin{align}\\hat{i}Y^\\mu_\\lambda = (-1)^\\lambda Y^\\mu_\\lambda.\\end{align}\n\nSome of the coupled basis terms transform like $Y^\\mu_\\lambda$,\nwhile others instead transform as pseudotensors,\n\n\\begin{align}\\hat{i}H^{\\lambda\\mu}=(-1)^{\\lambda+1}H^{\\lambda\\mu}\\end{align}\n\nwhere we omit for simplicity the indices that are not directly associated\nwith inversion and rotation symmetry. For more details about the block\ndecomposition, please refer to [Nigam et al., J. Chem. Phys. 156, 014115\n(2022)](https://pubs.aip.org/aip/jcp/article/156/1/014115/2839817)_.\n\nThe following is an animation of a trajectory along a [Lissajous\ncurve](https://en.wikipedia.org/wiki/Lissajous_curve)_ in 3D space,\nalongside a colormap representing the values of the real-space\nHamiltonian matrix elements of the graphene unit cell in a minimal\nSTO-3G basis. From the animation, it is evident how invariant elements,\nsuch as those associated with interactions between $s$ orbitals,\ndo not change under structural rotations. On the other hand,\ninteractions allowing for equivariant components, such as the\n$s$-$p$ block, change under rotations.\n\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "image_files = sorted(\n [\n f\"frames/{f}\"\n for f in os.listdir(\"./frames\")\n if f.startswith(\"rot_\") and f.endswith(\".png\")\n ]\n)\nimages = [mpimg.imread(img) for img in image_files]\nfig, ax = plt.subplots()\nimg_display = ax.imshow(images[0])\nax.axis(\"off\")\n\n\ndef update(frame):\n img_display.set_data(images[frame])\n return [img_display]\n\n\nani = FuncAnimation(fig, update, frames=len(images), interval=20, blit=True)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + ".. code:: python\n\n from IPython.display import HTML\n HTML(ani.to_jshtml())\n\n\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### Mapping geometric features to Hamiltonian targets\n\n\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Each Hamiltonian block obtained from the procedure [described\nabove](#symmetries-of-the-hamiltonian-matrix)_ can be modeled using\nsymmetrized features.\n\nElements of ``block_type=0`` are indexed by a single atom and are best\ndescribed by a symmetrized atom-centered density correlation\n([ACDC](https://doi.org/10.1063/1.5090481)_), denoted by\n$|\\overline{\\rho_{i}^{\\otimes \\nu}; \\sigma; \\lambda\\mu }\\rangle$,\nwhere $\\nu$ refers to the correlation (body)-order, and\u2014just as\nfor the blocks\u2014$\\lambda \\mu$ indicate the $\\mathrm{SO(3)}$\nirrep to which the feature is symmetrized. The symbol $\\sigma$\ndenotes the inversion parity.\n\nFor other blocks, such as ``block_type=2``, which explicitly reference\ntwo atoms, we use [two-center](https://doi.org/10.1063/5.0072784)_\nACDCs, $|\\overline{\\rho_{ii'}^{\\otimes \\nu}; \\lambda\\mu }\\rangle$.\n\nFor ``block_type=1, -1``, we ensure equivariance with respect to atom\nindex permutation by constructing symmetric and antisymmetric pair\nfeatures:\n$(|\\overline{\\rho_{ii'}^{\\otimes \\nu};\\lambda\\mu }\\rangle\\pm\\\n|\\overline{\\rho_{i'i}^{\\otimes \\nu};\\lambda\\mu }\\rangle)$.\n\n\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The features are discretized on a basis of radial functions and\nspherical harmonics, and their performance may depend on the\n*resolution* of the functions included in the model. There are\nadditional hyperparameters, such as the *cutoff* radius, which\ncontrols the extent of the atomic environment, and Gaussian widths. In\nthe following, we allow for flexibility in discretizing the\natom-centered and two-centered ACDCs by defining the hyperparameters for\nthe single-center (SC) $\\lambda$-SOAP and two-center (TC) ACDC\ndescriptors.\n\nThe single and two-center descriptors have very similar hyperparameters,\nexcept for the cutoff radius, which is larger for the two-center\ndescriptors to explicitly include distant pairs of atoms.\n\nNote that the descriptors of pairs of atoms separated by distances\ngreater than the cutoff radius are identically zero. Thus, any model\nbased on these descriptors would predict an identically zero value for\nthese pairs.\n\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "SC_HYPERS = {\n \"cutoff\": 3.0,\n \"max_radial\": 6,\n \"max_angular\": 6,\n \"atomic_gaussian_width\": 0.5,\n \"center_atom_weight\": 1,\n \"radial_basis\": {\"Gto\": {}},\n \"cutoff_function\": {\"ShiftedCosine\": {\"width\": 0.5}},\n}\n\nTC_HYPERS = {\n \"cutoff\": 6.0,\n \"max_radial\": 6,\n \"max_angular\": 6,\n \"atomic_gaussian_width\": 0.3,\n \"center_atom_weight\": 1.0,\n \"radial_basis\": {\"Gto\": {}},\n \"cutoff_function\": {\"ShiftedCosine\": {\"width\": 0.5}},\n}" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We then use the above defined hyperparameters to compute the descriptor\nand initialize a ``MLDataset`` instance, which contains, among other\nthings, the Hamiltonian block decomposition and the geometric features\ndescribed above.\n\nIn addition to computing the descriptors, ``MLDataset`` takes the data\nstored in the ``QMDataset`` instance and puts it in a form required to\ntrain a ML model.\n\n\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The ``item_names`` argument is a list of names of the quantities we want\nto compute and target in the ML model training, or that we want to be\nable to access later.\n\nFor example, ``fock_blocks`` is a\n[metatensor.Tensormap](https://tinyurl.com/tenmap)_ containing the\nHamiltonian coupled blocks. We also want to access the overlap matrices\nin $k$-space (``overlap_kspace``) to be able to compute the\nHamiltonian eigenvalues in the $k$-grid.\n\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "mldata = MLDataset(\n # A QMDataset instance\n qmdata,\n # The names of the quantities to compute/initialize for the training\n item_names=[\"fock_blocks\", \"overlap_kspace\"],\n # Hypers for the SC descriptors\n hypers_atom=SC_HYPERS,\n # Hypers for the TC descriptors\n hypers_pair=TC_HYPERS,\n # Cutoff for the angular quantum number to use in the Clebsh-Gordan iterations\n lcut=4,\n # Fraction of structures in the training set\n train_frac=0.7,\n # Fraction of structures in the validation set\n val_frac=0.2,\n # Fraction of structures in the test set\n test_frac=0.1,\n # Whether to shuffle or not the structure indices before splitting the data set\n shuffle=True,\n)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The matrix decomposition into blocks and the calculations of geometric\nfeatures is performed by the ``MLDataset`` class.\n\n\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "``mldata.features`` is ``metatensor.TensorMap`` containing the\nstuctures\u2019 descriptors\n\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "mldata.features" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "``mldata.items`` is a ``namedtuple`` containing the quantities defined\nin ``item_names``. e.g.\u00a0the coupled Hamiltonian blocks:\n\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "print(\"The TensorMap containing the Hamiltonian coupled blocks is\")\nmldata.items.fock_blocks" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Or the overlap matrices:\n\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "structure_idx = 0\nk_idx = 0\nprint(f\"The overlap matrix for structure {structure_idx} at the {k_idx}-th k-point is\")\nmldata.items.overlap_kspace[structure_idx][k_idx]" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## A machine learning model for the electronic Hamiltonian of graphene\n\n\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Linear model\n\nIn simple cases, such as the present one, it is convenient to start with\na linear model that directly maps the geometric descriptors to the\ntarget coupled blocks. This can be achieved using [Ridge regression](https://scikit-learn.org/1.5/modules/generated/sklearn.linear_model.Ridge.html)_\nas implemented in [scikit-learn](https://scikit-learn.org/stable/)_.\n\nThe linear regression model is expressed as\n\n\\begin{align}H_{ii',\\mathbf{Q}}^{\\lambda\\mu}(\\mathbf{t}) = \\\n \\sum_\\mathbf{q} w_{\\mathbf{q}}^{\\mathbf{Q},\\lambda} \\\n (\\rho_{ii'}^{\\otimes \\nu}(\\mathbf{t}))_{\\mathbf{q}}^{\\lambda\\mu},\\end{align}\n\nwhere a shorthand notation for the features has been introduced. Here,\n$\\mathbf{Q}$ includes all labels indicating the involved orbitals,\natomic species, and permutation symmetry, while $\\mathbf{q}$\nrepresents the feature dimension. The quantities\n$w_{\\mathbf{q}}^{\\mathbf{Q},\\lambda}$ are the model\u2019s weights.\nNote that different weights are associated with different values of\n$\\mathbf{Q}$ and $\\lambda$, but not with specific atom pairs\nor the translation vector, whose dependence arises only through the\ndescriptors.\n\n\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "In ``mlelec``, a linear model can be trained through the\n``LitEquivariantModel`` class, which accepts an ``init_from_ridge``\nkeyword. When set to ``True``, this initializes the weights of a more\ngeneral ``torch.nn.Module`` with the weights provided by Ridge\nregression.\n\n\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We will pass other keyword arguments to ``LitEquivariantModel``, to be\nable to further train the weights on top to the initial Ridge\nregression.\n\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "model = LitEquivariantModel(\n mldata=mldata, # a MLDataset instance\n nlayers=0, # The number of hidden layers\n nhidden=1, # The number of neurons in each hidden layer\n init_from_ridge=True, # If True, initialize the weights and biases of the\n # purely linear model from Ridge regression\n optimizer=\"LBFGS\", # Type of optimizer. Adam is likely better for\n # a more general neural network\n activation=\"SiLU\", # The nonlinear activation function\n learning_rate=1e-3, # Initial learning rate (LR)\n lr_scheduler_patience=10,\n lr_scheduler_factor=0.7,\n lr_scheduler_min_lr=1e-6,\n loss_fn=MSELoss(), # Use the mean square error as loss function\n)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### Model\u2019s accuracy in reproducing derived properties\n\n\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The Hamiltonian coupled blocks predicted by the ML model can be accessed\nfrom ``model.forward()``\n\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "predicted_blocks = model.forward(mldata.features)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The real-space blocks can be transformed to Hamiltonian matrices via the\n``mlelec.utils.pbc_utils.blocks_to_matrix`` function. The resulting\nreal-space Hamiltonians can be Fourier transformed to give the\n$k$-space ones.\n\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "HT = blocks_to_matrix(\n predicted_blocks,\n orbitals[\"sto-3g\"],\n {A: qmdata.structures[A] for A in range(len(qmdata))},\n detach=True,\n)\nHk = qmdata.bloch_sum(HT, is_tensor=True)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "##### Kohn-Sham eigenvalues\n\n\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We can then compute the eigenvalues on the $k$-grid used for the\ncalculation to assess the model accuracy in predicting band energies.\n\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "target_eigenvalues = compute_eigenvalues(qmdata.fock_kspace, qmdata.overlap_kspace)\npredicted_eigenvalues = compute_eigenvalues(Hk, qmdata.overlap_kspace)\n\nHartree = 27.211386024367243 # eV\n\nplt.rcParams[\"font.size\"] = 14\nfig, ax = plt.subplots()\nax.set_aspect(\"equal\")\n\nx_text = 0.38\ny_text = 0.2\nd = 0.06\n\nfor i, (idx, label) in enumerate(\n zip(\n [mldata.train_idx, mldata.val_idx, mldata.test_idx],\n [\"train\", \"validation\", \"test\"],\n )\n):\n\n target = (\n torch.stack([target_eigenvalues[i] for i in idx]).flatten().detach() * Hartree\n )\n prediction = (\n torch.stack([predicted_eigenvalues[i] for i in idx]).flatten().detach()\n * Hartree\n )\n\n non_core_states = target > -100\n rmse = np.sqrt(\n np.mean(\n (target.numpy()[non_core_states] - prediction.numpy()[non_core_states]) ** 2\n )\n )\n ax.scatter(target, prediction, marker=\".\", label=label, alpha=0.5)\n ax.text(\n x=x_text,\n y=y_text - d * i,\n s=rf\"$\\mathrm{{RMSE_{{{label}}}={rmse:.2f}\\,eV}}$\",\n transform=ax.transAxes,\n )\n\nxmin, xmax = ax.get_xlim()\nax.plot([xmin, xmax], [xmin, xmax], \"--k\")\nax.set_xlim(xmin, xmax)\nax.set_ylim(xmin, xmax)\nax.legend()\nax.set_xlabel(\"Target eigenvalues (eV)\")\nax.set_ylabel(\"Predicted eigenvalues (eV)\")" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "##### Graphene band structure\n\n\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Apart from the eigenvalues on a mesh in the Brillouin zone, we can use\nthe real-space Hamiltonians predicted by the model to compute the band\nstructure along high-symmetry paths.\n\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "fig, ax = plt.subplots(figsize=(8, 4.8))\n\nidx = 0\n\nhandles = []\n\nwith warnings.catch_warnings():\n warnings.filterwarnings(\"ignore\", category=DeprecationWarning)\n\n # Plot reference\n ax, h_ref = plot_bands_frame(\n qmdata.fock_realspace[idx], idx, qmdata, ax=ax, color=\"blue\", lw=2\n )\n\n # Plot prediction\n ax, h_pred = plot_bands_frame(\n HT[idx], idx, qmdata, ax=ax, color=\"lime\", ls=\"--\", lw=2\n )\n\nax.set_ylim(-30, 30)\nax.legend(\n [h_ref, h_pred],\n [\"Reference\", \"Prediction\"],\n loc=\"center left\",\n bbox_to_anchor=(1, 0.5),\n)\nfig.tight_layout()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Adding nonlinearities\n\n\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The model used above consists of several submodels, one for each Hamiltonian\ncoupled block. Each submodel can be extended to a [multilayer\nperceptron](https://en.wikipedia.org/wiki/Multilayer_perceptron)_\n(MLP) that maps the corresponding set of geometric features to the\nHamiltonian coupled block. Nonlinearities are applied to the invariants\nconstructed from each equivariant feature block using the\n``EquivariantNonlinearity`` module. This section outlines the process to\nmodify the model to introduce non-linear terms. Given that the time\nto train and evaluate the model would then increase, this section\nincludes snippets of code, but is not a complete implementation and\nis not executed when running this example.\n\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The architecture of ``EquivariantNonlinearity`` can be visualized with\n``torchviz`` with the following snippet:\n\n.. code:: python\n\n import torch\n from mlelec.models.equivariant_model import EquivariantNonLinearity\n from torchviz import make_dot\n m = EquivariantNonLinearity(torch.nn.SiLU(), layersize = 10)\n y = m.forward(torch.randn(3,3,10))\n dot = make_dot(y, dict(m.named_parameters()))\n dot.graph_attr.update(size='150,150')\n dot.render(\"equivariantnonlinear\", format=\"png\")\n dot\n\n\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + ".. figure:: equivariantnonlinear.png\n :alt: Graph representing the architecture of EquivariantNonLinearity\n :width: 300px\n\n Graph representing the architecture of EquivariantNonLinearity\n\n\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The global architecture of the MLP, implemented in ``simpleMLP``, can be\nvisualized with\n\n.. code:: python\n\n import torch\n from mlelec.models.equivariant_model import simpleMLP\n from torchviz import make_dot\n mlp = simpleMLP(\n nin=10,\n nout=1,\n nhidden=1,\n nlayers=1,\n bias=True,\n activation='SiLU',\n apply_layer_norm=True\n )\n y = mlp.forward(torch.randn(1,1,10))\n dot = make_dot(y, dict(mlp.named_parameters()))\n dot.graph_attr.update(size='150,150')\n dot.render(\"simpleMLP\", format=\"png\")\n dot\n\n\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + ".. figure:: simpleMLP.png\n :alt: Graph representing the architecture of simpleMLP\n :width: 600px\n\n Graph representing the architecture of simpleMLP\n\n\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### Set up the training loop for stochastic gradient descent\n\n\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Import additional modules needed to monitor the training.\n\n\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + ".. code:: python\n\n import lightning.pytorch as pl\n from lightning.pytorch.callbacks import EarlyStopping\n from mlelec.callbacks.logging import LoggingCallback\n from mlelec.models.equivariant_lightning import MLDatasetDataModule\n\n\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We set up a callback for logging training information such as the\ntraining and validation losses.\n\n\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + ".. code:: python\n\n logger_callback = LoggingCallback(log_every_n_epochs=5)\n\n\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We set up an early stopping criterion to stop the training when the\nvalidation loss function stops decreasing.\n\n\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + ".. code:: python\n\n early_stopping = EarlyStopping(\n monitor=\"val_loss\", min_delta=1e-3, patience=10, verbose=False, mode=\"min\"\n )\n\n\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We define a ``lighting.pytorch.Trainer`` instance to handle the training\nloop. For example, we can further optimize the weights for 50 epochs using\nthe [LBFGS](https://en.wikipedia.org/wiki/Limited-memory_BFGS)_\noptimizer.\n\nNote that PyTorch Lightning requires the definition of a data module to\ninstantiate DataLoaders to be used during the training.\n\n\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + ".. code:: python\n\n data_module = MLDatasetDataModule(mldata, batch_size=16, num_workers=0)\n\n trainer = pl.Trainer(\n max_epochs=50,\n accelerator=\"cpu\",\n check_val_every_n_epoch=10,\n callbacks=[early_stopping, logger_callback],\n logger=False,\n enable_checkpointing=False,\n )\n\n trainer.fit(model, data_module)\n\n\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We compute the test set loss to assess the model accuracy on an unseen\nset of structures\n\n\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + ".. code:: python\n\n trainer.test(model, data_module)\n\n\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "In this case, Ridge regression already provides good accuracy, so\nfurther optimizing the weights offers limited improvement. However, for\nmore complex datasets, the benefits of additional optimization can be\nsignificant.\n\n\n" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.11.10" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} \ No newline at end of file diff --git a/_downloads/a58e2543da5a6b5daa9cea5c8b3c3a21/lpr.py b/_downloads/a58e2543da5a6b5daa9cea5c8b3c3a21/lpr.py new file mode 100644 index 00000000..b0887e17 --- /dev/null +++ b/_downloads/a58e2543da5a6b5daa9cea5c8b3c3a21/lpr.py @@ -0,0 +1,265 @@ +""" +Local Prediction Rigidity analysis +================================== + +:Authors: Sanggyu "Raymond" Chong `@SanggyuChong `_; + Federico Grasselli `@fgrassel `_ + +In this tutorial, we calculate the SOAP descriptors of an amorphous +silicon dataset using rascaline, then compute the local prediction +rigidity (LPR) for the atoms of a "test" set before and after +modifications to the "training" dataset has been made. + +First, we import all the necessary packages: +""" + +# %% +import os +import tarfile + +import numpy as np +import requests +from ase.io import read +from matplotlib import pyplot as plt +from matplotlib.colors import LogNorm +from rascaline import SoapPowerSpectrum +from sklearn.decomposition import PCA +from skmatter.metrics import local_prediction_rigidity as lpr + + +# %% +# Load and prepare amorphous silicon data +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +# +# +# We first download the dataset associated with LPR +# analysis from Materials Cloud and load the the amorphous +# silicon structures using `ASE `_. + +filename = "LPR_supp_notebook_dataset.tar.gz" +if not os.path.exists(filename): + url = "https://rb.gy/wxsrug" # shortened URL + response = requests.get(url) + response.raise_for_status() + with open(filename, "wb") as f: + f.write(response.content) + +with tarfile.open(filename) as tar: + tar.extractall(path=".") + +frames_pristine = read("datasets/Si_amo_defect_free.xyz", ":") +frames_defect = read("datasets/Si_amo_defect_containing.xyz", ":") + +# Randomly shuffle the structures + +np.random.seed(20230215) + +ids = list(range(len(frames_pristine))) +np.random.shuffle(ids) +frames_pristine = [frames_pristine[ii] for ii in ids] + +ids = list(range(len(frames_defect))) +np.random.shuffle(ids) +frames_defect = [frames_defect[ii] for ii in ids] + +# %% +# We now further refine the loaded datasets according the the +# number of coordinated atoms that each atomic environment exhibits. +# "Pristine" refers to structures where all of the atoms have strictly +# 4 coordinating atoms. "Defect" refers to structures that contain +# atoms with coordination numbers other than 4. +# +# We use :code:`get_all_distances` funciton of :code:`ase.Atoms` to detect the +# number of coordinated atoms. + +cur_cutoff = 2.7 +refined_pristine_frames = [] +for frame in frames_pristine: + neighs = (frame.get_all_distances(mic=True) < cur_cutoff).sum(axis=0) - 1 + if neighs.max() > 4 or neighs.min() < 4: + continue + else: + refined_pristine_frames.append(frame) + +refined_defect_frames = [] +for frame in frames_defect: + neighs = (frame.get_all_distances(mic=True) < cur_cutoff).sum(axis=0) - 1 + num_defects = (neighs > 4).sum() + (neighs < 4).sum() + if num_defects > 4: + refined_defect_frames.append(frame) + + +# %% +# Compute SOAP descriptors using rascaline +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +# +# Now, we move on and compute the SOAP descriptors for the refined +# structures. First, define the rascaline hyperparameters used to +# compute SOAP. Among the hypers, notice that the cutoff is chosen +# to be 2.85 Å, and the radial scaling is turned off. These were +# heuristic choices made to accentuate the difference in the LPR +# based on the nearest-neighbor coordination. (Do not blindly +# use this set of hypers for production-quality model training!) + +# Hypers dictionary +hypers = { + "cutoff": 2.85, + "max_radial": 10, + "max_angular": 12, + "atomic_gaussian_width": 0.5, + "center_atom_weight": 1.0, + "radial_basis": {"Gto": {"spline_accuracy": 1e-8}}, + "cutoff_function": {"ShiftedCosine": {"width": 0.1}}, + "radial_scaling": None, +} +# Define rascaline calculator +calculator = SoapPowerSpectrum(**hypers) + +# Calculate the SOAP power spectrum +Xlist_pristine = [] +for frame in refined_pristine_frames: + descriptor = calculator.compute(frame) + Xlist_pristine.append(np.array(descriptor.block().values)) + +Xlist_defect = [] +for frame in refined_defect_frames: + descriptor = calculator.compute(frame) + Xlist_defect.append(np.array(descriptor.block().values)) + +# %% +# Organize structures into "training" and "test" sets +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +# +# Now we move on and compute the SOAP descriptors for the refined +# structures. First, define the rascaline hyperparameters used to +# compute SOAP. +# +# Notice that the format in which we handle the descriptors is as a +# list of :code:`np.array` descriptor blocks. This is to ensure +# compatibility with how things have been implemented in the LPR +# module of :code:`scikit-matter`. + +n_train = 400 +n_add = 50 +n_test = 50 + +X_pristine = [Xlist for Xlist in Xlist_pristine[: n_train + n_add]] +X_defect = [Xlist for Xlist in Xlist_defect[:n_add]] +X_test = [Xlist for Xlist in Xlist_defect[n_add : n_add + n_test]] + +# Save coordination values for visualization +test_coord = [] +for frame in refined_defect_frames[n_add : n_add + n_test]: + coord = (frame.get_all_distances(mic=True) < cur_cutoff - 0.05).sum(axis=0) - 1 + test_coord += coord.tolist() +test_coord = np.array(test_coord) + +# %% +# Compute the LPR for the test set +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +# +# Next, we will use the :code:`local_prediction_rigidity` module of +# `scikit-matter `_ +# to compute the LPRs for the test set that we have set apart. +# +# LPR reflects how the ML model perceives a local environment, +# given a collection of other structures, similar or different. +# It should then carry over some of the details involved in training +# the model, in this case the regularization strength. +# +# For this example, we have foregone on the actual model training, +# and so we define an arbitrary value for the alpha. + +alpha = 1e-4 +LPR_test, rank = lpr(X_pristine, X_test, alpha) +LPR_test = np.hstack(LPR_test) + +# %% +# Visualizing the LPR on a PCA map +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +# +# We now visualize the LPRs of the test set on a PCA map, +# where the PCA is performed on the SOAP descriptors of +# defect-containing dataset. + +pca = PCA(n_components=5) +descriptors_all = calculator.compute(refined_defect_frames) +pca.fit_transform(descriptors_all.block().values) +PCA_test = pca.transform(np.vstack(X_test)) + +rmin = np.log10(LPR_test.min()) + 0.5 +rmax = np.log10(LPR_test.max()) - 0.5 + +fig = plt.figure(figsize=(5, 4), dpi=200) +ax = fig.add_subplot() +im = ax.scatter( + PCA_test[:, 0], + PCA_test[:, 1], + c=LPR_test, + s=20, + linewidths=0, + norm=LogNorm(vmin=10**rmin, vmax=10**rmax), + cmap="viridis", +) + +ax.set_xlabel("PC1") +ax.set_ylabel("PC2") +fig.colorbar(im, ax=ax, label="LPR") +ax.tick_params(left=False, bottom=False, labelleft=False, labelbottom=False) +plt.show() + +# %% +# In the PCA map, where each point corresponds to an +# atomic environment of the test set structures, one +# can observe 4 different clusters of points, arranged +# along PC1. This corresponds to the coordination numbers +# ranging from 3 to 6. Since the training set contains +# structures exclusively composed of 4-coordinated atoms, +# LPR is distinctly high for the second, main cluster of +# points, and quite low for the three other clusters. + + +# %% +# Studying the LPR after dataset modification +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +# +# We now want to see what would happen when defect structures +# are included into the training set of the model. For this, +# we first create a modified dataset that incorporates in the +# defect structures, and recompute the LPR. + +X_new = X_pristine[:n_train] + X_defect[:n_add] +LPR_test_new, rank = lpr(X_new, X_test, alpha) +LPR_test_new = np.hstack(LPR_test_new) + +# %% +# We then visualize the change in the LPR with the +# modification of the dataset by plotting the same PCA +# map, but now colored by the ratio of new set of LPR +# values (after dataset modification) over the original +# one. + +fig = plt.figure(figsize=(5, 4), dpi=200) +ax = fig.add_subplot() +im = ax.scatter( + PCA_test[:, 0], + PCA_test[:, 1], + c=LPR_test_new / LPR_test, + s=20, + linewidths=0, + # norm=LogNorm(vmin=10**rmin, vmax=10**rmax), + cmap="OrRd", +) +ax.set_xlabel("PC1") +ax.set_ylabel("PC2") +fig.colorbar(im, ax=ax, label=r"LPR$_{\mathrm{new}}$ / LPR$_{\mathrm{old}}$") +ax.tick_params(left=False, bottom=False, labelleft=False, labelbottom=False) +plt.show() + +# %% +# It is apparent that while the LPR stays more or less consistent for the +# 4-coordinated atoms, it is significantly enhanced for the defective environments +# as a result of the inclusion of defective structures in the training set. + + +# %% diff --git a/_downloads/ab58b2811af545cfb312fbb1499797cd/roy-gch.zip b/_downloads/ab58b2811af545cfb312fbb1499797cd/roy-gch.zip new file mode 100644 index 00000000..d554f985 Binary files /dev/null and b/_downloads/ab58b2811af545cfb312fbb1499797cd/roy-gch.zip differ diff --git a/_downloads/acef7f4b78ef4bb781ee98c79cb1dfe9/gaas-map.ipynb b/_downloads/acef7f4b78ef4bb781ee98c79cb1dfe9/gaas-map.ipynb new file mode 100644 index 00000000..647f8790 --- /dev/null +++ b/_downloads/acef7f4b78ef4bb781ee98c79cb1dfe9/gaas-map.ipynb @@ -0,0 +1,169 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "\n# PCA/PCovR Visualization of a training dataset for a potential\n\n:Authors: Michele Ceriotti [@ceriottm](https://github.com/ceriottm/),\n Giulio Imbalzano\n\nThis example uses ``rascaline`` and ``metatensor`` to compute\nstructural properties for the structures in a training dataset\nfor a ML potential.\nThese are then used with simple dimensionality reduction algorithms\n(implemented in ``sklearn`` and ``skmatter``) to obtain a simplified\ndescription of the dataset, that is then visualized using\n``chemiscope``.\n\nThis example uses the dataset from\n[Imbalzano (2021)](http://doi.org/10.1103/PhysRevMaterials.5.063804)\nand the principal covariate regression scheme as implemented in\n[Helfrecht (2020)](http://doi.org/10.1088/2632-2153/aba9ef).\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "import os\n\nimport ase\nimport ase.io\nimport chemiscope\nimport numpy as np\nimport requests\nfrom matplotlib import pyplot as plt\nfrom metatensor import mean_over_samples\nfrom rascaline import AtomicComposition, SoapPowerSpectrum\nfrom sklearn.decomposition import PCA\nfrom sklearn.linear_model import RidgeCV\nfrom skmatter.decomposition import PCovR\nfrom skmatter.preprocessing import StandardFlexibleScaler\n\n\n# sphinx_gallery_thumbnail_number = 2" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "First, we load the structures, extracting some of the properties for\nmore convenient manipulation. These are\n$\\mathrm{Ga}_x\\mathrm{As}_{1-x}$ structures used in [Imbalzano &\nCeriotti (2021)](http://doi.org/10.1103/PhysRevMaterials.5.063804)_ to\ntrain a ML potential to describe the full composition range.\n\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "filename = \"gaas_training.xyz\"\nif not os.path.exists(filename):\n url = f\"https://zenodo.org/records/10566825/files/{filename}\"\n response = requests.get(url)\n response.raise_for_status()\n with open(filename, \"wb\") as f:\n f.write(response.content)\n\nstructures = ase.io.read(filename, \":\")\nenergy = np.array([f.info[\"energy\"] for f in structures])\nnatoms = np.array([len(f) for f in structures])" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Remove atomic energy baseline\n\nEnergies from an electronic structure calculation contain a very large\n\u201cself\u201d contributions from the atoms, which can obscure the important\ndifferences in cohesive energies between structures. We can build an\napproximate model based on the chemical nature of the atoms, $a_i$\n\n\\begin{align}E(A) = \\sum_{i\\in A} e_{a_i}\\end{align}\n\nwhere $e_a$ are atomic energies that can be determined by linear\nregression.\n\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "# rascaline has an `AtomicComposition` calculator that streamlines\n# this (simple) calculation\ncalculator = AtomicComposition(**{\"per_structure\": True})\nrho0 = calculator.compute(structures)\n\n# the descriptors are returned as a `TensorMap` object, that contains\n# the composition data in a sparse storage format\nrho0\n\n# for easier manipulation, we extract the features as a dense vector\n# of composition weights\ncomp_feats = rho0.keys_to_properties([\"species_center\"]).block(0).values\n\n# a one-liner to fit a linear model and compute \"dressed energies\"\natom_energy = (\n RidgeCV(alphas=np.geomspace(1e-8, 1e2, 20))\n .fit(comp_feats, energy)\n .predict(comp_feats)\n)\ncohesive_peratom = (energy - atom_energy) / natoms" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The baseline makes up a large fraction of the total energy, but actually\nthe residual (which is the part that matters) is still large.\n\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "fig, ax = plt.subplots(1, 1, figsize=(6, 4))\nax.plot(energy / natoms, atom_energy / natoms, \"b.\")\nax.set_xlabel(\"Energy / (eV/atom)\")\nax.set_ylabel(\"Atomic e. / (eV/atom)\")\nplt.show()\nprint(f\"RMSE / (eV/atom): {np.sqrt(np.mean((cohesive_peratom)**2))}\")" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Compute structural descriptors\n\nIn order to visualize the structures as a low-dimensional map, we start\nby computing suitable ML descriptors. Here we have used ``rascaline`` to\nevaluate average SOAP features for the structures.\n\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "# hypers for evaluating rascaline features\nhypers = {\n \"cutoff\": 4.5,\n \"max_radial\": 6,\n \"max_angular\": 4,\n \"atomic_gaussian_width\": 0.3,\n \"cutoff_function\": {\"ShiftedCosine\": {\"width\": 0.5}},\n \"radial_basis\": {\"Gto\": {\"accuracy\": 1e-6}},\n \"center_atom_weight\": 1.0,\n}\ncalculator = SoapPowerSpectrum(**hypers)\nrho2i = calculator.compute(structures)\n\n# neighbor types go to the keys for sparsity (this way one can\n# compute a heterogeneous dataset without having blocks of zeros)\nrho2i = rho2i.keys_to_samples([\"species_center\"]).keys_to_properties(\n [\"species_neighbor_1\", \"species_neighbor_2\"]\n)\n\n# computes structure-level descriptors and then extracts\n# the features as a dense array\nrho2i_structure = mean_over_samples(rho2i, sample_names=[\"center\", \"species_center\"])\nrho2i = None # releases memory\nfeatures = rho2i_structure.block(0).values" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We standardize (per atom) energy and features (computed as a *mean* over\natomic environments) so that they can be combined on the same footings.\n\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "sf_energy = StandardFlexibleScaler().fit_transform(cohesive_peratom.reshape(-1, 1))\nsf_feats = StandardFlexibleScaler().fit_transform(features)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## PCA and PCovR projection\n\nComputes PCA projection to generate low-dimensional descriptors that\nreflect structural diversity. Any other dimensionality reduction scheme\ncould be used in a similar fashion.\n\nWe also compute the principal covariate regression (PCovR) descriptors,\nthat reduce dimensionality while combining a variance preserving\ncriterion with the requirement that the low-dimensional features are\ncapable of estimating a target quantity (here, the energy).\n\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "# PCA\npca = PCA(n_components=4)\npca_features = pca.fit_transform(sf_feats)\n\nfig, ax = plt.subplots(1, 1, figsize=(6, 4))\nscatter = ax.scatter(pca_features[:, 0], pca_features[:, 1], c=cohesive_peratom)\nax.set_xlabel(\"PCA[1]\")\nax.set_ylabel(\"PCA[2]\")\ncbar = fig.colorbar(scatter, ax=ax)\ncbar.set_label(\"energy / eV/at.\")\nplt.show()\n\n# computes PCovR map\npcovr = PCovR(n_components=4)\npcovr_features = pcovr.fit_transform(sf_feats, sf_energy)\n\nfig, ax = plt.subplots(1, 1, figsize=(6, 4))\nscatter = ax.scatter(pcovr_features[:, 0], pcovr_features[:, 1], c=cohesive_peratom)\nax.set_xlabel(\"PCovR[1]\")\nax.set_ylabel(\"PCovR[2]\")\ncbar = fig.colorbar(scatter, ax=ax)\ncbar.set_label(\"energy / (eV/at.)\")\nplt.show()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Chemiscope visualization\n\nVisualizes the structure-property map using a chemiscope widget (and\ngenerates a .json file that can be viewed on\n[chemiscope.org](https://chemiscope.org)_).\n\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "# extracts force data (adding considerably to the dataset size...)\nforce_vectors = chemiscope.ase_vectors_to_arrows(structures, scale=1)\nforce_vectors[\"parameters\"][\"global\"][\"color\"] = 0x505050\n\n# adds properties to the ASE frames\nfor i, f in enumerate(structures):\n for j in range(len(pca_features[i])):\n f.info[\"pca_\" + str(j + 1)] = pca_features[i, j]\nfor i, f in enumerate(structures):\n for j in range(len(pcovr_features[i])):\n f.info[\"pcovr_\" + str(j + 1)] = pcovr_features[i, j]\nfor i, f in enumerate(structures):\n f.info[\"cohesive_energy\"] = cohesive_peratom[i]\n f.info[\"x_ga\"] = comp_feats[i, 0] / comp_feats[i].sum()\n\n# it would also be easy to add the properties manually, this is just a dictionary\nstructure_properties = chemiscope.extract_properties(structures)\n\ncs = chemiscope.show(\n frames=structures,\n properties=structure_properties,\n shapes={\"forces\": force_vectors},\n # the settings are a tad verbose, but give full control over the visualization\n settings={\n \"map\": {\n \"x\": {\"property\": \"pcovr_1\"},\n \"y\": {\"property\": \"pcovr_2\"},\n \"color\": {\"property\": \"x_ga\"},\n },\n \"structure\": [\n {\n \"bonds\": True,\n \"unitCell\": True,\n \"shape\": [\"forces\"],\n \"keepOrientation\": False,\n }\n ],\n },\n meta={\n \"name\": \"GaAs training data\",\n \"description\": \"\"\"\nA collection of Ga(x)As(1-x) structures to train a MLIP,\nincluding force and energy data.\n\"\"\",\n \"authors\": [\"Giulio Imbalzano\", \"Michele Ceriotti\"],\n \"references\": [\n \"\"\"\nG. Imbalzano and M. Ceriotti, 'Modeling the Ga/As binary system across\ntemperatures and compositions from first principles,'\nPhys. Rev. Materials 5(6), 063804 (2021).\n\"\"\",\n \"Original dataset: https://archive.materialscloud.org/record/2021.226\",\n ],\n },\n)\n\ncs.save(\"gaas_map.chemiscope.json.gz\")\n\ncs # display if in a notebook" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.11.10" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} \ No newline at end of file diff --git a/_downloads/ae0da8b1ee160a1314e0f4a70d65ba5f/reference-trajectory.py b/_downloads/ae0da8b1ee160a1314e0f4a70d65ba5f/reference-trajectory.py new file mode 100644 index 00000000..4fb6e77c --- /dev/null +++ b/_downloads/ae0da8b1ee160a1314e0f4a70d65ba5f/reference-trajectory.py @@ -0,0 +1,304 @@ +r""" +Batch run of CP2K calculations +============================== + +:Authors: Matthias Kellner `@bananenpampe `_, + Philip Loche `@PicoCentauri `_ + +This is an example how to perform single point calculations based on list of structures +using `CP2K `_ using its `reftraj functionality +`_. The inputs are a +set of structures in :download:`example.xyz` using the DFT parameters defined in +:download:`reftraj_template.cp2k`. The reference DFT parameters are taken from `Cheng et +al. Ab initio thermodynamics of liquid and solid water 2019 +`_. Due to the small size of the test +structure and convergence issues, we have decreased the size of the ``CUTOFF_RADIUS`` +from :math:`6.0\,\mathrm{Å}` to :math:`3.0\,\mathrm{Å}`. For actual production +calculations adapt the template! +""" + +# %% +# We start the example by importing the required packages. + +import os +import platform +import subprocess +from typing import List, Union + +import ase.io +import ase.visualize.plot +import matplotlib.pyplot as plt +import numpy as np +import requests + + +# %% +# +# Install CP2K +# ------------ +# +# We'll need a working installation of cp2k. The best way to do so depends on your +# platform, here are some possible solutions, but feel free to replace them with another +# installation method. + +if platform.system() == "Linux": + # use conda on Linux + subprocess.run(["conda", "install", "cp2k", "-c", "conda-forge", "-y"], check=True) +elif platform.system() == "Darwin": + # use homebrew on macOS + subprocess.run(["brew", "install", "cp2k"], check=True) +else: + print("no known way to install cp2k, skipping installation") + + +# %% +# Define necessary functions +# -------------------------- +# Next we below define necessary helper functions to run the example. + + +def write_reftraj(fname: str, frames: Union[ase.Atoms, List[ase.Atoms]]) -> None: + """Writes a list of ase atoms objects to a reference trajectory. + + A reference trajectory is the CP2K compatible format for the compuation of batches. + All frames must have the stoichiometry/composition. + """ + + if isinstance(frames, ase.Atoms): + frames = [frames] + + out = "" + for i, atoms in enumerate(frames): + if ( + len(atoms) != len(frames[0]) + or atoms.get_chemical_formula() != frames[0].get_chemical_formula() + ): + raise ValueError( + f"Atom symbols in frame {i},{atoms.get_chemical_formula()} are " + f"different compared to inital frame " + f"{frames[0].get_chemical_formula()}. " + "CP2K does not support changing atom types within a reftraj run!" + ) + + out += f"{len(atoms):>8}\n i = {i + 1:>8}, time = {0:>12.3f}\n" + for atom in atoms: + pos = atom.position + out += f"{atom.symbol}{pos[0]:24.15f}{pos[1]:24.15f}{pos[2]:24.15f}\n" + out += "\n" + with open(fname, "w") as f: + f.write(out) + + +# %% + + +def write_cellfile(fname: str, frames: Union[ase.Atoms, List[ase.Atoms]]) -> None: + """Writes a cellfile for a list of ``ase.Atoms``. + + A Cellfile accompanies a reftraj containing the cell parameters. + """ + if isinstance(frames, ase.Atoms): + frames = [frames] + + out = ( + "# " + "Step " + "Time [fs] " + "Ax [Angstrom] " + "Ay [Angstrom] " + "Az [Angstrom] " + "Bx [Angstrom] " + "By [Angstrom] " + "Bz [Angstrom] " + "Cx [Angstrom] " + "Cy [Angstrom] " + "Cz [Angstrom] " + "Volume [Angstrom^3]\n" + ) + + for i, atoms in enumerate(frames): + out += f"{i + 1:>8}{0:>12.3f}" + out += "".join([f"{c:>20.10f}" for c in atoms.cell.flatten()]) + out += f"{atoms.cell.volume:>25.10f}" + out += "\n" + + with open(fname, "w") as f: + f.write(out) + + +# %% + + +def write_cp2k_in( + fname: str, project_name: str, last_snapshot: int, cell: List[float] +) -> None: + """Writes a cp2k input file from a template. + + Importantly, it writes the location of the basis set definitions, + determined from the path of the system CP2K install to the input file. + """ + + cp2k_in = open("reftraj_template.cp2k", "r").read() + + cp2k_in = cp2k_in.replace("//PROJECT//", project_name) + cp2k_in = cp2k_in.replace("//LAST_SNAPSHOT//", str(last_snapshot)) + cp2k_in = cp2k_in.replace("//CELL//", " ".join([f"{c:.6f}" for c in cell])) + + with open(fname, "w") as f: + f.write(cp2k_in) + + +# %% +# +# We will now download basis set files from CP2K website. Depending on your CP2K +# installation, this might not be necessary! + + +def download_parameter(file): + path = os.path.join("parameters", file) + + if not os.path.exists(path): + url = f"https://raw.githubusercontent.com/cp2k/cp2k/support/v2024.1/data/{file}" + response = requests.get(url) + response.raise_for_status() + with open(path, "wb") as f: + f.write(response.content) + + +os.makedirs("parameters", exist_ok=True) +for file in ["GTH_BASIS_SETS", "BASIS_ADMM", "POTENTIAL", "dftd3.dat", "t_c_g.dat"]: + download_parameter(file) + + +# %% +# Prepare calculation inputs +# -------------------------- +# During this example we will create a directory named ``project_directory`` containing +# the subdirectories for each stoichiometry. This is necessary, because CP2K can only +# run calculations using a fixed stoichiometry at a time, using its ``reftraj`` +# functionality. +# +# Below we define the general information for the CP2K run. This includes the reference +# files for the structures, the ``project_name`` used to build the name of the +# trajectory during the CP2K run, the ``project_directory`` where we store all +# simulation output as well as the path ``write_to_file`` which is the name of the file +# containing the computed energies and forces of the simulation. + +frames_full = ase.io.read("example.xyz", ":") +project_name = "test_calcs" # name of the global PROJECT +project_directory = "production" +write_to_file = "out.xyz" + +# %% +# Below we show the initial configuration of two water molecules in a cubic box with a +# side length of :math:`\approx 4\,\mathrm{Å}`. + +ase.visualize.plot.plot_atoms(frames_full[0]) + +plt.xlabel("Å") +plt.ylabel("Å") + +plt.show() + +# %% +# We now extract the stoichiometry from the input dataset using ASE's +# :py:meth:`ase.symbols.Symbols.get_chemical_formula` method. + +frames_dict = {} + +for atoms in frames_full: + chemical_formula = atoms.get_chemical_formula() + try: + frames_dict[chemical_formula] + except KeyError: + frames_dict[chemical_formula] = [] + + frames_dict[chemical_formula].append(atoms) + +# %% +# Based on the stoichiometries we create one calculation subdirectories for the +# calculations. (reftraj, input and cellfile). For our example this is only is one +# directory named ``H4O2`` because our dataset consists only of a single structure with +# two water molecules. + +for stoichiometry, frames in frames_dict.items(): + current_directory = f"{project_directory}/{stoichiometry}" + os.makedirs(current_directory, exist_ok=True) + + write_cp2k_in( + f"{current_directory}/in.cp2k", + project_name=project_name, + last_snapshot=len(frames), + cell=frames[0].cell.diagonal(), + ) + + ase.io.write(f"{current_directory}/init.xyz", frames[0]) + write_reftraj(f"{current_directory}/reftraj.xyz", frames) + write_cellfile(f"{current_directory}/reftraj.cell", frames) + +# %% +# Run simulations +# --------------- +# Now we have all ingredients to run the simulations. Below we call the bash script +# :download:`run_calcs.sh`. +# +# .. literalinclude:: run_calcs.sh +# :language: bash +# +# This script will loop through all stoichiometry subdirectories and call the CP2K +# engine. + +# run the bash script directly from this script +subprocess.run("bash run_calcs.sh", shell=True) + +# %% +# .. note:: +# +# For a usage on an HPC environment you can parallelize the loop over the +# sub-directories and submit and single job per stoichiometry. +# +# Load results +# ------------ +# After the simulation we load the results and perform a unit version from the default +# CP2K output units (Bohr and Hartree) to Å and eV. + +cflength = 0.529177210903 # Bohr -> Å +cfenergy = 27.211386245988 # Hartree -> eV +cfforce = cfenergy / cflength # Hartree/Bohr -> eV/Å + +# %% +# Finally, we store the results as :class:`ase.Atoms` in the ``new_frames`` list and +# write them to the ``project_directory`` using the ``new_fname``. Here it will be +# written to ``production/out_dft.xyz``. + +new_frames = [] + +for stoichiometry, frames in frames_dict.items(): + current_directory = f"{project_directory}/{stoichiometry}" + + frames_dft = ase.io.read(f"{current_directory}/{project_name}-pos-1.xyz", ":") + forces_dft = ase.io.read(f"{current_directory}/{project_name}-frc-1.xyz", ":") + cell_dft = np.atleast_2d(np.loadtxt(f"{current_directory}/{project_name}-1.cell"))[ + :, 2:-1 + ] + + for i_atoms, atoms in enumerate(frames_dft): + frames_ref = frames[i_atoms] + + # Check consistent positions + if not np.allclose(atoms.positions, frames_ref.positions): + raise ValueError(f"Positions in frame {i_atoms} are not the same.") + + # Check consistent cell + if not np.allclose(frames_ref.cell.flatten(), cell_dft[i_atoms]): + raise ValueError(f"Cell dimensions in frame {i_atoms} are not the same.") + + atoms.info["E"] *= cfenergy + atoms.pbc = True + atoms.cell = frames_ref.cell + atoms.set_array("forces", cfforce * forces_dft[i_atoms].positions) + + new_frames += frames_dft + +new_fname = f"{os.path.splitext(os.path.basename(write_to_file))[0]}_dft.xyz" +ase.io.write(f"{project_directory}/{new_fname}", new_frames) diff --git a/_downloads/aff5eecc36386b5390fd6d11df5c3838/data.zip b/_downloads/aff5eecc36386b5390fd6d11df5c3838/data.zip new file mode 100644 index 00000000..c5b9a3e1 Binary files /dev/null and b/_downloads/aff5eecc36386b5390fd6d11df5c3838/data.zip differ diff --git a/_downloads/b130988d387c627a2afb4ff91c430422/environment.yml b/_downloads/b130988d387c627a2afb4ff91c430422/environment.yml new file mode 100644 index 00000000..4c2b74a6 --- /dev/null +++ b/_downloads/b130988d387c627a2afb4ff91c430422/environment.yml @@ -0,0 +1,11 @@ +channels: + - conda-forge +dependencies: + - python=3.11 + - pip + - rust >=1.65 + - pip: + - ase==3.22.1 + - matplotlib + - rascaline @ git+https://github.com/Luthaf/rascaline@5c2a79838bda0a52d0fde2fbe65941f4792c4cae + - skmatter diff --git a/_downloads/b59df37786d0d368d9bf73d930d78801/heat-capacity.zip b/_downloads/b59df37786d0d368d9bf73d930d78801/heat-capacity.zip new file mode 100644 index 00000000..b9805246 Binary files /dev/null and b/_downloads/b59df37786d0d368d9bf73d930d78801/heat-capacity.zip differ diff --git a/_downloads/b6b84bf8dd77ad82cc02fbec9e101f88/periodic-hamiltonian.zip b/_downloads/b6b84bf8dd77ad82cc02fbec9e101f88/periodic-hamiltonian.zip new file mode 100644 index 00000000..02ecb68c Binary files /dev/null and b/_downloads/b6b84bf8dd77ad82cc02fbec9e101f88/periodic-hamiltonian.zip differ diff --git a/_downloads/beac0e7cadaac3a5e3f35db1c93eb0d6/data.zip b/_downloads/beac0e7cadaac3a5e3f35db1c93eb0d6/data.zip new file mode 100644 index 00000000..75387698 Binary files /dev/null and b/_downloads/beac0e7cadaac3a5e3f35db1c93eb0d6/data.zip differ diff --git a/_downloads/c1382a1742282359674fed148953d82f/environment.yml b/_downloads/c1382a1742282359674fed148953d82f/environment.yml new file mode 100644 index 00000000..f720fd36 --- /dev/null +++ b/_downloads/c1382a1742282359674fed148953d82f/environment.yml @@ -0,0 +1,14 @@ +channels: + - conda-forge +dependencies: + - python=3.11 + - pip + - rust >=1.65 + - pip: + - ase==3.22.1 + - chemiscope>=0.7 + - matplotlib + - metatensor + - rascaline @ git+https://github.com/Luthaf/rascaline@ca957642f512e141c7570e987aadc05c7ac71983 + - scikit-learn + - skmatter diff --git a/_downloads/c30ae838fdaa9326592e1ef5414c0d62/gaas-map.py b/_downloads/c30ae838fdaa9326592e1ef5414c0d62/gaas-map.py new file mode 100644 index 00000000..99bdad6a --- /dev/null +++ b/_downloads/c30ae838fdaa9326592e1ef5414c0d62/gaas-map.py @@ -0,0 +1,261 @@ +r""" +PCA/PCovR Visualization of a training dataset for a potential +============================================================= + +:Authors: Michele Ceriotti `@ceriottm `_, + Giulio Imbalzano + +This example uses ``rascaline`` and ``metatensor`` to compute +structural properties for the structures in a training dataset +for a ML potential. +These are then used with simple dimensionality reduction algorithms +(implemented in ``sklearn`` and ``skmatter``) to obtain a simplified +description of the dataset, that is then visualized using +``chemiscope``. + +This example uses the dataset from +`Imbalzano (2021) `_ +and the principal covariate regression scheme as implemented in +`Helfrecht (2020) `_. +""" + +import os + +import ase +import ase.io +import chemiscope +import numpy as np +import requests +from matplotlib import pyplot as plt +from metatensor import mean_over_samples +from rascaline import AtomicComposition, SoapPowerSpectrum +from sklearn.decomposition import PCA +from sklearn.linear_model import RidgeCV +from skmatter.decomposition import PCovR +from skmatter.preprocessing import StandardFlexibleScaler + + +# sphinx_gallery_thumbnail_number = 2 + +###################################################################### +# First, we load the structures, extracting some of the properties for +# more convenient manipulation. These are +# :math:`\mathrm{Ga}_x\mathrm{As}_{1-x}` structures used in `Imbalzano & +# Ceriotti (2021) `__ to +# train a ML potential to describe the full composition range. +# + +filename = "gaas_training.xyz" +if not os.path.exists(filename): + url = f"https://zenodo.org/records/10566825/files/{filename}" + response = requests.get(url) + response.raise_for_status() + with open(filename, "wb") as f: + f.write(response.content) + +structures = ase.io.read(filename, ":") +energy = np.array([f.info["energy"] for f in structures]) +natoms = np.array([len(f) for f in structures]) + + +###################################################################### +# Remove atomic energy baseline +# ----------------------------- +# +# Energies from an electronic structure calculation contain a very large +# “self” contributions from the atoms, which can obscure the important +# differences in cohesive energies between structures. We can build an +# approximate model based on the chemical nature of the atoms, :math:`a_i` +# +# .. math:: E(A) = \sum_{i\in A} e_{a_i} +# +# where :math:`e_a` are atomic energies that can be determined by linear +# regression. +# + +# rascaline has an `AtomicComposition` calculator that streamlines +# this (simple) calculation +calculator = AtomicComposition(**{"per_structure": True}) +rho0 = calculator.compute(structures) + +# the descriptors are returned as a `TensorMap` object, that contains +# the composition data in a sparse storage format +rho0 + +# for easier manipulation, we extract the features as a dense vector +# of composition weights +comp_feats = rho0.keys_to_properties(["species_center"]).block(0).values + +# a one-liner to fit a linear model and compute "dressed energies" +atom_energy = ( + RidgeCV(alphas=np.geomspace(1e-8, 1e2, 20)) + .fit(comp_feats, energy) + .predict(comp_feats) +) +cohesive_peratom = (energy - atom_energy) / natoms + + +###################################################################### +# The baseline makes up a large fraction of the total energy, but actually +# the residual (which is the part that matters) is still large. +# + +fig, ax = plt.subplots(1, 1, figsize=(6, 4)) +ax.plot(energy / natoms, atom_energy / natoms, "b.") +ax.set_xlabel("Energy / (eV/atom)") +ax.set_ylabel("Atomic e. / (eV/atom)") +plt.show() +print(f"RMSE / (eV/atom): {np.sqrt(np.mean((cohesive_peratom)**2))}") + + +###################################################################### +# Compute structural descriptors +# ------------------------------ +# +# In order to visualize the structures as a low-dimensional map, we start +# by computing suitable ML descriptors. Here we have used ``rascaline`` to +# evaluate average SOAP features for the structures. +# + +# hypers for evaluating rascaline features +hypers = { + "cutoff": 4.5, + "max_radial": 6, + "max_angular": 4, + "atomic_gaussian_width": 0.3, + "cutoff_function": {"ShiftedCosine": {"width": 0.5}}, + "radial_basis": {"Gto": {"accuracy": 1e-6}}, + "center_atom_weight": 1.0, +} +calculator = SoapPowerSpectrum(**hypers) +rho2i = calculator.compute(structures) + +# neighbor types go to the keys for sparsity (this way one can +# compute a heterogeneous dataset without having blocks of zeros) +rho2i = rho2i.keys_to_samples(["species_center"]).keys_to_properties( + ["species_neighbor_1", "species_neighbor_2"] +) + +# computes structure-level descriptors and then extracts +# the features as a dense array +rho2i_structure = mean_over_samples(rho2i, sample_names=["center", "species_center"]) +rho2i = None # releases memory +features = rho2i_structure.block(0).values + + +###################################################################### +# We standardize (per atom) energy and features (computed as a *mean* over +# atomic environments) so that they can be combined on the same footings. +# + +sf_energy = StandardFlexibleScaler().fit_transform(cohesive_peratom.reshape(-1, 1)) +sf_feats = StandardFlexibleScaler().fit_transform(features) + + +###################################################################### +# PCA and PCovR projection +# ------------------------ +# +# Computes PCA projection to generate low-dimensional descriptors that +# reflect structural diversity. Any other dimensionality reduction scheme +# could be used in a similar fashion. +# +# We also compute the principal covariate regression (PCovR) descriptors, +# that reduce dimensionality while combining a variance preserving +# criterion with the requirement that the low-dimensional features are +# capable of estimating a target quantity (here, the energy). +# + +# PCA +pca = PCA(n_components=4) +pca_features = pca.fit_transform(sf_feats) + +fig, ax = plt.subplots(1, 1, figsize=(6, 4)) +scatter = ax.scatter(pca_features[:, 0], pca_features[:, 1], c=cohesive_peratom) +ax.set_xlabel("PCA[1]") +ax.set_ylabel("PCA[2]") +cbar = fig.colorbar(scatter, ax=ax) +cbar.set_label("energy / eV/at.") +plt.show() + +# computes PCovR map +pcovr = PCovR(n_components=4) +pcovr_features = pcovr.fit_transform(sf_feats, sf_energy) + +fig, ax = plt.subplots(1, 1, figsize=(6, 4)) +scatter = ax.scatter(pcovr_features[:, 0], pcovr_features[:, 1], c=cohesive_peratom) +ax.set_xlabel("PCovR[1]") +ax.set_ylabel("PCovR[2]") +cbar = fig.colorbar(scatter, ax=ax) +cbar.set_label("energy / (eV/at.)") +plt.show() + + +###################################################################### +# Chemiscope visualization +# ------------------------ +# +# Visualizes the structure-property map using a chemiscope widget (and +# generates a .json file that can be viewed on +# `chemiscope.org `__). +# + +# extracts force data (adding considerably to the dataset size...) +force_vectors = chemiscope.ase_vectors_to_arrows(structures, scale=1) +force_vectors["parameters"]["global"]["color"] = 0x505050 + +# adds properties to the ASE frames +for i, f in enumerate(structures): + for j in range(len(pca_features[i])): + f.info["pca_" + str(j + 1)] = pca_features[i, j] +for i, f in enumerate(structures): + for j in range(len(pcovr_features[i])): + f.info["pcovr_" + str(j + 1)] = pcovr_features[i, j] +for i, f in enumerate(structures): + f.info["cohesive_energy"] = cohesive_peratom[i] + f.info["x_ga"] = comp_feats[i, 0] / comp_feats[i].sum() + +# it would also be easy to add the properties manually, this is just a dictionary +structure_properties = chemiscope.extract_properties(structures) + +cs = chemiscope.show( + frames=structures, + properties=structure_properties, + shapes={"forces": force_vectors}, + # the settings are a tad verbose, but give full control over the visualization + settings={ + "map": { + "x": {"property": "pcovr_1"}, + "y": {"property": "pcovr_2"}, + "color": {"property": "x_ga"}, + }, + "structure": [ + { + "bonds": True, + "unitCell": True, + "shape": ["forces"], + "keepOrientation": False, + } + ], + }, + meta={ + "name": "GaAs training data", + "description": """ +A collection of Ga(x)As(1-x) structures to train a MLIP, +including force and energy data. +""", + "authors": ["Giulio Imbalzano", "Michele Ceriotti"], + "references": [ + """ +G. Imbalzano and M. Ceriotti, 'Modeling the Ga/As binary system across +temperatures and compositions from first principles,' +Phys. Rev. Materials 5(6), 063804 (2021). +""", + "Original dataset: https://archive.materialscloud.org/record/2021.226", + ], + }, +) + +cs.save("gaas_map.chemiscope.json.gz") + +cs # display if in a notebook diff --git a/_downloads/d26f5b90e59503961ba96aba6341b129/reference-trajectory.zip b/_downloads/d26f5b90e59503961ba96aba6341b129/reference-trajectory.zip new file mode 100644 index 00000000..db596d2e Binary files /dev/null and b/_downloads/d26f5b90e59503961ba96aba6341b129/reference-trajectory.zip differ diff --git a/_downloads/d997f92a427513b3b0c833f5b65889cf/reftraj_template.cp2k b/_downloads/d997f92a427513b3b0c833f5b65889cf/reftraj_template.cp2k new file mode 100644 index 00000000..fe83ba8d --- /dev/null +++ b/_downloads/d997f92a427513b3b0c833f5b65889cf/reftraj_template.cp2k @@ -0,0 +1,144 @@ +@SET PREP 0 + +@SET SCF_GUESS RESTART +@SET SCREEN_ON_INITIAL_P TRUE + +@IF ${PREP} + @SET SCF_GUESS ATOMIC + @SET SCREEN_ON_INITIAL_P FALSE +@ENDIF + +&GLOBAL + PROJECT //PROJECT// + PREFERRED_FFT_LIBRARY FFTW + FFTW_PLAN_TYPE MEASURE + RUN_TYPE MD + PRINT_LEVEL LOW +&END GLOBAL + +&MOTION + &PRINT + &CELL + &EACH + MD 1 + &END EACH + &END CELL + &FORCES + &EACH + MD 1 + &END EACH + &END FORCES + &END PRINT + &MD + ENSEMBLE REFTRAJ + &REFTRAJ ! Loads an external trajectory file and performs analysis on the loaded snapshots. + EVAL_ENERGY_FORCES TRUE + EVAL_FORCES TRUE + CELL_FILE_NAME reftraj.cell + TRAJ_FILE_NAME reftraj.xyz + FIRST_SNAPSHOT 1 + VARIABLE_VOLUME TRUE + LAST_SNAPSHOT //LAST_SNAPSHOT// + &END REFTRAJ + &END MD +&END MOTION + +&FORCE_EVAL + &PRINT + &FORCES + &EACH + MD 1 + &END EACH + &END FORCES + &END PRINT + &DFT + BASIS_SET_FILE_NAME ../../parameters/GTH_BASIS_SETS + BASIS_SET_FILE_NAME ../../parameters/BASIS_ADMM + POTENTIAL_FILE_NAME ../../parameters/POTENTIAL + &MGRID + CUTOFF 400 + &END MGRID + &SCF + SCF_GUESS ${SCF_GUESS} + MAX_SCF 20 + EPS_SCF 5.0E-7 + &OT + MINIMIZER DIIS + PRECONDITIONER FULL_ALL + &END OT + &OUTER_SCF + MAX_SCF 20 + EPS_SCF 5.0E-7 + &END OUTER_SCF + &END SCF + &QS + EPS_DEFAULT 1.0E-12 + EPS_PGF_ORB 1.0E-16 + EXTRAPOLATION_ORDER 5 + &END QS + &XC # revPBE0-TC-D3 + &XC_FUNCTIONAL + &PBE + PARAMETRIZATION REVPBE + SCALE_X 0.75 + SCALE_C 1.0 + &END + &END XC_FUNCTIONAL + &HF + FRACTION 0.25 + &SCREENING + EPS_SCHWARZ 1.0E-6 + SCREEN_ON_INITIAL_P ${SCREEN_ON_INITIAL_P} + &END + &MEMORY + MAX_MEMORY 37000 + EPS_STORAGE_SCALING 0.1 + &END + &INTERACTION_POTENTIAL + POTENTIAL_TYPE TRUNCATED + CUTOFF_RADIUS 3.0 + T_C_G_DATA ../../parameters/t_c_g.dat + &END + &HF_INFO + &END HF_INFO + &END + &VDW_POTENTIAL + POTENTIAL_TYPE PAIR_POTENTIAL + &PAIR_POTENTIAL + TYPE DFTD3 + R_CUTOFF 15 + LONG_RANGE_CORRECTION TRUE + REFERENCE_FUNCTIONAL revPBE0 + PARAMETER_FILE_NAME ../../parameters/dftd3.dat + &END + &END + &XC_GRID + XC_DERIV SPLINE2 + &END + &END XC + &AUXILIARY_DENSITY_MATRIX_METHOD + METHOD BASIS_PROJECTION + ADMM_PURIFICATION_METHOD MO_DIAG + &END AUXILIARY_DENSITY_MATRIX_METHOD + &END DFT + &SUBSYS + &TOPOLOGY + COORD_FILE_NAME init.xyz + COORD_FILE_FORMAT XYZ + CONN_FILE_FORMAT GENERATE + &END TOPOLOGY + &CELL + ABC [angstrom] //CELL// + &END CELL + &KIND H + BASIS_SET TZV2P-GTH + BASIS_SET AUX_FIT cpFIT3 + POTENTIAL GTH-PBE-q1 + &END KIND + &KIND O + BASIS_SET TZV2P-GTH + BASIS_SET AUX_FIT cpFIT3 + POTENTIAL GTH-PBE-q6 + &END KIND + &END SUBSYS +&END FORCE_EVAL diff --git a/_downloads/db9adeac0042e3126c9d37f1c33e3b6f/reference-trajectory.ipynb b/_downloads/db9adeac0042e3126c9d37f1c33e3b6f/reference-trajectory.ipynb new file mode 100644 index 00000000..72847e0f --- /dev/null +++ b/_downloads/db9adeac0042e3126c9d37f1c33e3b6f/reference-trajectory.ipynb @@ -0,0 +1,252 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "\n# Batch run of CP2K calculations\n\n:Authors: Matthias Kellner [@bananenpampe](https://github.com/bananenpampe/),\n Philip Loche [@PicoCentauri](https://github.com/PicoCentauri/)\n\nThis is an example how to perform single point calculations based on list of structures\nusing [CP2K](https://www.cp2k.org) using its [reftraj functionality](https://manual.cp2k.org/trunk/CP2K_INPUT/MOTION/MD/REFTRAJ.html). The inputs are a\nset of structures in :download:`example.xyz` using the DFT parameters defined in\n:download:`reftraj_template.cp2k`. The reference DFT parameters are taken from [Cheng et\nal. Ab initio thermodynamics of liquid and solid water 2019](https://www.pnas.org/doi/10.1073/pnas.1815117116). Due to the small size of the test\nstructure and convergence issues, we have decreased the size of the ``CUTOFF_RADIUS``\nfrom $6.0\\,\\mathrm{\u00c5}$ to $3.0\\,\\mathrm{\u00c5}$. For actual production\ncalculations adapt the template!\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We start the example by importing the required packages.\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "import os\nimport platform\nimport subprocess\nfrom typing import List, Union\n\nimport ase.io\nimport ase.visualize.plot\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport requests" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Install CP2K\n\nWe'll need a working installation of cp2k. The best way to do so depends on your\nplatform, here are some possible solutions, but feel free to replace them with another\ninstallation method.\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "if platform.system() == \"Linux\":\n # use conda on Linux\n subprocess.run([\"conda\", \"install\", \"cp2k\", \"-c\", \"conda-forge\", \"-y\"], check=True)\nelif platform.system() == \"Darwin\":\n # use homebrew on macOS\n subprocess.run([\"brew\", \"install\", \"cp2k\"], check=True)\nelse:\n print(\"no known way to install cp2k, skipping installation\")" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Define necessary functions\nNext we below define necessary helper functions to run the example.\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "def write_reftraj(fname: str, frames: Union[ase.Atoms, List[ase.Atoms]]) -> None:\n \"\"\"Writes a list of ase atoms objects to a reference trajectory.\n\n A reference trajectory is the CP2K compatible format for the compuation of batches.\n All frames must have the stoichiometry/composition.\n \"\"\"\n\n if isinstance(frames, ase.Atoms):\n frames = [frames]\n\n out = \"\"\n for i, atoms in enumerate(frames):\n if (\n len(atoms) != len(frames[0])\n or atoms.get_chemical_formula() != frames[0].get_chemical_formula()\n ):\n raise ValueError(\n f\"Atom symbols in frame {i},{atoms.get_chemical_formula()} are \"\n f\"different compared to inital frame \"\n f\"{frames[0].get_chemical_formula()}. \"\n \"CP2K does not support changing atom types within a reftraj run!\"\n )\n\n out += f\"{len(atoms):>8}\\n i = {i + 1:>8}, time = {0:>12.3f}\\n\"\n for atom in atoms:\n pos = atom.position\n out += f\"{atom.symbol}{pos[0]:24.15f}{pos[1]:24.15f}{pos[2]:24.15f}\\n\"\n out += \"\\n\"\n with open(fname, \"w\") as f:\n f.write(out)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "def write_cellfile(fname: str, frames: Union[ase.Atoms, List[ase.Atoms]]) -> None:\n \"\"\"Writes a cellfile for a list of ``ase.Atoms``.\n\n A Cellfile accompanies a reftraj containing the cell parameters.\n \"\"\"\n if isinstance(frames, ase.Atoms):\n frames = [frames]\n\n out = (\n \"# \"\n \"Step \"\n \"Time [fs] \"\n \"Ax [Angstrom] \"\n \"Ay [Angstrom] \"\n \"Az [Angstrom] \"\n \"Bx [Angstrom] \"\n \"By [Angstrom] \"\n \"Bz [Angstrom] \"\n \"Cx [Angstrom] \"\n \"Cy [Angstrom] \"\n \"Cz [Angstrom] \"\n \"Volume [Angstrom^3]\\n\"\n )\n\n for i, atoms in enumerate(frames):\n out += f\"{i + 1:>8}{0:>12.3f}\"\n out += \"\".join([f\"{c:>20.10f}\" for c in atoms.cell.flatten()])\n out += f\"{atoms.cell.volume:>25.10f}\"\n out += \"\\n\"\n\n with open(fname, \"w\") as f:\n f.write(out)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "def write_cp2k_in(\n fname: str, project_name: str, last_snapshot: int, cell: List[float]\n) -> None:\n \"\"\"Writes a cp2k input file from a template.\n\n Importantly, it writes the location of the basis set definitions,\n determined from the path of the system CP2K install to the input file.\n \"\"\"\n\n cp2k_in = open(\"reftraj_template.cp2k\", \"r\").read()\n\n cp2k_in = cp2k_in.replace(\"//PROJECT//\", project_name)\n cp2k_in = cp2k_in.replace(\"//LAST_SNAPSHOT//\", str(last_snapshot))\n cp2k_in = cp2k_in.replace(\"//CELL//\", \" \".join([f\"{c:.6f}\" for c in cell]))\n\n with open(fname, \"w\") as f:\n f.write(cp2k_in)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We will now download basis set files from CP2K website. Depending on your CP2K\ninstallation, this might not be necessary!\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "def download_parameter(file):\n path = os.path.join(\"parameters\", file)\n\n if not os.path.exists(path):\n url = f\"https://raw.githubusercontent.com/cp2k/cp2k/support/v2024.1/data/{file}\"\n response = requests.get(url)\n response.raise_for_status()\n with open(path, \"wb\") as f:\n f.write(response.content)\n\n\nos.makedirs(\"parameters\", exist_ok=True)\nfor file in [\"GTH_BASIS_SETS\", \"BASIS_ADMM\", \"POTENTIAL\", \"dftd3.dat\", \"t_c_g.dat\"]:\n download_parameter(file)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Prepare calculation inputs\nDuring this example we will create a directory named ``project_directory`` containing\nthe subdirectories for each stoichiometry. This is necessary, because CP2K can only\nrun calculations using a fixed stoichiometry at a time, using its ``reftraj``\nfunctionality.\n\nBelow we define the general information for the CP2K run. This includes the reference\nfiles for the structures, the ``project_name`` used to build the name of the\ntrajectory during the CP2K run, the ``project_directory`` where we store all\nsimulation output as well as the path ``write_to_file`` which is the name of the file\ncontaining the computed energies and forces of the simulation.\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "frames_full = ase.io.read(\"example.xyz\", \":\")\nproject_name = \"test_calcs\" # name of the global PROJECT\nproject_directory = \"production\"\nwrite_to_file = \"out.xyz\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Below we show the initial configuration of two water molecules in a cubic box with a\nside length of $\\approx 4\\,\\mathrm{\u00c5}$.\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "ase.visualize.plot.plot_atoms(frames_full[0])\n\nplt.xlabel(\"\u00c5\")\nplt.ylabel(\"\u00c5\")\n\nplt.show()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We now extract the stoichiometry from the input dataset using ASE's\n:py:meth:`ase.symbols.Symbols.get_chemical_formula` method.\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "frames_dict = {}\n\nfor atoms in frames_full:\n chemical_formula = atoms.get_chemical_formula()\n try:\n frames_dict[chemical_formula]\n except KeyError:\n frames_dict[chemical_formula] = []\n\n frames_dict[chemical_formula].append(atoms)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Based on the stoichiometries we create one calculation subdirectories for the\ncalculations. (reftraj, input and cellfile). For our example this is only is one\ndirectory named ``H4O2`` because our dataset consists only of a single structure with\ntwo water molecules.\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "for stoichiometry, frames in frames_dict.items():\n current_directory = f\"{project_directory}/{stoichiometry}\"\n os.makedirs(current_directory, exist_ok=True)\n\n write_cp2k_in(\n f\"{current_directory}/in.cp2k\",\n project_name=project_name,\n last_snapshot=len(frames),\n cell=frames[0].cell.diagonal(),\n )\n\n ase.io.write(f\"{current_directory}/init.xyz\", frames[0])\n write_reftraj(f\"{current_directory}/reftraj.xyz\", frames)\n write_cellfile(f\"{current_directory}/reftraj.cell\", frames)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Run simulations\nNow we have all ingredients to run the simulations. Below we call the bash script\n:download:`run_calcs.sh`.\n\n.. literalinclude:: run_calcs.sh\n :language: bash\n\nThis script will loop through all stoichiometry subdirectories and call the CP2K\nengine.\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "# run the bash script directly from this script\nsubprocess.run(\"bash run_calcs.sh\", shell=True)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "

Note

For a usage on an HPC environment you can parallelize the loop over the\n sub-directories and submit and single job per stoichiometry.

\n\n## Load results\nAfter the simulation we load the results and perform a unit version from the default\nCP2K output units (Bohr and Hartree) to \u00c5 and eV.\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "cflength = 0.529177210903 # Bohr -> \u00c5\ncfenergy = 27.211386245988 # Hartree -> eV\ncfforce = cfenergy / cflength # Hartree/Bohr -> eV/\u00c5" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Finally, we store the results as :class:`ase.Atoms` in the ``new_frames`` list and\nwrite them to the ``project_directory`` using the ``new_fname``. Here it will be\nwritten to ``production/out_dft.xyz``.\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "new_frames = []\n\nfor stoichiometry, frames in frames_dict.items():\n current_directory = f\"{project_directory}/{stoichiometry}\"\n\n frames_dft = ase.io.read(f\"{current_directory}/{project_name}-pos-1.xyz\", \":\")\n forces_dft = ase.io.read(f\"{current_directory}/{project_name}-frc-1.xyz\", \":\")\n cell_dft = np.atleast_2d(np.loadtxt(f\"{current_directory}/{project_name}-1.cell\"))[\n :, 2:-1\n ]\n\n for i_atoms, atoms in enumerate(frames_dft):\n frames_ref = frames[i_atoms]\n\n # Check consistent positions\n if not np.allclose(atoms.positions, frames_ref.positions):\n raise ValueError(f\"Positions in frame {i_atoms} are not the same.\")\n\n # Check consistent cell\n if not np.allclose(frames_ref.cell.flatten(), cell_dft[i_atoms]):\n raise ValueError(f\"Cell dimensions in frame {i_atoms} are not the same.\")\n\n atoms.info[\"E\"] *= cfenergy\n atoms.pbc = True\n atoms.cell = frames_ref.cell\n atoms.set_array(\"forces\", cfforce * forces_dft[i_atoms].positions)\n\n new_frames += frames_dft\n\nnew_fname = f\"{os.path.splitext(os.path.basename(write_to_file))[0]}_dft.xyz\"\nase.io.write(f\"{project_directory}/{new_fname}\", new_frames)" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.11.10" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} \ No newline at end of file diff --git a/_downloads/e389cfcd09e1fc1fab157bbb32fe0788/path-integrals.zip b/_downloads/e389cfcd09e1fc1fab157bbb32fe0788/path-integrals.zip new file mode 100644 index 00000000..fd22906c Binary files /dev/null and b/_downloads/e389cfcd09e1fc1fab157bbb32fe0788/path-integrals.zip differ diff --git a/_downloads/e7554e760ee8c061289c684f5c666feb/path-integrals.py b/_downloads/e7554e760ee8c061289c684f5c666feb/path-integrals.py new file mode 100644 index 00000000..1e182020 --- /dev/null +++ b/_downloads/e7554e760ee8c061289c684f5c666feb/path-integrals.py @@ -0,0 +1,332 @@ +""" +Path integral molecular dynamics +================================ + +:Authors: Michele Ceriotti `@ceriottm `_ + +This example shows how to run a path integral molecular dynamics +simulation using ``i-PI``, analyze the output and visualize the +trajectory in ``chemiscope``. It uses `LAMMPS `_ +as the driver to simulate the `q-TIP4P/f water +model `_. +""" + +import subprocess +import time + +import chemiscope +import ipi +import matplotlib.pyplot as plt +import numpy as np + + +# %% +# Quantum nuclear effects and path integral methods +# ------------------------------------------------- +# +# The Born-Oppenheimer approximation separates the joint quantum mechanical +# problem for electrons and nuclei into two independent problems. Even though +# often one makes the additional approximation of treating nuclei as classical +# particles, this is not necessary, and in some cases (typically when H atoms are +# present) can add considerable error. +# +# +# .. figure:: pimd-slices-round.png +# :align: center +# :width: 600px +# +# A representation of ther ring-polymer Hamiltonian for a water molecule. +# +# In order to describe the quantum mechanical nature of light nuclei +# (nuclear quantum effects) one of the most widely-applicable methods uses +# the *path integral formalism* to map the quantum partition function of a +# set of distinguishable particles onto the classical partition function of +# *ring polymers* composed by multiple beads (replicas) with +# corresponding atoms in adjacent replicas being connected by harmonic +# springs. +# `The textbook by Tuckerman `_ +# contains a pedagogic introduction to the topic, while +# `this paper `_ outlines the implementation +# used in ``i-PI``. +# +# The classical partition function of the path converges to quantum statistics +# in the limit of a large number of replicas. In this example, we will use a +# technique based on generalized Langevin dynamics, known as +# `PIGLET `_ to accelerate the +# convergence. + + +# %% +# Running PIMD calculations with ``i-PI`` +# --------------------------------------- +# +# `i-PI `_ is based on a client-server model, with ``i-PI`` +# controlling the nuclear dynamics (in this case sampling the path Hamiltonian using +# molecular dynamics) while the calculation of energies and forces is delegated to +# an external client program, in this example ``LAMMPS``. +# +# An i-PI calculation is specified by an XML file. + +# Open and read the XML file +with open("data/input_pimd.xml", "r") as file: + xml_content = file.read() +print(xml_content) + +# %% +# NB1: In a realistic simulation you may want to increase the field +# ``total_steps``, to simulate at least a few 100s of picoseconds. +# +# NB2: To converge a simulation of water at room temperature, you +# typically need at least 32 beads. We will see later how to accelerate +# convergence using a colored-noise thermostat, but you can try to +# modify the input to check convergence with conventional PIMD + +# %% +# i-PI and lammps should be run separately, and it is possible to +# launch separate lammps processes to parallelize the evaluation over +# the beads. On the the command line, this amounts to launching +# +# .. code-block:: bash +# +# i-pi data/input_pimd.xml > log & +# sleep 2 +# lmp -in data/in.lmp & +# lmp -in data/in.lmp & +# +# Note how ``i-PI`` and ``LAMMPS`` are completely independent, and +# therefore need a separate set of input files. The client-side communication +# in ``LAMMPS`` is described in the ``fix_ipi`` section, that matches the socket +# name and mode defined in the ``ffsocket`` field in the ``i-PI`` file. +# +# We can launch the external processes from a Python script as follows + +ipi_process = subprocess.Popen(["i-pi", "data/input_pimd.xml"]) +time.sleep(2) # wait for i-PI to start +lmp_process = [subprocess.Popen(["lmp", "-in", "data/in.lmp"]) for i in range(2)] + +# %% +# If you run this in a notebook, you can go ahead and start loading +# output files *before* i-PI and lammps have finished running, by +# skipping this cell + +ipi_process.wait() +lmp_process[0].wait() +lmp_process[1].wait() + + +# %% +# Analyzing the simulation +# ~~~~~~~~~~~~~~~~~~~~~~~~ +# +# After the simulation has run, you can visualize and post-process the trajectory data. +# Note that i-PI prints a separate trajectory for each bead, as structural properties +# can be computed averaging over the configurations of any of the beads. + +# drops first frame where all atoms overlap +output_data, output_desc = ipi.read_output("simulation.out") +traj_data = [ipi.read_trajectory(f"simulation.pos_{i}.xyz")[1:] for i in range(8)] + + +# %% +# The simulation parameters are pushed at the limits: with the aggressive stochastic +# thermostatting and the high-frequency normal modes of the ring polymer, there are +# fairly large fluctuations of the conserved quantity. This is usually not affecting +# physical observables, but if you see this level of drift in a production run, check +# carefully for convergence and stability with a reduced time step. + +fix, ax = plt.subplots(1, 1, figsize=(4, 3), constrained_layout=True) +ax.plot( + output_data["time"], + output_data["potential"] - output_data["potential"][0], + "b-", + label="Potential, $V$", +) +ax.plot( + output_data["time"], + output_data["conserved"] - output_data["conserved"][0], + "r-", + label="Conserved, $H$", +) +ax.set_xlabel(r"$t$ / ps") +ax.set_ylabel(r"energy / eV") +ax.legend() +plt.show() + +# %% +# While the potential energy is simply the mean over the beads of the +# energy of individual replicas, computing the kinetic energy requires +# averaging special quantities that involve also the correlations between beads. +# Here we compare two of these *estimators*: the 'thermodynamic' estimator becomes +# statistically inefficient when increasing the number of beads, whereas the +# 'centroid virial' estimator remains well-behaved. Note how quickly these estimators +# equilibrate to roughly their stationary value, much faster than the equilibration +# of the potential energy above. This is thanks to the ``pile_g`` thermostat +# (see `DOI:10.1063/1.3489925 `_) that is +# optimally coupled to the normal modes of the ring polymer. + +fix, ax = plt.subplots(1, 1, figsize=(4, 3), constrained_layout=True) +ax.plot( + output_data["time"], + output_data["kinetic_cv"], + "b-", + label="Centroid virial, $K_{CV}$", +) +ax.plot( + output_data["time"], + output_data["kinetic_td"], + "r-", + label="Thermodynamic, $K_{TD}$", +) +ax.set_xlabel(r"$t$ / ps") +ax.set_ylabel(r"energy / eV") +ax.legend() +plt.show() + +# %% +# You can also visualize the (very short) trajectory in a way that highlights the +# fast spreading out of the beads of the ring polymer. ``chemiscope`` provides a +# utility function to interleave the trajectories of the beads, forming a trajectory +# that shows the connecttions between the replicas of each atom. Each atom and its +# connections are color-coded. + +traj_pimd = chemiscope.ase_merge_pi_frames(traj_data) +# we also tweak the visualization options, and then show the viewer +traj_pimd["shapes"]["paths"]["parameters"]["global"]["radius"] = 0.05 +traj_pimd["settings"]["structure"][0].update( + dict( + atoms=False, + keepOrientation=True, + color={"property": "bead_id", "palette": "hsv (periodic)"}, + ) +) + +chemiscope.show(**traj_pimd, mode="structure") + +# %% +# Accelerating PIMD with a PIGLET thermostat +# ------------------------------------------ +# +# The simulations in the previous sections are very far from converged -- typically +# one would need approximately 32 replicas to converge a simulation of +# room-temperature water. To address this problem we will use a method based on +# generalized Langevin equations, called +# `PIGLET `_ +# +# The input file is ``input_piglet.xml``, that only differs by the definition of +# the thermostat, that uses a ``nm_gle`` mode in which each normal mode +# of the ring polymer is attached to a different colored-noise Generalized Langevin +# equation. This makes it possible to converge exactly the simulation results with +# a small number of replicas, and to accelerate greatly convergence for realistic +# systems such as this. The thermostat parameters can be generated on +# `the GLE4MD website `_ +# + +ipi_process = subprocess.Popen(["i-pi", "data/input_piglet.xml"]) +time.sleep(2) # wait for i-PI to start +lmp_process = [subprocess.Popen(["lmp", "-in", "data/in.lmp"]) for i in range(2)] + +ipi_process.wait() +lmp_process[0].wait() +lmp_process[1].wait() + +# %% +# The mean potential energy from the PIGLET trajectory is higher than that for the +# PIMD one, because it is closer to the converged value (try to run a PIMD trajectory +# with 64 beads for comparison) + +# drops first frame +output_gle, desc_gle = ipi.read_output("simulation_piglet.out") +traj_gle = [ipi.read_trajectory(f"simulation_piglet.pos_{i}.xyz")[1:] for i in range(8)] + +fig, ax = plt.subplots(1, 1, figsize=(4, 3), constrained_layout=True) +ax.plot( + output_data["time"], + output_data["potential"] - output_data["potential"][0], + "b--", + label="PIMD", +) +ax.plot( + output_gle["time"], + output_gle["potential"] - output_gle["potential"][0], + "b-", + label="PIGLET", +) +ax.set_xlabel(r"$t$ / ps") +ax.set_ylabel(r"energy / eV") +ax.legend() +plt.show() + +# %% +# However, you should be somewhat careful: PIGLET converges *some* but not all the +# correlations within a path. For instance, it is designed to converge the +# centroid-virial estimator for the kinetic energy, but not the thermodynamic +# estimator. For the same reason, don't try to look at equilibration in terms of +# the mean temperature: it won't match the target value, because PIGLET uses a +# Langevin equation that breaks the classical fluctuation-dissipation theorem, and +# generates a steady-state distribution that mimics quantum fluctuations. + +fix, ax = plt.subplots(1, 1, figsize=(4, 3), constrained_layout=True) +ax.plot(output_data["time"], output_data["kinetic_cv"], "b--", label="PIMD, $K_{CV}$") +ax.plot(output_gle["time"], output_gle["kinetic_cv"], "b", label="PIGLET, $K_{CV}$") +ax.plot(output_data["time"], output_data["kinetic_td"], "r--", label="PIMD, $K_{TD}$") +ax.plot(output_gle["time"], output_gle["kinetic_td"], "r", label="PIGLET, $K_{TD}$") +ax.set_xlabel(r"$t$ / ps") +ax.set_ylabel(r"energy / eV") +ax.legend() +plt.show() + +# %% +# Kinetic energy tensors +# ~~~~~~~~~~~~~~~~~~~~~~ +# +# While we're at it, let's do something more complicated (and instructive). +# Classically, the momentum distribution of any atom is isotropic, so the +# kinetic energy tensor (KET) :math:`\mathbf{p}\mathbf{p}^T/2m` is a constant +# times the identity matrix. Quantum mechanically, the kinetic energy tensor +# has more structure, that reflects the higher kinetic energy of particles +# along directions with stiff bonds. We can compute a moving average of the +# centroid virial estimator of the KET, and plot it to show the direction +# of anisotropy. Note that there are some subtleties connected with the +# evaluation of the moving average, see e.g. +# `DOI:10.1103/PhysRevLett.109.100604 `_ + +# %% +# We first need to postprocess the components of the kinetic energy tensors +# (that i-PI prints out separating the diagonal and off-diagonal bits), averaging +# them over the last 10 frames and combining them with the centroid configuration +# from the last frame in the trajectory. + +kinetic_cv = ipi.read_trajectory("simulation_piglet.kin.xyz")[1:] +kinetic_od = ipi.read_trajectory("simulation_piglet.kod.xyz")[1:] +kinetic_tens = np.hstack( + [ + np.asarray([k.positions for k in kinetic_cv[-10:]]).mean(axis=0), + np.asarray([k.positions for k in kinetic_od[-10:]]).mean(axis=0), + ] +) + +centroid = traj_gle[-1][-1].copy() +centroid.positions = np.asarray([t[-1].positions for t in traj_gle]).mean(axis=0) +centroid.arrays["kinetic_cv"] = kinetic_tens + +# %% +# We can then view these in ``chemiscope``, setting the proper parameters to +# visualize the ellipsoids associated with the KET. Note that some KETs have +# negative eigenvalues, because we are averaging over a few frames, which is +# insufficient to converge the estimator fully. + +ellipsoids = chemiscope.ase_tensors_to_ellipsoids( + [centroid], "kinetic_cv", scale=15, force_positive=True +) + +chemiscope.show( + [centroid], + shapes={"kinetic_cv": ellipsoids}, + mode="structure", + settings=chemiscope.quick_settings( + structure_settings={ + "shape": ["kinetic_cv"], + "unitCell": True, + } + ), +) diff --git a/_downloads/eca45738d1778be3da4e8dd6885e2b1b/sample-selection.zip b/_downloads/eca45738d1778be3da4e8dd6885e2b1b/sample-selection.zip new file mode 100644 index 00000000..9dfde77c Binary files /dev/null and b/_downloads/eca45738d1778be3da4e8dd6885e2b1b/sample-selection.zip differ diff --git a/_downloads/ecc5d2823a1b00229494ffc2024c524d/dos-align.py b/_downloads/ecc5d2823a1b00229494ffc2024c524d/dos-align.py new file mode 100644 index 00000000..7b789a3e --- /dev/null +++ b/_downloads/ecc5d2823a1b00229494ffc2024c524d/dos-align.py @@ -0,0 +1,951 @@ +""" +A ML model for the electron density of states +============================================= +:Authors: How Wei Bin `@HowWeiBin `_ + +This tutorial would go through the entire machine learning framework for the electronic +density of states (DOS). It will cover the construction of the DOS and SOAP +descriptors from ase Atoms and eigenenergy results. A simple neural network will +then be constructed and the model parameters, along with the energy reference will be +optimized during training. A total of three energy reference will be used, the average +Hartree potential, the Fermi level, and an optimized energy reference starting from +the Fermi level energy reference. The performance of each model is then compared. + +First, lets begin by importing the necessary packages and helper functions +""" + +# %% + +import os +import zipfile + +import ase +import ase.io +import matplotlib.pyplot as plt +import numpy as np +import requests +import torch +from rascaline import SoapPowerSpectrum +from scipy.interpolate import CubicHermiteSpline, interp1d +from scipy.optimize import brentq +from torch.utils.data import BatchSampler, DataLoader, Dataset, RandomSampler + + +# %% +# +# Step 0: Load Structures and Eigenenergies +# ------------------------------------------------ +# 1) Downloading and Extracting Data +# 2) Loading Data +# 3) Find range of eigenenergies +# +# We take a small subset of 104 structures in the Si dataset from `Bartok et al., +# 2018 `. +# Each structure in the dataset contains two atoms. +# +# + + +# %% +# 1) Downloading and Extracting Data +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +filename = "dataset.zip" +if not os.path.exists(filename): + url = "https://github.com/HowWeiBin/datasets/archive/refs/tags/Silicon-Diamonds.zip" + response = requests.get(url) + response.raise_for_status() + with open(filename, "wb") as f: + f.write(response.content) + +with zipfile.ZipFile("./dataset.zip", "r") as zip_ref: + zip_ref.extractall("./") +# %% +# 2) Loading Data +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +structures = ase.io.read("./datasets-Silicon-Diamonds/diamonds.xyz", ":") +n_structures = len(structures) +n_atoms = torch.tensor([len(i) for i in structures]) +eigenenergies = torch.load("./datasets-Silicon-Diamonds/diamond_energies.pt") +k_normalization = torch.tensor( + [len(i) for i in eigenenergies] +) # Calculates number of kpoints sampled per structure +print(f"Total number of structures: {len(structures)}") + +# %% +# 3) Find range of eigenenergies +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +# Process eigenenergies to flattened torch tensors + +total_eigenenergies = [torch.flatten(torch.tensor(i)) for i in eigenenergies] + +# Get lowest and highest value of eigenenergies to know the range of eigenenergies + +all_eigenenergies = torch.hstack(total_eigenenergies) +minE = torch.min(all_eigenenergies) +maxE = torch.max(all_eigenenergies) +print(f"The lowest eigenenergy in the dataset is {minE:.3}") +print(f"The highest eigenenergy in the dataset is {maxE:.3}") +# %% +# +# Step 1: Constructing the DOS with different energy references +# ------------------------------------------------------------------------------------------ +# 1) Construct the DOS using the original reference +# 2) Calculate the Fermi level from the DOS +# 3) Build a set of eigenenergies, with the energy reference set to the fermi level +# 4) Truncate the DOS energy window so that the DOS is well-defined at each point +# 5) Construct the DOS in the truncated energy window under both references +# 6) Construct Splines for the DOS to facilitate interpolation during model training +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +# %% +# 1) Construct the DOS using the original reference +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# The DOS will first be constructed from the full set of eigenenergies to +# determine the Fermi level of each structure. The original reference is the +# Average Hartree Potential in this example. + +# To ensure that all the eigenenergies are fully represented after +# gaussian broadening, the energy axis of the DOS extends +# 3eV wider than the range of values for the eigenenergies +energy_lower_bound = minE - 1.5 +energy_upper_bound = maxE + 1.5 + +# Gaussian Smearing for the eDOS, 0.3eV is the appropriate value for this dataset + +sigma = torch.tensor(0.3) +energy_interval = 0.05 +# energy axis, with a grid interval of 0.05 eV + +x_dos = torch.arange(energy_lower_bound, energy_upper_bound, energy_interval) +print( + f"The energy axis ranges from {energy_lower_bound:.3} to \ +{energy_upper_bound:.3}, consisting of {len(x_dos)} grid points" +) + +# normalization factor for each DOS, factor of 2 is included +# because each eigenenergy can be occupied by 2 electrons + +normalization = 2 * ( + 1 / torch.sqrt(2 * torch.tensor(np.pi) * sigma**2) / n_atoms / k_normalization +) + +total_edos = [] + +for structure_eigenenergies in total_eigenenergies: + e_dos = torch.sum( + # Builds a gaussian on each eigenenergy + # and calculates the value on each grid point + torch.exp(-0.5 * ((x_dos - structure_eigenenergies.view(-1, 1)) / sigma) ** 2), + dim=0, + ) + total_edos.append(e_dos) + +total_edos = torch.vstack(total_edos) +total_edos = (total_edos.T * normalization).T + +print(f"The final shape of all the DOS in the dataset is: {list(total_edos.shape)}") + +# %% +# 2) Calculate the Fermi level from the DOS +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# Now we integration the DOS, and then use cubic interpolation and brentq +# to calculate the fermi level. Since only the 4 valence electrons in Silicon +# are represented in this energy range, we take the point where the DOS integrates +# to 4 as the fermi level. + +fermi_levels = [] +total_i_edos = torch.cumulative_trapezoid( + total_edos, x_dos, axis=1 +) # Integrate the DOS along the energy axis +for i in total_i_edos: + interpolated = interp1d( + x_dos[:-1], i - 4, kind="cubic", copy=True, assume_sorted=True + ) # We use i-4 because Silicon has 4 electrons in this energy range + Ef = brentq( + interpolated, x_dos[0] + 0.1, x_dos[-1] - 0.1 + ) # Fermi Level is the point where the (integrated DOS - 4) = 0 + # 0.1 is added and subtracted to prevent brentq from going out of range + fermi_levels.append(Ef) +fermi_levels = torch.tensor(fermi_levels) +# %% +# 3) Build a set of eigenenergies, with the energy reference set to the fermi level +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# Using the fermi levels, we are now able to change the energy reference +# of the eigenenergies to the fermi level + +total_eigenenergies_Ef = [] +for index, energies in enumerate(total_eigenenergies): + total_eigenenergies_Ef.append(energies - fermi_levels[index]) + +all_eigenenergies_Ef = torch.hstack(total_eigenenergies_Ef) + +minE_Ef = torch.min(all_eigenenergies_Ef) +maxE_Ef = torch.max(all_eigenenergies_Ef) +print(f"The lowest eigenenergy using the fermi level energy reference is {minE_Ef:.3}") +print(f"The highest eigenenergy using the fermi level energy reference is {maxE_Ef:.3}") + + +# %% +# 4) Truncate the DOS energy window so that the DOS is well-defined at each point +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# With the fermi levels, we can also truncate the energy window for DOS prediction. +# In this example, we truncate the energy window such that it is 3eV above +# the highest Fermi level in the dataset. + +# For the Average Hartree Potential energy reference +x_dos_H = torch.arange(minE - 1.5, max(fermi_levels) + 3, energy_interval) + +# For the Fermi Level Energy Reference, all the Fermi levels in the dataset is 0eV +x_dos_Ef = torch.arange(minE_Ef - 1.5, 3, energy_interval) +# %% +# 5) Construct the DOS in the truncated energy window under both references +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# Here we construct 2 different targets where they differ in the energy reference +# chosen. These targets will then be treated as different datasets for the model +# to learn on. + +# For the Average Hartree Potential energy reference + +total_edos_H = [] + +for structure_eigenenergies_H in total_eigenenergies: + e_dos = torch.sum( + torch.exp( + -0.5 * ((x_dos_H - structure_eigenenergies_H.view(-1, 1)) / sigma) ** 2 + ), + dim=0, + ) + total_edos_H.append(e_dos) + +total_edos_H = torch.vstack(total_edos_H) +total_edos_H = (total_edos_H.T * normalization).T + + +# For the Fermi Level Energy Reference + +total_edos_Ef = [] + +for structure_eigenenergies_Ef in total_eigenenergies_Ef: + e_dos = torch.sum( + torch.exp( + -0.5 * ((x_dos_Ef - structure_eigenenergies_Ef.view(-1, 1)) / sigma) ** 2 + ), + dim=0, + ) + total_edos_Ef.append(e_dos) + +total_edos_Ef = torch.vstack(total_edos_Ef) +total_edos_Ef = (total_edos_Ef.T * normalization).T + +# %% +# 6) Construct Splines for the DOS to facilitate interpolation during model training +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# Building Cubic Hermite Splines on the DOS on the truncated energy window +# to facilitate interpolation during training. Cubic Hermite Splines takes +# in information on the value and derivative of a function at a point to build splines. +# Thus, we will have to compute both the value and derivative at each spline position + + +# Functions to compute the value and derivative of the DOS at each energy value, x +def edos_value(x, eigenenergies, normalization): + e_dos_E = ( + torch.sum( + torch.exp(-0.5 * ((x - eigenenergies.view(-1, 1)) / sigma) ** 2), dim=0 + ) + * normalization + ) + + return e_dos_E + + +def edos_derivative(x, eigenenergies, normalization): + dfn_dos_E = ( + torch.sum( + torch.exp(-0.5 * ((x - eigenenergies.view(-1, 1)) / sigma) ** 2) + * (-1 * ((x - eigenenergies.view(-1, 1)) / sigma) ** 2), + dim=0, + ) + * normalization + ) + + return dfn_dos_E + + +total_splines_H = [] +# the splines have a higher energy range in case the shift is high +spline_positions_H = torch.arange(minE - 2, max(fermi_levels) + 6, energy_interval) + +for index, structure_eigenenergies_H in enumerate(total_eigenenergies): + e_dos_H = edos_value( + spline_positions_H, structure_eigenenergies_H, normalization[index] + ) + e_dos_H_grad = edos_derivative( + spline_positions_H, structure_eigenenergies_H, normalization[index] + ) + spliner = CubicHermiteSpline(spline_positions_H, e_dos_H, e_dos_H_grad) + total_splines_H.append(torch.tensor(spliner.c)) + +total_splines_H = torch.stack(total_splines_H) + +total_splines_Ef = [] +spline_positions_Ef = torch.arange(minE_Ef - 2, 6, energy_interval) + +for index, structure_eigenenergies_Ef in enumerate(total_eigenenergies_Ef): + e_dos_Ef = edos_value( + spline_positions_Ef, structure_eigenenergies_Ef, normalization[index] + ) + e_dos_Ef_grad = edos_derivative( + spline_positions_Ef, structure_eigenenergies_Ef, normalization[index] + ) + spliner = CubicHermiteSpline(spline_positions_Ef, e_dos_Ef, e_dos_Ef_grad) + total_splines_Ef.append(torch.tensor(spliner.c)) + +total_splines_Ef = torch.stack(total_splines_Ef) + + +# %% +# We have stored the splines coefficients (spliner.c) as torch tensors, +# as such as we will need to write a function to evaluate the DOS from +# the splines positions and coefficients. + + +def evaluate_spline(spline_coefs, spline_positions, x): + """ + spline_coefs: shape of (n x 4 x spline_positions) + + return value: shape of (n x x) + + x : shape of (n x n_points) + """ + interval = torch.round( + spline_positions[1] - spline_positions[0], decimals=4 + ) # get spline grid intervals + x = torch.clamp( + x, min=spline_positions[0], max=spline_positions[-1] - 0.0005 + ) # restrict x to fall within the spline interval + # 0.0005 is substracted to combat errors arising from precision + indexes = torch.floor( + (x - spline_positions[0]) / interval + ).long() # Obtain the index for the appropriate spline coefficients + expanded_index = indexes.unsqueeze(dim=1).expand(-1, 4, -1) + x_1 = x - spline_positions[indexes] + x_2 = x_1 * x_1 + x_3 = x_2 * x_1 + x_0 = torch.ones_like(x_1) + x_powers = torch.stack([x_3, x_2, x_1, x_0]).permute(1, 0, 2) + value = torch.sum( + torch.mul(x_powers, torch.gather(spline_coefs, 2, expanded_index)), axis=1 + ) + + return value # returns the value of the DOS at the energy positions, x. + + +# %% +# Lets look at the accuracy of the splines. +# Test 1: Ability to reproduce the correct values at the default x_dos positions + +shifts = torch.zeros(n_structures) +x_dos_splines = x_dos_H + shifts.view(-1, 1) +spline_dos_H = evaluate_spline(total_splines_H, spline_positions_H, x_dos_splines) + +plt.plot(x_dos_H, total_edos_H[0], color="red", label="True DOS") +plt.plot(x_dos_H, spline_dos_H[0], color="blue", linestyle="--", label="Spline DOS") +plt.legend() +plt.xlabel("Energy [eV]") +plt.ylabel("DOS") +print("Both lines lie on each other") +# %% +# Test 2: Ability to reproduce the correct values at the shifted x_dos positions + +shifts = torch.zeros(n_structures) + 0.3 +x_dos_splines = x_dos_Ef + shifts.view(-1, 1) +spline_dos_Ef = evaluate_spline(total_splines_Ef, spline_positions_Ef, x_dos_splines) + +plt.plot(x_dos_Ef, total_edos_Ef[0], color="red", label="True DOS") +plt.plot(x_dos_Ef, spline_dos_Ef[0], color="blue", linestyle="--", label="Spline DOS") +plt.legend() +plt.xlabel("Energy [eV]") +plt.ylabel("DOS") +print("Both spectras look very similar") +# %% +# +# Step 2: Compute SOAP power spectrum for the dataset +# ------------------------------------------------------------------------------------------ +# +# We first define the hyperparameters to compute the +# SOAP power spectrum using rascaline. + +HYPER_PARAMETERS = { + "cutoff": 4.0, + "max_radial": 8, + "max_angular": 6, + "atomic_gaussian_width": 0.45, + "center_atom_weight": 1.0, + "radial_basis": {"Gto": {}}, + "cutoff_function": { + "Step": {}, + }, + "radial_scaling": { + "Willatt2018": { + "exponent": 5, + "rate": 1, + "scale": 3.0, + }, + }, +} + +# %% +# +# We feed the Hyperparameters into rascaline to compute the SOAP Power spectrum + + +calculator = SoapPowerSpectrum(**HYPER_PARAMETERS) +R_total_soap = calculator.compute(structures) +# Transform the tensormap to a single block containing a dense representation +R_total_soap.keys_to_samples("species_center") +R_total_soap.keys_to_properties(["species_neighbor_1", "species_neighbor_2"]) + +# Now we extract the data tensor from the single block +total_atom_soap = [] +for structure_i in range(n_structures): + a_i = R_total_soap.block(0).samples["structure"] == structure_i + total_atom_soap.append(torch.tensor(R_total_soap.block(0).values[a_i, :])) + +total_soap = torch.stack(total_atom_soap) +# %% +# +# Step 3: Building a Simple MLP Model +# --------------------------------------------------------------------- +# +# 1) Split the data into Training, Validation and Test +# 2) Define the dataloader and the Model Architecture +# 3) Define relevant loss functions for training and inference +# 4) Define the training loop +# 5) Evaluate the model +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +# %% +# 1) Split the data into Training, Validation and Test +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# We will first split the data in a 7:1:2 manner, corresponding to train, val and test. +np.random.seed(0) +train_index = np.arange(n_structures) +np.random.shuffle(train_index) +test_mark = int(0.8 * n_structures) +val_mark = int(0.7 * n_structures) +test_index = train_index[test_mark:] +val_index = train_index[val_mark:test_mark] +train_index = train_index[:val_mark] + +# %% +# 2) Define the dataloader and the Model Architecture +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# We will now build a dataloader and dataset to facillitate training the model batchwise + + +def generate_atomstructure_index(n_atoms_per_structure): + """Generate a sequence of indices for each atom in the structure. + The indices correspond to index of the structure that the atom belongs to + + Args: + n_atoms_per_structure ([array]): + [Array containing the number of atoms each structure contains] + + Return s: + [tensor]: [Total index, matching atoms to structure] + """ + # n_structures = len(n_atoms_per_structure) + total_index = [] + for i, atoms in enumerate(n_atoms_per_structure): + indiv_index = torch.zeros(atoms) + i + total_index.append(indiv_index) + total_index = torch.hstack(total_index) + return total_index.long() + + +class AtomicDataset(Dataset): + def __init__(self, features, n_atoms_per_structure): + self.features = features + self.n_structures = len(n_atoms_per_structure) + self.n_atoms_per_structure = n_atoms_per_structure + self.index = generate_atomstructure_index(self.n_atoms_per_structure) + assert torch.sum(n_atoms_per_structure) == len(features) + + def __len__(self): + return self.n_structures + + def __getitem__(self, idx): + if isinstance(idx, list): # If a list of indexes is given + feature_indexes = [] + + for i in idx: + feature_indexes.append((self.index == i).nonzero(as_tuple=True)[0]) + + feature_indexes = torch.hstack(feature_indexes) + + return ( + self.features[feature_indexes], + idx, + generate_atomstructure_index(self.n_atoms_per_structure[idx]), + ) + + else: + feature_indexes = (self.index == idx).nonzero(as_tuple=True)[0] + return ( + self.features[feature_indexes], + idx, + self.n_atoms_per_structure[idx], + ) + + +def collate( + batch, +): # Defines how to collate the outputs of the __getitem__ function at each batch + for x, idx, index in batch: + return (x, idx, index) + + +x_train = torch.flatten(total_soap[train_index], 0, 1).float() +total_atomic_soaps = torch.vstack(total_atom_soap).float() +train_features = AtomicDataset(x_train, n_atoms[train_index]) +full_atomstructure_index = generate_atomstructure_index(n_atoms) +# Will be required later to collate atomic predictions into structural predictions + +# Build a Dataloader that samples from the AtomicDataset in random batches +Sampler = RandomSampler(train_features) +BSampler = BatchSampler(Sampler, batch_size=32, drop_last=False) +traindata_loader = DataLoader(train_features, sampler=BSampler, collate_fn=collate) + + +# %% +# +# We will now define a simple three layer MLP model, consisting of three layers. +# The align keyword is used to indicate that the energy reference will be optimized +# during training. The alignment parameter refers to the adjustments made to the +# initial energy referenced and will be initialized as zeros. +# + + +class SOAP_NN(torch.nn.Module): + def __init__(self, input_dims, L1, n_train, target_dims, align): + super(SOAP_NN, self).__init__() + self.target_dims = target_dims + self.fc1 = torch.nn.Linear(input_dims, L1) + self.fc2 = torch.nn.Linear(L1, target_dims) + self.silu = torch.nn.SiLU() + self.align = align + if align: + initial_alignment = torch.zeros(n_train) + self.alignment = torch.nn.parameter.Parameter(initial_alignment) + + def forward(self, x): + result = self.fc1(x) + result = self.silu(result) + result = self.fc2(result) + return result + + +# %% +# We will use a small network architecture, whereby the input layer corresponds +# to the size of the SOAP features, 448, the intermediate layer corresponds to +# a tenth size of the input layer and the final layer corresponds +# to the number of outputs. +# +# As a shorthand, the model that optimizes the energy reference during +# training will be called the alignment model +# + +n_outputs_H = len(x_dos_H) +n_outputs_Ef = len(x_dos_Ef) + + +Model_H = SOAP_NN( + x_train.shape[1], + x_train.shape[1] // 10, + len(train_index), + n_outputs_H, + align=False, +) +Model_Ef = SOAP_NN( + x_train.shape[1], + x_train.shape[1] // 10, + len(train_index), + n_outputs_Ef, + align=False, +) +Model_Align = SOAP_NN( + x_train.shape[1], + x_train.shape[1] // 10, + len(train_index), + n_outputs_Ef, + align=True, +) +# The alignment model takes the fermi level energy reference as the starting point + +# %% +# 3) Define relevant loss functions for training and inference +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# We will now define some loss functions that will be useful when we implement +# the model training loop later and during model evaluation on the test set. + + +def t_get_mse(a, b, xdos): + """Compute mean error between two Density of States. + The mean error is integrated across the entire energy grid + to provide a single value to characterize the error + + Args: + a ([tensor]): [Predicted DOS] + b ([tensor]): [True DOS] + xdos ([tensor], optional): [Energy axis of DOS] + + Returns: + [float]: [MSE] + """ + if len(a.size()) > 1: + mse = (torch.trapezoid((a - b) ** 2, xdos, axis=1)).mean() + else: + mse = (torch.trapezoid((a - b) ** 2, xdos, axis=0)).mean() + return mse + + +def t_get_rmse(a, b, xdos): + """Compute root mean squared error between two Density of States . + + Args: + a ([tensor]): [Predicted DOS] + b ([tensor]): [True DOS] + xdos ([tensor], optional): [Energy axis of DOS] + + Raises: + ValueError: [Occurs if tensor shapes are mismatched] + + Returns: + [float]: [RMSE or %RMSE] + """ + + if len(a.size()) > 1: + rmse = torch.sqrt((torch.trapezoid((a - b) ** 2, xdos, axis=1)).mean()) + else: + rmse = torch.sqrt((torch.trapezoid((a - b) ** 2, xdos, axis=0)).mean()) + return rmse + + +def Opt_RMSE_spline(y_pred, xdos, target_splines, spline_positions, n_epochs): + """Evaluates RMSE on the optimal shift of energy axis. + The optimal shift is found via gradient descent after a gridsearch is performed. + + Args: + y_pred ([tensor]): [Prediction/s of DOS] + xdos ([tensor]): [Energy axis] + target_splines ([tensor]): [Contains spline coefficients] + spline_positions ([tensor]): [Contains spline positions] + n_epochs ([int]): [Number of epochs to run for Gradient Descent] + + Returns: + [rmse([float]), optimal_shift[tensor]]: + [RMSE on optimal shift, the optimal shift itself] + + """ + optim_search_mse = [] + offsets = torch.arange(-2, 2, 0.1) + # Grid-search is first done to reduce number of epochs needed for + # gradient descent, typically 50 epochs will be sufficient + # if searching within 0.1 + with torch.no_grad(): + for offset in offsets: + shifts = torch.zeros(y_pred.shape[0]) + offset + shifted_target = evaluate_spline( + target_splines, spline_positions, xdos + shifts.view(-1, 1) + ) + loss_i = ((y_pred - shifted_target) ** 2).mean(dim=1) + optim_search_mse.append(loss_i) + optim_search_mse = torch.vstack(optim_search_mse) + min_index = torch.argmin(optim_search_mse, dim=0) + optimal_offset = offsets[min_index] + + offset = optimal_offset + + shifts = torch.nn.parameter.Parameter(offset.float()) + opt_adam = torch.optim.Adam([shifts], lr=1e-2) + best_error = torch.zeros(len(shifts)) + 100 + best_shifts = shifts.clone() + for _ in range(n_epochs): + shifted_target = evaluate_spline( + target_splines, spline_positions, xdos + shifts.view(-1, 1) + ).detach() + + def closure(): + opt_adam.zero_grad() + shifted_target = evaluate_spline( + target_splines, spline_positions, xdos + shifts.view(-1, 1) + ) + loss_i = ((y_pred - shifted_target) ** 2).mean() + loss_i.backward(gradient=torch.tensor(1), inputs=shifts) + return loss_i + + opt_adam.step(closure) + + with torch.no_grad(): + each_loss = ((y_pred - shifted_target) ** 2).mean(dim=1).float() + index = each_loss < best_error + best_error[index] = each_loss[index].clone() + best_shifts[index] = shifts[index].clone() + + # Evaluate + + optimal_shift = best_shifts + shifted_target = evaluate_spline( + target_splines, spline_positions, xdos + optimal_shift.view(-1, 1) + ) + rmse = t_get_rmse(y_pred, shifted_target, xdos) + return rmse, optimal_shift + + +# %% +# +# 4) Define the training loop +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# We will now define the model training loop, for simplicity we will only +# train each model for a fixed number of epochs, learning rate, and batch_size. +# The training and validation error at each epoch will be saved. + + +def train_model(model_to_train, fixed_DOS, structure_splines, spline_positions, x_dos): + """Trains a model for 500 epochs + + Args: + model_to_train ([torch.nn.Module]): [ML Model] + fixed_DOS ([tensor]): [Contains the DOS at a fixed energy reference, + useful for models that don't optimize the energy reference] + structure_splines ([tensor]): [Contains spline coefficients] + spline_positions ([tensor]): [Contains spline positions] + x_dos ([tensor]): [Energy axis for the prediction] + + Returns: + [train_loss_history([tensor]), + val_loss_history[tensor], + structure_results[tensor]]: + + [Respective loss histories and final structure predictions] + """ + lr = 1e-2 + n_epochs = 500 + + opt = torch.optim.Adam(model_to_train.parameters(), lr=lr) + + train_loss_history = [] + val_loss_history = [] + + for _epoch in range(n_epochs): + for x_data, idx, index in traindata_loader: + opt.zero_grad() + predictions = model_to_train.forward(x_data) + structure_results = torch.zeros([len(idx), model_to_train.target_dims]) + # Sum atomic predictions in each structure + structure_results = structure_results.index_add_( + 0, index, predictions + ) / n_atoms[train_index[idx]].view(-1, 1) + if model_to_train.align: + alignment = model_to_train.alignment + alignment = alignment - torch.mean(alignment) + # Enforce that the alignments have a mean of zero since a constant + # value across the dataset is meaningless when optimizing the + # relative energy reference + target = evaluate_spline( + structure_splines[train_index[idx]], + spline_positions, + x_dos + alignment[idx].view(-1, 1), + ) # Shifts the target based on the alignment value + pred_loss = t_get_mse(structure_results, target, x_dos) + pred_loss.backward() + else: + pred_loss = t_get_mse( + structure_results, fixed_DOS[train_index[idx]], x_dos + ) + pred_loss.backward() + + opt.step() + with torch.no_grad(): + all_pred = model_to_train.forward(total_atomic_soaps.float()) + structure_results = torch.zeros([n_structures, model_to_train.target_dims]) + structure_results = structure_results.index_add_( + 0, full_atomstructure_index, all_pred + ) / (n_atoms).view(-1, 1) + if model_to_train.align: + # Evaluate model on optimal shift as there is no information + # regarding the shift from the fermi level energy reference + # during inference + + alignment = model_to_train.alignment + alignment = alignment - torch.mean(alignment) + target = evaluate_spline( + structure_splines[train_index], + spline_positions, + x_dos + alignment.view(-1, 1), + ) + + train_loss = t_get_rmse(structure_results[train_index], target, x_dos) + val_loss, val_shifts = Opt_RMSE_spline( + structure_results[val_index], + x_dos, + structure_splines[val_index], + spline_positions, + 50, + ) + + else: + train_loss = t_get_rmse( + structure_results[train_index], fixed_DOS[train_index], x_dos + ) + val_loss = t_get_rmse( + structure_results[val_index], fixed_DOS[val_index], x_dos + ) + + train_loss_history.append(train_loss) + val_loss_history.append(val_loss) + train_loss_history = torch.tensor(train_loss_history) + val_loss_history = torch.tensor(val_loss_history) + return ( + train_loss_history, + val_loss_history, + structure_results, + ) + # returns the loss history and the final set of predictions + + +# %% We will now train the respective models + +H_trainloss, H_valloss, H_predictions = train_model( + Model_H, total_edos_H, total_splines_H, spline_positions_H, x_dos_H +) + +Ef_trainloss, Ef_valloss, Ef_predictions = train_model( + Model_Ef, total_edos_Ef, total_splines_Ef, spline_positions_Ef, x_dos_Ef +) + +Align_trainloss, Align_valloss, Align_predictions = train_model( + Model_Align, total_edos_Ef, total_splines_Ef, spline_positions_Ef, x_dos_Ef +) +# %% +# Lets plot the train loss histories to compare their learning behaviour +# + +epochs = np.arange(500) + + +plt.plot(epochs, H_trainloss, color="red", label="Avg Hartree Potential") +plt.plot(epochs, Ef_trainloss, color="blue", label="Fermi Level") +plt.plot(epochs, Align_trainloss, color="green", label="Optimized Reference") +plt.legend() +plt.yscale(value="log") +plt.xlabel("Epochs") +plt.ylabel("RMSE") +plt.title("Train Loss vs Epoch") +plt.show() +# %% +# Lets plot the val loss histories to compare their learning behaviour +# + + +plt.plot(epochs, H_valloss, color="red", label="Avg Hartree Potential") +plt.plot(epochs, Ef_valloss, color="blue", label="Fermi Level") +plt.plot(epochs, Align_valloss, color="green", label="Optimized Reference") +plt.legend() +plt.yscale(value="log") +plt.xlabel("Epochs") +plt.ylabel("RMSE") +plt.title("Validation Loss vs Epoch") +plt.show() + + +# %% +# +# 5) Evaluate the model +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# We will now evaluate the model performance on the test set +# based on the model predictions we obtained previously +# + +H_testloss = Opt_RMSE_spline( + H_predictions[test_index], + x_dos_H, + total_splines_H[test_index], + spline_positions_H, + 200, +) # We use 200 epochs just so it the error a little bit more converged +Ef_testloss = Opt_RMSE_spline( + Ef_predictions[test_index], + x_dos_Ef, + total_splines_Ef[test_index], + spline_positions_Ef, + 200, +) # We use 200 epochs just so it the error a little bit more converged +Align_testloss = Opt_RMSE_spline( + Align_predictions[test_index], + x_dos_Ef, + total_splines_Ef[test_index], + spline_positions_Ef, + 200, +) # We use 200 epochs just so it the error a little bit more converged + +print(f"Test RMSE for average Hartree Potential: {H_testloss[0].item():.3}") +print(f"Test RMSE for Fermi Level: {Ef_testloss[0].item():.3}") +print(f"Test RMSE for Optimized Reference: {Align_testloss[0].item():.3}") + +print( + "The difference in effectiveness between the Optimized Reference \ +and the Fermi Level will increase with more epochs" +) +# %% +# +# Plot Training DOSes at different energy reference to visualize +# the impact of the energy reference. From the plots we can see +# that the optimized energy reference has better alignment of +# common spectral patterns across the dataset +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Average Hartree Energy Reference +# + +for i in total_edos_H[train_index]: + plt.plot(x_dos_H, i, color="C0", alpha=0.6) +plt.title("Energy Reference - Average Hartree Potential") +plt.xlabel("Energy [eV]") +plt.ylabel("DOS") +plt.show() +print("The DOSes, despite looking similar, are offset along the energy axis") + +# %% +# Fermi Level Energy Reference +for i in total_edos_Ef[train_index]: + plt.plot(x_dos_Ef, i, color="C0", alpha=0.6) +plt.title("Energy Reference - Fermi Level") +plt.xlabel("Energy [eV]") +plt.ylabel("DOS") +plt.show() + +print("It is better aligned but still quite some offset") +# %% +# Optimized Energy Reference +shifts = Model_Align.alignment.detach() +shifts = shifts - torch.mean(shifts) +x_dos_splines = x_dos_Ef + shifts.view(-1, 1) +total_edos_align = evaluate_spline( + total_splines_Ef[train_index], spline_positions_Ef, x_dos_splines +) + +for i in total_edos_align: + plt.plot(x_dos_Ef, i, color="C0", alpha=0.6) +plt.title("Energy Reference - Optimized") +plt.xlabel("Energy [eV]") +plt.ylabel("DOS") +plt.show() +print("The DOS alignment is better under the optimized energy reference") +print("The difference will increase with more training epochs") +# %% diff --git a/_downloads/edc4de60777e3b3373ed9e627d585459/environment.yml b/_downloads/edc4de60777e3b3373ed9e627d585459/environment.yml new file mode 100644 index 00000000..cb6cafe4 --- /dev/null +++ b/_downloads/edc4de60777e3b3373ed9e627d585459/environment.yml @@ -0,0 +1,14 @@ +channels: + - conda-forge +dependencies: + - python=3.11 + - pip + - rust >=1.65 + - pip: + - ase==3.22.1 + - chemiscope>=0.7 + - matplotlib + - metatensor + - rascaline @ git+https://github.com/Luthaf/rascaline@ca957642f512e141c7570e987aadc05c7ac71983 + - scikit-learn==1.4.0 + - skmatter diff --git a/_downloads/f04a73ec1916d97f905162a40b2a3dd0/heat-capacity.py b/_downloads/f04a73ec1916d97f905162a40b2a3dd0/heat-capacity.py new file mode 100644 index 00000000..dd574c7a --- /dev/null +++ b/_downloads/f04a73ec1916d97f905162a40b2a3dd0/heat-capacity.py @@ -0,0 +1,296 @@ +""" +Quantum heat capacity of water +============================== + +:Authors: + Filippo Bigi `@frostedoyster `_; + Michele Ceriotti `@ceriottm `_ + +This example shows how to estimate the heat capacity of liquid water +from a path integral molecular dynamics simulation. The dynamics are +run with `i-PI `_, and +`LAMMPS `_ is used +as the driver to simulate the `q-TIP4P/f water +model `_. +""" + +import os +import subprocess +import time +import xml.etree.ElementTree as ET + +import ipi +import matplotlib.pyplot as plt +import numpy as np + + +# %% +# A non-trivial energy estimator +# ------------------------------ +# +# As introduced in the +# `path-integrals example +# `_, +# path-integral estimators +# for observables that depend on momenta are generally not trivial to compute. +# +# In this example, we will focus on the constant-volume heat capacity, +# :math:`c_V`, which is one such +# observable, and we will calculate it for liquid water at room temperature. +# Because of the presence of high-frequency vibrations, many of the nuclear +# degrees of freedom are trapped in the vibrational ground state, which reduces +# substantially the heat capacity from the value that would be obtained +# in the classical limit. See `this review +# `_ +# for an overview of the impact of quantum nuclei on the properties of water. +# From a computational perspective, this means that it is necessary to use +# specialized simulations and estimators to evaluate the correct value. + + +# %% +# Running the PIMD calculation +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# This follows the same steps as the ``path-integrals`` example. One important +# difference is that we will request the ``scaledcoords`` output to the relevant +# section of the ``i-PI`` input XML file, which +# contains estimators that can be used to calculate the total energy and +# heat capacity as following +# `Yamamoto, J. Chem. Phys. (2005) `_. +# +# The input file is shown below. It should be noted that ``scaledcoords`` +# is given a finite differences displacement as a parameter. This is necessary +# as the estimators require higher order derivatives of the potential energy, +# which are calculated using finite differences. This also means that +# evaluating the estimator adds substantial overhead (so it is wise to only +# compute it every few simulation steps, to eliminate correlations between +# snapshots) and that one should be careful to use well-converged simulation +# parameters to avoid discontinuities and noise (for instance, we increase +# the accuracy of the particle-mesh electrostatic calculation, and use a +# shifted Lennard-Jones potential to avoid a discontinuity at the cutoff). + +# Open and show the relevant part of the input +xmlroot = ET.parse("data/input.xml").getroot() +print(" " + ET.tostring(xmlroot.find(".//properties"), encoding="unicode")) + +# %% +# We launch the i-PI and LAMMPS processes, exactly as in the +# ``path-integrals`` example. + +# don't rerun if the outputs already exist +ipi_process = None +if not os.path.exists("water-cv.out"): + ipi_process = subprocess.Popen(["i-pi", "data/input.xml"]) + time.sleep(2) # wait for i-PI to start + lmp_process = [subprocess.Popen(["lmp", "-in", "data/in.lmp"]) for i in range(2)] + +# %% +# Skip this cell if you want to run in the background +if ipi_process is not None: + ipi_process.wait() + lmp_process[0].wait() + lmp_process[1].wait() + +# %% +# Analyzing the results +# ~~~~~~~~~~~~~~~~~~~~~ +# Let's plot the potential and conserved energy as a function of time, +# just to check that the simulation ran sensibly. + +output_data, output_desc = ipi.read_output("water-cv.out") +fix, ax = plt.subplots(1, 1, figsize=(4, 3), constrained_layout=True) +ax.plot( + output_data["time"], + output_data["potential"] - output_data["potential"][0], + "b-", + label="Potential, $V$", +) +ax.plot( + output_data["time"], + output_data["conserved"] - output_data["conserved"][0], + "r-", + label="Conserved, $H$", +) +ax.set_xlabel(r"$t$ / ps") +ax.set_ylabel(r"energy / a.u.") +ax.legend() +plt.show() + +# %% +# As described in the `i-PI documentation +# `_, +# the two quantities returned by the ``scaledcoords`` output are ``eps_v`` +# and ``eps_v'``, defined in the aforementioned +# `paper `_. +# +# These estimators (:math:`\epsilon_v` and :math:`\epsilon_v'`) are derived in the +# "scaled coordinates" formalism, which is a useful trick to avoid the +# growth of the error in the instantaneous values of the estimators with +# the number of beads used in the path integral simulation. +# +# The same paper contains the formulas to calculate the total energy and +# heat capacity from these estimators: +# +# .. math:: +# E = \langle \epsilon_v \rangle \quad +# C_V = k_B \beta^2 \left( \langle \epsilon_v^2 \rangle - \langle +# \epsilon_v \rangle^2 - \langle \epsilon_v' \rangle \right) +# +# First the energy, whose estimator will be compared to the total energy +# calculated as the sum of the potential and kinetic energy estimators. +# Since the kinetic energy is itself calculated from a scaled-coordinates +# estimator (the "centroid virial" estimator), the two total energies are +# the same. + +eps_v = output_data["scaledcoords(fd_delta=5e-3)"][:, 0] +eps_v_prime = output_data["scaledcoords(fd_delta=5e-3)"][:, 1] + +energy_estimator = eps_v # first formula + +fix, ax = plt.subplots(1, 1, figsize=(4, 3), constrained_layout=True) +ax.plot( + output_data["time"], + energy_estimator - energy_estimator[0], + "b-", + label="scaled coordinates estimator", +) +ax.plot( + output_data["time"][:], + ( + output_data["potential"] + - output_data["potential"][0] + + output_data["kinetic_cv"] + - output_data["kinetic_cv"][0] + ), + "r.", + label="potential + virial kinetic", +) +ax.set_xlabel(r"$t$ / ps") +ax.set_ylabel(r"total energy / a.u.") +ax.legend() +plt.show() + + +# %% +# And, finally, the heat capacity. Note that normally the simulation +# requires a few ps for equilibration. Here we discard a few dozen steps +# to eliminate the initial jump, which is due to the relaxation of the +# ring polymers starting from a single atomic configuration. + +# i-PI scaledcoords outputs are in atomic units (see docs) +kB = 3.16681e-6 # Boltzmann constant in atomic units +T = 298.0 # temperature in K, as defined in the input file +beta = 1.0 / (kB * T) + +skip = 20 +heat_capacity = ( # second formula + kB + * (beta**2) + * ( + np.mean(eps_v[skip:] ** 2) + - np.mean(eps_v[skip:]) ** 2 + - np.mean(eps_v_prime[skip:]) + ) +) +heat_capacity_per_molecule = heat_capacity / 32 # 32 molecules in the simulation +print(f"Heat capacity (per water molecule): {(heat_capacity_per_molecule/kB):.2f} kB") + +# %% +# You may recognize that the first part of the estimator is reminiscent +# of the classical estimator for the heat capacity as the fluctuations of the +# (quantum) total energy, which in this case however requires a correction given +# by the mean of the second part of the scaled-coordinates estimator. + +# %% +# Estimating the statistical error +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Especially with such an underconverged simulation, it is important to +# estimate the statistical error in the heat capacity. +# +# Generally, errors on measurements are computed +# as "standard errors", i.e. the standard deviation of a series of data points +# divided by the square root of the number of data points. In our case, +# however, this is made more complicated by the correlation between +# close steps in the molecular dynamics trajectory, which would lead to an +# overestimation of the number of independent samples. To fix this, we can +# calculate the autocorrelation time of the estimators whose errors we +# want to estimate, and apply a correction factor to the number of samples. + + +def autocorrelate(x): + n = len(x) + xo = x - x.mean() # remove mean + acov = (np.correlate(xo, xo, "full"))[n - 1 :] + return acov[: len(acov) // 2] + + +def autocorrelation_time(x): + acov = autocorrelate(x) + return 1.0 + np.sum(acov) / acov[0] + + +# %% +# Using these helper functions, we can now calculate the error on the various +# parts of the heat capacity estimator. Note also the autocorrelation times, that +# are just a little larger than one, indicating that the stride used to print out +# the estimators is appropriate (as there is little correlation between the samples). + +# Autocorrelation times (i.e. number of steps needed to have independent samples) +autocorr_time_error_delta_eps_v = autocorrelation_time( + (eps_v[skip:] - eps_v[skip:].mean()) ** 2 +) +autocorr_time_error_eps_v_prime = autocorrelation_time(eps_v_prime[skip:]) + +print( + f""" +Autocorrelation times (in number of samples): +(eps-)^2: {autocorr_time_error_delta_eps_v:.2f} +eps': {autocorr_time_error_eps_v_prime:.2f} +""" +) + +# Effective number of samples +effective_samples_delta_eps_v = len(eps_v[skip:]) / autocorr_time_error_delta_eps_v +effective_samples_eps_v_prime = len(eps_v[skip:]) / autocorr_time_error_eps_v_prime + +# Standard errors using the effective number of samples +error_delta_eps_v = np.std((eps_v[skip:] - eps_v[skip:].mean()) ** 2) / np.sqrt( + effective_samples_delta_eps_v +) +error_eps_v_prime = np.std(eps_v_prime[skip:]) / np.sqrt(effective_samples_eps_v_prime) + +# Error on the heat capacity (assuming quadrature sum) +error_heat_capacity = ( + kB * (beta**2) * np.sqrt(error_delta_eps_v**2 + error_eps_v_prime**2) +) + +error_heat_capacity_per_molecule = ( + error_heat_capacity / 32 +) # 32 molecules in the simulation + +print( + "Error on the heat capacity (per water molecule): " + f"{(error_heat_capacity_per_molecule/kB):.2f} kB" +) + + +# %% +# The obtained heat capacity is consistent with the values from the literature +# (see e.g. `Ceriotti et al., J. Chem. Phys. (2011) +# `_ +# where the convergence of the heat capacity with number of beads is shown for the same +# water model used in this example). +# However, the error is quite large, which is expected given the short simulation time. +# To reduce the error, one would need to run a longer simulation. Other important error +# sources, which are not accounted for in the error estimate, are the finite size of the +# system and number of beads. Both of these are too small in this example to give +# reliable results. +# +# In a realistic simulation, up to a few 100s of picoseconds might be needed to reduce +# the sampling error to a small value (1-2% of the heat capacity). For water at room +# temperature, you will need 32 beads at the very least (8 were used in this example). +# It is more difficult to give a general rule for the system size: (quantum) energy +# fluctuations are usually localized, but to guarantee accurate sampling of the +# liquid structure, a few hundred water molecules would be a reasonable guess +# (32 were used in this example). diff --git a/_downloads/f6d6590267d583b5f0e9a7ca3a9f8439/lpr.zip b/_downloads/f6d6590267d583b5f0e9a7ca3a9f8439/lpr.zip new file mode 100644 index 00000000..1ead8c7f Binary files /dev/null and b/_downloads/f6d6590267d583b5f0e9a7ca3a9f8439/lpr.zip differ diff --git a/_downloads/fe6711aca3f0f5f2cec13f8a8ebe3462/example.xyz b/_downloads/fe6711aca3f0f5f2cec13f8a8ebe3462/example.xyz new file mode 100644 index 00000000..c0031e2d --- /dev/null +++ b/_downloads/fe6711aca3f0f5f2cec13f8a8ebe3462/example.xyz @@ -0,0 +1,8 @@ +6 +Lattice="3.9111732301689224 0.0 0.0 0.0 3.9111732301689224 0.0 0.0 0.0 3.9111732301689224" Properties=species:S:1:pos:R:3 #=T CELL(abcABC):=T 3.91117=T 90.00000=T Step:=T 1975600=T Bead:=T 0=T x_centroidangstrom=T cellangstrom=T count=0 pbc="T T T" +H 2.55799292 0.30476323 0.67883354 +H 1.46739292 0.53584100 3.59015677 +O 1.78619292 3.82685646 0.31171354 +H 3.52058031 2.55936677 2.71091323 +H 0.84863385 2.05009677 1.85452646 +O 0.09813385 1.75660677 2.33837646 diff --git a/_downloads/fece03724daaa69643cea3d483b9c18e/path-integrals.ipynb b/_downloads/fece03724daaa69643cea3d483b9c18e/path-integrals.ipynb new file mode 100644 index 00000000..97025c2a --- /dev/null +++ b/_downloads/fece03724daaa69643cea3d483b9c18e/path-integrals.ipynb @@ -0,0 +1,280 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "\n# Path integral molecular dynamics\n\n:Authors: Michele Ceriotti [@ceriottm](https://github.com/ceriottm/)\n\nThis example shows how to run a path integral molecular dynamics\nsimulation using ``i-PI``, analyze the output and visualize the\ntrajectory in ``chemiscope``. It uses [LAMMPS](http://lammps.org)\nas the driver to simulate the [q-TIP4P/f water\nmodel](http://doi.org/10.1063/1.3167790).\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "import subprocess\nimport time\n\nimport chemiscope\nimport ipi\nimport matplotlib.pyplot as plt\nimport numpy as np" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Quantum nuclear effects and path integral methods\n\nThe Born-Oppenheimer approximation separates the joint quantum mechanical\nproblem for electrons and nuclei into two independent problems. Even though\noften one makes the additional approximation of treating nuclei as classical\nparticles, this is not necessary, and in some cases (typically when H atoms are\npresent) can add considerable error.\n\n\n.. figure:: pimd-slices-round.png\n :align: center\n :width: 600px\n\n A representation of ther ring-polymer Hamiltonian for a water molecule.\n\nIn order to describe the quantum mechanical nature of light nuclei\n(nuclear quantum effects) one of the most widely-applicable methods uses\nthe *path integral formalism* to map the quantum partition function of a\nset of distinguishable particles onto the classical partition function of\n*ring polymers* composed by multiple beads (replicas) with\ncorresponding atoms in adjacent replicas being connected by harmonic\nsprings.\n[The textbook by Tuckerman](https://tinyurl.com/bdfhk2tx)\ncontains a pedagogic introduction to the topic, while\n[this paper](https://doi.org/10.1063/1.3489925) outlines the implementation\nused in ``i-PI``.\n\nThe classical partition function of the path converges to quantum statistics\nin the limit of a large number of replicas. In this example, we will use a\ntechnique based on generalized Langevin dynamics, known as\n[PIGLET](http://doi.org/10.1103/PhysRevLett.109.100604) to accelerate the\nconvergence.\n\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Running PIMD calculations with ``i-PI``\n\n[i-PI](http://ipi-code.org) is based on a client-server model, with ``i-PI``\ncontrolling the nuclear dynamics (in this case sampling the path Hamiltonian using\nmolecular dynamics) while the calculation of energies and forces is delegated to\nan external client program, in this example ``LAMMPS``.\n\nAn i-PI calculation is specified by an XML file.\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "# Open and read the XML file\nwith open(\"data/input_pimd.xml\", \"r\") as file:\n xml_content = file.read()\nprint(xml_content)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "NB1: In a realistic simulation you may want to increase the field\n``total_steps``, to simulate at least a few 100s of picoseconds.\n\nNB2: To converge a simulation of water at room temperature, you\ntypically need at least 32 beads. We will see later how to accelerate\nconvergence using a colored-noise thermostat, but you can try to\nmodify the input to check convergence with conventional PIMD\n\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "i-PI and lammps should be run separately, and it is possible to\nlaunch separate lammps processes to parallelize the evaluation over\nthe beads. On the the command line, this amounts to launching\n\n```bash\ni-pi data/input_pimd.xml > log &\nsleep 2\nlmp -in data/in.lmp &\nlmp -in data/in.lmp &\n```\nNote how ``i-PI`` and ``LAMMPS`` are completely independent, and\ntherefore need a separate set of input files. The client-side communication\nin ``LAMMPS`` is described in the ``fix_ipi`` section, that matches the socket\nname and mode defined in the ``ffsocket`` field in the ``i-PI`` file.\n\nWe can launch the external processes from a Python script as follows\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "ipi_process = subprocess.Popen([\"i-pi\", \"data/input_pimd.xml\"])\ntime.sleep(2) # wait for i-PI to start\nlmp_process = [subprocess.Popen([\"lmp\", \"-in\", \"data/in.lmp\"]) for i in range(2)]" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "If you run this in a notebook, you can go ahead and start loading\noutput files *before* i-PI and lammps have finished running, by\nskipping this cell\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "ipi_process.wait()\nlmp_process[0].wait()\nlmp_process[1].wait()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Analyzing the simulation\n\nAfter the simulation has run, you can visualize and post-process the trajectory data.\nNote that i-PI prints a separate trajectory for each bead, as structural properties\ncan be computed averaging over the configurations of any of the beads.\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "# drops first frame where all atoms overlap\noutput_data, output_desc = ipi.read_output(\"simulation.out\")\ntraj_data = [ipi.read_trajectory(f\"simulation.pos_{i}.xyz\")[1:] for i in range(8)]" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The simulation parameters are pushed at the limits: with the aggressive stochastic\nthermostatting and the high-frequency normal modes of the ring polymer, there are\nfairly large fluctuations of the conserved quantity. This is usually not affecting\nphysical observables, but if you see this level of drift in a production run, check\ncarefully for convergence and stability with a reduced time step.\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "fix, ax = plt.subplots(1, 1, figsize=(4, 3), constrained_layout=True)\nax.plot(\n output_data[\"time\"],\n output_data[\"potential\"] - output_data[\"potential\"][0],\n \"b-\",\n label=\"Potential, $V$\",\n)\nax.plot(\n output_data[\"time\"],\n output_data[\"conserved\"] - output_data[\"conserved\"][0],\n \"r-\",\n label=\"Conserved, $H$\",\n)\nax.set_xlabel(r\"$t$ / ps\")\nax.set_ylabel(r\"energy / eV\")\nax.legend()\nplt.show()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "While the potential energy is simply the mean over the beads of the\nenergy of individual replicas, computing the kinetic energy requires\naveraging special quantities that involve also the correlations between beads.\nHere we compare two of these *estimators*: the 'thermodynamic' estimator becomes\nstatistically inefficient when increasing the number of beads, whereas the\n'centroid virial' estimator remains well-behaved. Note how quickly these estimators\nequilibrate to roughly their stationary value, much faster than the equilibration\nof the potential energy above. This is thanks to the ``pile_g`` thermostat\n(see [DOI:10.1063/1.3489925](http://doi.org/10.1063/1.3489925)) that is\noptimally coupled to the normal modes of the ring polymer.\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "fix, ax = plt.subplots(1, 1, figsize=(4, 3), constrained_layout=True)\nax.plot(\n output_data[\"time\"],\n output_data[\"kinetic_cv\"],\n \"b-\",\n label=\"Centroid virial, $K_{CV}$\",\n)\nax.plot(\n output_data[\"time\"],\n output_data[\"kinetic_td\"],\n \"r-\",\n label=\"Thermodynamic, $K_{TD}$\",\n)\nax.set_xlabel(r\"$t$ / ps\")\nax.set_ylabel(r\"energy / eV\")\nax.legend()\nplt.show()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "You can also visualize the (very short) trajectory in a way that highlights the\nfast spreading out of the beads of the ring polymer. ``chemiscope`` provides a\nutility function to interleave the trajectories of the beads, forming a trajectory\nthat shows the connecttions between the replicas of each atom. Each atom and its\nconnections are color-coded.\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "traj_pimd = chemiscope.ase_merge_pi_frames(traj_data)\n# we also tweak the visualization options, and then show the viewer\ntraj_pimd[\"shapes\"][\"paths\"][\"parameters\"][\"global\"][\"radius\"] = 0.05\ntraj_pimd[\"settings\"][\"structure\"][0].update(\n dict(\n atoms=False,\n keepOrientation=True,\n color={\"property\": \"bead_id\", \"palette\": \"hsv (periodic)\"},\n )\n)\n\nchemiscope.show(**traj_pimd, mode=\"structure\")" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Accelerating PIMD with a PIGLET thermostat\n\nThe simulations in the previous sections are very far from converged -- typically\none would need approximately 32 replicas to converge a simulation of\nroom-temperature water. To address this problem we will use a method based on\ngeneralized Langevin equations, called\n[PIGLET](http://doi.org/10.1103/PhysRevLett.109.100604)\n\nThe input file is ``input_piglet.xml``, that only differs by the definition of\nthe thermostat, that uses a ``nm_gle`` mode in which each normal mode\nof the ring polymer is attached to a different colored-noise Generalized Langevin\nequation. This makes it possible to converge exactly the simulation results with\na small number of replicas, and to accelerate greatly convergence for realistic\nsystems such as this. The thermostat parameters can be generated on\n[the GLE4MD website](https://tinyurl.com/4y2e45jx)\n\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "ipi_process = subprocess.Popen([\"i-pi\", \"data/input_piglet.xml\"])\ntime.sleep(2) # wait for i-PI to start\nlmp_process = [subprocess.Popen([\"lmp\", \"-in\", \"data/in.lmp\"]) for i in range(2)]\n\nipi_process.wait()\nlmp_process[0].wait()\nlmp_process[1].wait()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The mean potential energy from the PIGLET trajectory is higher than that for the\nPIMD one, because it is closer to the converged value (try to run a PIMD trajectory\nwith 64 beads for comparison)\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "# drops first frame\noutput_gle, desc_gle = ipi.read_output(\"simulation_piglet.out\")\ntraj_gle = [ipi.read_trajectory(f\"simulation_piglet.pos_{i}.xyz\")[1:] for i in range(8)]\n\nfig, ax = plt.subplots(1, 1, figsize=(4, 3), constrained_layout=True)\nax.plot(\n output_data[\"time\"],\n output_data[\"potential\"] - output_data[\"potential\"][0],\n \"b--\",\n label=\"PIMD\",\n)\nax.plot(\n output_gle[\"time\"],\n output_gle[\"potential\"] - output_gle[\"potential\"][0],\n \"b-\",\n label=\"PIGLET\",\n)\nax.set_xlabel(r\"$t$ / ps\")\nax.set_ylabel(r\"energy / eV\")\nax.legend()\nplt.show()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "However, you should be somewhat careful: PIGLET converges *some* but not all the\ncorrelations within a path. For instance, it is designed to converge the\ncentroid-virial estimator for the kinetic energy, but not the thermodynamic\nestimator. For the same reason, don't try to look at equilibration in terms of\nthe mean temperature: it won't match the target value, because PIGLET uses a\nLangevin equation that breaks the classical fluctuation-dissipation theorem, and\ngenerates a steady-state distribution that mimics quantum fluctuations.\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "fix, ax = plt.subplots(1, 1, figsize=(4, 3), constrained_layout=True)\nax.plot(output_data[\"time\"], output_data[\"kinetic_cv\"], \"b--\", label=\"PIMD, $K_{CV}$\")\nax.plot(output_gle[\"time\"], output_gle[\"kinetic_cv\"], \"b\", label=\"PIGLET, $K_{CV}$\")\nax.plot(output_data[\"time\"], output_data[\"kinetic_td\"], \"r--\", label=\"PIMD, $K_{TD}$\")\nax.plot(output_gle[\"time\"], output_gle[\"kinetic_td\"], \"r\", label=\"PIGLET, $K_{TD}$\")\nax.set_xlabel(r\"$t$ / ps\")\nax.set_ylabel(r\"energy / eV\")\nax.legend()\nplt.show()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Kinetic energy tensors\n\nWhile we're at it, let's do something more complicated (and instructive).\nClassically, the momentum distribution of any atom is isotropic, so the\nkinetic energy tensor (KET) $\\mathbf{p}\\mathbf{p}^T/2m$ is a constant\ntimes the identity matrix. Quantum mechanically, the kinetic energy tensor\nhas more structure, that reflects the higher kinetic energy of particles\nalong directions with stiff bonds. We can compute a moving average of the\ncentroid virial estimator of the KET, and plot it to show the direction\nof anisotropy. Note that there are some subtleties connected with the\nevaluation of the moving average, see e.g.\n[DOI:10.1103/PhysRevLett.109.100604](http://doi.org/10.1103/PhysRevLett.109.100604)\n\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We first need to postprocess the components of the kinetic energy tensors\n(that i-PI prints out separating the diagonal and off-diagonal bits), averaging\nthem over the last 10 frames and combining them with the centroid configuration\nfrom the last frame in the trajectory.\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "kinetic_cv = ipi.read_trajectory(\"simulation_piglet.kin.xyz\")[1:]\nkinetic_od = ipi.read_trajectory(\"simulation_piglet.kod.xyz\")[1:]\nkinetic_tens = np.hstack(\n [\n np.asarray([k.positions for k in kinetic_cv[-10:]]).mean(axis=0),\n np.asarray([k.positions for k in kinetic_od[-10:]]).mean(axis=0),\n ]\n)\n\ncentroid = traj_gle[-1][-1].copy()\ncentroid.positions = np.asarray([t[-1].positions for t in traj_gle]).mean(axis=0)\ncentroid.arrays[\"kinetic_cv\"] = kinetic_tens" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We can then view these in ``chemiscope``, setting the proper parameters to\nvisualize the ellipsoids associated with the KET. Note that some KETs have\nnegative eigenvalues, because we are averaging over a few frames, which is\ninsufficient to converge the estimator fully.\n\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "ellipsoids = chemiscope.ase_tensors_to_ellipsoids(\n [centroid], \"kinetic_cv\", scale=15, force_positive=True\n)\n\nchemiscope.show(\n [centroid],\n shapes={\"kinetic_cv\": ellipsoids},\n mode=\"structure\",\n settings=chemiscope.quick_settings(\n structure_settings={\n \"shape\": [\"kinetic_cv\"],\n \"unitCell\": True,\n }\n ),\n)" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.11.10" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} \ No newline at end of file diff --git a/_images/equivariantnonlinear.png b/_images/equivariantnonlinear.png new file mode 100644 index 00000000..306ed6bb Binary files /dev/null and b/_images/equivariantnonlinear.png differ diff --git a/_images/graphene_lattice.png b/_images/graphene_lattice.png new file mode 100644 index 00000000..c474d59c Binary files /dev/null and b/_images/graphene_lattice.png differ diff --git a/_images/metad-scheme.png b/_images/metad-scheme.png new file mode 100644 index 00000000..4dd0e585 Binary files /dev/null and b/_images/metad-scheme.png differ diff --git a/_images/pimd-slices-round.png b/_images/pimd-slices-round.png new file mode 100644 index 00000000..39ae9416 Binary files /dev/null and b/_images/pimd-slices-round.png differ diff --git a/_images/simpleMLP.png b/_images/simpleMLP.png new file mode 100644 index 00000000..56121fa3 Binary files /dev/null and b/_images/simpleMLP.png differ diff --git a/_images/sphx_glr_dos-align_001.png b/_images/sphx_glr_dos-align_001.png new file mode 100644 index 00000000..7e67545f Binary files /dev/null and b/_images/sphx_glr_dos-align_001.png differ diff --git a/_images/sphx_glr_dos-align_002.png b/_images/sphx_glr_dos-align_002.png new file mode 100644 index 00000000..d43edbd2 Binary files /dev/null and b/_images/sphx_glr_dos-align_002.png differ diff --git a/_images/sphx_glr_dos-align_003.png b/_images/sphx_glr_dos-align_003.png new file mode 100644 index 00000000..95e62aac Binary files /dev/null and b/_images/sphx_glr_dos-align_003.png differ diff --git a/_images/sphx_glr_dos-align_004.png b/_images/sphx_glr_dos-align_004.png new file mode 100644 index 00000000..3b12d825 Binary files /dev/null and b/_images/sphx_glr_dos-align_004.png differ diff --git a/_images/sphx_glr_dos-align_005.png b/_images/sphx_glr_dos-align_005.png new file mode 100644 index 00000000..2992fb06 Binary files /dev/null and b/_images/sphx_glr_dos-align_005.png differ diff --git a/_images/sphx_glr_dos-align_006.png b/_images/sphx_glr_dos-align_006.png new file mode 100644 index 00000000..24602ecc Binary files /dev/null and b/_images/sphx_glr_dos-align_006.png differ diff --git a/_images/sphx_glr_dos-align_007.png b/_images/sphx_glr_dos-align_007.png new file mode 100644 index 00000000..0eded7d0 Binary files /dev/null and b/_images/sphx_glr_dos-align_007.png differ diff --git a/_images/sphx_glr_dos-align_thumb.png b/_images/sphx_glr_dos-align_thumb.png new file mode 100644 index 00000000..3b9c8eb6 Binary files /dev/null and b/_images/sphx_glr_dos-align_thumb.png differ diff --git a/_images/sphx_glr_gaas-map_001.png b/_images/sphx_glr_gaas-map_001.png new file mode 100644 index 00000000..0396ac91 Binary files /dev/null and b/_images/sphx_glr_gaas-map_001.png differ diff --git a/_images/sphx_glr_gaas-map_002.png b/_images/sphx_glr_gaas-map_002.png new file mode 100644 index 00000000..1d06873d Binary files /dev/null and b/_images/sphx_glr_gaas-map_002.png differ diff --git a/_images/sphx_glr_gaas-map_003.png b/_images/sphx_glr_gaas-map_003.png new file mode 100644 index 00000000..7360f6ef Binary files /dev/null and b/_images/sphx_glr_gaas-map_003.png differ diff --git a/_images/sphx_glr_gaas-map_thumb.png b/_images/sphx_glr_gaas-map_thumb.png new file mode 100644 index 00000000..5093008d Binary files /dev/null and b/_images/sphx_glr_gaas-map_thumb.png differ diff --git a/_images/sphx_glr_heat-capacity_001.png b/_images/sphx_glr_heat-capacity_001.png new file mode 100644 index 00000000..5d64420f Binary files /dev/null and b/_images/sphx_glr_heat-capacity_001.png differ diff --git a/_images/sphx_glr_heat-capacity_002.png b/_images/sphx_glr_heat-capacity_002.png new file mode 100644 index 00000000..8faf54d3 Binary files /dev/null and b/_images/sphx_glr_heat-capacity_002.png differ diff --git a/_images/sphx_glr_heat-capacity_thumb.png b/_images/sphx_glr_heat-capacity_thumb.png new file mode 100644 index 00000000..76f54da0 Binary files /dev/null and b/_images/sphx_glr_heat-capacity_thumb.png differ diff --git a/_images/sphx_glr_lode-linear_001.png b/_images/sphx_glr_lode-linear_001.png new file mode 100644 index 00000000..6d0e5e0a Binary files /dev/null and b/_images/sphx_glr_lode-linear_001.png differ diff --git a/_images/sphx_glr_lode-linear_thumb.png b/_images/sphx_glr_lode-linear_thumb.png new file mode 100644 index 00000000..165bff1e Binary files /dev/null and b/_images/sphx_glr_lode-linear_thumb.png differ diff --git a/_images/sphx_glr_lpr_001.png b/_images/sphx_glr_lpr_001.png new file mode 100644 index 00000000..66ed2beb Binary files /dev/null and b/_images/sphx_glr_lpr_001.png differ diff --git a/_images/sphx_glr_lpr_002.png b/_images/sphx_glr_lpr_002.png new file mode 100644 index 00000000..af01bffc Binary files /dev/null and b/_images/sphx_glr_lpr_002.png differ diff --git a/_images/sphx_glr_lpr_thumb.png b/_images/sphx_glr_lpr_thumb.png new file mode 100644 index 00000000..2e8445c4 Binary files /dev/null and b/_images/sphx_glr_lpr_thumb.png differ diff --git a/_images/sphx_glr_path-integrals_001.png b/_images/sphx_glr_path-integrals_001.png new file mode 100644 index 00000000..ace1e3bd Binary files /dev/null and b/_images/sphx_glr_path-integrals_001.png differ diff --git a/_images/sphx_glr_path-integrals_002.png b/_images/sphx_glr_path-integrals_002.png new file mode 100644 index 00000000..ef2f273a Binary files /dev/null and b/_images/sphx_glr_path-integrals_002.png differ diff --git a/_images/sphx_glr_path-integrals_003.png b/_images/sphx_glr_path-integrals_003.png new file mode 100644 index 00000000..062b0f68 Binary files /dev/null and b/_images/sphx_glr_path-integrals_003.png differ diff --git a/_images/sphx_glr_path-integrals_004.png b/_images/sphx_glr_path-integrals_004.png new file mode 100644 index 00000000..a11c2387 Binary files /dev/null and b/_images/sphx_glr_path-integrals_004.png differ diff --git a/_images/sphx_glr_path-integrals_thumb.png b/_images/sphx_glr_path-integrals_thumb.png new file mode 100644 index 00000000..761821e2 Binary files /dev/null and b/_images/sphx_glr_path-integrals_thumb.png differ diff --git a/_images/sphx_glr_periodic-hamiltonian_002.png b/_images/sphx_glr_periodic-hamiltonian_002.png new file mode 100644 index 00000000..1d559863 Binary files /dev/null and b/_images/sphx_glr_periodic-hamiltonian_002.png differ diff --git a/_images/sphx_glr_periodic-hamiltonian_003.png b/_images/sphx_glr_periodic-hamiltonian_003.png new file mode 100644 index 00000000..0bf8fbc2 Binary files /dev/null and b/_images/sphx_glr_periodic-hamiltonian_003.png differ diff --git a/_images/sphx_glr_periodic-hamiltonian_thumb.png b/_images/sphx_glr_periodic-hamiltonian_thumb.png new file mode 100644 index 00000000..07564a2b Binary files /dev/null and b/_images/sphx_glr_periodic-hamiltonian_thumb.png differ diff --git a/_images/sphx_glr_pi-metad_001.png b/_images/sphx_glr_pi-metad_001.png new file mode 100644 index 00000000..0f5332ad Binary files /dev/null and b/_images/sphx_glr_pi-metad_001.png differ diff --git a/_images/sphx_glr_pi-metad_002.png b/_images/sphx_glr_pi-metad_002.png new file mode 100644 index 00000000..90983fd5 Binary files /dev/null and b/_images/sphx_glr_pi-metad_002.png differ diff --git a/_images/sphx_glr_pi-metad_003.png b/_images/sphx_glr_pi-metad_003.png new file mode 100644 index 00000000..254ceb25 Binary files /dev/null and b/_images/sphx_glr_pi-metad_003.png differ diff --git a/_images/sphx_glr_pi-metad_004.png b/_images/sphx_glr_pi-metad_004.png new file mode 100644 index 00000000..c460ca2f Binary files /dev/null and b/_images/sphx_glr_pi-metad_004.png differ diff --git a/_images/sphx_glr_pi-metad_005.png b/_images/sphx_glr_pi-metad_005.png new file mode 100644 index 00000000..ee8695be Binary files /dev/null and b/_images/sphx_glr_pi-metad_005.png differ diff --git a/_images/sphx_glr_pi-metad_006.png b/_images/sphx_glr_pi-metad_006.png new file mode 100644 index 00000000..ee75106d Binary files /dev/null and b/_images/sphx_glr_pi-metad_006.png differ diff --git a/_images/sphx_glr_pi-metad_007.png b/_images/sphx_glr_pi-metad_007.png new file mode 100644 index 00000000..7fc79a70 Binary files /dev/null and b/_images/sphx_glr_pi-metad_007.png differ diff --git a/_images/sphx_glr_pi-metad_thumb.png b/_images/sphx_glr_pi-metad_thumb.png new file mode 100644 index 00000000..b0e927f5 Binary files /dev/null and b/_images/sphx_glr_pi-metad_thumb.png differ diff --git a/_images/sphx_glr_reference-trajectory_001.png b/_images/sphx_glr_reference-trajectory_001.png new file mode 100644 index 00000000..09086477 Binary files /dev/null and b/_images/sphx_glr_reference-trajectory_001.png differ diff --git a/_images/sphx_glr_reference-trajectory_thumb.png b/_images/sphx_glr_reference-trajectory_thumb.png new file mode 100644 index 00000000..18bd8b0c Binary files /dev/null and b/_images/sphx_glr_reference-trajectory_thumb.png differ diff --git a/_images/sphx_glr_roy-gch_001.png b/_images/sphx_glr_roy-gch_001.png new file mode 100644 index 00000000..10f8ff18 Binary files /dev/null and b/_images/sphx_glr_roy-gch_001.png differ diff --git a/_images/sphx_glr_roy-gch_002.png b/_images/sphx_glr_roy-gch_002.png new file mode 100644 index 00000000..4bd6896a Binary files /dev/null and b/_images/sphx_glr_roy-gch_002.png differ diff --git a/_images/sphx_glr_roy-gch_003.png b/_images/sphx_glr_roy-gch_003.png new file mode 100644 index 00000000..bbfcd462 Binary files /dev/null and b/_images/sphx_glr_roy-gch_003.png differ diff --git a/_images/sphx_glr_roy-gch_thumb.png b/_images/sphx_glr_roy-gch_thumb.png new file mode 100644 index 00000000..6ba09295 Binary files /dev/null and b/_images/sphx_glr_roy-gch_thumb.png differ diff --git a/_images/sphx_glr_sample-selection_001.png b/_images/sphx_glr_sample-selection_001.png new file mode 100644 index 00000000..7d911099 Binary files /dev/null and b/_images/sphx_glr_sample-selection_001.png differ diff --git a/_images/sphx_glr_sample-selection_thumb.png b/_images/sphx_glr_sample-selection_thumb.png new file mode 100644 index 00000000..9b0f68fc Binary files /dev/null and b/_images/sphx_glr_sample-selection_thumb.png differ diff --git a/_images/sphx_glr_thermostats_001.png b/_images/sphx_glr_thermostats_001.png new file mode 100644 index 00000000..b88d81b2 Binary files /dev/null and b/_images/sphx_glr_thermostats_001.png differ diff --git a/_images/sphx_glr_thermostats_002.png b/_images/sphx_glr_thermostats_002.png new file mode 100644 index 00000000..b64309aa Binary files /dev/null and b/_images/sphx_glr_thermostats_002.png differ diff --git a/_images/sphx_glr_thermostats_003.png b/_images/sphx_glr_thermostats_003.png new file mode 100644 index 00000000..d75b3ac1 Binary files /dev/null and b/_images/sphx_glr_thermostats_003.png differ diff --git a/_images/sphx_glr_thermostats_004.png b/_images/sphx_glr_thermostats_004.png new file mode 100644 index 00000000..8b20b5f7 Binary files /dev/null and b/_images/sphx_glr_thermostats_004.png differ diff --git a/_images/sphx_glr_thermostats_005.png b/_images/sphx_glr_thermostats_005.png new file mode 100644 index 00000000..66056fb2 Binary files /dev/null and b/_images/sphx_glr_thermostats_005.png differ diff --git a/_images/sphx_glr_thermostats_006.png b/_images/sphx_glr_thermostats_006.png new file mode 100644 index 00000000..1f191369 Binary files /dev/null and b/_images/sphx_glr_thermostats_006.png differ diff --git a/_images/sphx_glr_thermostats_007.png b/_images/sphx_glr_thermostats_007.png new file mode 100644 index 00000000..bf3066c0 Binary files /dev/null and b/_images/sphx_glr_thermostats_007.png differ diff --git a/_images/sphx_glr_thermostats_008.png b/_images/sphx_glr_thermostats_008.png new file mode 100644 index 00000000..df170076 Binary files /dev/null and b/_images/sphx_glr_thermostats_008.png differ diff --git a/_images/sphx_glr_thermostats_009.png b/_images/sphx_glr_thermostats_009.png new file mode 100644 index 00000000..d397c187 Binary files /dev/null and b/_images/sphx_glr_thermostats_009.png differ diff --git a/_images/sphx_glr_thermostats_010.png b/_images/sphx_glr_thermostats_010.png new file mode 100644 index 00000000..9c5243dd Binary files /dev/null and b/_images/sphx_glr_thermostats_010.png differ diff --git a/_images/sphx_glr_thermostats_011.png b/_images/sphx_glr_thermostats_011.png new file mode 100644 index 00000000..881e9ca6 Binary files /dev/null and b/_images/sphx_glr_thermostats_011.png differ diff --git a/_images/sphx_glr_thermostats_012.png b/_images/sphx_glr_thermostats_012.png new file mode 100644 index 00000000..51544ccf Binary files /dev/null and b/_images/sphx_glr_thermostats_012.png differ diff --git a/_images/sphx_glr_thermostats_013.png b/_images/sphx_glr_thermostats_013.png new file mode 100644 index 00000000..26a69bc6 Binary files /dev/null and b/_images/sphx_glr_thermostats_013.png differ diff --git a/_images/sphx_glr_thermostats_014.png b/_images/sphx_glr_thermostats_014.png new file mode 100644 index 00000000..6047a732 Binary files /dev/null and b/_images/sphx_glr_thermostats_014.png differ diff --git a/_images/sphx_glr_thermostats_thumb.png b/_images/sphx_glr_thermostats_thumb.png new file mode 100644 index 00000000..4f811804 Binary files /dev/null and b/_images/sphx_glr_thermostats_thumb.png differ diff --git a/_sources/all-examples.rst.txt b/_sources/all-examples.rst.txt new file mode 100644 index 00000000..0e93b1cf --- /dev/null +++ b/_sources/all-examples.rst.txt @@ -0,0 +1,172 @@ + +List of all recipes +=================== + +This section contains the list of all compiled recipes, including those +that are not part of any of the other sections. + + +.. grid:: 1 2 2 3 + :gutter: 1 1 2 3 + + .. grid-item:: + .. card:: A ML model for the electron density of states + :link: examples/dos-align/dos-align + :link-type: doc + :text-align: center + :shadow: md + + .. image:: examples/dos-align/images/thumb/sphx_glr_dos-align_thumb.png + :alt: This tutorial would go through the entire machine learning framework for the electronic density of states (DOS). It will cover the construction of the DOS and SOAP descriptors from ase Atoms and eigenenergy results. A simple neural network will then be constructed and the model parameters, along with the energy reference will be optimized during training. A total of three energy reference will be used, the average Hartree potential, the Fermi level, and an optimized energy reference starting from the Fermi level energy reference. The performance of each model is then compared. + :class: gallery-img + + + .. grid-item:: + .. card:: Batch run of CP2K calculations + :link: examples/batch-cp2k/reference-trajectory + :link-type: doc + :text-align: center + :shadow: md + + .. image:: examples/batch-cp2k/images/thumb/sphx_glr_reference-trajectory_thumb.png + :alt: This is an example how to perform single point calculations based on list of structures using CP2K using its reftraj functionality. The inputs are a set of structures in :download:`example.xyz` using the DFT parameters defined in :download:`reftraj_template.cp2k`. The reference DFT parameters are taken from Cheng et al. Ab initio thermodynamics of liquid and solid water 2019. Due to the small size of the test structure and convergence issues, we have decreased the size of the CUTOFF_RADIUS from 6.0\,\mathrm{Å} to 3.0\,\mathrm{Å}. For actual production calculations adapt the template! + :class: gallery-img + + + .. grid-item:: + .. card:: Constant-temperature MD and thermostats + :link: examples/thermostats/thermostats + :link-type: doc + :text-align: center + :shadow: md + + .. image:: examples/thermostats/images/thumb/sphx_glr_thermostats_thumb.png + :alt: This recipe gives a practical introduction to finite-temperature molecular dynamics simulations, and provides a guide to choose the most appropriate thermostat for the simulation at hand. + :class: gallery-img + + + .. grid-item:: + .. card:: Generalized Convex Hull construction for the polymorphs of ROY + :link: examples/roy-gch/roy-gch + :link-type: doc + :text-align: center + :shadow: md + + .. image:: examples/roy-gch/images/thumb/sphx_glr_roy-gch_thumb.png + :alt: This notebook analyzes the structures of 264 polymorphs of ROY, from Beran et Al, Chemical Science (2022), comparing the conventional density-energy convex hull with a Generalized Convex Hull (GCH) analysis (see Anelli et al., Phys. Rev. Materials (2018)). It uses features computed with rascaline and uses the directional convex hull function from scikit-matter to make the figure. + :class: gallery-img + + + .. grid-item:: + .. card:: Local Prediction Rigidity analysis + :link: examples/lpr/lpr + :link-type: doc + :text-align: center + :shadow: md + + .. image:: examples/lpr/images/thumb/sphx_glr_lpr_thumb.png + :alt: In this tutorial, we calculate the SOAP descriptors of an amorphous silicon dataset using rascaline, then compute the local prediction rigidity (LPR) for the atoms of a "test" set before and after modifications to the "training" dataset has been made. + :class: gallery-img + + + .. grid-item:: + .. card:: Long-distance Equivariants: a tutorial + :link: examples/lode-linear/lode-linear + :link-type: doc + :text-align: center + :shadow: md + + .. image:: examples/lode-linear/images/thumb/sphx_glr_lode-linear_thumb.png + :alt: This tutorial explains how Long range equivariant descriptors can be constructed using rascaline and the resulting descriptors be used to construct a linear model with equisolve + :class: gallery-img + + + .. grid-item:: + .. card:: PCA/PCovR Visualization of a training dataset for a potential + :link: examples/gaas-map/gaas-map + :link-type: doc + :text-align: center + :shadow: md + + .. image:: examples/gaas-map/images/thumb/sphx_glr_gaas-map_thumb.png + :alt: This example uses rascaline and metatensor to compute structural properties for the structures in a training dataset for a ML potential. These are then used with simple dimensionality reduction algorithms (implemented in sklearn and skmatter) to obtain a simplified description of the dataset, that is then visualized using chemiscope. + :class: gallery-img + + + .. grid-item:: + .. card:: Path integral metadynamics + :link: examples/pi-metad/pi-metad + :link-type: doc + :text-align: center + :shadow: md + + .. image:: examples/pi-metad/images/thumb/sphx_glr_pi-metad_thumb.png + :alt: This example shows how to run a free-energy sampling calculation that combines path integral molecular dynamics to model nuclear quantum effects and metadynamics to accelerate sampling of the high-free-energy regions. + :class: gallery-img + + + .. grid-item:: + .. card:: Path integral molecular dynamics + :link: examples/path-integrals/path-integrals + :link-type: doc + :text-align: center + :shadow: md + + .. image:: examples/path-integrals/images/thumb/sphx_glr_path-integrals_thumb.png + :alt: This example shows how to run a path integral molecular dynamics simulation using i-PI, analyze the output and visualize the trajectory in chemiscope. It uses LAMMPS as the driver to simulate the q-TIP4P/f water model. + :class: gallery-img + + + .. grid-item:: + .. card:: Periodic Hamiltonian learning + :link: examples/periodic-hamiltonian/periodic-hamiltonian + :link-type: doc + :text-align: center + :shadow: md + + .. image:: examples/periodic-hamiltonian/images/thumb/sphx_glr_periodic-hamiltonian_thumb.png + :alt: This tutorial explains how to train a machine learning model for the electronic Hamiltonian of a periodic system. Even though we focus on periodic systems, the code and techniques presented here can be directly transferred to molecules. + :class: gallery-img + + + .. grid-item:: + .. card:: Quantum heat capacity of water + :link: examples/heat-capacity/heat-capacity + :link-type: doc + :text-align: center + :shadow: md + + .. image:: examples/heat-capacity/images/thumb/sphx_glr_heat-capacity_thumb.png + :alt: This example shows how to estimate the heat capacity of liquid water from a path integral molecular dynamics simulation. The dynamics are run with i-PI, and LAMMPS is used as the driver to simulate the q-TIP4P/f water model. + :class: gallery-img + + + .. grid-item:: + .. card:: Sample and Feature Selection with FPS and CUR + :link: examples/sample-selection/sample-selection + :link-type: doc + :text-align: center + :shadow: md + + .. image:: examples/sample-selection/images/thumb/sphx_glr_sample-selection_thumb.png + :alt: In this tutorial we generate descriptors using rascaline, then select a subset of structures using both the farthest-point sampling (FPS) and CUR algorithms implemented in scikit-matter. Finally, we also generate a selection of the most important features using the same techniques. + :class: gallery-img + + +.. toctree:: + :maxdepth: 1 + :hidden: + :titlesonly: + + examples/dos-align/dos-align + examples/batch-cp2k/reference-trajectory + examples/thermostats/thermostats + examples/roy-gch/roy-gch + examples/lpr/lpr + examples/lode-linear/lode-linear + examples/gaas-map/gaas-map + examples/pi-metad/pi-metad + examples/path-integrals/path-integrals + examples/periodic-hamiltonian/periodic-hamiltonian + examples/heat-capacity/heat-capacity + examples/sample-selection/sample-selection diff --git a/_sources/contributing.rst.txt b/_sources/contributing.rst.txt new file mode 100644 index 00000000..d197ee0b --- /dev/null +++ b/_sources/contributing.rst.txt @@ -0,0 +1,7 @@ +Contributing a recipe +===================== + +.. include:: ../../CONTRIBUTING.rst + :start-after: marker-contrib-start + :end-before: marker-contrib-end + diff --git a/_sources/downloading.rst.txt b/_sources/downloading.rst.txt new file mode 100644 index 00000000..aa5b09d2 --- /dev/null +++ b/_sources/downloading.rst.txt @@ -0,0 +1,6 @@ +Downloading and running the recipes +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +.. include:: ../../INSTALLING.rst + :start-after: marker-install-start + :end-before: marker-install-end diff --git a/_sources/examples/batch-cp2k/reference-trajectory.rst.txt b/_sources/examples/batch-cp2k/reference-trajectory.rst.txt new file mode 100644 index 00000000..e65bf0d9 --- /dev/null +++ b/_sources/examples/batch-cp2k/reference-trajectory.rst.txt @@ -0,0 +1,529 @@ + +.. DO NOT EDIT. +.. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. +.. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: +.. "examples/batch-cp2k/reference-trajectory.py" +.. LINE NUMBERS ARE GIVEN BELOW. + +.. only:: html + + .. note:: + :class: sphx-glr-download-link-note + + :ref:`Go to the end ` + to download the full example code. + +.. rst-class:: sphx-glr-example-title + +.. _sphx_glr_examples_batch-cp2k_reference-trajectory.py: + + +Batch run of CP2K calculations +============================== + +:Authors: Matthias Kellner `@bananenpampe `_, + Philip Loche `@PicoCentauri `_ + +This is an example how to perform single point calculations based on list of structures +using `CP2K `_ using its `reftraj functionality +`_. The inputs are a +set of structures in :download:`example.xyz` using the DFT parameters defined in +:download:`reftraj_template.cp2k`. The reference DFT parameters are taken from `Cheng et +al. Ab initio thermodynamics of liquid and solid water 2019 +`_. Due to the small size of the test +structure and convergence issues, we have decreased the size of the ``CUTOFF_RADIUS`` +from :math:`6.0\,\mathrm{Å}` to :math:`3.0\,\mathrm{Å}`. For actual production +calculations adapt the template! + +.. GENERATED FROM PYTHON SOURCE LINES 21-22 + +We start the example by importing the required packages. + +.. GENERATED FROM PYTHON SOURCE LINES 22-35 + +.. code-block:: Python + + + import os + import platform + import subprocess + from typing import List, Union + + import ase.io + import ase.visualize.plot + import matplotlib.pyplot as plt + import numpy as np + import requests + + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 36-42 + +Install CP2K +------------ + +We'll need a working installation of cp2k. The best way to do so depends on your +platform, here are some possible solutions, but feel free to replace them with another +installation method. + +.. GENERATED FROM PYTHON SOURCE LINES 43-54 + +.. code-block:: Python + + + if platform.system() == "Linux": + # use conda on Linux + subprocess.run(["conda", "install", "cp2k", "-c", "conda-forge", "-y"], check=True) + elif platform.system() == "Darwin": + # use homebrew on macOS + subprocess.run(["brew", "install", "cp2k"], check=True) + else: + print("no known way to install cp2k, skipping installation") + + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 55-58 + +Define necessary functions +-------------------------- +Next we below define necessary helper functions to run the example. + +.. GENERATED FROM PYTHON SOURCE LINES 58-92 + +.. code-block:: Python + + + + def write_reftraj(fname: str, frames: Union[ase.Atoms, List[ase.Atoms]]) -> None: + """Writes a list of ase atoms objects to a reference trajectory. + + A reference trajectory is the CP2K compatible format for the compuation of batches. + All frames must have the stoichiometry/composition. + """ + + if isinstance(frames, ase.Atoms): + frames = [frames] + + out = "" + for i, atoms in enumerate(frames): + if ( + len(atoms) != len(frames[0]) + or atoms.get_chemical_formula() != frames[0].get_chemical_formula() + ): + raise ValueError( + f"Atom symbols in frame {i},{atoms.get_chemical_formula()} are " + f"different compared to inital frame " + f"{frames[0].get_chemical_formula()}. " + "CP2K does not support changing atom types within a reftraj run!" + ) + + out += f"{len(atoms):>8}\n i = {i + 1:>8}, time = {0:>12.3f}\n" + for atom in atoms: + pos = atom.position + out += f"{atom.symbol}{pos[0]:24.15f}{pos[1]:24.15f}{pos[2]:24.15f}\n" + out += "\n" + with open(fname, "w") as f: + f.write(out) + + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 93-129 + +.. code-block:: Python + + + + def write_cellfile(fname: str, frames: Union[ase.Atoms, List[ase.Atoms]]) -> None: + """Writes a cellfile for a list of ``ase.Atoms``. + + A Cellfile accompanies a reftraj containing the cell parameters. + """ + if isinstance(frames, ase.Atoms): + frames = [frames] + + out = ( + "# " + "Step " + "Time [fs] " + "Ax [Angstrom] " + "Ay [Angstrom] " + "Az [Angstrom] " + "Bx [Angstrom] " + "By [Angstrom] " + "Bz [Angstrom] " + "Cx [Angstrom] " + "Cy [Angstrom] " + "Cz [Angstrom] " + "Volume [Angstrom^3]\n" + ) + + for i, atoms in enumerate(frames): + out += f"{i + 1:>8}{0:>12.3f}" + out += "".join([f"{c:>20.10f}" for c in atoms.cell.flatten()]) + out += f"{atoms.cell.volume:>25.10f}" + out += "\n" + + with open(fname, "w") as f: + f.write(out) + + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 130-151 + +.. code-block:: Python + + + + def write_cp2k_in( + fname: str, project_name: str, last_snapshot: int, cell: List[float] + ) -> None: + """Writes a cp2k input file from a template. + + Importantly, it writes the location of the basis set definitions, + determined from the path of the system CP2K install to the input file. + """ + + cp2k_in = open("reftraj_template.cp2k", "r").read() + + cp2k_in = cp2k_in.replace("//PROJECT//", project_name) + cp2k_in = cp2k_in.replace("//LAST_SNAPSHOT//", str(last_snapshot)) + cp2k_in = cp2k_in.replace("//CELL//", " ".join([f"{c:.6f}" for c in cell])) + + with open(fname, "w") as f: + f.write(cp2k_in) + + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 152-154 + +We will now download basis set files from CP2K website. Depending on your CP2K +installation, this might not be necessary! + +.. GENERATED FROM PYTHON SOURCE LINES 155-173 + +.. code-block:: Python + + + + def download_parameter(file): + path = os.path.join("parameters", file) + + if not os.path.exists(path): + url = f"https://raw.githubusercontent.com/cp2k/cp2k/support/v2024.1/data/{file}" + response = requests.get(url) + response.raise_for_status() + with open(path, "wb") as f: + f.write(response.content) + + + os.makedirs("parameters", exist_ok=True) + for file in ["GTH_BASIS_SETS", "BASIS_ADMM", "POTENTIAL", "dftd3.dat", "t_c_g.dat"]: + download_parameter(file) + + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 174-186 + +Prepare calculation inputs +-------------------------- +During this example we will create a directory named ``project_directory`` containing +the subdirectories for each stoichiometry. This is necessary, because CP2K can only +run calculations using a fixed stoichiometry at a time, using its ``reftraj`` +functionality. + +Below we define the general information for the CP2K run. This includes the reference +files for the structures, the ``project_name`` used to build the name of the +trajectory during the CP2K run, the ``project_directory`` where we store all +simulation output as well as the path ``write_to_file`` which is the name of the file +containing the computed energies and forces of the simulation. + +.. GENERATED FROM PYTHON SOURCE LINES 186-192 + +.. code-block:: Python + + + frames_full = ase.io.read("example.xyz", ":") + project_name = "test_calcs" # name of the global PROJECT + project_directory = "production" + write_to_file = "out.xyz" + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 193-195 + +Below we show the initial configuration of two water molecules in a cubic box with a +side length of :math:`\approx 4\,\mathrm{Å}`. + +.. GENERATED FROM PYTHON SOURCE LINES 195-203 + +.. code-block:: Python + + + ase.visualize.plot.plot_atoms(frames_full[0]) + + plt.xlabel("Å") + plt.ylabel("Å") + + plt.show() + + + + +.. image-sg:: /examples/batch-cp2k/images/sphx_glr_reference-trajectory_001.png + :alt: reference trajectory + :srcset: /examples/batch-cp2k/images/sphx_glr_reference-trajectory_001.png + :class: sphx-glr-single-img + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 204-206 + +We now extract the stoichiometry from the input dataset using ASE's +:py:meth:`ase.symbols.Symbols.get_chemical_formula` method. + +.. GENERATED FROM PYTHON SOURCE LINES 206-218 + +.. code-block:: Python + + + frames_dict = {} + + for atoms in frames_full: + chemical_formula = atoms.get_chemical_formula() + try: + frames_dict[chemical_formula] + except KeyError: + frames_dict[chemical_formula] = [] + + frames_dict[chemical_formula].append(atoms) + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 219-223 + +Based on the stoichiometries we create one calculation subdirectories for the +calculations. (reftraj, input and cellfile). For our example this is only is one +directory named ``H4O2`` because our dataset consists only of a single structure with +two water molecules. + +.. GENERATED FROM PYTHON SOURCE LINES 223-239 + +.. code-block:: Python + + + for stoichiometry, frames in frames_dict.items(): + current_directory = f"{project_directory}/{stoichiometry}" + os.makedirs(current_directory, exist_ok=True) + + write_cp2k_in( + f"{current_directory}/in.cp2k", + project_name=project_name, + last_snapshot=len(frames), + cell=frames[0].cell.diagonal(), + ) + + ase.io.write(f"{current_directory}/init.xyz", frames[0]) + write_reftraj(f"{current_directory}/reftraj.xyz", frames) + write_cellfile(f"{current_directory}/reftraj.cell", frames) + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 240-250 + +Run simulations +--------------- +Now we have all ingredients to run the simulations. Below we call the bash script +:download:`run_calcs.sh`. + +.. literalinclude:: run_calcs.sh + :language: bash + +This script will loop through all stoichiometry subdirectories and call the CP2K +engine. + +.. GENERATED FROM PYTHON SOURCE LINES 250-254 + +.. code-block:: Python + + + # run the bash script directly from this script + subprocess.run("bash run_calcs.sh", shell=True) + + + + + +.. rst-class:: sphx-glr-script-out + + .. code-block:: none + + + CompletedProcess(args='bash run_calcs.sh', returncode=0) + + + +.. GENERATED FROM PYTHON SOURCE LINES 255-264 + +.. note:: + + For a usage on an HPC environment you can parallelize the loop over the + sub-directories and submit and single job per stoichiometry. + +Load results +------------ +After the simulation we load the results and perform a unit version from the default +CP2K output units (Bohr and Hartree) to Å and eV. + +.. GENERATED FROM PYTHON SOURCE LINES 264-269 + +.. code-block:: Python + + + cflength = 0.529177210903 # Bohr -> Å + cfenergy = 27.211386245988 # Hartree -> eV + cfforce = cfenergy / cflength # Hartree/Bohr -> eV/Å + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 270-273 + +Finally, we store the results as :class:`ase.Atoms` in the ``new_frames`` list and +write them to the ``project_directory`` using the ``new_fname``. Here it will be +written to ``production/out_dft.xyz``. + +.. GENERATED FROM PYTHON SOURCE LINES 273-305 + +.. code-block:: Python + + + new_frames = [] + + for stoichiometry, frames in frames_dict.items(): + current_directory = f"{project_directory}/{stoichiometry}" + + frames_dft = ase.io.read(f"{current_directory}/{project_name}-pos-1.xyz", ":") + forces_dft = ase.io.read(f"{current_directory}/{project_name}-frc-1.xyz", ":") + cell_dft = np.atleast_2d(np.loadtxt(f"{current_directory}/{project_name}-1.cell"))[ + :, 2:-1 + ] + + for i_atoms, atoms in enumerate(frames_dft): + frames_ref = frames[i_atoms] + + # Check consistent positions + if not np.allclose(atoms.positions, frames_ref.positions): + raise ValueError(f"Positions in frame {i_atoms} are not the same.") + + # Check consistent cell + if not np.allclose(frames_ref.cell.flatten(), cell_dft[i_atoms]): + raise ValueError(f"Cell dimensions in frame {i_atoms} are not the same.") + + atoms.info["E"] *= cfenergy + atoms.pbc = True + atoms.cell = frames_ref.cell + atoms.set_array("forces", cfforce * forces_dft[i_atoms].positions) + + new_frames += frames_dft + + new_fname = f"{os.path.splitext(os.path.basename(write_to_file))[0]}_dft.xyz" + ase.io.write(f"{project_directory}/{new_fname}", new_frames) + + + + + + + + +.. rst-class:: sphx-glr-timing + + **Total running time of the script:** (0 minutes 31.608 seconds) + + +.. _sphx_glr_download_examples_batch-cp2k_reference-trajectory.py: + +.. only:: html + + .. container:: sphx-glr-footer sphx-glr-footer-example + + + .. container:: sphx-glr-download + + :download:`Download Conda environment file: environment.yml ` + .. container:: sphx-glr-download sphx-glr-download-jupyter + + :download:`Download Jupyter notebook: reference-trajectory.ipynb ` + + .. container:: sphx-glr-download sphx-glr-download-python + + :download:`Download Python source code: reference-trajectory.py ` + + .. container:: sphx-glr-download sphx-glr-download-zip + + :download:`Download zipped: reference-trajectory.zip ` + + +.. only:: html + + .. rst-class:: sphx-glr-signature + + `Gallery generated by Sphinx-Gallery `_ + diff --git a/_sources/examples/dos-align/dos-align.rst.txt b/_sources/examples/dos-align/dos-align.rst.txt new file mode 100644 index 00000000..0c84c2f7 --- /dev/null +++ b/_sources/examples/dos-align/dos-align.rst.txt @@ -0,0 +1,1458 @@ + +.. DO NOT EDIT. +.. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. +.. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: +.. "examples/dos-align/dos-align.py" +.. LINE NUMBERS ARE GIVEN BELOW. + +.. only:: html + + .. note:: + :class: sphx-glr-download-link-note + + :ref:`Go to the end ` + to download the full example code. + +.. rst-class:: sphx-glr-example-title + +.. _sphx_glr_examples_dos-align_dos-align.py: + + +A ML model for the electron density of states +============================================= +:Authors: How Wei Bin `@HowWeiBin `_ + +This tutorial would go through the entire machine learning framework for the electronic +density of states (DOS). It will cover the construction of the DOS and SOAP +descriptors from ase Atoms and eigenenergy results. A simple neural network will +then be constructed and the model parameters, along with the energy reference will be +optimized during training. A total of three energy reference will be used, the average +Hartree potential, the Fermi level, and an optimized energy reference starting from +the Fermi level energy reference. The performance of each model is then compared. + +First, lets begin by importing the necessary packages and helper functions + +.. GENERATED FROM PYTHON SOURCE LINES 18-34 + +.. code-block:: Python + + + import os + import zipfile + + import ase + import ase.io + import matplotlib.pyplot as plt + import numpy as np + import requests + import torch + from rascaline import SoapPowerSpectrum + from scipy.interpolate import CubicHermiteSpline, interp1d + from scipy.optimize import brentq + from torch.utils.data import BatchSampler, DataLoader, Dataset, RandomSampler + + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 35-46 + +Step 0: Load Structures and Eigenenergies +------------------------------------------------ +1) Downloading and Extracting Data +2) Loading Data +3) Find range of eigenenergies + +We take a small subset of 104 structures in the Si dataset from `Bartok et al., +2018 `. +Each structure in the dataset contains two atoms. + + + +.. GENERATED FROM PYTHON SOURCE LINES 50-52 + +1) Downloading and Extracting Data +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +.. GENERATED FROM PYTHON SOURCE LINES 52-62 + +.. code-block:: Python + + filename = "dataset.zip" + if not os.path.exists(filename): + url = "https://github.com/HowWeiBin/datasets/archive/refs/tags/Silicon-Diamonds.zip" + response = requests.get(url) + response.raise_for_status() + with open(filename, "wb") as f: + f.write(response.content) + + with zipfile.ZipFile("./dataset.zip", "r") as zip_ref: + zip_ref.extractall("./") + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 63-65 + +2) Loading Data +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +.. GENERATED FROM PYTHON SOURCE LINES 65-74 + +.. code-block:: Python + + structures = ase.io.read("./datasets-Silicon-Diamonds/diamonds.xyz", ":") + n_structures = len(structures) + n_atoms = torch.tensor([len(i) for i in structures]) + eigenenergies = torch.load("./datasets-Silicon-Diamonds/diamond_energies.pt") + k_normalization = torch.tensor( + [len(i) for i in eigenenergies] + ) # Calculates number of kpoints sampled per structure + print(f"Total number of structures: {len(structures)}") + + + + + +.. rst-class:: sphx-glr-script-out + + .. code-block:: none + + /home/runner/work/atomistic-cookbook/atomistic-cookbook/examples/dos-align/dos-align.py:68: FutureWarning: You are using `torch.load` with `weights_only=False` (the current default value), which uses the default pickle module implicitly. It is possible to construct malicious pickle data which will execute arbitrary code during unpickling (See https://github.com/pytorch/pytorch/blob/main/SECURITY.md#untrusted-models for more details). In a future release, the default value for `weights_only` will be flipped to `True`. This limits the functions that could be executed during unpickling. Arbitrary objects will no longer be allowed to be loaded via this mode unless they are explicitly allowlisted by the user via `torch.serialization.add_safe_globals`. We recommend you start setting `weights_only=True` for any use case where you don't have full control of the loaded file. Please open an issue on GitHub for any issues related to this experimental feature. + eigenenergies = torch.load("./datasets-Silicon-Diamonds/diamond_energies.pt") + Total number of structures: 104 + + + + +.. GENERATED FROM PYTHON SOURCE LINES 75-77 + +3) Find range of eigenenergies +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +.. GENERATED FROM PYTHON SOURCE LINES 77-89 + +.. code-block:: Python + + + # Process eigenenergies to flattened torch tensors + + total_eigenenergies = [torch.flatten(torch.tensor(i)) for i in eigenenergies] + + # Get lowest and highest value of eigenenergies to know the range of eigenenergies + + all_eigenenergies = torch.hstack(total_eigenenergies) + minE = torch.min(all_eigenenergies) + maxE = torch.max(all_eigenenergies) + print(f"The lowest eigenenergy in the dataset is {minE:.3}") + print(f"The highest eigenenergy in the dataset is {maxE:.3}") + + + + +.. rst-class:: sphx-glr-script-out + + .. code-block:: none + + The lowest eigenenergy in the dataset is -20.5 + The highest eigenenergy in the dataset is 8.65 + + + + +.. GENERATED FROM PYTHON SOURCE LINES 90-100 + +Step 1: Constructing the DOS with different energy references +------------------------------------------------------------------------------------------ +1) Construct the DOS using the original reference +2) Calculate the Fermi level from the DOS +3) Build a set of eigenenergies, with the energy reference set to the fermi level +4) Truncate the DOS energy window so that the DOS is well-defined at each point +5) Construct the DOS in the truncated energy window under both references +6) Construct Splines for the DOS to facilitate interpolation during model training + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +.. GENERATED FROM PYTHON SOURCE LINES 103-108 + +1) Construct the DOS using the original reference +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +The DOS will first be constructed from the full set of eigenenergies to +determine the Fermi level of each structure. The original reference is the +Average Hartree Potential in this example. + +.. GENERATED FROM PYTHON SOURCE LINES 108-150 + +.. code-block:: Python + + + # To ensure that all the eigenenergies are fully represented after + # gaussian broadening, the energy axis of the DOS extends + # 3eV wider than the range of values for the eigenenergies + energy_lower_bound = minE - 1.5 + energy_upper_bound = maxE + 1.5 + + # Gaussian Smearing for the eDOS, 0.3eV is the appropriate value for this dataset + + sigma = torch.tensor(0.3) + energy_interval = 0.05 + # energy axis, with a grid interval of 0.05 eV + + x_dos = torch.arange(energy_lower_bound, energy_upper_bound, energy_interval) + print( + f"The energy axis ranges from {energy_lower_bound:.3} to \ + {energy_upper_bound:.3}, consisting of {len(x_dos)} grid points" + ) + + # normalization factor for each DOS, factor of 2 is included + # because each eigenenergy can be occupied by 2 electrons + + normalization = 2 * ( + 1 / torch.sqrt(2 * torch.tensor(np.pi) * sigma**2) / n_atoms / k_normalization + ) + + total_edos = [] + + for structure_eigenenergies in total_eigenenergies: + e_dos = torch.sum( + # Builds a gaussian on each eigenenergy + # and calculates the value on each grid point + torch.exp(-0.5 * ((x_dos - structure_eigenenergies.view(-1, 1)) / sigma) ** 2), + dim=0, + ) + total_edos.append(e_dos) + + total_edos = torch.vstack(total_edos) + total_edos = (total_edos.T * normalization).T + + print(f"The final shape of all the DOS in the dataset is: {list(total_edos.shape)}") + + + + + +.. rst-class:: sphx-glr-script-out + + .. code-block:: none + + The energy axis ranges from -22.0 to 10.1, consisting of 644 grid points + The final shape of all the DOS in the dataset is: [104, 644] + + + + +.. GENERATED FROM PYTHON SOURCE LINES 151-157 + +2) Calculate the Fermi level from the DOS +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Now we integration the DOS, and then use cubic interpolation and brentq +to calculate the fermi level. Since only the 4 valence electrons in Silicon +are represented in this energy range, we take the point where the DOS integrates +to 4 as the fermi level. + +.. GENERATED FROM PYTHON SOURCE LINES 157-172 + +.. code-block:: Python + + + fermi_levels = [] + total_i_edos = torch.cumulative_trapezoid( + total_edos, x_dos, axis=1 + ) # Integrate the DOS along the energy axis + for i in total_i_edos: + interpolated = interp1d( + x_dos[:-1], i - 4, kind="cubic", copy=True, assume_sorted=True + ) # We use i-4 because Silicon has 4 electrons in this energy range + Ef = brentq( + interpolated, x_dos[0] + 0.1, x_dos[-1] - 0.1 + ) # Fermi Level is the point where the (integrated DOS - 4) = 0 + # 0.1 is added and subtracted to prevent brentq from going out of range + fermi_levels.append(Ef) + fermi_levels = torch.tensor(fermi_levels) + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 173-177 + +3) Build a set of eigenenergies, with the energy reference set to the fermi level +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Using the fermi levels, we are now able to change the energy reference +of the eigenenergies to the fermi level + +.. GENERATED FROM PYTHON SOURCE LINES 177-190 + +.. code-block:: Python + + + total_eigenenergies_Ef = [] + for index, energies in enumerate(total_eigenenergies): + total_eigenenergies_Ef.append(energies - fermi_levels[index]) + + all_eigenenergies_Ef = torch.hstack(total_eigenenergies_Ef) + + minE_Ef = torch.min(all_eigenenergies_Ef) + maxE_Ef = torch.max(all_eigenenergies_Ef) + print(f"The lowest eigenenergy using the fermi level energy reference is {minE_Ef:.3}") + print(f"The highest eigenenergy using the fermi level energy reference is {maxE_Ef:.3}") + + + + + + +.. rst-class:: sphx-glr-script-out + + .. code-block:: none + + The lowest eigenenergy using the fermi level energy reference is -13.8 + The highest eigenenergy using the fermi level energy reference is 14.9 + + + + +.. GENERATED FROM PYTHON SOURCE LINES 191-196 + +4) Truncate the DOS energy window so that the DOS is well-defined at each point +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +With the fermi levels, we can also truncate the energy window for DOS prediction. +In this example, we truncate the energy window such that it is 3eV above +the highest Fermi level in the dataset. + +.. GENERATED FROM PYTHON SOURCE LINES 196-202 + +.. code-block:: Python + + + # For the Average Hartree Potential energy reference + x_dos_H = torch.arange(minE - 1.5, max(fermi_levels) + 3, energy_interval) + + # For the Fermi Level Energy Reference, all the Fermi levels in the dataset is 0eV + x_dos_Ef = torch.arange(minE_Ef - 1.5, 3, energy_interval) + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 203-208 + +5) Construct the DOS in the truncated energy window under both references +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Here we construct 2 different targets where they differ in the energy reference +chosen. These targets will then be treated as different datasets for the model +to learn on. + +.. GENERATED FROM PYTHON SOURCE LINES 208-242 + +.. code-block:: Python + + + # For the Average Hartree Potential energy reference + + total_edos_H = [] + + for structure_eigenenergies_H in total_eigenenergies: + e_dos = torch.sum( + torch.exp( + -0.5 * ((x_dos_H - structure_eigenenergies_H.view(-1, 1)) / sigma) ** 2 + ), + dim=0, + ) + total_edos_H.append(e_dos) + + total_edos_H = torch.vstack(total_edos_H) + total_edos_H = (total_edos_H.T * normalization).T + + + # For the Fermi Level Energy Reference + + total_edos_Ef = [] + + for structure_eigenenergies_Ef in total_eigenenergies_Ef: + e_dos = torch.sum( + torch.exp( + -0.5 * ((x_dos_Ef - structure_eigenenergies_Ef.view(-1, 1)) / sigma) ** 2 + ), + dim=0, + ) + total_edos_Ef.append(e_dos) + + total_edos_Ef = torch.vstack(total_edos_Ef) + total_edos_Ef = (total_edos_Ef.T * normalization).T + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 243-249 + +6) Construct Splines for the DOS to facilitate interpolation during model training +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Building Cubic Hermite Splines on the DOS on the truncated energy window +to facilitate interpolation during training. Cubic Hermite Splines takes +in information on the value and derivative of a function at a point to build splines. +Thus, we will have to compute both the value and derivative at each spline position + +.. GENERATED FROM PYTHON SOURCE LINES 249-308 + +.. code-block:: Python + + + + # Functions to compute the value and derivative of the DOS at each energy value, x + def edos_value(x, eigenenergies, normalization): + e_dos_E = ( + torch.sum( + torch.exp(-0.5 * ((x - eigenenergies.view(-1, 1)) / sigma) ** 2), dim=0 + ) + * normalization + ) + + return e_dos_E + + + def edos_derivative(x, eigenenergies, normalization): + dfn_dos_E = ( + torch.sum( + torch.exp(-0.5 * ((x - eigenenergies.view(-1, 1)) / sigma) ** 2) + * (-1 * ((x - eigenenergies.view(-1, 1)) / sigma) ** 2), + dim=0, + ) + * normalization + ) + + return dfn_dos_E + + + total_splines_H = [] + # the splines have a higher energy range in case the shift is high + spline_positions_H = torch.arange(minE - 2, max(fermi_levels) + 6, energy_interval) + + for index, structure_eigenenergies_H in enumerate(total_eigenenergies): + e_dos_H = edos_value( + spline_positions_H, structure_eigenenergies_H, normalization[index] + ) + e_dos_H_grad = edos_derivative( + spline_positions_H, structure_eigenenergies_H, normalization[index] + ) + spliner = CubicHermiteSpline(spline_positions_H, e_dos_H, e_dos_H_grad) + total_splines_H.append(torch.tensor(spliner.c)) + + total_splines_H = torch.stack(total_splines_H) + + total_splines_Ef = [] + spline_positions_Ef = torch.arange(minE_Ef - 2, 6, energy_interval) + + for index, structure_eigenenergies_Ef in enumerate(total_eigenenergies_Ef): + e_dos_Ef = edos_value( + spline_positions_Ef, structure_eigenenergies_Ef, normalization[index] + ) + e_dos_Ef_grad = edos_derivative( + spline_positions_Ef, structure_eigenenergies_Ef, normalization[index] + ) + spliner = CubicHermiteSpline(spline_positions_Ef, e_dos_Ef, e_dos_Ef_grad) + total_splines_Ef.append(torch.tensor(spliner.c)) + + total_splines_Ef = torch.stack(total_splines_Ef) + + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 309-312 + +We have stored the splines coefficients (spliner.c) as torch tensors, +as such as we will need to write a function to evaluate the DOS from +the splines positions and coefficients. + +.. GENERATED FROM PYTHON SOURCE LINES 312-345 + +.. code-block:: Python + + + + def evaluate_spline(spline_coefs, spline_positions, x): + """ + spline_coefs: shape of (n x 4 x spline_positions) + + return value: shape of (n x x) + + x : shape of (n x n_points) + """ + interval = torch.round( + spline_positions[1] - spline_positions[0], decimals=4 + ) # get spline grid intervals + x = torch.clamp( + x, min=spline_positions[0], max=spline_positions[-1] - 0.0005 + ) # restrict x to fall within the spline interval + # 0.0005 is substracted to combat errors arising from precision + indexes = torch.floor( + (x - spline_positions[0]) / interval + ).long() # Obtain the index for the appropriate spline coefficients + expanded_index = indexes.unsqueeze(dim=1).expand(-1, 4, -1) + x_1 = x - spline_positions[indexes] + x_2 = x_1 * x_1 + x_3 = x_2 * x_1 + x_0 = torch.ones_like(x_1) + x_powers = torch.stack([x_3, x_2, x_1, x_0]).permute(1, 0, 2) + value = torch.sum( + torch.mul(x_powers, torch.gather(spline_coefs, 2, expanded_index)), axis=1 + ) + + return value # returns the value of the DOS at the energy positions, x. + + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 346-348 + +Lets look at the accuracy of the splines. +Test 1: Ability to reproduce the correct values at the default x_dos positions + +.. GENERATED FROM PYTHON SOURCE LINES 348-359 + +.. code-block:: Python + + + shifts = torch.zeros(n_structures) + x_dos_splines = x_dos_H + shifts.view(-1, 1) + spline_dos_H = evaluate_spline(total_splines_H, spline_positions_H, x_dos_splines) + + plt.plot(x_dos_H, total_edos_H[0], color="red", label="True DOS") + plt.plot(x_dos_H, spline_dos_H[0], color="blue", linestyle="--", label="Spline DOS") + plt.legend() + plt.xlabel("Energy [eV]") + plt.ylabel("DOS") + print("Both lines lie on each other") + + + +.. image-sg:: /examples/dos-align/images/sphx_glr_dos-align_001.png + :alt: dos align + :srcset: /examples/dos-align/images/sphx_glr_dos-align_001.png + :class: sphx-glr-single-img + + +.. rst-class:: sphx-glr-script-out + + .. code-block:: none + + Both lines lie on each other + + + + +.. GENERATED FROM PYTHON SOURCE LINES 360-361 + +Test 2: Ability to reproduce the correct values at the shifted x_dos positions + +.. GENERATED FROM PYTHON SOURCE LINES 361-372 + +.. code-block:: Python + + + shifts = torch.zeros(n_structures) + 0.3 + x_dos_splines = x_dos_Ef + shifts.view(-1, 1) + spline_dos_Ef = evaluate_spline(total_splines_Ef, spline_positions_Ef, x_dos_splines) + + plt.plot(x_dos_Ef, total_edos_Ef[0], color="red", label="True DOS") + plt.plot(x_dos_Ef, spline_dos_Ef[0], color="blue", linestyle="--", label="Spline DOS") + plt.legend() + plt.xlabel("Energy [eV]") + plt.ylabel("DOS") + print("Both spectras look very similar") + + + +.. image-sg:: /examples/dos-align/images/sphx_glr_dos-align_002.png + :alt: dos align + :srcset: /examples/dos-align/images/sphx_glr_dos-align_002.png + :class: sphx-glr-single-img + + +.. rst-class:: sphx-glr-script-out + + .. code-block:: none + + Both spectras look very similar + + + + +.. GENERATED FROM PYTHON SOURCE LINES 373-378 + +Step 2: Compute SOAP power spectrum for the dataset +------------------------------------------------------------------------------------------ + +We first define the hyperparameters to compute the +SOAP power spectrum using rascaline. + +.. GENERATED FROM PYTHON SOURCE LINES 379-399 + +.. code-block:: Python + + + HYPER_PARAMETERS = { + "cutoff": 4.0, + "max_radial": 8, + "max_angular": 6, + "atomic_gaussian_width": 0.45, + "center_atom_weight": 1.0, + "radial_basis": {"Gto": {}}, + "cutoff_function": { + "Step": {}, + }, + "radial_scaling": { + "Willatt2018": { + "exponent": 5, + "rate": 1, + "scale": 3.0, + }, + }, + } + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 400-401 + +We feed the Hyperparameters into rascaline to compute the SOAP Power spectrum + +.. GENERATED FROM PYTHON SOURCE LINES 402-417 + +.. code-block:: Python + + + + calculator = SoapPowerSpectrum(**HYPER_PARAMETERS) + R_total_soap = calculator.compute(structures) + # Transform the tensormap to a single block containing a dense representation + R_total_soap.keys_to_samples("species_center") + R_total_soap.keys_to_properties(["species_neighbor_1", "species_neighbor_2"]) + + # Now we extract the data tensor from the single block + total_atom_soap = [] + for structure_i in range(n_structures): + a_i = R_total_soap.block(0).samples["structure"] == structure_i + total_atom_soap.append(torch.tensor(R_total_soap.block(0).values[a_i, :])) + + total_soap = torch.stack(total_atom_soap) + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 418-428 + +Step 3: Building a Simple MLP Model +--------------------------------------------------------------------- + +1) Split the data into Training, Validation and Test +2) Define the dataloader and the Model Architecture +3) Define relevant loss functions for training and inference +4) Define the training loop +5) Evaluate the model + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +.. GENERATED FROM PYTHON SOURCE LINES 431-434 + +1) Split the data into Training, Validation and Test +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +We will first split the data in a 7:1:2 manner, corresponding to train, val and test. + +.. GENERATED FROM PYTHON SOURCE LINES 434-443 + +.. code-block:: Python + + np.random.seed(0) + train_index = np.arange(n_structures) + np.random.shuffle(train_index) + test_mark = int(0.8 * n_structures) + val_mark = int(0.7 * n_structures) + test_index = train_index[test_mark:] + val_index = train_index[val_mark:test_mark] + train_index = train_index[:val_mark] + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 444-447 + +2) Define the dataloader and the Model Architecture +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +We will now build a dataloader and dataset to facillitate training the model batchwise + +.. GENERATED FROM PYTHON SOURCE LINES 447-523 + +.. code-block:: Python + + + + def generate_atomstructure_index(n_atoms_per_structure): + """Generate a sequence of indices for each atom in the structure. + The indices correspond to index of the structure that the atom belongs to + + Args: + n_atoms_per_structure ([array]): + [Array containing the number of atoms each structure contains] + + Return s: + [tensor]: [Total index, matching atoms to structure] + """ + # n_structures = len(n_atoms_per_structure) + total_index = [] + for i, atoms in enumerate(n_atoms_per_structure): + indiv_index = torch.zeros(atoms) + i + total_index.append(indiv_index) + total_index = torch.hstack(total_index) + return total_index.long() + + + class AtomicDataset(Dataset): + def __init__(self, features, n_atoms_per_structure): + self.features = features + self.n_structures = len(n_atoms_per_structure) + self.n_atoms_per_structure = n_atoms_per_structure + self.index = generate_atomstructure_index(self.n_atoms_per_structure) + assert torch.sum(n_atoms_per_structure) == len(features) + + def __len__(self): + return self.n_structures + + def __getitem__(self, idx): + if isinstance(idx, list): # If a list of indexes is given + feature_indexes = [] + + for i in idx: + feature_indexes.append((self.index == i).nonzero(as_tuple=True)[0]) + + feature_indexes = torch.hstack(feature_indexes) + + return ( + self.features[feature_indexes], + idx, + generate_atomstructure_index(self.n_atoms_per_structure[idx]), + ) + + else: + feature_indexes = (self.index == idx).nonzero(as_tuple=True)[0] + return ( + self.features[feature_indexes], + idx, + self.n_atoms_per_structure[idx], + ) + + + def collate( + batch, + ): # Defines how to collate the outputs of the __getitem__ function at each batch + for x, idx, index in batch: + return (x, idx, index) + + + x_train = torch.flatten(total_soap[train_index], 0, 1).float() + total_atomic_soaps = torch.vstack(total_atom_soap).float() + train_features = AtomicDataset(x_train, n_atoms[train_index]) + full_atomstructure_index = generate_atomstructure_index(n_atoms) + # Will be required later to collate atomic predictions into structural predictions + + # Build a Dataloader that samples from the AtomicDataset in random batches + Sampler = RandomSampler(train_features) + BSampler = BatchSampler(Sampler, batch_size=32, drop_last=False) + traindata_loader = DataLoader(train_features, sampler=BSampler, collate_fn=collate) + + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 524-529 + +We will now define a simple three layer MLP model, consisting of three layers. +The align keyword is used to indicate that the energy reference will be optimized +during training. The alignment parameter refers to the adjustments made to the +initial energy referenced and will be initialized as zeros. + + +.. GENERATED FROM PYTHON SOURCE LINES 530-551 + +.. code-block:: Python + + + + class SOAP_NN(torch.nn.Module): + def __init__(self, input_dims, L1, n_train, target_dims, align): + super(SOAP_NN, self).__init__() + self.target_dims = target_dims + self.fc1 = torch.nn.Linear(input_dims, L1) + self.fc2 = torch.nn.Linear(L1, target_dims) + self.silu = torch.nn.SiLU() + self.align = align + if align: + initial_alignment = torch.zeros(n_train) + self.alignment = torch.nn.parameter.Parameter(initial_alignment) + + def forward(self, x): + result = self.fc1(x) + result = self.silu(result) + result = self.fc2(result) + return result + + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 552-560 + +We will use a small network architecture, whereby the input layer corresponds +to the size of the SOAP features, 448, the intermediate layer corresponds to +a tenth size of the input layer and the final layer corresponds +to the number of outputs. + +As a shorthand, the model that optimizes the energy reference during +training will be called the alignment model + + +.. GENERATED FROM PYTHON SOURCE LINES 560-588 + +.. code-block:: Python + + + n_outputs_H = len(x_dos_H) + n_outputs_Ef = len(x_dos_Ef) + + + Model_H = SOAP_NN( + x_train.shape[1], + x_train.shape[1] // 10, + len(train_index), + n_outputs_H, + align=False, + ) + Model_Ef = SOAP_NN( + x_train.shape[1], + x_train.shape[1] // 10, + len(train_index), + n_outputs_Ef, + align=False, + ) + Model_Align = SOAP_NN( + x_train.shape[1], + x_train.shape[1] // 10, + len(train_index), + n_outputs_Ef, + align=True, + ) + # The alignment model takes the fermi level energy reference as the starting point + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 589-593 + +3) Define relevant loss functions for training and inference +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +We will now define some loss functions that will be useful when we implement +the model training loop later and during model evaluation on the test set. + +.. GENERATED FROM PYTHON SOURCE LINES 593-708 + +.. code-block:: Python + + + + def t_get_mse(a, b, xdos): + """Compute mean error between two Density of States. + The mean error is integrated across the entire energy grid + to provide a single value to characterize the error + + Args: + a ([tensor]): [Predicted DOS] + b ([tensor]): [True DOS] + xdos ([tensor], optional): [Energy axis of DOS] + + Returns: + [float]: [MSE] + """ + if len(a.size()) > 1: + mse = (torch.trapezoid((a - b) ** 2, xdos, axis=1)).mean() + else: + mse = (torch.trapezoid((a - b) ** 2, xdos, axis=0)).mean() + return mse + + + def t_get_rmse(a, b, xdos): + """Compute root mean squared error between two Density of States . + + Args: + a ([tensor]): [Predicted DOS] + b ([tensor]): [True DOS] + xdos ([tensor], optional): [Energy axis of DOS] + + Raises: + ValueError: [Occurs if tensor shapes are mismatched] + + Returns: + [float]: [RMSE or %RMSE] + """ + + if len(a.size()) > 1: + rmse = torch.sqrt((torch.trapezoid((a - b) ** 2, xdos, axis=1)).mean()) + else: + rmse = torch.sqrt((torch.trapezoid((a - b) ** 2, xdos, axis=0)).mean()) + return rmse + + + def Opt_RMSE_spline(y_pred, xdos, target_splines, spline_positions, n_epochs): + """Evaluates RMSE on the optimal shift of energy axis. + The optimal shift is found via gradient descent after a gridsearch is performed. + + Args: + y_pred ([tensor]): [Prediction/s of DOS] + xdos ([tensor]): [Energy axis] + target_splines ([tensor]): [Contains spline coefficients] + spline_positions ([tensor]): [Contains spline positions] + n_epochs ([int]): [Number of epochs to run for Gradient Descent] + + Returns: + [rmse([float]), optimal_shift[tensor]]: + [RMSE on optimal shift, the optimal shift itself] + + """ + optim_search_mse = [] + offsets = torch.arange(-2, 2, 0.1) + # Grid-search is first done to reduce number of epochs needed for + # gradient descent, typically 50 epochs will be sufficient + # if searching within 0.1 + with torch.no_grad(): + for offset in offsets: + shifts = torch.zeros(y_pred.shape[0]) + offset + shifted_target = evaluate_spline( + target_splines, spline_positions, xdos + shifts.view(-1, 1) + ) + loss_i = ((y_pred - shifted_target) ** 2).mean(dim=1) + optim_search_mse.append(loss_i) + optim_search_mse = torch.vstack(optim_search_mse) + min_index = torch.argmin(optim_search_mse, dim=0) + optimal_offset = offsets[min_index] + + offset = optimal_offset + + shifts = torch.nn.parameter.Parameter(offset.float()) + opt_adam = torch.optim.Adam([shifts], lr=1e-2) + best_error = torch.zeros(len(shifts)) + 100 + best_shifts = shifts.clone() + for _ in range(n_epochs): + shifted_target = evaluate_spline( + target_splines, spline_positions, xdos + shifts.view(-1, 1) + ).detach() + + def closure(): + opt_adam.zero_grad() + shifted_target = evaluate_spline( + target_splines, spline_positions, xdos + shifts.view(-1, 1) + ) + loss_i = ((y_pred - shifted_target) ** 2).mean() + loss_i.backward(gradient=torch.tensor(1), inputs=shifts) + return loss_i + + opt_adam.step(closure) + + with torch.no_grad(): + each_loss = ((y_pred - shifted_target) ** 2).mean(dim=1).float() + index = each_loss < best_error + best_error[index] = each_loss[index].clone() + best_shifts[index] = shifts[index].clone() + + # Evaluate + + optimal_shift = best_shifts + shifted_target = evaluate_spline( + target_splines, spline_positions, xdos + optimal_shift.view(-1, 1) + ) + rmse = t_get_rmse(y_pred, shifted_target, xdos) + return rmse, optimal_shift + + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 709-715 + +4) Define the training loop +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +We will now define the model training loop, for simplicity we will only +train each model for a fixed number of epochs, learning rate, and batch_size. +The training and validation error at each epoch will be saved. + +.. GENERATED FROM PYTHON SOURCE LINES 716-821 + +.. code-block:: Python + + + + def train_model(model_to_train, fixed_DOS, structure_splines, spline_positions, x_dos): + """Trains a model for 500 epochs + + Args: + model_to_train ([torch.nn.Module]): [ML Model] + fixed_DOS ([tensor]): [Contains the DOS at a fixed energy reference, + useful for models that don't optimize the energy reference] + structure_splines ([tensor]): [Contains spline coefficients] + spline_positions ([tensor]): [Contains spline positions] + x_dos ([tensor]): [Energy axis for the prediction] + + Returns: + [train_loss_history([tensor]), + val_loss_history[tensor], + structure_results[tensor]]: + + [Respective loss histories and final structure predictions] + """ + lr = 1e-2 + n_epochs = 500 + + opt = torch.optim.Adam(model_to_train.parameters(), lr=lr) + + train_loss_history = [] + val_loss_history = [] + + for _epoch in range(n_epochs): + for x_data, idx, index in traindata_loader: + opt.zero_grad() + predictions = model_to_train.forward(x_data) + structure_results = torch.zeros([len(idx), model_to_train.target_dims]) + # Sum atomic predictions in each structure + structure_results = structure_results.index_add_( + 0, index, predictions + ) / n_atoms[train_index[idx]].view(-1, 1) + if model_to_train.align: + alignment = model_to_train.alignment + alignment = alignment - torch.mean(alignment) + # Enforce that the alignments have a mean of zero since a constant + # value across the dataset is meaningless when optimizing the + # relative energy reference + target = evaluate_spline( + structure_splines[train_index[idx]], + spline_positions, + x_dos + alignment[idx].view(-1, 1), + ) # Shifts the target based on the alignment value + pred_loss = t_get_mse(structure_results, target, x_dos) + pred_loss.backward() + else: + pred_loss = t_get_mse( + structure_results, fixed_DOS[train_index[idx]], x_dos + ) + pred_loss.backward() + + opt.step() + with torch.no_grad(): + all_pred = model_to_train.forward(total_atomic_soaps.float()) + structure_results = torch.zeros([n_structures, model_to_train.target_dims]) + structure_results = structure_results.index_add_( + 0, full_atomstructure_index, all_pred + ) / (n_atoms).view(-1, 1) + if model_to_train.align: + # Evaluate model on optimal shift as there is no information + # regarding the shift from the fermi level energy reference + # during inference + + alignment = model_to_train.alignment + alignment = alignment - torch.mean(alignment) + target = evaluate_spline( + structure_splines[train_index], + spline_positions, + x_dos + alignment.view(-1, 1), + ) + + train_loss = t_get_rmse(structure_results[train_index], target, x_dos) + val_loss, val_shifts = Opt_RMSE_spline( + structure_results[val_index], + x_dos, + structure_splines[val_index], + spline_positions, + 50, + ) + + else: + train_loss = t_get_rmse( + structure_results[train_index], fixed_DOS[train_index], x_dos + ) + val_loss = t_get_rmse( + structure_results[val_index], fixed_DOS[val_index], x_dos + ) + + train_loss_history.append(train_loss) + val_loss_history.append(val_loss) + train_loss_history = torch.tensor(train_loss_history) + val_loss_history = torch.tensor(val_loss_history) + return ( + train_loss_history, + val_loss_history, + structure_results, + ) + # returns the loss history and the final set of predictions + + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 822-834 + +.. code-block:: Python + + + H_trainloss, H_valloss, H_predictions = train_model( + Model_H, total_edos_H, total_splines_H, spline_positions_H, x_dos_H + ) + + Ef_trainloss, Ef_valloss, Ef_predictions = train_model( + Model_Ef, total_edos_Ef, total_splines_Ef, spline_positions_Ef, x_dos_Ef + ) + + Align_trainloss, Align_valloss, Align_predictions = train_model( + Model_Align, total_edos_Ef, total_splines_Ef, spline_positions_Ef, x_dos_Ef + ) + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 835-837 + +Lets plot the train loss histories to compare their learning behaviour + + +.. GENERATED FROM PYTHON SOURCE LINES 837-850 + +.. code-block:: Python + + + epochs = np.arange(500) + + + plt.plot(epochs, H_trainloss, color="red", label="Avg Hartree Potential") + plt.plot(epochs, Ef_trainloss, color="blue", label="Fermi Level") + plt.plot(epochs, Align_trainloss, color="green", label="Optimized Reference") + plt.legend() + plt.yscale(value="log") + plt.xlabel("Epochs") + plt.ylabel("RMSE") + plt.title("Train Loss vs Epoch") + plt.show() + + + +.. image-sg:: /examples/dos-align/images/sphx_glr_dos-align_003.png + :alt: Train Loss vs Epoch + :srcset: /examples/dos-align/images/sphx_glr_dos-align_003.png + :class: sphx-glr-single-img + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 851-853 + +Lets plot the val loss histories to compare their learning behaviour + + +.. GENERATED FROM PYTHON SOURCE LINES 853-866 + +.. code-block:: Python + + + + plt.plot(epochs, H_valloss, color="red", label="Avg Hartree Potential") + plt.plot(epochs, Ef_valloss, color="blue", label="Fermi Level") + plt.plot(epochs, Align_valloss, color="green", label="Optimized Reference") + plt.legend() + plt.yscale(value="log") + plt.xlabel("Epochs") + plt.ylabel("RMSE") + plt.title("Validation Loss vs Epoch") + plt.show() + + + + + +.. image-sg:: /examples/dos-align/images/sphx_glr_dos-align_004.png + :alt: Validation Loss vs Epoch + :srcset: /examples/dos-align/images/sphx_glr_dos-align_004.png + :class: sphx-glr-single-img + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 867-872 + +5) Evaluate the model +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +We will now evaluate the model performance on the test set +based on the model predictions we obtained previously + + +.. GENERATED FROM PYTHON SOURCE LINES 873-904 + +.. code-block:: Python + + + H_testloss = Opt_RMSE_spline( + H_predictions[test_index], + x_dos_H, + total_splines_H[test_index], + spline_positions_H, + 200, + ) # We use 200 epochs just so it the error a little bit more converged + Ef_testloss = Opt_RMSE_spline( + Ef_predictions[test_index], + x_dos_Ef, + total_splines_Ef[test_index], + spline_positions_Ef, + 200, + ) # We use 200 epochs just so it the error a little bit more converged + Align_testloss = Opt_RMSE_spline( + Align_predictions[test_index], + x_dos_Ef, + total_splines_Ef[test_index], + spline_positions_Ef, + 200, + ) # We use 200 epochs just so it the error a little bit more converged + + print(f"Test RMSE for average Hartree Potential: {H_testloss[0].item():.3}") + print(f"Test RMSE for Fermi Level: {Ef_testloss[0].item():.3}") + print(f"Test RMSE for Optimized Reference: {Align_testloss[0].item():.3}") + + print( + "The difference in effectiveness between the Optimized Reference \ + and the Fermi Level will increase with more epochs" + ) + + + + +.. rst-class:: sphx-glr-script-out + + .. code-block:: none + + Test RMSE for average Hartree Potential: 0.0558 + Test RMSE for Fermi Level: 0.0398 + Test RMSE for Optimized Reference: 0.0378 + The difference in effectiveness between the Optimized Reference and the Fermi Level will increase with more epochs + + + + +.. GENERATED FROM PYTHON SOURCE LINES 905-914 + +Plot Training DOSes at different energy reference to visualize +the impact of the energy reference. From the plots we can see +that the optimized energy reference has better alignment of +common spectral patterns across the dataset + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Average Hartree Energy Reference + + +.. GENERATED FROM PYTHON SOURCE LINES 915-924 + +.. code-block:: Python + + + for i in total_edos_H[train_index]: + plt.plot(x_dos_H, i, color="C0", alpha=0.6) + plt.title("Energy Reference - Average Hartree Potential") + plt.xlabel("Energy [eV]") + plt.ylabel("DOS") + plt.show() + print("The DOSes, despite looking similar, are offset along the energy axis") + + + + +.. image-sg:: /examples/dos-align/images/sphx_glr_dos-align_005.png + :alt: Energy Reference - Average Hartree Potential + :srcset: /examples/dos-align/images/sphx_glr_dos-align_005.png + :class: sphx-glr-single-img + + +.. rst-class:: sphx-glr-script-out + + .. code-block:: none + + The DOSes, despite looking similar, are offset along the energy axis + + + + +.. GENERATED FROM PYTHON SOURCE LINES 925-926 + +Fermi Level Energy Reference + +.. GENERATED FROM PYTHON SOURCE LINES 926-934 + +.. code-block:: Python + + for i in total_edos_Ef[train_index]: + plt.plot(x_dos_Ef, i, color="C0", alpha=0.6) + plt.title("Energy Reference - Fermi Level") + plt.xlabel("Energy [eV]") + plt.ylabel("DOS") + plt.show() + + print("It is better aligned but still quite some offset") + + + +.. image-sg:: /examples/dos-align/images/sphx_glr_dos-align_006.png + :alt: Energy Reference - Fermi Level + :srcset: /examples/dos-align/images/sphx_glr_dos-align_006.png + :class: sphx-glr-single-img + + +.. rst-class:: sphx-glr-script-out + + .. code-block:: none + + It is better aligned but still quite some offset + + + + +.. GENERATED FROM PYTHON SOURCE LINES 935-936 + +Optimized Energy Reference + +.. GENERATED FROM PYTHON SOURCE LINES 936-951 + +.. code-block:: Python + + shifts = Model_Align.alignment.detach() + shifts = shifts - torch.mean(shifts) + x_dos_splines = x_dos_Ef + shifts.view(-1, 1) + total_edos_align = evaluate_spline( + total_splines_Ef[train_index], spline_positions_Ef, x_dos_splines + ) + + for i in total_edos_align: + plt.plot(x_dos_Ef, i, color="C0", alpha=0.6) + plt.title("Energy Reference - Optimized") + plt.xlabel("Energy [eV]") + plt.ylabel("DOS") + plt.show() + print("The DOS alignment is better under the optimized energy reference") + print("The difference will increase with more training epochs") + + + +.. image-sg:: /examples/dos-align/images/sphx_glr_dos-align_007.png + :alt: Energy Reference - Optimized + :srcset: /examples/dos-align/images/sphx_glr_dos-align_007.png + :class: sphx-glr-single-img + + +.. rst-class:: sphx-glr-script-out + + .. code-block:: none + + The DOS alignment is better under the optimized energy reference + The difference will increase with more training epochs + + + + + +.. rst-class:: sphx-glr-timing + + **Total running time of the script:** (1 minutes 47.626 seconds) + + +.. _sphx_glr_download_examples_dos-align_dos-align.py: + +.. only:: html + + .. container:: sphx-glr-footer sphx-glr-footer-example + + + .. container:: sphx-glr-download + + :download:`Download Conda environment file: environment.yml ` + .. container:: sphx-glr-download sphx-glr-download-jupyter + + :download:`Download Jupyter notebook: dos-align.ipynb ` + + .. container:: sphx-glr-download sphx-glr-download-python + + :download:`Download Python source code: dos-align.py ` + + .. container:: sphx-glr-download sphx-glr-download-zip + + :download:`Download zipped: dos-align.zip ` + + +.. only:: html + + .. rst-class:: sphx-glr-signature + + `Gallery generated by Sphinx-Gallery `_ + diff --git a/_sources/examples/gaas-map/gaas-map.rst.txt b/_sources/examples/gaas-map/gaas-map.rst.txt new file mode 100644 index 00000000..f36ec5ca --- /dev/null +++ b/_sources/examples/gaas-map/gaas-map.rst.txt @@ -0,0 +1,453 @@ + +.. DO NOT EDIT. +.. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. +.. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: +.. "examples/gaas-map/gaas-map.py" +.. LINE NUMBERS ARE GIVEN BELOW. + +.. only:: html + + .. note:: + :class: sphx-glr-download-link-note + + :ref:`Go to the end ` + to download the full example code. + +.. rst-class:: sphx-glr-example-title + +.. _sphx_glr_examples_gaas-map_gaas-map.py: + + +PCA/PCovR Visualization of a training dataset for a potential +============================================================= + +:Authors: Michele Ceriotti `@ceriottm `_, + Giulio Imbalzano + +This example uses ``rascaline`` and ``metatensor`` to compute +structural properties for the structures in a training dataset +for a ML potential. +These are then used with simple dimensionality reduction algorithms +(implemented in ``sklearn`` and ``skmatter``) to obtain a simplified +description of the dataset, that is then visualized using +``chemiscope``. + +This example uses the dataset from +`Imbalzano (2021) `_ +and the principal covariate regression scheme as implemented in +`Helfrecht (2020) `_. + +.. GENERATED FROM PYTHON SOURCE LINES 21-40 + +.. code-block:: Python + + + import os + + import ase + import ase.io + import chemiscope + import numpy as np + import requests + from matplotlib import pyplot as plt + from metatensor import mean_over_samples + from rascaline import AtomicComposition, SoapPowerSpectrum + from sklearn.decomposition import PCA + from sklearn.linear_model import RidgeCV + from skmatter.decomposition import PCovR + from skmatter.preprocessing import StandardFlexibleScaler + + + # sphinx_gallery_thumbnail_number = 2 + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 41-47 + +First, we load the structures, extracting some of the properties for +more convenient manipulation. These are +:math:`\mathrm{Ga}_x\mathrm{As}_{1-x}` structures used in `Imbalzano & +Ceriotti (2021) `__ to +train a ML potential to describe the full composition range. + + +.. GENERATED FROM PYTHON SOURCE LINES 47-61 + +.. code-block:: Python + + + filename = "gaas_training.xyz" + if not os.path.exists(filename): + url = f"https://zenodo.org/records/10566825/files/{filename}" + response = requests.get(url) + response.raise_for_status() + with open(filename, "wb") as f: + f.write(response.content) + + structures = ase.io.read(filename, ":") + energy = np.array([f.info["energy"] for f in structures]) + natoms = np.array([len(f) for f in structures]) + + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 62-75 + +Remove atomic energy baseline +----------------------------- + +Energies from an electronic structure calculation contain a very large +“self” contributions from the atoms, which can obscure the important +differences in cohesive energies between structures. We can build an +approximate model based on the chemical nature of the atoms, :math:`a_i` + +.. math:: E(A) = \sum_{i\in A} e_{a_i} + +where :math:`e_a` are atomic energies that can be determined by linear +regression. + + +.. GENERATED FROM PYTHON SOURCE LINES 75-98 + +.. code-block:: Python + + + # rascaline has an `AtomicComposition` calculator that streamlines + # this (simple) calculation + calculator = AtomicComposition(**{"per_structure": True}) + rho0 = calculator.compute(structures) + + # the descriptors are returned as a `TensorMap` object, that contains + # the composition data in a sparse storage format + rho0 + + # for easier manipulation, we extract the features as a dense vector + # of composition weights + comp_feats = rho0.keys_to_properties(["species_center"]).block(0).values + + # a one-liner to fit a linear model and compute "dressed energies" + atom_energy = ( + RidgeCV(alphas=np.geomspace(1e-8, 1e2, 20)) + .fit(comp_feats, energy) + .predict(comp_feats) + ) + cohesive_peratom = (energy - atom_energy) / natoms + + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 99-102 + +The baseline makes up a large fraction of the total energy, but actually +the residual (which is the part that matters) is still large. + + +.. GENERATED FROM PYTHON SOURCE LINES 102-111 + +.. code-block:: Python + + + fig, ax = plt.subplots(1, 1, figsize=(6, 4)) + ax.plot(energy / natoms, atom_energy / natoms, "b.") + ax.set_xlabel("Energy / (eV/atom)") + ax.set_ylabel("Atomic e. / (eV/atom)") + plt.show() + print(f"RMSE / (eV/atom): {np.sqrt(np.mean((cohesive_peratom)**2))}") + + + + + +.. image-sg:: /examples/gaas-map/images/sphx_glr_gaas-map_001.png + :alt: gaas map + :srcset: /examples/gaas-map/images/sphx_glr_gaas-map_001.png + :class: sphx-glr-single-img + + +.. rst-class:: sphx-glr-script-out + + .. code-block:: none + + RMSE / (eV/atom): 0.25095652580859984 + + + + +.. GENERATED FROM PYTHON SOURCE LINES 112-119 + +Compute structural descriptors +------------------------------ + +In order to visualize the structures as a low-dimensional map, we start +by computing suitable ML descriptors. Here we have used ``rascaline`` to +evaluate average SOAP features for the structures. + + +.. GENERATED FROM PYTHON SOURCE LINES 119-146 + +.. code-block:: Python + + + # hypers for evaluating rascaline features + hypers = { + "cutoff": 4.5, + "max_radial": 6, + "max_angular": 4, + "atomic_gaussian_width": 0.3, + "cutoff_function": {"ShiftedCosine": {"width": 0.5}}, + "radial_basis": {"Gto": {"accuracy": 1e-6}}, + "center_atom_weight": 1.0, + } + calculator = SoapPowerSpectrum(**hypers) + rho2i = calculator.compute(structures) + + # neighbor types go to the keys for sparsity (this way one can + # compute a heterogeneous dataset without having blocks of zeros) + rho2i = rho2i.keys_to_samples(["species_center"]).keys_to_properties( + ["species_neighbor_1", "species_neighbor_2"] + ) + + # computes structure-level descriptors and then extracts + # the features as a dense array + rho2i_structure = mean_over_samples(rho2i, sample_names=["center", "species_center"]) + rho2i = None # releases memory + features = rho2i_structure.block(0).values + + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 147-150 + +We standardize (per atom) energy and features (computed as a *mean* over +atomic environments) so that they can be combined on the same footings. + + +.. GENERATED FROM PYTHON SOURCE LINES 150-155 + +.. code-block:: Python + + + sf_energy = StandardFlexibleScaler().fit_transform(cohesive_peratom.reshape(-1, 1)) + sf_feats = StandardFlexibleScaler().fit_transform(features) + + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 156-168 + +PCA and PCovR projection +------------------------ + +Computes PCA projection to generate low-dimensional descriptors that +reflect structural diversity. Any other dimensionality reduction scheme +could be used in a similar fashion. + +We also compute the principal covariate regression (PCovR) descriptors, +that reduce dimensionality while combining a variance preserving +criterion with the requirement that the low-dimensional features are +capable of estimating a target quantity (here, the energy). + + +.. GENERATED FROM PYTHON SOURCE LINES 168-194 + +.. code-block:: Python + + + # PCA + pca = PCA(n_components=4) + pca_features = pca.fit_transform(sf_feats) + + fig, ax = plt.subplots(1, 1, figsize=(6, 4)) + scatter = ax.scatter(pca_features[:, 0], pca_features[:, 1], c=cohesive_peratom) + ax.set_xlabel("PCA[1]") + ax.set_ylabel("PCA[2]") + cbar = fig.colorbar(scatter, ax=ax) + cbar.set_label("energy / eV/at.") + plt.show() + + # computes PCovR map + pcovr = PCovR(n_components=4) + pcovr_features = pcovr.fit_transform(sf_feats, sf_energy) + + fig, ax = plt.subplots(1, 1, figsize=(6, 4)) + scatter = ax.scatter(pcovr_features[:, 0], pcovr_features[:, 1], c=cohesive_peratom) + ax.set_xlabel("PCovR[1]") + ax.set_ylabel("PCovR[2]") + cbar = fig.colorbar(scatter, ax=ax) + cbar.set_label("energy / (eV/at.)") + plt.show() + + + + + +.. rst-class:: sphx-glr-horizontal + + + * + + .. image-sg:: /examples/gaas-map/images/sphx_glr_gaas-map_002.png + :alt: gaas map + :srcset: /examples/gaas-map/images/sphx_glr_gaas-map_002.png + :class: sphx-glr-multi-img + + * + + .. image-sg:: /examples/gaas-map/images/sphx_glr_gaas-map_003.png + :alt: gaas map + :srcset: /examples/gaas-map/images/sphx_glr_gaas-map_003.png + :class: sphx-glr-multi-img + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 195-202 + +Chemiscope visualization +------------------------ + +Visualizes the structure-property map using a chemiscope widget (and +generates a .json file that can be viewed on +`chemiscope.org `__). + + +.. GENERATED FROM PYTHON SOURCE LINES 202-262 + +.. code-block:: Python + + + # extracts force data (adding considerably to the dataset size...) + force_vectors = chemiscope.ase_vectors_to_arrows(structures, scale=1) + force_vectors["parameters"]["global"]["color"] = 0x505050 + + # adds properties to the ASE frames + for i, f in enumerate(structures): + for j in range(len(pca_features[i])): + f.info["pca_" + str(j + 1)] = pca_features[i, j] + for i, f in enumerate(structures): + for j in range(len(pcovr_features[i])): + f.info["pcovr_" + str(j + 1)] = pcovr_features[i, j] + for i, f in enumerate(structures): + f.info["cohesive_energy"] = cohesive_peratom[i] + f.info["x_ga"] = comp_feats[i, 0] / comp_feats[i].sum() + + # it would also be easy to add the properties manually, this is just a dictionary + structure_properties = chemiscope.extract_properties(structures) + + cs = chemiscope.show( + frames=structures, + properties=structure_properties, + shapes={"forces": force_vectors}, + # the settings are a tad verbose, but give full control over the visualization + settings={ + "map": { + "x": {"property": "pcovr_1"}, + "y": {"property": "pcovr_2"}, + "color": {"property": "x_ga"}, + }, + "structure": [ + { + "bonds": True, + "unitCell": True, + "shape": ["forces"], + "keepOrientation": False, + } + ], + }, + meta={ + "name": "GaAs training data", + "description": """ + A collection of Ga(x)As(1-x) structures to train a MLIP, + including force and energy data. + """, + "authors": ["Giulio Imbalzano", "Michele Ceriotti"], + "references": [ + """ + G. Imbalzano and M. Ceriotti, 'Modeling the Ga/As binary system across + temperatures and compositions from first principles,' + Phys. Rev. Materials 5(6), 063804 (2021). + """, + "Original dataset: https://archive.materialscloud.org/record/2021.226", + ], + }, + ) + + cs.save("gaas_map.chemiscope.json.gz") + + cs # display if in a notebook + + +.. chemiscope:: _datasets/fig_gaas-map_001.json.gz + :mode: default + + + +.. raw:: html + +
+ +
+
+
+ + +.. rst-class:: sphx-glr-timing + + **Total running time of the script:** (1 minutes 2.675 seconds) + + +.. _sphx_glr_download_examples_gaas-map_gaas-map.py: + +.. only:: html + + .. container:: sphx-glr-footer sphx-glr-footer-example + + + .. container:: sphx-glr-download + + :download:`Download Conda environment file: environment.yml ` + .. container:: sphx-glr-download sphx-glr-download-jupyter + + :download:`Download Jupyter notebook: gaas-map.ipynb ` + + .. container:: sphx-glr-download sphx-glr-download-python + + :download:`Download Python source code: gaas-map.py ` + + .. container:: sphx-glr-download sphx-glr-download-zip + + :download:`Download zipped: gaas-map.zip ` + + +.. only:: html + + .. rst-class:: sphx-glr-signature + + `Gallery generated by Sphinx-Gallery `_ + diff --git a/_sources/examples/heat-capacity/heat-capacity.rst.txt b/_sources/examples/heat-capacity/heat-capacity.rst.txt new file mode 100644 index 00000000..0ad7a65c --- /dev/null +++ b/_sources/examples/heat-capacity/heat-capacity.rst.txt @@ -0,0 +1,509 @@ + +.. DO NOT EDIT. +.. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. +.. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: +.. "examples/heat-capacity/heat-capacity.py" +.. LINE NUMBERS ARE GIVEN BELOW. + +.. only:: html + + .. note:: + :class: sphx-glr-download-link-note + + :ref:`Go to the end ` + to download the full example code. + +.. rst-class:: sphx-glr-example-title + +.. _sphx_glr_examples_heat-capacity_heat-capacity.py: + + +Quantum heat capacity of water +============================== + +:Authors: + Filippo Bigi `@frostedoyster `_; + Michele Ceriotti `@ceriottm `_ + +This example shows how to estimate the heat capacity of liquid water +from a path integral molecular dynamics simulation. The dynamics are +run with `i-PI `_, and +`LAMMPS `_ is used +as the driver to simulate the `q-TIP4P/f water +model `_. + +.. GENERATED FROM PYTHON SOURCE LINES 16-27 + +.. code-block:: Python + + + import os + import subprocess + import time + import xml.etree.ElementTree as ET + + import ipi + import matplotlib.pyplot as plt + import numpy as np + + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 28-48 + +A non-trivial energy estimator +------------------------------ + +As introduced in the +`path-integrals example +`_, +path-integral estimators +for observables that depend on momenta are generally not trivial to compute. + +In this example, we will focus on the constant-volume heat capacity, +:math:`c_V`, which is one such +observable, and we will calculate it for liquid water at room temperature. +Because of the presence of high-frequency vibrations, many of the nuclear +degrees of freedom are trapped in the vibrational ground state, which reduces +substantially the heat capacity from the value that would be obtained +in the classical limit. See `this review +`_ +for an overview of the impact of quantum nuclei on the properties of water. +From a computational perspective, this means that it is necessary to use +specialized simulations and estimators to evaluate the correct value. + +.. GENERATED FROM PYTHON SOURCE LINES 51-71 + +Running the PIMD calculation +~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +This follows the same steps as the ``path-integrals`` example. One important +difference is that we will request the ``scaledcoords`` output to the relevant +section of the ``i-PI`` input XML file, which +contains estimators that can be used to calculate the total energy and +heat capacity as following +`Yamamoto, J. Chem. Phys. (2005) `_. + +The input file is shown below. It should be noted that ``scaledcoords`` +is given a finite differences displacement as a parameter. This is necessary +as the estimators require higher order derivatives of the potential energy, +which are calculated using finite differences. This also means that +evaluating the estimator adds substantial overhead (so it is wise to only +compute it every few simulation steps, to eliminate correlations between +snapshots) and that one should be careful to use well-converged simulation +parameters to avoid discontinuities and noise (for instance, we increase +the accuracy of the particle-mesh electrostatic calculation, and use a +shifted Lennard-Jones potential to avoid a discontinuity at the cutoff). + +.. GENERATED FROM PYTHON SOURCE LINES 71-76 + +.. code-block:: Python + + + # Open and show the relevant part of the input + xmlroot = ET.parse("data/input.xml").getroot() + print(" " + ET.tostring(xmlroot.find(".//properties"), encoding="unicode")) + + + + + +.. rst-class:: sphx-glr-script-out + + .. code-block:: none + + + [ step, time{picosecond}, conserved, potential, kinetic_cv, + scaledcoords(fd_delta=5e-3) ] + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 77-79 + +We launch the i-PI and LAMMPS processes, exactly as in the +``path-integrals`` example. + +.. GENERATED FROM PYTHON SOURCE LINES 79-87 + +.. code-block:: Python + + + # don't rerun if the outputs already exist + ipi_process = None + if not os.path.exists("water-cv.out"): + ipi_process = subprocess.Popen(["i-pi", "data/input.xml"]) + time.sleep(2) # wait for i-PI to start + lmp_process = [subprocess.Popen(["lmp", "-in", "data/in.lmp"]) for i in range(2)] + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 88-89 + +Skip this cell if you want to run in the background + +.. GENERATED FROM PYTHON SOURCE LINES 89-94 + +.. code-block:: Python + + if ipi_process is not None: + ipi_process.wait() + lmp_process[0].wait() + lmp_process[1].wait() + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 95-99 + +Analyzing the results +~~~~~~~~~~~~~~~~~~~~~ +Let's plot the potential and conserved energy as a function of time, +just to check that the simulation ran sensibly. + +.. GENERATED FROM PYTHON SOURCE LINES 99-119 + +.. code-block:: Python + + + output_data, output_desc = ipi.read_output("water-cv.out") + fix, ax = plt.subplots(1, 1, figsize=(4, 3), constrained_layout=True) + ax.plot( + output_data["time"], + output_data["potential"] - output_data["potential"][0], + "b-", + label="Potential, $V$", + ) + ax.plot( + output_data["time"], + output_data["conserved"] - output_data["conserved"][0], + "r-", + label="Conserved, $H$", + ) + ax.set_xlabel(r"$t$ / ps") + ax.set_ylabel(r"energy / a.u.") + ax.legend() + plt.show() + + + + +.. image-sg:: /examples/heat-capacity/images/sphx_glr_heat-capacity_001.png + :alt: heat capacity + :srcset: /examples/heat-capacity/images/sphx_glr_heat-capacity_001.png + :class: sphx-glr-single-img + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 120-144 + +As described in the `i-PI documentation +`_, +the two quantities returned by the ``scaledcoords`` output are ``eps_v`` +and ``eps_v'``, defined in the aforementioned +`paper `_. + +These estimators (:math:`\epsilon_v` and :math:`\epsilon_v'`) are derived in the +"scaled coordinates" formalism, which is a useful trick to avoid the +growth of the error in the instantaneous values of the estimators with +the number of beads used in the path integral simulation. + +The same paper contains the formulas to calculate the total energy and +heat capacity from these estimators: + +.. math:: + E = \langle \epsilon_v \rangle \quad + C_V = k_B \beta^2 \left( \langle \epsilon_v^2 \rangle - \langle + \epsilon_v \rangle^2 - \langle \epsilon_v' \rangle \right) + +First the energy, whose estimator will be compared to the total energy +calculated as the sum of the potential and kinetic energy estimators. +Since the kinetic energy is itself calculated from a scaled-coordinates +estimator (the "centroid virial" estimator), the two total energies are +the same. + +.. GENERATED FROM PYTHON SOURCE LINES 144-174 + +.. code-block:: Python + + + eps_v = output_data["scaledcoords(fd_delta=5e-3)"][:, 0] + eps_v_prime = output_data["scaledcoords(fd_delta=5e-3)"][:, 1] + + energy_estimator = eps_v # first formula + + fix, ax = plt.subplots(1, 1, figsize=(4, 3), constrained_layout=True) + ax.plot( + output_data["time"], + energy_estimator - energy_estimator[0], + "b-", + label="scaled coordinates estimator", + ) + ax.plot( + output_data["time"][:], + ( + output_data["potential"] + - output_data["potential"][0] + + output_data["kinetic_cv"] + - output_data["kinetic_cv"][0] + ), + "r.", + label="potential + virial kinetic", + ) + ax.set_xlabel(r"$t$ / ps") + ax.set_ylabel(r"total energy / a.u.") + ax.legend() + plt.show() + + + + + +.. image-sg:: /examples/heat-capacity/images/sphx_glr_heat-capacity_002.png + :alt: heat capacity + :srcset: /examples/heat-capacity/images/sphx_glr_heat-capacity_002.png + :class: sphx-glr-single-img + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 175-179 + +And, finally, the heat capacity. Note that normally the simulation +requires a few ps for equilibration. Here we discard a few dozen steps +to eliminate the initial jump, which is due to the relaxation of the +ring polymers starting from a single atomic configuration. + +.. GENERATED FROM PYTHON SOURCE LINES 179-198 + +.. code-block:: Python + + + # i-PI scaledcoords outputs are in atomic units (see docs) + kB = 3.16681e-6 # Boltzmann constant in atomic units + T = 298.0 # temperature in K, as defined in the input file + beta = 1.0 / (kB * T) + + skip = 20 + heat_capacity = ( # second formula + kB + * (beta**2) + * ( + np.mean(eps_v[skip:] ** 2) + - np.mean(eps_v[skip:]) ** 2 + - np.mean(eps_v_prime[skip:]) + ) + ) + heat_capacity_per_molecule = heat_capacity / 32 # 32 molecules in the simulation + print(f"Heat capacity (per water molecule): {(heat_capacity_per_molecule/kB):.2f} kB") + + + + + +.. rst-class:: sphx-glr-script-out + + .. code-block:: none + + Heat capacity (per water molecule): 15.17 kB + + + + +.. GENERATED FROM PYTHON SOURCE LINES 199-203 + +You may recognize that the first part of the estimator is reminiscent +of the classical estimator for the heat capacity as the fluctuations of the +(quantum) total energy, which in this case however requires a correction given +by the mean of the second part of the scaled-coordinates estimator. + +.. GENERATED FROM PYTHON SOURCE LINES 205-219 + +Estimating the statistical error +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Especially with such an underconverged simulation, it is important to +estimate the statistical error in the heat capacity. + +Generally, errors on measurements are computed +as "standard errors", i.e. the standard deviation of a series of data points +divided by the square root of the number of data points. In our case, +however, this is made more complicated by the correlation between +close steps in the molecular dynamics trajectory, which would lead to an +overestimation of the number of independent samples. To fix this, we can +calculate the autocorrelation time of the estimators whose errors we +want to estimate, and apply a correction factor to the number of samples. + +.. GENERATED FROM PYTHON SOURCE LINES 219-233 + +.. code-block:: Python + + + + def autocorrelate(x): + n = len(x) + xo = x - x.mean() # remove mean + acov = (np.correlate(xo, xo, "full"))[n - 1 :] + return acov[: len(acov) // 2] + + + def autocorrelation_time(x): + acov = autocorrelate(x) + return 1.0 + np.sum(acov) / acov[0] + + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 234-238 + +Using these helper functions, we can now calculate the error on the various +parts of the heat capacity estimator. Note also the autocorrelation times, that +are just a little larger than one, indicating that the stride used to print out +the estimators is appropriate (as there is little correlation between the samples). + +.. GENERATED FROM PYTHON SOURCE LINES 238-278 + +.. code-block:: Python + + + # Autocorrelation times (i.e. number of steps needed to have independent samples) + autocorr_time_error_delta_eps_v = autocorrelation_time( + (eps_v[skip:] - eps_v[skip:].mean()) ** 2 + ) + autocorr_time_error_eps_v_prime = autocorrelation_time(eps_v_prime[skip:]) + + print( + f""" + Autocorrelation times (in number of samples): + (eps-)^2: {autocorr_time_error_delta_eps_v:.2f} + eps': {autocorr_time_error_eps_v_prime:.2f} + """ + ) + + # Effective number of samples + effective_samples_delta_eps_v = len(eps_v[skip:]) / autocorr_time_error_delta_eps_v + effective_samples_eps_v_prime = len(eps_v[skip:]) / autocorr_time_error_eps_v_prime + + # Standard errors using the effective number of samples + error_delta_eps_v = np.std((eps_v[skip:] - eps_v[skip:].mean()) ** 2) / np.sqrt( + effective_samples_delta_eps_v + ) + error_eps_v_prime = np.std(eps_v_prime[skip:]) / np.sqrt(effective_samples_eps_v_prime) + + # Error on the heat capacity (assuming quadrature sum) + error_heat_capacity = ( + kB * (beta**2) * np.sqrt(error_delta_eps_v**2 + error_eps_v_prime**2) + ) + + error_heat_capacity_per_molecule = ( + error_heat_capacity / 32 + ) # 32 molecules in the simulation + + print( + "Error on the heat capacity (per water molecule): " + f"{(error_heat_capacity_per_molecule/kB):.2f} kB" + ) + + + + + + +.. rst-class:: sphx-glr-script-out + + .. code-block:: none + + + Autocorrelation times (in number of samples): + (eps-)^2: 1.94 + eps': 1.31 + + Error on the heat capacity (per water molecule): 2.06 kB + + + + +.. GENERATED FROM PYTHON SOURCE LINES 279-297 + +The obtained heat capacity is consistent with the values from the literature +(see e.g. `Ceriotti et al., J. Chem. Phys. (2011) +`_ +where the convergence of the heat capacity with number of beads is shown for the same +water model used in this example). +However, the error is quite large, which is expected given the short simulation time. +To reduce the error, one would need to run a longer simulation. Other important error +sources, which are not accounted for in the error estimate, are the finite size of the +system and number of beads. Both of these are too small in this example to give +reliable results. + +In a realistic simulation, up to a few 100s of picoseconds might be needed to reduce +the sampling error to a small value (1-2% of the heat capacity). For water at room +temperature, you will need 32 beads at the very least (8 were used in this example). +It is more difficult to give a general rule for the system size: (quantum) energy +fluctuations are usually localized, but to guarantee accurate sampling of the +liquid structure, a few hundred water molecules would be a reasonable guess +(32 were used in this example). + + +.. rst-class:: sphx-glr-timing + + **Total running time of the script:** (0 minutes 40.552 seconds) + + +.. _sphx_glr_download_examples_heat-capacity_heat-capacity.py: + +.. only:: html + + .. container:: sphx-glr-footer sphx-glr-footer-example + + + .. container:: sphx-glr-download + + :download:`Download Conda environment file: environment.yml ` + + .. container:: sphx-glr-download + + :download:`Download data files: data.zip ` + .. container:: sphx-glr-download sphx-glr-download-jupyter + + :download:`Download Jupyter notebook: heat-capacity.ipynb ` + + .. container:: sphx-glr-download sphx-glr-download-python + + :download:`Download Python source code: heat-capacity.py ` + + .. container:: sphx-glr-download sphx-glr-download-zip + + :download:`Download zipped: heat-capacity.zip ` + + +.. only:: html + + .. rst-class:: sphx-glr-signature + + `Gallery generated by Sphinx-Gallery `_ + diff --git a/_sources/examples/lode-linear/lode-linear.rst.txt b/_sources/examples/lode-linear/lode-linear.rst.txt new file mode 100644 index 00000000..ea3e3458 --- /dev/null +++ b/_sources/examples/lode-linear/lode-linear.rst.txt @@ -0,0 +1,742 @@ + +.. DO NOT EDIT. +.. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. +.. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: +.. "examples/lode-linear/lode-linear.py" +.. LINE NUMBERS ARE GIVEN BELOW. + +.. only:: html + + .. note:: + :class: sphx-glr-download-link-note + + :ref:`Go to the end ` + to download the full example code. + +.. rst-class:: sphx-glr-example-title + +.. _sphx_glr_examples_lode-linear_lode-linear.py: + + +Long-distance Equivariants: a tutorial +====================================== + +:Authors: Philip Loche `@PicoCentauri `_, + Kevin Huguenin-Dumittan `@kvhuguenin `_ + +This tutorial explains how Long range equivariant descriptors can be constructed using +rascaline and the resulting descriptors be used to construct a linear model with +equisolve + +First, import all the necessary packages + +.. GENERATED FROM PYTHON SOURCE LINES 16-27 + +.. code-block:: Python + + + import ase.io + import matplotlib.pyplot as plt + import metatensor + import numpy as np + from equisolve.numpy.models.linear_model import Ridge + from equisolve.utils.convert import ase_to_tensormap + from rascaline import AtomicComposition, LodeSphericalExpansion, SphericalExpansion + from rascaline.utils import PowerSpectrum + + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 28-43 + +Step 0: Prepare Data Set +------------------------ + +Get structures +~~~~~~~~~~~~~~ + +We take a small subset of the dimer dataset from `A. Grisafi et al., +2021 `_ +for which we additionally calculated the forces. Each structure in the +dataset contains two small organic molecules which are extended along a +certain direction in the subsequent structures. + +For speeding up the calculations we already selected the first 130 +:download:`structures ` of the charge-charge molecule +pairs. + +.. GENERATED FROM PYTHON SOURCE LINES 44-48 + +.. code-block:: Python + + + frames = ase.io.read("charge-charge.xyz", ":") + + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 49-56 + +Convert target properties to metatensor format +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +If we want to train models using the +`equisolve `_ package, we need to +convert the target properties (in this case, the energies and forces) +into the appropriate format #justequistorethings + +.. GENERATED FROM PYTHON SOURCE LINES 57-61 + +.. code-block:: Python + + + y = ase_to_tensormap(frames, energy="energy", forces="forces") + + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 62-73 + +Step 1: Compute short-range and LODE features +--------------------------------------------- + +Define hypers and get the expansion coefficients :math:`\langle anlm | \rho_i \rangle` +and :math:`\langle anlm | V_i \rangle` + +The short-range and long-range descriptors have very similar hyperparameters. We +highlight the differences below. + +We first define the hyperparameters for the short-range (SR) part. These will be used +to create SOAP features. + +.. GENERATED FROM PYTHON SOURCE LINES 74-86 + +.. code-block:: Python + + + SR_HYPERS = { + "cutoff": 3.0, + "max_radial": 6, + "max_angular": 2, + "atomic_gaussian_width": 0.3, + "center_atom_weight": 1.0, + "radial_basis": {"Gto": {}}, + "cutoff_function": {"ShiftedCosine": {"width": 0.5}}, + } + + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 87-88 + +And next the hyperparaters for the LODE / long-range (LR) part + +.. GENERATED FROM PYTHON SOURCE LINES 89-107 + +.. code-block:: Python + + + + LR_HYPERS = { + # Cutoff on which to project potential density + "cutoff": 3.0, + # keep max_radial slightly smaller than for SR part + "max_radial": 3, + # max_angular should be <= 4, more precisely, max_angular + potential_exponent < 10 + "max_angular": 2, + # keep at >=1, WARNING: CUBIC SCALING, do not use values <0.5 + "atomic_gaussian_width": 3.0, + "center_atom_weight": 1.0, + "radial_basis": {"Gto": {}}, + # the exponent p that determines the 1/r^p potential + "potential_exponent": 1, + } + + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 108-110 + +We then use the above defined hyperparaters to define the per atom short range (sr) +and long range (sr) descriptors. + +.. GENERATED FROM PYTHON SOURCE LINES 110-115 + +.. code-block:: Python + + + calculator_sr = SphericalExpansion(**SR_HYPERS) + calculator_lr = LodeSphericalExpansion(**LR_HYPERS) + + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 116-136 + +Note that LODE requires periodic systems. Therefore, if the data set does not come +with periodic boundary conditions by default you can not use the data set and you will +face an error if you try to compute the features. + +As you notices the calculation of the long range features takes significant more time +compared to the sr features. + +Taking a look at the output we find that the resulting +:py:class:`metatensor.TensorMap` are quite similar in their structure. The short range +:py:class:`metatensor.TensorMap` contains more blocks due to the higher +``max_angular`` paramater we choosed above. + +Generate the rotational invariants (power spectra) +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Rotationally invariant features can be obtained by taking two of the calculators that +were defines above. + +For the short-range part, we use the SOAP vector which is obtained by computing the +invariant combinations of the form :math:`\rho \otimes \rho`. + +.. GENERATED FROM PYTHON SOURCE LINES 137-142 + +.. code-block:: Python + + + ps_calculator_sr = PowerSpectrum(calculator_sr, calculator_sr) + ps_sr = ps_calculator_sr.compute(frames, gradients=["positions"]) + + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 143-149 + +We calculate gradients with respect to pistions by providing the +``gradients=["positions"]`` option to the +:py:meth:`rascaline.calculators.CalculatorBase.compute()` method. + +For the long-range part, we combine the long-range descriptor :math:`V` with one a +short-range density :math:`\rho` to get :math:`\rho \otimes V` features. + +.. GENERATED FROM PYTHON SOURCE LINES 150-155 + +.. code-block:: Python + + + ps_calculator_lr = PowerSpectrum(calculator_sr, calculator_lr) + ps_lr = ps_calculator_lr.compute(systems=frames, gradients=["positions"]) + + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 156-165 + +Step 2: Building a Simple Linear SR + LR Model with energy baselining +--------------------------------------------------------------------- + +Preprocessing (model dependent) +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +For our current model, we do not wish to treat the individual center and +neighbor species separately. Thus, we move the ``"species_center"`` key +into the ``sample`` direction, over which we will later sum over. + +.. GENERATED FROM PYTHON SOURCE LINES 166-171 + +.. code-block:: Python + + + ps_sr = ps_sr.keys_to_samples("species_center") + ps_lr = ps_lr.keys_to_samples("species_center") + + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 172-174 + +For linear models only: Sum features up over atoms (``samples``) in the same +structure. + +.. GENERATED FROM PYTHON SOURCE LINES 175-182 + +.. code-block:: Python + + + sample_names_to_sum = ["center", "species_center"] + + ps_sr = metatensor.sum_over_samples(ps_sr, sample_names=sample_names_to_sum) + ps_lr = metatensor.sum_over_samples(ps_lr, sample_names=sample_names_to_sum) + + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 183-189 + +Initialize tensormaps for energy baselining +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +We add a simple extra descriptor :py:class:`rascaline.AtomicComposition` that stores +how many atoms of each chemical species are contained in the structures. This is used +for energy baselining. + +.. GENERATED FROM PYTHON SOURCE LINES 190-197 + +.. code-block:: Python + + + calculator_co = AtomicComposition(per_structure=False) + descriptor_co = calculator_co.compute(frames, gradients=["positions"]) + + co = descriptor_co.keys_to_properties(["species_center"]) + co = metatensor.sum_over_samples(co, sample_names=["center"]) + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 198-219 + +The :py:class:`rascaline.AtomicComposition` calculator also allows to directly perform +the the sum over center atoms by using the following lines. + +.. code:: python + + descriptor_co = AtomicComposition(per_structure=True).compute(**compute_args) + co = descriptor_co.keys_to_properties(["species_center"]) + +Stack all the features together for linear model +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +A linear model on SR + LR features can be thought of as a linear model +built on a feature vector that is simply the concatenation of the SR and +LR features. + +Furthermore, energy baselining can be performed by concatenating the information about +chemical species as well. There is an metatensor function called +:py:func:`metatensor.join()` for this purpose. Formally, we can write for the SR +model. + +X_sr: :math:`1 \oplus \left(\rho \otimes \rho\right)` + +.. GENERATED FROM PYTHON SOURCE LINES 220-224 + +.. code-block:: Python + + + X_sr = metatensor.join([co, ps_sr], axis="properties") + + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 225-232 + +We used the ``axis="properties"`` parameter since we want to concatenate along the +features/properties dimensions. + +For the long range model we can formerly write + +X_lr: :math:`1 \oplus \left(\rho \otimes \rho\right) \oplus \left(\rho \otimes +V\right)` + +.. GENERATED FROM PYTHON SOURCE LINES 233-237 + +.. code-block:: Python + + + X_lr = metatensor.join([co, ps_sr, ps_lr], axis="properties") + + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 238-245 + +The features are now ready! Let us now perform some actual learning. Below we +initialize two instances of the :py:class:`equisolve.numpy.models.linear_model.Ridge` +class. :py:class:`equisolve.numpy.models.linear_model.Ridge` will perform a regression +with respect to ``"values"`` (energies) and ``"positions"`` gradients (forces). + +If you only want a fit with respect to energies you can remove the gradients with +``metatensor.remove_gradients()`` + +.. GENERATED FROM PYTHON SOURCE LINES 246-251 + +.. code-block:: Python + + + clf_sr = Ridge() + clf_lr = Ridge() + + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 252-258 + +Split training and target data into train and test dat +------------------------------------------------------ + +Split the training and the test data by the distance :math:`r_{\rm +train}=6\,\mathrm{Å}` between the center of mass of the two molecules. A structure +with a :math:`r_{\rm train}<6 {\rm Å}` is used for training. + +.. GENERATED FROM PYTHON SOURCE LINES 259-263 + +.. code-block:: Python + + + r_cut = 6.0 + + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 264-266 + +We calculate the indices from the dataset by list comprehension. The center of mass +distance is stored in the ``"distance""`` attribute. + +.. GENERATED FROM PYTHON SOURCE LINES 267-272 + +.. code-block:: Python + + + idx_train = [i for i, f in enumerate(frames) if f.info["distance"] < r_cut] + idx_test = [i for i, f in enumerate(frames) if f.info["distance"] >= r_cut] + + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 273-275 + +For doing the split we define two ``Labels`` instances and combine them in a +:py:class:`List`. + +.. GENERATED FROM PYTHON SOURCE LINES 276-282 + +.. code-block:: Python + + + samples_train = metatensor.Labels(["structure"], np.reshape(idx_train, (-1, 1))) + samples_test = metatensor.Labels(["structure"], np.reshape(idx_test, (-1, 1))) + grouped_labels = [samples_train, samples_test] + + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 283-284 + +That we use as input to the :py:func:`metatensor.split()` function + +.. GENERATED FROM PYTHON SOURCE LINES 285-297 + +.. code-block:: Python + + + X_sr_train, X_sr_test = metatensor.split( + X_sr, axis="samples", grouped_labels=grouped_labels + ) + + X_lr_train, X_lr_test = metatensor.split( + X_lr, axis="samples", grouped_labels=grouped_labels + ) + + y_train, y_test = metatensor.split(y, axis="samples", grouped_labels=grouped_labels) + + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 298-305 + +Fit the model +------------- + +For this model, we use a very simple regularization scheme where all features are +regularized in the same way (the amount being controlled by the parameter ``alpha``). +For more advanced regularization schemes (regularizing energies and forces differently +and/or the SR and LR parts differently), see further down. + +.. GENERATED FROM PYTHON SOURCE LINES 306-311 + +.. code-block:: Python + + + clf_sr.fit(X_sr_train, y_train, alpha=1e-6) + clf_lr.fit(X_lr_train, y_train, alpha=1e-6) + + + + + + +.. rst-class:: sphx-glr-script-out + + .. code-block:: none + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 312-317 + +Evaluation +---------- + +For evaluating the model we calculate the RMSEs using the ``score()`` method. With the +``parameter_key`` parameter we select which RMSE should be calculated. + +.. GENERATED FROM PYTHON SOURCE LINES 318-338 + +.. code-block:: Python + + + print( + "SR: RMSE energies = " + f"{clf_sr.score(X_sr_test, y_test, parameter_key='values')[0]:.3f} eV" + ) + print( + "SR: RMSE forces = " + f"{clf_sr.score(X_sr_test, y_test, parameter_key='positions')[0]:.3f} eV/Å" + ) + + print( + "LR: RMSE energies = " + f"{clf_lr.score(X_lr_test, y_test, parameter_key='values')[0]:.3f} eV" + ) + print( + "LR: RMSE forces = " + f"{clf_lr.score(X_lr_test, y_test, parameter_key='positions')[0]:.3f} eV/Å" + ) + + + + + + +.. rst-class:: sphx-glr-script-out + + .. code-block:: none + + SR: RMSE energies = 0.557 eV + SR: RMSE forces = 0.188 eV/Å + LR: RMSE energies = 0.158 eV + LR: RMSE forces = 0.178 eV/Å + + + + +.. GENERATED FROM PYTHON SOURCE LINES 339-345 + +We find that the RMSE of the energy and the force of the LR model is smaller compared +to the SR model. From this we conclude that the LR model performs better for the +selection of the dataset. + +We additionally, can plot of the binding energy as a function of the distance. For the +plot we select some properties from the dataset + +.. GENERATED FROM PYTHON SOURCE LINES 346-352 + +.. code-block:: Python + + + dist = np.array([f.info["distance"] for f in frames]) + energies = np.array([f.info["energy"] for f in frames]) + monomer_energies = np.array([f.info["energyA"] + f.info["energyB"] for f in frames]) + + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 353-354 + +and select only the indices corresponding to our test set. + +.. GENERATED FROM PYTHON SOURCE LINES 358-359 + +Next we calculate the predicted SR and LR ``TensorMaps``. + +.. GENERATED FROM PYTHON SOURCE LINES 360-365 + +.. code-block:: Python + + + y_sr_pred = clf_sr.predict(X_sr) + y_lr_pred = clf_lr.predict(X_lr) + + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 366-367 + +And, finally perform the plot. + +.. GENERATED FROM PYTHON SOURCE LINES 368-396 + +.. code-block:: Python + + + plt.scatter( + dist, y.block().values[:, 0] - monomer_energies, label="target data", color="black" + ) + + plt.scatter( + dist, + y_sr_pred.block().values[:, 0] - monomer_energies, + label="short range model", + marker="x", + ) + + plt.scatter( + dist, + y_lr_pred.block().values[:, 0] - monomer_energies, + label="long range model", + marker="s", + facecolor="None", + edgecolor="orange", + ) + + plt.xlabel("center of mass distance in Å") + plt.ylabel(r"$E - E_\mathrm{monomer}$ in eV") + plt.axvline(r_cut, c="red", label=r"$r_\mathrm{train}$") + + plt.legend() + plt.tight_layout() + plt.show() + + + +.. image-sg:: /examples/lode-linear/images/sphx_glr_lode-linear_001.png + :alt: lode linear + :srcset: /examples/lode-linear/images/sphx_glr_lode-linear_001.png + :class: sphx-glr-single-img + + + + + + +.. rst-class:: sphx-glr-timing + + **Total running time of the script:** (0 minutes 9.031 seconds) + + +.. _sphx_glr_download_examples_lode-linear_lode-linear.py: + +.. only:: html + + .. container:: sphx-glr-footer sphx-glr-footer-example + + + .. container:: sphx-glr-download + + :download:`Download Conda environment file: environment.yml ` + .. container:: sphx-glr-download sphx-glr-download-jupyter + + :download:`Download Jupyter notebook: lode-linear.ipynb ` + + .. container:: sphx-glr-download sphx-glr-download-python + + :download:`Download Python source code: lode-linear.py ` + + .. container:: sphx-glr-download sphx-glr-download-zip + + :download:`Download zipped: lode-linear.zip ` + + +.. only:: html + + .. rst-class:: sphx-glr-signature + + `Gallery generated by Sphinx-Gallery `_ + diff --git a/_sources/examples/lpr/lpr.rst.txt b/_sources/examples/lpr/lpr.rst.txt new file mode 100644 index 00000000..eafaf2ea --- /dev/null +++ b/_sources/examples/lpr/lpr.rst.txt @@ -0,0 +1,441 @@ + +.. DO NOT EDIT. +.. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. +.. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: +.. "examples/lpr/lpr.py" +.. LINE NUMBERS ARE GIVEN BELOW. + +.. only:: html + + .. note:: + :class: sphx-glr-download-link-note + + :ref:`Go to the end ` + to download the full example code. + +.. rst-class:: sphx-glr-example-title + +.. _sphx_glr_examples_lpr_lpr.py: + + +Local Prediction Rigidity analysis +================================== + +:Authors: Sanggyu "Raymond" Chong `@SanggyuChong `_; + Federico Grasselli `@fgrassel `_ + +In this tutorial, we calculate the SOAP descriptors of an amorphous +silicon dataset using rascaline, then compute the local prediction +rigidity (LPR) for the atoms of a "test" set before and after +modifications to the "training" dataset has been made. + +First, we import all the necessary packages: + +.. GENERATED FROM PYTHON SOURCE LINES 17-30 + +.. code-block:: Python + + import os + import tarfile + + import numpy as np + import requests + from ase.io import read + from matplotlib import pyplot as plt + from matplotlib.colors import LogNorm + from rascaline import SoapPowerSpectrum + from sklearn.decomposition import PCA + from skmatter.metrics import local_prediction_rigidity as lpr + + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 31-38 + +Load and prepare amorphous silicon data +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + +We first download the dataset associated with LPR +analysis from Materials Cloud and load the the amorphous +silicon structures using `ASE `_. + +.. GENERATED FROM PYTHON SOURCE LINES 38-65 + +.. code-block:: Python + + + filename = "LPR_supp_notebook_dataset.tar.gz" + if not os.path.exists(filename): + url = "https://rb.gy/wxsrug" # shortened URL + response = requests.get(url) + response.raise_for_status() + with open(filename, "wb") as f: + f.write(response.content) + + with tarfile.open(filename) as tar: + tar.extractall(path=".") + + frames_pristine = read("datasets/Si_amo_defect_free.xyz", ":") + frames_defect = read("datasets/Si_amo_defect_containing.xyz", ":") + + # Randomly shuffle the structures + + np.random.seed(20230215) + + ids = list(range(len(frames_pristine))) + np.random.shuffle(ids) + frames_pristine = [frames_pristine[ii] for ii in ids] + + ids = list(range(len(frames_defect))) + np.random.shuffle(ids) + frames_defect = [frames_defect[ii] for ii in ids] + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 66-74 + +We now further refine the loaded datasets according the the +number of coordinated atoms that each atomic environment exhibits. +"Pristine" refers to structures where all of the atoms have strictly +4 coordinating atoms. "Defect" refers to structures that contain +atoms with coordination numbers other than 4. + +We use :code:`get_all_distances` funciton of :code:`ase.Atoms` to detect the +number of coordinated atoms. + +.. GENERATED FROM PYTHON SOURCE LINES 74-92 + +.. code-block:: Python + + + cur_cutoff = 2.7 + refined_pristine_frames = [] + for frame in frames_pristine: + neighs = (frame.get_all_distances(mic=True) < cur_cutoff).sum(axis=0) - 1 + if neighs.max() > 4 or neighs.min() < 4: + continue + else: + refined_pristine_frames.append(frame) + + refined_defect_frames = [] + for frame in frames_defect: + neighs = (frame.get_all_distances(mic=True) < cur_cutoff).sum(axis=0) - 1 + num_defects = (neighs > 4).sum() + (neighs < 4).sum() + if num_defects > 4: + refined_defect_frames.append(frame) + + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 93-103 + +Compute SOAP descriptors using rascaline +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Now, we move on and compute the SOAP descriptors for the refined +structures. First, define the rascaline hyperparameters used to +compute SOAP. Among the hypers, notice that the cutoff is chosen +to be 2.85 Å, and the radial scaling is turned off. These were +heuristic choices made to accentuate the difference in the LPR +based on the nearest-neighbor coordination. (Do not blindly +use this set of hypers for production-quality model training!) + +.. GENERATED FROM PYTHON SOURCE LINES 103-129 + +.. code-block:: Python + + + # Hypers dictionary + hypers = { + "cutoff": 2.85, + "max_radial": 10, + "max_angular": 12, + "atomic_gaussian_width": 0.5, + "center_atom_weight": 1.0, + "radial_basis": {"Gto": {"spline_accuracy": 1e-8}}, + "cutoff_function": {"ShiftedCosine": {"width": 0.1}}, + "radial_scaling": None, + } + # Define rascaline calculator + calculator = SoapPowerSpectrum(**hypers) + + # Calculate the SOAP power spectrum + Xlist_pristine = [] + for frame in refined_pristine_frames: + descriptor = calculator.compute(frame) + Xlist_pristine.append(np.array(descriptor.block().values)) + + Xlist_defect = [] + for frame in refined_defect_frames: + descriptor = calculator.compute(frame) + Xlist_defect.append(np.array(descriptor.block().values)) + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 130-141 + +Organize structures into "training" and "test" sets +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Now we move on and compute the SOAP descriptors for the refined +structures. First, define the rascaline hyperparameters used to +compute SOAP. + +Notice that the format in which we handle the descriptors is as a +list of :code:`np.array` descriptor blocks. This is to ensure +compatibility with how things have been implemented in the LPR +module of :code:`scikit-matter`. + +.. GENERATED FROM PYTHON SOURCE LINES 141-157 + +.. code-block:: Python + + + n_train = 400 + n_add = 50 + n_test = 50 + + X_pristine = [Xlist for Xlist in Xlist_pristine[: n_train + n_add]] + X_defect = [Xlist for Xlist in Xlist_defect[:n_add]] + X_test = [Xlist for Xlist in Xlist_defect[n_add : n_add + n_test]] + + # Save coordination values for visualization + test_coord = [] + for frame in refined_defect_frames[n_add : n_add + n_test]: + coord = (frame.get_all_distances(mic=True) < cur_cutoff - 0.05).sum(axis=0) - 1 + test_coord += coord.tolist() + test_coord = np.array(test_coord) + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 158-172 + +Compute the LPR for the test set +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Next, we will use the :code:`local_prediction_rigidity` module of +`scikit-matter `_ +to compute the LPRs for the test set that we have set apart. + +LPR reflects how the ML model perceives a local environment, +given a collection of other structures, similar or different. +It should then carry over some of the details involved in training +the model, in this case the regularization strength. + +For this example, we have foregone on the actual model training, +and so we define an arbitrary value for the alpha. + +.. GENERATED FROM PYTHON SOURCE LINES 172-177 + +.. code-block:: Python + + + alpha = 1e-4 + LPR_test, rank = lpr(X_pristine, X_test, alpha) + LPR_test = np.hstack(LPR_test) + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 178-184 + +Visualizing the LPR on a PCA map +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +We now visualize the LPRs of the test set on a PCA map, +where the PCA is performed on the SOAP descriptors of +defect-containing dataset. + +.. GENERATED FROM PYTHON SOURCE LINES 184-211 + +.. code-block:: Python + + + pca = PCA(n_components=5) + descriptors_all = calculator.compute(refined_defect_frames) + pca.fit_transform(descriptors_all.block().values) + PCA_test = pca.transform(np.vstack(X_test)) + + rmin = np.log10(LPR_test.min()) + 0.5 + rmax = np.log10(LPR_test.max()) - 0.5 + + fig = plt.figure(figsize=(5, 4), dpi=200) + ax = fig.add_subplot() + im = ax.scatter( + PCA_test[:, 0], + PCA_test[:, 1], + c=LPR_test, + s=20, + linewidths=0, + norm=LogNorm(vmin=10**rmin, vmax=10**rmax), + cmap="viridis", + ) + + ax.set_xlabel("PC1") + ax.set_ylabel("PC2") + fig.colorbar(im, ax=ax, label="LPR") + ax.tick_params(left=False, bottom=False, labelleft=False, labelbottom=False) + plt.show() + + + + +.. image-sg:: /examples/lpr/images/sphx_glr_lpr_001.png + :alt: lpr + :srcset: /examples/lpr/images/sphx_glr_lpr_001.png + :class: sphx-glr-single-img + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 212-220 + +In the PCA map, where each point corresponds to an +atomic environment of the test set structures, one +can observe 4 different clusters of points, arranged +along PC1. This corresponds to the coordination numbers +ranging from 3 to 6. Since the training set contains +structures exclusively composed of 4-coordinated atoms, +LPR is distinctly high for the second, main cluster of +points, and quite low for the three other clusters. + +.. GENERATED FROM PYTHON SOURCE LINES 223-230 + +Studying the LPR after dataset modification +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +We now want to see what would happen when defect structures +are included into the training set of the model. For this, +we first create a modified dataset that incorporates in the +defect structures, and recompute the LPR. + +.. GENERATED FROM PYTHON SOURCE LINES 230-235 + +.. code-block:: Python + + + X_new = X_pristine[:n_train] + X_defect[:n_add] + LPR_test_new, rank = lpr(X_new, X_test, alpha) + LPR_test_new = np.hstack(LPR_test_new) + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 236-241 + +We then visualize the change in the LPR with the +modification of the dataset by plotting the same PCA +map, but now colored by the ratio of new set of LPR +values (after dataset modification) over the original +one. + +.. GENERATED FROM PYTHON SOURCE LINES 241-259 + +.. code-block:: Python + + + fig = plt.figure(figsize=(5, 4), dpi=200) + ax = fig.add_subplot() + im = ax.scatter( + PCA_test[:, 0], + PCA_test[:, 1], + c=LPR_test_new / LPR_test, + s=20, + linewidths=0, + # norm=LogNorm(vmin=10**rmin, vmax=10**rmax), + cmap="OrRd", + ) + ax.set_xlabel("PC1") + ax.set_ylabel("PC2") + fig.colorbar(im, ax=ax, label=r"LPR$_{\mathrm{new}}$ / LPR$_{\mathrm{old}}$") + ax.tick_params(left=False, bottom=False, labelleft=False, labelbottom=False) + plt.show() + + + + +.. image-sg:: /examples/lpr/images/sphx_glr_lpr_002.png + :alt: lpr + :srcset: /examples/lpr/images/sphx_glr_lpr_002.png + :class: sphx-glr-single-img + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 260-263 + +It is apparent that while the LPR stays more or less consistent for the +4-coordinated atoms, it is significantly enhanced for the defective environments +as a result of the inclusion of defective structures in the training set. + + +.. rst-class:: sphx-glr-timing + + **Total running time of the script:** (0 minutes 16.406 seconds) + + +.. _sphx_glr_download_examples_lpr_lpr.py: + +.. only:: html + + .. container:: sphx-glr-footer sphx-glr-footer-example + + + .. container:: sphx-glr-download + + :download:`Download Conda environment file: environment.yml ` + .. container:: sphx-glr-download sphx-glr-download-jupyter + + :download:`Download Jupyter notebook: lpr.ipynb ` + + .. container:: sphx-glr-download sphx-glr-download-python + + :download:`Download Python source code: lpr.py ` + + .. container:: sphx-glr-download sphx-glr-download-zip + + :download:`Download zipped: lpr.zip ` + + +.. only:: html + + .. rst-class:: sphx-glr-signature + + `Gallery generated by Sphinx-Gallery `_ + diff --git a/_sources/examples/path-integrals/path-integrals.rst.txt b/_sources/examples/path-integrals/path-integrals.rst.txt new file mode 100644 index 00000000..765f9995 --- /dev/null +++ b/_sources/examples/path-integrals/path-integrals.rst.txt @@ -0,0 +1,648 @@ + +.. DO NOT EDIT. +.. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. +.. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: +.. "examples/path-integrals/path-integrals.py" +.. LINE NUMBERS ARE GIVEN BELOW. + +.. only:: html + + .. note:: + :class: sphx-glr-download-link-note + + :ref:`Go to the end ` + to download the full example code. + +.. rst-class:: sphx-glr-example-title + +.. _sphx_glr_examples_path-integrals_path-integrals.py: + + +Path integral molecular dynamics +================================ + +:Authors: Michele Ceriotti `@ceriottm `_ + +This example shows how to run a path integral molecular dynamics +simulation using ``i-PI``, analyze the output and visualize the +trajectory in ``chemiscope``. It uses `LAMMPS `_ +as the driver to simulate the `q-TIP4P/f water +model `_. + +.. GENERATED FROM PYTHON SOURCE LINES 13-23 + +.. code-block:: Python + + + import subprocess + import time + + import chemiscope + import ipi + import matplotlib.pyplot as plt + import numpy as np + + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 24-57 + +Quantum nuclear effects and path integral methods +------------------------------------------------- + +The Born-Oppenheimer approximation separates the joint quantum mechanical +problem for electrons and nuclei into two independent problems. Even though +often one makes the additional approximation of treating nuclei as classical +particles, this is not necessary, and in some cases (typically when H atoms are +present) can add considerable error. + + +.. figure:: pimd-slices-round.png + :align: center + :width: 600px + + A representation of ther ring-polymer Hamiltonian for a water molecule. + +In order to describe the quantum mechanical nature of light nuclei +(nuclear quantum effects) one of the most widely-applicable methods uses +the *path integral formalism* to map the quantum partition function of a +set of distinguishable particles onto the classical partition function of +*ring polymers* composed by multiple beads (replicas) with +corresponding atoms in adjacent replicas being connected by harmonic +springs. +`The textbook by Tuckerman `_ +contains a pedagogic introduction to the topic, while +`this paper `_ outlines the implementation +used in ``i-PI``. + +The classical partition function of the path converges to quantum statistics +in the limit of a large number of replicas. In this example, we will use a +technique based on generalized Langevin dynamics, known as +`PIGLET `_ to accelerate the +convergence. + +.. GENERATED FROM PYTHON SOURCE LINES 60-69 + +Running PIMD calculations with ``i-PI`` +--------------------------------------- + +`i-PI `_ is based on a client-server model, with ``i-PI`` +controlling the nuclear dynamics (in this case sampling the path Hamiltonian using +molecular dynamics) while the calculation of energies and forces is delegated to +an external client program, in this example ``LAMMPS``. + +An i-PI calculation is specified by an XML file. + +.. GENERATED FROM PYTHON SOURCE LINES 69-75 + +.. code-block:: Python + + + # Open and read the XML file + with open("data/input_pimd.xml", "r") as file: + xml_content = file.read() + print(xml_content) + + + + + +.. rst-class:: sphx-glr-script-out + + .. code-block:: none + + + + [ step, time{picosecond}, conserved{electronvolt}, temperature{kelvin}, kinetic_cv{electronvolt}, potential{electronvolt}, pressure_cv{megapascal}, kinetic_td{electronvolt} ] + positions + kinetic_cv + kinetic_od + + 200 + + 32342 + + +
h2o-lammps
1e-4 +
+ + + data/water_32.pdb + 298 + + + lmpserial + + + 298 + + + + + 5.0 + + 0.5 + + + +
+ + + + + +.. GENERATED FROM PYTHON SOURCE LINES 76-83 + +NB1: In a realistic simulation you may want to increase the field +``total_steps``, to simulate at least a few 100s of picoseconds. + +NB2: To converge a simulation of water at room temperature, you +typically need at least 32 beads. We will see later how to accelerate +convergence using a colored-noise thermostat, but you can try to +modify the input to check convergence with conventional PIMD + +.. GENERATED FROM PYTHON SOURCE LINES 85-102 + +i-PI and lammps should be run separately, and it is possible to +launch separate lammps processes to parallelize the evaluation over +the beads. On the the command line, this amounts to launching + +.. code-block:: bash + + i-pi data/input_pimd.xml > log & + sleep 2 + lmp -in data/in.lmp & + lmp -in data/in.lmp & + +Note how ``i-PI`` and ``LAMMPS`` are completely independent, and +therefore need a separate set of input files. The client-side communication +in ``LAMMPS`` is described in the ``fix_ipi`` section, that matches the socket +name and mode defined in the ``ffsocket`` field in the ``i-PI`` file. + +We can launch the external processes from a Python script as follows + +.. GENERATED FROM PYTHON SOURCE LINES 102-107 + +.. code-block:: Python + + + ipi_process = subprocess.Popen(["i-pi", "data/input_pimd.xml"]) + time.sleep(2) # wait for i-PI to start + lmp_process = [subprocess.Popen(["lmp", "-in", "data/in.lmp"]) for i in range(2)] + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 108-111 + +If you run this in a notebook, you can go ahead and start loading +output files *before* i-PI and lammps have finished running, by +skipping this cell + +.. GENERATED FROM PYTHON SOURCE LINES 111-117 + +.. code-block:: Python + + + ipi_process.wait() + lmp_process[0].wait() + lmp_process[1].wait() + + + + + + +.. rst-class:: sphx-glr-script-out + + .. code-block:: none + + + 1 + + + +.. GENERATED FROM PYTHON SOURCE LINES 118-124 + +Analyzing the simulation +~~~~~~~~~~~~~~~~~~~~~~~~ + +After the simulation has run, you can visualize and post-process the trajectory data. +Note that i-PI prints a separate trajectory for each bead, as structural properties +can be computed averaging over the configurations of any of the beads. + +.. GENERATED FROM PYTHON SOURCE LINES 124-130 + +.. code-block:: Python + + + # drops first frame where all atoms overlap + output_data, output_desc = ipi.read_output("simulation.out") + traj_data = [ipi.read_trajectory(f"simulation.pos_{i}.xyz")[1:] for i in range(8)] + + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 131-136 + +The simulation parameters are pushed at the limits: with the aggressive stochastic +thermostatting and the high-frequency normal modes of the ring polymer, there are +fairly large fluctuations of the conserved quantity. This is usually not affecting +physical observables, but if you see this level of drift in a production run, check +carefully for convergence and stability with a reduced time step. + +.. GENERATED FROM PYTHON SOURCE LINES 136-155 + +.. code-block:: Python + + + fix, ax = plt.subplots(1, 1, figsize=(4, 3), constrained_layout=True) + ax.plot( + output_data["time"], + output_data["potential"] - output_data["potential"][0], + "b-", + label="Potential, $V$", + ) + ax.plot( + output_data["time"], + output_data["conserved"] - output_data["conserved"][0], + "r-", + label="Conserved, $H$", + ) + ax.set_xlabel(r"$t$ / ps") + ax.set_ylabel(r"energy / eV") + ax.legend() + plt.show() + + + + +.. image-sg:: /examples/path-integrals/images/sphx_glr_path-integrals_001.png + :alt: path integrals + :srcset: /examples/path-integrals/images/sphx_glr_path-integrals_001.png + :class: sphx-glr-single-img + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 156-166 + +While the potential energy is simply the mean over the beads of the +energy of individual replicas, computing the kinetic energy requires +averaging special quantities that involve also the correlations between beads. +Here we compare two of these *estimators*: the 'thermodynamic' estimator becomes +statistically inefficient when increasing the number of beads, whereas the +'centroid virial' estimator remains well-behaved. Note how quickly these estimators +equilibrate to roughly their stationary value, much faster than the equilibration +of the potential energy above. This is thanks to the ``pile_g`` thermostat +(see `DOI:10.1063/1.3489925 `_) that is +optimally coupled to the normal modes of the ring polymer. + +.. GENERATED FROM PYTHON SOURCE LINES 166-185 + +.. code-block:: Python + + + fix, ax = plt.subplots(1, 1, figsize=(4, 3), constrained_layout=True) + ax.plot( + output_data["time"], + output_data["kinetic_cv"], + "b-", + label="Centroid virial, $K_{CV}$", + ) + ax.plot( + output_data["time"], + output_data["kinetic_td"], + "r-", + label="Thermodynamic, $K_{TD}$", + ) + ax.set_xlabel(r"$t$ / ps") + ax.set_ylabel(r"energy / eV") + ax.legend() + plt.show() + + + + +.. image-sg:: /examples/path-integrals/images/sphx_glr_path-integrals_002.png + :alt: path integrals + :srcset: /examples/path-integrals/images/sphx_glr_path-integrals_002.png + :class: sphx-glr-single-img + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 186-191 + +You can also visualize the (very short) trajectory in a way that highlights the +fast spreading out of the beads of the ring polymer. ``chemiscope`` provides a +utility function to interleave the trajectories of the beads, forming a trajectory +that shows the connecttions between the replicas of each atom. Each atom and its +connections are color-coded. + +.. GENERATED FROM PYTHON SOURCE LINES 191-205 + +.. code-block:: Python + + + traj_pimd = chemiscope.ase_merge_pi_frames(traj_data) + # we also tweak the visualization options, and then show the viewer + traj_pimd["shapes"]["paths"]["parameters"]["global"]["radius"] = 0.05 + traj_pimd["settings"]["structure"][0].update( + dict( + atoms=False, + keepOrientation=True, + color={"property": "bead_id", "palette": "hsv (periodic)"}, + ) + ) + + chemiscope.show(**traj_pimd, mode="structure") + + + +.. chemiscope:: _datasets/fig_path-integrals_001.json.gz + :mode: structure + + + +.. raw:: html + +
+ +
+
+
+ +.. GENERATED FROM PYTHON SOURCE LINES 206-223 + +Accelerating PIMD with a PIGLET thermostat +------------------------------------------ + +The simulations in the previous sections are very far from converged -- typically +one would need approximately 32 replicas to converge a simulation of +room-temperature water. To address this problem we will use a method based on +generalized Langevin equations, called +`PIGLET `_ + +The input file is ``input_piglet.xml``, that only differs by the definition of +the thermostat, that uses a ``nm_gle`` mode in which each normal mode +of the ring polymer is attached to a different colored-noise Generalized Langevin +equation. This makes it possible to converge exactly the simulation results with +a small number of replicas, and to accelerate greatly convergence for realistic +systems such as this. The thermostat parameters can be generated on +`the GLE4MD website `_ + + +.. GENERATED FROM PYTHON SOURCE LINES 223-232 + +.. code-block:: Python + + + ipi_process = subprocess.Popen(["i-pi", "data/input_piglet.xml"]) + time.sleep(2) # wait for i-PI to start + lmp_process = [subprocess.Popen(["lmp", "-in", "data/in.lmp"]) for i in range(2)] + + ipi_process.wait() + lmp_process[0].wait() + lmp_process[1].wait() + + + + + +.. rst-class:: sphx-glr-script-out + + .. code-block:: none + + + 1 + + + +.. GENERATED FROM PYTHON SOURCE LINES 233-236 + +The mean potential energy from the PIGLET trajectory is higher than that for the +PIMD one, because it is closer to the converged value (try to run a PIMD trajectory +with 64 beads for comparison) + +.. GENERATED FROM PYTHON SOURCE LINES 236-259 + +.. code-block:: Python + + + # drops first frame + output_gle, desc_gle = ipi.read_output("simulation_piglet.out") + traj_gle = [ipi.read_trajectory(f"simulation_piglet.pos_{i}.xyz")[1:] for i in range(8)] + + fig, ax = plt.subplots(1, 1, figsize=(4, 3), constrained_layout=True) + ax.plot( + output_data["time"], + output_data["potential"] - output_data["potential"][0], + "b--", + label="PIMD", + ) + ax.plot( + output_gle["time"], + output_gle["potential"] - output_gle["potential"][0], + "b-", + label="PIGLET", + ) + ax.set_xlabel(r"$t$ / ps") + ax.set_ylabel(r"energy / eV") + ax.legend() + plt.show() + + + + +.. image-sg:: /examples/path-integrals/images/sphx_glr_path-integrals_003.png + :alt: path integrals + :srcset: /examples/path-integrals/images/sphx_glr_path-integrals_003.png + :class: sphx-glr-single-img + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 260-267 + +However, you should be somewhat careful: PIGLET converges *some* but not all the +correlations within a path. For instance, it is designed to converge the +centroid-virial estimator for the kinetic energy, but not the thermodynamic +estimator. For the same reason, don't try to look at equilibration in terms of +the mean temperature: it won't match the target value, because PIGLET uses a +Langevin equation that breaks the classical fluctuation-dissipation theorem, and +generates a steady-state distribution that mimics quantum fluctuations. + +.. GENERATED FROM PYTHON SOURCE LINES 267-278 + +.. code-block:: Python + + + fix, ax = plt.subplots(1, 1, figsize=(4, 3), constrained_layout=True) + ax.plot(output_data["time"], output_data["kinetic_cv"], "b--", label="PIMD, $K_{CV}$") + ax.plot(output_gle["time"], output_gle["kinetic_cv"], "b", label="PIGLET, $K_{CV}$") + ax.plot(output_data["time"], output_data["kinetic_td"], "r--", label="PIMD, $K_{TD}$") + ax.plot(output_gle["time"], output_gle["kinetic_td"], "r", label="PIGLET, $K_{TD}$") + ax.set_xlabel(r"$t$ / ps") + ax.set_ylabel(r"energy / eV") + ax.legend() + plt.show() + + + + +.. image-sg:: /examples/path-integrals/images/sphx_glr_path-integrals_004.png + :alt: path integrals + :srcset: /examples/path-integrals/images/sphx_glr_path-integrals_004.png + :class: sphx-glr-single-img + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 279-292 + +Kinetic energy tensors +~~~~~~~~~~~~~~~~~~~~~~ + +While we're at it, let's do something more complicated (and instructive). +Classically, the momentum distribution of any atom is isotropic, so the +kinetic energy tensor (KET) :math:`\mathbf{p}\mathbf{p}^T/2m` is a constant +times the identity matrix. Quantum mechanically, the kinetic energy tensor +has more structure, that reflects the higher kinetic energy of particles +along directions with stiff bonds. We can compute a moving average of the +centroid virial estimator of the KET, and plot it to show the direction +of anisotropy. Note that there are some subtleties connected with the +evaluation of the moving average, see e.g. +`DOI:10.1103/PhysRevLett.109.100604 `_ + +.. GENERATED FROM PYTHON SOURCE LINES 294-298 + +We first need to postprocess the components of the kinetic energy tensors +(that i-PI prints out separating the diagonal and off-diagonal bits), averaging +them over the last 10 frames and combining them with the centroid configuration +from the last frame in the trajectory. + +.. GENERATED FROM PYTHON SOURCE LINES 298-312 + +.. code-block:: Python + + + kinetic_cv = ipi.read_trajectory("simulation_piglet.kin.xyz")[1:] + kinetic_od = ipi.read_trajectory("simulation_piglet.kod.xyz")[1:] + kinetic_tens = np.hstack( + [ + np.asarray([k.positions for k in kinetic_cv[-10:]]).mean(axis=0), + np.asarray([k.positions for k in kinetic_od[-10:]]).mean(axis=0), + ] + ) + + centroid = traj_gle[-1][-1].copy() + centroid.positions = np.asarray([t[-1].positions for t in traj_gle]).mean(axis=0) + centroid.arrays["kinetic_cv"] = kinetic_tens + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 313-317 + +We can then view these in ``chemiscope``, setting the proper parameters to +visualize the ellipsoids associated with the KET. Note that some KETs have +negative eigenvalues, because we are averaging over a few frames, which is +insufficient to converge the estimator fully. + +.. GENERATED FROM PYTHON SOURCE LINES 317-333 + +.. code-block:: Python + + + ellipsoids = chemiscope.ase_tensors_to_ellipsoids( + [centroid], "kinetic_cv", scale=15, force_positive=True + ) + + chemiscope.show( + [centroid], + shapes={"kinetic_cv": ellipsoids}, + mode="structure", + settings=chemiscope.quick_settings( + structure_settings={ + "shape": ["kinetic_cv"], + "unitCell": True, + } + ), + ) + + +.. chemiscope:: _datasets/fig_path-integrals_002.json.gz + :mode: structure + + + +.. raw:: html + +
+ +
+
+
+ + +.. rst-class:: sphx-glr-timing + + **Total running time of the script:** (0 minutes 15.997 seconds) + + +.. _sphx_glr_download_examples_path-integrals_path-integrals.py: + +.. only:: html + + .. container:: sphx-glr-footer sphx-glr-footer-example + + + .. container:: sphx-glr-download + + :download:`Download Conda environment file: environment.yml ` + + .. container:: sphx-glr-download + + :download:`Download data files: data.zip ` + .. container:: sphx-glr-download sphx-glr-download-jupyter + + :download:`Download Jupyter notebook: path-integrals.ipynb ` + + .. container:: sphx-glr-download sphx-glr-download-python + + :download:`Download Python source code: path-integrals.py ` + + .. container:: sphx-glr-download sphx-glr-download-zip + + :download:`Download zipped: path-integrals.zip ` + + +.. only:: html + + .. rst-class:: sphx-glr-signature + + `Gallery generated by Sphinx-Gallery `_ + diff --git a/_sources/examples/periodic-hamiltonian/periodic-hamiltonian.rst.txt b/_sources/examples/periodic-hamiltonian/periodic-hamiltonian.rst.txt new file mode 100644 index 00000000..954dc16e --- /dev/null +++ b/_sources/examples/periodic-hamiltonian/periodic-hamiltonian.rst.txt @@ -0,0 +1,83990 @@ + +.. DO NOT EDIT. +.. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. +.. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: +.. "examples/periodic-hamiltonian/periodic-hamiltonian.py" +.. LINE NUMBERS ARE GIVEN BELOW. + +.. only:: html + + .. note:: + :class: sphx-glr-download-link-note + + :ref:`Go to the end ` + to download the full example code. + +.. rst-class:: sphx-glr-example-title + +.. _sphx_glr_examples_periodic-hamiltonian_periodic-hamiltonian.py: + + +Periodic Hamiltonian learning +============================= + +:Authors: Paolo Pegolo `@ppegolo `__, + Jigyasa Nigam `@curiosity54 `__ + +This tutorial explains how to train a machine learning model for the +electronic Hamiltonian of a periodic system. Even though we focus on +periodic systems, the code and techniques presented here can be directly +transferred to molecules. + +.. GENERATED FROM PYTHON SOURCE LINES 15-17 + +First, import the necessary packages + + +.. GENERATED FROM PYTHON SOURCE LINES 17-42 + +.. code-block:: Python + + + import os + import warnings + import zipfile + + import matplotlib.image as mpimg + import matplotlib.pyplot as plt + import numpy as np + import requests + import torch + from matplotlib.animation import FuncAnimation + from mlelec.data.derived_properties import compute_eigenvalues + from mlelec.data.mldataset import MLDataset + from mlelec.data.qmdataset import QMDataset + from mlelec.models.equivariant_lightning import LitEquivariantModel, MSELoss + from mlelec.utils.pbc_utils import blocks_to_matrix + from mlelec.utils.plot_utils import plot_bands_frame + + + warnings.filterwarnings("ignore") + torch.set_default_dtype(torch.float64) + + # sphinx_gallery_thumbnail_number = 3 + + + + + + +.. rst-class:: sphx-glr-script-out + + .. code-block:: none + + /home/runner/work/atomistic-cookbook/atomistic-cookbook/.nox/periodic-hamiltonian/lib/python3.11/site-packages/pyscf/dft/libxc.py:772: UserWarning: Since PySCF-2.3, B3LYP (and B3P86) are changed to the VWN-RPA variant, the same to the B3LYP functional in Gaussian and ORCA (issue 1480). To restore the VWN5 definition, you can put the setting "B3LYP_WITH_VWN5 = True" in pyscf_conf.py + warnings.warn('Since PySCF-2.3, B3LYP (and B3P86) are changed to the VWN-RPA variant, ' + + + + +.. GENERATED FROM PYTHON SOURCE LINES 43-46 + +Get Data and Prepare Data Set +----------------------------- + + +.. GENERATED FROM PYTHON SOURCE LINES 49-57 + +The data set contains 35 distorted graphene unit cells containing 2 +atoms. The reference density functional theory (DFT) calculations are +performed with `CP2K `__ using a minimal +`STO-3G `__ basis and +the `PBE `__ functional. +The Kohn-Sham equations are solved on a Monkhorst-Pack grid of +:math:`15\times 15\times 1` points in the Brillouin zone of the crystal. + + +.. GENERATED FROM PYTHON SOURCE LINES 60-68 + +Obtain structures and DFT data +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Generating training structures requires running a suitable DFT code, +and converting the output data in a format that can be processed by +the ML library ``mlelec``. Given that it takes some time to run even +these small calculations, we provide pre-computed data, but you can +also find instructions on how to generate data from scratch. + +.. GENERATED FROM PYTHON SOURCE LINES 70-83 + +Run your own cp2k calculations +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +If you have computational resources, you can run the DFT calculations +needed to produce the data set. `This other +tutorial `__ in the atomistic cookbook can +help you set up the CP2K calculations for this data set, using the +``reftraj_hamiltonian.cp2k`` file provided in ``data/``. To do the same +for another data set, adapt the reftraj file. +We will provide here some of the functions in the `batch-cp2k +tutorial `__ that need to be adapted to the +current data set. Note however you will have to modify these and combine +them with other tutorials to actually generate the data. + +.. GENERATED FROM PYTHON SOURCE LINES 86-93 + +Start by importing all the modules from the `batch-cp2k +tutorial `__ and run the cell to install +CP2K. Run also the cells up to the one defining ``write_cp2k_in``. +The following code snippet defines a slighly modified version of that function, +allowing for non-orthorombic supercell, and accounting for the reftraj file +name change. + + +.. GENERATED FROM PYTHON SOURCE LINES 95-122 + +.. code:: python + + def write_cp2k_in( + fname: str, + project_name: str, + last_snapshot: int, + cell_a: List[float], + cell_b: List[float], + cell_c: List[float], + ) -> None: + """Writes a cp2k input file from a template. + + Importantly, it writes the location of the basis set definitions, + determined from the path of the system CP2K install to the input file. + """ + + cp2k_in = open("reftraj_hamiltonian.cp2k", "r").read() + + cp2k_in = cp2k_in.replace("//PROJECT//", project_name) + cp2k_in = cp2k_in.replace("//LAST_SNAPSHOT//", str(last_snapshot)) + cp2k_in = cp2k_in.replace("//CELL_A//", " ".join([f"{c:.6f}" for c in cell_a])) + cp2k_in = cp2k_in.replace("//CELL_B//", " ".join([f"{c:.6f}" for c in cell_b])) + cp2k_in = cp2k_in.replace("//CELL_C//", " ".join([f"{c:.6f}" for c in cell_c])) + + with open(fname, "w") as f: + f.write(cp2k_in) + + +.. GENERATED FROM PYTHON SOURCE LINES 125-129 + +Unlike the `batch-cp2k tutorial `__, the +current data set includes a single stoichiometry, :math:`\mathrm{C_2}`. +Therefore, you can run this cell to set the calculation scripts up. + + +.. GENERATED FROM PYTHON SOURCE LINES 131-152 + +.. code:: python + + project_name = 'graphene' + frames = ase_read('C2.xyz', index=':') + os.makedirs(project_name, exist_ok=True) + os.makedirs(f"{project_name}/FOCK", exist_ok=True) + os.makedirs(f"{project_name}/OVER", exist_ok=True) + + write_cp2k_in( + f"{project_name}/in.cp2k", + project_name=project_name, + last_snapshot=len(frames), + cell_a=frames[0].cell.array[0], + cell_b=frames[0].cell.array[1], + cell_c=frames[0].cell.array[2], + ) + + ase_write(f"{project_name}/init.xyz", frames[0]) + write_reftraj(f"{project_name}/reftraj.xyz", frames) + write_cellfile(f"{project_name}/reftraj.cell", frames) + + +.. GENERATED FROM PYTHON SOURCE LINES 155-157 + +The CP2K calculations can be simply run using: + + +.. GENERATED FROM PYTHON SOURCE LINES 160-168 + +.. code:: python + + subprocess.run(( + f"cp2k.ssmp -i {project_name}/in.cp2k " + "> {project_name}/out.cp2k" + ), + shell=True) + + +.. GENERATED FROM PYTHON SOURCE LINES 171-173 + +Once the calculations are done, we can parse the results with: + + +.. GENERATED FROM PYTHON SOURCE LINES 176-238 + +.. code:: python + + from scipy.sparse import csr_matrix + + nao = 10 + ifr = 1 + fock = [] + over = [] + with open(f"{project_name}/out.cp2k", "r") as outfile: + T_lists = [] # List to hold all T_list instances + while True: + line = outfile.readline() + if not line: + break + if line.strip().split()[:3] != ["KS", "CSR", "write|"]: + continue + else: + nT = int(line.strip().split()[3]) + outfile.readline() # Skip the next line if necessary + T_list = [] # Initialize a new T_list for this block + for _ in range(nT): + line = outfile.readline() + if not line: + break + T_list.append([np.int32(j) for j in line.strip().split()[1:4]]) + T_list = np.array(T_list) + T_lists.append(T_list) # Append the T_list to T_lists + fock_ = {} + over_ = {} + for iT, T in enumerate( + T_list + ): # Loop through the translations and load matrices + T = T.tolist() + r, c, data = np.loadtxt( + ( + f"{project_name}/FOCK/{project_name}" + f"-KS_SPIN_1_R_{iT+1}-1_{ifr}.csr" + ), + unpack=True, + ) + r = np.int32(r - 1) + c = np.int32(c - 1) + fock_[tuple(T)] = csr_matrix( + (data, (r, c)), shape=(nao, nao) + ).toarray() + + r, c, data = np.loadtxt( + ( + f"{project_name}/OVER/{project_name}" + f"-S_SPIN_1_R_{iT+1}-1_{ifr}.csr" + ), + unpack=True, + ) + r = np.int32(r - 1) + c = np.int32(c - 1) + over_[tuple(T)] = csr_matrix( + (data, (r, c)), shape=(nao, nao) + ).toarray() + fock.append(fock_) + over.append(over_) + ifr += 1 + + +.. GENERATED FROM PYTHON SOURCE LINES 241-244 + +You can now save the matrices to ``.npy`` files, and a file with the +k-grids used in the calculations. + + +.. GENERATED FROM PYTHON SOURCE LINES 247-257 + +.. code:: python + + os.makedirs("data", exist_ok=True) + # Save the Hamiltonians + np.save("data/graphene_fock.npy", fock) + # Save the overlaps + np.save("data/graphene_ovlp.npy", over) + # Write a file with the k-grids, one line per structure + np.savetxt('data/kmesh.dat', [[15,15,1]]*len(frames), fmt='%d') + + +.. GENERATED FROM PYTHON SOURCE LINES 260-263 + +Download precomputed data +^^^^^^^^^^^^^^^^^^^^^^^^^ + + +.. GENERATED FROM PYTHON SOURCE LINES 266-269 + +For the sake of simplicity, you can also download precomputed data and +run just the machine learning part of the notebook using these data. + + +.. GENERATED FROM PYTHON SOURCE LINES 269-285 + +.. code-block:: Python + + + filename = "precomputed.zip" + if not os.path.exists(filename): + url = ( + "https://github.com/curiosity54/mlelec/raw/" + "tutorial_periodic/examples/periodic_tutorial/precomputed.zip" + ) + response = requests.get(url) + response.raise_for_status() + with open(filename, "wb") as f: + f.write(response.content) + + with zipfile.ZipFile(filename, "r") as zip_ref: + zip_ref.extractall("./") + + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 286-301 + +Periodic Hamiltonians in real and reciprocal space +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +The DFT calculations for the dataset above were performed using a +*minimal* STO-3G basis. The basis set is specified for each species +using three quantum numbers, :math:`n`, :math:`l`, :math:`m`. :math:`n` +is usually a natural number relating to the *radial* extent or +resolution whereas :math:`l` and :math:`m` specify the *angular +components* determining the shape of the orbital and its orientation in +space. For example, :math:`1s` orbitals correspond to :math:`n=1`, +:math:`l=0` and :math:`m=0`, while a :math:`2p_z` orbital corresponds to +:math:`n=2`, :math:`l=1` and :math:`m=0`. For the STO-3G basis-set, +these quantum numbers for Carbon (identified by its atomic number) are +given as follows. + + +.. GENERATED FROM PYTHON SOURCE LINES 301-308 + +.. code-block:: Python + + + basis = "sto-3g" + orbitals = { + "sto-3g": {6: [[1, 0, 0], [2, 0, 0], [2, 1, -1], [2, 1, 0], [2, 1, 1]]}, + } + + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 309-326 + +For each *frame* which of either train and test structures, the QM data +comprises the configuration, along with the corresponding *overlap* and +*Hamiltonian* (used interchangeably with *Fock*) matrices in the basis +specified above, as well as the :math:`k`-point grid that was used for the +calculation. + +Note that we are currently specifying these matrices in *real-space*, +:math:`\mathbf{H}(\mathbf{t})` , such that the element +:math:`\langle \mathbf{0} i nlm| \hat{H}| \mathbf{t} i' n'l'm'\rangle` +indicates the interaction between orbital :math:`nlm` on atom :math:`i` +in the undisplaced cell (denoted by the null lattice translation, +:math:`\mathbf{t}=\mathbf{0}`) and orbital :math:`n'l'm'` on atom +:math:`i'` in a periodic copy of the unit cell translated by +:math:`\mathbf{t}`. A short-hand notation for +:math:`\langle \mathbf{0} i nlm| \hat{H}| \mathbf{t} i' n'l'm'\rangle` +is :math:`H_{\small\substack{i,nlm\\i',n'l'm'}}(\mathbf{t})` + + +.. GENERATED FROM PYTHON SOURCE LINES 328-342 + +.. figure:: graphene_lattice.png + :alt: Representation of a graphene unit cell and some replicas. + :width: 600px + + Representation of a graphene unit cell and its + :math:`3 \times 3 \times 1` replicas in real space. The central cell + is denoted by :math:`\mathbf{t}=(0,0,0)`, while the cells translated + by a single lattice vector along directions 1 and 2 are denoted by + :math:`\mathbf{t}=(1,0,0)` and :math:`\mathbf{t}=(0,1,0)`, + respectively. The Hamiltonian matrix element between the :math:`1s` + orbital on atom :math:`i` in the central unit cell and the + :math:`2p_z` orbital on atom :math:`i'` in the + :math:`\mathbf{t}=(1,0,0)` cell is schematically represented. + + +.. GENERATED FROM PYTHON SOURCE LINES 345-358 + +Alternatively, we can provide the matrices in *reciprocal* (or +Fourier, :math:`k`) space. These are related to the real-space matrices +by a *Bloch sum*, + +.. math:: + + \mathbf{H}(\mathbf{k})=\sum_{\mathbf{t}}\ + e^{i\mathbf{k}\cdot\mathbf{t}} \mathbf{H}(\mathbf{t}). + + +In the case the input matrices are in reciprocal space, there should be +one matrix per :math:`k`-point in the grid. + + +.. GENERATED FROM PYTHON SOURCE LINES 360-366 + +A ``QMDataset`` to store the DFT data +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +The ``QMDataset`` class holds all the relevant data +obtained from a quantum-mechanical (in this case, DFT) calculation, +combining information from the files containing structures, +Hamiltonians and overlap matrices, and :math:`k`-point mesh. + +.. GENERATED FROM PYTHON SOURCE LINES 366-388 + +.. code-block:: Python + + + qmdata = QMDataset.from_file( + # File containing the atomistic structures + frames_path="data/C2.xyz", + # File containing the Hamiltonian (of Fock) matrices + fock_realspace_path="graphene_fock.npy", + # File containing the overlap matrices + overlap_realspace_path="graphene_ovlp.npy", + # File containing the k-point grids used for the DFT calculations + kmesh_path="kmesh.dat", + # Physical dimensionality of the system. Graphene is a 2D material + dimension=2, + # Device where to run the calculations + # (can be 'cpu' or 'cuda', if GPUs are available) + device="cpu", + # Name of the basis set used for the calculations + orbs_name=basis, + # List of quantum numbers associated with the basis set orbitals + orbs=orbitals[basis], + ) + + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 389-394 + +Quantities stored in ``QMDataset`` can be accessed as attributes, +e.g. ``qmdata.fock_realspace`` is a list (one element per structure) of +dictionaries labeled by the indices of the unit cell real-space +translations containing ``torch.Tensor``. + + +.. GENERATED FROM PYTHON SOURCE LINES 394-402 + +.. code-block:: Python + + + structure_idx = 0 + realspace_translation = 0, 0, 0 + print(f"The real-space Hamiltonian matrix for structure {structure_idx} labeled by") + print(f"translation T={realspace_translation} is:") + print(f"{qmdata.fock_realspace[structure_idx][realspace_translation]}") + + + + + + +.. rst-class:: sphx-glr-script-out + + .. code-block:: none + + The real-space Hamiltonian matrix for structure 0 labeled by + translation T=(0, 0, 0) is: + tensor([[-9.7210e+00, -2.6676e+00, 2.9317e-04, 3.2255e-04, 5.7009e-04, + -8.1646e-05, -4.6611e-01, -3.6897e-01, -1.2792e-02, 6.7660e-01], + [-2.6676e+00, -1.3880e+00, 3.2649e-03, 7.2985e-03, 1.0359e-02, + -4.6611e-01, -5.9615e-01, -2.5023e-01, -8.9866e-03, 4.5874e-01], + [ 2.9317e-04, 3.2649e-03, -4.2835e-01, -9.5326e-05, -1.2642e-02, + 3.6897e-01, 2.5023e-01, -1.0482e-01, 3.3322e-03, -1.6016e-01], + [ 3.2255e-04, 7.2985e-03, -9.5326e-05, -1.4549e-01, -2.8526e-04, + 1.2792e-02, 8.9865e-03, 3.3322e-03, -1.4956e-01, -6.0943e-03], + [ 5.7009e-04, 1.0359e-02, -1.2642e-02, -2.8526e-04, -4.4633e-01, + -6.7660e-01, -4.5874e-01, -1.6016e-01, -6.0944e-03, 1.0121e-01], + [-8.1646e-05, -4.6611e-01, 3.6897e-01, 1.2792e-02, -6.7660e-01, + -9.7210e+00, -2.6676e+00, -2.9113e-04, -3.2414e-04, -5.7176e-04], + [-4.6611e-01, -5.9615e-01, 2.5023e-01, 8.9865e-03, -4.5874e-01, + -2.6676e+00, -1.3880e+00, -3.2673e-03, -7.2983e-03, -1.0360e-02], + [-3.6897e-01, -2.5023e-01, -1.0482e-01, 3.3322e-03, -1.6016e-01, + -2.9113e-04, -3.2673e-03, -4.2835e-01, -9.5331e-05, -1.2644e-02], + [-1.2792e-02, -8.9866e-03, 3.3322e-03, -1.4956e-01, -6.0944e-03, + -3.2414e-04, -7.2983e-03, -9.5331e-05, -1.4549e-01, -2.8525e-04], + [ 6.7660e-01, 4.5874e-01, -1.6016e-01, -6.0943e-03, 1.0121e-01, + -5.7176e-04, -1.0360e-02, -1.2644e-02, -2.8525e-04, -4.4633e-01]]) + + + + +.. GENERATED FROM PYTHON SOURCE LINES 403-406 + +Machine learning data set +~~~~~~~~~~~~~~~~~~~~~~~~~ + + +.. GENERATED FROM PYTHON SOURCE LINES 409-412 + +Symmetries of the Hamiltonian matrix +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + +.. GENERATED FROM PYTHON SOURCE LINES 415-450 + +The data stored in ``QMDataset`` can be transformed into a format that +is optimal for machine learning modeling by leveraging the underlying +*physical symmetries* that characterize the atomistic structure, the +basis set, and their associated matrices. + +The Hamiltonian matrix is a complex learning target, indexed by two +atoms and the orbitals centered on them. Each +:math:`\mathbf{H}(\mathbf{k})` is a *Hermitian* matrix, while in real +space, periodicity introduces a *symmetry over translation pairs* such +that :math:`\mathbf{H}(-\mathbf{t}) = \mathbf{H}(\mathbf{t})^\dagger`, +where the dagger, :math:`\dagger`, denotes Hermitian conjugation. + +To address the symmetries associated with swapping atomic indices or +orbital labels, we divide the matrix into *blocks labeled by pairs of +atom types*. + +- ``block_type = 0``, or *on-site* blocks, consist of elements + corresponding to the interaction of orbitals on the same atom, + :math:`i = i'`. + +- ``block_type = 2``, or *cross-species* blocks, consist of elements + corresponding to orbitals centered on atoms of distinct species. + Since the two atoms can be distinguished, they can be consistently + arranged in a predetermined order. + +- ``block_type = 1, -1``, or *same-species* blocks, consist of + elements corresponding to orbitals centered on distinct atoms of the + same species. As these atoms are indistinguishable and cannot be + ordered definitively, the pair must be symmetrized for permutations. + We construct symmetric and antisymmetric combinations + :math:`(\mathbf{H}_{\small\substack{i,nlm\\i',n'l'm'}}(\mathbf{t})\pm\ + \mathbf{H}_{\small\substack{i',nlm\\i,n'l'm'}}(\mathbf{-t}))` + that correspond to ``block_type`` :math:`+1` and :math:`-1`, + respectively. + + +.. GENERATED FROM PYTHON SOURCE LINES 453-456 + +Equivariant structure of the Hamiltonians +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + +.. GENERATED FROM PYTHON SOURCE LINES 459-507 + +Even though the Hamiltonian operator under consideration is invariant, +*its representation transforms under the action of structural rotations +and inversions* due to the choice of the basis functions. Each of the +blocks has elements of the form +:math:`\langle\mathbf{0}inlm|\hat{H}|\mathbf{t}i'n'l'm'\rangle`, which +are in an *uncoupled* representation and transform as a product of +(real) spherical harmonics, :math:`Y_l^m \otimes Y_{l'}^{m'}`. + +This product can be decomposed into a direct sum of irreducible +representations (irreps) of :math:`\mathrm{SO(3)}`, + +.. math:: \lambda \mu:\lambda \in [|l_1-l_2|,l_1+l_2],\mu \in [-\lambda,\lambda], + +which express the Hamiltonian blocks in terms of contributions that +rotate independently and can be modeled using a feature that +geometrically describes the pair of atoms under consideration and shares +the same symmetry. We use the notation +:math:`H_{ii';nn'll'}^{\lambda\mu}` to indicate the elements of the +Hamiltonian in this coupled basis. + +The resulting irreps form a *coupled* representation, each of which +transforms as a spherical harmonic :math:`Y^\mu_\lambda` under +:math:`\mathrm{SO(3)}` rotations, but may exhibit more complex behavior +under inversions. For example, spherical harmonics transform under +inversion, :math:`\hat{i}`, as polar tensors: + +.. math:: \hat{i}Y^\mu_\lambda = (-1)^\lambda Y^\mu_\lambda. + +Some of the coupled basis terms transform like :math:`Y^\mu_\lambda`, +while others instead transform as pseudotensors, + +.. math:: \hat{i}H^{\lambda\mu}=(-1)^{\lambda+1}H^{\lambda\mu} + +where we omit for simplicity the indices that are not directly associated +with inversion and rotation symmetry. For more details about the block +decomposition, please refer to `Nigam et al., J. Chem. Phys. 156, 014115 +(2022) `__. + +The following is an animation of a trajectory along a `Lissajous +curve `__ in 3D space, +alongside a colormap representing the values of the real-space +Hamiltonian matrix elements of the graphene unit cell in a minimal +STO-3G basis. From the animation, it is evident how invariant elements, +such as those associated with interactions between :math:`s` orbitals, +do not change under structural rotations. On the other hand, +interactions allowing for equivariant components, such as the +:math:`s`-:math:`p` block, change under rotations. + + +.. GENERATED FROM PYTHON SOURCE LINES 507-529 + +.. code-block:: Python + + + image_files = sorted( + [ + f"frames/{f}" + for f in os.listdir("./frames") + if f.startswith("rot_") and f.endswith(".png") + ] + ) + images = [mpimg.imread(img) for img in image_files] + fig, ax = plt.subplots() + img_display = ax.imshow(images[0]) + ax.axis("off") + + + def update(frame): + img_display.set_data(images[frame]) + return [img_display] + + + ani = FuncAnimation(fig, update, frames=len(images), interval=20, blit=True) + + + + + +.. container:: sphx-glr-animation + + .. raw:: html + + + + + + + +
+ +
+ +
+ + + + + + + + + +
+
+ + + + + + +
+
+
+ + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 530-535 + +.. code:: python + + from IPython.display import HTML + HTML(ani.to_jshtml()) + + +.. GENERATED FROM PYTHON SOURCE LINES 538-541 + +Mapping geometric features to Hamiltonian targets +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + +.. GENERATED FROM PYTHON SOURCE LINES 544-567 + +Each Hamiltonian block obtained from the procedure `described +above <#symmetries-of-the-hamiltonian-matrix>`__ can be modeled using +symmetrized features. + +Elements of ``block_type=0`` are indexed by a single atom and are best +described by a symmetrized atom-centered density correlation +(`ACDC `__), denoted by +:math:`|\overline{\rho_{i}^{\otimes \nu}; \sigma; \lambda\mu }\rangle`, +where :math:`\nu` refers to the correlation (body)-order, and—just as +for the blocks—:math:`\lambda \mu` indicate the :math:`\mathrm{SO(3)}` +irrep to which the feature is symmetrized. The symbol :math:`\sigma` +denotes the inversion parity. + +For other blocks, such as ``block_type=2``, which explicitly reference +two atoms, we use `two-center `__ +ACDCs, :math:`|\overline{\rho_{ii'}^{\otimes \nu}; \lambda\mu }\rangle`. + +For ``block_type=1, -1``, we ensure equivariance with respect to atom +index permutation by constructing symmetric and antisymmetric pair +features: +:math:`(|\overline{\rho_{ii'}^{\otimes \nu};\lambda\mu }\rangle\pm\ +|\overline{\rho_{i'i}^{\otimes \nu};\lambda\mu }\rangle)`. + + +.. GENERATED FROM PYTHON SOURCE LINES 570-589 + +The features are discretized on a basis of radial functions and +spherical harmonics, and their performance may depend on the +*resolution* of the functions included in the model. There are +additional hyperparameters, such as the *cutoff* radius, which +controls the extent of the atomic environment, and Gaussian widths. In +the following, we allow for flexibility in discretizing the +atom-centered and two-centered ACDCs by defining the hyperparameters for +the single-center (SC) :math:`\lambda`-SOAP and two-center (TC) ACDC +descriptors. + +The single and two-center descriptors have very similar hyperparameters, +except for the cutoff radius, which is larger for the two-center +descriptors to explicitly include distant pairs of atoms. + +Note that the descriptors of pairs of atoms separated by distances +greater than the cutoff radius are identically zero. Thus, any model +based on these descriptors would predict an identically zero value for +these pairs. + + +.. GENERATED FROM PYTHON SOURCE LINES 589-611 + +.. code-block:: Python + + + SC_HYPERS = { + "cutoff": 3.0, + "max_radial": 6, + "max_angular": 6, + "atomic_gaussian_width": 0.5, + "center_atom_weight": 1, + "radial_basis": {"Gto": {}}, + "cutoff_function": {"ShiftedCosine": {"width": 0.5}}, + } + + TC_HYPERS = { + "cutoff": 6.0, + "max_radial": 6, + "max_angular": 6, + "atomic_gaussian_width": 0.3, + "center_atom_weight": 1.0, + "radial_basis": {"Gto": {}}, + "cutoff_function": {"ShiftedCosine": {"width": 0.5}}, + } + + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 612-621 + +We then use the above defined hyperparameters to compute the descriptor +and initialize a ``MLDataset`` instance, which contains, among other +things, the Hamiltonian block decomposition and the geometric features +described above. + +In addition to computing the descriptors, ``MLDataset`` takes the data +stored in the ``QMDataset`` instance and puts it in a form required to +train a ML model. + + +.. GENERATED FROM PYTHON SOURCE LINES 624-634 + +The ``item_names`` argument is a list of names of the quantities we want +to compute and target in the ML model training, or that we want to be +able to access later. + +For example, ``fock_blocks`` is a +`metatensor.Tensormap `__ containing the +Hamiltonian coupled blocks. We also want to access the overlap matrices +in :math:`k`-space (``overlap_kspace``) to be able to compute the +Hamiltonian eigenvalues in the :math:`k`-grid. + + +.. GENERATED FROM PYTHON SOURCE LINES 634-658 + +.. code-block:: Python + + + + mldata = MLDataset( + # A QMDataset instance + qmdata, + # The names of the quantities to compute/initialize for the training + item_names=["fock_blocks", "overlap_kspace"], + # Hypers for the SC descriptors + hypers_atom=SC_HYPERS, + # Hypers for the TC descriptors + hypers_pair=TC_HYPERS, + # Cutoff for the angular quantum number to use in the Clebsh-Gordan iterations + lcut=4, + # Fraction of structures in the training set + train_frac=0.7, + # Fraction of structures in the validation set + val_frac=0.2, + # Fraction of structures in the test set + test_frac=0.1, + # Whether to shuffle or not the structure indices before splitting the data set + shuffle=True, + ) + + + + + + +.. rst-class:: sphx-glr-script-out + + .. code-block:: none + + cpu pair features + cpu single center features + cpu single center features + + + + +.. GENERATED FROM PYTHON SOURCE LINES 659-662 + +The matrix decomposition into blocks and the calculations of geometric +features is performed by the ``MLDataset`` class. + + +.. GENERATED FROM PYTHON SOURCE LINES 665-668 + +``mldata.features`` is ``metatensor.TensorMap`` containing the +stuctures’ descriptors + + +.. GENERATED FROM PYTHON SOURCE LINES 668-672 + +.. code-block:: Python + + + mldata.features + + + + + + +.. rst-class:: sphx-glr-script-out + + .. code-block:: none + + + TensorMap with 27 blocks + keys: order_nu inversion_sigma spherical_harmonics_l species_center species_neighbor block_type + 2 -1 1 6 6 -1 + 2 -1 1 6 6 0 + 2 -1 1 6 6 1 + 2 -1 2 6 6 -1 + 2 -1 2 6 6 0 + 2 -1 2 6 6 1 + 2 -1 3 6 6 -1 + 2 -1 3 6 6 0 + 2 -1 3 6 6 1 + 2 -1 4 6 6 -1 + 2 -1 4 6 6 0 + 2 -1 4 6 6 1 + 2 1 0 6 6 -1 + 2 1 0 6 6 0 + 2 1 0 6 6 1 + 2 1 1 6 6 -1 + 2 1 1 6 6 0 + 2 1 1 6 6 1 + 2 1 2 6 6 -1 + 2 1 2 6 6 0 + 2 1 2 6 6 1 + 2 1 3 6 6 -1 + 2 1 3 6 6 0 + 2 1 3 6 6 1 + 2 1 4 6 6 -1 + 2 1 4 6 6 0 + 2 1 4 6 6 1 + + + +.. GENERATED FROM PYTHON SOURCE LINES 673-676 + +``mldata.items`` is a ``namedtuple`` containing the quantities defined +in ``item_names``. e.g. the coupled Hamiltonian blocks: + + +.. GENERATED FROM PYTHON SOURCE LINES 676-681 + +.. code-block:: Python + + + print("The TensorMap containing the Hamiltonian coupled blocks is") + mldata.items.fock_blocks + + + + + + +.. rst-class:: sphx-glr-script-out + + .. code-block:: none + + The TensorMap containing the Hamiltonian coupled blocks is + + TensorMap with 9 blocks + keys: block_type species_i species_j L inversion_sigma + -1 6 6 0 1 + -1 6 6 1 -1 + -1 6 6 1 1 + 0 6 6 0 1 + 0 6 6 1 1 + 0 6 6 2 1 + 1 6 6 0 1 + 1 6 6 1 1 + 1 6 6 2 1 + + + +.. GENERATED FROM PYTHON SOURCE LINES 682-684 + +Or the overlap matrices: + + +.. GENERATED FROM PYTHON SOURCE LINES 684-691 + +.. code-block:: Python + + + structure_idx = 0 + k_idx = 0 + print(f"The overlap matrix for structure {structure_idx} at the {k_idx}-th k-point is") + mldata.items.overlap_kspace[structure_idx][k_idx] + + + + + + +.. rst-class:: sphx-glr-script-out + + .. code-block:: none + + The overlap matrix for structure 0 at the 0-th k-point is + + tensor([[ 1.0000e+00+0.j, 2.6471e-01+0.j, -8.6736e-19+0.j, -3.4717e-16+0.j, + 0.0000e+00+0.j, 8.4955e-06+0.j, 1.3441e-01+0.j, 8.8189e-04+0.j, + 3.7267e-03+0.j, 3.8015e-03+0.j], + [ 2.6471e-01+0.j, 1.4675e+00+0.j, 5.4607e-25+0.j, -2.2147e-16+0.j, + 2.6503e-23+0.j, 1.3441e-01+0.j, 1.3276e+00+0.j, -7.6212e-04+0.j, + 2.2394e-02+0.j, 4.7228e-03+0.j], + [ 8.6736e-19+0.j, -5.4607e-25+0.j, 6.5783e-01+0.j, 6.3610e-17+0.j, + 6.2688e-04+0.j, -8.8189e-04+0.j, 7.6212e-04+0.j, -2.4925e-01+0.j, + -2.1836e-05+0.j, -1.6848e-02+0.j], + [ 3.4717e-16+0.j, 2.2147e-16+0.j, 6.3610e-17+0.j, 1.2005e+00+0.j, + 3.4697e-17+0.j, -3.7267e-03+0.j, -2.2394e-02+0.j, -2.1836e-05+0.j, + 7.7122e-01+0.j, -2.4677e-04+0.j], + [ 0.0000e+00+0.j, -2.6503e-23+0.j, 6.2688e-04+0.j, 3.4697e-17+0.j, + 6.6397e-01+0.j, -3.8015e-03+0.j, -4.7228e-03+0.j, -1.6848e-02+0.j, + -2.4677e-04+0.j, -2.7830e-01+0.j], + [ 8.4955e-06+0.j, 1.3441e-01+0.j, -8.8189e-04+0.j, -3.7267e-03+0.j, + -3.8015e-03+0.j, 1.0000e+00+0.j, 2.6471e-01+0.j, 0.0000e+00+0.j, + 0.0000e+00+0.j, 0.0000e+00+0.j], + [ 1.3441e-01+0.j, 1.3276e+00+0.j, 7.6212e-04+0.j, -2.2394e-02+0.j, + -4.7228e-03+0.j, 2.6471e-01+0.j, 1.4675e+00+0.j, 5.4607e-25+0.j, + 0.0000e+00+0.j, 2.6501e-23+0.j], + [ 8.8189e-04+0.j, -7.6212e-04+0.j, -2.4925e-01+0.j, -2.1836e-05+0.j, + -1.6848e-02+0.j, 0.0000e+00+0.j, -5.4607e-25+0.j, 6.5783e-01+0.j, + 0.0000e+00+0.j, 6.2688e-04+0.j], + [ 3.7267e-03+0.j, 2.2394e-02+0.j, -2.1836e-05+0.j, 7.7122e-01+0.j, + -2.4677e-04+0.j, 0.0000e+00+0.j, 0.0000e+00+0.j, 0.0000e+00+0.j, + 1.2005e+00+0.j, 0.0000e+00+0.j], + [ 3.8015e-03+0.j, 4.7228e-03+0.j, -1.6848e-02+0.j, -2.4677e-04+0.j, + -2.7830e-01+0.j, 0.0000e+00+0.j, -2.6501e-23+0.j, 6.2688e-04+0.j, + 0.0000e+00+0.j, 6.6397e-01+0.j]]) + + + +.. GENERATED FROM PYTHON SOURCE LINES 692-695 + +A machine learning model for the electronic Hamiltonian of graphene +------------------------------------------------------------------- + + +.. GENERATED FROM PYTHON SOURCE LINES 698-726 + +Linear model +~~~~~~~~~~~~ + +In simple cases, such as the present one, it is convenient to start with +a linear model that directly maps the geometric descriptors to the +target coupled blocks. This can be achieved using `Ridge regression +`__ +as implemented in `scikit-learn `__. + +The linear regression model is expressed as + +.. math:: + + + H_{ii',\mathbf{Q}}^{\lambda\mu}(\mathbf{t}) = \ + \sum_\mathbf{q} w_{\mathbf{q}}^{\mathbf{Q},\lambda} \ + (\rho_{ii'}^{\otimes \nu}(\mathbf{t}))_{\mathbf{q}}^{\lambda\mu}, + +where a shorthand notation for the features has been introduced. Here, +:math:`\mathbf{Q}` includes all labels indicating the involved orbitals, +atomic species, and permutation symmetry, while :math:`\mathbf{q}` +represents the feature dimension. The quantities +:math:`w_{\mathbf{q}}^{\mathbf{Q},\lambda}` are the model’s weights. +Note that different weights are associated with different values of +:math:`\mathbf{Q}` and :math:`\lambda`, but not with specific atom pairs +or the translation vector, whose dependence arises only through the +descriptors. + + +.. GENERATED FROM PYTHON SOURCE LINES 729-735 + +In ``mlelec``, a linear model can be trained through the +``LitEquivariantModel`` class, which accepts an ``init_from_ridge`` +keyword. When set to ``True``, this initializes the weights of a more +general ``torch.nn.Module`` with the weights provided by Ridge +regression. + + +.. GENERATED FROM PYTHON SOURCE LINES 738-742 + +We will pass other keyword arguments to ``LitEquivariantModel``, to be +able to further train the weights on top to the initial Ridge +regression. + + +.. GENERATED FROM PYTHON SOURCE LINES 742-760 + +.. code-block:: Python + + + model = LitEquivariantModel( + mldata=mldata, # a MLDataset instance + nlayers=0, # The number of hidden layers + nhidden=1, # The number of neurons in each hidden layer + init_from_ridge=True, # If True, initialize the weights and biases of the + # purely linear model from Ridge regression + optimizer="LBFGS", # Type of optimizer. Adam is likely better for + # a more general neural network + activation="SiLU", # The nonlinear activation function + learning_rate=1e-3, # Initial learning rate (LR) + lr_scheduler_patience=10, + lr_scheduler_factor=0.7, + lr_scheduler_min_lr=1e-6, + loss_fn=MSELoss(), # Use the mean square error as loss function + ) + + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 761-764 + +Model’s accuracy in reproducing derived properties +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + +.. GENERATED FROM PYTHON SOURCE LINES 767-770 + +The Hamiltonian coupled blocks predicted by the ML model can be accessed +from ``model.forward()`` + + +.. GENERATED FROM PYTHON SOURCE LINES 770-774 + +.. code-block:: Python + + + predicted_blocks = model.forward(mldata.features) + + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 775-780 + +The real-space blocks can be transformed to Hamiltonian matrices via the +``mlelec.utils.pbc_utils.blocks_to_matrix`` function. The resulting +real-space Hamiltonians can be Fourier transformed to give the +:math:`k`-space ones. + + +.. GENERATED FROM PYTHON SOURCE LINES 780-790 + +.. code-block:: Python + + + HT = blocks_to_matrix( + predicted_blocks, + orbitals["sto-3g"], + {A: qmdata.structures[A] for A in range(len(qmdata))}, + detach=True, + ) + Hk = qmdata.bloch_sum(HT, is_tensor=True) + + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 791-794 + +Kohn-Sham eigenvalues +''''''''''''''''''''' + + +.. GENERATED FROM PYTHON SOURCE LINES 797-800 + +We can then compute the eigenvalues on the :math:`k`-grid used for the +calculation to assess the model accuracy in predicting band energies. + + +.. GENERATED FROM PYTHON SOURCE LINES 800-852 + +.. code-block:: Python + + + target_eigenvalues = compute_eigenvalues(qmdata.fock_kspace, qmdata.overlap_kspace) + predicted_eigenvalues = compute_eigenvalues(Hk, qmdata.overlap_kspace) + + Hartree = 27.211386024367243 # eV + + plt.rcParams["font.size"] = 14 + fig, ax = plt.subplots() + ax.set_aspect("equal") + + x_text = 0.38 + y_text = 0.2 + d = 0.06 + + for i, (idx, label) in enumerate( + zip( + [mldata.train_idx, mldata.val_idx, mldata.test_idx], + ["train", "validation", "test"], + ) + ): + + target = ( + torch.stack([target_eigenvalues[i] for i in idx]).flatten().detach() * Hartree + ) + prediction = ( + torch.stack([predicted_eigenvalues[i] for i in idx]).flatten().detach() + * Hartree + ) + + non_core_states = target > -100 + rmse = np.sqrt( + np.mean( + (target.numpy()[non_core_states] - prediction.numpy()[non_core_states]) ** 2 + ) + ) + ax.scatter(target, prediction, marker=".", label=label, alpha=0.5) + ax.text( + x=x_text, + y=y_text - d * i, + s=rf"$\mathrm{{RMSE_{{{label}}}={rmse:.2f}\,eV}}$", + transform=ax.transAxes, + ) + + xmin, xmax = ax.get_xlim() + ax.plot([xmin, xmax], [xmin, xmax], "--k") + ax.set_xlim(xmin, xmax) + ax.set_ylim(xmin, xmax) + ax.legend() + ax.set_xlabel("Target eigenvalues (eV)") + ax.set_ylabel("Predicted eigenvalues (eV)") + + + + + +.. image-sg:: /examples/periodic-hamiltonian/images/sphx_glr_periodic-hamiltonian_002.png + :alt: periodic hamiltonian + :srcset: /examples/periodic-hamiltonian/images/sphx_glr_periodic-hamiltonian_002.png + :class: sphx-glr-single-img + + +.. rst-class:: sphx-glr-script-out + + .. code-block:: none + + + Text(74.4222222222222, 0.5, 'Predicted eigenvalues (eV)') + + + +.. GENERATED FROM PYTHON SOURCE LINES 853-856 + +Graphene band structure +''''''''''''''''''''''' + + +.. GENERATED FROM PYTHON SOURCE LINES 859-863 + +Apart from the eigenvalues on a mesh in the Brillouin zone, we can use +the real-space Hamiltonians predicted by the model to compute the band +structure along high-symmetry paths. + + +.. GENERATED FROM PYTHON SOURCE LINES 863-893 + +.. code-block:: Python + + + fig, ax = plt.subplots(figsize=(8, 4.8)) + + idx = 0 + + handles = [] + + with warnings.catch_warnings(): + warnings.filterwarnings("ignore", category=DeprecationWarning) + + # Plot reference + ax, h_ref = plot_bands_frame( + qmdata.fock_realspace[idx], idx, qmdata, ax=ax, color="blue", lw=2 + ) + + # Plot prediction + ax, h_pred = plot_bands_frame( + HT[idx], idx, qmdata, ax=ax, color="lime", ls="--", lw=2 + ) + + ax.set_ylim(-30, 30) + ax.legend( + [h_ref, h_pred], + ["Reference", "Prediction"], + loc="center left", + bbox_to_anchor=(1, 0.5), + ) + fig.tight_layout() + + + + + +.. image-sg:: /examples/periodic-hamiltonian/images/sphx_glr_periodic-hamiltonian_003.png + :alt: periodic hamiltonian + :srcset: /examples/periodic-hamiltonian/images/sphx_glr_periodic-hamiltonian_003.png + :class: sphx-glr-single-img + + +.. rst-class:: sphx-glr-script-out + + .. code-block:: none + + /home/runner/work/atomistic-cookbook/atomistic-cookbook/.nox/periodic-hamiltonian/lib/python3.11/site-packages/spglib/spglib.py:115: DeprecationWarning: dict interface (SpglibDataset['std_lattice']) is deprecated.Use attribute interface ({self.__class__.__name__}.{key}) instead + warnings.warn( + /home/runner/work/atomistic-cookbook/atomistic-cookbook/.nox/periodic-hamiltonian/lib/python3.11/site-packages/spglib/spglib.py:115: DeprecationWarning: dict interface (SpglibDataset['std_positions']) is deprecated.Use attribute interface ({self.__class__.__name__}.{key}) instead + warnings.warn( + /home/runner/work/atomistic-cookbook/atomistic-cookbook/.nox/periodic-hamiltonian/lib/python3.11/site-packages/spglib/spglib.py:115: DeprecationWarning: dict interface (SpglibDataset['std_types']) is deprecated.Use attribute interface ({self.__class__.__name__}.{key}) instead + warnings.warn( + /home/runner/work/atomistic-cookbook/atomistic-cookbook/.nox/periodic-hamiltonian/lib/python3.11/site-packages/spglib/spglib.py:115: DeprecationWarning: dict interface (SpglibDataset['number']) is deprecated.Use attribute interface ({self.__class__.__name__}.{key}) instead + warnings.warn( + /home/runner/work/atomistic-cookbook/atomistic-cookbook/.nox/periodic-hamiltonian/lib/python3.11/site-packages/spglib/spglib.py:115: DeprecationWarning: dict interface (SpglibDataset['transformation_matrix']) is deprecated.Use attribute interface ({self.__class__.__name__}.{key}) instead + warnings.warn( + /home/runner/work/atomistic-cookbook/atomistic-cookbook/.nox/periodic-hamiltonian/lib/python3.11/site-packages/spglib/spglib.py:115: DeprecationWarning: dict interface (SpglibDataset['international']) is deprecated.Use attribute interface ({self.__class__.__name__}.{key}) instead + warnings.warn( + /home/runner/work/atomistic-cookbook/atomistic-cookbook/.nox/periodic-hamiltonian/lib/python3.11/site-packages/spglib/spglib.py:115: DeprecationWarning: dict interface (SpglibDataset['std_rotation_matrix']) is deprecated.Use attribute interface ({self.__class__.__name__}.{key}) instead + warnings.warn( + /home/runner/work/atomistic-cookbook/atomistic-cookbook/.nox/periodic-hamiltonian/lib/python3.11/site-packages/spglib/spglib.py:115: DeprecationWarning: dict interface (SpglibDataset['std_lattice']) is deprecated.Use attribute interface ({self.__class__.__name__}.{key}) instead + warnings.warn( + /home/runner/work/atomistic-cookbook/atomistic-cookbook/.nox/periodic-hamiltonian/lib/python3.11/site-packages/spglib/spglib.py:115: DeprecationWarning: dict interface (SpglibDataset['std_positions']) is deprecated.Use attribute interface ({self.__class__.__name__}.{key}) instead + warnings.warn( + /home/runner/work/atomistic-cookbook/atomistic-cookbook/.nox/periodic-hamiltonian/lib/python3.11/site-packages/spglib/spglib.py:115: DeprecationWarning: dict interface (SpglibDataset['std_types']) is deprecated.Use attribute interface ({self.__class__.__name__}.{key}) instead + warnings.warn( + /home/runner/work/atomistic-cookbook/atomistic-cookbook/.nox/periodic-hamiltonian/lib/python3.11/site-packages/spglib/spglib.py:115: DeprecationWarning: dict interface (SpglibDataset['number']) is deprecated.Use attribute interface ({self.__class__.__name__}.{key}) instead + warnings.warn( + /home/runner/work/atomistic-cookbook/atomistic-cookbook/.nox/periodic-hamiltonian/lib/python3.11/site-packages/spglib/spglib.py:115: DeprecationWarning: dict interface (SpglibDataset['transformation_matrix']) is deprecated.Use attribute interface ({self.__class__.__name__}.{key}) instead + warnings.warn( + /home/runner/work/atomistic-cookbook/atomistic-cookbook/.nox/periodic-hamiltonian/lib/python3.11/site-packages/spglib/spglib.py:115: DeprecationWarning: dict interface (SpglibDataset['international']) is deprecated.Use attribute interface ({self.__class__.__name__}.{key}) instead + warnings.warn( + /home/runner/work/atomistic-cookbook/atomistic-cookbook/.nox/periodic-hamiltonian/lib/python3.11/site-packages/spglib/spglib.py:115: DeprecationWarning: dict interface (SpglibDataset['std_rotation_matrix']) is deprecated.Use attribute interface ({self.__class__.__name__}.{key}) instead + warnings.warn( + + + + +.. GENERATED FROM PYTHON SOURCE LINES 894-897 + +Adding nonlinearities +--------------------- + + +.. GENERATED FROM PYTHON SOURCE LINES 900-911 + +The model used above consists of several submodels, one for each Hamiltonian +coupled block. Each submodel can be extended to a `multilayer +perceptron `__ +(MLP) that maps the corresponding set of geometric features to the +Hamiltonian coupled block. Nonlinearities are applied to the invariants +constructed from each equivariant feature block using the +``EquivariantNonlinearity`` module. This section outlines the process to +modify the model to introduce non-linear terms. Given that the time +to train and evaluate the model would then increase, this section +includes snippets of code, but is not a complete implementation and +is not executed when running this example. + +.. GENERATED FROM PYTHON SOURCE LINES 914-929 + +The architecture of ``EquivariantNonlinearity`` can be visualized with +``torchviz`` with the following snippet: + +.. code:: python + + import torch + from mlelec.models.equivariant_model import EquivariantNonLinearity + from torchviz import make_dot + m = EquivariantNonLinearity(torch.nn.SiLU(), layersize = 10) + y = m.forward(torch.randn(3,3,10)) + dot = make_dot(y, dict(m.named_parameters())) + dot.graph_attr.update(size='150,150') + dot.render("equivariantnonlinear", format="png") + dot + + +.. GENERATED FROM PYTHON SOURCE LINES 932-938 + +.. figure:: equivariantnonlinear.png + :alt: Graph representing the architecture of EquivariantNonLinearity + :width: 300px + + Graph representing the architecture of EquivariantNonLinearity + + +.. GENERATED FROM PYTHON SOURCE LINES 941-964 + +The global architecture of the MLP, implemented in ``simpleMLP``, can be +visualized with + +.. code:: python + + import torch + from mlelec.models.equivariant_model import simpleMLP + from torchviz import make_dot + mlp = simpleMLP( + nin=10, + nout=1, + nhidden=1, + nlayers=1, + bias=True, + activation='SiLU', + apply_layer_norm=True + ) + y = mlp.forward(torch.randn(1,1,10)) + dot = make_dot(y, dict(mlp.named_parameters())) + dot.graph_attr.update(size='150,150') + dot.render("simpleMLP", format="png") + dot + + +.. GENERATED FROM PYTHON SOURCE LINES 967-973 + +.. figure:: simpleMLP.png + :alt: Graph representing the architecture of simpleMLP + :width: 600px + + Graph representing the architecture of simpleMLP + + +.. GENERATED FROM PYTHON SOURCE LINES 976-979 + +Set up the training loop for stochastic gradient descent +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + +.. GENERATED FROM PYTHON SOURCE LINES 982-984 + +Import additional modules needed to monitor the training. + + +.. GENERATED FROM PYTHON SOURCE LINES 987-994 + +.. code:: python + + import lightning.pytorch as pl + from lightning.pytorch.callbacks import EarlyStopping + from mlelec.callbacks.logging import LoggingCallback + from mlelec.models.equivariant_lightning import MLDatasetDataModule + + +.. GENERATED FROM PYTHON SOURCE LINES 997-1000 + +We set up a callback for logging training information such as the +training and validation losses. + + +.. GENERATED FROM PYTHON SOURCE LINES 1003-1007 + +.. code:: python + + logger_callback = LoggingCallback(log_every_n_epochs=5) + + +.. GENERATED FROM PYTHON SOURCE LINES 1010-1013 + +We set up an early stopping criterion to stop the training when the +validation loss function stops decreasing. + + +.. GENERATED FROM PYTHON SOURCE LINES 1016-1022 + +.. code:: python + + early_stopping = EarlyStopping( + monitor="val_loss", min_delta=1e-3, patience=10, verbose=False, mode="min" + ) + + +.. GENERATED FROM PYTHON SOURCE LINES 1025-1033 + +We define a ``lighting.pytorch.Trainer`` instance to handle the training +loop. For example, we can further optimize the weights for 50 epochs using +the `LBFGS `__ +optimizer. + +Note that PyTorch Lightning requires the definition of a data module to +instantiate DataLoaders to be used during the training. + + +.. GENERATED FROM PYTHON SOURCE LINES 1036-1051 + +.. code:: python + + data_module = MLDatasetDataModule(mldata, batch_size=16, num_workers=0) + + trainer = pl.Trainer( + max_epochs=50, + accelerator="cpu", + check_val_every_n_epoch=10, + callbacks=[early_stopping, logger_callback], + logger=False, + enable_checkpointing=False, + ) + + trainer.fit(model, data_module) + + +.. GENERATED FROM PYTHON SOURCE LINES 1054-1057 + +We compute the test set loss to assess the model accuracy on an unseen +set of structures + + +.. GENERATED FROM PYTHON SOURCE LINES 1060-1064 + +.. code:: python + + trainer.test(model, data_module) + + +.. GENERATED FROM PYTHON SOURCE LINES 1067-1072 + +In this case, Ridge regression already provides good accuracy, so +further optimizing the weights offers limited improvement. However, for +more complex datasets, the benefits of additional optimization can be +significant. + + + +.. rst-class:: sphx-glr-timing + + **Total running time of the script:** (1 minutes 53.471 seconds) + + +.. _sphx_glr_download_examples_periodic-hamiltonian_periodic-hamiltonian.py: + +.. only:: html + + .. container:: sphx-glr-footer sphx-glr-footer-example + + + .. container:: sphx-glr-download + + :download:`Download Conda environment file: environment.yml ` + + .. container:: sphx-glr-download + + :download:`Download data files: data.zip ` + .. container:: sphx-glr-download sphx-glr-download-jupyter + + :download:`Download Jupyter notebook: periodic-hamiltonian.ipynb ` + + .. container:: sphx-glr-download sphx-glr-download-python + + :download:`Download Python source code: periodic-hamiltonian.py ` + + .. container:: sphx-glr-download sphx-glr-download-zip + + :download:`Download zipped: periodic-hamiltonian.zip ` + + +.. only:: html + + .. rst-class:: sphx-glr-signature + + `Gallery generated by Sphinx-Gallery `_ + diff --git a/_sources/examples/pi-metad/pi-metad.rst.txt b/_sources/examples/pi-metad/pi-metad.rst.txt new file mode 100644 index 00000000..3e975c11 --- /dev/null +++ b/_sources/examples/pi-metad/pi-metad.rst.txt @@ -0,0 +1,1366 @@ + +.. DO NOT EDIT. +.. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. +.. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: +.. "examples/pi-metad/pi-metad.py" +.. LINE NUMBERS ARE GIVEN BELOW. + +.. only:: html + + .. note:: + :class: sphx-glr-download-link-note + + :ref:`Go to the end ` + to download the full example code. + +.. rst-class:: sphx-glr-example-title + +.. _sphx_glr_examples_pi-metad_pi-metad.py: + + +Path integral metadynamics +========================== + +:Authors: Michele Ceriotti `@ceriottm `_ + +This example shows how to run a free-energy sampling calculation that +combines path integral molecular dynamics to model nuclear quantum effects +and metadynamics to accelerate sampling of the high-free-energy regions. + +The rather complicated setup combines `i-PI `_ +to perform path integral +MD, its built-in driver to compute energy and forces for the Zundel +:math:`\mathrm{H_5O_2^+}` cation, and `PLUMED `_ +to perform metadynamics. +If you want to see an example in a more realistic scenario, you can look at +`this paper (Rossi et al., JCTC (2020)) +`_, +in which this +methodology is used to simulate the decomposition of methanesulphonic +acid in a solution of phenol and hydrogen peroxide. + +Note also that, in order to keep the execution time of this example as +low as possible, several parameters are set to values that would not be +suitable for an accurate, converged simulation. +They will be highlighted and more reasonable values will be provided. +"High-quality" runs can also be realized substituting the input files +used in this example with those labeled with the ``_hiq`` suffix, that +are also provided in the ``data/`` folder. + +.. GENERATED FROM PYTHON SOURCE LINES 33-48 + +.. code-block:: Python + + + import bz2 + import os + import subprocess + import time + import xml.etree.ElementTree as ET + + import ase + import ase.io + import chemiscope + import ipi + import matplotlib.pyplot as plt + import numpy as np + + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 49-76 + +Metadynamics for the Zundel cation +---------------------------------- + +Metadynamics is a method to accelerate sampling of rare events - microscopic processes +that are too infrequent to be observed over the time scale (ns-µs) accessible to +molecular dynamics simulations. You can read one of the many excellent reviews +on metadynamics (see e.g. +`Bussi and Branduardi (2015) `_), +or follow a +`lecture from the PLUMED masterclass +`_. +In short, during a metadynamics simulation an adaptive biasing potential is +built as a superimposition of Gaussians centered over configurations that have +been previously visited by the trajectory. This discourages the system from remaining +in high-probability configurations and accelerates sampling of free-energy barriers. + +.. figure:: metad-scheme.png + :align: center + :width: 600px + + A schematic representation of how metadynamics work by adaptively building + a repulsive bias based on the trajectory of a molecule, compensating for + low-energy regions in the free energy surface. + +Crucially, the bias is *not* built relative to the Cartesian coordinates of the atoms, +but relative to a lower-dimensional description of the system (so-called collective +variables) that are suited to describe the processes being studied. + +.. GENERATED FROM PYTHON SOURCE LINES 78-85 + +The Zundel cation :math:`\mathrm{H_5O_2^+}` is one of the limiting +structures of the solvated proton, and in the gas phase leads to a +stable structure, with the additional proton shared between two water +molecules (see the structure below). +We will use a potential fitted on high-end quantum-chemistry calculations +`Huang et al. (2005) `_ to compute energy +and forces acting on the atoms. + +.. GENERATED FROM PYTHON SOURCE LINES 86-90 + +.. code-block:: Python + + + zundel = ase.io.read("data/h5o2+.xyz", ":") + chemiscope.show(frames=zundel, mode="structure") + + + +.. chemiscope:: _datasets/fig_pi-metad_001.json.gz + :mode: structure + + + +.. raw:: html + +
+ +
+
+
+ +.. GENERATED FROM PYTHON SOURCE LINES 91-98 + +As the two water molecules are separated, the proton remains attached +to one of the two, effectively leading to a dissociated +:math:`\mathrm{H_2O+H_3O^+}` configuration. Thus, two natural +coordinates to describe the physics of this system are the distance +between the O atoms, and the difference in coordination number of +the two O atoms, which is 0 for a shared proton and ±1 for the +dissociated system. + +.. GENERATED FROM PYTHON SOURCE LINES 101-111 + +Running metadynamics calculations with ``i-PI`` and ``PLUMED`` +-------------------------------------------------------------- + +The client-server architecture `i-PI `_ is based on makes it easy +to combine multiple programs to realize complicated simulation workflows. +In this case we will use an implementation of the Zundel potential in a simple +driver code that is available in the i-PI repository, and use +`PLUMED `_ to compute collective variables and build +the adaptive bias. We will then perform some post-processing to +estimate the free energy. + +.. GENERATED FROM PYTHON SOURCE LINES 114-120 + +Installing the Python driver +~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +i-PI comes with a FORTRAN driver, which however has to be installed +from source. We use a utility function to compile it. Note that this requires +a functioning build system with `gfortran` and `make`. + +.. GENERATED FROM PYTHON SOURCE LINES 120-123 + +.. code-block:: Python + + + ipi.install_driver() + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 124-127 + +Defining the molecular dynamics setup +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +The `input-md.xml` file defines the way the MD simulation is performed. + +.. GENERATED FROM PYTHON SOURCE LINES 127-130 + +.. code-block:: Python + + + xmlroot = ET.parse("data/input-md.xml").getroot() + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 131-133 + +The `` block describe the way communication will occur with the +driver code + +.. GENERATED FROM PYTHON SOURCE LINES 133-136 + +.. code-block:: Python + + + print(" " + ET.tostring(xmlroot.find("ffsocket"), encoding="unicode")) + + + + + +.. rst-class:: sphx-glr-script-out + + .. code-block:: none + + + 1.00000000e-04
zundel
+
+ + + + + +.. GENERATED FROM PYTHON SOURCE LINES 137-145 + +... and the `` section describes the MD setup. +This is a relatively standard NVT setup, with an efficient +generalized Langevin equation thermostat (important to +compensate for the non-equilibrium nature of metadynamics). +Note that the time step is rather long (the recommended value for +aqueous systems is around 0.5 fs). This is done to improve +efficiency for this example, but you should check if it +affects results in a realistic scenario. + +.. GENERATED FROM PYTHON SOURCE LINES 145-148 + +.. code-block:: Python + + + print(" " + ET.tostring(xmlroot.find(".//motion"), encoding="unicode")) + + + + + +.. rst-class:: sphx-glr-script-out + + .. code-block:: none + + + False + + 1.0 + + + + [ 8.191023526179e-4, 8.328506066524e-3, 1.657771834013e-3, 9.736989925341e-4, 2.841803794895e-4, -3.176846864198e-5, -2.967010478210e-4, + -8.389856546341e-4, 2.405526974742e-2, -1.507872374848e-2, 2.589784240185e-3, 1.516783633362e-3, -5.958833418565e-4, 4.198422349789e-4, + 7.798710586406e-4, 1.507872374848e-2, 8.569039501219e-3, 6.001000899602e-3, 1.062029383877e-3, 1.093939147968e-3, -2.661575532976e-3, + -9.676783161546e-4, -2.589784240185e-3, -6.001000899602e-3, 2.680459336535e-5, -5.214694469742e-5, 4.231304910751e-4, -2.104894919743e-5, + -2.841997149166e-4, -1.516783633362e-3, -1.062029383877e-3, 5.214694469742e-5, 1.433903506353e-9, -4.241574212449e-5, 7.910178912362e-5, + 3.333208286893e-5, 5.958833418565e-4, -1.093939147968e-3, -4.231304910751e-4, 4.241574212449e-5, 2.385554468441e-8, -3.139255482869e-5, + 2.967533789056e-4, -4.198422349789e-4, 2.661575532976e-3, 2.104894919743e-5, -7.910178912362e-5, 3.139255482869e-5, 2.432567259684e-11 + ] + + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 149-157 + +The metadynamics setup requires three ingredients: +a `` forcefield that defines what input to use +(more on that later) and the file from which to initialize +the structural information (number of atoms, ...); +`` is an advanced feature, available from +PLUMED 2.10, that allows extracting internal variables +from plumed and integrate them into the outputs of +i-PI. + +.. GENERATED FROM PYTHON SOURCE LINES 157-160 + +.. code-block:: Python + + + print(" " + ET.tostring(xmlroot.find("ffplumed"), encoding="unicode")) + + + + + +.. rst-class:: sphx-glr-script-out + + .. code-block:: none + + + data/h5o2+.xyz + data/plumed-md.dat + [doo, co1.lessthan, co2.lessthan, dc, mtd.bias ] + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 161-166 + +The `` section contains a `` key that +specifies that energy and forces from PLUMED should be +treated as a bias (so that e.g. are not included in the +potential, even though they're used to propagate the +trajectory). + +.. GENERATED FROM PYTHON SOURCE LINES 166-176 + +.. code-block:: Python + + + print(" " + ET.tostring(xmlroot.find(".//ensemble"), encoding="unicode")) + + # The `` section contains a `` class that + # instructs i-PI to call the PLUMED action that adds hills + # along the trajectory. + + print(" " + ET.tostring(xmlroot.find("smotion"), encoding="unicode")) + + + + + + +.. rst-class:: sphx-glr-script-out + + .. code-block:: none + + + 300.0 + + + + + + + [ plumed ] + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 177-198 + +CVs and metadynamics +~~~~~~~~~~~~~~~~~~~~ + +The calculation of the collective variables and the +metadynamics bias is delegated to PLUMED, and controlled by +a separate `plumed-md.dat` input file. +Without going in detail into the syntax, one can recognize the +calculation of the distance between the O atoms `doo`, +the coordination of the two oxygens `co1` and `co2`, +and the difference between the two, `dc`. +The `METAD` action specifies the CVs to be used, the pace of +hill depositon (which is way too frequent here, but suitable for +this example), the width along the two CVs and the initial +height of the repulsive Gaussians (which are both too large to +guarantee high resolution in CV and energy). The `BIASFACTOR` keyword specifies +that the height of the hills will be progressively reduced +according to the "well-tempered metadynamics" protocol, see +`Barducci et al., Phys. Rev. Lett. (2008) +`_. +A repulsive static bias (`UPPER_WALLS`) prevents complete dissociation of the +cation by limiting the range of the O-O distance. + +.. GENERATED FROM PYTHON SOURCE LINES 198-203 + +.. code-block:: Python + + + with open("data/plumed-md.dat", "r") as file: + plumed_dat = file.read() + print(plumed_dat) + + + + + +.. rst-class:: sphx-glr-script-out + + .. code-block:: none + + # default units are LENGTH=nm ENERGY=kJ/mol TIME=ps + doo: DISTANCE ATOMS=1,2 + co1: DISTANCES GROUPA=1 GROUPB=3-7 LESS_THAN={RATIONAL R_0=0.14} + co2: DISTANCES GROUPA=2 GROUPB=3-7 LESS_THAN={RATIONAL R_0=0.14} + dc: COMBINE ARG=co1.lessthan,co2.lessthan COEFFICIENTS=1,-1 PERIODIC=NO + mtd: METAD ARG=doo,dc PACE=10 SIGMA=0.005,0.05 HEIGHT=4 FILE=HILLS-md BIASFACTOR=10 TEMP=300 + uwall: UPPER_WALLS ARG=doo AT=0.4 KAPPA=250 + + PRINT ARG=doo,co1.*,co2.*,dc,mtd.*,uwall.* STRIDE=10 FILE=COLVAR-md + FLUSH STRIDE=1 + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 204-222 + +Running the simulations +~~~~~~~~~~~~~~~~~~~~~~~ + +Now we can launch the actual calculations. On the the command line, +this requires launching i-PI first, and then the built-in driver, +specifying the appropriate communication mode, and the `zundel` potential. +PLUMED is called from within i-PI as a library, so there is no need to +launch a separate process. Note that the Zundel potential requires some data +files, with a hard-coded location in the current working directory, +which is why the driver should be run from within the ``data/`` folder. + +.. code-block:: bash + + i-pi data/input-md.xml > log & + sleep 2 + cd data; i-pi-driver -u -a zundel -m zundel + +The same can be achieved from Python using ``subprocess.Popen`` + +.. GENERATED FROM PYTHON SOURCE LINES 222-235 + +.. code-block:: Python + + + ipi_process = None + if not os.path.exists("meta-md.out"): + # don't rerun if the outputs already exist + ipi_process = subprocess.Popen(["i-pi", "data/input-md.xml"]) + time.sleep(2) # wait for i-PI to start + driver_process = [ + subprocess.Popen( + ["i-pi-driver", "-u", "-a", "zundel", "-m", "zundel"], cwd="data/" + ) + for i in range(1) + ] + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 236-238 + +If you run this in a notebook, you can go ahead and start loading +output files *before* i-PI has finished running by skipping this cell + +.. GENERATED FROM PYTHON SOURCE LINES 238-245 + +.. code-block:: Python + + + # wait for simulations to finish + if ipi_process is not None: + ipi_process.wait() + for process in driver_process: + process.wait() + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 246-253 + +Trajectory post-processing +~~~~~~~~~~~~~~~~~~~~~~~~~~ + +We can now post-process the simulation to see metadynamics in action. + +First, we read the trajectory outputs. Note that these have all been +printed with the same stride + +.. GENERATED FROM PYTHON SOURCE LINES 253-260 + +.. code-block:: Python + + + output_data, output_desc = ipi.read_output("meta-md.out") + colvar_data = ipi.read_trajectory("meta-md.colvar_0", format="extras")[ + "doo,dc,mtd.bias" + ] + traj_data = ipi.read_trajectory("meta-md.pos_0.xyz") + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 261-262 + +then, assemble a visualization + +.. GENERATED FROM PYTHON SOURCE LINES 262-277 + +.. code-block:: Python + + chemiscope.show( + frames=traj_data, + properties=dict( + d_OO=10 * colvar_data[:, 0], # nm to Å + delta_coord=colvar_data[:, 1], + bias=27.211386 * output_data["ensemble_bias"], # Ha to eV + time=2.4188843e-05 * output_data["time"], # atomictime to ps + ), # attime to ps + settings=chemiscope.quick_settings( + x="d_OO", y="delta_coord", z="bias", color="time", trajectory=True + ), + mode="default", + ) + + + + +.. chemiscope:: _datasets/fig_pi-metad_002.json.gz + :mode: default + + + +.. raw:: html + +
+ +
+
+
+ +.. GENERATED FROM PYTHON SOURCE LINES 278-283 + +The visualization above shows how the growing metadynamics bias pushes +progressively the atoms towards geometries with larger O-O separations, +and that for these distorted configurations the proton is not shared +symmetrically between the O atoms, but is preferentially attached to +one of the two water molecules. + +.. GENERATED FROM PYTHON SOURCE LINES 285-300 + +Trajectory diagnostics +...................... + +The time history of the bias is instructive, as it shows how the +bias grows until the trajectory gets pushed in a new region (where the +bias is zero) and then grows again. The envelope of the bias increase +slows down over time, because the "well-tempered" deposition strategy +reduces the height of the hills deposited in high-bias regions. + +Note that the potential energy has fluctuations that are larger than +the magnitude of the bias, although it shows a tendency to reach higher +values as the simulation progresses. This is because only two degrees +of freedom are affected by the bias, while all degrees of freedom +undergo thermal fluctuations, which are dominant even for this +small system. + +.. GENERATED FROM PYTHON SOURCE LINES 300-322 + +.. code-block:: Python + + + + fig, ax = plt.subplots(1, 1, figsize=(4, 3), constrained_layout=True) + + ax.plot( + 2.4188843e-05 * output_data["time"], + 27.211386 * output_data["potential"], + "r", + label="potential", + ) + ax.plot( + 2.4188843e-05 * output_data["time"], + 27.211386 * output_data["ensemble_bias"], + "b", + label="bias", + ) + + ax.set_xlabel(r"$t$ / ps") + ax.set_ylabel(r"energy / eV") + ax.legend(loc="upper left", ncols=1) + plt.show() + + + + +.. image-sg:: /examples/pi-metad/images/sphx_glr_pi-metad_001.png + :alt: pi metad + :srcset: /examples/pi-metad/images/sphx_glr_pi-metad_001.png + :class: sphx-glr-single-img + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 323-329 + +It's important to keep in mind that the growing metadynamics bias can +lead to deviations from the quasi-equilibrium sampling that is necessary +to recover the correct properties of the rare event. It is not easy +to verify this condition, but one simple diagnostics that can highlight +the most evident problems is looking at the kinetic temperature of different +portions of the system, computing a moving average to have a clearer signal. + +.. GENERATED FROM PYTHON SOURCE LINES 330-366 + +.. code-block:: Python + + + + def moving_average(arr, window_size): + # Create a window of the specified size with equal weights + window = np.ones(window_size) / window_size + # Use the 'valid' mode to only return elements where the window fully + # overlaps with the data + return np.convolve(arr, window, mode="valid") + + + fig, ax = plt.subplots(1, 1, figsize=(4, 3), constrained_layout=True) + + ax.plot( + 2.4188843e-05 * output_data["time"][50:-49], + moving_average(output_data["temperature(O)"], 100), + "r", + label=r"$T_\mathrm{O}$", + ) + ax.plot( + 2.4188843e-05 * output_data["time"][50:-49], + moving_average(output_data["temperature(H)"], 100), + "gray", + label=r"$T_\mathrm{H}$", + ) + ax.plot( + 2.4188843e-05 * output_data["time"][50:-49], + moving_average(output_data["temperature"], 100), + "b", + label="T", + ) + + ax.set_xlabel(r"$t$ / ps") + ax.set_ylabel(r"temperature / K") + ax.legend(loc="upper left", ncols=2) + plt.show() + + + + +.. image-sg:: /examples/pi-metad/images/sphx_glr_pi-metad_002.png + :alt: pi metad + :srcset: /examples/pi-metad/images/sphx_glr_pi-metad_002.png + :class: sphx-glr-single-img + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 367-377 + +It is clear that the very high rate of biasing used in this demonstrative +example leads to a temperature that is consistently higher than the target, +with spikes up to 380 K and O and H atoms reaching different temperatures +(i.e. equipartition is broken). While this does not affect the qualitative +nature of the results, these parameters are unsuitable for a production run. +NB: especially for small systems, the instantaneous kinetic temperature +can deviate by a large amount from the target temperature: only the mean +value has actual meaning. However, a kinetic temperature that is consistently +above the target value indicates that the thermostat cannot dissipate +efficiently the energy due to the growing bias. + +.. GENERATED FROM PYTHON SOURCE LINES 379-406 + +Free energy profiles +.................... + +One of the advantages of metadynamics is that it allows one to easily +estimate the free-energy associated with the collective variables +that are used to accelerate sampling by summing the repulsive hills +that have been deposited during the run and taking the negative of +the total bias at the end of the trajectory. + +Even though more sophisticated strategies exist that provide explicit +weighting factors to estimate the unbiased Boltzmann distribution +(see e.g. +`Giberti et al., JCTC 2020 +`_), +this simple approach is good enough for this example, and can be +realized as a post-processing step using the ``plumed sum_hills`` module, +that also applies a (simple) correction to the negative bias that +is needed when using the well-tempered bias scaling protocol. +On the command line, + +.. code-block:: bash + + plumed sum_hills --hills HILLS-md --min 0.21,-1 --max 0.31,1 --bin 100,100 \ + --outfile FES-md --stride 100 --mintozero < data/plumed-md.dat + +The ``--stride`` option generates a series of files showing the estimates +of :math:`F` at different times along the trajectory. + +.. GENERATED FROM PYTHON SOURCE LINES 406-444 + +.. code-block:: Python + + + with open("data/plumed-md.dat", "r") as file: + subprocess.run( + [ + "plumed", + "sum_hills", + "--hills", + "HILLS-md", + "--min", + "0.21,-1", + "--max", + "0.31,1", + "--bin", + "100,100", + "--outfile", + "FES-md", + "--stride", + "100", + "--mintozero", + ], + stdin=file, + text=True, + ) + + # rearrange data and converts to Å and eV + data = np.loadtxt("FES-md0.dat", comments="#")[:, :3] + xyz_0 = np.array([10, 1, 0.01036427])[:, np.newaxis, np.newaxis] * data.T.reshape( + 3, 101, 101 + ) + data = np.loadtxt("FES-md2.dat", comments="#")[:, :3] + xyz_2 = np.array([10, 1, 0.01036427])[:, np.newaxis, np.newaxis] * data.T.reshape( + 3, 101, 101 + ) + data = np.loadtxt("FES-md5.dat", comments="#")[:, :3] + xyz_5 = np.array([10, 1, 0.01036427])[:, np.newaxis, np.newaxis] * data.T.reshape( + 3, 101, 101 + ) + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 445-447 + +The plots show, left-to-right, the accumulation of the +metadynamics bias as simulation progresses. + +.. GENERATED FROM PYTHON SOURCE LINES 447-465 + +.. code-block:: Python + + + fig, ax = plt.subplots( + 1, 3, figsize=(8, 3), sharex=True, sharey=True, constrained_layout=True + ) + + cf_0 = ax[0].contourf(*xyz_0) + cf_1 = ax[1].contourf(*xyz_2) + cf_2 = ax[2].contourf(*xyz_5) + fig.colorbar(cf_2, ax=ax, orientation="vertical", label=r"$F$ / eV") + ax[0].set_ylabel(r"$\Delta C_\mathrm{H}$") + ax[0].set_xlabel(r"$d_\mathrm{OO}$ / Å") + ax[1].set_xlabel(r"$d_\mathrm{OO}$ / Å") + ax[2].set_xlabel(r"$d_\mathrm{OO}$ / Å") + ax[0].set_title(r"$t=0.8$ ps") + ax[1].set_title(r"$t=2.5$ ps") + ax[2].set_title(r"$t=5.0$ ps") + plt.show() + + + + +.. image-sg:: /examples/pi-metad/images/sphx_glr_pi-metad_003.png + :alt: $t=0.8$ ps, $t=2.5$ ps, $t=5.0$ ps + :srcset: /examples/pi-metad/images/sphx_glr_pi-metad_003.png + :class: sphx-glr-single-img + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 466-474 + +Biasing a path integral calculation +----------------------------------- + +You can see `this recipe +`_ +for a brief introduction to path integral simulations with `i-PI`. +From a practical perspective, very little needs to change with respect +to the classical case. + +.. GENERATED FROM PYTHON SOURCE LINES 474-477 + +.. code-block:: Python + + + xmlroot = ET.parse("data/input-pimd.xml").getroot() + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 478-486 + +The `nbeads` option determines the number of path integral +replicas. The value of 8 used here is not sufficient to converge +quantum statistics at 300 K (a more typical value would be +around 32). There are methods to reduce the number of replicas +needed for convergence, see e.g. +`Ceriotti and Markland, Nat. Rev. Chem. (2018) +`_ +but we keep it simple here. + +.. GENERATED FROM PYTHON SOURCE LINES 486-489 + +.. code-block:: Python + + + print(" " + ET.tostring(xmlroot.find(".//initialize"), encoding="unicode")[:23]) + + + + + +.. rst-class:: sphx-glr-script-out + + .. code-block:: none + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 490-520 + +Centroid bias +~~~~~~~~~~~~~ + +Another detail worth discussing is that the metadynamics bias +is computed exclusively on the *centroid*, the mean position of +the ring-polymer beads. This is an extreme form of +ring polymer contraction +`(Markland and Manolopoulos, J. Chem. Phys. (2008) +`_ +that avoids computing for each replica the slowly-varying +parts of the potential, but is not applied for computational +savings. When performing a quantum free-energy calculation it +is important to distinguish between the free-energy computed +as the logarithm of the probability of observing a given +configuration (that depends on the distribution of the +replicas) and the free-energy taken as a tool to estimate +reaction rates :math:`k` in a transition-state theory +fashion :math:`k\propto e^{-\Delta E^\ddagger/kT}`, +where the energy barrier :math:`\Delta E^\ddagger` +is better estimated from the distribution of the centroid. +See e.g. +`Habershon et al., Annu. Rev. Phys. Chem. (2013) +`_ +for a discussion of the subtleties involved in estimating +transition rates. +In practice, performing this contraction step is very easy +in `i-PI`, because for each `` section - including +that corresponding to the bias - it is possible to specify +a different number of replicas. The configurations will +be automatically computed by Fourier interpolation. + +.. GENERATED FROM PYTHON SOURCE LINES 520-523 + +.. code-block:: Python + + + print(" " + ET.tostring(xmlroot.find(".//bias"), encoding="unicode")) + + + + + +.. rst-class:: sphx-glr-script-out + + .. code-block:: none + + + + [ doo, dc, mtd.bias ] + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 524-531 + +Running the calculation +~~~~~~~~~~~~~~~~~~~~~~~ + +The other changes are purely cosmetic, and the calculation +can be launched very easily, using several drivers to parallelize +the energy evaluation over the beads (although this kind of calculations +is not limited by the evaluation of the forces). + +.. GENERATED FROM PYTHON SOURCE LINES 531-544 + +.. code-block:: Python + + + # don't rerun if the outputs already exist + ipi_process = None + if not os.path.exists("meta-pimd.out"): + ipi_process = subprocess.Popen(["i-pi", "data/input-pimd.xml"]) + time.sleep(2) # wait for i-PI to start + driver_process = [ + subprocess.Popen( + ["i-pi-driver", "-u", "-a", "zundel", "-m", "zundel"], cwd="data/" + ) + for i in range(4) + ] + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 545-547 + +If you run this in a notebook, you can go ahead and start loading +output files _before_ i-PI has finished running by skipping this cell + +.. GENERATED FROM PYTHON SOURCE LINES 548-555 + +.. code-block:: Python + + + # wait for simulations to finish + if ipi_process is not None: + ipi_process.wait() + for process in driver_process: + process.wait() + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 556-565 + +Analysis of the simulation +~~~~~~~~~~~~~~~~~~~~~~~~~~ + +A path integral simulation evolves multiple configurations at the same +time, forming a `ring polymer`. Each replica provides a sample of the +quantum mechanical configuration distribution of the atoms. To provide +an overall visualization of the path integral dynamics, we load all the +replicas and combine them using a utility function from the +`chemiscope` library.` + +.. GENERATED FROM PYTHON SOURCE LINES 565-600 + +.. code-block:: Python + + + + output_data, output_desc = ipi.read_output("meta-pimd.out") + colvar_data = ipi.read_trajectory("meta-pimd.colvar_0", format="extras")[ + "doo,dc,mtd.bias" + ] + pimd_traj_data = [ipi.read_trajectory(f"meta-pimd.pos_{i}.xyz") for i in range(8)] + + # combines the PI beads and sets up the visualization options + traj_pimd = chemiscope.ase_merge_pi_frames(pimd_traj_data) + traj_pimd["shapes"]["paths"]["parameters"]["global"]["radius"] = 0.05 + traj_pimd["properties"] = dict( + d_OO=10 * colvar_data[:, 0], # nm to Å + delta_coord=colvar_data[:, 1], + bias=27.211386 * output_data["ensemble_bias"], # Ha to eV + time=2.4188843e-05 * output_data["time"], + ) + traj_pimd["settings"] = chemiscope.quick_settings( + x="d_OO", + y="delta_coord", + z="bias", + color="time", + trajectory=True, + structure_settings=dict( + bonds=False, + atoms=False, + keepOrientation=True, + unitCell=False, + shape=[ + "paths", + ], + ), + ) + traj_pimd["settings"]["target"] = "structure" + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 601-603 + +Visualize the trajectory. Note the similar behavior as for the classical +trajectory, and the delocalization of the protons + +.. GENERATED FROM PYTHON SOURCE LINES 604-608 + +.. code-block:: Python + + + chemiscope.show(**traj_pimd) + + + + +.. chemiscope:: _datasets/fig_pi-metad_003.json.gz + :mode: default + + + +.. raw:: html + +
+ +
+
+
+ +.. GENERATED FROM PYTHON SOURCE LINES 609-615 + +Free energy plots +~~~~~~~~~~~~~~~~~ + +The free energy profiles relative to :math:`\Delta C_\mathrm{H}` +and :math:`d_\mathrm{OO}` can be computed exactly as for the +classical trajectory, using the `sum_hills` module. + +.. GENERATED FROM PYTHON SOURCE LINES 615-653 + +.. code-block:: Python + + + with open("data/plumed-pimd.dat", "r") as file: + subprocess.run( + [ + "plumed", + "sum_hills", + "--hills", + "HILLS-pimd", + "--min", + "0.21,-1", + "--max", + "0.31,1", + "--bin", + "100,100", + "--outfile", + "FES-pimd", + "--stride", + "100", + "--mintozero", + ], + stdin=file, + text=True, + ) + + # rearrange data and converts to Å and eV + data = np.loadtxt("FES-pimd0.dat", comments="#")[:, :3] + xyz_pi_0 = np.array([10, 1, 0.01036427])[:, np.newaxis, np.newaxis] * data.T.reshape( + 3, 101, 101 + ) + data = np.loadtxt("FES-pimd2.dat", comments="#")[:, :3] + xyz_pi_2 = np.array([10, 1, 0.01036427])[:, np.newaxis, np.newaxis] * data.T.reshape( + 3, 101, 101 + ) + data = np.loadtxt("FES-pimd5.dat", comments="#")[:, :3] + xyz_pi_5 = np.array([10, 1, 0.01036427])[:, np.newaxis, np.newaxis] * data.T.reshape( + 3, 101, 101 + ) + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 654-657 + +Just as for a classical run, the metadynamics bias progressively +pushes the centroid (and the beads that are distributed around it) +to sample a wider portion of the collective-variable space. + +.. GENERATED FROM PYTHON SOURCE LINES 657-675 + +.. code-block:: Python + + + fig, ax = plt.subplots( + 1, 3, figsize=(8, 3), sharex=True, sharey=True, constrained_layout=True + ) + + cf_0 = ax[0].contourf(*xyz_pi_0) + cf_1 = ax[1].contourf(*xyz_pi_2) + cf_2 = ax[2].contourf(*xyz_pi_5) + fig.colorbar(cf_2, ax=ax, orientation="vertical", label=r"$F$ / eV") + ax[0].set_ylabel(r"$\Delta C_\mathrm{H}$") + ax[0].set_xlabel(r"$d_\mathrm{OO}$ / Å") + ax[1].set_xlabel(r"$d_\mathrm{OO}$ / Å") + ax[2].set_xlabel(r"$d_\mathrm{OO}$ / Å") + ax[0].set_title(r"$t=0.8$ ps") + ax[1].set_title(r"$t=2.5$ ps") + ax[2].set_title(r"$t=5.0$ ps") + plt.show() + + + + +.. image-sg:: /examples/pi-metad/images/sphx_glr_pi-metad_004.png + :alt: $t=0.8$ ps, $t=2.5$ ps, $t=5.0$ ps + :srcset: /examples/pi-metad/images/sphx_glr_pi-metad_004.png + :class: sphx-glr-single-img + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 676-685 + +Assessing quantum nuclear effects +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +The effect of nuclear quantization on the centroid free-energy +is relatively small, despite the large delocalization of the +protons in the PIMD calculation. Looking more +carefully at the two distributions, one can notice that +in the high-:math:`d_\mathrm{OO}` region there is higher +delocalisation of the proton. + +.. GENERATED FROM PYTHON SOURCE LINES 685-703 + +.. code-block:: Python + + + fig, ax = plt.subplots( + 1, 1, figsize=(4, 3), sharex=True, sharey=True, constrained_layout=True + ) + + levels = np.linspace(0, 0.5, 6) + cp1 = ax.contour(*xyz_5, colors="b", levels=levels) + cp2 = ax.contour(*xyz_pi_5, colors="r", levels=levels) + ax.set_ylabel(r"$\Delta C_\mathrm{H}$") + ax.set_xlabel(r"$d_\mathrm{OO}$ / Å") + ax.legend( + handles=[ + plt.Line2D([0], [0], color="b", label="MD"), + plt.Line2D([0], [0], color="r", label="PIMD"), + ] + ) + plt.show() + + + + +.. image-sg:: /examples/pi-metad/images/sphx_glr_pi-metad_005.png + :alt: pi metad + :srcset: /examples/pi-metad/images/sphx_glr_pi-metad_005.png + :class: sphx-glr-single-img + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 704-710 + +To get a clear signal, we need better-converged calculations; +the `data/` folder contains inputs for these "high quality" runs, +and free-energies obtained from them. +The results confirm the lowering of the free-energy barrier for +the :math:`\mathrm{H_3O^+ + H_2O} \rightarrow \mathrm{H_2O + H_3O^+}` +transition. + +.. GENERATED FROM PYTHON SOURCE LINES 711-740 + +.. code-block:: Python + + + with bz2.open("data/FES-md_hiq.bz2", "rt") as f: + data = np.loadtxt(f, comments="#")[:, :3] + xyz_md_hiq = np.array([10, 1, 0.01036427])[:, np.newaxis, np.newaxis] * data.T.reshape( + 3, 101, 101 + ) + with bz2.open("data/FES-pimd_hiq.bz2", "rt") as f: + data = np.loadtxt(f, comments="#")[:, :3] + xyz_pi_hiq = np.array([10, 1, 0.01036427])[:, np.newaxis, np.newaxis] * data.T.reshape( + 3, 101, 101 + ) + + fig, ax = plt.subplots( + 1, 1, figsize=(4, 3), sharex=True, sharey=True, constrained_layout=True + ) + + levels = np.linspace(0, 0.5, 6) + cp1 = ax.contour(*xyz_md_hiq, colors="b", levels=levels) + cp2 = ax.contour(*xyz_pi_hiq, colors="r", levels=levels) + ax.set_ylabel(r"$\Delta C_\mathrm{H}$") + ax.set_xlabel(r"$d_\mathrm{OO}$ / Å") + ax.legend( + handles=[ + plt.Line2D([0], [0], color="b", label="MD"), + plt.Line2D([0], [0], color="r", label="PIMD"), + ] + ) + plt.show() + + + + +.. image-sg:: /examples/pi-metad/images/sphx_glr_pi-metad_006.png + :alt: pi metad + :srcset: /examples/pi-metad/images/sphx_glr_pi-metad_006.png + :class: sphx-glr-single-img + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 741-743 + +The lowering of the barrier for proton hopping is clearly +seen by taking 1D slices of the free energy at different O-O separations. + +.. GENERATED FROM PYTHON SOURCE LINES 744-776 + +.. code-block:: Python + + + fig, ax = plt.subplots( + 1, 1, figsize=(4, 3), sharex=True, sharey=True, constrained_layout=True + ) + + ax.plot( + xyz_md_hiq[1, :, 50], xyz_md_hiq[2, :, 50], "b", label=r"MD, $d_\mathrm{OO}=2.6 $Å" + ) + ax.plot( + xyz_pi_hiq[1, :, 50], + xyz_pi_hiq[2, :, 50], + "r", + label=r"PIMD, $d_\mathrm{OO}=2.6 $Å", + ) + ax.plot( + xyz_md_hiq[1, :, 60], + xyz_md_hiq[2, :, 60], + "b--", + label=r"MD, $d_\mathrm{OO}=2.7 $Å", + ) + ax.plot( + xyz_pi_hiq[1, :, 60], + xyz_pi_hiq[2, :, 60], + "r--", + label=r"PIMD, $d_\mathrm{OO}=2.7 $Å", + ) + ax.set_ylim(0.08, 0.6) + ax.legend(ncols=2, loc="upper right", fontsize=9) + ax.set_ylabel(r"$F$ / eV") + ax.set_xlabel(r"$\Delta C_\mathrm{H}$") + plt.show() + + + + +.. image-sg:: /examples/pi-metad/images/sphx_glr_pi-metad_007.png + :alt: pi metad + :srcset: /examples/pi-metad/images/sphx_glr_pi-metad_007.png + :class: sphx-glr-single-img + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 777-784 + +This model system is representative of the behavior of protons +along a hydrogen bond in different conditions, where the environment +determines the typical O-O separation, and whether the proton is shared +(as in high pressure ice X) or preferentially attached to one of the two +molecules. Zero-point energy (and to a lesser extent tunneling) +increases the delocalization, and reduces the barrier for an excess +proton to hop between water molecues. + + +.. rst-class:: sphx-glr-timing + + **Total running time of the script:** (1 minutes 53.200 seconds) + + +.. _sphx_glr_download_examples_pi-metad_pi-metad.py: + +.. only:: html + + .. container:: sphx-glr-footer sphx-glr-footer-example + + + .. container:: sphx-glr-download + + :download:`Download Conda environment file: environment.yml ` + + .. container:: sphx-glr-download + + :download:`Download data files: data.zip ` + .. container:: sphx-glr-download sphx-glr-download-jupyter + + :download:`Download Jupyter notebook: pi-metad.ipynb ` + + .. container:: sphx-glr-download sphx-glr-download-python + + :download:`Download Python source code: pi-metad.py ` + + .. container:: sphx-glr-download sphx-glr-download-zip + + :download:`Download zipped: pi-metad.zip ` + + +.. only:: html + + .. rst-class:: sphx-glr-signature + + `Gallery generated by Sphinx-Gallery `_ + diff --git a/_sources/examples/roy-gch/roy-gch.rst.txt b/_sources/examples/roy-gch/roy-gch.rst.txt new file mode 100644 index 00000000..97d50daa --- /dev/null +++ b/_sources/examples/roy-gch/roy-gch.rst.txt @@ -0,0 +1,586 @@ + +.. DO NOT EDIT. +.. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. +.. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: +.. "examples/roy-gch/roy-gch.py" +.. LINE NUMBERS ARE GIVEN BELOW. + +.. only:: html + + .. note:: + :class: sphx-glr-download-link-note + + :ref:`Go to the end ` + to download the full example code. + +.. rst-class:: sphx-glr-example-title + +.. _sphx_glr_examples_roy-gch_roy-gch.py: + + +Generalized Convex Hull construction for the polymorphs of ROY +============================================================== + +:Authors: Michele Ceriotti `@ceriottm `_ + +This notebook analyzes the structures of 264 polymorphs of ROY, from +`Beran et Al, Chemical Science (2022) `__, +comparing the conventional density-energy convex hull with a Generalized Convex Hull +(GCH) analysis (see `Anelli et al., Phys. Rev. Materials +(2018) `__). +It uses features computed with `rascaline `__ +and uses the directional convex hull function from +`scikit-matter `__ +to make the figure. + +The GCH construction aims at determining structures, among a collection of +candidate configurations, that are stable or have the potential of being stabilized +by appropriate thermodynamic boundary conditions (pressure, doping, external fields, +...). It does so by using microscopic descriptors to determine the diversity of +structures, and assumes that configurations that are stable relative to other +configurations with similar descriptors are those that could be made +"locally" stable by suitable synthesis conditions. + +.. GENERATED FROM PYTHON SOURCE LINES 25-38 + +.. code-block:: Python + + + # sphinx_gallery_thumbnail_number = 3 + import chemiscope + import matplotlib.tri + import numpy as np + from matplotlib import pyplot as plt + from metatensor import mean_over_samples + from rascaline import SoapPowerSpectrum + from sklearn.decomposition import PCA + from skmatter.datasets import load_roy_dataset + from skmatter.sample_selection import DirectionalConvexHull + + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 39-40 + +Loads the structures (that also contain properties in the ``info`` field) + +.. GENERATED FROM PYTHON SOURCE LINES 40-52 + +.. code-block:: Python + + + roy_data = load_roy_dataset() + + structures = roy_data["structures"] + + density = np.array([s.info["density"] for s in structures]) + energy = np.array([s.info["energy"] for s in structures]) + structype = np.array([s.info["type"] for s in structures]) + iknown = np.where(structype == "known")[0] + iothers = np.where(structype != "known")[0] + + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 53-62 + +Energy-density hull +------------------- + +The Directional Convex Hull routines can be used to compute a +conventional density-energy hull (see +`Hautier (2014) +`_ for a pedagogic +introduction to the convex hull construction in the context +of atomistic simulations). + +.. GENERATED FROM PYTHON SOURCE LINES 62-66 + +.. code-block:: Python + + + dch_builder = DirectionalConvexHull(low_dim_idx=[0]) + dch_builder.fit(density.reshape(-1, 1), energy) + + + + + +.. rst-class:: sphx-glr-script-out + + .. code-block:: none + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 67-69 + +We can get the indices of the selection, and compute the distance from +the hull + +.. GENERATED FROM PYTHON SOURCE LINES 69-74 + +.. code-block:: Python + + + sel = dch_builder.selected_idx_ + dch_dist = dch_builder.score_samples(density.reshape(-1, 1), energy) + + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 75-86 + +Hull energies +^^^^^^^^^^^^^ + +Structures on the hull are stable with respect to synthesis at constant +molar volume. Any other structure would lower the energy by decomposing +into a mixture of the two nearest structures along the hull. Given that +the lattice energy is an imperfect proxy for the free energy, and that +synthesis can be performed in other ways than by fixing the density, +structures that are not exactly on the hull might also be stable. One +can compute a “hull energy” as an indication of how close these +structures are to being stable. + +.. GENERATED FROM PYTHON SOURCE LINES 87-102 + +.. code-block:: Python + + + fig, ax = plt.subplots(1, 1, figsize=(6, 4)) + ax.scatter(density, energy, c=dch_dist, marker=".") + ssel = sel[np.argsort(density[sel])] + ax.plot(density[ssel], energy[ssel], "k--") + ax.set_xlabel("density / g/cm$^3$") + ax.set_ylabel("energy / kJ/mol") + plt.show() + + print( + f"Mean hull energy for 'known' stable structures {dch_dist[iknown].mean()} kJ/mol" + ) + print(f"Mean hull energy for 'other' structures {dch_dist[iothers].mean()} kJ/mol") + + + + + +.. image-sg:: /examples/roy-gch/images/sphx_glr_roy-gch_001.png + :alt: roy gch + :srcset: /examples/roy-gch/images/sphx_glr_roy-gch_001.png + :class: sphx-glr-single-img + + +.. rst-class:: sphx-glr-script-out + + .. code-block:: none + + Mean hull energy for 'known' stable structures 1.816657381014075 kJ/mol + Mean hull energy for 'other' structures 6.312730486304906 kJ/mol + + + + +.. GENERATED FROM PYTHON SOURCE LINES 103-108 + +Interactive visualization +^^^^^^^^^^^^^^^^^^^^^^^^^ + +You can also visualize the hull with ``chemiscope`` in a juptyer notebook. + + +.. GENERATED FROM PYTHON SOURCE LINES 108-130 + +.. code-block:: Python + + + cs = chemiscope.show( + structures, + dict( + energy=energy, + density=density, + hull_energy=dch_dist, + structure_type=structype, + ), + settings={ + "map": { + "x": {"property": "density"}, + "y": {"property": "energy"}, + "color": {"property": "hull_energy"}, + "symbol": "structure_type", + "size": {"factor": 35}, + }, + "structure": [{"unitCell": True, "supercell": {"0": 2, "1": 2, "2": 2}}], + }, + ) + cs + + + +.. chemiscope:: _datasets/fig_roy-gch_001.json.gz + :mode: default + + + +.. raw:: html + +
+ +
+
+
+ +.. GENERATED FROM PYTHON SOURCE LINES 131-132 + +Save chemiscope file in a format that can be shared and viewed on `chemiscope.org` + +.. GENERATED FROM PYTHON SOURCE LINES 133-135 + +.. code-block:: Python + + cs.save("roy_ch.json.gz") + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 136-148 + +Generalized Convex Hull +----------------------- + +A GCH is a similar construction, in which generic structural descriptors +are used in lieu of composition, density or other thermodynamic +constraints. The idea is that configurations that are found close to the +GCH are locally stable with respect to structurally-similar +configurations. In other terms, one can hope to find a thermodynamic +constraint (i.e. synthesis conditions) that act differently on these +structures in comparison with the others, and may potentially stabilize +them. + + +.. GENERATED FROM PYTHON SOURCE LINES 151-159 + +Compute structural descriptors +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +A first step is to computes suitable ML descriptors. Here we have used +``rascaline`` to evaluate average SOAP features for the structures. +If you don't want to install these dependencies for this example you +can also use the pre-computed features, but you can use this as a stub +to apply this analysis to other chemical systems + +.. GENERATED FROM PYTHON SOURCE LINES 159-182 + +.. code-block:: Python + + + hypers = { + "cutoff": 4, + "max_radial": 6, + "max_angular": 4, + "atomic_gaussian_width": 0.7, + "cutoff_function": {"ShiftedCosine": {"width": 0.5}}, + "radial_basis": {"Gto": {"accuracy": 1e-6}}, + "center_atom_weight": 1.0, + } + calculator = SoapPowerSpectrum(**hypers) + rho2i = calculator.compute(structures) + rho2i = rho2i.keys_to_samples(["species_center"]).keys_to_properties( + ["species_neighbor_1", "species_neighbor_2"] + ) + rho2i_structure = mean_over_samples(rho2i, sample_names=["center", "species_center"]) + np.savez("roy_features.npz", feats=rho2i_structure.block(0).values) + + + # features = roy_data["features"] + features = rho2i_structure.block(0).values + + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 183-189 + +PCA projection +^^^^^^^^^^^^^^ + +Computes PCA projection to generate low-dimensional descriptors that +reflect structural diversity. Any other dimensionality reduction scheme +could be used in a similar fashion. + +.. GENERATED FROM PYTHON SOURCE LINES 189-202 + +.. code-block:: Python + + + pca = PCA(n_components=4) + pca_features = pca.fit_transform(features) + + fig, ax = plt.subplots(1, 1, figsize=(6, 4)) + scatter = ax.scatter(pca_features[:, 0], pca_features[:, 1], c=energy) + ax.set_xlabel("PCA[1]") + ax.set_ylabel("PCA[2]") + cbar = fig.colorbar(scatter, ax=ax) + cbar.set_label("energy / kJ/mol") + plt.show() + + + + + +.. image-sg:: /examples/roy-gch/images/sphx_glr_roy-gch_002.png + :alt: roy gch + :srcset: /examples/roy-gch/images/sphx_glr_roy-gch_002.png + :class: sphx-glr-single-img + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 203-207 + +Builds the Generalized Convex Hull +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Builds a convex hull on the first two PCA features + +.. GENERATED FROM PYTHON SOURCE LINES 207-214 + +.. code-block:: Python + + + dch_builder = DirectionalConvexHull(low_dim_idx=[0, 1]) + dch_builder.fit(pca_features, energy) + sel = dch_builder.selected_idx_ + dch_dist = dch_builder.score_samples(pca_features, energy) + + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 215-217 + +Generates a 3D Plot + + +.. GENERATED FROM PYTHON SOURCE LINES 217-230 + +.. code-block:: Python + + + triang = matplotlib.tri.Triangulation(pca_features[sel, 0], pca_features[sel, 1]) + fig = plt.figure(figsize=(7, 5), tight_layout=True) + ax = fig.add_subplot(projection="3d") + ax.plot_trisurf(triang, energy[sel], color="gray") + ax.scatter(pca_features[:, 0], pca_features[:, 1], energy, c=dch_dist) + ax.set_xlabel("PCA[1]") + ax.set_ylabel("PCA[2]") + ax.set_zlabel("energy / kJ/mol\n \n", labelpad=11) + ax.view_init(25, 110) + plt.show() + + + + + +.. image-sg:: /examples/roy-gch/images/sphx_glr_roy-gch_003.png + :alt: roy gch + :srcset: /examples/roy-gch/images/sphx_glr_roy-gch_003.png + :class: sphx-glr-single-img + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 231-234 + +The GCH construction improves the separation between the hull energies +of “known” and hypothetical polymorphs (compare with the density-energy +values above) + +.. GENERATED FROM PYTHON SOURCE LINES 234-241 + +.. code-block:: Python + + + print( + f"Mean hull energy for 'known' stable structures {dch_dist[iknown].mean()} kJ/mol" + ) + print(f"Mean hull energy for 'other' structures {dch_dist[iothers].mean()} kJ/mol") + + + + + + +.. rst-class:: sphx-glr-script-out + + .. code-block:: none + + Mean hull energy for 'known' stable structures 0.8537845044740536 kJ/mol + Mean hull energy for 'other' structures 5.19887158185163 kJ/mol + + + + +.. GENERATED FROM PYTHON SOURCE LINES 242-243 + +Visualize in a ``chemiscope`` widget + +.. GENERATED FROM PYTHON SOURCE LINES 243-300 + +.. code-block:: Python + + + for i, f in enumerate(structures): + for j in range(len(pca_features[i])): + f.info["pca_" + str(j + 1)] = pca_features[i, j] + structure_properties = chemiscope.extract_properties(structures) + structure_properties.update({"per_atom_energy": energy, "hull_energy": dch_dist}) + + # You can save a chemiscope file to disk (for viewing on chemiscope.org) + + chemiscope.write_input( + "roy_gch.json.gz", + frames=structures, + properties=structure_properties, + meta={ + "name": "GCH for ROY polymorphs", + "description": """ + Demonstration of the Generalized Convex Hull construction for + polymorphs of the ROY molecule. Molecules that are closest to + the hull built on PCA-based structural descriptors and having the + internal energy predicted by electronic-structure calculations as + the z axis are the most thermodynamically stable. Indeed most of the + known polymorphs of ROY are on (or very close) to this hull. + """, + "authors": ["Michele Ceriotti "], + "references": [ + 'A. Anelli, E. A. Engel, C. J. Pickard, and M. Ceriotti, \ + "Generalized convex hull construction for materials discovery," \ + Physical Review Materials 2(10), 103804 (2018).', + 'G. J. O. Beran, I. J. Sugden, C. Greenwell, D. H. Bowskill, \ + C. C. Pantelides, and C. S. Adjiman, "How many more polymorphs of \ + ROY remain undiscovered," Chem. Sci. 13(5), 1288–1297 (2022).', + ], + }, + settings={ + "map": { + "x": {"property": "pca_1"}, + "y": {"property": "pca_2"}, + "z": {"property": "energy"}, + "symbol": "type", + "color": {"property": "hull_energy"}, + "size": { + "factor": 35, + "mode": "linear", + "property": "", + "reverse": True, + }, + }, + "structure": [ + { + "bonds": True, + "unitCell": True, + "keepOrientation": True, + } + ], + }, + ) + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 301-302 + +... and also load one as an interactive viewer + +.. GENERATED FROM PYTHON SOURCE LINES 303-305 + +.. code-block:: Python + + + chemiscope.show_input("roy_gch.json.gz") + + +.. chemiscope:: _datasets/fig_roy-gch_002.json.gz + :mode: default + + + +.. raw:: html + +
+ +
+
+
+ + +.. rst-class:: sphx-glr-timing + + **Total running time of the script:** (0 minutes 17.619 seconds) + + +.. _sphx_glr_download_examples_roy-gch_roy-gch.py: + +.. only:: html + + .. container:: sphx-glr-footer sphx-glr-footer-example + + + .. container:: sphx-glr-download + + :download:`Download Conda environment file: environment.yml ` + .. container:: sphx-glr-download sphx-glr-download-jupyter + + :download:`Download Jupyter notebook: roy-gch.ipynb ` + + .. container:: sphx-glr-download sphx-glr-download-python + + :download:`Download Python source code: roy-gch.py ` + + .. container:: sphx-glr-download sphx-glr-download-zip + + :download:`Download zipped: roy-gch.zip ` + + +.. only:: html + + .. rst-class:: sphx-glr-signature + + `Gallery generated by Sphinx-Gallery `_ + diff --git a/_sources/examples/sample-selection/sample-selection.rst.txt b/_sources/examples/sample-selection/sample-selection.rst.txt new file mode 100644 index 00000000..f572d946 --- /dev/null +++ b/_sources/examples/sample-selection/sample-selection.rst.txt @@ -0,0 +1,771 @@ + +.. DO NOT EDIT. +.. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. +.. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: +.. "examples/sample-selection/sample-selection.py" +.. LINE NUMBERS ARE GIVEN BELOW. + +.. only:: html + + .. note:: + :class: sphx-glr-download-link-note + + :ref:`Go to the end ` + to download the full example code. + +.. rst-class:: sphx-glr-example-title + +.. _sphx_glr_examples_sample-selection_sample-selection.py: + + +Sample and Feature Selection with FPS and CUR +============================================= + +:Authors: Davide Tisi `@DavideTisi `_ + +In this tutorial we generate descriptors using rascaline, then select a subset +of structures using both the farthest-point sampling (FPS) and CUR algorithms +implemented in scikit-matter. Finally, we also generate a selection of +the most important features using the same techniques. + +First, import all the necessary packages + +.. GENERATED FROM PYTHON SOURCE LINES 16-28 + +.. code-block:: Python + + + import ase.io + import chemiscope + import metatensor + import numpy as np + from equisolve.numpy import feature_selection, sample_selection + from matplotlib import pyplot as plt + from rascaline import SoapPowerSpectrum + from sklearn.decomposition import PCA + from skmatter import feature_selection as skfeat_selection + + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 29-34 + +Load molecular data +------------------- + +Load 500 example BTO structures from file, reading them using +`ASE `_. + +.. GENERATED FROM PYTHON SOURCE LINES 34-39 + +.. code-block:: Python + + + # Load a subset of :download:`structures ` of the example dataset + n_frames = 500 + frames = ase.io.read("input-fps.xyz", f":{n_frames}", format="extxyz") + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 40-44 + +Compute SOAP descriptors using rascaline +---------------------------------------- + +First, define the rascaline hyperparameters used to compute SOAP. + +.. GENERATED FROM PYTHON SOURCE LINES 44-82 + +.. code-block:: Python + + + + # rascaline hyperparameters + hypers = { + "cutoff": 6.0, + "max_radial": 8, + "max_angular": 6, + "atomic_gaussian_width": 0.3, + "cutoff_function": {"ShiftedCosine": {"width": 0.5}}, + "radial_basis": {"Gto": {"accuracy": 1e-6}}, + "radial_scaling": {"Willatt2018": {"exponent": 4, "rate": 1, "scale": 3.5}}, + "center_atom_weight": 1.0, + } + + # Generate a SOAP power spectrum + calculator = SoapPowerSpectrum(**hypers) + rho2i = calculator.compute(frames) + + + # Makes a dense block + atom_soap = rho2i.keys_to_properties(["species_neighbor_1", "species_neighbor_2"]) + + atom_soap_single_block = atom_soap.keys_to_samples(keys_to_move=["species_center"]) + + # Sum over atomic centers to compute structure features + struct_soap = metatensor.sum_over_samples( + atom_soap_single_block, sample_names=["center", "species_center"] + ) + + + print("atom feature descriptor shape:", atom_soap.block(0).values.shape) + print( + "atom feature descriptor (all in one block) shape:", + atom_soap_single_block.block(0).values.shape, + ) + print("structure feature descriptor shape:", struct_soap.block(0).values.shape) + + + + + + +.. rst-class:: sphx-glr-script-out + + .. code-block:: none + + atom feature descriptor shape: (12000, 2688) + atom feature descriptor (all in one block) shape: (20000, 2688) + structure feature descriptor shape: (500, 2688) + + + + +.. GENERATED FROM PYTHON SOURCE LINES 83-99 + +Perform atomic environment (i.e. sample) selection +--------------------------------------------------- + +Using FPS and CUR algorithms, we can perform selection of atomic environments. +These are implemented in equisolve, which provides a wrapper around +scikit-matter to allow for interfacing with data stored in the metatensor +format. + +Suppose we want to select the 10 most diverse environments for each chemical +species. + +First, we can use the `keys_to_properties` operation in metatensor to move the +neighbour species indices to the properties of the TensorBlocks. The resulting +descriptor will be a TensorMap comprised of three blocks, one for each +chemical species, where the chemical species indices are solely present in the +keys. + +.. GENERATED FROM PYTHON SOURCE LINES 99-108 + +.. code-block:: Python + + + + print("----Atomic environment selection-----") + # Define the number of structures to select using FPS/CUR + n_envs = 25 + + print(atom_soap) + print(atom_soap.block(0)) + + + + + +.. rst-class:: sphx-glr-script-out + + .. code-block:: none + + ----Atomic environment selection----- + TensorMap with 3 blocks + keys: species_center + 8 + 22 + 56 + TensorBlock + samples (12000): ['structure', 'center'] + components (): [] + properties (2688): ['species_neighbor_1', 'species_neighbor_2', 'l', 'n1', 'n2'] + gradients: None + + + + +.. GENERATED FROM PYTHON SOURCE LINES 109-110 + +select 10 atomic environments for each chemical species. + +.. GENERATED FROM PYTHON SOURCE LINES 110-131 + +.. code-block:: Python + + + # Define the number of structures *per block* to select using FPS + n_envs = 10 + + # FPS sample selection + selector_atomic_fps = sample_selection.FPS(n_to_select=n_envs, initialize="random").fit( + atom_soap + ) + + # Print the selected envs for each block + print("atomic envs selected with FPS:\n") + for key, block in selector_atomic_fps.support.items(): + print("species_center:", key, "\n(struct_idx, atom_idx)\n", block.samples.values) + + selector_atomic_cur = sample_selection.CUR(n_to_select=n_envs).fit(atom_soap) + # Print the selected envs for each block + print("atomic envs selected with CUR:\n") + for key, block in selector_atomic_cur.support.items(): + print("species_center:", key, "\n(struct_idx, atom_idx)\n", block.samples.values) + + + + + + +.. rst-class:: sphx-glr-script-out + + .. code-block:: none + + atomic envs selected with FPS: + + species_center: LabelsEntry(species_center=8) + (struct_idx, atom_idx) + [[ 68 18] + [113 36] + [140 21] + [285 20] + [339 16] + [339 23] + [339 24] + [341 17] + [347 37] + [436 22]] + species_center: LabelsEntry(species_center=22) + (struct_idx, atom_idx) + [[ 19 11] + [ 55 13] + [166 15] + [198 12] + [216 8] + [285 9] + [324 8] + [341 12] + [433 13] + [466 9]] + species_center: LabelsEntry(species_center=56) + (struct_idx, atom_idx) + [[ 40 7] + [140 2] + [238 3] + [289 6] + [339 3] + [341 4] + [407 0] + [407 7] + [436 6] + [451 7]] + atomic envs selected with CUR: + + species_center: LabelsEntry(species_center=8) + (struct_idx, atom_idx) + [[ 55 21] + [ 68 20] + [ 77 30] + [198 36] + [267 32] + [336 33] + [339 24] + [339 36] + [341 17] + [436 19]] + species_center: LabelsEntry(species_center=22) + (struct_idx, atom_idx) + [[ 10 39] + [ 40 10] + [ 70 10] + [130 10] + [166 15] + [170 14] + [216 8] + [285 9] + [326 10] + [466 10]] + species_center: LabelsEntry(species_center=56) + (struct_idx, atom_idx) + [[ 40 7] + [ 77 3] + [172 3] + [219 7] + [289 6] + [296 2] + [339 5] + [339 6] + [407 0] + [436 2]] + + + + +.. GENERATED FROM PYTHON SOURCE LINES 132-141 + +Selecting from a combined pool of atomic environments +----------------------------------------------------- + +One can also select from a combined pool of atomic environments and +structures, instead of selecting an equal number of atomic environments for +each chemical species. In this case, we can move the 'species_center' key to samples +such that our descriptor is a TensorMap consisting of a single block. Upon +sample selection, the most diverse atomic environments will be selected, +regardless of their chemical species. + +.. GENERATED FROM PYTHON SOURCE LINES 141-163 + +.. code-block:: Python + + print("----All atomic environment selection-----") + + print("keys", atom_soap.keys) + print("blocks", atom_soap[0]) + print("samples in first block", atom_soap[0].samples) + + # Using the original SOAP descriptor, move all keys to properties. + + + # Define the number of structures to select using FPS + n_envs = 10 + + # FPS sample selection + selector_atomic_fps = sample_selection.FPS(n_to_select=n_envs, initialize="random").fit( + atom_soap_single_block + ) + print( + "atomic envs selected with FPS: \n (struct_idx, atom_idx, species_center) \n", + selector_atomic_fps.support.block(0).samples.values, + ) + + + + + + +.. rst-class:: sphx-glr-script-out + + .. code-block:: none + + ----All atomic environment selection----- + keys Labels( + species_center + 8 + 22 + 56 + ) + blocks TensorBlock + samples (12000): ['structure', 'center'] + components (): [] + properties (2688): ['species_neighbor_1', 'species_neighbor_2', 'l', 'n1', 'n2'] + gradients: None + samples in first block Labels( + structure center + 0 16 + 0 17 + ... + 499 30 + 499 31 + ) + atomic envs selected with FPS: + (struct_idx, atom_idx, species_center) + [[ 68 12 22] + [ 77 30 8] + [140 21 8] + [166 15 22] + [216 8 22] + [289 6 56] + [339 18 8] + [407 0 56] + [460 4 56] + [466 34 8]] + + + + +.. GENERATED FROM PYTHON SOURCE LINES 164-175 + +Perform structure (i.e. sample) selection with FPS/CUR +--------------------------------------------------------- + +Instead of atomic environments, one can also select diverse structures. We can +use the `sum_over_samples` operation in metatensor to define features in the +structural basis instead of the atomic basis. This is done by summing over the +atomic environments, labeled by the 'center' index in the samples of the +TensorMap. + +Alternatively, one could use the `mean_over_samples` operation, depending on +the specific inhomogeneity of the size of the structures in the training set. + +.. GENERATED FROM PYTHON SOURCE LINES 175-205 + +.. code-block:: Python + + + print("----Structure selection-----") + + # Define the number of structures to select *per block* using FPS + n_structures = 10 + + # FPS structure selection + selector_struct_fps = sample_selection.FPS( + n_to_select=n_structures, initialize="random" + ).fit(struct_soap) + struct_fps_idxs = selector_struct_fps.support.block(0).samples.values.flatten() + + print("structures selected with FPS:\n", struct_fps_idxs) + + # CUR structure selection + selector_struct_cur = sample_selection.CUR(n_to_select=n_structures).fit(struct_soap) + struct_cur_idxs = selector_struct_cur.support.block(0).samples.values.flatten() + print("structures selected with CUR:\n", struct_cur_idxs) + + + # Slice structure descriptor along axis 0 to contain only the selected structures + struct_soap_fps = struct_soap.block(0).values[struct_fps_idxs, :] + struct_soap_cur = struct_soap.block(0).values[struct_cur_idxs, :] + assert struct_soap_fps.shape == struct_soap_cur.shape + + print("Structure descriptor shape before selection ", struct_soap.block(0).values.shape) + print("Structure descriptor shape after selection (FPS)", struct_soap_fps.shape) + print("Structure descriptor shape after selection (CUR)", struct_soap_cur.shape) + + + + + + +.. rst-class:: sphx-glr-script-out + + .. code-block:: none + + ----Structure selection----- + structures selected with FPS: + [ 15 71 140 167 172 257 317 326 356 496] + structures selected with CUR: + [ 39 40 68 110 140 289 326 386 398 438] + Structure descriptor shape before selection (500, 2688) + Structure descriptor shape after selection (FPS) (10, 2688) + Structure descriptor shape after selection (CUR) (10, 2688) + + + + +.. GENERATED FROM PYTHON SOURCE LINES 206-213 + +Visualize selected structures +----------------------------- + +sklearn can be used to perform PCA dimensionality reduction on the SOAP +descriptors. The resulting PC coordinates can be used to visualize the the +data alongside their structures in a chemiscope widget. + + +.. GENERATED FROM PYTHON SOURCE LINES 213-219 + +.. code-block:: Python + + + # Generate a structure PCA + struct_soap_pca = PCA(n_components=2).fit_transform(struct_soap.block(0).values) + assert struct_soap_pca.shape == (n_frames, 2) + + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 220-225 + +Plot the PCA map +~~~~~~~~~~~~~~~~ + +Notice how the selected points avoid the densely-sampled area, and cover +the periphery of the dataset + +.. GENERATED FROM PYTHON SOURCE LINES 225-242 + +.. code-block:: Python + + + # Matplotlib plot + fig, ax = plt.subplots(1, 1, figsize=(6, 4)) + scatter = ax.scatter(struct_soap_pca[:, 0], struct_soap_pca[:, 1], c="red") + ax.plot( + struct_soap_pca[struct_cur_idxs, 0], + struct_soap_pca[struct_cur_idxs, 1], + "ko", + fillstyle="none", + label="FPS selection", + ) + ax.set_xlabel("PCA[1]") + ax.set_ylabel("PCA[2]") + ax.legend() + fig.show() + + + + + +.. image-sg:: /examples/sample-selection/images/sphx_glr_sample-selection_001.png + :alt: sample selection + :srcset: /examples/sample-selection/images/sphx_glr_sample-selection_001.png + :class: sphx-glr-single-img + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 243-246 + +Creates a chemiscope viewer +~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + +.. GENERATED FROM PYTHON SOURCE LINES 246-294 + +.. code-block:: Python + + + # Selected level + selection_levels = [] + for i in range(len(frames)): + level = 0 + if i in struct_cur_idxs: + level += 1 + if i in struct_fps_idxs: + level += 2 + if level == 0: + level = "Not selected" + elif level == 1: + level = "CUR" + elif level == 2: + level = "FPS" + else: + level = "FPS+CUR" + selection_levels.append(level) + + properties = chemiscope.extract_properties(frames) + + properties.update( + { + "PC1": struct_soap_pca[:, 0], + "PC2": struct_soap_pca[:, 1], + "selection": np.array(selection_levels), + } + ) + + widget = chemiscope.show( + frames, + properties=properties, + settings={ + "map": { + "x": {"property": "PC1"}, + "y": {"property": "PC2"}, + "color": {"property": "energy"}, + "symbol": "selection", + "size": {"factor": 50}, + }, + "structure": [{"unitCell": True}], + }, + ) + widget.save("sample-selection.json.gz") + + # display, if in notebook or sphinx + widget + + + +.. chemiscope:: _datasets/fig_sample-selection_001.json.gz + :mode: default + + +.. rst-class:: sphx-glr-script-out + + .. code-block:: none + + /home/runner/work/atomistic-cookbook/atomistic-cookbook/.nox/sample-selection/lib/python3.11/site-packages/chemiscope/structures/_ase.py:134: UserWarning: the following structure properties are only defined for a subset of frames: ['stress']; they will be ignored + all_names = _ase_list_structure_properties(frames) + /home/runner/work/atomistic-cookbook/atomistic-cookbook/.nox/sample-selection/lib/python3.11/site-packages/chemiscope/structures/__init__.py:93: UserWarning: the following structure properties are only defined for a subset of frames: ['stress']; they will be ignored + return _ase_list_structure_properties(frames) + + +.. raw:: html + +
+ +
+
+
+ +.. GENERATED FROM PYTHON SOURCE LINES 295-301 + +Perform feature selection +------------------------- + +Now perform feature selection. In this example we will go back to using the +descriptor decomposed into atomic environments, as opposed to the one +decomposed into structure environments, but only use FPS for brevity. + +.. GENERATED FROM PYTHON SOURCE LINES 301-328 + +.. code-block:: Python + + print("----Feature selection-----") + + # Define the number of features to select + n_features = 200 + + # FPS feature selection + feat_fps = feature_selection.FPS(n_to_select=n_features, initialize="random").fit( + atom_soap_single_block + ) + + # Slice atomic descriptor along axis 1 to contain only the selected features + # atom_soap_single_block_fps = atom_soap_single_block.block(0).values[:, feat_fps_idxs] + atom_soap_single_block_fps = metatensor.slice( + atom_soap_single_block, + axis="properties", + labels=feat_fps.support.block(0).properties, + ) + + print( + "atomic descriptor shape before selection ", + atom_soap_single_block.block(0).values.shape, + ) + print( + "atomic descriptor shape after selection ", + atom_soap_single_block_fps.block(0).values.shape, + ) + + + + + +.. rst-class:: sphx-glr-script-out + + .. code-block:: none + + ----Feature selection----- + atomic descriptor shape before selection (20000, 2688) + atomic descriptor shape after selection (20000, 200) + + + + +.. GENERATED FROM PYTHON SOURCE LINES 331-337 + +Perform feature selection (skmatter) +------------------------------------ + +Now perform feature selection. In this example we will go back to using the +descriptor decomposed into atomic environments, as opposed to the one +decomposed into structure environments, but only use FPS for brevity. + +.. GENERATED FROM PYTHON SOURCE LINES 337-360 + +.. code-block:: Python + + + print("----Feature selection (skmatter)-----") + + # Define the number of features to select + n_features = 200 + + # FPS feature selection + feat_fps = skfeat_selection.FPS(n_to_select=n_features, initialize="random").fit( + atom_soap_single_block.block(0).values + ) + feat_fps_idxs = feat_fps.selected_idx_ + + print("Feature indices obtained with FPS ", feat_fps_idxs) + + # Slice atomic descriptor along axis 1 to contain only the selected features + atom_dscrptr_fps = atom_soap_single_block.block(0).values[:, feat_fps_idxs] + + print( + "atomic descriptor shape before selection ", + atom_soap_single_block.block(0).values.shape, + ) + print("atomic descriptor shape after selection ", atom_dscrptr_fps.shape) + + + + + +.. rst-class:: sphx-glr-script-out + + .. code-block:: none + + ----Feature selection (skmatter)----- + Feature indices obtained with FPS [2607 0 920 464 3 411 1 488 1824 921 5 465 29 1179 + 27 2240 468 1344 4 2244 602 923 489 274 1825 45 916 1180 + 28 1308 475 470 731 924 46 283 1828 474 450 30 491 2241 + 730 412 2084 12 477 1835 1636 859 476 1827 1796 496 413 931 + 936 21 453 1345 899 466 939 940 11 1816 1324 934 900 948 + 861 928 1490 19 860 925 2 1170 2276 456 1347 1819 1181 1310 + 13 858 1380 36 210 1372 1812 926 929 2195 947 458 1196 451 + 1307 492 2267 472 2212 915 462 449 733 725 922 18 37 2523 + 2532 1365 932 1746 347 473 868 912 502 275 927 1362 2246 1172 + 485 54 504 484 285 866 395 31 499 1348 480 1316 2092 38 + 1805 901 913 1941 723 944 2213 898 1187 1939 941 402 907 1364 + 6 1947 469 1309 467 490 1940 10 905 498 2242 1637 908 904 + 452 2083 942 1820 937 724 1171 500 933 338 420 2524 1682 2254 + 483 2221 22 1792 1764 494 7 738 949 9 2268 1832 1618 1323 + 478 482 950 461] + atomic descriptor shape before selection (20000, 2688) + atomic descriptor shape after selection (20000, 200) + + + + + +.. rst-class:: sphx-glr-timing + + **Total running time of the script:** (0 minutes 22.357 seconds) + + +.. _sphx_glr_download_examples_sample-selection_sample-selection.py: + +.. only:: html + + .. container:: sphx-glr-footer sphx-glr-footer-example + + + .. container:: sphx-glr-download + + :download:`Download Conda environment file: environment.yml ` + .. container:: sphx-glr-download sphx-glr-download-jupyter + + :download:`Download Jupyter notebook: sample-selection.ipynb ` + + .. container:: sphx-glr-download sphx-glr-download-python + + :download:`Download Python source code: sample-selection.py ` + + .. container:: sphx-glr-download sphx-glr-download-zip + + :download:`Download zipped: sample-selection.zip ` + + +.. only:: html + + .. rst-class:: sphx-glr-signature + + `Gallery generated by Sphinx-Gallery `_ + diff --git a/_sources/examples/thermostats/thermostats.rst.txt b/_sources/examples/thermostats/thermostats.rst.txt new file mode 100644 index 00000000..5ba4274e --- /dev/null +++ b/_sources/examples/thermostats/thermostats.rst.txt @@ -0,0 +1,1604 @@ + +.. DO NOT EDIT. +.. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. +.. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: +.. "examples/thermostats/thermostats.py" +.. LINE NUMBERS ARE GIVEN BELOW. + +.. only:: html + + .. note:: + :class: sphx-glr-download-link-note + + :ref:`Go to the end ` + to download the full example code. + +.. rst-class:: sphx-glr-example-title + +.. _sphx_glr_examples_thermostats_thermostats.py: + + +Constant-temperature MD and thermostats +======================================= + +:Authors: Michele Ceriotti `@ceriottm `_ + +This recipe gives a practical introduction to finite-temperature +molecular dynamics simulations, and provides a guide to choose the +most appropriate thermostat for the simulation at hand. + +As for other examples in the cookbook, a small simulation of liquid +water is used as an archetypal example. Molecular dynamics, sampling, +and constant-temperature simulations are discussed in much detail in +the book "Understanding Molecular Simulations" by Daan Frenkel and Berend Smit. +This +`seminal paper by H.C.Andersen `_ +provides a good historical introduction to the problem of +thermostatting, and this +`PhD thesis +`_ +provides a more detailed background to several of the techniques +discussed in this recipe. + +.. GENERATED FROM PYTHON SOURCE LINES 24-27 + +.. code-block:: Python + + + import os + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 28-41 + +.. code-block:: Python + + import subprocess + import time + import xml.etree.ElementTree as ET + + import chemiscope + import ipi + import matplotlib as mpl + import matplotlib.pyplot as plt + import numpy as np + from ipi.utils.tools.acf_xyz import compute_acf_xyz + from ipi.utils.tools.gle import get_gle_matrices, gle_frequency_kernel, isra_deconvolute + + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 42-67 + +Constant-temperature sampling of (thermo)dynamics +------------------------------------------------- + +Even though Hamilton's equations in classical mechanics conserve the total +energy of the group of atoms in a simulation, experimental boundary conditions +usually involve exchange of heat with the surroundings, especially when considering +the relatively small supercells that are often used in simulations. + +The goal of a constant-temperature MD simulation is to compute efficiently thermal +averages of the form :math:`\langle A(q,p)\rangle_\beta`, where the average +of the observable :math:`A(q,p)` is +evaluated over the Boltzmann distribution at inverse temperature +:math:`\beta=1/k_\mathrm{B}T`, +:math:`P(q,p)=Q^{-1} \exp(-\beta(p^2/2m + V(q)))` +In all these scenarios, optimizing the simulation involves reducing as much as +possible the *autocorrelation time* of the observable. + +Constant-temperature sampling is also important when one wants to compute +*dynamical* properties. In principle these would require +constant-energy trajectories, as any thermostatting procedure modifies +the dynamics of the system. However, the initial conditions +should usually be determined from constant-temperature conditions, +averaging over multiple constant-energy trajectories. +As we shall see, this protocol can often be simplified greatly, by choosing +thermostats that don't interfere with the natural microscopic dynamics. + +.. GENERATED FROM PYTHON SOURCE LINES 69-87 + +Running simulations +~~~~~~~~~~~~~~~~~~~ + +We use `i-PI `_ together with a ``LAMMPS`` driver to run +all the simulations in this recipe. The two codes need to be run separately, +and communicate atomic positions, energy and forces through a socket interface. + +The LAMMPS input defines the parameters of the +`q-TIP4P/f water model `_, +while the XML-formatted input of i-PI describes the setup of the +MD simulation. + +We begin running a constant-energy calculation, that +we will use to illustrate the metrics that can be applied to +assess the performance of a thermostatting scheme. If it is the +first time you see an ``i-PI`` input, you may want to look at +the input file side-by-sidewith the +`input reference `_. + +.. GENERATED FROM PYTHON SOURCE LINES 87-93 + +.. code-block:: Python + + + # Open and read the XML file + with open("data/input_nve.xml", "r") as file: + xml_content = file.read() + print(xml_content) + + + + + +.. rst-class:: sphx-glr-script-out + + .. code-block:: none + + + + + [ step, time{picosecond}, conserved{electronvolt}, + temperature{kelvin}, kinetic_md{electronvolt}, potential{electronvolt}, + temperature(H){kelvin}, temperature(O){kelvin} ] + positions + velocities + + 2000 + + 32342 + + +
h2o-lammps
1e-4 +
+ + + data/water_32.pdb + 300 + + + lmpserial + + + 300 + + + + 1.0 + + + +
+ + + + + +.. GENERATED FROM PYTHON SOURCE LINES 94-97 + +The part of the input that describes the molecular dynamics integrator +is the ``motion`` class. For this run, it specifies an *NVE* ensemble, and +a ``timestep`` of 1 fs for the integrator. + +.. GENERATED FROM PYTHON SOURCE LINES 97-101 + +.. code-block:: Python + + + xmlroot = ET.parse("data/input_nve.xml").getroot() + print(" " + ET.tostring(xmlroot.find(".//motion"), encoding="unicode")) + + + + + +.. rst-class:: sphx-glr-script-out + + .. code-block:: none + + + + 1.0 + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 102-108 + +Note that this -- and other runs in this example -- are too short to +provide quantitative results, and you may want to increase the +```` parameter so that the simulation runs for at least +a few tens of ps. The time step of 1 fs is also at the limit of what +is acceptable for running simulations of water. 0.5 fs would be a +safer, stabler value. + +.. GENERATED FROM PYTHON SOURCE LINES 111-122 + +To launch i-PI and LAMMPS from the command line you can just +execute the following commands + +.. code-block:: bash + + i-pi data/input_nve.xml > log & + sleep 2 + lmp -in data/in.lmp & + +To launch the external processes from a Python script +proceed as follows: + +.. GENERATED FROM PYTHON SOURCE LINES 122-129 + +.. code-block:: Python + + + ipi_process = None + if not os.path.exists("simulation_nve.out"): + ipi_process = subprocess.Popen(["i-pi", "data/input_nve.xml"]) + time.sleep(4) # wait for i-PI to start + lmp_process = [subprocess.Popen(["lmp", "-in", "data/in.lmp"]) for i in range(1)] + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 130-133 + +If you run this in a notebook, you can go ahead and start loading +output files *before* i-PI and LAMMPS have finished running, by +skipping this cell + +.. GENERATED FROM PYTHON SOURCE LINES 133-139 + +.. code-block:: Python + + + if ipi_process is not None: + ipi_process.wait() + lmp_process[0].wait() + + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 140-146 + +Analyzing the simulation +~~~~~~~~~~~~~~~~~~~~~~~~ + +After the simulation is finished, we can look at the outputs. +The outputs include the trajectory of positions, the velocities +and a number of energetic observables + +.. GENERATED FROM PYTHON SOURCE LINES 146-150 + +.. code-block:: Python + + + output_data, output_desc = ipi.read_output("simulation_nve.out") + traj_data = ipi.read_trajectory("simulation_nve.pos_0.xyz") + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 151-154 + +The trajectory shows mostly local vibrations on this short time scale, +but if you re-run with a longer ```` settings you should be +able to observe diffusing molecules in the liquid. + +.. GENERATED FROM PYTHON SOURCE LINES 154-163 + +.. code-block:: Python + + + chemiscope.show( + traj_data, + mode="structure", + settings=chemiscope.quick_settings( + trajectory=True, structure_settings={"unitCell": True} + ), + ) + + + +.. chemiscope:: _datasets/fig_thermostats_001.json.gz + :mode: structure + + + +.. raw:: html + +
+ +
+
+
+ +.. GENERATED FROM PYTHON SOURCE LINES 164-170 + +Potential and kinetic energy fluctuate, but the total energy is +(almost) constant, the small fluctuations being due to integration +errors, that are quite large with the long time step used for this +example. If you run with smaller ```` values, you should +see that the energy conservation condition is fulfilled with higher +accuracy. + +.. GENERATED FROM PYTHON SOURCE LINES 170-195 + +.. code-block:: Python + + + fig, ax = plt.subplots(1, 1, figsize=(4, 3), constrained_layout=True) + ax.plot( + output_data["time"], + output_data["potential"] - output_data["potential"][0], + "b-", + label="Potential, $V$", + ) + ax.plot( + output_data["time"], + output_data["kinetic_md"], + "r-", + label="Kinetic, $K$", + ) + ax.plot( + output_data["time"], + output_data["conserved"] - output_data["conserved"][0], + "k-", + label="Conserved, $H$", + ) + ax.set_xlabel(r"$t$ / ps") + ax.set_ylabel(r"energy / eV") + ax.legend() + plt.show() + + + + +.. image-sg:: /examples/thermostats/images/sphx_glr_thermostats_001.png + :alt: thermostats + :srcset: /examples/thermostats/images/sphx_glr_thermostats_001.png + :class: sphx-glr-single-img + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 196-209 + +In a classical MD simulation, based on the momentum :math:`\mathbf{p}` +of each atom, it is possible to evaluate its *kinetic temperature +estimator* :math:`T=\langle \mathbf{p}^2/m \rangle /3k_B` the average is to +be intended over a converged trajectory. Keep in mind that + +1. The *instantaneous* value of this estimator is meaningless +2. It is only well-defined in a constant-temperature simulation, so here + it only gives a sense of whether atomic momenta are close to what one + would expect at 300 K. + +With these caveats in mind, we can observe that the simulation has higher +velocities than expected at 300 K, and that there is no equipartition, the +O atoms having on average a higher energy than the H atoms. + +.. GENERATED FROM PYTHON SOURCE LINES 209-229 + +.. code-block:: Python + + + fig, ax = plt.subplots(1, 1, figsize=(4, 3), constrained_layout=True) + ax.plot( + output_data["time"], + output_data["temperature(O)"], + "r-", + label="O atoms", + ) + ax.plot( + output_data["time"], + output_data["temperature(H)"], + "c-", + label="H atoms", + ) + ax.plot(output_data["time"], output_data["temperature"], "k-", label="All atoms") + ax.set_xlabel(r"$t$ / ps") + ax.set_ylabel(r"$\tilde{T}$ / K") + ax.legend() + plt.show() + + + + +.. image-sg:: /examples/thermostats/images/sphx_glr_thermostats_002.png + :alt: thermostats + :srcset: /examples/thermostats/images/sphx_glr_thermostats_002.png + :class: sphx-glr-single-img + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 230-239 + +In order to investigate the dynamics more carefully, we +compute the velocity-velocity autocorrelation function +:math:`c_{vv}(t)=\sum_i \langle \mathbf{v}_i(t) \cdot \mathbf{v}_i(0) \rangle`. +We use a utility function that reads the outputs of ``i-PI`` +and computes both the autocorrelation function and its Fourier +transform. +:math:`c_{vv}(t)` contains information on the time scale and amplitude +of molecular motion, and is closely related to the vibrational density +of states and to spectroscopic observables such as IR and Raman spectra. + +.. GENERATED FROM PYTHON SOURCE LINES 239-260 + +.. code-block:: Python + + + acf_nve = compute_acf_xyz( + "simulation_nve.vel_0.xyz", + maximum_lag=600, + length_zeropadding=2000, + spectral_windowing="cosine-blackman", + timestep=1, + time_units="femtosecond", + skip=100, + ) + + fig, ax = plt.subplots(1, 1, figsize=(4, 3), constrained_layout=True) + ax.plot( + acf_nve[0][:1200] * 2.4188843e-05, # atomic time to ps + acf_nve[1][:1200] * 1e5, + "r-", + ) + ax.set_xlabel(r"$t$ / ps$") + ax.set_ylabel(r"$c_{vv}$ / arb. units") + plt.show() + + + + +.. image-sg:: /examples/thermostats/images/sphx_glr_thermostats_003.png + :alt: thermostats + :srcset: /examples/thermostats/images/sphx_glr_thermostats_003.png + :class: sphx-glr-single-img + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 261-271 + +The power spectrum (that can be computed as the Fourier transform of +:math:`c_{vv}`) reveals the frequencies of stretching, bending and libration +modes of water; the :math:`\omega\rightarrow 0` limit is proportional +to the diffusion coefficient. +We also load the results from a reference calculation (average of 8 +trajectories initiated from NVT-equilibrated samples, shown as the +confidence interval). You can see how to run these reference calculations +from the script ``data/run_traj.sh``. +The differences are due to the short trajectory, and to the fact that the +NVE trajectory is not equilibrated at 300 K. + +.. GENERATED FROM PYTHON SOURCE LINES 271-293 + +.. code-block:: Python + + + ha2cm1 = 219474.63 + + # Loads reference trajectory + acf_ref = np.loadtxt("data/traj-all_facf.data") + + fig, ax = plt.subplots(1, 1, figsize=(4, 3), constrained_layout=True) + + ax.fill_between( + acf_ref[:1200, 0] * ha2cm1, + (acf_ref[:1200, 1] - acf_ref[:1200, 2]) * 1e5, + (acf_ref[:1200, 1] + acf_ref[:1200, 2]) * 1e5, + color="gray", + label="reference", + ) + + ax.loglog(acf_nve[3][:1200] * ha2cm1, acf_nve[4][:1200] * 1e5, "r-", label="NVE") + ax.set_xlabel(r"$\omega$ / cm$^{-1}$") + ax.set_ylabel(r"$\hat{c}_{vv}$ / arb. units") + ax.legend() + plt.show() + + + + +.. image-sg:: /examples/thermostats/images/sphx_glr_thermostats_004.png + :alt: thermostats + :srcset: /examples/thermostats/images/sphx_glr_thermostats_004.png + :class: sphx-glr-single-img + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 294-329 + +Langevin thermostatting +----------------------- + +In order to perform a simulations that samples configurations +consistent with a Boltzmann distribution :math:`e^{-V(x)/k_B T}` +one needs to modify the equations of motion. There are many +different approaches to do this, some of which lead to deterministic +dynamics; the two more widely used deterministic thermostats +are the +`Berendsen thermostat `_ +which does not sample the Boltzmann distribution exactly and +should never be used given the many more rigorous alternatives, +and the Nosé-Hoover thermostat, that requires a +`"chain" implementation `_ +to be ergodic, which amounts essentially to a complicated way +to generate poor-quality pseudo-random numbers. + +Given the limitations of deterministic thermostats, in this +recipe we focus on stochastic thermostats, that model the +coupling to the chaotic dynamics of an external bath through +explicit random numbers. Langevin dynamics amounts to adding +to Hamilton's equations of motion, for each degree of freedom, +a term of the form + +.. math:: + + \dot{p} = -\gamma p + \sqrt{2\gamma m k_B T} \, \xi(t) + +where :math:` +\gamma` is a friction coefficient, and :math:`\xi` +uncorrelated random numbers that mimic collisions with the bath +particles. The friction can be seen as the inverse of a +characteristic *coupling time scale* +:math:`\tau=1/\gamma` that describes how strongly the bath +interacts with the system. + +.. GENERATED FROM PYTHON SOURCE LINES 331-339 + +Setting up a thermostat in ``i-PI`` +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +In order to set up a thermostat in ``i-PI``, one simply needs +to adjust the ```` block, to perform ``nvt`` dynamics +and include an appropriate ```` section. +Here we use a very-strongly coupled Langevin thermostat, +with :math:`\tau=10~fs`. + +.. GENERATED FROM PYTHON SOURCE LINES 339-343 + +.. code-block:: Python + + + xmlroot = ET.parse("data/input_higamma.xml").getroot() + print(" " + ET.tostring(xmlroot.find(".//dynamics"), encoding="unicode")) + + + + + +.. rst-class:: sphx-glr-script-out + + .. code-block:: none + + + 1.0 + + 10 + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 344-345 + +``i-PI`` and ``LAMMPS`` are launched as above ... + +.. GENERATED FROM PYTHON SOURCE LINES 345-352 + +.. code-block:: Python + + + ipi_process = None + if not os.path.exists("simulation_higamma.out"): + ipi_process = subprocess.Popen(["i-pi", "data/input_higamma.xml"]) + time.sleep(4) # wait for i-PI to start + lmp_process = [subprocess.Popen(["lmp", "-in", "data/in.lmp"]) for i in range(1)] + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 353-355 + +... and you should probably wait until they're done, +it'll take less than a minute. + +.. GENERATED FROM PYTHON SOURCE LINES 355-360 + +.. code-block:: Python + + + if ipi_process is not None: + ipi_process.wait() + lmp_process[0].wait() + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 361-368 + +Analysis of the trajectory +~~~~~~~~~~~~~~~~~~~~~~~~~~ + +The temperature converges very quickly to the target value +(fluctuations are to be expected, given that as discussed above +the temperature estimator is just the instantaneous kinetic energy, +that is not constant). There is also equipartition between O and H. + +.. GENERATED FROM PYTHON SOURCE LINES 368-392 + +.. code-block:: Python + + + output_data, output_desc = ipi.read_output("simulation_higamma.out") + traj_data = ipi.read_trajectory("simulation_higamma.pos_0.xyz") + + fig, ax = plt.subplots(1, 1, figsize=(4, 3), constrained_layout=True) + ax.plot( + output_data["time"], + output_data["temperature(O)"], + "r-", + label="O atoms", + ) + ax.plot( + output_data["time"], + output_data["temperature(H)"], + "c-", + label="H atoms", + ) + ax.plot(output_data["time"], output_data["temperature"], "k-", label="All atoms") + ax.set_xlabel(r"$t$ / ps") + ax.set_ylabel(r"$\tilde{T}$ / K") + ax.legend() + plt.show() + + + + + +.. image-sg:: /examples/thermostats/images/sphx_glr_thermostats_005.png + :alt: thermostats + :srcset: /examples/thermostats/images/sphx_glr_thermostats_005.png + :class: sphx-glr-single-img + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 393-412 + +The velocity-velocity correlation function shows how much +this thermostat affects the system dynamics. The high-frequency peaks, +corresponding to stretches and bending, are +greatly broadened, and the :math:`\omega\rightarrow 0` +limit of :math:`\hat{c}_{vv}`, corresponding to the +diffusion coefficient, is reduced by almost a factor of 5. +This last observation highlights that a too-aggressive +thermostat is not only disrupting the dynamics: +it also slows down diffusion through phase space, +making the dynamics less efficient at sampling slow, +collective motions. We shall see further down various +methods to counteract this effect, but in general one should +use a weaker coupling, that improves the sampling of configuration +space even though it slows down the convergence of the +kinetic energy. If you want a thermostat that equilibrates +aggressively the temperature while disturbing less the diffusive +modes, you may try the *fast-forward Langevin* thermostat +`(Hijazi et al., JCP (2018)) `_ +that can be activated with the option ``mode="ffl"``. + +.. GENERATED FROM PYTHON SOURCE LINES 412-444 + +.. code-block:: Python + + + # compute the v-v acf + acf_higamma = compute_acf_xyz( + "simulation_higamma.vel_0.xyz", + maximum_lag=600, + length_zeropadding=2000, + spectral_windowing="cosine-blackman", + timestep=1, + time_units="femtosecond", + skip=100, + ) + + # and plot + fig, ax = plt.subplots(1, 1, figsize=(4, 3), constrained_layout=True) + ax.fill_between( + acf_ref[:1200, 0] * ha2cm1, + (acf_ref[:1200, 1] - acf_ref[:1200, 2]) * 1e5, + (acf_ref[:1200, 1] + acf_ref[:1200, 2]) * 1e5, + color="gray", + label="reference", + ) + ax.loglog( + acf_higamma[3][:1200] * ha2cm1, + acf_higamma[4][:1200] * 1e5, + "b-", + label=r"Langevin, $\tau=10$fs", + ) + ax.set_xlabel(r"$\omega$ / cm$^{-1}$") + ax.set_ylabel(r"$\hat{c}_{vv}$ / arb. units") + ax.legend() + plt.show() + + + + +.. image-sg:: /examples/thermostats/images/sphx_glr_thermostats_006.png + :alt: thermostats + :srcset: /examples/thermostats/images/sphx_glr_thermostats_006.png + :class: sphx-glr-single-img + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 445-457 + +Global thermostats: stochastic velocity rescaling +------------------------------------------------- + +An alternative approach to sample the canonical Boltzmann +distribution while introducing fewer disturbances to the system +dynamics is to use a *global* thermostat, i.e. a scheme that +targets the *total* kinetic energy of the system, rather than that +of individual degrees of freedom. +We recommend the "stochastic velocity rescaling" thermostat +`(Bussi, Donadio, Parrinello, JCP (2007)) `_ +that acts by rescaling the total momentum vector, adding a +suitably distributed random noise term. + +.. GENERATED FROM PYTHON SOURCE LINES 460-467 + +Setting up a thermostat in ``i-PI`` +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Stochastic velocity rescaling is implemented in ``i-PI`` +can be selected by setting ``mode="svr"``, and has a +``tau`` parameter that corresponds to the time scale of the +coupling. + +.. GENERATED FROM PYTHON SOURCE LINES 467-471 + +.. code-block:: Python + + + xmlroot = ET.parse("data/input_svr.xml").getroot() + print(" " + ET.tostring(xmlroot.find(".//thermostat"), encoding="unicode")) + + + + + +.. rst-class:: sphx-glr-script-out + + .. code-block:: none + + + 10 + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 472-473 + +We run a simulation with the usual set up ... + +.. GENERATED FROM PYTHON SOURCE LINES 473-480 + +.. code-block:: Python + + + ipi_process = None + if not os.path.exists("simulation_svr.out"): + ipi_process = subprocess.Popen(["i-pi", "data/input_svr.xml"]) + time.sleep(4) # wait for i-PI to start + lmp_process = [subprocess.Popen(["lmp", "-in", "data/in.lmp"]) for i in range(1)] + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 481-482 + +... and wait for it to finish. + +.. GENERATED FROM PYTHON SOURCE LINES 482-487 + +.. code-block:: Python + + + if ipi_process is not None: + ipi_process.wait() + lmp_process[0].wait() + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 488-504 + +Analysis of the trajectory +~~~~~~~~~~~~~~~~~~~~~~~~~~ + +The kinetic temperature of the trajectory equilibrates very +rapidly to the target value. However, it takes a bit longer +(approximately 0.5 ps) to reach equipartition between O and H +atoms. This is an important shortcoming of global thermostats: +since they only target the total kinetic energy, they must rely +on internal energy redistribution to reach equilibrium between +different degrees of freedom. +Liquid water is a very ergodic system, in which all degrees of +freedom are strongly coupled, so this is not a major issue. However +care must be taken when modeling a quasi-harmonic crystal (e.g. +diamond, a metal, or an inorganic crystal), or a molecular system +in which the coupling between molecules is weaker (e.g. methane, +or another apolar compound). + +.. GENERATED FROM PYTHON SOURCE LINES 504-528 + +.. code-block:: Python + + + output_data, output_desc = ipi.read_output("simulation_svr.out") + traj_data = ipi.read_trajectory("simulation_svr.pos_0.xyz") + + fig, ax = plt.subplots(1, 1, figsize=(4, 3), constrained_layout=True) + ax.plot( + output_data["time"], + output_data["temperature(O)"], + "r-", + label="O atoms", + ) + ax.plot( + output_data["time"], + output_data["temperature(H)"], + "c-", + label="H atoms", + ) + ax.plot(output_data["time"], output_data["temperature"], "k-", label="All atoms") + ax.set_xlabel(r"$t$ / ps") + ax.set_ylabel(r"$\tilde{T}$ / K") + ax.legend() + plt.show() + + + + + +.. image-sg:: /examples/thermostats/images/sphx_glr_thermostats_007.png + :alt: thermostats + :srcset: /examples/thermostats/images/sphx_glr_thermostats_007.png + :class: sphx-glr-single-img + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 529-540 + +The velocity-velocity autocorrelation function is +essentially indistinguishable from the reference, computed +with an ensemble of NVE trajectories starting from canonical +samples. In fact, the small discrepancies are mostly due to +incomplete convergence of the averages in the short trajectory. + +This highlights the advantages of a global thermostat, that +does not disrupt the natural diffusion in configuration space, +and can often be used to compute dynamical, time-dependent +observables out of a single trajectory -- which is far more +practical than performing a collection of NVE trajectories. + +.. GENERATED FROM PYTHON SOURCE LINES 540-570 + +.. code-block:: Python + + + acf_svr = compute_acf_xyz( + "simulation_svr.vel_0.xyz", + maximum_lag=600, + length_zeropadding=2000, + spectral_windowing="cosine-blackman", + timestep=1, + time_units="femtosecond", + skip=100, + ) + + fig, ax = plt.subplots(1, 1, figsize=(4, 3), constrained_layout=True) + ax.fill_between( + acf_ref[:1200, 0] * ha2cm1, + (acf_ref[:1200, 1] - acf_ref[:1200, 2]) * 1e5, + (acf_ref[:1200, 1] + acf_ref[:1200, 2]) * 1e5, + color="gray", + label="reference", + ) + ax.loglog( + acf_svr[3][:1200] * ha2cm1, + acf_svr[4][:1200] * 1e5, + "b-", + label=r"SVR, $\tau=10$fs", + ) + ax.set_xlabel(r"$\omega$ / cm$^{-1}$") + ax.set_ylabel(r"$\hat{c}_{vv}$ / arb. units") + ax.legend() + plt.show() + + + + +.. image-sg:: /examples/thermostats/images/sphx_glr_thermostats_008.png + :alt: thermostats + :srcset: /examples/thermostats/images/sphx_glr_thermostats_008.png + :class: sphx-glr-single-img + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 571-603 + +Generalized Langevin Equation thermostat +---------------------------------------- + +The issue with a Langevin thermostat is that, for a given coupling +time :math:`\tau`, only molecular motions with a comparable time scale +are sampled efficiently: faster modes are *underdamped*, and slower modes +are *overdamped*, cf. the slowing down of diffusive behavior. + +A possible solution to this problem is using a +*Generalized Langevin Equation (GLE)* thermostat. A GLE +thermostat uses a matrix generalization of the Langevin term, +in which the physical momentum is supplemented by a few fictitious +momenta :math:`\mathbf{s}`, i.e. + +.. math:: + + (\dot{p},\dot{\mathbf{s}}) = -\mathbf{A}_p (p,\mathbf{s})\ + +\mathbf{B}_p (\xi,\boldsymbol{\xi}) + + +Here :math:`\mathbf{A}_p` is the *drift matrix* and :math:`\mathbf{B}_p` +is a diffusion matrix which, for canonical sampling, is determined by the target +temperature and the drift matrix through a fluctuation-dissipation relation. +The key idea is that :math:`\mathbf{A}_p` provides a lot of flexibility in defining +the behavior of the GLE, that can be tuned to achieve near-optimal sampling +for every degree of freedom (effectively acting as if the coupling constant was +tuned separately for slow and fast molecular motions). +The general idea and the practical implementation are discussed in +`(Ceriotti et al. JCTC (2010)) `_ +which also discusses other applications of the same principle, including +performing simulations with a non-equilibrium *quantum thermostat* that +mimics the quantum the quantum mechanical behavior of light nuclei. + +.. GENERATED FROM PYTHON SOURCE LINES 605-620 + +Setting up a thermostat in ``i-PI`` +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +A GLE thermostat can be activated using ``mode="gle"``. +The drift matrix used here has been generated from the +`GLE4MD website `_, using parameters that +aim for the most efficient sampling possible with the short +simulation time (2 ps). The `online generator +`_ +can be tuned to provide the best possible sampling for the system +of interest, the most important parameter being the slowest time scale +that one is interested in sampling (typically a fraction of the total +simulation time). The range of frequencies that is optimized can then +be tuned so as to reach, roughly, the maximum frequency present in the +system. + +.. GENERATED FROM PYTHON SOURCE LINES 620-624 + +.. code-block:: Python + + + xmlroot = ET.parse("data/input_gle.xml").getroot() + print(" " + ET.tostring(xmlroot.find(".//thermostat"), encoding="unicode")) + + + + + +.. rst-class:: sphx-glr-script-out + + .. code-block:: none + + + + [ 8.191023526179e-4, 8.328506066524e-3, 1.657771834013e-3, 9.736989925341e-4, 2.841803794895e-4, -3.176846864198e-5, -2.967010478210e-4, + -8.389856546341e-4, 2.405526974742e-2, -1.507872374848e-2, 2.589784240185e-3, 1.516783633362e-3, -5.958833418565e-4, 4.198422349789e-4, + 7.798710586406e-4, 1.507872374848e-2, 8.569039501219e-3, 6.001000899602e-3, 1.062029383877e-3, 1.093939147968e-3, -2.661575532976e-3, + -9.676783161546e-4, -2.589784240185e-3, -6.001000899602e-3, 2.680459336535e-5, -5.214694469742e-5, 4.231304910751e-4, -2.104894919743e-5, + -2.841997149166e-4, -1.516783633362e-3, -1.062029383877e-3, 5.214694469742e-5, 1.433903506353e-9, -4.241574212449e-5, 7.910178912362e-5, + 3.333208286893e-5, 5.958833418565e-4, -1.093939147968e-3, -4.231304910751e-4, 4.241574212449e-5, 2.385554468441e-8, -3.139255482869e-5, + 2.967533789056e-4, -4.198422349789e-4, 2.661575532976e-3, 2.104894919743e-5, -7.910178912362e-5, 3.139255482869e-5, 2.432567259684e-11 + ] + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 625-626 + +We launch ``i-PI`` as usual ... + +.. GENERATED FROM PYTHON SOURCE LINES 626-633 + +.. code-block:: Python + + + ipi_process = None + if not os.path.exists("simulation_gle.out"): + ipi_process = subprocess.Popen(["i-pi", "data/input_gle.xml"]) + time.sleep(4) # wait for i-PI to start + lmp_process = [subprocess.Popen(["lmp", "-in", "data/in.lmp"]) for i in range(1)] + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 634-635 + +... and wait for simulations to finish. + +.. GENERATED FROM PYTHON SOURCE LINES 635-640 + +.. code-block:: Python + + + if ipi_process is not None: + ipi_process.wait() + lmp_process[0].wait() + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 641-649 + +Analysis of the trajectory +~~~~~~~~~~~~~~~~~~~~~~~~~~ + +The kinetic temperature equilibrates quickly to the target value. +Since the GLE is a local thermostat, targeting each degree of freedom +separately, equipartition is also reached quickly. Sampling is less +fast than with an aggressive Langevin thermostat, because the GLE targets +each vibrational frequency separately, to minimize the impact on diffusion. + +.. GENERATED FROM PYTHON SOURCE LINES 649-672 + +.. code-block:: Python + + output_data, output_desc = ipi.read_output("simulation_gle.out") + traj_data = ipi.read_trajectory("simulation_gle.pos_0.xyz") + + fig, ax = plt.subplots(1, 1, figsize=(4, 3), constrained_layout=True) + ax.plot( + output_data["time"], + output_data["temperature(O)"], + "r-", + label="O atoms", + ) + ax.plot( + output_data["time"], + output_data["temperature(H)"], + "c-", + label="H atoms", + ) + ax.plot(output_data["time"], output_data["temperature"], "k-", label="All atoms") + ax.set_xlabel(r"$t$ / ps") + ax.set_ylabel(r"$\tilde{T}$ / K") + ax.legend() + plt.show() + + + + + +.. image-sg:: /examples/thermostats/images/sphx_glr_thermostats_009.png + :alt: thermostats + :srcset: /examples/thermostats/images/sphx_glr_thermostats_009.png + :class: sphx-glr-single-img + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 673-681 + +:math:`\hat{c}_{vv}` reflects the adaptive behavior of the GLE. +The fast modes are damped aggressively, leading to a large +broadening of the high frequency peaks, but librations and diffusive +modes are much less dampened than in the high-coupling Langevin case. +An optimal-coupling GLE is a safe choice to sample any system, from +molecular liquids to harmonic crystals, although a stochastic velocity +rescaling is preferable if one is interested in preserving the natural +dynamics. + +.. GENERATED FROM PYTHON SOURCE LINES 681-711 + +.. code-block:: Python + + + acf_gle = compute_acf_xyz( + "simulation_gle.vel_0.xyz", + maximum_lag=600, + length_zeropadding=2000, + spectral_windowing="cosine-blackman", + timestep=1, + time_units="femtosecond", + skip=100, + ) + + fig, ax = plt.subplots(1, 1, figsize=(4, 3), constrained_layout=True) + ax.fill_between( + acf_ref[:1200, 0] * ha2cm1, + (acf_ref[:1200, 1] - acf_ref[:1200, 2]) * 1e5, + (acf_ref[:1200, 1] + acf_ref[:1200, 2]) * 1e5, + color="gray", + label="reference", + ) + ax.loglog( + acf_gle[3][:1200] * ha2cm1, + acf_gle[4][:1200] * 1e5, + "b-", + label=r"GLE", + ) + ax.set_xlabel(r"$\omega$ / cm$^{-1}$") + ax.set_ylabel(r"$\hat{c}_{vv}$ / arb. units") + ax.legend() + plt.show() + + + + +.. image-sg:: /examples/thermostats/images/sphx_glr_thermostats_010.png + :alt: thermostats + :srcset: /examples/thermostats/images/sphx_glr_thermostats_010.png + :class: sphx-glr-single-img + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 712-735 + +R-L purification +~~~~~~~~~~~~~~~~ + +What if you also want to extract dynamical information from a GLE +(or Langevin) trajectory? It is actually possible to post-process the +power spectrum, performing a deconvolution based on the amount of +disturbance introduced by the GLE, that can be predicted analytically +in the harmonic limit. +The idea, discussed in `(Rossi et al., JCP (2018)) +`_ +is that if :math:`\hat{y}(\omega)` is the "natural" NVE power +spectrum, and :math:`k_{\mathrm{GLE}}(\omega_0, \omega)` is the power +spectrum predicted for a harmonic oscillator of frequency :math:`\omega_0`, +then the spectrum from the GLE dynamics will be approximately + +.. math:: + + \hat{y}_{\mathrm{GLE}}(\omega) = \int \mathrm{d}\omega' + k_{\mathrm{GLE}}(\omega', \omega) \hat{y}(\omega') + +The kernel can be computed analytically for all frequencies that +are relevant for the power spectrum, based on the GLE parameters +extracted from the input of ``i-PI``. + +.. GENERATED FROM PYTHON SOURCE LINES 735-753 + +.. code-block:: Python + + + n_omega = 1200 + Ap, Cp, Dp = get_gle_matrices("data/input_gle.xml") + gle_kernel = gle_frequency_kernel(acf_gle[3][:n_omega], Ap, Dp) + + + lomega = acf_gle[3][:n_omega] * ha2cm1 + fig, ax = plt.subplots(1, 1, figsize=(4, 3), constrained_layout=True) + levels = np.logspace(np.log10(gle_kernel.min()), np.log10(gle_kernel.max()), num=50) + contour = ax.contourf(lomega, lomega, gle_kernel, norm=mpl.colors.LogNorm()) + ax.set_xscale("log") + ax.set_yscale("log") + ax.set_xlabel(r"$\omega_0$ / cm$^{-1}$") + ax.set_ylabel(r"$\omega$ / cm$^{-1}$") + ax.set_xlim(10, 5000) + ax.set_ylim(10, 5000) + cbar = fig.colorbar(contour, ticks=[1e1, 1e3, 1e5, 1e7]) + + + + +.. image-sg:: /examples/thermostats/images/sphx_glr_thermostats_011.png + :alt: thermostats + :srcset: /examples/thermostats/images/sphx_glr_thermostats_011.png + :class: sphx-glr-single-img + + +.. rst-class:: sphx-glr-script-out + + .. code-block:: none + + + # Initializing system object + # Initializing simulation object + # Initializing from file data/water_32.pdb. Dimension: length, units: angstrom, cell_units: automatic + # Initializing from file data/water_32.pdb. Dimension: length, units: automatic, cell_units: automatic + # Initializing from file data/water_32.pdb. Dimension: length, units: automatic, cell_units: automatic + # Initializing from file data/water_32.pdb. Dimension: length, units: automatic, cell_units: automatic + # Initializing from file data/water_32.pdb. Dimension: length, units: automatic, cell_units: automatic + # Resampling velocities at temperature 300.0 kelvin + + + + +.. GENERATED FROM PYTHON SOURCE LINES 754-757 + +The deconvolution is based on the Iterative Image Space +Reconstruction Algorithm, which preserves the positive-definiteness +of the spectrum + +.. GENERATED FROM PYTHON SOURCE LINES 757-762 + +.. code-block:: Python + + + isra_acf, history, errors, laplace = isra_deconvolute( + acf_gle[3][:n_omega], acf_gle[4][:n_omega], gle_kernel, 64, 4 + ) + + + + + +.. rst-class:: sphx-glr-script-out + + .. code-block:: none + + # error, laplacian = 2.0035857194608525e-08, 5.597931268407369e-11 + # error, laplacian = 2.2056080818736523e-08, 1.7376945463460065e-10 + # error, laplacian = 2.3108219158631213e-08, 4.09763216849384e-10 + # error, laplacian = 2.369196704921211e-08, 7.780582324317745e-10 + # error, laplacian = 2.403580322791337e-08, 1.2694726433106536e-09 + # error, laplacian = 2.4249416522217333e-08, 1.8613480357225975e-09 + # error, laplacian = 2.438911224963073e-08, 2.5265424831388664e-09 + # error, laplacian = 2.4485109864354932e-08, 3.239103110728055e-09 + # error, laplacian = 2.4554211808525377e-08, 3.976973254686062e-09 + # error, laplacian = 2.4606081167050248e-08, 4.722765353502745e-09 + # error, laplacian = 2.4646468346077778e-08, 5.463509169214063e-09 + # error, laplacian = 2.467891320726097e-08, 6.189975719656217e-09 + # error, laplacian = 2.470566688914048e-08, 6.895908466753566e-09 + # error, laplacian = 2.472820607594879e-08, 7.577316415575888e-09 + # error, laplacian = 2.4747528979283516e-08, 8.231884533278532e-09 + + + + +.. GENERATED FROM PYTHON SOURCE LINES 763-767 + +Even though the ISRA algorithm is less prone to enhancing noise than +other deconvolution algorithms, successive iterations sharpen the spectrum +but introduce higher and higher levles of noise, particularly on the +low-frequency end of the spectrum so one has to choose when to stop. + +.. GENERATED FROM PYTHON SOURCE LINES 767-809 + +.. code-block:: Python + + + fig, ax = plt.subplots(1, 1, figsize=(4, 3), constrained_layout=True) + ax.loglog( + acf_gle[3][:1200] * ha2cm1, + acf_gle[4][:1200] * 1e5, + "b-", + label=r"GLE", + ) + ax.loglog( + acf_gle[3][:1200] * ha2cm1, + history[0] * 1e5, + ":", + color="#4000D0", + label=r"iter[1]", + ) + ax.loglog( + acf_gle[3][:1200] * ha2cm1, + history[2] * 1e5, + ":", + color="#A000A0", + label=r"iter[9]", + ) + ax.loglog( + acf_gle[3][:1200] * ha2cm1, + history[4] * 1e5, + ":", + color="#D00040", + label=r"iter[17]", + ) + ax.loglog( + acf_gle[3][:1200] * ha2cm1, + history[12] * 1e5, + ":", + color="#FF0000", + label=r"iter[49]", + ) + + ax.set_xlabel(r"$\omega$ / cm$^{-1}$") + ax.set_ylabel(r"$\hat{c}_{vv}$ / arb. units") + ax.legend() + plt.show() + + + + +.. image-sg:: /examples/thermostats/images/sphx_glr_thermostats_012.png + :alt: thermostats + :srcset: /examples/thermostats/images/sphx_glr_thermostats_012.png + :class: sphx-glr-single-img + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 810-815 + +Especially in the high-frequency region, the deconvolution +algorithm succees in recovering the underlying NVE dynamics, +which can be useful whenever one wants to optimize statistical +efficiency while still being able to estimate dynamical +properties. + +.. GENERATED FROM PYTHON SOURCE LINES 815-842 + +.. code-block:: Python + + + fig, ax = plt.subplots(1, 1, figsize=(4, 3), constrained_layout=True) + ax.fill_between( + acf_ref[:1200, 0] * ha2cm1, + (acf_ref[:1200, 1] - acf_ref[:1200, 2]) * 1e5, + (acf_ref[:1200, 1] + acf_ref[:1200, 2]) * 1e5, + color="gray", + label="reference", + ) + ax.loglog( + acf_gle[3][:1200] * ha2cm1, + acf_gle[4][:1200] * 1e5, + "b-", + label=r"GLE", + ) + ax.loglog( + acf_gle[3][:1200] * ha2cm1, + history[2] * 1e5, + "r-", + label=r"GLE$\rightarrow$ NVE (iter[5])", + ) + ax.set_xlabel(r"$\omega$ / cm$^{-1}$") + ax.set_ylabel(r"$\hat{c}_{vv}$ / arb. units") + ax.legend() + plt.show() + + + + + +.. image-sg:: /examples/thermostats/images/sphx_glr_thermostats_013.png + :alt: thermostats + :srcset: /examples/thermostats/images/sphx_glr_thermostats_013.png + :class: sphx-glr-single-img + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 843-864 + +Running with LAMMPS +~~~~~~~~~~~~~~~~~~~ + +GLE thermostats (as well as conventional Langevin, and +stochastic velocity rescaling) are also implemented natively +in ``LAMMPS``. + +An example of ``LAMMPS`` input containing a GLE thermostat can +be found in ``data/gle.lmp``. See also the +`documentation of the fix gle command +`_ + +.. code-block:: text + + fix 1 all gle 6 300 300 31415 data/smart.A + +The drift matrix can be obtained from the same website, simply +asking to output the matrix in raw format, choosing units consistent +with the ``LAMMPS`` settings, e.g. for this `optimal sampling setup +`_ + + +.. GENERATED FROM PYTHON SOURCE LINES 866-873 + +We can run ``LAMMPS`` from the command line + +.. code-block:: bash + + lmp -in data/gle.lmp & + +or from Python + +.. GENERATED FROM PYTHON SOURCE LINES 873-878 + +.. code-block:: Python + + + lmp_process = None + if not os.path.exists("lammps_out.dat"): + lmp_process = subprocess.Popen(["lmp", "-in", "data/gle.lmp"]) + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 879-881 + +... and wait + + +.. GENERATED FROM PYTHON SOURCE LINES 881-885 + +.. code-block:: Python + + + if lmp_process is not None: + lmp_process.wait() + + + + + + + + +.. GENERATED FROM PYTHON SOURCE LINES 886-890 + +The simulation is much faster (for such a small system and +cheap potential the overhead of ``i-PI``'s client-server mechanism +is substantial) and leads to similar results for the kinetic temperature + + +.. GENERATED FROM PYTHON SOURCE LINES 890-904 + +.. code-block:: Python + + + traj_data = np.loadtxt("lammps_out.dat") + + fig, ax = plt.subplots(1, 1, figsize=(4, 3), constrained_layout=True) + ax.plot( + traj_data[:, 0] * 1e-3, + traj_data[:, 1], + "k-", + label="All atoms", + ) + ax.set_xlabel(r"$t$ / ps") + ax.set_ylabel(r"$\tilde{T}$ / K") + ax.legend() + plt.show() + + + +.. image-sg:: /examples/thermostats/images/sphx_glr_thermostats_014.png + :alt: thermostats + :srcset: /examples/thermostats/images/sphx_glr_thermostats_014.png + :class: sphx-glr-single-img + + + + + + +.. rst-class:: sphx-glr-timing + + **Total running time of the script:** (1 minutes 14.142 seconds) + + +.. _sphx_glr_download_examples_thermostats_thermostats.py: + +.. only:: html + + .. container:: sphx-glr-footer sphx-glr-footer-example + + + .. container:: sphx-glr-download + + :download:`Download Conda environment file: environment.yml ` + + .. container:: sphx-glr-download + + :download:`Download data files: data.zip ` + .. container:: sphx-glr-download sphx-glr-download-jupyter + + :download:`Download Jupyter notebook: thermostats.ipynb ` + + .. container:: sphx-glr-download sphx-glr-download-python + + :download:`Download Python source code: thermostats.py ` + + .. container:: sphx-glr-download sphx-glr-download-zip + + :download:`Download zipped: thermostats.zip ` + + +.. only:: html + + .. rst-class:: sphx-glr-signature + + `Gallery generated by Sphinx-Gallery `_ + diff --git a/_sources/index.rst.txt b/_sources/index.rst.txt new file mode 100644 index 00000000..94d6983b --- /dev/null +++ b/_sources/index.rst.txt @@ -0,0 +1,35 @@ +.. meta:: + :description: Computational recipes for modeling matter at the atomic scale. + Interactive guides that you can also run locally and use as templates for + your own simulations. + :keywords: Atomistic simulations, statistical mechanics, machine learning, + molecular dynamics, quantum chemistry, materials modeling + +The Atomistic Cookbook +====================== + +.. include:: ../../README.rst + :start-after: marker-intro-start + :end-before: marker-intro-end + +Table of contents +~~~~~~~~~~~~~~~~~ + +.. toctree:: + :maxdepth: 1 + + topics/index + software/index + all-examples + downloading + contributing + +Recipe of the day +~~~~~~~~~~~~~~~~~ + +Want to try something new? Each day, one of the recipes in the cookbook +is highlighted on the front page. There is one to suit everyone's taste! + +.. raw:: html + +
diff --git a/_sources/software/chemiscope.rst.txt b/_sources/software/chemiscope.rst.txt new file mode 100644 index 00000000..37b6ed03 --- /dev/null +++ b/_sources/software/chemiscope.rst.txt @@ -0,0 +1,79 @@ +.. _chemiscope: + +chemiscope +========== + +Chemiscope is a tool for interactive exploration of databases of materials and +molecules, correlating local and global structural representations with the +properties of the systems. Chemiscope files can be viewed `online +`_, generated using a `python library +`_ and used inside jupyter notebooks or +sphinx documentations, which is how it's used in the cookbook examples. You can +check the `documentation `_ and the `github +repository `_. + + + +.. grid:: 1 2 2 3 + :gutter: 1 1 2 3 + + .. grid-item:: + .. card:: Generalized Convex Hull construction for the polymorphs of ROY + :link: ../examples/roy-gch/roy-gch + :link-type: doc + :text-align: center + :shadow: md + + .. image:: ../examples/roy-gch/images/thumb/sphx_glr_roy-gch_thumb.png + :alt: This notebook analyzes the structures of 264 polymorphs of ROY, from Beran et Al, Chemical Science (2022), comparing the conventional density-energy convex hull with a Generalized Convex Hull (GCH) analysis (see Anelli et al., Phys. Rev. Materials (2018)). It uses features computed with rascaline and uses the directional convex hull function from scikit-matter to make the figure. + :class: gallery-img + + + .. grid-item:: + .. card:: PCA/PCovR Visualization of a training dataset for a potential + :link: ../examples/gaas-map/gaas-map + :link-type: doc + :text-align: center + :shadow: md + + .. image:: ../examples/gaas-map/images/thumb/sphx_glr_gaas-map_thumb.png + :alt: This example uses rascaline and metatensor to compute structural properties for the structures in a training dataset for a ML potential. These are then used with simple dimensionality reduction algorithms (implemented in sklearn and skmatter) to obtain a simplified description of the dataset, that is then visualized using chemiscope. + :class: gallery-img + + + .. grid-item:: + .. card:: Path integral metadynamics + :link: ../examples/pi-metad/pi-metad + :link-type: doc + :text-align: center + :shadow: md + + .. image:: ../examples/pi-metad/images/thumb/sphx_glr_pi-metad_thumb.png + :alt: This example shows how to run a free-energy sampling calculation that combines path integral molecular dynamics to model nuclear quantum effects and metadynamics to accelerate sampling of the high-free-energy regions. + :class: gallery-img + + + .. grid-item:: + .. card:: Path integral molecular dynamics + :link: ../examples/path-integrals/path-integrals + :link-type: doc + :text-align: center + :shadow: md + + .. image:: ../examples/path-integrals/images/thumb/sphx_glr_path-integrals_thumb.png + :alt: This example shows how to run a path integral molecular dynamics simulation using i-PI, analyze the output and visualize the trajectory in chemiscope. It uses LAMMPS as the driver to simulate the q-TIP4P/f water model. + :class: gallery-img + + + .. grid-item:: + .. card:: Constant-temperature MD and thermostats + :link: ../examples/thermostats/thermostats + :link-type: doc + :text-align: center + :shadow: md + + .. image:: ../examples/thermostats/images/thumb/sphx_glr_thermostats_thumb.png + :alt: This recipe gives a practical introduction to finite-temperature molecular dynamics simulations, and provides a guide to choose the most appropriate thermostat for the simulation at hand. + :class: gallery-img + + \ No newline at end of file diff --git a/_sources/software/cp2k.rst.txt b/_sources/software/cp2k.rst.txt new file mode 100644 index 00000000..8af5aeb1 --- /dev/null +++ b/_sources/software/cp2k.rst.txt @@ -0,0 +1,37 @@ +cp2k +==== + +CP2K is a quantum chemistry and solid state physics software package that can +perform atomistic simulations of solid state, liquid, molecular, periodic, +material, crystal, and biological systems. Learn more about it on its `homepage +`_. + + + +.. grid:: 1 2 2 3 + :gutter: 1 1 2 3 + + .. grid-item:: + .. card:: Batch run of CP2K calculations + :link: ../examples/batch-cp2k/reference-trajectory + :link-type: doc + :text-align: center + :shadow: md + + .. image:: ../examples/batch-cp2k/images/thumb/sphx_glr_reference-trajectory_thumb.png + :alt: This is an example how to perform single point calculations based on list of structures using CP2K using its reftraj functionality. The inputs are a set of structures in :download:`example.xyz` using the DFT parameters defined in :download:`reftraj_template.cp2k`. The reference DFT parameters are taken from Cheng et al. Ab initio thermodynamics of liquid and solid water 2019. Due to the small size of the test structure and convergence issues, we have decreased the size of the CUTOFF_RADIUS from 6.0\,\mathrm{Å} to 3.0\,\mathrm{Å}. For actual production calculations adapt the template! + :class: gallery-img + + + .. grid-item:: + .. card:: Periodic Hamiltonian learning + :link: ../examples/periodic-hamiltonian/periodic-hamiltonian + :link-type: doc + :text-align: center + :shadow: md + + .. image:: ../examples/periodic-hamiltonian/images/thumb/sphx_glr_periodic-hamiltonian_thumb.png + :alt: This tutorial explains how to train a machine learning model for the electronic Hamiltonian of a periodic system. Even though we focus on periodic systems, the code and techniques presented here can be directly transferred to molecules. + :class: gallery-img + + \ No newline at end of file diff --git a/_sources/software/i-pi.rst.txt b/_sources/software/i-pi.rst.txt new file mode 100644 index 00000000..95580f0a --- /dev/null +++ b/_sources/software/i-pi.rst.txt @@ -0,0 +1,63 @@ +i-PI +==== + +i-PI is a universal force engine interface written in Python, designed to be +used together with an ab-initio, machine-learned, or force-field based +evaluation of the interactions between the atoms. You can see learn more about +it on the `ipi-code website `_, the `documentation pages +`_ or `the github repository +`_. + + + +.. grid:: 1 2 2 3 + :gutter: 1 1 2 3 + + .. grid-item:: + .. card:: Constant-temperature MD and thermostats + :link: ../examples/thermostats/thermostats + :link-type: doc + :text-align: center + :shadow: md + + .. image:: ../examples/thermostats/images/thumb/sphx_glr_thermostats_thumb.png + :alt: This recipe gives a practical introduction to finite-temperature molecular dynamics simulations, and provides a guide to choose the most appropriate thermostat for the simulation at hand. + :class: gallery-img + + + .. grid-item:: + .. card:: Path integral molecular dynamics + :link: ../examples/path-integrals/path-integrals + :link-type: doc + :text-align: center + :shadow: md + + .. image:: ../examples/path-integrals/images/thumb/sphx_glr_path-integrals_thumb.png + :alt: This example shows how to run a path integral molecular dynamics simulation using i-PI, analyze the output and visualize the trajectory in chemiscope. It uses LAMMPS as the driver to simulate the q-TIP4P/f water model. + :class: gallery-img + + + .. grid-item:: + .. card:: Path integral metadynamics + :link: ../examples/pi-metad/pi-metad + :link-type: doc + :text-align: center + :shadow: md + + .. image:: ../examples/pi-metad/images/thumb/sphx_glr_pi-metad_thumb.png + :alt: This example shows how to run a free-energy sampling calculation that combines path integral molecular dynamics to model nuclear quantum effects and metadynamics to accelerate sampling of the high-free-energy regions. + :class: gallery-img + + + .. grid-item:: + .. card:: Quantum heat capacity of water + :link: ../examples/heat-capacity/heat-capacity + :link-type: doc + :text-align: center + :shadow: md + + .. image:: ../examples/heat-capacity/images/thumb/sphx_glr_heat-capacity_thumb.png + :alt: This example shows how to estimate the heat capacity of liquid water from a path integral molecular dynamics simulation. The dynamics are run with i-PI, and LAMMPS is used as the driver to simulate the q-TIP4P/f water model. + :class: gallery-img + + \ No newline at end of file diff --git a/_sources/software/index.rst.txt b/_sources/software/index.rst.txt new file mode 100644 index 00000000..c742851b --- /dev/null +++ b/_sources/software/index.rst.txt @@ -0,0 +1,18 @@ +Recipes grouped by software used +================================ + +Cookbook recipes often combine multiple modeling tools. +Here you can find them organized based on the software +they use. They may give you ideas on how to use them +in your own atomistic cooking. + +.. toctree:: + :maxdepth: 1 + + i-pi + chemiscope + rascaline + scikit-matter + cp2k + lammps + plumed diff --git a/_sources/software/lammps.rst.txt b/_sources/software/lammps.rst.txt new file mode 100644 index 00000000..540c39e2 --- /dev/null +++ b/_sources/software/lammps.rst.txt @@ -0,0 +1,50 @@ +LAMMPS +====== + +LAMMPS is a classical molecular dynamics (MD) code, with a focus on materials +simulations. It includes a wealth of interatomic potentials, and of basic and +advanced molecular simulations techniques, and is highly parallelized using an +efficient domain decomposition scheme. Learn more about LAMMPS on its `homepage +`_. + + + +.. grid:: 1 2 2 3 + :gutter: 1 1 2 3 + + .. grid-item:: + .. card:: Constant-temperature MD and thermostats + :link: ../examples/thermostats/thermostats + :link-type: doc + :text-align: center + :shadow: md + + .. image:: ../examples/thermostats/images/thumb/sphx_glr_thermostats_thumb.png + :alt: This recipe gives a practical introduction to finite-temperature molecular dynamics simulations, and provides a guide to choose the most appropriate thermostat for the simulation at hand. + :class: gallery-img + + + .. grid-item:: + .. card:: Path integral molecular dynamics + :link: ../examples/path-integrals/path-integrals + :link-type: doc + :text-align: center + :shadow: md + + .. image:: ../examples/path-integrals/images/thumb/sphx_glr_path-integrals_thumb.png + :alt: This example shows how to run a path integral molecular dynamics simulation using i-PI, analyze the output and visualize the trajectory in chemiscope. It uses LAMMPS as the driver to simulate the q-TIP4P/f water model. + :class: gallery-img + + + .. grid-item:: + .. card:: Quantum heat capacity of water + :link: ../examples/heat-capacity/heat-capacity + :link-type: doc + :text-align: center + :shadow: md + + .. image:: ../examples/heat-capacity/images/thumb/sphx_glr_heat-capacity_thumb.png + :alt: This example shows how to estimate the heat capacity of liquid water from a path integral molecular dynamics simulation. The dynamics are run with i-PI, and LAMMPS is used as the driver to simulate the q-TIP4P/f water model. + :class: gallery-img + + \ No newline at end of file diff --git a/_sources/software/plumed.rst.txt b/_sources/software/plumed.rst.txt new file mode 100644 index 00000000..b46204b3 --- /dev/null +++ b/_sources/software/plumed.rst.txt @@ -0,0 +1,29 @@ +PLUMED +====== + +PLUMED is an open-source, community-developed library that provides a wide range +of different methods, which include enhanced-sampling algorithms, free-energy +methods, tools to analyze the vast amounts of data produced by molecular +dynamics (MD) simulations. These techniques can be used in combination with a +large toolbox of collective variables that describe complex processes in +physics, chemistry, material science, and biology. Documentation, examples and +installation instructions for the various packages are discussed on the `PLUMED +website `_. + + + +.. grid:: 1 2 2 3 + :gutter: 1 1 2 3 + + .. grid-item:: + .. card:: Path integral metadynamics + :link: ../examples/pi-metad/pi-metad + :link-type: doc + :text-align: center + :shadow: md + + .. image:: ../examples/pi-metad/images/thumb/sphx_glr_pi-metad_thumb.png + :alt: This example shows how to run a free-energy sampling calculation that combines path integral molecular dynamics to model nuclear quantum effects and metadynamics to accelerate sampling of the high-free-energy regions. + :class: gallery-img + + \ No newline at end of file diff --git a/_sources/software/rascaline.rst.txt b/_sources/software/rascaline.rst.txt new file mode 100644 index 00000000..aed8fa94 --- /dev/null +++ b/_sources/software/rascaline.rst.txt @@ -0,0 +1,99 @@ +rascaline +========= + +Rascaline is a library for the efficient computing of representations for +atomistic machine learning also called “descriptors” or “fingerprints”. These +representation can be used for atomistic machine learning (ML) models including +ML potentials, visualization or similarity analysis. You can learn how to use it +reading the `documentation `_, and get the latest +version from the `github repository `_ + + + +.. grid:: 1 2 2 3 + :gutter: 1 1 2 3 + + .. grid-item:: + .. card:: PCA/PCovR Visualization of a training dataset for a potential + :link: ../examples/gaas-map/gaas-map + :link-type: doc + :text-align: center + :shadow: md + + .. image:: ../examples/gaas-map/images/thumb/sphx_glr_gaas-map_thumb.png + :alt: This example uses rascaline and metatensor to compute structural properties for the structures in a training dataset for a ML potential. These are then used with simple dimensionality reduction algorithms (implemented in sklearn and skmatter) to obtain a simplified description of the dataset, that is then visualized using chemiscope. + :class: gallery-img + + + .. grid-item:: + .. card:: Local Prediction Rigidity analysis + :link: ../examples/lpr/lpr + :link-type: doc + :text-align: center + :shadow: md + + .. image:: ../examples/lpr/images/thumb/sphx_glr_lpr_thumb.png + :alt: In this tutorial, we calculate the SOAP descriptors of an amorphous silicon dataset using rascaline, then compute the local prediction rigidity (LPR) for the atoms of a "test" set before and after modifications to the "training" dataset has been made. + :class: gallery-img + + + .. grid-item:: + .. card:: A ML model for the electron density of states + :link: ../examples/dos-align/dos-align + :link-type: doc + :text-align: center + :shadow: md + + .. image:: ../examples/dos-align/images/thumb/sphx_glr_dos-align_thumb.png + :alt: This tutorial would go through the entire machine learning framework for the electronic density of states (DOS). It will cover the construction of the DOS and SOAP descriptors from ase Atoms and eigenenergy results. A simple neural network will then be constructed and the model parameters, along with the energy reference will be optimized during training. A total of three energy reference will be used, the average Hartree potential, the Fermi level, and an optimized energy reference starting from the Fermi level energy reference. The performance of each model is then compared. + :class: gallery-img + + + .. grid-item:: + .. card:: Long-distance Equivariants: a tutorial + :link: ../examples/lode-linear/lode-linear + :link-type: doc + :text-align: center + :shadow: md + + .. image:: ../examples/lode-linear/images/thumb/sphx_glr_lode-linear_thumb.png + :alt: This tutorial explains how Long range equivariant descriptors can be constructed using rascaline and the resulting descriptors be used to construct a linear model with equisolve + :class: gallery-img + + + .. grid-item:: + .. card:: Generalized Convex Hull construction for the polymorphs of ROY + :link: ../examples/roy-gch/roy-gch + :link-type: doc + :text-align: center + :shadow: md + + .. image:: ../examples/roy-gch/images/thumb/sphx_glr_roy-gch_thumb.png + :alt: This notebook analyzes the structures of 264 polymorphs of ROY, from Beran et Al, Chemical Science (2022), comparing the conventional density-energy convex hull with a Generalized Convex Hull (GCH) analysis (see Anelli et al., Phys. Rev. Materials (2018)). It uses features computed with rascaline and uses the directional convex hull function from scikit-matter to make the figure. + :class: gallery-img + + + .. grid-item:: + .. card:: Sample and Feature Selection with FPS and CUR + :link: ../examples/sample-selection/sample-selection + :link-type: doc + :text-align: center + :shadow: md + + .. image:: ../examples/sample-selection/images/thumb/sphx_glr_sample-selection_thumb.png + :alt: In this tutorial we generate descriptors using rascaline, then select a subset of structures using both the farthest-point sampling (FPS) and CUR algorithms implemented in scikit-matter. Finally, we also generate a selection of the most important features using the same techniques. + :class: gallery-img + + + .. grid-item:: + .. card:: Periodic Hamiltonian learning + :link: ../examples/periodic-hamiltonian/periodic-hamiltonian + :link-type: doc + :text-align: center + :shadow: md + + .. image:: ../examples/periodic-hamiltonian/images/thumb/sphx_glr_periodic-hamiltonian_thumb.png + :alt: This tutorial explains how to train a machine learning model for the electronic Hamiltonian of a periodic system. Even though we focus on periodic systems, the code and techniques presented here can be directly transferred to molecules. + :class: gallery-img + + \ No newline at end of file diff --git a/_sources/software/scikit-matter.rst.txt b/_sources/software/scikit-matter.rst.txt new file mode 100644 index 00000000..142057a2 --- /dev/null +++ b/_sources/software/scikit-matter.rst.txt @@ -0,0 +1,63 @@ +scikit-matter +============= + +scikit-matter is a toolbox of methods developed in the computational chemical +and materials science community, following the scikit-learn API and coding +guidelines to promote usability and interoperability with existing workflows. +You can get the latest version from its `github repository +`_ and learn how to use +it from its `documentation `_. + + + +.. grid:: 1 2 2 3 + :gutter: 1 1 2 3 + + .. grid-item:: + .. card:: Sample and Feature Selection with FPS and CUR + :link: ../examples/sample-selection/sample-selection + :link-type: doc + :text-align: center + :shadow: md + + .. image:: ../examples/sample-selection/images/thumb/sphx_glr_sample-selection_thumb.png + :alt: In this tutorial we generate descriptors using rascaline, then select a subset of structures using both the farthest-point sampling (FPS) and CUR algorithms implemented in scikit-matter. Finally, we also generate a selection of the most important features using the same techniques. + :class: gallery-img + + + .. grid-item:: + .. card:: Generalized Convex Hull construction for the polymorphs of ROY + :link: ../examples/roy-gch/roy-gch + :link-type: doc + :text-align: center + :shadow: md + + .. image:: ../examples/roy-gch/images/thumb/sphx_glr_roy-gch_thumb.png + :alt: This notebook analyzes the structures of 264 polymorphs of ROY, from Beran et Al, Chemical Science (2022), comparing the conventional density-energy convex hull with a Generalized Convex Hull (GCH) analysis (see Anelli et al., Phys. Rev. Materials (2018)). It uses features computed with rascaline and uses the directional convex hull function from scikit-matter to make the figure. + :class: gallery-img + + + .. grid-item:: + .. card:: Local Prediction Rigidity analysis + :link: ../examples/lpr/lpr + :link-type: doc + :text-align: center + :shadow: md + + .. image:: ../examples/lpr/images/thumb/sphx_glr_lpr_thumb.png + :alt: In this tutorial, we calculate the SOAP descriptors of an amorphous silicon dataset using rascaline, then compute the local prediction rigidity (LPR) for the atoms of a "test" set before and after modifications to the "training" dataset has been made. + :class: gallery-img + + + .. grid-item:: + .. card:: PCA/PCovR Visualization of a training dataset for a potential + :link: ../examples/gaas-map/gaas-map + :link-type: doc + :text-align: center + :shadow: md + + .. image:: ../examples/gaas-map/images/thumb/sphx_glr_gaas-map_thumb.png + :alt: This example uses rascaline and metatensor to compute structural properties for the structures in a training dataset for a ML potential. These are then used with simple dimensionality reduction algorithms (implemented in sklearn and skmatter) to obtain a simplified description of the dataset, that is then visualized using chemiscope. + :class: gallery-img + + \ No newline at end of file diff --git a/_sources/topics/analysis.rst.txt b/_sources/topics/analysis.rst.txt new file mode 100644 index 00000000..6c6b4880 --- /dev/null +++ b/_sources/topics/analysis.rst.txt @@ -0,0 +1,47 @@ +Analysis and post-processing +============================ + +This section contains recipes that analyze the output of a simulation, +for analysis or visualization purposes. + + + +.. grid:: 1 2 2 3 + :gutter: 1 1 2 3 + + .. grid-item:: + .. card:: PCA/PCovR Visualization of a training dataset for a potential + :link: ../examples/gaas-map/gaas-map + :link-type: doc + :text-align: center + :shadow: md + + .. image:: ../examples/gaas-map/images/thumb/sphx_glr_gaas-map_thumb.png + :alt: This example uses rascaline and metatensor to compute structural properties for the structures in a training dataset for a ML potential. These are then used with simple dimensionality reduction algorithms (implemented in sklearn and skmatter) to obtain a simplified description of the dataset, that is then visualized using chemiscope. + :class: gallery-img + + + .. grid-item:: + .. card:: Local Prediction Rigidity analysis + :link: ../examples/lpr/lpr + :link-type: doc + :text-align: center + :shadow: md + + .. image:: ../examples/lpr/images/thumb/sphx_glr_lpr_thumb.png + :alt: In this tutorial, we calculate the SOAP descriptors of an amorphous silicon dataset using rascaline, then compute the local prediction rigidity (LPR) for the atoms of a "test" set before and after modifications to the "training" dataset has been made. + :class: gallery-img + + + .. grid-item:: + .. card:: Generalized Convex Hull construction for the polymorphs of ROY + :link: ../examples/roy-gch/roy-gch + :link-type: doc + :text-align: center + :shadow: md + + .. image:: ../examples/roy-gch/images/thumb/sphx_glr_roy-gch_thumb.png + :alt: This notebook analyzes the structures of 264 polymorphs of ROY, from Beran et Al, Chemical Science (2022), comparing the conventional density-energy convex hull with a Generalized Convex Hull (GCH) analysis (see Anelli et al., Phys. Rev. Materials (2018)). It uses features computed with rascaline and uses the directional convex hull function from scikit-matter to make the figure. + :class: gallery-img + + \ No newline at end of file diff --git a/_sources/topics/index.rst.txt b/_sources/topics/index.rst.txt new file mode 100644 index 00000000..6b9f5be9 --- /dev/null +++ b/_sources/topics/index.rst.txt @@ -0,0 +1,15 @@ +Recipes grouped by topic +======================== + +You can navigate through the various recipes grouped +in thematic areas, including classes of simulation problems +and of modeling techniques. Recipes may be listed in +more than one area, when relevant. + +.. toctree:: + :maxdepth: 1 + + sampling + analysis + ml-models + nqes diff --git a/_sources/topics/ml-models.rst.txt b/_sources/topics/ml-models.rst.txt new file mode 100644 index 00000000..f2fe93d3 --- /dev/null +++ b/_sources/topics/ml-models.rst.txt @@ -0,0 +1,60 @@ +Machine learning models +======================= + +This section contains recipes that concern the training of machine-learning +models, or the pre-processing of data to optimize the model architecture or +data. + + + +.. grid:: 1 2 2 3 + :gutter: 1 1 2 3 + + .. grid-item:: + .. card:: A ML model for the electron density of states + :link: ../examples/dos-align/dos-align + :link-type: doc + :text-align: center + :shadow: md + + .. image:: ../examples/dos-align/images/thumb/sphx_glr_dos-align_thumb.png + :alt: This tutorial would go through the entire machine learning framework for the electronic density of states (DOS). It will cover the construction of the DOS and SOAP descriptors from ase Atoms and eigenenergy results. A simple neural network will then be constructed and the model parameters, along with the energy reference will be optimized during training. A total of three energy reference will be used, the average Hartree potential, the Fermi level, and an optimized energy reference starting from the Fermi level energy reference. The performance of each model is then compared. + :class: gallery-img + + + .. grid-item:: + .. card:: Long-distance Equivariants: a tutorial + :link: ../examples/lode-linear/lode-linear + :link-type: doc + :text-align: center + :shadow: md + + .. image:: ../examples/lode-linear/images/thumb/sphx_glr_lode-linear_thumb.png + :alt: This tutorial explains how Long range equivariant descriptors can be constructed using rascaline and the resulting descriptors be used to construct a linear model with equisolve + :class: gallery-img + + + .. grid-item:: + .. card:: Sample and Feature Selection with FPS and CUR + :link: ../examples/sample-selection/sample-selection + :link-type: doc + :text-align: center + :shadow: md + + .. image:: ../examples/sample-selection/images/thumb/sphx_glr_sample-selection_thumb.png + :alt: In this tutorial we generate descriptors using rascaline, then select a subset of structures using both the farthest-point sampling (FPS) and CUR algorithms implemented in scikit-matter. Finally, we also generate a selection of the most important features using the same techniques. + :class: gallery-img + + + .. grid-item:: + .. card:: Periodic Hamiltonian learning + :link: ../examples/periodic-hamiltonian/periodic-hamiltonian + :link-type: doc + :text-align: center + :shadow: md + + .. image:: ../examples/periodic-hamiltonian/images/thumb/sphx_glr_periodic-hamiltonian_thumb.png + :alt: This tutorial explains how to train a machine learning model for the electronic Hamiltonian of a periodic system. Even though we focus on periodic systems, the code and techniques presented here can be directly transferred to molecules. + :class: gallery-img + + \ No newline at end of file diff --git a/_sources/topics/nqes.rst.txt b/_sources/topics/nqes.rst.txt new file mode 100644 index 00000000..03072b8d --- /dev/null +++ b/_sources/topics/nqes.rst.txt @@ -0,0 +1,49 @@ +Nuclear quantum effects +======================= + +Most atomistic simulations treat nuclei as classical particles, that sample a +Boltzmann distribution. This approximation breaks down for light nuclei +(hydrogen above all) and high-frequency vibrations, requiring more sophisticated +statistical sampling to compute accurate statistical and dynamical properties. + + + +.. grid:: 1 2 2 3 + :gutter: 1 1 2 3 + + .. grid-item:: + .. card:: Path integral molecular dynamics + :link: ../examples/path-integrals/path-integrals + :link-type: doc + :text-align: center + :shadow: md + + .. image:: ../examples/path-integrals/images/thumb/sphx_glr_path-integrals_thumb.png + :alt: This example shows how to run a path integral molecular dynamics simulation using i-PI, analyze the output and visualize the trajectory in chemiscope. It uses LAMMPS as the driver to simulate the q-TIP4P/f water model. + :class: gallery-img + + + .. grid-item:: + .. card:: Path integral metadynamics + :link: ../examples/pi-metad/pi-metad + :link-type: doc + :text-align: center + :shadow: md + + .. image:: ../examples/pi-metad/images/thumb/sphx_glr_pi-metad_thumb.png + :alt: This example shows how to run a free-energy sampling calculation that combines path integral molecular dynamics to model nuclear quantum effects and metadynamics to accelerate sampling of the high-free-energy regions. + :class: gallery-img + + + .. grid-item:: + .. card:: Quantum heat capacity of water + :link: ../examples/heat-capacity/heat-capacity + :link-type: doc + :text-align: center + :shadow: md + + .. image:: ../examples/heat-capacity/images/thumb/sphx_glr_heat-capacity_thumb.png + :alt: This example shows how to estimate the heat capacity of liquid water from a path integral molecular dynamics simulation. The dynamics are run with i-PI, and LAMMPS is used as the driver to simulate the q-TIP4P/f water model. + :class: gallery-img + + \ No newline at end of file diff --git a/_sources/topics/sampling.rst.txt b/_sources/topics/sampling.rst.txt new file mode 100644 index 00000000..129cdb8b --- /dev/null +++ b/_sources/topics/sampling.rst.txt @@ -0,0 +1,72 @@ +Statistical sampling and dynamics +================================= + +This section contains recipes that compute thermodynamic averages by sampling, +evaluates dynamical properties, or otherwise computes the properties of a +set of configurations of an atomistic system. + + + +.. grid:: 1 2 2 3 + :gutter: 1 1 2 3 + + .. grid-item:: + .. card:: Constant-temperature MD and thermostats + :link: ../examples/thermostats/thermostats + :link-type: doc + :text-align: center + :shadow: md + + .. image:: ../examples/thermostats/images/thumb/sphx_glr_thermostats_thumb.png + :alt: This recipe gives a practical introduction to finite-temperature molecular dynamics simulations, and provides a guide to choose the most appropriate thermostat for the simulation at hand. + :class: gallery-img + + + .. grid-item:: + .. card:: Path integral molecular dynamics + :link: ../examples/path-integrals/path-integrals + :link-type: doc + :text-align: center + :shadow: md + + .. image:: ../examples/path-integrals/images/thumb/sphx_glr_path-integrals_thumb.png + :alt: This example shows how to run a path integral molecular dynamics simulation using i-PI, analyze the output and visualize the trajectory in chemiscope. It uses LAMMPS as the driver to simulate the q-TIP4P/f water model. + :class: gallery-img + + + .. grid-item:: + .. card:: Path integral metadynamics + :link: ../examples/pi-metad/pi-metad + :link-type: doc + :text-align: center + :shadow: md + + .. image:: ../examples/pi-metad/images/thumb/sphx_glr_pi-metad_thumb.png + :alt: This example shows how to run a free-energy sampling calculation that combines path integral molecular dynamics to model nuclear quantum effects and metadynamics to accelerate sampling of the high-free-energy regions. + :class: gallery-img + + + .. grid-item:: + .. card:: Batch run of CP2K calculations + :link: ../examples/batch-cp2k/reference-trajectory + :link-type: doc + :text-align: center + :shadow: md + + .. image:: ../examples/batch-cp2k/images/thumb/sphx_glr_reference-trajectory_thumb.png + :alt: This is an example how to perform single point calculations based on list of structures using CP2K using its reftraj functionality. The inputs are a set of structures in :download:`example.xyz` using the DFT parameters defined in :download:`reftraj_template.cp2k`. The reference DFT parameters are taken from Cheng et al. Ab initio thermodynamics of liquid and solid water 2019. Due to the small size of the test structure and convergence issues, we have decreased the size of the CUTOFF_RADIUS from 6.0\,\mathrm{Å} to 3.0\,\mathrm{Å}. For actual production calculations adapt the template! + :class: gallery-img + + + .. grid-item:: + .. card:: Quantum heat capacity of water + :link: ../examples/heat-capacity/heat-capacity + :link-type: doc + :text-align: center + :shadow: md + + .. image:: ../examples/heat-capacity/images/thumb/sphx_glr_heat-capacity_thumb.png + :alt: This example shows how to estimate the heat capacity of liquid water from a path integral molecular dynamics simulation. The dynamics are run with i-PI, and LAMMPS is used as the driver to simulate the q-TIP4P/f water model. + :class: gallery-img + + \ No newline at end of file diff --git a/_sphinx_design_static/design-tabs.js b/_sphinx_design_static/design-tabs.js new file mode 100644 index 00000000..b25bd6a4 --- /dev/null +++ b/_sphinx_design_static/design-tabs.js @@ -0,0 +1,101 @@ +// @ts-check + +// Extra JS capability for selected tabs to be synced +// The selection is stored in local storage so that it persists across page loads. + +/** + * @type {Record} + */ +let sd_id_to_elements = {}; +const storageKeyPrefix = "sphinx-design-tab-id-"; + +/** + * Create a key for a tab element. + * @param {HTMLElement} el - The tab element. + * @returns {[string, string, string] | null} - The key. + * + */ +function create_key(el) { + let syncId = el.getAttribute("data-sync-id"); + let syncGroup = el.getAttribute("data-sync-group"); + if (!syncId || !syncGroup) return null; + return [syncGroup, syncId, syncGroup + "--" + syncId]; +} + +/** + * Initialize the tab selection. + * + */ +function ready() { + // Find all tabs with sync data + + /** @type {string[]} */ + let groups = []; + + document.querySelectorAll(".sd-tab-label").forEach((label) => { + if (label instanceof HTMLElement) { + let data = create_key(label); + if (data) { + let [group, id, key] = data; + + // add click event listener + // @ts-ignore + label.onclick = onSDLabelClick; + + // store map of key to elements + if (!sd_id_to_elements[key]) { + sd_id_to_elements[key] = []; + } + sd_id_to_elements[key].push(label); + + if (groups.indexOf(group) === -1) { + groups.push(group); + // Check if a specific tab has been selected via URL parameter + const tabParam = new URLSearchParams(window.location.search).get( + group + ); + if (tabParam) { + console.log( + "sphinx-design: Selecting tab id for group '" + + group + + "' from URL parameter: " + + tabParam + ); + window.sessionStorage.setItem(storageKeyPrefix + group, tabParam); + } + } + + // Check is a specific tab has been selected previously + let previousId = window.sessionStorage.getItem( + storageKeyPrefix + group + ); + if (previousId === id) { + // console.log( + // "sphinx-design: Selecting tab from session storage: " + id + // ); + // @ts-ignore + label.previousElementSibling.checked = true; + } + } + } + }); +} + +/** + * Activate other tabs with the same sync id. + * + * @this {HTMLElement} - The element that was clicked. + */ +function onSDLabelClick() { + let data = create_key(this); + if (!data) return; + let [group, id, key] = data; + for (const label of sd_id_to_elements[key]) { + if (label === this) continue; + // @ts-ignore + label.previousElementSibling.checked = true; + } + window.sessionStorage.setItem(storageKeyPrefix + group, id); +} + +document.addEventListener("DOMContentLoaded", ready, false); diff --git a/_sphinx_design_static/sphinx-design.min.css b/_sphinx_design_static/sphinx-design.min.css new file mode 100644 index 00000000..860c36da --- /dev/null +++ b/_sphinx_design_static/sphinx-design.min.css @@ -0,0 +1 @@ +.sd-bg-primary{background-color:var(--sd-color-primary) !important}.sd-bg-text-primary{color:var(--sd-color-primary-text) !important}button.sd-bg-primary:focus,button.sd-bg-primary:hover{background-color:var(--sd-color-primary-highlight) !important}a.sd-bg-primary:focus,a.sd-bg-primary:hover{background-color:var(--sd-color-primary-highlight) !important}.sd-bg-secondary{background-color:var(--sd-color-secondary) !important}.sd-bg-text-secondary{color:var(--sd-color-secondary-text) !important}button.sd-bg-secondary:focus,button.sd-bg-secondary:hover{background-color:var(--sd-color-secondary-highlight) !important}a.sd-bg-secondary:focus,a.sd-bg-secondary:hover{background-color:var(--sd-color-secondary-highlight) !important}.sd-bg-success{background-color:var(--sd-color-success) !important}.sd-bg-text-success{color:var(--sd-color-success-text) !important}button.sd-bg-success:focus,button.sd-bg-success:hover{background-color:var(--sd-color-success-highlight) !important}a.sd-bg-success:focus,a.sd-bg-success:hover{background-color:var(--sd-color-success-highlight) !important}.sd-bg-info{background-color:var(--sd-color-info) !important}.sd-bg-text-info{color:var(--sd-color-info-text) !important}button.sd-bg-info:focus,button.sd-bg-info:hover{background-color:var(--sd-color-info-highlight) !important}a.sd-bg-info:focus,a.sd-bg-info:hover{background-color:var(--sd-color-info-highlight) !important}.sd-bg-warning{background-color:var(--sd-color-warning) !important}.sd-bg-text-warning{color:var(--sd-color-warning-text) !important}button.sd-bg-warning:focus,button.sd-bg-warning:hover{background-color:var(--sd-color-warning-highlight) !important}a.sd-bg-warning:focus,a.sd-bg-warning:hover{background-color:var(--sd-color-warning-highlight) !important}.sd-bg-danger{background-color:var(--sd-color-danger) !important}.sd-bg-text-danger{color:var(--sd-color-danger-text) !important}button.sd-bg-danger:focus,button.sd-bg-danger:hover{background-color:var(--sd-color-danger-highlight) !important}a.sd-bg-danger:focus,a.sd-bg-danger:hover{background-color:var(--sd-color-danger-highlight) !important}.sd-bg-light{background-color:var(--sd-color-light) !important}.sd-bg-text-light{color:var(--sd-color-light-text) !important}button.sd-bg-light:focus,button.sd-bg-light:hover{background-color:var(--sd-color-light-highlight) !important}a.sd-bg-light:focus,a.sd-bg-light:hover{background-color:var(--sd-color-light-highlight) !important}.sd-bg-muted{background-color:var(--sd-color-muted) !important}.sd-bg-text-muted{color:var(--sd-color-muted-text) !important}button.sd-bg-muted:focus,button.sd-bg-muted:hover{background-color:var(--sd-color-muted-highlight) !important}a.sd-bg-muted:focus,a.sd-bg-muted:hover{background-color:var(--sd-color-muted-highlight) !important}.sd-bg-dark{background-color:var(--sd-color-dark) !important}.sd-bg-text-dark{color:var(--sd-color-dark-text) !important}button.sd-bg-dark:focus,button.sd-bg-dark:hover{background-color:var(--sd-color-dark-highlight) !important}a.sd-bg-dark:focus,a.sd-bg-dark:hover{background-color:var(--sd-color-dark-highlight) !important}.sd-bg-black{background-color:var(--sd-color-black) !important}.sd-bg-text-black{color:var(--sd-color-black-text) !important}button.sd-bg-black:focus,button.sd-bg-black:hover{background-color:var(--sd-color-black-highlight) !important}a.sd-bg-black:focus,a.sd-bg-black:hover{background-color:var(--sd-color-black-highlight) !important}.sd-bg-white{background-color:var(--sd-color-white) !important}.sd-bg-text-white{color:var(--sd-color-white-text) !important}button.sd-bg-white:focus,button.sd-bg-white:hover{background-color:var(--sd-color-white-highlight) !important}a.sd-bg-white:focus,a.sd-bg-white:hover{background-color:var(--sd-color-white-highlight) !important}.sd-text-primary,.sd-text-primary>p{color:var(--sd-color-primary) !important}a.sd-text-primary:focus,a.sd-text-primary:hover{color:var(--sd-color-primary-highlight) !important}.sd-text-secondary,.sd-text-secondary>p{color:var(--sd-color-secondary) !important}a.sd-text-secondary:focus,a.sd-text-secondary:hover{color:var(--sd-color-secondary-highlight) !important}.sd-text-success,.sd-text-success>p{color:var(--sd-color-success) !important}a.sd-text-success:focus,a.sd-text-success:hover{color:var(--sd-color-success-highlight) !important}.sd-text-info,.sd-text-info>p{color:var(--sd-color-info) !important}a.sd-text-info:focus,a.sd-text-info:hover{color:var(--sd-color-info-highlight) !important}.sd-text-warning,.sd-text-warning>p{color:var(--sd-color-warning) !important}a.sd-text-warning:focus,a.sd-text-warning:hover{color:var(--sd-color-warning-highlight) !important}.sd-text-danger,.sd-text-danger>p{color:var(--sd-color-danger) !important}a.sd-text-danger:focus,a.sd-text-danger:hover{color:var(--sd-color-danger-highlight) !important}.sd-text-light,.sd-text-light>p{color:var(--sd-color-light) !important}a.sd-text-light:focus,a.sd-text-light:hover{color:var(--sd-color-light-highlight) !important}.sd-text-muted,.sd-text-muted>p{color:var(--sd-color-muted) !important}a.sd-text-muted:focus,a.sd-text-muted:hover{color:var(--sd-color-muted-highlight) !important}.sd-text-dark,.sd-text-dark>p{color:var(--sd-color-dark) !important}a.sd-text-dark:focus,a.sd-text-dark:hover{color:var(--sd-color-dark-highlight) !important}.sd-text-black,.sd-text-black>p{color:var(--sd-color-black) !important}a.sd-text-black:focus,a.sd-text-black:hover{color:var(--sd-color-black-highlight) !important}.sd-text-white,.sd-text-white>p{color:var(--sd-color-white) !important}a.sd-text-white:focus,a.sd-text-white:hover{color:var(--sd-color-white-highlight) !important}.sd-outline-primary{border-color:var(--sd-color-primary) !important;border-style:solid !important;border-width:1px !important}a.sd-outline-primary:focus,a.sd-outline-primary:hover{border-color:var(--sd-color-primary-highlight) !important}.sd-outline-secondary{border-color:var(--sd-color-secondary) !important;border-style:solid !important;border-width:1px !important}a.sd-outline-secondary:focus,a.sd-outline-secondary:hover{border-color:var(--sd-color-secondary-highlight) !important}.sd-outline-success{border-color:var(--sd-color-success) !important;border-style:solid !important;border-width:1px !important}a.sd-outline-success:focus,a.sd-outline-success:hover{border-color:var(--sd-color-success-highlight) !important}.sd-outline-info{border-color:var(--sd-color-info) !important;border-style:solid !important;border-width:1px !important}a.sd-outline-info:focus,a.sd-outline-info:hover{border-color:var(--sd-color-info-highlight) !important}.sd-outline-warning{border-color:var(--sd-color-warning) !important;border-style:solid !important;border-width:1px !important}a.sd-outline-warning:focus,a.sd-outline-warning:hover{border-color:var(--sd-color-warning-highlight) !important}.sd-outline-danger{border-color:var(--sd-color-danger) !important;border-style:solid !important;border-width:1px !important}a.sd-outline-danger:focus,a.sd-outline-danger:hover{border-color:var(--sd-color-danger-highlight) !important}.sd-outline-light{border-color:var(--sd-color-light) !important;border-style:solid !important;border-width:1px !important}a.sd-outline-light:focus,a.sd-outline-light:hover{border-color:var(--sd-color-light-highlight) !important}.sd-outline-muted{border-color:var(--sd-color-muted) !important;border-style:solid !important;border-width:1px !important}a.sd-outline-muted:focus,a.sd-outline-muted:hover{border-color:var(--sd-color-muted-highlight) !important}.sd-outline-dark{border-color:var(--sd-color-dark) !important;border-style:solid !important;border-width:1px !important}a.sd-outline-dark:focus,a.sd-outline-dark:hover{border-color:var(--sd-color-dark-highlight) !important}.sd-outline-black{border-color:var(--sd-color-black) !important;border-style:solid !important;border-width:1px !important}a.sd-outline-black:focus,a.sd-outline-black:hover{border-color:var(--sd-color-black-highlight) !important}.sd-outline-white{border-color:var(--sd-color-white) !important;border-style:solid !important;border-width:1px !important}a.sd-outline-white:focus,a.sd-outline-white:hover{border-color:var(--sd-color-white-highlight) !important}.sd-bg-transparent{background-color:transparent !important}.sd-outline-transparent{border-color:transparent !important}.sd-text-transparent{color:transparent !important}.sd-p-0{padding:0 !important}.sd-pt-0,.sd-py-0{padding-top:0 !important}.sd-pr-0,.sd-px-0{padding-right:0 !important}.sd-pb-0,.sd-py-0{padding-bottom:0 !important}.sd-pl-0,.sd-px-0{padding-left:0 !important}.sd-p-1{padding:.25rem !important}.sd-pt-1,.sd-py-1{padding-top:.25rem !important}.sd-pr-1,.sd-px-1{padding-right:.25rem !important}.sd-pb-1,.sd-py-1{padding-bottom:.25rem !important}.sd-pl-1,.sd-px-1{padding-left:.25rem !important}.sd-p-2{padding:.5rem !important}.sd-pt-2,.sd-py-2{padding-top:.5rem !important}.sd-pr-2,.sd-px-2{padding-right:.5rem !important}.sd-pb-2,.sd-py-2{padding-bottom:.5rem !important}.sd-pl-2,.sd-px-2{padding-left:.5rem !important}.sd-p-3{padding:1rem !important}.sd-pt-3,.sd-py-3{padding-top:1rem !important}.sd-pr-3,.sd-px-3{padding-right:1rem !important}.sd-pb-3,.sd-py-3{padding-bottom:1rem !important}.sd-pl-3,.sd-px-3{padding-left:1rem !important}.sd-p-4{padding:1.5rem !important}.sd-pt-4,.sd-py-4{padding-top:1.5rem !important}.sd-pr-4,.sd-px-4{padding-right:1.5rem !important}.sd-pb-4,.sd-py-4{padding-bottom:1.5rem !important}.sd-pl-4,.sd-px-4{padding-left:1.5rem !important}.sd-p-5{padding:3rem !important}.sd-pt-5,.sd-py-5{padding-top:3rem !important}.sd-pr-5,.sd-px-5{padding-right:3rem !important}.sd-pb-5,.sd-py-5{padding-bottom:3rem !important}.sd-pl-5,.sd-px-5{padding-left:3rem !important}.sd-m-auto{margin:auto !important}.sd-mt-auto,.sd-my-auto{margin-top:auto !important}.sd-mr-auto,.sd-mx-auto{margin-right:auto !important}.sd-mb-auto,.sd-my-auto{margin-bottom:auto !important}.sd-ml-auto,.sd-mx-auto{margin-left:auto !important}.sd-m-0{margin:0 !important}.sd-mt-0,.sd-my-0{margin-top:0 !important}.sd-mr-0,.sd-mx-0{margin-right:0 !important}.sd-mb-0,.sd-my-0{margin-bottom:0 !important}.sd-ml-0,.sd-mx-0{margin-left:0 !important}.sd-m-1{margin:.25rem !important}.sd-mt-1,.sd-my-1{margin-top:.25rem !important}.sd-mr-1,.sd-mx-1{margin-right:.25rem !important}.sd-mb-1,.sd-my-1{margin-bottom:.25rem !important}.sd-ml-1,.sd-mx-1{margin-left:.25rem !important}.sd-m-2{margin:.5rem !important}.sd-mt-2,.sd-my-2{margin-top:.5rem !important}.sd-mr-2,.sd-mx-2{margin-right:.5rem !important}.sd-mb-2,.sd-my-2{margin-bottom:.5rem !important}.sd-ml-2,.sd-mx-2{margin-left:.5rem !important}.sd-m-3{margin:1rem !important}.sd-mt-3,.sd-my-3{margin-top:1rem !important}.sd-mr-3,.sd-mx-3{margin-right:1rem !important}.sd-mb-3,.sd-my-3{margin-bottom:1rem !important}.sd-ml-3,.sd-mx-3{margin-left:1rem !important}.sd-m-4{margin:1.5rem !important}.sd-mt-4,.sd-my-4{margin-top:1.5rem !important}.sd-mr-4,.sd-mx-4{margin-right:1.5rem !important}.sd-mb-4,.sd-my-4{margin-bottom:1.5rem !important}.sd-ml-4,.sd-mx-4{margin-left:1.5rem !important}.sd-m-5{margin:3rem !important}.sd-mt-5,.sd-my-5{margin-top:3rem !important}.sd-mr-5,.sd-mx-5{margin-right:3rem !important}.sd-mb-5,.sd-my-5{margin-bottom:3rem !important}.sd-ml-5,.sd-mx-5{margin-left:3rem !important}.sd-w-25{width:25% !important}.sd-w-50{width:50% !important}.sd-w-75{width:75% !important}.sd-w-100{width:100% !important}.sd-w-auto{width:auto !important}.sd-h-25{height:25% !important}.sd-h-50{height:50% !important}.sd-h-75{height:75% !important}.sd-h-100{height:100% !important}.sd-h-auto{height:auto !important}.sd-d-none{display:none !important}.sd-d-inline{display:inline !important}.sd-d-inline-block{display:inline-block !important}.sd-d-block{display:block !important}.sd-d-grid{display:grid !important}.sd-d-flex-row{display:-ms-flexbox !important;display:flex !important;flex-direction:row !important}.sd-d-flex-column{display:-ms-flexbox !important;display:flex !important;flex-direction:column !important}.sd-d-inline-flex{display:-ms-inline-flexbox !important;display:inline-flex !important}@media(min-width: 576px){.sd-d-sm-none{display:none !important}.sd-d-sm-inline{display:inline !important}.sd-d-sm-inline-block{display:inline-block !important}.sd-d-sm-block{display:block !important}.sd-d-sm-grid{display:grid !important}.sd-d-sm-flex{display:-ms-flexbox !important;display:flex !important}.sd-d-sm-inline-flex{display:-ms-inline-flexbox !important;display:inline-flex !important}}@media(min-width: 768px){.sd-d-md-none{display:none !important}.sd-d-md-inline{display:inline !important}.sd-d-md-inline-block{display:inline-block !important}.sd-d-md-block{display:block !important}.sd-d-md-grid{display:grid !important}.sd-d-md-flex{display:-ms-flexbox !important;display:flex !important}.sd-d-md-inline-flex{display:-ms-inline-flexbox !important;display:inline-flex !important}}@media(min-width: 992px){.sd-d-lg-none{display:none !important}.sd-d-lg-inline{display:inline !important}.sd-d-lg-inline-block{display:inline-block !important}.sd-d-lg-block{display:block !important}.sd-d-lg-grid{display:grid !important}.sd-d-lg-flex{display:-ms-flexbox !important;display:flex !important}.sd-d-lg-inline-flex{display:-ms-inline-flexbox !important;display:inline-flex !important}}@media(min-width: 1200px){.sd-d-xl-none{display:none !important}.sd-d-xl-inline{display:inline !important}.sd-d-xl-inline-block{display:inline-block !important}.sd-d-xl-block{display:block !important}.sd-d-xl-grid{display:grid !important}.sd-d-xl-flex{display:-ms-flexbox !important;display:flex !important}.sd-d-xl-inline-flex{display:-ms-inline-flexbox !important;display:inline-flex !important}}.sd-align-major-start{justify-content:flex-start !important}.sd-align-major-end{justify-content:flex-end !important}.sd-align-major-center{justify-content:center !important}.sd-align-major-justify{justify-content:space-between !important}.sd-align-major-spaced{justify-content:space-evenly !important}.sd-align-minor-start{align-items:flex-start !important}.sd-align-minor-end{align-items:flex-end !important}.sd-align-minor-center{align-items:center !important}.sd-align-minor-stretch{align-items:stretch !important}.sd-text-justify{text-align:justify !important}.sd-text-left{text-align:left !important}.sd-text-right{text-align:right !important}.sd-text-center{text-align:center !important}.sd-font-weight-light{font-weight:300 !important}.sd-font-weight-lighter{font-weight:lighter !important}.sd-font-weight-normal{font-weight:400 !important}.sd-font-weight-bold{font-weight:700 !important}.sd-font-weight-bolder{font-weight:bolder !important}.sd-font-italic{font-style:italic !important}.sd-text-decoration-none{text-decoration:none !important}.sd-text-lowercase{text-transform:lowercase !important}.sd-text-uppercase{text-transform:uppercase !important}.sd-text-capitalize{text-transform:capitalize !important}.sd-text-wrap{white-space:normal !important}.sd-text-nowrap{white-space:nowrap !important}.sd-text-truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.sd-fs-1,.sd-fs-1>p{font-size:calc(1.375rem + 1.5vw) !important;line-height:unset !important}.sd-fs-2,.sd-fs-2>p{font-size:calc(1.325rem + 0.9vw) !important;line-height:unset !important}.sd-fs-3,.sd-fs-3>p{font-size:calc(1.3rem + 0.6vw) !important;line-height:unset !important}.sd-fs-4,.sd-fs-4>p{font-size:calc(1.275rem + 0.3vw) !important;line-height:unset !important}.sd-fs-5,.sd-fs-5>p{font-size:1.25rem !important;line-height:unset !important}.sd-fs-6,.sd-fs-6>p{font-size:1rem !important;line-height:unset !important}.sd-border-0{border:0 solid !important}.sd-border-top-0{border-top:0 solid !important}.sd-border-bottom-0{border-bottom:0 solid !important}.sd-border-right-0{border-right:0 solid !important}.sd-border-left-0{border-left:0 solid !important}.sd-border-1{border:1px solid !important}.sd-border-top-1{border-top:1px solid !important}.sd-border-bottom-1{border-bottom:1px solid !important}.sd-border-right-1{border-right:1px solid !important}.sd-border-left-1{border-left:1px solid !important}.sd-border-2{border:2px solid !important}.sd-border-top-2{border-top:2px solid !important}.sd-border-bottom-2{border-bottom:2px solid !important}.sd-border-right-2{border-right:2px solid !important}.sd-border-left-2{border-left:2px solid !important}.sd-border-3{border:3px solid !important}.sd-border-top-3{border-top:3px solid !important}.sd-border-bottom-3{border-bottom:3px solid !important}.sd-border-right-3{border-right:3px solid !important}.sd-border-left-3{border-left:3px solid !important}.sd-border-4{border:4px solid !important}.sd-border-top-4{border-top:4px solid !important}.sd-border-bottom-4{border-bottom:4px solid !important}.sd-border-right-4{border-right:4px solid !important}.sd-border-left-4{border-left:4px solid !important}.sd-border-5{border:5px solid !important}.sd-border-top-5{border-top:5px solid !important}.sd-border-bottom-5{border-bottom:5px solid !important}.sd-border-right-5{border-right:5px solid !important}.sd-border-left-5{border-left:5px solid !important}.sd-rounded-0{border-radius:0 !important}.sd-rounded-1{border-radius:.2rem !important}.sd-rounded-2{border-radius:.3rem !important}.sd-rounded-3{border-radius:.5rem !important}.sd-rounded-pill{border-radius:50rem !important}.sd-rounded-circle{border-radius:50% !important}.shadow-none{box-shadow:none !important}.sd-shadow-sm{box-shadow:0 .125rem .25rem var(--sd-color-shadow) !important}.sd-shadow-md{box-shadow:0 .5rem 1rem var(--sd-color-shadow) !important}.sd-shadow-lg{box-shadow:0 1rem 3rem var(--sd-color-shadow) !important}@keyframes sd-slide-from-left{0%{transform:translateX(-100%)}100%{transform:translateX(0)}}@keyframes sd-slide-from-right{0%{transform:translateX(200%)}100%{transform:translateX(0)}}@keyframes sd-grow100{0%{transform:scale(0);opacity:.5}100%{transform:scale(1);opacity:1}}@keyframes sd-grow50{0%{transform:scale(0.5);opacity:.5}100%{transform:scale(1);opacity:1}}@keyframes sd-grow50-rot20{0%{transform:scale(0.5) rotateZ(-20deg);opacity:.5}75%{transform:scale(1) rotateZ(5deg);opacity:1}95%{transform:scale(1) rotateZ(-1deg);opacity:1}100%{transform:scale(1) rotateZ(0);opacity:1}}.sd-animate-slide-from-left{animation:1s ease-out 0s 1 normal none running sd-slide-from-left}.sd-animate-slide-from-right{animation:1s ease-out 0s 1 normal none running sd-slide-from-right}.sd-animate-grow100{animation:1s ease-out 0s 1 normal none running sd-grow100}.sd-animate-grow50{animation:1s ease-out 0s 1 normal none running sd-grow50}.sd-animate-grow50-rot20{animation:1s ease-out 0s 1 normal none running sd-grow50-rot20}.sd-badge{display:inline-block;padding:.35em .65em;font-size:.75em;font-weight:700;line-height:1;text-align:center;white-space:nowrap;vertical-align:baseline;border-radius:.25rem}.sd-badge:empty{display:none}a.sd-badge{text-decoration:none}.sd-btn .sd-badge{position:relative;top:-1px}.sd-btn{background-color:transparent;border:1px solid transparent;border-radius:.25rem;cursor:pointer;display:inline-block;font-weight:400;font-size:1rem;line-height:1.5;padding:.375rem .75rem;text-align:center;text-decoration:none;transition:color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;vertical-align:middle;user-select:none;-moz-user-select:none;-ms-user-select:none;-webkit-user-select:none}.sd-btn:hover{text-decoration:none}@media(prefers-reduced-motion: reduce){.sd-btn{transition:none}}.sd-btn-primary,.sd-btn-outline-primary:hover,.sd-btn-outline-primary:focus{color:var(--sd-color-primary-text) !important;background-color:var(--sd-color-primary) !important;border-color:var(--sd-color-primary) !important;border-width:1px !important;border-style:solid !important}.sd-btn-primary:hover,.sd-btn-primary:focus{color:var(--sd-color-primary-text) !important;background-color:var(--sd-color-primary-highlight) !important;border-color:var(--sd-color-primary-highlight) !important;border-width:1px !important;border-style:solid !important}.sd-btn-outline-primary{color:var(--sd-color-primary) !important;border-color:var(--sd-color-primary) !important;border-width:1px !important;border-style:solid !important}.sd-btn-secondary,.sd-btn-outline-secondary:hover,.sd-btn-outline-secondary:focus{color:var(--sd-color-secondary-text) !important;background-color:var(--sd-color-secondary) !important;border-color:var(--sd-color-secondary) !important;border-width:1px !important;border-style:solid !important}.sd-btn-secondary:hover,.sd-btn-secondary:focus{color:var(--sd-color-secondary-text) !important;background-color:var(--sd-color-secondary-highlight) !important;border-color:var(--sd-color-secondary-highlight) !important;border-width:1px !important;border-style:solid !important}.sd-btn-outline-secondary{color:var(--sd-color-secondary) !important;border-color:var(--sd-color-secondary) !important;border-width:1px !important;border-style:solid !important}.sd-btn-success,.sd-btn-outline-success:hover,.sd-btn-outline-success:focus{color:var(--sd-color-success-text) !important;background-color:var(--sd-color-success) !important;border-color:var(--sd-color-success) !important;border-width:1px !important;border-style:solid !important}.sd-btn-success:hover,.sd-btn-success:focus{color:var(--sd-color-success-text) !important;background-color:var(--sd-color-success-highlight) !important;border-color:var(--sd-color-success-highlight) !important;border-width:1px !important;border-style:solid !important}.sd-btn-outline-success{color:var(--sd-color-success) !important;border-color:var(--sd-color-success) !important;border-width:1px !important;border-style:solid !important}.sd-btn-info,.sd-btn-outline-info:hover,.sd-btn-outline-info:focus{color:var(--sd-color-info-text) !important;background-color:var(--sd-color-info) !important;border-color:var(--sd-color-info) !important;border-width:1px !important;border-style:solid !important}.sd-btn-info:hover,.sd-btn-info:focus{color:var(--sd-color-info-text) !important;background-color:var(--sd-color-info-highlight) !important;border-color:var(--sd-color-info-highlight) !important;border-width:1px !important;border-style:solid !important}.sd-btn-outline-info{color:var(--sd-color-info) !important;border-color:var(--sd-color-info) !important;border-width:1px !important;border-style:solid !important}.sd-btn-warning,.sd-btn-outline-warning:hover,.sd-btn-outline-warning:focus{color:var(--sd-color-warning-text) !important;background-color:var(--sd-color-warning) !important;border-color:var(--sd-color-warning) !important;border-width:1px !important;border-style:solid !important}.sd-btn-warning:hover,.sd-btn-warning:focus{color:var(--sd-color-warning-text) !important;background-color:var(--sd-color-warning-highlight) !important;border-color:var(--sd-color-warning-highlight) !important;border-width:1px !important;border-style:solid !important}.sd-btn-outline-warning{color:var(--sd-color-warning) !important;border-color:var(--sd-color-warning) !important;border-width:1px !important;border-style:solid !important}.sd-btn-danger,.sd-btn-outline-danger:hover,.sd-btn-outline-danger:focus{color:var(--sd-color-danger-text) !important;background-color:var(--sd-color-danger) !important;border-color:var(--sd-color-danger) !important;border-width:1px !important;border-style:solid !important}.sd-btn-danger:hover,.sd-btn-danger:focus{color:var(--sd-color-danger-text) !important;background-color:var(--sd-color-danger-highlight) !important;border-color:var(--sd-color-danger-highlight) !important;border-width:1px !important;border-style:solid !important}.sd-btn-outline-danger{color:var(--sd-color-danger) !important;border-color:var(--sd-color-danger) !important;border-width:1px !important;border-style:solid !important}.sd-btn-light,.sd-btn-outline-light:hover,.sd-btn-outline-light:focus{color:var(--sd-color-light-text) !important;background-color:var(--sd-color-light) !important;border-color:var(--sd-color-light) !important;border-width:1px !important;border-style:solid !important}.sd-btn-light:hover,.sd-btn-light:focus{color:var(--sd-color-light-text) !important;background-color:var(--sd-color-light-highlight) !important;border-color:var(--sd-color-light-highlight) !important;border-width:1px !important;border-style:solid !important}.sd-btn-outline-light{color:var(--sd-color-light) !important;border-color:var(--sd-color-light) !important;border-width:1px !important;border-style:solid !important}.sd-btn-muted,.sd-btn-outline-muted:hover,.sd-btn-outline-muted:focus{color:var(--sd-color-muted-text) !important;background-color:var(--sd-color-muted) !important;border-color:var(--sd-color-muted) !important;border-width:1px !important;border-style:solid !important}.sd-btn-muted:hover,.sd-btn-muted:focus{color:var(--sd-color-muted-text) !important;background-color:var(--sd-color-muted-highlight) !important;border-color:var(--sd-color-muted-highlight) !important;border-width:1px !important;border-style:solid !important}.sd-btn-outline-muted{color:var(--sd-color-muted) !important;border-color:var(--sd-color-muted) !important;border-width:1px !important;border-style:solid !important}.sd-btn-dark,.sd-btn-outline-dark:hover,.sd-btn-outline-dark:focus{color:var(--sd-color-dark-text) !important;background-color:var(--sd-color-dark) !important;border-color:var(--sd-color-dark) !important;border-width:1px !important;border-style:solid !important}.sd-btn-dark:hover,.sd-btn-dark:focus{color:var(--sd-color-dark-text) !important;background-color:var(--sd-color-dark-highlight) !important;border-color:var(--sd-color-dark-highlight) !important;border-width:1px !important;border-style:solid !important}.sd-btn-outline-dark{color:var(--sd-color-dark) !important;border-color:var(--sd-color-dark) !important;border-width:1px !important;border-style:solid !important}.sd-btn-black,.sd-btn-outline-black:hover,.sd-btn-outline-black:focus{color:var(--sd-color-black-text) !important;background-color:var(--sd-color-black) !important;border-color:var(--sd-color-black) !important;border-width:1px !important;border-style:solid !important}.sd-btn-black:hover,.sd-btn-black:focus{color:var(--sd-color-black-text) !important;background-color:var(--sd-color-black-highlight) !important;border-color:var(--sd-color-black-highlight) !important;border-width:1px !important;border-style:solid !important}.sd-btn-outline-black{color:var(--sd-color-black) !important;border-color:var(--sd-color-black) !important;border-width:1px !important;border-style:solid !important}.sd-btn-white,.sd-btn-outline-white:hover,.sd-btn-outline-white:focus{color:var(--sd-color-white-text) !important;background-color:var(--sd-color-white) !important;border-color:var(--sd-color-white) !important;border-width:1px !important;border-style:solid !important}.sd-btn-white:hover,.sd-btn-white:focus{color:var(--sd-color-white-text) !important;background-color:var(--sd-color-white-highlight) !important;border-color:var(--sd-color-white-highlight) !important;border-width:1px !important;border-style:solid !important}.sd-btn-outline-white{color:var(--sd-color-white) !important;border-color:var(--sd-color-white) !important;border-width:1px !important;border-style:solid !important}.sd-stretched-link::after{position:absolute;top:0;right:0;bottom:0;left:0;z-index:1;content:""}.sd-hide-link-text{font-size:0}.sd-octicon,.sd-material-icon{display:inline-block;fill:currentColor;vertical-align:middle}.sd-avatar-xs{border-radius:50%;object-fit:cover;object-position:center;width:1rem;height:1rem}.sd-avatar-sm{border-radius:50%;object-fit:cover;object-position:center;width:3rem;height:3rem}.sd-avatar-md{border-radius:50%;object-fit:cover;object-position:center;width:5rem;height:5rem}.sd-avatar-lg{border-radius:50%;object-fit:cover;object-position:center;width:7rem;height:7rem}.sd-avatar-xl{border-radius:50%;object-fit:cover;object-position:center;width:10rem;height:10rem}.sd-avatar-inherit{border-radius:50%;object-fit:cover;object-position:center;width:inherit;height:inherit}.sd-avatar-initial{border-radius:50%;object-fit:cover;object-position:center;width:initial;height:initial}.sd-card{background-clip:border-box;background-color:var(--sd-color-card-background);border:1px solid var(--sd-color-card-border);border-radius:.25rem;color:var(--sd-color-card-text);display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;min-width:0;position:relative;word-wrap:break-word}.sd-card>hr{margin-left:0;margin-right:0}.sd-card-hover:hover{border-color:var(--sd-color-card-border-hover);transform:scale(1.01)}.sd-card-body{-ms-flex:1 1 auto;flex:1 1 auto;padding:1rem 1rem}.sd-card-title{margin-bottom:.5rem}.sd-card-subtitle{margin-top:-0.25rem;margin-bottom:0}.sd-card-text:last-child{margin-bottom:0}.sd-card-link:hover{text-decoration:none}.sd-card-link+.card-link{margin-left:1rem}.sd-card-header{padding:.5rem 1rem;margin-bottom:0;background-color:var(--sd-color-card-header);border-bottom:1px solid var(--sd-color-card-border)}.sd-card-header:first-child{border-radius:calc(0.25rem - 1px) calc(0.25rem - 1px) 0 0}.sd-card-footer{padding:.5rem 1rem;background-color:var(--sd-color-card-footer);border-top:1px solid var(--sd-color-card-border)}.sd-card-footer:last-child{border-radius:0 0 calc(0.25rem - 1px) calc(0.25rem - 1px)}.sd-card-header-tabs{margin-right:-0.5rem;margin-bottom:-0.5rem;margin-left:-0.5rem;border-bottom:0}.sd-card-header-pills{margin-right:-0.5rem;margin-left:-0.5rem}.sd-card-img-overlay{position:absolute;top:0;right:0;bottom:0;left:0;padding:1rem;border-radius:calc(0.25rem - 1px)}.sd-card-img,.sd-card-img-bottom,.sd-card-img-top{width:100%}.sd-card-img,.sd-card-img-top{border-top-left-radius:calc(0.25rem - 1px);border-top-right-radius:calc(0.25rem - 1px)}.sd-card-img,.sd-card-img-bottom{border-bottom-left-radius:calc(0.25rem - 1px);border-bottom-right-radius:calc(0.25rem - 1px)}.sd-cards-carousel{width:100%;display:flex;flex-wrap:nowrap;-ms-flex-direction:row;flex-direction:row;overflow-x:hidden;scroll-snap-type:x mandatory}.sd-cards-carousel.sd-show-scrollbar{overflow-x:auto}.sd-cards-carousel:hover,.sd-cards-carousel:focus{overflow-x:auto}.sd-cards-carousel>.sd-card{flex-shrink:0;scroll-snap-align:start}.sd-cards-carousel>.sd-card:not(:last-child){margin-right:3px}.sd-card-cols-1>.sd-card{width:90%}.sd-card-cols-2>.sd-card{width:45%}.sd-card-cols-3>.sd-card{width:30%}.sd-card-cols-4>.sd-card{width:22.5%}.sd-card-cols-5>.sd-card{width:18%}.sd-card-cols-6>.sd-card{width:15%}.sd-card-cols-7>.sd-card{width:12.8571428571%}.sd-card-cols-8>.sd-card{width:11.25%}.sd-card-cols-9>.sd-card{width:10%}.sd-card-cols-10>.sd-card{width:9%}.sd-card-cols-11>.sd-card{width:8.1818181818%}.sd-card-cols-12>.sd-card{width:7.5%}.sd-container,.sd-container-fluid,.sd-container-lg,.sd-container-md,.sd-container-sm,.sd-container-xl{margin-left:auto;margin-right:auto;padding-left:var(--sd-gutter-x, 0.75rem);padding-right:var(--sd-gutter-x, 0.75rem);width:100%}@media(min-width: 576px){.sd-container-sm,.sd-container{max-width:540px}}@media(min-width: 768px){.sd-container-md,.sd-container-sm,.sd-container{max-width:720px}}@media(min-width: 992px){.sd-container-lg,.sd-container-md,.sd-container-sm,.sd-container{max-width:960px}}@media(min-width: 1200px){.sd-container-xl,.sd-container-lg,.sd-container-md,.sd-container-sm,.sd-container{max-width:1140px}}.sd-row{--sd-gutter-x: 1.5rem;--sd-gutter-y: 0;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;margin-top:calc(var(--sd-gutter-y) * -1);margin-right:calc(var(--sd-gutter-x) * -0.5);margin-left:calc(var(--sd-gutter-x) * -0.5)}.sd-row>*{box-sizing:border-box;flex-shrink:0;width:100%;max-width:100%;padding-right:calc(var(--sd-gutter-x) * 0.5);padding-left:calc(var(--sd-gutter-x) * 0.5);margin-top:var(--sd-gutter-y)}.sd-col{flex:1 0 0%;-ms-flex:1 0 0%}.sd-row-cols-auto>*{flex:0 0 auto;width:auto}.sd-row-cols-1>*{flex:0 0 auto;-ms-flex:0 0 auto;width:100%}.sd-row-cols-2>*{flex:0 0 auto;-ms-flex:0 0 auto;width:50%}.sd-row-cols-3>*{flex:0 0 auto;-ms-flex:0 0 auto;width:33.3333333333%}.sd-row-cols-4>*{flex:0 0 auto;-ms-flex:0 0 auto;width:25%}.sd-row-cols-5>*{flex:0 0 auto;-ms-flex:0 0 auto;width:20%}.sd-row-cols-6>*{flex:0 0 auto;-ms-flex:0 0 auto;width:16.6666666667%}.sd-row-cols-7>*{flex:0 0 auto;-ms-flex:0 0 auto;width:14.2857142857%}.sd-row-cols-8>*{flex:0 0 auto;-ms-flex:0 0 auto;width:12.5%}.sd-row-cols-9>*{flex:0 0 auto;-ms-flex:0 0 auto;width:11.1111111111%}.sd-row-cols-10>*{flex:0 0 auto;-ms-flex:0 0 auto;width:10%}.sd-row-cols-11>*{flex:0 0 auto;-ms-flex:0 0 auto;width:9.0909090909%}.sd-row-cols-12>*{flex:0 0 auto;-ms-flex:0 0 auto;width:8.3333333333%}@media(min-width: 576px){.sd-col-sm{flex:1 0 0%;-ms-flex:1 0 0%}.sd-row-cols-sm-auto{flex:1 0 auto;-ms-flex:1 0 auto;width:100%}.sd-row-cols-sm-1>*{flex:0 0 auto;-ms-flex:0 0 auto;width:100%}.sd-row-cols-sm-2>*{flex:0 0 auto;-ms-flex:0 0 auto;width:50%}.sd-row-cols-sm-3>*{flex:0 0 auto;-ms-flex:0 0 auto;width:33.3333333333%}.sd-row-cols-sm-4>*{flex:0 0 auto;-ms-flex:0 0 auto;width:25%}.sd-row-cols-sm-5>*{flex:0 0 auto;-ms-flex:0 0 auto;width:20%}.sd-row-cols-sm-6>*{flex:0 0 auto;-ms-flex:0 0 auto;width:16.6666666667%}.sd-row-cols-sm-7>*{flex:0 0 auto;-ms-flex:0 0 auto;width:14.2857142857%}.sd-row-cols-sm-8>*{flex:0 0 auto;-ms-flex:0 0 auto;width:12.5%}.sd-row-cols-sm-9>*{flex:0 0 auto;-ms-flex:0 0 auto;width:11.1111111111%}.sd-row-cols-sm-10>*{flex:0 0 auto;-ms-flex:0 0 auto;width:10%}.sd-row-cols-sm-11>*{flex:0 0 auto;-ms-flex:0 0 auto;width:9.0909090909%}.sd-row-cols-sm-12>*{flex:0 0 auto;-ms-flex:0 0 auto;width:8.3333333333%}}@media(min-width: 768px){.sd-col-md{flex:1 0 0%;-ms-flex:1 0 0%}.sd-row-cols-md-auto{flex:1 0 auto;-ms-flex:1 0 auto;width:100%}.sd-row-cols-md-1>*{flex:0 0 auto;-ms-flex:0 0 auto;width:100%}.sd-row-cols-md-2>*{flex:0 0 auto;-ms-flex:0 0 auto;width:50%}.sd-row-cols-md-3>*{flex:0 0 auto;-ms-flex:0 0 auto;width:33.3333333333%}.sd-row-cols-md-4>*{flex:0 0 auto;-ms-flex:0 0 auto;width:25%}.sd-row-cols-md-5>*{flex:0 0 auto;-ms-flex:0 0 auto;width:20%}.sd-row-cols-md-6>*{flex:0 0 auto;-ms-flex:0 0 auto;width:16.6666666667%}.sd-row-cols-md-7>*{flex:0 0 auto;-ms-flex:0 0 auto;width:14.2857142857%}.sd-row-cols-md-8>*{flex:0 0 auto;-ms-flex:0 0 auto;width:12.5%}.sd-row-cols-md-9>*{flex:0 0 auto;-ms-flex:0 0 auto;width:11.1111111111%}.sd-row-cols-md-10>*{flex:0 0 auto;-ms-flex:0 0 auto;width:10%}.sd-row-cols-md-11>*{flex:0 0 auto;-ms-flex:0 0 auto;width:9.0909090909%}.sd-row-cols-md-12>*{flex:0 0 auto;-ms-flex:0 0 auto;width:8.3333333333%}}@media(min-width: 992px){.sd-col-lg{flex:1 0 0%;-ms-flex:1 0 0%}.sd-row-cols-lg-auto{flex:1 0 auto;-ms-flex:1 0 auto;width:100%}.sd-row-cols-lg-1>*{flex:0 0 auto;-ms-flex:0 0 auto;width:100%}.sd-row-cols-lg-2>*{flex:0 0 auto;-ms-flex:0 0 auto;width:50%}.sd-row-cols-lg-3>*{flex:0 0 auto;-ms-flex:0 0 auto;width:33.3333333333%}.sd-row-cols-lg-4>*{flex:0 0 auto;-ms-flex:0 0 auto;width:25%}.sd-row-cols-lg-5>*{flex:0 0 auto;-ms-flex:0 0 auto;width:20%}.sd-row-cols-lg-6>*{flex:0 0 auto;-ms-flex:0 0 auto;width:16.6666666667%}.sd-row-cols-lg-7>*{flex:0 0 auto;-ms-flex:0 0 auto;width:14.2857142857%}.sd-row-cols-lg-8>*{flex:0 0 auto;-ms-flex:0 0 auto;width:12.5%}.sd-row-cols-lg-9>*{flex:0 0 auto;-ms-flex:0 0 auto;width:11.1111111111%}.sd-row-cols-lg-10>*{flex:0 0 auto;-ms-flex:0 0 auto;width:10%}.sd-row-cols-lg-11>*{flex:0 0 auto;-ms-flex:0 0 auto;width:9.0909090909%}.sd-row-cols-lg-12>*{flex:0 0 auto;-ms-flex:0 0 auto;width:8.3333333333%}}@media(min-width: 1200px){.sd-col-xl{flex:1 0 0%;-ms-flex:1 0 0%}.sd-row-cols-xl-auto{flex:1 0 auto;-ms-flex:1 0 auto;width:100%}.sd-row-cols-xl-1>*{flex:0 0 auto;-ms-flex:0 0 auto;width:100%}.sd-row-cols-xl-2>*{flex:0 0 auto;-ms-flex:0 0 auto;width:50%}.sd-row-cols-xl-3>*{flex:0 0 auto;-ms-flex:0 0 auto;width:33.3333333333%}.sd-row-cols-xl-4>*{flex:0 0 auto;-ms-flex:0 0 auto;width:25%}.sd-row-cols-xl-5>*{flex:0 0 auto;-ms-flex:0 0 auto;width:20%}.sd-row-cols-xl-6>*{flex:0 0 auto;-ms-flex:0 0 auto;width:16.6666666667%}.sd-row-cols-xl-7>*{flex:0 0 auto;-ms-flex:0 0 auto;width:14.2857142857%}.sd-row-cols-xl-8>*{flex:0 0 auto;-ms-flex:0 0 auto;width:12.5%}.sd-row-cols-xl-9>*{flex:0 0 auto;-ms-flex:0 0 auto;width:11.1111111111%}.sd-row-cols-xl-10>*{flex:0 0 auto;-ms-flex:0 0 auto;width:10%}.sd-row-cols-xl-11>*{flex:0 0 auto;-ms-flex:0 0 auto;width:9.0909090909%}.sd-row-cols-xl-12>*{flex:0 0 auto;-ms-flex:0 0 auto;width:8.3333333333%}}.sd-col-auto{flex:0 0 auto;-ms-flex:0 0 auto;width:auto}.sd-col-1{flex:0 0 auto;-ms-flex:0 0 auto;width:8.3333333333%}.sd-col-2{flex:0 0 auto;-ms-flex:0 0 auto;width:16.6666666667%}.sd-col-3{flex:0 0 auto;-ms-flex:0 0 auto;width:25%}.sd-col-4{flex:0 0 auto;-ms-flex:0 0 auto;width:33.3333333333%}.sd-col-5{flex:0 0 auto;-ms-flex:0 0 auto;width:41.6666666667%}.sd-col-6{flex:0 0 auto;-ms-flex:0 0 auto;width:50%}.sd-col-7{flex:0 0 auto;-ms-flex:0 0 auto;width:58.3333333333%}.sd-col-8{flex:0 0 auto;-ms-flex:0 0 auto;width:66.6666666667%}.sd-col-9{flex:0 0 auto;-ms-flex:0 0 auto;width:75%}.sd-col-10{flex:0 0 auto;-ms-flex:0 0 auto;width:83.3333333333%}.sd-col-11{flex:0 0 auto;-ms-flex:0 0 auto;width:91.6666666667%}.sd-col-12{flex:0 0 auto;-ms-flex:0 0 auto;width:100%}.sd-g-0,.sd-gy-0{--sd-gutter-y: 0}.sd-g-0,.sd-gx-0{--sd-gutter-x: 0}.sd-g-1,.sd-gy-1{--sd-gutter-y: 0.25rem}.sd-g-1,.sd-gx-1{--sd-gutter-x: 0.25rem}.sd-g-2,.sd-gy-2{--sd-gutter-y: 0.5rem}.sd-g-2,.sd-gx-2{--sd-gutter-x: 0.5rem}.sd-g-3,.sd-gy-3{--sd-gutter-y: 1rem}.sd-g-3,.sd-gx-3{--sd-gutter-x: 1rem}.sd-g-4,.sd-gy-4{--sd-gutter-y: 1.5rem}.sd-g-4,.sd-gx-4{--sd-gutter-x: 1.5rem}.sd-g-5,.sd-gy-5{--sd-gutter-y: 3rem}.sd-g-5,.sd-gx-5{--sd-gutter-x: 3rem}@media(min-width: 576px){.sd-col-sm-auto{-ms-flex:0 0 auto;flex:0 0 auto;width:auto}.sd-col-sm-1{-ms-flex:0 0 auto;flex:0 0 auto;width:8.3333333333%}.sd-col-sm-2{-ms-flex:0 0 auto;flex:0 0 auto;width:16.6666666667%}.sd-col-sm-3{-ms-flex:0 0 auto;flex:0 0 auto;width:25%}.sd-col-sm-4{-ms-flex:0 0 auto;flex:0 0 auto;width:33.3333333333%}.sd-col-sm-5{-ms-flex:0 0 auto;flex:0 0 auto;width:41.6666666667%}.sd-col-sm-6{-ms-flex:0 0 auto;flex:0 0 auto;width:50%}.sd-col-sm-7{-ms-flex:0 0 auto;flex:0 0 auto;width:58.3333333333%}.sd-col-sm-8{-ms-flex:0 0 auto;flex:0 0 auto;width:66.6666666667%}.sd-col-sm-9{-ms-flex:0 0 auto;flex:0 0 auto;width:75%}.sd-col-sm-10{-ms-flex:0 0 auto;flex:0 0 auto;width:83.3333333333%}.sd-col-sm-11{-ms-flex:0 0 auto;flex:0 0 auto;width:91.6666666667%}.sd-col-sm-12{-ms-flex:0 0 auto;flex:0 0 auto;width:100%}.sd-g-sm-0,.sd-gy-sm-0{--sd-gutter-y: 0}.sd-g-sm-0,.sd-gx-sm-0{--sd-gutter-x: 0}.sd-g-sm-1,.sd-gy-sm-1{--sd-gutter-y: 0.25rem}.sd-g-sm-1,.sd-gx-sm-1{--sd-gutter-x: 0.25rem}.sd-g-sm-2,.sd-gy-sm-2{--sd-gutter-y: 0.5rem}.sd-g-sm-2,.sd-gx-sm-2{--sd-gutter-x: 0.5rem}.sd-g-sm-3,.sd-gy-sm-3{--sd-gutter-y: 1rem}.sd-g-sm-3,.sd-gx-sm-3{--sd-gutter-x: 1rem}.sd-g-sm-4,.sd-gy-sm-4{--sd-gutter-y: 1.5rem}.sd-g-sm-4,.sd-gx-sm-4{--sd-gutter-x: 1.5rem}.sd-g-sm-5,.sd-gy-sm-5{--sd-gutter-y: 3rem}.sd-g-sm-5,.sd-gx-sm-5{--sd-gutter-x: 3rem}}@media(min-width: 768px){.sd-col-md-auto{-ms-flex:0 0 auto;flex:0 0 auto;width:auto}.sd-col-md-1{-ms-flex:0 0 auto;flex:0 0 auto;width:8.3333333333%}.sd-col-md-2{-ms-flex:0 0 auto;flex:0 0 auto;width:16.6666666667%}.sd-col-md-3{-ms-flex:0 0 auto;flex:0 0 auto;width:25%}.sd-col-md-4{-ms-flex:0 0 auto;flex:0 0 auto;width:33.3333333333%}.sd-col-md-5{-ms-flex:0 0 auto;flex:0 0 auto;width:41.6666666667%}.sd-col-md-6{-ms-flex:0 0 auto;flex:0 0 auto;width:50%}.sd-col-md-7{-ms-flex:0 0 auto;flex:0 0 auto;width:58.3333333333%}.sd-col-md-8{-ms-flex:0 0 auto;flex:0 0 auto;width:66.6666666667%}.sd-col-md-9{-ms-flex:0 0 auto;flex:0 0 auto;width:75%}.sd-col-md-10{-ms-flex:0 0 auto;flex:0 0 auto;width:83.3333333333%}.sd-col-md-11{-ms-flex:0 0 auto;flex:0 0 auto;width:91.6666666667%}.sd-col-md-12{-ms-flex:0 0 auto;flex:0 0 auto;width:100%}.sd-g-md-0,.sd-gy-md-0{--sd-gutter-y: 0}.sd-g-md-0,.sd-gx-md-0{--sd-gutter-x: 0}.sd-g-md-1,.sd-gy-md-1{--sd-gutter-y: 0.25rem}.sd-g-md-1,.sd-gx-md-1{--sd-gutter-x: 0.25rem}.sd-g-md-2,.sd-gy-md-2{--sd-gutter-y: 0.5rem}.sd-g-md-2,.sd-gx-md-2{--sd-gutter-x: 0.5rem}.sd-g-md-3,.sd-gy-md-3{--sd-gutter-y: 1rem}.sd-g-md-3,.sd-gx-md-3{--sd-gutter-x: 1rem}.sd-g-md-4,.sd-gy-md-4{--sd-gutter-y: 1.5rem}.sd-g-md-4,.sd-gx-md-4{--sd-gutter-x: 1.5rem}.sd-g-md-5,.sd-gy-md-5{--sd-gutter-y: 3rem}.sd-g-md-5,.sd-gx-md-5{--sd-gutter-x: 3rem}}@media(min-width: 992px){.sd-col-lg-auto{-ms-flex:0 0 auto;flex:0 0 auto;width:auto}.sd-col-lg-1{-ms-flex:0 0 auto;flex:0 0 auto;width:8.3333333333%}.sd-col-lg-2{-ms-flex:0 0 auto;flex:0 0 auto;width:16.6666666667%}.sd-col-lg-3{-ms-flex:0 0 auto;flex:0 0 auto;width:25%}.sd-col-lg-4{-ms-flex:0 0 auto;flex:0 0 auto;width:33.3333333333%}.sd-col-lg-5{-ms-flex:0 0 auto;flex:0 0 auto;width:41.6666666667%}.sd-col-lg-6{-ms-flex:0 0 auto;flex:0 0 auto;width:50%}.sd-col-lg-7{-ms-flex:0 0 auto;flex:0 0 auto;width:58.3333333333%}.sd-col-lg-8{-ms-flex:0 0 auto;flex:0 0 auto;width:66.6666666667%}.sd-col-lg-9{-ms-flex:0 0 auto;flex:0 0 auto;width:75%}.sd-col-lg-10{-ms-flex:0 0 auto;flex:0 0 auto;width:83.3333333333%}.sd-col-lg-11{-ms-flex:0 0 auto;flex:0 0 auto;width:91.6666666667%}.sd-col-lg-12{-ms-flex:0 0 auto;flex:0 0 auto;width:100%}.sd-g-lg-0,.sd-gy-lg-0{--sd-gutter-y: 0}.sd-g-lg-0,.sd-gx-lg-0{--sd-gutter-x: 0}.sd-g-lg-1,.sd-gy-lg-1{--sd-gutter-y: 0.25rem}.sd-g-lg-1,.sd-gx-lg-1{--sd-gutter-x: 0.25rem}.sd-g-lg-2,.sd-gy-lg-2{--sd-gutter-y: 0.5rem}.sd-g-lg-2,.sd-gx-lg-2{--sd-gutter-x: 0.5rem}.sd-g-lg-3,.sd-gy-lg-3{--sd-gutter-y: 1rem}.sd-g-lg-3,.sd-gx-lg-3{--sd-gutter-x: 1rem}.sd-g-lg-4,.sd-gy-lg-4{--sd-gutter-y: 1.5rem}.sd-g-lg-4,.sd-gx-lg-4{--sd-gutter-x: 1.5rem}.sd-g-lg-5,.sd-gy-lg-5{--sd-gutter-y: 3rem}.sd-g-lg-5,.sd-gx-lg-5{--sd-gutter-x: 3rem}}@media(min-width: 1200px){.sd-col-xl-auto{-ms-flex:0 0 auto;flex:0 0 auto;width:auto}.sd-col-xl-1{-ms-flex:0 0 auto;flex:0 0 auto;width:8.3333333333%}.sd-col-xl-2{-ms-flex:0 0 auto;flex:0 0 auto;width:16.6666666667%}.sd-col-xl-3{-ms-flex:0 0 auto;flex:0 0 auto;width:25%}.sd-col-xl-4{-ms-flex:0 0 auto;flex:0 0 auto;width:33.3333333333%}.sd-col-xl-5{-ms-flex:0 0 auto;flex:0 0 auto;width:41.6666666667%}.sd-col-xl-6{-ms-flex:0 0 auto;flex:0 0 auto;width:50%}.sd-col-xl-7{-ms-flex:0 0 auto;flex:0 0 auto;width:58.3333333333%}.sd-col-xl-8{-ms-flex:0 0 auto;flex:0 0 auto;width:66.6666666667%}.sd-col-xl-9{-ms-flex:0 0 auto;flex:0 0 auto;width:75%}.sd-col-xl-10{-ms-flex:0 0 auto;flex:0 0 auto;width:83.3333333333%}.sd-col-xl-11{-ms-flex:0 0 auto;flex:0 0 auto;width:91.6666666667%}.sd-col-xl-12{-ms-flex:0 0 auto;flex:0 0 auto;width:100%}.sd-g-xl-0,.sd-gy-xl-0{--sd-gutter-y: 0}.sd-g-xl-0,.sd-gx-xl-0{--sd-gutter-x: 0}.sd-g-xl-1,.sd-gy-xl-1{--sd-gutter-y: 0.25rem}.sd-g-xl-1,.sd-gx-xl-1{--sd-gutter-x: 0.25rem}.sd-g-xl-2,.sd-gy-xl-2{--sd-gutter-y: 0.5rem}.sd-g-xl-2,.sd-gx-xl-2{--sd-gutter-x: 0.5rem}.sd-g-xl-3,.sd-gy-xl-3{--sd-gutter-y: 1rem}.sd-g-xl-3,.sd-gx-xl-3{--sd-gutter-x: 1rem}.sd-g-xl-4,.sd-gy-xl-4{--sd-gutter-y: 1.5rem}.sd-g-xl-4,.sd-gx-xl-4{--sd-gutter-x: 1.5rem}.sd-g-xl-5,.sd-gy-xl-5{--sd-gutter-y: 3rem}.sd-g-xl-5,.sd-gx-xl-5{--sd-gutter-x: 3rem}}.sd-flex-row-reverse{flex-direction:row-reverse !important}details.sd-dropdown{position:relative;font-size:var(--sd-fontsize-dropdown)}details.sd-dropdown:hover{cursor:pointer}details.sd-dropdown .sd-summary-content{cursor:default}details.sd-dropdown summary.sd-summary-title{padding:.5em .6em .5em 1em;font-size:var(--sd-fontsize-dropdown-title);font-weight:var(--sd-fontweight-dropdown-title);user-select:none;-moz-user-select:none;-ms-user-select:none;-webkit-user-select:none;list-style:none;display:inline-flex;justify-content:space-between}details.sd-dropdown summary.sd-summary-title::-webkit-details-marker{display:none}details.sd-dropdown summary.sd-summary-title:focus{outline:none}details.sd-dropdown summary.sd-summary-title .sd-summary-icon{margin-right:.6em;display:inline-flex;align-items:center}details.sd-dropdown summary.sd-summary-title .sd-summary-icon svg{opacity:.8}details.sd-dropdown summary.sd-summary-title .sd-summary-text{flex-grow:1;line-height:1.5;padding-right:.5rem}details.sd-dropdown summary.sd-summary-title .sd-summary-state-marker{pointer-events:none;display:inline-flex;align-items:center}details.sd-dropdown summary.sd-summary-title .sd-summary-state-marker svg{opacity:.6}details.sd-dropdown summary.sd-summary-title:hover .sd-summary-state-marker svg{opacity:1;transform:scale(1.1)}details.sd-dropdown[open] summary .sd-octicon.no-title{visibility:hidden}details.sd-dropdown .sd-summary-chevron-right{transition:.25s}details.sd-dropdown[open]>.sd-summary-title .sd-summary-chevron-right{transform:rotate(90deg)}details.sd-dropdown[open]>.sd-summary-title .sd-summary-chevron-down{transform:rotate(180deg)}details.sd-dropdown:not([open]).sd-card{border:none}details.sd-dropdown:not([open])>.sd-card-header{border:1px solid var(--sd-color-card-border);border-radius:.25rem}details.sd-dropdown.sd-fade-in[open] summary~*{-moz-animation:sd-fade-in .5s ease-in-out;-webkit-animation:sd-fade-in .5s ease-in-out;animation:sd-fade-in .5s ease-in-out}details.sd-dropdown.sd-fade-in-slide-down[open] summary~*{-moz-animation:sd-fade-in .5s ease-in-out,sd-slide-down .5s ease-in-out;-webkit-animation:sd-fade-in .5s ease-in-out,sd-slide-down .5s ease-in-out;animation:sd-fade-in .5s ease-in-out,sd-slide-down .5s ease-in-out}.sd-col>.sd-dropdown{width:100%}.sd-summary-content>.sd-tab-set:first-child{margin-top:0}@keyframes sd-fade-in{0%{opacity:0}100%{opacity:1}}@keyframes sd-slide-down{0%{transform:translate(0, -10px)}100%{transform:translate(0, 0)}}.sd-tab-set{border-radius:.125rem;display:flex;flex-wrap:wrap;margin:1em 0;position:relative}.sd-tab-set>input{opacity:0;position:absolute}.sd-tab-set>input:checked+label{border-color:var(--sd-color-tabs-underline-active);color:var(--sd-color-tabs-label-active)}.sd-tab-set>input:checked+label+.sd-tab-content{display:block}.sd-tab-set>input:not(:checked)+label:hover{color:var(--sd-color-tabs-label-hover);border-color:var(--sd-color-tabs-underline-hover)}.sd-tab-set>input:focus+label{outline-style:auto}.sd-tab-set>input:not(.focus-visible)+label{outline:none;-webkit-tap-highlight-color:transparent}.sd-tab-set>label{border-bottom:.125rem solid transparent;margin-bottom:0;color:var(--sd-color-tabs-label-inactive);border-color:var(--sd-color-tabs-underline-inactive);cursor:pointer;font-size:var(--sd-fontsize-tabs-label);font-weight:700;padding:1em 1.25em .5em;transition:color 250ms;width:auto;z-index:1}html .sd-tab-set>label:hover{color:var(--sd-color-tabs-label-active)}.sd-col>.sd-tab-set{width:100%}.sd-tab-content{box-shadow:0 -0.0625rem var(--sd-color-tabs-overline),0 .0625rem var(--sd-color-tabs-underline);display:none;order:99;padding-bottom:.75rem;padding-top:.75rem;width:100%}.sd-tab-content>:first-child{margin-top:0 !important}.sd-tab-content>:last-child{margin-bottom:0 !important}.sd-tab-content>.sd-tab-set{margin:0}.sd-sphinx-override,.sd-sphinx-override *{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}.sd-sphinx-override p{margin-top:0}:root{--sd-color-primary: #0071bc;--sd-color-secondary: #6c757d;--sd-color-success: #28a745;--sd-color-info: #17a2b8;--sd-color-warning: #f0b37e;--sd-color-danger: #dc3545;--sd-color-light: #f8f9fa;--sd-color-muted: #6c757d;--sd-color-dark: #212529;--sd-color-black: black;--sd-color-white: white;--sd-color-primary-highlight: #0060a0;--sd-color-secondary-highlight: #5c636a;--sd-color-success-highlight: #228e3b;--sd-color-info-highlight: #148a9c;--sd-color-warning-highlight: #cc986b;--sd-color-danger-highlight: #bb2d3b;--sd-color-light-highlight: #d3d4d5;--sd-color-muted-highlight: #5c636a;--sd-color-dark-highlight: #1c1f23;--sd-color-black-highlight: black;--sd-color-white-highlight: #d9d9d9;--sd-color-primary-bg: rgba(0, 113, 188, 0.2);--sd-color-secondary-bg: rgba(108, 117, 125, 0.2);--sd-color-success-bg: rgba(40, 167, 69, 0.2);--sd-color-info-bg: rgba(23, 162, 184, 0.2);--sd-color-warning-bg: rgba(240, 179, 126, 0.2);--sd-color-danger-bg: rgba(220, 53, 69, 0.2);--sd-color-light-bg: rgba(248, 249, 250, 0.2);--sd-color-muted-bg: rgba(108, 117, 125, 0.2);--sd-color-dark-bg: rgba(33, 37, 41, 0.2);--sd-color-black-bg: rgba(0, 0, 0, 0.2);--sd-color-white-bg: rgba(255, 255, 255, 0.2);--sd-color-primary-text: #fff;--sd-color-secondary-text: #fff;--sd-color-success-text: #fff;--sd-color-info-text: #fff;--sd-color-warning-text: #212529;--sd-color-danger-text: #fff;--sd-color-light-text: #212529;--sd-color-muted-text: #fff;--sd-color-dark-text: #fff;--sd-color-black-text: #fff;--sd-color-white-text: #212529;--sd-color-shadow: rgba(0, 0, 0, 0.15);--sd-color-card-border: rgba(0, 0, 0, 0.125);--sd-color-card-border-hover: hsla(231, 99%, 66%, 1);--sd-color-card-background: transparent;--sd-color-card-text: inherit;--sd-color-card-header: transparent;--sd-color-card-footer: transparent;--sd-color-tabs-label-active: hsla(231, 99%, 66%, 1);--sd-color-tabs-label-hover: hsla(231, 99%, 66%, 1);--sd-color-tabs-label-inactive: hsl(0, 0%, 66%);--sd-color-tabs-underline-active: hsla(231, 99%, 66%, 1);--sd-color-tabs-underline-hover: rgba(178, 206, 245, 0.62);--sd-color-tabs-underline-inactive: transparent;--sd-color-tabs-overline: rgb(222, 222, 222);--sd-color-tabs-underline: rgb(222, 222, 222);--sd-fontsize-tabs-label: 1rem;--sd-fontsize-dropdown: inherit;--sd-fontsize-dropdown-title: 1rem;--sd-fontweight-dropdown-title: 700} diff --git a/_static/all-examples-data.js b/_static/all-examples-data.js new file mode 100644 index 00000000..64baf4e9 --- /dev/null +++ b/_static/all-examples-data.js @@ -0,0 +1 @@ +var examplesData = [{"title": "A ML model for the electron density of states", "description": "This tutorial would go through the entire machine learning framework for the electronic density of states (DOS). It will cover the construction of the DOS and SOAP descriptors from ase Atoms and eigenenergy results. A simple neural network will then be constructed and the model parameters, along with the energy reference will be optimized during training. A total of three energy reference will be used, the average Hartree potential, the Fermi level, and an optimized energy reference starting from the Fermi level energy reference. The performance of each model is then compared.", "html": "

This tutorial would go through the entire machine learning framework for the electronic density of states (DOS). It will cover the construction of the DOS and SOAP descriptors from ase Atoms and eigenenergy results. A simple neural network will then be constructed and the model parameters, along with the energy reference will be optimized during training. A total of three energy reference will be used, the average Hartree potential, the Fermi level, and an optimized energy reference starting from the Fermi level energy reference. The performance of each model is then compared.

\n", "thumbnail": "_images/sphx_glr_dos-align_thumb.png", "ref": "examples/dos-align/dos-align.html"}, {"title": "Batch run of CP2K calculations", "description": "This is an example how to perform single point calculations based on list of structures using CP2K using its reftraj functionality. The inputs are a set of structures in :download:`example.xyz` using the DFT parameters defined in :download:`reftraj_template.cp2k`. The reference DFT parameters are taken from Cheng et al. Ab initio thermodynamics of liquid and solid water 2019. Due to the small size of the test structure and convergence issues, we have decreased the size of the CUTOFF_RADIUS from 6.0\\,\\mathrm{\u00c5} to 3.0\\,\\mathrm{\u00c5}. For actual production calculations adapt the template!", "html": "

This is an example how to perform single point calculations based on list of structures using CP2K using its reftraj functionality. The inputs are a set of structures in :download:`example.xyz` using the DFT parameters defined in :download:`reftraj_template.cp2k`. The reference DFT parameters are taken from Cheng et al. Ab initio thermodynamics of liquid and solid water 2019. Due to the small size of the test structure and convergence issues, we have decreased the size of the CUTOFF_RADIUS from 6.0,mathrm{\u00c5} to 3.0,mathrm{\u00c5}. For actual production calculations adapt the template!

\n", "thumbnail": "_images/sphx_glr_reference-trajectory_thumb.png", "ref": "examples/batch-cp2k/reference-trajectory.html"}, {"title": "Constant-temperature MD and thermostats", "description": "This recipe gives a practical introduction to finite-temperature molecular dynamics simulations, and provides a guide to choose the most appropriate thermostat for the simulation at hand.", "html": "

This recipe gives a practical introduction to finite-temperature molecular dynamics simulations, and provides a guide to choose the most appropriate thermostat for the simulation at hand.

\n", "thumbnail": "_images/sphx_glr_thermostats_thumb.png", "ref": "examples/thermostats/thermostats.html"}, {"title": "Generalized Convex Hull construction for the polymorphs of ROY", "description": "This notebook analyzes the structures of 264 polymorphs of ROY, from Beran et Al, Chemical Science (2022), comparing the conventional density-energy convex hull with a Generalized Convex Hull (GCH) analysis (see Anelli et al., Phys. Rev. Materials (2018)). It uses features computed with rascaline and uses the directional convex hull function from scikit-matter to make the figure.", "html": "

This notebook analyzes the structures of 264 polymorphs of ROY, from Beran et Al, Chemical Science (2022), comparing the conventional density-energy convex hull with a Generalized Convex Hull (GCH) analysis (see Anelli et al., Phys. Rev. Materials (2018)). It uses features computed with rascaline and uses the directional convex hull function from scikit-matter to make the figure.

\n", "thumbnail": "_images/sphx_glr_roy-gch_thumb.png", "ref": "examples/roy-gch/roy-gch.html"}, {"title": "Local Prediction Rigidity analysis", "description": "In this tutorial, we calculate the SOAP descriptors of an amorphous silicon dataset using rascaline, then compute the local prediction rigidity (LPR) for the atoms of a \"test\" set before and after modifications to the \"training\" dataset has been made.", "html": "

In this tutorial, we calculate the SOAP descriptors of an amorphous silicon dataset using rascaline, then compute the local prediction rigidity (LPR) for the atoms of a "test" set before and after modifications to the "training" dataset has been made.

\n", "thumbnail": "_images/sphx_glr_lpr_thumb.png", "ref": "examples/lpr/lpr.html"}, {"title": "Long-distance Equivariants: a tutorial", "description": "This tutorial explains how Long range equivariant descriptors can be constructed using rascaline and the resulting descriptors be used to construct a linear model with equisolve", "html": "

This tutorial explains how Long range equivariant descriptors can be constructed using rascaline and the resulting descriptors be used to construct a linear model with equisolve

\n", "thumbnail": "_images/sphx_glr_lode-linear_thumb.png", "ref": "examples/lode-linear/lode-linear.html"}, {"title": "PCA/PCovR Visualization of a training dataset for a potential", "description": "This example uses rascaline and metatensor to compute structural properties for the structures in a training dataset for a ML potential. These are then used with simple dimensionality reduction algorithms (implemented in sklearn and skmatter) to obtain a simplified description of the dataset, that is then visualized using chemiscope.", "html": "

This example uses rascaline and metatensor to compute structural properties for the structures in a training dataset for a ML potential. These are then used with simple dimensionality reduction algorithms (implemented in sklearn and skmatter) to obtain a simplified description of the dataset, that is then visualized using chemiscope.

\n", "thumbnail": "_images/sphx_glr_gaas-map_thumb.png", "ref": "examples/gaas-map/gaas-map.html"}, {"title": "Path integral metadynamics", "description": "This example shows how to run a free-energy sampling calculation that combines path integral molecular dynamics to model nuclear quantum effects and metadynamics to accelerate sampling of the high-free-energy regions.", "html": "

This example shows how to run a free-energy sampling calculation that combines path integral molecular dynamics to model nuclear quantum effects and metadynamics to accelerate sampling of the high-free-energy regions.

\n", "thumbnail": "_images/sphx_glr_pi-metad_thumb.png", "ref": "examples/pi-metad/pi-metad.html"}, {"title": "Path integral molecular dynamics", "description": "This example shows how to run a path integral molecular dynamics simulation using i-PI, analyze the output and visualize the trajectory in chemiscope. It uses LAMMPS as the driver to simulate the q-TIP4P/f water model.", "html": "

This example shows how to run a path integral molecular dynamics simulation using i-PI, analyze the output and visualize the trajectory in chemiscope. It uses LAMMPS as the driver to simulate the q-TIP4P/f water model.

\n", "thumbnail": "_images/sphx_glr_path-integrals_thumb.png", "ref": "examples/path-integrals/path-integrals.html"}, {"title": "Periodic Hamiltonian learning", "description": "This tutorial explains how to train a machine learning model for the electronic Hamiltonian of a periodic system. Even though we focus on periodic systems, the code and techniques presented here can be directly transferred to molecules.", "html": "

This tutorial explains how to train a machine learning model for the electronic Hamiltonian of a periodic system. Even though we focus on periodic systems, the code and techniques presented here can be directly transferred to molecules.

\n", "thumbnail": "_images/sphx_glr_periodic-hamiltonian_thumb.png", "ref": "examples/periodic-hamiltonian/periodic-hamiltonian.html"}, {"title": "Quantum heat capacity of water", "description": "This example shows how to estimate the heat capacity of liquid water from a path integral molecular dynamics simulation. The dynamics are run with i-PI, and LAMMPS is used as the driver to simulate the q-TIP4P/f water model.", "html": "

This example shows how to estimate the heat capacity of liquid water from a path integral molecular dynamics simulation. The dynamics are run with i-PI, and LAMMPS is used as the driver to simulate the q-TIP4P/f water model.

\n", "thumbnail": "_images/sphx_glr_heat-capacity_thumb.png", "ref": "examples/heat-capacity/heat-capacity.html"}, {"title": "Sample and Feature Selection with FPS and CUR", "description": "In this tutorial we generate descriptors using rascaline, then select a subset of structures using both the farthest-point sampling (FPS) and CUR algorithms implemented in scikit-matter. Finally, we also generate a selection of the most important features using the same techniques.", "html": "

In this tutorial we generate descriptors using rascaline, then select a subset of structures using both the farthest-point sampling (FPS) and CUR algorithms implemented in scikit-matter. Finally, we also generate a selection of the most important features using the same techniques.

\n", "thumbnail": "_images/sphx_glr_sample-selection_thumb.png", "ref": "examples/sample-selection/sample-selection.html"}]; \ No newline at end of file diff --git a/_static/basic.css b/_static/basic.css new file mode 100644 index 00000000..f316efcb --- /dev/null +++ b/_static/basic.css @@ -0,0 +1,925 @@ +/* + * basic.css + * ~~~~~~~~~ + * + * Sphinx stylesheet -- basic theme. + * + * :copyright: Copyright 2007-2024 by the Sphinx team, see AUTHORS. + * :license: BSD, see LICENSE for details. + * + */ + +/* -- main layout ----------------------------------------------------------- */ + +div.clearer { + clear: both; +} + +div.section::after { + display: block; + content: ''; + clear: left; +} + +/* -- relbar ---------------------------------------------------------------- */ + +div.related { + width: 100%; + font-size: 90%; +} + +div.related h3 { + display: none; +} + +div.related ul { + margin: 0; + padding: 0 0 0 10px; + list-style: none; +} + +div.related li { + display: inline; +} + +div.related li.right { + float: right; + margin-right: 5px; +} + +/* -- sidebar --------------------------------------------------------------- */ + +div.sphinxsidebarwrapper { + padding: 10px 5px 0 10px; +} + +div.sphinxsidebar { + float: left; + width: 230px; + margin-left: -100%; + font-size: 90%; + word-wrap: break-word; + overflow-wrap : break-word; +} + +div.sphinxsidebar ul { + list-style: none; +} + +div.sphinxsidebar ul ul, +div.sphinxsidebar ul.want-points { + margin-left: 20px; + list-style: square; +} + +div.sphinxsidebar ul ul { + margin-top: 0; + margin-bottom: 0; +} + +div.sphinxsidebar form { + margin-top: 10px; +} + +div.sphinxsidebar input { + border: 1px solid #98dbcc; + font-family: sans-serif; + font-size: 1em; +} + +div.sphinxsidebar #searchbox form.search { + overflow: hidden; +} + +div.sphinxsidebar #searchbox input[type="text"] { + float: left; + width: 80%; + padding: 0.25em; + box-sizing: border-box; +} + +div.sphinxsidebar #searchbox input[type="submit"] { + float: left; + width: 20%; + border-left: none; + padding: 0.25em; + box-sizing: border-box; +} + + +img { + border: 0; + max-width: 100%; +} + +/* -- search page ----------------------------------------------------------- */ + +ul.search { + margin: 10px 0 0 20px; + padding: 0; +} + +ul.search li { + padding: 5px 0 5px 20px; + background-image: url(file.png); + background-repeat: no-repeat; + background-position: 0 7px; +} + +ul.search li a { + font-weight: bold; +} + +ul.search li p.context { + color: #888; + margin: 2px 0 0 30px; + text-align: left; +} + +ul.keywordmatches li.goodmatch a { + font-weight: bold; +} + +/* -- index page ------------------------------------------------------------ */ + +table.contentstable { + width: 90%; + margin-left: auto; + margin-right: auto; +} + +table.contentstable p.biglink { + line-height: 150%; +} + +a.biglink { + font-size: 1.3em; +} + +span.linkdescr { + font-style: italic; + padding-top: 5px; + font-size: 90%; +} + +/* -- general index --------------------------------------------------------- */ + +table.indextable { + width: 100%; +} + +table.indextable td { + text-align: left; + vertical-align: top; +} + +table.indextable ul { + margin-top: 0; + margin-bottom: 0; + list-style-type: none; +} + +table.indextable > tbody > tr > td > ul { + padding-left: 0em; +} + +table.indextable tr.pcap { + height: 10px; +} + +table.indextable tr.cap { + margin-top: 10px; + background-color: #f2f2f2; +} + +img.toggler { + margin-right: 3px; + margin-top: 3px; + cursor: pointer; +} + +div.modindex-jumpbox { + border-top: 1px solid #ddd; + border-bottom: 1px solid #ddd; + margin: 1em 0 1em 0; + padding: 0.4em; +} + +div.genindex-jumpbox { + border-top: 1px solid #ddd; + border-bottom: 1px solid #ddd; + margin: 1em 0 1em 0; + padding: 0.4em; +} + +/* -- domain module index --------------------------------------------------- */ + +table.modindextable td { + padding: 2px; + border-collapse: collapse; +} + +/* -- general body styles --------------------------------------------------- */ + +div.body { + min-width: 360px; + max-width: 800px; +} + +div.body p, div.body dd, div.body li, div.body blockquote { + -moz-hyphens: auto; + -ms-hyphens: auto; + -webkit-hyphens: auto; + hyphens: auto; +} + +a.headerlink { + visibility: hidden; +} + +a:visited { + color: #551A8B; +} + +h1:hover > a.headerlink, +h2:hover > a.headerlink, +h3:hover > a.headerlink, +h4:hover > a.headerlink, +h5:hover > a.headerlink, +h6:hover > a.headerlink, +dt:hover > a.headerlink, +caption:hover > a.headerlink, +p.caption:hover > a.headerlink, +div.code-block-caption:hover > a.headerlink { + visibility: visible; +} + +div.body p.caption { + text-align: inherit; +} + +div.body td { + text-align: left; +} + +.first { + margin-top: 0 !important; +} + +p.rubric { + margin-top: 30px; + font-weight: bold; +} + +img.align-left, figure.align-left, .figure.align-left, object.align-left { + clear: left; + float: left; + margin-right: 1em; +} + +img.align-right, figure.align-right, .figure.align-right, object.align-right { + clear: right; + float: right; + margin-left: 1em; +} + +img.align-center, figure.align-center, .figure.align-center, object.align-center { + display: block; + margin-left: auto; + margin-right: auto; +} + +img.align-default, figure.align-default, .figure.align-default { + display: block; + margin-left: auto; + margin-right: auto; +} + +.align-left { + text-align: left; +} + +.align-center { + text-align: center; +} + +.align-default { + text-align: center; +} + +.align-right { + text-align: right; +} + +/* -- sidebars -------------------------------------------------------------- */ + +div.sidebar, +aside.sidebar { + margin: 0 0 0.5em 1em; + border: 1px solid #ddb; + padding: 7px; + background-color: #ffe; + width: 40%; + float: right; + clear: right; + overflow-x: auto; +} + +p.sidebar-title { + font-weight: bold; +} + +nav.contents, +aside.topic, +div.admonition, div.topic, blockquote { + clear: left; +} + +/* -- topics ---------------------------------------------------------------- */ + +nav.contents, +aside.topic, +div.topic { + border: 1px solid #ccc; + padding: 7px; + margin: 10px 0 10px 0; +} + +p.topic-title { + font-size: 1.1em; + font-weight: bold; + margin-top: 10px; +} + +/* -- admonitions ----------------------------------------------------------- */ + +div.admonition { + margin-top: 10px; + margin-bottom: 10px; + padding: 7px; +} + +div.admonition dt { + font-weight: bold; +} + +p.admonition-title { + margin: 0px 10px 5px 0px; + font-weight: bold; +} + +div.body p.centered { + text-align: center; + margin-top: 25px; +} + +/* -- content of sidebars/topics/admonitions -------------------------------- */ + +div.sidebar > :last-child, +aside.sidebar > :last-child, +nav.contents > :last-child, +aside.topic > :last-child, +div.topic > :last-child, +div.admonition > :last-child { + margin-bottom: 0; +} + +div.sidebar::after, +aside.sidebar::after, +nav.contents::after, +aside.topic::after, +div.topic::after, +div.admonition::after, +blockquote::after { + display: block; + content: ''; + clear: both; +} + +/* -- tables ---------------------------------------------------------------- */ + +table.docutils { + margin-top: 10px; + margin-bottom: 10px; + border: 0; + border-collapse: collapse; +} + +table.align-center { + margin-left: auto; + margin-right: auto; +} + +table.align-default { + margin-left: auto; + margin-right: auto; +} + +table caption span.caption-number { + font-style: italic; +} + +table caption span.caption-text { +} + +table.docutils td, table.docutils th { + padding: 1px 8px 1px 5px; + border-top: 0; + border-left: 0; + border-right: 0; + border-bottom: 1px solid #aaa; +} + +th { + text-align: left; + padding-right: 5px; +} + +table.citation { + border-left: solid 1px gray; + margin-left: 1px; +} + +table.citation td { + border-bottom: none; +} + +th > :first-child, +td > :first-child { + margin-top: 0px; +} + +th > :last-child, +td > :last-child { + margin-bottom: 0px; +} + +/* -- figures --------------------------------------------------------------- */ + +div.figure, figure { + margin: 0.5em; + padding: 0.5em; +} + +div.figure p.caption, figcaption { + padding: 0.3em; +} + +div.figure p.caption span.caption-number, +figcaption span.caption-number { + font-style: italic; +} + +div.figure p.caption span.caption-text, +figcaption span.caption-text { +} + +/* -- field list styles ----------------------------------------------------- */ + +table.field-list td, table.field-list th { + border: 0 !important; +} + +.field-list ul { + margin: 0; + padding-left: 1em; +} + +.field-list p { + margin: 0; +} + +.field-name { + -moz-hyphens: manual; + -ms-hyphens: manual; + -webkit-hyphens: manual; + hyphens: manual; +} + +/* -- hlist styles ---------------------------------------------------------- */ + +table.hlist { + margin: 1em 0; +} + +table.hlist td { + vertical-align: top; +} + +/* -- object description styles --------------------------------------------- */ + +.sig { + font-family: 'Consolas', 'Menlo', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', monospace; +} + +.sig-name, code.descname { + background-color: transparent; + font-weight: bold; +} + +.sig-name { + font-size: 1.1em; +} + +code.descname { + font-size: 1.2em; +} + +.sig-prename, code.descclassname { + background-color: transparent; +} + +.optional { + font-size: 1.3em; +} + +.sig-paren { + font-size: larger; +} + +.sig-param.n { + font-style: italic; +} + +/* C++ specific styling */ + +.sig-inline.c-texpr, +.sig-inline.cpp-texpr { + font-family: unset; +} + +.sig.c .k, .sig.c .kt, +.sig.cpp .k, .sig.cpp .kt { + color: #0033B3; +} + +.sig.c .m, +.sig.cpp .m { + color: #1750EB; +} + +.sig.c .s, .sig.c .sc, +.sig.cpp .s, .sig.cpp .sc { + color: #067D17; +} + + +/* -- other body styles ----------------------------------------------------- */ + +ol.arabic { + list-style: decimal; +} + +ol.loweralpha { + list-style: lower-alpha; +} + +ol.upperalpha { + list-style: upper-alpha; +} + +ol.lowerroman { + list-style: lower-roman; +} + +ol.upperroman { + list-style: upper-roman; +} + +:not(li) > ol > li:first-child > :first-child, +:not(li) > ul > li:first-child > :first-child { + margin-top: 0px; +} + +:not(li) > ol > li:last-child > :last-child, +:not(li) > ul > li:last-child > :last-child { + margin-bottom: 0px; +} + +ol.simple ol p, +ol.simple ul p, +ul.simple ol p, +ul.simple ul p { + margin-top: 0; +} + +ol.simple > li:not(:first-child) > p, +ul.simple > li:not(:first-child) > p { + margin-top: 0; +} + +ol.simple p, +ul.simple p { + margin-bottom: 0; +} + +aside.footnote > span, +div.citation > span { + float: left; +} +aside.footnote > span:last-of-type, +div.citation > span:last-of-type { + padding-right: 0.5em; +} +aside.footnote > p { + margin-left: 2em; +} +div.citation > p { + margin-left: 4em; +} +aside.footnote > p:last-of-type, +div.citation > p:last-of-type { + margin-bottom: 0em; +} +aside.footnote > p:last-of-type:after, +div.citation > p:last-of-type:after { + content: ""; + clear: both; +} + +dl.field-list { + display: grid; + grid-template-columns: fit-content(30%) auto; +} + +dl.field-list > dt { + font-weight: bold; + word-break: break-word; + padding-left: 0.5em; + padding-right: 5px; +} + +dl.field-list > dd { + padding-left: 0.5em; + margin-top: 0em; + margin-left: 0em; + margin-bottom: 0em; +} + +dl { + margin-bottom: 15px; +} + +dd > :first-child { + margin-top: 0px; +} + +dd ul, dd table { + margin-bottom: 10px; +} + +dd { + margin-top: 3px; + margin-bottom: 10px; + margin-left: 30px; +} + +.sig dd { + margin-top: 0px; + margin-bottom: 0px; +} + +.sig dl { + margin-top: 0px; + margin-bottom: 0px; +} + +dl > dd:last-child, +dl > dd:last-child > :last-child { + margin-bottom: 0; +} + +dt:target, span.highlighted { + background-color: #fbe54e; +} + +rect.highlighted { + fill: #fbe54e; +} + +dl.glossary dt { + font-weight: bold; + font-size: 1.1em; +} + +.versionmodified { + font-style: italic; +} + +.system-message { + background-color: #fda; + padding: 5px; + border: 3px solid red; +} + +.footnote:target { + background-color: #ffa; +} + +.line-block { + display: block; + margin-top: 1em; + margin-bottom: 1em; +} + +.line-block .line-block { + margin-top: 0; + margin-bottom: 0; + margin-left: 1.5em; +} + +.guilabel, .menuselection { + font-family: sans-serif; +} + +.accelerator { + text-decoration: underline; +} + +.classifier { + font-style: oblique; +} + +.classifier:before { + font-style: normal; + margin: 0 0.5em; + content: ":"; + display: inline-block; +} + +abbr, acronym { + border-bottom: dotted 1px; + cursor: help; +} + +.translated { + background-color: rgba(207, 255, 207, 0.2) +} + +.untranslated { + background-color: rgba(255, 207, 207, 0.2) +} + +/* -- code displays --------------------------------------------------------- */ + +pre { + overflow: auto; + overflow-y: hidden; /* fixes display issues on Chrome browsers */ +} + +pre, div[class*="highlight-"] { + clear: both; +} + +span.pre { + -moz-hyphens: none; + -ms-hyphens: none; + -webkit-hyphens: none; + hyphens: none; + white-space: nowrap; +} + +div[class*="highlight-"] { + margin: 1em 0; +} + +td.linenos pre { + border: 0; + background-color: transparent; + color: #aaa; +} + +table.highlighttable { + display: block; +} + +table.highlighttable tbody { + display: block; +} + +table.highlighttable tr { + display: flex; +} + +table.highlighttable td { + margin: 0; + padding: 0; +} + +table.highlighttable td.linenos { + padding-right: 0.5em; +} + +table.highlighttable td.code { + flex: 1; + overflow: hidden; +} + +.highlight .hll { + display: block; +} + +div.highlight pre, +table.highlighttable pre { + margin: 0; +} + +div.code-block-caption + div { + margin-top: 0; +} + +div.code-block-caption { + margin-top: 1em; + padding: 2px 5px; + font-size: small; +} + +div.code-block-caption code { + background-color: transparent; +} + +table.highlighttable td.linenos, +span.linenos, +div.highlight span.gp { /* gp: Generic.Prompt */ + user-select: none; + -webkit-user-select: text; /* Safari fallback only */ + -webkit-user-select: none; /* Chrome/Safari */ + -moz-user-select: none; /* Firefox */ + -ms-user-select: none; /* IE10+ */ +} + +div.code-block-caption span.caption-number { + padding: 0.1em 0.3em; + font-style: italic; +} + +div.code-block-caption span.caption-text { +} + +div.literal-block-wrapper { + margin: 1em 0; +} + +code.xref, a code { + background-color: transparent; + font-weight: bold; +} + +h1 code, h2 code, h3 code, h4 code, h5 code, h6 code { + background-color: transparent; +} + +.viewcode-link { + float: right; +} + +.viewcode-back { + float: right; + font-family: sans-serif; +} + +div.viewcode-block:target { + margin: -1px -10px; + padding: 0 10px; +} + +/* -- math display ---------------------------------------------------------- */ + +img.math { + vertical-align: middle; +} + +div.body div.math p { + text-align: center; +} + +span.eqno { + float: right; +} + +span.eqno a.headerlink { + position: absolute; + z-index: 1; +} + +div.math:hover a.headerlink { + visibility: visible; +} + +/* -- printout stylesheet --------------------------------------------------- */ + +@media print { + div.document, + div.documentwrapper, + div.bodywrapper { + margin: 0 !important; + width: 100%; + } + + div.sphinxsidebar, + div.related, + div.footer, + #top-link { + display: none; + } +} \ No newline at end of file diff --git a/_static/binder_badge_logo.svg b/_static/binder_badge_logo.svg new file mode 100644 index 00000000..327f6b63 --- /dev/null +++ b/_static/binder_badge_logo.svg @@ -0,0 +1 @@ + launchlaunchbinderbinder \ No newline at end of file diff --git a/_static/broken_example.png b/_static/broken_example.png new file mode 100644 index 00000000..4fea24e7 Binary files /dev/null and b/_static/broken_example.png differ diff --git a/_static/chemiscope-loading.svg b/_static/chemiscope-loading.svg new file mode 100644 index 00000000..0222d6b2 --- /dev/null +++ b/_static/chemiscope-loading.svg @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/_static/chemiscope-sphinx.css b/_static/chemiscope-sphinx.css new file mode 100644 index 00000000..f91f44f8 --- /dev/null +++ b/_static/chemiscope-sphinx.css @@ -0,0 +1,88 @@ +.chemiscope-sphinx-warning { + display: none; + flex-wrap: wrap; + border: 1px solid #f0ad4e; + background-color: #fcf8e3; + color: #8a6d3b; + padding: 15px; + border-radius: 4px; + margin-bottom: 20px; + + button { + position: relative; + float: right; + font-size: 3em; + line-height: 1; + color: inherit; + text-shadow: none; + background-color: transparent; + border: 0; + } + + p { + flex: 1; + } +} + +.chemiscope-sphinx-spinner img { + width: 2em; + height: 2em; + animation: spin 2s linear infinite; + position: absolute; + z-index: 100000; + left: 50%; +} + +@keyframes spin { + from { + transform: rotate(0deg); + } + + to { + transform: rotate(360deg); + } +} + +.chemiscope-sphinx { + .visualizer-container { + display: flex; + flex-wrap: wrap; + background: white; + padding-bottom: 16px; + } + + .visualizer-column { + flex: 1; + position: relative; + display: flex; + flex-direction: column; + padding-left: 10px; + } + + .visualizer-column-right { + flex: 1; + position: relative; + padding-right: 10px; + } + + .visualizer-item { + width: 100%; + height: 100%; + flex: 1; + } + + .visualizer-info { + flex-shrink: 0; + } + + .visualizer-structure-mode, + .visualizer-map-mode { + margin: auto; + max-width: 500px; + height: 550px; + } + + .visualizer-map-mode { + display: block; + } +} diff --git a/_static/chemiscope-sphinx.html b/_static/chemiscope-sphinx.html new file mode 100644 index 00000000..fd3eaf2e --- /dev/null +++ b/_static/chemiscope-sphinx.html @@ -0,0 +1,35 @@ + + + + + + + + + + + + + +
+

+ +
+
+ + +
+ Loading icon +
+ + +
+ +
+ + + diff --git a/_static/chemiscope-sphinx.js b/_static/chemiscope-sphinx.js new file mode 100644 index 00000000..2c93b818 --- /dev/null +++ b/_static/chemiscope-sphinx.js @@ -0,0 +1,178 @@ +/* eslint-disable */ + +/** + * Enum of the modes + */ +const VISUALISER_MODE = { + DEFAULT: 'default', + STRUCTURE: 'structure', + MAP: 'map', +}; + +/** + * Asynchronously loads the Chemiscope visualization for the dataset + */ +async function loadChemiscopeSphinx(divId, filePath, visualizerMode = VISUALISER_MODE.DEFAULT) { + // Handle warnings + Chemiscope.addWarningHandler((message) => displayWarning(divId, message)); + // Display loading + toggleLoadingVisible(divId, true); + + // Load the visualizer + try { + const dataset = await fetchDataset(filePath); + + // Setup visualizer config + const config = { + map: `${divId}-map`, + info: `${divId}-info`, + meta: `${divId}-meta`, + structure: `${divId}-structure`, + }; + + // Prepare html for the visualizer + const root = document.getElementById(divId); + root.innerHTML = generateChemiscopeHTML(config, visualizerMode); + + // Load widget + const visualiser = getVisualizer(visualizerMode); + await visualiser.load(config, dataset); + } catch (error) { + // Display errors + console.error(error); + displayWarning(divId, error); + } finally { + // Hide loading + toggleLoadingVisible(divId, false); + } +} + +/** + * Returns the appropriate Chemiscope visualizer based on the given mode + */ +function getVisualizer(mode) { + switch (mode) { + case VISUALISER_MODE.STRUCTURE: + return Chemiscope.StructureVisualizer; + case VISUALISER_MODE.MAP: + return Chemiscope.MapVisualizer; + default: + return Chemiscope.DefaultVisualizer; + } +} + +/** + * Loads the dataset and handled gzipped JSON with NaN values + */ +async function fetchDataset(filePath) { + // Get path to the file + const baseUrl = `${filePath}`; + + // Load file + const response = await fetch(baseUrl); + if (!response.ok) { + throw new Error(`Failed to fetch ${filePath}: ${response.statusText}`); + } + const buffer = await response.arrayBuffer(); + const magic = new Uint8Array(buffer.slice(0, 2)); + + let text; + // '1f 8b' is the magic constant starting gzip files + if (magic[0] == 0x1f && magic[1] == 0x8b) { + text = pako.inflate(new Uint8Array(buffer), { to: 'string' }); + } else { + const decoder = new TextDecoder('utf-8'); + text = decoder.decode(buffer); + } + return parseJsonWithNaN(text); +} + +/** + * Allow NaN in the JSON file. They are not part of the spec, but Python's json + * module output them, and they can be useful. + */ +function parseJsonWithNaN(text) { + return JSON.parse(text.replace(/\bNaN\b/g, '"***NaN***"'), (_key, value) => { + return value === '***NaN***' ? NaN : value; + }); +} + +/** + * Generates the HTML content for the Chemiscope visualizer + */ +function generateChemiscopeHTML(config, visualizerMode) { + switch (visualizerMode) { + case VISUALISER_MODE.DEFAULT: + return ` +
+
+
+
+
+
+
+
+
+
+
+
`; + case VISUALISER_MODE.STRUCTURE: + return ` +
+
+
+
+
+
+
+
+
`; + case VISUALISER_MODE.MAP: + return ` +
+
+
+
+
+
+
+
+
`; + } +} + +/** + * Toggles the visibility of the loader spinner + */ +function toggleLoadingVisible(divId, visible = true) { + const loader = document.getElementById(`${divId}-loading`); + if (loader) { + loader.style.display = visible ? 'block' : 'none'; + } +} + +/** + * Hides the specified element + */ +function hideElement(elementId) { + const element = document.getElementById(elementId); + if (element) { + element.style.display = 'none'; + } else { + console.error(`Element ${elementId} is not found`); + } +} + +/** + * Displays a warning message in the specified div + */ +function displayWarning(divId, message) { + const display = document.getElementById(`${divId}-warning-display`); + display.getElementsByTagName('p')[0].innerText = message; + display.style.display = 'flex'; + + // Automatically remove the warning after 4 seconds + setTimeout(() => { + display.style.display = 'none'; + }, 4000); +} diff --git a/_static/chemiscope.min.js b/_static/chemiscope.min.js new file mode 100644 index 00000000..221774f4 --- /dev/null +++ b/_static/chemiscope.min.js @@ -0,0 +1,2 @@ +/*! For license information please see chemiscope.min.js.LICENSE.txt */ +!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.Chemiscope=e():t.Chemiscope=e()}(self,(()=>(()=>{var __webpack_modules__={5955:(t,e,r)=>{"use strict";r.d(e,{A:()=>pt});var n=r(78706),i=r.n(n),o=r(72859),a=r.n(o),s=r(21906),l=r.n(s),c=new URL(r(77035),r.b),u=new URL(r(43470),r.b),h=new URL(r(68164),r.b),d=new URL(r(64665),r.b),f=new URL(r(4890),r.b),p=new URL(r(13363),r.b),m=new URL(r(13490),r.b),g=new URL(r(47603),r.b),v=new URL(r(13913),r.b),b=new URL(r(91413),r.b),y=new URL(r(64643),r.b),x=new URL(r(80216),r.b),_=new URL(r(61907),r.b),w=new URL(r(68605),r.b),k=new URL(r(25446),r.b),A=new URL(r(56694),r.b),M=new URL(r(24420),r.b),T=new URL(r(75796),r.b),S=new URL(r(92228),r.b),C=new URL(r(9819),r.b),E=new URL(r(47695),r.b),L=new URL(r(28869),r.b),z=new URL(r(30557),r.b),O=new URL(r(48460),r.b),D=new URL(r(56539),r.b),I=new URL(r(43737),r.b),F=new URL(r(47914),r.b),R=new URL(r(26117),r.b),P=new URL(r(66311),r.b),j=a()(i()),N=l()(c),B=l()(u),U=l()(h),G=l()(d),V=l()(f),H=l()(p),W=l()(m),q=l()(g),Y=l()(v),Z=l()(b),X=l()(y),$=l()(x),J=l()(_),K=l()(w),Q=l()(k),tt=l()(A),et=l()(M),rt=l()(T),nt=l()(S),it=l()(C),ot=l()(E),at=l()(L),st=l()(z),lt=l()(O),ct=l()(D),ut=l()(I),ht=l()(F),dt=l()(R),ft=l()(P);j.push([t.id,`.maplibregl-map{font:12px/20px Helvetica Neue,Arial,Helvetica,sans-serif;overflow:hidden;position:relative;-webkit-tap-highlight-color:rgb(0 0 0/0)}.maplibregl-canvas{left:0;position:absolute;top:0}.maplibregl-map:fullscreen{height:100%;width:100%}.maplibregl-ctrl-group button.maplibregl-ctrl-compass{touch-action:none}.maplibregl-canvas-container.maplibregl-interactive,.maplibregl-ctrl-group button.maplibregl-ctrl-compass{cursor:grab;-webkit-user-select:none;-moz-user-select:none;user-select:none}.maplibregl-canvas-container.maplibregl-interactive.maplibregl-track-pointer{cursor:pointer}.maplibregl-canvas-container.maplibregl-interactive:active,.maplibregl-ctrl-group button.maplibregl-ctrl-compass:active{cursor:grabbing}.maplibregl-canvas-container.maplibregl-touch-zoom-rotate,.maplibregl-canvas-container.maplibregl-touch-zoom-rotate .maplibregl-canvas{touch-action:pan-x pan-y}.maplibregl-canvas-container.maplibregl-touch-drag-pan,.maplibregl-canvas-container.maplibregl-touch-drag-pan .maplibregl-canvas{touch-action:pinch-zoom}.maplibregl-canvas-container.maplibregl-touch-zoom-rotate.maplibregl-touch-drag-pan,.maplibregl-canvas-container.maplibregl-touch-zoom-rotate.maplibregl-touch-drag-pan .maplibregl-canvas{touch-action:none}.maplibregl-canvas-container.maplibregl-touch-drag-pan.maplibregl-cooperative-gestures,.maplibregl-canvas-container.maplibregl-touch-drag-pan.maplibregl-cooperative-gestures .maplibregl-canvas{touch-action:pan-x pan-y}.maplibregl-ctrl-bottom-left,.maplibregl-ctrl-bottom-right,.maplibregl-ctrl-top-left,.maplibregl-ctrl-top-right{pointer-events:none;position:absolute;z-index:2}.maplibregl-ctrl-top-left{left:0;top:0}.maplibregl-ctrl-top-right{right:0;top:0}.maplibregl-ctrl-bottom-left{bottom:0;left:0}.maplibregl-ctrl-bottom-right{bottom:0;right:0}.maplibregl-ctrl{clear:both;pointer-events:auto;transform:translate(0)}.maplibregl-ctrl-top-left .maplibregl-ctrl{float:left;margin:10px 0 0 10px}.maplibregl-ctrl-top-right .maplibregl-ctrl{float:right;margin:10px 10px 0 0}.maplibregl-ctrl-bottom-left .maplibregl-ctrl{float:left;margin:0 0 10px 10px}.maplibregl-ctrl-bottom-right .maplibregl-ctrl{float:right;margin:0 10px 10px 0}.maplibregl-ctrl-group{background:#fff;border-radius:4px}.maplibregl-ctrl-group:not(:empty){box-shadow:0 0 0 2px rgba(0,0,0,.1)}@media (forced-colors:active){.maplibregl-ctrl-group:not(:empty){box-shadow:0 0 0 2px ButtonText}}.maplibregl-ctrl-group button{background-color:transparent;border:0;box-sizing:border-box;cursor:pointer;display:block;height:29px;outline:none;padding:0;width:29px}.maplibregl-ctrl-group button+button{border-top:1px solid #ddd}.maplibregl-ctrl button .maplibregl-ctrl-icon{background-position:50%;background-repeat:no-repeat;display:block;height:100%;width:100%}@media (forced-colors:active){.maplibregl-ctrl-icon{background-color:transparent}.maplibregl-ctrl-group button+button{border-top:1px solid ButtonText}}.maplibregl-ctrl button::-moz-focus-inner{border:0;padding:0}.maplibregl-ctrl-attrib-button:focus,.maplibregl-ctrl-group button:focus{box-shadow:0 0 2px 2px #0096ff}.maplibregl-ctrl button:disabled{cursor:not-allowed}.maplibregl-ctrl button:disabled .maplibregl-ctrl-icon{opacity:.25}.maplibregl-ctrl button:not(:disabled):hover{background-color:rgb(0 0 0/5%)}.maplibregl-ctrl-group button:focus:focus-visible{box-shadow:0 0 2px 2px #0096ff}.maplibregl-ctrl-group button:focus:not(:focus-visible){box-shadow:none}.maplibregl-ctrl-group button:focus:first-child{border-radius:4px 4px 0 0}.maplibregl-ctrl-group button:focus:last-child{border-radius:0 0 4px 4px}.maplibregl-ctrl-group button:focus:only-child{border-radius:inherit}.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon{background-image:url(${N})}.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url(${B})}@media (forced-colors:active){.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon{background-image:url(${U})}.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url(${G})}}@media (forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon{background-image:url(${V})}.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url(${H})}}.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon{background-image:url(${W})}.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon{background-image:url(${q})}@media (forced-colors:active){.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon{background-image:url(${Y})}.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon{background-image:url(${Z})}}@media (forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon{background-image:url(${X})}.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon{background-image:url(${q})}}.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon{background-image:url(${$})}@media (forced-colors:active){.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon{background-image:url(${J})}}@media (forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon{background-image:url(${K})}}.maplibregl-ctrl button.maplibregl-ctrl-terrain .maplibregl-ctrl-icon{background-image:url(${Q})}.maplibregl-ctrl button.maplibregl-ctrl-terrain-enabled .maplibregl-ctrl-icon{background-image:url(${tt})}.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon{background-image:url(${et})}.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon{background-image:url(${rt})}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active .maplibregl-ctrl-icon{background-image:url(${nt})}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active-error .maplibregl-ctrl-icon{background-image:url(${it})}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background .maplibregl-ctrl-icon{background-image:url(${ot})}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background-error .maplibregl-ctrl-icon{background-image:url(${at})}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-waiting .maplibregl-ctrl-icon{animation:maplibregl-spin 2s linear infinite}@media (forced-colors:active){.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon{background-image:url(${st})}.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon{background-image:url(${lt})}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active .maplibregl-ctrl-icon{background-image:url(${nt})}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active-error .maplibregl-ctrl-icon{background-image:url(${it})}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background .maplibregl-ctrl-icon{background-image:url(${ot})}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background-error .maplibregl-ctrl-icon{background-image:url(${at})}}@media (forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon{background-image:url(${ct})}.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon{background-image:url(${ut})}}@keyframes maplibregl-spin{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}a.maplibregl-ctrl-logo{background-image:url(${ht});background-repeat:no-repeat;cursor:pointer;display:block;height:23px;margin:0 0 -4px -4px;overflow:hidden;width:88px}a.maplibregl-ctrl-logo.maplibregl-compact{width:14px}@media (forced-colors:active){a.maplibregl-ctrl-logo{background-color:transparent;background-image:url(${ht})}}@media (forced-colors:active) and (prefers-color-scheme:light){a.maplibregl-ctrl-logo{background-image:url(${ht})}}.maplibregl-ctrl.maplibregl-ctrl-attrib{background-color:hsla(0,0%,100%,.5);margin:0;padding:0 5px}@media screen{.maplibregl-ctrl-attrib.maplibregl-compact{background-color:#fff;border-radius:12px;box-sizing:content-box;color:#000;margin:10px;min-height:20px;padding:2px 24px 2px 0;position:relative}.maplibregl-ctrl-attrib.maplibregl-compact-show{padding:2px 28px 2px 8px;visibility:visible}.maplibregl-ctrl-bottom-left>.maplibregl-ctrl-attrib.maplibregl-compact-show,.maplibregl-ctrl-top-left>.maplibregl-ctrl-attrib.maplibregl-compact-show{border-radius:12px;padding:2px 8px 2px 28px}.maplibregl-ctrl-attrib.maplibregl-compact .maplibregl-ctrl-attrib-inner{display:none}.maplibregl-ctrl-attrib-button{background-color:hsla(0,0%,100%,.5);background-image:url(${dt});border:0;border-radius:12px;box-sizing:border-box;cursor:pointer;display:none;height:24px;outline:none;position:absolute;right:0;top:0;width:24px}.maplibregl-ctrl-attrib summary.maplibregl-ctrl-attrib-button{-webkit-appearance:none;-moz-appearance:none;appearance:none;list-style:none}.maplibregl-ctrl-attrib summary.maplibregl-ctrl-attrib-button::-webkit-details-marker{display:none}.maplibregl-ctrl-bottom-left .maplibregl-ctrl-attrib-button,.maplibregl-ctrl-top-left .maplibregl-ctrl-attrib-button{left:0}.maplibregl-ctrl-attrib.maplibregl-compact .maplibregl-ctrl-attrib-button,.maplibregl-ctrl-attrib.maplibregl-compact-show .maplibregl-ctrl-attrib-inner{display:block}.maplibregl-ctrl-attrib.maplibregl-compact-show .maplibregl-ctrl-attrib-button{background-color:rgb(0 0 0/5%)}.maplibregl-ctrl-bottom-right>.maplibregl-ctrl-attrib.maplibregl-compact:after{bottom:0;right:0}.maplibregl-ctrl-top-right>.maplibregl-ctrl-attrib.maplibregl-compact:after{right:0;top:0}.maplibregl-ctrl-top-left>.maplibregl-ctrl-attrib.maplibregl-compact:after{left:0;top:0}.maplibregl-ctrl-bottom-left>.maplibregl-ctrl-attrib.maplibregl-compact:after{bottom:0;left:0}}@media screen and (forced-colors:active){.maplibregl-ctrl-attrib.maplibregl-compact:after{background-image:url(${ft})}}@media screen and (forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl-attrib.maplibregl-compact:after{background-image:url(${dt})}}.maplibregl-ctrl-attrib a{color:rgba(0,0,0,.75);text-decoration:none}.maplibregl-ctrl-attrib a:hover{color:inherit;text-decoration:underline}.maplibregl-attrib-empty{display:none}.maplibregl-ctrl-scale{background-color:hsla(0,0%,100%,.75);border:2px solid #333;border-top:#333;box-sizing:border-box;color:#333;font-size:10px;padding:0 5px}.maplibregl-popup{display:flex;left:0;pointer-events:none;position:absolute;top:0;will-change:transform}.maplibregl-popup-anchor-top,.maplibregl-popup-anchor-top-left,.maplibregl-popup-anchor-top-right{flex-direction:column}.maplibregl-popup-anchor-bottom,.maplibregl-popup-anchor-bottom-left,.maplibregl-popup-anchor-bottom-right{flex-direction:column-reverse}.maplibregl-popup-anchor-left{flex-direction:row}.maplibregl-popup-anchor-right{flex-direction:row-reverse}.maplibregl-popup-tip{border:10px solid transparent;height:0;width:0;z-index:1}.maplibregl-popup-anchor-top .maplibregl-popup-tip{align-self:center;border-bottom-color:#fff;border-top:none}.maplibregl-popup-anchor-top-left .maplibregl-popup-tip{align-self:flex-start;border-bottom-color:#fff;border-left:none;border-top:none}.maplibregl-popup-anchor-top-right .maplibregl-popup-tip{align-self:flex-end;border-bottom-color:#fff;border-right:none;border-top:none}.maplibregl-popup-anchor-bottom .maplibregl-popup-tip{align-self:center;border-bottom:none;border-top-color:#fff}.maplibregl-popup-anchor-bottom-left .maplibregl-popup-tip{align-self:flex-start;border-bottom:none;border-left:none;border-top-color:#fff}.maplibregl-popup-anchor-bottom-right .maplibregl-popup-tip{align-self:flex-end;border-bottom:none;border-right:none;border-top-color:#fff}.maplibregl-popup-anchor-left .maplibregl-popup-tip{align-self:center;border-left:none;border-right-color:#fff}.maplibregl-popup-anchor-right .maplibregl-popup-tip{align-self:center;border-left-color:#fff;border-right:none}.maplibregl-popup-close-button{background-color:transparent;border:0;border-radius:0 3px 0 0;cursor:pointer;position:absolute;right:0;top:0}.maplibregl-popup-close-button:hover{background-color:rgb(0 0 0/5%)}.maplibregl-popup-content{background:#fff;border-radius:3px;box-shadow:0 1px 2px rgba(0,0,0,.1);padding:15px 10px;pointer-events:auto;position:relative}.maplibregl-popup-anchor-top-left .maplibregl-popup-content{border-top-left-radius:0}.maplibregl-popup-anchor-top-right .maplibregl-popup-content{border-top-right-radius:0}.maplibregl-popup-anchor-bottom-left .maplibregl-popup-content{border-bottom-left-radius:0}.maplibregl-popup-anchor-bottom-right .maplibregl-popup-content{border-bottom-right-radius:0}.maplibregl-popup-track-pointer{display:none}.maplibregl-popup-track-pointer *{pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.maplibregl-map:hover .maplibregl-popup-track-pointer{display:flex}.maplibregl-map:active .maplibregl-popup-track-pointer{display:none}.maplibregl-marker{left:0;position:absolute;top:0;transition:opacity .2s;will-change:transform}.maplibregl-user-location-dot,.maplibregl-user-location-dot:before{background-color:#1da1f2;border-radius:50%;height:15px;width:15px}.maplibregl-user-location-dot:before{animation:maplibregl-user-location-dot-pulse 2s infinite;content:"";position:absolute}.maplibregl-user-location-dot:after{border:2px solid #fff;border-radius:50%;box-shadow:0 0 3px rgba(0,0,0,.35);box-sizing:border-box;content:"";height:19px;left:-2px;position:absolute;top:-2px;width:19px}@keyframes maplibregl-user-location-dot-pulse{0%{opacity:1;transform:scale(1)}70%{opacity:0;transform:scale(3)}to{opacity:0;transform:scale(1)}}.maplibregl-user-location-dot-stale{background-color:#aaa}.maplibregl-user-location-dot-stale:after{display:none}.maplibregl-user-location-accuracy-circle{background-color:#1da1f233;border-radius:100%;height:1px;width:1px}.maplibregl-crosshair,.maplibregl-crosshair .maplibregl-interactive,.maplibregl-crosshair .maplibregl-interactive:active{cursor:crosshair}.maplibregl-boxzoom{background:#fff;border:2px dotted #202020;height:0;left:0;opacity:.5;position:absolute;top:0;width:0}.maplibregl-cooperative-gesture-screen{align-items:center;background:rgba(0,0,0,.4);color:#fff;display:flex;font-size:1.4em;inset:0;justify-content:center;line-height:1.2;opacity:0;padding:1rem;pointer-events:none;position:absolute;transition:opacity 1s ease 1s;z-index:99999}.maplibregl-cooperative-gesture-screen.maplibregl-show{opacity:1;transition:opacity .05s}.maplibregl-cooperative-gesture-screen .maplibregl-mobile-message{display:none}@media (hover:none),(width <= 480px){.maplibregl-cooperative-gesture-screen .maplibregl-desktop-message{display:none}.maplibregl-cooperative-gesture-screen .maplibregl-mobile-message{display:block}}.maplibregl-pseudo-fullscreen{height:100%!important;left:0!important;position:fixed!important;top:0!important;width:100%!important;z-index:99999}`,""]);const pt=j},5018:(t,e,r)=>{"use strict";r.d(e,{A:()=>s});var n=r(78706),i=r.n(n),o=r(72859),a=r.n(o)()(i());a.push([t.id,".chsp-meta {\n z-index: 1;\n cursor: pointer;\n}\n\n.chsp-meta .chsp-info-icon {\n float: right;\n margin-top: 5px;\n margin-left: 3px;\n}\n\n.chsp-meta .chsp-info-icon svg {\n display: block;\n width: 14px;\n height: 14px;\n opacity: 0.6;\n}\n\n.chsp-authors-list {\n padding: 0;\n display: flex;\n flex-wrap: wrap;\n flex-direction: row;\n justify-content: center;\n}\n\n.chsp-authors-list li {\n border: solid #dee2e6 1px;\n padding: 10px;\n list-style-type: none;\n white-space: nowrap;\n}\n\n.chsp-open-map-settings {\n position: absolute;\n top: 3px;\n left: 5px;\n z-index: 10;\n}\n\n.chsp-open-viewer-settings {\n position: absolute;\n top: 5px;\n right: 5px;\n}\n\n.chsp-extra-options-btn {\n margin: auto;\n display: block;\n}\n\n/* Tooltip text */\n.chsp-tooltip {\n visibility: hidden;\n background: #69738a;\n color: white;\n padding: 6px;\n font-size: 12px;\n line-height: 12px;\n white-space: nowrap;\n border-radius: 2px;\n text-align: center;\n display: inline-block;\n width: 9em;\n position: absolute;\n z-index: 100000;\n}\n\n.chsp-tooltip-right {\n top: 0px;\n right: -9.5em;\n}\n\n.chsp-tooltip-below {\n top: 35px;\n left: -3.5em;\n}\n\n.chsp-has-tooltip:hover .chsp-tooltip {\n visibility: visible;\n}\n\n.chsp-pin-marker {\n border-radius: 50%;\n border: solid 1px black;\n --size: 12px;\n width: var(--size);\n height: var(--size);\n z-index: 10;\n}\n\n.chsp-map-pin-marker {\n position: absolute;\n /* ensure the top/right/left/bottom positioning is relative to the center of the div */\n transform: translate(calc(-50% + var(--size)), -50%);\n}\n\n.chsp-pin-marker:hover {\n --size: 20px;\n cursor: pointer;\n}\n\n/* This class is added on top of .chsp-pin-marker for the active pinned structure/environment */\n.chsp-active-pin {\n border-width: 2px;\n --size: 20px;\n}\n\n.chsp-active-pin:hover {\n --size: 22px;\n cursor: default;\n}\n\n.chsp-viewer-button {\n position: absolute;\n padding: 1px;\n margin: 0;\n height: 28px;\n width: 28px;\n z-index: 10;\n}\n\n.chsp-viewer-action-button {\n background-color: white;\n border: none;\n}\n\n.chsp-viewer-action-button:hover {\n background: white;\n}\n\n.chsp-viewer-action-button svg {\n opacity: 0.4;\n transition: opacity 0.15s ease-in-out;\n}\n\n.chsp-viewer-action-button:hover svg {\n opacity: 0.6;\n}\n\n.chsp-structure-viewer-grid {\n display: grid;\n position: relative;\n width: 100%;\n height: 100%;\n grid-column-gap: 2px;\n grid-row-gap: 2px;\n}\n\n.chsp-structure-viewer-cell {\n width: 99%;\n height: 99%;\n left: 0.5%;\n top: 0.5%;\n position: relative;\n border: 1px solid lightgray;\n padding: 1px;\n}\n\n.chsp-structure-viewer-cell-active {\n border-color: gray;\n}\n\n.chsp-map-options {\n display: grid;\n grid-template-columns: 1fr 0.5fr;\n align-items: center;\n justify-content: center;\n align-content: start;\n column-gap: 1em;\n}\n\n.chsp-map-options label {\n min-width: 6em;\n}\n\n.chsp-map-options > :nth-child(n + 3):not(.chsp-map-extra-options) {\n margin-top: 1.3rem;\n}\n\n.chsp-map-extra-options {\n display: grid;\n align-items: center;\n justify-items: center;\n grid-template-columns: auto 1fr 1fr;\n column-gap: 1em;\n}\n\n.chsp-map-extra-options > * {\n margin: 0.5em 0;\n}\n\n.chsp-map-extra-options label {\n min-width: auto;\n}\n\n.chsp-map-extra-options {\n grid-column: 1 / span 2;\n}\n\n.chsp-map-options .form-check-label {\n width: auto;\n}\n\n.chsp-modal-header {\n cursor: grab;\n}\n\n.chsp-play-button {\n border: 0;\n background: transparent;\n box-sizing: border-box;\n height: 1.2em;\n width: 1.2em;\n margin-left: 0.5ex;\n\n border-color: transparent transparent transparent #202020;\n transition: 100ms all ease;\n cursor: pointer;\n\n border-style: solid;\n border-width: 0.7em 0 0.7em 1em;\n}\n\n.chsp-play-button.chsp-playing {\n border-style: double;\n border-width: 0px 0 0px 1.2em;\n}\n\n.chsp-play-button:hover {\n border-color: transparent transparent transparent #404040;\n}\n\n.chsp-properties-table {\n height: 100%;\n width: 80%;\n margin: auto;\n}\n\n.chsp-properties-table td,\n.chsp-properties-table th {\n width: 50%;\n border-top: none;\n}\n\n.chsp-settings-section-title {\n font-weight: bold;\n}\n\n/* Change Plotly modebar style to match the style of the structure grid buttons */\n\n.chsp-map .modebar-group {\n padding-left: 0 !important;\n}\n\n.chsp-map .modebar-btn {\n cursor: default !important;\n font-family: apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial,\n 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol',\n 'Noto Color Emoji';\n}\n\n.chsp-map .modebar-btn::after {\n opacity: 0.9;\n}\n\n.chsp-map .icon:hover + .modebar-btn::after {\n visibility: visible;\n}\n\n.chsp-map .modebar-btn::before {\n content: none !important;\n}\n\n.chsp-map .modebar-btn .icon {\n transition: opacity 0.15s ease-in-out;\n padding: 3px;\n opacity: 0.3;\n cursor: pointer;\n}\n\n.chsp-map .modebar-group svg.icon {\n width: 2em;\n height: 2em;\n border-radius: 0.2em;\n}\n\n.chsp-map .modebar-group svg.icon:active {\n color: #212529;\n background-color: #dae0e5;\n border-color: #d3d9df;\n box-shadow: 0 0 0 0.2rem rgb(216 217 219 / 50%);\n}\n\n.chsp-map .modebar-btn .icon path {\n transition:\n color 0.15s ease-in-out,\n background-color 0.15s ease-in-out,\n border-color 0.15s ease-in-out,\n box-shadow 0.15s ease-in-out;\n fill: black !important;\n}\n\n.chsp-map .modebar-btn .icon:hover {\n opacity: 0.6;\n}\n\n.chsp-map .modebar-btn.active .icon {\n opacity: 0.6;\n}\n\n.chsp-info-btns {\n display: flex;\n position: relative;\n margin-bottom: 0.5ex;\n margin-top: 0.5ex;\n justify-content: center;\n}\n\n.chsp-info-structure-btn {\n min-width: 8em;\n padding-left: 6px;\n padding-right: 4px;\n font-weight: bold;\n font-size: small;\n background-color: none;\n border-color: #66a5e8;\n border-width: 2px;\n float: left;\n}\n\n.chsp-info-structure-btn:hover {\n background-color: #5b94d0;\n}\n\n.chsp-info-atom-btn {\n margin-left: 1em;\n padding-left: 6px;\n padding-right: 4px;\n min-width: 8em;\n font-weight: bold;\n font-size: small;\n background-color: none;\n border-color: #4cb64c;\n border-width: 2px;\n}\n\n.chsp-info-atom-btn:hover {\n background-color: #44a344;\n}\n\n.chsp-info-btns-svg {\n float: left;\n padding-right: 6px;\n padding-top: 3px;\n}\n\n.chsp-info-btns-svg svg {\n display: block;\n opacity: 0.6;\n}\n\n.chsp-info-number {\n -moz-appearance: textfield;\n appearance: textfield;\n border: none;\n transition: background-color 0.15s;\n background-color: #ebedf0;\n margin-left: 2px;\n margin-right: 3px;\n font-family: inherit;\n width: 4em;\n}\n\n.chsp-info-atom-btn:hover .chsp-info-number {\n background-color: #69b569;\n}\n\n.chsp-info-structure-btn:hover .chsp-info-number {\n background-color: #7ba9d9;\n}\n\n.chsp-info-number::-webkit-outer-spin-button,\n.chsp-info-number::-webkit-inner-spin-button {\n -webkit-appearance: none;\n margin: 0;\n}\n\n.chsp-info-tables {\n position: relative;\n width: 100%;\n}\n\n.chsp-info-table {\n position: absolute;\n bottom: 0;\n left: 0;\n right: 0;\n z-index: 10;\n background-color: white;\n /* max-height is set in JavaScript */\n overflow: auto;\n}\n\n.chsp-info-table.collapsing {\n overflow: hidden;\n}\n\n.chsp-info-table table {\n margin: 0;\n}\n\n/* Change the atoms slider thumb color to green, to match structure highlight */\n.chsp-atom-slider::-webkit-slider-thumb {\n background-color: #008000;\n}\n\n.chsp-atom-slider::-moz-range-thumb {\n background-color: #008000;\n}\n\n.chsp-atom-slider::-ms-thumb {\n background-color: #008000;\n}\n\n.chsp-atom-slider::-webkit-slider-thumb:active {\n background-color: #99cc99;\n}\n\n.chsp-atom-slider::-moz-range-thumb:active {\n background-color: #99cc99;\n}\n\n.chsp-atom-slider::-ms-thumb:active {\n background-color: #99cc99;\n}\n\n.chsp-atom-slider:focus::-webkit-slider-thumb {\n box-shadow:\n 0 0 0 1px #fff,\n 0 0 0 0.2rem rgba(0, 255, 0, 0.25);\n}\n\n.chsp-atom-slider:focus::-moz-range-thumb {\n box-shadow:\n 0 0 0 1px #fff,\n 0 0 0 0.2rem rgba(0, 255, 0, 0.25);\n}\n\n.chsp-atom-slider:focus::-ms-thumb {\n box-shadow:\n 0 0 0 1px #fff,\n 0 0 0 0.2rem rgba(0, 255, 0, 0.25);\n}\n\n.chsp-settings-representation {\n display: grid;\n grid-template-columns: 1fr 1fr 1fr;\n grid-row-gap: 1ex;\n}\n\n.chsp-settings-representation label {\n cursor: help;\n}\n\n.chsp-settings-supercell {\n display: grid;\n grid-template-columns: 1fr 1fr 1fr 2fr;\n}\n\n.chsp-supercell-count {\n max-width: 3.5em;\n}\n\n.chsp-settings-camera {\n display: grid;\n gap: 1em;\n grid-template-columns: repeat(7, auto);\n justify-content: center;\n}\n\n.chsp-settings-environments {\n display: grid;\n align-items: center;\n column-gap: 1em;\n grid-template-columns: 1fr 1fr 1fr;\n}\n\n.chsp-settings-extra-options {\n display: grid;\n gap: 1em;\n grid-template-columns: 1fr 1fr 1fr;\n grid-column: 1 / span 3;\n}\n\n.chsp-settings-extra-options > :nth-child(-n + 3) {\n margin-top: 1em;\n}\n\n.chsp-settings-trajectory {\n display: grid;\n grid-template-columns: 12em 12em;\n justify-content: center;\n align-content: center;\n gap: 1em;\n margin-bottom: 1ex;\n}\n\n.chsp-cell-info {\n position: absolute;\n bottom: 5px;\n left: 5px;\n font-size: 0.8em;\n}\n\n.chsp-toggle-plot-btn {\n display: block;\n position: relative;\n margin-top: 3px;\n margin-bottom: 1px;\n}\n\n.chsp-atom-color-property {\n display: grid;\n align-items: center;\n justify-items: center;\n grid-template-columns: 1fr 1fr;\n column-gap: 1em;\n margin: 0.5em 0;\n}\n\n.chsp-atom-extra-options {\n display: grid;\n align-items: center;\n justify-items: center;\n grid-template-columns: auto 1fr 1fr;\n column-gap: 1em;\n}\n\n.chsp-atom-extra-options > * {\n margin: 0.5em 0;\n}\n\n.chsp-atom-extra-options label {\n min-width: auto;\n}\n\n.chsp-atom-extra-options {\n grid-column: 1 / span 2;\n}\n\n.chsp-target-toggle {\n padding-left: 5px;\n padding-right: 5px;\n display: flex;\n justify-content: flex-end;\n gap: 5px;\n}\n\n.chsp-target-spinner {\n width: 25px;\n height: 25px;\n margin-left: 5px;\n}\n",""]);const s=a},48654:(t,e,r)=>{"use strict";r.d(e,{A:()=>V});var n=r(78706),i=r.n(n),o=r(72859),a=r.n(o),s=r(21906),l=r.n(s),c=new URL(r(35531),r.b),u=new URL(r(45419),r.b),h=new URL(r(83385),r.b),d=new URL(r(14274),r.b),f=new URL(r(57154),r.b),p=new URL(r(35782),r.b),m=new URL(r(54718),r.b),g=new URL(r(48487),r.b),v=new URL(r(35372),r.b),b=new URL(r(17914),r.b),y=new URL(r(36366),r.b),x=new URL(r(67830),r.b),_=new URL(r(88832),r.b),w=new URL(r(57249),r.b),k=new URL(r(75932),r.b),A=new URL(r(11144),r.b),M=a()(i()),T=l()(c),S=l()(u),C=l()(h),E=l()(d),L=l()(f),z=l()(p),O=l()(m),D=l()(g),I=l()(v),F=l()(b),R=l()(y),P=l()(x),j=l()(_),N=l()(w),B=l()(k),U=l()(A);M.push([t.id,`@charset "UTF-8";/*!\n * Bootstrap v5.2.3 (https://getbootstrap.com/)\n * Copyright 2011-2022 The Bootstrap Authors\n * Copyright 2011-2022 Twitter, Inc.\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n */:root{--bs-blue:#0d6efd;--bs-indigo:#6610f2;--bs-purple:#6f42c1;--bs-pink:#d63384;--bs-red:#dc3545;--bs-orange:#fd7e14;--bs-yellow:#ffc107;--bs-green:#198754;--bs-teal:#20c997;--bs-cyan:#0dcaf0;--bs-black:#000;--bs-white:#fff;--bs-gray:#6c757d;--bs-gray-dark:#343a40;--bs-gray-100:#f8f9fa;--bs-gray-200:#e9ecef;--bs-gray-300:#dee2e6;--bs-gray-400:#ced4da;--bs-gray-500:#adb5bd;--bs-gray-600:#6c757d;--bs-gray-700:#495057;--bs-gray-800:#343a40;--bs-gray-900:#212529;--bs-primary:#0d6efd;--bs-secondary:#6c757d;--bs-success:#198754;--bs-info:#0dcaf0;--bs-warning:#ffc107;--bs-danger:#dc3545;--bs-light:#f8f9fa;--bs-dark:#212529;--bs-primary-rgb:13,110,253;--bs-secondary-rgb:108,117,125;--bs-success-rgb:25,135,84;--bs-info-rgb:13,202,240;--bs-warning-rgb:255,193,7;--bs-danger-rgb:220,53,69;--bs-light-rgb:248,249,250;--bs-dark-rgb:33,37,41;--bs-white-rgb:255,255,255;--bs-black-rgb:0,0,0;--bs-body-color-rgb:33,37,41;--bs-body-bg-rgb:255,255,255;--bs-font-sans-serif:system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue","Noto Sans","Liberation Sans",Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--bs-font-monospace:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--bs-gradient:linear-gradient(180deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0));--bs-body-font-family:var(--bs-font-sans-serif);--bs-body-font-size:1rem;--bs-body-font-weight:400;--bs-body-line-height:1.5;--bs-body-color:#212529;--bs-body-bg:#fff;--bs-border-width:1px;--bs-border-style:solid;--bs-border-color:#dee2e6;--bs-border-color-translucent:rgba(0, 0, 0, 0.175);--bs-border-radius:0.375rem;--bs-border-radius-sm:0.25rem;--bs-border-radius-lg:0.5rem;--bs-border-radius-xl:1rem;--bs-border-radius-2xl:2rem;--bs-border-radius-pill:50rem;--bs-link-color:#0d6efd;--bs-link-hover-color:#0a58ca;--bs-code-color:#d63384;--bs-highlight-bg:#fff3cd}*,::after,::before{box-sizing:border-box}@media (prefers-reduced-motion:no-preference){:root{scroll-behavior:smooth}}body{margin:0;font-family:var(--bs-body-font-family);font-size:var(--bs-body-font-size);font-weight:var(--bs-body-font-weight);line-height:var(--bs-body-line-height);color:var(--bs-body-color);text-align:var(--bs-body-text-align);background-color:var(--bs-body-bg);-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:transparent}hr{margin:1rem 0;color:inherit;border:0;border-top:1px solid;opacity:.25}.h1,.h2,.h3,.h4,.h5,.h6,h1,h2,h3,h4,h5,h6{margin-top:0;margin-bottom:.5rem;font-weight:500;line-height:1.2}.h1,h1{font-size:calc(1.375rem + 1.5vw)}@media (min-width:1200px){.h1,h1{font-size:2.5rem}}.h2,h2{font-size:calc(1.325rem + .9vw)}@media (min-width:1200px){.h2,h2{font-size:2rem}}.h3,h3{font-size:calc(1.3rem + .6vw)}@media (min-width:1200px){.h3,h3{font-size:1.75rem}}.h4,h4{font-size:calc(1.275rem + .3vw)}@media (min-width:1200px){.h4,h4{font-size:1.5rem}}.h5,h5{font-size:1.25rem}.h6,h6{font-size:1rem}p{margin-top:0;margin-bottom:1rem}abbr[title]{-webkit-text-decoration:underline dotted;text-decoration:underline dotted;cursor:help;-webkit-text-decoration-skip-ink:none;text-decoration-skip-ink:none}address{margin-bottom:1rem;font-style:normal;line-height:inherit}ol,ul{padding-left:2rem}dl,ol,ul{margin-top:0;margin-bottom:1rem}ol ol,ol ul,ul ol,ul ul{margin-bottom:0}dt{font-weight:700}dd{margin-bottom:.5rem;margin-left:0}blockquote{margin:0 0 1rem}b,strong{font-weight:bolder}.small,small{font-size:.875em}.mark,mark{padding:.1875em;background-color:var(--bs-highlight-bg)}sub,sup{position:relative;font-size:.75em;line-height:0;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}a{color:var(--bs-link-color);text-decoration:underline}a:hover{color:var(--bs-link-hover-color)}a:not([href]):not([class]),a:not([href]):not([class]):hover{color:inherit;text-decoration:none}code,kbd,pre,samp{font-family:var(--bs-font-monospace);font-size:1em}pre{display:block;margin-top:0;margin-bottom:1rem;overflow:auto;font-size:.875em}pre code{font-size:inherit;color:inherit;word-break:normal}code{font-size:.875em;color:var(--bs-code-color);word-wrap:break-word}a>code{color:inherit}kbd{padding:.1875rem .375rem;font-size:.875em;color:var(--bs-body-bg);background-color:var(--bs-body-color);border-radius:.25rem}kbd kbd{padding:0;font-size:1em}figure{margin:0 0 1rem}img,svg{vertical-align:middle}table{caption-side:bottom;border-collapse:collapse}caption{padding-top:.5rem;padding-bottom:.5rem;color:#6c757d;text-align:left}th{text-align:inherit;text-align:-webkit-match-parent}tbody,td,tfoot,th,thead,tr{border-color:inherit;border-style:solid;border-width:0}label{display:inline-block}button{border-radius:0}button:focus:not(:focus-visible){outline:0}button,input,optgroup,select,textarea{margin:0;font-family:inherit;font-size:inherit;line-height:inherit}button,select{text-transform:none}[role=button]{cursor:pointer}select{word-wrap:normal}select:disabled{opacity:1}[list]:not([type=date]):not([type=datetime-local]):not([type=month]):not([type=week]):not([type=time])::-webkit-calendar-picker-indicator{display:none!important}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button}[type=button]:not(:disabled),[type=reset]:not(:disabled),[type=submit]:not(:disabled),button:not(:disabled){cursor:pointer}::-moz-focus-inner{padding:0;border-style:none}textarea{resize:vertical}fieldset{min-width:0;padding:0;margin:0;border:0}legend{float:left;width:100%;padding:0;margin-bottom:.5rem;font-size:calc(1.275rem + .3vw);line-height:inherit}@media (min-width:1200px){legend{font-size:1.5rem}}legend+*{clear:left}::-webkit-datetime-edit-day-field,::-webkit-datetime-edit-fields-wrapper,::-webkit-datetime-edit-hour-field,::-webkit-datetime-edit-minute,::-webkit-datetime-edit-month-field,::-webkit-datetime-edit-text,::-webkit-datetime-edit-year-field{padding:0}::-webkit-inner-spin-button{height:auto}[type=search]{outline-offset:-2px;-webkit-appearance:textfield}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-color-swatch-wrapper{padding:0}::-webkit-file-upload-button{font:inherit;-webkit-appearance:button}::file-selector-button{font:inherit;-webkit-appearance:button}output{display:inline-block}iframe{border:0}summary{display:list-item;cursor:pointer}progress{vertical-align:baseline}[hidden]{display:none!important}.lead{font-size:1.25rem;font-weight:300}.display-1{font-size:calc(1.625rem + 4.5vw);font-weight:300;line-height:1.2}@media (min-width:1200px){.display-1{font-size:5rem}}.display-2{font-size:calc(1.575rem + 3.9vw);font-weight:300;line-height:1.2}@media (min-width:1200px){.display-2{font-size:4.5rem}}.display-3{font-size:calc(1.525rem + 3.3vw);font-weight:300;line-height:1.2}@media (min-width:1200px){.display-3{font-size:4rem}}.display-4{font-size:calc(1.475rem + 2.7vw);font-weight:300;line-height:1.2}@media (min-width:1200px){.display-4{font-size:3.5rem}}.display-5{font-size:calc(1.425rem + 2.1vw);font-weight:300;line-height:1.2}@media (min-width:1200px){.display-5{font-size:3rem}}.display-6{font-size:calc(1.375rem + 1.5vw);font-weight:300;line-height:1.2}@media (min-width:1200px){.display-6{font-size:2.5rem}}.list-unstyled{padding-left:0;list-style:none}.list-inline{padding-left:0;list-style:none}.list-inline-item{display:inline-block}.list-inline-item:not(:last-child){margin-right:.5rem}.initialism{font-size:.875em;text-transform:uppercase}.blockquote{margin-bottom:1rem;font-size:1.25rem}.blockquote>:last-child{margin-bottom:0}.blockquote-footer{margin-top:-1rem;margin-bottom:1rem;font-size:.875em;color:#6c757d}.blockquote-footer::before{content:"— "}.img-fluid{max-width:100%;height:auto}.img-thumbnail{padding:.25rem;background-color:#fff;border:1px solid var(--bs-border-color);border-radius:.375rem;max-width:100%;height:auto}.figure{display:inline-block}.figure-img{margin-bottom:.5rem;line-height:1}.figure-caption{font-size:.875em;color:#6c757d}.container,.container-fluid,.container-lg,.container-md,.container-sm,.container-xl,.container-xxl{--bs-gutter-x:1.5rem;--bs-gutter-y:0;width:100%;padding-right:calc(var(--bs-gutter-x) * .5);padding-left:calc(var(--bs-gutter-x) * .5);margin-right:auto;margin-left:auto}@media (min-width:576px){.container,.container-sm{max-width:540px}}@media (min-width:768px){.container,.container-md,.container-sm{max-width:720px}}@media (min-width:992px){.container,.container-lg,.container-md,.container-sm{max-width:960px}}@media (min-width:1200px){.container,.container-lg,.container-md,.container-sm,.container-xl{max-width:1140px}}@media (min-width:1400px){.container,.container-lg,.container-md,.container-sm,.container-xl,.container-xxl{max-width:1320px}}.row{--bs-gutter-x:1.5rem;--bs-gutter-y:0;display:flex;flex-wrap:wrap;margin-top:calc(-1 * var(--bs-gutter-y));margin-right:calc(-.5 * var(--bs-gutter-x));margin-left:calc(-.5 * var(--bs-gutter-x))}.row>*{flex-shrink:0;width:100%;max-width:100%;padding-right:calc(var(--bs-gutter-x) * .5);padding-left:calc(var(--bs-gutter-x) * .5);margin-top:var(--bs-gutter-y)}.col{flex:1 0 0%}.row-cols-auto>*{flex:0 0 auto;width:auto}.row-cols-1>*{flex:0 0 auto;width:100%}.row-cols-2>*{flex:0 0 auto;width:50%}.row-cols-3>*{flex:0 0 auto;width:33.3333333333%}.row-cols-4>*{flex:0 0 auto;width:25%}.row-cols-5>*{flex:0 0 auto;width:20%}.row-cols-6>*{flex:0 0 auto;width:16.6666666667%}.col-auto{flex:0 0 auto;width:auto}.col-1{flex:0 0 auto;width:8.33333333%}.col-2{flex:0 0 auto;width:16.66666667%}.col-3{flex:0 0 auto;width:25%}.col-4{flex:0 0 auto;width:33.33333333%}.col-5{flex:0 0 auto;width:41.66666667%}.col-6{flex:0 0 auto;width:50%}.col-7{flex:0 0 auto;width:58.33333333%}.col-8{flex:0 0 auto;width:66.66666667%}.col-9{flex:0 0 auto;width:75%}.col-10{flex:0 0 auto;width:83.33333333%}.col-11{flex:0 0 auto;width:91.66666667%}.col-12{flex:0 0 auto;width:100%}.offset-1{margin-left:8.33333333%}.offset-2{margin-left:16.66666667%}.offset-3{margin-left:25%}.offset-4{margin-left:33.33333333%}.offset-5{margin-left:41.66666667%}.offset-6{margin-left:50%}.offset-7{margin-left:58.33333333%}.offset-8{margin-left:66.66666667%}.offset-9{margin-left:75%}.offset-10{margin-left:83.33333333%}.offset-11{margin-left:91.66666667%}.g-0,.gx-0{--bs-gutter-x:0}.g-0,.gy-0{--bs-gutter-y:0}.g-1,.gx-1{--bs-gutter-x:0.25rem}.g-1,.gy-1{--bs-gutter-y:0.25rem}.g-2,.gx-2{--bs-gutter-x:0.5rem}.g-2,.gy-2{--bs-gutter-y:0.5rem}.g-3,.gx-3{--bs-gutter-x:1rem}.g-3,.gy-3{--bs-gutter-y:1rem}.g-4,.gx-4{--bs-gutter-x:1.5rem}.g-4,.gy-4{--bs-gutter-y:1.5rem}.g-5,.gx-5{--bs-gutter-x:3rem}.g-5,.gy-5{--bs-gutter-y:3rem}@media (min-width:576px){.col-sm{flex:1 0 0%}.row-cols-sm-auto>*{flex:0 0 auto;width:auto}.row-cols-sm-1>*{flex:0 0 auto;width:100%}.row-cols-sm-2>*{flex:0 0 auto;width:50%}.row-cols-sm-3>*{flex:0 0 auto;width:33.3333333333%}.row-cols-sm-4>*{flex:0 0 auto;width:25%}.row-cols-sm-5>*{flex:0 0 auto;width:20%}.row-cols-sm-6>*{flex:0 0 auto;width:16.6666666667%}.col-sm-auto{flex:0 0 auto;width:auto}.col-sm-1{flex:0 0 auto;width:8.33333333%}.col-sm-2{flex:0 0 auto;width:16.66666667%}.col-sm-3{flex:0 0 auto;width:25%}.col-sm-4{flex:0 0 auto;width:33.33333333%}.col-sm-5{flex:0 0 auto;width:41.66666667%}.col-sm-6{flex:0 0 auto;width:50%}.col-sm-7{flex:0 0 auto;width:58.33333333%}.col-sm-8{flex:0 0 auto;width:66.66666667%}.col-sm-9{flex:0 0 auto;width:75%}.col-sm-10{flex:0 0 auto;width:83.33333333%}.col-sm-11{flex:0 0 auto;width:91.66666667%}.col-sm-12{flex:0 0 auto;width:100%}.offset-sm-0{margin-left:0}.offset-sm-1{margin-left:8.33333333%}.offset-sm-2{margin-left:16.66666667%}.offset-sm-3{margin-left:25%}.offset-sm-4{margin-left:33.33333333%}.offset-sm-5{margin-left:41.66666667%}.offset-sm-6{margin-left:50%}.offset-sm-7{margin-left:58.33333333%}.offset-sm-8{margin-left:66.66666667%}.offset-sm-9{margin-left:75%}.offset-sm-10{margin-left:83.33333333%}.offset-sm-11{margin-left:91.66666667%}.g-sm-0,.gx-sm-0{--bs-gutter-x:0}.g-sm-0,.gy-sm-0{--bs-gutter-y:0}.g-sm-1,.gx-sm-1{--bs-gutter-x:0.25rem}.g-sm-1,.gy-sm-1{--bs-gutter-y:0.25rem}.g-sm-2,.gx-sm-2{--bs-gutter-x:0.5rem}.g-sm-2,.gy-sm-2{--bs-gutter-y:0.5rem}.g-sm-3,.gx-sm-3{--bs-gutter-x:1rem}.g-sm-3,.gy-sm-3{--bs-gutter-y:1rem}.g-sm-4,.gx-sm-4{--bs-gutter-x:1.5rem}.g-sm-4,.gy-sm-4{--bs-gutter-y:1.5rem}.g-sm-5,.gx-sm-5{--bs-gutter-x:3rem}.g-sm-5,.gy-sm-5{--bs-gutter-y:3rem}}@media (min-width:768px){.col-md{flex:1 0 0%}.row-cols-md-auto>*{flex:0 0 auto;width:auto}.row-cols-md-1>*{flex:0 0 auto;width:100%}.row-cols-md-2>*{flex:0 0 auto;width:50%}.row-cols-md-3>*{flex:0 0 auto;width:33.3333333333%}.row-cols-md-4>*{flex:0 0 auto;width:25%}.row-cols-md-5>*{flex:0 0 auto;width:20%}.row-cols-md-6>*{flex:0 0 auto;width:16.6666666667%}.col-md-auto{flex:0 0 auto;width:auto}.col-md-1{flex:0 0 auto;width:8.33333333%}.col-md-2{flex:0 0 auto;width:16.66666667%}.col-md-3{flex:0 0 auto;width:25%}.col-md-4{flex:0 0 auto;width:33.33333333%}.col-md-5{flex:0 0 auto;width:41.66666667%}.col-md-6{flex:0 0 auto;width:50%}.col-md-7{flex:0 0 auto;width:58.33333333%}.col-md-8{flex:0 0 auto;width:66.66666667%}.col-md-9{flex:0 0 auto;width:75%}.col-md-10{flex:0 0 auto;width:83.33333333%}.col-md-11{flex:0 0 auto;width:91.66666667%}.col-md-12{flex:0 0 auto;width:100%}.offset-md-0{margin-left:0}.offset-md-1{margin-left:8.33333333%}.offset-md-2{margin-left:16.66666667%}.offset-md-3{margin-left:25%}.offset-md-4{margin-left:33.33333333%}.offset-md-5{margin-left:41.66666667%}.offset-md-6{margin-left:50%}.offset-md-7{margin-left:58.33333333%}.offset-md-8{margin-left:66.66666667%}.offset-md-9{margin-left:75%}.offset-md-10{margin-left:83.33333333%}.offset-md-11{margin-left:91.66666667%}.g-md-0,.gx-md-0{--bs-gutter-x:0}.g-md-0,.gy-md-0{--bs-gutter-y:0}.g-md-1,.gx-md-1{--bs-gutter-x:0.25rem}.g-md-1,.gy-md-1{--bs-gutter-y:0.25rem}.g-md-2,.gx-md-2{--bs-gutter-x:0.5rem}.g-md-2,.gy-md-2{--bs-gutter-y:0.5rem}.g-md-3,.gx-md-3{--bs-gutter-x:1rem}.g-md-3,.gy-md-3{--bs-gutter-y:1rem}.g-md-4,.gx-md-4{--bs-gutter-x:1.5rem}.g-md-4,.gy-md-4{--bs-gutter-y:1.5rem}.g-md-5,.gx-md-5{--bs-gutter-x:3rem}.g-md-5,.gy-md-5{--bs-gutter-y:3rem}}@media (min-width:992px){.col-lg{flex:1 0 0%}.row-cols-lg-auto>*{flex:0 0 auto;width:auto}.row-cols-lg-1>*{flex:0 0 auto;width:100%}.row-cols-lg-2>*{flex:0 0 auto;width:50%}.row-cols-lg-3>*{flex:0 0 auto;width:33.3333333333%}.row-cols-lg-4>*{flex:0 0 auto;width:25%}.row-cols-lg-5>*{flex:0 0 auto;width:20%}.row-cols-lg-6>*{flex:0 0 auto;width:16.6666666667%}.col-lg-auto{flex:0 0 auto;width:auto}.col-lg-1{flex:0 0 auto;width:8.33333333%}.col-lg-2{flex:0 0 auto;width:16.66666667%}.col-lg-3{flex:0 0 auto;width:25%}.col-lg-4{flex:0 0 auto;width:33.33333333%}.col-lg-5{flex:0 0 auto;width:41.66666667%}.col-lg-6{flex:0 0 auto;width:50%}.col-lg-7{flex:0 0 auto;width:58.33333333%}.col-lg-8{flex:0 0 auto;width:66.66666667%}.col-lg-9{flex:0 0 auto;width:75%}.col-lg-10{flex:0 0 auto;width:83.33333333%}.col-lg-11{flex:0 0 auto;width:91.66666667%}.col-lg-12{flex:0 0 auto;width:100%}.offset-lg-0{margin-left:0}.offset-lg-1{margin-left:8.33333333%}.offset-lg-2{margin-left:16.66666667%}.offset-lg-3{margin-left:25%}.offset-lg-4{margin-left:33.33333333%}.offset-lg-5{margin-left:41.66666667%}.offset-lg-6{margin-left:50%}.offset-lg-7{margin-left:58.33333333%}.offset-lg-8{margin-left:66.66666667%}.offset-lg-9{margin-left:75%}.offset-lg-10{margin-left:83.33333333%}.offset-lg-11{margin-left:91.66666667%}.g-lg-0,.gx-lg-0{--bs-gutter-x:0}.g-lg-0,.gy-lg-0{--bs-gutter-y:0}.g-lg-1,.gx-lg-1{--bs-gutter-x:0.25rem}.g-lg-1,.gy-lg-1{--bs-gutter-y:0.25rem}.g-lg-2,.gx-lg-2{--bs-gutter-x:0.5rem}.g-lg-2,.gy-lg-2{--bs-gutter-y:0.5rem}.g-lg-3,.gx-lg-3{--bs-gutter-x:1rem}.g-lg-3,.gy-lg-3{--bs-gutter-y:1rem}.g-lg-4,.gx-lg-4{--bs-gutter-x:1.5rem}.g-lg-4,.gy-lg-4{--bs-gutter-y:1.5rem}.g-lg-5,.gx-lg-5{--bs-gutter-x:3rem}.g-lg-5,.gy-lg-5{--bs-gutter-y:3rem}}@media (min-width:1200px){.col-xl{flex:1 0 0%}.row-cols-xl-auto>*{flex:0 0 auto;width:auto}.row-cols-xl-1>*{flex:0 0 auto;width:100%}.row-cols-xl-2>*{flex:0 0 auto;width:50%}.row-cols-xl-3>*{flex:0 0 auto;width:33.3333333333%}.row-cols-xl-4>*{flex:0 0 auto;width:25%}.row-cols-xl-5>*{flex:0 0 auto;width:20%}.row-cols-xl-6>*{flex:0 0 auto;width:16.6666666667%}.col-xl-auto{flex:0 0 auto;width:auto}.col-xl-1{flex:0 0 auto;width:8.33333333%}.col-xl-2{flex:0 0 auto;width:16.66666667%}.col-xl-3{flex:0 0 auto;width:25%}.col-xl-4{flex:0 0 auto;width:33.33333333%}.col-xl-5{flex:0 0 auto;width:41.66666667%}.col-xl-6{flex:0 0 auto;width:50%}.col-xl-7{flex:0 0 auto;width:58.33333333%}.col-xl-8{flex:0 0 auto;width:66.66666667%}.col-xl-9{flex:0 0 auto;width:75%}.col-xl-10{flex:0 0 auto;width:83.33333333%}.col-xl-11{flex:0 0 auto;width:91.66666667%}.col-xl-12{flex:0 0 auto;width:100%}.offset-xl-0{margin-left:0}.offset-xl-1{margin-left:8.33333333%}.offset-xl-2{margin-left:16.66666667%}.offset-xl-3{margin-left:25%}.offset-xl-4{margin-left:33.33333333%}.offset-xl-5{margin-left:41.66666667%}.offset-xl-6{margin-left:50%}.offset-xl-7{margin-left:58.33333333%}.offset-xl-8{margin-left:66.66666667%}.offset-xl-9{margin-left:75%}.offset-xl-10{margin-left:83.33333333%}.offset-xl-11{margin-left:91.66666667%}.g-xl-0,.gx-xl-0{--bs-gutter-x:0}.g-xl-0,.gy-xl-0{--bs-gutter-y:0}.g-xl-1,.gx-xl-1{--bs-gutter-x:0.25rem}.g-xl-1,.gy-xl-1{--bs-gutter-y:0.25rem}.g-xl-2,.gx-xl-2{--bs-gutter-x:0.5rem}.g-xl-2,.gy-xl-2{--bs-gutter-y:0.5rem}.g-xl-3,.gx-xl-3{--bs-gutter-x:1rem}.g-xl-3,.gy-xl-3{--bs-gutter-y:1rem}.g-xl-4,.gx-xl-4{--bs-gutter-x:1.5rem}.g-xl-4,.gy-xl-4{--bs-gutter-y:1.5rem}.g-xl-5,.gx-xl-5{--bs-gutter-x:3rem}.g-xl-5,.gy-xl-5{--bs-gutter-y:3rem}}@media (min-width:1400px){.col-xxl{flex:1 0 0%}.row-cols-xxl-auto>*{flex:0 0 auto;width:auto}.row-cols-xxl-1>*{flex:0 0 auto;width:100%}.row-cols-xxl-2>*{flex:0 0 auto;width:50%}.row-cols-xxl-3>*{flex:0 0 auto;width:33.3333333333%}.row-cols-xxl-4>*{flex:0 0 auto;width:25%}.row-cols-xxl-5>*{flex:0 0 auto;width:20%}.row-cols-xxl-6>*{flex:0 0 auto;width:16.6666666667%}.col-xxl-auto{flex:0 0 auto;width:auto}.col-xxl-1{flex:0 0 auto;width:8.33333333%}.col-xxl-2{flex:0 0 auto;width:16.66666667%}.col-xxl-3{flex:0 0 auto;width:25%}.col-xxl-4{flex:0 0 auto;width:33.33333333%}.col-xxl-5{flex:0 0 auto;width:41.66666667%}.col-xxl-6{flex:0 0 auto;width:50%}.col-xxl-7{flex:0 0 auto;width:58.33333333%}.col-xxl-8{flex:0 0 auto;width:66.66666667%}.col-xxl-9{flex:0 0 auto;width:75%}.col-xxl-10{flex:0 0 auto;width:83.33333333%}.col-xxl-11{flex:0 0 auto;width:91.66666667%}.col-xxl-12{flex:0 0 auto;width:100%}.offset-xxl-0{margin-left:0}.offset-xxl-1{margin-left:8.33333333%}.offset-xxl-2{margin-left:16.66666667%}.offset-xxl-3{margin-left:25%}.offset-xxl-4{margin-left:33.33333333%}.offset-xxl-5{margin-left:41.66666667%}.offset-xxl-6{margin-left:50%}.offset-xxl-7{margin-left:58.33333333%}.offset-xxl-8{margin-left:66.66666667%}.offset-xxl-9{margin-left:75%}.offset-xxl-10{margin-left:83.33333333%}.offset-xxl-11{margin-left:91.66666667%}.g-xxl-0,.gx-xxl-0{--bs-gutter-x:0}.g-xxl-0,.gy-xxl-0{--bs-gutter-y:0}.g-xxl-1,.gx-xxl-1{--bs-gutter-x:0.25rem}.g-xxl-1,.gy-xxl-1{--bs-gutter-y:0.25rem}.g-xxl-2,.gx-xxl-2{--bs-gutter-x:0.5rem}.g-xxl-2,.gy-xxl-2{--bs-gutter-y:0.5rem}.g-xxl-3,.gx-xxl-3{--bs-gutter-x:1rem}.g-xxl-3,.gy-xxl-3{--bs-gutter-y:1rem}.g-xxl-4,.gx-xxl-4{--bs-gutter-x:1.5rem}.g-xxl-4,.gy-xxl-4{--bs-gutter-y:1.5rem}.g-xxl-5,.gx-xxl-5{--bs-gutter-x:3rem}.g-xxl-5,.gy-xxl-5{--bs-gutter-y:3rem}}.table{--bs-table-color:var(--bs-body-color);--bs-table-bg:transparent;--bs-table-border-color:var(--bs-border-color);--bs-table-accent-bg:transparent;--bs-table-striped-color:var(--bs-body-color);--bs-table-striped-bg:rgba(0, 0, 0, 0.05);--bs-table-active-color:var(--bs-body-color);--bs-table-active-bg:rgba(0, 0, 0, 0.1);--bs-table-hover-color:var(--bs-body-color);--bs-table-hover-bg:rgba(0, 0, 0, 0.075);width:100%;margin-bottom:1rem;color:var(--bs-table-color);vertical-align:top;border-color:var(--bs-table-border-color)}.table>:not(caption)>*>*{padding:.5rem .5rem;background-color:var(--bs-table-bg);border-bottom-width:1px;box-shadow:inset 0 0 0 9999px var(--bs-table-accent-bg)}.table>tbody{vertical-align:inherit}.table>thead{vertical-align:bottom}.table-group-divider{border-top:2px solid currentcolor}.caption-top{caption-side:top}.table-sm>:not(caption)>*>*{padding:.25rem .25rem}.table-bordered>:not(caption)>*{border-width:1px 0}.table-bordered>:not(caption)>*>*{border-width:0 1px}.table-borderless>:not(caption)>*>*{border-bottom-width:0}.table-borderless>:not(:first-child){border-top-width:0}.table-striped>tbody>tr:nth-of-type(odd)>*{--bs-table-accent-bg:var(--bs-table-striped-bg);color:var(--bs-table-striped-color)}.table-striped-columns>:not(caption)>tr>:nth-child(2n){--bs-table-accent-bg:var(--bs-table-striped-bg);color:var(--bs-table-striped-color)}.table-active{--bs-table-accent-bg:var(--bs-table-active-bg);color:var(--bs-table-active-color)}.table-hover>tbody>tr:hover>*{--bs-table-accent-bg:var(--bs-table-hover-bg);color:var(--bs-table-hover-color)}.table-primary{--bs-table-color:#000;--bs-table-bg:#cfe2ff;--bs-table-border-color:#bacbe6;--bs-table-striped-bg:#c5d7f2;--bs-table-striped-color:#000;--bs-table-active-bg:#bacbe6;--bs-table-active-color:#000;--bs-table-hover-bg:#bfd1ec;--bs-table-hover-color:#000;color:var(--bs-table-color);border-color:var(--bs-table-border-color)}.table-secondary{--bs-table-color:#000;--bs-table-bg:#e2e3e5;--bs-table-border-color:#cbccce;--bs-table-striped-bg:#d7d8da;--bs-table-striped-color:#000;--bs-table-active-bg:#cbccce;--bs-table-active-color:#000;--bs-table-hover-bg:#d1d2d4;--bs-table-hover-color:#000;color:var(--bs-table-color);border-color:var(--bs-table-border-color)}.table-success{--bs-table-color:#000;--bs-table-bg:#d1e7dd;--bs-table-border-color:#bcd0c7;--bs-table-striped-bg:#c7dbd2;--bs-table-striped-color:#000;--bs-table-active-bg:#bcd0c7;--bs-table-active-color:#000;--bs-table-hover-bg:#c1d6cc;--bs-table-hover-color:#000;color:var(--bs-table-color);border-color:var(--bs-table-border-color)}.table-info{--bs-table-color:#000;--bs-table-bg:#cff4fc;--bs-table-border-color:#badce3;--bs-table-striped-bg:#c5e8ef;--bs-table-striped-color:#000;--bs-table-active-bg:#badce3;--bs-table-active-color:#000;--bs-table-hover-bg:#bfe2e9;--bs-table-hover-color:#000;color:var(--bs-table-color);border-color:var(--bs-table-border-color)}.table-warning{--bs-table-color:#000;--bs-table-bg:#fff3cd;--bs-table-border-color:#e6dbb9;--bs-table-striped-bg:#f2e7c3;--bs-table-striped-color:#000;--bs-table-active-bg:#e6dbb9;--bs-table-active-color:#000;--bs-table-hover-bg:#ece1be;--bs-table-hover-color:#000;color:var(--bs-table-color);border-color:var(--bs-table-border-color)}.table-danger{--bs-table-color:#000;--bs-table-bg:#f8d7da;--bs-table-border-color:#dfc2c4;--bs-table-striped-bg:#eccccf;--bs-table-striped-color:#000;--bs-table-active-bg:#dfc2c4;--bs-table-active-color:#000;--bs-table-hover-bg:#e5c7ca;--bs-table-hover-color:#000;color:var(--bs-table-color);border-color:var(--bs-table-border-color)}.table-light{--bs-table-color:#000;--bs-table-bg:#f8f9fa;--bs-table-border-color:#dfe0e1;--bs-table-striped-bg:#ecedee;--bs-table-striped-color:#000;--bs-table-active-bg:#dfe0e1;--bs-table-active-color:#000;--bs-table-hover-bg:#e5e6e7;--bs-table-hover-color:#000;color:var(--bs-table-color);border-color:var(--bs-table-border-color)}.table-dark{--bs-table-color:#fff;--bs-table-bg:#212529;--bs-table-border-color:#373b3e;--bs-table-striped-bg:#2c3034;--bs-table-striped-color:#fff;--bs-table-active-bg:#373b3e;--bs-table-active-color:#fff;--bs-table-hover-bg:#323539;--bs-table-hover-color:#fff;color:var(--bs-table-color);border-color:var(--bs-table-border-color)}.table-responsive{overflow-x:auto;-webkit-overflow-scrolling:touch}@media (max-width:575.98px){.table-responsive-sm{overflow-x:auto;-webkit-overflow-scrolling:touch}}@media (max-width:767.98px){.table-responsive-md{overflow-x:auto;-webkit-overflow-scrolling:touch}}@media (max-width:991.98px){.table-responsive-lg{overflow-x:auto;-webkit-overflow-scrolling:touch}}@media (max-width:1199.98px){.table-responsive-xl{overflow-x:auto;-webkit-overflow-scrolling:touch}}@media (max-width:1399.98px){.table-responsive-xxl{overflow-x:auto;-webkit-overflow-scrolling:touch}}.form-label{margin-bottom:.5rem}.col-form-label{padding-top:calc(.375rem + 1px);padding-bottom:calc(.375rem + 1px);margin-bottom:0;font-size:inherit;line-height:1.5}.col-form-label-lg{padding-top:calc(.5rem + 1px);padding-bottom:calc(.5rem + 1px);font-size:1.25rem}.col-form-label-sm{padding-top:calc(.25rem + 1px);padding-bottom:calc(.25rem + 1px);font-size:.875rem}.form-text{margin-top:.25rem;font-size:.875em;color:#6c757d}.form-control{display:block;width:100%;padding:.375rem .75rem;font-size:1rem;font-weight:400;line-height:1.5;color:#212529;background-color:#fff;background-clip:padding-box;border:1px solid #ced4da;-webkit-appearance:none;-moz-appearance:none;appearance:none;border-radius:.375rem;transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out}@media (prefers-reduced-motion:reduce){.form-control{transition:none}}.form-control[type=file]{overflow:hidden}.form-control[type=file]:not(:disabled):not([readonly]){cursor:pointer}.form-control:focus{color:#212529;background-color:#fff;border-color:#86b7fe;outline:0;box-shadow:0 0 0 .25rem rgba(13,110,253,.25)}.form-control::-webkit-date-and-time-value{height:1.5em}.form-control::-moz-placeholder{color:#6c757d;opacity:1}.form-control::placeholder{color:#6c757d;opacity:1}.form-control:disabled{background-color:#e9ecef;opacity:1}.form-control::-webkit-file-upload-button{padding:.375rem .75rem;margin:-.375rem -.75rem;-webkit-margin-end:.75rem;margin-inline-end:.75rem;color:#212529;background-color:#e9ecef;pointer-events:none;border-color:inherit;border-style:solid;border-width:0;border-inline-end-width:1px;border-radius:0;-webkit-transition:color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;transition:color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out}.form-control::file-selector-button{padding:.375rem .75rem;margin:-.375rem -.75rem;-webkit-margin-end:.75rem;margin-inline-end:.75rem;color:#212529;background-color:#e9ecef;pointer-events:none;border-color:inherit;border-style:solid;border-width:0;border-inline-end-width:1px;border-radius:0;transition:color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out}@media (prefers-reduced-motion:reduce){.form-control::-webkit-file-upload-button{-webkit-transition:none;transition:none}.form-control::file-selector-button{transition:none}}.form-control:hover:not(:disabled):not([readonly])::-webkit-file-upload-button{background-color:#dde0e3}.form-control:hover:not(:disabled):not([readonly])::file-selector-button{background-color:#dde0e3}.form-control-plaintext{display:block;width:100%;padding:.375rem 0;margin-bottom:0;line-height:1.5;color:#212529;background-color:transparent;border:solid transparent;border-width:1px 0}.form-control-plaintext:focus{outline:0}.form-control-plaintext.form-control-lg,.form-control-plaintext.form-control-sm{padding-right:0;padding-left:0}.form-control-sm{min-height:calc(1.5em + .5rem + 2px);padding:.25rem .5rem;font-size:.875rem;border-radius:.25rem}.form-control-sm::-webkit-file-upload-button{padding:.25rem .5rem;margin:-.25rem -.5rem;-webkit-margin-end:.5rem;margin-inline-end:.5rem}.form-control-sm::file-selector-button{padding:.25rem .5rem;margin:-.25rem -.5rem;-webkit-margin-end:.5rem;margin-inline-end:.5rem}.form-control-lg{min-height:calc(1.5em + 1rem + 2px);padding:.5rem 1rem;font-size:1.25rem;border-radius:.5rem}.form-control-lg::-webkit-file-upload-button{padding:.5rem 1rem;margin:-.5rem -1rem;-webkit-margin-end:1rem;margin-inline-end:1rem}.form-control-lg::file-selector-button{padding:.5rem 1rem;margin:-.5rem -1rem;-webkit-margin-end:1rem;margin-inline-end:1rem}textarea.form-control{min-height:calc(1.5em + .75rem + 2px)}textarea.form-control-sm{min-height:calc(1.5em + .5rem + 2px)}textarea.form-control-lg{min-height:calc(1.5em + 1rem + 2px)}.form-control-color{width:3rem;height:calc(1.5em + .75rem + 2px);padding:.375rem}.form-control-color:not(:disabled):not([readonly]){cursor:pointer}.form-control-color::-moz-color-swatch{border:0!important;border-radius:.375rem}.form-control-color::-webkit-color-swatch{border-radius:.375rem}.form-control-color.form-control-sm{height:calc(1.5em + .5rem + 2px)}.form-control-color.form-control-lg{height:calc(1.5em + 1rem + 2px)}.form-select{display:block;width:100%;padding:.375rem 2.25rem .375rem .75rem;-moz-padding-start:calc(0.75rem - 3px);font-size:1rem;font-weight:400;line-height:1.5;color:#212529;background-color:#fff;background-image:url(${T});background-repeat:no-repeat;background-position:right .75rem center;background-size:16px 12px;border:1px solid #ced4da;border-radius:.375rem;transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out;-webkit-appearance:none;-moz-appearance:none;appearance:none}@media (prefers-reduced-motion:reduce){.form-select{transition:none}}.form-select:focus{border-color:#86b7fe;outline:0;box-shadow:0 0 0 .25rem rgba(13,110,253,.25)}.form-select[multiple],.form-select[size]:not([size="1"]){padding-right:.75rem;background-image:none}.form-select:disabled{background-color:#e9ecef}.form-select:-moz-focusring{color:transparent;text-shadow:0 0 0 #212529}.form-select-sm{padding-top:.25rem;padding-bottom:.25rem;padding-left:.5rem;font-size:.875rem;border-radius:.25rem}.form-select-lg{padding-top:.5rem;padding-bottom:.5rem;padding-left:1rem;font-size:1.25rem;border-radius:.5rem}.form-check{display:block;min-height:1.5rem;padding-left:1.5em;margin-bottom:.125rem}.form-check .form-check-input{float:left;margin-left:-1.5em}.form-check-reverse{padding-right:1.5em;padding-left:0;text-align:right}.form-check-reverse .form-check-input{float:right;margin-right:-1.5em;margin-left:0}.form-check-input{width:1em;height:1em;margin-top:.25em;vertical-align:top;background-color:#fff;background-repeat:no-repeat;background-position:center;background-size:contain;border:1px solid rgba(0,0,0,.25);-webkit-appearance:none;-moz-appearance:none;appearance:none;-webkit-print-color-adjust:exact;color-adjust:exact;print-color-adjust:exact}.form-check-input[type=checkbox]{border-radius:.25em}.form-check-input[type=radio]{border-radius:50%}.form-check-input:active{filter:brightness(90%)}.form-check-input:focus{border-color:#86b7fe;outline:0;box-shadow:0 0 0 .25rem rgba(13,110,253,.25)}.form-check-input:checked{background-color:#0d6efd;border-color:#0d6efd}.form-check-input:checked[type=checkbox]{background-image:url(${S})}.form-check-input:checked[type=radio]{background-image:url(${C})}.form-check-input[type=checkbox]:indeterminate{background-color:#0d6efd;border-color:#0d6efd;background-image:url(${E})}.form-check-input:disabled{pointer-events:none;filter:none;opacity:.5}.form-check-input:disabled~.form-check-label,.form-check-input[disabled]~.form-check-label{cursor:default;opacity:.5}.form-switch{padding-left:2.5em}.form-switch .form-check-input{width:2em;margin-left:-2.5em;background-image:url(${L});background-position:left center;border-radius:2em;transition:background-position .15s ease-in-out}@media (prefers-reduced-motion:reduce){.form-switch .form-check-input{transition:none}}.form-switch .form-check-input:focus{background-image:url(${z})}.form-switch .form-check-input:checked{background-position:right center;background-image:url(${O})}.form-switch.form-check-reverse{padding-right:2.5em;padding-left:0}.form-switch.form-check-reverse .form-check-input{margin-right:-2.5em;margin-left:0}.form-check-inline{display:inline-block;margin-right:1rem}.btn-check{position:absolute;clip:rect(0,0,0,0);pointer-events:none}.btn-check:disabled+.btn,.btn-check[disabled]+.btn{pointer-events:none;filter:none;opacity:.65}.form-range{width:100%;height:1.5rem;padding:0;background-color:transparent;-webkit-appearance:none;-moz-appearance:none;appearance:none}.form-range:focus{outline:0}.form-range:focus::-webkit-slider-thumb{box-shadow:0 0 0 1px #fff,0 0 0 .25rem rgba(13,110,253,.25)}.form-range:focus::-moz-range-thumb{box-shadow:0 0 0 1px #fff,0 0 0 .25rem rgba(13,110,253,.25)}.form-range::-moz-focus-outer{border:0}.form-range::-webkit-slider-thumb{width:1rem;height:1rem;margin-top:-.25rem;background-color:#0d6efd;border:0;border-radius:1rem;-webkit-transition:background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;transition:background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;-webkit-appearance:none;appearance:none}@media (prefers-reduced-motion:reduce){.form-range::-webkit-slider-thumb{-webkit-transition:none;transition:none}}.form-range::-webkit-slider-thumb:active{background-color:#b6d4fe}.form-range::-webkit-slider-runnable-track{width:100%;height:.5rem;color:transparent;cursor:pointer;background-color:#dee2e6;border-color:transparent;border-radius:1rem}.form-range::-moz-range-thumb{width:1rem;height:1rem;background-color:#0d6efd;border:0;border-radius:1rem;-moz-transition:background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;transition:background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;-moz-appearance:none;appearance:none}@media (prefers-reduced-motion:reduce){.form-range::-moz-range-thumb{-moz-transition:none;transition:none}}.form-range::-moz-range-thumb:active{background-color:#b6d4fe}.form-range::-moz-range-track{width:100%;height:.5rem;color:transparent;cursor:pointer;background-color:#dee2e6;border-color:transparent;border-radius:1rem}.form-range:disabled{pointer-events:none}.form-range:disabled::-webkit-slider-thumb{background-color:#adb5bd}.form-range:disabled::-moz-range-thumb{background-color:#adb5bd}.form-floating{position:relative}.form-floating>.form-control,.form-floating>.form-control-plaintext,.form-floating>.form-select{height:calc(3.5rem + 2px);line-height:1.25}.form-floating>label{position:absolute;top:0;left:0;width:100%;height:100%;padding:1rem .75rem;overflow:hidden;text-align:start;text-overflow:ellipsis;white-space:nowrap;pointer-events:none;border:1px solid transparent;transform-origin:0 0;transition:opacity .1s ease-in-out,transform .1s ease-in-out}@media (prefers-reduced-motion:reduce){.form-floating>label{transition:none}}.form-floating>.form-control,.form-floating>.form-control-plaintext{padding:1rem .75rem}.form-floating>.form-control-plaintext::-moz-placeholder,.form-floating>.form-control::-moz-placeholder{color:transparent}.form-floating>.form-control-plaintext::placeholder,.form-floating>.form-control::placeholder{color:transparent}.form-floating>.form-control-plaintext:not(:-moz-placeholder-shown),.form-floating>.form-control:not(:-moz-placeholder-shown){padding-top:1.625rem;padding-bottom:.625rem}.form-floating>.form-control-plaintext:focus,.form-floating>.form-control-plaintext:not(:placeholder-shown),.form-floating>.form-control:focus,.form-floating>.form-control:not(:placeholder-shown){padding-top:1.625rem;padding-bottom:.625rem}.form-floating>.form-control-plaintext:-webkit-autofill,.form-floating>.form-control:-webkit-autofill{padding-top:1.625rem;padding-bottom:.625rem}.form-floating>.form-select{padding-top:1.625rem;padding-bottom:.625rem}.form-floating>.form-control:not(:-moz-placeholder-shown)~label{opacity:.65;transform:scale(.85) translateY(-.5rem) translateX(.15rem)}.form-floating>.form-control-plaintext~label,.form-floating>.form-control:focus~label,.form-floating>.form-control:not(:placeholder-shown)~label,.form-floating>.form-select~label{opacity:.65;transform:scale(.85) translateY(-.5rem) translateX(.15rem)}.form-floating>.form-control:-webkit-autofill~label{opacity:.65;transform:scale(.85) translateY(-.5rem) translateX(.15rem)}.form-floating>.form-control-plaintext~label{border-width:1px 0}.input-group{position:relative;display:flex;flex-wrap:wrap;align-items:stretch;width:100%}.input-group>.form-control,.input-group>.form-floating,.input-group>.form-select{position:relative;flex:1 1 auto;width:1%;min-width:0}.input-group>.form-control:focus,.input-group>.form-floating:focus-within,.input-group>.form-select:focus{z-index:5}.input-group .btn{position:relative;z-index:2}.input-group .btn:focus{z-index:5}.input-group-text{display:flex;align-items:center;padding:.375rem .75rem;font-size:1rem;font-weight:400;line-height:1.5;color:#212529;text-align:center;white-space:nowrap;background-color:#e9ecef;border:1px solid #ced4da;border-radius:.375rem}.input-group-lg>.btn,.input-group-lg>.form-control,.input-group-lg>.form-select,.input-group-lg>.input-group-text{padding:.5rem 1rem;font-size:1.25rem;border-radius:.5rem}.input-group-sm>.btn,.input-group-sm>.form-control,.input-group-sm>.form-select,.input-group-sm>.input-group-text{padding:.25rem .5rem;font-size:.875rem;border-radius:.25rem}.input-group-lg>.form-select,.input-group-sm>.form-select{padding-right:3rem}.input-group:not(.has-validation)>.dropdown-toggle:nth-last-child(n+3),.input-group:not(.has-validation)>.form-floating:not(:last-child)>.form-control,.input-group:not(.has-validation)>.form-floating:not(:last-child)>.form-select,.input-group:not(.has-validation)>:not(:last-child):not(.dropdown-toggle):not(.dropdown-menu):not(.form-floating){border-top-right-radius:0;border-bottom-right-radius:0}.input-group.has-validation>.dropdown-toggle:nth-last-child(n+4),.input-group.has-validation>.form-floating:nth-last-child(n+3)>.form-control,.input-group.has-validation>.form-floating:nth-last-child(n+3)>.form-select,.input-group.has-validation>:nth-last-child(n+3):not(.dropdown-toggle):not(.dropdown-menu):not(.form-floating){border-top-right-radius:0;border-bottom-right-radius:0}.input-group>:not(:first-child):not(.dropdown-menu):not(.valid-tooltip):not(.valid-feedback):not(.invalid-tooltip):not(.invalid-feedback){margin-left:-1px;border-top-left-radius:0;border-bottom-left-radius:0}.input-group>.form-floating:not(:first-child)>.form-control,.input-group>.form-floating:not(:first-child)>.form-select{border-top-left-radius:0;border-bottom-left-radius:0}.valid-feedback{display:none;width:100%;margin-top:.25rem;font-size:.875em;color:#198754}.valid-tooltip{position:absolute;top:100%;z-index:5;display:none;max-width:100%;padding:.25rem .5rem;margin-top:.1rem;font-size:.875rem;color:#fff;background-color:rgba(25,135,84,.9);border-radius:.375rem}.is-valid~.valid-feedback,.is-valid~.valid-tooltip,.was-validated :valid~.valid-feedback,.was-validated :valid~.valid-tooltip{display:block}.form-control.is-valid,.was-validated .form-control:valid{border-color:#198754;padding-right:calc(1.5em + .75rem);background-image:url(${D});background-repeat:no-repeat;background-position:right calc(.375em + .1875rem) center;background-size:calc(.75em + .375rem) calc(.75em + .375rem)}.form-control.is-valid:focus,.was-validated .form-control:valid:focus{border-color:#198754;box-shadow:0 0 0 .25rem rgba(25,135,84,.25)}.was-validated textarea.form-control:valid,textarea.form-control.is-valid{padding-right:calc(1.5em + .75rem);background-position:top calc(.375em + .1875rem) right calc(.375em + .1875rem)}.form-select.is-valid,.was-validated .form-select:valid{border-color:#198754}.form-select.is-valid:not([multiple]):not([size]),.form-select.is-valid:not([multiple])[size="1"],.was-validated .form-select:valid:not([multiple]):not([size]),.was-validated .form-select:valid:not([multiple])[size="1"]{padding-right:4.125rem;background-image:url(${T}),url(${D});background-position:right .75rem center,center right 2.25rem;background-size:16px 12px,calc(.75em + .375rem) calc(.75em + .375rem)}.form-select.is-valid:focus,.was-validated .form-select:valid:focus{border-color:#198754;box-shadow:0 0 0 .25rem rgba(25,135,84,.25)}.form-control-color.is-valid,.was-validated .form-control-color:valid{width:calc(3rem + calc(1.5em + .75rem))}.form-check-input.is-valid,.was-validated .form-check-input:valid{border-color:#198754}.form-check-input.is-valid:checked,.was-validated .form-check-input:valid:checked{background-color:#198754}.form-check-input.is-valid:focus,.was-validated .form-check-input:valid:focus{box-shadow:0 0 0 .25rem rgba(25,135,84,.25)}.form-check-input.is-valid~.form-check-label,.was-validated .form-check-input:valid~.form-check-label{color:#198754}.form-check-inline .form-check-input~.valid-feedback{margin-left:.5em}.input-group>.form-control:not(:focus).is-valid,.input-group>.form-floating:not(:focus-within).is-valid,.input-group>.form-select:not(:focus).is-valid,.was-validated .input-group>.form-control:not(:focus):valid,.was-validated .input-group>.form-floating:not(:focus-within):valid,.was-validated .input-group>.form-select:not(:focus):valid{z-index:3}.invalid-feedback{display:none;width:100%;margin-top:.25rem;font-size:.875em;color:#dc3545}.invalid-tooltip{position:absolute;top:100%;z-index:5;display:none;max-width:100%;padding:.25rem .5rem;margin-top:.1rem;font-size:.875rem;color:#fff;background-color:rgba(220,53,69,.9);border-radius:.375rem}.is-invalid~.invalid-feedback,.is-invalid~.invalid-tooltip,.was-validated :invalid~.invalid-feedback,.was-validated :invalid~.invalid-tooltip{display:block}.form-control.is-invalid,.was-validated .form-control:invalid{border-color:#dc3545;padding-right:calc(1.5em + .75rem);background-image:url(${I});background-repeat:no-repeat;background-position:right calc(.375em + .1875rem) center;background-size:calc(.75em + .375rem) calc(.75em + .375rem)}.form-control.is-invalid:focus,.was-validated .form-control:invalid:focus{border-color:#dc3545;box-shadow:0 0 0 .25rem rgba(220,53,69,.25)}.was-validated textarea.form-control:invalid,textarea.form-control.is-invalid{padding-right:calc(1.5em + .75rem);background-position:top calc(.375em + .1875rem) right calc(.375em + .1875rem)}.form-select.is-invalid,.was-validated .form-select:invalid{border-color:#dc3545}.form-select.is-invalid:not([multiple]):not([size]),.form-select.is-invalid:not([multiple])[size="1"],.was-validated .form-select:invalid:not([multiple]):not([size]),.was-validated .form-select:invalid:not([multiple])[size="1"]{padding-right:4.125rem;background-image:url(${T}),url(${I});background-position:right .75rem center,center right 2.25rem;background-size:16px 12px,calc(.75em + .375rem) calc(.75em + .375rem)}.form-select.is-invalid:focus,.was-validated .form-select:invalid:focus{border-color:#dc3545;box-shadow:0 0 0 .25rem rgba(220,53,69,.25)}.form-control-color.is-invalid,.was-validated .form-control-color:invalid{width:calc(3rem + calc(1.5em + .75rem))}.form-check-input.is-invalid,.was-validated .form-check-input:invalid{border-color:#dc3545}.form-check-input.is-invalid:checked,.was-validated .form-check-input:invalid:checked{background-color:#dc3545}.form-check-input.is-invalid:focus,.was-validated .form-check-input:invalid:focus{box-shadow:0 0 0 .25rem rgba(220,53,69,.25)}.form-check-input.is-invalid~.form-check-label,.was-validated .form-check-input:invalid~.form-check-label{color:#dc3545}.form-check-inline .form-check-input~.invalid-feedback{margin-left:.5em}.input-group>.form-control:not(:focus).is-invalid,.input-group>.form-floating:not(:focus-within).is-invalid,.input-group>.form-select:not(:focus).is-invalid,.was-validated .input-group>.form-control:not(:focus):invalid,.was-validated .input-group>.form-floating:not(:focus-within):invalid,.was-validated .input-group>.form-select:not(:focus):invalid{z-index:4}.btn{--bs-btn-padding-x:0.75rem;--bs-btn-padding-y:0.375rem;--bs-btn-font-family: ;--bs-btn-font-size:1rem;--bs-btn-font-weight:400;--bs-btn-line-height:1.5;--bs-btn-color:#212529;--bs-btn-bg:transparent;--bs-btn-border-width:1px;--bs-btn-border-color:transparent;--bs-btn-border-radius:0.375rem;--bs-btn-hover-border-color:transparent;--bs-btn-box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0.15),0 1px 1px rgba(0, 0, 0, 0.075);--bs-btn-disabled-opacity:0.65;--bs-btn-focus-box-shadow:0 0 0 0.25rem rgba(var(--bs-btn-focus-shadow-rgb), .5);display:inline-block;padding:var(--bs-btn-padding-y) var(--bs-btn-padding-x);font-family:var(--bs-btn-font-family);font-size:var(--bs-btn-font-size);font-weight:var(--bs-btn-font-weight);line-height:var(--bs-btn-line-height);color:var(--bs-btn-color);text-align:center;text-decoration:none;vertical-align:middle;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;user-select:none;border:var(--bs-btn-border-width) solid var(--bs-btn-border-color);border-radius:var(--bs-btn-border-radius);background-color:var(--bs-btn-bg);transition:color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out}@media (prefers-reduced-motion:reduce){.btn{transition:none}}.btn:hover{color:var(--bs-btn-hover-color);background-color:var(--bs-btn-hover-bg);border-color:var(--bs-btn-hover-border-color)}.btn-check+.btn:hover{color:var(--bs-btn-color);background-color:var(--bs-btn-bg);border-color:var(--bs-btn-border-color)}.btn:focus-visible{color:var(--bs-btn-hover-color);background-color:var(--bs-btn-hover-bg);border-color:var(--bs-btn-hover-border-color);outline:0;box-shadow:var(--bs-btn-focus-box-shadow)}.btn-check:focus-visible+.btn{border-color:var(--bs-btn-hover-border-color);outline:0;box-shadow:var(--bs-btn-focus-box-shadow)}.btn-check:checked+.btn,.btn.active,.btn.show,.btn:first-child:active,:not(.btn-check)+.btn:active{color:var(--bs-btn-active-color);background-color:var(--bs-btn-active-bg);border-color:var(--bs-btn-active-border-color)}.btn-check:checked+.btn:focus-visible,.btn.active:focus-visible,.btn.show:focus-visible,.btn:first-child:active:focus-visible,:not(.btn-check)+.btn:active:focus-visible{box-shadow:var(--bs-btn-focus-box-shadow)}.btn.disabled,.btn:disabled,fieldset:disabled .btn{color:var(--bs-btn-disabled-color);pointer-events:none;background-color:var(--bs-btn-disabled-bg);border-color:var(--bs-btn-disabled-border-color);opacity:var(--bs-btn-disabled-opacity)}.btn-primary{--bs-btn-color:#fff;--bs-btn-bg:#0d6efd;--bs-btn-border-color:#0d6efd;--bs-btn-hover-color:#fff;--bs-btn-hover-bg:#0b5ed7;--bs-btn-hover-border-color:#0a58ca;--bs-btn-focus-shadow-rgb:49,132,253;--bs-btn-active-color:#fff;--bs-btn-active-bg:#0a58ca;--bs-btn-active-border-color:#0a53be;--bs-btn-active-shadow:inset 0 3px 5px rgba(0, 0, 0, 0.125);--bs-btn-disabled-color:#fff;--bs-btn-disabled-bg:#0d6efd;--bs-btn-disabled-border-color:#0d6efd}.btn-secondary{--bs-btn-color:#fff;--bs-btn-bg:#6c757d;--bs-btn-border-color:#6c757d;--bs-btn-hover-color:#fff;--bs-btn-hover-bg:#5c636a;--bs-btn-hover-border-color:#565e64;--bs-btn-focus-shadow-rgb:130,138,145;--bs-btn-active-color:#fff;--bs-btn-active-bg:#565e64;--bs-btn-active-border-color:#51585e;--bs-btn-active-shadow:inset 0 3px 5px rgba(0, 0, 0, 0.125);--bs-btn-disabled-color:#fff;--bs-btn-disabled-bg:#6c757d;--bs-btn-disabled-border-color:#6c757d}.btn-success{--bs-btn-color:#fff;--bs-btn-bg:#198754;--bs-btn-border-color:#198754;--bs-btn-hover-color:#fff;--bs-btn-hover-bg:#157347;--bs-btn-hover-border-color:#146c43;--bs-btn-focus-shadow-rgb:60,153,110;--bs-btn-active-color:#fff;--bs-btn-active-bg:#146c43;--bs-btn-active-border-color:#13653f;--bs-btn-active-shadow:inset 0 3px 5px rgba(0, 0, 0, 0.125);--bs-btn-disabled-color:#fff;--bs-btn-disabled-bg:#198754;--bs-btn-disabled-border-color:#198754}.btn-info{--bs-btn-color:#000;--bs-btn-bg:#0dcaf0;--bs-btn-border-color:#0dcaf0;--bs-btn-hover-color:#000;--bs-btn-hover-bg:#31d2f2;--bs-btn-hover-border-color:#25cff2;--bs-btn-focus-shadow-rgb:11,172,204;--bs-btn-active-color:#000;--bs-btn-active-bg:#3dd5f3;--bs-btn-active-border-color:#25cff2;--bs-btn-active-shadow:inset 0 3px 5px rgba(0, 0, 0, 0.125);--bs-btn-disabled-color:#000;--bs-btn-disabled-bg:#0dcaf0;--bs-btn-disabled-border-color:#0dcaf0}.btn-warning{--bs-btn-color:#000;--bs-btn-bg:#ffc107;--bs-btn-border-color:#ffc107;--bs-btn-hover-color:#000;--bs-btn-hover-bg:#ffca2c;--bs-btn-hover-border-color:#ffc720;--bs-btn-focus-shadow-rgb:217,164,6;--bs-btn-active-color:#000;--bs-btn-active-bg:#ffcd39;--bs-btn-active-border-color:#ffc720;--bs-btn-active-shadow:inset 0 3px 5px rgba(0, 0, 0, 0.125);--bs-btn-disabled-color:#000;--bs-btn-disabled-bg:#ffc107;--bs-btn-disabled-border-color:#ffc107}.btn-danger{--bs-btn-color:#fff;--bs-btn-bg:#dc3545;--bs-btn-border-color:#dc3545;--bs-btn-hover-color:#fff;--bs-btn-hover-bg:#bb2d3b;--bs-btn-hover-border-color:#b02a37;--bs-btn-focus-shadow-rgb:225,83,97;--bs-btn-active-color:#fff;--bs-btn-active-bg:#b02a37;--bs-btn-active-border-color:#a52834;--bs-btn-active-shadow:inset 0 3px 5px rgba(0, 0, 0, 0.125);--bs-btn-disabled-color:#fff;--bs-btn-disabled-bg:#dc3545;--bs-btn-disabled-border-color:#dc3545}.btn-light{--bs-btn-color:#000;--bs-btn-bg:#f8f9fa;--bs-btn-border-color:#f8f9fa;--bs-btn-hover-color:#000;--bs-btn-hover-bg:#d3d4d5;--bs-btn-hover-border-color:#c6c7c8;--bs-btn-focus-shadow-rgb:211,212,213;--bs-btn-active-color:#000;--bs-btn-active-bg:#c6c7c8;--bs-btn-active-border-color:#babbbc;--bs-btn-active-shadow:inset 0 3px 5px rgba(0, 0, 0, 0.125);--bs-btn-disabled-color:#000;--bs-btn-disabled-bg:#f8f9fa;--bs-btn-disabled-border-color:#f8f9fa}.btn-dark{--bs-btn-color:#fff;--bs-btn-bg:#212529;--bs-btn-border-color:#212529;--bs-btn-hover-color:#fff;--bs-btn-hover-bg:#424649;--bs-btn-hover-border-color:#373b3e;--bs-btn-focus-shadow-rgb:66,70,73;--bs-btn-active-color:#fff;--bs-btn-active-bg:#4d5154;--bs-btn-active-border-color:#373b3e;--bs-btn-active-shadow:inset 0 3px 5px rgba(0, 0, 0, 0.125);--bs-btn-disabled-color:#fff;--bs-btn-disabled-bg:#212529;--bs-btn-disabled-border-color:#212529}.btn-outline-primary{--bs-btn-color:#0d6efd;--bs-btn-border-color:#0d6efd;--bs-btn-hover-color:#fff;--bs-btn-hover-bg:#0d6efd;--bs-btn-hover-border-color:#0d6efd;--bs-btn-focus-shadow-rgb:13,110,253;--bs-btn-active-color:#fff;--bs-btn-active-bg:#0d6efd;--bs-btn-active-border-color:#0d6efd;--bs-btn-active-shadow:inset 0 3px 5px rgba(0, 0, 0, 0.125);--bs-btn-disabled-color:#0d6efd;--bs-btn-disabled-bg:transparent;--bs-btn-disabled-border-color:#0d6efd;--bs-gradient:none}.btn-outline-secondary{--bs-btn-color:#6c757d;--bs-btn-border-color:#6c757d;--bs-btn-hover-color:#fff;--bs-btn-hover-bg:#6c757d;--bs-btn-hover-border-color:#6c757d;--bs-btn-focus-shadow-rgb:108,117,125;--bs-btn-active-color:#fff;--bs-btn-active-bg:#6c757d;--bs-btn-active-border-color:#6c757d;--bs-btn-active-shadow:inset 0 3px 5px rgba(0, 0, 0, 0.125);--bs-btn-disabled-color:#6c757d;--bs-btn-disabled-bg:transparent;--bs-btn-disabled-border-color:#6c757d;--bs-gradient:none}.btn-outline-success{--bs-btn-color:#198754;--bs-btn-border-color:#198754;--bs-btn-hover-color:#fff;--bs-btn-hover-bg:#198754;--bs-btn-hover-border-color:#198754;--bs-btn-focus-shadow-rgb:25,135,84;--bs-btn-active-color:#fff;--bs-btn-active-bg:#198754;--bs-btn-active-border-color:#198754;--bs-btn-active-shadow:inset 0 3px 5px rgba(0, 0, 0, 0.125);--bs-btn-disabled-color:#198754;--bs-btn-disabled-bg:transparent;--bs-btn-disabled-border-color:#198754;--bs-gradient:none}.btn-outline-info{--bs-btn-color:#0dcaf0;--bs-btn-border-color:#0dcaf0;--bs-btn-hover-color:#000;--bs-btn-hover-bg:#0dcaf0;--bs-btn-hover-border-color:#0dcaf0;--bs-btn-focus-shadow-rgb:13,202,240;--bs-btn-active-color:#000;--bs-btn-active-bg:#0dcaf0;--bs-btn-active-border-color:#0dcaf0;--bs-btn-active-shadow:inset 0 3px 5px rgba(0, 0, 0, 0.125);--bs-btn-disabled-color:#0dcaf0;--bs-btn-disabled-bg:transparent;--bs-btn-disabled-border-color:#0dcaf0;--bs-gradient:none}.btn-outline-warning{--bs-btn-color:#ffc107;--bs-btn-border-color:#ffc107;--bs-btn-hover-color:#000;--bs-btn-hover-bg:#ffc107;--bs-btn-hover-border-color:#ffc107;--bs-btn-focus-shadow-rgb:255,193,7;--bs-btn-active-color:#000;--bs-btn-active-bg:#ffc107;--bs-btn-active-border-color:#ffc107;--bs-btn-active-shadow:inset 0 3px 5px rgba(0, 0, 0, 0.125);--bs-btn-disabled-color:#ffc107;--bs-btn-disabled-bg:transparent;--bs-btn-disabled-border-color:#ffc107;--bs-gradient:none}.btn-outline-danger{--bs-btn-color:#dc3545;--bs-btn-border-color:#dc3545;--bs-btn-hover-color:#fff;--bs-btn-hover-bg:#dc3545;--bs-btn-hover-border-color:#dc3545;--bs-btn-focus-shadow-rgb:220,53,69;--bs-btn-active-color:#fff;--bs-btn-active-bg:#dc3545;--bs-btn-active-border-color:#dc3545;--bs-btn-active-shadow:inset 0 3px 5px rgba(0, 0, 0, 0.125);--bs-btn-disabled-color:#dc3545;--bs-btn-disabled-bg:transparent;--bs-btn-disabled-border-color:#dc3545;--bs-gradient:none}.btn-outline-light{--bs-btn-color:#f8f9fa;--bs-btn-border-color:#f8f9fa;--bs-btn-hover-color:#000;--bs-btn-hover-bg:#f8f9fa;--bs-btn-hover-border-color:#f8f9fa;--bs-btn-focus-shadow-rgb:248,249,250;--bs-btn-active-color:#000;--bs-btn-active-bg:#f8f9fa;--bs-btn-active-border-color:#f8f9fa;--bs-btn-active-shadow:inset 0 3px 5px rgba(0, 0, 0, 0.125);--bs-btn-disabled-color:#f8f9fa;--bs-btn-disabled-bg:transparent;--bs-btn-disabled-border-color:#f8f9fa;--bs-gradient:none}.btn-outline-dark{--bs-btn-color:#212529;--bs-btn-border-color:#212529;--bs-btn-hover-color:#fff;--bs-btn-hover-bg:#212529;--bs-btn-hover-border-color:#212529;--bs-btn-focus-shadow-rgb:33,37,41;--bs-btn-active-color:#fff;--bs-btn-active-bg:#212529;--bs-btn-active-border-color:#212529;--bs-btn-active-shadow:inset 0 3px 5px rgba(0, 0, 0, 0.125);--bs-btn-disabled-color:#212529;--bs-btn-disabled-bg:transparent;--bs-btn-disabled-border-color:#212529;--bs-gradient:none}.btn-link{--bs-btn-font-weight:400;--bs-btn-color:var(--bs-link-color);--bs-btn-bg:transparent;--bs-btn-border-color:transparent;--bs-btn-hover-color:var(--bs-link-hover-color);--bs-btn-hover-border-color:transparent;--bs-btn-active-color:var(--bs-link-hover-color);--bs-btn-active-border-color:transparent;--bs-btn-disabled-color:#6c757d;--bs-btn-disabled-border-color:transparent;--bs-btn-box-shadow:none;--bs-btn-focus-shadow-rgb:49,132,253;text-decoration:underline}.btn-link:focus-visible{color:var(--bs-btn-color)}.btn-link:hover{color:var(--bs-btn-hover-color)}.btn-group-lg>.btn,.btn-lg{--bs-btn-padding-y:0.5rem;--bs-btn-padding-x:1rem;--bs-btn-font-size:1.25rem;--bs-btn-border-radius:0.5rem}.btn-group-sm>.btn,.btn-sm{--bs-btn-padding-y:0.25rem;--bs-btn-padding-x:0.5rem;--bs-btn-font-size:0.875rem;--bs-btn-border-radius:0.25rem}.fade{transition:opacity .15s linear}@media (prefers-reduced-motion:reduce){.fade{transition:none}}.fade:not(.show){opacity:0}.collapse:not(.show){display:none}.collapsing{height:0;overflow:hidden;transition:height .35s ease}@media (prefers-reduced-motion:reduce){.collapsing{transition:none}}.collapsing.collapse-horizontal{width:0;height:auto;transition:width .35s ease}@media (prefers-reduced-motion:reduce){.collapsing.collapse-horizontal{transition:none}}.dropdown,.dropdown-center,.dropend,.dropstart,.dropup,.dropup-center{position:relative}.dropdown-toggle{white-space:nowrap}.dropdown-toggle::after{display:inline-block;margin-left:.255em;vertical-align:.255em;content:"";border-top:.3em solid;border-right:.3em solid transparent;border-bottom:0;border-left:.3em solid transparent}.dropdown-toggle:empty::after{margin-left:0}.dropdown-menu{--bs-dropdown-zindex:1000;--bs-dropdown-min-width:10rem;--bs-dropdown-padding-x:0;--bs-dropdown-padding-y:0.5rem;--bs-dropdown-spacer:0.125rem;--bs-dropdown-font-size:1rem;--bs-dropdown-color:#212529;--bs-dropdown-bg:#fff;--bs-dropdown-border-color:var(--bs-border-color-translucent);--bs-dropdown-border-radius:0.375rem;--bs-dropdown-border-width:1px;--bs-dropdown-inner-border-radius:calc(0.375rem - 1px);--bs-dropdown-divider-bg:var(--bs-border-color-translucent);--bs-dropdown-divider-margin-y:0.5rem;--bs-dropdown-box-shadow:0 0.5rem 1rem rgba(0, 0, 0, 0.15);--bs-dropdown-link-color:#212529;--bs-dropdown-link-hover-color:#1e2125;--bs-dropdown-link-hover-bg:#e9ecef;--bs-dropdown-link-active-color:#fff;--bs-dropdown-link-active-bg:#0d6efd;--bs-dropdown-link-disabled-color:#adb5bd;--bs-dropdown-item-padding-x:1rem;--bs-dropdown-item-padding-y:0.25rem;--bs-dropdown-header-color:#6c757d;--bs-dropdown-header-padding-x:1rem;--bs-dropdown-header-padding-y:0.5rem;position:absolute;z-index:var(--bs-dropdown-zindex);display:none;min-width:var(--bs-dropdown-min-width);padding:var(--bs-dropdown-padding-y) var(--bs-dropdown-padding-x);margin:0;font-size:var(--bs-dropdown-font-size);color:var(--bs-dropdown-color);text-align:left;list-style:none;background-color:var(--bs-dropdown-bg);background-clip:padding-box;border:var(--bs-dropdown-border-width) solid var(--bs-dropdown-border-color);border-radius:var(--bs-dropdown-border-radius)}.dropdown-menu[data-bs-popper]{top:100%;left:0;margin-top:var(--bs-dropdown-spacer)}.dropdown-menu-start{--bs-position:start}.dropdown-menu-start[data-bs-popper]{right:auto;left:0}.dropdown-menu-end{--bs-position:end}.dropdown-menu-end[data-bs-popper]{right:0;left:auto}@media (min-width:576px){.dropdown-menu-sm-start{--bs-position:start}.dropdown-menu-sm-start[data-bs-popper]{right:auto;left:0}.dropdown-menu-sm-end{--bs-position:end}.dropdown-menu-sm-end[data-bs-popper]{right:0;left:auto}}@media (min-width:768px){.dropdown-menu-md-start{--bs-position:start}.dropdown-menu-md-start[data-bs-popper]{right:auto;left:0}.dropdown-menu-md-end{--bs-position:end}.dropdown-menu-md-end[data-bs-popper]{right:0;left:auto}}@media (min-width:992px){.dropdown-menu-lg-start{--bs-position:start}.dropdown-menu-lg-start[data-bs-popper]{right:auto;left:0}.dropdown-menu-lg-end{--bs-position:end}.dropdown-menu-lg-end[data-bs-popper]{right:0;left:auto}}@media (min-width:1200px){.dropdown-menu-xl-start{--bs-position:start}.dropdown-menu-xl-start[data-bs-popper]{right:auto;left:0}.dropdown-menu-xl-end{--bs-position:end}.dropdown-menu-xl-end[data-bs-popper]{right:0;left:auto}}@media (min-width:1400px){.dropdown-menu-xxl-start{--bs-position:start}.dropdown-menu-xxl-start[data-bs-popper]{right:auto;left:0}.dropdown-menu-xxl-end{--bs-position:end}.dropdown-menu-xxl-end[data-bs-popper]{right:0;left:auto}}.dropup .dropdown-menu[data-bs-popper]{top:auto;bottom:100%;margin-top:0;margin-bottom:var(--bs-dropdown-spacer)}.dropup .dropdown-toggle::after{display:inline-block;margin-left:.255em;vertical-align:.255em;content:"";border-top:0;border-right:.3em solid transparent;border-bottom:.3em solid;border-left:.3em solid transparent}.dropup .dropdown-toggle:empty::after{margin-left:0}.dropend .dropdown-menu[data-bs-popper]{top:0;right:auto;left:100%;margin-top:0;margin-left:var(--bs-dropdown-spacer)}.dropend .dropdown-toggle::after{display:inline-block;margin-left:.255em;vertical-align:.255em;content:"";border-top:.3em solid transparent;border-right:0;border-bottom:.3em solid transparent;border-left:.3em solid}.dropend .dropdown-toggle:empty::after{margin-left:0}.dropend .dropdown-toggle::after{vertical-align:0}.dropstart .dropdown-menu[data-bs-popper]{top:0;right:100%;left:auto;margin-top:0;margin-right:var(--bs-dropdown-spacer)}.dropstart .dropdown-toggle::after{display:inline-block;margin-left:.255em;vertical-align:.255em;content:""}.dropstart .dropdown-toggle::after{display:none}.dropstart .dropdown-toggle::before{display:inline-block;margin-right:.255em;vertical-align:.255em;content:"";border-top:.3em solid transparent;border-right:.3em solid;border-bottom:.3em solid transparent}.dropstart .dropdown-toggle:empty::after{margin-left:0}.dropstart .dropdown-toggle::before{vertical-align:0}.dropdown-divider{height:0;margin:var(--bs-dropdown-divider-margin-y) 0;overflow:hidden;border-top:1px solid var(--bs-dropdown-divider-bg);opacity:1}.dropdown-item{display:block;width:100%;padding:var(--bs-dropdown-item-padding-y) var(--bs-dropdown-item-padding-x);clear:both;font-weight:400;color:var(--bs-dropdown-link-color);text-align:inherit;text-decoration:none;white-space:nowrap;background-color:transparent;border:0}.dropdown-item:focus,.dropdown-item:hover{color:var(--bs-dropdown-link-hover-color);background-color:var(--bs-dropdown-link-hover-bg)}.dropdown-item.active,.dropdown-item:active{color:var(--bs-dropdown-link-active-color);text-decoration:none;background-color:var(--bs-dropdown-link-active-bg)}.dropdown-item.disabled,.dropdown-item:disabled{color:var(--bs-dropdown-link-disabled-color);pointer-events:none;background-color:transparent}.dropdown-menu.show{display:block}.dropdown-header{display:block;padding:var(--bs-dropdown-header-padding-y) var(--bs-dropdown-header-padding-x);margin-bottom:0;font-size:.875rem;color:var(--bs-dropdown-header-color);white-space:nowrap}.dropdown-item-text{display:block;padding:var(--bs-dropdown-item-padding-y) var(--bs-dropdown-item-padding-x);color:var(--bs-dropdown-link-color)}.dropdown-menu-dark{--bs-dropdown-color:#dee2e6;--bs-dropdown-bg:#343a40;--bs-dropdown-border-color:var(--bs-border-color-translucent);--bs-dropdown-box-shadow: ;--bs-dropdown-link-color:#dee2e6;--bs-dropdown-link-hover-color:#fff;--bs-dropdown-divider-bg:var(--bs-border-color-translucent);--bs-dropdown-link-hover-bg:rgba(255, 255, 255, 0.15);--bs-dropdown-link-active-color:#fff;--bs-dropdown-link-active-bg:#0d6efd;--bs-dropdown-link-disabled-color:#adb5bd;--bs-dropdown-header-color:#adb5bd}.btn-group,.btn-group-vertical{position:relative;display:inline-flex;vertical-align:middle}.btn-group-vertical>.btn,.btn-group>.btn{position:relative;flex:1 1 auto}.btn-group-vertical>.btn-check:checked+.btn,.btn-group-vertical>.btn-check:focus+.btn,.btn-group-vertical>.btn.active,.btn-group-vertical>.btn:active,.btn-group-vertical>.btn:focus,.btn-group-vertical>.btn:hover,.btn-group>.btn-check:checked+.btn,.btn-group>.btn-check:focus+.btn,.btn-group>.btn.active,.btn-group>.btn:active,.btn-group>.btn:focus,.btn-group>.btn:hover{z-index:1}.btn-toolbar{display:flex;flex-wrap:wrap;justify-content:flex-start}.btn-toolbar .input-group{width:auto}.btn-group{border-radius:.375rem}.btn-group>.btn-group:not(:first-child),.btn-group>:not(.btn-check:first-child)+.btn{margin-left:-1px}.btn-group>.btn-group:not(:last-child)>.btn,.btn-group>.btn.dropdown-toggle-split:first-child,.btn-group>.btn:not(:last-child):not(.dropdown-toggle){border-top-right-radius:0;border-bottom-right-radius:0}.btn-group>.btn-group:not(:first-child)>.btn,.btn-group>.btn:nth-child(n+3),.btn-group>:not(.btn-check)+.btn{border-top-left-radius:0;border-bottom-left-radius:0}.dropdown-toggle-split{padding-right:.5625rem;padding-left:.5625rem}.dropdown-toggle-split::after,.dropend .dropdown-toggle-split::after,.dropup .dropdown-toggle-split::after{margin-left:0}.dropstart .dropdown-toggle-split::before{margin-right:0}.btn-group-sm>.btn+.dropdown-toggle-split,.btn-sm+.dropdown-toggle-split{padding-right:.375rem;padding-left:.375rem}.btn-group-lg>.btn+.dropdown-toggle-split,.btn-lg+.dropdown-toggle-split{padding-right:.75rem;padding-left:.75rem}.btn-group-vertical{flex-direction:column;align-items:flex-start;justify-content:center}.btn-group-vertical>.btn,.btn-group-vertical>.btn-group{width:100%}.btn-group-vertical>.btn-group:not(:first-child),.btn-group-vertical>.btn:not(:first-child){margin-top:-1px}.btn-group-vertical>.btn-group:not(:last-child)>.btn,.btn-group-vertical>.btn:not(:last-child):not(.dropdown-toggle){border-bottom-right-radius:0;border-bottom-left-radius:0}.btn-group-vertical>.btn-group:not(:first-child)>.btn,.btn-group-vertical>.btn~.btn{border-top-left-radius:0;border-top-right-radius:0}.nav{--bs-nav-link-padding-x:1rem;--bs-nav-link-padding-y:0.5rem;--bs-nav-link-font-weight: ;--bs-nav-link-color:var(--bs-link-color);--bs-nav-link-hover-color:var(--bs-link-hover-color);--bs-nav-link-disabled-color:#6c757d;display:flex;flex-wrap:wrap;padding-left:0;margin-bottom:0;list-style:none}.nav-link{display:block;padding:var(--bs-nav-link-padding-y) var(--bs-nav-link-padding-x);font-size:var(--bs-nav-link-font-size);font-weight:var(--bs-nav-link-font-weight);color:var(--bs-nav-link-color);text-decoration:none;transition:color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out}@media (prefers-reduced-motion:reduce){.nav-link{transition:none}}.nav-link:focus,.nav-link:hover{color:var(--bs-nav-link-hover-color)}.nav-link.disabled{color:var(--bs-nav-link-disabled-color);pointer-events:none;cursor:default}.nav-tabs{--bs-nav-tabs-border-width:1px;--bs-nav-tabs-border-color:#dee2e6;--bs-nav-tabs-border-radius:0.375rem;--bs-nav-tabs-link-hover-border-color:#e9ecef #e9ecef #dee2e6;--bs-nav-tabs-link-active-color:#495057;--bs-nav-tabs-link-active-bg:#fff;--bs-nav-tabs-link-active-border-color:#dee2e6 #dee2e6 #fff;border-bottom:var(--bs-nav-tabs-border-width) solid var(--bs-nav-tabs-border-color)}.nav-tabs .nav-link{margin-bottom:calc(-1 * var(--bs-nav-tabs-border-width));background:0 0;border:var(--bs-nav-tabs-border-width) solid transparent;border-top-left-radius:var(--bs-nav-tabs-border-radius);border-top-right-radius:var(--bs-nav-tabs-border-radius)}.nav-tabs .nav-link:focus,.nav-tabs .nav-link:hover{isolation:isolate;border-color:var(--bs-nav-tabs-link-hover-border-color)}.nav-tabs .nav-link.disabled,.nav-tabs .nav-link:disabled{color:var(--bs-nav-link-disabled-color);background-color:transparent;border-color:transparent}.nav-tabs .nav-item.show .nav-link,.nav-tabs .nav-link.active{color:var(--bs-nav-tabs-link-active-color);background-color:var(--bs-nav-tabs-link-active-bg);border-color:var(--bs-nav-tabs-link-active-border-color)}.nav-tabs .dropdown-menu{margin-top:calc(-1 * var(--bs-nav-tabs-border-width));border-top-left-radius:0;border-top-right-radius:0}.nav-pills{--bs-nav-pills-border-radius:0.375rem;--bs-nav-pills-link-active-color:#fff;--bs-nav-pills-link-active-bg:#0d6efd}.nav-pills .nav-link{background:0 0;border:0;border-radius:var(--bs-nav-pills-border-radius)}.nav-pills .nav-link:disabled{color:var(--bs-nav-link-disabled-color);background-color:transparent;border-color:transparent}.nav-pills .nav-link.active,.nav-pills .show>.nav-link{color:var(--bs-nav-pills-link-active-color);background-color:var(--bs-nav-pills-link-active-bg)}.nav-fill .nav-item,.nav-fill>.nav-link{flex:1 1 auto;text-align:center}.nav-justified .nav-item,.nav-justified>.nav-link{flex-basis:0;flex-grow:1;text-align:center}.nav-fill .nav-item .nav-link,.nav-justified .nav-item .nav-link{width:100%}.tab-content>.tab-pane{display:none}.tab-content>.active{display:block}.navbar{--bs-navbar-padding-x:0;--bs-navbar-padding-y:0.5rem;--bs-navbar-color:rgba(0, 0, 0, 0.55);--bs-navbar-hover-color:rgba(0, 0, 0, 0.7);--bs-navbar-disabled-color:rgba(0, 0, 0, 0.3);--bs-navbar-active-color:rgba(0, 0, 0, 0.9);--bs-navbar-brand-padding-y:0.3125rem;--bs-navbar-brand-margin-end:1rem;--bs-navbar-brand-font-size:1.25rem;--bs-navbar-brand-color:rgba(0, 0, 0, 0.9);--bs-navbar-brand-hover-color:rgba(0, 0, 0, 0.9);--bs-navbar-nav-link-padding-x:0.5rem;--bs-navbar-toggler-padding-y:0.25rem;--bs-navbar-toggler-padding-x:0.75rem;--bs-navbar-toggler-font-size:1.25rem;--bs-navbar-toggler-icon-bg:url(${F});--bs-navbar-toggler-border-color:rgba(0, 0, 0, 0.1);--bs-navbar-toggler-border-radius:0.375rem;--bs-navbar-toggler-focus-width:0.25rem;--bs-navbar-toggler-transition:box-shadow 0.15s ease-in-out;position:relative;display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;padding:var(--bs-navbar-padding-y) var(--bs-navbar-padding-x)}.navbar>.container,.navbar>.container-fluid,.navbar>.container-lg,.navbar>.container-md,.navbar>.container-sm,.navbar>.container-xl,.navbar>.container-xxl{display:flex;flex-wrap:inherit;align-items:center;justify-content:space-between}.navbar-brand{padding-top:var(--bs-navbar-brand-padding-y);padding-bottom:var(--bs-navbar-brand-padding-y);margin-right:var(--bs-navbar-brand-margin-end);font-size:var(--bs-navbar-brand-font-size);color:var(--bs-navbar-brand-color);text-decoration:none;white-space:nowrap}.navbar-brand:focus,.navbar-brand:hover{color:var(--bs-navbar-brand-hover-color)}.navbar-nav{--bs-nav-link-padding-x:0;--bs-nav-link-padding-y:0.5rem;--bs-nav-link-font-weight: ;--bs-nav-link-color:var(--bs-navbar-color);--bs-nav-link-hover-color:var(--bs-navbar-hover-color);--bs-nav-link-disabled-color:var(--bs-navbar-disabled-color);display:flex;flex-direction:column;padding-left:0;margin-bottom:0;list-style:none}.navbar-nav .nav-link.active,.navbar-nav .show>.nav-link{color:var(--bs-navbar-active-color)}.navbar-nav .dropdown-menu{position:static}.navbar-text{padding-top:.5rem;padding-bottom:.5rem;color:var(--bs-navbar-color)}.navbar-text a,.navbar-text a:focus,.navbar-text a:hover{color:var(--bs-navbar-active-color)}.navbar-collapse{flex-basis:100%;flex-grow:1;align-items:center}.navbar-toggler{padding:var(--bs-navbar-toggler-padding-y) var(--bs-navbar-toggler-padding-x);font-size:var(--bs-navbar-toggler-font-size);line-height:1;color:var(--bs-navbar-color);background-color:transparent;border:var(--bs-border-width) solid var(--bs-navbar-toggler-border-color);border-radius:var(--bs-navbar-toggler-border-radius);transition:var(--bs-navbar-toggler-transition)}@media (prefers-reduced-motion:reduce){.navbar-toggler{transition:none}}.navbar-toggler:hover{text-decoration:none}.navbar-toggler:focus{text-decoration:none;outline:0;box-shadow:0 0 0 var(--bs-navbar-toggler-focus-width)}.navbar-toggler-icon{display:inline-block;width:1.5em;height:1.5em;vertical-align:middle;background-image:var(--bs-navbar-toggler-icon-bg);background-repeat:no-repeat;background-position:center;background-size:100%}.navbar-nav-scroll{max-height:var(--bs-scroll-height,75vh);overflow-y:auto}@media (min-width:576px){.navbar-expand-sm{flex-wrap:nowrap;justify-content:flex-start}.navbar-expand-sm .navbar-nav{flex-direction:row}.navbar-expand-sm .navbar-nav .dropdown-menu{position:absolute}.navbar-expand-sm .navbar-nav .nav-link{padding-right:var(--bs-navbar-nav-link-padding-x);padding-left:var(--bs-navbar-nav-link-padding-x)}.navbar-expand-sm .navbar-nav-scroll{overflow:visible}.navbar-expand-sm .navbar-collapse{display:flex!important;flex-basis:auto}.navbar-expand-sm .navbar-toggler{display:none}.navbar-expand-sm .offcanvas{position:static;z-index:auto;flex-grow:1;width:auto!important;height:auto!important;visibility:visible!important;background-color:transparent!important;border:0!important;transform:none!important;transition:none}.navbar-expand-sm .offcanvas .offcanvas-header{display:none}.navbar-expand-sm .offcanvas .offcanvas-body{display:flex;flex-grow:0;padding:0;overflow-y:visible}}@media (min-width:768px){.navbar-expand-md{flex-wrap:nowrap;justify-content:flex-start}.navbar-expand-md .navbar-nav{flex-direction:row}.navbar-expand-md .navbar-nav .dropdown-menu{position:absolute}.navbar-expand-md .navbar-nav .nav-link{padding-right:var(--bs-navbar-nav-link-padding-x);padding-left:var(--bs-navbar-nav-link-padding-x)}.navbar-expand-md .navbar-nav-scroll{overflow:visible}.navbar-expand-md .navbar-collapse{display:flex!important;flex-basis:auto}.navbar-expand-md .navbar-toggler{display:none}.navbar-expand-md .offcanvas{position:static;z-index:auto;flex-grow:1;width:auto!important;height:auto!important;visibility:visible!important;background-color:transparent!important;border:0!important;transform:none!important;transition:none}.navbar-expand-md .offcanvas .offcanvas-header{display:none}.navbar-expand-md .offcanvas .offcanvas-body{display:flex;flex-grow:0;padding:0;overflow-y:visible}}@media (min-width:992px){.navbar-expand-lg{flex-wrap:nowrap;justify-content:flex-start}.navbar-expand-lg .navbar-nav{flex-direction:row}.navbar-expand-lg .navbar-nav .dropdown-menu{position:absolute}.navbar-expand-lg .navbar-nav .nav-link{padding-right:var(--bs-navbar-nav-link-padding-x);padding-left:var(--bs-navbar-nav-link-padding-x)}.navbar-expand-lg .navbar-nav-scroll{overflow:visible}.navbar-expand-lg .navbar-collapse{display:flex!important;flex-basis:auto}.navbar-expand-lg .navbar-toggler{display:none}.navbar-expand-lg .offcanvas{position:static;z-index:auto;flex-grow:1;width:auto!important;height:auto!important;visibility:visible!important;background-color:transparent!important;border:0!important;transform:none!important;transition:none}.navbar-expand-lg .offcanvas .offcanvas-header{display:none}.navbar-expand-lg .offcanvas .offcanvas-body{display:flex;flex-grow:0;padding:0;overflow-y:visible}}@media (min-width:1200px){.navbar-expand-xl{flex-wrap:nowrap;justify-content:flex-start}.navbar-expand-xl .navbar-nav{flex-direction:row}.navbar-expand-xl .navbar-nav .dropdown-menu{position:absolute}.navbar-expand-xl .navbar-nav .nav-link{padding-right:var(--bs-navbar-nav-link-padding-x);padding-left:var(--bs-navbar-nav-link-padding-x)}.navbar-expand-xl .navbar-nav-scroll{overflow:visible}.navbar-expand-xl .navbar-collapse{display:flex!important;flex-basis:auto}.navbar-expand-xl .navbar-toggler{display:none}.navbar-expand-xl .offcanvas{position:static;z-index:auto;flex-grow:1;width:auto!important;height:auto!important;visibility:visible!important;background-color:transparent!important;border:0!important;transform:none!important;transition:none}.navbar-expand-xl .offcanvas .offcanvas-header{display:none}.navbar-expand-xl .offcanvas .offcanvas-body{display:flex;flex-grow:0;padding:0;overflow-y:visible}}@media (min-width:1400px){.navbar-expand-xxl{flex-wrap:nowrap;justify-content:flex-start}.navbar-expand-xxl .navbar-nav{flex-direction:row}.navbar-expand-xxl .navbar-nav .dropdown-menu{position:absolute}.navbar-expand-xxl .navbar-nav .nav-link{padding-right:var(--bs-navbar-nav-link-padding-x);padding-left:var(--bs-navbar-nav-link-padding-x)}.navbar-expand-xxl .navbar-nav-scroll{overflow:visible}.navbar-expand-xxl .navbar-collapse{display:flex!important;flex-basis:auto}.navbar-expand-xxl .navbar-toggler{display:none}.navbar-expand-xxl .offcanvas{position:static;z-index:auto;flex-grow:1;width:auto!important;height:auto!important;visibility:visible!important;background-color:transparent!important;border:0!important;transform:none!important;transition:none}.navbar-expand-xxl .offcanvas .offcanvas-header{display:none}.navbar-expand-xxl .offcanvas .offcanvas-body{display:flex;flex-grow:0;padding:0;overflow-y:visible}}.navbar-expand{flex-wrap:nowrap;justify-content:flex-start}.navbar-expand .navbar-nav{flex-direction:row}.navbar-expand .navbar-nav .dropdown-menu{position:absolute}.navbar-expand .navbar-nav .nav-link{padding-right:var(--bs-navbar-nav-link-padding-x);padding-left:var(--bs-navbar-nav-link-padding-x)}.navbar-expand .navbar-nav-scroll{overflow:visible}.navbar-expand .navbar-collapse{display:flex!important;flex-basis:auto}.navbar-expand .navbar-toggler{display:none}.navbar-expand .offcanvas{position:static;z-index:auto;flex-grow:1;width:auto!important;height:auto!important;visibility:visible!important;background-color:transparent!important;border:0!important;transform:none!important;transition:none}.navbar-expand .offcanvas .offcanvas-header{display:none}.navbar-expand .offcanvas .offcanvas-body{display:flex;flex-grow:0;padding:0;overflow-y:visible}.navbar-dark{--bs-navbar-color:rgba(255, 255, 255, 0.55);--bs-navbar-hover-color:rgba(255, 255, 255, 0.75);--bs-navbar-disabled-color:rgba(255, 255, 255, 0.25);--bs-navbar-active-color:#fff;--bs-navbar-brand-color:#fff;--bs-navbar-brand-hover-color:#fff;--bs-navbar-toggler-border-color:rgba(255, 255, 255, 0.1);--bs-navbar-toggler-icon-bg:url(${R})}.card{--bs-card-spacer-y:1rem;--bs-card-spacer-x:1rem;--bs-card-title-spacer-y:0.5rem;--bs-card-border-width:1px;--bs-card-border-color:var(--bs-border-color-translucent);--bs-card-border-radius:0.375rem;--bs-card-box-shadow: ;--bs-card-inner-border-radius:calc(0.375rem - 1px);--bs-card-cap-padding-y:0.5rem;--bs-card-cap-padding-x:1rem;--bs-card-cap-bg:rgba(0, 0, 0, 0.03);--bs-card-cap-color: ;--bs-card-height: ;--bs-card-color: ;--bs-card-bg:#fff;--bs-card-img-overlay-padding:1rem;--bs-card-group-margin:0.75rem;position:relative;display:flex;flex-direction:column;min-width:0;height:var(--bs-card-height);word-wrap:break-word;background-color:var(--bs-card-bg);background-clip:border-box;border:var(--bs-card-border-width) solid var(--bs-card-border-color);border-radius:var(--bs-card-border-radius)}.card>hr{margin-right:0;margin-left:0}.card>.list-group{border-top:inherit;border-bottom:inherit}.card>.list-group:first-child{border-top-width:0;border-top-left-radius:var(--bs-card-inner-border-radius);border-top-right-radius:var(--bs-card-inner-border-radius)}.card>.list-group:last-child{border-bottom-width:0;border-bottom-right-radius:var(--bs-card-inner-border-radius);border-bottom-left-radius:var(--bs-card-inner-border-radius)}.card>.card-header+.list-group,.card>.list-group+.card-footer{border-top:0}.card-body{flex:1 1 auto;padding:var(--bs-card-spacer-y) var(--bs-card-spacer-x);color:var(--bs-card-color)}.card-title{margin-bottom:var(--bs-card-title-spacer-y)}.card-subtitle{margin-top:calc(-.5 * var(--bs-card-title-spacer-y));margin-bottom:0}.card-text:last-child{margin-bottom:0}.card-link+.card-link{margin-left:var(--bs-card-spacer-x)}.card-header{padding:var(--bs-card-cap-padding-y) var(--bs-card-cap-padding-x);margin-bottom:0;color:var(--bs-card-cap-color);background-color:var(--bs-card-cap-bg);border-bottom:var(--bs-card-border-width) solid var(--bs-card-border-color)}.card-header:first-child{border-radius:var(--bs-card-inner-border-radius) var(--bs-card-inner-border-radius) 0 0}.card-footer{padding:var(--bs-card-cap-padding-y) var(--bs-card-cap-padding-x);color:var(--bs-card-cap-color);background-color:var(--bs-card-cap-bg);border-top:var(--bs-card-border-width) solid var(--bs-card-border-color)}.card-footer:last-child{border-radius:0 0 var(--bs-card-inner-border-radius) var(--bs-card-inner-border-radius)}.card-header-tabs{margin-right:calc(-.5 * var(--bs-card-cap-padding-x));margin-bottom:calc(-1 * var(--bs-card-cap-padding-y));margin-left:calc(-.5 * var(--bs-card-cap-padding-x));border-bottom:0}.card-header-tabs .nav-link.active{background-color:var(--bs-card-bg);border-bottom-color:var(--bs-card-bg)}.card-header-pills{margin-right:calc(-.5 * var(--bs-card-cap-padding-x));margin-left:calc(-.5 * var(--bs-card-cap-padding-x))}.card-img-overlay{position:absolute;top:0;right:0;bottom:0;left:0;padding:var(--bs-card-img-overlay-padding);border-radius:var(--bs-card-inner-border-radius)}.card-img,.card-img-bottom,.card-img-top{width:100%}.card-img,.card-img-top{border-top-left-radius:var(--bs-card-inner-border-radius);border-top-right-radius:var(--bs-card-inner-border-radius)}.card-img,.card-img-bottom{border-bottom-right-radius:var(--bs-card-inner-border-radius);border-bottom-left-radius:var(--bs-card-inner-border-radius)}.card-group>.card{margin-bottom:var(--bs-card-group-margin)}@media (min-width:576px){.card-group{display:flex;flex-flow:row wrap}.card-group>.card{flex:1 0 0%;margin-bottom:0}.card-group>.card+.card{margin-left:0;border-left:0}.card-group>.card:not(:last-child){border-top-right-radius:0;border-bottom-right-radius:0}.card-group>.card:not(:last-child) .card-header,.card-group>.card:not(:last-child) .card-img-top{border-top-right-radius:0}.card-group>.card:not(:last-child) .card-footer,.card-group>.card:not(:last-child) .card-img-bottom{border-bottom-right-radius:0}.card-group>.card:not(:first-child){border-top-left-radius:0;border-bottom-left-radius:0}.card-group>.card:not(:first-child) .card-header,.card-group>.card:not(:first-child) .card-img-top{border-top-left-radius:0}.card-group>.card:not(:first-child) .card-footer,.card-group>.card:not(:first-child) .card-img-bottom{border-bottom-left-radius:0}}.accordion{--bs-accordion-color:#212529;--bs-accordion-bg:#fff;--bs-accordion-transition:color 0.15s ease-in-out,background-color 0.15s ease-in-out,border-color 0.15s ease-in-out,box-shadow 0.15s ease-in-out,border-radius 0.15s ease;--bs-accordion-border-color:var(--bs-border-color);--bs-accordion-border-width:1px;--bs-accordion-border-radius:0.375rem;--bs-accordion-inner-border-radius:calc(0.375rem - 1px);--bs-accordion-btn-padding-x:1.25rem;--bs-accordion-btn-padding-y:1rem;--bs-accordion-btn-color:#212529;--bs-accordion-btn-bg:var(--bs-accordion-bg);--bs-accordion-btn-icon:url(${P});--bs-accordion-btn-icon-width:1.25rem;--bs-accordion-btn-icon-transform:rotate(-180deg);--bs-accordion-btn-icon-transition:transform 0.2s ease-in-out;--bs-accordion-btn-active-icon:url(${j});--bs-accordion-btn-focus-border-color:#86b7fe;--bs-accordion-btn-focus-box-shadow:0 0 0 0.25rem rgba(13, 110, 253, 0.25);--bs-accordion-body-padding-x:1.25rem;--bs-accordion-body-padding-y:1rem;--bs-accordion-active-color:#0c63e4;--bs-accordion-active-bg:#e7f1ff}.accordion-button{position:relative;display:flex;align-items:center;width:100%;padding:var(--bs-accordion-btn-padding-y) var(--bs-accordion-btn-padding-x);font-size:1rem;color:var(--bs-accordion-btn-color);text-align:left;background-color:var(--bs-accordion-btn-bg);border:0;border-radius:0;overflow-anchor:none;transition:var(--bs-accordion-transition)}@media (prefers-reduced-motion:reduce){.accordion-button{transition:none}}.accordion-button:not(.collapsed){color:var(--bs-accordion-active-color);background-color:var(--bs-accordion-active-bg);box-shadow:inset 0 calc(-1 * var(--bs-accordion-border-width)) 0 var(--bs-accordion-border-color)}.accordion-button:not(.collapsed)::after{background-image:var(--bs-accordion-btn-active-icon);transform:var(--bs-accordion-btn-icon-transform)}.accordion-button::after{flex-shrink:0;width:var(--bs-accordion-btn-icon-width);height:var(--bs-accordion-btn-icon-width);margin-left:auto;content:"";background-image:var(--bs-accordion-btn-icon);background-repeat:no-repeat;background-size:var(--bs-accordion-btn-icon-width);transition:var(--bs-accordion-btn-icon-transition)}@media (prefers-reduced-motion:reduce){.accordion-button::after{transition:none}}.accordion-button:hover{z-index:2}.accordion-button:focus{z-index:3;border-color:var(--bs-accordion-btn-focus-border-color);outline:0;box-shadow:var(--bs-accordion-btn-focus-box-shadow)}.accordion-header{margin-bottom:0}.accordion-item{color:var(--bs-accordion-color);background-color:var(--bs-accordion-bg);border:var(--bs-accordion-border-width) solid var(--bs-accordion-border-color)}.accordion-item:first-of-type{border-top-left-radius:var(--bs-accordion-border-radius);border-top-right-radius:var(--bs-accordion-border-radius)}.accordion-item:first-of-type .accordion-button{border-top-left-radius:var(--bs-accordion-inner-border-radius);border-top-right-radius:var(--bs-accordion-inner-border-radius)}.accordion-item:not(:first-of-type){border-top:0}.accordion-item:last-of-type{border-bottom-right-radius:var(--bs-accordion-border-radius);border-bottom-left-radius:var(--bs-accordion-border-radius)}.accordion-item:last-of-type .accordion-button.collapsed{border-bottom-right-radius:var(--bs-accordion-inner-border-radius);border-bottom-left-radius:var(--bs-accordion-inner-border-radius)}.accordion-item:last-of-type .accordion-collapse{border-bottom-right-radius:var(--bs-accordion-border-radius);border-bottom-left-radius:var(--bs-accordion-border-radius)}.accordion-body{padding:var(--bs-accordion-body-padding-y) var(--bs-accordion-body-padding-x)}.accordion-flush .accordion-collapse{border-width:0}.accordion-flush .accordion-item{border-right:0;border-left:0;border-radius:0}.accordion-flush .accordion-item:first-child{border-top:0}.accordion-flush .accordion-item:last-child{border-bottom:0}.accordion-flush .accordion-item .accordion-button,.accordion-flush .accordion-item .accordion-button.collapsed{border-radius:0}.breadcrumb{--bs-breadcrumb-padding-x:0;--bs-breadcrumb-padding-y:0;--bs-breadcrumb-margin-bottom:1rem;--bs-breadcrumb-bg: ;--bs-breadcrumb-border-radius: ;--bs-breadcrumb-divider-color:#6c757d;--bs-breadcrumb-item-padding-x:0.5rem;--bs-breadcrumb-item-active-color:#6c757d;display:flex;flex-wrap:wrap;padding:var(--bs-breadcrumb-padding-y) var(--bs-breadcrumb-padding-x);margin-bottom:var(--bs-breadcrumb-margin-bottom);font-size:var(--bs-breadcrumb-font-size);list-style:none;background-color:var(--bs-breadcrumb-bg);border-radius:var(--bs-breadcrumb-border-radius)}.breadcrumb-item+.breadcrumb-item{padding-left:var(--bs-breadcrumb-item-padding-x)}.breadcrumb-item+.breadcrumb-item::before{float:left;padding-right:var(--bs-breadcrumb-item-padding-x);color:var(--bs-breadcrumb-divider-color);content:var(--bs-breadcrumb-divider, "/")}.breadcrumb-item.active{color:var(--bs-breadcrumb-item-active-color)}.pagination{--bs-pagination-padding-x:0.75rem;--bs-pagination-padding-y:0.375rem;--bs-pagination-font-size:1rem;--bs-pagination-color:var(--bs-link-color);--bs-pagination-bg:#fff;--bs-pagination-border-width:1px;--bs-pagination-border-color:#dee2e6;--bs-pagination-border-radius:0.375rem;--bs-pagination-hover-color:var(--bs-link-hover-color);--bs-pagination-hover-bg:#e9ecef;--bs-pagination-hover-border-color:#dee2e6;--bs-pagination-focus-color:var(--bs-link-hover-color);--bs-pagination-focus-bg:#e9ecef;--bs-pagination-focus-box-shadow:0 0 0 0.25rem rgba(13, 110, 253, 0.25);--bs-pagination-active-color:#fff;--bs-pagination-active-bg:#0d6efd;--bs-pagination-active-border-color:#0d6efd;--bs-pagination-disabled-color:#6c757d;--bs-pagination-disabled-bg:#fff;--bs-pagination-disabled-border-color:#dee2e6;display:flex;padding-left:0;list-style:none}.page-link{position:relative;display:block;padding:var(--bs-pagination-padding-y) var(--bs-pagination-padding-x);font-size:var(--bs-pagination-font-size);color:var(--bs-pagination-color);text-decoration:none;background-color:var(--bs-pagination-bg);border:var(--bs-pagination-border-width) solid var(--bs-pagination-border-color);transition:color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out}@media (prefers-reduced-motion:reduce){.page-link{transition:none}}.page-link:hover{z-index:2;color:var(--bs-pagination-hover-color);background-color:var(--bs-pagination-hover-bg);border-color:var(--bs-pagination-hover-border-color)}.page-link:focus{z-index:3;color:var(--bs-pagination-focus-color);background-color:var(--bs-pagination-focus-bg);outline:0;box-shadow:var(--bs-pagination-focus-box-shadow)}.active>.page-link,.page-link.active{z-index:3;color:var(--bs-pagination-active-color);background-color:var(--bs-pagination-active-bg);border-color:var(--bs-pagination-active-border-color)}.disabled>.page-link,.page-link.disabled{color:var(--bs-pagination-disabled-color);pointer-events:none;background-color:var(--bs-pagination-disabled-bg);border-color:var(--bs-pagination-disabled-border-color)}.page-item:not(:first-child) .page-link{margin-left:-1px}.page-item:first-child .page-link{border-top-left-radius:var(--bs-pagination-border-radius);border-bottom-left-radius:var(--bs-pagination-border-radius)}.page-item:last-child .page-link{border-top-right-radius:var(--bs-pagination-border-radius);border-bottom-right-radius:var(--bs-pagination-border-radius)}.pagination-lg{--bs-pagination-padding-x:1.5rem;--bs-pagination-padding-y:0.75rem;--bs-pagination-font-size:1.25rem;--bs-pagination-border-radius:0.5rem}.pagination-sm{--bs-pagination-padding-x:0.5rem;--bs-pagination-padding-y:0.25rem;--bs-pagination-font-size:0.875rem;--bs-pagination-border-radius:0.25rem}.badge{--bs-badge-padding-x:0.65em;--bs-badge-padding-y:0.35em;--bs-badge-font-size:0.75em;--bs-badge-font-weight:700;--bs-badge-color:#fff;--bs-badge-border-radius:0.375rem;display:inline-block;padding:var(--bs-badge-padding-y) var(--bs-badge-padding-x);font-size:var(--bs-badge-font-size);font-weight:var(--bs-badge-font-weight);line-height:1;color:var(--bs-badge-color);text-align:center;white-space:nowrap;vertical-align:baseline;border-radius:var(--bs-badge-border-radius)}.badge:empty{display:none}.btn .badge{position:relative;top:-1px}.alert{--bs-alert-bg:transparent;--bs-alert-padding-x:1rem;--bs-alert-padding-y:1rem;--bs-alert-margin-bottom:1rem;--bs-alert-color:inherit;--bs-alert-border-color:transparent;--bs-alert-border:1px solid var(--bs-alert-border-color);--bs-alert-border-radius:0.375rem;position:relative;padding:var(--bs-alert-padding-y) var(--bs-alert-padding-x);margin-bottom:var(--bs-alert-margin-bottom);color:var(--bs-alert-color);background-color:var(--bs-alert-bg);border:var(--bs-alert-border);border-radius:var(--bs-alert-border-radius)}.alert-heading{color:inherit}.alert-link{font-weight:700}.alert-dismissible{padding-right:3rem}.alert-dismissible .btn-close{position:absolute;top:0;right:0;z-index:2;padding:1.25rem 1rem}.alert-primary{--bs-alert-color:#084298;--bs-alert-bg:#cfe2ff;--bs-alert-border-color:#b6d4fe}.alert-primary .alert-link{color:#06357a}.alert-secondary{--bs-alert-color:#41464b;--bs-alert-bg:#e2e3e5;--bs-alert-border-color:#d3d6d8}.alert-secondary .alert-link{color:#34383c}.alert-success{--bs-alert-color:#0f5132;--bs-alert-bg:#d1e7dd;--bs-alert-border-color:#badbcc}.alert-success .alert-link{color:#0c4128}.alert-info{--bs-alert-color:#055160;--bs-alert-bg:#cff4fc;--bs-alert-border-color:#b6effb}.alert-info .alert-link{color:#04414d}.alert-warning{--bs-alert-color:#664d03;--bs-alert-bg:#fff3cd;--bs-alert-border-color:#ffecb5}.alert-warning .alert-link{color:#523e02}.alert-danger{--bs-alert-color:#842029;--bs-alert-bg:#f8d7da;--bs-alert-border-color:#f5c2c7}.alert-danger .alert-link{color:#6a1a21}.alert-light{--bs-alert-color:#636464;--bs-alert-bg:#fefefe;--bs-alert-border-color:#fdfdfe}.alert-light .alert-link{color:#4f5050}.alert-dark{--bs-alert-color:#141619;--bs-alert-bg:#d3d3d4;--bs-alert-border-color:#bcbebf}.alert-dark .alert-link{color:#101214}@keyframes progress-bar-stripes{0%{background-position-x:1rem}}.progress{--bs-progress-height:1rem;--bs-progress-font-size:0.75rem;--bs-progress-bg:#e9ecef;--bs-progress-border-radius:0.375rem;--bs-progress-box-shadow:inset 0 1px 2px rgba(0, 0, 0, 0.075);--bs-progress-bar-color:#fff;--bs-progress-bar-bg:#0d6efd;--bs-progress-bar-transition:width 0.6s ease;display:flex;height:var(--bs-progress-height);overflow:hidden;font-size:var(--bs-progress-font-size);background-color:var(--bs-progress-bg);border-radius:var(--bs-progress-border-radius)}.progress-bar{display:flex;flex-direction:column;justify-content:center;overflow:hidden;color:var(--bs-progress-bar-color);text-align:center;white-space:nowrap;background-color:var(--bs-progress-bar-bg);transition:var(--bs-progress-bar-transition)}@media (prefers-reduced-motion:reduce){.progress-bar{transition:none}}.progress-bar-striped{background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-size:var(--bs-progress-height) var(--bs-progress-height)}.progress-bar-animated{animation:1s linear infinite progress-bar-stripes}@media (prefers-reduced-motion:reduce){.progress-bar-animated{animation:none}}.list-group{--bs-list-group-color:#212529;--bs-list-group-bg:#fff;--bs-list-group-border-color:rgba(0, 0, 0, 0.125);--bs-list-group-border-width:1px;--bs-list-group-border-radius:0.375rem;--bs-list-group-item-padding-x:1rem;--bs-list-group-item-padding-y:0.5rem;--bs-list-group-action-color:#495057;--bs-list-group-action-hover-color:#495057;--bs-list-group-action-hover-bg:#f8f9fa;--bs-list-group-action-active-color:#212529;--bs-list-group-action-active-bg:#e9ecef;--bs-list-group-disabled-color:#6c757d;--bs-list-group-disabled-bg:#fff;--bs-list-group-active-color:#fff;--bs-list-group-active-bg:#0d6efd;--bs-list-group-active-border-color:#0d6efd;display:flex;flex-direction:column;padding-left:0;margin-bottom:0;border-radius:var(--bs-list-group-border-radius)}.list-group-numbered{list-style-type:none;counter-reset:section}.list-group-numbered>.list-group-item::before{content:counters(section, ".") ". ";counter-increment:section}.list-group-item-action{width:100%;color:var(--bs-list-group-action-color);text-align:inherit}.list-group-item-action:focus,.list-group-item-action:hover{z-index:1;color:var(--bs-list-group-action-hover-color);text-decoration:none;background-color:var(--bs-list-group-action-hover-bg)}.list-group-item-action:active{color:var(--bs-list-group-action-active-color);background-color:var(--bs-list-group-action-active-bg)}.list-group-item{position:relative;display:block;padding:var(--bs-list-group-item-padding-y) var(--bs-list-group-item-padding-x);color:var(--bs-list-group-color);text-decoration:none;background-color:var(--bs-list-group-bg);border:var(--bs-list-group-border-width) solid var(--bs-list-group-border-color)}.list-group-item:first-child{border-top-left-radius:inherit;border-top-right-radius:inherit}.list-group-item:last-child{border-bottom-right-radius:inherit;border-bottom-left-radius:inherit}.list-group-item.disabled,.list-group-item:disabled{color:var(--bs-list-group-disabled-color);pointer-events:none;background-color:var(--bs-list-group-disabled-bg)}.list-group-item.active{z-index:2;color:var(--bs-list-group-active-color);background-color:var(--bs-list-group-active-bg);border-color:var(--bs-list-group-active-border-color)}.list-group-item+.list-group-item{border-top-width:0}.list-group-item+.list-group-item.active{margin-top:calc(-1 * var(--bs-list-group-border-width));border-top-width:var(--bs-list-group-border-width)}.list-group-horizontal{flex-direction:row}.list-group-horizontal>.list-group-item:first-child:not(:last-child){border-bottom-left-radius:var(--bs-list-group-border-radius);border-top-right-radius:0}.list-group-horizontal>.list-group-item:last-child:not(:first-child){border-top-right-radius:var(--bs-list-group-border-radius);border-bottom-left-radius:0}.list-group-horizontal>.list-group-item.active{margin-top:0}.list-group-horizontal>.list-group-item+.list-group-item{border-top-width:var(--bs-list-group-border-width);border-left-width:0}.list-group-horizontal>.list-group-item+.list-group-item.active{margin-left:calc(-1 * var(--bs-list-group-border-width));border-left-width:var(--bs-list-group-border-width)}@media (min-width:576px){.list-group-horizontal-sm{flex-direction:row}.list-group-horizontal-sm>.list-group-item:first-child:not(:last-child){border-bottom-left-radius:var(--bs-list-group-border-radius);border-top-right-radius:0}.list-group-horizontal-sm>.list-group-item:last-child:not(:first-child){border-top-right-radius:var(--bs-list-group-border-radius);border-bottom-left-radius:0}.list-group-horizontal-sm>.list-group-item.active{margin-top:0}.list-group-horizontal-sm>.list-group-item+.list-group-item{border-top-width:var(--bs-list-group-border-width);border-left-width:0}.list-group-horizontal-sm>.list-group-item+.list-group-item.active{margin-left:calc(-1 * var(--bs-list-group-border-width));border-left-width:var(--bs-list-group-border-width)}}@media (min-width:768px){.list-group-horizontal-md{flex-direction:row}.list-group-horizontal-md>.list-group-item:first-child:not(:last-child){border-bottom-left-radius:var(--bs-list-group-border-radius);border-top-right-radius:0}.list-group-horizontal-md>.list-group-item:last-child:not(:first-child){border-top-right-radius:var(--bs-list-group-border-radius);border-bottom-left-radius:0}.list-group-horizontal-md>.list-group-item.active{margin-top:0}.list-group-horizontal-md>.list-group-item+.list-group-item{border-top-width:var(--bs-list-group-border-width);border-left-width:0}.list-group-horizontal-md>.list-group-item+.list-group-item.active{margin-left:calc(-1 * var(--bs-list-group-border-width));border-left-width:var(--bs-list-group-border-width)}}@media (min-width:992px){.list-group-horizontal-lg{flex-direction:row}.list-group-horizontal-lg>.list-group-item:first-child:not(:last-child){border-bottom-left-radius:var(--bs-list-group-border-radius);border-top-right-radius:0}.list-group-horizontal-lg>.list-group-item:last-child:not(:first-child){border-top-right-radius:var(--bs-list-group-border-radius);border-bottom-left-radius:0}.list-group-horizontal-lg>.list-group-item.active{margin-top:0}.list-group-horizontal-lg>.list-group-item+.list-group-item{border-top-width:var(--bs-list-group-border-width);border-left-width:0}.list-group-horizontal-lg>.list-group-item+.list-group-item.active{margin-left:calc(-1 * var(--bs-list-group-border-width));border-left-width:var(--bs-list-group-border-width)}}@media (min-width:1200px){.list-group-horizontal-xl{flex-direction:row}.list-group-horizontal-xl>.list-group-item:first-child:not(:last-child){border-bottom-left-radius:var(--bs-list-group-border-radius);border-top-right-radius:0}.list-group-horizontal-xl>.list-group-item:last-child:not(:first-child){border-top-right-radius:var(--bs-list-group-border-radius);border-bottom-left-radius:0}.list-group-horizontal-xl>.list-group-item.active{margin-top:0}.list-group-horizontal-xl>.list-group-item+.list-group-item{border-top-width:var(--bs-list-group-border-width);border-left-width:0}.list-group-horizontal-xl>.list-group-item+.list-group-item.active{margin-left:calc(-1 * var(--bs-list-group-border-width));border-left-width:var(--bs-list-group-border-width)}}@media (min-width:1400px){.list-group-horizontal-xxl{flex-direction:row}.list-group-horizontal-xxl>.list-group-item:first-child:not(:last-child){border-bottom-left-radius:var(--bs-list-group-border-radius);border-top-right-radius:0}.list-group-horizontal-xxl>.list-group-item:last-child:not(:first-child){border-top-right-radius:var(--bs-list-group-border-radius);border-bottom-left-radius:0}.list-group-horizontal-xxl>.list-group-item.active{margin-top:0}.list-group-horizontal-xxl>.list-group-item+.list-group-item{border-top-width:var(--bs-list-group-border-width);border-left-width:0}.list-group-horizontal-xxl>.list-group-item+.list-group-item.active{margin-left:calc(-1 * var(--bs-list-group-border-width));border-left-width:var(--bs-list-group-border-width)}}.list-group-flush{border-radius:0}.list-group-flush>.list-group-item{border-width:0 0 var(--bs-list-group-border-width)}.list-group-flush>.list-group-item:last-child{border-bottom-width:0}.list-group-item-primary{color:#084298;background-color:#cfe2ff}.list-group-item-primary.list-group-item-action:focus,.list-group-item-primary.list-group-item-action:hover{color:#084298;background-color:#bacbe6}.list-group-item-primary.list-group-item-action.active{color:#fff;background-color:#084298;border-color:#084298}.list-group-item-secondary{color:#41464b;background-color:#e2e3e5}.list-group-item-secondary.list-group-item-action:focus,.list-group-item-secondary.list-group-item-action:hover{color:#41464b;background-color:#cbccce}.list-group-item-secondary.list-group-item-action.active{color:#fff;background-color:#41464b;border-color:#41464b}.list-group-item-success{color:#0f5132;background-color:#d1e7dd}.list-group-item-success.list-group-item-action:focus,.list-group-item-success.list-group-item-action:hover{color:#0f5132;background-color:#bcd0c7}.list-group-item-success.list-group-item-action.active{color:#fff;background-color:#0f5132;border-color:#0f5132}.list-group-item-info{color:#055160;background-color:#cff4fc}.list-group-item-info.list-group-item-action:focus,.list-group-item-info.list-group-item-action:hover{color:#055160;background-color:#badce3}.list-group-item-info.list-group-item-action.active{color:#fff;background-color:#055160;border-color:#055160}.list-group-item-warning{color:#664d03;background-color:#fff3cd}.list-group-item-warning.list-group-item-action:focus,.list-group-item-warning.list-group-item-action:hover{color:#664d03;background-color:#e6dbb9}.list-group-item-warning.list-group-item-action.active{color:#fff;background-color:#664d03;border-color:#664d03}.list-group-item-danger{color:#842029;background-color:#f8d7da}.list-group-item-danger.list-group-item-action:focus,.list-group-item-danger.list-group-item-action:hover{color:#842029;background-color:#dfc2c4}.list-group-item-danger.list-group-item-action.active{color:#fff;background-color:#842029;border-color:#842029}.list-group-item-light{color:#636464;background-color:#fefefe}.list-group-item-light.list-group-item-action:focus,.list-group-item-light.list-group-item-action:hover{color:#636464;background-color:#e5e5e5}.list-group-item-light.list-group-item-action.active{color:#fff;background-color:#636464;border-color:#636464}.list-group-item-dark{color:#141619;background-color:#d3d3d4}.list-group-item-dark.list-group-item-action:focus,.list-group-item-dark.list-group-item-action:hover{color:#141619;background-color:#bebebf}.list-group-item-dark.list-group-item-action.active{color:#fff;background-color:#141619;border-color:#141619}.btn-close{box-sizing:content-box;width:1em;height:1em;padding:.25em .25em;color:#000;background:transparent url(${N}) center/1em auto no-repeat;border:0;border-radius:.375rem;opacity:.5}.btn-close:hover{color:#000;text-decoration:none;opacity:.75}.btn-close:focus{outline:0;box-shadow:0 0 0 .25rem rgba(13,110,253,.25);opacity:1}.btn-close.disabled,.btn-close:disabled{pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;opacity:.25}.btn-close-white{filter:invert(1) grayscale(100%) brightness(200%)}.toast{--bs-toast-zindex:1090;--bs-toast-padding-x:0.75rem;--bs-toast-padding-y:0.5rem;--bs-toast-spacing:1.5rem;--bs-toast-max-width:350px;--bs-toast-font-size:0.875rem;--bs-toast-color: ;--bs-toast-bg:rgba(255, 255, 255, 0.85);--bs-toast-border-width:1px;--bs-toast-border-color:var(--bs-border-color-translucent);--bs-toast-border-radius:0.375rem;--bs-toast-box-shadow:0 0.5rem 1rem rgba(0, 0, 0, 0.15);--bs-toast-header-color:#6c757d;--bs-toast-header-bg:rgba(255, 255, 255, 0.85);--bs-toast-header-border-color:rgba(0, 0, 0, 0.05);width:var(--bs-toast-max-width);max-width:100%;font-size:var(--bs-toast-font-size);color:var(--bs-toast-color);pointer-events:auto;background-color:var(--bs-toast-bg);background-clip:padding-box;border:var(--bs-toast-border-width) solid var(--bs-toast-border-color);box-shadow:var(--bs-toast-box-shadow);border-radius:var(--bs-toast-border-radius)}.toast.showing{opacity:0}.toast:not(.show){display:none}.toast-container{--bs-toast-zindex:1090;position:absolute;z-index:var(--bs-toast-zindex);width:-webkit-max-content;width:-moz-max-content;width:max-content;max-width:100%;pointer-events:none}.toast-container>:not(:last-child){margin-bottom:var(--bs-toast-spacing)}.toast-header{display:flex;align-items:center;padding:var(--bs-toast-padding-y) var(--bs-toast-padding-x);color:var(--bs-toast-header-color);background-color:var(--bs-toast-header-bg);background-clip:padding-box;border-bottom:var(--bs-toast-border-width) solid var(--bs-toast-header-border-color);border-top-left-radius:calc(var(--bs-toast-border-radius) - var(--bs-toast-border-width));border-top-right-radius:calc(var(--bs-toast-border-radius) - var(--bs-toast-border-width))}.toast-header .btn-close{margin-right:calc(-.5 * var(--bs-toast-padding-x));margin-left:var(--bs-toast-padding-x)}.toast-body{padding:var(--bs-toast-padding-x);word-wrap:break-word}.modal{--bs-modal-zindex:1055;--bs-modal-width:500px;--bs-modal-padding:1rem;--bs-modal-margin:0.5rem;--bs-modal-color: ;--bs-modal-bg:#fff;--bs-modal-border-color:var(--bs-border-color-translucent);--bs-modal-border-width:1px;--bs-modal-border-radius:0.5rem;--bs-modal-box-shadow:0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);--bs-modal-inner-border-radius:calc(0.5rem - 1px);--bs-modal-header-padding-x:1rem;--bs-modal-header-padding-y:1rem;--bs-modal-header-padding:1rem 1rem;--bs-modal-header-border-color:var(--bs-border-color);--bs-modal-header-border-width:1px;--bs-modal-title-line-height:1.5;--bs-modal-footer-gap:0.5rem;--bs-modal-footer-bg: ;--bs-modal-footer-border-color:var(--bs-border-color);--bs-modal-footer-border-width:1px;position:fixed;top:0;left:0;z-index:var(--bs-modal-zindex);display:none;width:100%;height:100%;overflow-x:hidden;overflow-y:auto;outline:0}.modal-dialog{position:relative;width:auto;margin:var(--bs-modal-margin);pointer-events:none}.modal.fade .modal-dialog{transition:transform .3s ease-out;transform:translate(0,-50px)}@media (prefers-reduced-motion:reduce){.modal.fade .modal-dialog{transition:none}}.modal.show .modal-dialog{transform:none}.modal.modal-static .modal-dialog{transform:scale(1.02)}.modal-dialog-scrollable{height:calc(100% - var(--bs-modal-margin) * 2)}.modal-dialog-scrollable .modal-content{max-height:100%;overflow:hidden}.modal-dialog-scrollable .modal-body{overflow-y:auto}.modal-dialog-centered{display:flex;align-items:center;min-height:calc(100% - var(--bs-modal-margin) * 2)}.modal-content{position:relative;display:flex;flex-direction:column;width:100%;color:var(--bs-modal-color);pointer-events:auto;background-color:var(--bs-modal-bg);background-clip:padding-box;border:var(--bs-modal-border-width) solid var(--bs-modal-border-color);border-radius:var(--bs-modal-border-radius);outline:0}.modal-backdrop{--bs-backdrop-zindex:1050;--bs-backdrop-bg:#000;--bs-backdrop-opacity:0.5;position:fixed;top:0;left:0;z-index:var(--bs-backdrop-zindex);width:100vw;height:100vh;background-color:var(--bs-backdrop-bg)}.modal-backdrop.fade{opacity:0}.modal-backdrop.show{opacity:var(--bs-backdrop-opacity)}.modal-header{display:flex;flex-shrink:0;align-items:center;justify-content:space-between;padding:var(--bs-modal-header-padding);border-bottom:var(--bs-modal-header-border-width) solid var(--bs-modal-header-border-color);border-top-left-radius:var(--bs-modal-inner-border-radius);border-top-right-radius:var(--bs-modal-inner-border-radius)}.modal-header .btn-close{padding:calc(var(--bs-modal-header-padding-y) * .5) calc(var(--bs-modal-header-padding-x) * .5);margin:calc(-.5 * var(--bs-modal-header-padding-y)) calc(-.5 * var(--bs-modal-header-padding-x)) calc(-.5 * var(--bs-modal-header-padding-y)) auto}.modal-title{margin-bottom:0;line-height:var(--bs-modal-title-line-height)}.modal-body{position:relative;flex:1 1 auto;padding:var(--bs-modal-padding)}.modal-footer{display:flex;flex-shrink:0;flex-wrap:wrap;align-items:center;justify-content:flex-end;padding:calc(var(--bs-modal-padding) - var(--bs-modal-footer-gap) * .5);background-color:var(--bs-modal-footer-bg);border-top:var(--bs-modal-footer-border-width) solid var(--bs-modal-footer-border-color);border-bottom-right-radius:var(--bs-modal-inner-border-radius);border-bottom-left-radius:var(--bs-modal-inner-border-radius)}.modal-footer>*{margin:calc(var(--bs-modal-footer-gap) * .5)}@media (min-width:576px){.modal{--bs-modal-margin:1.75rem;--bs-modal-box-shadow:0 0.5rem 1rem rgba(0, 0, 0, 0.15)}.modal-dialog{max-width:var(--bs-modal-width);margin-right:auto;margin-left:auto}.modal-sm{--bs-modal-width:300px}}@media (min-width:992px){.modal-lg,.modal-xl{--bs-modal-width:800px}}@media (min-width:1200px){.modal-xl{--bs-modal-width:1140px}}.modal-fullscreen{width:100vw;max-width:none;height:100%;margin:0}.modal-fullscreen .modal-content{height:100%;border:0;border-radius:0}.modal-fullscreen .modal-footer,.modal-fullscreen .modal-header{border-radius:0}.modal-fullscreen .modal-body{overflow-y:auto}@media (max-width:575.98px){.modal-fullscreen-sm-down{width:100vw;max-width:none;height:100%;margin:0}.modal-fullscreen-sm-down .modal-content{height:100%;border:0;border-radius:0}.modal-fullscreen-sm-down .modal-footer,.modal-fullscreen-sm-down .modal-header{border-radius:0}.modal-fullscreen-sm-down .modal-body{overflow-y:auto}}@media (max-width:767.98px){.modal-fullscreen-md-down{width:100vw;max-width:none;height:100%;margin:0}.modal-fullscreen-md-down .modal-content{height:100%;border:0;border-radius:0}.modal-fullscreen-md-down .modal-footer,.modal-fullscreen-md-down .modal-header{border-radius:0}.modal-fullscreen-md-down .modal-body{overflow-y:auto}}@media (max-width:991.98px){.modal-fullscreen-lg-down{width:100vw;max-width:none;height:100%;margin:0}.modal-fullscreen-lg-down .modal-content{height:100%;border:0;border-radius:0}.modal-fullscreen-lg-down .modal-footer,.modal-fullscreen-lg-down .modal-header{border-radius:0}.modal-fullscreen-lg-down .modal-body{overflow-y:auto}}@media (max-width:1199.98px){.modal-fullscreen-xl-down{width:100vw;max-width:none;height:100%;margin:0}.modal-fullscreen-xl-down .modal-content{height:100%;border:0;border-radius:0}.modal-fullscreen-xl-down .modal-footer,.modal-fullscreen-xl-down .modal-header{border-radius:0}.modal-fullscreen-xl-down .modal-body{overflow-y:auto}}@media (max-width:1399.98px){.modal-fullscreen-xxl-down{width:100vw;max-width:none;height:100%;margin:0}.modal-fullscreen-xxl-down .modal-content{height:100%;border:0;border-radius:0}.modal-fullscreen-xxl-down .modal-footer,.modal-fullscreen-xxl-down .modal-header{border-radius:0}.modal-fullscreen-xxl-down .modal-body{overflow-y:auto}}.tooltip{--bs-tooltip-zindex:1080;--bs-tooltip-max-width:200px;--bs-tooltip-padding-x:0.5rem;--bs-tooltip-padding-y:0.25rem;--bs-tooltip-margin: ;--bs-tooltip-font-size:0.875rem;--bs-tooltip-color:#fff;--bs-tooltip-bg:#000;--bs-tooltip-border-radius:0.375rem;--bs-tooltip-opacity:0.9;--bs-tooltip-arrow-width:0.8rem;--bs-tooltip-arrow-height:0.4rem;z-index:var(--bs-tooltip-zindex);display:block;padding:var(--bs-tooltip-arrow-height);margin:var(--bs-tooltip-margin);font-family:var(--bs-font-sans-serif);font-style:normal;font-weight:400;line-height:1.5;text-align:left;text-align:start;text-decoration:none;text-shadow:none;text-transform:none;letter-spacing:normal;word-break:normal;white-space:normal;word-spacing:normal;line-break:auto;font-size:var(--bs-tooltip-font-size);word-wrap:break-word;opacity:0}.tooltip.show{opacity:var(--bs-tooltip-opacity)}.tooltip .tooltip-arrow{display:block;width:var(--bs-tooltip-arrow-width);height:var(--bs-tooltip-arrow-height)}.tooltip .tooltip-arrow::before{position:absolute;content:"";border-color:transparent;border-style:solid}.bs-tooltip-auto[data-popper-placement^=top] .tooltip-arrow,.bs-tooltip-top .tooltip-arrow{bottom:0}.bs-tooltip-auto[data-popper-placement^=top] .tooltip-arrow::before,.bs-tooltip-top .tooltip-arrow::before{top:-1px;border-width:var(--bs-tooltip-arrow-height) calc(var(--bs-tooltip-arrow-width) * .5) 0;border-top-color:var(--bs-tooltip-bg)}.bs-tooltip-auto[data-popper-placement^=right] .tooltip-arrow,.bs-tooltip-end .tooltip-arrow{left:0;width:var(--bs-tooltip-arrow-height);height:var(--bs-tooltip-arrow-width)}.bs-tooltip-auto[data-popper-placement^=right] .tooltip-arrow::before,.bs-tooltip-end .tooltip-arrow::before{right:-1px;border-width:calc(var(--bs-tooltip-arrow-width) * .5) var(--bs-tooltip-arrow-height) calc(var(--bs-tooltip-arrow-width) * .5) 0;border-right-color:var(--bs-tooltip-bg)}.bs-tooltip-auto[data-popper-placement^=bottom] .tooltip-arrow,.bs-tooltip-bottom .tooltip-arrow{top:0}.bs-tooltip-auto[data-popper-placement^=bottom] .tooltip-arrow::before,.bs-tooltip-bottom .tooltip-arrow::before{bottom:-1px;border-width:0 calc(var(--bs-tooltip-arrow-width) * .5) var(--bs-tooltip-arrow-height);border-bottom-color:var(--bs-tooltip-bg)}.bs-tooltip-auto[data-popper-placement^=left] .tooltip-arrow,.bs-tooltip-start .tooltip-arrow{right:0;width:var(--bs-tooltip-arrow-height);height:var(--bs-tooltip-arrow-width)}.bs-tooltip-auto[data-popper-placement^=left] .tooltip-arrow::before,.bs-tooltip-start .tooltip-arrow::before{left:-1px;border-width:calc(var(--bs-tooltip-arrow-width) * .5) 0 calc(var(--bs-tooltip-arrow-width) * .5) var(--bs-tooltip-arrow-height);border-left-color:var(--bs-tooltip-bg)}.tooltip-inner{max-width:var(--bs-tooltip-max-width);padding:var(--bs-tooltip-padding-y) var(--bs-tooltip-padding-x);color:var(--bs-tooltip-color);text-align:center;background-color:var(--bs-tooltip-bg);border-radius:var(--bs-tooltip-border-radius)}.popover{--bs-popover-zindex:1070;--bs-popover-max-width:276px;--bs-popover-font-size:0.875rem;--bs-popover-bg:#fff;--bs-popover-border-width:1px;--bs-popover-border-color:var(--bs-border-color-translucent);--bs-popover-border-radius:0.5rem;--bs-popover-inner-border-radius:calc(0.5rem - 1px);--bs-popover-box-shadow:0 0.5rem 1rem rgba(0, 0, 0, 0.15);--bs-popover-header-padding-x:1rem;--bs-popover-header-padding-y:0.5rem;--bs-popover-header-font-size:1rem;--bs-popover-header-color: ;--bs-popover-header-bg:#f0f0f0;--bs-popover-body-padding-x:1rem;--bs-popover-body-padding-y:1rem;--bs-popover-body-color:#212529;--bs-popover-arrow-width:1rem;--bs-popover-arrow-height:0.5rem;--bs-popover-arrow-border:var(--bs-popover-border-color);z-index:var(--bs-popover-zindex);display:block;max-width:var(--bs-popover-max-width);font-family:var(--bs-font-sans-serif);font-style:normal;font-weight:400;line-height:1.5;text-align:left;text-align:start;text-decoration:none;text-shadow:none;text-transform:none;letter-spacing:normal;word-break:normal;white-space:normal;word-spacing:normal;line-break:auto;font-size:var(--bs-popover-font-size);word-wrap:break-word;background-color:var(--bs-popover-bg);background-clip:padding-box;border:var(--bs-popover-border-width) solid var(--bs-popover-border-color);border-radius:var(--bs-popover-border-radius)}.popover .popover-arrow{display:block;width:var(--bs-popover-arrow-width);height:var(--bs-popover-arrow-height)}.popover .popover-arrow::after,.popover .popover-arrow::before{position:absolute;display:block;content:"";border-color:transparent;border-style:solid;border-width:0}.bs-popover-auto[data-popper-placement^=top]>.popover-arrow,.bs-popover-top>.popover-arrow{bottom:calc(-1 * (var(--bs-popover-arrow-height)) - var(--bs-popover-border-width))}.bs-popover-auto[data-popper-placement^=top]>.popover-arrow::after,.bs-popover-auto[data-popper-placement^=top]>.popover-arrow::before,.bs-popover-top>.popover-arrow::after,.bs-popover-top>.popover-arrow::before{border-width:var(--bs-popover-arrow-height) calc(var(--bs-popover-arrow-width) * .5) 0}.bs-popover-auto[data-popper-placement^=top]>.popover-arrow::before,.bs-popover-top>.popover-arrow::before{bottom:0;border-top-color:var(--bs-popover-arrow-border)}.bs-popover-auto[data-popper-placement^=top]>.popover-arrow::after,.bs-popover-top>.popover-arrow::after{bottom:var(--bs-popover-border-width);border-top-color:var(--bs-popover-bg)}.bs-popover-auto[data-popper-placement^=right]>.popover-arrow,.bs-popover-end>.popover-arrow{left:calc(-1 * (var(--bs-popover-arrow-height)) - var(--bs-popover-border-width));width:var(--bs-popover-arrow-height);height:var(--bs-popover-arrow-width)}.bs-popover-auto[data-popper-placement^=right]>.popover-arrow::after,.bs-popover-auto[data-popper-placement^=right]>.popover-arrow::before,.bs-popover-end>.popover-arrow::after,.bs-popover-end>.popover-arrow::before{border-width:calc(var(--bs-popover-arrow-width) * .5) var(--bs-popover-arrow-height) calc(var(--bs-popover-arrow-width) * .5) 0}.bs-popover-auto[data-popper-placement^=right]>.popover-arrow::before,.bs-popover-end>.popover-arrow::before{left:0;border-right-color:var(--bs-popover-arrow-border)}.bs-popover-auto[data-popper-placement^=right]>.popover-arrow::after,.bs-popover-end>.popover-arrow::after{left:var(--bs-popover-border-width);border-right-color:var(--bs-popover-bg)}.bs-popover-auto[data-popper-placement^=bottom]>.popover-arrow,.bs-popover-bottom>.popover-arrow{top:calc(-1 * (var(--bs-popover-arrow-height)) - var(--bs-popover-border-width))}.bs-popover-auto[data-popper-placement^=bottom]>.popover-arrow::after,.bs-popover-auto[data-popper-placement^=bottom]>.popover-arrow::before,.bs-popover-bottom>.popover-arrow::after,.bs-popover-bottom>.popover-arrow::before{border-width:0 calc(var(--bs-popover-arrow-width) * .5) var(--bs-popover-arrow-height)}.bs-popover-auto[data-popper-placement^=bottom]>.popover-arrow::before,.bs-popover-bottom>.popover-arrow::before{top:0;border-bottom-color:var(--bs-popover-arrow-border)}.bs-popover-auto[data-popper-placement^=bottom]>.popover-arrow::after,.bs-popover-bottom>.popover-arrow::after{top:var(--bs-popover-border-width);border-bottom-color:var(--bs-popover-bg)}.bs-popover-auto[data-popper-placement^=bottom] .popover-header::before,.bs-popover-bottom .popover-header::before{position:absolute;top:0;left:50%;display:block;width:var(--bs-popover-arrow-width);margin-left:calc(-.5 * var(--bs-popover-arrow-width));content:"";border-bottom:var(--bs-popover-border-width) solid var(--bs-popover-header-bg)}.bs-popover-auto[data-popper-placement^=left]>.popover-arrow,.bs-popover-start>.popover-arrow{right:calc(-1 * (var(--bs-popover-arrow-height)) - var(--bs-popover-border-width));width:var(--bs-popover-arrow-height);height:var(--bs-popover-arrow-width)}.bs-popover-auto[data-popper-placement^=left]>.popover-arrow::after,.bs-popover-auto[data-popper-placement^=left]>.popover-arrow::before,.bs-popover-start>.popover-arrow::after,.bs-popover-start>.popover-arrow::before{border-width:calc(var(--bs-popover-arrow-width) * .5) 0 calc(var(--bs-popover-arrow-width) * .5) var(--bs-popover-arrow-height)}.bs-popover-auto[data-popper-placement^=left]>.popover-arrow::before,.bs-popover-start>.popover-arrow::before{right:0;border-left-color:var(--bs-popover-arrow-border)}.bs-popover-auto[data-popper-placement^=left]>.popover-arrow::after,.bs-popover-start>.popover-arrow::after{right:var(--bs-popover-border-width);border-left-color:var(--bs-popover-bg)}.popover-header{padding:var(--bs-popover-header-padding-y) var(--bs-popover-header-padding-x);margin-bottom:0;font-size:var(--bs-popover-header-font-size);color:var(--bs-popover-header-color);background-color:var(--bs-popover-header-bg);border-bottom:var(--bs-popover-border-width) solid var(--bs-popover-border-color);border-top-left-radius:var(--bs-popover-inner-border-radius);border-top-right-radius:var(--bs-popover-inner-border-radius)}.popover-header:empty{display:none}.popover-body{padding:var(--bs-popover-body-padding-y) var(--bs-popover-body-padding-x);color:var(--bs-popover-body-color)}.carousel{position:relative}.carousel.pointer-event{touch-action:pan-y}.carousel-inner{position:relative;width:100%;overflow:hidden}.carousel-inner::after{display:block;clear:both;content:""}.carousel-item{position:relative;display:none;float:left;width:100%;margin-right:-100%;-webkit-backface-visibility:hidden;backface-visibility:hidden;transition:transform .6s ease-in-out}@media (prefers-reduced-motion:reduce){.carousel-item{transition:none}}.carousel-item-next,.carousel-item-prev,.carousel-item.active{display:block}.active.carousel-item-end,.carousel-item-next:not(.carousel-item-start){transform:translateX(100%)}.active.carousel-item-start,.carousel-item-prev:not(.carousel-item-end){transform:translateX(-100%)}.carousel-fade .carousel-item{opacity:0;transition-property:opacity;transform:none}.carousel-fade .carousel-item-next.carousel-item-start,.carousel-fade .carousel-item-prev.carousel-item-end,.carousel-fade .carousel-item.active{z-index:1;opacity:1}.carousel-fade .active.carousel-item-end,.carousel-fade .active.carousel-item-start{z-index:0;opacity:0;transition:opacity 0s .6s}@media (prefers-reduced-motion:reduce){.carousel-fade .active.carousel-item-end,.carousel-fade .active.carousel-item-start{transition:none}}.carousel-control-next,.carousel-control-prev{position:absolute;top:0;bottom:0;z-index:1;display:flex;align-items:center;justify-content:center;width:15%;padding:0;color:#fff;text-align:center;background:0 0;border:0;opacity:.5;transition:opacity .15s ease}@media (prefers-reduced-motion:reduce){.carousel-control-next,.carousel-control-prev{transition:none}}.carousel-control-next:focus,.carousel-control-next:hover,.carousel-control-prev:focus,.carousel-control-prev:hover{color:#fff;text-decoration:none;outline:0;opacity:.9}.carousel-control-prev{left:0}.carousel-control-next{right:0}.carousel-control-next-icon,.carousel-control-prev-icon{display:inline-block;width:2rem;height:2rem;background-repeat:no-repeat;background-position:50%;background-size:100% 100%}.carousel-control-prev-icon{background-image:url(${B})}.carousel-control-next-icon{background-image:url(${U})}.carousel-indicators{position:absolute;right:0;bottom:0;left:0;z-index:2;display:flex;justify-content:center;padding:0;margin-right:15%;margin-bottom:1rem;margin-left:15%;list-style:none}.carousel-indicators [data-bs-target]{box-sizing:content-box;flex:0 1 auto;width:30px;height:3px;padding:0;margin-right:3px;margin-left:3px;text-indent:-999px;cursor:pointer;background-color:#fff;background-clip:padding-box;border:0;border-top:10px solid transparent;border-bottom:10px solid transparent;opacity:.5;transition:opacity .6s ease}@media (prefers-reduced-motion:reduce){.carousel-indicators [data-bs-target]{transition:none}}.carousel-indicators .active{opacity:1}.carousel-caption{position:absolute;right:15%;bottom:1.25rem;left:15%;padding-top:1.25rem;padding-bottom:1.25rem;color:#fff;text-align:center}.carousel-dark .carousel-control-next-icon,.carousel-dark .carousel-control-prev-icon{filter:invert(1) grayscale(100)}.carousel-dark .carousel-indicators [data-bs-target]{background-color:#000}.carousel-dark .carousel-caption{color:#000}.spinner-border,.spinner-grow{display:inline-block;width:var(--bs-spinner-width);height:var(--bs-spinner-height);vertical-align:var(--bs-spinner-vertical-align);border-radius:50%;animation:var(--bs-spinner-animation-speed) linear infinite var(--bs-spinner-animation-name)}@keyframes spinner-border{to{transform:rotate(360deg)}}.spinner-border{--bs-spinner-width:2rem;--bs-spinner-height:2rem;--bs-spinner-vertical-align:-0.125em;--bs-spinner-border-width:0.25em;--bs-spinner-animation-speed:0.75s;--bs-spinner-animation-name:spinner-border;border:var(--bs-spinner-border-width) solid currentcolor;border-right-color:transparent}.spinner-border-sm{--bs-spinner-width:1rem;--bs-spinner-height:1rem;--bs-spinner-border-width:0.2em}@keyframes spinner-grow{0%{transform:scale(0)}50%{opacity:1;transform:none}}.spinner-grow{--bs-spinner-width:2rem;--bs-spinner-height:2rem;--bs-spinner-vertical-align:-0.125em;--bs-spinner-animation-speed:0.75s;--bs-spinner-animation-name:spinner-grow;background-color:currentcolor;opacity:0}.spinner-grow-sm{--bs-spinner-width:1rem;--bs-spinner-height:1rem}@media (prefers-reduced-motion:reduce){.spinner-border,.spinner-grow{--bs-spinner-animation-speed:1.5s}}.offcanvas,.offcanvas-lg,.offcanvas-md,.offcanvas-sm,.offcanvas-xl,.offcanvas-xxl{--bs-offcanvas-zindex:1045;--bs-offcanvas-width:400px;--bs-offcanvas-height:30vh;--bs-offcanvas-padding-x:1rem;--bs-offcanvas-padding-y:1rem;--bs-offcanvas-color: ;--bs-offcanvas-bg:#fff;--bs-offcanvas-border-width:1px;--bs-offcanvas-border-color:var(--bs-border-color-translucent);--bs-offcanvas-box-shadow:0 0.125rem 0.25rem rgba(0, 0, 0, 0.075)}@media (max-width:575.98px){.offcanvas-sm{position:fixed;bottom:0;z-index:var(--bs-offcanvas-zindex);display:flex;flex-direction:column;max-width:100%;color:var(--bs-offcanvas-color);visibility:hidden;background-color:var(--bs-offcanvas-bg);background-clip:padding-box;outline:0;transition:transform .3s ease-in-out}}@media (max-width:575.98px) and (prefers-reduced-motion:reduce){.offcanvas-sm{transition:none}}@media (max-width:575.98px){.offcanvas-sm.offcanvas-start{top:0;left:0;width:var(--bs-offcanvas-width);border-right:var(--bs-offcanvas-border-width) solid var(--bs-offcanvas-border-color);transform:translateX(-100%)}}@media (max-width:575.98px){.offcanvas-sm.offcanvas-end{top:0;right:0;width:var(--bs-offcanvas-width);border-left:var(--bs-offcanvas-border-width) solid var(--bs-offcanvas-border-color);transform:translateX(100%)}}@media (max-width:575.98px){.offcanvas-sm.offcanvas-top{top:0;right:0;left:0;height:var(--bs-offcanvas-height);max-height:100%;border-bottom:var(--bs-offcanvas-border-width) solid var(--bs-offcanvas-border-color);transform:translateY(-100%)}}@media (max-width:575.98px){.offcanvas-sm.offcanvas-bottom{right:0;left:0;height:var(--bs-offcanvas-height);max-height:100%;border-top:var(--bs-offcanvas-border-width) solid var(--bs-offcanvas-border-color);transform:translateY(100%)}}@media (max-width:575.98px){.offcanvas-sm.show:not(.hiding),.offcanvas-sm.showing{transform:none}}@media (max-width:575.98px){.offcanvas-sm.hiding,.offcanvas-sm.show,.offcanvas-sm.showing{visibility:visible}}@media (min-width:576px){.offcanvas-sm{--bs-offcanvas-height:auto;--bs-offcanvas-border-width:0;background-color:transparent!important}.offcanvas-sm .offcanvas-header{display:none}.offcanvas-sm .offcanvas-body{display:flex;flex-grow:0;padding:0;overflow-y:visible;background-color:transparent!important}}@media (max-width:767.98px){.offcanvas-md{position:fixed;bottom:0;z-index:var(--bs-offcanvas-zindex);display:flex;flex-direction:column;max-width:100%;color:var(--bs-offcanvas-color);visibility:hidden;background-color:var(--bs-offcanvas-bg);background-clip:padding-box;outline:0;transition:transform .3s ease-in-out}}@media (max-width:767.98px) and (prefers-reduced-motion:reduce){.offcanvas-md{transition:none}}@media (max-width:767.98px){.offcanvas-md.offcanvas-start{top:0;left:0;width:var(--bs-offcanvas-width);border-right:var(--bs-offcanvas-border-width) solid var(--bs-offcanvas-border-color);transform:translateX(-100%)}}@media (max-width:767.98px){.offcanvas-md.offcanvas-end{top:0;right:0;width:var(--bs-offcanvas-width);border-left:var(--bs-offcanvas-border-width) solid var(--bs-offcanvas-border-color);transform:translateX(100%)}}@media (max-width:767.98px){.offcanvas-md.offcanvas-top{top:0;right:0;left:0;height:var(--bs-offcanvas-height);max-height:100%;border-bottom:var(--bs-offcanvas-border-width) solid var(--bs-offcanvas-border-color);transform:translateY(-100%)}}@media (max-width:767.98px){.offcanvas-md.offcanvas-bottom{right:0;left:0;height:var(--bs-offcanvas-height);max-height:100%;border-top:var(--bs-offcanvas-border-width) solid var(--bs-offcanvas-border-color);transform:translateY(100%)}}@media (max-width:767.98px){.offcanvas-md.show:not(.hiding),.offcanvas-md.showing{transform:none}}@media (max-width:767.98px){.offcanvas-md.hiding,.offcanvas-md.show,.offcanvas-md.showing{visibility:visible}}@media (min-width:768px){.offcanvas-md{--bs-offcanvas-height:auto;--bs-offcanvas-border-width:0;background-color:transparent!important}.offcanvas-md .offcanvas-header{display:none}.offcanvas-md .offcanvas-body{display:flex;flex-grow:0;padding:0;overflow-y:visible;background-color:transparent!important}}@media (max-width:991.98px){.offcanvas-lg{position:fixed;bottom:0;z-index:var(--bs-offcanvas-zindex);display:flex;flex-direction:column;max-width:100%;color:var(--bs-offcanvas-color);visibility:hidden;background-color:var(--bs-offcanvas-bg);background-clip:padding-box;outline:0;transition:transform .3s ease-in-out}}@media (max-width:991.98px) and (prefers-reduced-motion:reduce){.offcanvas-lg{transition:none}}@media (max-width:991.98px){.offcanvas-lg.offcanvas-start{top:0;left:0;width:var(--bs-offcanvas-width);border-right:var(--bs-offcanvas-border-width) solid var(--bs-offcanvas-border-color);transform:translateX(-100%)}}@media (max-width:991.98px){.offcanvas-lg.offcanvas-end{top:0;right:0;width:var(--bs-offcanvas-width);border-left:var(--bs-offcanvas-border-width) solid var(--bs-offcanvas-border-color);transform:translateX(100%)}}@media (max-width:991.98px){.offcanvas-lg.offcanvas-top{top:0;right:0;left:0;height:var(--bs-offcanvas-height);max-height:100%;border-bottom:var(--bs-offcanvas-border-width) solid var(--bs-offcanvas-border-color);transform:translateY(-100%)}}@media (max-width:991.98px){.offcanvas-lg.offcanvas-bottom{right:0;left:0;height:var(--bs-offcanvas-height);max-height:100%;border-top:var(--bs-offcanvas-border-width) solid var(--bs-offcanvas-border-color);transform:translateY(100%)}}@media (max-width:991.98px){.offcanvas-lg.show:not(.hiding),.offcanvas-lg.showing{transform:none}}@media (max-width:991.98px){.offcanvas-lg.hiding,.offcanvas-lg.show,.offcanvas-lg.showing{visibility:visible}}@media (min-width:992px){.offcanvas-lg{--bs-offcanvas-height:auto;--bs-offcanvas-border-width:0;background-color:transparent!important}.offcanvas-lg .offcanvas-header{display:none}.offcanvas-lg .offcanvas-body{display:flex;flex-grow:0;padding:0;overflow-y:visible;background-color:transparent!important}}@media (max-width:1199.98px){.offcanvas-xl{position:fixed;bottom:0;z-index:var(--bs-offcanvas-zindex);display:flex;flex-direction:column;max-width:100%;color:var(--bs-offcanvas-color);visibility:hidden;background-color:var(--bs-offcanvas-bg);background-clip:padding-box;outline:0;transition:transform .3s ease-in-out}}@media (max-width:1199.98px) and (prefers-reduced-motion:reduce){.offcanvas-xl{transition:none}}@media (max-width:1199.98px){.offcanvas-xl.offcanvas-start{top:0;left:0;width:var(--bs-offcanvas-width);border-right:var(--bs-offcanvas-border-width) solid var(--bs-offcanvas-border-color);transform:translateX(-100%)}}@media (max-width:1199.98px){.offcanvas-xl.offcanvas-end{top:0;right:0;width:var(--bs-offcanvas-width);border-left:var(--bs-offcanvas-border-width) solid var(--bs-offcanvas-border-color);transform:translateX(100%)}}@media (max-width:1199.98px){.offcanvas-xl.offcanvas-top{top:0;right:0;left:0;height:var(--bs-offcanvas-height);max-height:100%;border-bottom:var(--bs-offcanvas-border-width) solid var(--bs-offcanvas-border-color);transform:translateY(-100%)}}@media (max-width:1199.98px){.offcanvas-xl.offcanvas-bottom{right:0;left:0;height:var(--bs-offcanvas-height);max-height:100%;border-top:var(--bs-offcanvas-border-width) solid var(--bs-offcanvas-border-color);transform:translateY(100%)}}@media (max-width:1199.98px){.offcanvas-xl.show:not(.hiding),.offcanvas-xl.showing{transform:none}}@media (max-width:1199.98px){.offcanvas-xl.hiding,.offcanvas-xl.show,.offcanvas-xl.showing{visibility:visible}}@media (min-width:1200px){.offcanvas-xl{--bs-offcanvas-height:auto;--bs-offcanvas-border-width:0;background-color:transparent!important}.offcanvas-xl .offcanvas-header{display:none}.offcanvas-xl .offcanvas-body{display:flex;flex-grow:0;padding:0;overflow-y:visible;background-color:transparent!important}}@media (max-width:1399.98px){.offcanvas-xxl{position:fixed;bottom:0;z-index:var(--bs-offcanvas-zindex);display:flex;flex-direction:column;max-width:100%;color:var(--bs-offcanvas-color);visibility:hidden;background-color:var(--bs-offcanvas-bg);background-clip:padding-box;outline:0;transition:transform .3s ease-in-out}}@media (max-width:1399.98px) and (prefers-reduced-motion:reduce){.offcanvas-xxl{transition:none}}@media (max-width:1399.98px){.offcanvas-xxl.offcanvas-start{top:0;left:0;width:var(--bs-offcanvas-width);border-right:var(--bs-offcanvas-border-width) solid var(--bs-offcanvas-border-color);transform:translateX(-100%)}}@media (max-width:1399.98px){.offcanvas-xxl.offcanvas-end{top:0;right:0;width:var(--bs-offcanvas-width);border-left:var(--bs-offcanvas-border-width) solid var(--bs-offcanvas-border-color);transform:translateX(100%)}}@media (max-width:1399.98px){.offcanvas-xxl.offcanvas-top{top:0;right:0;left:0;height:var(--bs-offcanvas-height);max-height:100%;border-bottom:var(--bs-offcanvas-border-width) solid var(--bs-offcanvas-border-color);transform:translateY(-100%)}}@media (max-width:1399.98px){.offcanvas-xxl.offcanvas-bottom{right:0;left:0;height:var(--bs-offcanvas-height);max-height:100%;border-top:var(--bs-offcanvas-border-width) solid var(--bs-offcanvas-border-color);transform:translateY(100%)}}@media (max-width:1399.98px){.offcanvas-xxl.show:not(.hiding),.offcanvas-xxl.showing{transform:none}}@media (max-width:1399.98px){.offcanvas-xxl.hiding,.offcanvas-xxl.show,.offcanvas-xxl.showing{visibility:visible}}@media (min-width:1400px){.offcanvas-xxl{--bs-offcanvas-height:auto;--bs-offcanvas-border-width:0;background-color:transparent!important}.offcanvas-xxl .offcanvas-header{display:none}.offcanvas-xxl .offcanvas-body{display:flex;flex-grow:0;padding:0;overflow-y:visible;background-color:transparent!important}}.offcanvas{position:fixed;bottom:0;z-index:var(--bs-offcanvas-zindex);display:flex;flex-direction:column;max-width:100%;color:var(--bs-offcanvas-color);visibility:hidden;background-color:var(--bs-offcanvas-bg);background-clip:padding-box;outline:0;transition:transform .3s ease-in-out}@media (prefers-reduced-motion:reduce){.offcanvas{transition:none}}.offcanvas.offcanvas-start{top:0;left:0;width:var(--bs-offcanvas-width);border-right:var(--bs-offcanvas-border-width) solid var(--bs-offcanvas-border-color);transform:translateX(-100%)}.offcanvas.offcanvas-end{top:0;right:0;width:var(--bs-offcanvas-width);border-left:var(--bs-offcanvas-border-width) solid var(--bs-offcanvas-border-color);transform:translateX(100%)}.offcanvas.offcanvas-top{top:0;right:0;left:0;height:var(--bs-offcanvas-height);max-height:100%;border-bottom:var(--bs-offcanvas-border-width) solid var(--bs-offcanvas-border-color);transform:translateY(-100%)}.offcanvas.offcanvas-bottom{right:0;left:0;height:var(--bs-offcanvas-height);max-height:100%;border-top:var(--bs-offcanvas-border-width) solid var(--bs-offcanvas-border-color);transform:translateY(100%)}.offcanvas.show:not(.hiding),.offcanvas.showing{transform:none}.offcanvas.hiding,.offcanvas.show,.offcanvas.showing{visibility:visible}.offcanvas-backdrop{position:fixed;top:0;left:0;z-index:1040;width:100vw;height:100vh;background-color:#000}.offcanvas-backdrop.fade{opacity:0}.offcanvas-backdrop.show{opacity:.5}.offcanvas-header{display:flex;align-items:center;justify-content:space-between;padding:var(--bs-offcanvas-padding-y) var(--bs-offcanvas-padding-x)}.offcanvas-header .btn-close{padding:calc(var(--bs-offcanvas-padding-y) * .5) calc(var(--bs-offcanvas-padding-x) * .5);margin-top:calc(-.5 * var(--bs-offcanvas-padding-y));margin-right:calc(-.5 * var(--bs-offcanvas-padding-x));margin-bottom:calc(-.5 * var(--bs-offcanvas-padding-y))}.offcanvas-title{margin-bottom:0;line-height:1.5}.offcanvas-body{flex-grow:1;padding:var(--bs-offcanvas-padding-y) var(--bs-offcanvas-padding-x);overflow-y:auto}.placeholder{display:inline-block;min-height:1em;vertical-align:middle;cursor:wait;background-color:currentcolor;opacity:.5}.placeholder.btn::before{display:inline-block;content:""}.placeholder-xs{min-height:.6em}.placeholder-sm{min-height:.8em}.placeholder-lg{min-height:1.2em}.placeholder-glow .placeholder{animation:placeholder-glow 2s ease-in-out infinite}@keyframes placeholder-glow{50%{opacity:.2}}.placeholder-wave{-webkit-mask-image:linear-gradient(130deg,#000 55%,rgba(0,0,0,0.8) 75%,#000 95%);mask-image:linear-gradient(130deg,#000 55%,rgba(0,0,0,0.8) 75%,#000 95%);-webkit-mask-size:200% 100%;mask-size:200% 100%;animation:placeholder-wave 2s linear infinite}@keyframes placeholder-wave{100%{-webkit-mask-position:-200% 0%;mask-position:-200% 0%}}.clearfix::after{display:block;clear:both;content:""}.text-bg-primary{color:#fff!important;background-color:RGBA(13,110,253,var(--bs-bg-opacity,1))!important}.text-bg-secondary{color:#fff!important;background-color:RGBA(108,117,125,var(--bs-bg-opacity,1))!important}.text-bg-success{color:#fff!important;background-color:RGBA(25,135,84,var(--bs-bg-opacity,1))!important}.text-bg-info{color:#000!important;background-color:RGBA(13,202,240,var(--bs-bg-opacity,1))!important}.text-bg-warning{color:#000!important;background-color:RGBA(255,193,7,var(--bs-bg-opacity,1))!important}.text-bg-danger{color:#fff!important;background-color:RGBA(220,53,69,var(--bs-bg-opacity,1))!important}.text-bg-light{color:#000!important;background-color:RGBA(248,249,250,var(--bs-bg-opacity,1))!important}.text-bg-dark{color:#fff!important;background-color:RGBA(33,37,41,var(--bs-bg-opacity,1))!important}.link-primary{color:#0d6efd!important}.link-primary:focus,.link-primary:hover{color:#0a58ca!important}.link-secondary{color:#6c757d!important}.link-secondary:focus,.link-secondary:hover{color:#565e64!important}.link-success{color:#198754!important}.link-success:focus,.link-success:hover{color:#146c43!important}.link-info{color:#0dcaf0!important}.link-info:focus,.link-info:hover{color:#3dd5f3!important}.link-warning{color:#ffc107!important}.link-warning:focus,.link-warning:hover{color:#ffcd39!important}.link-danger{color:#dc3545!important}.link-danger:focus,.link-danger:hover{color:#b02a37!important}.link-light{color:#f8f9fa!important}.link-light:focus,.link-light:hover{color:#f9fafb!important}.link-dark{color:#212529!important}.link-dark:focus,.link-dark:hover{color:#1a1e21!important}.ratio{position:relative;width:100%}.ratio::before{display:block;padding-top:var(--bs-aspect-ratio);content:""}.ratio>*{position:absolute;top:0;left:0;width:100%;height:100%}.ratio-1x1{--bs-aspect-ratio:100%}.ratio-4x3{--bs-aspect-ratio:75%}.ratio-16x9{--bs-aspect-ratio:56.25%}.ratio-21x9{--bs-aspect-ratio:42.8571428571%}.fixed-top{position:fixed;top:0;right:0;left:0;z-index:1030}.fixed-bottom{position:fixed;right:0;bottom:0;left:0;z-index:1030}.sticky-top{position:-webkit-sticky;position:sticky;top:0;z-index:1020}.sticky-bottom{position:-webkit-sticky;position:sticky;bottom:0;z-index:1020}@media (min-width:576px){.sticky-sm-top{position:-webkit-sticky;position:sticky;top:0;z-index:1020}.sticky-sm-bottom{position:-webkit-sticky;position:sticky;bottom:0;z-index:1020}}@media (min-width:768px){.sticky-md-top{position:-webkit-sticky;position:sticky;top:0;z-index:1020}.sticky-md-bottom{position:-webkit-sticky;position:sticky;bottom:0;z-index:1020}}@media (min-width:992px){.sticky-lg-top{position:-webkit-sticky;position:sticky;top:0;z-index:1020}.sticky-lg-bottom{position:-webkit-sticky;position:sticky;bottom:0;z-index:1020}}@media (min-width:1200px){.sticky-xl-top{position:-webkit-sticky;position:sticky;top:0;z-index:1020}.sticky-xl-bottom{position:-webkit-sticky;position:sticky;bottom:0;z-index:1020}}@media (min-width:1400px){.sticky-xxl-top{position:-webkit-sticky;position:sticky;top:0;z-index:1020}.sticky-xxl-bottom{position:-webkit-sticky;position:sticky;bottom:0;z-index:1020}}.hstack{display:flex;flex-direction:row;align-items:center;align-self:stretch}.vstack{display:flex;flex:1 1 auto;flex-direction:column;align-self:stretch}.visually-hidden,.visually-hidden-focusable:not(:focus):not(:focus-within){position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important;border:0!important}.stretched-link::after{position:absolute;top:0;right:0;bottom:0;left:0;z-index:1;content:""}.text-truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.vr{display:inline-block;align-self:stretch;width:1px;min-height:1em;background-color:currentcolor;opacity:.25}.align-baseline{vertical-align:baseline!important}.align-top{vertical-align:top!important}.align-middle{vertical-align:middle!important}.align-bottom{vertical-align:bottom!important}.align-text-bottom{vertical-align:text-bottom!important}.align-text-top{vertical-align:text-top!important}.float-start{float:left!important}.float-end{float:right!important}.float-none{float:none!important}.opacity-0{opacity:0!important}.opacity-25{opacity:.25!important}.opacity-50{opacity:.5!important}.opacity-75{opacity:.75!important}.opacity-100{opacity:1!important}.overflow-auto{overflow:auto!important}.overflow-hidden{overflow:hidden!important}.overflow-visible{overflow:visible!important}.overflow-scroll{overflow:scroll!important}.d-inline{display:inline!important}.d-inline-block{display:inline-block!important}.d-block{display:block!important}.d-grid{display:grid!important}.d-table{display:table!important}.d-table-row{display:table-row!important}.d-table-cell{display:table-cell!important}.d-flex{display:flex!important}.d-inline-flex{display:inline-flex!important}.d-none{display:none!important}.shadow{box-shadow:0 .5rem 1rem rgba(0,0,0,.15)!important}.shadow-sm{box-shadow:0 .125rem .25rem rgba(0,0,0,.075)!important}.shadow-lg{box-shadow:0 1rem 3rem rgba(0,0,0,.175)!important}.shadow-none{box-shadow:none!important}.position-static{position:static!important}.position-relative{position:relative!important}.position-absolute{position:absolute!important}.position-fixed{position:fixed!important}.position-sticky{position:-webkit-sticky!important;position:sticky!important}.top-0{top:0!important}.top-50{top:50%!important}.top-100{top:100%!important}.bottom-0{bottom:0!important}.bottom-50{bottom:50%!important}.bottom-100{bottom:100%!important}.start-0{left:0!important}.start-50{left:50%!important}.start-100{left:100%!important}.end-0{right:0!important}.end-50{right:50%!important}.end-100{right:100%!important}.translate-middle{transform:translate(-50%,-50%)!important}.translate-middle-x{transform:translateX(-50%)!important}.translate-middle-y{transform:translateY(-50%)!important}.border{border:var(--bs-border-width) var(--bs-border-style) var(--bs-border-color)!important}.border-0{border:0!important}.border-top{border-top:var(--bs-border-width) var(--bs-border-style) var(--bs-border-color)!important}.border-top-0{border-top:0!important}.border-end{border-right:var(--bs-border-width) var(--bs-border-style) var(--bs-border-color)!important}.border-end-0{border-right:0!important}.border-bottom{border-bottom:var(--bs-border-width) var(--bs-border-style) var(--bs-border-color)!important}.border-bottom-0{border-bottom:0!important}.border-start{border-left:var(--bs-border-width) var(--bs-border-style) var(--bs-border-color)!important}.border-start-0{border-left:0!important}.border-primary{--bs-border-opacity:1;border-color:rgba(var(--bs-primary-rgb),var(--bs-border-opacity))!important}.border-secondary{--bs-border-opacity:1;border-color:rgba(var(--bs-secondary-rgb),var(--bs-border-opacity))!important}.border-success{--bs-border-opacity:1;border-color:rgba(var(--bs-success-rgb),var(--bs-border-opacity))!important}.border-info{--bs-border-opacity:1;border-color:rgba(var(--bs-info-rgb),var(--bs-border-opacity))!important}.border-warning{--bs-border-opacity:1;border-color:rgba(var(--bs-warning-rgb),var(--bs-border-opacity))!important}.border-danger{--bs-border-opacity:1;border-color:rgba(var(--bs-danger-rgb),var(--bs-border-opacity))!important}.border-light{--bs-border-opacity:1;border-color:rgba(var(--bs-light-rgb),var(--bs-border-opacity))!important}.border-dark{--bs-border-opacity:1;border-color:rgba(var(--bs-dark-rgb),var(--bs-border-opacity))!important}.border-white{--bs-border-opacity:1;border-color:rgba(var(--bs-white-rgb),var(--bs-border-opacity))!important}.border-1{--bs-border-width:1px}.border-2{--bs-border-width:2px}.border-3{--bs-border-width:3px}.border-4{--bs-border-width:4px}.border-5{--bs-border-width:5px}.border-opacity-10{--bs-border-opacity:0.1}.border-opacity-25{--bs-border-opacity:0.25}.border-opacity-50{--bs-border-opacity:0.5}.border-opacity-75{--bs-border-opacity:0.75}.border-opacity-100{--bs-border-opacity:1}.w-25{width:25%!important}.w-50{width:50%!important}.w-75{width:75%!important}.w-100{width:100%!important}.w-auto{width:auto!important}.mw-100{max-width:100%!important}.vw-100{width:100vw!important}.min-vw-100{min-width:100vw!important}.h-25{height:25%!important}.h-50{height:50%!important}.h-75{height:75%!important}.h-100{height:100%!important}.h-auto{height:auto!important}.mh-100{max-height:100%!important}.vh-100{height:100vh!important}.min-vh-100{min-height:100vh!important}.flex-fill{flex:1 1 auto!important}.flex-row{flex-direction:row!important}.flex-column{flex-direction:column!important}.flex-row-reverse{flex-direction:row-reverse!important}.flex-column-reverse{flex-direction:column-reverse!important}.flex-grow-0{flex-grow:0!important}.flex-grow-1{flex-grow:1!important}.flex-shrink-0{flex-shrink:0!important}.flex-shrink-1{flex-shrink:1!important}.flex-wrap{flex-wrap:wrap!important}.flex-nowrap{flex-wrap:nowrap!important}.flex-wrap-reverse{flex-wrap:wrap-reverse!important}.justify-content-start{justify-content:flex-start!important}.justify-content-end{justify-content:flex-end!important}.justify-content-center{justify-content:center!important}.justify-content-between{justify-content:space-between!important}.justify-content-around{justify-content:space-around!important}.justify-content-evenly{justify-content:space-evenly!important}.align-items-start{align-items:flex-start!important}.align-items-end{align-items:flex-end!important}.align-items-center{align-items:center!important}.align-items-baseline{align-items:baseline!important}.align-items-stretch{align-items:stretch!important}.align-content-start{align-content:flex-start!important}.align-content-end{align-content:flex-end!important}.align-content-center{align-content:center!important}.align-content-between{align-content:space-between!important}.align-content-around{align-content:space-around!important}.align-content-stretch{align-content:stretch!important}.align-self-auto{align-self:auto!important}.align-self-start{align-self:flex-start!important}.align-self-end{align-self:flex-end!important}.align-self-center{align-self:center!important}.align-self-baseline{align-self:baseline!important}.align-self-stretch{align-self:stretch!important}.order-first{order:-1!important}.order-0{order:0!important}.order-1{order:1!important}.order-2{order:2!important}.order-3{order:3!important}.order-4{order:4!important}.order-5{order:5!important}.order-last{order:6!important}.m-0{margin:0!important}.m-1{margin:.25rem!important}.m-2{margin:.5rem!important}.m-3{margin:1rem!important}.m-4{margin:1.5rem!important}.m-5{margin:3rem!important}.m-auto{margin:auto!important}.mx-0{margin-right:0!important;margin-left:0!important}.mx-1{margin-right:.25rem!important;margin-left:.25rem!important}.mx-2{margin-right:.5rem!important;margin-left:.5rem!important}.mx-3{margin-right:1rem!important;margin-left:1rem!important}.mx-4{margin-right:1.5rem!important;margin-left:1.5rem!important}.mx-5{margin-right:3rem!important;margin-left:3rem!important}.mx-auto{margin-right:auto!important;margin-left:auto!important}.my-0{margin-top:0!important;margin-bottom:0!important}.my-1{margin-top:.25rem!important;margin-bottom:.25rem!important}.my-2{margin-top:.5rem!important;margin-bottom:.5rem!important}.my-3{margin-top:1rem!important;margin-bottom:1rem!important}.my-4{margin-top:1.5rem!important;margin-bottom:1.5rem!important}.my-5{margin-top:3rem!important;margin-bottom:3rem!important}.my-auto{margin-top:auto!important;margin-bottom:auto!important}.mt-0{margin-top:0!important}.mt-1{margin-top:.25rem!important}.mt-2{margin-top:.5rem!important}.mt-3{margin-top:1rem!important}.mt-4{margin-top:1.5rem!important}.mt-5{margin-top:3rem!important}.mt-auto{margin-top:auto!important}.me-0{margin-right:0!important}.me-1{margin-right:.25rem!important}.me-2{margin-right:.5rem!important}.me-3{margin-right:1rem!important}.me-4{margin-right:1.5rem!important}.me-5{margin-right:3rem!important}.me-auto{margin-right:auto!important}.mb-0{margin-bottom:0!important}.mb-1{margin-bottom:.25rem!important}.mb-2{margin-bottom:.5rem!important}.mb-3{margin-bottom:1rem!important}.mb-4{margin-bottom:1.5rem!important}.mb-5{margin-bottom:3rem!important}.mb-auto{margin-bottom:auto!important}.ms-0{margin-left:0!important}.ms-1{margin-left:.25rem!important}.ms-2{margin-left:.5rem!important}.ms-3{margin-left:1rem!important}.ms-4{margin-left:1.5rem!important}.ms-5{margin-left:3rem!important}.ms-auto{margin-left:auto!important}.p-0{padding:0!important}.p-1{padding:.25rem!important}.p-2{padding:.5rem!important}.p-3{padding:1rem!important}.p-4{padding:1.5rem!important}.p-5{padding:3rem!important}.px-0{padding-right:0!important;padding-left:0!important}.px-1{padding-right:.25rem!important;padding-left:.25rem!important}.px-2{padding-right:.5rem!important;padding-left:.5rem!important}.px-3{padding-right:1rem!important;padding-left:1rem!important}.px-4{padding-right:1.5rem!important;padding-left:1.5rem!important}.px-5{padding-right:3rem!important;padding-left:3rem!important}.py-0{padding-top:0!important;padding-bottom:0!important}.py-1{padding-top:.25rem!important;padding-bottom:.25rem!important}.py-2{padding-top:.5rem!important;padding-bottom:.5rem!important}.py-3{padding-top:1rem!important;padding-bottom:1rem!important}.py-4{padding-top:1.5rem!important;padding-bottom:1.5rem!important}.py-5{padding-top:3rem!important;padding-bottom:3rem!important}.pt-0{padding-top:0!important}.pt-1{padding-top:.25rem!important}.pt-2{padding-top:.5rem!important}.pt-3{padding-top:1rem!important}.pt-4{padding-top:1.5rem!important}.pt-5{padding-top:3rem!important}.pe-0{padding-right:0!important}.pe-1{padding-right:.25rem!important}.pe-2{padding-right:.5rem!important}.pe-3{padding-right:1rem!important}.pe-4{padding-right:1.5rem!important}.pe-5{padding-right:3rem!important}.pb-0{padding-bottom:0!important}.pb-1{padding-bottom:.25rem!important}.pb-2{padding-bottom:.5rem!important}.pb-3{padding-bottom:1rem!important}.pb-4{padding-bottom:1.5rem!important}.pb-5{padding-bottom:3rem!important}.ps-0{padding-left:0!important}.ps-1{padding-left:.25rem!important}.ps-2{padding-left:.5rem!important}.ps-3{padding-left:1rem!important}.ps-4{padding-left:1.5rem!important}.ps-5{padding-left:3rem!important}.gap-0{gap:0!important}.gap-1{gap:.25rem!important}.gap-2{gap:.5rem!important}.gap-3{gap:1rem!important}.gap-4{gap:1.5rem!important}.gap-5{gap:3rem!important}.font-monospace{font-family:var(--bs-font-monospace)!important}.fs-1{font-size:calc(1.375rem + 1.5vw)!important}.fs-2{font-size:calc(1.325rem + .9vw)!important}.fs-3{font-size:calc(1.3rem + .6vw)!important}.fs-4{font-size:calc(1.275rem + .3vw)!important}.fs-5{font-size:1.25rem!important}.fs-6{font-size:1rem!important}.fst-italic{font-style:italic!important}.fst-normal{font-style:normal!important}.fw-light{font-weight:300!important}.fw-lighter{font-weight:lighter!important}.fw-normal{font-weight:400!important}.fw-bold{font-weight:700!important}.fw-semibold{font-weight:600!important}.fw-bolder{font-weight:bolder!important}.lh-1{line-height:1!important}.lh-sm{line-height:1.25!important}.lh-base{line-height:1.5!important}.lh-lg{line-height:2!important}.text-start{text-align:left!important}.text-end{text-align:right!important}.text-center{text-align:center!important}.text-decoration-none{text-decoration:none!important}.text-decoration-underline{text-decoration:underline!important}.text-decoration-line-through{text-decoration:line-through!important}.text-lowercase{text-transform:lowercase!important}.text-uppercase{text-transform:uppercase!important}.text-capitalize{text-transform:capitalize!important}.text-wrap{white-space:normal!important}.text-nowrap{white-space:nowrap!important}.text-break{word-wrap:break-word!important;word-break:break-word!important}.text-primary{--bs-text-opacity:1;color:rgba(var(--bs-primary-rgb),var(--bs-text-opacity))!important}.text-secondary{--bs-text-opacity:1;color:rgba(var(--bs-secondary-rgb),var(--bs-text-opacity))!important}.text-success{--bs-text-opacity:1;color:rgba(var(--bs-success-rgb),var(--bs-text-opacity))!important}.text-info{--bs-text-opacity:1;color:rgba(var(--bs-info-rgb),var(--bs-text-opacity))!important}.text-warning{--bs-text-opacity:1;color:rgba(var(--bs-warning-rgb),var(--bs-text-opacity))!important}.text-danger{--bs-text-opacity:1;color:rgba(var(--bs-danger-rgb),var(--bs-text-opacity))!important}.text-light{--bs-text-opacity:1;color:rgba(var(--bs-light-rgb),var(--bs-text-opacity))!important}.text-dark{--bs-text-opacity:1;color:rgba(var(--bs-dark-rgb),var(--bs-text-opacity))!important}.text-black{--bs-text-opacity:1;color:rgba(var(--bs-black-rgb),var(--bs-text-opacity))!important}.text-white{--bs-text-opacity:1;color:rgba(var(--bs-white-rgb),var(--bs-text-opacity))!important}.text-body{--bs-text-opacity:1;color:rgba(var(--bs-body-color-rgb),var(--bs-text-opacity))!important}.text-muted{--bs-text-opacity:1;color:#6c757d!important}.text-black-50{--bs-text-opacity:1;color:rgba(0,0,0,.5)!important}.text-white-50{--bs-text-opacity:1;color:rgba(255,255,255,.5)!important}.text-reset{--bs-text-opacity:1;color:inherit!important}.text-opacity-25{--bs-text-opacity:0.25}.text-opacity-50{--bs-text-opacity:0.5}.text-opacity-75{--bs-text-opacity:0.75}.text-opacity-100{--bs-text-opacity:1}.bg-primary{--bs-bg-opacity:1;background-color:rgba(var(--bs-primary-rgb),var(--bs-bg-opacity))!important}.bg-secondary{--bs-bg-opacity:1;background-color:rgba(var(--bs-secondary-rgb),var(--bs-bg-opacity))!important}.bg-success{--bs-bg-opacity:1;background-color:rgba(var(--bs-success-rgb),var(--bs-bg-opacity))!important}.bg-info{--bs-bg-opacity:1;background-color:rgba(var(--bs-info-rgb),var(--bs-bg-opacity))!important}.bg-warning{--bs-bg-opacity:1;background-color:rgba(var(--bs-warning-rgb),var(--bs-bg-opacity))!important}.bg-danger{--bs-bg-opacity:1;background-color:rgba(var(--bs-danger-rgb),var(--bs-bg-opacity))!important}.bg-light{--bs-bg-opacity:1;background-color:rgba(var(--bs-light-rgb),var(--bs-bg-opacity))!important}.bg-dark{--bs-bg-opacity:1;background-color:rgba(var(--bs-dark-rgb),var(--bs-bg-opacity))!important}.bg-black{--bs-bg-opacity:1;background-color:rgba(var(--bs-black-rgb),var(--bs-bg-opacity))!important}.bg-white{--bs-bg-opacity:1;background-color:rgba(var(--bs-white-rgb),var(--bs-bg-opacity))!important}.bg-body{--bs-bg-opacity:1;background-color:rgba(var(--bs-body-bg-rgb),var(--bs-bg-opacity))!important}.bg-transparent{--bs-bg-opacity:1;background-color:transparent!important}.bg-opacity-10{--bs-bg-opacity:0.1}.bg-opacity-25{--bs-bg-opacity:0.25}.bg-opacity-50{--bs-bg-opacity:0.5}.bg-opacity-75{--bs-bg-opacity:0.75}.bg-opacity-100{--bs-bg-opacity:1}.bg-gradient{background-image:var(--bs-gradient)!important}.user-select-all{-webkit-user-select:all!important;-moz-user-select:all!important;user-select:all!important}.user-select-auto{-webkit-user-select:auto!important;-moz-user-select:auto!important;user-select:auto!important}.user-select-none{-webkit-user-select:none!important;-moz-user-select:none!important;user-select:none!important}.pe-none{pointer-events:none!important}.pe-auto{pointer-events:auto!important}.rounded{border-radius:var(--bs-border-radius)!important}.rounded-0{border-radius:0!important}.rounded-1{border-radius:var(--bs-border-radius-sm)!important}.rounded-2{border-radius:var(--bs-border-radius)!important}.rounded-3{border-radius:var(--bs-border-radius-lg)!important}.rounded-4{border-radius:var(--bs-border-radius-xl)!important}.rounded-5{border-radius:var(--bs-border-radius-2xl)!important}.rounded-circle{border-radius:50%!important}.rounded-pill{border-radius:var(--bs-border-radius-pill)!important}.rounded-top{border-top-left-radius:var(--bs-border-radius)!important;border-top-right-radius:var(--bs-border-radius)!important}.rounded-end{border-top-right-radius:var(--bs-border-radius)!important;border-bottom-right-radius:var(--bs-border-radius)!important}.rounded-bottom{border-bottom-right-radius:var(--bs-border-radius)!important;border-bottom-left-radius:var(--bs-border-radius)!important}.rounded-start{border-bottom-left-radius:var(--bs-border-radius)!important;border-top-left-radius:var(--bs-border-radius)!important}.visible{visibility:visible!important}.invisible{visibility:hidden!important}@media (min-width:576px){.float-sm-start{float:left!important}.float-sm-end{float:right!important}.float-sm-none{float:none!important}.d-sm-inline{display:inline!important}.d-sm-inline-block{display:inline-block!important}.d-sm-block{display:block!important}.d-sm-grid{display:grid!important}.d-sm-table{display:table!important}.d-sm-table-row{display:table-row!important}.d-sm-table-cell{display:table-cell!important}.d-sm-flex{display:flex!important}.d-sm-inline-flex{display:inline-flex!important}.d-sm-none{display:none!important}.flex-sm-fill{flex:1 1 auto!important}.flex-sm-row{flex-direction:row!important}.flex-sm-column{flex-direction:column!important}.flex-sm-row-reverse{flex-direction:row-reverse!important}.flex-sm-column-reverse{flex-direction:column-reverse!important}.flex-sm-grow-0{flex-grow:0!important}.flex-sm-grow-1{flex-grow:1!important}.flex-sm-shrink-0{flex-shrink:0!important}.flex-sm-shrink-1{flex-shrink:1!important}.flex-sm-wrap{flex-wrap:wrap!important}.flex-sm-nowrap{flex-wrap:nowrap!important}.flex-sm-wrap-reverse{flex-wrap:wrap-reverse!important}.justify-content-sm-start{justify-content:flex-start!important}.justify-content-sm-end{justify-content:flex-end!important}.justify-content-sm-center{justify-content:center!important}.justify-content-sm-between{justify-content:space-between!important}.justify-content-sm-around{justify-content:space-around!important}.justify-content-sm-evenly{justify-content:space-evenly!important}.align-items-sm-start{align-items:flex-start!important}.align-items-sm-end{align-items:flex-end!important}.align-items-sm-center{align-items:center!important}.align-items-sm-baseline{align-items:baseline!important}.align-items-sm-stretch{align-items:stretch!important}.align-content-sm-start{align-content:flex-start!important}.align-content-sm-end{align-content:flex-end!important}.align-content-sm-center{align-content:center!important}.align-content-sm-between{align-content:space-between!important}.align-content-sm-around{align-content:space-around!important}.align-content-sm-stretch{align-content:stretch!important}.align-self-sm-auto{align-self:auto!important}.align-self-sm-start{align-self:flex-start!important}.align-self-sm-end{align-self:flex-end!important}.align-self-sm-center{align-self:center!important}.align-self-sm-baseline{align-self:baseline!important}.align-self-sm-stretch{align-self:stretch!important}.order-sm-first{order:-1!important}.order-sm-0{order:0!important}.order-sm-1{order:1!important}.order-sm-2{order:2!important}.order-sm-3{order:3!important}.order-sm-4{order:4!important}.order-sm-5{order:5!important}.order-sm-last{order:6!important}.m-sm-0{margin:0!important}.m-sm-1{margin:.25rem!important}.m-sm-2{margin:.5rem!important}.m-sm-3{margin:1rem!important}.m-sm-4{margin:1.5rem!important}.m-sm-5{margin:3rem!important}.m-sm-auto{margin:auto!important}.mx-sm-0{margin-right:0!important;margin-left:0!important}.mx-sm-1{margin-right:.25rem!important;margin-left:.25rem!important}.mx-sm-2{margin-right:.5rem!important;margin-left:.5rem!important}.mx-sm-3{margin-right:1rem!important;margin-left:1rem!important}.mx-sm-4{margin-right:1.5rem!important;margin-left:1.5rem!important}.mx-sm-5{margin-right:3rem!important;margin-left:3rem!important}.mx-sm-auto{margin-right:auto!important;margin-left:auto!important}.my-sm-0{margin-top:0!important;margin-bottom:0!important}.my-sm-1{margin-top:.25rem!important;margin-bottom:.25rem!important}.my-sm-2{margin-top:.5rem!important;margin-bottom:.5rem!important}.my-sm-3{margin-top:1rem!important;margin-bottom:1rem!important}.my-sm-4{margin-top:1.5rem!important;margin-bottom:1.5rem!important}.my-sm-5{margin-top:3rem!important;margin-bottom:3rem!important}.my-sm-auto{margin-top:auto!important;margin-bottom:auto!important}.mt-sm-0{margin-top:0!important}.mt-sm-1{margin-top:.25rem!important}.mt-sm-2{margin-top:.5rem!important}.mt-sm-3{margin-top:1rem!important}.mt-sm-4{margin-top:1.5rem!important}.mt-sm-5{margin-top:3rem!important}.mt-sm-auto{margin-top:auto!important}.me-sm-0{margin-right:0!important}.me-sm-1{margin-right:.25rem!important}.me-sm-2{margin-right:.5rem!important}.me-sm-3{margin-right:1rem!important}.me-sm-4{margin-right:1.5rem!important}.me-sm-5{margin-right:3rem!important}.me-sm-auto{margin-right:auto!important}.mb-sm-0{margin-bottom:0!important}.mb-sm-1{margin-bottom:.25rem!important}.mb-sm-2{margin-bottom:.5rem!important}.mb-sm-3{margin-bottom:1rem!important}.mb-sm-4{margin-bottom:1.5rem!important}.mb-sm-5{margin-bottom:3rem!important}.mb-sm-auto{margin-bottom:auto!important}.ms-sm-0{margin-left:0!important}.ms-sm-1{margin-left:.25rem!important}.ms-sm-2{margin-left:.5rem!important}.ms-sm-3{margin-left:1rem!important}.ms-sm-4{margin-left:1.5rem!important}.ms-sm-5{margin-left:3rem!important}.ms-sm-auto{margin-left:auto!important}.p-sm-0{padding:0!important}.p-sm-1{padding:.25rem!important}.p-sm-2{padding:.5rem!important}.p-sm-3{padding:1rem!important}.p-sm-4{padding:1.5rem!important}.p-sm-5{padding:3rem!important}.px-sm-0{padding-right:0!important;padding-left:0!important}.px-sm-1{padding-right:.25rem!important;padding-left:.25rem!important}.px-sm-2{padding-right:.5rem!important;padding-left:.5rem!important}.px-sm-3{padding-right:1rem!important;padding-left:1rem!important}.px-sm-4{padding-right:1.5rem!important;padding-left:1.5rem!important}.px-sm-5{padding-right:3rem!important;padding-left:3rem!important}.py-sm-0{padding-top:0!important;padding-bottom:0!important}.py-sm-1{padding-top:.25rem!important;padding-bottom:.25rem!important}.py-sm-2{padding-top:.5rem!important;padding-bottom:.5rem!important}.py-sm-3{padding-top:1rem!important;padding-bottom:1rem!important}.py-sm-4{padding-top:1.5rem!important;padding-bottom:1.5rem!important}.py-sm-5{padding-top:3rem!important;padding-bottom:3rem!important}.pt-sm-0{padding-top:0!important}.pt-sm-1{padding-top:.25rem!important}.pt-sm-2{padding-top:.5rem!important}.pt-sm-3{padding-top:1rem!important}.pt-sm-4{padding-top:1.5rem!important}.pt-sm-5{padding-top:3rem!important}.pe-sm-0{padding-right:0!important}.pe-sm-1{padding-right:.25rem!important}.pe-sm-2{padding-right:.5rem!important}.pe-sm-3{padding-right:1rem!important}.pe-sm-4{padding-right:1.5rem!important}.pe-sm-5{padding-right:3rem!important}.pb-sm-0{padding-bottom:0!important}.pb-sm-1{padding-bottom:.25rem!important}.pb-sm-2{padding-bottom:.5rem!important}.pb-sm-3{padding-bottom:1rem!important}.pb-sm-4{padding-bottom:1.5rem!important}.pb-sm-5{padding-bottom:3rem!important}.ps-sm-0{padding-left:0!important}.ps-sm-1{padding-left:.25rem!important}.ps-sm-2{padding-left:.5rem!important}.ps-sm-3{padding-left:1rem!important}.ps-sm-4{padding-left:1.5rem!important}.ps-sm-5{padding-left:3rem!important}.gap-sm-0{gap:0!important}.gap-sm-1{gap:.25rem!important}.gap-sm-2{gap:.5rem!important}.gap-sm-3{gap:1rem!important}.gap-sm-4{gap:1.5rem!important}.gap-sm-5{gap:3rem!important}.text-sm-start{text-align:left!important}.text-sm-end{text-align:right!important}.text-sm-center{text-align:center!important}}@media (min-width:768px){.float-md-start{float:left!important}.float-md-end{float:right!important}.float-md-none{float:none!important}.d-md-inline{display:inline!important}.d-md-inline-block{display:inline-block!important}.d-md-block{display:block!important}.d-md-grid{display:grid!important}.d-md-table{display:table!important}.d-md-table-row{display:table-row!important}.d-md-table-cell{display:table-cell!important}.d-md-flex{display:flex!important}.d-md-inline-flex{display:inline-flex!important}.d-md-none{display:none!important}.flex-md-fill{flex:1 1 auto!important}.flex-md-row{flex-direction:row!important}.flex-md-column{flex-direction:column!important}.flex-md-row-reverse{flex-direction:row-reverse!important}.flex-md-column-reverse{flex-direction:column-reverse!important}.flex-md-grow-0{flex-grow:0!important}.flex-md-grow-1{flex-grow:1!important}.flex-md-shrink-0{flex-shrink:0!important}.flex-md-shrink-1{flex-shrink:1!important}.flex-md-wrap{flex-wrap:wrap!important}.flex-md-nowrap{flex-wrap:nowrap!important}.flex-md-wrap-reverse{flex-wrap:wrap-reverse!important}.justify-content-md-start{justify-content:flex-start!important}.justify-content-md-end{justify-content:flex-end!important}.justify-content-md-center{justify-content:center!important}.justify-content-md-between{justify-content:space-between!important}.justify-content-md-around{justify-content:space-around!important}.justify-content-md-evenly{justify-content:space-evenly!important}.align-items-md-start{align-items:flex-start!important}.align-items-md-end{align-items:flex-end!important}.align-items-md-center{align-items:center!important}.align-items-md-baseline{align-items:baseline!important}.align-items-md-stretch{align-items:stretch!important}.align-content-md-start{align-content:flex-start!important}.align-content-md-end{align-content:flex-end!important}.align-content-md-center{align-content:center!important}.align-content-md-between{align-content:space-between!important}.align-content-md-around{align-content:space-around!important}.align-content-md-stretch{align-content:stretch!important}.align-self-md-auto{align-self:auto!important}.align-self-md-start{align-self:flex-start!important}.align-self-md-end{align-self:flex-end!important}.align-self-md-center{align-self:center!important}.align-self-md-baseline{align-self:baseline!important}.align-self-md-stretch{align-self:stretch!important}.order-md-first{order:-1!important}.order-md-0{order:0!important}.order-md-1{order:1!important}.order-md-2{order:2!important}.order-md-3{order:3!important}.order-md-4{order:4!important}.order-md-5{order:5!important}.order-md-last{order:6!important}.m-md-0{margin:0!important}.m-md-1{margin:.25rem!important}.m-md-2{margin:.5rem!important}.m-md-3{margin:1rem!important}.m-md-4{margin:1.5rem!important}.m-md-5{margin:3rem!important}.m-md-auto{margin:auto!important}.mx-md-0{margin-right:0!important;margin-left:0!important}.mx-md-1{margin-right:.25rem!important;margin-left:.25rem!important}.mx-md-2{margin-right:.5rem!important;margin-left:.5rem!important}.mx-md-3{margin-right:1rem!important;margin-left:1rem!important}.mx-md-4{margin-right:1.5rem!important;margin-left:1.5rem!important}.mx-md-5{margin-right:3rem!important;margin-left:3rem!important}.mx-md-auto{margin-right:auto!important;margin-left:auto!important}.my-md-0{margin-top:0!important;margin-bottom:0!important}.my-md-1{margin-top:.25rem!important;margin-bottom:.25rem!important}.my-md-2{margin-top:.5rem!important;margin-bottom:.5rem!important}.my-md-3{margin-top:1rem!important;margin-bottom:1rem!important}.my-md-4{margin-top:1.5rem!important;margin-bottom:1.5rem!important}.my-md-5{margin-top:3rem!important;margin-bottom:3rem!important}.my-md-auto{margin-top:auto!important;margin-bottom:auto!important}.mt-md-0{margin-top:0!important}.mt-md-1{margin-top:.25rem!important}.mt-md-2{margin-top:.5rem!important}.mt-md-3{margin-top:1rem!important}.mt-md-4{margin-top:1.5rem!important}.mt-md-5{margin-top:3rem!important}.mt-md-auto{margin-top:auto!important}.me-md-0{margin-right:0!important}.me-md-1{margin-right:.25rem!important}.me-md-2{margin-right:.5rem!important}.me-md-3{margin-right:1rem!important}.me-md-4{margin-right:1.5rem!important}.me-md-5{margin-right:3rem!important}.me-md-auto{margin-right:auto!important}.mb-md-0{margin-bottom:0!important}.mb-md-1{margin-bottom:.25rem!important}.mb-md-2{margin-bottom:.5rem!important}.mb-md-3{margin-bottom:1rem!important}.mb-md-4{margin-bottom:1.5rem!important}.mb-md-5{margin-bottom:3rem!important}.mb-md-auto{margin-bottom:auto!important}.ms-md-0{margin-left:0!important}.ms-md-1{margin-left:.25rem!important}.ms-md-2{margin-left:.5rem!important}.ms-md-3{margin-left:1rem!important}.ms-md-4{margin-left:1.5rem!important}.ms-md-5{margin-left:3rem!important}.ms-md-auto{margin-left:auto!important}.p-md-0{padding:0!important}.p-md-1{padding:.25rem!important}.p-md-2{padding:.5rem!important}.p-md-3{padding:1rem!important}.p-md-4{padding:1.5rem!important}.p-md-5{padding:3rem!important}.px-md-0{padding-right:0!important;padding-left:0!important}.px-md-1{padding-right:.25rem!important;padding-left:.25rem!important}.px-md-2{padding-right:.5rem!important;padding-left:.5rem!important}.px-md-3{padding-right:1rem!important;padding-left:1rem!important}.px-md-4{padding-right:1.5rem!important;padding-left:1.5rem!important}.px-md-5{padding-right:3rem!important;padding-left:3rem!important}.py-md-0{padding-top:0!important;padding-bottom:0!important}.py-md-1{padding-top:.25rem!important;padding-bottom:.25rem!important}.py-md-2{padding-top:.5rem!important;padding-bottom:.5rem!important}.py-md-3{padding-top:1rem!important;padding-bottom:1rem!important}.py-md-4{padding-top:1.5rem!important;padding-bottom:1.5rem!important}.py-md-5{padding-top:3rem!important;padding-bottom:3rem!important}.pt-md-0{padding-top:0!important}.pt-md-1{padding-top:.25rem!important}.pt-md-2{padding-top:.5rem!important}.pt-md-3{padding-top:1rem!important}.pt-md-4{padding-top:1.5rem!important}.pt-md-5{padding-top:3rem!important}.pe-md-0{padding-right:0!important}.pe-md-1{padding-right:.25rem!important}.pe-md-2{padding-right:.5rem!important}.pe-md-3{padding-right:1rem!important}.pe-md-4{padding-right:1.5rem!important}.pe-md-5{padding-right:3rem!important}.pb-md-0{padding-bottom:0!important}.pb-md-1{padding-bottom:.25rem!important}.pb-md-2{padding-bottom:.5rem!important}.pb-md-3{padding-bottom:1rem!important}.pb-md-4{padding-bottom:1.5rem!important}.pb-md-5{padding-bottom:3rem!important}.ps-md-0{padding-left:0!important}.ps-md-1{padding-left:.25rem!important}.ps-md-2{padding-left:.5rem!important}.ps-md-3{padding-left:1rem!important}.ps-md-4{padding-left:1.5rem!important}.ps-md-5{padding-left:3rem!important}.gap-md-0{gap:0!important}.gap-md-1{gap:.25rem!important}.gap-md-2{gap:.5rem!important}.gap-md-3{gap:1rem!important}.gap-md-4{gap:1.5rem!important}.gap-md-5{gap:3rem!important}.text-md-start{text-align:left!important}.text-md-end{text-align:right!important}.text-md-center{text-align:center!important}}@media (min-width:992px){.float-lg-start{float:left!important}.float-lg-end{float:right!important}.float-lg-none{float:none!important}.d-lg-inline{display:inline!important}.d-lg-inline-block{display:inline-block!important}.d-lg-block{display:block!important}.d-lg-grid{display:grid!important}.d-lg-table{display:table!important}.d-lg-table-row{display:table-row!important}.d-lg-table-cell{display:table-cell!important}.d-lg-flex{display:flex!important}.d-lg-inline-flex{display:inline-flex!important}.d-lg-none{display:none!important}.flex-lg-fill{flex:1 1 auto!important}.flex-lg-row{flex-direction:row!important}.flex-lg-column{flex-direction:column!important}.flex-lg-row-reverse{flex-direction:row-reverse!important}.flex-lg-column-reverse{flex-direction:column-reverse!important}.flex-lg-grow-0{flex-grow:0!important}.flex-lg-grow-1{flex-grow:1!important}.flex-lg-shrink-0{flex-shrink:0!important}.flex-lg-shrink-1{flex-shrink:1!important}.flex-lg-wrap{flex-wrap:wrap!important}.flex-lg-nowrap{flex-wrap:nowrap!important}.flex-lg-wrap-reverse{flex-wrap:wrap-reverse!important}.justify-content-lg-start{justify-content:flex-start!important}.justify-content-lg-end{justify-content:flex-end!important}.justify-content-lg-center{justify-content:center!important}.justify-content-lg-between{justify-content:space-between!important}.justify-content-lg-around{justify-content:space-around!important}.justify-content-lg-evenly{justify-content:space-evenly!important}.align-items-lg-start{align-items:flex-start!important}.align-items-lg-end{align-items:flex-end!important}.align-items-lg-center{align-items:center!important}.align-items-lg-baseline{align-items:baseline!important}.align-items-lg-stretch{align-items:stretch!important}.align-content-lg-start{align-content:flex-start!important}.align-content-lg-end{align-content:flex-end!important}.align-content-lg-center{align-content:center!important}.align-content-lg-between{align-content:space-between!important}.align-content-lg-around{align-content:space-around!important}.align-content-lg-stretch{align-content:stretch!important}.align-self-lg-auto{align-self:auto!important}.align-self-lg-start{align-self:flex-start!important}.align-self-lg-end{align-self:flex-end!important}.align-self-lg-center{align-self:center!important}.align-self-lg-baseline{align-self:baseline!important}.align-self-lg-stretch{align-self:stretch!important}.order-lg-first{order:-1!important}.order-lg-0{order:0!important}.order-lg-1{order:1!important}.order-lg-2{order:2!important}.order-lg-3{order:3!important}.order-lg-4{order:4!important}.order-lg-5{order:5!important}.order-lg-last{order:6!important}.m-lg-0{margin:0!important}.m-lg-1{margin:.25rem!important}.m-lg-2{margin:.5rem!important}.m-lg-3{margin:1rem!important}.m-lg-4{margin:1.5rem!important}.m-lg-5{margin:3rem!important}.m-lg-auto{margin:auto!important}.mx-lg-0{margin-right:0!important;margin-left:0!important}.mx-lg-1{margin-right:.25rem!important;margin-left:.25rem!important}.mx-lg-2{margin-right:.5rem!important;margin-left:.5rem!important}.mx-lg-3{margin-right:1rem!important;margin-left:1rem!important}.mx-lg-4{margin-right:1.5rem!important;margin-left:1.5rem!important}.mx-lg-5{margin-right:3rem!important;margin-left:3rem!important}.mx-lg-auto{margin-right:auto!important;margin-left:auto!important}.my-lg-0{margin-top:0!important;margin-bottom:0!important}.my-lg-1{margin-top:.25rem!important;margin-bottom:.25rem!important}.my-lg-2{margin-top:.5rem!important;margin-bottom:.5rem!important}.my-lg-3{margin-top:1rem!important;margin-bottom:1rem!important}.my-lg-4{margin-top:1.5rem!important;margin-bottom:1.5rem!important}.my-lg-5{margin-top:3rem!important;margin-bottom:3rem!important}.my-lg-auto{margin-top:auto!important;margin-bottom:auto!important}.mt-lg-0{margin-top:0!important}.mt-lg-1{margin-top:.25rem!important}.mt-lg-2{margin-top:.5rem!important}.mt-lg-3{margin-top:1rem!important}.mt-lg-4{margin-top:1.5rem!important}.mt-lg-5{margin-top:3rem!important}.mt-lg-auto{margin-top:auto!important}.me-lg-0{margin-right:0!important}.me-lg-1{margin-right:.25rem!important}.me-lg-2{margin-right:.5rem!important}.me-lg-3{margin-right:1rem!important}.me-lg-4{margin-right:1.5rem!important}.me-lg-5{margin-right:3rem!important}.me-lg-auto{margin-right:auto!important}.mb-lg-0{margin-bottom:0!important}.mb-lg-1{margin-bottom:.25rem!important}.mb-lg-2{margin-bottom:.5rem!important}.mb-lg-3{margin-bottom:1rem!important}.mb-lg-4{margin-bottom:1.5rem!important}.mb-lg-5{margin-bottom:3rem!important}.mb-lg-auto{margin-bottom:auto!important}.ms-lg-0{margin-left:0!important}.ms-lg-1{margin-left:.25rem!important}.ms-lg-2{margin-left:.5rem!important}.ms-lg-3{margin-left:1rem!important}.ms-lg-4{margin-left:1.5rem!important}.ms-lg-5{margin-left:3rem!important}.ms-lg-auto{margin-left:auto!important}.p-lg-0{padding:0!important}.p-lg-1{padding:.25rem!important}.p-lg-2{padding:.5rem!important}.p-lg-3{padding:1rem!important}.p-lg-4{padding:1.5rem!important}.p-lg-5{padding:3rem!important}.px-lg-0{padding-right:0!important;padding-left:0!important}.px-lg-1{padding-right:.25rem!important;padding-left:.25rem!important}.px-lg-2{padding-right:.5rem!important;padding-left:.5rem!important}.px-lg-3{padding-right:1rem!important;padding-left:1rem!important}.px-lg-4{padding-right:1.5rem!important;padding-left:1.5rem!important}.px-lg-5{padding-right:3rem!important;padding-left:3rem!important}.py-lg-0{padding-top:0!important;padding-bottom:0!important}.py-lg-1{padding-top:.25rem!important;padding-bottom:.25rem!important}.py-lg-2{padding-top:.5rem!important;padding-bottom:.5rem!important}.py-lg-3{padding-top:1rem!important;padding-bottom:1rem!important}.py-lg-4{padding-top:1.5rem!important;padding-bottom:1.5rem!important}.py-lg-5{padding-top:3rem!important;padding-bottom:3rem!important}.pt-lg-0{padding-top:0!important}.pt-lg-1{padding-top:.25rem!important}.pt-lg-2{padding-top:.5rem!important}.pt-lg-3{padding-top:1rem!important}.pt-lg-4{padding-top:1.5rem!important}.pt-lg-5{padding-top:3rem!important}.pe-lg-0{padding-right:0!important}.pe-lg-1{padding-right:.25rem!important}.pe-lg-2{padding-right:.5rem!important}.pe-lg-3{padding-right:1rem!important}.pe-lg-4{padding-right:1.5rem!important}.pe-lg-5{padding-right:3rem!important}.pb-lg-0{padding-bottom:0!important}.pb-lg-1{padding-bottom:.25rem!important}.pb-lg-2{padding-bottom:.5rem!important}.pb-lg-3{padding-bottom:1rem!important}.pb-lg-4{padding-bottom:1.5rem!important}.pb-lg-5{padding-bottom:3rem!important}.ps-lg-0{padding-left:0!important}.ps-lg-1{padding-left:.25rem!important}.ps-lg-2{padding-left:.5rem!important}.ps-lg-3{padding-left:1rem!important}.ps-lg-4{padding-left:1.5rem!important}.ps-lg-5{padding-left:3rem!important}.gap-lg-0{gap:0!important}.gap-lg-1{gap:.25rem!important}.gap-lg-2{gap:.5rem!important}.gap-lg-3{gap:1rem!important}.gap-lg-4{gap:1.5rem!important}.gap-lg-5{gap:3rem!important}.text-lg-start{text-align:left!important}.text-lg-end{text-align:right!important}.text-lg-center{text-align:center!important}}@media (min-width:1200px){.float-xl-start{float:left!important}.float-xl-end{float:right!important}.float-xl-none{float:none!important}.d-xl-inline{display:inline!important}.d-xl-inline-block{display:inline-block!important}.d-xl-block{display:block!important}.d-xl-grid{display:grid!important}.d-xl-table{display:table!important}.d-xl-table-row{display:table-row!important}.d-xl-table-cell{display:table-cell!important}.d-xl-flex{display:flex!important}.d-xl-inline-flex{display:inline-flex!important}.d-xl-none{display:none!important}.flex-xl-fill{flex:1 1 auto!important}.flex-xl-row{flex-direction:row!important}.flex-xl-column{flex-direction:column!important}.flex-xl-row-reverse{flex-direction:row-reverse!important}.flex-xl-column-reverse{flex-direction:column-reverse!important}.flex-xl-grow-0{flex-grow:0!important}.flex-xl-grow-1{flex-grow:1!important}.flex-xl-shrink-0{flex-shrink:0!important}.flex-xl-shrink-1{flex-shrink:1!important}.flex-xl-wrap{flex-wrap:wrap!important}.flex-xl-nowrap{flex-wrap:nowrap!important}.flex-xl-wrap-reverse{flex-wrap:wrap-reverse!important}.justify-content-xl-start{justify-content:flex-start!important}.justify-content-xl-end{justify-content:flex-end!important}.justify-content-xl-center{justify-content:center!important}.justify-content-xl-between{justify-content:space-between!important}.justify-content-xl-around{justify-content:space-around!important}.justify-content-xl-evenly{justify-content:space-evenly!important}.align-items-xl-start{align-items:flex-start!important}.align-items-xl-end{align-items:flex-end!important}.align-items-xl-center{align-items:center!important}.align-items-xl-baseline{align-items:baseline!important}.align-items-xl-stretch{align-items:stretch!important}.align-content-xl-start{align-content:flex-start!important}.align-content-xl-end{align-content:flex-end!important}.align-content-xl-center{align-content:center!important}.align-content-xl-between{align-content:space-between!important}.align-content-xl-around{align-content:space-around!important}.align-content-xl-stretch{align-content:stretch!important}.align-self-xl-auto{align-self:auto!important}.align-self-xl-start{align-self:flex-start!important}.align-self-xl-end{align-self:flex-end!important}.align-self-xl-center{align-self:center!important}.align-self-xl-baseline{align-self:baseline!important}.align-self-xl-stretch{align-self:stretch!important}.order-xl-first{order:-1!important}.order-xl-0{order:0!important}.order-xl-1{order:1!important}.order-xl-2{order:2!important}.order-xl-3{order:3!important}.order-xl-4{order:4!important}.order-xl-5{order:5!important}.order-xl-last{order:6!important}.m-xl-0{margin:0!important}.m-xl-1{margin:.25rem!important}.m-xl-2{margin:.5rem!important}.m-xl-3{margin:1rem!important}.m-xl-4{margin:1.5rem!important}.m-xl-5{margin:3rem!important}.m-xl-auto{margin:auto!important}.mx-xl-0{margin-right:0!important;margin-left:0!important}.mx-xl-1{margin-right:.25rem!important;margin-left:.25rem!important}.mx-xl-2{margin-right:.5rem!important;margin-left:.5rem!important}.mx-xl-3{margin-right:1rem!important;margin-left:1rem!important}.mx-xl-4{margin-right:1.5rem!important;margin-left:1.5rem!important}.mx-xl-5{margin-right:3rem!important;margin-left:3rem!important}.mx-xl-auto{margin-right:auto!important;margin-left:auto!important}.my-xl-0{margin-top:0!important;margin-bottom:0!important}.my-xl-1{margin-top:.25rem!important;margin-bottom:.25rem!important}.my-xl-2{margin-top:.5rem!important;margin-bottom:.5rem!important}.my-xl-3{margin-top:1rem!important;margin-bottom:1rem!important}.my-xl-4{margin-top:1.5rem!important;margin-bottom:1.5rem!important}.my-xl-5{margin-top:3rem!important;margin-bottom:3rem!important}.my-xl-auto{margin-top:auto!important;margin-bottom:auto!important}.mt-xl-0{margin-top:0!important}.mt-xl-1{margin-top:.25rem!important}.mt-xl-2{margin-top:.5rem!important}.mt-xl-3{margin-top:1rem!important}.mt-xl-4{margin-top:1.5rem!important}.mt-xl-5{margin-top:3rem!important}.mt-xl-auto{margin-top:auto!important}.me-xl-0{margin-right:0!important}.me-xl-1{margin-right:.25rem!important}.me-xl-2{margin-right:.5rem!important}.me-xl-3{margin-right:1rem!important}.me-xl-4{margin-right:1.5rem!important}.me-xl-5{margin-right:3rem!important}.me-xl-auto{margin-right:auto!important}.mb-xl-0{margin-bottom:0!important}.mb-xl-1{margin-bottom:.25rem!important}.mb-xl-2{margin-bottom:.5rem!important}.mb-xl-3{margin-bottom:1rem!important}.mb-xl-4{margin-bottom:1.5rem!important}.mb-xl-5{margin-bottom:3rem!important}.mb-xl-auto{margin-bottom:auto!important}.ms-xl-0{margin-left:0!important}.ms-xl-1{margin-left:.25rem!important}.ms-xl-2{margin-left:.5rem!important}.ms-xl-3{margin-left:1rem!important}.ms-xl-4{margin-left:1.5rem!important}.ms-xl-5{margin-left:3rem!important}.ms-xl-auto{margin-left:auto!important}.p-xl-0{padding:0!important}.p-xl-1{padding:.25rem!important}.p-xl-2{padding:.5rem!important}.p-xl-3{padding:1rem!important}.p-xl-4{padding:1.5rem!important}.p-xl-5{padding:3rem!important}.px-xl-0{padding-right:0!important;padding-left:0!important}.px-xl-1{padding-right:.25rem!important;padding-left:.25rem!important}.px-xl-2{padding-right:.5rem!important;padding-left:.5rem!important}.px-xl-3{padding-right:1rem!important;padding-left:1rem!important}.px-xl-4{padding-right:1.5rem!important;padding-left:1.5rem!important}.px-xl-5{padding-right:3rem!important;padding-left:3rem!important}.py-xl-0{padding-top:0!important;padding-bottom:0!important}.py-xl-1{padding-top:.25rem!important;padding-bottom:.25rem!important}.py-xl-2{padding-top:.5rem!important;padding-bottom:.5rem!important}.py-xl-3{padding-top:1rem!important;padding-bottom:1rem!important}.py-xl-4{padding-top:1.5rem!important;padding-bottom:1.5rem!important}.py-xl-5{padding-top:3rem!important;padding-bottom:3rem!important}.pt-xl-0{padding-top:0!important}.pt-xl-1{padding-top:.25rem!important}.pt-xl-2{padding-top:.5rem!important}.pt-xl-3{padding-top:1rem!important}.pt-xl-4{padding-top:1.5rem!important}.pt-xl-5{padding-top:3rem!important}.pe-xl-0{padding-right:0!important}.pe-xl-1{padding-right:.25rem!important}.pe-xl-2{padding-right:.5rem!important}.pe-xl-3{padding-right:1rem!important}.pe-xl-4{padding-right:1.5rem!important}.pe-xl-5{padding-right:3rem!important}.pb-xl-0{padding-bottom:0!important}.pb-xl-1{padding-bottom:.25rem!important}.pb-xl-2{padding-bottom:.5rem!important}.pb-xl-3{padding-bottom:1rem!important}.pb-xl-4{padding-bottom:1.5rem!important}.pb-xl-5{padding-bottom:3rem!important}.ps-xl-0{padding-left:0!important}.ps-xl-1{padding-left:.25rem!important}.ps-xl-2{padding-left:.5rem!important}.ps-xl-3{padding-left:1rem!important}.ps-xl-4{padding-left:1.5rem!important}.ps-xl-5{padding-left:3rem!important}.gap-xl-0{gap:0!important}.gap-xl-1{gap:.25rem!important}.gap-xl-2{gap:.5rem!important}.gap-xl-3{gap:1rem!important}.gap-xl-4{gap:1.5rem!important}.gap-xl-5{gap:3rem!important}.text-xl-start{text-align:left!important}.text-xl-end{text-align:right!important}.text-xl-center{text-align:center!important}}@media (min-width:1400px){.float-xxl-start{float:left!important}.float-xxl-end{float:right!important}.float-xxl-none{float:none!important}.d-xxl-inline{display:inline!important}.d-xxl-inline-block{display:inline-block!important}.d-xxl-block{display:block!important}.d-xxl-grid{display:grid!important}.d-xxl-table{display:table!important}.d-xxl-table-row{display:table-row!important}.d-xxl-table-cell{display:table-cell!important}.d-xxl-flex{display:flex!important}.d-xxl-inline-flex{display:inline-flex!important}.d-xxl-none{display:none!important}.flex-xxl-fill{flex:1 1 auto!important}.flex-xxl-row{flex-direction:row!important}.flex-xxl-column{flex-direction:column!important}.flex-xxl-row-reverse{flex-direction:row-reverse!important}.flex-xxl-column-reverse{flex-direction:column-reverse!important}.flex-xxl-grow-0{flex-grow:0!important}.flex-xxl-grow-1{flex-grow:1!important}.flex-xxl-shrink-0{flex-shrink:0!important}.flex-xxl-shrink-1{flex-shrink:1!important}.flex-xxl-wrap{flex-wrap:wrap!important}.flex-xxl-nowrap{flex-wrap:nowrap!important}.flex-xxl-wrap-reverse{flex-wrap:wrap-reverse!important}.justify-content-xxl-start{justify-content:flex-start!important}.justify-content-xxl-end{justify-content:flex-end!important}.justify-content-xxl-center{justify-content:center!important}.justify-content-xxl-between{justify-content:space-between!important}.justify-content-xxl-around{justify-content:space-around!important}.justify-content-xxl-evenly{justify-content:space-evenly!important}.align-items-xxl-start{align-items:flex-start!important}.align-items-xxl-end{align-items:flex-end!important}.align-items-xxl-center{align-items:center!important}.align-items-xxl-baseline{align-items:baseline!important}.align-items-xxl-stretch{align-items:stretch!important}.align-content-xxl-start{align-content:flex-start!important}.align-content-xxl-end{align-content:flex-end!important}.align-content-xxl-center{align-content:center!important}.align-content-xxl-between{align-content:space-between!important}.align-content-xxl-around{align-content:space-around!important}.align-content-xxl-stretch{align-content:stretch!important}.align-self-xxl-auto{align-self:auto!important}.align-self-xxl-start{align-self:flex-start!important}.align-self-xxl-end{align-self:flex-end!important}.align-self-xxl-center{align-self:center!important}.align-self-xxl-baseline{align-self:baseline!important}.align-self-xxl-stretch{align-self:stretch!important}.order-xxl-first{order:-1!important}.order-xxl-0{order:0!important}.order-xxl-1{order:1!important}.order-xxl-2{order:2!important}.order-xxl-3{order:3!important}.order-xxl-4{order:4!important}.order-xxl-5{order:5!important}.order-xxl-last{order:6!important}.m-xxl-0{margin:0!important}.m-xxl-1{margin:.25rem!important}.m-xxl-2{margin:.5rem!important}.m-xxl-3{margin:1rem!important}.m-xxl-4{margin:1.5rem!important}.m-xxl-5{margin:3rem!important}.m-xxl-auto{margin:auto!important}.mx-xxl-0{margin-right:0!important;margin-left:0!important}.mx-xxl-1{margin-right:.25rem!important;margin-left:.25rem!important}.mx-xxl-2{margin-right:.5rem!important;margin-left:.5rem!important}.mx-xxl-3{margin-right:1rem!important;margin-left:1rem!important}.mx-xxl-4{margin-right:1.5rem!important;margin-left:1.5rem!important}.mx-xxl-5{margin-right:3rem!important;margin-left:3rem!important}.mx-xxl-auto{margin-right:auto!important;margin-left:auto!important}.my-xxl-0{margin-top:0!important;margin-bottom:0!important}.my-xxl-1{margin-top:.25rem!important;margin-bottom:.25rem!important}.my-xxl-2{margin-top:.5rem!important;margin-bottom:.5rem!important}.my-xxl-3{margin-top:1rem!important;margin-bottom:1rem!important}.my-xxl-4{margin-top:1.5rem!important;margin-bottom:1.5rem!important}.my-xxl-5{margin-top:3rem!important;margin-bottom:3rem!important}.my-xxl-auto{margin-top:auto!important;margin-bottom:auto!important}.mt-xxl-0{margin-top:0!important}.mt-xxl-1{margin-top:.25rem!important}.mt-xxl-2{margin-top:.5rem!important}.mt-xxl-3{margin-top:1rem!important}.mt-xxl-4{margin-top:1.5rem!important}.mt-xxl-5{margin-top:3rem!important}.mt-xxl-auto{margin-top:auto!important}.me-xxl-0{margin-right:0!important}.me-xxl-1{margin-right:.25rem!important}.me-xxl-2{margin-right:.5rem!important}.me-xxl-3{margin-right:1rem!important}.me-xxl-4{margin-right:1.5rem!important}.me-xxl-5{margin-right:3rem!important}.me-xxl-auto{margin-right:auto!important}.mb-xxl-0{margin-bottom:0!important}.mb-xxl-1{margin-bottom:.25rem!important}.mb-xxl-2{margin-bottom:.5rem!important}.mb-xxl-3{margin-bottom:1rem!important}.mb-xxl-4{margin-bottom:1.5rem!important}.mb-xxl-5{margin-bottom:3rem!important}.mb-xxl-auto{margin-bottom:auto!important}.ms-xxl-0{margin-left:0!important}.ms-xxl-1{margin-left:.25rem!important}.ms-xxl-2{margin-left:.5rem!important}.ms-xxl-3{margin-left:1rem!important}.ms-xxl-4{margin-left:1.5rem!important}.ms-xxl-5{margin-left:3rem!important}.ms-xxl-auto{margin-left:auto!important}.p-xxl-0{padding:0!important}.p-xxl-1{padding:.25rem!important}.p-xxl-2{padding:.5rem!important}.p-xxl-3{padding:1rem!important}.p-xxl-4{padding:1.5rem!important}.p-xxl-5{padding:3rem!important}.px-xxl-0{padding-right:0!important;padding-left:0!important}.px-xxl-1{padding-right:.25rem!important;padding-left:.25rem!important}.px-xxl-2{padding-right:.5rem!important;padding-left:.5rem!important}.px-xxl-3{padding-right:1rem!important;padding-left:1rem!important}.px-xxl-4{padding-right:1.5rem!important;padding-left:1.5rem!important}.px-xxl-5{padding-right:3rem!important;padding-left:3rem!important}.py-xxl-0{padding-top:0!important;padding-bottom:0!important}.py-xxl-1{padding-top:.25rem!important;padding-bottom:.25rem!important}.py-xxl-2{padding-top:.5rem!important;padding-bottom:.5rem!important}.py-xxl-3{padding-top:1rem!important;padding-bottom:1rem!important}.py-xxl-4{padding-top:1.5rem!important;padding-bottom:1.5rem!important}.py-xxl-5{padding-top:3rem!important;padding-bottom:3rem!important}.pt-xxl-0{padding-top:0!important}.pt-xxl-1{padding-top:.25rem!important}.pt-xxl-2{padding-top:.5rem!important}.pt-xxl-3{padding-top:1rem!important}.pt-xxl-4{padding-top:1.5rem!important}.pt-xxl-5{padding-top:3rem!important}.pe-xxl-0{padding-right:0!important}.pe-xxl-1{padding-right:.25rem!important}.pe-xxl-2{padding-right:.5rem!important}.pe-xxl-3{padding-right:1rem!important}.pe-xxl-4{padding-right:1.5rem!important}.pe-xxl-5{padding-right:3rem!important}.pb-xxl-0{padding-bottom:0!important}.pb-xxl-1{padding-bottom:.25rem!important}.pb-xxl-2{padding-bottom:.5rem!important}.pb-xxl-3{padding-bottom:1rem!important}.pb-xxl-4{padding-bottom:1.5rem!important}.pb-xxl-5{padding-bottom:3rem!important}.ps-xxl-0{padding-left:0!important}.ps-xxl-1{padding-left:.25rem!important}.ps-xxl-2{padding-left:.5rem!important}.ps-xxl-3{padding-left:1rem!important}.ps-xxl-4{padding-left:1.5rem!important}.ps-xxl-5{padding-left:3rem!important}.gap-xxl-0{gap:0!important}.gap-xxl-1{gap:.25rem!important}.gap-xxl-2{gap:.5rem!important}.gap-xxl-3{gap:1rem!important}.gap-xxl-4{gap:1.5rem!important}.gap-xxl-5{gap:3rem!important}.text-xxl-start{text-align:left!important}.text-xxl-end{text-align:right!important}.text-xxl-center{text-align:center!important}}@media (min-width:1200px){.fs-1{font-size:2.5rem!important}.fs-2{font-size:2rem!important}.fs-3{font-size:1.75rem!important}.fs-4{font-size:1.5rem!important}}@media print{.d-print-inline{display:inline!important}.d-print-inline-block{display:inline-block!important}.d-print-block{display:block!important}.d-print-grid{display:grid!important}.d-print-table{display:table!important}.d-print-table-row{display:table-row!important}.d-print-table-cell{display:table-cell!important}.d-print-flex{display:flex!important}.d-print-inline-flex{display:inline-flex!important}.d-print-none{display:none!important}}`,""]);var G=new CSSStyleSheet;G.replaceSync(M.toString());const V=G},62621:(t,e,r)=>{"use strict";r.d(e,{A:()=>l});var n=r(78706),i=r.n(n),o=r(72859),a=r.n(o)()(i());a.push([t.id,".chsp-meta {\n z-index: 1;\n cursor: pointer;\n}\n\n.chsp-meta .chsp-info-icon {\n float: right;\n margin-top: 5px;\n margin-left: 3px;\n}\n\n.chsp-meta .chsp-info-icon svg {\n display: block;\n width: 14px;\n height: 14px;\n opacity: 0.6;\n}\n\n.chsp-authors-list {\n padding: 0;\n display: flex;\n flex-wrap: wrap;\n flex-direction: row;\n justify-content: center;\n}\n\n.chsp-authors-list li {\n border: solid #dee2e6 1px;\n padding: 10px;\n list-style-type: none;\n white-space: nowrap;\n}\n\n.chsp-open-map-settings {\n position: absolute;\n top: 3px;\n left: 5px;\n z-index: 10;\n}\n\n.chsp-open-viewer-settings {\n position: absolute;\n top: 5px;\n right: 5px;\n}\n\n.chsp-extra-options-btn {\n margin: auto;\n display: block;\n}\n\n/* Tooltip text */\n.chsp-tooltip {\n visibility: hidden;\n background: #69738a;\n color: white;\n padding: 6px;\n font-size: 12px;\n line-height: 12px;\n white-space: nowrap;\n border-radius: 2px;\n text-align: center;\n display: inline-block;\n width: 9em;\n position: absolute;\n z-index: 100000;\n}\n\n.chsp-tooltip-right {\n top: 0px;\n right: -9.5em;\n}\n\n.chsp-tooltip-below {\n top: 35px;\n left: -3.5em;\n}\n\n.chsp-has-tooltip:hover .chsp-tooltip {\n visibility: visible;\n}\n\n.chsp-pin-marker {\n border-radius: 50%;\n border: solid 1px black;\n --size: 12px;\n width: var(--size);\n height: var(--size);\n z-index: 10;\n}\n\n.chsp-map-pin-marker {\n position: absolute;\n /* ensure the top/right/left/bottom positioning is relative to the center of the div */\n transform: translate(calc(-50% + var(--size)), -50%);\n}\n\n.chsp-pin-marker:hover {\n --size: 20px;\n cursor: pointer;\n}\n\n/* This class is added on top of .chsp-pin-marker for the active pinned structure/environment */\n.chsp-active-pin {\n border-width: 2px;\n --size: 20px;\n}\n\n.chsp-active-pin:hover {\n --size: 22px;\n cursor: default;\n}\n\n.chsp-viewer-button {\n position: absolute;\n padding: 1px;\n margin: 0;\n height: 28px;\n width: 28px;\n z-index: 10;\n}\n\n.chsp-viewer-action-button {\n background-color: white;\n border: none;\n}\n\n.chsp-viewer-action-button:hover {\n background: white;\n}\n\n.chsp-viewer-action-button svg {\n opacity: 0.4;\n transition: opacity 0.15s ease-in-out;\n}\n\n.chsp-viewer-action-button:hover svg {\n opacity: 0.6;\n}\n\n.chsp-structure-viewer-grid {\n display: grid;\n position: relative;\n width: 100%;\n height: 100%;\n grid-column-gap: 2px;\n grid-row-gap: 2px;\n}\n\n.chsp-structure-viewer-cell {\n width: 99%;\n height: 99%;\n left: 0.5%;\n top: 0.5%;\n position: relative;\n border: 1px solid lightgray;\n padding: 1px;\n}\n\n.chsp-structure-viewer-cell-active {\n border-color: gray;\n}\n\n.chsp-map-options {\n display: grid;\n grid-template-columns: 1fr 0.5fr;\n align-items: center;\n justify-content: center;\n align-content: start;\n column-gap: 1em;\n}\n\n.chsp-map-options label {\n min-width: 6em;\n}\n\n.chsp-map-options > :nth-child(n + 3):not(.chsp-map-extra-options) {\n margin-top: 1.3rem;\n}\n\n.chsp-map-extra-options {\n display: grid;\n align-items: center;\n justify-items: center;\n grid-template-columns: auto 1fr 1fr;\n column-gap: 1em;\n}\n\n.chsp-map-extra-options > * {\n margin: 0.5em 0;\n}\n\n.chsp-map-extra-options label {\n min-width: auto;\n}\n\n.chsp-map-extra-options {\n grid-column: 1 / span 2;\n}\n\n.chsp-map-options .form-check-label {\n width: auto;\n}\n\n.chsp-modal-header {\n cursor: grab;\n}\n\n.chsp-play-button {\n border: 0;\n background: transparent;\n box-sizing: border-box;\n height: 1.2em;\n width: 1.2em;\n margin-left: 0.5ex;\n\n border-color: transparent transparent transparent #202020;\n transition: 100ms all ease;\n cursor: pointer;\n\n border-style: solid;\n border-width: 0.7em 0 0.7em 1em;\n}\n\n.chsp-play-button.chsp-playing {\n border-style: double;\n border-width: 0px 0 0px 1.2em;\n}\n\n.chsp-play-button:hover {\n border-color: transparent transparent transparent #404040;\n}\n\n.chsp-properties-table {\n height: 100%;\n width: 80%;\n margin: auto;\n}\n\n.chsp-properties-table td,\n.chsp-properties-table th {\n width: 50%;\n border-top: none;\n}\n\n.chsp-settings-section-title {\n font-weight: bold;\n}\n\n/* Change Plotly modebar style to match the style of the structure grid buttons */\n\n.chsp-map .modebar-group {\n padding-left: 0 !important;\n}\n\n.chsp-map .modebar-btn {\n cursor: default !important;\n font-family: apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial,\n 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol',\n 'Noto Color Emoji';\n}\n\n.chsp-map .modebar-btn::after {\n opacity: 0.9;\n}\n\n.chsp-map .icon:hover + .modebar-btn::after {\n visibility: visible;\n}\n\n.chsp-map .modebar-btn::before {\n content: none !important;\n}\n\n.chsp-map .modebar-btn .icon {\n transition: opacity 0.15s ease-in-out;\n padding: 3px;\n opacity: 0.3;\n cursor: pointer;\n}\n\n.chsp-map .modebar-group svg.icon {\n width: 2em;\n height: 2em;\n border-radius: 0.2em;\n}\n\n.chsp-map .modebar-group svg.icon:active {\n color: #212529;\n background-color: #dae0e5;\n border-color: #d3d9df;\n box-shadow: 0 0 0 0.2rem rgb(216 217 219 / 50%);\n}\n\n.chsp-map .modebar-btn .icon path {\n transition:\n color 0.15s ease-in-out,\n background-color 0.15s ease-in-out,\n border-color 0.15s ease-in-out,\n box-shadow 0.15s ease-in-out;\n fill: black !important;\n}\n\n.chsp-map .modebar-btn .icon:hover {\n opacity: 0.6;\n}\n\n.chsp-map .modebar-btn.active .icon {\n opacity: 0.6;\n}\n\n.chsp-info-btns {\n display: flex;\n position: relative;\n margin-bottom: 0.5ex;\n margin-top: 0.5ex;\n justify-content: center;\n}\n\n.chsp-info-structure-btn {\n min-width: 8em;\n padding-left: 6px;\n padding-right: 4px;\n font-weight: bold;\n font-size: small;\n background-color: none;\n border-color: #66a5e8;\n border-width: 2px;\n float: left;\n}\n\n.chsp-info-structure-btn:hover {\n background-color: #5b94d0;\n}\n\n.chsp-info-atom-btn {\n margin-left: 1em;\n padding-left: 6px;\n padding-right: 4px;\n min-width: 8em;\n font-weight: bold;\n font-size: small;\n background-color: none;\n border-color: #4cb64c;\n border-width: 2px;\n}\n\n.chsp-info-atom-btn:hover {\n background-color: #44a344;\n}\n\n.chsp-info-btns-svg {\n float: left;\n padding-right: 6px;\n padding-top: 3px;\n}\n\n.chsp-info-btns-svg svg {\n display: block;\n opacity: 0.6;\n}\n\n.chsp-info-number {\n -moz-appearance: textfield;\n appearance: textfield;\n border: none;\n transition: background-color 0.15s;\n background-color: #ebedf0;\n margin-left: 2px;\n margin-right: 3px;\n font-family: inherit;\n width: 4em;\n}\n\n.chsp-info-atom-btn:hover .chsp-info-number {\n background-color: #69b569;\n}\n\n.chsp-info-structure-btn:hover .chsp-info-number {\n background-color: #7ba9d9;\n}\n\n.chsp-info-number::-webkit-outer-spin-button,\n.chsp-info-number::-webkit-inner-spin-button {\n -webkit-appearance: none;\n margin: 0;\n}\n\n.chsp-info-tables {\n position: relative;\n width: 100%;\n}\n\n.chsp-info-table {\n position: absolute;\n bottom: 0;\n left: 0;\n right: 0;\n z-index: 10;\n background-color: white;\n /* max-height is set in JavaScript */\n overflow: auto;\n}\n\n.chsp-info-table.collapsing {\n overflow: hidden;\n}\n\n.chsp-info-table table {\n margin: 0;\n}\n\n/* Change the atoms slider thumb color to green, to match structure highlight */\n.chsp-atom-slider::-webkit-slider-thumb {\n background-color: #008000;\n}\n\n.chsp-atom-slider::-moz-range-thumb {\n background-color: #008000;\n}\n\n.chsp-atom-slider::-ms-thumb {\n background-color: #008000;\n}\n\n.chsp-atom-slider::-webkit-slider-thumb:active {\n background-color: #99cc99;\n}\n\n.chsp-atom-slider::-moz-range-thumb:active {\n background-color: #99cc99;\n}\n\n.chsp-atom-slider::-ms-thumb:active {\n background-color: #99cc99;\n}\n\n.chsp-atom-slider:focus::-webkit-slider-thumb {\n box-shadow:\n 0 0 0 1px #fff,\n 0 0 0 0.2rem rgba(0, 255, 0, 0.25);\n}\n\n.chsp-atom-slider:focus::-moz-range-thumb {\n box-shadow:\n 0 0 0 1px #fff,\n 0 0 0 0.2rem rgba(0, 255, 0, 0.25);\n}\n\n.chsp-atom-slider:focus::-ms-thumb {\n box-shadow:\n 0 0 0 1px #fff,\n 0 0 0 0.2rem rgba(0, 255, 0, 0.25);\n}\n\n.chsp-settings-representation {\n display: grid;\n grid-template-columns: 1fr 1fr 1fr;\n grid-row-gap: 1ex;\n}\n\n.chsp-settings-representation label {\n cursor: help;\n}\n\n.chsp-settings-supercell {\n display: grid;\n grid-template-columns: 1fr 1fr 1fr 2fr;\n}\n\n.chsp-supercell-count {\n max-width: 3.5em;\n}\n\n.chsp-settings-camera {\n display: grid;\n gap: 1em;\n grid-template-columns: repeat(7, auto);\n justify-content: center;\n}\n\n.chsp-settings-environments {\n display: grid;\n align-items: center;\n column-gap: 1em;\n grid-template-columns: 1fr 1fr 1fr;\n}\n\n.chsp-settings-extra-options {\n display: grid;\n gap: 1em;\n grid-template-columns: 1fr 1fr 1fr;\n grid-column: 1 / span 3;\n}\n\n.chsp-settings-extra-options > :nth-child(-n + 3) {\n margin-top: 1em;\n}\n\n.chsp-settings-trajectory {\n display: grid;\n grid-template-columns: 12em 12em;\n justify-content: center;\n align-content: center;\n gap: 1em;\n margin-bottom: 1ex;\n}\n\n.chsp-cell-info {\n position: absolute;\n bottom: 5px;\n left: 5px;\n font-size: 0.8em;\n}\n\n.chsp-toggle-plot-btn {\n display: block;\n position: relative;\n margin-top: 3px;\n margin-bottom: 1px;\n}\n\n.chsp-atom-color-property {\n display: grid;\n align-items: center;\n justify-items: center;\n grid-template-columns: 1fr 1fr;\n column-gap: 1em;\n margin: 0.5em 0;\n}\n\n.chsp-atom-extra-options {\n display: grid;\n align-items: center;\n justify-items: center;\n grid-template-columns: auto 1fr 1fr;\n column-gap: 1em;\n}\n\n.chsp-atom-extra-options > * {\n margin: 0.5em 0;\n}\n\n.chsp-atom-extra-options label {\n min-width: auto;\n}\n\n.chsp-atom-extra-options {\n grid-column: 1 / span 2;\n}\n\n.chsp-target-toggle {\n padding-left: 5px;\n padding-right: 5px;\n display: flex;\n justify-content: flex-end;\n gap: 5px;\n}\n\n.chsp-target-spinner {\n width: 25px;\n height: 25px;\n margin-left: 5px;\n}\n",""]);var s=new CSSStyleSheet;s.replaceSync(a.toString());const l=s},37821:function(module,__unused_webpack_exports,__webpack_require__){var process=__webpack_require__(39807),factory;factory=()=>(()=>{var __webpack_modules__={"./node_modules/iobuffer/lib-esm/IOBuffer.js":(t,e,r)=>{"use strict";r.r(e),r.d(e,{IOBuffer:()=>a});var n=r("./node_modules/iobuffer/lib-esm/text.browser.js");const i=(()=>{const t=new Uint8Array(4);return!((new Uint32Array(t.buffer)[0]=1)&t[0])})(),o={int8:globalThis.Int8Array,uint8:globalThis.Uint8Array,int16:globalThis.Int16Array,uint16:globalThis.Uint16Array,int32:globalThis.Int32Array,uint32:globalThis.Uint32Array,uint64:globalThis.BigUint64Array,int64:globalThis.BigInt64Array,float32:globalThis.Float32Array,float64:globalThis.Float64Array};class a{constructor(t=8192,e={}){let r=!1;"number"==typeof t?t=new ArrayBuffer(t):(r=!0,this.lastWrittenByte=t.byteLength);const n=e.offset?e.offset>>>0:0,i=t.byteLength-n;let o=n;(ArrayBuffer.isView(t)||t instanceof a)&&(t.byteLength!==t.buffer.byteLength&&(o=t.byteOffset+n),t=t.buffer),this.lastWrittenByte=r?i:0,this.buffer=t,this.length=i,this.byteLength=i,this.byteOffset=o,this.offset=0,this.littleEndian=!0,this._data=new DataView(this.buffer,o,i),this._mark=0,this._marks=[]}available(t=1){return this.offset+t<=this.length}isLittleEndian(){return this.littleEndian}setLittleEndian(){return this.littleEndian=!0,this}isBigEndian(){return!this.littleEndian}setBigEndian(){return this.littleEndian=!1,this}skip(t=1){return this.offset+=t,this}back(t=1){return this.offset-=t,this}seek(t){return this.offset=t,this}mark(){return this._mark=this.offset,this}reset(){return this.offset=this._mark,this}pushMark(){return this._marks.push(this.offset),this}popMark(){const t=this._marks.pop();if(void 0===t)throw new Error("Mark stack empty");return this.seek(t),this}rewind(){return this.offset=0,this}ensureAvailable(t=1){if(!this.available(t)){const e=2*(this.offset+t),r=new Uint8Array(e);r.set(new Uint8Array(this.buffer)),this.buffer=r.buffer,this.length=this.byteLength=e,this._data=new DataView(this.buffer)}return this}readBoolean(){return 0!==this.readUint8()}readInt8(){return this._data.getInt8(this.offset++)}readUint8(){return this._data.getUint8(this.offset++)}readByte(){return this.readUint8()}readBytes(t=1){return this.readArray(t,"uint8")}readArray(t,e){const r=o[e].BYTES_PER_ELEMENT*t,n=this.byteOffset+this.offset,a=this.buffer.slice(n,n+r);if(this.littleEndian===i&&"uint8"!==e&&"int8"!==e){const t=new Uint8Array(this.buffer.slice(n,n+r));t.reverse();const i=new o[e](t.buffer);return this.offset+=r,i.reverse(),i}const s=new o[e](a);return this.offset+=r,s}readInt16(){const t=this._data.getInt16(this.offset,this.littleEndian);return this.offset+=2,t}readUint16(){const t=this._data.getUint16(this.offset,this.littleEndian);return this.offset+=2,t}readInt32(){const t=this._data.getInt32(this.offset,this.littleEndian);return this.offset+=4,t}readUint32(){const t=this._data.getUint32(this.offset,this.littleEndian);return this.offset+=4,t}readFloat32(){const t=this._data.getFloat32(this.offset,this.littleEndian);return this.offset+=4,t}readFloat64(){const t=this._data.getFloat64(this.offset,this.littleEndian);return this.offset+=8,t}readBigInt64(){const t=this._data.getBigInt64(this.offset,this.littleEndian);return this.offset+=8,t}readBigUint64(){const t=this._data.getBigUint64(this.offset,this.littleEndian);return this.offset+=8,t}readChar(){return String.fromCharCode(this.readInt8())}readChars(t=1){let e="";for(let r=0;rthis.lastWrittenByte&&(this.lastWrittenByte=this.offset)}}},"./node_modules/iobuffer/lib-esm/text-encoding-polyfill.js":function(){"use strict";!function(t){if(t.TextEncoder&&t.TextDecoder)return!1;function e(t="utf-8"){if("utf-8"!==t)throw new RangeError(`Failed to construct 'TextEncoder': The encoding label provided ('${t}') is invalid.`)}function r(t="utf-8",e={fatal:!1}){if("utf-8"!==t)throw new RangeError(`Failed to construct 'TextDecoder': The encoding label provided ('${t}') is invalid.`);if(e.fatal)throw new Error("Failed to construct 'TextDecoder': the 'fatal' option is unsupported.")}Object.defineProperty(e.prototype,"encoding",{value:"utf-8"}),e.prototype.encode=function(t,e={stream:!1}){if(e.stream)throw new Error("Failed to encode: the 'stream' option is unsupported.");let r=0;const n=t.length;let i=0,o=Math.max(32,n+(n>>1)+7),a=new Uint8Array(o>>3<<3);for(;r=55296&&e<=56319){if(r=55296&&e<=56319)continue}if(i+4>a.length){o+=8,o*=1+r/t.length*2,o=o>>3<<3;const e=new Uint8Array(o);e.set(a),a=e}if(4294967168&e){if(4294965248&e)if(4294901760&e){if(4292870144&e)continue;a[i++]=e>>18&7|240,a[i++]=e>>12&63|128,a[i++]=e>>6&63|128}else a[i++]=e>>12&15|224,a[i++]=e>>6&63|128;else a[i++]=e>>6&31|192;a[i++]=63&e|128}else a[i++]=e}return a.slice(0,i)},Object.defineProperty(r.prototype,"encoding",{value:"utf-8"}),Object.defineProperty(r.prototype,"fatal",{value:!1}),Object.defineProperty(r.prototype,"ignoreBOM",{value:!1}),r.prototype.decode=function(t,e={stream:!1}){if(e.stream)throw new Error("Failed to decode: the 'stream' option is unsupported.");const r=new Uint8Array(t);let n=0;const i=r.length,o=[];for(;n65535&&(e-=65536,o.push(e>>>10&1023|55296),e=56320|1023&e),o.push(e)}}else o.push(t)}return String.fromCharCode.apply(null,o)},t.TextEncoder=e,t.TextDecoder=r}("undefined"!=typeof window?window:"undefined"!=typeof self?self:this)},"./node_modules/iobuffer/lib-esm/text.browser.js":(t,e,r)=>{"use strict";function n(t,e="utf8"){return new TextDecoder(e).decode(t)}r.r(e),r.d(e,{decode:()=>n,encode:()=>o}),r("./node_modules/iobuffer/lib-esm/text-encoding-polyfill.js");const i=new TextEncoder;function o(t){return i.encode(t)}},"./node_modules/netcdfjs/lib-esm/data.js":(t,e,r)=>{"use strict";r.r(e),r.d(e,{nonRecord:()=>i,record:()=>o});var n=r("./node_modules/netcdfjs/lib-esm/types.js");function i(t,e){const r=(0,n.str2num)(e.type),i=e.size/(0,n.num2bytes)(r),o=new Array(i);for(let e=0;e{"use strict";r.r(e),r.d(e,{header:()=>u});var n=r("./node_modules/netcdfjs/lib-esm/types.js"),i=r("./node_modules/netcdfjs/lib-esm/utils.js");const o=0,a=10,s=11,l=12,c=0;function u(t,e){const r={version:e},l={length:t.readUint32()},u=function(t){const e={};let r,n;const s=t.readUint32();let l;if(s===o)return(0,i.notNetcdf)(t.readUint32()!==o,"wrong empty tag for list of dimensions"),[];{(0,i.notNetcdf)(s!==a,"wrong tag for list of dimensions");const e=t.readUint32();l=new Array(e);for(let o=0;o6,`non valid type ${f}`);const p=t.readUint32();let m=t.readUint32();2===r&&((0,i.notNetcdf)(m>0,"offsets larger than 4GB not supported"),m=t.readUint32());let g=!1;void 0!==e&&u[0]===e&&(c+=p,g=!0),l[a]={name:o,dimensions:u,attributes:d,type:(0,n.num2str)(f),size:p,offset:m,record:g}}}return{variables:l,recordStep:c}}(t,l?.id,e);return Array.isArray(d)||(r.variables=d.variables,l.recordStep=d.recordStep),r.recordDimension=l,r}function h(t){const e=t.readUint32();let r;if(e===o)return(0,i.notNetcdf)(t.readUint32()!==o,"wrong empty tag for list of attributes"),[];{(0,i.notNetcdf)(e!==l,"wrong tag for list of attributes");const o=t.readUint32();r=new Array(o);for(let e=0;e6,`non valid type ${a}`);const s=t.readUint32(),l=(0,n.readType)(t,a,s);(0,i.padding)(t),r[e]={name:o,type:(0,n.num2str)(a),value:l}}}return r}},"./node_modules/netcdfjs/lib-esm/index.js":(t,e,r)=>{"use strict";r.r(e),r.d(e,{NetCDFReader:()=>n.NetCDFReader});var n=r("./node_modules/netcdfjs/lib-esm/parser.js")},"./node_modules/netcdfjs/lib-esm/parser.js":(t,e,r)=>{"use strict";r.r(e),r.d(e,{NetCDFReader:()=>l});var n=r("./node_modules/iobuffer/lib-esm/IOBuffer.js"),i=r("./node_modules/netcdfjs/lib-esm/data.js"),o=r("./node_modules/netcdfjs/lib-esm/header.js"),a=r("./node_modules/netcdfjs/lib-esm/toString.js"),s=r("./node_modules/netcdfjs/lib-esm/utils.js");class l{constructor(t){this.toString=a.toString;const e=new n.IOBuffer(t);e.setBigEndian(),(0,s.notNetcdf)("CDF"!==e.readChars(3),"should start with CDF");const r=e.readByte();(0,s.notNetcdf)(r>2,"unknown version"),this.header=(0,o.header)(e,r),this.buffer=e}get version(){return 1===this.header.version?"classic format":"64-bit offset format"}get recordDimension(){return this.header.recordDimension}get dimensions(){return this.header.dimensions}get globalAttributes(){return this.header.globalAttributes}getAttribute(t){const e=this.globalAttributes.find((e=>e.name===t));return e?e.value:null}getDataVariableAsString(t){const e=this.getDataVariable(t);return e?e.join(""):null}get variables(){return this.header.variables}getDataVariable(t){let e;if(e="string"==typeof t?this.header.variables.find((e=>e.name===t)):t,void 0===e)throw new Error("Not a valid NetCDF v3.x file: variable not found");return this.buffer.seek(e.offset),e.record?(0,i.record)(this.buffer,e,this.header.recordDimension):(0,i.nonRecord)(this.buffer,e)}dataVariableExists(t){return void 0!==this.header.variables.find((e=>e.name===t))}attributeExists(t){return void 0!==this.globalAttributes.find((e=>e.name===t))}}},"./node_modules/netcdfjs/lib-esm/toString.js":(t,e,r)=>{"use strict";function n(){const t=[];t.push("DIMENSIONS");for(const e of this.dimensions)t.push(` ${e.name.padEnd(30)} = size: ${e.size}`);t.push(""),t.push("GLOBAL ATTRIBUTES");for(const e of this.globalAttributes)t.push(` ${e.name.padEnd(30)} = ${e.value}`);const e=JSON.parse(JSON.stringify(this.variables));t.push(""),t.push("VARIABLES:");for(const r of e){r.value=this.getDataVariable(r);let e=JSON.stringify(r.value);e.length>50&&(e=e.substring(0,50)),isNaN(r.value.length)||(e+=` (length: ${r.value.length})`),t.push(` ${r.name.padEnd(30)} = ${e}`)}return t.join("\n")}r.r(e),r.d(e,{toString:()=>n})},"./node_modules/netcdfjs/lib-esm/types.js":(t,e,r)=>{"use strict";r.r(e),r.d(e,{num2bytes:()=>o,num2str:()=>i,readType:()=>l,str2num:()=>a});const n={BYTE:1,CHAR:2,SHORT:3,INT:4,FLOAT:5,DOUBLE:6};function i(t){switch(Number(t)){case n.BYTE:return"byte";case n.CHAR:return"char";case n.SHORT:return"short";case n.INT:return"int";case n.FLOAT:return"float";case n.DOUBLE:return"double";default:return"undefined"}}function o(t){switch(Number(t)){case n.BYTE:case n.CHAR:return 1;case n.SHORT:return 2;case n.INT:case n.FLOAT:return 4;case n.DOUBLE:return 8;default:return-1}}function a(t){switch(String(t)){case"byte":return n.BYTE;case"char":return n.CHAR;case"short":return n.SHORT;case"int":return n.INT;case"float":return n.FLOAT;case"double":return n.DOUBLE;default:return-1}}function s(t,e){if(1!==t){const r=new Array(t);for(let n=0;n{"use strict";function n(t,e){if(t)throw new TypeError(`Not a valid NetCDF v3.x file: ${e}`)}function i(t){t.offset%4!=0&&t.skip(4-t.offset%4)}function o(t){const e=t.readUint32(),r=t.readChars(e);return i(t),r}r.r(e),r.d(e,{notNetcdf:()=>n,padding:()=>i,readName:()=>o})},"./src/WebGL/shaders/lib/basic/basic.frag":(t,e,r)=>{"use strict";r.r(e),r.d(e,{default:()=>n});const n="uniform mat4 viewMatrix;\nuniform float opacity;\nuniform vec3 fogColor;\nuniform float fogNear;\nuniform float fogFar;\nvarying vec3 vColor;\n//DEFINEFRAGCOLOR\nvoid main() {\n gl_FragColor = vec4( vColor, opacity );\n float depth = gl_FragCoord.z / gl_FragCoord.w;\n float fogFactor = smoothstep( fogNear, fogFar, depth );\n gl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );\n}"},"./src/WebGL/shaders/lib/basic/basic.vert":(t,e,r)=>{"use strict";r.r(e),r.d(e,{default:()=>n});const n="uniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\nuniform mat3 normalMatrix;\n\nattribute vec3 position;\nattribute vec3 color;\n\nvarying vec3 vColor;\n\nvoid main() {\n\n vColor = color;\n vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\n gl_Position = projectionMatrix * mvPosition;\n\n}"},"./src/WebGL/shaders/lib/instanced/instanced.frag":(t,e,r)=>{"use strict";r.r(e),r.d(e,{default:()=>n});const n="uniform mat4 viewMatrix;\nuniform float opacity;\n\nuniform vec3 fogColor;\nuniform float fogNear;\nuniform float fogFar;\n\nvarying vec3 vLightFront;\nvarying vec3 vColor;\n//DEFINEFRAGCOLOR\n\nvoid main() {\n\n gl_FragColor = vec4( vec3 ( 1.0 ), opacity );\n\n #ifndef WIREFRAME\n gl_FragColor.xyz *= vLightFront;\n #endif\n\n gl_FragColor = gl_FragColor * vec4( vColor, opacity );\n float depth = gl_FragCoord.z / gl_FragCoord.w;\n\n float fogFactor = smoothstep( fogNear, fogFar, depth );\n\n gl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );\n\n}\n\n\n"},"./src/WebGL/shaders/lib/instanced/instanced.vert":(t,e,r)=>{"use strict";r.r(e),r.d(e,{default:()=>n});const n="\n\nuniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\nuniform mat3 normalMatrix;\nuniform vec3 directionalLightColor[ 1 ];\nuniform vec3 directionalLightDirection[ 1 ];\n\nattribute vec3 offset;\nattribute vec3 position;\nattribute vec3 normal;\nattribute vec3 color;\nattribute float radius;\n\nvarying vec3 vColor;\nvarying vec3 vLightFront;\n\nvoid main() {\n\n vColor = color;\n\n vec3 objectNormal = normal;\n vec3 transformedNormal = normalMatrix * objectNormal;\n vec4 mvPosition = modelViewMatrix * vec4( position * radius + offset, 1.0 );\n\n vLightFront = vec3( 0.0 );\n\n transformedNormal = normalize( transformedNormal );\n\n vec4 lDirection = viewMatrix * vec4( directionalLightDirection[ 0 ], 0.0 );\n vec3 dirVector = normalize( lDirection.xyz );\n float dotProduct = dot( transformedNormal, dirVector );\n vec3 directionalLightWeighting = vec3( max( dotProduct, 0.0 ) );\n\n vLightFront += directionalLightColor[ 0 ] * directionalLightWeighting;\n\n gl_Position = projectionMatrix * mvPosition;\n}\n\n"},"./src/WebGL/shaders/lib/lambert/lambert.frag":(t,e,r)=>{"use strict";r.r(e),r.d(e,{default:()=>n});const n="uniform mat4 viewMatrix;\nuniform float opacity;\n\nuniform vec3 fogColor;\nuniform float fogNear;\nuniform float fogFar;\n\nvarying vec3 vLightFront;\nvarying vec3 vColor;\n//DEFINEFRAGCOLOR\n\nvoid main() {\n\n gl_FragColor = vec4( vec3 ( 1.0 ), opacity );\n\n #ifndef WIREFRAME\n gl_FragColor.xyz *= vLightFront;\n #endif\n\n gl_FragColor = gl_FragColor * vec4( vColor, opacity );\n float depth = gl_FragCoord.z / gl_FragCoord.w;\n\n float fogFactor = smoothstep( fogNear, fogFar, depth );\n\n gl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );\n\n}"},"./src/WebGL/shaders/lib/lambert/lambert.vert":(t,e,r)=>{"use strict";r.r(e),r.d(e,{default:()=>n});const n="\nuniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\nuniform mat3 normalMatrix;\nuniform vec3 directionalLightColor[ 1 ];\nuniform vec3 directionalLightDirection[ 1 ];\n\nattribute vec3 position;\nattribute vec3 normal;\nattribute vec3 color;\n\nvarying vec3 vColor;\nvarying vec3 vLightFront;\n\nvoid main() {\n\n vColor = color;\n\n vec3 objectNormal = normal;\n vec3 transformedNormal = normalMatrix * objectNormal;\n vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\n\n vLightFront = vec3( 0.0 );\n\n transformedNormal = normalize( transformedNormal );\n\n vec4 lDirection = viewMatrix * vec4( directionalLightDirection[ 0 ], 0.0 );\n vec3 dirVector = normalize( lDirection.xyz );\n float dotProduct = dot( transformedNormal, dirVector );\n vec3 directionalLightWeighting = vec3( max( dotProduct, 0.0 ) );\n\n vLightFront += directionalLightColor[ 0 ] * directionalLightWeighting;\n\n gl_Position = projectionMatrix * mvPosition;\n}"},"./src/WebGL/shaders/lib/lambertdouble/lambertdouble.frag":(t,e,r)=>{"use strict";r.r(e),r.d(e,{default:()=>n});const n="\n\nuniform mat4 viewMatrix;\nuniform float opacity;\n\nuniform vec3 fogColor;\nuniform float fogNear;\nuniform float fogFar;\n\nvarying vec3 vLightFront;\nvarying vec3 vLightBack;\n\nvarying vec3 vColor;\n//DEFINEFRAGCOLOR\n\nvoid main() {\n\n gl_FragColor = vec4( vec3 ( 1.0 ), opacity );\n\n #ifndef WIREFRAME\n if ( gl_FrontFacing )\n gl_FragColor.xyz *= vLightFront;\n else\n gl_FragColor.xyz *= vLightBack;\n #endif\n\n gl_FragColor = gl_FragColor * vec4( vColor, opacity );\n float depth = gl_FragCoord.z / gl_FragCoord.w;\n\n float fogFactor = smoothstep( fogNear, fogFar, depth );\n\n gl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );\n\n}\n\n\n"},"./src/WebGL/shaders/lib/lambertdouble/lambertdouble.vert":(t,e,r)=>{"use strict";r.r(e),r.d(e,{default:()=>n});const n="\n\nuniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\nuniform mat3 normalMatrix;\nuniform vec3 directionalLightColor[ 1 ];\nuniform vec3 directionalLightDirection[ 1 ];\n\nattribute vec3 position;\nattribute vec3 normal;\nattribute vec3 color;\n\nvarying vec3 vColor;\nvarying vec3 vLightFront;\nvarying vec3 vLightBack;\n\nvoid main() {\n\n vColor = color;\n\n vec3 objectNormal = normal;\n vec3 transformedNormal = normalMatrix * objectNormal;\n vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\n\n vLightFront = vec3( 0.0 );\n vLightBack = vec3( 0.0 );\n\n transformedNormal = normalize( transformedNormal );\n\n vec4 lDirection = viewMatrix * vec4( directionalLightDirection[ 0 ], 0.0 );\n vec3 dirVector = normalize( lDirection.xyz );\n float dotProduct = dot( transformedNormal, dirVector );\n vec3 directionalLightWeighting = vec3( max( dotProduct, 0.0 ) );\n vec3 directionalLightWeightingBack = vec3( max( -dotProduct, 0.0 ) );\n\n vLightFront += directionalLightColor[ 0 ] * directionalLightWeighting;\n vLightBack += directionalLightColor[ 0 ] * directionalLightWeightingBack;\n\n gl_Position = projectionMatrix * mvPosition;\n}\n\n"},"./src/WebGL/shaders/lib/outline/outline.frag":(t,e,r)=>{"use strict";r.r(e),r.d(e,{default:()=>n});const n="\n\nuniform float opacity;\nuniform vec3 outlineColor;\nuniform vec3 fogColor;\nuniform float fogNear;\nuniform float fogFar;\n//DEFINEFRAGCOLOR\n\nvoid main() {\n gl_FragColor = vec4( outlineColor, 1 );\n}\n\n\n"},"./src/WebGL/shaders/lib/outline/outline.vert":(t,e,r)=>{"use strict";r.r(e),r.d(e,{default:()=>n});const n="\n\nuniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform float outlineWidth;\nuniform float outlinePushback;\n\nattribute vec3 position;\nattribute vec3 normal;\nattribute vec3 color;\n\nvoid main() {\n\n vec4 norm = modelViewMatrix*vec4(normalize(normal),0.0);\n vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\n mvPosition.xy += norm.xy*outlineWidth;\n gl_Position = projectionMatrix * mvPosition;\n mvPosition.z -= outlinePushback; //go backwards in model space\n vec4 pushpos = projectionMatrix*mvPosition; //project to get z in projection space, I'm probably missing some simple math to do the same thing..\n gl_Position.z = gl_Position.w*pushpos.z/pushpos.w;\n}\n\n"},"./src/WebGL/shaders/lib/screen/screen.frag":(t,e,r)=>{"use strict";r.r(e),r.d(e,{default:()=>n});const n="uniform sampler2D colormap;\nvarying highp vec2 vTexCoords;\nuniform vec2 dimensions;\n//DEFINEFRAGCOLOR\nvoid main (void) {\n gl_FragColor = texture2D(colormap, vTexCoords);\n}\n "},"./src/WebGL/shaders/lib/screen/screen.vert":(t,e,r)=>{"use strict";r.r(e),r.d(e,{default:()=>n});const n="attribute vec2 vertexPosition;\nvarying highp vec2 vTexCoords;\nconst vec2 scale = vec2(0.5, 0.5);\n\nvoid main() {\n vTexCoords = vertexPosition * scale + scale; // scale vertex attribute to [0,1] range\n gl_Position = vec4(vertexPosition, 0.0, 1.0);\n}\n "},"./src/WebGL/shaders/lib/screenaa/screenaa.frag":(t,e,r)=>{"use strict";r.r(e),r.d(e,{default:()=>n});const n="uniform sampler2D colormap;\nvarying highp vec2 vTexCoords;\nuniform vec2 dimensions;\n\n// Basic FXAA implementation based on the code on geeks3d.com \n#define FXAA_REDUCE_MIN (1.0/ 128.0)\n#define FXAA_REDUCE_MUL (1.0 / 8.0)\n#define FXAA_SPAN_MAX 8.0\n\nvec4 applyFXAA(vec2 fragCoord, sampler2D tex)\n{\n vec4 color;\n vec2 inverseVP = vec2(1.0 / dimensions.x, 1.0 / dimensions.y);\n vec3 rgbNW = texture2D(tex, fragCoord + vec2(-1.0, -1.0) * inverseVP).xyz;\n vec3 rgbNE = texture2D(tex, fragCoord + vec2(1.0, -1.0) * inverseVP).xyz;\n vec3 rgbSW = texture2D(tex, fragCoord + vec2(-1.0, 1.0) * inverseVP).xyz;\n vec3 rgbSE = texture2D(tex, fragCoord + vec2(1.0, 1.0) * inverseVP).xyz;\n vec3 rgbM = texture2D(tex, fragCoord * inverseVP).xyz;\n vec3 luma = vec3(0.299, 0.587, 0.114);\n float lumaNW = dot(rgbNW, luma);\n float lumaNE = dot(rgbNE, luma);\n float lumaSW = dot(rgbSW, luma);\n float lumaSE = dot(rgbSE, luma);\n float lumaM = dot(rgbM, luma);\n float lumaMin = min(lumaM, min(min(lumaNW, lumaNE), min(lumaSW, lumaSE)));\n float lumaMax = max(lumaM, max(max(lumaNW, lumaNE), max(lumaSW, lumaSE)));\n\n vec2 dir;\n dir.x = -((lumaNW + lumaNE) - (lumaSW + lumaSE));\n dir.y = ((lumaNW + lumaSW) - (lumaNE + lumaSE));\n\n float dirReduce = max((lumaNW + lumaNE + lumaSW + lumaSE) *\n (0.25 * FXAA_REDUCE_MUL), FXAA_REDUCE_MIN);\n\n float rcpDirMin = 1.0 / (min(abs(dir.x), abs(dir.y)) + dirReduce);\n dir = min(vec2(FXAA_SPAN_MAX, FXAA_SPAN_MAX),\n max(vec2(-FXAA_SPAN_MAX, -FXAA_SPAN_MAX),\n dir * rcpDirMin)) * inverseVP;\n\n vec3 rgbA = 0.5 * (\n texture2D(tex, fragCoord + dir * (1.0 / 3.0 - 0.5)).xyz +\n texture2D(tex, fragCoord + dir * (2.0 / 3.0 - 0.5)).xyz);\n vec3 rgbB = rgbA * 0.5 + 0.25 * (\n texture2D(tex, fragCoord + dir * -0.5).xyz +\n texture2D(tex, fragCoord + dir * 0.5).xyz);\n\n float lumaB = dot(rgbB, luma);\n if ((lumaB < lumaMin) || (lumaB > lumaMax))\n color = vec4(rgbA, 1.0);\n else\n color = vec4(rgbB, 1.0);\n return color;\n}\n//DEFINEFRAGCOLOR\nvoid main (void) {\n gl_FragColor = applyFXAA(vTexCoords, colormap);\n}\n "},"./src/WebGL/shaders/lib/screenaa/screenaa.vert":(t,e,r)=>{"use strict";r.r(e),r.d(e,{default:()=>n});const n="attribute vec2 vertexPosition;\nvarying highp vec2 vTexCoords;\nconst vec2 scale = vec2(0.5, 0.5);\n\nvoid main() {\n vTexCoords = vertexPosition * scale + scale; // scale vertex attribute to [0,1] range\n gl_Position = vec4(vertexPosition, 0.0, 1.0);\n}\n "},"./src/WebGL/shaders/lib/sphereimposter/sphereimposter.frag":(t,e,r)=>{"use strict";r.r(e),r.d(e,{default:()=>n});const n="\nuniform mat4 viewMatrix;\nuniform float opacity;\nuniform mat4 projectionMatrix;\n\nuniform vec3 fogColor;\nuniform float fogNear;\nuniform float fogFar;\nuniform float uDepth;\nuniform vec3 directionalLightColor[ 1 ];\n\nvarying vec3 vColor;\nvarying vec2 mapping;\nvarying float rval;\nvarying vec3 vLight;\nvarying vec3 center;\n\n//DEFINEFRAGCOLOR\n\nvoid main() {\n float lensqr = dot(mapping,mapping);\n float rsqr = rval*rval;\n if(lensqr > rsqr)\n discard;\n float z = sqrt(rsqr-lensqr);\n vec3 cameraPos = center+ vec3(mapping.x,mapping.y,z);\n vec4 clipPos = projectionMatrix * vec4(cameraPos, 1.0);\n float ndcDepth = clipPos.z / clipPos.w;\n gl_FragDepthEXT = ((gl_DepthRange.diff * ndcDepth) + gl_DepthRange.near + gl_DepthRange.far) / 2.0;\n vec3 norm = normalize(vec3(mapping.x,mapping.y,z));\n float dotProduct = dot( norm, vLight );\n vec3 directionalLightWeighting = vec3( max( dotProduct, 0.0 ) );\n vec3 vLight = directionalLightColor[ 0 ] * directionalLightWeighting;\n gl_FragColor = vec4(vLight*vColor, opacity*opacity );\n float fogFactor = smoothstep( fogNear, fogFar, gl_FragDepthEXT/gl_FragCoord.w );\n gl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );\n\n\n}\n\n"},"./src/WebGL/shaders/lib/sphereimposter/sphereimposter.vert":(t,e,r)=>{"use strict";r.r(e),r.d(e,{default:()=>n});const n="uniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\nuniform mat3 normalMatrix;\nuniform vec3 directionalLightColor[ 1 ];\nuniform vec3 directionalLightDirection[ 1 ];\n\nattribute vec3 position;\nattribute vec3 normal;\nattribute vec3 color;\n\nvarying vec2 mapping;\nvarying vec3 vColor;\nvarying float rval;\nvarying vec3 vLight;\nvarying vec3 center;\n\nvoid main() {\n\n vColor = color;\n vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\n center = mvPosition.xyz;\n vec4 projPosition = projectionMatrix * mvPosition;\n vec4 adjust = projectionMatrix* vec4(normal,0.0); adjust.z = 0.0; adjust.w = 0.0;\n vec4 lDirection = viewMatrix * vec4( directionalLightDirection[ 0 ], 0.0 );\n vLight = normalize( lDirection.xyz );\n mapping = normal.xy;\n rval = abs(normal.x);\n gl_Position = projPosition+adjust;\n\n}\n"},"./src/WebGL/shaders/lib/sphereimposteroutline/sphereimposteroutline.frag":(t,e,r)=>{"use strict";r.r(e),r.d(e,{default:()=>n});const n="\n\nuniform float opacity;\nuniform vec3 outlineColor;\nuniform vec3 fogColor;\nuniform float fogNear;\nuniform float fogFar;\nuniform mat4 projectionMatrix;\nvarying vec2 mapping;\nvarying float rval;\nvarying vec3 center;\n\nuniform float outlinePushback;\n\n//DEFINEFRAGCOLOR\n\nvoid main() {\n float lensqr = dot(mapping,mapping);\n float rsqr = rval*rval;\n if(lensqr > rsqr)\n discard;\n float z = sqrt(rsqr-lensqr);\n vec3 cameraPos = center+ vec3(mapping.x,mapping.y,z-outlinePushback);\n vec4 clipPos = projectionMatrix * vec4(cameraPos, 1.0);\n float ndcDepth = clipPos.z / clipPos.w;\n gl_FragDepthEXT = ((gl_DepthRange.diff * ndcDepth) + gl_DepthRange.near + gl_DepthRange.far) / 2.0;\n gl_FragColor = vec4(outlineColor, 1 );\n}\n\n\n"},"./src/WebGL/shaders/lib/sphereimposteroutline/sphereimposteroutline.vert":(t,e,r)=>{"use strict";r.r(e),r.d(e,{default:()=>n});const n="\n\nuniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform float outlineWidth;\nuniform float outlinePushback;\n\nattribute vec3 position;\nattribute vec3 normal;\nattribute vec3 color;\n\nvarying vec2 mapping;\nvarying float rval;\nvarying vec3 center;\n\nvoid main() {\n\n vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\n center = mvPosition.xyz;\n vec4 projPosition = projectionMatrix * mvPosition;\n vec2 norm = normal.xy + vec2(sign(normal.x)*outlineWidth,sign(normal.y)*outlineWidth);\n vec4 adjust = projectionMatrix* vec4(norm,normal.z,0.0); adjust.z = 0.0; adjust.w = 0.0;\n mapping = norm.xy;\n rval = abs(norm.x);\n gl_Position = projPosition+adjust;\n}\n\n"},"./src/WebGL/shaders/lib/sprite/sprite.frag":(t,e,r)=>{"use strict";r.r(e),r.d(e,{default:()=>n});const n="\n\nuniform vec3 color;\nuniform sampler2D map;\nuniform float opacity;\n\nuniform int fogType;\nuniform vec3 fogColor;\nuniform float fogDensity;\nuniform float fogNear;\nuniform float fogFar;\nuniform float alphaTest;\n\nvarying vec2 vUV;\n//DEFINEFRAGCOLOR\n\nvoid main() {\n\n vec4 texture = texture2D(map, vUV);\n\n if (texture.a < alphaTest) discard;\n\n gl_FragColor = vec4(color * texture.xyz, texture.a * opacity);\n\n if (fogType > 0) {\n\n float depth = gl_FragCoord.z / gl_FragCoord.w;\n float fogFactor = 0.0;\n\n if (fogType == 1) {\n fogFactor = smoothstep(fogNear, fogFar, depth);\n }\n\n else {\n const float LOG2 = 1.442695;\n float fogFactor = exp2(- fogDensity * fogDensity * depth * depth * LOG2);\n fogFactor = 1.0 - clamp(fogFactor, 0.0, 1.0);\n }\n\n gl_FragColor = mix(gl_FragColor, vec4(fogColor, gl_FragColor.w), fogFactor);\n\n }\n}\n\n"},"./src/WebGL/shaders/lib/sprite/sprite.vert":(t,e,r)=>{"use strict";r.r(e),r.d(e,{default:()=>n});const n="\n\nuniform int useScreenCoordinates;\nuniform vec3 screenPosition;\nuniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform float rotation;\nuniform vec2 scale;\nuniform vec2 alignment;\nuniform vec2 uvOffset;\nuniform vec2 uvScale;\n\nattribute vec2 position;\nattribute vec2 uv;\n\nvarying vec2 vUV;\n\nvoid main() {\n\n vUV = uvOffset + uv * uvScale;\n\n vec2 alignedPosition = position + alignment;\n\n vec2 rotatedPosition;\n rotatedPosition.x = ( cos(rotation) * alignedPosition.x - sin(rotation) * alignedPosition.y ) * scale.x;\n rotatedPosition.y = ( sin(rotation) * alignedPosition.x + cos(rotation) * alignedPosition.y ) * scale.y;\n\n vec4 finalPosition;\n\n if(useScreenCoordinates != 0) {\n finalPosition = vec4(screenPosition.xy + rotatedPosition, screenPosition.z, 1.0);\n }\n\n else {\n finalPosition = projectionMatrix * modelViewMatrix * vec4(0.0, 0.0, 0.0, 1.0); finalPosition /= finalPosition.w;\n finalPosition.xy += rotatedPosition; \n }\n\n gl_Position = finalPosition;\n\n}\n\n"},"./src/WebGL/shaders/lib/stickimposter/stickimposter.partial.frag":(t,e,r)=>{"use strict";r.r(e),r.d(e,{default:()=>n});const n=" float dotProduct = dot( norm, vLight );\n vec3 light = vec3( max( dotProduct, 0.0 ) );\n gl_FragColor = vec4(light*color, opacity*opacity );\n float fogFactor = smoothstep( fogNear, fogFar, depth );\n gl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );\n}"},"./src/WebGL/shaders/lib/stickimposter/stickimposter.vert":(t,e,r)=>{"use strict";r.r(e),r.d(e,{default:()=>n});const n="\n\nuniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\nuniform mat3 normalMatrix;\nuniform vec3 directionalLightColor[ 1 ];\nuniform vec3 directionalLightDirection[ 1 ];\n\nattribute vec3 position;\nattribute vec3 normal;\nattribute vec3 color;\nattribute float radius;\n\nvarying vec3 vColor;\nvarying vec3 vLight;\nvarying vec3 cposition;\nvarying vec3 p1;\nvarying vec3 p2;\nvarying float r;\n\nvoid main() {\n\n vColor = color; vColor.z = abs(vColor.z); //z indicates which vertex and so would vary\n r = abs(radius);\n vec4 to = modelViewMatrix*vec4(normal, 1.0); //normal is other point of cylinder\n vec4 pt = modelViewMatrix*vec4(position, 1.0);\n vec4 mvPosition = pt;\n p1 = pt.xyz; p2 = to.xyz;\n vec3 norm = to.xyz-pt.xyz;\n float mult = 1.1; //slop to account for perspective of sphere\n if(length(p1) > length(p2)) { //billboard at level of closest point\n mvPosition = to;\n }\n vec3 n = normalize(mvPosition.xyz);\n//intersect with the plane defined by the camera looking at the billboard point\n if(color.z >= 0.0) { //p1\n if(projectionMatrix[3][3] == 0.0) { //perspective\n vec3 pnorm = normalize(p1);\n float t = dot(mvPosition.xyz-p1,n)/dot(pnorm,n);\n mvPosition.xyz = p1+t*pnorm; \n } else { //orthographic\n mvPosition.xyz = p1;\n }\n } else {\n if(projectionMatrix[3][3] == 0.0) { //perspective\n vec3 pnorm = normalize(p2);\n float t = dot(mvPosition.xyz-p2,n)/dot(pnorm,n);\n mvPosition.xyz = p2+t*pnorm;\n } else { //orthographic\n mvPosition.xyz = p2;\n } \n mult *= -1.0;\n }\n vec3 cr = normalize(cross(mvPosition.xyz,norm))*radius;\n vec3 doublecr = normalize(cross(mvPosition.xyz,cr))*radius;\n mvPosition.xyz += mult*(cr + doublecr).xyz;\n cposition = mvPosition.xyz;\n gl_Position = projectionMatrix * mvPosition;\n vec4 lDirection = viewMatrix * vec4( directionalLightDirection[ 0 ], 0.0 );\n vLight = normalize( lDirection.xyz )*directionalLightColor[0]; //not really sure this is right, but color is always white so..\n}\n\n"},"./src/WebGL/shaders/lib/stickimposteroutline/stickimposteroutline.vert":(t,e,r)=>{"use strict";r.r(e),r.d(e,{default:()=>n});const n="\n\nuniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\nuniform mat3 normalMatrix;\nuniform vec3 directionalLightColor[ 1 ];\nuniform vec3 directionalLightDirection[ 1 ];\nuniform vec3 outlineColor;\nuniform float outlineWidth;\nuniform float outlinePushback;\n\n\nattribute vec3 position;\nattribute vec3 normal;\nattribute vec3 color;\nattribute float radius;\n\nvarying vec3 vColor;\nvarying vec3 vLight;\nvarying vec3 cposition;\nvarying vec3 p1;\nvarying vec3 p2;\nvarying float r;\n\nvoid main() {\n\n vColor = outlineColor;\n float rad = radius+sign(radius)*outlineWidth;\n r = abs(rad);\n vec4 to = modelViewMatrix*vec4(normal, 1.0); //normal is other point of cylinder\n vec4 pt = modelViewMatrix*vec4(position, 1.0);\n//pushback\n to.xyz += normalize(to.xyz)*outlinePushback;\n pt.xyz += normalize(pt.xyz)*outlinePushback;\n\n vec4 mvPosition = pt;\n p1 = pt.xyz; p2 = to.xyz;\n vec3 norm = to.xyz-pt.xyz;\n float mult = 1.1; //slop to account for perspective of sphere\n if(length(p1) > length(p2)) { //billboard at level of closest point\n mvPosition = to;\n }\n vec3 n = normalize(mvPosition.xyz);\n//intersect with the plane defined by the camera looking at the billboard point\n if(color.z >= 0.0) { //p1\n vec3 pnorm = normalize(p1);\n float t = dot(mvPosition.xyz-p1,n)/dot(pnorm,n);\n mvPosition.xyz = p1+t*pnorm;\n } else {\n vec3 pnorm = normalize(p2);\n float t = dot(mvPosition.xyz-p2,n)/dot(pnorm,n);\n mvPosition.xyz = p2+t*pnorm;\n mult *= -1.0;\n }\n vec3 cr = normalize(cross(mvPosition.xyz,norm))*rad;\n vec3 doublecr = normalize(cross(mvPosition.xyz,cr))*rad;\n mvPosition.xy += mult*(cr + doublecr).xy;\n cposition = mvPosition.xyz;\n gl_Position = projectionMatrix * mvPosition;\n vLight = vec3(1.0,1.0,1.0);\n}\n\n"},"./src/WebGL/shaders/lib/volumetric/volumetric.frag":(t,e,r)=>{"use strict";r.r(e),r.d(e,{default:()=>n});const n="\nuniform highp sampler3D data;\nuniform highp sampler2D colormap;\nuniform highp sampler2D depthmap;\n\n\nuniform mat4 textmat;\nuniform mat4 projinv;\nuniform mat4 projectionMatrix;\n\nuniform float step;\nuniform float subsamples;\nuniform float maxdepth;\nuniform float transfermin;\nuniform float transfermax;\nin vec4 mvPosition;\nout vec4 color;\nvoid main(void) {\n\n vec4 pos = mvPosition;\n bool seengood = false;\n float i = 0.0;\n color = vec4(1,1,1,0);\n float increment = 1.0/subsamples;\n float maxsteps = (maxdepth*subsamples/step);\n//there's probably a better way to do this..\n//calculate farthest possible point in model coordinates\n vec4 maxpos = vec4(pos.x,pos.y,pos.z-maxdepth,1.0);\n// convert to projection\n maxpos = projectionMatrix*maxpos;\n vec4 startp = projectionMatrix*pos;\n// homogonize\n maxpos /= maxpos.w;\n startp /= startp.w;\n//take x,y from start and z from max\n maxpos = vec4(startp.x,startp.y,maxpos.z,1.0);\n//convert back to model space\n maxpos = projinv*maxpos;\n maxpos /= maxpos.w;\n float incr = step/subsamples;\n//get depth from depthmap\n//startp is apparently [-1,1]\n vec2 tpos = startp.xy/2.0+0.5;\n float depth = texture(depthmap, tpos).r;\n//compute vector between start and end\n vec4 direction = maxpos-pos;\n for( i = 0.0; i <= maxsteps; i++) {\n vec4 pt = (pos+(i/maxsteps)*direction);\n vec4 ppt = projectionMatrix*pt;\n float ptdepth = ppt.z/ppt.w;\n ptdepth = ((gl_DepthRange.diff * ptdepth) + gl_DepthRange.near + gl_DepthRange.far) / 2.0;\n if(ptdepth > depth) break;\n pt = textmat*pt;\n// pt /= pt.w;\n if(pt.x >= -0.01 && pt.y >= -0.01 && pt.z >= -0.01 && pt.x <= 1.01 && pt.y <= 1.01 && pt.z <= 1.01) {\n seengood = true;\n } else if(seengood) {\n break;\n }\n if( pt.x < -0.01 || pt.x > 1.01 || pt.y < -0.01 || pt.y > 1.01 || pt.z < -0.01 || pt.z > 1.01 ){\n color.a = 0.0;\n continue;\n }\n else {\n float val = texture(data, pt.zyx).r;\n if(isinf(val)) continue; //masked out\n float cval = (val-transfermin)/(transfermax-transfermin); //scale to texture 0-1 range\n vec4 val_color = texture(colormap, vec2(cval,0.5));\n color.rgb = color.rgb*color.a + (1.0-color.a)*val_color.a*val_color.rgb;\n color.a += (1.0 - color.a) * val_color.a; \n if(color.a > 0.0) color.rgb /= color.a;\n// color = vec4(pt.x, pt.y, pt.z, 1.0);\n }\n// color = vec4(pt.x, pt.y, pt.z, 0.0)\n }\n}\n\n "},"./src/WebGL/shaders/lib/volumetric/volumetric.vert":(t,e,r)=>{"use strict";r.r(e),r.d(e,{default:()=>n});const n="uniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\n\nin vec3 position;\nout vec4 mvPosition;\nvoid main() {\n\n mvPosition = modelViewMatrix * vec4( position, 1.0 );\n gl_Position = projectionMatrix*mvPosition;\n}\n"},"./src/WebGL/shaders/utils/stickimposterFragmentShader.partial.frag":(t,e,r)=>{"use strict";r.r(e),r.d(e,{default:()=>n});const n="uniform float opacity;\nuniform mat4 projectionMatrix;\n\nuniform vec3 fogColor;\nuniform float fogNear;\nuniform float fogFar;\n\nvarying vec3 vLight;\nvarying vec3 vColor;\nvarying vec3 cposition;\nvarying vec3 p1;\nvarying vec3 p2;\nvarying float r;\n\n//DEFINEFRAGCOLOR\n\n//cylinder-ray intersection testing taken from http://mrl.nyu.edu/~dzorin/cg05/lecture12.pdf\n//also useful: http://stackoverflow.com/questions/9595300/cylinder-impostor-in-glsl\n//with a bit more care (caps) this could be a general cylinder imposter (see also outline)\nvoid main() {\n vec3 color = abs(vColor);\n vec3 pos = cposition;\n vec3 p = pos; //ray point\n vec3 v = vec3(0.0,0.0,-1.0); //ray normal - orthographic\n if(projectionMatrix[3][3] == 0.0) v = normalize(pos); //ray normal - perspective\n vec3 pa = p1; //cyl start\n vec3 va = normalize(p2-p1); //cyl norm\n vec3 tmp1 = v-(dot(v,va)*va);\n vec3 deltap = p-pa;\n float A = dot(tmp1,tmp1);\n if(A == 0.0) discard;\n vec3 tmp2 = deltap-(dot(deltap,va)*va);\n float B = 2.0*dot(tmp1, tmp2);\n float C = dot(tmp2,tmp2)-r*r;\n//quadratic equation!\n float det = (B*B) - (4.0*A*C);\n if(det < 0.0) discard;\n float sqrtDet = sqrt(det);\n float posT = (-B+sqrtDet)/(2.0*A);\n float negT = (-B-sqrtDet)/(2.0*A);\n float intersectionT = min(posT,negT);\n vec3 qi = p+v*intersectionT;\n float dotp1 = dot(va,qi-p1);\n float dotp2 = dot(va,qi-p2);\n vec3 norm;\n if( dotp1 < 0.0 || dotp2 > 0.0) { //(p-c)^2 + 2(p-c)vt +v^2+t^2 - r^2 = 0\n vec3 cp;\n if( dotp1 < 0.0) { \n// if(vColor.x < 0.0 ) discard; //color sign bit indicates if we should cap or not\n cp = p1;\n } else {\n// if(vColor.y < 0.0 ) discard;\n cp = p2;\n }\n vec3 diff = p-cp;\n A = dot(v,v);\n B = dot(diff,v)*2.0;\n C = dot(diff,diff)-r*r;\n det = (B*B) - (4.0*C);\n if(det < 0.0) discard;\n sqrtDet = sqrt(det);\n posT = (-B+sqrtDet)/(2.0);\n negT = (-B-sqrtDet)/(2.0);\n float t = min(posT,negT);\n qi = p+v*t; \n norm = normalize(qi-cp); \n } else {\n norm = normalize(qi-(dotp1*va + p1));\n }\n vec4 clipPos = projectionMatrix * vec4(qi, 1.0);\n float ndcDepth = clipPos.z / clipPos.w;\n float depth = ((gl_DepthRange.diff * ndcDepth) + gl_DepthRange.near + gl_DepthRange.far) / 2.0;\n gl_FragDepthEXT = depth;"},"./src/GLDraw.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{CAP:()=>n,GLDraw:()=>i});var n,i,o=r("./src/WebGL/math/index.ts");!function(t){t[t.NONE=0]="NONE",t[t.FLAT=1]="FLAT",t[t.ROUND=2]="ROUND"}(n||(n={})),function(t){function e(t,e,r){var n,i,o,a,s,l=Math.hypot(t,e);l<1e-4?(i=0,o=1):(i=-t/l,o=e/l),e=-i*t+o*e,(n=Math.hypot(e,r))<1e-4?(a=0,s=1):(a=r/n,s=e/n);var c=new Float32Array(9);return c[0]=o,c[1]=i,c[2]=0,c[3]=-i*s,c[4]=o*s,c[5]=a,c[6]=i*a,c[7]=-o*a,c[8]=s,c}var r=new class{constructor(){this.cache={};let t,e=[],r=Math.pow(2,4),n=2,i=Math.pow(2,n),a=r/i;for(e[0]=new o.Vector3(-1,0,0),e[a]=new o.Vector3(0,0,1),e[2*a]=new o.Vector3(1,0,0),e[3*a]=new o.Vector3(0,0,-1),n=3;n<=4;n++){for(i=Math.pow(2,n-1),a=r/i,t=0;t{"use strict";r.r(e),r.d(e,{GLModel:()=>p});var n=r("./src/WebGL/index.ts"),i=r("./src/WebGL/shapes/index.ts"),o=r("./src/WebGL/math/index.ts"),a=r("./src/colors.ts"),s=r("./src/GLDraw.ts"),l=r("./src/glcartoon.ts"),c=r("./src/utilities.ts"),u=r("./src/Gradient.ts"),h=r("./src/parsers/index.ts"),d=r("./node_modules/netcdfjs/lib-esm/index.js"),f=r("./src/parsers/utils/assignBonds.ts");class p{static sameObj(t,e){return t&&e?JSON.stringify(t)==JSON.stringify(e):t==e}constructor(t,e){this.atoms=[],this.frames=[],this.box=null,this.atomdfs=null,this.id=0,this.hidden=!1,this.molObj=null,this.renderedMolObj=null,this.lastColors=null,this.modelData={},this.modelDatas=null,this.idMatrix=new o.Matrix4,this.dontDuplicateAtoms=!0,this.defaultColor=a.elementColors.defaultColor,this.defaultStickRadius=.25,this.options=e||{},this.ElementColors=this.options.defaultcolors?this.options.defaultcolors:a.elementColors.defaultColors,this.defaultSphereRadius=this.options.defaultSphereRadius?this.options.defaultSphereRadius:1.5,this.defaultCartoonQuality=this.options.cartoonQuality?this.options.cartoonQuality:10,this.id=t}getRadiusFromStyle(t,e){var r=this.defaultSphereRadius;if(void 0!==e.radius)r=e.radius;else if(p.vdwRadii[t.elem])r=p.vdwRadii[t.elem];else if(t.elem.length>1){let e=t.elem;e=e[0].toUpperCase()+e[1].toLowerCase(),p.vdwRadii[e]&&(r=p.vdwRadii[e])}return void 0!==e.scale&&(r*=e.scale),r}drawAtomCross(t,e){if(t.style.cross){var r=t.style.cross;if(!r.hidden){var i=r.linewidth||p.defaultlineWidth;e[i]||(e[i]=new n.Geometry);var a=e[i].updateGeoGroup(6),s=this.getRadiusFromStyle(t,r),l=[[s,0,0],[-s,0,0],[0,s,0],[0,-s,0],[0,0,s],[0,0,-s]],u=t.clickable||t.hoverable;u&&void 0===t.intersectionShape&&(t.intersectionShape={sphere:[],cylinder:[],line:[]});for(var h=(0,c.getColorFromStyle)(t,r),d=a.vertexArray,f=a.colorArray,m=0;m<6;m++){var g=3*a.vertices;if(a.vertices++,d[g]=t.x+l[m][0],d[g+1]=t.y+l[m][1],d[g+2]=t.z+l[m][2],f[g]=h.r,f[g+1]=h.g,f[g+2]=h.b,u){var v=new o.Vector3(l[m][0],l[m][1],l[m][2]);v.multiplyScalar(.1),v.set(v.x+t.x,v.y+t.y,v.z+t.z),t.intersectionShape.line.push(v)}}}}}getGoodCross(t,e,r,n){for(var i=null,a=-1,s=0,l=t.bonds.length;sa&&(i=h,(a=c)>.1))return i}return i}getSideBondV(t,e,r){var n,i,a,s,l=new o.Vector3(t.x,t.y,t.z),c=new o.Vector3(e.x,e.y,e.z).clone(),u=null;if(c.sub(l),1===t.bonds.length)1===e.bonds.length?(u=c.clone(),Math.abs(u.x)>1e-4?u.y+=1:u.x+=1):(n=(r+1)%e.bonds.length,i=e.bonds[n],(a=this.atoms[i]).index==t.index&&(n=(n+1)%e.bonds.length,i=e.bonds[n],a=this.atoms[i]),(s=new o.Vector3(a.x,a.y,a.z).clone()).sub(l),(u=s.clone()).cross(c));else if((u=this.getGoodCross(t,e,l,c)).lengthSq()<.01){var h=this.getGoodCross(e,t,l,c);null!=h&&(u=h)}return u.lengthSq()<.01&&(u=c.clone(),Math.abs(u.x)>1e-4?u.y+=1:u.x+=1),u.cross(c),u.normalize(),u}addLine(t,e,r,n,i,o){t[r]=n.x,t[r+1]=n.y,t[r+2]=n.z,e[r]=o.r,e[r+1]=o.g,e[r+2]=o.b,t[r+3]=i.x,t[r+4]=i.y,t[r+5]=i.z,e[r+3]=o.r,e[r+4]=o.g,e[r+5]=o.b}drawBondLines(t,e,r){if(t.style.line){var i=t.style.line;if(!i.hidden){var s,l,u,h,d=i.linewidth||p.defaultlineWidth;r[d]||(r[d]=new n.Geometry);for(var f=r[d].updateGeoGroup(6*t.bonds.length),m=f.vertexArray,g=f.colorArray,v=0;v=b.index)){var y=new o.Vector3(t.x,t.y,t.z),x=new o.Vector3(b.x,b.y,b.z),_=y.clone().add(x).multiplyScalar(.5),w=!1,k=t.clickable||t.hoverable,A=b.clickable||b.hoverable;(k||A)&&(k&&(void 0===t.intersectionShape&&(t.intersectionShape={sphere:[],cylinder:[],line:[],triangle:[]}),t.intersectionShape.line.push(y),t.intersectionShape.line.push(_)),A&&(void 0===b.intersectionShape&&(b.intersectionShape={sphere:[],cylinder:[],line:[],triangle:[]}),b.intersectionShape.line.push(_),b.intersectionShape.line.push(x)));var M=(0,c.getColorFromStyle)(t,t.style.line),T=(0,c.getColorFromStyle)(b,b.style.line);if(t.bondStyles&&t.bondStyles[v]){var S=t.bondStyles[v];if(!S.iswire)continue;S.singleBond&&(w=!0),void 0!==S.color1&&(M=a.CC.color(S.color1)),void 0!==S.color2&&(T=a.CC.color(S.color2))}var C,E,L=3*f.vertices;if(t.bondOrder[v]>1&&t.bondOrder[v]<4&&!w){var z=this.getSideBondV(t,b,v),O=x.clone();O.sub(y),2==t.bondOrder[v]?(z.multiplyScalar(.1),(s=y.clone()).add(z),(l=y.clone()).sub(z),(u=s.clone()).add(O),(h=l.clone()).add(O),M==T?(f.vertices+=4,this.addLine(m,g,L,s,u,M),this.addLine(m,g,L+6,l,h,M)):(f.vertices+=8,O.multiplyScalar(.5),(C=s.clone()).add(O),(E=l.clone()).add(O),this.addLine(m,g,L,s,C,M),this.addLine(m,g,L+6,C,u,T),this.addLine(m,g,L+12,l,E,M),this.addLine(m,g,L+18,E,h,T))):3==t.bondOrder[v]&&(z.multiplyScalar(.1),(s=y.clone()).add(z),(l=y.clone()).sub(z),(u=s.clone()).add(O),(h=l.clone()).add(O),M==T?(f.vertices+=6,this.addLine(m,g,L,y,x,M),this.addLine(m,g,L+6,s,u,M),this.addLine(m,g,L+12,l,h,M)):(f.vertices+=12,O.multiplyScalar(.5),(C=s.clone()).add(O),(E=l.clone()).add(O),this.addLine(m,g,L,y,_,M),this.addLine(m,g,L+6,_,x,T),this.addLine(m,g,L+12,s,C,M),this.addLine(m,g,L+18,C,u,T),this.addLine(m,g,L+24,l,E,M),this.addLine(m,g,L+30,E,h,T)))}else M==T?(f.vertices+=2,this.addLine(m,g,L,y,x,M)):(f.vertices+=4,this.addLine(m,g,L,y,_,M),this.addLine(m,g,L+6,_,x,T))}}}}}drawAtomSphere(t,e){if(t.style.sphere){var r=t.style.sphere;if(!r.hidden){var n=(0,c.getColorFromStyle)(t,r),a=this.getRadiusFromStyle(t,r);if((!0===t.clickable||t.hoverable)&&void 0!==t.intersectionShape){var l=new o.Vector3(t.x,t.y,t.z);t.intersectionShape.sphere.push(new i.Sphere(l,a))}s.GLDraw.drawSphere(e,t,a,n)}}}drawAtomClickSphere(t){if(t.style.clicksphere){var e=t.style.clicksphere;if(!e.hidden){var r=this.getRadiusFromStyle(t,e);if((!0===t.clickable||t.hoverable)&&void 0!==t.intersectionShape){var n=new o.Vector3(t.x,t.y,t.z);t.intersectionShape.sphere.push(new i.Sphere(n,r))}}}}drawAtomInstanced(t,e){if(t.style.sphere){var r=t.style.sphere;if(!r.hidden){var n=this.getRadiusFromStyle(t,r),a=(0,c.getColorFromStyle)(t,r),s=e.updateGeoGroup(1),l=s.vertices,u=3*l,h=s.vertexArray,d=s.colorArray,f=s.radiusArray;if(h[u]=t.x,h[u+1]=t.y,h[u+2]=t.z,d[u]=a.r,d[u+1]=a.g,d[u+2]=a.b,f[l]=n,(!0===t.clickable||t.hoverable)&&void 0!==t.intersectionShape){var p=new o.Vector3(t.x,t.y,t.z);t.intersectionShape.sphere.push(new i.Sphere(p,n))}s.vertices+=1}}}drawSphereImposter(t,e,r,n){var i,o=t.updateGeoGroup(4),a=o.vertices,s=3*a,l=o.vertexArray,c=o.colorArray;for(i=0;i<4;i++)l[s+3*i]=e.x,l[s+3*i+1]=e.y,l[s+3*i+2]=e.z;var u=o.normalArray;for(i=0;i<4;i++)c[s+3*i]=n.r,c[s+3*i+1]=n.g,c[s+3*i+2]=n.b;u[s+0]=-r,u[s+1]=r,u[s+2]=0,u[s+3]=-r,u[s+4]=-r,u[s+5]=0,u[s+6]=r,u[s+7]=-r,u[s+8]=0,u[s+9]=r,u[s+10]=r,u[s+11]=0,o.vertices+=4;var h=o.faceArray,d=o.faceidx;h[d+0]=a,h[d+1]=a+1,h[d+2]=a+2,h[d+3]=a+2,h[d+4]=a+3,h[d+5]=a,o.faceidx+=6}drawAtomImposter(t,e){if(t.style.sphere){var r=t.style.sphere;if(!r.hidden){var n=this.getRadiusFromStyle(t,r),a=(0,c.getColorFromStyle)(t,r);if((!0===t.clickable||t.hoverable)&&void 0!==t.intersectionShape){var s=new o.Vector3(t.x,t.y,t.z);t.intersectionShape.sphere.push(new i.Sphere(s,n))}this.drawSphereImposter(e,t,n,a)}}}calculateDashes(t,e,r,n,i){var a=Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2)+Math.pow(t.z-e.z,2));r=Math.max(r,0),i=Math.max(i,0)+2*r,(n=Math.max(n,.001))+i>a&&(n=a,i=0);var s,l=Math.floor((a-n)/(n+i))+1;i=(a-l*n)/l;for(var c=new o.Vector3(t.x,t.y,t.z),u=new o.Vector3((e.x-t.x)/(a/i),(e.y-t.y)/(a/i),(e.z-t.z)/(a/i)),h=new o.Vector3((e.x-t.x)/(a/n),(e.y-t.y)/(a/n),(e.z-t.z)/(a/n)),d=[],f=0;f{var e=r.imposter?p.drawStickImposter:s.GLDraw.drawCylinder;return!D&&t>=1?e:(t,r,n,i,o,a=0,s=0,l=.1,c=.25)=>{this.calculateDashes(r,n,i,l,c).forEach((r=>{e(t,r.from,r.to,i,o,a,s)}))}};for(f=0;f3){if(t.bondOrder[f]<1&&(z*=t.bondOrder[f]),!N.capDrawn&&N.bonds.length<4&&(F=2),R!=U?(k=(new o.Vector3).addVectors(G,V).multiplyScalar(.5),j(r,G,k,z,R,I,0,E,L),j(r,k,V,z,U,0,F,E,L)):j(r,G,V,z,R,I,F,E,L),h=t.clickable||t.hoverable,d=N.clickable||N.hoverable,h||d){if(k||(k=(new o.Vector3).addVectors(G,V).multiplyScalar(.5)),h){var H=new i.Cylinder(G,k,z),W=new i.Sphere(G,z);t.intersectionShape.cylinder.push(H),t.intersectionShape.sphere.push(W)}if(d){var q=new i.Cylinder(V,k,z),Y=new i.Sphere(V,z);N.intersectionShape.cylinder.push(q),N.intersectionShape.sphere.push(Y)}}}else if(t.bondOrder[f]>1){var Z=0,X=0;z!=T&&(Z=2,X=2);var $,J,K,Q,tt,et=V.clone(),rt=null;et.sub(G),rt=this.getSideBondV(t,N,f),2==t.bondOrder[f]?($=z*S,rt.multiplyScalar(1.5*$),(J=G.clone()).add(rt),(K=G.clone()).sub(rt),(Q=J.clone()).add(et),(tt=K.clone()).add(et),R!=U?(k=(new o.Vector3).addVectors(J,Q).multiplyScalar(.5),A=(new o.Vector3).addVectors(K,tt).multiplyScalar(.5),j(r,J,k,$,R,Z,0),j(r,k,Q,$,U,0,X),j(r,K,A,$,R,Z,0),j(r,A,tt,$,U,0,X)):(j(r,J,Q,$,R,Z,X),j(r,K,tt,$,R,Z,X)),h=t.clickable||t.hoverable,d=N.clickable||N.hoverable,(h||d)&&(k||(k=(new o.Vector3).addVectors(J,Q).multiplyScalar(.5)),A||(A=(new o.Vector3).addVectors(K,tt).multiplyScalar(.5)),h&&(v=new i.Cylinder(J,k,$),b=new i.Cylinder(K,A,$),t.intersectionShape.cylinder.push(v),t.intersectionShape.cylinder.push(b)),d&&(x=new i.Cylinder(Q,k,$),_=new i.Cylinder(tt,A,$),N.intersectionShape.cylinder.push(x),N.intersectionShape.cylinder.push(_)))):3==t.bondOrder[f]&&($=z*C,rt.cross(et),rt.normalize(),rt.multiplyScalar(3*$),(J=G.clone()).add(rt),(K=G.clone()).sub(rt),(Q=J.clone()).add(et),(tt=K.clone()).add(et),R!=U?(k=(new o.Vector3).addVectors(J,Q).multiplyScalar(.5),A=(new o.Vector3).addVectors(K,tt).multiplyScalar(.5),M=(new o.Vector3).addVectors(G,V).multiplyScalar(.5),j(r,J,k,$,R,Z,0),j(r,k,Q,$,U,0,X),j(r,G,M,$,R,I,0),j(r,M,V,$,U,0,F),j(r,K,A,$,R,Z,0),j(r,A,tt,$,U,0,X)):(j(r,J,Q,$,R,Z,X),j(r,G,V,$,R,I,F),j(r,K,tt,$,R,Z,X)),h=t.clickable||t.hoverable,d=N.clickable||N.hoverable,(h||d)&&(k||(k=(new o.Vector3).addVectors(J,Q).multiplyScalar(.5)),A||(A=(new o.Vector3).addVectors(K,tt).multiplyScalar(.5)),M||(M=(new o.Vector3).addVectors(G,V).multiplyScalar(.5)),h&&(v=new i.Cylinder(J.clone(),k.clone(),$),b=new i.Cylinder(K.clone(),A.clone(),$),y=new i.Cylinder(G.clone(),M.clone(),$),t.intersectionShape.cylinder.push(v),t.intersectionShape.cylinder.push(b),t.intersectionShape.cylinder.push(y)),d&&(x=new i.Cylinder(Q.clone(),k.clone(),$),_=new i.Cylinder(tt.clone(),A.clone(),$),w=new i.Cylinder(V.clone(),M.clone(),$),N.intersectionShape.cylinder.push(x),N.intersectionShape.cylinder.push(_),N.intersectionShape.cylinder.push(w))))}}}var nt=!1,it=0,ot=!1;for(f=0;f0&&(nt=!0):0==it&&(t.bonds.length>0||u.showNonBonded)&&(nt=!0),nt&&(z=T,r.imposter?this.drawSphereImposter(r.sphereGeometry,t,z,R):s.GLDraw.drawSphere(r,t,z,R))}}}createMolObj(t,e){e=e||{};var r,i,o,c,u=new n.Object3D,h=[],d={},f={},p=this.drawAtomSphere,m=null,g=null;e.supportsImposters?(p=this.drawAtomImposter,(m=new n.Geometry(!0)).imposter=!0,(g=new n.Geometry(!0,!0)).imposter=!0,g.sphereGeometry=new n.Geometry(!0),g.sphereGeometry.imposter=!0,g.drawnCaps={}):e.supportsAIA?(p=this.drawAtomInstanced,(m=new n.Geometry(!1,!0,!0)).instanced=!0,g=new n.Geometry(!0)):(m=new n.Geometry(!0),g=new n.Geometry(!0));var v,b={},y=[Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY];for(r=0,o=t.length;ry[1]&&(y[1]=x.resi)),h.push(x))}}if(h.length>0&&(0,l.drawCartoon)(u,h,y,this.defaultCartoonQuality),m&&m.vertices>0){m.initTypedArrays();var _=null,w=null;m.imposter?_=new n.SphereImposterMaterial({ambient:0,vertexColors:!0,reflectivity:0}):m.instanced?(w=new n.Geometry(!0),s.GLDraw.drawSphere(w,{x:0,y:0,z:0},1,new a.Color(.5,.5,.5)),w.initTypedArrays(),_=new n.InstancedMaterial({sphereMaterial:new n.MeshLambertMaterial({ambient:0,vertexColors:!0,reflectivity:0}),sphere:w})):_=new n.MeshLambertMaterial({ambient:0,vertexColors:!0,reflectivity:0}),b.sphere<1&&b.sphere>=0&&(_.transparent=!0,_.opacity=b.sphere),w=new n.Mesh(m,_),u.add(w)}if(g.vertices>0){var k=null,A=null,M=g.sphereGeometry;M&&void 0!==M.vertices&&0!=M.vertices||(M=null),g.initTypedArrays(),M&&M.initTypedArrays();var T={ambient:0,vertexColors:!0,reflectivity:0};g.imposter?(k=new n.StickImposterMaterial(T),A=new n.SphereImposterMaterial(T)):(k=new n.MeshLambertMaterial(T),A=new n.MeshLambertMaterial(T),k.wireframe&&(g.setUpWireframe(),M&&M.setUpWireframe())),b.stick<1&&b.stick>=0&&(k.transparent=!0,k.opacity=b.stick,A.transparent=!0,A.opacity=b.stick);var S=new n.Mesh(g,k);if(u.add(S),M){var C=new n.Mesh(M,A);u.add(C)}}for(r in d)if(d.hasOwnProperty(r)){v=r;var E=new n.LineBasicMaterial({linewidth:v,vertexColors:!0});b.line<1&&b.line>=0&&(E.transparent=!0,E.opacity=b.line),d[r].initTypedArrays();var L=new n.Line(d[r],E,n.LineStyle.LinePieces);u.add(L)}for(r in f)if(f.hasOwnProperty(r)){v=r;var z=new n.LineBasicMaterial({linewidth:v,vertexColors:!0});b.cross<1&&b.cross>=0&&(z.transparent=!0,z.opacity=b.cross),f[r].initTypedArrays();var O=new n.Line(f[r],z,n.LineStyle.LinePieces);u.add(O)}if(this.dontDuplicateAtoms&&this.modelData.symmetries&&this.modelData.symmetries.length>0){var D,I=new n.Object3D;for(D=0;Dr?e-n:e}adjustCoordinatesToBox(){if(this.box&&this.atomdfs)for(var t=this.box[0],e=this.box[1],r=this.box[2],n=.9*t,i=.9*e,o=.9*r,a=0;a=r)&&(t=r-1),null!=n.frames.url){var a=n.frames.url;(0,c.getbin)(a+"/traj/frame/"+t+"/"+n.frames.path,void 0,"POST",void 0).then((function(t){for(var e=new Float32Array(t,44),r=0,o=0;o=n&&t<=i)return!0}}return!1}static deepCopyAndCache(t,e){if("object"!=typeof t||null==t)return t;if(t.__cache_created)return t;const r={};for(const n in t){const i=t[n];if(Array.isArray(i)){r[n]=[];for(let t=0;t=n[0][0]&&a<=n[1][0]&&s>=n[0][1]&&s<=n[1][1]&&l>=n[0][2]&&l<=n[1][2]&&(a>=r[0][0]&&a<=r[1][0]&&s>=r[0][1]&&s<=r[1][1]&&l>=r[0][2]&&l<=r[1][2]||o.push(this.atoms[t]))}return o}static getFloat(t){return"number"==typeof t?t:parseFloat(t)}selectedAtoms(t,e){var r=[];t=p.deepCopyAndCache(t||{},this),e||(e=this.atoms);for(var n=e.length,i=0;i0&&r.push(n[t])}}if(t.hasOwnProperty("within")&&t.within.hasOwnProperty("sel")&&t.within.hasOwnProperty("distance")){var s=this.selectedAtoms(t.within.sel,this.atoms),l={};const e=p.getFloat(t.within.distance),n=e*e;for(let t=0;t0&&(l[e]=1)}var c=[];if(t.within.invert)for(let t=0;t0;)if(e=d.pop(),f=e.chain,m=e.resi,void 0===h[e.index]){h[e.index]=!0;for(var g=0;g0&&(this.molObj=null)}else console.log("Callback is not a function")}setHoverable(t,e,r,n){if(e=!!e,r=(0,c.makeFunction)(r),n=(0,c.makeFunction)(n),null!==r)if(null!==n){var i=this.selectedAtoms(t,this.atoms),o=i.length;for(let t=0;t0&&(this.molObj=null)}else console.log("Unhover_callback is not a function");else console.log("Hover_callback is not a function")}enableContextMenu(t,e){var r;e=!!e;var n=this.selectedAtoms(t,this.atoms),i=n.length;for(r=0;r0&&(this.molObj=null)}setColorByElement(t,e){if(null===this.molObj||!p.sameObj(e,this.lastColors)){this.lastColors=e;var r=this.selectedAtoms(t,r);r.length>0&&(this.molObj=null);for(var n=0;n0&&(this.molObj=null),"string"==typeof r&&void 0!==u.Gradient.builtinGradients[r]&&(r=new u.Gradient.builtinGradients[r]),n||(n=r.range()),n||(n=(0,c.getPropertyRange)(a,e)),i=0;i0&&(this.molObj=null);for(let t=0;t=i)continue;let a={b:r,e:i},s=o.bondOrder[t];1!=s&&(a.o=s),e.b.push(a)}}return e}globj(t,e){(null===this.molObj||e.regen)&&(this.molObj=this.createMolObj(this.atoms,e),this.renderedMolObj&&(t.remove(this.renderedMolObj),this.renderedMolObj=null),this.renderedMolObj=this.molObj.clone(),this.hidden&&(this.renderedMolObj.setVisible(!1),this.molObj.setVisible(!1)),t.add(this.renderedMolObj))}exportVRML(){return this.createMolObj(this.atoms,{supportsImposters:!1,supportsAIA:!1}).vrml()}removegl(t){this.renderedMolObj&&(void 0!==this.renderedMolObj.geometry&&this.renderedMolObj.geometry.dispose(),void 0!==this.renderedMolObj.material&&this.renderedMolObj.material.dispose(),t.remove(this.renderedMolObj),this.renderedMolObj=null),this.molObj=null}hide(){this.hidden=!0,this.renderedMolObj&&this.renderedMolObj.setVisible(!1),this.molObj&&this.molObj.setVisible(!1)}show(){this.hidden=!1,this.renderedMolObj&&this.renderedMolObj.setVisible(!0),this.molObj&&this.molObj.setVisible(!0)}addPropertyLabels(t,e,r,n){for(var i=this.selectedAtoms(e,i),o=(0,c.deepCopy)(n),a=0;aMOLECULE/gm)?"mol2":t.match(/^data_/gm)&&t.match(/^loop_/gm)?"cif":t.match(/^HETATM/gm)||t.match(/^ATOM/gm)?"pdb":t.match(/ITEM: TIMESTEP/gm)?"lammpstrj":t.match(/^.*\n.*\n.\s*(\d+)\s+(\d+)/gm)?"sdf":t.match(/^%VERSION\s+VERSION_STAMP/gm)?"prmtop":"xyz",console.log("Best guess: "+e))),(0,h.Parsers[e])(t,r)}}p.defaultAtomStyle={line:{}},p.defaultlineWidth=1,p.vdwRadii={H:1.2,He:1.4,Li:1.82,Be:1.53,B:1.92,C:1.7,N:1.55,O:1.52,F:1.47,Ne:1.54,Na:2.27,Mg:1.73,Al:1.84,Si:2.1,P:1.8,S:1.8,Cl:1.75,Ar:1.88,K:2.75,Ca:2.31,Ni:1.63,Cu:1.4,Zn:1.39,Ga:1.87,Ge:2.11,As:1.85,Se:1.9,Br:1.85,Kr:2.02,Rb:3.03,Sr:2.49,Pd:1.63,Ag:1.72,Cd:1.58,In:1.93,Sn:2.17,Sb:2.06,Te:2.06,I:1.98,Xe:2.16,Cs:3.43,Ba:2.68,Pt:1.75,Au:1.66,Hg:1.55,Tl:1.96,Pb:2.02,Bi:2.07,Po:1.97,At:2.02,Rn:2.2,Fr:3.48,Ra:2.83,U:1.86},p.ignoredKeys=new Set(["props","invert","model","frame","byres","expand","within","and","or","not"])},"./src/GLShape.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{GLShape:()=>d,splitMesh:()=>f});var n=r("./src/WebGL/index.ts"),i=r("./src/WebGL/shapes/index.ts"),o=r("./src/WebGL/math/index.ts"),a=r("./src/colors.ts"),s=r("./src/ProteinSurface4.ts"),l=r("./src/VolumeData.ts"),c=r("./src/GLDraw.ts"),u=r("./src/glcartoon.ts"),h=r("./src/utilities.ts");class d{static finalizeGeo(t){var e=t.updateGeoGroup(0);e.vertices>0&&e.truncateArrayBuffers(!0,!0)}static updateColor(t,e){var r,n,i;e=e||a.CC.color(e),t.colorsNeedUpdate=!0,e.constructor!==Array&&(r=e.r,n=e.g,i=e.b);for(let o in t.geometryGroups){let a=t.geometryGroups[o],s=a.colorArray;for(let t=0,o=a.vertices;t0?u/t:(t+u)/t}d.multiplyScalar(c);var f=new o.Vector3(n.x,n.y,n.z).add(d),p=d.clone().negate();let m=new o.Vector3(n.x,n.y,n.z);t.intersectionShape.cylinder.push(new i.Cylinder(m,f.clone(),s)),t.intersectionShape.sphere.push(new i.Sphere(m,s));var g=[];g[0]=d.clone(),Math.abs(g[0].x)>1e-4?g[0].y+=1:g[0].x+=1,g[0].cross(d),g[0].normalize(),g[4]=g[0].clone(),g[4].crossVectors(g[0],d),g[4].normalize(),g[8]=g[0].clone().negate(),g[12]=g[4].clone().negate(),g[2]=g[0].clone().add(g[4]).normalize(),g[6]=g[4].clone().add(g[8]).normalize(),g[10]=g[8].clone().add(g[12]).normalize(),g[14]=g[12].clone().add(g[0]).normalize(),g[1]=g[0].clone().add(g[2]).normalize(),g[3]=g[2].clone().add(g[4]).normalize(),g[5]=g[4].clone().add(g[6]).normalize(),g[7]=g[6].clone().add(g[8]).normalize(),g[9]=g[8].clone().add(g[10]).normalize(),g[11]=g[10].clone().add(g[12]).normalize(),g[13]=g[12].clone().add(g[14]).normalize(),g[15]=g[14].clone().add(g[0]).normalize();var v,b,y,x,_,w,k,A,M,T,S,C,E,L,z,O,D,I,F,R,P,j,N=h.vertices,B=h.vertexArray,U=h.faceArray,G=h.normalArray,V=h.lineArray;for(b=0,y=g.length;b0){var Y=B[v-3],Z=B[v-2],X=B[v-1],$=new o.Vector3(Y,Z,X),J=new o.Vector3(a.x,a.y,a.z),K=f.clone(),Q=new o.Vector3(q.x,q.y,q.z);t.intersectionShape.triangle.push(new i.Triangle(Q,J,$)),t.intersectionShape.triangle.push(new i.Triangle($.clone(),K,Q.clone()))}}h.vertices+=48,B[v=3*h.vertices]=n.x,B[v+1]=n.y,B[v+2]=n.z,B[v+3]=f.x,B[v+4]=f.y,B[v+5]=f.z,B[v+6]=a.x,B[v+7]=a.y,B[v+8]=a.z,h.vertices+=3;var tt=h.vertices-3,et=h.vertices-2,rt=h.vertices-1,nt=3*tt,it=3*et,ot=3*rt;for(b=0,y=g.length-1;bs&&(s=u),h>l&&(l=h),d>c&&(c=d)}t.center.set((s+i)/2,(l+o)/2,(c+a)/2),t.radius=t.center.distanceTo({x:s,y:l,z:c}),t.box={min:{x:i,y:o,z:a},max:{x:s,y:l,z:c}}}static addCustomGeo(t,e,r,n,a){var s,l,c,u,h,f,p,m,g,v=e.addGeoGroup(),b=r.vertexArr,y=r.normalArr,x=r.faceArr;v.vertices=b.length,v.faceidx=x.length;var _=v.vertexArray,w=v.colorArray;for(n.constructor!==Array&&(m=n.r,g=n.g,u=n.b),f=0,p=v.vertices;fc?(h.fromCap=0,h.toCap=2):(h.fromCap=2,h.toCap=2),this.addCylinder(h)}}addLine(t){var e,r;e=t.start?new o.Vector3(t.start.x||0,t.start.y||0,t.start.z||0):new o.Vector3(0,0,0),t.end?void 0===(r=new o.Vector3(t.end.x,t.end.y||0,t.end.z||0)).x&&(r.x=3):r=new o.Vector3(3,0,0);var n=this.geo.updateGeoGroup(2),i=n.vertices,a=3*i,s=n.vertexArray;s[a]=e.x,s[a+1]=e.y,s[a+2]=e.z,s[a+3]=r.x,s[a+4]=r.y,s[a+5]=r.z,n.vertices+=2;var l=n.lineArray,c=n.lineidx;l[c]=i,l[c+1]=i+1,n.lineidx+=2;var u=new o.Vector3;this.components.push({centroid:u.addVectors(e,r).multiplyScalar(.5)}),n=this.geo.updateGeoGroup(0),d.updateBoundingFromPoints(this.boundingSphere,this.components,n.vertexArray,n.vertices)}addArrow(t){if(t.start?t.start=new o.Vector3(t.start.x||0,t.start.y||0,t.start.z||0):t.start=new o.Vector3(0,0,0),t.dir instanceof o.Vector3&&"number"==typeof t.length){var e=t.dir.clone().multiplyScalar(t.length).add(t.start);t.end=e}else t.end?(t.end=new o.Vector3(t.end.x,t.end.y||0,t.end.z||0),void 0===t.end.x&&(t.end.x=3)):t.end=new o.Vector3(3,0,0);t.radius=t.radius||.1,t.radiusRatio=t.radiusRatio||1.618034,t.mid=0=0?g[i]-l:l-g[i])>0&&(v[i]|=d.ISDONE);var b=[],y=[];s.MarchingCube.march(v,b,y,{fulltable:!0,voxel:c,unitCube:t.unit,origin:t.origin,matrix:t.matrix,nX:h,nY:f,nZ:p}),!c&&u>0&&s.MarchingCube.laplacianSmooth(u,b,y);var x=[],_=[],w=[];if(e.selectedRegion&&void 0===e.coords&&(e.coords=e.selectedRegion),void 0===e.coords&&void 0!==e.selection&&(n?e.coords=n.selectedAtoms(e.selection):console.log("addIsosurface needs viewer is selection provided.")),void 0!==e.coords){var k=e.coords[0].x,A=e.coords[0].y,M=e.coords[0].z,T=e.coords[0].x,S=e.coords[0].y,C=e.coords[0].z;for(let t=0;tk?k=e.coords[t].x:e.coords[t].xA?A=e.coords[t].y:e.coords[t].yM?M=e.coords[t].z:e.coords[t].zT&&b[t].xS&&b[t].yC&&b[t].z=64e3&&(e.push({vertexArr:[],normalArr:[],faceArr:[]}),t.colorArr&&(e.colorArr=[]),i++)}return e}d.ISDONE=2,d.drawCustom=function(t,e,r){var n=r,i=n.vertexArr,o=n.faceArr;0!==i.length&&0!==o.length||console.warn("Error adding custom shape component: No vertices and/or face indices supplied!");var s=r.color;void 0===s&&(s=t.color),s=a.CC.color(s);for(var l=f(n),c=0,u=l.length;c{"use strict";r.r(e),r.d(e,{GLViewer:()=>m,createStereoViewer:()=>b,createViewer:()=>g,createViewerGrid:()=>v});var n=r("./src/WebGL/index.ts"),i=r("./src/WebGL/math/index.ts"),o=r("./src/colors.ts"),a=r("./src/utilities.ts"),s=r("./src/Gradient.ts"),l=r("./src/GLModel.ts"),c=r("./src/Label.ts"),u=r("./src/GLShape.ts"),h=r("./src/VolumeData.ts"),d=r("./src/ProteinSurface4.ts"),f=r("./src/VolumetricRender.ts"),p=r("./node_modules/upng-js/UPNG.js");class m{getWidth(){let t=this.container,e=t.offsetWidth;if(0==e&&"none"===t.style.display){let r=t.style.position,n=t.style.visibility;t.style.display="block",t.style.visibility="hidden",t.style.position="absolute",e=t.offsetWidth,t.style.display="none",t.style.visibility=n,t.style.position=r}return e}getHeight(){let t=this.container,e=t.offsetHeight;if(0==e&&"none"===t.style.display){let r=t.style.position,n=t.style.visibility;t.style.display="block",t.style.visibility="hidden",t.style.position="absolute",e=t.offsetHeight,t.style.display="none",t.style.visibility=n,t.style.position=r}return e}setupRenderer(){this.renderer=new n.Renderer({antialias:this.config.antialias,preserveDrawingBuffer:!0,premultipliedAlpha:!1,id:this.config.id,row:this.config.row,col:this.config.col,rows:this.config.rows,cols:this.config.cols,canvas:this.config.canvas,containerWidth:this.WIDTH,containerHeight:this.HEIGHT}),this.renderer.domElement.style.width="100%",this.renderer.domElement.style.height="100%",this.renderer.domElement.style.padding="0",this.renderer.domElement.style.position="absolute",this.renderer.domElement.style.top="0px",this.renderer.domElement.style.left="0px",this.renderer.domElement.style.zIndex="0"}initializeScene(){this.scene=new n.Scene,this.scene.fog=new n.Fog(this.bgColor,100,200),this.modelGroup=new n.Object3D,this.rotationGroup=new n.Object3D,this.rotationGroup.useQuaternion=!0,this.rotationGroup.quaternion=new i.Quaternion(0,0,0,1),this.rotationGroup.add(this.modelGroup),this.scene.add(this.rotationGroup);var t=new n.Light(16777215);t.position=new i.Vector3(.2,.2,1).normalize(),t.intensity=1,this.scene.add(t)}initContainer(t){this.container=t,this.WIDTH=this.getWidth(),this.HEIGHT=this.getHeight(),this.ASPECT=this.renderer.getAspect(this.WIDTH,this.HEIGHT),this.renderer.setSize(this.WIDTH,this.HEIGHT),this.container.append(this.renderer.domElement),this.glDOM=this.renderer.domElement,this.nomouse||(this.glDOM.addEventListener("mousedown",this._handleMouseDown.bind(this),{passive:!1}),this.glDOM.addEventListener("touchstart",this._handleMouseDown.bind(this),{passive:!1}),this.glDOM.addEventListener("wheel",this._handleMouseScroll.bind(this),{passive:!1}),this.glDOM.addEventListener("mousemove",this._handleMouseMove.bind(this),{passive:!1}),this.glDOM.addEventListener("touchmove",this._handleMouseMove.bind(this),{passive:!1}),this.glDOM.addEventListener("contextmenu",this._handleContextMenu.bind(this),{passive:!1}))}decAnim(){this.animated--,this.animated<0&&(this.animated=0)}incAnim(){this.animated++}nextSurfID(){var t=0;for(let r in this.surfaces)if(this.surfaces.hasOwnProperty(r)){var e=parseInt(r);isNaN(e)||e>t&&(t=e)}return t+1}setSlabAndFog(){let t=this.camera.position.z-this.rotationGroup.position.z;t<1&&(t=1),this.camera.near=t+this.slabNear,this.camera.near<1&&(this.camera.near=1),this.camera.far=t+this.slabFar,this.camera.near+1>this.camera.far&&(this.camera.far=this.camera.near+1),this.camera.fov=this.fov,this.camera.right=t*Math.tan(Math.PI/180*this.fov),this.camera.left=-this.camera.right,this.camera.top=this.camera.right/this.ASPECT,this.camera.bottom=-this.camera.top,this.camera.updateProjectionMatrix(),this.scene.fog.near=this.camera.near+this.fogStart*(this.camera.far-this.camera.near),this.scene.fog.far=this.camera.far,this.config.disableFog&&(this.scene.fog.near=this.scene.fog.far)}show(t){if(this.renderer.setViewport(),this.scene&&(this.setSlabAndFog(),this.renderer.render(this.scene,this.camera),this.viewChangeCallback&&this.viewChangeCallback(this._viewer.getView()),!t&&this.linkedViewers.length>0))for(var e=this._viewer.getView(),r=0;r0){let e=this.CAMERA_Z-this.config.lowerZoomLimit;t>e&&(t=e)}if(this.config.upperZoomLimit&&this.config.upperZoomLimit>0){let e=this.CAMERA_Z-this.config.upperZoomLimit;tthis.CAMERA_Z-1&&(t=this.CAMERA_Z-1),t}static slerp(t,e,r){if(1==r)return e.clone();if(0==r)return t.clone();let n=t.x*e.x+t.y*e.y+t.z*e.z+t.w*e.w;if(n>.9995){let n=new i.Quaternion(t.x+r*(e.x-t.x),t.y+r*(e.y-t.y),t.z+r*(e.z-t.z),t.w+r*(e.w-t.w));return n.normalize(),n}n<0&&(e=e.clone().multiplyScalar(-1),n=-n),n>1?n=1:n<-1&&(n=-1);var o=Math.acos(n)*r,a=e.clone();a.sub(t.clone().multiplyScalar(n)),a.normalize();var s=Math.cos(o),l=Math.sin(o),c=new i.Quaternion(t.x*s+a.x*l,t.y*s+a.y*l,t.z*s+a.z*l,t.w*s+a.w*l);return c.normalize(),c}constructor(t,e={}){if(this.nomouse=!1,this.glDOM=null,this.models=[],this.surfaces={},this.shapes=[],this.labels=[],this.clickables=[],this.hoverables=[],this.contextMenuEnabledObjects=[],this.current_hover=null,this.hoverDuration=500,this.longTouchDuration=1e3,this.viewer_frame=0,this.viewChangeCallback=null,this.stateChangeCallback=null,this.NEAR=1,this.FAR=800,this.CAMERA_Z=150,this.fov=20,this.linkedViewers=[],this.renderer=null,this.control_all=!1,this.scene=null,this.rotationGroup=null,this.modelGroup=null,this.fogStart=.4,this.slabNear=-50,this.slabFar=50,this.cq=new i.Quaternion(0,0,0,1),this.dq=new i.Quaternion(0,0,0,1),this.animated=0,this.animationTimers=new Set,this.isDragging=!1,this.mouseStartX=0,this.mouseStartY=0,this.touchDistanceStart=0,this.touchHold=!1,this.currentModelPos=0,this.cz=0,this.cslabNear=0,this.cslabFar=0,this.userContextMenuHandler=null,this.config=e,this.callback=this.config.callback,this.defaultcolors=this.config.defaultcolors,this.defaultcolors||(this.defaultcolors=o.elementColors.defaultColors),this.nomouse=this.config.nomouse,this.bgColor=0,this.config.backgroundColor=this.config.backgroundColor||"#ffffff",void 0!==this.config.backgroundColor&&(this.bgColor=o.CC.color(this.config.backgroundColor).getHex()),this.config.backgroundAlpha=null==this.config.backgroundAlpha?1:this.config.backgroundAlpha,this.camerax=0,void 0!==this.config.camerax&&(this.camerax=parseFloat(this.config.camerax)),this._viewer=this,this.container=t,null!=this.config.hoverDuration&&(this.hoverDuration=this.config.hoverDuration),void 0===this.config.antialias&&(this.config.antialias=!0),void 0===this.config.cartoonQuality&&(this.config.cartoonQuality=10),this.WIDTH=this.getWidth(),this.HEIGHT=this.getHeight(),this.setupRenderer(),this.row=null==this.config.row?0:this.config.row,this.col=null==this.config.col?0:this.config.col,this.cols=this.config.cols,this.rows=this.config.rows,this.viewers=this.config.viewers,this.control_all=this.config.control_all,this.ASPECT=this.renderer.getAspect(this.WIDTH,this.HEIGHT),this.camera=new n.Camera(this.fov,this.ASPECT,this.NEAR,this.FAR,this.config.orthographic),this.camera.position=new i.Vector3(this.camerax,0,this.CAMERA_Z),this.lookingAt=new i.Vector3,this.camera.lookAt(this.lookingAt),this.raycaster=new n.Raycaster(new i.Vector3(0,0,0),new i.Vector3(0,0,0)),this.projector=new n.Projector,this.initializeScene(),this.renderer.setClearColorHex(this.bgColor,this.config.backgroundAlpha),this.scene.fog.color=o.CC.color(this.bgColor),document.body.addEventListener("mouseup",this._handleMouseUp.bind(this)),document.body.addEventListener("touchend",this._handleMouseUp.bind(this)),this.initContainer(this.container),this.config.style&&this.setViewStyle(this.config),window.addEventListener("resize",this.resize.bind(this)),void 0!==window.ResizeObserver&&(this.divwatcher=new window.ResizeObserver(this.resize.bind(this)),this.divwatcher.observe(this.container)),void 0!==window.IntersectionObserver){let t=(t,e)=>{t.forEach((t=>{t.isIntersecting&&this.resize()}))};this.intwatcher=new window.IntersectionObserver(t),this.intwatcher.observe(this.container)}try{"function"==typeof this.callback&&this.callback(this)}catch(t){console.log("error with glviewer callback: "+t)}}targetedObjects(t,e,r){var n={x:t,y:e,z:-1};return Array.isArray(r)||(r=this.selectedAtoms(r)),0==r.length?[]:(this.raycaster.setFromCamera(n,this.camera),this.raycaster.intersectObjects(this.modelGroup,r))}modelToScreen(t){let e=!1;Array.isArray(t)||(t=[t],e=!0);let r=this.renderer.getXRatio(),n=this.renderer.getYRatio(),o=this.col,a=this.row,s=o*(this.WIDTH/r),l=(n-a-1)*(this.HEIGHT/n),c=[],u=this.canvasOffset();return t.forEach((t=>{let e=new i.Vector3(t.x,t.y,t.z);e.applyMatrix4(this.modelGroup.matrixWorld),this.projector.projectVector(e,this.camera);let o=this.WIDTH/r*(e.x+1)/2+u.left+s,a=-this.HEIGHT/n*(e.y-1)/2+u.top+l;c.push({x:o,y:a})})),e&&(c=c[0]),c}screenOffsetToModel(t,e,r){var n=t/this.WIDTH,o=e/this.HEIGHT,a=void 0===r?this.rotationGroup.position.z:r,s=this.rotationGroup.quaternion,l=new i.Vector3(0,0,a);return this.projector.projectVector(l,this.camera),l.x+=2*n,l.y-=2*o,this.projector.unprojectVector(l,this.camera),l.z=0,l.applyQuaternion(s),l}screenToModelDistance(t,e){let r=this.canvasOffset(),n=new i.Vector3(e.x,e.y,e.z);n.applyMatrix4(this.modelGroup.matrixWorld);let o=n.clone();this.projector.projectVector(n,this.camera);let a=new i.Vector3(2*(t.x-r.left)/this.WIDTH-1,2*(t.y-r.top)/-this.HEIGHT+1,n.z);return this.projector.unprojectVector(a,this.camera),a.distanceTo(o)}setViewChangeCallback(t){"function"!=typeof t&&null!=t||(this.viewChangeCallback=t)}setStateChangeCallback(t){"function"!=typeof t&&null!=t||(this.stateChangeCallback=t)}getConfig(){return this.config}setConfig(t){this.config=t}getInternalState(){var t={models:[],surfaces:[],shapes:[],labels:[]};for(let e=0;e{e.getCanvas().toBlob((function(e){e.arrayBuffer().then(t)}),"image/png")}))),n+=1,n==t&&(e.viewChangeCallback=i,Promise.all(o).then((t=>{let n=[];for(let e=0;e0&&(this.hoverTimeout=setTimeout((function(){a.handleHoverSelection(o.x,o.y,t)}),this.hoverDuration)),this.isDragging)){t.targetTouches&&(t.targetTouches.length>1||1===t.targetTouches.length&&!this.closeEnoughForClick(t))&&clearTimeout(this.longTouchTimeout);var l=(e-this.mouseStartX)/this.WIDTH,c=(r-this.mouseStartY)/this.HEIGHT;0!=this.touchDistanceStart&&t.targetTouches&&2==t.targetTouches.length?(s=2,c=2*(this.calcTouchDistance(t)-this.touchDistanceStart)/(this.WIDTH+this.HEIGHT)):t.targetTouches&&3==t.targetTouches.length&&(s=1),l*=n,c*=i;var u,h=Math.hypot(l,c);if(3==s||3==this.mouseButton&&t.ctrlKey)this.slabNear=this.cslabNear+100*l,this.slabFar=this.cslabFar-100*c;else if(2==s||3==this.mouseButton||t.shiftKey)(u=.85*(this.CAMERA_Z-this.rotationGroup.position.z))<80&&(u=80),this.rotationGroup.position.z=this.cz+c*u,this.rotationGroup.position.z=this.adjustZoomToLimits(this.rotationGroup.position.z);else if(1==s||2==this.mouseButton||t.ctrlKey){var d=this.screenOffsetToModel(n*(e-this.mouseStartX),i*(r-this.mouseStartY));this.modelGroup.position.addVectors(this.currentModelPos,d)}else if((0===s||1==this.mouseButton)&&0!==h){var f=Math.sin(h*Math.PI)/h;this.dq.x=Math.cos(h*Math.PI),this.dq.y=0,this.dq.z=f*l,this.dq.w=-f*c,this.rotationGroup.quaternion.set(1,0,0,0),this.rotationGroup.quaternion.multiply(this.dq),this.rotationGroup.quaternion.multiply(this.cq)}this.show()}}_handleContextMenu(t){if(t.preventDefault(),this.closeEnoughForClick(t)){var e=this.mouseStartX,r=this.mouseStartY,n=this.canvasOffset();let o=this.mouseXY(e,r),a=o.x,s=o.y,l=this.targetedObjects(a,s,this.contextMenuEnabledObjects);var i=null;l.length&&(i=l[0].clickable),n=this.canvasOffset(),e=this.mouseStartX-n.left,r=this.mouseStartY-n.top,this.userContextMenuHandler&&(this.userContextMenuHandler(i,e,r,l,t),this.isDragging=!1)}}setContainer(t){let e=(0,a.getElement)(t)||this.container;return this.initContainer(e),this}setBackgroundColor(t,e){(void 0===e||e<0||e>1)&&(e=1);var r=o.CC.color(t);return this.scene.fog.color=r,this.bgColor=r.getHex(),this.renderer.setClearColorHex(r.getHex(),e),this.show(),this}setProjection(t){this.camera.ortho="orthographic"===t,this.setSlabAndFog()}setViewStyle(t){if("outline"===t.style){var e={};t.color&&(e.color=o.CC.color(t.color)),t.width&&(e.width=t.width),this.renderer.enableOutline(e)}else this.renderer.disableOutline();return this}updateSize(){this.renderer.setSize(this.WIDTH,this.HEIGHT),this.ASPECT=this.renderer.getAspect(this.WIDTH,this.HEIGHT),this.renderer.setSize(this.WIDTH,this.HEIGHT),this.camera.aspect=this.ASPECT,this.camera.updateProjectionMatrix()}setWidth(t){return this.WIDTH=t||this.WIDTH,this.updateSize(),this}setHeight(t){return this.HEIGHT=t||this.HEIGHT,this.updateSize(),this}resize(){this.WIDTH=this.getWidth(),this.HEIGHT=this.getHeight();let t=!1;if(console.log("resize "+this.container.id),console.log("lost "+this.renderer.isLost()+" w"+this.WIDTH+" h"+this.HEIGHT),this.renderer.isLost()&&this.WIDTH>0&&this.HEIGHT>0){let e=!1,r=this.container.querySelector("canvas");r&&r!=this.renderer.getCanvas()?this.config.canvas=r:(r.remove(),this.config&&null!=this.config.canvas&&(delete this.config.canvas,e=!0)),this.setupRenderer(),this.initContainer(this.container),this.renderer.setClearColorHex(this.bgColor,this.config.backgroundAlpha),t=!0,e&&(this.config.canvas=this.renderer.getCanvas()),console.log("regen "+t+" resetcanvas "+e)}if(0==this.WIDTH||0==this.HEIGHT?this.animated&&this._viewer.pauseAnimate():this.animated&&this._viewer.resumeAnimate(),this.updateSize(),t){let t=this.renderer.supportedExtensions();if(t.regen=!0,this.viewers)for(let e=0,r=this.viewers.length;e=0&&(this.modelGroup.remove(this.labels[r].sprite),(this.viewer_frame<0||this.labels[r].frame==this.viewer_frame)&&this.modelGroup.add(this.labels[r].sprite));for(r in this.surfaces)if(this.surfaces.hasOwnProperty(r)){var a=this.surfaces[r];for(i=0;i1||1==a[i].symmetries.length&&!a[i].symmetries[i].isIdentity()){var c,u=new n.Object3D;for(c=0;c0?this.animateMotion(e,r,this.modelGroup.position,this.adjustZoomToLimits(i),this.rotationGroup.quaternion,this.lookingAt):(this.rotationGroup.position.z=this.adjustZoomToLimits(i),this.show()),this}translate(t,e,r=0,n=!1){var o=t/this.WIDTH,a=e/this.HEIGHT,s=new i.Vector3(0,0,-this.CAMERA_Z);this.projector.projectVector(s,this.camera),s.x-=o,s.y-=a,this.projector.unprojectVector(s,this.camera),s.z=0;var l=this.lookingAt.clone().add(s);return r>0?this.animateMotion(r,n,this.modelGroup.position,this.rotationGroup.position.z,this.rotationGroup.quaternion,l):(this.lookingAt=l,this.camera.lookAt(this.lookingAt),this.show()),this}translateScene(t,e,r=0,n=!1){var i=this.screenOffsetToModel(t,e),o=this.modelGroup.position.clone().add(i);return r>0?this.animateMotion(r,n,this.modelGroup.position,this.rotationGroup.position.z,this.rotationGroup.quaternion,this.lookingAt):(this.modelGroup.position=o,this.show()),this}fitSlab(t){t=t||{};var e=this.getAtomsFromSel(t),r=(0,a.getExtent)(e),n=r[1][0]-r[0][0],i=r[1][1]-r[0][1],o=r[1][2]-r[0][2],s=Math.hypot(n,i,o);return s<5&&(s=5),this.slabNear=-s/1.9,this.slabFar=s/2,this}center(t={},e=0,r=!1){var n,o,s=this.getAtomsFromSel(t),l=(0,a.getExtent)(s);(0,a.isEmptyObject)(t)?(this.shapes.forEach((t=>{if(t&&t.boundingSphere&&t.boundingSphere.center){var e=t.boundingSphere.center,r=t.boundingSphere.radius;r>0?(s.push(new i.Vector3(e.x+r,e.y,e.z)),s.push(new i.Vector3(e.x-r,e.y,e.z)),s.push(new i.Vector3(e.x,e.y+r,e.z)),s.push(new i.Vector3(e.x,e.y-r,e.z)),s.push(new i.Vector3(e.x,e.y,e.z+r)),s.push(new i.Vector3(e.x,e.y,e.z-r))):s.push(e)}})),l=(0,a.getExtent)(s),n=s,o=l):(n=this.getAtomsFromSel({}),o=(0,a.getExtent)(n));var c=new i.Vector3(l[2][0],l[2][1],l[2][2]),u=o[1][0]-o[0][0],h=o[1][1]-o[0][1],d=o[1][2]-o[0][2],f=Math.hypot(u,h,d);f<5&&(f=5),this.slabNear=-f/1.9,this.slabFar=f/2,u=l[1][0]-l[0][0],h=l[1][1]-l[0][1],d=l[1][2]-l[0][2],(f=Math.hypot(u,h,d))<5&&(f=5);for(var p=25,m=0;mp&&(p=g)}f=2*Math.sqrt(p);var v=c.clone().multiplyScalar(-1);return e>0?this.animateMotion(e,r,v,this.rotationGroup.position.z,this.rotationGroup.quaternion,this.lookingAt):(this.modelGroup.position=v,this.show()),this}zoomTo(t={},e=0,r=!1){let n=this.getAtomsFromSel(t),o=(0,a.getExtent)(n),s=o;if((0,a.isEmptyObject)(t)){let t=n&&n.length;if(this.shapes.forEach((t=>{if(t&&t.boundingSphere)if(t.boundingSphere.box){let e=t.boundingSphere.box;n.push(new i.Vector3(e.min.x,e.min.y,e.min.z)),n.push(new i.Vector3(e.max.x,e.max.y,e.max.z))}else if(t.boundingSphere.center){var e=t.boundingSphere.center,r=t.boundingSphere.radius;r>0?(n.push(new i.Vector3(e.x+r,e.y,e.z)),n.push(new i.Vector3(e.x-r,e.y,e.z)),n.push(new i.Vector3(e.x,e.y+r,e.z)),n.push(new i.Vector3(e.x,e.y-r,e.z)),n.push(new i.Vector3(e.x,e.y,e.z+r)),n.push(new i.Vector3(e.x,e.y,e.z-r))):n.push(e)}})),s=(0,a.getExtent)(n),!t)for(let t=0;t<3;t++)o[2][t]=(s[0][t]+s[1][t])/2}else{let t=this.getAtomsFromSel({});s=(0,a.getExtent)(t)}var l=new i.Vector3(o[2][0],o[2][1],o[2][2]),c=s[1][0]-s[0][0],u=s[1][1]-s[0][1],h=s[1][2]-s[0][2],d=Math.hypot(c,u,h);d<5&&(d=5),this.slabNear=-d/1.9,this.slabFar=d/2,0===Object.keys(t).length&&(this.slabNear=Math.min(2*-d,-50),this.slabFar=Math.max(2*d,50));var f=this.config.minimumZoomToDistance||5;c=o[1][0]-o[0][0],u=o[1][1]-o[0][1],h=o[1][2]-o[0][2],(d=Math.hypot(c,u,h))p&&(p=g)}d=2*Math.sqrt(p);var v=l.clone().multiplyScalar(-1),b=-(.5*d/Math.tan(Math.PI/180*this.camera.fov/2)-this.CAMERA_Z);return b=this.adjustZoomToLimits(b),e>0?this.animateMotion(e,r,v,b,this.rotationGroup.quaternion,this.lookingAt):(this.modelGroup.position=v,this.rotationGroup.position.z=b,this.show()),this}setSlab(t,e){this.slabNear=t,this.slabFar=e}getSlab(){return{near:this.slabNear,far:this.slabFar}}addLabel(t,e={},r,n=!1){if(r){var i=(0,a.getExtent)(this.getAtomsFromSel(r));e.position={x:i[2][0],y:i[2][1],z:i[2][2]}}var o=new c.Label(t,e);return o.setContext(),this.modelGroup.add(o.sprite),this.labels.push(o),n||this.show(),o}addResLabels(t,e,r=!1){let n=this.labels.length;return this.applyToModels("addResLabels",t,this,e,r),this.show(),this.labels.slice(n)}addPropertyLabels(t,e,r){return this.applyToModels("addPropertyLabels",t,e,this,r),this.show(),this}removeLabel(t){for(var e=0;e0&&void 0===this.shapes[this.shapes.length-1];)this.shapes.pop();return this}removeAllShapes(){for(var t=0;t-1e-4&&o.x<1.0001&&o.y>-1e-4&&o.y<1.0001&&o.z>-1e-4&&o.z<1.0001)}}for(let o=0;oo){t.start=r,t.end=n,e.addLine(t);break}h.addVectors(r,c),t.start=r,t.end=h,e.addLine(t),r=h.clone(),d+=a,h.addVectors(r,u),r=h.clone(),d+=s}return e.finalize(),e}addCustom(t){t=t||{};var e=new u.GLShape(t);return e.shapePosition=this.shapes.length,e.addCustom(t),this.shapes.push(e),e.finalize(),e}addVolumetricData(t,e,r={}){var n=new h.VolumeData(t,e);return r.hasOwnProperty("transferfn")?this.addVolumetricRender(n,r):this.addIsosurface(n,r)}addIsosurface(t,e={},r){var n=new u.GLShape(e);return n.shapePosition=this.shapes.length,n.addIsosurface(t,e,r,this),this.shapes.push(n),n}addVolumetricRender(t,e){e=e||{};var r=new f.GLVolumetricRender(t,e,this);return r.shapePosition=this.shapes.length,this.shapes.push(r),r}hasVolumetricRender(){return this.renderer.supportsVolumetric()}enableFog(t){t?this.scene.fog=new n.Fog(this.bgColor,100,200):(this.config.disableFog=!0,this.show())}setFrame(t){this.viewer_frame=t;let e=this;return new Promise((function(r){var n=e.models.map((function(r){return r.setFrame(t,e)}));Promise.all(n).then((function(){r()}))}))}getFrame(){return this.viewer_frame}getNumFrames(){var t=0;for(let e=0;et&&(t=this.models[e].getNumFrames());for(let e=0;e=t&&(t=this.shapes[e].frame+1);for(let e=0;e=t&&(t=this.labels[e].frame+1);return t}animate(t){this.incAnim();var e=100,r="forward",n=1/0;(t=t||{}).interval&&(e=t.interval),t.loop&&(r=t.loop),t.reps&&(n=t.reps);var i=this.getNumFrames(),o=this,s=0;t.startFrame&&(s=t.startFrame%i);var l=1;t.step&&(n/=l=t.step);var c,u,h=0,d=i*n,f=new Date,p=function(t){f=new Date,"forward"==t?o.setFrame(s).then((function(){s=(s+l)%i,c()})):"backward"==t?o.setFrame(i-1-s).then((function(){s=(s+l)%i,c()})):o.setFrame(s).then((function(){l*=(s+=l)%(i-1)==0?-1:1,c()}))};return c=function(){if(o.render(),o.getCanvas().isConnected)if(++h>=d||!o.isAnimated())u.cancel(),o.animationTimers.delete(u),o.decAnim();else{var t=e-((new Date).getTime()-f.getTime());t=t>0?t:0,o.animationTimers.delete(u),u=new a.PausableTimer(p,t,r),o.animationTimers.add(u)}else o.stopAnimate()},u=new a.PausableTimer(p,0,r),this.animationTimers.add(u),this}stopAnimate(){return this.animated=0,this.animationTimers.forEach((function(t){t.cancel()})),this.animationTimers=new Set,this}pauseAnimate(){return this.animationTimers.forEach((function(t){t.pause()})),this}resumeAnimate(){return this.animationTimers.forEach((function(t){t.resume()})),this}isAnimated(){return this.animated>0}getModelOpt(t){return t&&!t.defaultcolors?(t.defaultcolors=this.defaultcolors,t.cartoonQuality=t.cartoonQuality||this.config.cartoonQuality):void 0===t&&(t={defaultcolors:this.defaultcolors,cartoonQuality:this.config.cartoonQuality}),t}addModel(t,e="",r){r=this.getModelOpt(r);var n=new l.GLModel(this.models.length,r);return n.addMolData(t,e,r),this.models.push(n),n}addModels(t,e,r){(r=this.getModelOpt(r)).multimodel=!0,r.frames=!0;for(var n=l.GLModel.parseMolData(t,e,r),i=0;i0&&void 0===this.models[this.models.length-1];)this.models.pop();return this}}removeAllModels(){for(var t=0;te[1][0]||n.ye[1][1]||n.ze[1][2]||r.push(n))}return r}static volume(t){return(t[1][0]-t[0][0])*(t[1][1]-t[0][1])*(t[1][2]-t[0][2])}carveUpExtent(t,e,r){let n=[],i={};for(let t=0,r=e.length;tn&&r>i?0:n>r&&n>i?1:2;var o=a(t),l=a(t),c=(t[1][e]-t[0][e])/2+t[0][e];o[1][e]=c,l[0][e]=c;var u=s(o),h=s(l);return u.concat(h)},l=s(t);for(let t=0,i=l.length;t0)for(let t=0,e=h.length;t1||1==w.length&&!w[0].isIdentity()){_=!0;break}}var k=function(t,r,n){var i;b=l?m.shallowCopy(p.getAtomsFromSel(l)):n;var o=(0,a.getExtent)(n,!0);if(e.map&&e.map.prop){var c=e.map.prop;let t=(0,s.getGradient)(e.map.scheme||e.map.gradient||new s.Gradient.RWB),r=t.range();r||(r=(0,a.getPropertyRange)(n,c)),e.colorscheme={prop:c,gradient:t}}for(let t=0,n=r.length;t0){var x=(0,a.getExtent)(b,!0);y.sort((function(t,e){var r=function(t,e){var r=t.extent,n=r[1][0]-r[0][0],i=r[1][1]-r[0][1],o=r[1][2]-r[0][2],a=n-e[2][0];a*=a;var s=i-e[2][1];s*=s;var l=o-e[2][2];return a+s+l*l};return r(t,x)-r(e,x)}))}var _=[];for(let t=0,e=r.length;t0&&(A.push({geo:new n.Geometry(!0),mat:f,done:!1,finished:!1,symmetries:this.models[x].getSymmetries()}),C.push(k(A[A.length-1],T[x],S[x])));M=Promise.all(C)}else A.push({geo:new n.Geometry(!0),mat:f,done:!1,finished:!1,symmetries:[new i.Matrix4]}),M=k(A[A.length-1],v,y);return this.surfaces[h]=A,M.surfid=h,c&&"function"==typeof c?(M.then((function(t){c(t)})),h):M}setSurfaceMaterialStyle(t,e){if((0,a.adjustVolumeStyle)(e),this.surfaces[t]){var r=this.surfaces[t];r.style=e;for(var i=0;i0?this.camera.position.x=r*Math.tan(Math.PI/180*e):this.camera.position.x=-r*Math.tan(Math.PI/180*e),this.camera.lookAt(new i.Vector3(0,0,this.rotationGroup.position.z)),this.camera.position.x}setDefaultCartoonQuality(t){this.config.cartoonQuality=t}}function g(t,e){if(t=(0,a.getElement)(t)){e=e||{};try{return new m(t,e)}catch(t){throw"error creating viewer: "+t}}}function v(t,e={},r={}){if(t=(0,a.getElement)(t)){var n=[],i=document.createElement("canvas");r.rows=e.rows,r.cols=e.cols,r.control_all=null!=e.control_all&&e.control_all,t.appendChild(i);try{for(var o=0;o{"use strict";r.r(e),r.d(e,{CustomLinear:()=>u,Gradient:()=>d,GradientType:()=>i,ROYGB:()=>l,RWB:()=>s,Sinebow:()=>c,builtinGradients:()=>h,getGradient:()=>a,normalizeValue:()=>o});var n=r("./src/colors.ts");class i{}function o(t,e,r){return e>=t?(re&&(r=e),{lo:t,hi:e,val:r}):(r>t&&(r=t),r=2?(this.max=t[1],this.min=t[0]):t&&e&&!Array.isArray(t)&&(this.min=t,this.max=e)}range(){return void 0!==this.min&&void 0!==this.max?[this.min,this.max]:null}valueToHex(t,e){var r,n;if(t=this.mult*t,e?(r=e[0],n=e[1]):(r=this.min,n=this.max),void 0===t)return 16777215;var i=o(r,n,t);r=i.lo;var a,s=n=i.hi;return(t=i.val)<(s=e&&void 0!==e[2]?e[2]:void 0!==this.mid?this.mid:(r+n)/2)?16711680+256*(a=Math.floor(255*Math.sqrt((t-r)/(s-r))))+a:t>s?65536*(a=Math.floor(255*Math.sqrt(1-(t-s)/(n-s))))+256*a+255:16777215}}class l extends i{constructor(t,e){super(),this.gradient="ROYGB",this.mult=1,this.min=t,this.max=e,void 0===e&&Array.isArray(t)&&t.length>=2?(this.max=t[1],this.min=t[0]):t&&e&&!Array.isArray(t)&&(this.min=t,this.max=e)}valueToHex(t,e){var r,n;if(t=this.mult*t,e?(r=e[0],n=e[1]):(r=this.min,n=this.max),void 0===t)return 16777215;var i=o(r,n,t),a=((r=i.lo)+(n=i.hi))/2,s=(r+a)/2,l=(a+n)/2;return(t=i.val)=2&&(this.max=t[1],this.min=t[0]),e=2?(this.max=t[1],this.min=t[0],i=e):(this.min=t,this.max=e,i=r),i)for(let t of i)this.colors.push(n.CC.color(t));else this.colors.push(n.CC.color(0))}range(){return void 0!==this.min&&void 0!==this.max?[this.min,this.max]:null}valueToHex(t,e){var r,i;if(e?(r=e[0],i=e[1]):(r=this.min,i=this.max),void 0===t)return 16777215;var a=o(r,i,t);r=a.lo,i=a.hi,t=a.val;let s=this.colors.length,l=(i-r)/s,c=Math.min(Math.floor((t-r)/l),s-1),u=Math.min(c+1,s-1),h=(t-r-c*l)/l,d=this.colors[c],f=this.colors[u];return new n.Color(d.r+h*(f.r-d.r),d.g+h*(f.g-d.g),d.b+h*(f.b-d.b)).getHex()}}const h={rwb:s,RWB:s,roygb:l,ROYGB:l,sinebow:c,linear:u};class d extends i{valueToHex(t,e){return 0}range(){return null}}d.RWB=s,d.ROYGB=l,d.Sinebow=c,d.CustomLinear=u,d.builtinGradients=h,d.normalizeValue=o,d.getGradient=a},"./src/Label.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{Label:()=>l,LabelCount:()=>a});var n=r("./src/WebGL/index.ts"),i=r("./src/Gradient.ts"),o=r("./src/colors.ts");let a=0;function s(t,e,r){var n=r;return void 0!==t&&(t instanceof o.Color?n=t.scaled():void 0!==(n=o.CC.color(t)).scaled&&(n=n.scaled())),void 0!==e&&(n.a=parseFloat(e)),n}class l{constructor(t,e){this.id=a++,this.stylespec=e||{},this.canvas=document.createElement("canvas"),this.canvas.width=134,this.canvas.height=35,this.context=this.canvas.getContext("2d"),this.sprite=new n.Sprite,this.text=t,this.frame=this.stylespec.frame}getStyle(){return this.stylespec}setContext(){var t=this.stylespec,e=void 0!==t.useScreen&&t.useScreen,r=t.showBackground;"0"!==r&&"false"!==r||(r=!1),void 0===r&&(r=!0);var o=t.font?t.font:"sans-serif",a=parseInt(t.fontSize)?parseInt(t.fontSize):18,l=s(t.fontColor,t.fontOpacity,{r:255,g:255,b:255,a:1}),c=t.padding?t.padding:4,u=t.borderThickness?t.borderThickness:0,h=s(t.backgroundColor,t.backgroundOpacity,{r:0,g:0,b:0,a:1}),d=s(t.borderColor,t.borderOpacity,h),f=t.position?t.position:{x:-10,y:1,z:1},p=void 0===t.inFront||t.inFront;"false"!==p&&"0"!==p||(p=!1);var m=t.alignment||n.SpriteAlignment.topLeft;"string"==typeof m&&m in n.SpriteAlignment&&(m=n.SpriteAlignment[m]);var g="";t.bold&&(g="bold "),this.context.font=g+a+"px "+o;var v=this.context.measureText(this.text).width;r||(u=0);var b=v+2.5*u+2*c,y=1.25*a+2*u+2*c;if(t.backgroundImage){var x=t.backgroundImage,_=t.backgroundWidth?t.backgroundWidth:x.width,w=t.backgroundHeight?t.backgroundHeight:x.height;_>b&&(b=_),w>y&&(y=w)}if(this.canvas.width=b,this.canvas.height=y,this.context.clearRect(0,0,this.canvas.width,this.canvas.height),g="",t.bold&&(g="bold "),this.context.font=g+a+"px "+o,this.context.fillStyle="rgba("+h.r+","+h.g+","+h.b+","+h.a+")",this.context.strokeStyle="rgba("+d.r+","+d.g+","+d.b+","+d.a+")",t.backgroundGradient){let e=this.context.createLinearGradient(0,y/2,b,y/2),r=i.Gradient.getGradient(t.backgroundGradient),n=r.range(),o=-1,a=1;n&&(o=n[0],a=n[1]);let l=a-o;for(let t=0;t<1.01;t+=.1){let n=s(r.valueToHex(o+l*t)),i="rgba("+n.r+","+n.g+","+n.b+","+n.a+")";e.addColorStop(t,i)}this.context.fillStyle=e}this.context.lineWidth=u,r&&function(t,e,r,n,i,o,a){t.beginPath(),t.moveTo(e+6,r),t.lineTo(e+n-6,r),t.quadraticCurveTo(e+n,r,e+n,r+6),t.lineTo(e+n,r+i-6),t.quadraticCurveTo(e+n,r+i,e+n-6,r+i),t.lineTo(e+6,r+i),t.quadraticCurveTo(e,r+i,e,r+i-6),t.lineTo(e,r+6),t.quadraticCurveTo(e,r,e+6,r),t.closePath(),t.fill(),a&&t.stroke()}(this.context,u,u,b-2*u,y-2*u,0,u>0),t.backgroundImage&&this.context.drawImage(x,0,0,b,y),this.context.fillStyle="rgba("+l.r+","+l.g+","+l.b+","+l.a+")",this.context.fillText(this.text,u+c,a+u+c,v);var k=new n.Texture(this.canvas);k.needsUpdate=!0,this.sprite.material=new n.SpriteMaterial({map:k,useScreenCoordinates:e,alignment:m,depthTest:!p,screenOffset:t.screenOffset||null}),this.sprite.scale.set(1,1,1),this.sprite.position.set(f.x,f.y,f.z)}dispose(){void 0!==this.sprite.material.map&&this.sprite.material.map.dispose(),void 0!==this.sprite.material&&this.sprite.material.dispose()}}},"./src/ProteinSurface4.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{MarchingCube:()=>l,MarchingCubeInitializer:()=>s,PointGrid:()=>c,ProteinSurface:()=>u,SurfaceType:()=>n,setSyncSurface:()=>a,syncSurface:()=>o});var n,i=r("./src/WebGL/math/index.ts");!function(t){t[t.VDW=1]="VDW",t[t.MS=2]="MS",t[t.SAS=3]="SAS",t[t.SES=4]="SES"}(n||(n={}));var o=!1;function a(t){o=t}(window.navigator.userAgent.indexOf("MSIE ")>=0||window.navigator.userAgent.indexOf("Trident/")>=0)&&(o=!0);class s{constructor(){this.ISDONE=2,this.edgeTable=new Uint32Array([0,0,0,0,0,0,0,2816,0,0,0,1792,0,3328,3584,3840,0,0,0,138,0,21,0,134,0,0,0,652,0,2067,3865,3600,0,0,0,42,0,0,0,294,0,0,21,28,0,3875,1049,3360,0,168,162,170,0,645,2475,2210,0,687,293,172,4010,3747,3497,3232,0,0,0,0,0,69,0,900,0,0,0,1792,138,131,1608,1920,0,81,0,2074,84,85,84,86,0,81,0,3676,330,1105,1881,1616,0,0,0,42,0,69,0,502,0,0,21,3580,138,2035,1273,1520,2816,104,2337,106,840,581,367,102,2816,3695,3429,3180,1898,1635,1385,1120,0,0,0,0,0,0,0,3910,0,0,69,588,42,2083,41,2880,0,0,0,1722,0,2293,4095,3830,0,255,757,764,2538,2291,3065,2800,0,0,81,338,0,3925,1119,3414,84,855,85,340,2130,2899,89,2384,1792,712,194,1162,4036,3781,3535,3270,708,719,197,204,3018,2755,2505,2240,0,0,0,0,168,420,168,1958,162,162,676,2988,170,163,680,928,3328,3096,3328,3642,52,53,1855,1590,2340,2111,2869,2620,298,51,825,560,3584,3584,3090,3482,1668,1941,1183,1430,146,2975,2069,2460,154,915,153,400,3840,3592,3329,3082,1796,1541,1295,1030,2818,2575,2309,2060,778,515,265,0]),this.triTable=[[],[],[],[],[],[],[],[11,9,8],[],[],[],[8,10,9],[],[10,8,11],[9,11,10],[8,10,9,8,11,10],[],[],[],[1,7,3],[],[4,2,0],[],[2,1,7],[],[],[],[2,7,3,2,9,7],[],[1,4,11,1,0,4],[3,8,0,11,9,4,11,10,9],[4,11,9,11,10,9],[],[],[],[5,3,1],[],[],[],[2,5,8,2,1,5],[],[],[2,4,0],[3,2,4],[],[0,9,1,8,10,5,8,11,10],[3,4,0,3,10,4],[5,8,10,8,11,10],[],[3,5,7],[7,1,5],[1,7,3,1,5,7],[],[9,2,0,9,7,2],[0,3,8,1,7,11,1,5,7],[11,1,7,1,5,7],[],[9,1,0,5,3,2,5,7,3],[8,2,5,8,0,2],[2,5,3,5,7,3],[3,9,1,3,8,9,7,11,10,7,10,5],[9,1,0,10,7,11,10,5,7],[3,8,0,7,10,5,7,11,10],[11,5,7,11,10,5],[],[],[],[],[],[0,6,2],[],[7,2,9,7,9,8],[],[],[],[8,10,9],[7,1,3],[7,1,0],[6,9,3,6,10,9],[7,10,8,10,9,8],[],[6,0,4],[],[11,1,4,11,3,1],[2,4,6],[2,0,4,2,4,6],[2,4,6],[1,4,2,4,6,2],[],[6,0,4],[],[2,11,3,6,9,4,6,10,9],[8,6,1,8,1,3],[10,0,6,0,4,6],[8,0,3,9,6,10,9,4,6],[10,4,6,10,9,4],[],[],[],[5,3,1],[],[0,6,2],[],[7,4,8,5,2,1,5,6,2],[],[],[2,4,0],[7,4,8,2,11,3,10,5,6],[7,1,3],[5,6,10,0,9,1,8,7,4],[5,6,10,7,0,3,7,4,0],[10,5,6,4,8,7],[9,11,8],[3,5,6],[0,5,11,0,11,8],[6,3,5,3,1,5],[3,9,6,3,8,9],[9,6,0,6,2,0],[0,3,8,2,5,6,2,1,5],[1,6,2,1,5,6],[9,11,8],[1,0,9,6,10,5,11,3,2],[6,10,5,2,8,0,2,11,8],[3,2,11,10,5,6],[10,5,6,9,3,8,9,1,3],[0,9,1,5,6,10],[8,0,3,10,5,6],[10,5,6],[],[],[],[],[],[],[],[1,10,2,9,11,6,9,8,11],[],[],[6,0,2],[3,6,9,3,2,6],[3,5,1],[0,5,1,0,11,5],[0,3,5],[6,9,11,9,8,11],[],[],[],[4,5,9,7,1,10,7,3,1],[],[11,6,7,2,4,5,2,0,4],[11,6,7,8,0,3,1,10,2,9,4,5],[6,7,11,1,10,2,9,4,5],[],[4,1,0,4,5,1,6,7,3,6,3,2],[9,4,5,0,6,7,0,2,6],[4,5,9,6,3,2,6,7,3],[6,7,11,5,3,8,5,1,3],[6,7,11,4,1,0,4,5,1],[4,5,9,3,8,0,11,6,7],[9,4,5,7,11,6],[],[],[0,6,4],[8,6,4,8,1,6],[],[0,10,2,0,9,10,4,8,11,4,11,6],[10,2,1,6,0,3,6,4,0],[10,2,1,11,4,8,11,6,4],[4,2,6],[1,0,9,2,4,8,2,6,4],[2,4,0,2,6,4],[8,2,4,2,6,4],[11,4,1,11,6,4],[0,9,1,4,11,6,4,8,11],[3,6,0,6,4,0],[8,6,4,8,11,6],[10,8,9],[6,3,9,6,7,3],[6,7,1],[10,7,1,7,3,1],[7,11,6,8,10,2,8,9,10],[11,6,7,10,0,9,10,2,0],[2,1,10,7,11,6,8,0,3],[1,10,2,6,7,11],[7,2,6,7,9,2],[1,0,9,3,6,7,3,2,6],[7,0,6,0,2,6],[2,7,3,2,6,7],[7,11,6,3,9,1,3,8,9],[9,1,0,11,6,7],[0,3,8,11,6,7],[11,6,7],[],[],[],[],[5,3,7],[8,5,2,8,7,5],[5,3,7],[1,10,2,5,8,7,5,9,8],[1,7,5],[1,7,5],[9,2,7,9,7,5],[11,3,2,8,5,9,8,7,5],[1,3,7,1,7,5],[0,7,1,7,5,1],[9,3,5,3,7,5],[9,7,5,9,8,7],[8,10,11],[3,4,10,3,10,11],[8,10,11],[5,9,4,1,11,3,1,10,11],[2,4,5],[5,2,4,2,0,4],[0,3,8,5,9,4,10,2,1],[2,1,10,9,4,5],[2,8,5,2,11,8],[3,2,11,1,4,5,1,0,4],[9,4,5,8,2,11,8,0,2],[11,3,2,9,4,5],[8,5,3,5,1,3],[5,0,4,5,1,0],[3,8,0,4,5,9],[9,4,5],[11,9,10],[11,9,10],[1,11,4,1,10,11],[8,7,4,11,1,10,11,3,1],[2,7,9,2,9,10],[4,8,7,0,10,2,0,9,10],[2,1,10,0,7,4,0,3,7],[10,2,1,8,7,4],[1,7,4],[3,2,11,4,8,7,9,1,0],[11,4,2,4,0,2],[2,11,3,7,4,8],[4,1,7,1,3,7],[1,0,9,8,7,4],[3,4,0,3,7,4],[8,7,4],[8,9,10,8,10,11],[3,9,11,9,10,11],[0,10,8,10,11,8],[10,3,1,10,11,3],[2,8,10,8,9,10],[9,2,0,9,10,2],[8,0,3,1,10,2],[10,2,1],[1,11,9,11,8,9],[11,3,2,0,9,1],[11,0,2,11,8,0],[11,3,2],[8,1,3,8,9,1],[9,1,0],[8,0,3],[]],this.edgeTable2=[0,265,515,778,2060,2309,2575,2822,1030,1295,1541,1804,3082,3331,3593,3840,400,153,915,666,2460,2197,2975,2710,1430,1183,1941,1692,3482,3219,3993,3728,560,825,51,314,2620,2869,2111,2358,1590,1855,1077,1340,3642,3891,3129,3376,928,681,419,170,2988,2725,2479,2214,1958,1711,1445,1196,4010,3747,3497,3232,2240,2505,2755,3018,204,453,719,966,3270,3535,3781,4044,1226,1475,1737,1984,2384,2137,2899,2650,348,85,863,598,3414,3167,3925,3676,1370,1107,1881,1616,2800,3065,2291,2554,764,1013,255,502,3830,4095,3317,3580,1786,2035,1273,1520,2912,2665,2403,2154,876,613,367,102,3942,3695,3429,3180,1898,1635,1385,1120,1120,1385,1635,1898,3180,3429,3695,3942,102,367,613,876,2154,2403,2665,2912,1520,1273,2035,1786,3580,3317,4095,3830,502,255,1013,764,2554,2291,3065,2800,1616,1881,1107,1370,3676,3925,3167,3414,598,863,85,348,2650,2899,2137,2384,1984,1737,1475,1226,4044,3781,3535,3270,966,719,453,204,3018,2755,2505,2240,3232,3497,3747,4010,1196,1445,1711,1958,2214,2479,2725,2988,170,419,681,928,3376,3129,3891,3642,1340,1077,1855,1590,2358,2111,2869,2620,314,51,825,560,3728,3993,3219,3482,1692,1941,1183,1430,2710,2975,2197,2460,666,915,153,400,3840,3593,3331,3082,1804,1541,1295,1030,2822,2575,2309,2060,778,515,265,0],this.triTable2=[[],[8,3,0],[9,0,1],[8,3,1,8,1,9],[11,2,3],[11,2,0,11,0,8],[11,2,3,0,1,9],[2,1,11,1,9,11,11,9,8],[10,1,2],[8,3,0,1,2,10],[9,0,2,9,2,10],[3,2,8,2,10,8,8,10,9],[10,1,3,10,3,11],[1,0,10,0,8,10,10,8,11],[0,3,9,3,11,9,9,11,10],[8,10,9,8,11,10],[8,4,7],[3,0,4,3,4,7],[1,9,0,8,4,7],[9,4,1,4,7,1,1,7,3],[2,3,11,7,8,4],[7,11,4,11,2,4,4,2,0],[3,11,2,4,7,8,9,0,1],[2,7,11,2,1,7,1,4,7,1,9,4],[10,1,2,8,4,7],[2,10,1,0,4,7,0,7,3],[4,7,8,0,2,10,0,10,9],[2,7,3,2,9,7,7,9,4,2,10,9],[8,4,7,11,10,1,11,1,3],[11,4,7,1,4,11,1,11,10,1,0,4],[3,8,0,7,11,4,11,9,4,11,10,9],[7,11,4,4,11,9,11,10,9],[9,5,4],[3,0,8,4,9,5],[5,4,0,5,0,1],[4,8,5,8,3,5,5,3,1],[11,2,3,9,5,4],[9,5,4,8,11,2,8,2,0],[3,11,2,1,5,4,1,4,0],[8,5,4,2,5,8,2,8,11,2,1,5],[2,10,1,9,5,4],[0,8,3,5,4,9,10,1,2],[10,5,2,5,4,2,2,4,0],[3,4,8,3,2,4,2,5,4,2,10,5],[5,4,9,1,3,11,1,11,10],[0,9,1,4,8,5,8,10,5,8,11,10],[3,4,0,3,10,4,4,10,5,3,11,10],[4,8,5,5,8,10,8,11,10],[9,5,7,9,7,8],[0,9,3,9,5,3,3,5,7],[8,0,7,0,1,7,7,1,5],[1,7,3,1,5,7],[11,2,3,8,9,5,8,5,7],[9,2,0,9,7,2,2,7,11,9,5,7],[0,3,8,2,1,11,1,7,11,1,5,7],[2,1,11,11,1,7,1,5,7],[1,2,10,5,7,8,5,8,9],[9,1,0,10,5,2,5,3,2,5,7,3],[5,2,10,8,2,5,8,5,7,8,0,2],[10,5,2,2,5,3,5,7,3],[3,9,1,3,8,9,7,11,10,7,10,5],[9,1,0,10,7,11,10,5,7],[3,8,0,7,10,5,7,11,10],[11,5,7,11,10,5],[11,7,6],[0,8,3,11,7,6],[9,0,1,11,7,6],[7,6,11,3,1,9,3,9,8],[2,3,7,2,7,6],[8,7,0,7,6,0,0,6,2],[1,9,0,3,7,6,3,6,2],[7,6,2,7,2,9,2,1,9,7,9,8],[1,2,10,6,11,7],[2,10,1,7,6,11,8,3,0],[11,7,6,10,9,0,10,0,2],[7,6,11,3,2,8,8,2,10,8,10,9],[6,10,7,10,1,7,7,1,3],[6,10,1,6,1,7,7,1,0,7,0,8],[9,0,3,6,9,3,6,10,9,6,3,7],[6,10,7,7,10,8,10,9,8],[8,4,6,8,6,11],[11,3,6,3,0,6,6,0,4],[0,1,9,4,6,11,4,11,8],[1,9,4,11,1,4,11,3,1,11,4,6],[3,8,2,8,4,2,2,4,6],[2,0,4,2,4,6],[1,9,0,3,8,2,2,8,4,2,4,6],[9,4,1,1,4,2,4,6,2],[10,1,2,11,8,4,11,4,6],[10,1,2,11,3,6,6,3,0,6,0,4],[0,2,10,0,10,9,4,11,8,4,6,11],[2,11,3,6,9,4,6,10,9],[8,4,6,8,6,1,6,10,1,8,1,3],[1,0,10,10,0,6,0,4,6],[8,0,3,9,6,10,9,4,6],[10,4,6,10,9,4],[9,5,4,7,6,11],[4,9,5,3,0,8,11,7,6],[6,11,7,4,0,1,4,1,5],[6,11,7,4,8,5,5,8,3,5,3,1],[4,9,5,6,2,3,6,3,7],[9,5,4,8,7,0,0,7,6,0,6,2],[4,0,1,4,1,5,6,3,7,6,2,3],[7,4,8,5,2,1,5,6,2],[6,11,7,1,2,10,9,5,4],[11,7,6,8,3,0,1,2,10,9,5,4],[11,7,6,10,5,2,2,5,4,2,4,0],[7,4,8,2,11,3,10,5,6],[4,9,5,6,10,7,7,10,1,7,1,3],[5,6,10,0,9,1,8,7,4],[5,6,10,7,0,3,7,4,0],[10,5,6,4,8,7],[5,6,9,6,11,9,9,11,8],[0,9,5,0,5,3,3,5,6,3,6,11],[0,1,5,0,5,11,5,6,11,0,11,8],[11,3,6,6,3,5,3,1,5],[9,5,6,3,9,6,3,8,9,3,6,2],[5,6,9,9,6,0,6,2,0],[0,3,8,2,5,6,2,1,5],[1,6,2,1,5,6],[1,2,10,5,6,9,9,6,11,9,11,8],[1,0,9,6,10,5,11,3,2],[6,10,5,2,8,0,2,11,8],[3,2,11,10,5,6],[10,5,6,9,3,8,9,1,3],[0,9,1,5,6,10],[8,0,3,10,5,6],[10,5,6],[10,6,5],[8,3,0,10,6,5],[0,1,9,5,10,6],[10,6,5,9,8,3,9,3,1],[3,11,2,10,6,5],[6,5,10,2,0,8,2,8,11],[1,9,0,6,5,10,11,2,3],[1,10,2,5,9,6,9,11,6,9,8,11],[1,2,6,1,6,5],[0,8,3,2,6,5,2,5,1],[5,9,6,9,0,6,6,0,2],[9,6,5,3,6,9,3,9,8,3,2,6],[11,6,3,6,5,3,3,5,1],[0,5,1,0,11,5,5,11,6,0,8,11],[0,5,9,0,3,5,3,6,5,3,11,6],[5,9,6,6,9,11,9,8,11],[10,6,5,4,7,8],[5,10,6,7,3,0,7,0,4],[5,10,6,0,1,9,8,4,7],[4,5,9,6,7,10,7,1,10,7,3,1],[7,8,4,2,3,11,10,6,5],[11,6,7,10,2,5,2,4,5,2,0,4],[11,6,7,8,0,3,1,10,2,9,4,5],[6,7,11,1,10,2,9,4,5],[7,8,4,5,1,2,5,2,6],[4,1,0,4,5,1,6,7,3,6,3,2],[9,4,5,8,0,7,0,6,7,0,2,6],[4,5,9,6,3,2,6,7,3],[6,7,11,4,5,8,5,3,8,5,1,3],[6,7,11,4,1,0,4,5,1],[4,5,9,3,8,0,11,6,7],[9,4,5,7,11,6],[10,6,4,10,4,9],[8,3,0,9,10,6,9,6,4],[1,10,0,10,6,0,0,6,4],[8,6,4,8,1,6,6,1,10,8,3,1],[2,3,11,6,4,9,6,9,10],[0,10,2,0,9,10,4,8,11,4,11,6],[10,2,1,11,6,3,6,0,3,6,4,0],[10,2,1,11,4,8,11,6,4],[9,1,4,1,2,4,4,2,6],[1,0,9,3,2,8,2,4,8,2,6,4],[2,4,0,2,6,4],[3,2,8,8,2,4,2,6,4],[1,4,9,11,4,1,11,1,3,11,6,4],[0,9,1,4,11,6,4,8,11],[11,6,3,3,6,0,6,4,0],[8,6,4,8,11,6],[6,7,10,7,8,10,10,8,9],[9,3,0,6,3,9,6,9,10,6,7,3],[6,1,10,6,7,1,7,0,1,7,8,0],[6,7,10,10,7,1,7,3,1],[7,11,6,3,8,2,8,10,2,8,9,10],[11,6,7,10,0,9,10,2,0],[2,1,10,7,11,6,8,0,3],[1,10,2,6,7,11],[7,2,6,7,9,2,2,9,1,7,8,9],[1,0,9,3,6,7,3,2,6],[8,0,7,7,0,6,0,2,6],[2,7,3,2,6,7],[7,11,6,3,9,1,3,8,9],[9,1,0,11,6,7],[0,3,8,11,6,7],[11,6,7],[11,7,5,11,5,10],[3,0,8,7,5,10,7,10,11],[9,0,1,10,11,7,10,7,5],[3,1,9,3,9,8,7,10,11,7,5,10],[10,2,5,2,3,5,5,3,7],[5,10,2,8,5,2,8,7,5,8,2,0],[9,0,1,10,2,5,5,2,3,5,3,7],[1,10,2,5,8,7,5,9,8],[2,11,1,11,7,1,1,7,5],[0,8,3,2,11,1,1,11,7,1,7,5],[9,0,2,9,2,7,2,11,7,9,7,5],[11,3,2,8,5,9,8,7,5],[1,3,7,1,7,5],[8,7,0,0,7,1,7,5,1],[0,3,9,9,3,5,3,7,5],[9,7,5,9,8,7],[4,5,8,5,10,8,8,10,11],[3,0,4,3,4,10,4,5,10,3,10,11],[0,1,9,4,5,8,8,5,10,8,10,11],[5,9,4,1,11,3,1,10,11],[3,8,4,3,4,2,2,4,5,2,5,10],[10,2,5,5,2,4,2,0,4],[0,3,8,5,9,4,10,2,1],[2,1,10,9,4,5],[8,4,5,2,8,5,2,11,8,2,5,1],[3,2,11,1,4,5,1,0,4],[9,4,5,8,2,11,8,0,2],[11,3,2,9,4,5],[4,5,8,8,5,3,5,1,3],[5,0,4,5,1,0],[3,8,0,4,5,9],[9,4,5],[7,4,11,4,9,11,11,9,10],[3,0,8,7,4,11,11,4,9,11,9,10],[11,7,4,1,11,4,1,10,11,1,4,0],[8,7,4,11,1,10,11,3,1],[2,3,7,2,7,9,7,4,9,2,9,10],[4,8,7,0,10,2,0,9,10],[2,1,10,0,7,4,0,3,7],[10,2,1,8,7,4],[2,11,7,2,7,1,1,7,4,1,4,9],[3,2,11,4,8,7,9,1,0],[7,4,11,11,4,2,4,0,2],[2,11,3,7,4,8],[9,1,4,4,1,7,1,3,7],[1,0,9,8,7,4],[3,4,0,3,7,4],[8,7,4],[8,9,10,8,10,11],[0,9,3,3,9,11,9,10,11],[1,10,0,0,10,8,10,11,8],[10,3,1,10,11,3],[3,8,2,2,8,10,8,9,10],[9,2,0,9,10,2],[8,0,3,1,10,2],[10,2,1],[2,11,1,1,11,9,11,8,9],[11,3,2,0,9,1],[11,0,2,11,8,0],[11,3,2],[8,1,3,8,9,1],[9,1,0],[8,0,3],[]]}march(t,e,r,n){let o=!!n.fulltable,a=n.hasOwnProperty("origin")&&n.origin.hasOwnProperty("x")?n.origin:{x:0,y:0,z:0},s=!!n.voxel,l=n.matrix,c=n.nX||0,u=n.nY||0,h=n.nZ||0,d=n.scale||1,f=null;f=n.unitCube?n.unitCube:{x:d,y:d,z:d};let p,m,g=new Int32Array(c*u*h);for(p=0,m=g.length;p>2))+n+((2&e)>>1))*h+i+(1&e)]&this.ISDONE)<=3&&(e.push(e[n]),n=e.length-1,e.push(e[i]),i=e.length-1,e.push(e[o]),o=e.length-1),r.push(n),r.push(i),r.push(o)}}}laplacianSmooth(t,e,r){let n,i,o,a,s,l=new Array(e.length);for(n=0,i=e.length;n1e6&&(this.scaleFactor=this.defaultScaleFactor/2);let n=1/this.scaleFactor*5.5;this.pminx=t[0][0],this.pmaxx=t[1][0],this.pminy=t[0][1],this.pmaxy=t[1][1],this.pminz=t[0][2],this.pmaxz=t[1][2],e?(this.pminx-=this.probeRadius+n,this.pminy-=this.probeRadius+n,this.pminz-=this.probeRadius+n,this.pmaxx+=this.probeRadius+n,this.pmaxy+=this.probeRadius+n,this.pmaxz+=this.probeRadius+n):(this.pminx-=n,this.pminy-=n,this.pminz-=n,this.pmaxx+=n,this.pmaxy+=n,this.pmaxz+=n),this.pminx=Math.floor(this.pminx*this.scaleFactor)/this.scaleFactor,this.pminy=Math.floor(this.pminy*this.scaleFactor)/this.scaleFactor,this.pminz=Math.floor(this.pminz*this.scaleFactor)/this.scaleFactor,this.pmaxx=Math.ceil(this.pmaxx*this.scaleFactor)/this.scaleFactor,this.pmaxy=Math.ceil(this.pmaxy*this.scaleFactor)/this.scaleFactor,this.pmaxz=Math.ceil(this.pmaxz*this.scaleFactor)/this.scaleFactor,this.ptranx=-this.pminx,this.ptrany=-this.pminy,this.ptranz=-this.pminz,this.pLength=Math.ceil(this.scaleFactor*(this.pmaxx-this.pminx))+1,this.pWidth=Math.ceil(this.scaleFactor*(this.pmaxy-this.pminy))+1,this.pHeight=Math.ceil(this.scaleFactor*(this.pmaxz-this.pminz))+1,this.boundingatom(e),this.cutRadius=this.probeRadius*this.scaleFactor,this.vpBits=new Uint8Array(this.pLength*this.pWidth*this.pHeight),this.vpDistance=new Float64Array(this.pLength*this.pWidth*this.pHeight),this.vpAtomID=new Int32Array(this.pLength*this.pWidth*this.pHeight)}boundingatom(t){let e={};for(const r in this.vdwRadii){let n=this.vdwRadii[r];e[r]=t?(n+this.probeRadius)*this.scaleFactor+.5:n*this.scaleFactor+.5;let i=e[r]*e[r];this.widxz[r]=Math.floor(e[r])+1,this.depty[r]=new Int32Array(this.widxz[r]*this.widxz[r]);let o=0;for(let t=0;ti)this.depty[r][o]=-1;else{let t=Math.sqrt(i-n);this.depty[r][o]=Math.floor(t)}o++}}}fillvoxels(t,e){for(let t=0,e=this.vpBits.length;t=this.pLength||c>=this.pWidth||u>=this.pHeight)continue;let d=a*s+c*this.pHeight+u;if(this.vpBits[d]&this.INOUT){let a=e[this.vpAtomID[d]];if(a.serial!=t.serial){let e=r+f-Math.floor(.5+this.scaleFactor*(a.x+this.ptranx)),s=n+o-Math.floor(.5+this.scaleFactor*(a.y+this.ptrany)),l=i+p-Math.floor(.5+this.scaleFactor*(a.z+this.ptranz));f*f+o*o+p*p=this.pLength||c>=this.pWidth||u>=this.pHeight)continue;let d=a*s+c*this.pHeight+u;if(this.vpBits[d]&this.ISDONE){let a=e[this.vpAtomID[d]];if(a.serial!=t.serial){let e=n+f-Math.floor(.5+this.scaleFactor*(a.x+this.ptranx)),s=i+r-Math.floor(.5+this.scaleFactor*(a.y+this.ptrany)),l=o+p-Math.floor(.5+this.scaleFactor*(a.z+this.ptranz));f*f+r*r+p*p-1&&a-1&&l-1&&s=s)||(this.vpBits[t]|=this.ISBOUND))}fastoneshell(t,e){let r,n,i,o,a,s,l,c,u,h=[];if(0===t.length)return h;let d={ix:-1,iy:-1,iz:-1},f=this.pWidth*this.pHeight;for(let p=0,m=t.length;p-1&&d.iy-1&&d.iz-1&&(u=d.ix*f+this.pHeight*d.iy+d.iz,this.vpBits[u]&this.INOUT&&!(this.vpBits[u]&this.ISDONE)?(e.set(d.ix,d.iy,i+this.nb[t][2],c),o=d.ix-c.ix,a=d.iy-c.iy,s=d.iz-c.iz,l=o*o+a*a+s*s,this.vpDistance[u]=l,this.vpBits[u]|=this.ISDONE,this.vpBits[u]|=this.ISBOUND,h.push({ix:d.ix,iy:d.iy,iz:d.iz})):this.vpBits[u]&this.INOUT&&this.vpBits[u]&this.ISDONE&&(o=d.ix-c.ix,a=d.iy-c.iy,s=d.iz-c.iz,l=o*o+a*a+s*s,l-1&&d.iy-1&&d.iz-1&&(u=d.ix*f+this.pHeight*d.iy+d.iz,this.vpBits[u]&this.INOUT&&!(this.vpBits[u]&this.ISDONE)?(e.set(d.ix,d.iy,i+this.nb[t][2],c),o=d.ix-c.ix,a=d.iy-c.iy,s=d.iz-c.iz,l=o*o+a*a+s*s,this.vpDistance[u]=l,this.vpBits[u]|=this.ISDONE,this.vpBits[u]|=this.ISBOUND,h.push({ix:d.ix,iy:d.iy,iz:d.iz})):this.vpBits[u]&this.INOUT&&this.vpBits[u]&this.ISDONE&&(o=d.ix-c.ix,a=d.iy-c.iy,s=d.iz-c.iz,l=o*o+a*a+s*s,l-1&&d.iy-1&&d.iz-1&&(u=d.ix*f+this.pHeight*d.iy+d.iz,this.vpBits[u]&this.INOUT&&!(this.vpBits[u]&this.ISDONE)?(e.set(d.ix,d.iy,i+this.nb[t][2],c),o=d.ix-c.ix,a=d.iy-c.iy,s=d.iz-c.iz,l=o*o+a*a+s*s,this.vpDistance[u]=l,this.vpBits[u]|=this.ISDONE,this.vpBits[u]|=this.ISBOUND,h.push({ix:d.ix,iy:d.iy,iz:d.iz})):this.vpBits[u]&this.INOUT&&this.vpBits[u]&this.ISDONE&&(o=d.ix-c.ix,a=d.iy-c.iy,s=d.iz-c.iz,l=o*o+a*a+s*s,l{"use strict";r.r(e),r.d(e,{VolumeData:()=>l});var n=r("./src/utilities.ts"),i=r("./src/WebGL/math/index.ts"),o=r("./src/parsers/VASP.ts"),a=r("./src/parsers/CUBE.ts"),s=r("./node_modules/pako/dist/pako.esm.mjs");class l{constructor(t,e,r){if(this.unit={x:1,y:1,z:1},this.origin={x:0,y:0,z:0},this.size={x:0,y:0,z:0},this.data=new Float32Array([]),this.matrix=null,this.inversematrix=null,this.isbinary=new Set(["ccp4","CCP4"]),this.getCoordinates=function(t){var e=t/(this.size.y*this.size.z),r=t%(this.size.y*this.size.z),n=t%this.size.z;return e*=this.unit.x,r*=this.unit.y,n*=this.unit.z,{x:e+=this.origin.x,y:r+=this.origin.y,z:n+=this.origin.z}},this.vasp=function(t){var e=t.replace(/^\s+/,"").split(/[\n\r]/),r=(0,o.VASP)(t)[0].length;if(0==r)return console.log("No good formating of CHG or CHGCAR file, not atomic information provided in the file."),void(this.data=[]);var n,a=1.889725992,s=parseFloat(e[1]);n=e[2].replace(/^\s+/,"").split(/\s+/);var l=new i.Vector3(parseFloat(n[0]),parseFloat(n[1]),parseFloat(n[2])).multiplyScalar(s*a);n=e[3].replace(/^\s+/,"").split(/\s+/);var c=new i.Vector3(parseFloat(n[0]),parseFloat(n[1]),parseFloat(n[2])).multiplyScalar(s*a);n=e[4].replace(/^\s+/,"").split(/\s+/);var u=new i.Vector3(parseFloat(n[0]),parseFloat(n[1]),parseFloat(n[2])).multiplyScalar(s*a),h=l.x*(c.y*u.z-u.y*c.z)-c.x*(l.y*u.z-u.y*l.z)+u.x*(l.y*c.z-c.y*l.z),d=1/(h=Math.abs(h)/Math.pow(a,3));e.splice(0,8+r+1);var f=e[0].replace(/^\s+/,"").replace(/\s+/g," ").split(" "),p=Math.abs(parseFloat(f[0])),m=Math.abs(parseFloat(f[1])),g=Math.abs(parseFloat(f[2])),v=this.origin=new i.Vector3(0,0,0);this.size={x:p,y:m,z:g},this.unit=new i.Vector3(l.x,c.y,u.z),l=l.multiplyScalar(1/(a*p)),c=c.multiplyScalar(1/(a*m)),u=u.multiplyScalar(1/(a*g)),0==l.y&&0==l.z&&0==c.x&&0==c.z&&0==u.x&&0==u.y||(this.matrix=new i.Matrix4(l.x,c.x,u.x,0,l.y,c.y,u.y,0,l.z,c.z,u.z,0,0,0,0,1),this.matrix=this.matrix.multiplyMatrices(this.matrix,(new i.Matrix4).makeTranslation(v.x,v.y,v.z)),this.origin=new i.Vector3(0,0,0),this.unit=new i.Vector3(1,1,1)),e.splice(0,1);var b=e.join(" "),y=(b=b.replace(/^\s+/,"")).split(/[\s\r]+/);y.splice(p*m*g+1);for(var x=Float32Array.from(y,parseFloat),_=0;_=this.size.x||e<0||e>=this.size.y||r<0||r>=this.size.z?-1:t*this.size.y*this.size.z+e*this.size.z+r}getVal(t,e,r){let n=this.getIndex(t,e,r);return n<0?0:this.data[n]}cube(t){var e=t.split(/\r?\n/);if(!(e.length<6)){var r=(0,a.CUBE)(t,{}).modelData[0].cryst,n=e[2].replace(/^\s+/,"").replace(/\s+/g," ").split(" "),i=parseFloat(n[0]),o=Math.abs(i);this.origin=r.origin,this.size=r.size,this.unit=r.unit,this.matrix=r.matrix4;var s=6;i<0&&s++;var l=e.splice(o+s).join(" "),c=(l=l.replace(/^\s+/,"")).split(/[\s\r]+/);this.data=Float32Array.from(c,parseFloat)}}ccp4(t){var e={};t=new Int8Array(t);var r=new Int32Array(t.buffer,0,56),n=new Float32Array(t.buffer,0,56),o=new DataView(t.buffer);if(e.MAP=String.fromCharCode(o.getUint8(208),o.getUint8(209),o.getUint8(210),o.getUint8(211)),e.MACHST=[o.getUint8(212),o.getUint8(213)],17===e.MACHST[0]&&17===e.MACHST[1])for(var a=t.byteLength,s=0;s{"use strict";r.r(e),r.d(e,{GLVolumetricRender:()=>l});var n=r("./src/WebGL/shapes/index.ts"),i=r("./src/WebGL/math/index.ts"),o=r("./src/WebGL/index.ts"),a=r("./src/colors.ts"),s=r("./src/GLShape.ts");class l{static interpolateArray(t,e){function r(t,e,r){return t+(e-t)*r}var n=[],i=(t.length-1)/(e-1);n[0]=t[0];for(var o=1;o=0||t.getIndex(u,h,d)>=0)for(let e=s;e=0&&!r[s]&&(e-a.x)*(e-a.x)+(n-a.y)*(n-a.y)+(o-a.z)*(o-a.z){"use strict";r.r(e),r.d(e,{Camera:()=>o});var n=r("./src/WebGL/core/index.ts"),i=r("./src/WebGL/math/index.ts");class o extends n.Object3D{constructor(t=50,e=1,r=.1,n=2e3,o=!1){super(),this.projectionMatrix=new i.Matrix4,this.projectionMatrixInverse=new i.Matrix4,this.matrixWorldInverse=new i.Matrix4,this.fov=t,this.aspect=e,this.near=r,this.far=n;var a=this.position.z;this.right=a*Math.tan(Math.PI/180*t),this.left=-this.right,this.top=this.right/this.aspect,this.bottom=-this.top,this.ortho=!!o,this.updateProjectionMatrix()}lookAt(t){this.matrix.lookAt(this.position,t,this.up),this.rotationAutoUpdate&&(!1===this.useQuaternion&&this.rotation instanceof i.Vector3?this.rotation.setEulerFromRotationMatrix(this.matrix,this.eulerOrder):console.error("Unimplemented math operation."))}updateProjectionMatrix(){this.ortho?this.projectionMatrix.makeOrthographic(this.left,this.right,this.top,this.bottom,this.near,this.far):this.projectionMatrix.makePerspective(this.fov,this.aspect,this.near,this.far),this.projectionMatrixInverse.getInverse(this.projectionMatrix)}}},"./src/WebGL/Fog.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{Fog:()=>i});var n=r("./src/colors.ts");class i{constructor(t,e=1,r=1e3){this.name="",this.color=new n.Color(t),this.near=e,this.far=r}clone(){return new i(this.color.getHex(),this.near,this.far)}}},"./src/WebGL/Renderer.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{Renderer:()=>f});var n=r("./src/WebGL/Camera.ts"),i=r("./src/WebGL/constants/Sides.ts"),o=r("./src/WebGL/constants/TextureConstants.ts"),a=r("./src/WebGL/core/index.ts"),s=r("./src/colors.ts"),l=r("./src/WebGL/materials/index.ts"),c=r("./src/WebGL/math/index.ts"),u=r("./src/WebGL/objects/index.ts"),h=r("./src/WebGL/shaders/index.ts"),d=r("./src/WebGL/SpritePlugin.ts");class f{constructor(t){this.context=null,this.devicePixelRatio=1,this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.autoUpdateObjects=!0,this.autoUpdateScene=!0,this.info={memory:{programs:0,geometries:0,textures:0},render:{calls:0,vertices:0,faces:0,points:0}},this._programs=[],this._programs_counter=0,this._webglversion=1,this._currentProgram=null,this._currentMaterialId=-1,this._currentGeometryGroupHash=null,this._currentCamera=null,this._geometryGroupCounter=0,this._oldDoubleSided=-1,this._oldFlipSided=-1,this._oldDepthTest=-1,this._oldDepthWrite=-1,this._oldPolygonOffset=null,this._oldLineWidth=null,this._viewportWidth=0,this._viewportHeight=0,this._currentWidth=0,this._currentHeight=0,this._enabledAttributes={},this._projScreenMatrix=new c.Matrix4,this._vector3=new c.Vector3,this._worldInverse=new c.Matrix4,this._projInverse=new c.Matrix4,this._textureMatrix=new c.Matrix4,this._direction=new c.Vector3,this._lightsNeedUpdate=!0,this._lights={ambient:[0,0,0],directional:{length:0,colors:[],positions:[]},point:{length:0,colors:[],positions:[],distances:[]},spot:{length:0,colors:[],positions:[],distances:[],directions:[],anglesCos:[],exponents:[]},hemi:{length:0,skyColors:[],groundColors:[],positions:[]}},this.sprites=new d.SpritePlugin,this._screenshader=null,this._vertexattribpos=null,this._screenQuadVBO=null,this._fb=null,this._targetTexture=null,this._depthTexture=null,t=t||{},this.row=t.row,this.col=t.col,this.rows=t.rows,this.cols=t.cols,this._canvas=void 0!==t.canvas?t.canvas:document.createElement("canvas"),this._precision=void 0!==t.precision?t.precision:"highp",this._alpha=void 0===t.alpha||t.alpha,this._premultipliedAlpha=void 0===t.premultipliedAlpha||t.premultipliedAlpha,this._antialias=void 0!==t.antialias&&t.antialias,this._stencil=void 0===t.stencil||t.stencil,this._preserveDrawingBuffer=void 0!==t.preserveDrawingBuffer&&t.preserveDrawingBuffer,this._clearColor=void 0!==t.clearColor?new s.Color(t.clearColor):new s.Color(0),this._clearAlpha=void 0!==t.clearAlpha?t.clearAlpha:0,this._outlineMaterial=new l.MeshOutlineMaterial(t.outline),this._outlineSphereImposterMaterial=new l.SphereImposterOutlineMaterial(t.outline),this._outlineStickImposterMaterial=new l.StickImposterOutlineMaterial(t.outline),this._outlineEnabled=!!t.outline,this.domElement=this._canvas,this._canvas.id=t.id,0!=t.containerWidth&&0!=t.containerHeight&&(this.initGL(),this.setDefaultGLState(),this.context=this._gl,this.isWebGL1()?this._extInstanced=this._gl.getExtension("ANGLE_instanced_arrays"):this._extInstanced={vertexAttribDivisorANGLE:this._gl.vertexAttribDivisor.bind(this._gl),drawElementsInstancedANGLE:this._gl.drawElementsInstanced.bind(this._gl)},this._extFragDepth=this._gl.getExtension("EXT_frag_depth"),this._extFloatLinear=this._gl.getExtension("OES_texture_float_linear"),this._extColorBufferFloat=this._gl.getExtension("EXT_color_buffer_float"),this.sprites.init(this))}supportedExtensions(){return{supportsAIA:Boolean(this._extInstanced),supportsImposters:Boolean(this._extFragDepth)||!this.isWebGL1(),regen:!1}}getContext(){return this._gl}getCanvas(){return this._canvas}isLost(){return null==this._gl||this._gl.isContextLost()}getPrecision(){return this._precision}setClearColorHex(t,e){this._clearColor.setHex(t),this._clearAlpha=e,this.isLost()||this._gl.clearColor(this._clearColor.r,this._clearColor.g,this._clearColor.b,this._clearAlpha)}enableOutline(t){this._outlineMaterial=new l.MeshOutlineMaterial(t),this._outlineSphereImposterMaterial=new l.SphereImposterOutlineMaterial(t),this._outlineStickImposterMaterial=new l.StickImposterOutlineMaterial(t),this._outlineEnabled=!0}disableOutline(){this._outlineEnabled=!1}setViewport(){if(null!=this.rows&&null!=this.cols&&null!=this.row&&null!=this.col){var t=this._canvas.width/this.cols,e=this._canvas.height/this.rows;this._viewportWidth=t,this._viewportHeight=e,this.isLost()||(this._gl.enable(this._gl.SCISSOR_TEST),this._gl.scissor(t*this.col,e*this.row,t,e),this._gl.viewport(t*this.col,e*this.row,t,e))}}setSize(t,e){if(this.devicePixelRatio=void 0!==window.devicePixelRatio?window.devicePixelRatio:1,this._antialias&&this.devicePixelRatio<2&&(this.devicePixelRatio*=2),null!=this.rows&&null!=this.cols&&null!=this.row&&null!=this.col){var r=t/this.cols,n=e/this.rows;this._canvas.width=t*this.devicePixelRatio,this._canvas.height=e*this.devicePixelRatio,this._viewportWidth=r*this.devicePixelRatio,this._viewportHeight=n*this.devicePixelRatio,this._canvas.style.width=t+"px",this._canvas.style.height=e+"px",this.setViewport()}else this._viewportWidth=this._canvas.width=t*this.devicePixelRatio,this._viewportHeight=this._canvas.height=e*this.devicePixelRatio,this._canvas.style.width=t+"px",this._canvas.style.height=e+"px",this.isLost()||this._gl.viewport(0,0,this._gl.drawingBufferWidth,this._gl.drawingBufferHeight);this.initFrameBuffer()}clear(t,e,r){var n=0;(void 0===t||t)&&(n|=this._gl.COLOR_BUFFER_BIT),(void 0===e||e)&&(n|=this._gl.DEPTH_BUFFER_BIT),(void 0===r||r)&&(n|=this._gl.STENCIL_BUFFER_BIT),this._gl.clear(n)}clearTarget(t,e,r){this.clear(t,e,r)}setMaterialFaces(t,e){var r=t.side===i.DoubleSide,n=t.side===i.BackSide;t.imposter||(n=e?!n:n),this._oldDoubleSided!==r&&(r?this._gl.disable(this._gl.CULL_FACE):this._gl.enable(this._gl.CULL_FACE),this._oldDoubleSided=r),this._oldFlipSided!==n&&(n?this._gl.frontFace(this._gl.CW):this._gl.frontFace(this._gl.CCW),this._oldFlipSided=n),this._gl.cullFace(this._gl.BACK)}setDepthTest(t){this._oldDepthTest!==t&&(t?this._gl.enable(this._gl.DEPTH_TEST):this._gl.disable(this._gl.DEPTH_TEST),this._oldDepthTest=t)}setDepthWrite(t){this._oldDepthWrite!==t&&(this._gl.depthMask(t),this._oldDepthWrite=t)}setBlending(t){t?(this._gl.enable(this._gl.BLEND),this._gl.blendEquationSeparate(this._gl.FUNC_ADD,this._gl.FUNC_ADD),this._gl.blendFuncSeparate(this._gl.SRC_ALPHA,this._gl.ONE_MINUS_SRC_ALPHA,this._gl.ONE,this._gl.ONE_MINUS_SRC_ALPHA)):this._gl.disable(this._gl.BLEND)}initMaterial(t,e,r,n){var i,o;if(t.addEventListener("dispose",this.onMaterialDispose.bind(this)),o=t.shaderID){var a=h.ShaderLib[o];t.vertexShader=a.vertexShader,t.fragmentShader=a.fragmentShader,t.uniforms=h.ShaderUtils.clone(a.uniforms)}i={wireframe:t.wireframe,fragdepth:t.imposter,volumetric:t.volumetric},t.program=this.buildProgram(t.fragmentShader,t.vertexShader,t.uniforms,i)}renderBuffer(t,e,r,n,i,o){var a,s;if(n.visible&&(a=this.setProgram(t,e,r,n,o,this))){s=a.attributes;var l,c,h=!1,d=n.wireframe?1:0,f=16777215*i.id+2*a.id+d;if(f!==this._currentGeometryGroupHash&&(this._currentGeometryGroupHash=f,h=!0),h&&(this.disableAttributes(),s.position>=0&&(this._gl.bindBuffer(this._gl.ARRAY_BUFFER,i.__webglVertexBuffer),this.enableAttribute(s.position),this._gl.vertexAttribPointer(s.position,3,this._gl.FLOAT,!1,0,0)),s.color>=0&&(this._gl.bindBuffer(this._gl.ARRAY_BUFFER,i.__webglColorBuffer),this.enableAttribute(s.color),this._gl.vertexAttribPointer(s.color,3,this._gl.FLOAT,!1,0,0)),s.normal>=0&&(this._gl.bindBuffer(this._gl.ARRAY_BUFFER,i.__webglNormalBuffer),this.enableAttribute(s.normal),this._gl.vertexAttribPointer(s.normal,3,this._gl.FLOAT,!1,0,0)),s.offset>=0&&(this._gl.bindBuffer(this._gl.ARRAY_BUFFER,i.__webglOffsetBuffer),this.enableAttribute(s.offset),this._gl.vertexAttribPointer(s.offset,3,this._gl.FLOAT,!1,0,0)),s.radius>=0&&(this._gl.bindBuffer(this._gl.ARRAY_BUFFER,i.__webglRadiusBuffer),this.enableAttribute(s.radius),this._gl.vertexAttribPointer(s.radius,1,this._gl.FLOAT,!1,0,0))),o instanceof u.Mesh){if("instanced"===n.shaderID){var p=n.sphere.geometryGroups[0];h&&(this._gl.bindBuffer(this._gl.ARRAY_BUFFER,i.__webglVertexBuffer),this._gl.bufferData(this._gl.ARRAY_BUFFER,p.vertexArray,this._gl.STATIC_DRAW),this._gl.bindBuffer(this._gl.ARRAY_BUFFER,i.__webglNormalBuffer),this._gl.bufferData(this._gl.ARRAY_BUFFER,p.normalArray,this._gl.STATIC_DRAW),this._gl.bindBuffer(this._gl.ELEMENT_ARRAY_BUFFER,i.__webglFaceBuffer),this._gl.bufferData(this._gl.ELEMENT_ARRAY_BUFFER,p.faceArray,this._gl.STATIC_DRAW)),l=p.faceidx,this._extInstanced.vertexAttribDivisorANGLE(s.offset,1),this._extInstanced.vertexAttribDivisorANGLE(s.radius,1),this._extInstanced.vertexAttribDivisorANGLE(s.color,1),this._extInstanced.drawElementsInstancedANGLE(this._gl.TRIANGLES,l,this._gl.UNSIGNED_SHORT,0,i.radiusArray.length),this._extInstanced.vertexAttribDivisorANGLE(s.offset,0),this._extInstanced.vertexAttribDivisorANGLE(s.radius,0),this._extInstanced.vertexAttribDivisorANGLE(s.color,0)}else n.wireframe?(c=i.lineidx,this.setLineWidth(n.wireframeLinewidth),h&&this._gl.bindBuffer(this._gl.ELEMENT_ARRAY_BUFFER,i.__webglLineBuffer),this._gl.drawElements(this._gl.LINES,c,this._gl.UNSIGNED_SHORT,0)):(l=i.faceidx,h&&this._gl.bindBuffer(this._gl.ELEMENT_ARRAY_BUFFER,i.__webglFaceBuffer),this._gl.drawElements(this._gl.TRIANGLES,l,this._gl.UNSIGNED_SHORT,0));this.info.render.calls++,this.info.render.vertices+=l,this.info.render.faces+=l/3}else o instanceof u.Line&&(c=i.vertices,this.setLineWidth(n.linewidth),this._gl.drawArrays(this._gl.LINES,0,c),this.info.render.calls++)}}render(t,e,r){if(e instanceof n.Camera!=0){var i,o,a,s,l,c=t.__lights,u=t.fog;if(this._currentMaterialId=-1,this._lightsNeedUpdate=!0,this.autoUpdateScene&&t.updateMatrixWorld(),void 0===e.parent&&e.updateMatrixWorld(),e.matrixWorldInverse.getInverse(e.matrixWorld),this._projScreenMatrix.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse),!this.isLost()){this.autoUpdateObjects&&this.initWebGLObjects(t),this.info.render.calls=0,this.info.render.vertices=0,this.info.render.faces=0,this.info.render.points=0,this._currentWidth=this._viewportWidth,this._currentHeight=this._viewportHeight,this.setViewport(),this.setFrameBuffer(),(this.autoClear||r)&&(this._gl.clearColor(this._clearColor.r,this._clearColor.g,this._clearColor.b,this._clearAlpha),this.clear(this.autoClearColor,this.autoClearDepth,this.autoClearStencil));var h=!1;for(i=0,o=(l=t.__webglObjects).length;i=0;--r)t[r].object===e&&t.splice(r,1)}removeInstancesDirect(t,e){for(var r=t.length-1;r>=0;--r)t[r]===e&&t.splice(r,1)}unrollBufferMaterial(t){var e=t.object.material;if(e.volumetric)t.opaque=null,t.transparent=null,t.volumetric=e;else if(e.transparent){if(t.opaque=null,t.volumetric=null,t.transparent=e,!e.wireframe){var r=e.clone();r.opacity=0,t.blank=r}}else t.opaque=e,t.transparent=null,t.volumetric=null}setBuffers(t,e){var r=t.vertexArray,n=t.colorArray;if(void 0!==t.__webglOffsetBuffer?(this._gl.bindBuffer(this._gl.ARRAY_BUFFER,t.__webglOffsetBuffer),this._gl.bufferData(this._gl.ARRAY_BUFFER,r,e)):(this._gl.bindBuffer(this._gl.ARRAY_BUFFER,t.__webglVertexBuffer),this._gl.bufferData(this._gl.ARRAY_BUFFER,r,e)),this._gl.bindBuffer(this._gl.ARRAY_BUFFER,t.__webglColorBuffer),this._gl.bufferData(this._gl.ARRAY_BUFFER,n,e),t.normalArray&&void 0!==t.__webglNormalBuffer){var i=t.normalArray;this._gl.bindBuffer(this._gl.ARRAY_BUFFER,t.__webglNormalBuffer),this._gl.bufferData(this._gl.ARRAY_BUFFER,i,e)}if(t.radiusArray&&void 0!==t.__webglRadiusBuffer&&(this._gl.bindBuffer(this._gl.ARRAY_BUFFER,t.__webglRadiusBuffer),this._gl.bufferData(this._gl.ARRAY_BUFFER,t.radiusArray,e)),t.faceArray&&void 0!==t.__webglFaceBuffer){var o=t.faceArray;this._gl.bindBuffer(this._gl.ELEMENT_ARRAY_BUFFER,t.__webglFaceBuffer),this._gl.bufferData(this._gl.ELEMENT_ARRAY_BUFFER,o,e)}if(t.lineArray&&void 0!==t.__webglLineBuffer){var a=t.lineArray;this._gl.bindBuffer(this._gl.ELEMENT_ARRAY_BUFFER,t.__webglLineBuffer),this._gl.bufferData(this._gl.ELEMENT_ARRAY_BUFFER,a,e)}}createMeshBuffers(t){t.radiusArray&&(t.__webglRadiusBuffer=this._gl.createBuffer()),t.useOffset&&(t.__webglOffsetBuffer=this._gl.createBuffer()),t.__webglVertexBuffer=this._gl.createBuffer(),t.__webglNormalBuffer=this._gl.createBuffer(),t.__webglColorBuffer=this._gl.createBuffer(),t.__webglFaceBuffer=this._gl.createBuffer(),t.__webglLineBuffer=this._gl.createBuffer(),this.info.memory.geometries++}createLineBuffers(t){t.__webglVertexBuffer=this._gl.createBuffer(),t.__webglColorBuffer=this._gl.createBuffer(),this.info.memory.geometries++}addBuffer(t,e,r){t.push({buffer:e,object:r,opaque:null,transparent:null})}setupMatrices(t,e){t._modelViewMatrix.multiplyMatrices(e.matrixWorldInverse,t.matrixWorld),t._normalMatrix.getInverse(t._modelViewMatrix),t._normalMatrix.transpose()}filterFallback(t){return this._gl.LINEAR}setTextureParameters(t,e){t==this._gl.TEXTURE_2D?(this._gl.texParameteri(t,this._gl.TEXTURE_WRAP_S,this._gl.CLAMP_TO_EDGE),this._gl.texParameteri(t,this._gl.TEXTURE_WRAP_T,this._gl.CLAMP_TO_EDGE),this._gl.texParameteri(t,this._gl.TEXTURE_MAG_FILTER,this.filterFallback(e.magFilter)),this._gl.texParameteri(t,this._gl.TEXTURE_MIN_FILTER,this.filterFallback(e.minFilter))):(this._gl.texParameteri(t,this._gl.TEXTURE_WRAP_S,this._gl.CLAMP_TO_EDGE),this._gl.texParameteri(t,this._gl.TEXTURE_WRAP_T,this._gl.CLAMP_TO_EDGE),this._gl.texParameteri(t,this._gl.TEXTURE_WRAP_R,this._gl.CLAMP_TO_EDGE),this._extColorBufferFloat&&this._extFloatLinear?(this._gl.texParameteri(t,this._gl.TEXTURE_MAG_FILTER,this._gl.LINEAR),this._gl.texParameteri(t,this._gl.TEXTURE_MIN_FILTER,this._gl.LINEAR)):(this._gl.texParameteri(t,this._gl.TEXTURE_MAG_FILTER,this._gl.NEAREST),this._gl.texParameteri(t,this._gl.TEXTURE_MIN_FILTER,this._gl.NEAREST)))}paramToGL(t){return t===o.UnsignedByteType?this._gl.UNSIGNED_BYTE:t===o.RGBAFormat?this._gl.RGBA:t===o.NearestFilter?this._gl.NEAREST:0}setupLights(t,e){var r,n,i,o,s,l=this._lights,c=l.directional.colors,u=l.directional.positions,h=0,d=0;for(r=0,n=e.length;r{"use strict";r.r(e),r.d(e,{SpritePlugin:()=>i});var n=r("./src/WebGL/shaders/index.ts");class i{constructor(){this.sprite={vertices:null,faces:null,vertexBuffer:null,elementBuffer:null,program:null,attributes:{},uniforms:null}}init(t){this.gl=t.context,this.renderer=t,this.precision=t.getPrecision(),this.sprite.vertices=new Float32Array(16),this.sprite.faces=new Uint16Array(6);var e=0;this.sprite.vertices[e++]=-1,this.sprite.vertices[e++]=-1,this.sprite.vertices[e++]=0,this.sprite.vertices[e++]=0,this.sprite.vertices[e++]=1,this.sprite.vertices[e++]=-1,this.sprite.vertices[e++]=1,this.sprite.vertices[e++]=0,this.sprite.vertices[e++]=1,this.sprite.vertices[e++]=1,this.sprite.vertices[e++]=1,this.sprite.vertices[e++]=1,this.sprite.vertices[e++]=-1,this.sprite.vertices[e++]=1,this.sprite.vertices[e++]=0,this.sprite.vertices[e++]=1,e=0,this.sprite.faces[e++]=0,this.sprite.faces[e++]=1,this.sprite.faces[e++]=2,this.sprite.faces[e++]=0,this.sprite.faces[e++]=2,this.sprite.faces[e++]=3,this.sprite.vertexBuffer=this.gl.createBuffer(),this.sprite.elementBuffer=this.gl.createBuffer(),this.gl.bindBuffer(this.gl.ARRAY_BUFFER,this.sprite.vertexBuffer),this.gl.bufferData(this.gl.ARRAY_BUFFER,this.sprite.vertices,this.gl.STATIC_DRAW),this.gl.bindBuffer(this.gl.ELEMENT_ARRAY_BUFFER,this.sprite.elementBuffer),this.gl.bufferData(this.gl.ELEMENT_ARRAY_BUFFER,this.sprite.faces,this.gl.STATIC_DRAW),this.sprite.program=this.createProgram(n.ShaderLib.sprite,this.precision||1),this.sprite.attributes={};const r={};this.sprite.attributes.position=this.gl.getAttribLocation(this.sprite.program,"position"),this.sprite.attributes.uv=this.gl.getAttribLocation(this.sprite.program,"uv"),r.uvOffset=this.gl.getUniformLocation(this.sprite.program,"uvOffset"),r.uvScale=this.gl.getUniformLocation(this.sprite.program,"uvScale"),r.rotation=this.gl.getUniformLocation(this.sprite.program,"rotation"),r.scale=this.gl.getUniformLocation(this.sprite.program,"scale"),r.alignment=this.gl.getUniformLocation(this.sprite.program,"alignment"),r.color=this.gl.getUniformLocation(this.sprite.program,"color"),r.map=this.gl.getUniformLocation(this.sprite.program,"map"),r.opacity=this.gl.getUniformLocation(this.sprite.program,"opacity"),r.useScreenCoordinates=this.gl.getUniformLocation(this.sprite.program,"useScreenCoordinates"),r.screenPosition=this.gl.getUniformLocation(this.sprite.program,"screenPosition"),r.modelViewMatrix=this.gl.getUniformLocation(this.sprite.program,"modelViewMatrix"),r.projectionMatrix=this.gl.getUniformLocation(this.sprite.program,"projectionMatrix"),r.fogType=this.gl.getUniformLocation(this.sprite.program,"fogType"),r.fogDensity=this.gl.getUniformLocation(this.sprite.program,"fogDensity"),r.fogNear=this.gl.getUniformLocation(this.sprite.program,"fogNear"),r.fogFar=this.gl.getUniformLocation(this.sprite.program,"fogFar"),r.fogColor=this.gl.getUniformLocation(this.sprite.program,"fogColor"),r.alphaTest=this.gl.getUniformLocation(this.sprite.program,"alphaTest"),this.sprite.uniforms=r}render(t,e,r,n,i){var a,s,l,c,u,h,d,f,p,m;if(!this.gl)throw new Error("WebGLRenderer not initialized");let g=[];null===(a=null==t?void 0:t.__webglSprites)||void 0===a||a.forEach((t=>{(i&&0==t.material.depthTest||!i&&t.material.depthTest)&&g.push(t)}));let v=g.length;if(!v)return;const b=this.sprite.attributes,y=this.sprite.uniforms;if(!y)throw new Error("Uniforms not defined");var x=.5*r,_=.5*n;this.gl.useProgram(this.sprite.program),this.gl.enableVertexAttribArray(b.position),this.gl.enableVertexAttribArray(b.uv),this.gl.disable(this.gl.CULL_FACE),this.gl.enable(this.gl.BLEND),this.gl.bindBuffer(this.gl.ARRAY_BUFFER,this.sprite.vertexBuffer),this.gl.vertexAttribPointer(b.position,2,this.gl.FLOAT,!1,16,0),this.gl.vertexAttribPointer(b.uv,2,this.gl.FLOAT,!1,16,8),this.gl.bindBuffer(this.gl.ELEMENT_ARRAY_BUFFER,this.sprite.elementBuffer),this.gl.uniformMatrix4fv(y.projectionMatrix,!1,e.projectionMatrix.elements),this.gl.activeTexture(this.gl.TEXTURE0),this.gl.uniform1i(y.map,0);var w,k=0,A=0,M=t.fog;let T,S,C,E;M?(this.gl.uniform3f(y.fogColor,M.color.r,M.color.g,M.color.b),this.gl.uniform1f(y.fogNear,M.near),this.gl.uniform1f(y.fogFar,M.far),this.gl.uniform1i(y.fogType,1),k=1,A=1):(this.gl.uniform1i(y.fogType,0),k=0,A=0);let L=[];for(w=0;w{"use strict";var n;r.r(e),r.d(e,{Coloring:()=>n}),function(t){t[t.NoColors=0]="NoColors",t[t.FaceColors=1]="FaceColors",t[t.VertexColors=2]="VertexColors"}(n||(n={}))},"./src/WebGL/constants/Shading.ts":(t,e,r)=>{"use strict";var n;r.r(e),r.d(e,{Shading:()=>n}),function(t){t[t.NoShading=0]="NoShading",t[t.FlatShading=1]="FlatShading",t[t.SmoothShading=2]="SmoothShading"}(n||(n={}))},"./src/WebGL/constants/Sides.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{BackSide:()=>i,DoubleSide:()=>o,FrontSide:()=>n});const n=0,i=1,o=2},"./src/WebGL/constants/SpriteAlignment.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{SpriteAlignment:()=>i});var n=r("./src/WebGL/math/index.ts");const i={topLeft:new n.Vector2(1,-1),topCenter:new n.Vector2(0,-1),topRight:new n.Vector2(-1,-1),centerLeft:new n.Vector2(1,0),center:new n.Vector2(0,0),centerRight:new n.Vector2(-1,0),bottomLeft:new n.Vector2(1,1),bottomCenter:new n.Vector2(0,1),bottomRight:new n.Vector2(-1,1)}},"./src/WebGL/constants/TextureConstants.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{ClampToEdgeWrapping:()=>n,FloatType:()=>l,LinearFilter:()=>i,LinearMipMapLinearFilter:()=>a,NearestFilter:()=>o,R32Format:()=>h,RFormat:()=>u,RGBAFormat:()=>c,UnsignedByteType:()=>s});const n=1001,i=1006,o=1007,a=1008,s=1009,l=1010,c=1021,u=1022,h=1023},"./src/WebGL/constants/TextureOperations.ts":(t,e,r)=>{"use strict";var n;r.r(e),r.d(e,{TextureOperations:()=>n}),function(t){t[t.MultiplyOperation=0]="MultiplyOperation",t[t.MixOperation=1]="MixOperation",t[t.AddOperation=2]="AddOperation"}(n||(n={}))},"./src/WebGL/constants/index.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{BackSide:()=>i.BackSide,ClampToEdgeWrapping:()=>s.ClampToEdgeWrapping,Coloring:()=>n.Coloring,DoubleSide:()=>i.DoubleSide,FloatType:()=>s.FloatType,FrontSide:()=>i.FrontSide,LinearFilter:()=>s.LinearFilter,LinearMipMapLinearFilter:()=>s.LinearMipMapLinearFilter,NearestFilter:()=>s.NearestFilter,R32Format:()=>s.R32Format,RFormat:()=>s.RFormat,RGBAFormat:()=>s.RGBAFormat,Shading:()=>o.Shading,SpriteAlignment:()=>a.SpriteAlignment,TextureOperations:()=>l.TextureOperations,UnsignedByteType:()=>s.UnsignedByteType});var n=r("./src/WebGL/constants/Coloring.ts"),i=r("./src/WebGL/constants/Sides.ts"),o=r("./src/WebGL/constants/Shading.ts"),a=r("./src/WebGL/constants/SpriteAlignment.ts"),s=r("./src/WebGL/constants/TextureConstants.ts"),l=r("./src/WebGL/constants/TextureOperations.ts")},"./src/WebGL/core/EventDispatcher.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{EventDispatcher:()=>n});class n{constructor(){this.listeners={}}dispatchEvent(t){var e=this.listeners[t.type];if(void 0!==e){t.target=this;for(var r=0,n=e.length;r{"use strict";r.r(e),r.d(e,{Geometry:()=>l,GeometryGroup:()=>s,GeometryIDCount:()=>c});var n=r("./src/WebGL/materials/LineBasicMaterial.ts"),i=r("./src/WebGL/core/EventDispatcher.ts"),o=r("./src/WebGL/math/index.ts"),a=r("./src/colors.ts");class s{constructor(t=0){this.vertexArray=null,this.colorArray=null,this.normalArray=null,this.radiusArray=null,this.faceArray=null,this.lineArray=null,this.vertices=0,this.faceidx=0,this.lineidx=0,this.__inittedArrays=!1,this.id=t}setColors(t){var e=this.vertexArray,r=this.colorArray;if(!e)throw new Error("vertex array not initialized");if(!r)throw new Error("color array not initialized");if(e.length==r.length)for(var n=0;n0?this.lineArray=(null==a?void 0:a.subarray(0,this.lineidx))||null:this.lineArray=new Uint16Array(0)):(this.normalArray=new Float32Array(0),this.faceArray=new Uint16Array(0),this.lineArray=new Uint16Array(0)),s&&(this.radiusArray=s.subarray(0,this.vertices)),e&&(this.normalArray&&(this.normalArray=new Float32Array(this.normalArray)),this.faceArray&&(this.faceArray=new Uint16Array(this.faceArray)),this.lineArray&&(this.lineArray=new Uint16Array(this.lineArray)),this.vertexArray&&(this.vertexArray=new Float32Array(this.vertexArray)),this.colorArray&&(this.colorArray=new Float32Array(this.colorArray)),this.radiusArray&&(this.radiusArray=new Float32Array(this.radiusArray))),this.__inittedArrays=!0}}class l extends i.EventDispatcher{constructor(t=!1,e=!1,r=!1){super(),this.name="",this.hasTangents=!1,this.dynamic=!0,this.verticesNeedUpdate=!1,this.elementsNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.buffersNeedUpdate=!1,this.imposter=!1,this.instanced=!1,this.geometryGroups=[],this.groups=0,this.id=c++,this.mesh=t,this.radii=e,this.offset=r}updateGeoGroup(t=0){var e,r=this.groups>0?this.geometryGroups[this.groups-1]:null;return(!r||r.vertices+t>((null===(e=null==r?void 0:r.vertexArray)||void 0===e?void 0:e.length)||0)/3)&&(r=this.addGeoGroup()),r}vrml(t,e){for(var r="",n=this.geometryGroups.length,i=0;i{"use strict";r.r(e),r.d(e,{Light:()=>l,Object3D:()=>a,Object3DIDCount:()=>o,Scene:()=>s});var n=r("./src/WebGL/math/index.ts"),i=r("./src/colors.ts");let o=0;class a{constructor(){this.id=o++,this.name="",this.children=[],this.position=new n.Vector3,this.rotation=new n.Vector3,this.matrix=new n.Matrix4,this.matrixWorld=new n.Matrix4,this.quaternion=new n.Quaternion,this.eulerOrder="XYZ",this.up=new n.Vector3(0,1,0),this.scale=new n.Vector3(1,1,1),this.matrixAutoUpdate=!0,this.matrixWorldNeedsUpdate=!0,this.rotationAutoUpdate=!0,this.useQuaternion=!1,this.visible=!0}lookAt(t){this.matrix.lookAt(t,this.position,this.up),this.rotationAutoUpdate&&(!0===this.useQuaternion?console.error("Unimplemented math operation."):this.rotation instanceof n.Vector3&&this.rotation.setEulerFromRotationMatrix(this.matrix,this.eulerOrder))}add(t){if(t!==this){t.parent=this,this.children.push(t);for(var e=this;void 0!==e.parent;)e=e.parent;void 0!==e&&e instanceof s&&e.__addObject(t)}else console.error("Can't add $3Dmol.Object3D to itself")}remove(t){var e=this.children.indexOf(t);if(-1!==e){t.parent=void 0,this.children.splice(e,1);for(var r=this;void 0!==r.parent;)r=r.parent;void 0!==r&&r instanceof s&&r.__removeObject(t)}}vrml(t){t||(t=" ");var e=2*Math.atan2(this.quaternion.lengthxyz(),this.quaternion.w),r=0,n=0,i=0;if(0!=e){let t=Math.sin(e/2);r=this.quaternion.x/t,n=this.quaternion.y/t,i=this.quaternion.z/t}var o=t+"Transform {\n"+t+" center "+this.position.x+" "+this.position.y+" "+this.position.z+"\n"+t+" rotation "+r+" "+n+" "+i+" "+e+"\n"+t+" children [\n";this.geometry&&(o+=this.geometry.vrml(t,this.material));for(var a=0;a{"use strict";r.r(e),r.d(e,{Projector:()=>i});const n=new(r("./src/WebGL/math/index.ts").Matrix4);class i{static unprojectVector(t,e){return e.projectionMatrixInverse.getInverse(e.projectionMatrix),n.multiplyMatrices(e.matrixWorld,e.projectionMatrixInverse),t.applyProjection(n)}static projectVector(t,e){return e.matrixWorldInverse.getInverse(e.matrixWorld),n.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse),t.applyProjection(n)}projectVector(t,e){return i.projectVector(t,e)}unprojectVector(t,e){return i.unprojectVector(t,e)}}},"./src/WebGL/core/Raycaster.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{Raycaster:()=>s,intersectObject:()=>v});var n=r("./src/WebGL/math/index.ts"),i=r("./src/WebGL/shapes/index.ts");const o=(t,e)=>t.distance-e.distance,a=new n.Matrix4;class s{constructor(t,e,r,i){this.precision=1e-4,this.linePrecision=.2,this.ray=new n.Ray(t,e),this.ray.direction.lengthSq()>0&&this.ray.direction.normalize(),this.near=i||0,this.far=r||1/0}set(t,e){this.ray.set(t,e)}setFromCamera(t,e){e.ortho?(this.ray.origin.set(t.x,t.y,(e.near+e.far)/(e.near-e.far)).unproject(e),this.ray.direction.set(0,0,-1).transformDirection(e.matrixWorld)):(this.ray.origin.setFromMatrixPosition(e.matrixWorld),this.ray.direction.set(t.x,t.y,t.z),e.projectionMatrixInverse.getInverse(e.projectionMatrix),a.multiplyMatrices(e.matrixWorld,e.projectionMatrixInverse),this.ray.direction.applyProjection(a),this.ray.direction.sub(this.ray.origin).normalize())}intersectObjects(t,e){for(var r=[],n=0,i=e.length;nMath.min(Math.max(t,-1),1);var c=new i.Sphere,u=new i.Cylinder,h=new i.Triangle,d=new n.Vector3,f=new n.Vector3,p=new n.Vector3,m=new n.Vector3,g=new n.Vector3;function v(t,e,r,n){if(g.getPositionFromMatrix(t.matrixWorld),void 0===e.intersectionShape)return n;var o,a,s,v,b,y,x,_,w,k,A,M,T,S,C=e.intersectionShape,E=r.linePrecision,L=(E*=t.matrixWorld.getMaxScaleOnAxis())*E;if(void 0!==e.boundingSphere&&e.boundingSphere instanceof i.Sphere&&(c.copy(e.boundingSphere),c.applyMatrix4(t.matrixWorld),!r.ray.isIntersectionSphere(c)))return n;for(o=0,a=C.triangle.length;o=0)continue;if(d.subVectors(h.a,r.ray.origin),(x=s.dot(d)/v)<0)continue;f.copy(r.ray.direction).multiplyScalar(x).add(r.ray.origin),f.sub(h.a),p.copy(h.b).sub(h.a),m.copy(h.c).sub(h.a);var z=p.dot(m),O=p.lengthSq(),D=m.lengthSq();if((M=(O*f.dot(m)-z*f.dot(p))/(O*D-z*z))<0||M>1)continue;if((A=(f.dot(p)-M*z)/O)<0||A>1||A+M>1)continue;n.push({clickable:e,distance:x})}for(o=0,a=C.cylinder.length;ou.lengthSq()||M<0)continue;n.push({clickable:e,distance:x})}}for(o=0,a=C.line.length;o{"use strict";r.r(e),r.d(e,{Texture:()=>s,TextureIdCount:()=>l});var n=r("./src/WebGL/constants/TextureConstants.ts"),i=r("./src/WebGL/math/index.ts"),o=r("./src/WebGL/core/EventDispatcher.ts"),a=r("./src/WebGL/core/UVMapping.ts");class s extends o.EventDispatcher{constructor(t,e){super(),this.id=l++,this.name="",this.image=t,this.mapping=new a.UVMapping,this.wrapS=n.ClampToEdgeWrapping,this.wrapT=n.ClampToEdgeWrapping,this.anisotropy=1,e?(this.format=n.RFormat,this.type=n.FloatType,this.premultiplyAlpha=!1,this.flipY=!1,this.unpackAlignment=1,this.magFilter=n.NearestFilter,this.minFilter=n.NearestFilter):(this.format=n.RGBAFormat,this.type=n.UnsignedByteType,this.offset=new i.Vector2(0,0),this.repeat=new i.Vector2(1,1),this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.magFilter=n.LinearFilter,this.minFilter=n.LinearMipMapLinearFilter),this.needsUpdate=!1,this.onUpdate=null}clone(t=new s){return t.image=this.image,t.mapping=this.mapping,t.wrapS=this.wrapS,t.wrapT=this.wrapT,t.magFilter=this.magFilter,t.minFilter=this.minFilter,t.anisotropy=this.anisotropy,t.format=this.format,t.type=this.type,t.offset.copy(this.offset),t.repeat.copy(this.repeat),t.premultiplyAlpha=this.premultiplyAlpha,t.flipY=this.flipY,t.unpackAlignment=this.unpackAlignment,t}dispose(){this.dispatchEvent({type:"dispose"})}}let l=0},"./src/WebGL/core/UVMapping.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{UVMapping:()=>n});class n{}},"./src/WebGL/core/index.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{EventDispatcher:()=>n.EventDispatcher,Geometry:()=>i.Geometry,GeometryGroup:()=>i.GeometryGroup,GeometryIDCount:()=>i.GeometryIDCount,Light:()=>o.Light,Object3D:()=>o.Object3D,Object3DIDCount:()=>o.Object3DIDCount,Projector:()=>a.Projector,Raycaster:()=>s.Raycaster,Scene:()=>o.Scene,Texture:()=>l.Texture,TextureIdCount:()=>l.TextureIdCount,UVMapping:()=>c.UVMapping,intersectObject:()=>s.intersectObject});var n=r("./src/WebGL/core/EventDispatcher.ts"),i=r("./src/WebGL/core/Geometry.ts"),o=r("./src/WebGL/core/Object3D.ts"),a=r("./src/WebGL/core/Projector.ts"),s=r("./src/WebGL/core/Raycaster.ts"),l=r("./src/WebGL/core/Texture.ts"),c=r("./src/WebGL/core/UVMapping.ts")},"./src/WebGL/index.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{BackSide:()=>n.BackSide,Camera:()=>u.Camera,ClampToEdgeWrapping:()=>n.ClampToEdgeWrapping,Coloring:()=>n.Coloring,Cylinder:()=>c.Cylinder,DoubleSide:()=>n.DoubleSide,EventDispatcher:()=>i.EventDispatcher,FloatType:()=>n.FloatType,Fog:()=>h.Fog,FrontSide:()=>n.FrontSide,Geometry:()=>i.Geometry,GeometryGroup:()=>i.GeometryGroup,GeometryIDCount:()=>i.GeometryIDCount,ImposterMaterial:()=>o.ImposterMaterial,InstancedMaterial:()=>o.InstancedMaterial,Light:()=>i.Light,Line:()=>s.Line,LineBasicMaterial:()=>o.LineBasicMaterial,LineStyle:()=>s.LineStyle,LinearFilter:()=>n.LinearFilter,LinearMipMapLinearFilter:()=>n.LinearMipMapLinearFilter,Material:()=>o.Material,MaterialIdCount:()=>o.MaterialIdCount,Matrix3:()=>a.Matrix3,Matrix4:()=>a.Matrix4,Mesh:()=>s.Mesh,MeshDoubleLambertMaterial:()=>o.MeshDoubleLambertMaterial,MeshLambertMaterial:()=>o.MeshLambertMaterial,MeshOutlineMaterial:()=>o.MeshOutlineMaterial,NearestFilter:()=>n.NearestFilter,Object3D:()=>i.Object3D,Object3DIDCount:()=>i.Object3DIDCount,Projector:()=>i.Projector,Quaternion:()=>a.Quaternion,R32Format:()=>n.R32Format,RFormat:()=>n.RFormat,RGBAFormat:()=>n.RGBAFormat,Ray:()=>a.Ray,Raycaster:()=>i.Raycaster,Renderer:()=>d.Renderer,Scene:()=>i.Scene,ShaderLib:()=>l.ShaderLib,ShaderUtils:()=>l.ShaderUtils,Shading:()=>n.Shading,Sphere:()=>c.Sphere,SphereImposterMaterial:()=>o.SphereImposterMaterial,SphereImposterOutlineMaterial:()=>o.SphereImposterOutlineMaterial,Sprite:()=>s.Sprite,SpriteAlignment:()=>n.SpriteAlignment,SpriteMaterial:()=>o.SpriteMaterial,SpritePlugin:()=>f.SpritePlugin,StickImposterMaterial:()=>o.StickImposterMaterial,StickImposterOutlineMaterial:()=>o.StickImposterOutlineMaterial,Texture:()=>i.Texture,TextureIdCount:()=>i.TextureIdCount,TextureOperations:()=>n.TextureOperations,Triangle:()=>c.Triangle,UVMapping:()=>i.UVMapping,UnsignedByteType:()=>n.UnsignedByteType,Vector2:()=>a.Vector2,Vector3:()=>a.Vector3,VolumetricMaterial:()=>o.VolumetricMaterial,basic:()=>l.basic,clamp:()=>a.clamp,clone:()=>l.clone,conversionMatrix3:()=>a.conversionMatrix3,degToRad:()=>a.degToRad,instanced:()=>l.instanced,intersectObject:()=>i.intersectObject,lambert:()=>l.lambert,lambertdouble:()=>l.lambertdouble,outline:()=>l.outline,screen:()=>l.screen,screenaa:()=>l.screenaa,sphereimposter:()=>l.sphereimposter,sphereimposteroutline:()=>l.sphereimposteroutline,sprite:()=>l.sprite,stickimposter:()=>l.stickimposter,stickimposteroutline:()=>l.stickimposteroutline,volumetric:()=>l.volumetric});var n=r("./src/WebGL/constants/index.ts"),i=r("./src/WebGL/core/index.ts"),o=r("./src/WebGL/materials/index.ts"),a=r("./src/WebGL/math/index.ts"),s=r("./src/WebGL/objects/index.ts"),l=r("./src/WebGL/shaders/index.ts"),c=r("./src/WebGL/shapes/index.ts"),u=r("./src/WebGL/Camera.ts"),h=r("./src/WebGL/Fog.ts"),d=r("./src/WebGL/Renderer.ts"),f=r("./src/WebGL/SpritePlugin.ts")},"./src/WebGL/materials/ImposterMaterial.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{ImposterMaterial:()=>l});var n=r("./src/WebGL/constants/Coloring.ts"),i=r("./src/WebGL/constants/Shading.ts"),o=r("./src/colors.ts"),a=r("./src/WebGL/math/index.ts"),s=r("./src/WebGL/materials/Material.ts");class l extends s.Material{constructor(t){super(),this.color=new o.Color(16777215),this.ambient=new o.Color(1048575),this.emissive=new o.Color(0),this.imposter=!0,this.wrapAround=!1,this.wrapRGB=new a.Vector3(1,1,1),this.map=void 0,this.lightMap=null,this.specularMap=null,this.envMap=null,this.reflectivity=1,this.refractionRatio=.98,this.fog=!0,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.shading=i.Shading.SmoothShading,this.shaderID=null,this.vertexColors=n.Coloring.NoColors,this.skinning=!1,this.setValues(t)}clone(t=new l){return super.clone.call(this,t),t.color.copy(this.color),t.ambient.copy(this.ambient),t.emissive.copy(this.emissive),t.wrapAround=this.wrapAround,t.wrapRGB.copy(this.wrapRGB),t.map=this.map,t.lightMap=this.lightMap,t.specularMap=this.specularMap,t.envMap=this.envMap,t.combine=this.combine,t.reflectivity=this.reflectivity,t.refractionRatio=this.refractionRatio,t.fog=this.fog,t.shading=this.shading,t.shaderID=this.shaderID,t.vertexColors=this.vertexColors,t.skinning=this.skinning,t.morphTargets=this.morphTargets,t.morphNormals=this.morphNormals,t}}},"./src/WebGL/materials/InstancedMaterial.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{InstancedMaterial:()=>l});var n=r("./src/WebGL/constants/Coloring.ts"),i=r("./src/WebGL/constants/Shading.ts"),o=r("./src/colors.ts"),a=r("./src/WebGL/math/index.ts"),s=r("./src/WebGL/materials/Material.ts");class l extends s.Material{constructor(t){super(),this.color=new o.Color(16777215),this.ambient=new o.Color(1048575),this.emissive=new o.Color(0),this.wrapAround=!1,this.wrapRGB=new a.Vector3(1,1,1),this.map=void 0,this.lightMap=null,this.specularMap=null,this.envMap=null,this.reflectivity=1,this.refractionRatio=.98,this.fog=!0,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.shading=i.Shading.SmoothShading,this.shaderID="instanced",this.vertexColors=n.Coloring.NoColors,this.skinning=!1,this.sphere=null,this.setValues(t)}clone(t=new l){return super.clone.call(this,t),t.color.copy(this.color),t.ambient.copy(this.ambient),t.emissive.copy(this.emissive),t.wrapAround=this.wrapAround,t.wrapRGB.copy(this.wrapRGB),t.map=this.map,t.lightMap=this.lightMap,t.specularMap=this.specularMap,t.envMap=this.envMap,t.combine=this.combine,t.reflectivity=this.reflectivity,t.refractionRatio=this.refractionRatio,t.fog=this.fog,t.shading=this.shading,t.shaderID=this.shaderID,t.vertexColors=this.vertexColors,t.skinning=this.skinning,t.morphTargets=this.morphTargets,t.morphNormals=this.morphNormals,t.sphere=this.sphere,t}}},"./src/WebGL/materials/LineBasicMaterial.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{LineBasicMaterial:()=>o});var n=r("./src/colors.ts"),i=r("./src/WebGL/materials/Material.ts");class o extends i.Material{constructor(t){super(),this.color=new n.Color(16777215),this.linewidth=1,this.linecap="round",this.linejoin="round",this.vertexColors=!1,this.fog=!0,this.shaderID="basic",this.setValues(t)}clone(t=new o){return super.clone.call(this,t),t.color.copy(this.color),t}}},"./src/WebGL/materials/Material.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{Material:()=>s,MaterialIdCount:()=>l});var n=r("./src/WebGL/constants/Sides.ts"),i=r("./src/WebGL/core/index.ts"),o=r("./src/WebGL/math/index.ts"),a=r("./src/colors.ts");class s extends i.EventDispatcher{constructor(){super(...arguments),this.id=l++,this.name="",this.side=n.FrontSide,this.opacity=1,this.transparent=!1,this.depthTest=!0,this.depthWrite=!0,this.stencilTest=!0,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.alphaTest=0,this.visible=!0,this.needsUpdate=!0,this.outline=!1,this.wireframe=!1}setValues(t={}){if(void 0!==t)for(var e in t){var r=t[e];if(void 0!==r){if(e in this){var n=this[e];n instanceof a.Color&&r instanceof a.Color?n.copy(r):n instanceof a.Color?n.set(r):n instanceof o.Vector3&&r instanceof o.Vector3?n.copy(r):this[e]=r}}else console.warn("$3Dmol.Material: '"+e+"' parameter is undefined.")}}clone(t=new s){return t.name=this.name,t.side=this.side,t.opacity=this.opacity,t.transparent=this.transparent,t.depthTest=this.depthTest,t.depthWrite=this.depthWrite,t.stencilTest=this.stencilTest,t.polygonOffset=this.polygonOffset,t.polygonOffsetFactor=this.polygonOffsetFactor,t.polygonOffsetUnits=this.polygonOffsetUnits,t.alphaTest=this.alphaTest,t.overdraw=this.overdraw,t.visible=this.visible,t}dispose(){this.dispatchEvent({type:"dispose"})}}let l=0},"./src/WebGL/materials/MeshDoubleLambertMaterial.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{MeshDoubleLambertMaterial:()=>o});var n=r("./src/WebGL/constants/Sides.ts"),i=r("./src/WebGL/materials/MeshLambertMaterial.ts");class o extends i.MeshLambertMaterial{constructor(t){super(t),this.shaderID="lambertdouble",this.side=n.DoubleSide,this.outline=!1}clone(t=new o){return super.clone.call(this,t),t}}},"./src/WebGL/materials/MeshLambertMaterial.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{MeshLambertMaterial:()=>l});var n=r("./src/WebGL/constants/Coloring.ts"),i=r("./src/WebGL/constants/Shading.ts"),o=r("./src/WebGL/materials/Material.ts"),a=r("./src/colors.ts"),s=r("./src/WebGL/math/index.ts");class l extends o.Material{constructor(t){super(),this.color=new a.Color(16777215),this.ambient=new a.Color(1048575),this.emissive=new a.Color(0),this.wrapAround=!1,this.wrapRGB=new s.Vector3(1,1,1),this.map=void 0,this.lightMap=null,this.specularMap=null,this.envMap=null,this.reflectivity=1,this.refractionRatio=.98,this.fog=!0,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.shading=i.Shading.SmoothShading,this.shaderID="lambert",this.vertexColors=n.Coloring.NoColors,this.skinning=!1,this.setValues(t)}clone(t=new l){return super.clone.call(this,t),t.color.copy(this.color),t.ambient.copy(this.ambient),t.emissive.copy(this.emissive),t.wrapAround=this.wrapAround,t.wrapRGB.copy(this.wrapRGB),t.map=this.map,t.lightMap=this.lightMap,t.specularMap=this.specularMap,t.envMap=this.envMap,t.combine=this.combine,t.reflectivity=this.reflectivity,t.refractionRatio=this.refractionRatio,t.fog=this.fog,t.shading=this.shading,t.shaderID=this.shaderID,t.vertexColors=this.vertexColors,t.skinning=this.skinning,t.morphTargets=this.morphTargets,t.morphNormals=this.morphNormals,t}}},"./src/WebGL/materials/MeshOutlineMaterial.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{MeshOutlineMaterial:()=>o});var n=r("./src/colors.ts"),i=r("./src/WebGL/materials/Material.ts");class o extends i.Material{constructor(t){super(),t=t||{},this.fog=!0,this.shaderID="outline",this.wireframe=!1,this.outlineColor=t.color||new n.Color(0,0,0),this.outlineWidth=t.width||.1,this.outlinePushback=t.pushback||1}clone(t=new o){return super.clone.call(this,t),t.fog=this.fog,t.shaderID=this.shaderID,t.wireframe=this.wireframe,t}}},"./src/WebGL/materials/SphereImposterMaterial.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{SphereImposterMaterial:()=>i});var n=r("./src/WebGL/materials/ImposterMaterial.ts");class i extends n.ImposterMaterial{constructor(t){super(t),this.shaderID="sphereimposter",this.setValues(t)}clone(t=new i){return super.clone.call(this,t),t}}},"./src/WebGL/materials/SphereImposterOutlineMaterial.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{SphereImposterOutlineMaterial:()=>o});var n=r("./src/colors.ts"),i=r("./src/WebGL/materials/ImposterMaterial.ts");class o extends i.ImposterMaterial{constructor(t){super(t),t=t||{},this.shaderID="sphereimposteroutline",this.outlineColor=t.color||new n.Color(0,0,0),this.outlineWidth=t.width||.1,this.outlinePushback=t.pushback||1,this.setValues(t)}clone(t=new o){return super.clone.call(this,t),t.outlineColor=this.outlineColor,t.outlineWidth=this.outlineWidth,t.outlinePushback=this.outlinePushback,t}}},"./src/WebGL/materials/SpriteMaterial.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{SpriteMaterial:()=>l});var n=r("./src/WebGL/constants/SpriteAlignment.ts"),i=r("./src/WebGL/core/Texture.ts"),o=r("./src/colors.ts"),a=r("./src/WebGL/math/index.ts"),s=r("./src/WebGL/materials/Material.ts");class l extends s.Material{constructor(t){super(),this.color=new o.Color(16777215),this.map=new i.Texture,this.useScreenCoordinates=!0,this.fog=!1,this.uvOffset=new a.Vector2(0,0),this.uvScale=new a.Vector2(1,1),this.depthTest=!this.useScreenCoordinates,this.sizeAttenuation=!this.useScreenCoordinates,this.screenOffset=this.screenOffset,this.scaleByViewPort=!this.sizeAttenuation,this.alignment=n.SpriteAlignment.center.clone(),this.setValues(t),void 0===(t=t||{}).depthTest&&(this.depthTest=!this.useScreenCoordinates),void 0===t.sizeAttenuation&&(this.sizeAttenuation=!this.useScreenCoordinates),void 0===t.scaleByViewPort&&(this.scaleByViewPort=!this.sizeAttenuation)}clone(t=new l){return super.clone.call(this,t),t.color.copy(this.color),t.map=this.map,t.useScreenCoordinates=this.useScreenCoordinates,t.screenOffset=this.screenOffset,t.sizeAttenuation=this.sizeAttenuation,t.scaleByViewport=this.scaleByViewPort,t.alignment.copy(this.alignment),t.uvOffset.copy(this.uvOffset),t}}},"./src/WebGL/materials/StickImposterMaterial.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{StickImposterMaterial:()=>i});var n=r("./src/WebGL/materials/ImposterMaterial.ts");class i extends n.ImposterMaterial{constructor(t){super(t),this.shaderID="stickimposter",this.setValues(t)}clone(t=new i){return super.clone.call(this,t),t}}},"./src/WebGL/materials/StickImposterOutlineMaterial.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{StickImposterOutlineMaterial:()=>o});var n=r("./src/colors.ts"),i=r("./src/WebGL/materials/ImposterMaterial.ts");class o extends i.ImposterMaterial{constructor(t={}){super(t),this.shaderID="stickimposteroutline",this.outlineColor=new n.Color(0,0,0),this.outlineWidth=.1,this.outlinePushback=1,t.color&&(this.outlineColor=t.color),t.width&&(this.outlineWidth=t.width),t.pushback&&(this.outlinePushback=t.pushback),this.setValues(t)}clone(t=new o){return super.clone.call(this,t),t.outlineColor=this.outlineColor,t.outlineWidth=this.outlineWidth,t.outlinePushback=this.outlinePushback,t}}},"./src/WebGL/materials/VolumetricMaterial.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{VolumetricMaterial:()=>a});var n=r("./src/WebGL/constants/Sides.ts"),i=r("./src/colors.ts"),o=r("./src/WebGL/materials/Material.ts");class a extends o.Material{constructor(t){super(),this.transparent=!1,this.volumetric=!0,this.color=new i.Color(16777215),this.transferfn=null,this.map=void 0,this.extent=[],this.maxdepth=100,this.unit=0,this.texmatrix=null,this.transfermin=-1,this.transfermax=1,this.subsamples=5,this.shaderID="volumetric",this.side=n.FrontSide,this.setValues(t)}clone(t=new a){return super.clone.call(this,t),t.transparent=this.transparent,t.volumetric=this.volumetric,t.color=this.color,t.transferfn=this.transferfn,t.map=this.map,t.extent=this.extent,t.maxdepth=this.maxdepth,t.unit=this.unit,t.texmatrix=this.texmatrix,t.transfermin=this.transfermin,t.transfermax=this.transfermax,t.subsamples=this.subsamples,t.shaderID=this.shaderID,t.side=this.side,t}}},"./src/WebGL/materials/index.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{ImposterMaterial:()=>n.ImposterMaterial,InstancedMaterial:()=>i.InstancedMaterial,LineBasicMaterial:()=>o.LineBasicMaterial,Material:()=>a.Material,MaterialIdCount:()=>a.MaterialIdCount,MeshDoubleLambertMaterial:()=>s.MeshDoubleLambertMaterial,MeshLambertMaterial:()=>l.MeshLambertMaterial,MeshOutlineMaterial:()=>c.MeshOutlineMaterial,SphereImposterMaterial:()=>u.SphereImposterMaterial,SphereImposterOutlineMaterial:()=>h.SphereImposterOutlineMaterial,SpriteMaterial:()=>d.SpriteMaterial,StickImposterMaterial:()=>f.StickImposterMaterial,StickImposterOutlineMaterial:()=>p.StickImposterOutlineMaterial,VolumetricMaterial:()=>m.VolumetricMaterial});var n=r("./src/WebGL/materials/ImposterMaterial.ts"),i=r("./src/WebGL/materials/InstancedMaterial.ts"),o=r("./src/WebGL/materials/LineBasicMaterial.ts"),a=r("./src/WebGL/materials/Material.ts"),s=r("./src/WebGL/materials/MeshDoubleLambertMaterial.ts"),l=r("./src/WebGL/materials/MeshLambertMaterial.ts"),c=r("./src/WebGL/materials/MeshOutlineMaterial.ts"),u=r("./src/WebGL/materials/SphereImposterMaterial.ts"),h=r("./src/WebGL/materials/SphereImposterOutlineMaterial.ts"),d=r("./src/WebGL/materials/SpriteMaterial.ts"),f=r("./src/WebGL/materials/StickImposterMaterial.ts"),p=r("./src/WebGL/materials/StickImposterOutlineMaterial.ts"),m=r("./src/WebGL/materials/VolumetricMaterial.ts")},"./src/WebGL/math/Quaternion.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{Quaternion:()=>n});class n{constructor(t,e,r,n){this.x=t||0,this.y=e||0,this.z=r||0,this.w=void 0!==n?n:1}set(t,e,r,n){return this.x=t,this.y=e,this.z=r,this.w=n,this}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=t.w,this}conjugate(){return this.x*=-1,this.y*=-1,this.z*=-1,this}inverse(){return this.conjugate().normalize()}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}lengthxyz(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}normalize(){let t=this.length();return 0===t?(this.x=0,this.y=0,this.z=0,this.w=1):(t=1/t,this.x*=t,this.y*=t,this.z*=t,this.w*=t),this}multiply(t){return this.multiplyQuaternions(this,t)}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this}multiplyQuaternions(t,e){const r=t.x,n=t.y,i=t.z,o=t.w,a=e.x,s=e.y,l=e.z,c=e.w;return this.x=r*c+o*a+n*l-i*s,this.y=n*c+o*s+i*a-r*l,this.z=i*c+o*l+r*s-n*a,this.w=o*c-r*a-n*s-i*l,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this}clone(){return new n(this.x,this.y,this.z,this.w)}setFromEuler(t){const e=Math.cos(t.x/2),r=Math.cos(t.y/2),n=Math.cos(t.z/2),i=Math.sin(t.x/2),o=Math.sin(t.y/2),a=Math.sin(t.z/2);return this.x=i*r*n+e*o*a,this.y=e*o*n-i*r*a,this.z=e*r*a+i*o*n,this.w=e*r*n-i*o*a,this}}},"./src/WebGL/math/Vector2.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{Vector2:()=>n});class n{constructor(t,e){this.x=t||0,this.y=e||0}set(t,e){return this.x=t,this.y=e,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this}copy(t){return this.x=t.x,this.y=t.y,this}clone(){return new n(this.x,this.y)}}},"./src/WebGL/math/index.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{Matrix3:()=>l.Matrix3,Matrix4:()=>l.Matrix4,Quaternion:()=>n.Quaternion,Ray:()=>l.Ray,Vector2:()=>i.Vector2,Vector3:()=>l.Vector3,clamp:()=>o.clamp,conversionMatrix3:()=>a.conversionMatrix3,degToRad:()=>s.degToRad});var n=r("./src/WebGL/math/Quaternion.ts"),i=r("./src/WebGL/math/Vector2.ts"),o=r("./src/WebGL/math/utils/clamp.ts"),a=r("./src/WebGL/math/utils/conversionMatrix3.ts"),s=r("./src/WebGL/math/utils/degToRad.ts"),l=r("./src/WebGL/math/math.ts")},"./src/WebGL/math/math.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{Matrix3:()=>d,Matrix4:()=>u,Ray:()=>f,Vector3:()=>h});var n,i,o,a,s,l=r("./src/WebGL/math/utils/degToRad.ts"),c=r("./src/WebGL/math/utils/clamp.ts");class u{constructor(t=1,e=0,r=0,n=0,i=0,o=1,a=0,s=0,l=0,c=0,u=1,h=0,d=0,f=0,p=0,m=1){void 0!==t&&"number"!=typeof t?this.elements=new Float32Array(t):(this.elements=new Float32Array(16),this.elements[0]=t,this.elements[4]=e,this.elements[8]=r,this.elements[12]=n,this.elements[1]=i,this.elements[5]=o,this.elements[9]=a,this.elements[13]=s,this.elements[2]=l,this.elements[6]=c,this.elements[10]=u,this.elements[14]=h,this.elements[3]=d,this.elements[7]=f,this.elements[11]=p,this.elements[15]=m)}makeScale(t,e,r){throw new Error("Method not implemented.")}set(t,e,r,n,i,o,a,s,l,c,u,h,d,f,p,m){const g=this.elements;return g[0]=t,g[4]=e,g[8]=r,g[12]=n,g[1]=i,g[5]=o,g[9]=a,g[13]=s,g[2]=l,g[6]=c,g[10]=u,g[14]=h,g[3]=d,g[7]=f,g[11]=p,g[15]=m,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}copy(t){const e=t.elements;return this.set(e[0],e[4],e[8],e[12],e[1],e[5],e[9],e[13],e[2],e[6],e[10],e[14],e[3],e[7],e[11],e[15]),this}matrix3FromTopLeft(){const t=this.elements;return new d(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10])}setRotationFromEuler(t,e){const r=this.elements,{x:n,y:i,z:o}=t,a=Math.cos(n),s=Math.sin(n),l=Math.cos(i),c=Math.sin(i),u=Math.cos(o),h=Math.sin(o);if(void 0===e||"XYZ"===e){const t=a*u,e=a*h,n=s*u,i=s*h;r[0]=l*u,r[4]=-l*h,r[8]=c,r[1]=e+n*c,r[5]=t-i*c,r[9]=-s*l,r[2]=i-t*c,r[6]=n+e*c,r[10]=a*l}else console.error(`Error with matrix4 setRotationFromEuler. Order: ${e}`);return this}setRotationFromQuaternion(t){const e=this.elements,{x:r,y:n,z:i,w:o}=t,a=r+r,s=n+n,l=i+i,c=r*a,u=r*s,h=r*l,d=n*s,f=n*l,p=i*l,m=o*a,g=o*s,v=o*l;return e[0]=1-(d+p),e[4]=u-v,e[8]=h+g,e[1]=u+v,e[5]=1-(c+p),e[9]=f-m,e[2]=h-g,e[6]=f+m,e[10]=1-(c+d),this}multiplyMatrices(t,e){const r=t.elements,n=e.elements,i=this.elements,o=r[0],a=r[4],s=r[8],l=r[12],c=r[1],u=r[5],h=r[9],d=r[13],f=r[2],p=r[6],m=r[10],g=r[14],v=r[3],b=r[7],y=r[11],x=r[15],_=n[0],w=n[4],k=n[8],A=n[12],M=n[1],T=n[5],S=n[9],C=n[13],E=n[2],L=n[6],z=n[10],O=n[14],D=n[3],I=n[7],F=n[11],R=n[15];return i[0]=o*_+a*M+s*E+l*D,i[4]=o*w+a*T+s*L+l*I,i[8]=o*k+a*S+s*z+l*F,i[12]=o*A+a*C+s*O+l*R,i[1]=c*_+u*M+h*E+d*D,i[5]=c*w+u*T+h*L+d*I,i[9]=c*k+u*S+h*z+d*F,i[13]=c*A+u*C+h*O+d*R,i[2]=f*_+p*M+m*E+g*D,i[6]=f*w+p*T+m*L+g*I,i[10]=f*k+p*S+m*z+g*F,i[14]=f*A+p*C+m*O+g*R,i[3]=v*_+b*M+y*E+x*D,i[7]=v*w+b*T+y*L+x*I,i[11]=v*k+b*S+y*z+x*F,i[15]=v*A+b*C+y*O+x*R,this}multiplyScalar(t){const e=this.elements;return e[0]*=t,e[4]*=t,e[8]*=t,e[12]*=t,e[1]*=t,e[5]*=t,e[9]*=t,e[13]*=t,e[2]*=t,e[6]*=t,e[10]*=t,e[14]*=t,e[3]*=t,e[7]*=t,e[11]*=t,e[15]*=t,this}makeTranslation(t,e,r){return this.set(1,0,0,t,0,1,0,e,0,0,1,r,0,0,0,1),this}snap(t){t||(t=4);const e=Math.pow(10,4),r=this.elements;for(let t=0;t<16;t++){const n=Math.round(r[t]);n===Math.round(r[t]*e)/e&&(r[t]=n)}return this}transpose(){const t=this.elements;let e;return e=t[1],t[1]=t[4],t[4]=e,e=t[2],t[2]=t[8],t[8]=e,e=t[6],t[6]=t[9],t[9]=e,e=t[3],t[3]=t[12],t[12]=e,e=t[7],t[7]=t[13],t[13]=e,e=t[11],t[11]=t[14],t[14]=e,this}setPosition(t){const e=this.elements;return e[12]=t.x,e[13]=t.y,e[14]=t.z,this}translate(t){const e=this.elements;return e[12]+=t.x,e[13]+=t.y,e[14]+=t.z,this}getInverse(t,e){const r=this.elements,n=t.elements,i=n[0],o=n[4],a=n[8],s=n[12],l=n[1],c=n[5],u=n[9],h=n[13],d=n[2],f=n[6],p=n[10],m=n[14],g=n[3],v=n[7],b=n[11],y=n[15];r[0]=u*m*v-h*p*v+h*f*b-c*m*b-u*f*y+c*p*y,r[4]=s*p*v-a*m*v-s*f*b+o*m*b+a*f*y-o*p*y,r[8]=a*h*v-s*u*v+s*c*b-o*h*b-a*c*y+o*u*y,r[12]=s*u*f-a*h*f-s*c*p+o*h*p+a*c*m-o*u*m,r[1]=h*p*g-u*m*g-h*d*b+l*m*b+u*d*y-l*p*y,r[5]=a*m*g-s*p*g+s*d*b-i*m*b-a*d*y+i*p*y,r[9]=s*u*g-a*h*g-s*l*b+i*h*b+a*l*y-i*u*y,r[13]=a*h*d-s*u*d+s*l*p-i*h*p-a*l*m+i*u*m,r[2]=c*m*g-h*f*g+h*d*v-l*m*v-c*d*y+l*f*y,r[6]=s*f*g-o*m*g-s*d*v+i*m*v+o*d*y-i*f*y,r[10]=o*h*g-s*c*g+s*l*v-i*h*v-o*l*y+i*c*y,r[14]=s*c*d-o*h*d-s*l*f+i*h*f+o*l*m-i*c*m,r[3]=u*f*g-c*p*g-u*d*v+l*p*v+c*d*b-l*f*b,r[7]=o*p*g-a*f*g+a*d*v-i*p*v-o*d*b+i*f*b,r[11]=a*c*g-o*u*g-a*l*v+i*u*v+o*l*b-i*c*b,r[15]=o*u*d-a*c*d+a*l*f-i*u*f-o*l*p+i*c*p;const x=i*r[0]+l*r[4]+d*r[8]+g*r[12];if(0===x){const t="Matrix4.getInverse(): can't invert matrix, determinant is 0";if(e)throw new Error(t);return console.warn(t),this.identity(),this}return this.multiplyScalar(1/x),this}isReflected(){const t=this.elements,e=t[0],r=t[4],n=t[8],i=t[1],o=t[5],a=t[9],s=t[2],l=t[6],c=t[10];return e*o*c+i*l*n+s*r*a-s*o*n-i*r*c-e*l*a<0}scale(t){const e=this.elements,{x:r}=t,{y:n}=t,{z:i}=t;return e[0]*=r,e[4]*=n,e[8]*=i,e[1]*=r,e[5]*=n,e[9]*=i,e[2]*=r,e[6]*=n,e[10]*=i,e[3]*=r,e[7]*=n,e[11]*=i,this}getMaxScaleOnAxis(){const t=this.elements,e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],r=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],n=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(e,Math.max(r,n)))}makeFrustum(t,e,r,n,i,o){const a=this.elements,s=2*i/(e-t),l=2*i/(n-r),c=(e+t)/(e-t),u=(n+r)/(n-r),h=-(o+i)/(o-i),d=-2*o*i/(o-i);return a[0]=s,a[4]=0,a[8]=c,a[12]=0,a[1]=0,a[5]=l,a[9]=u,a[13]=0,a[2]=0,a[6]=0,a[10]=h,a[14]=d,a[3]=0,a[7]=0,a[11]=-1,a[15]=0,this}makePerspective(t,e,r,n){const i=r*Math.tan((0,l.degToRad)(.5*t)),o=-i,a=o*e,s=i*e;return this.makeFrustum(a,s,o,i,r,n)}makeOrthographic(t,e,r,n,i,o){const a=this.elements,s=1/(e-t),l=1/(r-n),c=1/(o-i),u=(e+t)*s,h=(r+n)*l,d=(o+i)*c;return a[0]=2*s,a[4]=0,a[8]=0,a[12]=-u,a[1]=0,a[5]=2*l,a[9]=0,a[13]=-h,a[2]=0,a[6]=0,a[10]=-2*c,a[14]=-d,a[3]=0,a[7]=0,a[11]=0,a[15]=1,this}isEqual(t){const e=t.elements,r=this.elements;return r[0]===e[0]&&r[4]===e[4]&&r[8]===e[8]&&r[12]===e[12]&&r[1]===e[1]&&r[5]===e[5]&&r[9]===e[9]&&r[13]===e[13]&&r[2]===e[2]&&r[6]===e[6]&&r[10]===e[10]&&r[14]===e[14]&&r[3]===e[3]&&r[7]===e[7]&&r[11]===e[11]&&r[15]===e[15]}clone(){const t=this.elements;return new u(t[0],t[4],t[8],t[12],t[1],t[5],t[9],t[13],t[2],t[6],t[10],t[14],t[3],t[7],t[11],t[15])}isIdentity(){const t=this.elements;return 1===t[0]&&0===t[4]&&0===t[8]&&0===t[12]&&0===t[1]&&1===t[5]&&0===t[9]&&0===t[13]&&0===t[2]&&0===t[6]&&1===t[10]&&0===t[14]&&0===t[3]&&0===t[7]&&0===t[11]&&1===t[15]}isNearlyIdentity(t){return this.clone().snap(t).isIdentity()}getScale(t){const e=this.elements;return t=t||new h,o.set(e[0],e[1],e[2]),a.set(e[4],e[5],e[6]),s.set(e[8],e[9],e[10]),t.x=o.length(),t.y=a.length(),t.z=s.length(),t}lookAt(t,e,r){const n=this.elements;return s.subVectors(t,e).normalize(),0===s.length()&&(s.z=1),o.crossVectors(r,s).normalize(),0===o.length()&&(s.x+=1e-4,o.crossVectors(r,s).normalize()),a.crossVectors(s,o),n[0]=o.x,n[4]=a.x,n[8]=s.x,n[1]=o.y,n[5]=a.y,n[9]=s.y,n[2]=o.z,n[6]=a.z,n[10]=s.z,this}compose(t,e,r){const o=this.elements;return n.identity(),n.setRotationFromQuaternion(e),i.makeScale(r.x,r.y,r.z),this.multiplyMatrices(n,i),o[12]=t.x,o[13]=t.y,o[14]=t.z,this}}n=new u,i=new u;class h{constructor(t,e,r){this.x=t||0,this.y=e||0,this.z=r||0,this.atomid=void 0}set(t,e,r){return this.x=t,this.y=e,this.z=r,this}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this}multiplyVectors(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this.z=t.z*e.z,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this}divideScalar(t){return 0!==t?(this.x/=t,this.y/=t,this.z/=t):(this.x=0,this.y=0,this.z=0),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,r=this.y-t.y,n=this.z-t.z;return e*e+r*r+n*n}applyMatrix3(t){const{x:e}=this,{y:r}=this,{z:n}=this,i=t.elements;return this.x=i[0]*e+i[3]*r+i[6]*n,this.y=i[1]*e+i[4]*r+i[7]*n,this.z=i[2]*e+i[5]*r+i[8]*n,this}applyMatrix4(t){const{x:e}=this,{y:r}=this,{z:n}=this,i=t.elements;return this.x=i[0]*e+i[4]*r+i[8]*n+i[12],this.y=i[1]*e+i[5]*r+i[9]*n+i[13],this.z=i[2]*e+i[6]*r+i[10]*n+i[14],this}applyProjection(t){const{x:e}=this,{y:r}=this,{z:n}=this,i=t.elements,o=i[3]*e+i[7]*r+i[11]*n+i[15];return this.x=(i[0]*e+i[4]*r+i[8]*n+i[12])/o,this.y=(i[1]*e+i[5]*r+i[9]*n+i[13])/o,this.z=(i[2]*e+i[6]*r+i[10]*n+i[14])/o,this}applyQuaternion(t){const{x:e}=this,{y:r}=this,{z:n}=this,i=t.x,o=t.y,a=t.z,s=t.w,l={};l.x=2*(r*a-n*o),l.y=2*(n*i-e*a),l.z=2*(e*o-r*i);const c={};return c.x=l.y*a-l.z*o,c.y=l.z*i-l.x*a,c.z=l.x*o-l.y*i,this.x=e+s*l.x+c.x,this.y=r+s*l.y+c.y,this.z=n+s*l.z+c.z,this}negate(){return this.multiplyScalar(-1)}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}normalize(){return this.divideScalar(this.length())}cross(t){const{x:e}=this,{y:r}=this,{z:n}=this;return this.x=r*t.z-n*t.y,this.y=n*t.x-e*t.z,this.z=e*t.y-r*t.x,this}crossVectors(t,e){return this.x=t.y*e.z-t.z*e.y,this.y=t.z*e.x-t.x*e.z,this.z=t.x*e.y-t.y*e.x,this}equals(t){return this.x==t.x&&this.y==t.y&&this.z==t.z}getPositionFromMatrix(t){return this.x=t.elements[12],this.y=t.elements[13],this.z=t.elements[14],this}setEulerFromRotationMatrix(t,e){const r=t.elements,n=r[0],i=r[4],o=r[8],a=r[5],s=r[9],l=r[6],u=r[10];return void 0===e||"XYZ"===e?(this.y=Math.asin((0,c.clamp)(o,-1,1)),Math.abs(o)<.99999?(this.x=Math.atan2(-s,u),this.z=Math.atan2(-i,n)):(this.x=Math.atan2(l,a),this.z=0)):console.error(`Error with vector's setEulerFromRotationMatrix: Unknown order: ${e}`),this}rotateAboutVector(t,e){t.normalize();const r=Math.cos(e),n=Math.sin(e),i=this.clone().multiplyScalar(r),o=t.clone().cross(this).multiplyScalar(n),a=t.clone().multiplyScalar(t.clone().dot(this)).multiplyScalar(1-r),s=i.add(o).add(a);return this.x=s.x,this.y=s.y,this.z=s.z,this}setFromMatrixPosition(t){const e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this}transformDirection(t){const{x:e}=this,{y:r}=this,{z:n}=this,i=t.elements;return this.x=i[0]*e+i[4]*r+i[8]*n,this.y=i[1]*e+i[5]*r+i[9]*n,this.z=i[2]*e+i[6]*r+i[10]*n,this.normalize()}clone(){return new h(this.x,this.y,this.z)}unproject(t){const e=n;return e.multiplyMatrices(t.matrixWorld,e.getInverse(t.projectionMatrix)),this.applyMatrix4(e)}}o=new h,a=new h,s=new h;class d{constructor(t=1,e=0,r=0,n=0,i=1,o=0,a=0,s=0,l=1){this.elements=new Float32Array(9),this.set(t,e,r,n,i,o,a,s,l)}set(t,e,r,n,i,o,a,s,l){const c=this.elements;return c[0]=t,c[3]=e,c[6]=r,c[1]=n,c[4]=i,c[7]=o,c[2]=a,c[5]=s,c[8]=l,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(t){const e=t.elements;this.set(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])}multiplyScalar(t){const e=this.elements;return e[0]*=t,e[3]*=t,e[6]*=t,e[1]*=t,e[4]*=t,e[7]*=t,e[2]*=t,e[5]*=t,e[8]*=t,this}getInverse3(t){const e=t.elements,r=this.elements;r[0]=e[4]*e[8]-e[5]*e[7],r[3]=e[6]*e[5]-e[3]*e[8],r[6]=e[3]*e[7]-e[6]*e[4],r[1]=e[7]*e[2]-e[1]*e[8],r[4]=e[0]*e[8]-e[6]*e[2],r[7]=e[1]*e[6]-e[0]*e[7],r[2]=e[1]*e[5]-e[2]*e[4],r[5]=e[2]*e[3]-e[0]*e[5],r[8]=e[0]*e[4]-e[1]*e[3];const n=e[0]*r[0]+e[3]*r[1]+e[6]*r[2];return this.multiplyScalar(1/n),this}getInverse(t,e){const r=t.elements,n=this.elements;n[0]=r[10]*r[5]-r[6]*r[9],n[1]=-r[10]*r[1]+r[2]*r[9],n[2]=r[6]*r[1]-r[2]*r[5],n[3]=-r[10]*r[4]+r[6]*r[8],n[4]=r[10]*r[0]-r[2]*r[8],n[5]=-r[6]*r[0]+r[2]*r[4],n[6]=r[9]*r[4]-r[5]*r[8],n[7]=-r[9]*r[0]+r[1]*r[8],n[8]=r[5]*r[0]-r[1]*r[4];const i=r[0]*n[0]+r[1]*n[3]+r[2]*n[6];if(0===i){const t="Matrix3.getInverse(): can't invert matrix, determinant is 0";if(e)throw new Error(t);return console.warn(t),this.identity(),this}return this.multiplyScalar(1/i),this}getDeterminant(){const t=this.elements;return t[0]*t[4]*t[8]+t[1]*t[5]*t[6]+t[2]*t[3]*t[7]-t[2]*t[4]*t[6]-t[1]*t[3]*t[8]-t[0]*t[5]*t[7]}transpose(){let t;const e=this.elements;return t=e[1],e[1]=e[3],e[3]=t,t=e[2],e[2]=e[6],e[6]=t,t=e[5],e[5]=e[7],e[7]=t,this}clone(){const t=this.elements;return new d(t[0],t[3],t[6],t[1],t[4],t[7],t[2],t[5],t[8])}getMatrix4(){const t=this.elements;return new u(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0)}}class f{constructor(t,e){this.origin=void 0!==t?t:new h,this.direction=void 0!==e?e:new h}set(t,e){return this.origin.copy(t),this.direction.copy(e),this}copy(t){return this.origin.copy(t.origin),this.direction.copy(t.direction),this}at(t,e){return(e||new h).copy(this.direction).multiplyScalar(t).add(this.origin)}recast(t){const e=o;return this.origin.copy(this.at(t,e)),this}closestPointToPoint(t,e){const r=e||new h;r.subVectors(t,this.origin);const n=r.dot(this.direction);return r.copy(this.direction).multiplyScalar(n).add(this.origin)}distanceToPoint(t){const e=o,r=e.subVectors(t,this.origin).dot(this.direction);return e.copy(this.direction).multiplyScalar(r).add(this.origin),e.distanceTo(t)}isIntersectionCylinder(){}isIntersectionSphere(t){return this.distanceToPoint(t.center)<=t.radius}isIntersectionPlane(t){return 0!==t.normal.dot(this.direction)||0===t.distanceToPoint(this.origin)}distanceToPlane(t){const e=t.normal.dot(this.direction);return 0===e?0===t.distanceToPoint(this.origin)?0:void 0:-(this.origin.dot(t.normal)+t.constant)/e}intersectPlane(t,e){const r=this.distanceToPlane(t);if(void 0!==r)return this.at(r,e)}applyMatrix4(t){return this.direction.add(this.origin).applyMatrix4(t),this.origin.applyMatrix4(t),this.direction.sub(this.origin),this}clone(){return(new f).copy(this)}}},"./src/WebGL/math/utils/clamp.ts":(t,e,r)=>{"use strict";function n(t,e,r){return Math.min(Math.max(t,e),r)}r.r(e),r.d(e,{clamp:()=>n})},"./src/WebGL/math/utils/conversionMatrix3.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{conversionMatrix3:()=>i});var n=r("./src/WebGL/math/math.ts");function i(t,e,r,i,o,a){i=i*Math.PI/180,o=o*Math.PI/180,a=a*Math.PI/180;const s=t=>t*t,l=Math.cos(i),c=Math.cos(o),u=Math.cos(a),h=Math.sin(a);return new n.Matrix3(t,e*u,r*c,0,e*h,r*(l-c*u)/h,0,0,r*Math.sqrt(1-s(l)-s(c)-s(u)+2*l*c*u)/h)}},"./src/WebGL/math/utils/degToRad.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{degToRad:()=>i});const n=Math.PI/180;function i(t){return t*n}},"./src/WebGL/objects/Line.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{Line:()=>a,LineStyle:()=>n});var n,i=r("./src/WebGL/materials/index.ts"),o=r("./src/WebGL/core/index.ts");!function(t){t[t.LineStrip=0]="LineStrip",t[t.LinePieces=1]="LinePieces"}(n||(n={}));class a extends o.Object3D{constructor(t,e=new i.LineBasicMaterial({color:16777215*Math.random()}),r=n.LineStrip){super(),this.geometry=t,this.material=e,this.type=r}clone(t=new a(this.geometry,this.material,this.type)){return super.clone.call(this,t),t}}},"./src/WebGL/objects/Mesh.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{Mesh:()=>i});var n=r("./src/WebGL/core/index.ts");class i extends n.Object3D{constructor(t,e){super(),this.geometry=t,this.material=e}clone(t){return void 0===t&&(t=new i(this.geometry,this.material)),super.clone.call(this,t),t}}},"./src/WebGL/objects/Sprite.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{Sprite:()=>o});var n=r("./src/WebGL/materials/index.ts"),i=r("./src/WebGL/core/index.ts");class o extends i.Object3D{constructor(t=new n.SpriteMaterial){super(),this.material=t,this.rotation3d=this.rotation,this.rotation=0}updateMatrix(){this.matrix.setPosition(this.position),this.rotation3d.set(0,0,this.rotation),this.matrix.setRotationFromEuler(this.rotation3d),1===this.scale.x&&1===this.scale.y||this.matrix.scale(this.scale),this.matrixWorldNeedsUpdate=!0}clone(t=new o(this.material)){return i.Object3D.prototype.clone.call(this,t),t}}},"./src/WebGL/objects/index.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{Line:()=>n.Line,LineStyle:()=>n.LineStyle,Mesh:()=>i.Mesh,Sprite:()=>o.Sprite});var n=r("./src/WebGL/objects/Line.ts"),i=r("./src/WebGL/objects/Mesh.ts"),o=r("./src/WebGL/objects/Sprite.ts")},"./src/WebGL/shaders/ShaderType.ts":(t,e,r)=>{"use strict";r.r(e)},"./src/WebGL/shaders/index.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{ShaderLib:()=>n.ShaderLib,ShaderUtils:()=>i.ShaderUtils,basic:()=>n.basic,clone:()=>i.clone,instanced:()=>n.instanced,lambert:()=>n.lambert,lambertdouble:()=>n.lambertdouble,outline:()=>n.outline,screen:()=>n.screen,screenaa:()=>n.screenaa,sphereimposter:()=>n.sphereimposter,sphereimposteroutline:()=>n.sphereimposteroutline,sprite:()=>n.sprite,stickimposter:()=>n.stickimposter,stickimposteroutline:()=>n.stickimposteroutline,volumetric:()=>n.volumetric});var n=r("./src/WebGL/shaders/lib/index.ts"),i=r("./src/WebGL/shaders/utils/index.ts");r("./src/WebGL/shaders/ShaderType.ts")},"./src/WebGL/shaders/lib/basic/index.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{basic:()=>o});var n=r("./src/WebGL/shaders/lib/basic/uniforms.ts"),i=r("./src/WebGL/shaders/lib/basic/basic.frag");const o={vertexShader:r("./src/WebGL/shaders/lib/basic/basic.vert").default.replace("#define GLSLIFY 1",""),fragmentShader:i.default.replace("#define GLSLIFY 1",""),uniforms:n.uniforms}},"./src/WebGL/shaders/lib/basic/uniforms.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{uniforms:()=>n});const n={opacity:{type:"f",value:1},fogColor:{type:"c",value:new(r("./src/colors.ts").Color)(1,1,1)},fogNear:{type:"f",value:1},fogFar:{type:"f",value:2e3}}},"./src/WebGL/shaders/lib/index.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{ShaderLib:()=>g,basic:()=>n.basic,instanced:()=>i.instanced,lambert:()=>o.lambert,lambertdouble:()=>a.lambertdouble,outline:()=>s.outline,screen:()=>l.screen,screenaa:()=>c.screenaa,sphereimposter:()=>u.sphereimposter,sphereimposteroutline:()=>h.sphereimposteroutline,sprite:()=>d.sprite,stickimposter:()=>f.stickimposter,stickimposteroutline:()=>p.stickimposteroutline,volumetric:()=>m.volumetric});var n=r("./src/WebGL/shaders/lib/basic/index.ts"),i=r("./src/WebGL/shaders/lib/instanced/index.ts"),o=r("./src/WebGL/shaders/lib/lambert/index.ts"),a=r("./src/WebGL/shaders/lib/lambertdouble/index.ts"),s=r("./src/WebGL/shaders/lib/outline/index.ts"),l=r("./src/WebGL/shaders/lib/screen/index.ts"),c=r("./src/WebGL/shaders/lib/screenaa/index.ts"),u=r("./src/WebGL/shaders/lib/sphereimposter/index.ts"),h=r("./src/WebGL/shaders/lib/sphereimposteroutline/index.ts"),d=r("./src/WebGL/shaders/lib/sprite/index.ts"),f=r("./src/WebGL/shaders/lib/stickimposter/index.ts"),p=r("./src/WebGL/shaders/lib/stickimposteroutline/index.ts"),m=r("./src/WebGL/shaders/lib/volumetric/index.ts");const g={basic:n.basic,instanced:i.instanced,lambert:o.lambert,lambertdouble:a.lambertdouble,outline:s.outline,screen:l.screen,screenaa:c.screenaa,sphereimposter:u.sphereimposter,sphereimposteroutline:h.sphereimposteroutline,sprite:d.sprite,stickimposter:f.stickimposter,stickimposteroutline:p.stickimposteroutline,volumetric:m.volumetric}},"./src/WebGL/shaders/lib/instanced/index.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{instanced:()=>a});var n=r("./src/WebGL/shaders/lib/instanced/uniforms.ts"),i=r("./src/WebGL/shaders/lib/instanced/instanced.frag"),o=r("./src/WebGL/shaders/lib/instanced/instanced.vert");const a={fragmentShader:i.default.replace("#define GLSLIFY 1",""),vertexShader:o.default.replace("#define GLSLIFY 1",""),uniforms:n.uniforms}},"./src/WebGL/shaders/lib/instanced/uniforms.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{uniforms:()=>n});const n={opacity:{type:"f",value:1},fogColor:{type:"c",value:new(r("./src/colors.ts").Color)(1,1,1)},fogNear:{type:"f",value:1},fogFar:{type:"f",value:2e3},directionalLightColor:{type:"fv",value:[]},directionalLightDirection:{type:"fv",value:[]}}},"./src/WebGL/shaders/lib/lambert/index.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{lambert:()=>a});var n=r("./src/WebGL/shaders/lib/lambert/uniforms.ts"),i=r("./src/WebGL/shaders/lib/lambert/lambert.frag"),o=r("./src/WebGL/shaders/lib/lambert/lambert.vert");const a={fragmentShader:i.default.replace("#define GLSLIFY 1",""),vertexShader:o.default.replace("#define GLSLIFY 1",""),uniforms:n.uniforms}},"./src/WebGL/shaders/lib/lambert/uniforms.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{uniforms:()=>n});const n={opacity:{type:"f",value:1},fogColor:{type:"c",value:new(r("./src/colors.ts").Color)(1,1,1)},fogNear:{type:"f",value:1},fogFar:{type:"f",value:2e3},directionalLightColor:{type:"fv",value:[]},directionalLightDirection:{type:"fv",value:[]}}},"./src/WebGL/shaders/lib/lambertdouble/index.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{lambertdouble:()=>a});var n=r("./src/WebGL/shaders/lib/lambertdouble/uniforms.ts"),i=r("./src/WebGL/shaders/lib/lambertdouble/lambertdouble.frag"),o=r("./src/WebGL/shaders/lib/lambertdouble/lambertdouble.vert");const a={fragmentShader:i.default.replace("#define GLSLIFY 1",""),vertexShader:o.default.replace("#define GLSLIFY 1",""),uniforms:n.uniforms}},"./src/WebGL/shaders/lib/lambertdouble/uniforms.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{uniforms:()=>n});const n={opacity:{type:"f",value:1},fogColor:{type:"c",value:new(r("./src/colors.ts").Color)(1,1,1)},fogNear:{type:"f",value:1},fogFar:{type:"f",value:2e3},directionalLightColor:{type:"fv",value:[]},directionalLightDirection:{type:"fv",value:[]}}},"./src/WebGL/shaders/lib/outline/index.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{outline:()=>a});var n=r("./src/WebGL/shaders/lib/outline/uniforms.ts"),i=r("./src/WebGL/shaders/lib/outline/outline.frag"),o=r("./src/WebGL/shaders/lib/outline/outline.vert");const a={fragmentShader:i.default.replace("#define GLSLIFY 1",""),vertexShader:o.default.replace("#define GLSLIFY 1",""),uniforms:n.uniforms}},"./src/WebGL/shaders/lib/outline/uniforms.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{uniforms:()=>i});var n=r("./src/colors.ts");const i={opacity:{type:"f",value:1},outlineColor:{type:"c",value:new n.Color(0,0,0)},fogColor:{type:"c",value:new n.Color(1,1,1)},fogNear:{type:"f",value:1},fogFar:{type:"f",value:2e3},outlineWidth:{type:"f",value:.1},outlinePushback:{type:"f",value:1}}},"./src/WebGL/shaders/lib/screen/index.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{screen:()=>a});var n=r("./src/WebGL/shaders/lib/screen/uniforms.ts"),i=r("./src/WebGL/shaders/lib/screen/screen.frag"),o=r("./src/WebGL/shaders/lib/screen/screen.vert");const a={fragmentShader:i.default.replace("#define GLSLIFY 1",""),vertexShader:o.default.replace("#define GLSLIFY 1",""),uniforms:n.uniforms}},"./src/WebGL/shaders/lib/screen/uniforms.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{uniforms:()=>n});const n={}},"./src/WebGL/shaders/lib/screenaa/index.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{screenaa:()=>a});var n=r("./src/WebGL/shaders/lib/screenaa/uniforms.ts"),i=r("./src/WebGL/shaders/lib/screenaa/screenaa.frag"),o=r("./src/WebGL/shaders/lib/screenaa/screenaa.vert");const a={fragmentShader:i.default.replace("#define GLSLIFY 1",""),vertexShader:o.default.replace("#define GLSLIFY 1",""),uniforms:n.uniforms}},"./src/WebGL/shaders/lib/screenaa/uniforms.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{uniforms:()=>n});const n={}},"./src/WebGL/shaders/lib/sphereimposter/index.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{sphereimposter:()=>o});var n=r("./src/WebGL/shaders/lib/sphereimposter/uniforms.ts"),i=r("./src/WebGL/shaders/lib/sphereimposter/sphereimposter.frag");const o={vertexShader:r("./src/WebGL/shaders/lib/sphereimposter/sphereimposter.vert").default.replace("#define GLSLIFY 1",""),fragmentShader:i.default.replace("#define GLSLIFY 1",""),uniforms:n.uniforms}},"./src/WebGL/shaders/lib/sphereimposter/uniforms.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{uniforms:()=>n});const n={opacity:{type:"f",value:1},fogColor:{type:"c",value:new(r("./src/colors.ts").Color)(1,1,1)},fogNear:{type:"f",value:1},fogFar:{type:"f",value:2e3},directionalLightColor:{type:"fv",value:[]},directionalLightDirection:{type:"fv",value:[]}}},"./src/WebGL/shaders/lib/sphereimposteroutline/index.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{sphereimposteroutline:()=>a});var n=r("./src/WebGL/shaders/lib/sphereimposteroutline/uniforms.ts"),i=r("./src/WebGL/shaders/lib/sphereimposteroutline/sphereimposteroutline.frag"),o=r("./src/WebGL/shaders/lib/sphereimposteroutline/sphereimposteroutline.vert");const a={fragmentShader:i.default.replace("#define GLSLIFY 1",""),vertexShader:o.default.replace("#define GLSLIFY 1",""),uniforms:n.uniforms}},"./src/WebGL/shaders/lib/sphereimposteroutline/uniforms.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{uniforms:()=>i});var n=r("./src/colors.ts");const i={opacity:{type:"f",value:1},outlineColor:{type:"c",value:new n.Color(0,0,0)},fogColor:{type:"c",value:new n.Color(1,1,1)},fogNear:{type:"f",value:1},fogFar:{type:"f",value:2e3},outlineWidth:{type:"f",value:.1},outlinePushback:{type:"f",value:1}}},"./src/WebGL/shaders/lib/sprite/index.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{sprite:()=>a});var n=r("./src/WebGL/shaders/lib/sprite/uniforms.ts"),i=r("./src/WebGL/shaders/lib/sprite/sprite.frag"),o=r("./src/WebGL/shaders/lib/sprite/sprite.vert");const a={fragmentShader:i.default.replace("#define GLSLIFY 1",""),vertexShader:o.default.replace("#define GLSLIFY 1",""),uniforms:n.uniforms}},"./src/WebGL/shaders/lib/sprite/uniforms.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{uniforms:()=>n});const n={}},"./src/WebGL/shaders/lib/stickimposter/index.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{stickimposter:()=>s});var n=r("./src/WebGL/shaders/lib/stickimposter/uniforms.ts"),i=r("./src/WebGL/shaders/utils/stickimposterFragmentShader.partial.frag"),o=r("./src/WebGL/shaders/lib/stickimposter/stickimposter.partial.frag"),a=r("./src/WebGL/shaders/lib/stickimposter/stickimposter.vert");const s={fragmentShader:[i.default,o.default].join("\n").replace("#define GLSLIFY 1",""),vertexShader:a.default.replace("#define GLSLIFY 1",""),uniforms:n.uniforms}},"./src/WebGL/shaders/lib/stickimposter/uniforms.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{uniforms:()=>n});const n={opacity:{type:"f",value:1},fogColor:{type:"c",value:new(r("./src/colors.ts").Color)(1,1,1)},fogNear:{type:"f",value:1},fogFar:{type:"f",value:2e3},directionalLightColor:{type:"fv",value:[]},directionalLightDirection:{type:"fv",value:[]}}},"./src/WebGL/shaders/lib/stickimposteroutline/index.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{stickimposteroutline:()=>a});var n=r("./src/WebGL/shaders/lib/stickimposteroutline/uniforms.ts"),i=r("./src/WebGL/shaders/utils/stickimposterFragmentShader.partial.frag"),o=r("./src/WebGL/shaders/lib/stickimposteroutline/stickimposteroutline.vert");const a={fragmentShader:(i.default+"gl_FragColor = vec4(color,1.0);}").replace("#define GLSLIFY 1",""),vertexShader:o.default.replace("#define GLSLIFY 1",""),uniforms:n.uniforms}},"./src/WebGL/shaders/lib/stickimposteroutline/uniforms.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{uniforms:()=>i});var n=r("./src/colors.ts");const i={opacity:{type:"f",value:1},fogColor:{type:"c",value:new n.Color(1,1,1)},fogNear:{type:"f",value:1},fogFar:{type:"f",value:2e3},outlineColor:{type:"c",value:new n.Color(0,0,0)},outlineWidth:{type:"f",value:.1},outlinePushback:{type:"f",value:1}}},"./src/WebGL/shaders/lib/volumetric/index.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{volumetric:()=>a});var n=r("./src/WebGL/shaders/lib/volumetric/uniforms.ts"),i=r("./src/WebGL/shaders/lib/volumetric/volumetric.frag"),o=r("./src/WebGL/shaders/lib/volumetric/volumetric.vert");const a={fragmentShader:i.default.replace("#define GLSLIFY 1",""),vertexShader:o.default.replace("#define GLSLIFY 1",""),uniforms:n.uniforms}},"./src/WebGL/shaders/lib/volumetric/uniforms.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{uniforms:()=>n});const n={opacity:{type:"f",value:1},fogColor:{type:"c",value:new(r("./src/colors.ts").Color)(1,1,1)},fogNear:{type:"f",value:1},fogFar:{type:"f",value:2e3},data:{type:"i",value:3},colormap:{type:"i",value:4},depthmap:{type:"i",value:5},step:{type:"f",value:1},maxdepth:{type:"f",value:100},subsamples:{type:"f",value:5},textmat:{type:"mat4",value:[]},projinv:{type:"mat4",value:[]},transfermin:{type:"f",value:-.2},transfermax:{type:"f",value:.2}}},"./src/WebGL/shaders/utils/clone.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{clone:()=>i});var n=r("./src/colors.ts");function i(t){let e={};for(const i in t){e[i]={},e[i].type=t[i].type;var r=t[i].value;r instanceof n.Color?e[i].value=r.clone():"number"==typeof r?e[i].value=r:r instanceof Array?e[i].value=[]:console.error("Error copying shader uniforms from ShaderLib: unknown type for uniform")}return e}},"./src/WebGL/shaders/utils/index.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{ShaderUtils:()=>o,clone:()=>n.clone});var n=r("./src/WebGL/shaders/utils/clone.ts"),i=r("./src/WebGL/shaders/utils/stickimposterFragmentShader.partial.frag");const o={clone:n.clone,stickimposterFragmentShader:i.default}},"./src/WebGL/shapes/Cylinder.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{Cylinder:()=>o});var n=r("./src/WebGL/math/index.ts");let i=new n.Vector3;class o{constructor(t=new n.Vector3,e=new n.Vector3,r=0){this.c1=t,this.c2=e,this.radius=r,this.direction=(new n.Vector3).subVectors(this.c2,this.c1).normalize()}copy(t){return this.c1.copy(t.c1),this.c2.copy(t.c2),this.direction.copy(t.direction),this.radius=t.radius,this}lengthSq(){return i.subVectors(this.c2,this.c1).lengthSq()}applyMatrix4(t){return this.direction.add(this.c1).applyMatrix4(t),this.c1.applyMatrix4(t),this.c2.applyMatrix4(t),this.direction.sub(this.c1).normalize(),this.radius=this.radius*t.getMaxScaleOnAxis(),this}}},"./src/WebGL/shapes/Sphere.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{Sphere:()=>i});var n=r("./src/WebGL/math/index.ts");class i{constructor(t={x:0,y:0,z:0},e=0){this.center=new n.Vector3(t.x,t.y,t.z),this.radius=e}set(t,e){return this.center.copy(t),this.radius=e,this}copy(t){return this.center.copy(t.center),this.radius=t.radius,this}applyMatrix4(t){return this.center.applyMatrix4(t),this.radius=this.radius*t.getMaxScaleOnAxis(),this}translate(t){return this.center.add(t),this}equals(t){return t.center.equals(this.center)&&t.radius===this.radius}clone(){return(new i).copy(this)}}},"./src/WebGL/shapes/Triangle.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{Triangle:()=>o});var n=r("./src/WebGL/math/index.ts");const i=new n.Vector3;class o{constructor(t=new n.Vector3,e=new n.Vector3,r=new n.Vector3){this.a=t,this.b=e,this.c=r}copy(t){return this.a.copy(t.a),this.b.copy(t.b),this.c.copy(t.c),this}applyMatrix4(t){return this.a.applyMatrix4(t),this.b.applyMatrix4(t),this.c.applyMatrix4(t),this}getNormal(){var t=this.a.clone();return t.sub(this.b),i.subVectors(this.c,this.b),t.cross(i),t.normalize(),t}}},"./src/WebGL/shapes/index.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{Cylinder:()=>i.Cylinder,Sphere:()=>n.Sphere,Triangle:()=>o.Triangle});var n=r("./src/WebGL/shapes/Sphere.ts"),i=r("./src/WebGL/shapes/Cylinder.ts"),o=r("./src/WebGL/shapes/Triangle.ts")},"./src/autoload.ts":(__unused_webpack_module,__nested_webpack_exports__,__nested_webpack_require_891473__)=>{"use strict";__nested_webpack_require_891473__.r(__nested_webpack_exports__),__nested_webpack_require_891473__.d(__nested_webpack_exports__,{autoinit:()=>autoinit,autoload:()=>autoload,processing_autoinit:()=>processing_autoinit,viewers:()=>viewers});var _GLViewer__WEBPACK_IMPORTED_MODULE_0__=__nested_webpack_require_891473__("./src/GLViewer.ts"),_ProteinSurface4__WEBPACK_IMPORTED_MODULE_1__=__nested_webpack_require_891473__("./src/ProteinSurface4.ts"),_utilities__WEBPACK_IMPORTED_MODULE_2__=__nested_webpack_require_891473__("./src/utilities.ts"),_colors__WEBPACK_IMPORTED_MODULE_3__=__nested_webpack_require_891473__("./src/colors.ts"),autoinit=!1,processing_autoinit=!1,viewers={};function autoload(viewer,callback){var i,dataname,type;if(null!=document.querySelector(".viewer_3Dmoljs")&&(autoinit=!0),autoinit){processing_autoinit=!0,viewer=null!=viewer?viewer:null;var nviewers=0;document.querySelectorAll(".viewer_3Dmoljs").forEach((viewerdiv=>{var datauri=[],datatypes=[],uri="";"static"==viewerdiv.style.position&&(viewerdiv.style.position="relative");var UI=null;if(type=null,viewerdiv.dataset.pdb)datauri.push("https://files.rcsb.org/view/"+viewerdiv.dataset.pdb+".pdb"),datatypes.push("pdb");else if(viewerdiv.dataset.cid)datatypes.push("sdf"),datauri.push("https://pubchem.ncbi.nlm.nih.gov/rest/pug/compound/cid/"+viewerdiv.dataset.cid+"/SDF?record_type=3d");else if(viewerdiv.dataset.href||viewerdiv.dataset.url){uri=viewerdiv.dataset.href?viewerdiv.dataset.href:viewerdiv.dataset.url,datauri.push(uri),type=uri.substring(uri.lastIndexOf(".")+1),datatypes.push(type);var molName=uri.substring(uri.lastIndexOf("/")+1,uri.lastIndexOf("."));"/"==molName&&(molName=uri.substring(uri.lastIndexOf("/")+1)),viewerdiv.dataset[datatypes[datatypes.length-1]]=molName}let divdata=viewerdiv.dataset;for(i in divdata)"pdb"===i.substring(0,3)&&"pdb"!==i?(datauri.push("https://files.rcsb.org/view/"+divdata[i]+".pdb"),datatypes.push("pdb")):"href"===i.substring(0,4)&&"href"!==i?(uri=divdata[i],datauri.push(uri),datatypes.push(uri.substring(uri.lastIndexOf(".")+1))):"cid"===i.substring(0,3)&&"cid"!==i&&(datauri.push("https://pubchem.ncbi.nlm.nih.gov/rest/pug/compound/cid/"+divdata[i]+"/SDF?record_type=3d"),datatypes.push("sdf"));var options={};viewerdiv.dataset.options&&(options=(0,_utilities__WEBPACK_IMPORTED_MODULE_2__.specStringToObject)(viewerdiv.dataset.options));var bgcolor=_colors__WEBPACK_IMPORTED_MODULE_3__.CC.color(viewerdiv.dataset.backgroundcolor),bgalpha=viewerdiv.dataset.backgroundalpha;bgalpha=null==bgalpha?1:parseFloat(bgalpha);var style={line:{}};viewerdiv.dataset.style&&(style=(0,_utilities__WEBPACK_IMPORTED_MODULE_2__.specStringToObject)(viewerdiv.dataset.style));var select={};viewerdiv.dataset.select&&(select=(0,_utilities__WEBPACK_IMPORTED_MODULE_2__.specStringToObject)(viewerdiv.dataset.select));var selectstylelist=[],surfaces=[],labels=[],zoomto={},spin=null,d=viewerdiv.dataset,stylere=/style(.+)/,surfre=/surface(.*)/,reslabre=/labelres(.*)/,keys=[];for(dataname in d)Object.prototype.hasOwnProperty.call(d,dataname)&&keys.push(dataname);for(keys.sort(),i=0;i{UI.loadSurface("VDW",e,r,t)})):t.addSurface(_ProteinSurface4__WEBPACK_IMPORTED_MODULE_1__.SurfaceType.VDW,r,e,e)}for(i=0;ifunction(moldata){uri=datauri[i];var type=viewerdiv.dataset.type||viewerdiv.dataset.datatype||datatypes[i];if(glviewer.addModel(moldata,type,options),UI){var modelName=viewerdiv.dataset[datatypes[i]];UI.setModelTitle(modelName)}if(i+=1,i{"complete"===document.readyState&&autoload()}},"./src/colors.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{CC:()=>i,Color:()=>n,builtinColorSchemes:()=>h,chains:()=>u,elementColors:()=>l,htmlColors:()=>o,residues:()=>c,ssColors:()=>a});class n{constructor(t,e,r){return this.r=0,this.g=0,this.b=0,arguments.length>1&&"number"==typeof t?(this.r=t||0,this.g=e||0,this.b=r||0,this):this.set(t||0)}set(t){return t instanceof n?t.clone():("number"==typeof t?this.setHex(t):"object"==typeof t&&(this.r=(null==t?void 0:t.r)||0,this.g=(null==t?void 0:t.g)||0,this.b=(null==t?void 0:t.b)||0),this)}setHex(t){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(255&t)/255,this}getHex(){return Math.round(255*this.r)<<16|Math.round(255*this.g)<<8|Math.round(255*this.b)}clone(){return new n(this.r,this.g,this.b)}copy(t){return this.r=t.r,this.g=t.g,this.b=t.b,this}scaled(){var t={};return t.r=Math.round(255*this.r),t.g=Math.round(255*this.g),t.b=Math.round(255*this.b),t.a=1,t}}class i{static color(t){if(!t)return i.cache[0];if(t instanceof n)return t;if("number"==typeof t&&void 0!==i.cache[t])return i.cache[t];if(t&&Array.isArray(t))return t.map(i.color);let e=i.getHex(t),r=new n(e);return i.cache[e]=r,r}static getHex(t){var e;if(Array.isArray(t))return t.map(i.getHex);if("string"==typeof t){let r=t;if(!isNaN(parseInt(r)))return parseInt(r);if(r=r.trim(),4==r.length&&"#"==r[0]&&(r="#"+r[1]+r[1]+r[2]+r[2]+r[3]+r[3]),7==r.length&&"#"==r[0])return parseInt(r.substring(1),16);let n=i.rgbRegEx.exec(r);if(n){""!=n[1]&&console.log("WARNING: Opacity value in rgba ignored. Specify separately as opacity attribute.");let t=0;for(let e=2;e<5;e++){t*=256;let r=n[e].endsWith("%")?255*parseFloat(n[e])/100:parseFloat(n[e]);t+=Math.round(r)}return t}return(null===(e=null===window||void 0===window?void 0:window.$3Dmol)||void 0===e?void 0:e.htmlColors[t.toLowerCase()])||0}return t}}i.rgbRegEx=/rgb(a?)\(\s*([^ ,\)\t]+)\s*,\s*([^ ,\)\t]+)\s*,\s*([^ ,\)\t]+)/i,i.cache={0:new n(0)};const o={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgrey:11119017,darkgreen:25600,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,grey:8421504,green:32768,greenyellow:11403055,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgrey:13882323,lightgreen:9498256,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},a={pyMol:{h:16711680,s:16776960,c:65280},Jmol:{h:16711808,s:16762880,c:16777215}},s={H:16777215,He:16761035,HE:16761035,Li:11674146,LI:11674146,B:65280,C:13158600,N:9408511,O:15728640,F:14329120,Na:255,NA:255,Mg:2263842,MG:2263842,Al:8421520,AL:8421520,Si:14329120,SI:14329120,P:16753920,S:16762930,Cl:65280,CL:65280,Ca:8421520,CA:8421520,Ti:8421520,TI:8421520,Cr:8421520,CR:8421520,Mn:8421520,MN:8421520,Fe:16753920,FE:16753920,Ni:10824234,NI:10824234,Cu:10824234,CU:10824234,Zn:10824234,ZN:10824234,Br:10824234,BR:10824234,Ag:8421520,AG:8421520,I:10494192,Ba:16753920,BA:16753920,Au:14329120,AU:14329120},l={defaultColor:16716947,Jmol:{H:16777215,He:14286847,HE:14286847,Li:13402367,LI:13402367,Be:12779264,BE:12779264,B:16758197,C:9474192,N:3166456,O:16715021,F:9494608,Ne:11789301,NE:11789301,Na:11230450,NA:11230450,Mg:9109248,MG:9109248,Al:12560038,AL:12560038,Si:1578e4,SI:1578e4,P:16744448,S:16777008,Cl:2093087,CL:2093087,Ar:8442339,AR:8442339,K:9388244,Ca:4062976,CA:4062976,Sc:15132390,SC:15132390,Ti:12567239,TI:12567239,V:10921643,Cr:9083335,CR:9083335,Mn:10255047,MN:10255047,Fe:14706227,FE:14706227,Co:15765664,CO:15765664,Ni:5296208,NI:5296208,Cu:13140019,CU:13140019,Zn:8224944,ZN:8224944,Ga:12750735,GA:12750735,Ge:6721423,GE:6721423,As:12419299,AS:12419299,Se:16752896,SE:16752896,Br:10889513,BR:10889513,Kr:6076625,KR:6076625,Rb:7351984,RB:7351984,Sr:65280,SR:65280,Y:9764863,Zr:9756896,ZR:9756896,Nb:7586505,NB:7586505,Mo:5551541,MO:5551541,Tc:3907230,TC:3907230,Ru:2396047,RU:2396047,Rh:687500,RH:687500,Pd:27013,PD:27013,Ag:12632256,AG:12632256,Cd:16767375,CD:16767375,In:10909043,IN:10909043,Sn:6717568,SN:6717568,Sb:10380213,SB:10380213,Te:13924864,TE:13924864,I:9699476,Xe:4366e3,XE:4366e3,Cs:5707663,CS:5707663,Ba:51456,BA:51456,La:7394559,LA:7394559,Ce:16777159,CE:16777159,Pr:14286791,PR:14286791,Nd:13107143,ND:13107143,Pm:10747847,PM:10747847,Sm:9437127,SM:9437127,Eu:6422471,EU:6422471,Gd:4587463,GD:4587463,Tb:3211207,TB:3211207,Dy:2097095,DY:2097095,Ho:65436,HO:65436,Er:58997,ER:58997,Tm:54354,TM:54354,Yb:48952,YB:48952,Lu:43812,LU:43812,Hf:5096191,HF:5096191,Ta:5089023,TA:5089023,W:2200790,Re:2522539,RE:2522539,Os:2516630,OS:2516630,Ir:1528967,IR:1528967,Pt:13684960,PT:13684960,Au:16765219,AU:16765219,Hg:12105936,HG:12105936,Tl:10900557,TL:10900557,Pb:5724513,PB:5724513,Bi:10375093,BI:10375093,Po:11230208,PO:11230208,At:7688005,AT:7688005,Rn:4358806,RN:4358806,Fr:4325478,FR:4325478,Ra:32e3,RA:32e3,Ac:7384058,AC:7384058,Th:47871,TH:47871,Pa:41471,PA:41471,U:36863,Np:33023,NP:33023,Pu:27647,PU:27647,Am:5528818,AM:5528818,Cm:7888099,CM:7888099,Bk:9064419,BK:9064419,Cf:10565332,CF:10565332,Es:11739092,ES:11739092,Fm:11739066,FM:11739066,Md:11734438,MD:11734438,No:12389767,NO:12389767,Lr:13041766,LR:13041766,Rf:13369433,RF:13369433,Db:13697103,DB:13697103,Sg:14221381,SG:14221381,Bh:14680120,BH:14680120,Hs:15073326,HS:15073326,Mt:15400998,MT:15400998},rasmol:s,defaultColors:Object.assign({},s),greenCarbon:Object.assign(Object.assign({},s),{C:65280}),cyanCarbon:Object.assign(Object.assign({},s),{C:65535}),magentaCarbon:Object.assign(Object.assign({},s),{C:16711935}),yellowCarbon:Object.assign(Object.assign({},s),{C:16776960}),whiteCarbon:Object.assign(Object.assign({},s),{C:16777215}),orangeCarbon:Object.assign(Object.assign({},s),{C:16753920}),purpleCarbon:Object.assign(Object.assign({},s),{C:8388736}),blueCarbon:Object.assign(Object.assign({},s),{C:255})},c={amino:{ALA:13158600,ARG:1334015,ASN:56540,ASP:15075850,CYS:15132160,GLN:56540,GLU:15075850,GLY:15461355,HIS:8553170,ILE:1016335,LEU:1016335,LYS:1334015,MET:15132160,PHE:3289770,PRO:14456450,SER:16422400,THR:16422400,TRP:11819700,TYR:3289770,VAL:1016335,ASX:16738740,GLX:16738740},shapely:{ALA:9240460,ARG:124,ASN:16743536,ASP:10485826,CYS:16777072,GLN:16731212,GLU:6684672,GLY:16777215,HIS:7368959,ILE:19456,LEU:4546117,LYS:4671416,MET:12099650,PHE:5459026,PRO:5395026,SER:16740418,THR:12078080,TRP:5195264,TYR:9203788,VAL:16747775,ASX:16711935,GLX:16711935},nucleic:{A:10526975,G:16740464,I:8454143,C:16747595,T:10551200,U:16744576}},u={atom:{A:12636415,B:11599792,C:16761032,D:16777088,E:16761087,F:11596016,G:16765040,H:15761536,I:16113331,J:49151,K:13458524,L:6737322,M:10145074,N:15631086,O:52945,P:65407,Q:3978097,R:139,S:12433259,T:25600,U:8388608,V:8421376,W:8388736,X:32896,Y:12092939,Z:11674146},hetatm:{A:9478351,B:8441752,C:13602992,D:13619056,E:13603023,F:8437952,G:13607008,H:12603504,I:12955267,J:42959,K:11881548,L:5682578,M:9090346,N:12481214,O:46753,P:53103,Q:3447649,R:187,S:10854235,T:37888,U:11534336,V:11579392,W:11534512,X:45232,Y:15250963,Z:12726834}},h={ssPyMol:{prop:"ss",map:a.pyMol},ssJmol:{prop:"ss",map:a.Jmol},Jmol:{prop:"elem",map:l.Jmol},amino:{prop:"resn",map:c.amino},shapely:{prop:"resn",map:c.shapely},nucleic:{prop:"resn",map:c.nucleic},chain:{prop:"chain",map:u.atom},rasmol:{prop:"elem",map:l.rasmol},default:{prop:"elem",map:l.defaultColors},greenCarbon:{prop:"elem",map:l.greenCarbon},chainHetatm:{prop:"chain",map:u.hetatm},cyanCarbon:{prop:"elem",map:l.cyanCarbon},magentaCarbon:{prop:"elem",map:l.magentaCarbon},purpleCarbon:{prop:"elem",map:l.purpleCarbon},whiteCarbon:{prop:"elem",map:l.whiteCarbon},orangeCarbon:{prop:"elem",map:l.orangeCarbon},yellowCarbon:{prop:"elem",map:l.yellowCarbon},blueCarbon:{prop:"elem",map:l.blueCarbon}}},"./src/glcartoon.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{drawCartoon:()=>T,subdivide_spline:()=>u});var n=r("./src/WebGL/math/index.ts"),i=r("./src/WebGL/shapes/index.ts"),o=r("./src/WebGL/index.ts"),a=r("./src/Gradient.ts"),s=r("./src/colors.ts"),l=r("./src/GLDraw.ts"),c=r("./src/utilities.ts");function u(t,e){var r,i,o,a,s,l,c,u,h,d=[],f=t;for((f=[]).push(t[0]),r=1,i=t.length-1;r0){var g=[i,i+1,i-1,i-2],v=h.faceidx;p[v]=g[0],p[v+1]=g[1],p[v+2]=g[3],p[v+3]=g[1],p[v+4]=g[2],p[v+5]=g[3],h.faceidx+=6}h.vertices+=2}}function v(t,e,r,n,o,a,l){l&&"default"!==l||(l="rectangle"),"edged"===l?function(t,e,r,n,o){if(!(e.length<2)){var a,l;if(a=e[0],l=e[e.length-1],a=u(a,n),l=u(l,n),!o)return g(t,a,l,r);var c,h,d,f,p,m,v,b,y,x,_,w,k,A,M,T,S,C,E,L,z,O,D=[],I=[[0,2,-6,-8],[-4,-2,6,4],[7,-1,-5,3],[-3,5,1,-7]];for(k=0,A=a.length;k0){var R=void 0!==w&&void 0!==_&&w.serial!==_.serial;for(M=0;M<4;M++){var P=[m+I[M][0],m+I[M][1],m+I[M][2],m+I[M][3]];if(O[b=E.faceidx]=P[0],O[b+1]=P[1],O[b+2]=P[3],O[b+3]=P[1],O[b+4]=P[2],O[b+5]=P[3],E.faceidx+=6,_.clickable||w.clickable||_.hoverable||w.hoverable){var j=D[P[3]].clone(),N=D[P[0]].clone(),B=D[P[2]].clone(),U=D[P[1]].clone();if(j.atom=D[P[3]].atom||null,B.atom=D[P[2]].atom||null,N.atom=D[P[0]].atom||null,U.atom=D[P[1]].atom||null,R){var G=j.clone().add(N).multiplyScalar(.5),V=B.clone().add(U).multiplyScalar(.5),H=j.clone().add(U).multiplyScalar(.5);M%2==0?((w.clickable||w.hoverable)&&(T=new i.Triangle(G,H,j),S=new i.Triangle(V,B,H),C=new i.Triangle(H,B,j),w.intersectionShape.triangle.push(T),w.intersectionShape.triangle.push(S),w.intersectionShape.triangle.push(C)),(_.clickable||_.hoverable)&&(T=new i.Triangle(N,U,H),S=new i.Triangle(U,V,H),C=new i.Triangle(N,H,G),_.intersectionShape.triangle.push(T),_.intersectionShape.triangle.push(S),_.intersectionShape.triangle.push(C))):((_.clickable||_.hoverable)&&(T=new i.Triangle(G,H,j),S=new i.Triangle(V,B,H),C=new i.Triangle(H,B,j),_.intersectionShape.triangle.push(T),_.intersectionShape.triangle.push(S),_.intersectionShape.triangle.push(C)),(w.clickable||w.hoverable)&&(T=new i.Triangle(N,U,H),S=new i.Triangle(U,V,H),C=new i.Triangle(N,H,G),w.intersectionShape.triangle.push(T),w.intersectionShape.triangle.push(S),w.intersectionShape.triangle.push(C)))}else(_.clickable||_.hoverable)&&(T=new i.Triangle(N,U,j),S=new i.Triangle(U,B,j),_.intersectionShape.triangle.push(T),_.intersectionShape.triangle.push(S))}}}E.vertices+=8,w=_}var W=D.length-8;for(L=(E=t.updateGeoGroup(8)).vertexArray,z=E.colorArray,O=E.faceArray,v=3*(m=E.vertices),b=E.faceidx,k=0;k<4;k++){D.push(D[2*k]),D.push(D[W+2*k]);var q=D[2*k],Y=D[W+2*k];L[v+6*k]=q.x,L[v+1+6*k]=q.y,L[v+2+6*k]=q.z,L[v+3+6*k]=Y.x,L[v+4+6*k]=Y.y,L[v+5+6*k]=Y.z,z[v+6*k]=y.r,z[v+1+6*k]=y.g,z[v+2+6*k]=y.b,z[v+3+6*k]=y.r,z[v+4+6*k]=y.g,z[v+5+6*k]=y.b}W+=8,T=[m,m+2,m+6,m+4],S=[m+1,m+5,m+7,m+3],O[b]=T[0],O[b+1]=T[1],O[b+2]=T[3],O[b+3]=T[1],O[b+4]=T[2],O[b+5]=T[3],O[b+6]=S[0],O[b+7]=S[1],O[b+8]=S[3],O[b+9]=S[1],O[b+10]=S[2],O[b+11]=S[3],E.faceidx+=12,E.vertices+=8}}(t,e,r,n,o):"rectangle"!==l&&"oval"!==l&&"parabola"!==l||function(t,e,r,n,o,a,l){var c,h,d,f,p,m,v,b,y,x;if((d=e.length)<2||e[0].length<2)return;for(c=0;c0&&(c-=1,a=!0),E=Math.round(c*(r.length-1)/f),C=s.CC.color(r[E]),y=v,x=b,v=[],b=[],p=[],void 0!==e[0][c].atom&&(S=e[0][c].atom,"oval"===l?m=_:"rectangle"===l?m=w:"parabola"===l&&(m=k)),m||(m=w),h=0;h0&&!a){for(h=0;h<2*d;h++)D=[A+I[h][0],A+I[h][1],A+I[h][2],A+I[h][3]],O[T=F.faceidx]=D[0],O[T+1]=D[1],O[T+2]=D[3],O[T+3]=D[1],O[T+4]=D[2],O[T+5]=D[3],F.faceidx+=6;if(S.clickable||S.hoverable){var j=[];for(h in j.push(new i.Triangle(y[0],v[0],v[d-1])),j.push(new i.Triangle(y[0],v[d-1],y[d-1])),j.push(new i.Triangle(y[d-1],v[d-1],b[d-1])),j.push(new i.Triangle(y[d-1],b[d-1],x[d-1])),j.push(new i.Triangle(b[0],x[0],x[d-1])),j.push(new i.Triangle(b[d-1],b[0],x[d-1])),j.push(new i.Triangle(v[0],y[0],x[0])),j.push(new i.Triangle(b[0],v[0],x[0])),j)S.intersectionShape.triangle.push(j[h])}}F.vertices+=2*d}for(L=F.vertexArray,z=F.colorArray,O=F.faceArray,M=3*(A=F.vertices),T=F.faceidx,c=0;c=0&&r<1&&(a.transparent=!0,a.opacity=r),a.outline=n;var s=new o.Mesh(e,a);t.add(s)}}function _(t,e,r,i,o,a,s,l,c){var u,m,g,v,b,y;if(i&&o&&s){var x=o.sub(i);x.normalize();var _=l[c];for(m=c+1;m0&&v(V,W,H,d,L,0,W.style);var r=[],n=null;if(e){for(z=0;z0&&v(V,W,H,d,L,0,W.style),W=[],z=0;z{"use strict";r.r(e),r.d(e,{CAP:()=>m.CAP,CC:()=>i.CC,Color:()=>i.Color,CustomLinear:()=>n.CustomLinear,Cylinder:()=>c.Cylinder,GLDraw:()=>m.GLDraw,GLModel:()=>v.GLModel,GLShape:()=>p.GLShape,GLViewer:()=>b.GLViewer,GLVolumetricRender:()=>f.GLVolumetricRender,Gradient:()=>n.Gradient,GradientType:()=>n.GradientType,Label:()=>o.Label,LabelCount:()=>o.LabelCount,MarchingCube:()=>h.MarchingCube,MarchingCubeInitializer:()=>h.MarchingCubeInitializer,Matrix3:()=>l.Matrix3,Matrix4:()=>l.Matrix4,Parsers:()=>s.Parsers,PausableTimer:()=>u.PausableTimer,PointGrid:()=>h.PointGrid,ProteinSurface:()=>h.ProteinSurface,Quaternion:()=>l.Quaternion,ROYGB:()=>n.ROYGB,RWB:()=>n.RWB,Ray:()=>l.Ray,Sinebow:()=>n.Sinebow,Sphere:()=>c.Sphere,SurfaceType:()=>h.SurfaceType,Triangle:()=>c.Triangle,Vector2:()=>l.Vector2,Vector3:()=>l.Vector3,VolumeData:()=>d.VolumeData,adjustVolumeStyle:()=>u.adjustVolumeStyle,applyPartialCharges:()=>a.applyPartialCharges,autoinit:()=>y.autoinit,autoload:()=>y.autoload,base64ToArray:()=>u.base64ToArray,bondLength:()=>s.bondLength,builtinColorSchemes:()=>i.builtinColorSchemes,builtinGradients:()=>n.builtinGradients,chains:()=>i.chains,clamp:()=>l.clamp,conversionMatrix3:()=>l.conversionMatrix3,createStereoViewer:()=>b.createStereoViewer,createViewer:()=>b.createViewer,createViewerGrid:()=>b.createViewerGrid,deepCopy:()=>u.deepCopy,degToRad:()=>l.degToRad,download:()=>u.download,drawCartoon:()=>g.drawCartoon,elementColors:()=>i.elementColors,extend:()=>u.extend,get:()=>u.get,getAtomProperty:()=>u.getAtomProperty,getColorFromStyle:()=>u.getColorFromStyle,getElement:()=>u.getElement,getExtent:()=>u.getExtent,getGradient:()=>n.getGradient,getPropertyRange:()=>u.getPropertyRange,getbin:()=>u.getbin,htmlColors:()=>i.htmlColors,inflateString:()=>u.inflateString,isEmptyObject:()=>u.isEmptyObject,isNumeric:()=>u.isNumeric,makeFunction:()=>u.makeFunction,mergeGeos:()=>u.mergeGeos,normalizeValue:()=>n.normalizeValue,partialCharges:()=>a.partialCharges,processing_autoinit:()=>y.processing_autoinit,residues:()=>i.residues,setBondLength:()=>s.setBondLength,setSyncSurface:()=>h.setSyncSurface,specStringToObject:()=>u.specStringToObject,splitMesh:()=>p.splitMesh,ssColors:()=>i.ssColors,subdivide_spline:()=>g.subdivide_spline,syncSurface:()=>h.syncSurface,viewers:()=>y.viewers});var n=r("./src/Gradient.ts"),i=r("./src/colors.ts"),o=r("./src/Label.ts"),a=r("./src/partialCharges.ts"),s=r("./src/parsers/index.ts"),l=r("./src/WebGL/math/index.ts"),c=r("./src/WebGL/shapes/index.ts"),u=r("./src/utilities.ts"),h=r("./src/ProteinSurface4.ts"),d=r("./src/VolumeData.ts"),f=r("./src/VolumetricRender.ts"),p=r("./src/GLShape.ts"),m=r("./src/GLDraw.ts"),g=r("./src/glcartoon.ts"),v=r("./src/GLModel.ts"),b=r("./src/GLViewer.ts"),y=r("./src/autoload.ts");r("./src/specs.ts"),window&&(window.$3Dmol=e)},"./src/parsers/BCIF.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{BCIF:()=>p});var n=r("./src/utilities.ts"),i=r("./src/parsers/utils/computeSecondaryStructure.ts"),o=r("./src/parsers/utils/processSymmetries.ts"),a=r("./src/parsers/cifutils/category.ts"),s=r("./src/parsers/utils/assignPDBBonds.ts"),l=r("./src/WebGL/index.ts"),c=r("./src/parsers/utils/isEmpty.ts"),u=r("./src/vendor/mmtf.js");class h{constructor(t){if(this.C={},t){let e=t.getField("comp_id"),r=t.getField("atom_id_1"),n=t.getField("atom_id_2"),i=t.getField("value_order");for(let t=0;t0&&(o.bonds.push(a.index),a.bonds.push(o.index),o.bondOrder.push(s),a.bondOrder.push(s))}}for(let t of e.C){let e=t[0],r=t[1],n=t[2],i=this.geta(e),o=this.geta(r);null!=i&&null!=o&&(i.bonds.push(o.index),o.bonds.push(i.index),i.bondOrder.push(n),o.bondOrder.push(n))}}}function p(t,e){var r=!e.keepH,p=e.altLoc?e.altLoc:"A",m=!e.noComputeSecondaryStructure;const g=!e.doAssembly,v=void 0===e.assignBonds||e.assignBonds;if("string"==typeof t)try{t=(0,n.base64ToArray)(t)}catch(e){t=(new TextEncoder).encode(t)}else t=new Uint8Array(t);var b=u.decodeMsgpack(t);31==b&&(t=(0,n.inflateString)(t,!1),b=u.decodeMsgpack(t));var y=[],x=y.modelData=[],_=b.dataBlocks.length;if(0==_)return y;e.multimodel||(_=1);for(let t=0;t<_;t++){let n=y.length;const i=[];x.push({symmetries:[]}),y.push([]);const o=b.dataBlocks[t],s=Object.create(null);for(const t of o.categories)s[t.name.substr(1)]=(0,a.Category)(t);let u={},m=s.struct_conf;if(m){let t=m.getField("conf_type_id"),e=m.getField("beg_label_asym_id"),r=m.getField("beg_label_seq_id"),n=m.getField("end_label_seq_id");for(let i=0;i1&&("1"==t[1]?r.ssbegin=!0:"2"==t[1]&&(r.ssend=!0))}}}e.multimodel&&t<_-1&&(e.onemol||(y.push([]),x.push({symmetries:[]})))}for(let t=0;t{"use strict";function n(t,e){var r=[[]];"string"==typeof t&&(t=JSON.parse(t));for(var n=t.m,i=n[0].a,o=n[0].b,a=n[0].s,s=void 0!==e&&void 0!==e.parseStyle?e.parseStyle:void 0!==a,l=r[r.length-1].length,c=0;cn})},"./src/parsers/CIF.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{CIF:()=>l});var n=r("./src/parsers/utils/computeSecondaryStructure.ts"),i=r("./src/parsers/utils/processSymmetries.ts"),o=r("./src/WebGL/index.ts"),a=r("./src/parsers/utils/assignPDBBonds.ts");const s=function(t,e,r,n){return new o.Vector3(e,r,n).applyMatrix3(t)};function l(t,e={}){const r=[],l=!e.doAssembly,c=r.modelData=[],u=void 0===e.assignBonds||e.assignBonds;function h(t,e){const r=[];let n=0,i=0;for(;i-1){let e=m.split("");e[t]="_",m=(m=e.join("")).substring(0,t)+"_"+m.substring(t+1)}}f.push(m)}}let g=0;for(;g{"use strict";r.r(e),r.d(e,{CUBE:()=>a});var n=r("./src/WebGL/index.ts"),i=r("./src/parsers/utils/assignBonds.ts"),o=r("./src/parsers/utils/anumToSymbol.ts");function a(t,e){e=e||{};const r=[[]];let a=t.split(/\r?\n/);const s=void 0===e.assignBonds||e.assignBonds;if(a.length<6)return r;let l=a[2].replace(/^\s+/,"").replace(/\s+/g," ").split(" ");const c=Math.abs(parseFloat(l[0]));let u={origin:void 0,size:void 0,unit:void 0,matrix4:void 0,matrix:void 0};const h=u.origin=new n.Vector3(parseFloat(l[1]),parseFloat(l[2]),parseFloat(l[3]));l=a[3].replace(/^\s+/,"").replace(/\s+/g," ").split(" "),l=a[3].replace(/^\s+/,"").replace(/\s+/g," ").split(" ");const d=l[0]>0?.529177:1;h.multiplyScalar(d);const f=Math.abs(l[0]),p=new n.Vector3(parseFloat(l[1]),parseFloat(l[2]),parseFloat(l[3])).multiplyScalar(d);l=a[4].replace(/^\s+/,"").replace(/\s+/g," ").split(" ");const m=Math.abs(l[0]),g=new n.Vector3(parseFloat(l[1]),parseFloat(l[2]),parseFloat(l[3])).multiplyScalar(d);l=a[5].replace(/^\s+/,"").replace(/\s+/g," ").split(" ");const v=Math.abs(l[0]),b=new n.Vector3(parseFloat(l[1]),parseFloat(l[2]),parseFloat(l[3])).multiplyScalar(d);if(u.size={x:f,y:m,z:v},u.unit=new n.Vector3(p.x,g.y,b.z),0!=p.y||0!=p.z||0!=g.x||0!=g.z||0!=b.x||0!=b.y){u.matrix4=new n.Matrix4(p.x,g.x,b.x,0,p.y,g.y,b.y,0,p.z,g.z,b.z,0,0,0,0,1);let t=(new n.Matrix4).makeTranslation(h.x,h.y,h.z);u.matrix4=u.matrix4.multiplyMatrices(t,u.matrix4),u.matrix=u.matrix4.matrix3FromTopLeft(),u.origin=new n.Vector3(0,0,0),u.unit=new n.Vector3(1,1,1)}r.modelData=[{cryst:u}],a=a.splice(6,c);for(var y=r[r.length-1].length,x=y+a.length,_=y;_{"use strict";r.r(e),r.d(e,{GRO:()=>o});var n=r("./src/parsers/utils/assignPDBBonds.ts"),i=r("./src/parsers/utils/atomNameToElem.ts");function o(t,e){const r=[],o=t.split(/\r?\n|\r/);for(;o.length>0;){const t=parseInt(o[1]);if(o.length<3||isNaN(t)||t<=0||o.length44&&(a.dx=10*parseFloat(r.slice(44,52)),a.dy=10*parseFloat(r.slice(52,60)),a.dz=10*parseFloat(r.slice(60,68))),e[t]=a}if(o.length<=n+3){const t=o[n++].trim().split(/\s+/);if(3===t.length){for(let e=0;e<3;e++)t[e]=(10*parseFloat(t[e])).toString();r.box=t}}o.splice(0,++n)}for(let t=0;t{"use strict";r.r(e),r.d(e,{LAMMPSTRJ:()=>o});var n=r("./src/parsers/utils/assignBonds.ts");const i={id:"serial",type:"atom",element:"elem",q:"charge",radius:"radius",x:"x",xu:"x",xs:"x",xsu:"x",y:"y",yu:"y",ys:"y",ysu:"y",z:"z",zu:"z",zs:"z",zsu:"z"};function o(t,e){const r=[],o=t.split(/\r?\n|\r/);let a=0,s=0,l=0;for(;l{"use strict";r.r(e),r.d(e,{MMTFparser:()=>h});var n=r("./src/utilities.ts"),i=r("./src/WebGL/index.ts"),o=r("./src/parsers/utils/computeSecondaryStructure.ts"),a=r("./src/parsers/utils/processSymmetries.ts"),s=r("./src/vendor/mmtf.js"),l=function(t){return String.fromCharCode.apply(null,t).replace(/\0/g,"")},c=function(t){return 0==t||2==t||4==t?"h":3==t?"s":"c"};let u=new Set(["D-SACCHARIDE","D-SACCHARIDE 1,4 AND 1,4 LINKING","D-SACCHARIDE 1,4 AND 1,6 LINKING","L-SACCHARIDE","L-SACCHARIDE 1,4 AND 1,4 LINKING","L-SACCHARIDE 1,4 AND 1,6 LINKING","NON-POLYMER","OTHER","PEPTIDE-LIKE","SACCHARIDE"]);function h(t,e){var r=!e.keepH,h=e.altLoc?e.altLoc:"A",d=!!e.noSecondaryStructure,f=!e.noComputeSecondaryStructure,p=!e.doAssembly,m=e.assemblyIndex?e.assemblyIndex:0;t="string"==typeof t?(0,n.base64ToArray)(t):new Uint8Array(t);var g,v,b,y,x,_,w=s.decode(t),k=[[]],A=k.modelData=[],M=0,T=0,S=0,C=w.secStructList,E=w.bFactorList,L=w.altLocList,z=w.occupancyList,O=w.bondAtomList,D=w.bondOrderList,I=w.numModels;if(0==I)return k;e.multimodel||(I=1);var F=[];if(!p&&w.bioAssemblyList&&w.bioAssemblyList.length>0){var R=w.bioAssemblyList[m].transformList;for(g=0,_=R.length;g<_;g++){var P=new i.Matrix4(R[g].matrix);P.transpose(),F.push(P)}}var j=null;if(w.unitCell){var N=w.unitCell;j={a:N[0],b:N[1],c:N[2],alpha:N[3],beta:N[4],gamma:N[5]}}let B=[];w.entityList.forEach((t=>{t.chainIndexList.forEach((e=>{B[e]="polymer"==t.type}))}));var U=0;for(x=0;x=C.length||c(C[et]!=tt))&&(Q=!0)}var rt=w.groupIdList[T],nt=X.groupName;let t=X.chemCompType;var it=S;let e=u.has(t)||!B[M];for(b=0;b<$;++b){var ot=X.elementList[b];if(r&&"H"==ot)S+=1;else{var at="";E&&(at=E[S]);var st="";L&&L[S]&&(st=String.fromCharCode(L[S]));var lt="";if(z&&(lt=z[S]),""==st||st==h||"*"==h){var ct=w.atomIdList[S],ut=X.atomNameList[b],ht=0;X.atomChargeList&&(ht=X.atomChargeList[b]);var dt=w.xCoordList[S],ft=w.yCoordList[S],pt=w.zCoordList[S];H[S]=V.length,V.push({resn:nt,x:dt,y:ft,z:pt,elem:ot,hetflag:e,chain:q,resi:rt,icode:st,rescode:rt+(" "!=st?"^"+st:""),serial:ct,altLoc:st,index:S,atom:ut,bonds:[],ss:c(J),ssbegin:K,ssend:Q,bondOrder:[],properties:{charge:ht,occupancy:lt},b:at}),S+=1}else S+=1}}var mt=X.bondAtomList;for(b=0,y=X.bondOrderList.length;b=S){U=t;break}let i=H[e],o=H[r],a=V[i],s=V[o];a&&s&&(a.bonds.push(o),a.bondOrder.push(n),s.bonds.push(i),s.bondOrder.push(n))}e.multimodel&&(e.onemol||k.push([]))}if(!p)for(let t=0;t{"use strict";r.r(e),r.d(e,{MOL2:()=>i});let n={"C.1":"C",C1:"C","C.2":"C",C2:"C","C.3":"C",C3:"C","C.ar":"C",Car:"C","C.cat":"C",Ccat:"C","H.spc":"H",Hspc:"H","H.t3p":"H",Ht3p:"H","N.1":"N",N1:"N","N.2":"N",N2:"N","N.3":"N",N3:"N","N.4":"N",N4:"N","N.am":"N",Nam:"N","N.ar":"N",Nar:"N","N.p13":"N",Np13:"N","O.2":"O",O2:"O","O.3":"O",O3:"O","O.co2":"O",Oco2:"O","O.spc":"O",Ospc:"O","O.t3p":"O",Ot3p:"O","P.3":"P",P3:"P","S.2":"S",S2:"S","S.3":"S",S3:"S","S.o":"S",So:"S","S.o2":"S",So2:"S"};function i(t,e){var r=[[]],i=!1;void 0!==e.keepH&&(i=!e.keepH);var o=t.search(/@MOLECULE/),a=t.search(/@ATOM/);if(-1==o||-1==a)return r;for(var s=t.substring(o).split(/\r?\n|\r/);s.length>0;){var l=[],c=s[2].replace(/^\s+/,"").replace(/\s+/g," ").split(" "),u=parseInt(c[0]),h=0;c.length>1&&(h=parseInt(c[1]));var d,f=4;for(d=3;dATOM"==s[d]){f=d+1;break}var p=r[r.length-1].length,m=p+u;for(d=p;dBOND"==s[f++]){_=!0;break}if(_&&h)for(d=0;d{"use strict";r.r(e),r.d(e,{PDB:()=>i});var n=r("./src/parsers/utils/getSinglePDB.ts");function i(t,e){e=e||{};var r=[],i={};r.modelData=[];for(var o=t.split(/\r?\n|\r/);o.length>0;){var a=(0,n.getSinglePDB)(o,e,i),s=a[0],l=a[1];if(o=a[2],0!=s.length){if(e.multimodel&&e.onemol&&r.length>0)for(var c=r[0].length,u=0;u{"use strict";r.r(e),r.d(e,{PQR:()=>o});var n=r("./src/parsers/utils/assignPDBBonds.ts"),i=r("./src/parsers/utils/computeSecondaryStructure.ts");function o(t,e){var r=[[]],o=!e.noSecondaryStructure;r.modelData=[{symmetries:[]}];var a,s=[],l=t.split(/\r?\n|\r/);for(let t=0;t1&&e[1].toUpperCase()!=e[1]&&(v=e.substring(0,2)),u="H"==a[0],s[t]=r[r.length-1].length,r[r.length-1].push({resn:n,x:d,y:f,z:p,elem:v,hetflag:u,chain:i,resi:o,serial:t,atom:e,bonds:[],ss:"c",bondOrder:[],properties:{charge:m,partialCharge:m,radius:g},pdbline:a})}else if("CONECT"==c){var b=parseInt(a.substring(6,11)),y=r[r.length-1][s[b]];for(let t=0;t<4;t++){var x=parseInt(a.substring([11,16,21,26][t],[11,16,21,26][t]+5)),_=r[r.length-1][s[x]];void 0!==y&&void 0!==_&&(y.bonds.push(s[x]),y.bondOrder.push(1))}}}for(let t=0;t{"use strict";function n(t){var e,r=[],n=0,i=t.split(/\r?\n|\r/);if(!(i.length>0&&i[0].includes("VERSION")))return[];var o=i.filter((function(t){return t.includes("POINTERS")||t.includes("ATOM_NAME")||t.includes("CHARGE")||t.includes("RADII")||t.includes("BONDS_INC_HYDROGEN")||t.includes("BONDS_WITHOUT_HYDROGEN")})),a=u("POINTERS");if(-1==a)return[];var s=h(a),l=parseInt(i[a+1].slice(0,s[1]));if(isNaN(l)||l<=0)return[];if(-1==(a=u("ATOM_NAME")))return[];var c=(s=h(a))[0];for(let t=0;t0){for(;!i[e].includes("FORMAT");)e++;return e}return-1}function h(t){var e=i[t].match(/\((\d*)\S*/),r=i[t].match(/[a-zA-Z](\d*)\)\s*/);return null==r&&(r=i[t].match(/[a-zA-Z](\d*)\.\d*\)\s*/)),[e[1],r[1]]}return[r]}r.r(e),r.d(e,{PRMTOP:()=>n})},"./src/parsers/SDF.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{SDF:()=>o});var n=function(t,e){var r=[[]],n=!1;for(void 0!==e.keepH&&(n=!e.keepH);t.length>0&&!(t.length<4);){var i=parseInt(t[3].substring(0,3));if(isNaN(i)||i<=0)break;var o=parseInt(t[3].substring(3,6)),a=4;if(t.length<4+i+o)break;var s,l,c=[],u=r[r.length-1].length,h=u+i;for(s=u;s0&&!(t.length<8)&&t[4].startsWith("M V30 BEGIN CTAB")&&t[5].startsWith("M V30 COUNTS")&&!(t[5].length<14);){var i=t[5].substring(13).match(/\S+/g);if(i.length<2)break;var o=parseInt(i[0]);if(isNaN(o)||o<=0)break;var a=parseInt(i[1]),s=7;if(t.length<8+o+a)break;var l,c=[],u=r[r.length-1].length,h=u+o;for(l=u;l4){var f={},p=d[1].replace(/ /g,"");f.atom=f.elem=p[0].toUpperCase()+p.substring(1).toLowerCase(),"H"===f.elem&&n||(f.serial=l,c[l]=r[r.length-1].length,f.x=parseFloat(d[2]),f.y=parseFloat(d[3]),f.z=parseFloat(d[4]),f.hetflag=!0,f.bonds=[],f.bondOrder=[],f.properties={},f.index=r[r.length-1].length,r[r.length-1].push(f))}}if("M V30 END ATOM"!==t[s])break;if(s++,0===a||"M V30 BEGIN BOND"!==t[s])break;for(s++,l=0;l3){var g=c[parseInt(m[2])-1+u],v=c[parseInt(m[3])-1+u],b=parseFloat(m[1]);void 0!==g&&void 0!==v&&(r[r.length-1][g].bonds.push(v),r[r.length-1][g].bondOrder.push(b),r[r.length-1][v].bonds.push(g),r[r.length-1][v].bondOrder.push(b))}}if(!e.multimodel)break;for(e.onemol||r.push([]);"$$$$"!==t[s]&&s3&&o[3].length>38&&(r=o[3].substring(34,39)),"V2000"===r?n(o,e):"V3000"===r?i(o,e):[[""]]}},"./src/parsers/VASP.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{VASP:()=>o});var n=r("./src/WebGL/index.ts"),i=r("./src/parsers/utils/assignBonds.ts");function o(t,e={}){var r=[[]],o={};const a=void 0===e.assignBonds||e.assignBonds;var s=t.replace(/^\s+/,"").split(/\r?\n/);if(s.length<3)return r;if(!s[1].match(/\d+/))return console.log("Warning: second line of the vasp structure file must be a number"),r;if(o.length=parseFloat(s[1]),o.length<0)return console.log("Warning: Vasp implementation for negative lattice lengths is not yet available"),r;o.xVec=new Float32Array(s[2].replace(/^\s+/,"").split(/\s+/)),o.yVec=new Float32Array(s[3].replace(/^\s+/,"").split(/\s+/)),o.zVec=new Float32Array(s[4].replace(/^\s+/,"").split(/\s+/));var l=new n.Matrix3(o.xVec[0],o.xVec[1],o.xVec[2],o.yVec[0],o.yVec[1],o.yVec[2],o.zVec[0],o.zVec[1],o.zVec[2]);l.multiplyScalar(o.length),r.modelData=[{symmetries:[],cryst:{matrix:l}}];var c=s[5].replace(/\s+/,"").replace(/\s+$/,"").split(/\s+/),u=new Int16Array(s[6].replace(/^\s+/,"").split(/\s+/)),h=s[7].replace(/\s+/,""),d=!1;if(h.match(/S/)&&(d=!0,h=s[8].replace(/\s+/,"")),h.match(/C/))h="cartesian";else{if(!h.match(/D/))return console.log("Warning: Unknown vasp mode in POSCAR file: mode must be either C(artesian) or D(irect)"),r;h="direct"}if(c.length!=u.length)return console.log("Warning: declaration of atomary species wrong:"),console.log(c),console.log(u),r;d?s.splice(0,9):s.splice(0,8);for(var f=0,p=0,m=c.length;p{"use strict";r.r(e),r.d(e,{XYZ:()=>o});var n=r("./src/WebGL/index.ts"),i=r("./src/parsers/utils/assignBonds.ts");function o(t,e){for(var r=[[]],o=void 0===(e=e||{}).assignBonds||e.assignBonds,a=t.split(/\r?\n|\r/);a.length>0&&!(a.length<3);){var s=parseInt(a[0]);if(isNaN(s)||s<=0)break;if(a.length1){var c=new Float32Array(l[1].split(/\s+/)),u=new n.Matrix3(c[0],c[3],c[6],c[1],c[4],c[7],c[2],c[5],c[8]);r.modelData=[{cryst:{matrix:u}}]}for(var h=2,d=r[r.length-1].length,f=d+s,p=d;p=7&&(g.dx=parseFloat(m[4]),g.dy=parseFloat(m[5]),g.dz=parseFloat(m[6]))}if(!e.multimodel)break;r.push([]),a.splice(0,h)}if(o)for(let t=0;t{"use strict";r.r(e),r.d(e,{Category:()=>i});var n=r("./src/parsers/cifutils/decoder.ts");function i(t){const e=Object.create(null),r=Object.create(null);for(const r of t.columns)e[r.name]=r;return{rowCount:t.rowCount,name:t.name.substring(1),fieldNames:t.columns.map((t=>t.name)),getField(t){const i=e[t];if(i)return r[t]||(r[t]=(0,n.decode)(i.data)),r[t]}}}},"./src/parsers/cifutils/decoder.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{decode:()=>o});var n=r("./src/parsers/cifutils/encoding.ts");const i=13330===new Uint16Array(new Uint8Array([18,52]).buffer)[0];function o(t){let e=t.data;for(let r=t.encoding.length-1;r>=0;r--)e=a(e,t.encoding[r]);return e}function a(t,e){switch(e.kind){case"ByteArray":switch(e.type){case n.Encoding.IntDataType.Uint8:return t;case n.Encoding.IntDataType.Int8:return function(t){return new Int8Array(t.buffer,t.byteOffset)}(t);case n.Encoding.IntDataType.Int16:return function(t){return c(t,2,Int16Array)}(t);case n.Encoding.IntDataType.Uint16:return function(t){return c(t,2,Uint16Array)}(t);case n.Encoding.IntDataType.Int32:return function(t){return c(t,4,Int32Array)}(t);case n.Encoding.IntDataType.Uint32:return function(t){return c(t,4,Uint32Array)}(t);case n.Encoding.FloatDataType.Float32:return function(t){return c(t,4,Float32Array)}(t);case n.Encoding.FloatDataType.Float64:return function(t){return c(t,8,Float64Array)}(t);default:throw new Error("unreachable")}case"FixedPoint":return function(t,e){const r=t.length,n=l(e.srcType,r),i=1/e.factor;for(let e=0;e{"use strict";r.r(e),r.d(e,{Encoding:()=>i,VERSION:()=>n});const n="0.3.0";var i;!function(t){let e,r;!function(t){t[t.Int8=1]="Int8",t[t.Int16=2]="Int16",t[t.Int32=3]="Int32",t[t.Uint8=4]="Uint8",t[t.Uint16=5]="Uint16",t[t.Uint32=6]="Uint32"}(e=t.IntDataType||(t.IntDataType={})),function(t){t[t.Float32=32]="Float32",t[t.Float64=33]="Float64"}(r=t.FloatDataType||(t.FloatDataType={})),t.getDataType=function(e){let r;return r=e instanceof Int8Array?t.IntDataType.Int8:e instanceof Int16Array?t.IntDataType.Int16:e instanceof Int32Array?t.IntDataType.Int32:e instanceof Uint8Array?t.IntDataType.Uint8:e instanceof Uint16Array?t.IntDataType.Uint16:e instanceof Uint32Array?t.IntDataType.Uint32:e instanceof Float32Array?t.FloatDataType.Float32:e instanceof Float64Array?t.FloatDataType.Float64:t.IntDataType.Int32,r},t.isSignedIntegerDataType=function(t){if(t instanceof Int8Array||t instanceof Int16Array||t instanceof Int32Array)return!0;for(let e=0,r=t.length;e{"use strict";r.r(e),r.d(e,{Parsers:()=>b,bondLength:()=>v.bondLength,setBondLength:()=>v.setBondLength});var n=r("./src/parsers/VASP.ts"),i=r("./src/parsers/CUBE.ts"),o=r("./src/parsers/XYZ.ts"),a=r("./src/parsers/SDF.ts"),s=r("./src/parsers/CDJSON.ts"),l=r("./src/parsers/CIF.ts"),c=r("./src/parsers/MOL2.ts"),u=r("./src/parsers/PDB.ts"),h=r("./src/parsers/PQR.ts"),d=r("./src/parsers/MMTF.ts"),f=r("./src/parsers/PRMTOP.ts"),p=r("./src/parsers/GRO.ts"),m=r("./src/parsers/LAMMPSTRJ.ts"),g=r("./src/parsers/BCIF.ts"),v=r("./src/parsers/utils/bondLength.ts");const b={vasp:n.VASP,VASP:n.VASP,cube:i.CUBE,CUBE:i.CUBE,xyz:o.XYZ,XYZ:o.XYZ,sdf:a.SDF,SDF:a.SDF,json:s.CDJSON,cdjson:s.CDJSON,CDJSON:s.CDJSON,mcif:l.CIF,cif:l.CIF,CIF:l.CIF,mol2:c.MOL2,MOL2:c.MOL2,pdb:u.PDB,PDB:u.PDB,pdbqt:u.PDB,PDBQT:u.PDB,pqr:h.PQR,PQR:h.PQR,mmtf:d.MMTFparser,MMTF:d.MMTFparser,prmtop:f.PRMTOP,PRMTOP:f.PRMTOP,gro:p.GRO,GRO:p.GRO,lammpstrj:m.LAMMPSTRJ,LAMMPSTRJ:m.LAMMPSTRJ,bcif:g.BCIF,BCIF:g.BCIF}},"./src/parsers/utils/anumToSymbol.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{anumToSymbol:()=>n});const n={1:"H",2:"He",3:"Li",4:"Be",5:"B",6:"C",7:"N",8:"O",9:"F",10:"Ne",11:"Na",12:"Mg",13:"Al",14:"Si",15:"P",16:"S",17:"Cl",18:"Ar",19:"K",20:"Ca",21:"Sc",22:"Ti",23:"V",24:"Cr",25:"Mn",26:"Fe",27:"Co",28:"Ni",29:"Cu",30:"Zn",31:"Ga",32:"Ge",33:"As",34:"Se",35:"Br",36:"Kr",37:"Rb",38:"Sr",39:"Y",40:"Zr",41:"Nb",42:"Mo",43:"Tc",44:"Ru",45:"Rh",46:"Pd",47:"Ag",48:"Cd",49:"In",50:"Sn",51:"Sb",52:"Te",53:"I",54:"Xe",55:"Cs",56:"Ba",71:"Lu",72:"Hf",73:"Ta",74:"W",75:"Re",76:"Os",77:"Ir",78:"Pt",79:"Au",80:"Hg",81:"Tl",82:"Pb",83:"Bi",84:"Po",85:"At",86:"Rn",87:"Fr",88:"Ra",104:"Rf",105:"Db",106:"Sg",107:"Bh",108:"Hs",109:"Mt",110:"Ds",111:"Rg",112:"Cn",113:"Nh",114:"Fl",115:"Mc",116:"Lv",117:"Ts",118:"Og",57:"La",58:"Ce",59:"Pr",60:"Nd",61:"Pm",62:"Sm",63:"Eu",64:"Gd",65:"Tb",66:"Dy",67:"Ho",68:"Er",69:"Tm",70:"Yb",89:"Ac",90:"Th",91:"Pa",92:"U",93:"Np",94:"Pu",95:"Am",96:"Cm",97:"Bk",98:"Cf",99:"Es",100:"Fm",101:"Md",102:"No"}},"./src/parsers/utils/areConnected.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{areConnected:()=>o});var n=r("./src/parsers/utils/bondLength.ts");const i=new Set(["Na","K","Ca","Mg","Mn","Sr"]);function o(t,e,r){if(r&&r.unboundCations&&(i.has(t.elem)||i.has(e.elem)))return!1;let o=(0,n.bondLength)(t.elem)+(0,n.bondLength)(e.elem);o+=.25,o*=o;let a=t.x-e.x;if(a*=a,a>o)return!1;let s=t.y-e.y;if(s*=s,s>o)return!1;let l=t.z-e.z;if(l*=l,l>o)return!1;const c=a+s+l;return!(isNaN(c)||c<.5||c>o||t.altLoc!==e.altLoc&&""!==t.altLoc.trim()&&""!==e.altLoc.trim())}},"./src/parsers/utils/assignBackboneHBonds.ts":(t,e,r)=>{"use strict";function n(t,e){const r=e||3.2,n=r*r,i=[];for(let e=0,r=t.length;er)break;if(t.atom==o.atom)continue;const s=Math.abs(t.y-o.y);if(s>r)continue;const l=Math.abs(t.x-o.x);if(l>r)continue;const c=l*l+s*s+e*e;c>n||t.chain==o.chain&&Math.abs(t.resi-o.resi)<4||(cn})},"./src/parsers/utils/assignBonds.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{assignBonds:()=>a});var n=r("./src/parsers/utils/areConnected.ts");const i=[{x:0,y:0,z:1},{x:0,y:1,z:-1},{x:0,y:1,z:0},{x:0,y:1,z:1},{x:1,y:-1,z:-1},{x:1,y:-1,z:0},{x:1,y:-1,z:1},{x:1,y:0,z:-1},{x:1,y:0,z:0},{x:1,y:0,z:1},{x:1,y:1,z:-1},{x:1,y:1,z:0},{x:1,y:1,z:1}],o=4.95;function a(t,e){for(let e=0,r=t.length;e{"use strict";r.r(e),r.d(e,{assignPDBBonds:()=>a});var n=r("./src/parsers/utils/areConnected.ts"),i=r("./src/parsers/utils/assignBonds.ts"),o=r("./src/parsers/utils/standardResidues.ts");function a(t,e){const r=[],a=[];for(let e=0,n=t.length;e1)break;(0,n.areConnected)(i,t,e)&&(-1===i.bonds.indexOf(t.index)&&(i.bonds.push(t.index),i.bondOrder.push(1),t.bonds.push(i.index),t.bondOrder.push(1)),i.resi!==t.resi&&(s=!0))}}}},"./src/parsers/utils/atomNameToElem.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{atomNameToElem:()=>i});var n=r("./src/parsers/utils/bondLength.ts");function i(t,e){let r=t.replace(/ /g,"");return r.length>0&&"H"===r[0]&&"Hg"!==r&&"He"!==r&&"Hf"!==r&&"Hs"!==r&&"Ho"!==r&&(r="H"),r.length>1&&(r=r[0].toUpperCase()+r.substring(1).toLowerCase(),void 0===n.bondTable[r]?r=r[0]:e&&("Ca"===r||"Cd"===r)&&(r="C")),r}},"./src/parsers/utils/bondLength.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{bondLength:()=>i,bondTable:()=>n,setBondLength:()=>o});let n={H:.37,He:.32,Li:1.34,Be:.9,B:.82,C:.77,N:.75,O:.73,F:.71,Ne:.69,Na:1.54,Mg:1.3,Al:1.18,Si:1.11,P:1.06,S:1.02,Cl:.99,Ar:.97,K:1.96,Ca:1.74,Sc:1.44,Ti:1.56,V:1.25,Mn:1.39,Fe:1.25,Co:1.26,Ni:1.21,Cu:1.38,Zn:1.31,Ga:1.26,Ge:1.22,Se:1.16,Br:1.14,Kr:1.1,Rb:2.11,Sr:1.92,Y:1.62,Zr:1.48,Nb:1.37,Mo:1.45,Tc:1.56,Ru:1.26,Rh:1.35,Pd:1.31,Ag:1.53,Cd:1.48,In:1.44,Sn:1.41,Sb:1.38,Te:1.35,I:1.33,Xe:1.3,Cs:2.25,Ba:1.98,Lu:1.6,Hf:1.5,Ta:1.38,W:1.46,Re:1.59,Os:1.44,Ir:1.37,Pt:1.28,Au:1.44,Hg:1.49,Tl:1.48,Pb:1.47,Bi:1.46,Rn:1.45};function i(t){return n[t]||1.6}function o(t,e){e<0&&(e=0),n[t]=e}},"./src/parsers/utils/computeSecondaryStructure.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{computeSecondaryStructure:()=>i});var n=r("./src/parsers/utils/assignBackboneHBonds.ts");function i(t,e){(0,n.assignBackboneHBonds)(t,e);const r={};let i,o,a,s,l,c;for(i=0,o=t.length;i{"use strict";r.r(e),r.d(e,{getSinglePDB:()=>h});var n=r("./src/WebGL/index.ts"),i=r("./src/parsers/utils/atomNameToElem.ts"),o=r("./src/parsers/utils/bondLength.ts"),a=r("./src/parsers/utils/computeSecondaryStructure.ts"),s=r("./src/parsers/utils/isEmpty.ts"),l=r("./src/parsers/utils/processSymmetries.ts"),c=r("./src/parsers/utils/assignPDBBonds.ts"),u=r("./src/parsers/utils/validateBonds.ts");function h(t,e,r){const h=[],d=void 0===e.assignBonds||e.assignBonds,f=!e.keepH,p=!!e.noSecondaryStructure,m=!e.noComputeSecondaryStructure,g=!e.doAssembly,v=e.altLoc?e.altLoc:"A",b={symmetries:[],cryst:void 0};let y,x=[];const _=[];let w;const k={};for(let e=0;e=4?1:r}}else k[o]=1,0!=e.bonds.length&&e.bonds[e.bonds.length-1]===i||(e.bonds.push(i),e.bondOrder.push(1))}}else if("HELIX "===a){s=w.substring(19,20),l=parseInt(w.substring(21,25)),c=parseInt(w.substring(33,37)),s in r||(r[s]={}),r[s][l]="h1";for(let t=l+1;t1&&("1"==t[1]?e.ssbegin=!0:"2"==t[1]&&(e.ssend=!0))}}return[h,b,x]}},"./src/parsers/utils/isEmpty.ts":(t,e,r)=>{"use strict";function n(t){for(const e in t)return!1;return!0}r.r(e),r.d(e,{isEmpty:()=>n})},"./src/parsers/utils/processSymmetries.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{processSymmetries:()=>i});var n=r("./src/WebGL/index.ts");function i(t,e,r,i){const o=!r.duplicateAssemblyAtoms,a=e.length;let s=a,l=-1,c=null,u=null;(r.normalizeAssembly||r.wrapAtoms)&&i&&(c=(0,n.conversionMatrix3)(i.a,i.b,i.c,i.alpha,i.beta,i.gamma),u=new n.Matrix3,u.getInverse3(c));let h=function(t){let e=t.clone().applyMatrix3(u);const r=[e.x,e.y,e.z],i=[0,0,0];for(let t=0;t<3;t++){for(;r[t]<-.001;)r[t]+=1,i[t]+=1;for(;r[t]>1.001;)r[t]-=1,i[t]-=1}const o=new n.Vector3(i[0],i[1],i[2]);return o.applyMatrix3(c),o};if(r.normalizeAssembly&&i)for(let r=0;r.001&&(l=r),t[r].translate(o)}if(o){if(t.length>1)for(let r=0;r=0){const r=new n.Vector3;for(let n=0;n{"use strict";r.r(e),r.d(e,{standardResidues:()=>n});const n=new Set(["ABU","ACD","ALA","ALB","ALI","ARG","AR0","ASN","ASP","ASX","BAS","CYS","CYH","CYX","CSS","CSH","GLN","GLU","GLX","GLY","HIS","HIE","HID","HIP","HYP","ILE","ILU","LEU","LYS","MET","PCA","PGA","PHE","PR0","PRO","PRZ","SER","THR","TRP","TYR","VAL","A","1MA","C","5MC","OMC","G","1MG","2MG","M2G","7MG","OMG","YG","I","T","U","+U","H2U","5MU","PSU","ACE","F0R","H2O","HOH","WAT"])},"./src/parsers/utils/validateBonds.ts":(t,e,r)=>{"use strict";function n(t,e){for(let r=0,n=t.length;rn})},"./src/partialCharges.ts":(t,e,r)=>{"use strict";r.r(e),r.d(e,{applyPartialCharges:()=>i,partialCharges:()=>n});const n={"ALA:N":-.15,"ALA:CA":.1,"ALA:CB":0,"ALA:C":.6,"ALA:O":-.55,"ARG:N":-.15,"ARG:CA":.1,"ARG:CB":0,"ARG:CG":0,"ARG:CD":.1,"ARG:NE":-.1,"ARG:CZ":.5,"ARG:NH1":.25,"ARG:NH2":.25,"ARG:C":.6,"ARG:O":-.55,"ASN:N":-.15,"ASN:CA":.1,"ASN:CB":0,"ASN:CG":.55,"ASN:OD1":-.55,"ASN:ND2":0,"ASN:C":.6,"ASN:O":-.55,"ASP:N":-.15,"ASP:CA":.1,"ASP:CB":0,"ASP:CG":.14,"ASP:OD1":-.57,"ASP:OD2":-.57,"ASP:C":.6,"ASP:O":-.55,"CYS:N":-.15,"CYS:CA":.1,"CYS:CB":.19,"CYS:SG":-.19,"CYS:C":.6,"CYS:O":-.55,"GLN:N":-.15,"GLN:CA":.1,"GLN:CB":0,"GLN:CG":0,"GLN:CD":.55,"GLN:OE1":-.55,"GLN:NE2":0,"GLN:C":.6,"GLN:O":-.55,"GLU:N":-.15,"GLU:CA":.1,"GLU:CB":0,"GLU:CG":0,"GLU:CD":.14,"GLU:OE1":-.57,"GLU:OE2":-.57,"GLU:C":.6,"GLU:O":-.55,"GLY:N":-.15,"GLY:CA":.1,"GLY:C":.6,"GLY:O":-.55,"HIS:N":-.15,"HIS:CA":.1,"HIS:CB":0,"HIS:CG":.1,"HIS:ND1":-.1,"HIS:CD2":.1,"HIS:NE2":-.4,"HIS:CE1":.3,"HIS:C":.6,"HIS:O":-.55,"ILE:N":-.15,"ILE:CA":.1,"ILE:CB":0,"ILE:CG2":0,"ILE:CG1":0,"ILE:CD":0,"ILE:C":.6,"ILE:O":-.55,"LEU:N":-.15,"LEU:CA":.1,"LEU:CB":0,"LEU:CG":0,"LEU:CD1":0,"LEU:CD2":0,"LEU:C":.6,"LEU:O":-.55,"LYS:N":-.15,"LYS:CA":.1,"LYS:CB":0,"LYS:CG":0,"LYS:CD":0,"LYS:CE":.25,"LYS:NZ":.75,"LYS:C":.6,"LYS:O":-.55,"MET:N":-.15,"MET:CA":.1,"MET:CB":0,"MET:CG":.06,"MET:SD":-.12,"MET:CE":.06,"MET:C":.6,"MET:O":-.55,"PHE:N":-.15,"PHE:CA":.1,"PHE:CB":0,"PHE:CG":0,"PHE:CD1":0,"PHE:CD2":0,"PHE:CE1":0,"PHE:CE2":0,"PHE:CZ":0,"PHE:C":.6,"PHE:O":-.55,"PRO:N":-.25,"PRO:CD":.1,"PRO:CA":.1,"PRO:CB":0,"PRO:CG":0,"PRO:C":.6,"PRO:O":-.55,"SER:N":-.15,"SER:CA":.1,"SER:CB":.25,"SER:OG":-.25,"SER:C":.6,"SER:O":-.55,"THR:N":-.15,"THR:CA":.1,"THR:CB":.25,"THR:OG1":-.25,"THR:CG2":0,"THR:C":.6,"THR:O":-.55,"TRP:N":-.15,"TRP:CA":.1,"TRP:CB":0,"TRP:CG":-.03,"TRP:CD2":.1,"TRP:CE2":-.04,"TRP:CE3":-.03,"TRP:CD1":.06,"TRP:NE1":-.06,"TRP:CZ2":0,"TRP:CZ3":0,"TRP:CH2":0,"TRP:C":.6,"TRP:O":-.55,"TYR:N":-.15,"TYR:CA":.1,"TYR:CB":0,"TYR:CG":0,"TYR:CD1":0,"TYR:CE1":0,"TYR:CD2":0,"TYR:CE2":0,"TYR:CZ":.25,"TYR:OH":-.25,"TYR:C":.6,"TYR:O":-.55,"VAL:N":-.15,"VAL:CA":.1,"VAL:CB":0,"VAL:CG1":0,"VAL:CG2":0,"VAL:C":.6,"VAL:O":-.55};function i(t,e){if((!e||void 0===t.partialCharge)&&t.resn&&t.atom){var r=t.resn+":"+t.atom;t.properties.partialCharge=n[r]}}},"./src/specs.ts":(t,e,r)=>{"use strict";r.r(e)},"./src/utilities.ts":(__unused_webpack_module,__nested_webpack_exports__,__nested_webpack_require_1150143__)=>{"use strict";__nested_webpack_require_1150143__.r(__nested_webpack_exports__),__nested_webpack_require_1150143__.d(__nested_webpack_exports__,{PausableTimer:()=>PausableTimer,adjustVolumeStyle:()=>adjustVolumeStyle,base64ToArray:()=>base64ToArray,deepCopy:()=>deepCopy,download:()=>download,extend:()=>extend,get:()=>get,getAtomProperty:()=>getAtomProperty,getColorFromStyle:()=>getColorFromStyle,getElement:()=>getElement,getExtent:()=>getExtent,getPropertyRange:()=>getPropertyRange,getbin:()=>getbin,inflateString:()=>inflateString,isEmptyObject:()=>isEmptyObject,isNumeric:()=>isNumeric,makeFunction:()=>makeFunction,mergeGeos:()=>mergeGeos,specStringToObject:()=>specStringToObject});var _Gradient__WEBPACK_IMPORTED_MODULE_0__=__nested_webpack_require_1150143__("./src/Gradient.ts"),_VolumeData__WEBPACK_IMPORTED_MODULE_1__=__nested_webpack_require_1150143__("./src/VolumeData.ts"),_colors__WEBPACK_IMPORTED_MODULE_2__=__nested_webpack_require_1150143__("./src/colors.ts"),pako__WEBPACK_IMPORTED_MODULE_3__=__nested_webpack_require_1150143__("./node_modules/pako/dist/pako.esm.mjs");function extend(t,e){for(var r in e)e.hasOwnProperty(r)&&void 0!==e[r]&&(t[r]=e[r]);return t}function deepCopy(t){let e,r,n;if(null==t)return{};if("object"!=typeof t||null===t)return t;for(n in e=Array.isArray(t)?[]:{},t)r=t[n],e[n]=deepCopy(r);return e}function isNumeric(t){var e=typeof t;return("number"===e||"string"===e)&&!isNaN(t-parseFloat(t))}function isEmptyObject(t){var e;for(e in t)return!1;return!0}function makeFunction(callback){return callback&&"string"==typeof callback&&(callback=eval("("+callback+")")),callback&&"function"!=typeof callback?null:callback}function adjustVolumeStyle(t){t&&(!t.volformat||t.voldata instanceof _VolumeData__WEBPACK_IMPORTED_MODULE_1__.VolumeData||(t.voldata=new _VolumeData__WEBPACK_IMPORTED_MODULE_1__.VolumeData(t.voldata,t.volformat)),t.volscheme&&(t.volscheme=_Gradient__WEBPACK_IMPORTED_MODULE_0__.Gradient.getGradient(t.volscheme)))}function getExtent(t,e){var r,n,i,o,a,s,l,c,u,h,d=!e;if(r=n=i=9999,o=a=s=-9999,l=c=u=h=0,0===t.length)return[[0,0,0],[0,0,0],[0,0,0]];for(var f=0;fp.x?o:p.x,a=a>p.y?a:p.y,s=s>p.z?s:p.z,p.symmetries&&d))for(var m=0;mp.symmetries[m].x?o:p.symmetries[m].x,a=a>p.symmetries[m].y?a:p.symmetries[m].y,s=s>p.symmetries[m].z?s:p.symmetries[m].z}return[[r,n,i],[o,a,s],[l/h,c/h,u/h]]}function getPropertyRange(t,e){for(var r=Number.POSITIVE_INFINITY,n=Number.NEGATIVE_INFINITY,i=0,o=t.length;in&&(n=a))}return isFinite(r)||isFinite(n)?isFinite(r)?isFinite(n)||(n=r):r=n:r=n=0,[r,n]}class PausableTimer{constructor(t,e,r){this.total_time_run=0,this.fn=t,this.arg=r,this.countdown=e,this.start_time=(new Date).getTime(),this.ident=setTimeout(t,e,r)}cancel(){clearTimeout(this.ident)}pause(){clearTimeout(this.ident),this.total_time_run=(new Date).getTime()-this.start_time}resume(){this.ident=setTimeout(this.fn,Math.max(0,this.countdown-this.total_time_run),this.arg)}}function base64ToArray(t){for(var e=window.atob(t),r=e.length,n=new Uint8Array(r),i=0;i=0?parseFloat(t):parseInt(t):"true"===t||"false"!==t&&t},r={};if("all"===(t=t.replace(/%7E/g,"~")))return r;for(var n=t.split(";"),i=0;it.text()));return e?r.then(e):r}function getbin(t,e,r,n){var i;return i="POST"==r?fetch(t,{method:"POST",body:n}).then((t=>checkStatus(t))).then((t=>t.arrayBuffer())):fetch(t).then((t=>checkStatus(t))).then((t=>t.arrayBuffer())),e?i.then(e):i}function download(t,e,r,n){var i="",o="",a="",s=null,l=e.addModel();if(t.indexOf(":")<0&&(t=4==t.length?"pdb:"+t:isNaN(t)?"url:"+t:"cid:"+t),"mmtf:"==t.substring(0,5)&&(console.log("WARNING: MMTF now deprecated. Reverting to bcif."),t="bcif:"+t.slice(5)),"bcif:"===t.substring(0,5))t=t.substring(5).toUpperCase(),a="https://models.rcsb.org/"+t+".bcif.gz",r&&void 0===r.noComputeSecondaryStructure&&(r.noComputeSecondaryStructure=!0),s=new Promise((function(t){getbin(a).then((function(n){l.addMolData(n,"bcif.gz",r),e.zoomTo(),e.render(),t(l)}),(function(){console.log("fetch of "+a+" failed.")}))}));else{if("pdb:"===t.substring(0,4)){if(i="bcif",r&&r.format&&(i=r.format),r&&void 0===r.noComputeSecondaryStructure&&(r.noComputeSecondaryStructure=!0),!(t=t.substring(4).toUpperCase()).match(/^[1-9][A-Za-z0-9]{3}$/))return void alert("Wrong PDB ID");"bcif"==i?a="https://models.rcsb.org/"+t.toUpperCase()+".bcif.gz":(o=r&&r.pdbUri?r.pdbUri:"https://files.rcsb.org/view/",a=o+t+"."+i)}else if("cid:"==t.substring(0,4)){if(i="sdf",!(t=t.substring(4)).match(/^[0-9]+$/))return void alert("Wrong Compound ID");a="https://pubchem.ncbi.nlm.nih.gov/rest/pug/compound/cid/"+t+"/SDF?record_type=3d"}else"url:"==t.substring(0,4)&&(a=t.substring(4),i=a);var c=function(t){l.addMolData(t,i,r),e.zoomTo(),e.render()};s=new Promise((function(e){"bcif"==i?getbin(a).then((function(t){c(t),e(l)})).catch((function(){o=r&&r.pdbUri?r.pdbUri:"https://files.rcsb.org/view/",a=o+t+".pdb",i="pdb",console.log("falling back to pdb format"),get(a).then((function(t){c(t),e(l)})).catch((function(t){c(""),e(l),console.log("fetch of "+a+" failed: "+t.statusText)}))})):get(a).then((function(t){c(t),e(l)})).catch((function(t){c(""),e(l),console.log("fetch of "+a+" failed: "+t.statusText)}))}))}return n?(s.then((function(t){n(t)})),l):s}function getColorFromStyle(t,e){let r=e.colorscheme;if(void 0!==_colors__WEBPACK_IMPORTED_MODULE_2__.builtinColorSchemes[r])r=_colors__WEBPACK_IMPORTED_MODULE_2__.builtinColorSchemes[r];else if("string"==typeof r&&r.endsWith("Carbon")){let t=r.substring(0,r.lastIndexOf("Carbon")).toLowerCase();if(void 0!==_colors__WEBPACK_IMPORTED_MODULE_2__.htmlColors[t]){let e=Object.assign({},_colors__WEBPACK_IMPORTED_MODULE_2__.elementColors.defaultColors);e.C=_colors__WEBPACK_IMPORTED_MODULE_2__.htmlColors[t],_colors__WEBPACK_IMPORTED_MODULE_2__.builtinColorSchemes[r]={prop:"elem",map:e},r=_colors__WEBPACK_IMPORTED_MODULE_2__.builtinColorSchemes[r]}}let n=t.color;if(void 0!==e.color&&"spectrum"!=e.color&&(n=e.color),void 0!==r){let o,a;if(void 0!==_colors__WEBPACK_IMPORTED_MODULE_2__.elementColors[r])r=_colors__WEBPACK_IMPORTED_MODULE_2__.elementColors[r],void 0!==r[t[r.prop]]&&(n=r.map[t[r.prop]]);else if(void 0!==r[t[r.prop]])n=r.map[t[r.prop]];else if(void 0!==r.prop&&void 0!==r.gradient){o=r.prop;var i=r.gradient;i instanceof _Gradient__WEBPACK_IMPORTED_MODULE_0__.GradientType||(i=(0,_Gradient__WEBPACK_IMPORTED_MODULE_0__.getGradient)(r));let e=i.range()||[-1,1];a=getAtomProperty(t,o),null!=a&&(n=i.valueToHex(a,e))}else void 0!==r.prop&&void 0!==r.map?(o=r.prop,a=getAtomProperty(t,o),void 0!==r.map[a]&&(n=r.map[a])):void 0!==e.colorscheme[t.elem]?n=e.colorscheme[t.elem]:console.log("Could not interpret colorscheme "+r)}else void 0!==e.colorfunc&&(n=e.colorfunc(t));return _colors__WEBPACK_IMPORTED_MODULE_2__.CC.color(n)}function getElement(t){let e=t;return"string"==typeof t?e=document.querySelector("#"+t):"object"==typeof t&&t.get&&(e=t.get(0)),e}function inflateString(t,e=!0){let r;return r="string"==typeof t?(new TextEncoder).encode(t):new Uint8Array(t),(0,pako__WEBPACK_IMPORTED_MODULE_3__.inflate)(r,{to:e?"string":null})}},"./node_modules/upng-js/UPNG.js":(t,e,r)=>{var n;n={},t.exports=n,function(t,e){t.toRGBA8=function(e){var r=e.width,n=e.height;if(null==e.tabs.acTL)return[t.toRGBA8.decodeImage(e.data,r,n,e).buffer];var i=[];null==e.frames[0].data&&(e.frames[0].data=e.data);for(var o,a=new Uint8Array(r*n*4),s=0;s>3)]>>7-(7&p)&1);l[T]=x[S],l[T+1]=x[S+1],l[T+2]=x[S+2],l[T+3]=C>2)]>>6-((3&p)<<1)&3),l[T]=x[S],l[T+1]=x[S+1],l[T+2]=x[S+2],l[T+3]=C>1)]>>4-((1&p)<<2)&15),l[T]=x[S],l[T+1]=x[S+1],l[T+2]=x[S+2],l[T+3]=C>3]>>7-(7&p)&1))==255*g?0:255;c[p]=z<<24|E<<16|E<<8|E}if(2==h)for(p=0;p>2]>>6-((3&p)<<1)&3))==85*g?0:255,c[p]=z<<24|E<<16|E<<8|E;if(4==h)for(p=0;p>1]>>4-((1&p)<<2)&15))==17*g?0:255,c[p]=z<<24|E<<16|E<<8|E;if(8==h)for(p=0;p>3,s=Math.ceil(n*o/8),l=new Uint8Array(i*s),c=0,u=[0,0,4,0,2,0,1],h=[0,4,0,2,0,1,0],d=[8,8,8,4,4,2,2],f=[8,8,4,4,2,2,1],p=0;p<7;){for(var m=d[p],g=f[p],v=0,b=0,y=u[p];y>3])>>7-(7&M)&1,l[k*s+(A>>3)]|=T<<7-(3&A)),2==o&&(T=(T=e[M>>3])>>6-(7&M)&3,l[k*s+(A>>2)]|=T<<6-((3&A)<<1)),4==o&&(T=(T=e[M>>3])>>4-(7&M)&15,l[k*s+(A>>1)]|=T<<4-((1&A)<<2)),o>=8)for(var S=k*s+A*a,C=0;C>3)+C];M+=o,A+=g}w++,k+=m}v*b!=0&&(c+=b*(1+_)),p+=1}return l},t.decode._getBPP=function(t){return[1,null,3,1,2,null,4][t.ctype]*t.depth},t.decode._filterZero=function(e,r,n,i,o){var a=t.decode._getBPP(r),s=Math.ceil(i*a/8),l=t.decode._paeth;a=Math.ceil(a/8);for(var c=0;c>1)&255;if(4==d)for(f=a;f>1)&255;for(f=a;f>1)&255}if(4==d){for(f=0;f>8&255,t[e+1]=255&r},readUint:function(t,e){return 16777216*t[e]+(t[e+1]<<16|t[e+2]<<8|t[e+3])},writeUint:function(t,e,r){t[e]=r>>24&255,t[e+1]=r>>16&255,t[e+2]=r>>8&255,t[e+3]=255&r},readASCII:function(t,e,r){for(var n="",i=0;i=0&&s>=0?(h=f*e+p<<2,d=(s+f)*i+a+p<<2):(h=(-s+f)*e-a+p<<2,d=f*i+p<<2),0==l)n[d]=t[h],n[d+1]=t[h+1],n[d+2]=t[h+2],n[d+3]=t[h+3];else if(1==l){var m=t[h+3]*(1/255),g=t[h]*m,v=t[h+1]*m,b=t[h+2]*m,y=n[d+3]*(1/255),x=n[d]*y,_=n[d+1]*y,w=n[d+2]*y,k=1-m,A=m+y*k,M=0==A?0:1/A;n[d+3]=255*A,n[d+0]=(g+x*k)*M,n[d+1]=(v+_*k)*M,n[d+2]=(b+w*k)*M}else if(2==l)m=t[h+3],g=t[h],v=t[h+1],b=t[h+2],y=n[d+3],x=n[d],_=n[d+1],w=n[d+2],m==y&&g==x&&v==_&&b==w?(n[d]=0,n[d+1]=0,n[d+2]=0,n[d+3]=0):(n[d]=g,n[d+1]=v,n[d+2]=b,n[d+3]=m);else if(3==l){if(m=t[h+3],g=t[h],v=t[h+1],b=t[h+2],y=n[d+3],x=n[d],_=n[d+1],w=n[d+2],m==y&&g==x&&v==_&&b==w)continue;if(m<220&&y>20)return!1}return!0},t.encode=function(e,r,n,i,o,a){null==i&&(i=0),null==a&&(a=!1);for(var s=new Uint8Array(e[0].byteLength*e.length+100),l=[137,80,78,71,13,10,26,10],c=0;c<8;c++)s[c]=l[c];var u=8,h=t._bin,d=t.crc.crc,f=h.writeUint,p=h.writeUshort,m=h.writeASCII,g=t.encode.compressPNG(e,r,n,i,a);f(s,u,13),m(s,u+=4,"IHDR"),f(s,u+=4,r),f(s,u+=4,n),s[u+=4]=g.depth,s[++u]=g.ctype,s[++u]=0,s[++u]=0,s[++u]=0,f(s,++u,d(s,u-17,17)),f(s,u+=4,1),m(s,u+=4,"sRGB"),s[u+=4]=1,f(s,++u,d(s,u-5,5)),u+=4;var v=e.length>1;if(v&&(f(s,u,8),m(s,u+=4,"acTL"),f(s,u+=4,e.length),f(s,u+=4,0),f(s,u+=4,d(s,u-12,12)),u+=4),3==g.ctype){for(f(s,u,3*(T=g.plte.length)),m(s,u+=4,"PLTE"),u+=4,c=0;c>8&255,w=y>>16&255;s[u+b+0]=x,s[u+b+1]=_,s[u+b+2]=w}if(f(s,u+=3*T,d(s,u-3*T-4,3*T+4)),u+=4,g.gotAlpha){for(f(s,u,T),m(s,u+=4,"tRNS"),u+=4,c=0;c>24&255;f(s,u+=T,d(s,u-T-4,T+4)),u+=4}}for(var k=0,A=0;A=300))break}}var _=!!m&&o,w=v.length;w<=256&&0==a&&(l=w<=2?1:w<=4?2:w<=16?4:8,o&&(l=8),m=!0);var k=[];for(h=0;hN&&(N=G),UB&&(B=U));var V=-1==N?1:(N-P+1)*(B-j+1);V>1)]|=g[M[q+G]]<<4-4*(1&G);else if(2==l)for(G=0;G>2)]|=g[M[q+G]]<<6-2*(3&G);else if(1==l)for(G=0;G>3)]|=g[M[q+G]]<<7-1*(7&G)}A=H,s=3,c=1}else if(0==m&&1==e.length){H=new Uint8Array(C*E*3);var Y=C*E;for(p=0;p5e5)||2!=l&&3!=l&&4!=l){for(var c=0;c>1)+256&255;if(4==a)for(u=o;u>1)&255;for(u=o;u>1)&255}if(4==a){for(u=0;u>>1:r>>>=1;t[e]=r}return t}(),update:function(e,r,n,i){for(var o=0;o>>8;return e},crc:function(e,r,n){return 4294967295^t.crc.update(4294967295,e,r,n)}},t.quantize=function(e,r,n){for(var i=[],o=0,a=0;am&&(m=p[a].est.L,g=a);if(m<.001)break;var v=p[g],b=t.quantize.splitPixels(s,l,v.i0,v.i1,v.est.e,v.est.eMq255),y={i0:v.i0,i1:b,bst:null,est:null,tdst:0,left:null,right:null};y.bst=t.quantize.stats(s,y.i0,y.i1),y.est=t.quantize.estats(y.bst);var x={i0:b,i1:v.i1,bst:null,est:null,tdst:0,left:null,right:null};for(x.bst={R:[],m:[],N:v.bst.N-y.bst.N},a=0;a<16;a++)x.bst.R[a]=v.bst.R[a]-y.bst.R[a];for(a=0;a<4;a++)x.bst.m[a]=v.bst.m[a]-y.bst.m[a];x.est=t.quantize.estats(x.bst),v.left=y,v.right=x,p[g]=y,p.push(x)}p.sort((function(t,e){return e.bst.N-t.bst.N}));for(var _=0;_>2]=L.est.rgba}i[_]=A.buffer}return{bufs:i,plte:p}},t.quantize.getNearest=function(e,r,n,i,o){if(null==e.left)return e.tdst=t.quantize.dist(e.est.q,r,n,i,o),e;var a=t.quantize.planeDst(e.est,r,n,i,o),s=e.left,l=e.right;a>0&&(s=e.right,l=e.left);var c=t.quantize.getNearest(s,r,n,i,o);if(c.tdst<=a*a)return c;var u=t.quantize.getNearest(l,r,n,i,o);return u.tdsta;)i-=4;if(n>=i)break;var l=r[n>>2];r[n>>2]=r[i>>2],r[i>>2]=l,n+=4,i-=4}for(;s(e,n,o)>a;)n-=4;return n+4},t.quantize.vecDot=function(t,e,r){return t[e]*r[0]+t[e+1]*r[1]+t[e+2]*r[2]+t[e+3]*r[3]},t.quantize.stats=function(t,e,r){for(var n=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],i=[0,0,0,0],o=r-e>>2,a=e;a>>0}},t.M4={multVec:function(t,e){return[t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3],t[4]*e[0]+t[5]*e[1]+t[6]*e[2]+t[7]*e[3],t[8]*e[0]+t[9]*e[1]+t[10]*e[2]+t[11]*e[3],t[12]*e[0]+t[13]*e[1]+t[14]*e[2]+t[15]*e[3]]},dot:function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]},sml:function(t,e){return[t*e[0],t*e[1],t*e[2],t*e[3]]}},t.encode.alphaMul=function(t,e){for(var r=new Uint8Array(t.length),n=t.length>>2,i=0;i{"use strict";var n={};(0,r("./node_modules/upng-js/node_modules/pako/lib/utils/common.js").assign)(n,r("./node_modules/upng-js/node_modules/pako/lib/deflate.js"),r("./node_modules/upng-js/node_modules/pako/lib/inflate.js"),r("./node_modules/upng-js/node_modules/pako/lib/zlib/constants.js")),t.exports=n},"./node_modules/upng-js/node_modules/pako/lib/deflate.js":(t,e,r)=>{"use strict";var n=r("./node_modules/upng-js/node_modules/pako/lib/zlib/deflate.js"),i=r("./node_modules/upng-js/node_modules/pako/lib/utils/common.js"),o=r("./node_modules/upng-js/node_modules/pako/lib/utils/strings.js"),a=r("./node_modules/upng-js/node_modules/pako/lib/zlib/messages.js"),s=r("./node_modules/upng-js/node_modules/pako/lib/zlib/zstream.js"),l=Object.prototype.toString;function c(t){if(!(this instanceof c))return new c(t);this.options=i.assign({level:-1,method:8,chunkSize:16384,windowBits:15,memLevel:8,strategy:0,to:""},t||{});var e=this.options;e.raw&&e.windowBits>0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new s,this.strm.avail_out=0;var r=n.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(0!==r)throw new Error(a[r]);if(e.header&&n.deflateSetHeader(this.strm,e.header),e.dictionary){var u;if(u="string"==typeof e.dictionary?o.string2buf(e.dictionary):"[object ArrayBuffer]"===l.call(e.dictionary)?new Uint8Array(e.dictionary):e.dictionary,0!==(r=n.deflateSetDictionary(this.strm,u)))throw new Error(a[r]);this._dict_set=!0}}function u(t,e){var r=new c(e);if(r.push(t,!0),r.err)throw r.msg||a[r.err];return r.result}c.prototype.push=function(t,e){var r,a,s=this.strm,c=this.options.chunkSize;if(this.ended)return!1;a=e===~~e?e:!0===e?4:0,"string"==typeof t?s.input=o.string2buf(t):"[object ArrayBuffer]"===l.call(t)?s.input=new Uint8Array(t):s.input=t,s.next_in=0,s.avail_in=s.input.length;do{if(0===s.avail_out&&(s.output=new i.Buf8(c),s.next_out=0,s.avail_out=c),1!==(r=n.deflate(s,a))&&0!==r)return this.onEnd(r),this.ended=!0,!1;0!==s.avail_out&&(0!==s.avail_in||4!==a&&2!==a)||("string"===this.options.to?this.onData(o.buf2binstring(i.shrinkBuf(s.output,s.next_out))):this.onData(i.shrinkBuf(s.output,s.next_out)))}while((s.avail_in>0||0===s.avail_out)&&1!==r);return 4===a?(r=n.deflateEnd(this.strm),this.onEnd(r),this.ended=!0,0===r):2!==a||(this.onEnd(0),s.avail_out=0,!0)},c.prototype.onData=function(t){this.chunks.push(t)},c.prototype.onEnd=function(t){0===t&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=i.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},e.Deflate=c,e.deflate=u,e.deflateRaw=function(t,e){return(e=e||{}).raw=!0,u(t,e)},e.gzip=function(t,e){return(e=e||{}).gzip=!0,u(t,e)}},"./node_modules/upng-js/node_modules/pako/lib/inflate.js":(t,e,r)=>{"use strict";var n=r("./node_modules/upng-js/node_modules/pako/lib/zlib/inflate.js"),i=r("./node_modules/upng-js/node_modules/pako/lib/utils/common.js"),o=r("./node_modules/upng-js/node_modules/pako/lib/utils/strings.js"),a=r("./node_modules/upng-js/node_modules/pako/lib/zlib/constants.js"),s=r("./node_modules/upng-js/node_modules/pako/lib/zlib/messages.js"),l=r("./node_modules/upng-js/node_modules/pako/lib/zlib/zstream.js"),c=r("./node_modules/upng-js/node_modules/pako/lib/zlib/gzheader.js"),u=Object.prototype.toString;function h(t){if(!(this instanceof h))return new h(t);this.options=i.assign({chunkSize:16384,windowBits:0,to:""},t||{});var e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,0===e.windowBits&&(e.windowBits=-15)),!(e.windowBits>=0&&e.windowBits<16)||t&&t.windowBits||(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&(15&e.windowBits||(e.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new l,this.strm.avail_out=0;var r=n.inflateInit2(this.strm,e.windowBits);if(r!==a.Z_OK)throw new Error(s[r]);if(this.header=new c,n.inflateGetHeader(this.strm,this.header),e.dictionary&&("string"==typeof e.dictionary?e.dictionary=o.string2buf(e.dictionary):"[object ArrayBuffer]"===u.call(e.dictionary)&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(r=n.inflateSetDictionary(this.strm,e.dictionary))!==a.Z_OK))throw new Error(s[r])}function d(t,e){var r=new h(e);if(r.push(t,!0),r.err)throw r.msg||s[r.err];return r.result}h.prototype.push=function(t,e){var r,s,l,c,h,d=this.strm,f=this.options.chunkSize,p=this.options.dictionary,m=!1;if(this.ended)return!1;s=e===~~e?e:!0===e?a.Z_FINISH:a.Z_NO_FLUSH,"string"==typeof t?d.input=o.binstring2buf(t):"[object ArrayBuffer]"===u.call(t)?d.input=new Uint8Array(t):d.input=t,d.next_in=0,d.avail_in=d.input.length;do{if(0===d.avail_out&&(d.output=new i.Buf8(f),d.next_out=0,d.avail_out=f),(r=n.inflate(d,a.Z_NO_FLUSH))===a.Z_NEED_DICT&&p&&(r=n.inflateSetDictionary(this.strm,p)),r===a.Z_BUF_ERROR&&!0===m&&(r=a.Z_OK,m=!1),r!==a.Z_STREAM_END&&r!==a.Z_OK)return this.onEnd(r),this.ended=!0,!1;d.next_out&&(0!==d.avail_out&&r!==a.Z_STREAM_END&&(0!==d.avail_in||s!==a.Z_FINISH&&s!==a.Z_SYNC_FLUSH)||("string"===this.options.to?(l=o.utf8border(d.output,d.next_out),c=d.next_out-l,h=o.buf2string(d.output,l),d.next_out=c,d.avail_out=f-c,c&&i.arraySet(d.output,d.output,l,c,0),this.onData(h)):this.onData(i.shrinkBuf(d.output,d.next_out)))),0===d.avail_in&&0===d.avail_out&&(m=!0)}while((d.avail_in>0||0===d.avail_out)&&r!==a.Z_STREAM_END);return r===a.Z_STREAM_END&&(s=a.Z_FINISH),s===a.Z_FINISH?(r=n.inflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===a.Z_OK):s!==a.Z_SYNC_FLUSH||(this.onEnd(a.Z_OK),d.avail_out=0,!0)},h.prototype.onData=function(t){this.chunks.push(t)},h.prototype.onEnd=function(t){t===a.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=i.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},e.Inflate=h,e.inflate=d,e.inflateRaw=function(t,e){return(e=e||{}).raw=!0,d(t,e)},e.ungzip=d},"./node_modules/upng-js/node_modules/pako/lib/utils/common.js":(t,e)=>{"use strict";var r="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;function n(t,e){return Object.prototype.hasOwnProperty.call(t,e)}e.assign=function(t){for(var e=Array.prototype.slice.call(arguments,1);e.length;){var r=e.shift();if(r){if("object"!=typeof r)throw new TypeError(r+"must be non-object");for(var i in r)n(r,i)&&(t[i]=r[i])}}return t},e.shrinkBuf=function(t,e){return t.length===e?t:t.subarray?t.subarray(0,e):(t.length=e,t)};var i={arraySet:function(t,e,r,n,i){if(e.subarray&&t.subarray)t.set(e.subarray(r,r+n),i);else for(var o=0;o{"use strict";var n=r("./node_modules/upng-js/node_modules/pako/lib/utils/common.js"),i=!0,o=!0;try{String.fromCharCode.apply(null,[0])}catch(t){i=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(t){o=!1}for(var a=new n.Buf8(256),s=0;s<256;s++)a[s]=s>=252?6:s>=248?5:s>=240?4:s>=224?3:s>=192?2:1;function l(t,e){if(e<65534&&(t.subarray&&o||!t.subarray&&i))return String.fromCharCode.apply(null,n.shrinkBuf(t,e));for(var r="",a=0;a>>6,e[a++]=128|63&r):r<65536?(e[a++]=224|r>>>12,e[a++]=128|r>>>6&63,e[a++]=128|63&r):(e[a++]=240|r>>>18,e[a++]=128|r>>>12&63,e[a++]=128|r>>>6&63,e[a++]=128|63&r);return e},e.buf2binstring=function(t){return l(t,t.length)},e.binstring2buf=function(t){for(var e=new n.Buf8(t.length),r=0,i=e.length;r4)c[n++]=65533,r+=o-1;else{for(i&=2===o?31:3===o?15:7;o>1&&r1?c[n++]=65533:i<65536?c[n++]=i:(i-=65536,c[n++]=55296|i>>10&1023,c[n++]=56320|1023&i)}return l(c,n)},e.utf8border=function(t,e){var r;for((e=e||t.length)>t.length&&(e=t.length),r=e-1;r>=0&&128==(192&t[r]);)r--;return r<0||0===r?e:r+a[t[r]]>e?r:e}},"./node_modules/upng-js/node_modules/pako/lib/zlib/adler32.js":t=>{"use strict";t.exports=function(t,e,r,n){for(var i=65535&t,o=t>>>16&65535,a=0;0!==r;){r-=a=r>2e3?2e3:r;do{o=o+(i=i+e[n++]|0)|0}while(--a);i%=65521,o%=65521}return i|o<<16}},"./node_modules/upng-js/node_modules/pako/lib/zlib/constants.js":t=>{"use strict";t.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},"./node_modules/upng-js/node_modules/pako/lib/zlib/crc32.js":t=>{"use strict";var e=function(){for(var t,e=[],r=0;r<256;r++){t=r;for(var n=0;n<8;n++)t=1&t?3988292384^t>>>1:t>>>1;e[r]=t}return e}();t.exports=function(t,r,n,i){var o=e,a=i+n;t^=-1;for(var s=i;s>>8^o[255&(t^r[s])];return~t}},"./node_modules/upng-js/node_modules/pako/lib/zlib/deflate.js":(t,e,r)=>{"use strict";var n,i=r("./node_modules/upng-js/node_modules/pako/lib/utils/common.js"),o=r("./node_modules/upng-js/node_modules/pako/lib/zlib/trees.js"),a=r("./node_modules/upng-js/node_modules/pako/lib/zlib/adler32.js"),s=r("./node_modules/upng-js/node_modules/pako/lib/zlib/crc32.js"),l=r("./node_modules/upng-js/node_modules/pako/lib/zlib/messages.js"),c=-2,u=258,h=262,d=103,f=113,p=666;function m(t,e){return t.msg=l[e],e}function g(t){return(t<<1)-(t>4?9:0)}function v(t){for(var e=t.length;--e>=0;)t[e]=0}function b(t){var e=t.state,r=e.pending;r>t.avail_out&&(r=t.avail_out),0!==r&&(i.arraySet(t.output,e.pending_buf,e.pending_out,r,t.next_out),t.next_out+=r,e.pending_out+=r,t.total_out+=r,t.avail_out-=r,e.pending-=r,0===e.pending&&(e.pending_out=0))}function y(t,e){o._tr_flush_block(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,b(t.strm)}function x(t,e){t.pending_buf[t.pending++]=e}function _(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e}function w(t,e){var r,n,i=t.max_chain_length,o=t.strstart,a=t.prev_length,s=t.nice_match,l=t.strstart>t.w_size-h?t.strstart-(t.w_size-h):0,c=t.window,d=t.w_mask,f=t.prev,p=t.strstart+u,m=c[o+a-1],g=c[o+a];t.prev_length>=t.good_match&&(i>>=2),s>t.lookahead&&(s=t.lookahead);do{if(c[(r=e)+a]===g&&c[r+a-1]===m&&c[r]===c[o]&&c[++r]===c[o+1]){o+=2,r++;do{}while(c[++o]===c[++r]&&c[++o]===c[++r]&&c[++o]===c[++r]&&c[++o]===c[++r]&&c[++o]===c[++r]&&c[++o]===c[++r]&&c[++o]===c[++r]&&c[++o]===c[++r]&&oa){if(t.match_start=e,a=n,n>=s)break;m=c[o+a-1],g=c[o+a]}}}while((e=f[e&d])>l&&0!=--i);return a<=t.lookahead?a:t.lookahead}function k(t){var e,r,n,o,l,c,u,d,f,p,m=t.w_size;do{if(o=t.window_size-t.lookahead-t.strstart,t.strstart>=m+(m-h)){i.arraySet(t.window,t.window,m,m,0),t.match_start-=m,t.strstart-=m,t.block_start-=m,e=r=t.hash_size;do{n=t.head[--e],t.head[e]=n>=m?n-m:0}while(--r);e=r=m;do{n=t.prev[--e],t.prev[e]=n>=m?n-m:0}while(--r);o+=m}if(0===t.strm.avail_in)break;if(c=t.strm,u=t.window,d=t.strstart+t.lookahead,f=o,p=void 0,(p=c.avail_in)>f&&(p=f),r=0===p?0:(c.avail_in-=p,i.arraySet(u,c.input,c.next_in,p,d),1===c.state.wrap?c.adler=a(c.adler,u,p,d):2===c.state.wrap&&(c.adler=s(c.adler,u,p,d)),c.next_in+=p,c.total_in+=p,p),t.lookahead+=r,t.lookahead+t.insert>=3)for(l=t.strstart-t.insert,t.ins_h=t.window[l],t.ins_h=(t.ins_h<=3&&(t.ins_h=(t.ins_h<=3)if(n=o._tr_tally(t,t.strstart-t.match_start,t.match_length-3),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=3){t.match_length--;do{t.strstart++,t.ins_h=(t.ins_h<=3&&(t.ins_h=(t.ins_h<4096)&&(t.match_length=2)),t.prev_length>=3&&t.match_length<=t.prev_length){i=t.strstart+t.lookahead-3,n=o._tr_tally(t,t.strstart-1-t.prev_match,t.prev_length-3),t.lookahead-=t.prev_length-1,t.prev_length-=2;do{++t.strstart<=i&&(t.ins_h=(t.ins_h<15&&(s=2,n-=16),o<1||o>9||8!==r||n<8||n>15||e<0||e>9||a<0||a>4)return m(t,c);8===n&&(n=9);var l=new S;return t.state=l,l.strm=t,l.wrap=s,l.gzhead=null,l.w_bits=n,l.w_size=1<t.pending_buf_size-5&&(r=t.pending_buf_size-5);;){if(t.lookahead<=1){if(k(t),0===t.lookahead&&0===e)return 1;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;var n=t.block_start+r;if((0===t.strstart||t.strstart>=n)&&(t.lookahead=t.strstart-n,t.strstart=n,y(t,!1),0===t.strm.avail_out))return 1;if(t.strstart-t.block_start>=t.w_size-h&&(y(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(y(t,!0),0===t.strm.avail_out?3:4):(t.strstart>t.block_start&&(y(t,!1),t.strm.avail_out),1)})),new T(4,4,8,4,A),new T(4,5,16,8,A),new T(4,6,32,32,A),new T(4,4,16,16,M),new T(8,16,32,32,M),new T(8,16,128,128,M),new T(8,32,128,256,M),new T(32,128,258,1024,M),new T(32,258,258,4096,M)],e.deflateInit=function(t,e){return L(t,e,8,15,8,0)},e.deflateInit2=L,e.deflateReset=E,e.deflateResetKeep=C,e.deflateSetHeader=function(t,e){return t&&t.state?2!==t.state.wrap?c:(t.state.gzhead=e,0):c},e.deflate=function(t,e){var r,i,a,l;if(!t||!t.state||e>5||e<0)return t?m(t,c):c;if(i=t.state,!t.output||!t.input&&0!==t.avail_in||i.status===p&&4!==e)return m(t,0===t.avail_out?-5:c);if(i.strm=t,r=i.last_flush,i.last_flush=e,42===i.status)if(2===i.wrap)t.adler=0,x(i,31),x(i,139),x(i,8),i.gzhead?(x(i,(i.gzhead.text?1:0)+(i.gzhead.hcrc?2:0)+(i.gzhead.extra?4:0)+(i.gzhead.name?8:0)+(i.gzhead.comment?16:0)),x(i,255&i.gzhead.time),x(i,i.gzhead.time>>8&255),x(i,i.gzhead.time>>16&255),x(i,i.gzhead.time>>24&255),x(i,9===i.level?2:i.strategy>=2||i.level<2?4:0),x(i,255&i.gzhead.os),i.gzhead.extra&&i.gzhead.extra.length&&(x(i,255&i.gzhead.extra.length),x(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(t.adler=s(t.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=69):(x(i,0),x(i,0),x(i,0),x(i,0),x(i,0),x(i,9===i.level?2:i.strategy>=2||i.level<2?4:0),x(i,3),i.status=f);else{var h=8+(i.w_bits-8<<4)<<8;h|=(i.strategy>=2||i.level<2?0:i.level<6?1:6===i.level?2:3)<<6,0!==i.strstart&&(h|=32),h+=31-h%31,i.status=f,_(i,h),0!==i.strstart&&(_(i,t.adler>>>16),_(i,65535&t.adler)),t.adler=1}if(69===i.status)if(i.gzhead.extra){for(a=i.pending;i.gzindex<(65535&i.gzhead.extra.length)&&(i.pending!==i.pending_buf_size||(i.gzhead.hcrc&&i.pending>a&&(t.adler=s(t.adler,i.pending_buf,i.pending-a,a)),b(t),a=i.pending,i.pending!==i.pending_buf_size));)x(i,255&i.gzhead.extra[i.gzindex]),i.gzindex++;i.gzhead.hcrc&&i.pending>a&&(t.adler=s(t.adler,i.pending_buf,i.pending-a,a)),i.gzindex===i.gzhead.extra.length&&(i.gzindex=0,i.status=73)}else i.status=73;if(73===i.status)if(i.gzhead.name){a=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>a&&(t.adler=s(t.adler,i.pending_buf,i.pending-a,a)),b(t),a=i.pending,i.pending===i.pending_buf_size)){l=1;break}l=i.gzindexa&&(t.adler=s(t.adler,i.pending_buf,i.pending-a,a)),0===l&&(i.gzindex=0,i.status=91)}else i.status=91;if(91===i.status)if(i.gzhead.comment){a=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>a&&(t.adler=s(t.adler,i.pending_buf,i.pending-a,a)),b(t),a=i.pending,i.pending===i.pending_buf_size)){l=1;break}l=i.gzindexa&&(t.adler=s(t.adler,i.pending_buf,i.pending-a,a)),0===l&&(i.status=d)}else i.status=d;if(i.status===d&&(i.gzhead.hcrc?(i.pending+2>i.pending_buf_size&&b(t),i.pending+2<=i.pending_buf_size&&(x(i,255&t.adler),x(i,t.adler>>8&255),t.adler=0,i.status=f)):i.status=f),0!==i.pending){if(b(t),0===t.avail_out)return i.last_flush=-1,0}else if(0===t.avail_in&&g(e)<=g(r)&&4!==e)return m(t,-5);if(i.status===p&&0!==t.avail_in)return m(t,-5);if(0!==t.avail_in||0!==i.lookahead||0!==e&&i.status!==p){var w=2===i.strategy?function(t,e){for(var r;;){if(0===t.lookahead&&(k(t),0===t.lookahead)){if(0===e)return 1;break}if(t.match_length=0,r=o._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,r&&(y(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(y(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(y(t,!1),0===t.strm.avail_out)?1:2}(i,e):3===i.strategy?function(t,e){for(var r,n,i,a,s=t.window;;){if(t.lookahead<=u){if(k(t),t.lookahead<=u&&0===e)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=3&&t.strstart>0&&(n=s[i=t.strstart-1])===s[++i]&&n===s[++i]&&n===s[++i]){a=t.strstart+u;do{}while(n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&it.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=3?(r=o._tr_tally(t,1,t.match_length-3),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(r=o._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),r&&(y(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(y(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(y(t,!1),0===t.strm.avail_out)?1:2}(i,e):n[i.level].func(i,e);if(3!==w&&4!==w||(i.status=p),1===w||3===w)return 0===t.avail_out&&(i.last_flush=-1),0;if(2===w&&(1===e?o._tr_align(i):5!==e&&(o._tr_stored_block(i,0,0,!1),3===e&&(v(i.head),0===i.lookahead&&(i.strstart=0,i.block_start=0,i.insert=0))),b(t),0===t.avail_out))return i.last_flush=-1,0}return 4!==e?0:i.wrap<=0?1:(2===i.wrap?(x(i,255&t.adler),x(i,t.adler>>8&255),x(i,t.adler>>16&255),x(i,t.adler>>24&255),x(i,255&t.total_in),x(i,t.total_in>>8&255),x(i,t.total_in>>16&255),x(i,t.total_in>>24&255)):(_(i,t.adler>>>16),_(i,65535&t.adler)),b(t),i.wrap>0&&(i.wrap=-i.wrap),0!==i.pending?0:1)},e.deflateEnd=function(t){var e;return t&&t.state?42!==(e=t.state.status)&&69!==e&&73!==e&&91!==e&&e!==d&&e!==f&&e!==p?m(t,c):(t.state=null,e===f?m(t,-3):0):c},e.deflateSetDictionary=function(t,e){var r,n,o,s,l,u,h,d,f=e.length;if(!t||!t.state)return c;if(2===(s=(r=t.state).wrap)||1===s&&42!==r.status||r.lookahead)return c;for(1===s&&(t.adler=a(t.adler,e,f,0)),r.wrap=0,f>=r.w_size&&(0===s&&(v(r.head),r.strstart=0,r.block_start=0,r.insert=0),d=new i.Buf8(r.w_size),i.arraySet(d,e,f-r.w_size,r.w_size,0),e=d,f=r.w_size),l=t.avail_in,u=t.next_in,h=t.input,t.avail_in=f,t.next_in=0,t.input=e,k(r);r.lookahead>=3;){n=r.strstart,o=r.lookahead-2;do{r.ins_h=(r.ins_h<{"use strict";t.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},"./node_modules/upng-js/node_modules/pako/lib/zlib/inffast.js":t=>{"use strict";t.exports=function(t,e){var r,n,i,o,a,s,l,c,u,h,d,f,p,m,g,v,b,y,x,_,w,k,A,M,T;r=t.state,n=t.next_in,M=t.input,i=n+(t.avail_in-5),o=t.next_out,T=t.output,a=o-(e-t.avail_out),s=o+(t.avail_out-257),l=r.dmax,c=r.wsize,u=r.whave,h=r.wnext,d=r.window,f=r.hold,p=r.bits,m=r.lencode,g=r.distcode,v=(1<>>=x=y>>>24,p-=x,0==(x=y>>>16&255))T[o++]=65535&y;else{if(!(16&x)){if(64&x){if(32&x){r.mode=12;break t}t.msg="invalid literal/length code",r.mode=30;break t}y=m[(65535&y)+(f&(1<>>=x,p-=x),p<15&&(f+=M[n++]<>>=x=y>>>24,p-=x,16&(x=y>>>16&255)){if(w=65535&y,p<(x&=15)&&(f+=M[n++]<l){t.msg="invalid distance too far back",r.mode=30;break t}if(f>>>=x,p-=x,w>(x=o-a)){if((x=w-x)>u&&r.sane){t.msg="invalid distance too far back",r.mode=30;break t}if(k=0,A=d,0===h){if(k+=c-x,x<_){_-=x;do{T[o++]=d[k++]}while(--x);k=o-w,A=T}}else if(h2;)T[o++]=A[k++],T[o++]=A[k++],T[o++]=A[k++],_-=3;_&&(T[o++]=A[k++],_>1&&(T[o++]=A[k++]))}else{k=o-w;do{T[o++]=T[k++],T[o++]=T[k++],T[o++]=T[k++],_-=3}while(_>2);_&&(T[o++]=T[k++],_>1&&(T[o++]=T[k++]))}break}if(64&x){t.msg="invalid distance code",r.mode=30;break t}y=g[(65535&y)+(f&(1<>3,f&=(1<<(p-=_<<3))-1,t.next_in=n,t.next_out=o,t.avail_in=n{"use strict";var n=r("./node_modules/upng-js/node_modules/pako/lib/utils/common.js"),i=r("./node_modules/upng-js/node_modules/pako/lib/zlib/adler32.js"),o=r("./node_modules/upng-js/node_modules/pako/lib/zlib/crc32.js"),a=r("./node_modules/upng-js/node_modules/pako/lib/zlib/inffast.js"),s=r("./node_modules/upng-js/node_modules/pako/lib/zlib/inftrees.js"),l=-2,c=12,u=30;function h(t){return(t>>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24)}function d(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new n.Buf16(320),this.work=new n.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function f(t){var e;return t&&t.state?(e=t.state,t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=1&e.wrap),e.mode=1,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new n.Buf32(852),e.distcode=e.distdyn=new n.Buf32(592),e.sane=1,e.back=-1,0):l}function p(t){var e;return t&&t.state?((e=t.state).wsize=0,e.whave=0,e.wnext=0,f(t)):l}function m(t,e){var r,n;return t&&t.state?(n=t.state,e<0?(r=0,e=-e):(r=1+(e>>4),e<48&&(e&=15)),e&&(e<8||e>15)?l:(null!==n.window&&n.wbits!==e&&(n.window=null),n.wrap=r,n.wbits=e,p(t))):l}function g(t,e){var r,n;return t?(n=new d,t.state=n,n.window=null,0!==(r=m(t,e))&&(t.state=null),r):l}var v,b,y=!0;function x(t){if(y){var e;for(v=new n.Buf32(512),b=new n.Buf32(32),e=0;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(s(1,t.lens,0,288,v,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;s(2,t.lens,0,32,b,0,t.work,{bits:5}),y=!1}t.lencode=v,t.lenbits=9,t.distcode=b,t.distbits=5}function _(t,e,r,i){var o,a=t.state;return null===a.window&&(a.wsize=1<=a.wsize?(n.arraySet(a.window,e,r-a.wsize,a.wsize,0),a.wnext=0,a.whave=a.wsize):((o=a.wsize-a.wnext)>i&&(o=i),n.arraySet(a.window,e,r-i,o,a.wnext),(i-=o)?(n.arraySet(a.window,e,r-i,i,0),a.wnext=i,a.whave=a.wsize):(a.wnext+=o,a.wnext===a.wsize&&(a.wnext=0),a.whave>>8&255,r.check=o(r.check,j,2,0),b=0,y=0,r.mode=2;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&b)<<8)+(b>>8))%31){t.msg="incorrect header check",r.mode=u;break}if(8!=(15&b)){t.msg="unknown compression method",r.mode=u;break}if(y-=4,D=8+(15&(b>>>=4)),0===r.wbits)r.wbits=D;else if(D>r.wbits){t.msg="invalid window size",r.mode=u;break}r.dmax=1<>8&1),512&r.flags&&(j[0]=255&b,j[1]=b>>>8&255,r.check=o(r.check,j,2,0)),b=0,y=0,r.mode=3;case 3:for(;y<32;){if(0===g)break t;g--,b+=d[p++]<>>8&255,j[2]=b>>>16&255,j[3]=b>>>24&255,r.check=o(r.check,j,4,0)),b=0,y=0,r.mode=4;case 4:for(;y<16;){if(0===g)break t;g--,b+=d[p++]<>8),512&r.flags&&(j[0]=255&b,j[1]=b>>>8&255,r.check=o(r.check,j,2,0)),b=0,y=0,r.mode=5;case 5:if(1024&r.flags){for(;y<16;){if(0===g)break t;g--,b+=d[p++]<>>8&255,r.check=o(r.check,j,2,0)),b=0,y=0}else r.head&&(r.head.extra=null);r.mode=6;case 6:if(1024&r.flags&&((A=r.length)>g&&(A=g),A&&(r.head&&(D=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),n.arraySet(r.head.extra,d,p,A,D)),512&r.flags&&(r.check=o(r.check,d,A,p)),g-=A,p+=A,r.length-=A),r.length))break t;r.length=0,r.mode=7;case 7:if(2048&r.flags){if(0===g)break t;A=0;do{D=d[p+A++],r.head&&D&&r.length<65536&&(r.head.name+=String.fromCharCode(D))}while(D&&A>9&1,r.head.done=!0),t.adler=r.check=0,r.mode=c;break;case 10:for(;y<32;){if(0===g)break t;g--,b+=d[p++]<>>=7&y,y-=7&y,r.mode=27;break}for(;y<3;){if(0===g)break t;g--,b+=d[p++]<>>=1)){case 0:r.mode=14;break;case 1:if(x(r),r.mode=20,6===e){b>>>=2,y-=2;break t}break;case 2:r.mode=17;break;case 3:t.msg="invalid block type",r.mode=u}b>>>=2,y-=2;break;case 14:for(b>>>=7&y,y-=7&y;y<32;){if(0===g)break t;g--,b+=d[p++]<>>16^65535)){t.msg="invalid stored block lengths",r.mode=u;break}if(r.length=65535&b,b=0,y=0,r.mode=15,6===e)break t;case 15:r.mode=16;case 16:if(A=r.length){if(A>g&&(A=g),A>v&&(A=v),0===A)break t;n.arraySet(f,d,p,A,m),g-=A,p+=A,v-=A,m+=A,r.length-=A;break}r.mode=c;break;case 17:for(;y<14;){if(0===g)break t;g--,b+=d[p++]<>>=5,y-=5,r.ndist=1+(31&b),b>>>=5,y-=5,r.ncode=4+(15&b),b>>>=4,y-=4,r.nlen>286||r.ndist>30){t.msg="too many length or distance symbols",r.mode=u;break}r.have=0,r.mode=18;case 18:for(;r.have>>=3,y-=3}for(;r.have<19;)r.lens[N[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,F={bits:r.lenbits},I=s(0,r.lens,0,19,r.lencode,0,r.work,F),r.lenbits=F.bits,I){t.msg="invalid code lengths set",r.mode=u;break}r.have=0,r.mode=19;case 19:for(;r.have>>16&255,E=65535&P,!((S=P>>>24)<=y);){if(0===g)break t;g--,b+=d[p++]<>>=S,y-=S,r.lens[r.have++]=E;else{if(16===E){for(R=S+2;y>>=S,y-=S,0===r.have){t.msg="invalid bit length repeat",r.mode=u;break}D=r.lens[r.have-1],A=3+(3&b),b>>>=2,y-=2}else if(17===E){for(R=S+3;y>>=S)),b>>>=3,y-=3}else{for(R=S+7;y>>=S)),b>>>=7,y-=7}if(r.have+A>r.nlen+r.ndist){t.msg="invalid bit length repeat",r.mode=u;break}for(;A--;)r.lens[r.have++]=D}}if(r.mode===u)break;if(0===r.lens[256]){t.msg="invalid code -- missing end-of-block",r.mode=u;break}if(r.lenbits=9,F={bits:r.lenbits},I=s(1,r.lens,0,r.nlen,r.lencode,0,r.work,F),r.lenbits=F.bits,I){t.msg="invalid literal/lengths set",r.mode=u;break}if(r.distbits=6,r.distcode=r.distdyn,F={bits:r.distbits},I=s(2,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,F),r.distbits=F.bits,I){t.msg="invalid distances set",r.mode=u;break}if(r.mode=20,6===e)break t;case 20:r.mode=21;case 21:if(g>=6&&v>=258){t.next_out=m,t.avail_out=v,t.next_in=p,t.avail_in=g,r.hold=b,r.bits=y,a(t,k),m=t.next_out,f=t.output,v=t.avail_out,p=t.next_in,d=t.input,g=t.avail_in,b=r.hold,y=r.bits,r.mode===c&&(r.back=-1);break}for(r.back=0;C=(P=r.lencode[b&(1<>>16&255,E=65535&P,!((S=P>>>24)<=y);){if(0===g)break t;g--,b+=d[p++]<>L)])>>>16&255,E=65535&P,!(L+(S=P>>>24)<=y);){if(0===g)break t;g--,b+=d[p++]<>>=L,y-=L,r.back+=L}if(b>>>=S,y-=S,r.back+=S,r.length=E,0===C){r.mode=26;break}if(32&C){r.back=-1,r.mode=c;break}if(64&C){t.msg="invalid literal/length code",r.mode=u;break}r.extra=15&C,r.mode=22;case 22:if(r.extra){for(R=r.extra;y>>=r.extra,y-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=23;case 23:for(;C=(P=r.distcode[b&(1<>>16&255,E=65535&P,!((S=P>>>24)<=y);){if(0===g)break t;g--,b+=d[p++]<>L)])>>>16&255,E=65535&P,!(L+(S=P>>>24)<=y);){if(0===g)break t;g--,b+=d[p++]<>>=L,y-=L,r.back+=L}if(b>>>=S,y-=S,r.back+=S,64&C){t.msg="invalid distance code",r.mode=u;break}r.offset=E,r.extra=15&C,r.mode=24;case 24:if(r.extra){for(R=r.extra;y>>=r.extra,y-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){t.msg="invalid distance too far back",r.mode=u;break}r.mode=25;case 25:if(0===v)break t;if(A=k-v,r.offset>A){if((A=r.offset-A)>r.whave&&r.sane){t.msg="invalid distance too far back",r.mode=u;break}A>r.wnext?(A-=r.wnext,M=r.wsize-A):M=r.wnext-A,A>r.length&&(A=r.length),T=r.window}else T=f,M=m-r.offset,A=r.length;A>v&&(A=v),v-=A,r.length-=A;do{f[m++]=T[M++]}while(--A);0===r.length&&(r.mode=21);break;case 26:if(0===v)break t;f[m++]=r.length,v--,r.mode=21;break;case 27:if(r.wrap){for(;y<32;){if(0===g)break t;g--,b|=d[p++]<{"use strict";var n=r("./node_modules/upng-js/node_modules/pako/lib/utils/common.js"),i=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],o=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],a=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],s=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];t.exports=function(t,e,r,l,c,u,h,d){var f,p,m,g,v,b,y,x,_,w=d.bits,k=0,A=0,M=0,T=0,S=0,C=0,E=0,L=0,z=0,O=0,D=null,I=0,F=new n.Buf16(16),R=new n.Buf16(16),P=null,j=0;for(k=0;k<=15;k++)F[k]=0;for(A=0;A=1&&0===F[T];T--);if(S>T&&(S=T),0===T)return c[u++]=20971520,c[u++]=20971520,d.bits=1,0;for(M=1;M0&&(0===t||1!==T))return-1;for(R[1]=0,k=1;k<15;k++)R[k+1]=R[k]+F[k];for(A=0;A852||2===t&&z>592)return 1;for(;;){y=k-E,h[A]b?(x=P[j+h[A]],_=D[I+h[A]]):(x=96,_=0),f=1<>E)+(p-=f)]=y<<24|x<<16|_}while(0!==p);for(f=1<>=1;if(0!==f?(O&=f-1,O+=f):O=0,A++,0==--F[k]){if(k===T)break;k=e[r+h[A]]}if(k>S&&(O&g)!==m){for(0===E&&(E=S),v+=M,L=1<<(C=k-E);C+E852||2===t&&z>592)return 1;c[m=O&g]=S<<24|C<<16|v-u}}return 0!==O&&(c[v+O]=k-E<<24|64<<16),d.bits=S,0}},"./node_modules/upng-js/node_modules/pako/lib/zlib/messages.js":t=>{"use strict";t.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},"./node_modules/upng-js/node_modules/pako/lib/zlib/trees.js":(t,e,r)=>{"use strict";var n=r("./node_modules/upng-js/node_modules/pako/lib/utils/common.js");function i(t){for(var e=t.length;--e>=0;)t[e]=0}var o=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],a=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],s=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],l=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],c=new Array(576);i(c);var u=new Array(60);i(u);var h=new Array(512);i(h);var d=new Array(256);i(d);var f=new Array(29);i(f);var p,m,g,v=new Array(30);function b(t,e,r,n,i){this.static_tree=t,this.extra_bits=e,this.extra_base=r,this.elems=n,this.max_length=i,this.has_stree=t&&t.length}function y(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}function x(t){return t<256?h[t]:h[256+(t>>>7)]}function _(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255}function w(t,e,r){t.bi_valid>16-r?(t.bi_buf|=e<>16-t.bi_valid,t.bi_valid+=r-16):(t.bi_buf|=e<>>=1,r<<=1}while(--e>0);return r>>>1}function M(t,e,r){var n,i,o=new Array(16),a=0;for(n=1;n<=15;n++)o[n]=a=a+r[n-1]<<1;for(i=0;i<=e;i++){var s=t[2*i+1];0!==s&&(t[2*i]=A(o[s]++,s))}}function T(t){var e;for(e=0;e<286;e++)t.dyn_ltree[2*e]=0;for(e=0;e<30;e++)t.dyn_dtree[2*e]=0;for(e=0;e<19;e++)t.bl_tree[2*e]=0;t.dyn_ltree[512]=1,t.opt_len=t.static_len=0,t.last_lit=t.matches=0}function S(t){t.bi_valid>8?_(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0}function C(t,e,r,n){var i=2*e,o=2*r;return t[i]>1;r>=1;r--)E(t,o,r);i=l;do{r=t.heap[1],t.heap[1]=t.heap[t.heap_len--],E(t,o,1),n=t.heap[1],t.heap[--t.heap_max]=r,t.heap[--t.heap_max]=n,o[2*i]=o[2*r]+o[2*n],t.depth[i]=(t.depth[r]>=t.depth[n]?t.depth[r]:t.depth[n])+1,o[2*r+1]=o[2*n+1]=i,t.heap[1]=i++,E(t,o,1)}while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],function(t,e){var r,n,i,o,a,s,l=e.dyn_tree,c=e.max_code,u=e.stat_desc.static_tree,h=e.stat_desc.has_stree,d=e.stat_desc.extra_bits,f=e.stat_desc.extra_base,p=e.stat_desc.max_length,m=0;for(o=0;o<=15;o++)t.bl_count[o]=0;for(l[2*t.heap[t.heap_max]+1]=0,r=t.heap_max+1;r<573;r++)(o=l[2*l[2*(n=t.heap[r])+1]+1]+1)>p&&(o=p,m++),l[2*n+1]=o,n>c||(t.bl_count[o]++,a=0,n>=f&&(a=d[n-f]),s=l[2*n],t.opt_len+=s*(o+a),h&&(t.static_len+=s*(u[2*n+1]+a)));if(0!==m){do{for(o=p-1;0===t.bl_count[o];)o--;t.bl_count[o]--,t.bl_count[o+1]+=2,t.bl_count[p]--,m-=2}while(m>0);for(o=p;0!==o;o--)for(n=t.bl_count[o];0!==n;)(i=t.heap[--r])>c||(l[2*i+1]!==o&&(t.opt_len+=(o-l[2*i+1])*l[2*i],l[2*i+1]=o),n--)}}(t,e),M(o,c,t.bl_count)}function O(t,e,r){var n,i,o=-1,a=e[1],s=0,l=7,c=4;for(0===a&&(l=138,c=3),e[2*(r+1)+1]=65535,n=0;n<=r;n++)i=a,a=e[2*(n+1)+1],++s>=7;n<30;n++)for(v[n]=i<<7,t=0;t<1<0?(2===t.strm.data_type&&(t.strm.data_type=function(t){var e,r=4093624447;for(e=0;e<=31;e++,r>>>=1)if(1&r&&0!==t.dyn_ltree[2*e])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(e=32;e<256;e++)if(0!==t.dyn_ltree[2*e])return 1;return 0}(t)),z(t,t.l_desc),z(t,t.d_desc),a=function(t){var e;for(O(t,t.dyn_ltree,t.l_desc.max_code),O(t,t.dyn_dtree,t.d_desc.max_code),z(t,t.bl_desc),e=18;e>=3&&0===t.bl_tree[2*l[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e}(t),i=t.opt_len+3+7>>>3,(o=t.static_len+3+7>>>3)<=i&&(i=o)):i=o=r+5,r+4<=i&&-1!==e?F(t,e,r,n):4===t.strategy||o===i?(w(t,2+(n?1:0),3),L(t,c,u)):(w(t,4+(n?1:0),3),function(t,e,r,n){var i;for(w(t,e-257,5),w(t,r-1,5),w(t,n-4,4),i=0;i>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&r,t.last_lit++,0===e?t.dyn_ltree[2*r]++:(t.matches++,e--,t.dyn_ltree[2*(d[r]+256+1)]++,t.dyn_dtree[2*x(e)]++),t.last_lit===t.lit_bufsize-1},e._tr_align=function(t){w(t,2,3),k(t,256,c),function(t){16===t.bi_valid?(_(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}(t)}},"./node_modules/upng-js/node_modules/pako/lib/zlib/zstream.js":t=>{"use strict";t.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},"./src/SurfaceWorker.js":()=>{$3Dmol.workerString=function(){self.onmessage=function(t){var e=t.data,r=e.type;if(r<0)self.atomData=e.atoms,self.volume=e.volume,self.ps=new ProteinSurface;else{var n=self.ps;n.initparm(e.expandedExtent,1!=r,self.volume),n.fillvoxels(self.atomData,e.extendedAtoms),n.buildboundary(),4!==r&&2!==r||(n.fastdistancemap(),n.boundingatom(!1),n.fillvoxelswaals(self.atomData,e.extendedAtoms)),n.marchingcube(r);var i=n.getFacesAndVertices(e.atomsToShow);self.postMessage(i)}}}.toString().replace(/(^.*?\{|\}$)/g,""),$3Dmol.workerString+=";\nfunction _classCallCheck() {};",$3Dmol.workerString+=";\n"+$3Dmol.Vector3.toString(),$3Dmol.workerString+=";\n"+$3Dmol.MarchingCubeInitializer.toString()+";\n\n",$3Dmol.workerString+=";\n"+$3Dmol.PointGrid.toString()+";\n",$3Dmol.workerString+=";\nvar ProteinSurface = "+$3Dmol.ProteinSurface.toString()+";\n",$3Dmol.SurfaceWorker=window.URL?window.URL.createObjectURL(new Blob([$3Dmol.workerString],{type:"text/javascript"})):void 0},"./src/exporter.js":t=>{"object"==typeof t.exports&&(t.exports=window.$3Dmol)},"./src/vendor/mmtf.js":function(t,e){!function(t){"use strict";function e(t,e,r){for(var n=(t.byteLength,0),i=r.length;i>n;n++){var o=r.charCodeAt(n);if(128>o)t.setUint8(e++,o>>>0&127);else if(2048>o)t.setUint8(e++,o>>>6&31|192),t.setUint8(e++,o>>>0&63|128);else if(65536>o)t.setUint8(e++,o>>>12&15|224),t.setUint8(e++,o>>>6&63|128),t.setUint8(e++,o>>>0&63|128);else{if(!(1114112>o))throw new Error("bad codepoint "+o);t.setUint8(e++,o>>>18&7|240),t.setUint8(e++,o>>>12&63|128),t.setUint8(e++,o>>>6&63|128),t.setUint8(e++,o>>>0&63|128)}}}function r(t){for(var e=0,r=0,n=t.length;n>r;r++){var i=t.charCodeAt(r);if(128>i)e+=1;else if(2048>i)e+=2;else if(65536>i)e+=3;else{if(!(1114112>i))throw new Error("bad codepoint "+i);e+=4}}return e}function n(t,i,o){var a=typeof t;if("string"===a){if(32>(s=r(t)))return i.setUint8(o,160|s),e(i,o+1,t),1+s;if(256>s)return i.setUint8(o,217),i.setUint8(o+1,s),e(i,o+2,t),2+s;if(65536>s)return i.setUint8(o,218),i.setUint16(o+1,s),e(i,o+3,t),3+s;if(4294967296>s)return i.setUint8(o,219),i.setUint32(o+1,s),e(i,o+5,t),5+s}if(t instanceof Uint8Array){var s=t.byteLength,l=new Uint8Array(i.buffer);if(256>s)return i.setUint8(o,196),i.setUint8(o+1,s),l.set(t,o+2),2+s;if(65536>s)return i.setUint8(o,197),i.setUint16(o+1,s),l.set(t,o+3),3+s;if(4294967296>s)return i.setUint8(o,198),i.setUint32(o+1,s),l.set(t,o+5),5+s}if("number"===a){if(!isFinite(t))throw new Error("Number not finite: "+t);if(Math.floor(t)!==t)return i.setUint8(o,203),i.setFloat64(o+1,t),9;if(t>=0){if(128>t)return i.setUint8(o,t),1;if(256>t)return i.setUint8(o,204),i.setUint8(o+1,t),2;if(65536>t)return i.setUint8(o,205),i.setUint16(o+1,t),3;if(4294967296>t)return i.setUint8(o,206),i.setUint32(o+1,t),5;throw new Error("Number too big 0x"+t.toString(16))}if(t>=-32)return i.setInt8(o,t),1;if(t>=-128)return i.setUint8(o,208),i.setInt8(o+1,t),2;if(t>=-32768)return i.setUint8(o,209),i.setInt16(o+1,t),3;if(t>=-2147483648)return i.setUint8(o,210),i.setInt32(o+1,t),5;throw new Error("Number too small -0x"+(-t).toString(16).substr(1))}if(null===t)return i.setUint8(o,192),1;if("boolean"===a)return i.setUint8(o,t?195:194),1;if("object"===a){var c=0,u=Array.isArray(t);if(u)s=t.length;else{var h=Object.keys(t);s=h.length}if(16>s?(i.setUint8(o,s|(u?144:128)),c=1):65536>s?(i.setUint8(o,u?220:222),i.setUint16(o+1,s),c=3):4294967296>s&&(i.setUint8(o,u?221:223),i.setUint32(o+1,s),c=5),u)for(var d=0;s>d;d++)c+=n(t[d],i,o+c);else for(d=0;s>d;d++){var f=h[d];c+=n(f,i,o+c),c+=n(t[f],i,o+c)}return c}throw new Error("Unknown type "+a)}function i(t){var e=typeof t;if("string"===e){if(32>(n=r(t)))return 1+n;if(256>n)return 2+n;if(65536>n)return 3+n;if(4294967296>n)return 5+n}if(t instanceof Uint8Array){if(256>(n=t.byteLength))return 2+n;if(65536>n)return 3+n;if(4294967296>n)return 5+n}if("number"===e){if(Math.floor(t)!==t)return 9;if(t>=0){if(128>t)return 1;if(256>t)return 2;if(65536>t)return 3;if(4294967296>t)return 5;throw new Error("Number too big 0x"+t.toString(16))}if(t>=-32)return 1;if(t>=-128)return 2;if(t>=-32768)return 3;if(t>=-2147483648)return 5;throw new Error("Number too small -0x"+t.toString(16).substr(1))}if("boolean"===e||null===t)return 1;if("object"===e){var n,o=0;if(Array.isArray(t)){n=t.length;for(var a=0;n>a;a++)o+=i(t[a])}else{var s=Object.keys(t);for(n=s.length,a=0;n>a;a++){var l=s[a];o+=i(l)+i(t[l])}}if(16>n)return 1+o;if(65536>n)return 3+o;if(4294967296>n)return 5+o;throw new Error("Array or object too long 0x"+n.toString(16))}throw new Error("Unknown type "+e)}function o(t){var e=new ArrayBuffer(i(t));return n(t,new DataView(e),0),new Uint8Array(e)}function a(t,e,r){return e?new t(e.buffer,e.byteOffset,e.byteLength/(r||1)):void 0}function s(t){return a(DataView,t)}function l(t){return a(Uint8Array,t)}function c(t){return a(Int8Array,t)}function u(t){return a(Int32Array,t,4)}function h(t,e){var r=t.length/2;e||(e=new Int16Array(r));for(var n=0,i=0;r>n;++n,i+=2)e[n]=t[i]<<8^t[i+1];return e}function d(t,e){var r=t.length/4;e||(e=new Int32Array(r));for(var n=0,i=0;r>n;++n,i+=4)e[n]=t[i]<<24^t[i+1]<<16^t[i+2]<<8^t[i+3];return e}function f(t,e){var r=t.length;e||(e=new Uint8Array(4*r));for(var n=s(e),i=0;r>i;++i)n.setInt32(4*i,t[i]);return l(e)}function p(t,e,r){var n=t.length,i=1/e;r||(r=new Float32Array(n));for(var o=0;n>o;++o)r[o]=t[o]*i;return r}function m(t,e,r){var n=t.length;r||(r=new Int32Array(n));for(var i=0;n>i;++i)r[i]=Math.round(t[i]*e);return r}function g(t,e){var r,n;if(!e){var i=0;for(r=0,n=t.length;n>r;r+=2)i+=t[r+1];e=new t.constructor(i)}var o=0;for(r=0,n=t.length;n>r;r+=2)for(var a=t[r],s=t[r+1],l=0;s>l;++l)e[o]=a,++o;return e}function v(t){if(0===t.length)return new Int32Array;var e,r,n=2;for(e=1,r=t.length;r>e;++e)t[e-1]!==t[e]&&(n+=2);var i=new Int32Array(n),o=0,a=1;for(e=1,r=t.length;r>e;++e)t[e-1]!==t[e]?(i[o]=t[e-1],i[o+1]=a,a=1,o+=2):++a;return i[o]=t[t.length-1],i[o+1]=a,i}function b(t,e){var r=t.length;e||(e=new t.constructor(r)),r&&(e[0]=t[0]);for(var n=1;r>n;++n)e[n]=t[n]+e[n-1];return e}function y(t,e){var r=t.length;e||(e=new t.constructor(r)),e[0]=t[0];for(var n=1;r>n;++n)e[n]=t[n]-t[n-1];return e}function x(t,e){var r,n,i=t instanceof Int8Array?127:32767,o=-i-1,a=t.length;if(!e){var s=0;for(r=0;a>r;++r)t[r]o&&++s;e=new Int32Array(s)}for(r=0,n=0;a>r;){for(var l=0;t[r]===i||t[r]===o;)l+=t[r],++r;l+=t[r],++r,e[n]=l,++n}return e}function _(t,e,r){return p(x(t,u(r)),e,r)}function w(t,e,r){var n=x(t,u(r));return function(t,e,r){return p(b(t,u(r)),e,r)}(n,e,function(t){return a(Float32Array,t,4)}(n))}function k(t,e,r){return function(t,e){var r,n=e?127:32767,i=-n-1,o=t.length,a=0;for(r=0;o>r;++r)0===(c=t[r])?++a:c>0?(a+=Math.ceil(c/n),c%n==0&&(a+=1)):(a+=Math.ceil(c/i),c%i==0&&(a+=1));var s=e?new Int8Array(a):new Int16Array(a),l=0;for(r=0;o>r;++r){var c;if((c=t[r])>=0)for(;c>=n;)s[l]=n,++l,c-=n;else for(;i>=c;)s[l]=i,++l,c-=i;s[l]=c,++l}return s}(function(t,e,r){return y(m(t,e),r)}(t,e),r)}function A(t,e,r,n){var i=new ArrayBuffer(12+n.byteLength),o=new Uint8Array(i),a=new DataView(i);return a.setInt32(0,t),a.setInt32(4,e),r&&o.set(r,8),o.set(n,12),o}function M(t){return A(2,t.length,void 0,l(t))}function T(t){return A(4,t.length,void 0,f(t))}function S(t,e){return A(5,t.length/e,f([e]),l(t))}function C(t){return A(6,t.length,void 0,f(v(t)))}function E(t){return A(8,t.length,void 0,f(function(t){return v(y(t))}(t)))}function L(t,e){return A(9,t.length,f([e]),f(function(t,e){return v(m(t,e))}(t,e)))}function z(t,e){return A(10,t.length,f([e]),function(t,e){var r=t.length;e||(e=new Uint8Array(2*r));for(var n=s(e),i=0;r>i;++i)n.setInt16(2*i,t[i]);return l(e)}(k(t,e)))}function O(t){var e={};return N.forEach((function(r){void 0!==t[r]&&(e[r]=t[r])})),t.bondAtomList&&(e.bondAtomList=T(t.bondAtomList)),t.bondOrderList&&(e.bondOrderList=M(t.bondOrderList)),e.xCoordList=z(t.xCoordList,1e3),e.yCoordList=z(t.yCoordList,1e3),e.zCoordList=z(t.zCoordList,1e3),t.bFactorList&&(e.bFactorList=z(t.bFactorList,100)),t.atomIdList&&(e.atomIdList=E(t.atomIdList)),t.altLocList&&(e.altLocList=C(t.altLocList)),t.occupancyList&&(e.occupancyList=L(t.occupancyList,100)),e.groupIdList=E(t.groupIdList),e.groupTypeList=T(t.groupTypeList),t.secStructList&&(e.secStructList=M(t.secStructList)),t.insCodeList&&(e.insCodeList=C(t.insCodeList)),t.sequenceIndexList&&(e.sequenceIndexList=E(t.sequenceIndexList)),e.chainIdList=S(t.chainIdList,4),t.chainNameList&&(e.chainNameList=S(t.chainNameList,4)),e}function D(t){function e(t){for(var e={},r=0;t>r;r++)e[o()]=o();return e}function r(e){var r=t.subarray(a,a+e);return a+=e,r}function n(e){var r=t.subarray(a,a+e);a+=e;var n=65535;if(e>n){for(var i=[],o=0;or;r++)e[r]=o();return e}function o(){var o,l,c=t[a];if(!(128&c))return a++,c;if(128==(240&c))return a++,e(l=15&c);if(144==(240&c))return a++,i(l=15&c);if(160==(224&c))return a++,n(l=31&c);if(!(224&~c))return o=s.getInt8(a),a++,o;switch(c){case 192:return a++,null;case 194:return a++,!1;case 195:return a++,!0;case 196:return l=s.getUint8(a+1),a+=2,r(l);case 197:return l=s.getUint16(a+1),a+=3,r(l);case 198:return l=s.getUint32(a+1),a+=5,r(l);case 202:return o=s.getFloat32(a+1),a+=5,o;case 203:return o=s.getFloat64(a+1),a+=9,o;case 204:return o=t[a+1],a+=2,o;case 205:return o=s.getUint16(a+1),a+=3,o;case 206:return o=s.getUint32(a+1),a+=5,o;case 208:return o=s.getInt8(a+1),a+=2,o;case 209:return o=s.getInt16(a+1),a+=3,o;case 210:return o=s.getInt32(a+1),a+=5,o;case 217:return l=s.getUint8(a+1),a+=2,n(l);case 218:return l=s.getUint16(a+1),a+=3,n(l);case 219:return l=s.getUint32(a+1),a+=5,n(l);case 220:return l=s.getUint16(a+1),a+=3,i(l);case 221:return l=s.getUint32(a+1),a+=5,i(l);case 222:return l=s.getUint16(a+1),a+=3,e(l);case 223:return l=s.getUint32(a+1),a+=5,e(l)}throw new Error("Unknown type 0x"+c.toString(16))}var a=0,s=new DataView(t.buffer);return o()}function I(t,e,r,n){switch(t){case 1:return function(t,e){var r=t.length;e||(e=new Float32Array(r/4));for(var n=s(e),i=s(t),o=0,a=0,l=r/4;l>o;++o,a+=4)n.setFloat32(a,i.getFloat32(a),!0);return e}(e);case 2:return c(e);case 3:return h(e);case 4:return d(e);case 5:return l(e);case 6:return g(d(e),new Uint8Array(r));case 7:return g(d(e));case 8:return function(t,e){return b(g(t),e)}(d(e));case 9:return function(t,e,r){return p(g(t,u(r)),e,r)}(d(e),d(n)[0]);case 10:return w(h(e),d(n)[0]);case 11:return p(h(e),d(n)[0]);case 12:return _(h(e),d(n)[0]);case 13:return _(c(e),d(n)[0]);case 14:return x(h(e));case 15:return x(c(e))}}function F(t,e){var r=(e=e||{}).ignoreFields,n={};return B.forEach((function(e){var i=!!r&&-1!==r.indexOf(e),o=t[e];i||void 0===o||(o instanceof Uint8Array?n[e]=I.apply(null,function(t){var e=s(t),r=e.getInt32(0),n=e.getInt32(4),i=t.subarray(8,12);return[r,t=t.subarray(12),n,i]}(o)):n[e]=o)})),n}function R(t){return String.fromCharCode.apply(null,t).replace(/\0/g,"")}function P(t,e){return t instanceof ArrayBuffer&&(t=new Uint8Array(t)),F(t instanceof Uint8Array?D(t):t,e)}function j(t,e,r,n){var i=new XMLHttpRequest;i.addEventListener("load",(function(){try{var t=P(i.response);r(t)}catch(t){n(t)}}),!0),i.addEventListener("error",n,!0),i.responseType="arraybuffer",i.open("GET",e+t.toUpperCase()),i.send()}var N=["mmtfVersion","mmtfProducer","unitCell","spaceGroup","structureId","title","depositionDate","releaseDate","experimentalMethods","resolution","rFree","rWork","bioAssemblyList","ncsOperatorList","entityList","groupList","numBonds","numAtoms","numGroups","numChains","numModels","groupsPerChain","chainsPerModel"],B=N.concat(["xCoordList","yCoordList","zCoordList","groupIdList","groupTypeList","chainIdList","bFactorList","atomIdList","altLocList","occupancyList","secStructList","insCodeList","sequenceIndexList","chainNameList","bondAtomList","bondOrderList"]),U="//mmtf.rcsb.org/v1.0/",G=U+"full/",V=U+"reduced/";t.encode=function(t){return o(O(t))},t.decode=P,t.traverse=function(t,e,r){var n,i,o,a,s,l,c=(r=r||{}).firstModelOnly,u=e.onModel,h=e.onChain,d=e.onGroup,f=e.onAtom,p=e.onBond,m=0,g=0,v=0,b=0,y=0,x=-1,_=t.chainNameList,w=t.secStructList,k=t.insCodeList,A=t.sequenceIndexList,M=t.atomIdList,T=t.bFactorList,S=t.altLocList,C=t.occupancyList,E=t.bondAtomList,L=t.bondOrderList;for(n=0,i=t.chainsPerModel.length;i>n&&!(c&&m>0);++n){var z=t.chainsPerModel[m];for(u&&u({chainCount:z,modelIndex:m}),o=0;z>o;++o){var O=t.groupsPerChain[g];if(h){var D=R(t.chainIdList.subarray(4*g,4*g+4)),I=null;_&&(I=R(_.subarray(4*g,4*g+4))),h({groupCount:O,chainIndex:g,modelIndex:m,chainId:D,chainName:I})}for(a=0;O>a;++a){var F=t.groupList[t.groupTypeList[v]],P=F.atomNameList.length;if(d){var j=null;w&&(j=w[v]);var N=null;t.insCodeList&&(N=String.fromCharCode(k[v]));var B=null;A&&(B=A[v]),d({atomCount:P,groupIndex:v,chainIndex:g,modelIndex:m,groupId:t.groupIdList[v],groupType:t.groupTypeList[v],groupName:F.groupName,singleLetterCode:F.singleLetterCode,chemCompType:F.chemCompType,secStruct:j,insCode:N,sequenceIndex:B})}for(s=0;P>s;++s){if(f){var U=null;M&&(U=M[b]);var G=null;T&&(G=T[b]);var V=null;S&&(V=String.fromCharCode(S[b]));var H=null;C&&(H=C[b]),f({atomIndex:b,groupIndex:v,chainIndex:g,modelIndex:m,atomId:U,element:F.elementList[s],atomName:F.atomNameList[s],formalCharge:F.formalChargeList[s],xCoord:t.xCoordList[b],yCoord:t.yCoordList[b],zCoord:t.zCoordList[b],bFactor:G,altLoc:V,occupancy:H})}b+=1}if(p){var W=F.bondAtomList;for(s=0,l=F.bondOrderList.length;l>s;++s)p({atomIndex1:b-P+W[2*s],atomIndex2:b-P+W[2*s+1],bondOrder:F.bondOrderList[s]})}v+=1}g+=1}if(y=x+1,x=b-1,p&&E)for(s=0,l=E.length;l>s;s+=2){var q=E[s],Y=E[s+1];(q>=y&&x>=q||Y>=y&&x>=Y)&&p({atomIndex1:q,atomIndex2:Y,bondOrder:L?L[s/2]:null})}m+=1}},t.fetch=function(t,e,r){j(t,G,e,r)},t.fetchReduced=function(t,e,r){j(t,V,e,r)},t.version="v1.0.1",t.fetchUrl=G,t.fetchReducedUrl=V,t.encodeMsgpack=o,t.encodeMmtf=O,t.decodeMsgpack=D,t.decodeMmtf=F}(e)},"./node_modules/pako/dist/pako.esm.mjs":(t,e,r)=>{"use strict";function n(t){let e=t.length;for(;--e>=0;)t[e]=0}r.r(e),r.d(e,{Deflate:()=>wr,Inflate:()=>Tr,constants:()=>Lr,default:()=>zr,deflate:()=>kr,deflateRaw:()=>Ar,gzip:()=>Mr,inflate:()=>Sr,inflateRaw:()=>Cr,ungzip:()=>Er});const i=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),o=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),a=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),s=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),l=new Array(576);n(l);const c=new Array(60);n(c);const u=new Array(512);n(u);const h=new Array(256);n(h);const d=new Array(29);n(d);const f=new Array(30);function p(t,e,r,n,i){this.static_tree=t,this.extra_bits=e,this.extra_base=r,this.elems=n,this.max_length=i,this.has_stree=t&&t.length}let m,g,v;function b(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}n(f);const y=t=>t<256?u[t]:u[256+(t>>>7)],x=(t,e)=>{t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255},_=(t,e,r)=>{t.bi_valid>16-r?(t.bi_buf|=e<>16-t.bi_valid,t.bi_valid+=r-16):(t.bi_buf|=e<{_(t,r[2*e],r[2*e+1])},k=(t,e)=>{let r=0;do{r|=1&t,t>>>=1,r<<=1}while(--e>0);return r>>>1},A=(t,e,r)=>{const n=new Array(16);let i,o,a=0;for(i=1;i<=15;i++)a=a+r[i-1]<<1,n[i]=a;for(o=0;o<=e;o++){let e=t[2*o+1];0!==e&&(t[2*o]=k(n[e]++,e))}},M=t=>{let e;for(e=0;e<286;e++)t.dyn_ltree[2*e]=0;for(e=0;e<30;e++)t.dyn_dtree[2*e]=0;for(e=0;e<19;e++)t.bl_tree[2*e]=0;t.dyn_ltree[512]=1,t.opt_len=t.static_len=0,t.sym_next=t.matches=0},T=t=>{t.bi_valid>8?x(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0},S=(t,e,r,n)=>{const i=2*e,o=2*r;return t[i]{const n=t.heap[r];let i=r<<1;for(;i<=t.heap_len&&(i{let n,a,s,l,c=0;if(0!==t.sym_next)do{n=255&t.pending_buf[t.sym_buf+c++],n+=(255&t.pending_buf[t.sym_buf+c++])<<8,a=t.pending_buf[t.sym_buf+c++],0===n?w(t,a,e):(s=h[a],w(t,s+256+1,e),l=i[s],0!==l&&(a-=d[s],_(t,a,l)),n--,s=y(n),w(t,s,r),l=o[s],0!==l&&(n-=f[s],_(t,n,l)))}while(c{const r=e.dyn_tree,n=e.stat_desc.static_tree,i=e.stat_desc.has_stree,o=e.stat_desc.elems;let a,s,l,c=-1;for(t.heap_len=0,t.heap_max=573,a=0;a>1;a>=1;a--)C(t,r,a);l=o;do{a=t.heap[1],t.heap[1]=t.heap[t.heap_len--],C(t,r,1),s=t.heap[1],t.heap[--t.heap_max]=a,t.heap[--t.heap_max]=s,r[2*l]=r[2*a]+r[2*s],t.depth[l]=(t.depth[a]>=t.depth[s]?t.depth[a]:t.depth[s])+1,r[2*a+1]=r[2*s+1]=l,t.heap[1]=l++,C(t,r,1)}while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],((t,e)=>{const r=e.dyn_tree,n=e.max_code,i=e.stat_desc.static_tree,o=e.stat_desc.has_stree,a=e.stat_desc.extra_bits,s=e.stat_desc.extra_base,l=e.stat_desc.max_length;let c,u,h,d,f,p,m=0;for(d=0;d<=15;d++)t.bl_count[d]=0;for(r[2*t.heap[t.heap_max]+1]=0,c=t.heap_max+1;c<573;c++)u=t.heap[c],d=r[2*r[2*u+1]+1]+1,d>l&&(d=l,m++),r[2*u+1]=d,u>n||(t.bl_count[d]++,f=0,u>=s&&(f=a[u-s]),p=r[2*u],t.opt_len+=p*(d+f),o&&(t.static_len+=p*(i[2*u+1]+f)));if(0!==m){do{for(d=l-1;0===t.bl_count[d];)d--;t.bl_count[d]--,t.bl_count[d+1]+=2,t.bl_count[l]--,m-=2}while(m>0);for(d=l;0!==d;d--)for(u=t.bl_count[d];0!==u;)h=t.heap[--c],h>n||(r[2*h+1]!==d&&(t.opt_len+=(d-r[2*h+1])*r[2*h],r[2*h+1]=d),u--)}})(t,e),A(r,c,t.bl_count)},z=(t,e,r)=>{let n,i,o=-1,a=e[1],s=0,l=7,c=4;for(0===a&&(l=138,c=3),e[2*(r+1)+1]=65535,n=0;n<=r;n++)i=a,a=e[2*(n+1)+1],++s{let n,i,o=-1,a=e[1],s=0,l=7,c=4;for(0===a&&(l=138,c=3),n=0;n<=r;n++)if(i=a,a=e[2*(n+1)+1],!(++s{_(t,0+(n?1:0),3),T(t),x(t,r),x(t,~r),r&&t.pending_buf.set(t.window.subarray(e,e+r),t.pending),t.pending+=r};var F={_tr_init:t=>{D||((()=>{let t,e,r,n,s;const b=new Array(16);for(r=0,n=0;n<28;n++)for(d[n]=r,t=0;t<1<>=7;n<30;n++)for(f[n]=s<<7,t=0;t<1<{let i,o,a=0;t.level>0?(2===t.strm.data_type&&(t.strm.data_type=(t=>{let e,r=4093624447;for(e=0;e<=31;e++,r>>>=1)if(1&r&&0!==t.dyn_ltree[2*e])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(e=32;e<256;e++)if(0!==t.dyn_ltree[2*e])return 1;return 0})(t)),L(t,t.l_desc),L(t,t.d_desc),a=(t=>{let e;for(z(t,t.dyn_ltree,t.l_desc.max_code),z(t,t.dyn_dtree,t.d_desc.max_code),L(t,t.bl_desc),e=18;e>=3&&0===t.bl_tree[2*s[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e})(t),i=t.opt_len+3+7>>>3,o=t.static_len+3+7>>>3,o<=i&&(i=o)):i=o=r+5,r+4<=i&&-1!==e?I(t,e,r,n):4===t.strategy||o===i?(_(t,2+(n?1:0),3),E(t,l,c)):(_(t,4+(n?1:0),3),((t,e,r,n)=>{let i;for(_(t,e-257,5),_(t,r-1,5),_(t,n-4,4),i=0;i(t.pending_buf[t.sym_buf+t.sym_next++]=e,t.pending_buf[t.sym_buf+t.sym_next++]=e>>8,t.pending_buf[t.sym_buf+t.sym_next++]=r,0===e?t.dyn_ltree[2*r]++:(t.matches++,e--,t.dyn_ltree[2*(h[r]+256+1)]++,t.dyn_dtree[2*y(e)]++),t.sym_next===t.sym_end),_tr_align:t=>{_(t,2,3),w(t,256,l),(t=>{16===t.bi_valid?(x(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)})(t)}},R=(t,e,r,n)=>{let i=65535&t,o=t>>>16&65535,a=0;for(;0!==r;){a=r>2e3?2e3:r,r-=a;do{i=i+e[n++]|0,o=o+i|0}while(--a);i%=65521,o%=65521}return i|o<<16};const P=new Uint32Array((()=>{let t,e=[];for(var r=0;r<256;r++){t=r;for(var n=0;n<8;n++)t=1&t?3988292384^t>>>1:t>>>1;e[r]=t}return e})());var j=(t,e,r,n)=>{const i=P,o=n+r;t^=-1;for(let r=n;r>>8^i[255&(t^e[r])];return~t},N={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},B={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};const{_tr_init:U,_tr_stored_block:G,_tr_flush_block:V,_tr_tally:H,_tr_align:W}=F,{Z_NO_FLUSH:q,Z_PARTIAL_FLUSH:Y,Z_FULL_FLUSH:Z,Z_FINISH:X,Z_BLOCK:$,Z_OK:J,Z_STREAM_END:K,Z_STREAM_ERROR:Q,Z_DATA_ERROR:tt,Z_BUF_ERROR:et,Z_DEFAULT_COMPRESSION:rt,Z_FILTERED:nt,Z_HUFFMAN_ONLY:it,Z_RLE:ot,Z_FIXED:at,Z_DEFAULT_STRATEGY:st,Z_UNKNOWN:lt,Z_DEFLATED:ct}=B,ut=258,ht=262,dt=42,ft=113,pt=666,mt=(t,e)=>(t.msg=N[e],e),gt=t=>2*t-(t>4?9:0),vt=t=>{let e=t.length;for(;--e>=0;)t[e]=0},bt=t=>{let e,r,n,i=t.w_size;e=t.hash_size,n=e;do{r=t.head[--n],t.head[n]=r>=i?r-i:0}while(--e);e=i,n=e;do{r=t.prev[--n],t.prev[n]=r>=i?r-i:0}while(--e)};let yt=(t,e,r)=>(e<{const e=t.state;let r=e.pending;r>t.avail_out&&(r=t.avail_out),0!==r&&(t.output.set(e.pending_buf.subarray(e.pending_out,e.pending_out+r),t.next_out),t.next_out+=r,e.pending_out+=r,t.total_out+=r,t.avail_out-=r,e.pending-=r,0===e.pending&&(e.pending_out=0))},_t=(t,e)=>{V(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,xt(t.strm)},wt=(t,e)=>{t.pending_buf[t.pending++]=e},kt=(t,e)=>{t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e},At=(t,e,r,n)=>{let i=t.avail_in;return i>n&&(i=n),0===i?0:(t.avail_in-=i,e.set(t.input.subarray(t.next_in,t.next_in+i),r),1===t.state.wrap?t.adler=R(t.adler,e,i,r):2===t.state.wrap&&(t.adler=j(t.adler,e,i,r)),t.next_in+=i,t.total_in+=i,i)},Mt=(t,e)=>{let r,n,i=t.max_chain_length,o=t.strstart,a=t.prev_length,s=t.nice_match;const l=t.strstart>t.w_size-ht?t.strstart-(t.w_size-ht):0,c=t.window,u=t.w_mask,h=t.prev,d=t.strstart+ut;let f=c[o+a-1],p=c[o+a];t.prev_length>=t.good_match&&(i>>=2),s>t.lookahead&&(s=t.lookahead);do{if(r=e,c[r+a]===p&&c[r+a-1]===f&&c[r]===c[o]&&c[++r]===c[o+1]){o+=2,r++;do{}while(c[++o]===c[++r]&&c[++o]===c[++r]&&c[++o]===c[++r]&&c[++o]===c[++r]&&c[++o]===c[++r]&&c[++o]===c[++r]&&c[++o]===c[++r]&&c[++o]===c[++r]&&oa){if(t.match_start=e,a=n,n>=s)break;f=c[o+a-1],p=c[o+a]}}}while((e=h[e&u])>l&&0!=--i);return a<=t.lookahead?a:t.lookahead},Tt=t=>{const e=t.w_size;let r,n,i;do{if(n=t.window_size-t.lookahead-t.strstart,t.strstart>=e+(e-ht)&&(t.window.set(t.window.subarray(e,e+e-n),0),t.match_start-=e,t.strstart-=e,t.block_start-=e,t.insert>t.strstart&&(t.insert=t.strstart),bt(t),n+=e),0===t.strm.avail_in)break;if(r=At(t.strm,t.window,t.strstart+t.lookahead,n),t.lookahead+=r,t.lookahead+t.insert>=3)for(i=t.strstart-t.insert,t.ins_h=t.window[i],t.ins_h=yt(t,t.ins_h,t.window[i+1]);t.insert&&(t.ins_h=yt(t,t.ins_h,t.window[i+3-1]),t.prev[i&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=i,i++,t.insert--,!(t.lookahead+t.insert<3)););}while(t.lookahead{let r,n,i,o=t.pending_buf_size-5>t.w_size?t.w_size:t.pending_buf_size-5,a=0,s=t.strm.avail_in;do{if(r=65535,i=t.bi_valid+42>>3,t.strm.avail_outn+t.strm.avail_in&&(r=n+t.strm.avail_in),r>i&&(r=i),r>8,t.pending_buf[t.pending-2]=~r,t.pending_buf[t.pending-1]=~r>>8,xt(t.strm),n&&(n>r&&(n=r),t.strm.output.set(t.window.subarray(t.block_start,t.block_start+n),t.strm.next_out),t.strm.next_out+=n,t.strm.avail_out-=n,t.strm.total_out+=n,t.block_start+=n,r-=n),r&&(At(t.strm,t.strm.output,t.strm.next_out,r),t.strm.next_out+=r,t.strm.avail_out-=r,t.strm.total_out+=r)}while(0===a);return s-=t.strm.avail_in,s&&(s>=t.w_size?(t.matches=2,t.window.set(t.strm.input.subarray(t.strm.next_in-t.w_size,t.strm.next_in),0),t.strstart=t.w_size,t.insert=t.strstart):(t.window_size-t.strstart<=s&&(t.strstart-=t.w_size,t.window.set(t.window.subarray(t.w_size,t.w_size+t.strstart),0),t.matches<2&&t.matches++,t.insert>t.strstart&&(t.insert=t.strstart)),t.window.set(t.strm.input.subarray(t.strm.next_in-s,t.strm.next_in),t.strstart),t.strstart+=s,t.insert+=s>t.w_size-t.insert?t.w_size-t.insert:s),t.block_start=t.strstart),t.high_wateri&&t.block_start>=t.w_size&&(t.block_start-=t.w_size,t.strstart-=t.w_size,t.window.set(t.window.subarray(t.w_size,t.w_size+t.strstart),0),t.matches<2&&t.matches++,i+=t.w_size,t.insert>t.strstart&&(t.insert=t.strstart)),i>t.strm.avail_in&&(i=t.strm.avail_in),i&&(At(t.strm,t.window,t.strstart,i),t.strstart+=i,t.insert+=i>t.w_size-t.insert?t.w_size-t.insert:i),t.high_water>3,i=t.pending_buf_size-i>65535?65535:t.pending_buf_size-i,o=i>t.w_size?t.w_size:i,n=t.strstart-t.block_start,(n>=o||(n||e===X)&&e!==q&&0===t.strm.avail_in&&n<=i)&&(r=n>i?i:n,a=e===X&&0===t.strm.avail_in&&r===n?1:0,G(t,t.block_start,r,a),t.block_start+=r,xt(t.strm)),a?3:1)},Ct=(t,e)=>{let r,n;for(;;){if(t.lookahead=3&&(t.ins_h=yt(t,t.ins_h,t.window[t.strstart+3-1]),r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!==r&&t.strstart-r<=t.w_size-ht&&(t.match_length=Mt(t,r)),t.match_length>=3)if(n=H(t,t.strstart-t.match_start,t.match_length-3),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=3){t.match_length--;do{t.strstart++,t.ins_h=yt(t,t.ins_h,t.window[t.strstart+3-1]),r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart}while(0!=--t.match_length);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=yt(t,t.ins_h,t.window[t.strstart+1]);else n=H(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(n&&(_t(t,!1),0===t.strm.avail_out))return 1}return t.insert=t.strstart<2?t.strstart:2,e===X?(_t(t,!0),0===t.strm.avail_out?3:4):t.sym_next&&(_t(t,!1),0===t.strm.avail_out)?1:2},Et=(t,e)=>{let r,n,i;for(;;){if(t.lookahead=3&&(t.ins_h=yt(t,t.ins_h,t.window[t.strstart+3-1]),r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=2,0!==r&&t.prev_length4096)&&(t.match_length=2)),t.prev_length>=3&&t.match_length<=t.prev_length){i=t.strstart+t.lookahead-3,n=H(t,t.strstart-1-t.prev_match,t.prev_length-3),t.lookahead-=t.prev_length-1,t.prev_length-=2;do{++t.strstart<=i&&(t.ins_h=yt(t,t.ins_h,t.window[t.strstart+3-1]),r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart)}while(0!=--t.prev_length);if(t.match_available=0,t.match_length=2,t.strstart++,n&&(_t(t,!1),0===t.strm.avail_out))return 1}else if(t.match_available){if(n=H(t,0,t.window[t.strstart-1]),n&&_t(t,!1),t.strstart++,t.lookahead--,0===t.strm.avail_out)return 1}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(n=H(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<2?t.strstart:2,e===X?(_t(t,!0),0===t.strm.avail_out?3:4):t.sym_next&&(_t(t,!1),0===t.strm.avail_out)?1:2};function Lt(t,e,r,n,i){this.good_length=t,this.max_lazy=e,this.nice_length=r,this.max_chain=n,this.func=i}const zt=[new Lt(0,0,0,0,St),new Lt(4,4,8,4,Ct),new Lt(4,5,16,8,Ct),new Lt(4,6,32,32,Ct),new Lt(4,4,16,16,Et),new Lt(8,16,32,32,Et),new Lt(8,16,128,128,Et),new Lt(8,32,128,256,Et),new Lt(32,128,258,1024,Et),new Lt(32,258,258,4096,Et)];function Ot(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=ct,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(1146),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),vt(this.dyn_ltree),vt(this.dyn_dtree),vt(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),vt(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),vt(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const Dt=t=>{if(!t)return 1;const e=t.state;return!e||e.strm!==t||e.status!==dt&&57!==e.status&&69!==e.status&&73!==e.status&&91!==e.status&&103!==e.status&&e.status!==ft&&e.status!==pt?1:0},It=t=>{if(Dt(t))return mt(t,Q);t.total_in=t.total_out=0,t.data_type=lt;const e=t.state;return e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=2===e.wrap?57:e.wrap?dt:ft,t.adler=2===e.wrap?0:1,e.last_flush=-2,U(e),J},Ft=t=>{const e=It(t);var r;return e===J&&((r=t.state).window_size=2*r.w_size,vt(r.head),r.max_lazy_match=zt[r.level].max_lazy,r.good_match=zt[r.level].good_length,r.nice_match=zt[r.level].nice_length,r.max_chain_length=zt[r.level].max_chain,r.strstart=0,r.block_start=0,r.lookahead=0,r.insert=0,r.match_length=r.prev_length=2,r.match_available=0,r.ins_h=0),e},Rt=(t,e,r,n,i,o)=>{if(!t)return Q;let a=1;if(e===rt&&(e=6),n<0?(a=0,n=-n):n>15&&(a=2,n-=16),i<1||i>9||r!==ct||n<8||n>15||e<0||e>9||o<0||o>at||8===n&&1!==a)return mt(t,Q);8===n&&(n=9);const s=new Ot;return t.state=s,s.strm=t,s.status=dt,s.wrap=a,s.gzhead=null,s.w_bits=n,s.w_size=1<Dt(t)||2!==t.state.wrap?Q:(t.state.gzhead=e,J),Nt=(t,e)=>{if(Dt(t)||e>$||e<0)return t?mt(t,Q):Q;const r=t.state;if(!t.output||0!==t.avail_in&&!t.input||r.status===pt&&e!==X)return mt(t,0===t.avail_out?et:Q);const n=r.last_flush;if(r.last_flush=e,0!==r.pending){if(xt(t),0===t.avail_out)return r.last_flush=-1,J}else if(0===t.avail_in&>(e)<=gt(n)&&e!==X)return mt(t,et);if(r.status===pt&&0!==t.avail_in)return mt(t,et);if(r.status===dt&&0===r.wrap&&(r.status=ft),r.status===dt){let e=ct+(r.w_bits-8<<4)<<8,n=-1;if(n=r.strategy>=it||r.level<2?0:r.level<6?1:6===r.level?2:3,e|=n<<6,0!==r.strstart&&(e|=32),e+=31-e%31,kt(r,e),0!==r.strstart&&(kt(r,t.adler>>>16),kt(r,65535&t.adler)),t.adler=1,r.status=ft,xt(t),0!==r.pending)return r.last_flush=-1,J}if(57===r.status)if(t.adler=0,wt(r,31),wt(r,139),wt(r,8),r.gzhead)wt(r,(r.gzhead.text?1:0)+(r.gzhead.hcrc?2:0)+(r.gzhead.extra?4:0)+(r.gzhead.name?8:0)+(r.gzhead.comment?16:0)),wt(r,255&r.gzhead.time),wt(r,r.gzhead.time>>8&255),wt(r,r.gzhead.time>>16&255),wt(r,r.gzhead.time>>24&255),wt(r,9===r.level?2:r.strategy>=it||r.level<2?4:0),wt(r,255&r.gzhead.os),r.gzhead.extra&&r.gzhead.extra.length&&(wt(r,255&r.gzhead.extra.length),wt(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(t.adler=j(t.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=69;else if(wt(r,0),wt(r,0),wt(r,0),wt(r,0),wt(r,0),wt(r,9===r.level?2:r.strategy>=it||r.level<2?4:0),wt(r,3),r.status=ft,xt(t),0!==r.pending)return r.last_flush=-1,J;if(69===r.status){if(r.gzhead.extra){let e=r.pending,n=(65535&r.gzhead.extra.length)-r.gzindex;for(;r.pending+n>r.pending_buf_size;){let i=r.pending_buf_size-r.pending;if(r.pending_buf.set(r.gzhead.extra.subarray(r.gzindex,r.gzindex+i),r.pending),r.pending=r.pending_buf_size,r.gzhead.hcrc&&r.pending>e&&(t.adler=j(t.adler,r.pending_buf,r.pending-e,e)),r.gzindex+=i,xt(t),0!==r.pending)return r.last_flush=-1,J;e=0,n-=i}let i=new Uint8Array(r.gzhead.extra);r.pending_buf.set(i.subarray(r.gzindex,r.gzindex+n),r.pending),r.pending+=n,r.gzhead.hcrc&&r.pending>e&&(t.adler=j(t.adler,r.pending_buf,r.pending-e,e)),r.gzindex=0}r.status=73}if(73===r.status){if(r.gzhead.name){let e,n=r.pending;do{if(r.pending===r.pending_buf_size){if(r.gzhead.hcrc&&r.pending>n&&(t.adler=j(t.adler,r.pending_buf,r.pending-n,n)),xt(t),0!==r.pending)return r.last_flush=-1,J;n=0}e=r.gzindexn&&(t.adler=j(t.adler,r.pending_buf,r.pending-n,n)),r.gzindex=0}r.status=91}if(91===r.status){if(r.gzhead.comment){let e,n=r.pending;do{if(r.pending===r.pending_buf_size){if(r.gzhead.hcrc&&r.pending>n&&(t.adler=j(t.adler,r.pending_buf,r.pending-n,n)),xt(t),0!==r.pending)return r.last_flush=-1,J;n=0}e=r.gzindexn&&(t.adler=j(t.adler,r.pending_buf,r.pending-n,n))}r.status=103}if(103===r.status){if(r.gzhead.hcrc){if(r.pending+2>r.pending_buf_size&&(xt(t),0!==r.pending))return r.last_flush=-1,J;wt(r,255&t.adler),wt(r,t.adler>>8&255),t.adler=0}if(r.status=ft,xt(t),0!==r.pending)return r.last_flush=-1,J}if(0!==t.avail_in||0!==r.lookahead||e!==q&&r.status!==pt){let n=0===r.level?St(r,e):r.strategy===it?((t,e)=>{let r;for(;;){if(0===t.lookahead&&(Tt(t),0===t.lookahead)){if(e===q)return 1;break}if(t.match_length=0,r=H(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,r&&(_t(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===X?(_t(t,!0),0===t.strm.avail_out?3:4):t.sym_next&&(_t(t,!1),0===t.strm.avail_out)?1:2})(r,e):r.strategy===ot?((t,e)=>{let r,n,i,o;const a=t.window;for(;;){if(t.lookahead<=ut){if(Tt(t),t.lookahead<=ut&&e===q)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=3&&t.strstart>0&&(i=t.strstart-1,n=a[i],n===a[++i]&&n===a[++i]&&n===a[++i])){o=t.strstart+ut;do{}while(n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&it.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=3?(r=H(t,1,t.match_length-3),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(r=H(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),r&&(_t(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===X?(_t(t,!0),0===t.strm.avail_out?3:4):t.sym_next&&(_t(t,!1),0===t.strm.avail_out)?1:2})(r,e):zt[r.level].func(r,e);if(3!==n&&4!==n||(r.status=pt),1===n||3===n)return 0===t.avail_out&&(r.last_flush=-1),J;if(2===n&&(e===Y?W(r):e!==$&&(G(r,0,0,!1),e===Z&&(vt(r.head),0===r.lookahead&&(r.strstart=0,r.block_start=0,r.insert=0))),xt(t),0===t.avail_out))return r.last_flush=-1,J}return e!==X?J:r.wrap<=0?K:(2===r.wrap?(wt(r,255&t.adler),wt(r,t.adler>>8&255),wt(r,t.adler>>16&255),wt(r,t.adler>>24&255),wt(r,255&t.total_in),wt(r,t.total_in>>8&255),wt(r,t.total_in>>16&255),wt(r,t.total_in>>24&255)):(kt(r,t.adler>>>16),kt(r,65535&t.adler)),xt(t),r.wrap>0&&(r.wrap=-r.wrap),0!==r.pending?J:K)},Bt=t=>{if(Dt(t))return Q;const e=t.state.status;return t.state=null,e===ft?mt(t,tt):J},Ut=(t,e)=>{let r=e.length;if(Dt(t))return Q;const n=t.state,i=n.wrap;if(2===i||1===i&&n.status!==dt||n.lookahead)return Q;if(1===i&&(t.adler=R(t.adler,e,r,0)),n.wrap=0,r>=n.w_size){0===i&&(vt(n.head),n.strstart=0,n.block_start=0,n.insert=0);let t=new Uint8Array(n.w_size);t.set(e.subarray(r-n.w_size,r),0),e=t,r=n.w_size}const o=t.avail_in,a=t.next_in,s=t.input;for(t.avail_in=r,t.next_in=0,t.input=e,Tt(n);n.lookahead>=3;){let t=n.strstart,e=n.lookahead-2;do{n.ins_h=yt(n,n.ins_h,n.window[t+3-1]),n.prev[t&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=t,t++}while(--e);n.strstart=t,n.lookahead=2,Tt(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=2,n.match_available=0,t.next_in=a,t.input=s,t.avail_in=o,n.wrap=i,J};const Gt=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var Vt=function(t){const e=Array.prototype.slice.call(arguments,1);for(;e.length;){const r=e.shift();if(r){if("object"!=typeof r)throw new TypeError(r+"must be non-object");for(const e in r)Gt(r,e)&&(t[e]=r[e])}}return t},Ht=t=>{let e=0;for(let r=0,n=t.length;r=252?6:t>=248?5:t>=240?4:t>=224?3:t>=192?2:1;qt[254]=qt[254]=1;var Yt=t=>{if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(t);let e,r,n,i,o,a=t.length,s=0;for(i=0;i>>6,e[o++]=128|63&r):r<65536?(e[o++]=224|r>>>12,e[o++]=128|r>>>6&63,e[o++]=128|63&r):(e[o++]=240|r>>>18,e[o++]=128|r>>>12&63,e[o++]=128|r>>>6&63,e[o++]=128|63&r);return e},Zt=(t,e)=>{const r=e||t.length;if("function"==typeof TextDecoder&&TextDecoder.prototype.decode)return(new TextDecoder).decode(t.subarray(0,e));let n,i;const o=new Array(2*r);for(i=0,n=0;n4)o[i++]=65533,n+=a-1;else{for(e&=2===a?31:3===a?15:7;a>1&&n1?o[i++]=65533:e<65536?o[i++]=e:(e-=65536,o[i++]=55296|e>>10&1023,o[i++]=56320|1023&e)}}return((t,e)=>{if(e<65534&&t.subarray&&Wt)return String.fromCharCode.apply(null,t.length===e?t:t.subarray(0,e));let r="";for(let n=0;n{(e=e||t.length)>t.length&&(e=t.length);let r=e-1;for(;r>=0&&128==(192&t[r]);)r--;return r<0||0===r?e:r+qt[t[r]]>e?r:e},$t=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0};const Jt=Object.prototype.toString,{Z_NO_FLUSH:Kt,Z_SYNC_FLUSH:Qt,Z_FULL_FLUSH:te,Z_FINISH:ee,Z_OK:re,Z_STREAM_END:ne,Z_DEFAULT_COMPRESSION:ie,Z_DEFAULT_STRATEGY:oe,Z_DEFLATED:ae}=B;function se(t){this.options=Vt({level:ie,method:ae,chunkSize:16384,windowBits:15,memLevel:8,strategy:oe},t||{});let e=this.options;e.raw&&e.windowBits>0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new $t,this.strm.avail_out=0;let r=Pt(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(r!==re)throw new Error(N[r]);if(e.header&&jt(this.strm,e.header),e.dictionary){let t;if(t="string"==typeof e.dictionary?Yt(e.dictionary):"[object ArrayBuffer]"===Jt.call(e.dictionary)?new Uint8Array(e.dictionary):e.dictionary,r=Ut(this.strm,t),r!==re)throw new Error(N[r]);this._dict_set=!0}}function le(t,e){const r=new se(e);if(r.push(t,!0),r.err)throw r.msg||N[r.err];return r.result}se.prototype.push=function(t,e){const r=this.strm,n=this.options.chunkSize;let i,o;if(this.ended)return!1;for(o=e===~~e?e:!0===e?ee:Kt,"string"==typeof t?r.input=Yt(t):"[object ArrayBuffer]"===Jt.call(t)?r.input=new Uint8Array(t):r.input=t,r.next_in=0,r.avail_in=r.input.length;;)if(0===r.avail_out&&(r.output=new Uint8Array(n),r.next_out=0,r.avail_out=n),(o===Qt||o===te)&&r.avail_out<=6)this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;else{if(i=Nt(r,o),i===ne)return r.next_out>0&&this.onData(r.output.subarray(0,r.next_out)),i=Bt(this.strm),this.onEnd(i),this.ended=!0,i===re;if(0!==r.avail_out){if(o>0&&r.next_out>0)this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;else if(0===r.avail_in)break}else this.onData(r.output)}return!0},se.prototype.onData=function(t){this.chunks.push(t)},se.prototype.onEnd=function(t){t===re&&(this.result=Ht(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};var ce={Deflate:se,deflate:le,deflateRaw:function(t,e){return(e=e||{}).raw=!0,le(t,e)},gzip:function(t,e){return(e=e||{}).gzip=!0,le(t,e)},constants:B};const ue=16209;var he=function(t,e){let r,n,i,o,a,s,l,c,u,h,d,f,p,m,g,v,b,y,x,_,w,k,A,M;const T=t.state;r=t.next_in,A=t.input,n=r+(t.avail_in-5),i=t.next_out,M=t.output,o=i-(e-t.avail_out),a=i+(t.avail_out-257),s=T.dmax,l=T.wsize,c=T.whave,u=T.wnext,h=T.window,d=T.hold,f=T.bits,p=T.lencode,m=T.distcode,g=(1<>>24,d>>>=y,f-=y,y=b>>>16&255,0===y)M[i++]=65535&b;else{if(!(16&y)){if(64&y){if(32&y){T.mode=16191;break t}t.msg="invalid literal/length code",T.mode=ue;break t}b=p[(65535&b)+(d&(1<>>=y,f-=y),f<15&&(d+=A[r++]<>>24,d>>>=y,f-=y,y=b>>>16&255,16&y){if(_=65535&b,y&=15,fs){t.msg="invalid distance too far back",T.mode=ue;break t}if(d>>>=y,f-=y,y=i-o,_>y){if(y=_-y,y>c&&T.sane){t.msg="invalid distance too far back",T.mode=ue;break t}if(w=0,k=h,0===u){if(w+=l-y,y2;)M[i++]=k[w++],M[i++]=k[w++],M[i++]=k[w++],x-=3;x&&(M[i++]=k[w++],x>1&&(M[i++]=k[w++]))}else{w=i-_;do{M[i++]=M[w++],M[i++]=M[w++],M[i++]=M[w++],x-=3}while(x>2);x&&(M[i++]=M[w++],x>1&&(M[i++]=M[w++]))}break}if(64&y){t.msg="invalid distance code",T.mode=ue;break t}b=m[(65535&b)+(d&(1<>3,r-=x,f-=x<<3,d&=(1<{const l=s.bits;let c,u,h,d,f,p,m=0,g=0,v=0,b=0,y=0,x=0,_=0,w=0,k=0,A=0,M=null;const T=new Uint16Array(16),S=new Uint16Array(16);let C,E,L,z=null;for(m=0;m<=15;m++)T[m]=0;for(g=0;g=1&&0===T[b];b--);if(y>b&&(y=b),0===b)return i[o++]=20971520,i[o++]=20971520,s.bits=1,0;for(v=1;v0&&(0===t||1!==b))return-1;for(S[1]=0,m=1;m<15;m++)S[m+1]=S[m]+T[m];for(g=0;g852||2===t&&k>592)return 1;for(;;){C=m-_,a[g]+1=p?(E=z[a[g]-p],L=M[a[g]-p]):(E=96,L=0),c=1<>_)+u]=C<<24|E<<16|L}while(0!==u);for(c=1<>=1;if(0!==c?(A&=c-1,A+=c):A=0,g++,0==--T[m]){if(m===b)break;m=e[r+a[g]]}if(m>y&&(A&d)!==h){for(0===_&&(_=y),f+=v,x=m-_,w=1<852||2===t&&k>592)return 1;h=A&d,i[h]=y<<24|x<<16|f-o}}return 0!==A&&(i[f+A]=m-_<<24|64<<16),s.bits=y,0};const{Z_FINISH:ve,Z_BLOCK:be,Z_TREES:ye,Z_OK:xe,Z_STREAM_END:_e,Z_NEED_DICT:we,Z_STREAM_ERROR:ke,Z_DATA_ERROR:Ae,Z_MEM_ERROR:Me,Z_BUF_ERROR:Te,Z_DEFLATED:Se}=B,Ce=16180,Ee=16190,Le=16191,ze=16192,Oe=16194,De=16199,Ie=16200,Fe=16206,Re=16209,Pe=t=>(t>>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24);function je(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const Ne=t=>{if(!t)return 1;const e=t.state;return!e||e.strm!==t||e.mode16211?1:0},Be=t=>{if(Ne(t))return ke;const e=t.state;return t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=1&e.wrap),e.mode=Ce,e.last=0,e.havedict=0,e.flags=-1,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new Int32Array(852),e.distcode=e.distdyn=new Int32Array(592),e.sane=1,e.back=-1,xe},Ue=t=>{if(Ne(t))return ke;const e=t.state;return e.wsize=0,e.whave=0,e.wnext=0,Be(t)},Ge=(t,e)=>{let r;if(Ne(t))return ke;const n=t.state;return e<0?(r=0,e=-e):(r=5+(e>>4),e<48&&(e&=15)),e&&(e<8||e>15)?ke:(null!==n.window&&n.wbits!==e&&(n.window=null),n.wrap=r,n.wbits=e,Ue(t))},Ve=(t,e)=>{if(!t)return ke;const r=new je;t.state=r,r.strm=t,r.window=null,r.mode=Ce;const n=Ge(t,e);return n!==xe&&(t.state=null),n};let He,We,qe=!0;const Ye=t=>{if(qe){He=new Int32Array(512),We=new Int32Array(32);let e=0;for(;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(ge(1,t.lens,0,288,He,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;ge(2,t.lens,0,32,We,0,t.work,{bits:5}),qe=!1}t.lencode=He,t.lenbits=9,t.distcode=We,t.distbits=5},Ze=(t,e,r,n)=>{let i;const o=t.state;return null===o.window&&(o.wsize=1<=o.wsize?(o.window.set(e.subarray(r-o.wsize,r),0),o.wnext=0,o.whave=o.wsize):(i=o.wsize-o.wnext,i>n&&(i=n),o.window.set(e.subarray(r-n,r-n+i),o.wnext),(n-=i)?(o.window.set(e.subarray(r-n,r),0),o.wnext=n,o.whave=o.wsize):(o.wnext+=i,o.wnext===o.wsize&&(o.wnext=0),o.whave{let r,n,i,o,a,s,l,c,u,h,d,f,p,m,g,v,b,y,x,_,w,k,A=0;const M=new Uint8Array(4);let T,S;const C=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(Ne(t)||!t.output||!t.input&&0!==t.avail_in)return ke;r=t.state,r.mode===Le&&(r.mode=ze),a=t.next_out,i=t.output,l=t.avail_out,o=t.next_in,n=t.input,s=t.avail_in,c=r.hold,u=r.bits,h=s,d=l,k=xe;t:for(;;)switch(r.mode){case Ce:if(0===r.wrap){r.mode=ze;break}for(;u<16;){if(0===s)break t;s--,c+=n[o++]<>>8&255,r.check=j(r.check,M,2,0),c=0,u=0,r.mode=16181;break}if(r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&c)<<8)+(c>>8))%31){t.msg="incorrect header check",r.mode=Re;break}if((15&c)!==Se){t.msg="unknown compression method",r.mode=Re;break}if(c>>>=4,u-=4,w=8+(15&c),0===r.wbits&&(r.wbits=w),w>15||w>r.wbits){t.msg="invalid window size",r.mode=Re;break}r.dmax=1<>8&1),512&r.flags&&4&r.wrap&&(M[0]=255&c,M[1]=c>>>8&255,r.check=j(r.check,M,2,0)),c=0,u=0,r.mode=16182;case 16182:for(;u<32;){if(0===s)break t;s--,c+=n[o++]<>>8&255,M[2]=c>>>16&255,M[3]=c>>>24&255,r.check=j(r.check,M,4,0)),c=0,u=0,r.mode=16183;case 16183:for(;u<16;){if(0===s)break t;s--,c+=n[o++]<>8),512&r.flags&&4&r.wrap&&(M[0]=255&c,M[1]=c>>>8&255,r.check=j(r.check,M,2,0)),c=0,u=0,r.mode=16184;case 16184:if(1024&r.flags){for(;u<16;){if(0===s)break t;s--,c+=n[o++]<>>8&255,r.check=j(r.check,M,2,0)),c=0,u=0}else r.head&&(r.head.extra=null);r.mode=16185;case 16185:if(1024&r.flags&&(f=r.length,f>s&&(f=s),f&&(r.head&&(w=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Uint8Array(r.head.extra_len)),r.head.extra.set(n.subarray(o,o+f),w)),512&r.flags&&4&r.wrap&&(r.check=j(r.check,n,f,o)),s-=f,o+=f,r.length-=f),r.length))break t;r.length=0,r.mode=16186;case 16186:if(2048&r.flags){if(0===s)break t;f=0;do{w=n[o+f++],r.head&&w&&r.length<65536&&(r.head.name+=String.fromCharCode(w))}while(w&&f>9&1,r.head.done=!0),t.adler=r.check=0,r.mode=Le;break;case 16189:for(;u<32;){if(0===s)break t;s--,c+=n[o++]<>>=7&u,u-=7&u,r.mode=Fe;break}for(;u<3;){if(0===s)break t;s--,c+=n[o++]<>>=1,u-=1,3&c){case 0:r.mode=16193;break;case 1:if(Ye(r),r.mode=De,e===ye){c>>>=2,u-=2;break t}break;case 2:r.mode=16196;break;case 3:t.msg="invalid block type",r.mode=Re}c>>>=2,u-=2;break;case 16193:for(c>>>=7&u,u-=7&u;u<32;){if(0===s)break t;s--,c+=n[o++]<>>16^65535)){t.msg="invalid stored block lengths",r.mode=Re;break}if(r.length=65535&c,c=0,u=0,r.mode=Oe,e===ye)break t;case Oe:r.mode=16195;case 16195:if(f=r.length,f){if(f>s&&(f=s),f>l&&(f=l),0===f)break t;i.set(n.subarray(o,o+f),a),s-=f,o+=f,l-=f,a+=f,r.length-=f;break}r.mode=Le;break;case 16196:for(;u<14;){if(0===s)break t;s--,c+=n[o++]<>>=5,u-=5,r.ndist=1+(31&c),c>>>=5,u-=5,r.ncode=4+(15&c),c>>>=4,u-=4,r.nlen>286||r.ndist>30){t.msg="too many length or distance symbols",r.mode=Re;break}r.have=0,r.mode=16197;case 16197:for(;r.have>>=3,u-=3}for(;r.have<19;)r.lens[C[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,T={bits:r.lenbits},k=ge(0,r.lens,0,19,r.lencode,0,r.work,T),r.lenbits=T.bits,k){t.msg="invalid code lengths set",r.mode=Re;break}r.have=0,r.mode=16198;case 16198:for(;r.have>>24,v=A>>>16&255,b=65535&A,!(g<=u);){if(0===s)break t;s--,c+=n[o++]<>>=g,u-=g,r.lens[r.have++]=b;else{if(16===b){for(S=g+2;u>>=g,u-=g,0===r.have){t.msg="invalid bit length repeat",r.mode=Re;break}w=r.lens[r.have-1],f=3+(3&c),c>>>=2,u-=2}else if(17===b){for(S=g+3;u>>=g,u-=g,w=0,f=3+(7&c),c>>>=3,u-=3}else{for(S=g+7;u>>=g,u-=g,w=0,f=11+(127&c),c>>>=7,u-=7}if(r.have+f>r.nlen+r.ndist){t.msg="invalid bit length repeat",r.mode=Re;break}for(;f--;)r.lens[r.have++]=w}}if(r.mode===Re)break;if(0===r.lens[256]){t.msg="invalid code -- missing end-of-block",r.mode=Re;break}if(r.lenbits=9,T={bits:r.lenbits},k=ge(1,r.lens,0,r.nlen,r.lencode,0,r.work,T),r.lenbits=T.bits,k){t.msg="invalid literal/lengths set",r.mode=Re;break}if(r.distbits=6,r.distcode=r.distdyn,T={bits:r.distbits},k=ge(2,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,T),r.distbits=T.bits,k){t.msg="invalid distances set",r.mode=Re;break}if(r.mode=De,e===ye)break t;case De:r.mode=Ie;case Ie:if(s>=6&&l>=258){t.next_out=a,t.avail_out=l,t.next_in=o,t.avail_in=s,r.hold=c,r.bits=u,he(t,d),a=t.next_out,i=t.output,l=t.avail_out,o=t.next_in,n=t.input,s=t.avail_in,c=r.hold,u=r.bits,r.mode===Le&&(r.back=-1);break}for(r.back=0;A=r.lencode[c&(1<>>24,v=A>>>16&255,b=65535&A,!(g<=u);){if(0===s)break t;s--,c+=n[o++]<>y)],g=A>>>24,v=A>>>16&255,b=65535&A,!(y+g<=u);){if(0===s)break t;s--,c+=n[o++]<>>=y,u-=y,r.back+=y}if(c>>>=g,u-=g,r.back+=g,r.length=b,0===v){r.mode=16205;break}if(32&v){r.back=-1,r.mode=Le;break}if(64&v){t.msg="invalid literal/length code",r.mode=Re;break}r.extra=15&v,r.mode=16201;case 16201:if(r.extra){for(S=r.extra;u>>=r.extra,u-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=16202;case 16202:for(;A=r.distcode[c&(1<>>24,v=A>>>16&255,b=65535&A,!(g<=u);){if(0===s)break t;s--,c+=n[o++]<>y)],g=A>>>24,v=A>>>16&255,b=65535&A,!(y+g<=u);){if(0===s)break t;s--,c+=n[o++]<>>=y,u-=y,r.back+=y}if(c>>>=g,u-=g,r.back+=g,64&v){t.msg="invalid distance code",r.mode=Re;break}r.offset=b,r.extra=15&v,r.mode=16203;case 16203:if(r.extra){for(S=r.extra;u>>=r.extra,u-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){t.msg="invalid distance too far back",r.mode=Re;break}r.mode=16204;case 16204:if(0===l)break t;if(f=d-l,r.offset>f){if(f=r.offset-f,f>r.whave&&r.sane){t.msg="invalid distance too far back",r.mode=Re;break}f>r.wnext?(f-=r.wnext,p=r.wsize-f):p=r.wnext-f,f>r.length&&(f=r.length),m=r.window}else m=i,p=a-r.offset,f=r.length;f>l&&(f=l),l-=f,r.length-=f;do{i[a++]=m[p++]}while(--f);0===r.length&&(r.mode=Ie);break;case 16205:if(0===l)break t;i[a++]=r.length,l--,r.mode=Ie;break;case Fe:if(r.wrap){for(;u<32;){if(0===s)break t;s--,c|=n[o++]<{if(Ne(t))return ke;let e=t.state;return e.window&&(e.window=null),t.state=null,xe},Qe=(t,e)=>{if(Ne(t))return ke;const r=t.state;return 2&r.wrap?(r.head=e,e.done=!1,xe):ke},tr=(t,e)=>{const r=e.length;let n,i,o;return Ne(t)?ke:(n=t.state,0!==n.wrap&&n.mode!==Ee?ke:n.mode===Ee&&(i=1,i=R(i,e,r,0),i!==n.check)?Ae:(o=Ze(t,e,r,r),o?(n.mode=16210,Me):(n.havedict=1,xe)))},er=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1};const rr=Object.prototype.toString,{Z_NO_FLUSH:nr,Z_FINISH:ir,Z_OK:or,Z_STREAM_END:ar,Z_NEED_DICT:sr,Z_STREAM_ERROR:lr,Z_DATA_ERROR:cr,Z_MEM_ERROR:ur}=B;function hr(t){this.options=Vt({chunkSize:65536,windowBits:15,to:""},t||{});const e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,0===e.windowBits&&(e.windowBits=-15)),!(e.windowBits>=0&&e.windowBits<16)||t&&t.windowBits||(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&(15&e.windowBits||(e.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new $t,this.strm.avail_out=0;let r=$e(this.strm,e.windowBits);if(r!==or)throw new Error(N[r]);if(this.header=new er,Qe(this.strm,this.header),e.dictionary&&("string"==typeof e.dictionary?e.dictionary=Yt(e.dictionary):"[object ArrayBuffer]"===rr.call(e.dictionary)&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(r=tr(this.strm,e.dictionary),r!==or)))throw new Error(N[r])}function dr(t,e){const r=new hr(e);if(r.push(t),r.err)throw r.msg||N[r.err];return r.result}hr.prototype.push=function(t,e){const r=this.strm,n=this.options.chunkSize,i=this.options.dictionary;let o,a,s;if(this.ended)return!1;for(a=e===~~e?e:!0===e?ir:nr,"[object ArrayBuffer]"===rr.call(t)?r.input=new Uint8Array(t):r.input=t,r.next_in=0,r.avail_in=r.input.length;;){for(0===r.avail_out&&(r.output=new Uint8Array(n),r.next_out=0,r.avail_out=n),o=Je(r,a),o===sr&&i&&(o=tr(r,i),o===or?o=Je(r,a):o===cr&&(o=sr));r.avail_in>0&&o===ar&&r.state.wrap>0&&0!==t[r.next_in];)Xe(r),o=Je(r,a);switch(o){case lr:case cr:case sr:case ur:return this.onEnd(o),this.ended=!0,!1}if(s=r.avail_out,r.next_out&&(0===r.avail_out||o===ar))if("string"===this.options.to){let t=Xt(r.output,r.next_out),e=r.next_out-t,i=Zt(r.output,t);r.next_out=e,r.avail_out=n-e,e&&r.output.set(r.output.subarray(t,t+e),0),this.onData(i)}else this.onData(r.output.length===r.next_out?r.output:r.output.subarray(0,r.next_out));if(o!==or||0!==s){if(o===ar)return o=Ke(this.strm),this.onEnd(o),this.ended=!0,!0;if(0===r.avail_in)break}}return!0},hr.prototype.onData=function(t){this.chunks.push(t)},hr.prototype.onEnd=function(t){t===or&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=Ht(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};var fr={Inflate:hr,inflate:dr,inflateRaw:function(t,e){return(e=e||{}).raw=!0,dr(t,e)},ungzip:dr,constants:B};const{Deflate:pr,deflate:mr,deflateRaw:gr,gzip:vr}=ce,{Inflate:br,inflate:yr,inflateRaw:xr,ungzip:_r}=fr;var wr=pr,kr=mr,Ar=gr,Mr=vr,Tr=br,Sr=yr,Cr=xr,Er=_r,Lr=B,zr={Deflate:pr,deflate:mr,deflateRaw:gr,gzip:vr,Inflate:br,inflate:yr,inflateRaw:xr,ungzip:_r,constants:B}}},__webpack_module_cache__={};function __nested_webpack_require_1675243__(t){var e=__webpack_module_cache__[t];if(void 0!==e)return e.exports;var r=__webpack_module_cache__[t]={exports:{}};return __webpack_modules__[t].call(r.exports,r,r.exports,__nested_webpack_require_1675243__),r.exports}__nested_webpack_require_1675243__.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return __nested_webpack_require_1675243__.d(e,{a:e}),e},__nested_webpack_require_1675243__.d=(t,e)=>{for(var r in e)__nested_webpack_require_1675243__.o(e,r)&&!__nested_webpack_require_1675243__.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},__nested_webpack_require_1675243__.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),__nested_webpack_require_1675243__.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},__nested_webpack_require_1675243__("./src/index.ts"),__nested_webpack_require_1675243__("./src/SurfaceWorker.js");var __nested_webpack_exports__=__nested_webpack_require_1675243__("./src/exporter.js");return __nested_webpack_exports__})(),module.exports=factory()},27941:(t,e,r)=>{var n,i;(function(){var o={version:"3.8.2"},a=[].slice,s=function(t){return a.call(t)},l=self.document;function c(t){return t&&(t.ownerDocument||t.document||t).documentElement}function u(t){return t&&(t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView)}if(l)try{s(l.documentElement.childNodes)[0].nodeType}catch(t){s=function(t){for(var e=t.length,r=new Array(e);e--;)r[e]=t[e];return r}}if(Date.now||(Date.now=function(){return+new Date}),l)try{l.createElement("DIV").style.setProperty("opacity",0,"")}catch(t){var h=this.Element.prototype,d=h.setAttribute,f=h.setAttributeNS,p=this.CSSStyleDeclaration.prototype,m=p.setProperty;h.setAttribute=function(t,e){d.call(this,t,e+"")},h.setAttributeNS=function(t,e,r){f.call(this,t,e,r+"")},p.setProperty=function(t,e,r){m.call(this,t,e+"",r)}}function g(t,e){return te?1:t>=e?0:NaN}function v(t){return null===t?NaN:+t}function b(t){return!isNaN(t)}function y(t){return{left:function(e,r,n,i){for(arguments.length<3&&(n=0),arguments.length<4&&(i=e.length);n>>1;t(e[o],r)<0?n=o+1:i=o}return n},right:function(e,r,n,i){for(arguments.length<3&&(n=0),arguments.length<4&&(i=e.length);n>>1;t(e[o],r)>0?i=o:n=o+1}return n}}}o.ascending=g,o.descending=function(t,e){return et?1:e>=t?0:NaN},o.min=function(t,e){var r,n,i=-1,o=t.length;if(1===arguments.length){for(;++i=n){r=n;break}for(;++in&&(r=n)}else{for(;++i=n){r=n;break}for(;++in&&(r=n)}return r},o.max=function(t,e){var r,n,i=-1,o=t.length;if(1===arguments.length){for(;++i=n){r=n;break}for(;++ir&&(r=n)}else{for(;++i=n){r=n;break}for(;++ir&&(r=n)}return r},o.extent=function(t,e){var r,n,i,o=-1,a=t.length;if(1===arguments.length){for(;++o=n){r=i=n;break}for(;++on&&(r=n),i=n){r=i=n;break}for(;++on&&(r=n),i1)return a/(l-1)},o.deviation=function(){var t=o.variance.apply(this,arguments);return t?Math.sqrt(t):t};var x=y(g);function _(t){return t.length}o.bisectLeft=x.left,o.bisect=o.bisectRight=x.right,o.bisector=function(t){return y(1===t.length?function(e,r){return g(t(e),r)}:t)},o.shuffle=function(t,e,r){(o=arguments.length)<3&&(r=t.length,o<2&&(e=0));for(var n,i,o=r-e;o;)i=Math.random()*o--|0,n=t[o+e],t[o+e]=t[i+e],t[i+e]=n;return t},o.permute=function(t,e){for(var r=e.length,n=new Array(r);r--;)n[r]=t[e[r]];return n},o.pairs=function(t){for(var e=0,r=t.length-1,n=t[0],i=new Array(r<0?0:r);e=0;)for(e=(n=t[i]).length;--e>=0;)r[--a]=n[e];return r};var w=Math.abs;function k(t,e){for(var r in e)Object.defineProperty(t.prototype,r,{value:e[r],enumerable:!1})}function A(){this._=Object.create(null)}function M(t){return"__proto__"==(t+="")||"\0"===t[0]?"\0"+t:t}function T(t){return"\0"===(t+="")[0]?t.slice(1):t}function S(t){return M(t)in this._}function C(t){return(t=M(t))in this._&&delete this._[t]}function E(){var t=[];for(var e in this._)t.push(T(e));return t}function L(){var t=0;for(var e in this._)++t;return t}function z(){for(var t in this._)return!1;return!0}function O(){this._=Object.create(null)}function D(t){return t}function I(t,e,r){return function(){var n=r.apply(e,arguments);return n===e?t:n}}function F(t,e){if(e in t)return e;e=e.charAt(0).toUpperCase()+e.slice(1);for(var r=0,n=R.length;re;)i.push(n/o);else for(;(n=t+r*++a)=n.length)return e?e.call(r,o):t?o.sort(t):o;for(var l,c,u,h,d=-1,f=o.length,p=n[s++],m=new A;++d=n.length)return t;var r=[],o=i[e++];return t.forEach((function(t,n){r.push({key:t,values:s(n,e)})})),o?r.sort((function(t,e){return o(t.key,e.key)})):r}return r.map=function(t,e){return a(e,t,0)},r.entries=function(t){return s(a(o.map,t,0),0)},r.key=function(t){return n.push(t),r},r.sortKeys=function(t){return i[n.length-1]=t,r},r.sortValues=function(e){return t=e,r},r.rollup=function(t){return e=t,r},r},o.set=function(t){var e=new O;if(t)for(var r=0,n=t.length;r=0&&(n=t.slice(r+1),t=t.slice(0,r)),t)return arguments.length<2?this[t].on(n):this[t].on(n,e);if(2===arguments.length){if(null==e)for(t in this)this.hasOwnProperty(t)&&this[t].on(n,null);return this}},o.event=null,o.requote=function(t){return t.replace(V,"\\$&")};var V=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,H={}.__proto__?function(t,e){t.__proto__=e}:function(t,e){for(var r in e)t[r]=e[r]};function W(t){return H(t,X),t}var q=function(t,e){return e.querySelector(t)},Y=function(t,e){return e.querySelectorAll(t)},Z=function(t,e){var r=t.matches||t[F(t,"matchesSelector")];return Z=function(t,e){return r.call(t,e)},Z(t,e)};"function"==typeof Sizzle&&(q=function(t,e){return Sizzle(t,e)[0]||null},Y=Sizzle,Z=Sizzle.matchesSelector),o.selection=function(){return o.select(l.documentElement)};var X=o.selection.prototype=[];function $(t){return"function"==typeof t?t:function(){return q(t,this)}}function J(t){return"function"==typeof t?t:function(){return Y(t,this)}}X.select=function(t){var e,r,n,i,o=[];t=$(t);for(var a=-1,s=this.length;++a=0&&"xmlns"!==(r=t.slice(0,e))&&(t=t.slice(e+1)),Q.hasOwnProperty(r)?{space:Q[r],local:t}:t}},X.attr=function(t,e){if(arguments.length<2){if("string"==typeof t){var r=this.node();return(t=o.ns.qualify(t)).local?r.getAttributeNS(t.space,t.local):r.getAttribute(t)}for(e in t)this.each(tt(e,t[e]));return this}return this.each(tt(t,e))},X.classed=function(t,e){if(arguments.length<2){if("string"==typeof t){var r=this.node(),n=(t=nt(t)).length,i=-1;if(e=r.classList){for(;++i=0;)(r=n[i])&&(o&&o!==r.nextSibling&&o.parentNode.insertBefore(r,o),o=r);return this},X.sort=function(t){t=dt.apply(this,arguments);for(var e=-1,r=this.length;++e0&&(t=t.slice(0,i));var l=vt.get(t);function c(){var e=this[n];e&&(this.removeEventListener(t,e,e.$),delete this[n])}return l&&(t=l,a=yt),i?e?function(){var i=a(e,s(arguments));c.call(this),this.addEventListener(t,this[n]=i,i.$=r),i._=e}:c:e?P:function(){var e,r=new RegExp("^__on([^.]+)"+o.requote(t)+"$");for(var n in this)if(e=n.match(r)){var i=this[n];this.removeEventListener(e[1],i,i.$),delete this[n]}}}o.selection.enter=pt,o.selection.enter.prototype=mt,mt.append=X.append,mt.empty=X.empty,mt.node=X.node,mt.call=X.call,mt.size=X.size,mt.select=function(t){for(var e,r,n,i,o,a=[],s=-1,l=this.length;++s=n&&(n=e+1);!(a=s[n])&&++n1?zt:t<-1?-zt:Math.asin(t)}function Ft(t){return((t=Math.exp(t))+1/t)/2}var Rt=Math.SQRT2;o.interpolateZoom=function(t,e){var r,n,i=t[0],o=t[1],a=t[2],s=e[0],l=e[1],c=e[2],u=s-i,h=l-o,d=u*u+h*h;if(d0&&(t=t.transition().duration(m)),t.call(w.event)}function S(){s&&s.domain(a.range().map((function(t){return(t-d.x)/d.k})).map(a.invert)),h&&h.domain(c.range().map((function(t){return(t-d.y)/d.k})).map(c.invert))}function C(t){g++||t({type:"zoomstart"})}function E(t){S(),t({type:"zoom",scale:d.k,translate:[d.x,d.y]})}function L(t){--g||(t({type:"zoomend"}),e=null)}function z(){var t=this,e=_.of(t,arguments),r=0,n=o.select(u(t)).on(b,(function(){r=1,M(o.mouse(t),i),E(e)})).on(y,(function(){n.on(b,null).on(y,null),a(r),L(e)})),i=k(o.mouse(t)),a=wt(t);Zi.call(t),C(e)}function O(){var t,e=this,r=_.of(e,arguments),n={},a=0,s=".zoom-"+o.event.changedTouches[0].identifier,l="touchmove"+s,c="touchend"+s,u=[],h=o.select(e),f=wt(e);function p(){var r=o.touches(e);return t=d.k,r.forEach((function(t){t.identifier in n&&(n[t.identifier]=k(t))})),r}function m(){var t=o.event.target;o.select(t).on(l,g).on(c,b),u.push(t);for(var r=o.event.changedTouches,s=0,h=r.length;s1){v=f[0];var y=f[1],x=v[0]-y[0],_=v[1]-y[1];a=x*x+_*_}}function g(){var s,l,c,u,h=o.touches(e);Zi.call(e);for(var d=0,f=h.length;d360?t-=360:t<0&&(t+=360),t<60?n+(i-n)*t/60:t<180?i:t<240?n+(i-n)*(240-t)/60:n}(t))}return t=isNaN(t)?0:(t%=360)<0?t+360:t,e=isNaN(e)||e<0?0:e>1?1:e,n=2*(r=r<0?0:r>1?1:r)-(i=r<=.5?r*(1+e):r+e-r*e),new ne(o(t+120),o(t),o(t-120))}function Ht(t,e,r){return this instanceof Ht?(this.h=+t,this.c=+e,void(this.l=+r)):arguments.length<2?t instanceof Ht?new Ht(t.h,t.c,t.l):function(t,e,r){return t>0?new Ht(Math.atan2(r,e)*Dt,Math.sqrt(e*e+r*r),t):new Ht(NaN,NaN,t)}(t instanceof Yt?t.l:(t=ue((t=o.rgb(t)).r,t.g,t.b)).l,t.a,t.b):new Ht(t,e,r)}Gt.brighter=function(t){return t=Math.pow(.7,arguments.length?t:1),new Ut(this.h,this.s,this.l/t)},Gt.darker=function(t){return t=Math.pow(.7,arguments.length?t:1),new Ut(this.h,this.s,t*this.l)},Gt.rgb=function(){return Vt(this.h,this.s,this.l)},o.hcl=Ht;var Wt=Ht.prototype=new Bt;function qt(t,e,r){return isNaN(t)&&(t=0),isNaN(e)&&(e=0),new Yt(r,Math.cos(t*=Ot)*e,Math.sin(t)*e)}function Yt(t,e,r){return this instanceof Yt?(this.l=+t,this.a=+e,void(this.b=+r)):arguments.length<2?t instanceof Yt?new Yt(t.l,t.a,t.b):t instanceof Ht?qt(t.h,t.c,t.l):ue((t=ne(t)).r,t.g,t.b):new Yt(t,e,r)}Wt.brighter=function(t){return new Ht(this.h,this.c,Math.min(100,this.l+Zt*(arguments.length?t:1)))},Wt.darker=function(t){return new Ht(this.h,this.c,Math.max(0,this.l-Zt*(arguments.length?t:1)))},Wt.rgb=function(){return qt(this.h,this.c,this.l).rgb()},o.lab=Yt;var Zt=18,Xt=.95047,$t=1,Jt=1.08883,Kt=Yt.prototype=new Bt;function Qt(t,e,r){var n=(t+16)/116,i=n+e/500,o=n-r/200;return new ne(re(3.2404542*(i=te(i)*Xt)-1.5371385*(n=te(n)*$t)-.4985314*(o=te(o)*Jt)),re(-.969266*i+1.8760108*n+.041556*o),re(.0556434*i-.2040259*n+1.0572252*o))}function te(t){return t>.206893034?t*t*t:(t-4/29)/7.787037}function ee(t){return t>.008856?Math.pow(t,1/3):7.787037*t+4/29}function re(t){return Math.round(255*(t<=.00304?12.92*t:1.055*Math.pow(t,1/2.4)-.055))}function ne(t,e,r){return this instanceof ne?(this.r=~~t,this.g=~~e,void(this.b=~~r)):arguments.length<2?t instanceof ne?new ne(t.r,t.g,t.b):le(""+t,ne,Vt):new ne(t,e,r)}function ie(t){return new ne(t>>16,t>>8&255,255&t)}function oe(t){return ie(t)+""}Kt.brighter=function(t){return new Yt(Math.min(100,this.l+Zt*(arguments.length?t:1)),this.a,this.b)},Kt.darker=function(t){return new Yt(Math.max(0,this.l-Zt*(arguments.length?t:1)),this.a,this.b)},Kt.rgb=function(){return Qt(this.l,this.a,this.b)},o.rgb=ne;var ae=ne.prototype=new Bt;function se(t){return t<16?"0"+Math.max(0,t).toString(16):Math.min(255,t).toString(16)}function le(t,e,r){var n,i,o,a=0,s=0,l=0;if(n=/([a-z]+)\((.*)\)/.exec(t=t.toLowerCase()))switch(i=n[2].split(","),n[1]){case"hsl":return r(parseFloat(i[0]),parseFloat(i[1])/100,parseFloat(i[2])/100);case"rgb":return e(de(i[0]),de(i[1]),de(i[2]))}return(o=fe.get(t))?e(o.r,o.g,o.b):(null==t||"#"!==t.charAt(0)||isNaN(o=parseInt(t.slice(1),16))||(4===t.length?(a=(3840&o)>>4,a|=a>>4,s=240&o,s|=s>>4,l=15&o,l|=l<<4):7===t.length&&(a=(16711680&o)>>16,s=(65280&o)>>8,l=255&o)),e(a,s,l))}function ce(t,e,r){var n,i,o=Math.min(t/=255,e/=255,r/=255),a=Math.max(t,e,r),s=a-o,l=(a+o)/2;return s?(i=l<.5?s/(a+o):s/(2-a-o),n=t==a?(e-r)/s+(e0&&l<1?0:n),new Ut(n,i,l)}function ue(t,e,r){var n=ee((.4124564*(t=he(t))+.3575761*(e=he(e))+.1804375*(r=he(r)))/Xt),i=ee((.2126729*t+.7151522*e+.072175*r)/$t);return Yt(116*i-16,500*(n-i),200*(i-ee((.0193339*t+.119192*e+.9503041*r)/Jt)))}function he(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function de(t){var e=parseFloat(t);return"%"===t.charAt(t.length-1)?Math.round(2.55*e):e}ae.brighter=function(t){t=Math.pow(.7,arguments.length?t:1);var e=this.r,r=this.g,n=this.b,i=30;return e||r||n?(e&&e=200&&e<300||304===e){try{t=r.call(i,c)}catch(t){return void a.error.call(i,t)}a.load.call(i,t)}else a.error.call(i,c)}return self.XDomainRequest&&!("withCredentials"in c)&&/^(http(s)?:)?\/\//.test(t)&&(c=new XDomainRequest),"onload"in c?c.onload=c.onerror=h:c.onreadystatechange=function(){c.readyState>3&&h()},c.onprogress=function(t){var e=o.event;o.event=t;try{a.progress.call(i,c)}finally{o.event=e}},i.header=function(t,e){return t=(t+"").toLowerCase(),arguments.length<2?l[t]:(null==e?delete l[t]:l[t]=e+"",i)},i.mimeType=function(t){return arguments.length?(e=null==t?null:t+"",i):e},i.responseType=function(t){return arguments.length?(u=t,i):u},i.response=function(t){return r=t,i},["get","post"].forEach((function(t){i[t]=function(){return i.send.apply(i,[t].concat(s(arguments)))}})),i.send=function(r,n,o){if(2===arguments.length&&"function"==typeof n&&(o=n,n=null),c.open(r,t,!0),null==e||"accept"in l||(l.accept=e+",*/*"),c.setRequestHeader)for(var s in l)c.setRequestHeader(s,l[s]);return null!=e&&c.overrideMimeType&&c.overrideMimeType(e),null!=u&&(c.responseType=u),null!=o&&i.on("error",o).on("load",(function(t){o(null,t)})),a.beforesend.call(i,c),c.send(null==n?null:n),i},i.abort=function(){return c.abort(),i},o.rebind(i,a,"on"),null==n?i:i.get(function(t){return 1===t.length?function(e,r){t(null==e?r:null)}:t}(n))}fe.forEach((function(t,e){fe.set(t,ie(e))})),o.functor=pe,o.xhr=me(D),o.dsv=function(t,e){var r=new RegExp('["'+t+"\n]"),n=t.charCodeAt(0);function i(t,r,n){arguments.length<3&&(n=r,r=null);var i=ge(t,e,null==r?o:a(r),n);return i.row=function(t){return arguments.length?i.response(null==(r=t)?o:a(t)):r},i}function o(t){return i.parse(t.responseText)}function a(t){return function(e){return i.parse(e.responseText,t)}}function s(e){return e.map(l).join(t)}function l(t){return r.test(t)?'"'+t.replace(/\"/g,'""')+'"':t}return i.parse=function(t,e){var r;return i.parseRows(t,(function(t,n){if(r)return r(t,n-1);var i=function(e){for(var r={},n=t.length,i=0;i=l)return a;if(i)return i=!1,o;var e=c;if(34===t.charCodeAt(e)){for(var r=e;r++24?(isFinite(e)&&(clearTimeout(xe),xe=setTimeout(ke,e)),ye=0):(ye=1,_e(ke))}function Ae(){for(var t=Date.now(),e=ve;e;)t>=e.t&&e.c(t-e.t)&&(e.c=null),e=e.n;return t}function Me(){for(var t,e=ve,r=1/0;e;)e.c?(e.t1&&(e=t[o[a-2]],r=t[o[a-1]],n=t[s],(r[0]-e[0])*(n[1]-e[1])-(r[1]-e[1])*(n[0]-e[0])<=0);)--a;o[a++]=s}return o.slice(0,a)}function Ee(t,e){return t[0]-e[0]||t[1]-e[1]}o.timer=function(){we.apply(this,arguments)},o.timer.flush=function(){Ae(),Me()},o.round=function(t,e){return e?Math.round(t*(e=Math.pow(10,e)))/e:Math.round(t)},o.geom={},o.geom.hull=function(t){var e=Te,r=Se;if(arguments.length)return n(t);function n(t){if(t.length<3)return[];var n,i=pe(e),o=pe(r),a=t.length,s=[],l=[];for(n=0;n=0;--n)f.push(t[s[c[n]][2]]);for(n=+h;nTt)s=s.L;else{if(!((i=o-Ye(s,a))>Tt)){n>-Tt?(e=s.P,r=s):i>-Tt?(e=s,r=s.N):e=r=s;break}if(!s.R){e=s;break}s=s.R}var l=Ge(t);if(Re.insert(e,l),e||r){if(e===r)return Ke(e),r=Ge(e.site),Re.insert(l,r),l.edge=r.edge=er(e.site,l.site),Je(e),void Je(r);if(r){Ke(e),Ke(r);var c=e.site,u=c.x,h=c.y,d=t.x-u,f=t.y-h,p=r.site,m=p.x-u,g=p.y-h,v=2*(d*g-f*m),b=d*d+f*f,y=m*m+g*g,x={x:(g*b-f*y)/v+u,y:(d*y-m*b)/v+h};rr(r.edge,c,p,x),l.edge=er(c,t,null,x),r.edge=er(t,p,null,x),Je(e),Je(r)}else l.edge=er(e.site,l.site)}}function qe(t,e){var r=t.site,n=r.x,i=r.y,o=i-e;if(!o)return n;var a=t.P;if(!a)return-1/0;var s=(r=a.site).x,l=r.y,c=l-e;if(!c)return s;var u=s-n,h=1/o-1/c,d=u/c;return h?(-d+Math.sqrt(d*d-2*h*(u*u/(-2*c)-l+c/2+i-o/2)))/h+n:(n+s)/2}function Ye(t,e){var r=t.N;if(r)return qe(r,e);var n=t.site;return n.y===e?n.x:1/0}function Ze(t){this.site=t,this.edges=[]}function Xe(t,e){return e.angle-t.angle}function $e(){or(this),this.x=this.y=this.arc=this.site=this.cy=null}function Je(t){var e=t.P,r=t.N;if(e&&r){var n=e.site,i=t.site,o=r.site;if(n!==o){var a=i.x,s=i.y,l=n.x-a,c=n.y-s,u=o.x-a,h=2*(l*(g=o.y-s)-c*u);if(!(h>=-St)){var d=l*l+c*c,f=u*u+g*g,p=(g*d-c*f)/h,m=(l*f-u*d)/h,g=m+s,v=Be.pop()||new $e;v.arc=t,v.site=i,v.x=p+a,v.y=g+Math.sqrt(p*p+m*m),v.cy=g,t.circle=v;for(var b=null,y=je._;y;)if(v.y=s)return;if(d>p){if(o){if(o.y>=c)return}else o={x:g,y:l};r={x:g,y:c}}else{if(o){if(o.y1)if(d>p){if(o){if(o.y>=c)return}else o={x:(l-i)/n,y:l};r={x:(c-i)/n,y:c}}else{if(o){if(o.y=s)return}else o={x:a,y:n*a+i};r={x:s,y:n*s+i}}else{if(o){if(o.x0)){if(e/=d,d<0){if(e0){if(e>h)return;e>u&&(u=e)}if(e=i-l,d||!(e<0)){if(e/=d,d<0){if(e>h)return;e>u&&(u=e)}else if(d>0){if(e0)){if(e/=f,f<0){if(e0){if(e>h)return;e>u&&(u=e)}if(e=o-c,f||!(e<0)){if(e/=f,f<0){if(e>h)return;e>u&&(u=e)}else if(f>0){if(e0&&(t.a={x:l+u*d,y:c+u*f}),h<1&&(t.b={x:l+h*d,y:c+h*f}),t}}}}}),l=a.length;l--;)(!Qe(e=a[l],t)||!s(e)||w(e.a.x-e.b.x)Tt||w(i-r)>Tt)&&(s.splice(a,0,new nr((v=o.site,b=u,y=w(n-h)Tt?{x:h,y:w(e-h)Tt?{x:w(r-p)Tt?{x:d,y:w(e-d)Tt?{x:w(r-f)=r&&c.x<=i&&c.y>=n&&c.y<=a?[[r,a],[i,a],[i,n],[r,n]]:[]).point=t[s]})),e}function s(t){return t.map((function(t,e){return{x:Math.round(n(t,e)/Tt)*Tt,y:Math.round(i(t,e)/Tt)*Tt,i:e}}))}return a.links=function(t){return cr(s(t)).edges.filter((function(t){return t.l&&t.r})).map((function(e){return{source:t[e.l.i],target:t[e.r.i]}}))},a.triangles=function(t){var e=[];return cr(s(t)).cells.forEach((function(r,n){for(var i,o,a,s,l=r.site,c=r.edges.sort(Xe),u=-1,h=c.length,d=c[h-1].edge,f=d.l===l?d.r:d.l;++uo&&(i=e.slice(o,i),s[a]?s[a]+=i:s[++a]=i),(r=r[0])===(n=n[0])?s[a]?s[a]+=n:s[++a]=n:(s[++a]=null,l.push({i:a,x:vr(r,n)})),o=xr.lastIndex;return om&&(m=l.x),l.y>g&&(g=l.y),c.push(l.x),u.push(l.y);else for(h=0;hm&&(m=y),x>g&&(g=x),c.push(y),u.push(x)}var _=m-f,k=g-p;function A(t,e,r,n,i,o,a,s){if(!isNaN(r)&&!isNaN(n))if(t.leaf){var l=t.x,c=t.y;if(null!=l)if(w(l-r)+w(c-n)<.01)M(t,e,r,n,i,o,a,s);else{var u=t.point;t.x=t.y=t.point=null,M(t,u,l,c,i,o,a,s),M(t,e,r,n,i,o,a,s)}else t.x=r,t.y=n,t.point=e}else M(t,e,r,n,i,o,a,s)}function M(t,e,r,n,i,o,a,s){var l=.5*(i+a),c=.5*(o+s),u=r>=l,h=n>=c,d=h<<1|u;t.leaf=!1,u?i=l:a=l,h?o=c:s=c,A(t=t.nodes[d]||(t.nodes[d]={leaf:!0,nodes:[],point:null,x:null,y:null}),e,r,n,i,o,a,s)}_>k?g=p+_:m=f+k;var T={leaf:!0,nodes:[],point:null,x:null,y:null,add:function(t){A(T,t,+v(t,++h),+b(t,h),f,p,m,g)}};if(T.visit=function(t){pr(t,T,f,p,m,g)},T.find=function(t){return function(t,e,r,n,i,o,a){var s,l=1/0;return function t(c,u,h,d,f){if(!(u>o||h>a||d=_)<<1|e>=x,k=w+4;w=0&&!(r=o.interpolators[n](t,e)););return r}function wr(t,e){var r,n=[],i=[],o=t.length,a=e.length,s=Math.min(t.length,e.length);for(r=0;r=1)return 1;var e=t*t,r=e*t;return 4*(t<.5?r:3*(t-e)+r-.75)}function zr(t){return 1-Math.cos(t*zt)}function Or(t){return Math.pow(2,10*(t-1))}function Dr(t){return 1-Math.sqrt(1-t*t)}function Ir(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375}function Fr(t,e){return e-=t,function(r){return Math.round(t+e*r)}}function Rr(t){var e,r,n,i=[t.a,t.b],o=[t.c,t.d],a=jr(i),s=Pr(i,o),l=jr(((e=o)[0]+=(n=-s)*(r=i)[0],e[1]+=n*r[1],e))||0;i[0]*o[1]=0?t.slice(0,r):t,i=r>=0?t.slice(r+1):"in";return n=Ar.get(n)||kr,i=Mr.get(i)||D,e=i(n.apply(null,a.call(arguments,1))),function(t){return t<=0?0:t>=1?1:e(t)}},o.interpolateHcl=function(t,e){t=o.hcl(t),e=o.hcl(e);var r=t.h,n=t.c,i=t.l,a=e.h-r,s=e.c-n,l=e.l-i;return isNaN(s)&&(s=0,n=isNaN(n)?e.c:n),isNaN(a)?(a=0,r=isNaN(r)?e.h:r):a>180?a-=360:a<-180&&(a+=360),function(t){return qt(r+a*t,n+s*t,i+l*t)+""}},o.interpolateHsl=function(t,e){t=o.hsl(t),e=o.hsl(e);var r=t.h,n=t.s,i=t.l,a=e.h-r,s=e.s-n,l=e.l-i;return isNaN(s)&&(s=0,n=isNaN(n)?e.s:n),isNaN(a)?(a=0,r=isNaN(r)?e.h:r):a>180?a-=360:a<-180&&(a+=360),function(t){return Vt(r+a*t,n+s*t,i+l*t)+""}},o.interpolateLab=function(t,e){t=o.lab(t),e=o.lab(e);var r=t.l,n=t.a,i=t.b,a=e.l-r,s=e.a-n,l=e.b-i;return function(t){return Qt(r+a*t,n+s*t,i+l*t)+""}},o.interpolateRound=Fr,o.transform=function(t){var e=l.createElementNS(o.ns.prefix.svg,"g");return(o.transform=function(t){if(null!=t){e.setAttribute("transform",t);var r=e.transform.baseVal.consolidate()}return new Rr(r?r.matrix:Nr)})(t)},Rr.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var Nr={a:1,b:0,c:0,d:1,e:0,f:0};function Br(t){return t.length?t.pop()+",":""}function Ur(t,e){var r=[],n=[];return t=o.transform(t),e=o.transform(e),function(t,e,r,n){if(t[0]!==e[0]||t[1]!==e[1]){var i=r.push("translate(",null,",",null,")");n.push({i:i-4,x:vr(t[0],e[0])},{i:i-2,x:vr(t[1],e[1])})}else(e[0]||e[1])&&r.push("translate("+e+")")}(t.translate,e.translate,r,n),function(t,e,r,n){t!==e?(t-e>180?e+=360:e-t>180&&(t+=360),n.push({i:r.push(Br(r)+"rotate(",null,")")-2,x:vr(t,e)})):e&&r.push(Br(r)+"rotate("+e+")")}(t.rotate,e.rotate,r,n),function(t,e,r,n){t!==e?n.push({i:r.push(Br(r)+"skewX(",null,")")-2,x:vr(t,e)}):e&&r.push(Br(r)+"skewX("+e+")")}(t.skew,e.skew,r,n),function(t,e,r,n){if(t[0]!==e[0]||t[1]!==e[1]){var i=r.push(Br(r)+"scale(",null,",",null,")");n.push({i:i-4,x:vr(t[0],e[0])},{i:i-2,x:vr(t[1],e[1])})}else 1===e[0]&&1===e[1]||r.push(Br(r)+"scale("+e+")")}(t.scale,e.scale,r,n),t=e=null,function(t){for(var e,i=-1,o=n.length;++i0?r=e:(t.c=null,t.t=NaN,t=null,l.end({type:"end",alpha:r=0})):e>0&&(l.start({type:"start",alpha:r=e}),t=we(s.tick)),s):r},s.start=function(){var t,e,r,o=v.length,l=b.length,u=c[0],p=c[1];for(t=0;t=0;)r.push(i[n])}function rn(t,e){for(var r=[t],n=[];null!=(t=r.pop());)if(n.push(t),(o=t.children)&&(i=o.length))for(var i,o,a=-1;++a=0;)a.push(u=c[l]),u.parent=o,u.depth=o.depth+1;r&&(o.value=0),o.children=c}else r&&(o.value=+r.call(n,o,o.depth)||0),delete o.children;return rn(i,(function(e){var n,i;t&&(n=e.children)&&n.sort(t),r&&(i=e.parent)&&(i.value+=e.value)})),s}return n.sort=function(e){return arguments.length?(t=e,n):t},n.children=function(t){return arguments.length?(e=t,n):e},n.value=function(t){return arguments.length?(r=t,n):r},n.revalue=function(t){return r&&(en(t,(function(t){t.children&&(t.value=0)})),rn(t,(function(t){var e;t.children||(t.value=+r.call(n,t,t.depth)||0),(e=t.parent)&&(e.value+=t.value)}))),t},n},o.layout.partition=function(){var t=o.layout.hierarchy(),e=[1,1];function r(t,e,n,i){var o=t.children;if(t.x=e,t.y=t.depth*i,t.dx=n,t.dy=i,o&&(a=o.length)){var a,s,l,c=-1;for(n=t.value?n/t.value:0;++cs&&(s=n),a.push(n)}for(r=0;ri&&(n=r,i=e);return n}function vn(t){return t.reduce(bn,0)}function bn(t,e){return t+e[1]}function yn(t,e){return xn(t,Math.ceil(Math.log(e.length)/Math.LN2+1))}function xn(t,e){for(var r=-1,n=+t[0],i=(t[1]-n)/e,o=[];++r<=e;)o[r]=i*r+n;return o}function _n(t){return[o.min(t),o.max(t)]}function wn(t,e){return t.value-e.value}function kn(t,e){var r=t._pack_next;t._pack_next=e,e._pack_prev=t,e._pack_next=r,r._pack_prev=e}function An(t,e){t._pack_next=e,e._pack_prev=t}function Mn(t,e){var r=e.x-t.x,n=e.y-t.y,i=t.r+e.r;return.999*i*i>r*r+n*n}function Tn(t){if((e=t.children)&&(l=e.length)){var e,r,n,i,o,a,s,l,c=1/0,u=-1/0,h=1/0,d=-1/0;if(e.forEach(Sn),(r=e[0]).x=-r.r,r.y=0,y(r),l>1&&((n=e[1]).x=n.r,n.y=0,y(n),l>2))for(Ln(r,n,i=e[2]),y(i),kn(r,i),r._pack_prev=i,kn(i,n),n=r._pack_next,o=3;o0)for(a=-1;++a=h[0]&&l<=h[1]&&((s=c[o.bisect(d,l,1,p)-1]).y+=m,s.push(i[a]));return c}return i.value=function(t){return arguments.length?(e=t,i):e},i.range=function(t){return arguments.length?(r=pe(t),i):r},i.bins=function(t){return arguments.length?(n="number"==typeof t?function(e){return xn(e,t)}:pe(t),i):n},i.frequency=function(e){return arguments.length?(t=!!e,i):t},i},o.layout.pack=function(){var t,e=o.layout.hierarchy().sort(wn),r=0,n=[1,1];function i(i,o){var a=e.call(this,i,o),s=a[0],l=n[0],c=n[1],u=null==t?Math.sqrt:"function"==typeof t?t:function(){return t};if(s.x=s.y=0,rn(s,(function(t){t.r=+u(t.value)})),rn(s,Tn),r){var h=r*(t?1:Math.max(2*s.r/l,2*s.r/c))/2;rn(s,(function(t){t.r+=h})),rn(s,Tn),rn(s,(function(t){t.r-=h}))}return En(s,l/2,c/2,t?1:1/Math.max(2*s.r/l,2*s.r/c)),a}return i.size=function(t){return arguments.length?(n=t,i):n},i.radius=function(e){return arguments.length?(t=null==e||"function"==typeof e?e:+e,i):t},i.padding=function(t){return arguments.length?(r=+t,i):r},tn(i,e)},o.layout.tree=function(){var t=o.layout.hierarchy().sort(null).value(null),e=zn,r=[1,1],n=null;function i(i,o){var c=t.call(this,i,o),u=c[0],h=function(t){for(var e,r={A:null,children:[t]},n=[r];null!=(e=n.pop());)for(var i,o=e.children,a=0,s=o.length;af.x&&(f=t),t.depth>p.depth&&(p=t)}));var m=e(d,f)/2-d.x,g=r[0]/(f.x+e(f,d)/2+m),v=r[1]/(p.depth||1);en(u,(function(t){t.x=(t.x+m)*g,t.y=t.depth*v}))}return c}function a(t){var r=t.children,n=t.parent.children,i=t.i?n[t.i-1]:null;if(r.length){!function(t){for(var e,r=0,n=0,i=t.children,o=i.length;--o>=0;)(e=i[o]).z+=r,e.m+=r,r+=e.s+(n+=e.c)}(t);var o=(r[0].z+r[r.length-1].z)/2;i?(t.z=i.z+e(t._,i._),t.m=t.z-o):t.z=o}else i&&(t.z=i.z+e(t._,i._));t.parent.A=function(t,r,n){if(r){for(var i,o=t,a=t,s=r,l=o.parent.children[0],c=o.m,u=a.m,h=s.m,d=l.m;s=Dn(s),o=On(o),s&&o;)l=On(l),(a=Dn(a)).a=t,(i=s.z+h-o.z-c+e(s._,o._))>0&&(In(Fn(s,t,n),t,i),c+=i,u+=i),h+=s.m,c+=o.m,d+=l.m,u+=a.m;s&&!Dn(a)&&(a.t=s,a.m+=h-u),o&&!On(l)&&(l.t=o,l.m+=c-d,n=t)}return n}(t,i,t.parent.A||n[0])}function s(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function l(t){t.x*=r[0],t.y=t.depth*r[1]}return i.separation=function(t){return arguments.length?(e=t,i):e},i.size=function(t){return arguments.length?(n=null==(r=t)?l:null,i):n?null:r},i.nodeSize=function(t){return arguments.length?(n=null==(r=t)?null:l,i):n?r:null},tn(i,t)},o.layout.cluster=function(){var t=o.layout.hierarchy().sort(null).value(null),e=zn,r=[1,1],n=!1;function i(i,a){var s,l=t.call(this,i,a),c=l[0],u=0;rn(c,(function(t){var r=t.children;r&&r.length?(t.x=function(t){return t.reduce((function(t,e){return t+e.x}),0)/t.length}(r),t.y=function(t){return 1+o.max(t,(function(t){return t.y}))}(r)):(t.x=s?u+=e(t,s):0,t.y=0,s=t)}));var h=Rn(c),d=Pn(c),f=h.x-e(h,d)/2,p=d.x+e(d,h)/2;return rn(c,n?function(t){t.x=(t.x-c.x)*r[0],t.y=(c.y-t.y)*r[1]}:function(t){t.x=(t.x-f)/(p-f)*r[0],t.y=(1-(c.y?t.y/c.y:1))*r[1]}),l}return i.separation=function(t){return arguments.length?(e=t,i):e},i.size=function(t){return arguments.length?(n=null==(r=t),i):n?null:r},i.nodeSize=function(t){return arguments.length?(n=null!=(r=t),i):n?r:null},tn(i,t)},o.layout.treemap=function(){var t,e=o.layout.hierarchy(),r=Math.round,n=[1,1],i=null,a=jn,s=!1,l="squarify",c=.5*(1+Math.sqrt(5));function u(t,e){for(var r,n,i=-1,o=t.length;++i0;)s.push(r=c[i-1]),s.area+=r.area,"squarify"!==l||(n=f(s,m))<=d?(c.pop(),d=n):(s.area-=s.pop().area,p(s,m,o,!1),m=Math.min(o.dx,o.dy),s.length=s.area=0,d=1/0);s.length&&(p(s,m,o,!0),s.length=s.area=0),e.forEach(h)}}function d(t){var e=t.children;if(e&&e.length){var r,n=a(t),i=e.slice(),o=[];for(u(i,n.dx*n.dy/t.value),o.area=0;r=i.pop();)o.push(r),o.area+=r.area,null!=r.z&&(p(o,r.z?n.dx:n.dy,n,!i.length),o.length=o.area=0);e.forEach(d)}}function f(t,e){for(var r,n=t.area,i=0,o=1/0,a=-1,s=t.length;++ai&&(i=r));return e*=e,(n*=n)?Math.max(e*i*c/n,n/(e*o*c)):1/0}function p(t,e,n,i){var o,a=-1,s=t.length,l=n.x,c=n.y,u=e?r(t.area/e):0;if(e==n.dx){for((i||u>n.dy)&&(u=n.dy);++an.dx)&&(u=n.dx);++a1);return t+e*r*Math.sqrt(-2*Math.log(i)/i)}},logNormal:function(){var t=o.random.normal.apply(o,arguments);return function(){return Math.exp(t())}},bates:function(t){var e=o.random.irwinHall(t);return function(){return e()/t}},irwinHall:function(t){return function(){for(var e=0,r=0;r2?qn:Gn,l=n?Vr:Gr;return i=a(t,e,l,r),o=a(e,t,l,_r),s}function s(t){return i(t)}return s.invert=function(t){return o(t)},s.domain=function(e){return arguments.length?(t=e.map(Number),a()):t},s.range=function(t){return arguments.length?(e=t,a()):e},s.rangeRound=function(t){return s.range(t).interpolate(Fr)},s.clamp=function(t){return arguments.length?(n=t,a()):n},s.interpolate=function(t){return arguments.length?(r=t,a()):r},s.ticks=function(e){return Jn(t,e)},s.tickFormat=function(e,r){return d3_scale_linearTickFormat(t,e,r)},s.nice=function(e){return Xn(t,e),a()},s.copy=function(){return Yn(t,e,r,n)},a()}function Zn(t,e){return o.rebind(t,e,"range","rangeRound","interpolate","clamp")}function Xn(t,e){return Vn(t,Hn($n(t,e)[2])),Vn(t,Hn($n(t,e)[2])),t}function $n(t,e){null==e&&(e=10);var r=Bn(t),n=r[1]-r[0],i=Math.pow(10,Math.floor(Math.log(n/e)/Math.LN10)),o=e/n*i;return o<=.15?i*=10:o<=.35?i*=5:o<=.75&&(i*=2),r[0]=Math.ceil(r[0]/i)*i,r[1]=Math.floor(r[1]/i)*i+.5*i,r[2]=i,r}function Jn(t,e){return o.range.apply(o,$n(t,e))}function Kn(t,e,r,n){function i(t){return(r?Math.log(t<0?0:t):-Math.log(t>0?0:-t))/Math.log(e)}function o(t){return r?Math.pow(e,t):-Math.pow(e,-t)}function a(e){return t(i(e))}return a.invert=function(e){return o(t.invert(e))},a.domain=function(e){return arguments.length?(r=e[0]>=0,t.domain((n=e.map(Number)).map(i)),a):n},a.base=function(r){return arguments.length?(e=+r,t.domain(n.map(i)),a):e},a.nice=function(){var e=Vn(n.map(i),r?Math:Qn);return t.domain(e),n=e.map(o),a},a.ticks=function(){var t=Bn(n),a=[],s=t[0],l=t[1],c=Math.floor(i(s)),u=Math.ceil(i(l)),h=e%1?2:e;if(isFinite(u-c)){if(r){for(;c0;d--)a.push(o(c)*d);for(c=0;a[c]l;u--);a=a.slice(c,u)}return a},a.copy=function(){return Kn(t.copy(),e,r,n)},Zn(a,t)}o.scale.linear=function(){return Yn([0,1],[0,1],_r,!1)},o.scale.log=function(){return Kn(o.scale.linear().domain([0,1]),10,!0,[1,10])};var Qn={floor:function(t){return-Math.ceil(-t)},ceil:function(t){return-Math.floor(-t)}};function ti(t,e,r){var n=ei(e),i=ei(1/e);function o(e){return t(n(e))}return o.invert=function(e){return i(t.invert(e))},o.domain=function(e){return arguments.length?(t.domain((r=e.map(Number)).map(n)),o):r},o.ticks=function(t){return Jn(r,t)},o.tickFormat=function(t,e){return d3_scale_linearTickFormat(r,t,e)},o.nice=function(t){return o.domain(Xn(r,t))},o.exponent=function(a){return arguments.length?(n=ei(e=a),i=ei(1/e),t.domain(r.map(n)),o):e},o.copy=function(){return ti(t.copy(),e,r)},Zn(o,t)}function ei(t){return function(e){return e<0?-Math.pow(-e,t):Math.pow(e,t)}}function ri(t,e){var r,n,i;function a(i){return n[((r.get(i)||("range"===e.t?r.set(i,t.push(i)):NaN))-1)%n.length]}function s(e,r){return o.range(t.length).map((function(t){return e+r*t}))}return a.domain=function(n){if(!arguments.length)return t;t=[],r=new A;for(var i,o=-1,s=n.length;++o0?r[n-1]:t[0],nh?0:1;if(c=Lt)return l(c,f)+(s?l(s,1-f):"")+"Z";var p,m,g,v,b,y,x,_,w,k,A,M,T=0,S=0,C=[];if((v=(+a.apply(this,arguments)||0)/2)&&(g=n===di?Math.sqrt(s*s+c*c):+n.apply(this,arguments),f||(S*=-1),c&&(S=It(g/c*Math.sin(v))),s&&(T=It(g/s*Math.sin(v)))),c){b=c*Math.cos(u+S),y=c*Math.sin(u+S),x=c*Math.cos(h-S),_=c*Math.sin(h-S);var E=Math.abs(h-u-2*S)<=Ct?0:1;if(S&&bi(b,y,x,_)===f^E){var L=(u+h)/2;b=c*Math.cos(L),y=c*Math.sin(L),x=_=null}}else b=y=0;if(s){w=s*Math.cos(h-T),k=s*Math.sin(h-T),A=s*Math.cos(u+T),M=s*Math.sin(u+T);var z=Math.abs(u-h+2*T)<=Ct?0:1;if(T&&bi(w,k,A,M)===1-f^z){var O=(u+h)/2;w=s*Math.cos(O),k=s*Math.sin(O),A=M=null}}else w=k=0;if(d>Tt&&(p=Math.min(Math.abs(c-s)/2,+r.apply(this,arguments)))>.001){m=s0?0:1}function yi(t,e,r,n,i){var o=t[0]-e[0],a=t[1]-e[1],s=(i?n:-n)/Math.sqrt(o*o+a*a),l=s*a,c=-s*o,u=t[0]+l,h=t[1]+c,d=e[0]+l,f=e[1]+c,p=(u+d)/2,m=(h+f)/2,g=d-u,v=f-h,b=g*g+v*v,y=r-n,x=u*f-d*h,_=(v<0?-1:1)*Math.sqrt(Math.max(0,y*y*b-x*x)),w=(x*v-g*_)/b,k=(-x*g-v*_)/b,A=(x*v+g*_)/b,M=(-x*g+v*_)/b,T=w-p,S=k-m,C=A-p,E=M-m;return T*T+S*S>C*C+E*E&&(w=A,k=M),[[w-l,k-c],[w*r/y,k*r/y]]}function xi(){return!0}function _i(t){var e=Te,r=Se,n=xi,i=ki,o=i.key,a=.7;function s(o){var s,l=[],c=[],u=-1,h=o.length,d=pe(e),f=pe(r);function p(){l.push("M",i(t(c),a))}for(;++u1&&i.push("H",n[0]),i.join("")},"step-before":Mi,"step-after":Ti,basis:Ei,"basis-open":function(t){if(t.length<4)return ki(t);for(var e,r=[],n=-1,i=t.length,o=[0],a=[0];++n<3;)e=t[n],o.push(e[0]),a.push(e[1]);for(r.push(Li(Di,o)+","+Li(Di,a)),--n;++n9&&(i=3*e/Math.sqrt(i),a[s]=i*r,a[s+1]=i*n);for(s=-1;++s<=l;)i=(t[Math.min(l,s+1)][0]-t[Math.max(0,s-1)][0])/(6*(1+a[s]*a[s])),o.push([i||0,a[s]*i||0]);return o}(t))}});function ki(t){return t.length>1?t.join("L"):t+"Z"}function Ai(t){return t.join("L")+"Z"}function Mi(t){for(var e=0,r=t.length,n=t[0],i=[n[0],",",n[1]];++e1){s=e[1],o=t[l],l++,n+="C"+(i[0]+a[0])+","+(i[1]+a[1])+","+(o[0]-s[0])+","+(o[1]-s[1])+","+o[0]+","+o[1];for(var c=2;cCt)+",1 "+e}function l(t,e,r,n){return"Q 0,0 "+n}return o.radius=function(t){return arguments.length?(r=pe(t),o):r},o.source=function(e){return arguments.length?(t=pe(e),o):t},o.target=function(t){return arguments.length?(e=pe(t),o):e},o.startAngle=function(t){return arguments.length?(n=pe(t),o):n},o.endAngle=function(t){return arguments.length?(i=pe(t),o):i},o},o.svg.diagonal=function(){var t=ji,e=Ni,r=Ui;function n(n,i){var o=t.call(this,n,i),a=e.call(this,n,i),s=(o.y+a.y)/2,l=[o,{x:o.x,y:s},{x:a.x,y:s},a];return"M"+(l=l.map(r))[0]+"C"+l[1]+" "+l[2]+" "+l[3]}return n.source=function(e){return arguments.length?(t=pe(e),n):t},n.target=function(t){return arguments.length?(e=pe(t),n):e},n.projection=function(t){return arguments.length?(r=t,n):r},n},o.svg.diagonal.radial=function(){var t=o.svg.diagonal(),e=Ui,r=t.projection;return t.projection=function(t){return arguments.length?r(function(t){return function(){var e=t.apply(this,arguments),r=e[0],n=e[1]-zt;return[r*Math.cos(n),r*Math.sin(n)]}}(e=t)):e},t},o.svg.symbol=function(){var t=Vi,e=Gi;function r(r,n){return(Wi.get(t.call(this,r,n))||Hi)(e.call(this,r,n))}return r.type=function(e){return arguments.length?(t=pe(e),r):t},r.size=function(t){return arguments.length?(e=pe(t),r):e},r};var Wi=o.map({circle:Hi,cross:function(t){var e=Math.sqrt(t/5)/2;return"M"+-3*e+","+-e+"H"+-e+"V"+-3*e+"H"+e+"V"+-e+"H"+3*e+"V"+e+"H"+e+"V"+3*e+"H"+-e+"V"+e+"H"+-3*e+"Z"},diamond:function(t){var e=Math.sqrt(t/(2*Yi)),r=e*Yi;return"M0,"+-e+"L"+r+",0 0,"+e+" "+-r+",0Z"},square:function(t){var e=Math.sqrt(t)/2;return"M"+-e+","+-e+"L"+e+","+-e+" "+e+","+e+" "+-e+","+e+"Z"},"triangle-down":function(t){var e=Math.sqrt(t/qi),r=e*qi/2;return"M0,"+r+"L"+e+","+-r+" "+-e+","+-r+"Z"},"triangle-up":function(t){var e=Math.sqrt(t/qi),r=e*qi/2;return"M0,"+-r+"L"+e+","+r+" "+-e+","+r+"Z"}});o.svg.symbolTypes=Wi.keys();var qi=Math.sqrt(3),Yi=Math.tan(30*Ot);X.transition=function(t){for(var e,r,n=Ji||++to,i=no(t),o=[],a=Ki||{time:Date.now(),ease:Lr,delay:0,duration:250},s=-1,l=this.length;++s0;)c[--d].call(t,a);if(o>=1)return h.event&&h.event.end.call(t,t.__data__,e),--u.count?delete u[n]:delete t[r],1}h||(o=i.time,a=we((function(t){var e=h.delay;if(a.t=e+o,e<=t)return d(t-e);a.c=d}),0,o),h=u[n]={tween:new A,time:o,timer:a,delay:i.delay,duration:i.duration,ease:i.ease,index:e},i=null,++u.count)}Qi.call=X.call,Qi.empty=X.empty,Qi.node=X.node,Qi.size=X.size,o.transition=function(t,e){return t&&t.transition?Ji?t.transition(e):t:o.selection().transition(t)},o.transition.prototype=Qi,Qi.select=function(t){var e,r,n,i=this.id,o=this.namespace,a=[];t=$(t);for(var s=-1,l=this.length;++srect,.s>rect").attr("width",a[1]-a[0])}function m(t){t.select(".extent").attr("y",s[0]),t.selectAll(".extent,.e>rect,.w>rect").attr("height",s[1]-s[0])}function g(){var h,g,v=this,b=o.select(o.event.target),y=r.of(v,arguments),x=o.select(v),_=b.datum(),w=!/^(n|s)$/.test(_)&&n,k=!/^(e|w)$/.test(_)&&i,A=b.classed("extent"),M=wt(v),T=o.mouse(v),S=o.select(u(v)).on("keydown.brush",(function(){32==o.event.keyCode&&(A||(h=null,T[0]-=a[1],T[1]-=s[1],A=2),B())})).on("keyup.brush",(function(){32==o.event.keyCode&&2==A&&(T[0]+=a[1],T[1]+=s[1],A=0,B())}));if(o.event.changedTouches?S.on("touchmove.brush",L).on("touchend.brush",O):S.on("mousemove.brush",L).on("mouseup.brush",O),x.interrupt().selectAll("*").interrupt(),A)T[0]=a[0]-T[0],T[1]=s[0]-T[1];else if(_){var C=+/w$/.test(_),E=+/^n/.test(_);g=[a[1-C]-T[0],s[1-E]-T[1]],T[0]=a[C],T[1]=s[E]}else o.event.altKey&&(h=T.slice());function L(){var t=o.mouse(v),e=!1;g&&(t[0]+=g[0],t[1]+=g[1]),A||(o.event.altKey?(h||(h=[(a[0]+a[1])/2,(s[0]+s[1])/2]),T[0]=a[+(t[0]{"use strict";t.exports=r(48777)},48777:(t,e,r)=>{"use strict";var n=r(72478),i=r(90897),o=r(94698),a=r(25359),s=r(9994),l=r(7999),c=r(97e3),u=r(23754),h=r(22366),d=r(54387);function f(t,e){for(var r=e[0],n=e[1],o=1/(e[2]-r),a=1/(e[3]-n),s=new Array(t.length),l=0,c=t.length/2;l>>1;e.dtype||(e.dtype="array"),"string"==typeof e.dtype?p=new(h(e.dtype))(g):e.dtype&&(p=e.dtype,Array.isArray(p)&&(p.length=g));for(var v=0;vr||s>1073741824){for(var d=0;dr+i||T>n+i||S=L||a===s)){var l=b[o];void 0===s&&(s=l.length);for(var c=a;c=g&&h<=w&&d>=v&&d<=k&&z.push(u)}var f=y[o],p=f[4*a+0],m=f[4*a+1],x=f[4*a+2],_=f[4*a+3],A=function(t,e){for(var r=null,n=0;null===r;)if(r=t[4*e+n],++n>t.length)return null;return r}(f,a+1),C=.5*i,O=o+1;e(r,n,C,O,p,m||x||_||A),e(r,n+C,C,O,m,x||_||A),e(r+C,n,C,O,x,_||A),e(r+C,n+C,C,O,_,A)}}(0,0,1,0,0,1),z},p;function C(t,e,r){for(var n=1,i=.5,o=.5,a=.5,s=0;s{t.exports=function(t){var e=0,r=0,n=0,i=0;return t.map((function(t){var o=(t=t.slice())[0],a=o.toUpperCase();if(o!=a)switch(t[0]=a,o){case"a":t[6]+=n,t[7]+=i;break;case"v":t[1]+=i;break;case"h":t[1]+=n;break;default:for(var s=1;s{"use strict";t.exports=function(t,e){if(!t||null==t.length)throw Error("Argument should be an array");e=null==e?1:Math.floor(e);for(var r=Array(2*e),n=0;ni&&(i=t[a]),t[a]{"use strict";t.exports=function(t,e,r){if("function"==typeof Array.prototype.findIndex)return t.findIndex(e,r);if("function"!=typeof e)throw new TypeError("predicate must be a function");var n=Object(t),i=n.length;if(0===i)return-1;for(var o=0;o{"use strict";var n=r(25359);t.exports=function(t,e,r){if(!t||null==t.length)throw Error("Argument should be an array");null==e&&(e=1),null==r&&(r=n(t,e));for(var i=0;i{"use strict";var n=r(39807);function i(t){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i(t)}function o(t,e){for(var r=0;r1?r-1:0),i=1;i1?r-1:0),i=1;i1?r-1:0),i=1;i1?r-1:0),i=1;i{"use strict";var n=r(39807);function i(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function o(t){for(var e=1;et.length)&&(r=t.length),t.substring(r-e.length,r)===e}var y="",x="",_="",w="",k={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"};function A(t){var e=Object.keys(t),r=Object.create(Object.getPrototypeOf(t));return e.forEach((function(e){r[e]=t[e]})),Object.defineProperty(r,"message",{value:t.message}),r}function M(t){return g(t,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}var T=function(t,e){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&f(t,e)}(T,t);var r,i,s,u,h=(r=T,i=d(),function(){var t,e=p(r);if(i){var n=p(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return l(this,t)});function T(t){var e;if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,T),"object"!==m(t)||null===t)throw new v("options","Object",t);var r=t.message,i=t.operator,o=t.stackStartFn,a=t.actual,s=t.expected,u=Error.stackTraceLimit;if(Error.stackTraceLimit=0,null!=r)e=h.call(this,String(r));else if(n.stderr&&n.stderr.isTTY&&(n.stderr&&n.stderr.getColorDepth&&1!==n.stderr.getColorDepth()?(y="",x="",w="",_=""):(y="",x="",w="",_="")),"object"===m(a)&&null!==a&&"object"===m(s)&&null!==s&&"stack"in a&&a instanceof Error&&"stack"in s&&s instanceof Error&&(a=A(a),s=A(s)),"deepStrictEqual"===i||"strictEqual"===i)e=h.call(this,function(t,e,r){var i="",o="",a=0,s="",l=!1,c=M(t),u=c.split("\n"),h=M(e).split("\n"),d=0,f="";if("strictEqual"===r&&"object"===m(t)&&"object"===m(e)&&null!==t&&null!==e&&(r="strictEqualObject"),1===u.length&&1===h.length&&u[0]!==h[0]){var p=u[0].length+h[0].length;if(p<=10){if(!("object"===m(t)&&null!==t||"object"===m(e)&&null!==e||0===t&&0===e))return"".concat(k[r],"\n\n")+"".concat(u[0]," !== ").concat(h[0],"\n")}else if("strictEqualObject"!==r&&p<(n.stderr&&n.stderr.isTTY?n.stderr.columns:80)){for(;u[0][d]===h[0][d];)d++;d>2&&(f="\n ".concat(function(t,e){if(e=Math.floor(e),0==t.length||0==e)return"";var r=t.length*e;for(e=Math.floor(Math.log(e)/Math.log(2));e;)t+=t,e--;return t+t.substring(0,r-t.length)}(" ",d),"^"),d=0)}}for(var g=u[u.length-1],v=h[h.length-1];g===v&&(d++<2?s="\n ".concat(g).concat(s):i=g,u.pop(),h.pop(),0!==u.length&&0!==h.length);)g=u[u.length-1],v=h[h.length-1];var A=Math.max(u.length,h.length);if(0===A){var T=c.split("\n");if(T.length>30)for(T[26]="".concat(y,"...").concat(w);T.length>27;)T.pop();return"".concat(k.notIdentical,"\n\n").concat(T.join("\n"),"\n")}d>3&&(s="\n".concat(y,"...").concat(w).concat(s),l=!0),""!==i&&(s="\n ".concat(i).concat(s),i="");var S=0,C=k[r]+"\n".concat(x,"+ actual").concat(w," ").concat(_,"- expected").concat(w),E=" ".concat(y,"...").concat(w," Lines skipped");for(d=0;d1&&d>2&&(L>4?(o+="\n".concat(y,"...").concat(w),l=!0):L>3&&(o+="\n ".concat(h[d-2]),S++),o+="\n ".concat(h[d-1]),S++),a=d,i+="\n".concat(_,"-").concat(w," ").concat(h[d]),S++;else if(h.length1&&d>2&&(L>4?(o+="\n".concat(y,"...").concat(w),l=!0):L>3&&(o+="\n ".concat(u[d-2]),S++),o+="\n ".concat(u[d-1]),S++),a=d,o+="\n".concat(x,"+").concat(w," ").concat(u[d]),S++;else{var z=h[d],O=u[d],D=O!==z&&(!b(O,",")||O.slice(0,-1)!==z);D&&b(z,",")&&z.slice(0,-1)===O&&(D=!1,O+=","),D?(L>1&&d>2&&(L>4?(o+="\n".concat(y,"...").concat(w),l=!0):L>3&&(o+="\n ".concat(u[d-2]),S++),o+="\n ".concat(u[d-1]),S++),a=d,o+="\n".concat(x,"+").concat(w," ").concat(O),i+="\n".concat(_,"-").concat(w," ").concat(z),S+=2):(o+=i,i="",1!==L&&0!==d||(o+="\n ".concat(O),S++))}if(S>20&&d30)for(f[26]="".concat(y,"...").concat(w);f.length>27;)f.pop();e=1===f.length?h.call(this,"".concat(d," ").concat(f[0])):h.call(this,"".concat(d,"\n\n").concat(f.join("\n"),"\n"))}else{var p=M(a),g="",S=k[i];"notDeepEqual"===i||"notEqual"===i?(p="".concat(k[i],"\n\n").concat(p)).length>1024&&(p="".concat(p.slice(0,1021),"...")):(g="".concat(M(s)),p.length>512&&(p="".concat(p.slice(0,509),"...")),g.length>512&&(g="".concat(g.slice(0,509),"...")),"deepEqual"===i||"equal"===i?p="".concat(S,"\n\n").concat(p,"\n\nshould equal\n\n"):g=" ".concat(i," ").concat(g)),e=h.call(this,"".concat(p).concat(g))}return Error.stackTraceLimit=u,e.generatedMessage=!r,Object.defineProperty(c(e),"name",{value:"AssertionError [ERR_ASSERTION]",enumerable:!1,writable:!0,configurable:!0}),e.code="ERR_ASSERTION",e.actual=a,e.expected=s,e.operator=i,Error.captureStackTrace&&Error.captureStackTrace(c(e),o),e.stack,e.name="AssertionError",l(e)}return s=T,(u=[{key:"toString",value:function(){return"".concat(this.name," [").concat(this.code,"]: ").concat(this.message)}},{key:e,value:function(t,e){return g(this,o(o({},e),{},{customInspect:!1,depth:0}))}}])&&a(s.prototype,u),Object.defineProperty(s,"prototype",{writable:!1}),T}(u(Error),g.custom);t.exports=T},81146:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function i(t,e){return i=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},i(t,e)}function o(t){return o=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},o(t)}var a,s,l={};function c(t,e,r){r||(r=Error);var a=function(r){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&i(t,e)}(u,r);var a,s,l,c=(s=u,l=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=o(s);if(l){var r=o(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===n(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,t)});function u(r,n,i){var o;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,u),o=c.call(this,function(t,r,n){return"string"==typeof e?e:e(t,r,n)}(r,n,i)),o.code=t,o}return a=u,Object.defineProperty(a,"prototype",{writable:!1}),a}(r);l[t]=a}function u(t,e){if(Array.isArray(t)){var r=t.length;return t=t.map((function(t){return String(t)})),r>2?"one of ".concat(e," ").concat(t.slice(0,r-1).join(", "),", or ")+t[r-1]:2===r?"one of ".concat(e," ").concat(t[0]," or ").concat(t[1]):"of ".concat(e," ").concat(t[0])}return"of ".concat(e," ").concat(String(t))}c("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),c("ERR_INVALID_ARG_TYPE",(function(t,e,i){var o,s,l,c,h;if(void 0===a&&(a=r(34961)),a("string"==typeof t,"'name' must be a string"),"string"==typeof e&&(s="not ",e.substr(0,4)===s)?(o="must not be",e=e.replace(/^not /,"")):o="must be",function(t,e,r){return(void 0===r||r>t.length)&&(r=t.length),t.substring(r-9,r)===e}(t," argument"))l="The ".concat(t," ").concat(o," ").concat(u(e,"type"));else{var d=("number"!=typeof h&&(h=0),h+1>(c=t).length||-1===c.indexOf(".",h)?"argument":"property");l='The "'.concat(t,'" ').concat(d," ").concat(o," ").concat(u(e,"type"))}return l+". Received type ".concat(n(i))}),TypeError),c("ERR_INVALID_ARG_VALUE",(function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"is invalid";void 0===s&&(s=r(11276));var i=s.inspect(e);return i.length>128&&(i="".concat(i.slice(0,128),"...")),"The argument '".concat(t,"' ").concat(n,". Received ").concat(i)}),TypeError,RangeError),c("ERR_INVALID_RETURN_VALUE",(function(t,e,r){var i;return i=r&&r.constructor&&r.constructor.name?"instance of ".concat(r.constructor.name):"type ".concat(n(r)),"Expected ".concat(t,' to be returned from the "').concat(e,'"')+" function but got ".concat(i,".")}),TypeError),c("ERR_MISSING_ARGS",(function(){for(var t=arguments.length,e=new Array(t),n=0;n0,"At least one arg needs to be specified");var i="The ",o=e.length;switch(e=e.map((function(t){return'"'.concat(t,'"')})),o){case 1:i+="".concat(e[0]," argument");break;case 2:i+="".concat(e[0]," and ").concat(e[1]," arguments");break;default:i+=e.slice(0,o-1).join(", "),i+=", and ".concat(e[o-1]," arguments")}return"".concat(i," must be specified")}),TypeError),t.exports.codes=l},88884:(t,e,r)=>{"use strict";function n(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,o,a,s=[],l=!0,c=!1;try{if(o=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=o.call(r)).done)&&(s.push(n.value),s.length!==e);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw i}}return s}}(t,e)||function(t,e){if(t){if("string"==typeof t)return i(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?i(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r10)return!0;for(var e=0;e57)return!0}return 10===t.length&&t>=Math.pow(2,32)}function D(t){return Object.keys(t).filter(O).concat(u(t).filter(Object.prototype.propertyIsEnumerable.bind(t)))}function I(t,e){if(t===e)return 0;for(var r=t.length,n=e.length,i=0,o=Math.min(r,n);i{"use strict";r.r(e),r.d(e,{decode:()=>s,encode:()=>a});for(var n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i="undefined"==typeof Uint8Array?[]:new Uint8Array(256),o=0;o<64;o++)i[n.charCodeAt(o)]=o;var a=function(t){var e,r=new Uint8Array(t),i=r.length,o="";for(e=0;e>2],o+=n[(3&r[e])<<4|r[e+1]>>4],o+=n[(15&r[e+1])<<2|r[e+2]>>6],o+=n[63&r[e+2]];return i%3==2?o=o.substring(0,o.length-1)+"=":i%3==1&&(o=o.substring(0,o.length-2)+"=="),o},s=function(t){var e,r,n,o,a,s=.75*t.length,l=t.length,c=0;"="===t[t.length-1]&&(s--,"="===t[t.length-2]&&s--);var u=new ArrayBuffer(s),h=new Uint8Array(u);for(e=0;e>4,h[c++]=(15&n)<<4|o>>2,h[c++]=(3&o)<<6|63&a;return u}},17507:(t,e)=>{"use strict";e.byteLength=function(t){var e=s(t),r=e[0],n=e[1];return 3*(r+n)/4-n},e.toByteArray=function(t){var e,r,o=s(t),a=o[0],l=o[1],c=new i(function(t,e,r){return 3*(e+r)/4-r}(0,a,l)),u=0,h=l>0?a-4:a;for(r=0;r>16&255,c[u++]=e>>8&255,c[u++]=255&e;return 2===l&&(e=n[t.charCodeAt(r)]<<2|n[t.charCodeAt(r+1)]>>4,c[u++]=255&e),1===l&&(e=n[t.charCodeAt(r)]<<10|n[t.charCodeAt(r+1)]<<4|n[t.charCodeAt(r+2)]>>2,c[u++]=e>>8&255,c[u++]=255&e),c},e.fromByteArray=function(t){for(var e,n=t.length,i=n%3,o=[],a=16383,s=0,c=n-i;sc?c:s+a));return 1===i?(e=t[n-1],o.push(r[e>>2]+r[e<<4&63]+"==")):2===i&&(e=(t[n-2]<<8)+t[n-1],o.push(r[e>>10]+r[e>>4&63]+r[e<<2&63]+"=")),o.join("")};for(var r=[],n=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0;a<64;++a)r[a]=o[a],n[o.charCodeAt(a)]=a;function s(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function l(t,e,n){for(var i,o,a=[],s=e;s>18&63]+r[o>>12&63]+r[o>>6&63]+r[63&o]);return a.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},72478:t=>{"use strict";function e(t,e,r,n,i){for(var o=i+1;n<=i;){var a=n+i>>>1,s=t[a];(void 0!==r?r(s,e):s-e)>=0?(o=a,i=a-1):n=a+1}return o}function r(t,e,r,n,i){for(var o=i+1;n<=i;){var a=n+i>>>1,s=t[a];(void 0!==r?r(s,e):s-e)>0?(o=a,i=a-1):n=a+1}return o}function n(t,e,r,n,i){for(var o=n-1;n<=i;){var a=n+i>>>1,s=t[a];(void 0!==r?r(s,e):s-e)<0?(o=a,n=a+1):i=a-1}return o}function i(t,e,r,n,i){for(var o=n-1;n<=i;){var a=n+i>>>1,s=t[a];(void 0!==r?r(s,e):s-e)<=0?(o=a,n=a+1):i=a-1}return o}function o(t,e,r,n,i){for(;n<=i;){var o=n+i>>>1,a=t[o],s=void 0!==r?r(a,e):a-e;if(0===s)return o;s<=0?n=o+1:i=o-1}return-1}function a(t,e,r,n,i,o){return"function"==typeof r?o(t,e,r,void 0===n?0:0|n,void 0===i?t.length-1:0|i):o(t,e,void 0,void 0===r?0:0|r,void 0===n?t.length-1:0|n)}t.exports={ge:function(t,r,n,i,o){return a(t,r,n,i,o,e)},gt:function(t,e,n,i,o){return a(t,e,n,i,o,r)},lt:function(t,e,r,i,o){return a(t,e,r,i,o,n)},le:function(t,e,r,n,o){return a(t,e,r,n,o,i)},eq:function(t,e,r,n,i){return a(t,e,r,n,i,o)}}},88828:(t,e)=>{"use strict";function r(t){var e=32;return(t&=-t)&&e--,65535&t&&(e-=16),16711935&t&&(e-=8),252645135&t&&(e-=4),858993459&t&&(e-=2),1431655765&t&&(e-=1),e}e.INT_BITS=32,e.INT_MAX=2147483647,e.INT_MIN=-1<<31,e.sign=function(t){return(t>0)-(t<0)},e.abs=function(t){var e=t>>31;return(t^e)-e},e.min=function(t,e){return e^(t^e)&-(t65535)<<4,e|=r=((t>>>=e)>255)<<3,e|=r=((t>>>=r)>15)<<2,(e|=r=((t>>>=r)>3)<<1)|(t>>>=r)>>1},e.log10=function(t){return t>=1e9?9:t>=1e8?8:t>=1e7?7:t>=1e6?6:t>=1e5?5:t>=1e4?4:t>=1e3?3:t>=100?2:t>=10?1:0},e.popCount=function(t){return 16843009*((t=(858993459&(t-=t>>>1&1431655765))+(t>>>2&858993459))+(t>>>4)&252645135)>>>24},e.countTrailingZeros=r,e.nextPow2=function(t){return t+=0===t,--t,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,1+(t|=t>>>16)},e.prevPow2=function(t){return t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)-(t>>>1)},e.parity=function(t){return t^=t>>>16,t^=t>>>8,t^=t>>>4,27030>>>(t&=15)&1};var n=new Array(256);!function(t){for(var e=0;e<256;++e){var r=e,n=e,i=7;for(r>>>=1;r;r>>>=1)n<<=1,n|=1&r,--i;t[e]=n<>>8&255]<<16|n[t>>>16&255]<<8|n[t>>>24&255]},e.interleave2=function(t,e){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t&=65535)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e&=65535)|e<<8))|e<<4))|e<<2))|e<<1))<<1},e.deinterleave2=function(t,e){return(t=65535&((t=16711935&((t=252645135&((t=858993459&((t=t>>>e&1431655765)|t>>>1))|t>>>2))|t>>>4))|t>>>16))<<16>>16},e.interleave3=function(t,e,r){return t=1227133513&((t=3272356035&((t=251719695&((t=4278190335&((t&=1023)|t<<16))|t<<8))|t<<4))|t<<2),(t|=(e=1227133513&((e=3272356035&((e=251719695&((e=4278190335&((e&=1023)|e<<16))|e<<8))|e<<4))|e<<2))<<1)|(r=1227133513&((r=3272356035&((r=251719695&((r=4278190335&((r&=1023)|r<<16))|r<<8))|r<<4))|r<<2))<<2},e.deinterleave3=function(t,e){return(t=1023&((t=4278190335&((t=251719695&((t=3272356035&((t=t>>>e&1227133513)|t>>>2))|t>>>4))|t>>>8))|t>>>16))<<22>>22},e.nextCombination=function(t){var e=t|t-1;return e+1|(~e&-~e)-1>>>r(t)+1}},25875:t=>{"use strict";t.exports=function(t,n){n||(n={});var i,o,a,s,l,c,u,h,d,f,p,m=null==n.cutoff?.25:n.cutoff,g=null==n.radius?8:n.radius,v=n.channel||0;if(ArrayBuffer.isView(t)||Array.isArray(t)){if(!n.width||!n.height)throw Error("For raw data width and height should be provided by options");i=n.width,o=n.height,s=t,c=n.stride?n.stride:Math.floor(t.length/i/o)}else window.HTMLCanvasElement&&t instanceof window.HTMLCanvasElement?(u=(h=t).getContext("2d"),i=h.width,o=h.height,s=(d=u.getImageData(0,0,i,o)).data,c=4):window.CanvasRenderingContext2D&&t instanceof window.CanvasRenderingContext2D?(u=t,i=(h=t.canvas).width,o=h.height,s=(d=u.getImageData(0,0,i,o)).data,c=4):window.ImageData&&t instanceof window.ImageData&&(d=t,i=t.width,o=t.height,s=d.data,c=4);if(a=Math.max(i,o),window.Uint8ClampedArray&&s instanceof window.Uint8ClampedArray||window.Uint8Array&&s instanceof window.Uint8Array)for(l=s,s=Array(i*o),f=0,p=Math.floor(l.length/c);f{"use strict";const n=r(17507),i=r(23778),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;e.hp=l,e.IS=50;const a=2147483647;function s(t){if(t>a)throw new RangeError('The value "'+t+'" is invalid for option "size"');const e=new Uint8Array(t);return Object.setPrototypeOf(e,l.prototype),e}function l(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return h(t)}return c(t,e,r)}function c(t,e,r){if("string"==typeof t)return function(t,e){if("string"==typeof e&&""!==e||(e="utf8"),!l.isEncoding(e))throw new TypeError("Unknown encoding: "+e);const r=0|m(t,e);let n=s(r);const i=n.write(t,e);return i!==r&&(n=n.slice(0,i)),n}(t,e);if(ArrayBuffer.isView(t))return function(t){if(X(t,Uint8Array)){const e=new Uint8Array(t);return f(e.buffer,e.byteOffset,e.byteLength)}return d(t)}(t);if(null==t)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(X(t,ArrayBuffer)||t&&X(t.buffer,ArrayBuffer))return f(t,e,r);if("undefined"!=typeof SharedArrayBuffer&&(X(t,SharedArrayBuffer)||t&&X(t.buffer,SharedArrayBuffer)))return f(t,e,r);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');const n=t.valueOf&&t.valueOf();if(null!=n&&n!==t)return l.from(n,e,r);const i=function(t){if(l.isBuffer(t)){const e=0|p(t.length),r=s(e);return 0===r.length||t.copy(r,0,0,e),r}return void 0!==t.length?"number"!=typeof t.length||$(t.length)?s(0):d(t):"Buffer"===t.type&&Array.isArray(t.data)?d(t.data):void 0}(t);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return l.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function u(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function h(t){return u(t),s(t<0?0:0|p(t))}function d(t){const e=t.length<0?0:0|p(t.length),r=s(e);for(let n=0;n=a)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a.toString(16)+" bytes");return 0|t}function m(t,e){if(l.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||X(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);const r=t.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let i=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return q(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return Y(t).length;default:if(i)return n?-1:q(t).length;e=(""+e).toLowerCase(),i=!0}}function g(t,e,r){let n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return L(this,e,r);case"utf8":case"utf-8":return T(this,e,r);case"ascii":return C(this,e,r);case"latin1":case"binary":return E(this,e,r);case"base64":return M(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return z(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function v(t,e,r){const n=t[e];t[e]=t[r],t[r]=n}function b(t,e,r,n,i){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),$(r=+r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof e&&(e=l.from(e,n)),l.isBuffer(e))return 0===e.length?-1:y(t,e,r,n,i);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):y(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function y(t,e,r,n,i){let o,a=1,s=t.length,l=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;a=2,s/=2,l/=2,r/=2}function c(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}if(i){let n=-1;for(o=r;os&&(r=s-l),o=r;o>=0;o--){let r=!0;for(let n=0;ni&&(n=i):n=i;const o=e.length;let a;for(n>o/2&&(n=o/2),a=0;a>8,i=r%256,o.push(i),o.push(n);return o}(e,t.length-r),t,r,n)}function M(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function T(t,e,r){r=Math.min(t.length,r);const n=[];let i=e;for(;i239?4:e>223?3:e>191?2:1;if(i+a<=r){let r,n,s,l;switch(a){case 1:e<128&&(o=e);break;case 2:r=t[i+1],128==(192&r)&&(l=(31&e)<<6|63&r,l>127&&(o=l));break;case 3:r=t[i+1],n=t[i+2],128==(192&r)&&128==(192&n)&&(l=(15&e)<<12|(63&r)<<6|63&n,l>2047&&(l<55296||l>57343)&&(o=l));break;case 4:r=t[i+1],n=t[i+2],s=t[i+3],128==(192&r)&&128==(192&n)&&128==(192&s)&&(l=(15&e)<<18|(63&r)<<12|(63&n)<<6|63&s,l>65535&&l<1114112&&(o=l))}}null===o?(o=65533,a=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|1023&o),n.push(o),i+=a}return function(t){const e=t.length;if(e<=S)return String.fromCharCode.apply(String,t);let r="",n=0;for(;nn.length?(l.isBuffer(e)||(e=l.from(e)),e.copy(n,i)):Uint8Array.prototype.set.call(n,e,i);else{if(!l.isBuffer(e))throw new TypeError('"list" argument must be an Array of Buffers');e.copy(n,i)}i+=e.length}return n},l.byteLength=m,l.prototype._isBuffer=!0,l.prototype.swap16=function(){const t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let e=0;er&&(t+=" ... "),""},o&&(l.prototype[o]=l.prototype.inspect),l.prototype.compare=function(t,e,r,n,i){if(X(t,Uint8Array)&&(t=l.from(t,t.offset,t.byteLength)),!l.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(this===t)return 0;let o=(i>>>=0)-(n>>>=0),a=(r>>>=0)-(e>>>=0);const s=Math.min(o,a),c=this.slice(n,i),u=t.slice(e,r);for(let t=0;t>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}const i=this.length-e;if((void 0===r||r>i)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let o=!1;for(;;)switch(n){case"hex":return x(this,t,e,r);case"utf8":case"utf-8":return _(this,t,e,r);case"ascii":case"latin1":case"binary":return w(this,t,e,r);case"base64":return k(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return A(this,t,e,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const S=4096;function C(t,e,r){let n="";r=Math.min(t.length,r);for(let i=e;in)&&(r=n);let i="";for(let n=e;nr)throw new RangeError("Trying to access beyond buffer length")}function D(t,e,r,n,i,o){if(!l.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||et.length)throw new RangeError("Index out of range")}function I(t,e,r,n,i){G(e,n,i,t,r,7);let o=Number(e&BigInt(4294967295));t[r++]=o,o>>=8,t[r++]=o,o>>=8,t[r++]=o,o>>=8,t[r++]=o;let a=Number(e>>BigInt(32)&BigInt(4294967295));return t[r++]=a,a>>=8,t[r++]=a,a>>=8,t[r++]=a,a>>=8,t[r++]=a,r}function F(t,e,r,n,i){G(e,n,i,t,r,7);let o=Number(e&BigInt(4294967295));t[r+7]=o,o>>=8,t[r+6]=o,o>>=8,t[r+5]=o,o>>=8,t[r+4]=o;let a=Number(e>>BigInt(32)&BigInt(4294967295));return t[r+3]=a,a>>=8,t[r+2]=a,a>>=8,t[r+1]=a,a>>=8,t[r]=a,r+8}function R(t,e,r,n,i,o){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function P(t,e,r,n,o){return e=+e,r>>>=0,o||R(t,0,r,4),i.write(t,e,r,n,23,4),r+4}function j(t,e,r,n,o){return e=+e,r>>>=0,o||R(t,0,r,8),i.write(t,e,r,n,52,8),r+8}l.prototype.slice=function(t,e){const r=this.length;(t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e>>=0,e>>>=0,r||O(t,e,this.length);let n=this[t],i=1,o=0;for(;++o>>=0,e>>>=0,r||O(t,e,this.length);let n=this[t+--e],i=1;for(;e>0&&(i*=256);)n+=this[t+--e]*i;return n},l.prototype.readUint8=l.prototype.readUInt8=function(t,e){return t>>>=0,e||O(t,1,this.length),this[t]},l.prototype.readUint16LE=l.prototype.readUInt16LE=function(t,e){return t>>>=0,e||O(t,2,this.length),this[t]|this[t+1]<<8},l.prototype.readUint16BE=l.prototype.readUInt16BE=function(t,e){return t>>>=0,e||O(t,2,this.length),this[t]<<8|this[t+1]},l.prototype.readUint32LE=l.prototype.readUInt32LE=function(t,e){return t>>>=0,e||O(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},l.prototype.readUint32BE=l.prototype.readUInt32BE=function(t,e){return t>>>=0,e||O(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},l.prototype.readBigUInt64LE=K((function(t){V(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||H(t,this.length-8);const n=e+256*this[++t]+65536*this[++t]+this[++t]*2**24,i=this[++t]+256*this[++t]+65536*this[++t]+r*2**24;return BigInt(n)+(BigInt(i)<>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||H(t,this.length-8);const n=e*2**24+65536*this[++t]+256*this[++t]+this[++t],i=this[++t]*2**24+65536*this[++t]+256*this[++t]+r;return(BigInt(n)<>>=0,e>>>=0,r||O(t,e,this.length);let n=this[t],i=1,o=0;for(;++o=i&&(n-=Math.pow(2,8*e)),n},l.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||O(t,e,this.length);let n=e,i=1,o=this[t+--n];for(;n>0&&(i*=256);)o+=this[t+--n]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*e)),o},l.prototype.readInt8=function(t,e){return t>>>=0,e||O(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},l.prototype.readInt16LE=function(t,e){t>>>=0,e||O(t,2,this.length);const r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},l.prototype.readInt16BE=function(t,e){t>>>=0,e||O(t,2,this.length);const r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},l.prototype.readInt32LE=function(t,e){return t>>>=0,e||O(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},l.prototype.readInt32BE=function(t,e){return t>>>=0,e||O(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},l.prototype.readBigInt64LE=K((function(t){V(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||H(t,this.length-8);const n=this[t+4]+256*this[t+5]+65536*this[t+6]+(r<<24);return(BigInt(n)<>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||H(t,this.length-8);const n=(e<<24)+65536*this[++t]+256*this[++t]+this[++t];return(BigInt(n)<>>=0,e||O(t,4,this.length),i.read(this,t,!0,23,4)},l.prototype.readFloatBE=function(t,e){return t>>>=0,e||O(t,4,this.length),i.read(this,t,!1,23,4)},l.prototype.readDoubleLE=function(t,e){return t>>>=0,e||O(t,8,this.length),i.read(this,t,!0,52,8)},l.prototype.readDoubleBE=function(t,e){return t>>>=0,e||O(t,8,this.length),i.read(this,t,!1,52,8)},l.prototype.writeUintLE=l.prototype.writeUIntLE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||D(this,t,e,r,Math.pow(2,8*r)-1,0);let i=1,o=0;for(this[e]=255&t;++o>>=0,r>>>=0,n||D(this,t,e,r,Math.pow(2,8*r)-1,0);let i=r-1,o=1;for(this[e+i]=255&t;--i>=0&&(o*=256);)this[e+i]=t/o&255;return e+r},l.prototype.writeUint8=l.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||D(this,t,e,1,255,0),this[e]=255&t,e+1},l.prototype.writeUint16LE=l.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||D(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},l.prototype.writeUint16BE=l.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||D(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},l.prototype.writeUint32LE=l.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||D(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},l.prototype.writeUint32BE=l.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||D(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},l.prototype.writeBigUInt64LE=K((function(t,e=0){return I(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),l.prototype.writeBigUInt64BE=K((function(t,e=0){return F(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),l.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){const n=Math.pow(2,8*r-1);D(this,t,e,r,n-1,-n)}let i=0,o=1,a=0;for(this[e]=255&t;++i>>=0,!n){const n=Math.pow(2,8*r-1);D(this,t,e,r,n-1,-n)}let i=r-1,o=1,a=0;for(this[e+i]=255&t;--i>=0&&(o*=256);)t<0&&0===a&&0!==this[e+i+1]&&(a=1),this[e+i]=(t/o|0)-a&255;return e+r},l.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||D(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},l.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||D(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},l.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||D(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},l.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||D(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},l.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||D(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},l.prototype.writeBigInt64LE=K((function(t,e=0){return I(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),l.prototype.writeBigInt64BE=K((function(t,e=0){return F(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),l.prototype.writeFloatLE=function(t,e,r){return P(this,t,e,!0,r)},l.prototype.writeFloatBE=function(t,e,r){return P(this,t,e,!1,r)},l.prototype.writeDoubleLE=function(t,e,r){return j(this,t,e,!0,r)},l.prototype.writeDoubleBE=function(t,e,r){return j(this,t,e,!1,r)},l.prototype.copy=function(t,e,r,n){if(!l.isBuffer(t))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(i=e;i=n+4;r-=3)e=`_${t.slice(r-3,r)}${e}`;return`${t.slice(0,r)}${e}`}function G(t,e,r,n,i,o){if(t>r||t3?0===e||e===BigInt(0)?`>= 0${n} and < 2${n} ** ${8*(o+1)}${n}`:`>= -(2${n} ** ${8*(o+1)-1}${n}) and < 2 ** ${8*(o+1)-1}${n}`:`>= ${e}${n} and <= ${r}${n}`,new N.ERR_OUT_OF_RANGE("value",i,t)}!function(t,e,r){V(e,"offset"),void 0!==t[e]&&void 0!==t[e+r]||H(e,t.length-(r+1))}(n,i,o)}function V(t,e){if("number"!=typeof t)throw new N.ERR_INVALID_ARG_TYPE(e,"number",t)}function H(t,e,r){if(Math.floor(t)!==t)throw V(t,r),new N.ERR_OUT_OF_RANGE(r||"offset","an integer",t);if(e<0)throw new N.ERR_BUFFER_OUT_OF_BOUNDS;throw new N.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${e}`,t)}B("ERR_BUFFER_OUT_OF_BOUNDS",(function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),B("ERR_INVALID_ARG_TYPE",(function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`}),TypeError),B("ERR_OUT_OF_RANGE",(function(t,e,r){let n=`The value of "${t}" is out of range.`,i=r;return Number.isInteger(r)&&Math.abs(r)>2**32?i=U(String(r)):"bigint"==typeof r&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=U(i)),i+="n"),n+=` It must be ${e}. Received ${i}`,n}),RangeError);const W=/[^+/0-9A-Za-z-_]/g;function q(t,e){let r;e=e||1/0;const n=t.length;let i=null;const o=[];for(let a=0;a55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(a+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function Y(t){return n.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(W,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function Z(t,e,r,n){let i;for(i=0;i=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function X(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function $(t){return t!=t}const J=function(){const t="0123456789abcdef",e=new Array(256);for(let r=0;r<16;++r){const n=16*r;for(let i=0;i<16;++i)e[n+i]=t[r]+t[i]}return e}();function K(t){return"undefined"==typeof BigInt?Q:t}function Q(){throw new Error("BigInt not supported")}},24310:(t,e,r)=>{"use strict";var n=r(59412),i=r(61398),o=i(n("String.prototype.indexOf"));t.exports=function(t,e){var r=n(t,!!e);return"function"==typeof r&&o(t,".prototype.")>-1?i(r):r}},61398:(t,e,r)=>{"use strict";var n=r(35366),i=r(59412),o=r(86928),a=r(48744),s=i("%Function.prototype.apply%"),l=i("%Function.prototype.call%"),c=i("%Reflect.apply%",!0)||n.call(l,s),u=r(38232),h=i("%Math.max%");t.exports=function(t){if("function"!=typeof t)throw new a("a function is required");var e=c(n,l,arguments);return o(e,1+h(0,t.length-(arguments.length-1)),!0)};var d=function(){return c(n,s,arguments)};u?u(t.exports,"apply",{value:d}):t.exports.apply=d},90897:t=>{t.exports=function(t,e,r){return er?r:t:te?e:t}},92173:(t,e,r)=>{"use strict";var n=r(90897);function i(t,e){null==e&&(e=!0);var r=t[0],i=t[1],o=t[2],a=t[3];return null==a&&(a=e?1:255),e&&(r*=255,i*=255,o*=255,a*=255),16777216*(r=255&n(r,0,255))+((i=255&n(i,0,255))<<16)+((o=255&n(o,0,255))<<8)+(255&n(a,0,255))}t.exports=i,t.exports.to=i,t.exports.from=function(t,e){var r=(t=+t)>>>24,n=(16711680&t)>>>16,i=(65280&t)>>>8,o=255&t;return!1===e?[r,n,i,o]:[r/255,n/255,i/255,o/255]}},22319:t=>{"use strict";t.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}},34463:(t,e,r)=>{"use strict";var n=r(31562),i=r(90897),o=r(22366);t.exports=function(t,e){"float"!==e&&e||(e="array"),"uint"===e&&(e="uint8"),"uint_clamped"===e&&(e="uint8_clamped");var r=new(o(e))(4),a="uint8"!==e&&"uint8_clamped"!==e;return t.length&&"string"!=typeof t||((t=n(t))[0]/=255,t[1]/=255,t[2]/=255),function(t){return t instanceof Uint8Array||t instanceof Uint8ClampedArray||!!(Array.isArray(t)&&(t[0]>1||0===t[0])&&(t[1]>1||0===t[1])&&(t[2]>1||0===t[2])&&(!t[3]||t[3]>1))}(t)?(r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=null!=t[3]?t[3]:255,a&&(r[0]/=255,r[1]/=255,r[2]/=255,r[3]/=255),r):(a?(r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=null!=t[3]?t[3]:1):(r[0]=i(Math.floor(255*t[0]),0,255),r[1]=i(Math.floor(255*t[1]),0,255),r[2]=i(Math.floor(255*t[2]),0,255),r[3]=null==t[3]?255:i(Math.floor(255*t[3]),0,255)),r)}},11211:(t,e,r)=>{"use strict";var n=r(22319);t.exports=function(t){var e,r,o=[],a=1;if("string"==typeof t)if(t=t.toLowerCase(),n[t])o=n[t].slice(),r="rgb";else if("transparent"===t)a=0,r="rgb",o=[0,0,0];else if(/^#[A-Fa-f0-9]+$/.test(t)){var s=t.slice(1);a=1,(u=s.length)<=4?(o=[parseInt(s[0]+s[0],16),parseInt(s[1]+s[1],16),parseInt(s[2]+s[2],16)],4===u&&(a=parseInt(s[3]+s[3],16)/255)):(o=[parseInt(s[0]+s[1],16),parseInt(s[2]+s[3],16),parseInt(s[4]+s[5],16)],8===u&&(a=parseInt(s[6]+s[7],16)/255)),o[0]||(o[0]=0),o[1]||(o[1]=0),o[2]||(o[2]=0),r="rgb"}else if(e=/^((?:rgb|hs[lvb]|hwb|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms)a?)\s*\(([^\)]*)\)/.exec(t)){var l=e[1],c="rgb"===l;r=s=l.replace(/a$/,"");var u="cmyk"===s?4:"gray"===s?1:3;o=e[2].trim().split(/\s*[,\/]\s*|\s+/).map((function(t,e){if(/%$/.test(t))return e===u?parseFloat(t)/100:"rgb"===s?255*parseFloat(t)/100:parseFloat(t);if("h"===s[e]){if(/deg$/.test(t))return parseFloat(t);if(void 0!==i[t])return i[t]}return parseFloat(t)})),l===s&&o.push(1),a=c||void 0===o[u]?1:o[u],o=o.slice(0,u)}else t.length>10&&/[0-9](?:\s|\/)/.test(t)&&(o=t.match(/([0-9]+)/g).map((function(t){return parseFloat(t)})),r=t.match(/([a-z])/gi).join("").toLowerCase());else isNaN(t)?Array.isArray(t)||t.length?(o=[t[0],t[1],t[2]],r="rgb",a=4===t.length?t[3]:1):t instanceof Object&&(null!=t.r||null!=t.red||null!=t.R?(r="rgb",o=[t.r||t.red||t.R||0,t.g||t.green||t.G||0,t.b||t.blue||t.B||0]):(r="hsl",o=[t.h||t.hue||t.H||0,t.s||t.saturation||t.S||0,t.l||t.lightness||t.L||t.b||t.brightness]),a=t.a||t.alpha||t.opacity||1,null!=t.opacity&&(a/=100)):(r="rgb",o=[t>>>16,(65280&t)>>>8,255&t]);return{space:r,values:o,alpha:a}};var i={red:0,orange:60,yellow:120,green:180,blue:240,purple:300}},31562:(t,e,r)=>{"use strict";var n=r(11211),i=r(31497),o=r(90897);t.exports=function(t){var e,r=n(t);return r.space?((e=Array(3))[0]=o(r.values[0],0,255),e[1]=o(r.values[1],0,255),e[2]=o(r.values[2],0,255),"h"===r.space[0]&&(e=i.rgb(e)),e.push(o(r.alpha,0,1)),e):[]}},31497:(t,e,r)=>{"use strict";var n=r(65837);t.exports={name:"hsl",min:[0,0,0],max:[360,100,100],channel:["hue","saturation","lightness"],alias:["HSL"],rgb:function(t){var e,r,n,i,o,a=t[0]/360,s=t[1]/100,l=t[2]/100;if(0===s)return[o=255*l,o,o];e=2*l-(r=l<.5?l*(1+s):l+s-l*s),i=[0,0,0];for(var c=0;c<3;c++)(n=a+1/3*-(c-1))<0?n++:n>1&&n--,o=6*n<1?e+6*(r-e)*n:2*n<1?r:3*n<2?e+(r-e)*(2/3-n)*6:e,i[c]=255*o;return i}},n.hsl=function(t){var e,r,n=t[0]/255,i=t[1]/255,o=t[2]/255,a=Math.min(n,i,o),s=Math.max(n,i,o),l=s-a;return s===a?e=0:n===s?e=(i-o)/l:i===s?e=2+(o-n)/l:o===s&&(e=4+(n-i)/l),(e=Math.min(60*e,360))<0&&(e+=360),r=(a+s)/2,[e,100*(s===a?0:r<=.5?l/(s+a):l/(2-s-a)),100*r]}},65837:t=>{"use strict";t.exports={name:"rgb",min:[0,0,0],max:[255,255,255],channel:["red","green","blue"],alias:["RGB"]}},86643:()=>{!function(){"use strict";if("undefined"!=typeof document&&!("adoptedStyleSheets"in document)){var t="ShadyCSS"in window&&!ShadyCSS.nativeShadow,e=document.implementation.createHTMLDocument(""),r=new WeakMap,n="object"==typeof DOMException?Error:DOMException,i=Object.defineProperty,o=Array.prototype.forEach,a=/@import.+?;?$/gm,s=CSSStyleSheet.prototype;s.replace=function(){return Promise.reject(new n("Can't call replace on non-constructed CSSStyleSheets."))},s.replaceSync=function(){throw new n("Failed to execute 'replaceSync' on 'CSSStyleSheet': Can't call replaceSync on non-constructed CSSStyleSheets.")};var l=new WeakMap,c=new WeakMap,u=new WeakMap,h=new WeakMap,d=S.prototype;d.replace=function(t){try{return this.replaceSync(t),Promise.resolve(this)}catch(t){return Promise.reject(t)}},d.replaceSync=function(t){if(T(this),"string"==typeof t){var e=this;l.get(e).textContent=function(t){var e=t.replace(a,"");return e!==t&&console.warn("@import rules are not allowed here. See https://github.com/WICG/construct-stylesheets/issues/119#issuecomment-588352418"),e.trim()}(t),h.set(e,[]),c.get(e).forEach((function(t){t.isConnected()&&M(e,A(e,t))}))}},i(d,"cssRules",{configurable:!0,enumerable:!0,get:function(){return T(this),l.get(this).sheet.cssRules}}),i(d,"media",{configurable:!0,enumerable:!0,get:function(){return T(this),l.get(this).sheet.media}}),["addRule","deleteRule","insertRule","removeRule"].forEach((function(t){d[t]=function(){var e=this;T(e);var r=arguments;h.get(e).push({method:t,args:r}),c.get(e).forEach((function(n){if(n.isConnected()){var i=A(e,n).sheet;i[t].apply(i,r)}}));var n=l.get(e).sheet;return n[t].apply(n,r)}})),i(S,Symbol.hasInstance,{configurable:!0,value:w});var f={childList:!0,subtree:!0},p=new WeakMap,m=new WeakMap,g=new WeakMap,v=new WeakMap;if(D.prototype={isConnected:function(){var t=m.get(this);return t instanceof Document?"loading"!==t.readyState:function(t){return"isConnected"in t?t.isConnected:document.contains(t)}(t.host)},connect:function(){var t=z(this);v.get(this).observe(t,f),g.get(this).length>0&&O(this),L(t,(function(t){C(t).connect()}))},disconnect:function(){v.get(this).disconnect()},update:function(t){var e=this,r=m.get(e)===document?"Document":"ShadowRoot";if(!Array.isArray(t))throw new TypeError("Failed to set the 'adoptedStyleSheets' property on "+r+": Iterator getter is not callable.");if(!t.every(w))throw new TypeError("Failed to set the 'adoptedStyleSheets' property on "+r+": Failed to convert value to 'CSSStyleSheet'");if(t.some(k))throw new TypeError("Failed to set the 'adoptedStyleSheets' property on "+r+": Can't adopt non-constructed stylesheets");e.sheets=t;var n,i,o=g.get(e),a=(n=t).filter((function(t,e){return n.indexOf(t)===e}));(i=a,o.filter((function(t){return-1===i.indexOf(t)}))).forEach((function(t){var r;(r=A(t,e)).parentNode.removeChild(r),function(t,e){u.get(t).delete(e),c.set(t,c.get(t).filter((function(t){return t!==e})))}(t,e)})),g.set(e,a),e.isConnected()&&a.length>0&&O(e)}},window.CSSStyleSheet=S,E(Document),"ShadowRoot"in window){E(ShadowRoot);var b=Element.prototype,y=b.attachShadow;b.attachShadow=function(t){var e=y.call(this,t);return"closed"===t.mode&&r.set(this,e),e}}var x=C(document);x.isConnected()?x.connect():document.addEventListener("DOMContentLoaded",x.connect.bind(x))}function _(t){return t.shadowRoot||r.get(t)}function w(t){return"object"==typeof t&&(d.isPrototypeOf(t)||s.isPrototypeOf(t))}function k(t){return"object"==typeof t&&s.isPrototypeOf(t)}function A(t,e){return u.get(t).get(e)}function M(t,e){requestAnimationFrame((function(){e.textContent=l.get(t).textContent,h.get(t).forEach((function(t){return e.sheet[t.method].apply(e.sheet,t.args)}))}))}function T(t){if(!l.has(t))throw new TypeError("Illegal invocation")}function S(){var t=this,r=document.createElement("style");e.body.appendChild(r),l.set(t,r),c.set(t,[]),u.set(t,new WeakMap),h.set(t,[])}function C(t){var e=p.get(t);return e||(e=new D(t),p.set(t,e)),e}function E(t){i(t.prototype,"adoptedStyleSheets",{configurable:!0,enumerable:!0,get:function(){return C(this).sheets},set:function(t){C(this).update(t)}})}function L(t,e){for(var r=document.createNodeIterator(t,NodeFilter.SHOW_ELEMENT,(function(t){return _(t)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT}),null,!1),n=void 0;n=r.nextNode();)e(_(n))}function z(t){var e=m.get(t);return e instanceof Document?e.body:e}function O(t){var e=document.createDocumentFragment(),r=g.get(t),n=v.get(t),i=z(t);n.disconnect(),r.forEach((function(r){e.appendChild(A(r,t)||function(t,e){var r=document.createElement("style");return u.get(t).set(e,r),c.get(t).push(e),r}(r,t))})),i.insertBefore(e,null),n.observe(i,f),r.forEach((function(e){M(e,A(e,t))}))}function D(e){var r=this;r.sheets=[],m.set(r,e),g.set(r,[]),v.set(r,new MutationObserver((function(e,n){document?e.forEach((function(e){t||o.call(e.addedNodes,(function(t){t instanceof Element&&L(t,(function(t){C(t).connect()}))})),o.call(e.removedNodes,(function(e){e instanceof Element&&(function(t,e){return e instanceof HTMLStyleElement&&g.get(t).some((function(e){return A(e,t)}))}(r,e)&&O(r),t||L(e,(function(t){C(t).disconnect()})))}))})):n.disconnect()})))}}()},82393:(t,e,r)=>{"use strict";t.exports={parse:r(60062),stringify:r(40288)}},15305:(t,e,r)=>{"use strict";var n=r(23648);t.exports={isSize:function(t){return/^[\d\.]/.test(t)||-1!==t.indexOf("/")||-1!==n.indexOf(t)}}},60062:(t,e,r)=>{"use strict";var n=r(51183),i=r(54324),o=r(94316),a=r(99803),s=r(87486),l=r(2362),c=r(46492),u=r(15305).isSize;t.exports=d;var h=d.cache={};function d(t){if("string"!=typeof t)throw new Error("Font argument must be a string.");if(h[t])return h[t];if(""===t)throw new Error("Cannot parse an empty string.");if(-1!==o.indexOf(t))return h[t]={system:t};for(var e,r={style:"normal",variant:"normal",weight:"normal",stretch:"normal",lineHeight:"normal",size:"1rem",family:["serif"]},d=c(t,/\s+/);e=d.shift();){if(-1!==i.indexOf(e))return["style","variant","weight","stretch"].forEach((function(t){r[t]=e})),h[t]=r;if(-1===s.indexOf(e))if("normal"!==e&&"small-caps"!==e)if(-1===l.indexOf(e)){if(-1===a.indexOf(e)){if(u(e)){var p=c(e,"/");if(r.size=p[0],null!=p[1]?r.lineHeight=f(p[1]):"/"===d[0]&&(d.shift(),r.lineHeight=f(d.shift())),!d.length)throw new Error("Missing required font-family.");return r.family=c(d.join(" "),/\s*,\s*/).map(n),h[t]=r}throw new Error("Unknown or unsupported font token: "+e)}r.weight=e}else r.stretch=e;else r.variant=e;else r.style=e}throw new Error("Missing required font-size.")}function f(t){var e=parseFloat(t);return e.toString()===t?e:t}},40288:(t,e,r)=>{"use strict";var n=r(9994),i=r(15305).isSize,o=p(r(54324)),a=p(r(94316)),s=p(r(99803)),l=p(r(87486)),c=p(r(2362)),u={normal:1,"small-caps":1},h={serif:1,"sans-serif":1,monospace:1,cursive:1,fantasy:1,"system-ui":1},d="serif";function f(t,e){if(t&&!e[t]&&!o[t])throw Error("Unknown keyword `"+t+"`");return t}function p(t){for(var e={},r=0;r{"use strict";t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var r="",n=void 0!==e[5];return e[4]&&(r+="@supports (".concat(e[4],") {")),e[2]&&(r+="@media ".concat(e[2]," {")),n&&(r+="@layer".concat(e[5].length>0?" ".concat(e[5]):""," {")),r+=t(e),n&&(r+="}"),e[2]&&(r+="}"),e[4]&&(r+="}"),r})).join("")},e.i=function(t,r,n,i,o){"string"==typeof t&&(t=[[null,t,void 0]]);var a={};if(n)for(var s=0;s0?" ".concat(u[5]):""," {").concat(u[1],"}")),u[5]=o),r&&(u[2]?(u[1]="@media ".concat(u[2]," {").concat(u[1],"}"),u[2]=r):u[2]=r),i&&(u[4]?(u[1]="@supports (".concat(u[4],") {").concat(u[1],"}"),u[4]=i):u[4]="".concat(i)),e.push(u))}},e}},21906:t=>{"use strict";t.exports=function(t,e){return e||(e={}),t?(t=String(t.__esModule?t.default:t),/^['"].*['"]$/.test(t)&&(t=t.slice(1,-1)),e.hash&&(t+=e.hash),/["'() \t\n]|(%20)/.test(t)||e.needQuotes?'"'.concat(t.replace(/"/g,'\\"').replace(/\n/g,"\\n"),'"'):t):t}},78706:t=>{"use strict";t.exports=function(t){return t[1]}},39683:(t,e,r)=>{"use strict";var n,i=r(59738),o=r(10040),a=r(4216),s=r(15498),l=r(54863),c=r(30829),u=Function.prototype.bind,h=Object.defineProperty,d=Object.prototype.hasOwnProperty;n=function(t,e,r){var n,i=o(e)&&a(e.value);return delete(n=s(e)).writable,delete n.value,n.get=function(){return!r.overwriteDefinition&&d.call(this,t)?i:(e.value=u.call(i,r.resolveContext?r.resolveContext(this):this),h(this,t,e),this[t])},n},t.exports=function(t){var e=l(arguments[1]);return i(e.resolveContext)&&a(e.resolveContext),c(t,(function(t,r){return n(r,t,e)}))}},86142:(t,e,r)=>{"use strict";var n=r(59738),i=r(15034),o=r(18021),a=r(54863),s=r(79813);(t.exports=function(t,e){var r,i,l,c,u;return arguments.length<2||"string"!=typeof t?(c=e,e=t,t=null):c=arguments[2],n(t)?(r=s.call(t,"c"),i=s.call(t,"e"),l=s.call(t,"w")):(r=l=!0,i=!1),u={value:e,configurable:r,enumerable:i,writable:l},c?o(a(c),u):u}).gs=function(t,e,r){var l,c,u,h;return"string"!=typeof t?(u=r,r=e,e=t,t=null):u=arguments[3],n(e)?i(e)?n(r)?i(r)||(u=r,r=void 0):r=void 0:(u=e,e=r=void 0):e=void 0,n(t)?(l=s.call(t,"c"),c=s.call(t,"e")):(l=!0,c=!1),h={get:e,set:r,configurable:l,enumerable:c},u?o(a(u),h):h}},31830:(t,e,r)=>{"use strict";function n(t,e){if((r=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var r,n=t.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+t.slice(r+1)]}r.d(e,{GP:()=>d,OE:()=>m});var i,o=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function a(t){if(!(e=o.exec(t)))throw new Error("invalid format: "+t);var e;return new s({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}function s(t){this.fill=void 0===t.fill?" ":t.fill+"",this.align=void 0===t.align?">":t.align+"",this.sign=void 0===t.sign?"-":t.sign+"",this.symbol=void 0===t.symbol?"":t.symbol+"",this.zero=!!t.zero,this.width=void 0===t.width?void 0:+t.width,this.comma=!!t.comma,this.precision=void 0===t.precision?void 0:+t.precision,this.trim=!!t.trim,this.type=void 0===t.type?"":t.type+""}function l(t,e){var r=n(t,e);if(!r)return t+"";var i=r[0],o=r[1];return o<0?"0."+new Array(-o).join("0")+i:i.length>o+1?i.slice(0,o+1)+"."+i.slice(o+1):i+new Array(o-i.length+2).join("0")}a.prototype=s.prototype,s.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};const c={"%":function(t,e){return(100*t).toFixed(e)},b:function(t){return Math.round(t).toString(2)},c:function(t){return t+""},d:function(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)},e:function(t,e){return t.toExponential(e)},f:function(t,e){return t.toFixed(e)},g:function(t,e){return t.toPrecision(e)},o:function(t){return Math.round(t).toString(8)},p:function(t,e){return l(100*t,e)},r:l,s:function(t,e){var r=n(t,e);if(!r)return t+"";var o=r[0],a=r[1],s=a-(i=3*Math.max(-8,Math.min(8,Math.floor(a/3))))+1,l=o.length;return s===l?o:s>l?o+new Array(s-l+1).join("0"):s>0?o.slice(0,s)+"."+o.slice(s):"0."+new Array(1-s).join("0")+n(t,Math.max(0,e+s-1))[0]},X:function(t){return Math.round(t).toString(16).toUpperCase()},x:function(t){return Math.round(t).toString(16)}};function u(t){return t}var h,d,f=Array.prototype.map,p=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function m(t){var e,r,o=void 0===t.grouping||void 0===t.thousands?u:(e=f.call(t.grouping,Number),r=t.thousands+"",function(t,n){for(var i=t.length,o=[],a=0,s=e[0],l=0;i>0&&s>0&&(l+s+1>n&&(s=Math.max(1,n-l)),o.push(t.substring(i-=s,i+s)),!((l+=s+1)>n));)s=e[a=(a+1)%e.length];return o.reverse().join(r)}),s=void 0===t.currency?"":t.currency[0]+"",l=void 0===t.currency?"":t.currency[1]+"",h=void 0===t.decimal?".":t.decimal+"",d=void 0===t.numerals?u:function(t){return function(e){return e.replace(/[0-9]/g,(function(e){return t[+e]}))}}(f.call(t.numerals,String)),m=void 0===t.percent?"%":t.percent+"",g=void 0===t.minus?"-":t.minus+"",v=void 0===t.nan?"NaN":t.nan+"";function b(t){var e=(t=a(t)).fill,r=t.align,n=t.sign,u=t.symbol,f=t.zero,b=t.width,y=t.comma,x=t.precision,_=t.trim,w=t.type;"n"===w?(y=!0,w="g"):c[w]||(void 0===x&&(x=12),_=!0,w="g"),(f||"0"===e&&"="===r)&&(f=!0,e="0",r="=");var k="$"===u?s:"#"===u&&/[boxX]/.test(w)?"0"+w.toLowerCase():"",A="$"===u?l:/[%p]/.test(w)?m:"",M=c[w],T=/[defgprs%]/.test(w);function S(t){var a,s,l,c=k,u=A;if("c"===w)u=M(t)+u,t="";else{var m=(t=+t)<0||1/t<0;if(t=isNaN(t)?v:M(Math.abs(t),x),_&&(t=function(t){t:for(var e,r=t.length,n=1,i=-1;n0&&(i=0)}return i>0?t.slice(0,i)+t.slice(e+1):t}(t)),m&&0==+t&&"+"!==n&&(m=!1),c=(m?"("===n?n:g:"-"===n||"("===n?"":n)+c,u=("s"===w?p[8+i/3]:"")+u+(m&&"("===n?")":""),T)for(a=-1,s=t.length;++a(l=t.charCodeAt(a))||l>57){u=(46===l?h+t.slice(a+1):t.slice(a))+u,t=t.slice(0,a);break}}y&&!f&&(t=o(t,1/0));var S=c.length+t.length+u.length,C=S>1)+c+t+u+C.slice(S);break;default:t=C+c+t+u}return d(t)}return x=void 0===x?6:/[gprs]/.test(w)?Math.max(1,Math.min(21,x)):Math.max(0,Math.min(20,x)),S.toString=function(){return t+""},S}return{format:b,formatPrefix:function(t,e){var r,i=b(((t=a(t)).type="f",t)),o=3*Math.max(-8,Math.min(8,Math.floor((r=e,((r=n(Math.abs(r)))?r[1]:NaN)/3)))),s=Math.pow(10,-o),l=p[8+o/3];return function(t){return i(s*t)+l}}}}h=m({decimal:".",thousands:",",grouping:[3],currency:["$",""],minus:"-"}),d=h.format,h.formatPrefix},79969:(t,e,r)=>{"use strict";r.d(e,{DC:()=>p,de:()=>d,aL:()=>m});var n=r(64772),i=r(79896),o=r(61396),a=r(67848),s=r(28397),l=r(34045);function c(t){if(0<=t.y&&t.y<100){var e=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return e.setFullYear(t.y),e}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function u(t){if(0<=t.y&&t.y<100){var e=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return e.setUTCFullYear(t.y),e}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function h(t,e,r){return{y:t,m:e,d:r,H:0,M:0,S:0,L:0}}function d(t){var e=t.dateTime,r=t.date,s=t.time,l=t.periods,d=t.days,f=t.shortDays,p=t.months,m=t.shortMonths,v=w(l),b=k(l),y=w(d),x=k(d),_=w(f),et=k(f),_t=w(p),Dt=k(p),It=w(m),Ft=k(m),Rt={a:function(t){return f[t.getDay()]},A:function(t){return d[t.getDay()]},b:function(t){return m[t.getMonth()]},B:function(t){return p[t.getMonth()]},c:null,d:H,e:H,f:X,g:at,G:lt,H:W,I:q,j:Y,L:Z,m:$,M:J,p:function(t){return l[+(t.getHours()>=12)]},q:function(t){return 1+~~(t.getMonth()/3)},Q:zt,s:Ot,S:K,u:Q,U:tt,V:rt,w:nt,W:it,x:null,X:null,y:ot,Y:st,Z:ct,"%":Lt},Pt={a:function(t){return f[t.getUTCDay()]},A:function(t){return d[t.getUTCDay()]},b:function(t){return m[t.getUTCMonth()]},B:function(t){return p[t.getUTCMonth()]},c:null,d:ut,e:ut,f:mt,g:Tt,G:Ct,H:ht,I:dt,j:ft,L:pt,m:gt,M:vt,p:function(t){return l[+(t.getUTCHours()>=12)]},q:function(t){return 1+~~(t.getUTCMonth()/3)},Q:zt,s:Ot,S:bt,u:yt,U:xt,V:wt,w:kt,W:At,x:null,X:null,y:Mt,Y:St,Z:Et,"%":Lt},jt={a:function(t,e,r){var n=_.exec(e.slice(r));return n?(t.w=et[n[0].toLowerCase()],r+n[0].length):-1},A:function(t,e,r){var n=y.exec(e.slice(r));return n?(t.w=x[n[0].toLowerCase()],r+n[0].length):-1},b:function(t,e,r){var n=It.exec(e.slice(r));return n?(t.m=Ft[n[0].toLowerCase()],r+n[0].length):-1},B:function(t,e,r){var n=_t.exec(e.slice(r));return n?(t.m=Dt[n[0].toLowerCase()],r+n[0].length):-1},c:function(t,r,n){return Ut(t,e,r,n)},d:I,e:I,f:B,g:L,G:E,H:R,I:R,j:F,L:N,m:D,M:P,p:function(t,e,r){var n=v.exec(e.slice(r));return n?(t.p=b[n[0].toLowerCase()],r+n[0].length):-1},q:O,Q:G,s:V,S:j,u:M,U:T,V:S,w:A,W:C,x:function(t,e,n){return Ut(t,r,e,n)},X:function(t,e,r){return Ut(t,s,e,r)},y:L,Y:E,Z:z,"%":U};function Nt(t,e){return function(r){var n,i,o,a=[],s=-1,l=0,c=t.length;for(r instanceof Date||(r=new Date(+r));++s53)return null;"w"in d||(d.w=1),"Z"in d?(l=(s=u(h(d.y,0,1))).getUTCDay(),s=l>4||0===l?n.rt.ceil(s):(0,n.rt)(s),s=i.A.offset(s,7*(d.V-1)),d.y=s.getUTCFullYear(),d.m=s.getUTCMonth(),d.d=s.getUTCDate()+(d.w+6)%7):(l=(s=c(h(d.y,0,1))).getDay(),s=l>4||0===l?o.By.ceil(s):(0,o.By)(s),s=a.A.offset(s,7*(d.V-1)),d.y=s.getFullYear(),d.m=s.getMonth(),d.d=s.getDate()+(d.w+6)%7)}else("W"in d||"U"in d)&&("w"in d||(d.w="u"in d?d.u%7:"W"in d?1:0),l="Z"in d?u(h(d.y,0,1)).getUTCDay():c(h(d.y,0,1)).getDay(),d.m=0,d.d="W"in d?(d.w+6)%7+7*d.W-(l+5)%7:d.w+7*d.U-(l+6)%7);return"Z"in d?(d.H+=d.Z/100|0,d.M+=d.Z%100,u(d)):c(d)}}function Ut(t,e,r,n){for(var i,o,a=0,s=e.length,l=r.length;a=l)return-1;if(37===(i=e.charCodeAt(a++))){if(i=e.charAt(a++),!(o=jt[i in g?e.charAt(a++):i])||(n=o(t,r,n))<0)return-1}else if(i!=r.charCodeAt(n++))return-1}return n}return Rt.x=Nt(r,Rt),Rt.X=Nt(s,Rt),Rt.c=Nt(e,Rt),Pt.x=Nt(r,Pt),Pt.X=Nt(s,Pt),Pt.c=Nt(e,Pt),{format:function(t){var e=Nt(t+="",Rt);return e.toString=function(){return t},e},parse:function(t){var e=Bt(t+="",!1);return e.toString=function(){return t},e},utcFormat:function(t){var e=Nt(t+="",Pt);return e.toString=function(){return t},e},utcParse:function(t){var e=Bt(t+="",!0);return e.toString=function(){return t},e}}}var f,p,m,g={"-":"",_:" ",0:"0"},v=/^\s*\d+/,b=/^%/,y=/[\\^$*+?|[\]().{}]/g;function x(t,e,r){var n=t<0?"-":"",i=(n?-t:t)+"",o=i.length;return n+(o68?1900:2e3),r+n[0].length):-1}function z(t,e,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(r,r+6));return n?(t.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function O(t,e,r){var n=v.exec(e.slice(r,r+1));return n?(t.q=3*n[0]-3,r+n[0].length):-1}function D(t,e,r){var n=v.exec(e.slice(r,r+2));return n?(t.m=n[0]-1,r+n[0].length):-1}function I(t,e,r){var n=v.exec(e.slice(r,r+2));return n?(t.d=+n[0],r+n[0].length):-1}function F(t,e,r){var n=v.exec(e.slice(r,r+3));return n?(t.m=0,t.d=+n[0],r+n[0].length):-1}function R(t,e,r){var n=v.exec(e.slice(r,r+2));return n?(t.H=+n[0],r+n[0].length):-1}function P(t,e,r){var n=v.exec(e.slice(r,r+2));return n?(t.M=+n[0],r+n[0].length):-1}function j(t,e,r){var n=v.exec(e.slice(r,r+2));return n?(t.S=+n[0],r+n[0].length):-1}function N(t,e,r){var n=v.exec(e.slice(r,r+3));return n?(t.L=+n[0],r+n[0].length):-1}function B(t,e,r){var n=v.exec(e.slice(r,r+6));return n?(t.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function U(t,e,r){var n=b.exec(e.slice(r,r+1));return n?r+n[0].length:-1}function G(t,e,r){var n=v.exec(e.slice(r));return n?(t.Q=+n[0],r+n[0].length):-1}function V(t,e,r){var n=v.exec(e.slice(r));return n?(t.s=+n[0],r+n[0].length):-1}function H(t,e){return x(t.getDate(),e,2)}function W(t,e){return x(t.getHours(),e,2)}function q(t,e){return x(t.getHours()%12||12,e,2)}function Y(t,e){return x(1+a.A.count((0,s.A)(t),t),e,3)}function Z(t,e){return x(t.getMilliseconds(),e,3)}function X(t,e){return Z(t,e)+"000"}function $(t,e){return x(t.getMonth()+1,e,2)}function J(t,e){return x(t.getMinutes(),e,2)}function K(t,e){return x(t.getSeconds(),e,2)}function Q(t){var e=t.getDay();return 0===e?7:e}function tt(t,e){return x(o.fz.count((0,s.A)(t)-1,t),e,2)}function et(t){var e=t.getDay();return e>=4||0===e?(0,o.dt)(t):o.dt.ceil(t)}function rt(t,e){return t=et(t),x(o.dt.count((0,s.A)(t),t)+(4===(0,s.A)(t).getDay()),e,2)}function nt(t){return t.getDay()}function it(t,e){return x(o.By.count((0,s.A)(t)-1,t),e,2)}function ot(t,e){return x(t.getFullYear()%100,e,2)}function at(t,e){return x((t=et(t)).getFullYear()%100,e,2)}function st(t,e){return x(t.getFullYear()%1e4,e,4)}function lt(t,e){var r=t.getDay();return x((t=r>=4||0===r?(0,o.dt)(t):o.dt.ceil(t)).getFullYear()%1e4,e,4)}function ct(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+x(e/60|0,"0",2)+x(e%60,"0",2)}function ut(t,e){return x(t.getUTCDate(),e,2)}function ht(t,e){return x(t.getUTCHours(),e,2)}function dt(t,e){return x(t.getUTCHours()%12||12,e,2)}function ft(t,e){return x(1+i.A.count((0,l.A)(t),t),e,3)}function pt(t,e){return x(t.getUTCMilliseconds(),e,3)}function mt(t,e){return pt(t,e)+"000"}function gt(t,e){return x(t.getUTCMonth()+1,e,2)}function vt(t,e){return x(t.getUTCMinutes(),e,2)}function bt(t,e){return x(t.getUTCSeconds(),e,2)}function yt(t){var e=t.getUTCDay();return 0===e?7:e}function xt(t,e){return x(n.Hl.count((0,l.A)(t)-1,t),e,2)}function _t(t){var e=t.getUTCDay();return e>=4||0===e?(0,n.pT)(t):n.pT.ceil(t)}function wt(t,e){return t=_t(t),x(n.pT.count((0,l.A)(t),t)+(4===(0,l.A)(t).getUTCDay()),e,2)}function kt(t){return t.getUTCDay()}function At(t,e){return x(n.rt.count((0,l.A)(t)-1,t),e,2)}function Mt(t,e){return x(t.getUTCFullYear()%100,e,2)}function Tt(t,e){return x((t=_t(t)).getUTCFullYear()%100,e,2)}function St(t,e){return x(t.getUTCFullYear()%1e4,e,4)}function Ct(t,e){var r=t.getUTCDay();return x((t=r>=4||0===r?(0,n.pT)(t):n.pT.ceil(t)).getUTCFullYear()%1e4,e,4)}function Et(){return"+0000"}function Lt(){return"%"}function zt(t){return+t}function Ot(t){return Math.floor(+t/1e3)}f=d({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]}),p=f.format,f.parse,m=f.utcFormat,f.utcParse},67848:(t,e,r)=>{"use strict";r.d(e,{A:()=>a,_:()=>s});var n=r(94825),i=r(37968),o=(0,n.A)((function(t){t.setHours(0,0,0,0)}),(function(t,e){t.setDate(t.getDate()+e)}),(function(t,e){return(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*i.rR)/i.Nm}),(function(t){return t.getDate()-1}));const a=o;var s=o.range},37968:(t,e,r)=>{"use strict";r.d(e,{Fq:()=>s,JJ:()=>o,Nm:()=>a,Tt:()=>n,rR:()=>i});var n=1e3,i=6e4,o=36e5,a=864e5,s=6048e5},55622:(t,e,r)=>{"use strict";r.r(e),r.d(e,{timeDay:()=>v.A,timeDays:()=>v._,timeFriday:()=>b.Sh,timeFridays:()=>b.tz,timeHour:()=>m,timeHours:()=>g,timeInterval:()=>n.A,timeMillisecond:()=>o,timeMilliseconds:()=>a,timeMinute:()=>d,timeMinutes:()=>f,timeMonday:()=>b.By,timeMondays:()=>b.KP,timeMonth:()=>x,timeMonths:()=>_,timeSaturday:()=>b.kS,timeSaturdays:()=>b.t$,timeSecond:()=>c,timeSeconds:()=>u,timeSunday:()=>b.fz,timeSundays:()=>b.se,timeThursday:()=>b.dt,timeThursdays:()=>b.Q$,timeTuesday:()=>b.eQ,timeTuesdays:()=>b.yW,timeWednesday:()=>b.l3,timeWednesdays:()=>b.gf,timeWeek:()=>b.fz,timeWeeks:()=>b.se,timeYear:()=>w.A,timeYears:()=>w.V,utcDay:()=>E.A,utcDays:()=>E.o,utcFriday:()=>L.a1,utcFridays:()=>L.Zn,utcHour:()=>S,utcHours:()=>C,utcMillisecond:()=>o,utcMilliseconds:()=>a,utcMinute:()=>A,utcMinutes:()=>M,utcMonday:()=>L.rt,utcMondays:()=>L.ON,utcMonth:()=>O,utcMonths:()=>D,utcSaturday:()=>L.c8,utcSaturdays:()=>L.Xo,utcSecond:()=>c,utcSeconds:()=>u,utcSunday:()=>L.Hl,utcSundays:()=>L.aZ,utcThursday:()=>L.pT,utcThursdays:()=>L.wr,utcTuesday:()=>L.sr,utcTuesdays:()=>L.jN,utcWednesday:()=>L.z2,utcWednesdays:()=>L.G6,utcWeek:()=>L.Hl,utcWeeks:()=>L.aZ,utcYear:()=>I.A,utcYears:()=>I.j});var n=r(94825),i=(0,n.A)((function(){}),(function(t,e){t.setTime(+t+e)}),(function(t,e){return e-t}));i.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?(0,n.A)((function(e){e.setTime(Math.floor(e/t)*t)}),(function(e,r){e.setTime(+e+r*t)}),(function(e,r){return(r-e)/t})):i:null};const o=i;var a=i.range,s=r(37968),l=(0,n.A)((function(t){t.setTime(t-t.getMilliseconds())}),(function(t,e){t.setTime(+t+e*s.Tt)}),(function(t,e){return(e-t)/s.Tt}),(function(t){return t.getUTCSeconds()}));const c=l;var u=l.range,h=(0,n.A)((function(t){t.setTime(t-t.getMilliseconds()-t.getSeconds()*s.Tt)}),(function(t,e){t.setTime(+t+e*s.rR)}),(function(t,e){return(e-t)/s.rR}),(function(t){return t.getMinutes()}));const d=h;var f=h.range,p=(0,n.A)((function(t){t.setTime(t-t.getMilliseconds()-t.getSeconds()*s.Tt-t.getMinutes()*s.rR)}),(function(t,e){t.setTime(+t+e*s.JJ)}),(function(t,e){return(e-t)/s.JJ}),(function(t){return t.getHours()}));const m=p;var g=p.range,v=r(67848),b=r(61396),y=(0,n.A)((function(t){t.setDate(1),t.setHours(0,0,0,0)}),(function(t,e){t.setMonth(t.getMonth()+e)}),(function(t,e){return e.getMonth()-t.getMonth()+12*(e.getFullYear()-t.getFullYear())}),(function(t){return t.getMonth()}));const x=y;var _=y.range,w=r(28397),k=(0,n.A)((function(t){t.setUTCSeconds(0,0)}),(function(t,e){t.setTime(+t+e*s.rR)}),(function(t,e){return(e-t)/s.rR}),(function(t){return t.getUTCMinutes()}));const A=k;var M=k.range,T=(0,n.A)((function(t){t.setUTCMinutes(0,0,0)}),(function(t,e){t.setTime(+t+e*s.JJ)}),(function(t,e){return(e-t)/s.JJ}),(function(t){return t.getUTCHours()}));const S=T;var C=T.range,E=r(79896),L=r(64772),z=(0,n.A)((function(t){t.setUTCDate(1),t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCMonth(t.getUTCMonth()+e)}),(function(t,e){return e.getUTCMonth()-t.getUTCMonth()+12*(e.getUTCFullYear()-t.getUTCFullYear())}),(function(t){return t.getUTCMonth()}));const O=z;var D=z.range,I=r(34045)},94825:(t,e,r)=>{"use strict";r.d(e,{A:()=>o});var n=new Date,i=new Date;function o(t,e,r,a){function s(e){return t(e=0===arguments.length?new Date:new Date(+e)),e}return s.floor=function(e){return t(e=new Date(+e)),e},s.ceil=function(r){return t(r=new Date(r-1)),e(r,1),t(r),r},s.round=function(t){var e=s(t),r=s.ceil(t);return t-e0))return a;do{a.push(o=new Date(+r)),e(r,i),t(r)}while(o=e)for(;t(e),!r(e);)e.setTime(e-1)}),(function(t,n){if(t>=t)if(n<0)for(;++n<=0;)for(;e(t,-1),!r(t););else for(;--n>=0;)for(;e(t,1),!r(t););}))},r&&(s.count=function(e,o){return n.setTime(+e),i.setTime(+o),t(n),t(i),Math.floor(r(n,i))},s.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?s.filter(a?function(e){return a(e)%t==0}:function(e){return s.count(0,e)%t==0}):s:null}),s}},79896:(t,e,r)=>{"use strict";r.d(e,{A:()=>a,o:()=>s});var n=r(94825),i=r(37968),o=(0,n.A)((function(t){t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCDate(t.getUTCDate()+e)}),(function(t,e){return(e-t)/i.Nm}),(function(t){return t.getUTCDate()-1}));const a=o;var s=o.range},64772:(t,e,r)=>{"use strict";r.d(e,{G6:()=>g,Hl:()=>a,ON:()=>p,Xo:()=>y,Zn:()=>b,a1:()=>h,aZ:()=>f,c8:()=>d,jN:()=>m,pT:()=>u,rt:()=>s,sr:()=>l,wr:()=>v,z2:()=>c});var n=r(94825),i=r(37968);function o(t){return(0,n.A)((function(e){e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCDate(t.getUTCDate()+7*e)}),(function(t,e){return(e-t)/i.Fq}))}var a=o(0),s=o(1),l=o(2),c=o(3),u=o(4),h=o(5),d=o(6),f=a.range,p=s.range,m=l.range,g=c.range,v=u.range,b=h.range,y=d.range},34045:(t,e,r)=>{"use strict";r.d(e,{A:()=>o,j:()=>a});var n=r(94825),i=(0,n.A)((function(t){t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCFullYear(t.getUTCFullYear()+e)}),(function(t,e){return e.getUTCFullYear()-t.getUTCFullYear()}),(function(t){return t.getUTCFullYear()}));i.every=function(t){return isFinite(t=Math.floor(t))&&t>0?(0,n.A)((function(e){e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)}),(function(e,r){e.setUTCFullYear(e.getUTCFullYear()+r*t)})):null};const o=i;var a=i.range},61396:(t,e,r)=>{"use strict";r.d(e,{By:()=>s,KP:()=>p,Q$:()=>v,Sh:()=>h,dt:()=>u,eQ:()=>l,fz:()=>a,gf:()=>g,kS:()=>d,l3:()=>c,se:()=>f,t$:()=>y,tz:()=>b,yW:()=>m});var n=r(94825),i=r(37968);function o(t){return(0,n.A)((function(e){e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)}),(function(t,e){t.setDate(t.getDate()+7*e)}),(function(t,e){return(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*i.rR)/i.Fq}))}var a=o(0),s=o(1),l=o(2),c=o(3),u=o(4),h=o(5),d=o(6),f=a.range,p=s.range,m=l.range,g=c.range,v=u.range,b=h.range,y=d.range},28397:(t,e,r)=>{"use strict";r.d(e,{A:()=>o,V:()=>a});var n=r(94825),i=(0,n.A)((function(t){t.setMonth(0,1),t.setHours(0,0,0,0)}),(function(t,e){t.setFullYear(t.getFullYear()+e)}),(function(t,e){return e.getFullYear()-t.getFullYear()}),(function(t){return t.getFullYear()}));i.every=function(t){return isFinite(t=Math.floor(t))&&t>0?(0,n.A)((function(e){e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)}),(function(e,r){e.setFullYear(e.getFullYear()+r*t)})):null};const o=i;var a=i.range},43362:(t,e,r)=>{"use strict";var n=r(38232),i=r(66367),o=r(48744),a=r(55572);t.exports=function(t,e,r){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new o("`obj` must be an object or a function`");if("string"!=typeof e&&"symbol"!=typeof e)throw new o("`property` must be a string or a symbol`");if(arguments.length>3&&"boolean"!=typeof arguments[3]&&null!==arguments[3])throw new o("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&"boolean"!=typeof arguments[4]&&null!==arguments[4])throw new o("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&"boolean"!=typeof arguments[5]&&null!==arguments[5])throw new o("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&"boolean"!=typeof arguments[6])throw new o("`loose`, if provided, must be a boolean");var s=arguments.length>3?arguments[3]:null,l=arguments.length>4?arguments[4]:null,c=arguments.length>5?arguments[5]:null,u=arguments.length>6&&arguments[6],h=!!a&&a(t,e);if(n)n(t,e,{configurable:null===c&&h?h.configurable:!c,enumerable:null===s&&h?h.enumerable:!s,value:r,writable:null===l&&h?h.writable:!l});else{if(!u&&(s||l||c))throw new i("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");t[e]=r}}},10781:(t,e,r)=>{"use strict";var n=r(99952),i="function"==typeof Symbol&&"symbol"==typeof Symbol("foo"),o=Object.prototype.toString,a=Array.prototype.concat,s=r(43362),l=r(20419)(),c=function(t,e,r,n){if(e in t)if(!0===n){if(t[e]===r)return}else if("function"!=typeof(i=n)||"[object Function]"!==o.call(i)||!n())return;var i;l?s(t,e,r,!0):s(t,e,r)},u=function(t,e){var r=arguments.length>2?arguments[2]:{},o=n(e);i&&(o=a.call(o,Object.getOwnPropertySymbols(e)));for(var s=0;s{"use strict";t.exports=function(){for(var t=0;t{"use strict";t.exports=n;var e=(n.canvas=document.createElement("canvas")).getContext("2d"),r=i([32,126]);function n(t,n){Array.isArray(t)&&(t=t.join(", "));var o,a={},s=16,l=.05;n&&(2===n.length&&"number"==typeof n[0]?o=i(n):Array.isArray(n)?o=n:(n.o?o=i(n.o):n.pairs&&(o=n.pairs),n.fontSize&&(s=n.fontSize),null!=n.threshold&&(l=n.threshold))),o||(o=r),e.font=s+"px "+t;for(var c=0;cs*l){var f=(d-h)/s;a[u]=1e3*f}}return a}function i(t){for(var e=[],r=t[0];r<=t[1];r++)for(var n=String.fromCharCode(r),i=t[0];i{var n=r(97883),i=r(25058),o={M:"moveTo",C:"bezierCurveTo"};t.exports=function(t,e){t.beginPath(),i(n(e)).forEach((function(e){var r=e[0],n=e.slice(1);t[o[r]].apply(t,n)})),t.closePath()}},22366:t=>{t.exports=function(t){switch(t){case"int8":return Int8Array;case"int16":return Int16Array;case"int32":return Int32Array;case"uint8":return Uint8Array;case"uint16":return Uint16Array;case"uint32":return Uint32Array;case"float32":return Float32Array;case"float64":return Float64Array;case"array":return Array;case"uint8_clamped":return Uint8ClampedArray}}},31338:t=>{"use strict";function e(t,r,n){var i=0|t[n];if(i<=0)return[];var o,a=new Array(i);if(n===t.length-1)for(o=0;o0)return function(t,e){var r,n;for(r=new Array(t),n=0;n{"use strict";function e(t,e,n){n=n||2;var o,a,s,l,h,d,p,m=e&&e.length,g=m?e[0]*n:t.length,v=r(t,0,g,n,!0),b=[];if(!v||v.next===v.prev)return b;if(m&&(v=function(t,e,n,i){var o,a,s,l=[];for(o=0,a=e.length;o80*n){o=s=t[0],a=l=t[1];for(var y=n;ys&&(s=h),d>l&&(l=d);p=0!==(p=Math.max(s-o,l-a))?32767/p:0}return i(v,b,n,o,a,p,0),b}function r(t,e,r,n,i){var o,a;if(i===T(t,e,r,n)>0)for(o=e;o=e;o-=n)a=k(o,t[o],t[o+1],a);return a&&v(a,a.next)&&(A(a),a=a.next),a}function n(t,e){if(!t)return t;e||(e=t);var r,n=t;do{if(r=!1,n.steiner||!v(n,n.next)&&0!==g(n.prev,n,n.next))n=n.next;else{if(A(n),(n=e=n.prev)===n.next)break;r=!0}}while(r||n!==e);return e}function i(t,e,r,c,u,h,f){if(t){!f&&h&&function(t,e,r,n){var i=t;do{0===i.z&&(i.z=d(i.x,i.y,e,r,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,function(t){var e,r,n,i,o,a,s,l,c=1;do{for(r=t,t=null,o=null,a=0;r;){for(a++,n=r,s=0,e=0;e0||l>0&&n;)0!==s&&(0===l||!n||r.z<=n.z)?(i=r,r=r.nextZ,s--):(i=n,n=n.nextZ,l--),o?o.nextZ=i:t=i,i.prevZ=o,o=i;r=n}o.nextZ=null,c*=2}while(a>1)}(i)}(t,c,u,h);for(var p,m,g=t;t.prev!==t.next;)if(p=t.prev,m=t.next,h?a(t,c,u,h):o(t))e.push(p.i/r|0),e.push(t.i/r|0),e.push(m.i/r|0),A(t),t=m.next,g=m.next;else if((t=m)===g){f?1===f?i(t=s(n(t),e,r),e,r,c,u,h,2):2===f&&l(t,e,r,c,u,h):i(n(t),e,r,c,u,h,1);break}}}function o(t){var e=t.prev,r=t,n=t.next;if(g(e,r,n)>=0)return!1;for(var i=e.x,o=r.x,a=n.x,s=e.y,l=r.y,c=n.y,u=io?i>a?i:a:o>a?o:a,f=s>l?s>c?s:c:l>c?l:c,m=n.next;m!==e;){if(m.x>=u&&m.x<=d&&m.y>=h&&m.y<=f&&p(i,s,o,l,a,c,m.x,m.y)&&g(m.prev,m,m.next)>=0)return!1;m=m.next}return!0}function a(t,e,r,n){var i=t.prev,o=t,a=t.next;if(g(i,o,a)>=0)return!1;for(var s=i.x,l=o.x,c=a.x,u=i.y,h=o.y,f=a.y,m=sl?s>c?s:c:l>c?l:c,y=u>h?u>f?u:f:h>f?h:f,x=d(m,v,e,r,n),_=d(b,y,e,r,n),w=t.prevZ,k=t.nextZ;w&&w.z>=x&&k&&k.z<=_;){if(w.x>=m&&w.x<=b&&w.y>=v&&w.y<=y&&w!==i&&w!==a&&p(s,u,l,h,c,f,w.x,w.y)&&g(w.prev,w,w.next)>=0)return!1;if(w=w.prevZ,k.x>=m&&k.x<=b&&k.y>=v&&k.y<=y&&k!==i&&k!==a&&p(s,u,l,h,c,f,k.x,k.y)&&g(k.prev,k,k.next)>=0)return!1;k=k.nextZ}for(;w&&w.z>=x;){if(w.x>=m&&w.x<=b&&w.y>=v&&w.y<=y&&w!==i&&w!==a&&p(s,u,l,h,c,f,w.x,w.y)&&g(w.prev,w,w.next)>=0)return!1;w=w.prevZ}for(;k&&k.z<=_;){if(k.x>=m&&k.x<=b&&k.y>=v&&k.y<=y&&k!==i&&k!==a&&p(s,u,l,h,c,f,k.x,k.y)&&g(k.prev,k,k.next)>=0)return!1;k=k.nextZ}return!0}function s(t,e,r){var i=t;do{var o=i.prev,a=i.next.next;!v(o,a)&&b(o,i,i.next,a)&&_(o,a)&&_(a,o)&&(e.push(o.i/r|0),e.push(i.i/r|0),e.push(a.i/r|0),A(i),A(i.next),i=t=a),i=i.next}while(i!==t);return n(i)}function l(t,e,r,o,a,s){var l=t;do{for(var c=l.next.next;c!==l.prev;){if(l.i!==c.i&&m(l,c)){var u=w(l,c);return l=n(l,l.next),u=n(u,u.next),i(l,e,r,o,a,s,0),void i(u,e,r,o,a,s,0)}c=c.next}l=l.next}while(l!==t)}function c(t,e){return t.x-e.x}function u(t,e){var r=function(t,e){var r,n=e,i=t.x,o=t.y,a=-1/0;do{if(o<=n.y&&o>=n.next.y&&n.next.y!==n.y){var s=n.x+(o-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(s<=i&&s>a&&(a=s,r=n.x=n.x&&n.x>=u&&i!==n.x&&p(or.x||n.x===r.x&&h(r,n)))&&(r=n,f=l)),n=n.next}while(n!==c);return r}(t,e);if(!r)return e;var i=w(r,t);return n(i,i.next),n(r,r.next)}function h(t,e){return g(t.prev,t,e.prev)<0&&g(e.next,t,t.next)<0}function d(t,e,r,n,i){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-r)*i|0)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-n)*i|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function f(t){var e=t,r=t;do{(e.x=(t-a)*(o-s)&&(t-a)*(n-s)>=(r-a)*(e-s)&&(r-a)*(o-s)>=(i-a)*(n-s)}function m(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var r=t;do{if(r.i!==t.i&&r.next.i!==t.i&&r.i!==e.i&&r.next.i!==e.i&&b(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}(t,e)&&(_(t,e)&&_(e,t)&&function(t,e){var r=t,n=!1,i=(t.x+e.x)/2,o=(t.y+e.y)/2;do{r.y>o!=r.next.y>o&&r.next.y!==r.y&&i<(r.next.x-r.x)*(o-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next}while(r!==t);return n}(t,e)&&(g(t.prev,t,e.prev)||g(t,e.prev,e))||v(t,e)&&g(t.prev,t,t.next)>0&&g(e.prev,e,e.next)>0)}function g(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function v(t,e){return t.x===e.x&&t.y===e.y}function b(t,e,r,n){var i=x(g(t,e,r)),o=x(g(t,e,n)),a=x(g(r,n,t)),s=x(g(r,n,e));return i!==o&&a!==s||!(0!==i||!y(t,r,e))||!(0!==o||!y(t,n,e))||!(0!==a||!y(r,t,n))||!(0!==s||!y(r,e,n))}function y(t,e,r){return e.x<=Math.max(t.x,r.x)&&e.x>=Math.min(t.x,r.x)&&e.y<=Math.max(t.y,r.y)&&e.y>=Math.min(t.y,r.y)}function x(t){return t>0?1:t<0?-1:0}function _(t,e){return g(t.prev,t,t.next)<0?g(t,e,t.next)>=0&&g(t,t.prev,e)>=0:g(t,e,t.prev)<0||g(t,t.next,e)<0}function w(t,e){var r=new M(t.i,t.x,t.y),n=new M(e.i,e.x,e.y),i=t.next,o=e.prev;return t.next=e,e.prev=t,r.next=i,i.prev=r,n.next=r,r.prev=n,o.next=n,n.prev=o,n}function k(t,e,r,n){var i=new M(t,e,r);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function A(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function M(t,e,r){this.i=t,this.x=e,this.y=r,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function T(t,e,r,n){for(var i=0,o=e,a=r-n;o0&&(n+=t[i-1].length,r.holes.push(n))}return r}},38232:(t,e,r)=>{"use strict";var n=r(59412)("%Object.defineProperty%",!0)||!1;if(n)try{n({},"a",{value:1})}catch(t){n=!1}t.exports=n},33674:t=>{"use strict";t.exports=EvalError},94234:t=>{"use strict";t.exports=Error},8975:t=>{"use strict";t.exports=RangeError},59299:t=>{"use strict";t.exports=ReferenceError},66367:t=>{"use strict";t.exports=SyntaxError},48744:t=>{"use strict";t.exports=TypeError},63432:t=>{"use strict";t.exports=URIError},18918:(t,e,r)=>{"use strict";var n=r(2033);t.exports=function(){return n(this).length=0,this}},54034:(t,e,r)=>{"use strict";t.exports=r(90329)()?Array.from:r(28741)},90329:t=>{"use strict";t.exports=function(){var t,e,r=Array.from;return"function"==typeof r&&(e=r(t=["raz","dwa"]),Boolean(e&&e!==t&&"dwa"===e[1]))}},28741:(t,e,r)=>{"use strict";var n=r(89791).iterator,i=r(40471),o=r(85875),a=r(60812),s=r(55366),l=r(2033),c=r(93767),u=r(54295),h=Array.isArray,d=Function.prototype.call,f={configurable:!0,enumerable:!0,writable:!0,value:null},p=Object.defineProperty;t.exports=function(t){var e,r,m,g,v,b,y,x,_,w,k=arguments[1],A=arguments[2];if(t=Object(l(t)),c(k)&&s(k),this&&this!==Array&&o(this))e=this;else{if(!k){if(i(t))return 1!==(v=t.length)?Array.apply(null,t):((g=new Array(1))[0]=t[0],g);if(h(t)){for(g=new Array(v=t.length),r=0;r=55296&&b<=56319&&(w+=t[++r]),w=k?d.call(k,A,w,m):w,e?(f.value=w,p(g,m,f)):g[m]=w,++m;v=m}if(void 0===v)for(v=a(t.length),e&&(g=new e(v)),r=0;r{"use strict";var e=Object.prototype.toString,r=e.call(function(){return arguments}());t.exports=function(t){return e.call(t)===r}},85875:t=>{"use strict";var e=Object.prototype.toString,r=RegExp.prototype.test.bind(/^[object [A-Za-z0-9]*Function]$/);t.exports=function(t){return"function"==typeof t&&r(e.call(t))}},20450:t=>{"use strict";t.exports=function(){}},55334:(t,e,r)=>{"use strict";t.exports=r(42669)()?Math.sign:r(78209)},42669:t=>{"use strict";t.exports=function(){var t=Math.sign;return"function"==typeof t&&1===t(10)&&-1===t(-20)}},78209:t=>{"use strict";t.exports=function(t){return t=Number(t),isNaN(t)||0===t?t:t>0?1:-1}},28371:(t,e,r)=>{"use strict";var n=r(55334),i=Math.abs,o=Math.floor;t.exports=function(t){return isNaN(t)?0:0!==(t=Number(t))&&isFinite(t)?n(t)*o(i(t)):t}},60812:(t,e,r)=>{"use strict";var n=r(28371),i=Math.max;t.exports=function(t){return i(0,n(t))}},78826:(t,e,r)=>{"use strict";var n=r(55366),i=r(2033),o=Function.prototype.bind,a=Function.prototype.call,s=Object.keys,l=Object.prototype.propertyIsEnumerable;t.exports=function(t,e){return function(r,c){var u,h=arguments[2],d=arguments[3];return r=Object(i(r)),n(c),u=s(r),d&&u.sort("function"==typeof d?o.call(d,r):void 0),"function"!=typeof t&&(t=u[t]),a.call(t,u,(function(t,n){return l.call(r,t)?a.call(c,h,r[t],t,r,n):e}))}}},18021:(t,e,r)=>{"use strict";t.exports=r(99484)()?Object.assign:r(28752)},99484:t=>{"use strict";t.exports=function(){var t,e=Object.assign;return"function"==typeof e&&(e(t={foo:"raz"},{bar:"dwa"},{trzy:"trzy"}),t.foo+t.bar+t.trzy==="razdwatrzy")}},28752:(t,e,r)=>{"use strict";var n=r(87984),i=r(2033),o=Math.max;t.exports=function(t,e){var r,a,s,l=o(arguments.length,2);for(t=Object(i(t)),s=function(n){try{t[n]=e[n]}catch(t){r||(r=t)}},a=1;a{"use strict";var n=r(54034),i=r(18021),o=r(2033);t.exports=function(t){var e=Object(o(t)),r=arguments[1],a=Object(arguments[2]);if(e!==t&&!r)return e;var s={};return r?n(r,(function(e){(a.ensure||e in t)&&(s[e]=t[e])})):i(s,t),s}},39095:(t,e,r)=>{"use strict";var n,i,o,a,s=Object.create;r(11314)()||(n=r(786)),t.exports=n?1!==n.level?s:(i={},o={},a={configurable:!1,enumerable:!1,writable:!0,value:void 0},Object.getOwnPropertyNames(Object.prototype).forEach((function(t){o[t]="__proto__"!==t?a:{configurable:!0,enumerable:!1,writable:!0,value:void 0}})),Object.defineProperties(i,o),Object.defineProperty(n,"nullPolyfill",{configurable:!1,enumerable:!1,writable:!1,value:i}),function(t,e){return s(null===t?i:t,e)}):s},17916:(t,e,r)=>{"use strict";t.exports=r(78826)("forEach")},27375:(t,e,r)=>{"use strict";var n=r(93767),i={function:!0,object:!0};t.exports=function(t){return n(t)&&i[typeof t]||!1}},93767:(t,e,r)=>{"use strict";var n=r(20450)();t.exports=function(t){return t!==n&&null!==t}},87984:(t,e,r)=>{"use strict";t.exports=r(60263)()?Object.keys:r(42351)},60263:t=>{"use strict";t.exports=function(){try{return Object.keys("primitive"),!0}catch(t){return!1}}},42351:(t,e,r)=>{"use strict";var n=r(93767),i=Object.keys;t.exports=function(t){return i(n(t)?Object(t):t)}},30829:(t,e,r)=>{"use strict";var n=r(55366),i=r(17916),o=Function.prototype.call;t.exports=function(t,e){var r={},a=arguments[2];return n(e),i(t,(function(t,n,i,s){r[n]=o.call(e,a,t,n,i,s)})),r}},54863:(t,e,r)=>{"use strict";var n=r(93767),i=Array.prototype.forEach,o=Object.create;t.exports=function(t){var e=o(null);return i.call(arguments,(function(t){n(t)&&function(t,e){var r;for(r in t)e[r]=t[r]}(Object(t),e)})),e}},83579:(t,e,r)=>{"use strict";t.exports=r(11314)()?Object.setPrototypeOf:r(786)},11314:t=>{"use strict";var e=Object.create,r=Object.getPrototypeOf,n={};t.exports=function(){var t=Object.setPrototypeOf;return"function"==typeof t&&r(t((arguments[0]||e)(null),n))===n}},786:(t,e,r)=>{"use strict";var n,i,o,a,s=r(27375),l=r(2033),c=Object.prototype.isPrototypeOf,u=Object.defineProperty,h={configurable:!0,enumerable:!1,writable:!0,value:void 0};n=function(t,e){if(l(t),null===e||s(e))return t;throw new TypeError("Prototype must be null or an object")},t.exports=(i=function(){var t,e=Object.create(null),r={},n=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__");if(n){try{(t=n.set).call(e,r)}catch(t){}if(Object.getPrototypeOf(e)===r)return{set:t,level:2}}return e.__proto__=r,Object.getPrototypeOf(e)===r?{level:2}:((e={}).__proto__=r,Object.getPrototypeOf(e)===r&&{level:1})}(),i?(2===i.level?i.set?(a=i.set,o=function(t,e){return a.call(n(t,e),e),t}):o=function(t,e){return n(t,e).__proto__=e,t}:o=function t(e,r){var i;return n(e,r),(i=c.call(t.nullPolyfill,e))&&delete t.nullPolyfill.__proto__,null===r&&(r=t.nullPolyfill),e.__proto__=r,i&&u(t.nullPolyfill,"__proto__",h),e},Object.defineProperty(o,"level",{configurable:!1,enumerable:!1,writable:!1,value:i.level})):null),r(39095)},55366:t=>{"use strict";t.exports=function(t){if("function"!=typeof t)throw new TypeError(t+" is not a function");return t}},66529:(t,e,r)=>{"use strict";var n=r(27375);t.exports=function(t){if(!n(t))throw new TypeError(t+" is not an Object");return t}},2033:(t,e,r)=>{"use strict";var n=r(93767);t.exports=function(t){if(!n(t))throw new TypeError("Cannot use null or undefined");return t}},79813:(t,e,r)=>{"use strict";t.exports=r(82844)()?String.prototype.contains:r(65040)},82844:t=>{"use strict";var e="razdwatrzy";t.exports=function(){return"function"==typeof e.contains&&!0===e.contains("dwa")&&!1===e.contains("foo")}},65040:t=>{"use strict";var e=String.prototype.indexOf;t.exports=function(t){return e.call(this,t,arguments[1])>-1}},54295:t=>{"use strict";var e=Object.prototype.toString,r=e.call("");t.exports=function(t){return"string"==typeof t||t&&"object"==typeof t&&(t instanceof String||e.call(t)===r)||!1}},36434:t=>{"use strict";var e=Object.create(null),r=Math.random;t.exports=function(){var t;do{t=r().toString(36).slice(2)}while(e[t]);return t}},46136:(t,e,r)=>{"use strict";var n,i=r(83579),o=r(79813),a=r(86142),s=r(89791),l=r(15929),c=Object.defineProperty;n=t.exports=function(t,e){if(!(this instanceof n))throw new TypeError("Constructor requires 'new'");l.call(this,t),e=e?o.call(e,"key+value")?"key+value":o.call(e,"key")?"key":"value":"value",c(this,"__kind__",a("",e))},i&&i(n,l),delete n.prototype.constructor,n.prototype=Object.create(l.prototype,{_resolve:a((function(t){return"value"===this.__kind__?this.__list__[t]:"key+value"===this.__kind__?[t,this.__list__[t]]:t}))}),c(n.prototype,s.toStringTag,a("c","Array Iterator"))},88822:(t,e,r)=>{"use strict";var n=r(40471),i=r(55366),o=r(54295),a=r(28753),s=Array.isArray,l=Function.prototype.call,c=Array.prototype.some;t.exports=function(t,e){var r,u,h,d,f,p,m,g,v=arguments[2];if(s(t)||n(t)?r="array":o(t)?r="string":t=a(t),i(e),h=function(){d=!0},"array"!==r)if("string"!==r)for(u=t.next();!u.done;){if(l.call(e,v,u.value,h),d)return;u=t.next()}else for(p=t.length,f=0;f=55296&&g<=56319&&(m+=t[++f]),l.call(e,v,m,h),!d);++f);else c.call(t,(function(t){return l.call(e,v,t,h),d}))}},28753:(t,e,r)=>{"use strict";var n=r(40471),i=r(54295),o=r(46136),a=r(45408),s=r(86898),l=r(89791).iterator;t.exports=function(t){return"function"==typeof s(t)[l]?t[l]():n(t)?new o(t):i(t)?new a(t):new o(t)}},15929:(t,e,r)=>{"use strict";var n,i=r(18918),o=r(18021),a=r(55366),s=r(2033),l=r(86142),c=r(39683),u=r(89791),h=Object.defineProperty,d=Object.defineProperties;t.exports=n=function(t,e){if(!(this instanceof n))throw new TypeError("Constructor requires 'new'");d(this,{__list__:l("w",s(t)),__context__:l("w",e),__nextIndex__:l("w",0)}),e&&(a(e.on),e.on("_add",this._onAdd),e.on("_delete",this._onDelete),e.on("_clear",this._onClear))},delete n.prototype.constructor,d(n.prototype,o({_next:l((function(){var t;if(this.__list__)return this.__redo__&&void 0!==(t=this.__redo__.shift())?t:this.__nextIndex__=this.__nextIndex__||(++this.__nextIndex__,this.__redo__?(this.__redo__.forEach((function(e,r){e>=t&&(this.__redo__[r]=++e)}),this),this.__redo__.push(t)):h(this,"__redo__",l("c",[t])))})),_onDelete:l((function(t){var e;t>=this.__nextIndex__||(--this.__nextIndex__,this.__redo__&&(-1!==(e=this.__redo__.indexOf(t))&&this.__redo__.splice(e,1),this.__redo__.forEach((function(e,r){e>t&&(this.__redo__[r]=--e)}),this)))})),_onClear:l((function(){this.__redo__&&i.call(this.__redo__),this.__nextIndex__=0}))}))),h(n.prototype,u.iterator,l((function(){return this})))},46692:(t,e,r)=>{"use strict";var n=r(40471),i=r(93767),o=r(54295),a=r(89791).iterator,s=Array.isArray;t.exports=function(t){return!(!i(t)||!s(t)&&!o(t)&&!n(t)&&"function"!=typeof t[a])}},45408:(t,e,r)=>{"use strict";var n,i=r(83579),o=r(86142),a=r(89791),s=r(15929),l=Object.defineProperty;n=t.exports=function(t){if(!(this instanceof n))throw new TypeError("Constructor requires 'new'");t=String(t),s.call(this,t),l(this,"__length__",o("",t.length))},i&&i(n,s),delete n.prototype.constructor,n.prototype=Object.create(s.prototype,{_next:o((function(){if(this.__list__)return this.__nextIndex__=55296&&e<=56319?r+this.__list__[this.__nextIndex__++]:r}))}),l(n.prototype,a.toStringTag,o("c","String Iterator"))},86898:(t,e,r)=>{"use strict";var n=r(46692);t.exports=function(t){if(!n(t))throw new TypeError(t+" is not iterable");return t}},89791:(t,e,r)=>{"use strict";t.exports=r(87494)()?r(63844).Symbol:r(44164)},87494:(t,e,r)=>{"use strict";var n=r(63844),i={object:!0,symbol:!0};t.exports=function(){var t,e=n.Symbol;if("function"!=typeof e)return!1;t=e("test symbol");try{String(t)}catch(t){return!1}return!!i[typeof e.iterator]&&!!i[typeof e.toPrimitive]&&!!i[typeof e.toStringTag]}},84848:t=>{"use strict";t.exports=function(t){return!!t&&("symbol"==typeof t||!!t.constructor&&"Symbol"===t.constructor.name&&"Symbol"===t[t.constructor.toStringTag])}},78718:(t,e,r)=>{"use strict";var n=r(86142),i=Object.create,o=Object.defineProperty,a=Object.prototype,s=i(null);t.exports=function(t){for(var e,r,i=0;s[t+(i||"")];)++i;return s[t+=i||""]=!0,o(a,e="@@"+t,n.gs(null,(function(t){r||(r=!0,o(this,e,n(t)),r=!1)}))),e}},25052:(t,e,r)=>{"use strict";var n=r(86142),i=r(63844).Symbol;t.exports=function(t){return Object.defineProperties(t,{hasInstance:n("",i&&i.hasInstance||t("hasInstance")),isConcatSpreadable:n("",i&&i.isConcatSpreadable||t("isConcatSpreadable")),iterator:n("",i&&i.iterator||t("iterator")),match:n("",i&&i.match||t("match")),replace:n("",i&&i.replace||t("replace")),search:n("",i&&i.search||t("search")),species:n("",i&&i.species||t("species")),split:n("",i&&i.split||t("split")),toPrimitive:n("",i&&i.toPrimitive||t("toPrimitive")),toStringTag:n("",i&&i.toStringTag||t("toStringTag")),unscopables:n("",i&&i.unscopables||t("unscopables"))})}},68813:(t,e,r)=>{"use strict";var n=r(86142),i=r(85618),o=Object.create(null);t.exports=function(t){return Object.defineProperties(t,{for:n((function(e){return o[e]?o[e]:o[e]=t(String(e))})),keyFor:n((function(t){var e;for(e in i(t),o)if(o[e]===t)return e}))})}},44164:(t,e,r)=>{"use strict";var n,i,o,a=r(86142),s=r(85618),l=r(63844).Symbol,c=r(78718),u=r(25052),h=r(68813),d=Object.create,f=Object.defineProperties,p=Object.defineProperty;if("function"==typeof l)try{String(l()),o=!0}catch(t){}else l=null;i=function(t){if(this instanceof i)throw new TypeError("Symbol is not a constructor");return n(t)},t.exports=n=function t(e){var r;if(this instanceof t)throw new TypeError("Symbol is not a constructor");return o?l(e):(r=d(i.prototype),e=void 0===e?"":String(e),f(r,{__description__:a("",e),__name__:a("",c(e))}))},u(n),h(n),f(i.prototype,{constructor:a(n),toString:a("",(function(){return this.__name__}))}),f(n.prototype,{toString:a((function(){return"Symbol ("+s(this).__description__+")"})),valueOf:a((function(){return s(this)}))}),p(n.prototype,n.toPrimitive,a("",(function(){var t=s(this);return"symbol"==typeof t?t:t.toString()}))),p(n.prototype,n.toStringTag,a("c","Symbol")),p(i.prototype,n.toStringTag,a("c",n.prototype[n.toStringTag])),p(i.prototype,n.toPrimitive,a("c",n.prototype[n.toPrimitive]))},85618:(t,e,r)=>{"use strict";var n=r(84848);t.exports=function(t){if(!n(t))throw new TypeError(t+" is not a symbol");return t}},41456:(t,e,r)=>{"use strict";t.exports=r(39687)()?WeakMap:r(87841)},39687:t=>{"use strict";t.exports=function(){var t,e;if("function"!=typeof WeakMap)return!1;try{t=new WeakMap([[e={},"one"],[{},"two"],[{},"three"]])}catch(t){return!1}return"[object WeakMap]"===String(t)&&"function"==typeof t.set&&t.set({},1)===t&&"function"==typeof t.delete&&"function"==typeof t.has&&"one"===t.get(e)}},99037:t=>{"use strict";t.exports="function"==typeof WeakMap&&"[object WeakMap]"===Object.prototype.toString.call(new WeakMap)},87841:(t,e,r)=>{"use strict";var n,i=r(93767),o=r(83579),a=r(66529),s=r(2033),l=r(36434),c=r(86142),u=r(28753),h=r(88822),d=r(89791).toStringTag,f=r(99037),p=Array.isArray,m=Object.defineProperty,g=Object.prototype.hasOwnProperty,v=Object.getPrototypeOf;t.exports=n=function(){var t,e=arguments[0];if(!(this instanceof n))throw new TypeError("Constructor requires 'new'");return t=f&&o&&WeakMap!==n?o(new WeakMap,v(this)):this,i(e)&&(p(e)||(e=u(e))),m(t,"__weakMapData__",c("c","$weakMap$"+l())),e?(h(e,(function(e){s(e),t.set(e[0],e[1])})),t):t},f&&(o&&o(n,WeakMap),n.prototype=Object.create(WeakMap.prototype,{constructor:c(n)})),Object.defineProperties(n.prototype,{delete:c((function(t){return!!g.call(a(t),this.__weakMapData__)&&(delete t[this.__weakMapData__],!0)})),get:c((function(t){if(g.call(a(t),this.__weakMapData__))return t[this.__weakMapData__]})),has:c((function(t){return g.call(a(t),this.__weakMapData__)})),set:c((function(t,e){return m(a(t),this.__weakMapData__,c("c",e)),this})),toString:c((function(){return"[object WeakMap]"}))}),m(n.prototype,d,c("c","WeakMap"))},86626:t=>{"use strict";var e,r="object"==typeof Reflect?Reflect:null,n=r&&"function"==typeof r.apply?r.apply:function(t,e,r){return Function.prototype.apply.call(t,e,r)};e=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var i=Number.isNaN||function(t){return t!=t};function o(){o.init.call(this)}t.exports=o,t.exports.once=function(t,e){return new Promise((function(r,n){function i(r){t.removeListener(e,o),n(r)}function o(){"function"==typeof t.removeListener&&t.removeListener("error",i),r([].slice.call(arguments))}m(t,e,o,{once:!0}),"error"!==e&&function(t,e){"function"==typeof t.on&&m(t,"error",e,{once:!0})}(t,i)}))},o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var a=10;function s(t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function l(t){return void 0===t._maxListeners?o.defaultMaxListeners:t._maxListeners}function c(t,e,r,n){var i,o,a,c;if(s(r),void 0===(o=t._events)?(o=t._events=Object.create(null),t._eventsCount=0):(void 0!==o.newListener&&(t.emit("newListener",e,r.listener?r.listener:r),o=t._events),a=o[e]),void 0===a)a=o[e]=r,++t._eventsCount;else if("function"==typeof a?a=o[e]=n?[r,a]:[a,r]:n?a.unshift(r):a.push(r),(i=l(t))>0&&a.length>i&&!a.warned){a.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=t,u.type=e,u.count=a.length,c=u,console&&console.warn&&console.warn(c)}return t}function u(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function h(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},i=u.bind(n);return i.listener=r,n.wrapFn=i,i}function d(t,e,r){var n=t._events;if(void 0===n)return[];var i=n[e];return void 0===i?[]:"function"==typeof i?r?[i.listener||i]:[i]:r?function(t){for(var e=new Array(t.length),r=0;r0&&(a=e[0]),a instanceof Error)throw a;var s=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw s.context=a,s}var l=o[t];if(void 0===l)return!1;if("function"==typeof l)n(l,this,e);else{var c=l.length,u=p(l,c);for(r=0;r=0;o--)if(r[o]===e||r[o].listener===e){a=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():function(t,e){for(;e+1=0;n--)this.removeListener(t,e[n]);return this},o.prototype.listeners=function(t){return d(this,t,!0)},o.prototype.rawListeners=function(t){return d(this,t,!1)},o.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):f.call(t,e)},o.prototype.listenerCount=f,o.prototype.eventNames=function(){return this._eventsCount>0?e(this._events):[]}},44232:t=>{var e=function(){if("object"==typeof self&&self)return self;if("object"==typeof window&&window)return window;throw new Error("Unable to resolve global `this`")};t.exports=function(){if(this)return this;try{Object.defineProperty(Object.prototype,"__global__",{get:function(){return this},configurable:!0})}catch(t){return e()}try{return __global__||e()}finally{delete Object.prototype.__global__}}()},63844:(t,e,r)=>{"use strict";t.exports=r(25515)()?globalThis:r(44232)},25515:t=>{"use strict";t.exports=function(){return"object"==typeof globalThis&&!!globalThis&&globalThis.Array===Array}},7370:(t,e,r)=>{"use strict";var n=r(45219);t.exports=function(t){var e=typeof t;if("string"===e){var r=t;if(0==(t=+t)&&n(r))return!1}else if("number"!==e)return!1;return t-t<1}},97e3:(t,e,r)=>{var n=r(22366);t.exports=function(t,e,r){if(!t)throw new TypeError("must specify data as first parameter");if(r=0|+(r||0),Array.isArray(t)&&t[0]&&"number"==typeof t[0][0]){var i,o,a,s,l=t[0].length,c=t.length*l;e&&"string"!=typeof e||(e=new(n(e||"float32"))(c+r));var u=e.length-r;if(c!==u)throw new Error("source length "+c+" ("+l+"x"+t.length+") does not match destination length "+u);for(i=0,a=r;i{"use strict";var n=r(40288),i=[32,126];t.exports=function(t){var e=(t=t||{}).shape?t.shape:t.canvas?[t.canvas.width,t.canvas.height]:[512,512],r=t.canvas||document.createElement("canvas"),o=t.font,a="number"==typeof t.step?[t.step,t.step]:t.step||[32,32],s=t.chars||i;if(o&&"string"!=typeof o&&(o=n(o)),Array.isArray(s)){if(2===s.length&&"number"==typeof s[0]&&"number"==typeof s[1]){for(var l=[],c=s[0],u=0;c<=s[1];c++)l[u++]=String.fromCharCode(c);s=l}}else s=String(s).split("");e=e.slice(),r.width=e[0],r.height=e[1];var h=r.getContext("2d");h.fillStyle="#000",h.fillRect(0,0,r.width,r.height),h.font=o,h.textAlign="center",h.textBaseline="middle",h.fillStyle="#fff";var d=a[0]/2,f=a[1]/2;for(c=0;ce[0]-a[0]/2&&(d=a[0]/2,f+=a[1]);return r}},45250:t=>{"use strict";function e(t,o){o||(o={}),("string"==typeof t||Array.isArray(t))&&(o.family=t);var a=Array.isArray(o.family)?o.family.join(", "):o.family;if(!a)throw Error("`family` must be defined");var s=o.size||o.fontSize||o.em||48,l=o.weight||o.fontWeight||"",c=(t=[o.style||o.fontStyle||"",l,s].join(" ")+"px "+a,o.origin||"top");if(e.cache[a]&&s<=e.cache[a].em)return r(e.cache[a],c);var u=o.canvas||e.canvas,h=u.getContext("2d"),d={upper:void 0!==o.upper?o.upper:"H",lower:void 0!==o.lower?o.lower:"x",descent:void 0!==o.descent?o.descent:"p",ascent:void 0!==o.ascent?o.ascent:"h",tittle:void 0!==o.tittle?o.tittle:"i",overshoot:void 0!==o.overshoot?o.overshoot:"O"},f=Math.ceil(1.5*s);u.height=f,u.width=.5*f,h.font=t;var p="H",m={top:0};h.clearRect(0,0,f,f),h.textBaseline="top",h.fillStyle="black",h.fillText(p,0,0);var g=n(h.getImageData(0,0,f,f));h.clearRect(0,0,f,f),h.textBaseline="bottom",h.fillText(p,0,f);var v=n(h.getImageData(0,0,f,f));m.lineHeight=m.bottom=f-v+g,h.clearRect(0,0,f,f),h.textBaseline="alphabetic",h.fillText(p,0,f);var b=f-n(h.getImageData(0,0,f,f))-1+g;m.baseline=m.alphabetic=b,h.clearRect(0,0,f,f),h.textBaseline="middle",h.fillText(p,0,.5*f);var y=n(h.getImageData(0,0,f,f));m.median=m.middle=f-y-1+g-.5*f,h.clearRect(0,0,f,f),h.textBaseline="hanging",h.fillText(p,0,.5*f);var x=n(h.getImageData(0,0,f,f));m.hanging=f-x-1+g-.5*f,h.clearRect(0,0,f,f),h.textBaseline="ideographic",h.fillText(p,0,f);var _=n(h.getImageData(0,0,f,f));if(m.ideographic=f-_-1+g,d.upper&&(h.clearRect(0,0,f,f),h.textBaseline="top",h.fillText(d.upper,0,0),m.upper=n(h.getImageData(0,0,f,f)),m.capHeight=m.baseline-m.upper),d.lower&&(h.clearRect(0,0,f,f),h.textBaseline="top",h.fillText(d.lower,0,0),m.lower=n(h.getImageData(0,0,f,f)),m.xHeight=m.baseline-m.lower),d.tittle&&(h.clearRect(0,0,f,f),h.textBaseline="top",h.fillText(d.tittle,0,0),m.tittle=n(h.getImageData(0,0,f,f))),d.ascent&&(h.clearRect(0,0,f,f),h.textBaseline="top",h.fillText(d.ascent,0,0),m.ascent=n(h.getImageData(0,0,f,f))),d.descent&&(h.clearRect(0,0,f,f),h.textBaseline="top",h.fillText(d.descent,0,0),m.descent=i(h.getImageData(0,0,f,f))),d.overshoot){h.clearRect(0,0,f,f),h.textBaseline="top",h.fillText(d.overshoot,0,0);var w=i(h.getImageData(0,0,f,f));m.overshoot=w-b}for(var k in m)m[k]/=s;return m.em=s,e.cache[a]=m,r(m,c)}function r(t,e){var r={};for(var n in"string"==typeof e&&(e=t[e]),t)"em"!==n&&(r[n]=t[n]-e);return r}function n(t){for(var e=t.height,r=t.data,n=3;n0;n-=4)if(0!==r[n])return Math.floor(.25*(n-3)/e)}t.exports=e,e.canvas=document.createElement("canvas"),e.cache={}},85573:(t,e,r)=>{"use strict";var n=r(60245),i=Object.prototype.toString,o=Object.prototype.hasOwnProperty;t.exports=function(t,e,r){if(!n(e))throw new TypeError("iterator must be a function");var a;arguments.length>=3&&(a=r),"[object Array]"===i.call(t)?function(t,e,r){for(var n=0,i=t.length;n{"use strict";var e=Object.prototype.toString,r=Math.max,n=function(t,e){for(var r=[],n=0;n{"use strict";var n=r(5438);t.exports=Function.prototype.bind||n},64487:t=>{t.exports=function(t,e){if("string"!=typeof t)throw new TypeError("must specify type string");if(e=e||{},"undefined"==typeof document&&!e.canvas)return null;var r=e.canvas||document.createElement("canvas");"number"==typeof e.width&&(r.width=e.width),"number"==typeof e.height&&(r.height=e.height);var n,i=e;try{var o=[t];0===t.indexOf("webgl")&&o.push("experimental-"+t);for(var a=0;a{"use strict";var n,i=r(94234),o=r(33674),a=r(8975),s=r(59299),l=r(66367),c=r(48744),u=r(63432),h=Function,d=function(t){try{return h('"use strict"; return ('+t+").constructor;")()}catch(t){}},f=Object.getOwnPropertyDescriptor;if(f)try{f({},"")}catch(t){f=null}var p=function(){throw new c},m=f?function(){try{return p}catch(t){try{return f(arguments,"callee").get}catch(t){return p}}}():p,g=r(23266)(),v=r(39681)(),b=Object.getPrototypeOf||(v?function(t){return t.__proto__}:null),y={},x="undefined"!=typeof Uint8Array&&b?b(Uint8Array):n,_={__proto__:null,"%AggregateError%":"undefined"==typeof AggregateError?n:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?n:ArrayBuffer,"%ArrayIteratorPrototype%":g&&b?b([][Symbol.iterator]()):n,"%AsyncFromSyncIteratorPrototype%":n,"%AsyncFunction%":y,"%AsyncGenerator%":y,"%AsyncGeneratorFunction%":y,"%AsyncIteratorPrototype%":y,"%Atomics%":"undefined"==typeof Atomics?n:Atomics,"%BigInt%":"undefined"==typeof BigInt?n:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?n:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?n:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?n:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":i,"%eval%":eval,"%EvalError%":o,"%Float32Array%":"undefined"==typeof Float32Array?n:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?n:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?n:FinalizationRegistry,"%Function%":h,"%GeneratorFunction%":y,"%Int8Array%":"undefined"==typeof Int8Array?n:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?n:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?n:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":g&&b?b(b([][Symbol.iterator]())):n,"%JSON%":"object"==typeof JSON?JSON:n,"%Map%":"undefined"==typeof Map?n:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&g&&b?b((new Map)[Symbol.iterator]()):n,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?n:Promise,"%Proxy%":"undefined"==typeof Proxy?n:Proxy,"%RangeError%":a,"%ReferenceError%":s,"%Reflect%":"undefined"==typeof Reflect?n:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?n:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&g&&b?b((new Set)[Symbol.iterator]()):n,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?n:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":g&&b?b(""[Symbol.iterator]()):n,"%Symbol%":g?Symbol:n,"%SyntaxError%":l,"%ThrowTypeError%":m,"%TypedArray%":x,"%TypeError%":c,"%Uint8Array%":"undefined"==typeof Uint8Array?n:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?n:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?n:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?n:Uint32Array,"%URIError%":u,"%WeakMap%":"undefined"==typeof WeakMap?n:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?n:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?n:WeakSet};if(b)try{null.error}catch(t){var w=b(b(t));_["%Error.prototype%"]=w}var k=function t(e){var r;if("%AsyncFunction%"===e)r=d("async function () {}");else if("%GeneratorFunction%"===e)r=d("function* () {}");else if("%AsyncGeneratorFunction%"===e)r=d("async function* () {}");else if("%AsyncGenerator%"===e){var n=t("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if("%AsyncIteratorPrototype%"===e){var i=t("%AsyncGenerator%");i&&b&&(r=b(i.prototype))}return _[e]=r,r},A={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},M=r(35366),T=r(19942),S=M.call(Function.call,Array.prototype.concat),C=M.call(Function.apply,Array.prototype.splice),E=M.call(Function.call,String.prototype.replace),L=M.call(Function.call,String.prototype.slice),z=M.call(Function.call,RegExp.prototype.exec),O=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,D=/\\(\\)?/g,I=function(t,e){var r,n=t;if(T(A,n)&&(n="%"+(r=A[n])[0]+"%"),T(_,n)){var i=_[n];if(i===y&&(i=k(n)),void 0===i&&!e)throw new c("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:r,name:n,value:i}}throw new l("intrinsic "+t+" does not exist!")};t.exports=function(t,e){if("string"!=typeof t||0===t.length)throw new c("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof e)throw new c('"allowMissing" argument must be a boolean');if(null===z(/^%?[^%]*%?$/,t))throw new l("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=function(t){var e=L(t,0,1),r=L(t,-1);if("%"===e&&"%"!==r)throw new l("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==e)throw new l("invalid intrinsic syntax, expected opening `%`");var n=[];return E(t,O,(function(t,e,r,i){n[n.length]=r?E(i,D,"$1"):e||t})),n}(t),n=r.length>0?r[0]:"",i=I("%"+n+"%",e),o=i.name,a=i.value,s=!1,u=i.alias;u&&(n=u[0],C(r,S([0,1],u)));for(var h=1,d=!0;h=r.length){var v=f(a,p);a=(d=!!v)&&"get"in v&&!("originalValue"in v.get)?v.get:a[p]}else d=T(a,p),a=a[p];d&&!s&&(_[o]=a)}}return a}},4813:t=>{t.exports=function(t,e){var r=e[0],n=e[1],i=e[2],o=e[3],a=e[4],s=e[5],l=e[6],c=e[7],u=e[8],h=e[9],d=e[10],f=e[11],p=e[12],m=e[13],g=e[14],v=e[15];return t[0]=s*(d*v-f*g)-h*(l*v-c*g)+m*(l*f-c*d),t[1]=-(n*(d*v-f*g)-h*(i*v-o*g)+m*(i*f-o*d)),t[2]=n*(l*v-c*g)-s*(i*v-o*g)+m*(i*c-o*l),t[3]=-(n*(l*f-c*d)-s*(i*f-o*d)+h*(i*c-o*l)),t[4]=-(a*(d*v-f*g)-u*(l*v-c*g)+p*(l*f-c*d)),t[5]=r*(d*v-f*g)-u*(i*v-o*g)+p*(i*f-o*d),t[6]=-(r*(l*v-c*g)-a*(i*v-o*g)+p*(i*c-o*l)),t[7]=r*(l*f-c*d)-a*(i*f-o*d)+u*(i*c-o*l),t[8]=a*(h*v-f*m)-u*(s*v-c*m)+p*(s*f-c*h),t[9]=-(r*(h*v-f*m)-u*(n*v-o*m)+p*(n*f-o*h)),t[10]=r*(s*v-c*m)-a*(n*v-o*m)+p*(n*c-o*s),t[11]=-(r*(s*f-c*h)-a*(n*f-o*h)+u*(n*c-o*s)),t[12]=-(a*(h*g-d*m)-u*(s*g-l*m)+p*(s*d-l*h)),t[13]=r*(h*g-d*m)-u*(n*g-i*m)+p*(n*d-i*h),t[14]=-(r*(s*g-l*m)-a*(n*g-i*m)+p*(n*l-i*s)),t[15]=r*(s*d-l*h)-a*(n*d-i*h)+u*(n*l-i*s),t}},1903:t=>{t.exports=function(t){var e=new Float32Array(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}},42981:t=>{t.exports=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}},46864:t=>{t.exports=function(){var t=new Float32Array(16);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}},49921:t=>{t.exports=function(t){var e=t[0],r=t[1],n=t[2],i=t[3],o=t[4],a=t[5],s=t[6],l=t[7],c=t[8],u=t[9],h=t[10],d=t[11],f=t[12],p=t[13],m=t[14],g=t[15];return(e*a-r*o)*(h*g-d*m)-(e*s-n*o)*(u*g-d*p)+(e*l-i*o)*(u*m-h*p)+(r*s-n*a)*(c*g-d*f)-(r*l-i*a)*(c*m-h*f)+(n*l-i*s)*(c*p-u*f)}},17399:t=>{t.exports=function(t,e){var r=e[0],n=e[1],i=e[2],o=e[3],a=r+r,s=n+n,l=i+i,c=r*a,u=n*a,h=n*s,d=i*a,f=i*s,p=i*l,m=o*a,g=o*s,v=o*l;return t[0]=1-h-p,t[1]=u+v,t[2]=d-g,t[3]=0,t[4]=u-v,t[5]=1-c-p,t[6]=f+m,t[7]=0,t[8]=d+g,t[9]=f-m,t[10]=1-c-h,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}},7354:t=>{t.exports=function(t,e,r){var n,i,o,a=r[0],s=r[1],l=r[2],c=Math.sqrt(a*a+s*s+l*l);return Math.abs(c)<1e-6?null:(a*=c=1/c,s*=c,l*=c,n=Math.sin(e),o=1-(i=Math.cos(e)),t[0]=a*a*o+i,t[1]=s*a*o+l*n,t[2]=l*a*o-s*n,t[3]=0,t[4]=a*s*o-l*n,t[5]=s*s*o+i,t[6]=l*s*o+a*n,t[7]=0,t[8]=a*l*o+s*n,t[9]=s*l*o-a*n,t[10]=l*l*o+i,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t)}},76743:t=>{t.exports=function(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3],s=n+n,l=i+i,c=o+o,u=n*s,h=n*l,d=n*c,f=i*l,p=i*c,m=o*c,g=a*s,v=a*l,b=a*c;return t[0]=1-(f+m),t[1]=h+b,t[2]=d-v,t[3]=0,t[4]=h-b,t[5]=1-(u+m),t[6]=p+g,t[7]=0,t[8]=d+v,t[9]=p-g,t[10]=1-(u+f),t[11]=0,t[12]=r[0],t[13]=r[1],t[14]=r[2],t[15]=1,t}},90367:t=>{t.exports=function(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e[1],t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e[2],t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}},68673:t=>{t.exports=function(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=e[0],t[13]=e[1],t[14]=e[2],t[15]=1,t}},80180:t=>{t.exports=function(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=n,t[6]=r,t[7]=0,t[8]=0,t[9]=-r,t[10]=n,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}},68727:t=>{t.exports=function(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=0,t[2]=-r,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=r,t[9]=0,t[10]=n,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}},96402:t=>{t.exports=function(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=r,t[2]=0,t[3]=0,t[4]=-r,t[5]=n,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}},29192:t=>{t.exports=function(t,e,r,n,i,o,a){var s=1/(r-e),l=1/(i-n),c=1/(o-a);return t[0]=2*o*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*o*l,t[6]=0,t[7]=0,t[8]=(r+e)*s,t[9]=(i+n)*l,t[10]=(a+o)*c,t[11]=-1,t[12]=0,t[13]=0,t[14]=a*o*2*c,t[15]=0,t}},87894:t=>{t.exports=function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}},79538:(t,e,r)=>{t.exports={create:r(46864),clone:r(1903),copy:r(42981),identity:r(87894),transpose:r(45665),invert:r(27608),adjoint:r(4813),determinant:r(49921),multiply:r(66760),translate:r(77656),scale:r(62504),rotate:r(26079),rotateX:r(15567),rotateY:r(52408),rotateZ:r(27089),fromRotation:r(7354),fromRotationTranslation:r(76743),fromScaling:r(90367),fromTranslation:r(68673),fromXRotation:r(80180),fromYRotation:r(68727),fromZRotation:r(96402),fromQuat:r(17399),frustum:r(29192),perspective:r(4772),perspectiveFromFieldOfView:r(11882),ortho:r(74040),lookAt:r(66582),str:r(65213)}},27608:t=>{t.exports=function(t,e){var r=e[0],n=e[1],i=e[2],o=e[3],a=e[4],s=e[5],l=e[6],c=e[7],u=e[8],h=e[9],d=e[10],f=e[11],p=e[12],m=e[13],g=e[14],v=e[15],b=r*s-n*a,y=r*l-i*a,x=r*c-o*a,_=n*l-i*s,w=n*c-o*s,k=i*c-o*l,A=u*m-h*p,M=u*g-d*p,T=u*v-f*p,S=h*g-d*m,C=h*v-f*m,E=d*v-f*g,L=b*E-y*C+x*S+_*T-w*M+k*A;return L?(L=1/L,t[0]=(s*E-l*C+c*S)*L,t[1]=(i*C-n*E-o*S)*L,t[2]=(m*k-g*w+v*_)*L,t[3]=(d*w-h*k-f*_)*L,t[4]=(l*T-a*E-c*M)*L,t[5]=(r*E-i*T+o*M)*L,t[6]=(g*x-p*k-v*y)*L,t[7]=(u*k-d*x+f*y)*L,t[8]=(a*C-s*T+c*A)*L,t[9]=(n*T-r*C-o*A)*L,t[10]=(p*w-m*x+v*b)*L,t[11]=(h*x-u*w-f*b)*L,t[12]=(s*M-a*S-l*A)*L,t[13]=(r*S-n*M+i*A)*L,t[14]=(m*y-p*_-g*b)*L,t[15]=(u*_-h*y+d*b)*L,t):null}},66582:(t,e,r)=>{var n=r(87894);t.exports=function(t,e,r,i){var o,a,s,l,c,u,h,d,f,p,m=e[0],g=e[1],v=e[2],b=i[0],y=i[1],x=i[2],_=r[0],w=r[1],k=r[2];return Math.abs(m-_)<1e-6&&Math.abs(g-w)<1e-6&&Math.abs(v-k)<1e-6?n(t):(h=m-_,d=g-w,f=v-k,o=y*(f*=p=1/Math.sqrt(h*h+d*d+f*f))-x*(d*=p),a=x*(h*=p)-b*f,s=b*d-y*h,(p=Math.sqrt(o*o+a*a+s*s))?(o*=p=1/p,a*=p,s*=p):(o=0,a=0,s=0),l=d*s-f*a,c=f*o-h*s,u=h*a-d*o,(p=Math.sqrt(l*l+c*c+u*u))?(l*=p=1/p,c*=p,u*=p):(l=0,c=0,u=0),t[0]=o,t[1]=l,t[2]=h,t[3]=0,t[4]=a,t[5]=c,t[6]=d,t[7]=0,t[8]=s,t[9]=u,t[10]=f,t[11]=0,t[12]=-(o*m+a*g+s*v),t[13]=-(l*m+c*g+u*v),t[14]=-(h*m+d*g+f*v),t[15]=1,t)}},66760:t=>{t.exports=function(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3],s=e[4],l=e[5],c=e[6],u=e[7],h=e[8],d=e[9],f=e[10],p=e[11],m=e[12],g=e[13],v=e[14],b=e[15],y=r[0],x=r[1],_=r[2],w=r[3];return t[0]=y*n+x*s+_*h+w*m,t[1]=y*i+x*l+_*d+w*g,t[2]=y*o+x*c+_*f+w*v,t[3]=y*a+x*u+_*p+w*b,y=r[4],x=r[5],_=r[6],w=r[7],t[4]=y*n+x*s+_*h+w*m,t[5]=y*i+x*l+_*d+w*g,t[6]=y*o+x*c+_*f+w*v,t[7]=y*a+x*u+_*p+w*b,y=r[8],x=r[9],_=r[10],w=r[11],t[8]=y*n+x*s+_*h+w*m,t[9]=y*i+x*l+_*d+w*g,t[10]=y*o+x*c+_*f+w*v,t[11]=y*a+x*u+_*p+w*b,y=r[12],x=r[13],_=r[14],w=r[15],t[12]=y*n+x*s+_*h+w*m,t[13]=y*i+x*l+_*d+w*g,t[14]=y*o+x*c+_*f+w*v,t[15]=y*a+x*u+_*p+w*b,t}},74040:t=>{t.exports=function(t,e,r,n,i,o,a){var s=1/(e-r),l=1/(n-i),c=1/(o-a);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*l,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*c,t[11]=0,t[12]=(e+r)*s,t[13]=(i+n)*l,t[14]=(a+o)*c,t[15]=1,t}},4772:t=>{t.exports=function(t,e,r,n,i){var o=1/Math.tan(e/2),a=1/(n-i);return t[0]=o/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=o,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=(i+n)*a,t[11]=-1,t[12]=0,t[13]=0,t[14]=2*i*n*a,t[15]=0,t}},11882:t=>{t.exports=function(t,e,r,n){var i=Math.tan(e.upDegrees*Math.PI/180),o=Math.tan(e.downDegrees*Math.PI/180),a=Math.tan(e.leftDegrees*Math.PI/180),s=Math.tan(e.rightDegrees*Math.PI/180),l=2/(a+s),c=2/(i+o);return t[0]=l,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=c,t[6]=0,t[7]=0,t[8]=-(a-s)*l*.5,t[9]=(i-o)*c*.5,t[10]=n/(r-n),t[11]=-1,t[12]=0,t[13]=0,t[14]=n*r/(r-n),t[15]=0,t}},26079:t=>{t.exports=function(t,e,r,n){var i,o,a,s,l,c,u,h,d,f,p,m,g,v,b,y,x,_,w,k,A,M,T,S,C=n[0],E=n[1],L=n[2],z=Math.sqrt(C*C+E*E+L*L);return Math.abs(z)<1e-6?null:(C*=z=1/z,E*=z,L*=z,i=Math.sin(r),a=1-(o=Math.cos(r)),s=e[0],l=e[1],c=e[2],u=e[3],h=e[4],d=e[5],f=e[6],p=e[7],m=e[8],g=e[9],v=e[10],b=e[11],y=C*C*a+o,x=E*C*a+L*i,_=L*C*a-E*i,w=C*E*a-L*i,k=E*E*a+o,A=L*E*a+C*i,M=C*L*a+E*i,T=E*L*a-C*i,S=L*L*a+o,t[0]=s*y+h*x+m*_,t[1]=l*y+d*x+g*_,t[2]=c*y+f*x+v*_,t[3]=u*y+p*x+b*_,t[4]=s*w+h*k+m*A,t[5]=l*w+d*k+g*A,t[6]=c*w+f*k+v*A,t[7]=u*w+p*k+b*A,t[8]=s*M+h*T+m*S,t[9]=l*M+d*T+g*S,t[10]=c*M+f*T+v*S,t[11]=u*M+p*T+b*S,e!==t&&(t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t)}},15567:t=>{t.exports=function(t,e,r){var n=Math.sin(r),i=Math.cos(r),o=e[4],a=e[5],s=e[6],l=e[7],c=e[8],u=e[9],h=e[10],d=e[11];return e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=o*i+c*n,t[5]=a*i+u*n,t[6]=s*i+h*n,t[7]=l*i+d*n,t[8]=c*i-o*n,t[9]=u*i-a*n,t[10]=h*i-s*n,t[11]=d*i-l*n,t}},52408:t=>{t.exports=function(t,e,r){var n=Math.sin(r),i=Math.cos(r),o=e[0],a=e[1],s=e[2],l=e[3],c=e[8],u=e[9],h=e[10],d=e[11];return e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=o*i-c*n,t[1]=a*i-u*n,t[2]=s*i-h*n,t[3]=l*i-d*n,t[8]=o*n+c*i,t[9]=a*n+u*i,t[10]=s*n+h*i,t[11]=l*n+d*i,t}},27089:t=>{t.exports=function(t,e,r){var n=Math.sin(r),i=Math.cos(r),o=e[0],a=e[1],s=e[2],l=e[3],c=e[4],u=e[5],h=e[6],d=e[7];return e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=o*i+c*n,t[1]=a*i+u*n,t[2]=s*i+h*n,t[3]=l*i+d*n,t[4]=c*i-o*n,t[5]=u*i-a*n,t[6]=h*i-s*n,t[7]=d*i-l*n,t}},62504:t=>{t.exports=function(t,e,r){var n=r[0],i=r[1],o=r[2];return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*o,t[9]=e[9]*o,t[10]=e[10]*o,t[11]=e[11]*o,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}},65213:t=>{t.exports=function(t){return"mat4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+", "+t[9]+", "+t[10]+", "+t[11]+", "+t[12]+", "+t[13]+", "+t[14]+", "+t[15]+")"}},77656:t=>{t.exports=function(t,e,r){var n,i,o,a,s,l,c,u,h,d,f,p,m=r[0],g=r[1],v=r[2];return e===t?(t[12]=e[0]*m+e[4]*g+e[8]*v+e[12],t[13]=e[1]*m+e[5]*g+e[9]*v+e[13],t[14]=e[2]*m+e[6]*g+e[10]*v+e[14],t[15]=e[3]*m+e[7]*g+e[11]*v+e[15]):(n=e[0],i=e[1],o=e[2],a=e[3],s=e[4],l=e[5],c=e[6],u=e[7],h=e[8],d=e[9],f=e[10],p=e[11],t[0]=n,t[1]=i,t[2]=o,t[3]=a,t[4]=s,t[5]=l,t[6]=c,t[7]=u,t[8]=h,t[9]=d,t[10]=f,t[11]=p,t[12]=n*m+s*g+h*v+e[12],t[13]=i*m+l*g+d*v+e[13],t[14]=o*m+c*g+f*v+e[14],t[15]=a*m+u*g+p*v+e[15]),t}},45665:t=>{t.exports=function(t,e){if(t===e){var r=e[1],n=e[2],i=e[3],o=e[6],a=e[7],s=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=r,t[6]=e[9],t[7]=e[13],t[8]=n,t[9]=o,t[11]=e[14],t[12]=i,t[13]=a,t[14]=s}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t}},69499:(t,e,r)=>{"use strict";var n=r(82393),i=r(9994),o=r(83029),a=r(6627),s=r(41456),l=r(34463),c=r(81937),u=r(31888),h=r(94698),d=r(35867),f=r(3202),p=r(70665),m=r(3812),g=r(34597),v=r(45250),b=r(97e3),y=r(88828).nextPow2,x=new s,_=!1;if(document.body){var w=document.body.appendChild(document.createElement("div"));w.style.font="italic small-caps bold condensed 16px/2 cursive",getComputedStyle(w).fontStretch&&(_=!0),document.body.removeChild(w)}var k=function(t){!function(t){return"function"==typeof t&&t._gl&&t.prop&&t.texture&&t.buffer}(t)?this.gl=a(t):(t={regl:t},this.gl=t.regl._gl),this.shader=x.get(this.gl),this.shader?this.regl=this.shader.regl:this.regl=t.regl||o({gl:this.gl}),this.charBuffer=this.regl.buffer({type:"uint8",usage:"stream"}),this.sizeBuffer=this.regl.buffer({type:"float",usage:"stream"}),this.shader||(this.shader=this.createShader(),x.set(this.gl,this.shader)),this.batch=[],this.fontSize=[],this.font=[],this.fontAtlas=[],this.draw=this.shader.draw.bind(this),this.render=function(){this.regl._refresh(),this.draw(this.batch)},this.canvas=this.gl.canvas,this.update(d(t)?t:{})};k.prototype.createShader=function(){var t=this.regl,e=t({blend:{enable:!0,color:[0,0,0,1],func:{srcRGB:"src alpha",dstRGB:"one minus src alpha",srcAlpha:"one minus dst alpha",dstAlpha:"one"}},stencil:{enable:!1},depth:{enable:!1},count:t.prop("count"),offset:t.prop("offset"),attributes:{charOffset:{offset:4,stride:8,buffer:t.this("sizeBuffer")},width:{offset:0,stride:8,buffer:t.this("sizeBuffer")},char:t.this("charBuffer"),position:t.this("position")},uniforms:{atlasSize:function(t,e){return[e.atlas.width,e.atlas.height]},atlasDim:function(t,e){return[e.atlas.cols,e.atlas.rows]},atlas:function(t,e){return e.atlas.texture},charStep:function(t,e){return e.atlas.step},em:function(t,e){return e.atlas.em},color:t.prop("color"),opacity:t.prop("opacity"),viewport:t.this("viewportArray"),scale:t.this("scale"),align:t.prop("align"),baseline:t.prop("baseline"),translate:t.this("translate"),positionOffset:t.prop("positionOffset")},primitive:"points",viewport:t.this("viewport"),vert:"\n\t\t\tprecision highp float;\n\t\t\tattribute float width, charOffset, char;\n\t\t\tattribute vec2 position;\n\t\t\tuniform float fontSize, charStep, em, align, baseline;\n\t\t\tuniform vec4 viewport;\n\t\t\tuniform vec4 color;\n\t\t\tuniform vec2 atlasSize, atlasDim, scale, translate, positionOffset;\n\t\t\tvarying vec2 charCoord, charId;\n\t\t\tvarying float charWidth;\n\t\t\tvarying vec4 fontColor;\n\t\t\tvoid main () {\n\t\t\t\tvec2 offset = floor(em * (vec2(align + charOffset, baseline)\n\t\t\t\t\t+ vec2(positionOffset.x, -positionOffset.y)))\n\t\t\t\t\t/ (viewport.zw * scale.xy);\n\n\t\t\t\tvec2 position = (position + translate) * scale;\n\t\t\t\tposition += offset * scale;\n\n\t\t\t\tcharCoord = position * viewport.zw + viewport.xy;\n\n\t\t\t\tgl_Position = vec4(position * 2. - 1., 0, 1);\n\n\t\t\t\tgl_PointSize = charStep;\n\n\t\t\t\tcharId.x = mod(char, atlasDim.x);\n\t\t\t\tcharId.y = floor(char / atlasDim.x);\n\n\t\t\t\tcharWidth = width * em;\n\n\t\t\t\tfontColor = color / 255.;\n\t\t\t}",frag:"\n\t\t\tprecision highp float;\n\t\t\tuniform float fontSize, charStep, opacity;\n\t\t\tuniform vec2 atlasSize;\n\t\t\tuniform vec4 viewport;\n\t\t\tuniform sampler2D atlas;\n\t\t\tvarying vec4 fontColor;\n\t\t\tvarying vec2 charCoord, charId;\n\t\t\tvarying float charWidth;\n\n\t\t\tfloat lightness(vec4 color) {\n\t\t\t\treturn color.r * 0.299 + color.g * 0.587 + color.b * 0.114;\n\t\t\t}\n\n\t\t\tvoid main () {\n\t\t\t\tvec2 uv = gl_FragCoord.xy - charCoord + charStep * .5;\n\t\t\t\tfloat halfCharStep = floor(charStep * .5 + .5);\n\n\t\t\t\t// invert y and shift by 1px (FF expecially needs that)\n\t\t\t\tuv.y = charStep - uv.y;\n\n\t\t\t\t// ignore points outside of character bounding box\n\t\t\t\tfloat halfCharWidth = ceil(charWidth * .5);\n\t\t\t\tif (floor(uv.x) > halfCharStep + halfCharWidth ||\n\t\t\t\t\tfloor(uv.x) < halfCharStep - halfCharWidth) return;\n\n\t\t\t\tuv += charId * charStep;\n\t\t\t\tuv = uv / atlasSize;\n\n\t\t\t\tvec4 color = fontColor;\n\t\t\t\tvec4 mask = texture2D(atlas, uv);\n\n\t\t\t\tfloat maskY = lightness(mask);\n\t\t\t\t// float colorY = lightness(color);\n\t\t\t\tcolor.a *= maskY;\n\t\t\t\tcolor.a *= opacity;\n\n\t\t\t\t// color.a += .1;\n\n\t\t\t\t// antialiasing, see yiq color space y-channel formula\n\t\t\t\t// color.rgb += (1. - color.rgb) * (1. - mask.rgb);\n\n\t\t\t\tgl_FragColor = color;\n\t\t\t}"});return{regl:t,draw:e,atlas:{}}},k.prototype.update=function(t){var e=this;if("string"==typeof t)t={text:t};else if(!t)return;null!=(t=i(t,{position:"position positions coord coords coordinates",font:"font fontFace fontface typeface cssFont css-font family fontFamily",fontSize:"fontSize fontsize size font-size",text:"text texts chars characters value values symbols",align:"align alignment textAlign textbaseline",baseline:"baseline textBaseline textbaseline",direction:"dir direction textDirection",color:"color colour fill fill-color fillColor textColor textcolor",kerning:"kerning kern",range:"range dataBox",viewport:"vp viewport viewBox viewbox viewPort",opacity:"opacity alpha transparency visible visibility opaque",offset:"offset positionOffset padding shift indent indentation"},!0)).opacity&&(Array.isArray(t.opacity)?this.opacity=t.opacity.map((function(t){return parseFloat(t)})):this.opacity=parseFloat(t.opacity)),null!=t.viewport&&(this.viewport=h(t.viewport),this.viewportArray=[this.viewport.x,this.viewport.y,this.viewport.width,this.viewport.height]),null==this.viewport&&(this.viewport={x:0,y:0,width:this.gl.drawingBufferWidth,height:this.gl.drawingBufferHeight},this.viewportArray=[this.viewport.x,this.viewport.y,this.viewport.width,this.viewport.height]),null!=t.kerning&&(this.kerning=t.kerning),null!=t.offset&&("number"==typeof t.offset&&(t.offset=[t.offset,0]),this.positionOffset=b(t.offset)),t.direction&&(this.direction=t.direction),t.range&&(this.range=t.range,this.scale=[1/(t.range[2]-t.range[0]),1/(t.range[3]-t.range[1])],this.translate=[-t.range[0],-t.range[1]]),t.scale&&(this.scale=t.scale),t.translate&&(this.translate=t.translate),this.scale||(this.scale=[1/this.viewport.width,1/this.viewport.height]),this.translate||(this.translate=[0,0]),this.font.length||t.font||(t.font=k.baseFontSize+"px sans-serif");var r,o=!1,a=!1;if(t.font&&(Array.isArray(t.font)?t.font:[t.font]).forEach((function(t,r){if("string"==typeof t)try{t=n.parse(t)}catch(e){t=n.parse(k.baseFontSize+"px "+t)}else{var i=t.style,s=t.weight,l=t.stretch,c=t.variant;t=n.parse(n.stringify(t)),i&&(t.style=i),s&&(t.weight=s),l&&(t.stretch=l),c&&(t.variant=c)}var u=n.stringify({size:k.baseFontSize,family:t.family,stretch:_?t.stretch:void 0,variant:t.variant,weight:t.weight,style:t.style}),h=f(t.size),d=Math.round(h[0]*p(h[1]));if(d!==e.fontSize[r]&&(a=!0,e.fontSize[r]=d),!(e.font[r]&&u==e.font[r].baseString||(o=!0,e.font[r]=k.fonts[u],e.font[r]))){var m=t.family.join(", "),g=[t.style];t.style!=t.variant&&g.push(t.variant),t.variant!=t.weight&&g.push(t.weight),_&&t.weight!=t.stretch&&g.push(t.stretch),e.font[r]={baseString:u,family:m,weight:t.weight,stretch:t.stretch,style:t.style,variant:t.variant,width:{},kerning:{},metrics:v(m,{origin:"top",fontSize:k.baseFontSize,fontStyle:g.join(" ")})},k.fonts[u]=e.font[r]}})),(o||a)&&this.font.forEach((function(r,i){var o=n.stringify({size:e.fontSize[i],family:r.family,stretch:_?r.stretch:void 0,variant:r.variant,weight:r.weight,style:r.style});if(e.fontAtlas[i]=e.shader.atlas[o],!e.fontAtlas[i]){var a=r.metrics;e.shader.atlas[o]=e.fontAtlas[i]={fontString:o,step:2*Math.ceil(e.fontSize[i]*a.bottom*.5),em:e.fontSize[i],cols:0,rows:0,height:0,width:0,chars:[],ids:{},texture:e.regl.texture()}}null==t.text&&(t.text=e.text)})),"string"==typeof t.text&&t.position&&t.position.length>2){for(var s=Array(.5*t.position.length),d=0;d2){for(var w=!t.position[0].length,A=u.mallocFloat(2*this.count),M=0,T=0;M1?e.align[r]:e.align[0]:e.align;if("number"==typeof n)return n;switch(n){case"right":case"end":return-t;case"center":case"centre":case"middle":return.5*-t}return 0}))),null==this.baseline&&null==t.baseline&&(t.baseline=0),null!=t.baseline&&(this.baseline=t.baseline,Array.isArray(this.baseline)||(this.baseline=[this.baseline]),this.baselineOffset=this.baseline.map((function(t,r){var n=(e.font[r]||e.font[0]).metrics,i=0;return i+=.5*n.bottom,-1*(i+="number"==typeof t?t-n.baseline:-n[t])}))),null!=t.color)if(t.color||(t.color="transparent"),"string"!=typeof t.color&&isNaN(t.color)){var H;if("number"==typeof t.color[0]&&t.color.length>this.counts.length){var W=t.color.length;H=u.mallocUint8(W);for(var q=(t.color.subarray||t.color.slice).bind(t.color),Y=0;Y4||this.baselineOffset.length>1||this.align&&this.align.length>1||this.fontAtlas.length>1||this.positionOffset.length>2){var $=Math.max(.5*this.position.length||0,.25*this.color.length||0,this.baselineOffset.length||0,this.alignOffset.length||0,this.font.length||0,this.opacity.length||0,.5*this.positionOffset.length||0);this.batch=Array($);for(var J=0;J1?this.counts[J]:this.counts[0],offset:this.textOffsets.length>1?this.textOffsets[J]:this.textOffsets[0],color:this.color?this.color.length<=4?this.color:this.color.subarray(4*J,4*J+4):[0,0,0,255],opacity:Array.isArray(this.opacity)?this.opacity[J]:this.opacity,baseline:null!=this.baselineOffset[J]?this.baselineOffset[J]:this.baselineOffset[0],align:this.align?null!=this.alignOffset[J]?this.alignOffset[J]:this.alignOffset[0]:0,atlas:this.fontAtlas[J]||this.fontAtlas[0],positionOffset:this.positionOffset.length>2?this.positionOffset.subarray(2*J,2*J+2):this.positionOffset}}else this.count?this.batch=[{count:this.count,offset:0,color:this.color||[0,0,0,255],opacity:Array.isArray(this.opacity)?this.opacity[0]:this.opacity,baseline:this.baselineOffset[0],align:this.alignOffset?this.alignOffset[0]:0,atlas:this.fontAtlas[0],positionOffset:this.positionOffset}]:this.batch=[]},k.prototype.destroy=function(){},k.prototype.kerning=!0,k.prototype.position={constant:new Float32Array(2)},k.prototype.translate=null,k.prototype.scale=null,k.prototype.font=null,k.prototype.text="",k.prototype.positionOffset=[0,0],k.prototype.opacity=1,k.prototype.color=new Uint8Array([0,0,0,255]),k.prototype.alignOffset=[0,0],k.maxAtlasSize=1024,k.atlasCanvas=document.createElement("canvas"),k.atlasContext=k.atlasCanvas.getContext("2d",{alpha:!1}),k.baseFontSize=64,k.fonts={},t.exports=k},6627:(t,e,r)=>{"use strict";var n=r(9994);function i(t){if(t.container)if(t.container==document.body)document.body.style.width||(t.canvas.width=t.width||t.pixelRatio*r.g.innerWidth),document.body.style.height||(t.canvas.height=t.height||t.pixelRatio*r.g.innerHeight);else{var e=t.container.getBoundingClientRect();t.canvas.width=t.width||e.right-e.left,t.canvas.height=t.height||e.bottom-e.top}}function o(t){return"function"==typeof t.getContext&&"width"in t&&"height"in t}function a(){var t=document.createElement("canvas");return t.style.position="absolute",t.style.top=0,t.style.left=0,t}t.exports=function(t){var e;if(t?"string"==typeof t&&(t={container:t}):t={},(t=o(t)||"string"==typeof(e=t).nodeName&&"function"==typeof e.appendChild&&"function"==typeof e.getBoundingClientRect?{container:t}:function(t){return"function"==typeof t.drawArrays||"function"==typeof t.drawElements}(t)?{gl:t}:n(t,{container:"container target element el canvas holder parent parentNode wrapper use ref root node",gl:"gl context webgl glContext",attrs:"attributes attrs contextAttributes",pixelRatio:"pixelRatio pxRatio px ratio pxratio pixelratio",width:"w width",height:"h height"},!0)).pixelRatio||(t.pixelRatio=r.g.pixelRatio||1),t.gl)return t.gl;if(t.canvas&&(t.container=t.canvas.parentNode),t.container){if("string"==typeof t.container){var s=document.querySelector(t.container);if(!s)throw Error("Element "+t.container+" is not found");t.container=s}o(t.container)?(t.canvas=t.container,t.container=t.canvas.parentNode):t.canvas||(t.canvas=a(),t.container.appendChild(t.canvas),i(t))}else if(!t.canvas){if("undefined"==typeof document)throw Error("Not DOM environment. Use headless-gl.");t.container=document.body||document.documentElement,t.canvas=a(),t.container.appendChild(t.canvas),i(t)}return t.gl||["webgl","experimental-webgl","webgl-experimental"].some((function(e){try{t.gl=t.canvas.getContext(e,t.attrs)}catch(t){}return t.gl})),t.gl}},43236:t=>{t.exports=function(t){"string"==typeof t&&(t=[t]);for(var e=[].slice.call(arguments,1),r=[],n=0;n{"use strict";var n=r(59412)("%Object.getOwnPropertyDescriptor%",!0);if(n)try{n([],"length")}catch(t){n=null}t.exports=n},56885:(t,e,r)=>{"use strict";var n,i=r(41888);n="function"==typeof r.g.matchMedia?!r.g.matchMedia("(hover: none)").matches:i,t.exports=n},17520:(t,e,r)=>{"use strict";var n=r(41888);t.exports=n&&function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("test",null,e),window.removeEventListener("test",null,e)}catch(e){t=!1}return t}()},20419:(t,e,r)=>{"use strict";var n=r(38232),i=function(){return!!n};i.hasArrayLengthDefineBug=function(){if(!n)return null;try{return 1!==n([],"length",{value:1}).length}catch(t){return!0}},t.exports=i},39681:t=>{"use strict";var e={__proto__:null,foo:{}},r=Object;t.exports=function(){return{__proto__:e}.foo===e.foo&&!(e instanceof r)}},23266:(t,e,r)=>{"use strict";var n="undefined"!=typeof Symbol&&Symbol,i=r(93272);t.exports=function(){return"function"==typeof n&&"function"==typeof Symbol&&"symbol"==typeof n("foo")&&"symbol"==typeof Symbol("bar")&&i()}},93272:t=>{"use strict";t.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var t={},e=Symbol("test"),r=Object(e);if("string"==typeof e)return!1;if("[object Symbol]"!==Object.prototype.toString.call(e))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(e in t[e]=42,t)return!1;if("function"==typeof Object.keys&&0!==Object.keys(t).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(t).length)return!1;var n=Object.getOwnPropertySymbols(t);if(1!==n.length||n[0]!==e)return!1;if(!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var i=Object.getOwnPropertyDescriptor(t,e);if(42!==i.value||!0!==i.enumerable)return!1}return!0}},15541:(t,e,r)=>{"use strict";var n=r(93272);t.exports=function(){return n()&&!!Symbol.toStringTag}},19942:(t,e,r)=>{"use strict";var n=Function.prototype.call,i=Object.prototype.hasOwnProperty,o=r(35366);t.exports=o.call(n,i)},23778:(t,e)=>{e.read=function(t,e,r,n,i){var o,a,s=8*i-n-1,l=(1<>1,u=-7,h=r?i-1:0,d=r?-1:1,f=t[e+h];for(h+=d,o=f&(1<<-u)-1,f>>=-u,u+=s;u>0;o=256*o+t[e+h],h+=d,u-=8);for(a=o&(1<<-u)-1,o>>=-u,u+=n;u>0;a=256*a+t[e+h],h+=d,u-=8);if(0===o)o=1-c;else{if(o===l)return a?NaN:1/0*(f?-1:1);a+=Math.pow(2,n),o-=c}return(f?-1:1)*a*Math.pow(2,o-n)},e.write=function(t,e,r,n,i,o){var a,s,l,c=8*o-i-1,u=(1<>1,d=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,f=n?0:o-1,p=n?1:-1,m=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,a=u):(a=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-a))<1&&(a--,l*=2),(e+=a+h>=1?d/l:d*Math.pow(2,1-h))*l>=2&&(a++,l/=2),a+h>=u?(s=0,a=u):a+h>=1?(s=(e*l-1)*Math.pow(2,i),a+=h):(s=e*Math.pow(2,h-1)*Math.pow(2,i),a=0));i>=8;t[r+f]=255&s,f+=p,s/=256,i-=8);for(a=a<0;t[r+f]=255&a,f+=p,a/=256,c-=8);t[r+f-p]|=128*m}},9715:t=>{"function"==typeof Object.create?t.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(t,e){if(e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}}},68007:(t,e,r)=>{"use strict";var n=r(15541)(),i=r(24310)("Object.prototype.toString"),o=function(t){return!(n&&t&&"object"==typeof t&&Symbol.toStringTag in t)&&"[object Arguments]"===i(t)},a=function(t){return!!o(t)||null!==t&&"object"==typeof t&&"number"==typeof t.length&&t.length>=0&&"[object Array]"!==i(t)&&"[object Function]"===i(t.callee)},s=function(){return o(arguments)}();o.isLegacyArguments=a,t.exports=s?o:a},41888:t=>{t.exports=!0},60245:t=>{"use strict";var e,r,n=Function.prototype.toString,i="object"==typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"==typeof i&&"function"==typeof Object.defineProperty)try{e=Object.defineProperty({},"length",{get:function(){throw r}}),r={},i((function(){throw 42}),null,e)}catch(t){t!==r&&(i=null)}else i=null;var o=/^\s*class\b/,a=function(t){try{var e=n.call(t);return o.test(e)}catch(t){return!1}},s=function(t){try{return!a(t)&&(n.call(t),!0)}catch(t){return!1}},l=Object.prototype.toString,c="function"==typeof Symbol&&!!Symbol.toStringTag,u=!(0 in[,]),h=function(){return!1};if("object"==typeof document){var d=document.all;l.call(d)===l.call(document.all)&&(h=function(t){if((u||!t)&&(void 0===t||"object"==typeof t))try{var e=l.call(t);return("[object HTMLAllCollection]"===e||"[object HTML document.all class]"===e||"[object HTMLCollection]"===e||"[object Object]"===e)&&null==t("")}catch(t){}return!1})}t.exports=i?function(t){if(h(t))return!0;if(!t)return!1;if("function"!=typeof t&&"object"!=typeof t)return!1;try{i(t,null,e)}catch(t){if(t!==r)return!1}return!a(t)&&s(t)}:function(t){if(h(t))return!0;if(!t)return!1;if("function"!=typeof t&&"object"!=typeof t)return!1;if(c)return s(t);if(a(t))return!1;var e=l.call(t);return!("[object Function]"!==e&&"[object GeneratorFunction]"!==e&&!/^\[object HTML/.test(e))&&s(t)}},74205:(t,e,r)=>{"use strict";var n,i=Object.prototype.toString,o=Function.prototype.toString,a=/^\s*(?:function)?\*/,s=r(15541)(),l=Object.getPrototypeOf;t.exports=function(t){if("function"!=typeof t)return!1;if(a.test(o.call(t)))return!0;if(!s)return"[object GeneratorFunction]"===i.call(t);if(!l)return!1;if(void 0===n){var e=function(){if(!s)return!1;try{return Function("return function*() {}")()}catch(t){}}();n=!!e&&l(e)}return l(t)===n}},47691:t=>{"use strict";t.exports="undefined"!=typeof navigator&&(/MSIE/.test(navigator.userAgent)||/Trident\//.test(navigator.appVersion))},12431:t=>{"use strict";t.exports=i,t.exports.isMobile=i,t.exports.default=i;const e=/(android|bb\d+|meego).+mobile|armv7l|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series[46]0|samsungbrowser.*mobile|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i,r=/CrOS/,n=/android|ipad|playbook|silk/i;function i(t){t||(t={});let i=t.ua;if(i||"undefined"==typeof navigator||(i=navigator.userAgent),i&&i.headers&&"string"==typeof i.headers["user-agent"]&&(i=i.headers["user-agent"]),"string"!=typeof i)return!1;let o=e.test(i)&&!r.test(i)||!!t.tablet&&n.test(i);return!o&&t.tablet&&t.featureDetect&&navigator&&navigator.maxTouchPoints>1&&-1!==i.indexOf("Macintosh")&&-1!==i.indexOf("Safari")&&(o=!0),o}},87266:t=>{"use strict";t.exports=function(t){return t!=t}},74858:(t,e,r)=>{"use strict";var n=r(61398),i=r(10781),o=r(87266),a=r(29419),s=r(50317),l=n(a(),Number);i(l,{getPolyfill:a,implementation:o,shim:s}),t.exports=l},29419:(t,e,r)=>{"use strict";var n=r(87266);t.exports=function(){return Number.isNaN&&Number.isNaN(NaN)&&!Number.isNaN("a")?Number.isNaN:n}},50317:(t,e,r)=>{"use strict";var n=r(10781),i=r(29419);t.exports=function(){var t=i();return n(Number,{isNaN:t},{isNaN:function(){return Number.isNaN!==t}}),t}},23754:t=>{"use strict";t.exports=function(t){var e=typeof t;return null!==t&&("object"===e||"function"===e)}},35867:t=>{"use strict";var e=Object.prototype.toString;t.exports=function(t){var r;return"[object Object]"===e.call(t)&&(null===(r=Object.getPrototypeOf(t))||r===Object.getPrototypeOf({}))}},45219:t=>{"use strict";t.exports=function(t){for(var e,r=t.length,n=0;n13)&&32!==e&&133!==e&&160!==e&&5760!==e&&6158!==e&&(e<8192||e>8205)&&8232!==e&&8233!==e&&8239!==e&&8287!==e&&8288!==e&&12288!==e&&65279!==e)return!1;return!0}},12611:t=>{"use strict";t.exports=function(t){return"string"==typeof t&&(t=t.trim(),!!(/^[mzlhvcsqta]\s*[-+.0-9][^mlhvzcsqta]+/i.test(t)&&/[\dz]$/i.test(t)&&t.length>4))}},94179:(t,e,r)=>{"use strict";var n=r(17478);t.exports=function(t){return!!n(t)}},54387:t=>{"use strict";t.exports=Math.log2||function(t){return Math.log(t)*Math.LOG2E}},10024:t=>{var e={left:0,top:0};t.exports=function(t,r,n){r=r||t.currentTarget||t.srcElement,Array.isArray(n)||(n=[0,0]);var i,o=t.clientX||0,a=t.clientY||0,s=(i=r)===window||i===document||i===document.body?e:i.getBoundingClientRect();return n[0]=o-s.left,n[1]=a-s.top,n}},60613:function(t,e,r){var n;!function(i,o){o[i]=o[i]||function(){"use strict";var t,e,r,n=Object.prototype.toString,i="undefined"!=typeof setImmediate?function(t){return setImmediate(t)}:setTimeout;try{Object.defineProperty({},"x",{}),t=function(t,e,r,n){return Object.defineProperty(t,e,{value:r,writable:!0,configurable:!1!==n})}}catch(e){t=function(t,e,r){return t[e]=r,t}}function o(t,n){r.add(t,n),e||(e=i(r.drain))}function a(t){var e,r=typeof t;return null==t||"object"!=r&&"function"!=r||(e=t.then),"function"==typeof e&&e}function s(){for(var t=0;t0&&o(s,r))}catch(t){u.call(new d(r),t)}}}function u(t){var e=this;e.triggered||(e.triggered=!0,e.def&&(e=e.def),e.msg=t,e.state=2,e.chain.length>0&&o(s,e))}function h(t,e,r,n){for(var i=0;i{var e=Math.PI,r=s(120);function n(t,e,r,n){return["C",t,e,r,n,r,n]}function i(t,e,r,n,i,o){return["C",t/3+2/3*r,e/3+2/3*n,i/3+2/3*r,o/3+2/3*n,i,o]}function o(t,n,i,s,l,c,u,h,d,f){if(f)k=f[0],A=f[1],_=f[2],w=f[3];else{var p=a(t,n,-l);t=p.x,n=p.y;var m=(t-(h=(p=a(h,d,-l)).x))/2,g=(n-(d=p.y))/2,v=m*m/(i*i)+g*g/(s*s);v>1&&(i*=v=Math.sqrt(v),s*=v);var b=i*i,y=s*s,x=(c==u?-1:1)*Math.sqrt(Math.abs((b*y-b*g*g-y*m*m)/(b*g*g+y*m*m)));x==1/0&&(x=1);var _=x*i*g/s+(t+h)/2,w=x*-s*m/i+(n+d)/2,k=Math.asin(((n-w)/s).toFixed(9)),A=Math.asin(((d-w)/s).toFixed(9));(k=t<_?e-k:k)<0&&(k=2*e+k),(A=h<_?e-A:A)<0&&(A=2*e+A),u&&k>A&&(k-=2*e),!u&&A>k&&(A-=2*e)}if(Math.abs(A-k)>r){var M=A,T=h,S=d;A=k+r*(u&&A>k?1:-1);var C=o(h=_+i*Math.cos(A),d=w+s*Math.sin(A),i,s,l,0,u,T,S,[A,M,_,w])}var E=Math.tan((A-k)/4),L=4/3*i*E,z=4/3*s*E,O=[2*t-(t+L*Math.sin(k)),2*n-(n-z*Math.cos(k)),h+L*Math.sin(A),d-z*Math.cos(A),h,d];if(f)return O;C&&(O=O.concat(C));for(var D=0;D7&&(r.push(v.splice(0,7)),v.unshift("C"));break;case"S":var y=f,x=p;"C"!=e&&"S"!=e||(y+=y-a,x+=x-l),v=["C",y,x,v[1],v[2],v[3],v[4]];break;case"T":"Q"==e||"T"==e?(h=2*f-h,d=2*p-d):(h=f,d=p),v=i(f,p,h,d,v[1],v[2]);break;case"Q":h=v[1],d=v[2],v=i(f,p,v[1],v[2],v[3],v[4]);break;case"L":v=n(f,p,v[1],v[2]);break;case"H":v=n(f,p,v[1],p);break;case"V":v=n(f,p,f,v[1]);break;case"Z":v=n(f,p,c,u)}e=b,f=v[v.length-2],p=v[v.length-1],v.length>4?(a=v[v.length-4],l=v[v.length-3]):(a=f,l=p),r.push(v)}return r}},34597:t=>{"use strict";var e=Object.getOwnPropertySymbols,r=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;t.exports=function(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var e={},r=0;r<10;r++)e["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(e).map((function(t){return e[t]})).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach((function(t){n[t]=t})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(t){return!1}}()?Object.assign:function(t,i){for(var o,a,s=function(t){if(null==t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}(t),l=1;l{"use strict";var e=function(t){return t!=t};t.exports=function(t,r){return 0===t&&0===r?1/t==1/r:t===r||!(!e(t)||!e(r))}},62956:(t,e,r)=>{"use strict";var n=r(10781),i=r(61398),o=r(36560),a=r(43765),s=r(6723),l=i(a(),Object);n(l,{getPolyfill:a,implementation:o,shim:s}),t.exports=l},43765:(t,e,r)=>{"use strict";var n=r(36560);t.exports=function(){return"function"==typeof Object.is?Object.is:n}},6723:(t,e,r)=>{"use strict";var n=r(43765),i=r(10781);t.exports=function(){var t=n();return i(Object,{is:t},{is:function(){return Object.is!==t}}),t}},77908:(t,e,r)=>{"use strict";var n;if(!Object.keys){var i=Object.prototype.hasOwnProperty,o=Object.prototype.toString,a=r(12724),s=Object.prototype.propertyIsEnumerable,l=!s.call({toString:null},"toString"),c=s.call((function(){}),"prototype"),u=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],h=function(t){var e=t.constructor;return e&&e.prototype===t},d={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},f=function(){if("undefined"==typeof window)return!1;for(var t in window)try{if(!d["$"+t]&&i.call(window,t)&&null!==window[t]&&"object"==typeof window[t])try{h(window[t])}catch(t){return!0}}catch(t){return!0}return!1}();n=function(t){var e=null!==t&&"object"==typeof t,r="[object Function]"===o.call(t),n=a(t),s=e&&"[object String]"===o.call(t),d=[];if(!e&&!r&&!n)throw new TypeError("Object.keys called on a non-object");var p=c&&r;if(s&&t.length>0&&!i.call(t,0))for(var m=0;m0)for(var g=0;g{"use strict";var n=Array.prototype.slice,i=r(12724),o=Object.keys,a=o?function(t){return o(t)}:r(77908),s=Object.keys;a.shim=function(){if(Object.keys){var t=function(){var t=Object.keys(arguments);return t&&t.length===arguments.length}(1,2);t||(Object.keys=function(t){return i(t)?s(n.call(t)):s(t)})}else Object.keys=a;return Object.keys||a},t.exports=a},12724:t=>{"use strict";var e=Object.prototype.toString;t.exports=function(t){var r=e.call(t),n="[object Arguments]"===r;return n||(n="[object Array]"!==r&&null!==t&&"object"==typeof t&&"number"==typeof t.length&&t.length>=0&&"[object Function]"===e.call(t.callee)),n}},99864:(t,e,r)=>{"use strict";var n=r(99952),i=r(93272)(),o=r(24310),a=Object,s=o("Array.prototype.push"),l=o("Object.prototype.propertyIsEnumerable"),c=i?Object.getOwnPropertySymbols:null;t.exports=function(t,e){if(null==t)throw new TypeError("target must be an object");var r=a(t);if(1===arguments.length)return r;for(var o=1;o{"use strict";var n=r(99864);t.exports=function(){return Object.assign?function(){if(!Object.assign)return!1;for(var t="abcdefghijklmnopqrst",e=t.split(""),r={},n=0;n{"use strict";function e(t,e){if("string"!=typeof t)return[t];var r=[t];"string"==typeof e||Array.isArray(e)?e={brackets:e}:e||(e={});var n=e.brackets?Array.isArray(e.brackets)?e.brackets:[e.brackets]:["{}","[]","()"],i=e.escape||"___",o=!!e.flat;n.forEach((function(t){var e=new RegExp(["\\",t[0],"[^\\",t[0],"\\",t[1],"]*\\",t[1]].join("")),n=[];function o(e,o,a){var s=r.push(e.slice(t[0].length,-t[1].length))-1;return n.push(s),i+s+i}r.forEach((function(t,n){for(var i,a=0;t!=i;)if(i=t,t=t.replace(e,o),a++>1e4)throw Error("References have circular dependency. Please, check them.");r[n]=t})),n=n.reverse(),r=r.map((function(e){return n.forEach((function(r){e=e.replace(new RegExp("(\\"+i+r+"\\"+i+")","g"),t[0]+"$1"+t[1])})),e}))}));var a=new RegExp("\\"+i+"([0-9]+)\\"+i);return o?r:function t(e,r,n){for(var i,o=[],s=0;i=a.exec(e);){if(s++>1e4)throw Error("Circular references in parenthesis");o.push(e.slice(0,i.index)),o.push(t(r[i[1]],r)),e=e.slice(i.index+i[0].length)}return o.push(e),o}(r[0],r)}function r(t,e){if(e&&e.flat){var r,n=e&&e.escape||"___",i=t[0];if(!i)return"";for(var o=new RegExp("\\"+n+"([0-9]+)\\"+n),a=0;i!=r;){if(a++>1e4)throw Error("Circular references in "+t);r=i,i=i.replace(o,s)}return i}return t.reduce((function t(e,r){return Array.isArray(r)&&(r=r.reduce(t,"")),e+r}),"");function s(e,r){if(null==t[r])throw Error("Reference "+r+"is undefined");return t[r]}}function n(t,n){return Array.isArray(t)?r(t,n):e(t,n)}n.parse=e,n.stringify=r,t.exports=n},94698:(t,e,r)=>{"use strict";var n=r(9994);t.exports=function(t){var e;return arguments.length>1&&(t=arguments),"string"==typeof t?t=t.split(/\s/).map(parseFloat):"number"==typeof t&&(t=[t]),t.length&&"number"==typeof t[0]?e=1===t.length?{width:t[0],height:t[0],x:0,y:0}:2===t.length?{width:t[0],height:t[1],x:0,y:0}:{x:t[0],y:t[1],width:t[2]-t[0]||0,height:t[3]-t[1]||0}:t&&(e={x:(t=n(t,{left:"x l left Left",top:"y t top Top",width:"w width W Width",height:"h height W Width",bottom:"b bottom Bottom",right:"r right Right"})).left||0,y:t.top||0},null==t.width?t.right?e.width=t.right-e.x:e.width=0:e.width=t.width,null==t.height?t.bottom?e.height=t.bottom-e.y:e.height=0:e.height=t.height),e}},37974:t=>{t.exports=function(t){var i=[];return t.replace(r,(function(t,r,o){var a=r.toLowerCase();for(o=function(t){var e=t.match(n);return e?e.map(Number):[]}(o),"m"==a&&o.length>2&&(i.push([r].concat(o.splice(0,2))),a="l",r="m"==r?"l":"L");;){if(o.length==e[a])return o.unshift(r),i.push(o);if(o.length{t.exports=function(t,e){e||(e=[0,""]),t=String(t);var r=parseFloat(t,10);return e[0]=r,e[1]=t.match(/[\d.\-\+]*\s*(.*)/)[1]||"",e}},9994:t=>{"use strict";t.exports=function(t,e,n){var i,o,a={};if("string"==typeof e&&(e=r(e)),Array.isArray(e)){var s={};for(o=0;o{"use strict";var n=r(12822),i={"X,X div":'direction:ltr;font-family:"Open Sans",verdana,arial,sans-serif;margin:0;padding:0;',"X input,X button":'font-family:"Open Sans",verdana,arial,sans-serif;',"X input:focus,X button:focus":"outline:none;","X a":"text-decoration:none;","X a:hover":"text-decoration:none;","X .crisp":"shape-rendering:crispEdges;","X .user-select-none":"-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none;","X svg":"overflow:hidden;","X svg a":"fill:#447adb;","X svg a:hover":"fill:#3c6dc5;","X .main-svg":"position:absolute;top:0;left:0;pointer-events:none;","X .main-svg .draglayer":"pointer-events:all;","X .cursor-default":"cursor:default;","X .cursor-pointer":"cursor:pointer;","X .cursor-crosshair":"cursor:crosshair;","X .cursor-move":"cursor:move;","X .cursor-col-resize":"cursor:col-resize;","X .cursor-row-resize":"cursor:row-resize;","X .cursor-ns-resize":"cursor:ns-resize;","X .cursor-ew-resize":"cursor:ew-resize;","X .cursor-sw-resize":"cursor:sw-resize;","X .cursor-s-resize":"cursor:s-resize;","X .cursor-se-resize":"cursor:se-resize;","X .cursor-w-resize":"cursor:w-resize;","X .cursor-e-resize":"cursor:e-resize;","X .cursor-nw-resize":"cursor:nw-resize;","X .cursor-n-resize":"cursor:n-resize;","X .cursor-ne-resize":"cursor:ne-resize;","X .cursor-grab":"cursor:-webkit-grab;cursor:grab;","X .modebar":"position:absolute;top:2px;right:2px;","X .ease-bg":"-webkit-transition:background-color .3s ease 0s;-moz-transition:background-color .3s ease 0s;-ms-transition:background-color .3s ease 0s;-o-transition:background-color .3s ease 0s;transition:background-color .3s ease 0s;","X .modebar--hover>:not(.watermark)":"opacity:0;-webkit-transition:opacity .3s ease 0s;-moz-transition:opacity .3s ease 0s;-ms-transition:opacity .3s ease 0s;-o-transition:opacity .3s ease 0s;transition:opacity .3s ease 0s;","X:hover .modebar--hover .modebar-group":"opacity:1;","X .modebar-group":"float:left;display:inline-block;box-sizing:border-box;padding-left:8px;position:relative;vertical-align:middle;white-space:nowrap;","X .modebar-btn":"position:relative;font-size:16px;padding:3px 4px;height:22px;cursor:pointer;line-height:normal;box-sizing:border-box;","X .modebar-btn svg":"position:relative;top:2px;","X .modebar.vertical":"display:flex;flex-direction:column;flex-wrap:wrap;align-content:flex-end;max-height:100%;","X .modebar.vertical svg":"top:-1px;","X .modebar.vertical .modebar-group":"display:block;float:none;padding-left:0px;padding-bottom:8px;","X .modebar.vertical .modebar-group .modebar-btn":"display:block;text-align:center;","X [data-title]:before,X [data-title]:after":"position:absolute;-webkit-transform:translate3d(0, 0, 0);-moz-transform:translate3d(0, 0, 0);-ms-transform:translate3d(0, 0, 0);-o-transform:translate3d(0, 0, 0);transform:translate3d(0, 0, 0);display:none;opacity:0;z-index:1001;pointer-events:none;top:110%;right:50%;","X [data-title]:hover:before,X [data-title]:hover:after":"display:block;opacity:1;","X [data-title]:before":'content:"";position:absolute;background:rgba(0,0,0,0);border:6px solid rgba(0,0,0,0);z-index:1002;margin-top:-12px;border-bottom-color:#69738a;margin-right:-6px;',"X [data-title]:after":"content:attr(data-title);background:#69738a;color:#fff;padding:8px 10px;font-size:12px;line-height:12px;white-space:nowrap;margin-right:-18px;border-radius:2px;","X .vertical [data-title]:before,X .vertical [data-title]:after":"top:0%;right:200%;","X .vertical [data-title]:before":"border:6px solid rgba(0,0,0,0);border-left-color:#69738a;margin-top:8px;margin-right:-30px;",Y:'font-family:"Open Sans",verdana,arial,sans-serif;position:fixed;top:50px;right:20px;z-index:10000;font-size:10pt;max-width:180px;',"Y p":"margin:0;","Y .notifier-note":"min-width:180px;max-width:250px;border:1px solid #fff;z-index:3000;margin:0;background-color:#8c97af;background-color:rgba(140,151,175,.9);color:#fff;padding:10px;overflow-wrap:break-word;word-wrap:break-word;-ms-hyphens:auto;-webkit-hyphens:auto;hyphens:auto;","Y .notifier-close":"color:#fff;opacity:.8;float:right;padding:0 5px;background:none;border:none;font-size:20px;font-weight:bold;line-height:20px;","Y .notifier-close:hover":"color:#444;text-decoration:none;cursor:pointer;"};for(var o in i){var a=o.replace(/^,/," ,").replace(/X/g,".js-plotly-plot .plotly").replace(/Y/g,".plotly-notifier");n.addStyleRule(a,i[o])}},12028:(t,e,r)=>{"use strict";t.exports=r(7623)},72010:(t,e,r)=>{"use strict";t.exports=r(46443)},94646:(t,e,r)=>{"use strict";t.exports=r(88479)},91208:t=>{"use strict";t.exports=[{path:"",backoff:0},{path:"M-2.4,-3V3L0.6,0Z",backoff:.6},{path:"M-3.7,-2.5V2.5L1.3,0Z",backoff:1.3},{path:"M-4.45,-3L-1.65,-0.2V0.2L-4.45,3L1.55,0Z",backoff:1.55},{path:"M-2.2,-2.2L-0.2,-0.2V0.2L-2.2,2.2L-1.4,3L1.6,0L-1.4,-3Z",backoff:1.6},{path:"M-4.4,-2.1L-0.6,-0.2V0.2L-4.4,2.1L-4,3L2,0L-4,-3Z",backoff:2},{path:"M2,0A2,2 0 1,1 0,-2A2,2 0 0,1 2,0Z",backoff:0,noRotate:!0},{path:"M2,2V-2H-2V2Z",backoff:0,noRotate:!0}]},77061:(t,e,r)=>{"use strict";var n=r(91208),i=r(75058),o=r(21197),a=r(46121).templatedArray,s=r(53644);function l(t){return["In order for absolute positioning of the arrow to work, *a"+t+"ref* must be exactly the same as *"+t+"ref*, otherwise *a"+t+"ref* will revert to *pixel* (explained next).","For relative positioning, *a"+t+"ref* can be set to *pixel*,","in which case the *a"+t+"* value is specified in pixels","relative to *"+t+"*.","Absolute positioning is useful","for trendline annotations which should continue to indicate","the correct trend when zoomed. Relative positioning is useful","for specifying the text offset for an annotated point."].join(" ")}function c(t,e,r){return["Sets the",t,"component of the arrow tail about the arrow head.","If `a"+t+"ref` is `pixel`, a positive (negative)","component corresponds to an arrow pointing","from",r,"to",e,"("+e,"to",r+").","If `a"+t+"ref` is not `pixel` and is exactly the same as `"+t+"ref`,","this is an absolute value on that axis,","like `"+t+"`, specified in the same coordinates as `"+t+"ref`."].join(" ")}t.exports=a("annotation",{visible:{valType:"boolean",dflt:!0,editType:"calc+arraydraw",description:["Determines whether or not this annotation is visible."].join(" ")},text:{valType:"string",editType:"calc+arraydraw",description:["Sets the text associated with this annotation.","Plotly uses a subset of HTML tags to do things like","newline (
), bold (), italics (),","hyperlinks (). Tags , , , , "," are also supported."].join(" ")},textangle:{valType:"angle",dflt:0,editType:"calc+arraydraw",description:["Sets the angle at which the `text` is drawn","with respect to the horizontal."].join(" ")},font:i({editType:"calc+arraydraw",colorEditType:"arraydraw",description:"Sets the annotation text font."}),width:{valType:"number",min:1,dflt:null,editType:"calc+arraydraw",description:["Sets an explicit width for the text box. null (default) lets the","text set the box width. Wider text will be clipped.","There is no automatic wrapping; use
to start a new line."].join(" ")},height:{valType:"number",min:1,dflt:null,editType:"calc+arraydraw",description:["Sets an explicit height for the text box. null (default) lets the","text set the box height. Taller text will be clipped."].join(" ")},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw",description:"Sets the opacity of the annotation (text + arrow)."},align:{valType:"enumerated",values:["left","center","right"],dflt:"center",editType:"arraydraw",description:["Sets the horizontal alignment of the `text` within the box.","Has an effect only if `text` spans two or more lines","(i.e. `text` contains one or more
HTML tags) or if an","explicit width is set to override the text width."].join(" ")},valign:{valType:"enumerated",values:["top","middle","bottom"],dflt:"middle",editType:"arraydraw",description:["Sets the vertical alignment of the `text` within the box.","Has an effect only if an explicit height is set to override","the text height."].join(" ")},bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw",description:"Sets the background color of the annotation."},bordercolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw",description:["Sets the color of the border enclosing the annotation `text`."].join(" ")},borderpad:{valType:"number",min:0,dflt:1,editType:"calc+arraydraw",description:["Sets the padding (in px) between the `text`","and the enclosing border."].join(" ")},borderwidth:{valType:"number",min:0,dflt:1,editType:"calc+arraydraw",description:["Sets the width (in px) of the border enclosing","the annotation `text`."].join(" ")},showarrow:{valType:"boolean",dflt:!0,editType:"calc+arraydraw",description:["Determines whether or not the annotation is drawn with an arrow.","If *true*, `text` is placed near the arrow's tail.","If *false*, `text` lines up with the `x` and `y` provided."].join(" ")},arrowcolor:{valType:"color",editType:"arraydraw",description:"Sets the color of the annotation arrow."},arrowhead:{valType:"integer",min:0,max:n.length,dflt:1,editType:"arraydraw",description:"Sets the end annotation arrow head style."},startarrowhead:{valType:"integer",min:0,max:n.length,dflt:1,editType:"arraydraw",description:"Sets the start annotation arrow head style."},arrowside:{valType:"flaglist",flags:["end","start"],extras:["none"],dflt:"end",editType:"arraydraw",description:"Sets the annotation arrow head position."},arrowsize:{valType:"number",min:.3,dflt:1,editType:"calc+arraydraw",description:["Sets the size of the end annotation arrow head, relative to `arrowwidth`.","A value of 1 (default) gives a head about 3x as wide as the line."].join(" ")},startarrowsize:{valType:"number",min:.3,dflt:1,editType:"calc+arraydraw",description:["Sets the size of the start annotation arrow head, relative to `arrowwidth`.","A value of 1 (default) gives a head about 3x as wide as the line."].join(" ")},arrowwidth:{valType:"number",min:.1,editType:"calc+arraydraw",description:"Sets the width (in px) of annotation arrow line."},standoff:{valType:"number",min:0,dflt:0,editType:"calc+arraydraw",description:["Sets a distance, in pixels, to move the end arrowhead away from the","position it is pointing at, for example to point at the edge of","a marker independent of zoom. Note that this shortens the arrow","from the `ax` / `ay` vector, in contrast to `xshift` / `yshift`","which moves everything by this amount."].join(" ")},startstandoff:{valType:"number",min:0,dflt:0,editType:"calc+arraydraw",description:["Sets a distance, in pixels, to move the start arrowhead away from the","position it is pointing at, for example to point at the edge of","a marker independent of zoom. Note that this shortens the arrow","from the `ax` / `ay` vector, in contrast to `xshift` / `yshift`","which moves everything by this amount."].join(" ")},ax:{valType:"any",editType:"calc+arraydraw",description:[c("x","left","right")].join(" ")},ay:{valType:"any",editType:"calc+arraydraw",description:[c("y","top","bottom")].join(" ")},axref:{valType:"enumerated",dflt:"pixel",values:["pixel",o.idRegex.x.toString()],editType:"calc",description:["Indicates in what coordinates the tail of the","annotation (ax,ay) is specified.",s.axisRefDescription("x","left","right"),l("x")].join(" ")},ayref:{valType:"enumerated",dflt:"pixel",values:["pixel",o.idRegex.y.toString()],editType:"calc",description:["Indicates in what coordinates the tail of the","annotation (ax,ay) is specified.",s.axisRefDescription("y","bottom","top"),l("y")].join(" ")},xref:{valType:"enumerated",values:["paper",o.idRegex.x.toString()],editType:"calc",description:["Sets the annotation's x coordinate axis.",s.axisRefDescription("x","left","right")].join(" ")},x:{valType:"any",editType:"calc+arraydraw",description:["Sets the annotation's x position.","If the axis `type` is *log*, then you must take the","log of your desired range.","If the axis `type` is *date*, it should be date strings,","like date data, though Date objects and unix milliseconds","will be accepted and converted to strings.","If the axis `type` is *category*, it should be numbers,","using the scale where each category is assigned a serial","number from zero in the order it appears."].join(" ")},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"auto",editType:"calc+arraydraw",description:["Sets the text box's horizontal position anchor","This anchor binds the `x` position to the *left*, *center*","or *right* of the annotation.","For example, if `x` is set to 1, `xref` to *paper* and","`xanchor` to *right* then the right-most portion of the","annotation lines up with the right-most edge of the","plotting area.","If *auto*, the anchor is equivalent to *center* for","data-referenced annotations or if there is an arrow,","whereas for paper-referenced with no arrow, the anchor picked","corresponds to the closest side."].join(" ")},xshift:{valType:"number",dflt:0,editType:"calc+arraydraw",description:["Shifts the position of the whole annotation and arrow to the","right (positive) or left (negative) by this many pixels."].join(" ")},yref:{valType:"enumerated",values:["paper",o.idRegex.y.toString()],editType:"calc",description:["Sets the annotation's y coordinate axis.",s.axisRefDescription("y","bottom","top")].join(" ")},y:{valType:"any",editType:"calc+arraydraw",description:["Sets the annotation's y position.","If the axis `type` is *log*, then you must take the","log of your desired range.","If the axis `type` is *date*, it should be date strings,","like date data, though Date objects and unix milliseconds","will be accepted and converted to strings.","If the axis `type` is *category*, it should be numbers,","using the scale where each category is assigned a serial","number from zero in the order it appears."].join(" ")},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"auto",editType:"calc+arraydraw",description:["Sets the text box's vertical position anchor","This anchor binds the `y` position to the *top*, *middle*","or *bottom* of the annotation.","For example, if `y` is set to 1, `yref` to *paper* and","`yanchor` to *top* then the top-most portion of the","annotation lines up with the top-most edge of the","plotting area.","If *auto*, the anchor is equivalent to *middle* for","data-referenced annotations or if there is an arrow,","whereas for paper-referenced with no arrow, the anchor picked","corresponds to the closest side."].join(" ")},yshift:{valType:"number",dflt:0,editType:"calc+arraydraw",description:["Shifts the position of the whole annotation and arrow up","(positive) or down (negative) by this many pixels."].join(" ")},clicktoshow:{valType:"enumerated",values:[!1,"onoff","onout"],dflt:!1,editType:"arraydraw",description:["Makes this annotation respond to clicks on the plot.","If you click a data point that exactly matches the `x` and `y`","values of this annotation, and it is hidden (visible: false),","it will appear. In *onoff* mode, you must click the same point","again to make it disappear, so if you click multiple points,","you can show multiple annotations. In *onout* mode, a click","anywhere else in the plot (on another data point or not) will","hide this annotation.","If you need to show/hide this annotation in response to different","`x` or `y` values, you can set `xclick` and/or `yclick`. This is","useful for example to label the side of a bar. To label markers","though, `standoff` is preferred over `xclick` and `yclick`."].join(" ")},xclick:{valType:"any",editType:"arraydraw",description:["Toggle this annotation when clicking a data point whose `x` value","is `xclick` rather than the annotation's `x` value."].join(" ")},yclick:{valType:"any",editType:"arraydraw",description:["Toggle this annotation when clicking a data point whose `y` value","is `yclick` rather than the annotation's `y` value."].join(" ")},hovertext:{valType:"string",editType:"arraydraw",description:["Sets text to appear when hovering over this annotation.","If omitted or blank, no hover label will appear."].join(" ")},hoverlabel:{bgcolor:{valType:"color",editType:"arraydraw",description:["Sets the background color of the hover label.","By default uses the annotation's `bgcolor` made opaque,","or white if it was transparent."].join(" ")},bordercolor:{valType:"color",editType:"arraydraw",description:["Sets the border color of the hover label.","By default uses either dark grey or white, for maximum","contrast with `hoverlabel.bgcolor`."].join(" ")},font:i({editType:"arraydraw",description:["Sets the hover label text font.","By default uses the global hover font and size,","with color from `hoverlabel.bordercolor`."].join(" ")}),editType:"arraydraw"},captureevents:{valType:"boolean",editType:"arraydraw",description:["Determines whether the annotation text box captures mouse move","and click events, or allows those events to pass through to data","points in the plot that may be behind the annotation. By default","`captureevents` is *false* unless `hovertext` is provided.","If you use the event `plotly_clickannotation` without `hovertext`","you must explicitly enable `captureevents`."].join(" ")},editType:"calc",_deprecated:{ref:{valType:"string",editType:"calc",description:["Obsolete. Set `xref` and `yref` separately instead."].join(" ")}}})},37830:(t,e,r)=>{"use strict";var n=r(12822),i=r(75815),o=r(8214).draw;function a(t){var e=t._fullLayout;n.filterVisible(e.annotations).forEach((function(e){var r=i.getFromId(t,e.xref),n=i.getFromId(t,e.yref),o=i.getRefType(e.xref),a=i.getRefType(e.yref);e._extremes={},"range"===o&&s(e,r),"range"===a&&s(e,n)}))}function s(t,e){var r,n=e._id,o=n.charAt(0),a=t[o],s=t["a"+o],l=t[o+"ref"],c=t["a"+o+"ref"],u=t["_"+o+"padplus"],h=t["_"+o+"padminus"],d={x:1,y:-1}[o]*t[o+"shift"],f=3*t.arrowsize*t.arrowwidth||0,p=f+d,m=f-d,g=3*t.startarrowsize*t.arrowwidth||0,v=g+d,b=g-d;if(c===l){var y=i.findExtremes(e,[e.r2c(a)],{ppadplus:p,ppadminus:m}),x=i.findExtremes(e,[e.r2c(s)],{ppadplus:Math.max(u,v),ppadminus:Math.max(h,b)});r={min:[y.min[0],x.min[0]],max:[y.max[0],x.max[0]]}}else v=s?v+s:v,b=s?b-s:b,r=i.findExtremes(e,[e.r2c(a)],{ppadplus:Math.max(u,p,v),ppadminus:Math.max(h,m,b)});t._extremes[n]=r}t.exports=function(t){var e=t._fullLayout;if(n.filterVisible(e.annotations).length&&t._fullData.length)return n.syncOrAsync([o,a],t)}},74434:(t,e,r)=>{"use strict";var n=r(12822),i=r(25059),o=r(46121).arrayEditor;function a(t,e){var r,n,i,o,a,l,c,u=t._fullLayout.annotations,h=[],d=[],f=[],p=(e||[]).length;for(r=0;r0||r.explicitOff.length>0},onClick:function(t,e){var r,s,l=a(t,e),c=l.on,u=l.off.concat(l.explicitOff),h={},d=t._fullLayout.annotations;if(c.length||u.length){for(r=0;r{"use strict";var n=r(12822),i=r(17499);t.exports=function(t,e,r,o){o("opacity");var a=o("bgcolor"),s=o("bordercolor"),l=i.opacity(s);o("borderpad");var c=o("borderwidth"),u=o("showarrow");if(o("text",u?" ":r._dfltTitle.annotation),o("textangle"),n.coerceFont(o,"font",r.font),o("width"),o("align"),o("height")&&o("valign"),u){var h,d,f=o("arrowside");-1!==f.indexOf("end")&&(h=o("arrowhead"),d=o("arrowsize")),-1!==f.indexOf("start")&&(o("startarrowhead",h),o("startarrowsize",d)),o("arrowcolor",l?e.bordercolor:i.defaultLine),o("arrowwidth",2*(l&&c||1)),o("standoff"),o("startstandoff")}var p=o("hovertext"),m=r.hoverlabel||{};if(p){var g=o("hoverlabel.bgcolor",m.bgcolor||(i.opacity(a)?i.rgb(a):i.defaultLine)),v=o("hoverlabel.bordercolor",m.bordercolor||i.contrast(g)),b=n.extendFlat({},m.font);b.color||(b.color=v),n.coerceFont(o,"hoverlabel.font",b)}o("captureevents",!!p)}},44102:(t,e,r)=>{"use strict";var n=r(7370),i=r(61814);t.exports=function(t,e,r,o){e=e||{};var a="log"===r&&"linear"===e.type,s="linear"===r&&"log"===e.type;if(a||s)for(var l,c,u=t._fullLayout.annotations,h=e._id.charAt(0),d=0;d{"use strict";var n=r(12822),i=r(75815),o=r(35677),a=r(35486),s=r(77061);function l(t,e,r){function o(r,i){return n.coerce(t,e,s,r,i)}var l=o("visible"),c=o("clicktoshow");if(l||c){a(t,e,r,o);for(var u=e.showarrow,h=["x","y"],d=[-10,-30],f={_fullLayout:r},p=0;p<2;p++){var m=h[p],g=i.coerceRef(t,e,f,m,"","paper");if("paper"!==g&&i.getFromId(f,g)._annIndices.push(e._index),i.coercePosition(e,f,o,g,m,.5),u){var v="a"+m,b=i.coerceRef(t,e,f,v,"pixel",["pixel","paper"]);"pixel"!==b&&b!==g&&(b=e[v]="pixel");var y="pixel"===b?d[p]:.4;i.coercePosition(e,f,o,b,v,y)}o(m+"anchor"),o(m+"shift")}if(n.noneOrAll(t,e,["x","y"]),u&&n.noneOrAll(t,e,["ax","ay"]),c){var x=o("xclick"),_=o("yclick");e._xclick=void 0===x?e.x:i.cleanPosition(x,f,e.xref),e._yclick=void 0===_?e.y:i.cleanPosition(_,f,e.yref)}}}t.exports=function(t,e){o(t,e,{name:"annotations",handleItemDefaults:l})}},8214:(t,e,r)=>{"use strict";var n=r(27941),i=r(25059),o=r(51137),a=r(12822),s=a.strTranslate,l=r(75815),c=r(17499),u=r(40666),h=r(70410),d=r(80394),f=r(76292),p=r(19846),m=r(46121).arrayEditor,g=r(65753);function v(t,e){var r=t._fullLayout.annotations[e]||{},n=l.getFromId(t,r.xref),i=l.getFromId(t,r.yref);n&&n.setScale(),i&&i.setScale(),y(t,r,e,!1,n,i)}function b(t,e,r,n,i){var o=i[r],a=i[r+"ref"],s=-1!==r.indexOf("y"),c="domain"===l.getRefType(a),u=s?n.h:n.w;return t?c?o+(s?-e:e)/t._length:t.p2r(t.r2p(o)+e):o+(s?-e:e)/u}function y(t,e,r,o,v,y){var x,_,w=t._fullLayout,k=t._fullLayout._size,A=t._context.edits;o?(x="annotation-"+o,_=o+".annotations"):(x="annotation",_="annotations");var M=m(t.layout,_,e),T=M.modifyBase,S=M.modifyItem,C=M.getUpdateObj;w._infolayer.selectAll("."+x+'[data-index="'+r+'"]').remove();var E="clip"+w._uid+"_ann"+r;if(e._input&&!1!==e.visible){var L={x:{},y:{}},z=+e.textangle||0,O=w._infolayer.append("g").classed(x,!0).attr("data-index",String(r)).style("opacity",e.opacity),D=O.append("g").classed("annotation-text-g",!0),I=A[e.showarrow?"annotationTail":"annotationPosition"],F=e.captureevents||A.annotationText||I,R=D.append("g").style("pointer-events",F?"all":null).call(f,"pointer").on("click",(function(){t._dragging=!1,t.emit("plotly_clickannotation",q(n.event))}));e.hovertext&&R.on("mouseover",(function(){var r=e.hoverlabel,n=r.font,i=this.getBoundingClientRect(),o=t.getBoundingClientRect();h.loneHover({x0:i.left-o.left,x1:i.right-o.left,y:(i.top+i.bottom)/2-o.top,text:e.hovertext,color:r.bgcolor,borderColor:r.bordercolor,fontFamily:n.family,fontSize:n.size,fontColor:n.color,fontWeight:n.weight,fontStyle:n.style,fontVariant:n.variant,fontShadow:n.fontShadow,fontLineposition:n.fontLineposition,fontTextcase:n.fontTextcase},{container:w._hoverlayer.node(),outerContainer:w._paper.node(),gd:t})})).on("mouseout",(function(){h.loneUnhover(w._hoverlayer.node())}));var P=e.borderwidth,j=e.borderpad,N=P+j,B=R.append("rect").attr("class","bg").style("stroke-width",P+"px").call(c.stroke,e.bordercolor).call(c.fill,e.bgcolor),U=e.width||e.height,G=w._topclips.selectAll("#"+E).data(U?[0]:[]);G.enter().append("clipPath").classed("annclip",!0).attr("id",E).append("rect"),G.exit().remove();var V=e.font,H=w._meta?a.templateString(e.text,w._meta):e.text,W=R.append("text").classed("annotation-text",!0).text(H);A.annotationText?W.call(d.makeEditable,{delegate:R,gd:t}).call(Y).on("edit",(function(r){e.text=r,this.call(Y),S("text",r),v&&v.autorange&&T(v._name+".autorange",!0),y&&y.autorange&&T(y._name+".autorange",!0),i.call("_guiRelayout",t,C())})):W.call(Y)}else n.selectAll("#"+E).remove();function q(t){var n={index:r,annotation:e._input,fullAnnotation:e,event:t};return o&&(n.subplotId=o),n}function Y(r){return r.call(u.font,V).attr({"text-anchor":{left:"start",right:"end"}[e.align]||"middle"}),d.convertToTspans(r,t,Z),r}function Z(){var r=W.selectAll("a");1===r.size()&&r.text()===W.text()&&R.insert("a",":first-child").attr({"xlink:xlink:href":r.attr("xlink:href"),"xlink:xlink:show":r.attr("xlink:show")}).style({cursor:"pointer"}).node().appendChild(B.node());var n=R.select(".annotation-text-math-group"),h=!n.empty(),m=u.bBox((h?n:W).node()),x=m.width,_=m.height,M=e.width||x,F=e.height||_,j=Math.round(M+2*N),V=Math.round(F+2*N);function H(t,e){return"auto"===e&&(e=t<1/3?"left":t>2/3?"right":"center"),{center:0,middle:0,left:.5,bottom:-.5,right:-.5,top:.5}[e]}for(var Y=!1,Z=["x","y"],X=0;X1)&&(nt===rt?((ft=it.r2fraction(e["a"+et]))<0||ft>1)&&(Y=!0):Y=!0),$=it._offset+it.r2p(e[et]),Q=.5}else{var pt="domain"===dt;"x"===et?(K=e[et],$=pt?it._offset+it._length*K:$=k.l+k.w*K):(K=1-e[et],$=pt?it._offset+it._length*K:$=k.t+k.h*K),Q=e.showarrow?.5:K}if(e.showarrow){ht.head=$;var mt=e["a"+et];if(tt=at*H(.5,e.xanchor)-st*H(.5,e.yanchor),nt===rt){var gt=l.getRefType(nt);"domain"===gt?("y"===et&&(mt=1-mt),ht.tail=it._offset+it._length*mt):"paper"===gt?"y"===et?(mt=1-mt,ht.tail=k.t+k.h*mt):ht.tail=k.l+k.w*mt:ht.tail=it._offset+it.r2p(mt),J=tt}else ht.tail=$+mt,J=tt+mt;ht.text=ht.tail+tt;var vt=w["x"===et?"width":"height"];if("paper"===rt&&(ht.head=a.constrain(ht.head,1,vt-1)),"pixel"===nt){var bt=-Math.max(ht.tail-3,ht.text),yt=Math.min(ht.tail+3,ht.text)-vt;bt>0?(ht.tail+=bt,ht.text+=bt):yt>0&&(ht.tail-=yt,ht.text-=yt)}ht.tail+=ut,ht.head+=ut}else J=tt=lt*H(Q,ct),ht.text=$+tt;ht.text+=ut,tt+=ut,J+=ut,e["_"+et+"padplus"]=lt/2+J,e["_"+et+"padminus"]=lt/2-J,e["_"+et+"size"]=lt,e["_"+et+"shift"]=tt}if(Y)R.remove();else{var xt=0,_t=0;if("left"!==e.align&&(xt=(M-x)*("center"===e.align?.5:1)),"top"!==e.valign&&(_t=(F-_)*("middle"===e.valign?.5:1)),h)n.select("svg").attr({x:N+xt-1,y:N+_t}).call(u.setClipUrl,U?E:null,t);else{var wt=N+_t-m.top,kt=N+xt-m.left;W.call(d.positionText,kt,wt).call(u.setClipUrl,U?E:null,t)}G.select("rect").call(u.setRect,N,N,M,F),B.call(u.setRect,P/2,P/2,j-P,V-P),R.call(u.setTranslate,Math.round(L.x.text-j/2),Math.round(L.y.text-V/2)),D.attr({transform:"rotate("+z+","+L.x.text+","+L.y.text+")"});var At,Mt=function(r,n){O.selectAll(".annotation-arrow-g").remove();var l=L.x.head,h=L.y.head,d=L.x.tail+r,f=L.y.tail+n,m=L.x.text+r,x=L.y.text+n,_=a.rotationXYMatrix(z,m,x),w=a.apply2DTransform(_),M=a.apply2DTransform2(_),E=+B.attr("width"),I=+B.attr("height"),F=m-.5*E,P=F+E,j=x-.5*I,N=j+I,U=[[F,j,F,N],[F,N,P,N],[P,N,P,j],[P,j,F,j]].map(M);if(!U.reduce((function(t,e){return t^!!a.segmentsIntersect(l,h,l+1e6,h+1e6,e[0],e[1],e[2],e[3])}),!1)){U.forEach((function(t){var e=a.segmentsIntersect(d,f,l,h,t[0],t[1],t[2],t[3]);e&&(d=e.x,f=e.y)}));var G=e.arrowwidth,V=e.arrowcolor,H=e.arrowside,W=O.append("g").style({opacity:c.opacity(V)}).classed("annotation-arrow-g",!0),q=W.append("path").attr("d","M"+d+","+f+"L"+l+","+h).style("stroke-width",G+"px").call(c.stroke,c.rgb(V));if(g(q,H,e),A.annotationPosition&&q.node().parentNode&&!o){var Y=l,Z=h;if(e.standoff){var X=Math.sqrt(Math.pow(l-d,2)+Math.pow(h-f,2));Y+=e.standoff*(d-l)/X,Z+=e.standoff*(f-h)/X}var $,J,K=W.append("path").classed("annotation-arrow",!0).classed("anndrag",!0).classed("cursor-move",!0).attr({d:"M3,3H-3V-3H3ZM0,0L"+(d-Y)+","+(f-Z),transform:s(Y,Z)}).style("stroke-width",G+6+"px").call(c.stroke,"rgba(0,0,0,0)").call(c.fill,"rgba(0,0,0,0)");p.init({element:K.node(),gd:t,prepFn:function(){var t=u.getTranslate(R);$=t.x,J=t.y,v&&v.autorange&&T(v._name+".autorange",!0),y&&y.autorange&&T(y._name+".autorange",!0)},moveFn:function(t,r){var n=w($,J),i=n[0]+t,o=n[1]+r;R.call(u.setTranslate,i,o),S("x",b(v,t,"x",k,e)),S("y",b(y,r,"y",k,e)),e.axref===e.xref&&S("ax",b(v,t,"ax",k,e)),e.ayref===e.yref&&S("ay",b(y,r,"ay",k,e)),W.attr("transform",s(t,r)),D.attr({transform:"rotate("+z+","+i+","+o+")"})},doneFn:function(){i.call("_guiRelayout",t,C());var e=document.querySelector(".js-notes-box-panel");e&&e.redraw(e.selectedObj)}})}}};e.showarrow&&Mt(0,0),I&&p.init({element:R.node(),gd:t,prepFn:function(){At=D.attr("transform")},moveFn:function(t,r){var n="pointer";if(e.showarrow)e.axref===e.xref?S("ax",b(v,t,"ax",k,e)):S("ax",e.ax+t),e.ayref===e.yref?S("ay",b(y,r,"ay",k.w,e)):S("ay",e.ay+r),Mt(t,r);else{if(o)return;var i,a;if(v)i=b(v,t,"x",k,e);else{var l=e._xsize/k.w,c=e.x+(e._xshift-e.xshift)/k.w-l/2;i=p.align(c+t/k.w,l,0,1,e.xanchor)}if(y)a=b(y,r,"y",k,e);else{var u=e._ysize/k.h,h=e.y-(e._yshift+e.yshift)/k.h-u/2;a=p.align(h-r/k.h,u,0,1,e.yanchor)}S("x",i),S("y",a),v&&y||(n=p.getCursor(v?.5:i,y?.5:a,e.xanchor,e.yanchor))}D.attr({transform:s(t,r)+At}),f(R,n)},clickFn:function(r,n){e.captureevents&&t.emit("plotly_clickannotation",q(n))},doneFn:function(){f(R),i.call("_guiRelayout",t,C());var e=document.querySelector(".js-notes-box-panel");e&&e.redraw(e.selectedObj)}})}}}t.exports={draw:function(t){var e=t._fullLayout;e._infolayer.selectAll(".annotation").remove();for(var r=0;r{"use strict";var n=r(27941),i=r(17499),o=r(91208),a=r(12822),s=a.strScale,l=a.strRotate,c=a.strTranslate;t.exports=function(t,e,r){var a,u,h,d,f=t.node(),p=o[r.arrowhead||0],m=o[r.startarrowhead||0],g=(r.arrowwidth||1)*(r.arrowsize||1),v=(r.arrowwidth||1)*(r.startarrowsize||1),b=e.indexOf("start")>=0,y=e.indexOf("end")>=0,x=p.backoff*g+r.standoff,_=m.backoff*v+r.startstandoff;if("line"===f.nodeName){a={x:+t.attr("x1"),y:+t.attr("y1")},u={x:+t.attr("x2"),y:+t.attr("y2")};var w=a.x-u.x,k=a.y-u.y;if(d=(h=Math.atan2(k,w))+Math.PI,x&&_&&x+_>Math.sqrt(w*w+k*k))return void I();if(x){if(x*x>w*w+k*k)return void I();var A=x*Math.cos(h),M=x*Math.sin(h);u.x+=A,u.y+=M,t.attr({x2:u.x,y2:u.y})}if(_){if(_*_>w*w+k*k)return void I();var T=_*Math.cos(h),S=_*Math.sin(h);a.x-=T,a.y-=S,t.attr({x1:a.x,y1:a.y})}}else if("path"===f.nodeName){var C=f.getTotalLength(),E="";if(C{"use strict";var n=r(8214),i=r(74434);t.exports={moduleType:"component",name:"annotations",layoutAttributes:r(77061),supplyLayoutDefaults:r(26194),includeBasePlot:r(39859)("annotations"),calcAutorange:r(37830),draw:n.draw,drawOne:n.drawOne,drawRaw:n.drawRaw,hasClickToShow:i.hasClickToShow,onClick:i.onClick,convertCoords:r(44102)}},98368:(t,e,r)=>{"use strict";var n=r(77061),i=r(62309).overrideAll,o=r(46121).templatedArray;t.exports=i(o("annotation",{visible:n.visible,x:{valType:"any",description:["Sets the annotation's x position."].join(" ")},y:{valType:"any",description:["Sets the annotation's y position."].join(" ")},z:{valType:"any",description:["Sets the annotation's z position."].join(" ")},ax:{valType:"number",description:["Sets the x component of the arrow tail about the arrow head (in pixels)."].join(" ")},ay:{valType:"number",description:["Sets the y component of the arrow tail about the arrow head (in pixels)."].join(" ")},xanchor:n.xanchor,xshift:n.xshift,yanchor:n.yanchor,yshift:n.yshift,text:n.text,textangle:n.textangle,font:n.font,width:n.width,height:n.height,opacity:n.opacity,align:n.align,valign:n.valign,bgcolor:n.bgcolor,bordercolor:n.bordercolor,borderpad:n.borderpad,borderwidth:n.borderwidth,showarrow:n.showarrow,arrowcolor:n.arrowcolor,arrowhead:n.arrowhead,startarrowhead:n.startarrowhead,arrowside:n.arrowside,arrowsize:n.arrowsize,startarrowsize:n.startarrowsize,arrowwidth:n.arrowwidth,standoff:n.standoff,startstandoff:n.startstandoff,hovertext:n.hovertext,hoverlabel:n.hoverlabel,captureevents:n.captureevents}),"calc","from-root")},81030:(t,e,r)=>{"use strict";var n=r(12822),i=r(75815);function o(t,e){var r=e.fullSceneLayout.domain,o=e.fullLayout._size,a={pdata:null,type:"linear",autorange:!1,range:[-1/0,1/0]};t._xa={},n.extendFlat(t._xa,a),i.setConvert(t._xa),t._xa._offset=o.l+r.x[0]*o.w,t._xa.l2p=function(){return.5*(1+t._pdata[0]/t._pdata[3])*o.w*(r.x[1]-r.x[0])},t._ya={},n.extendFlat(t._ya,a),i.setConvert(t._ya),t._ya._offset=o.t+(1-r.y[1])*o.h,t._ya.l2p=function(){return.5*(1-t._pdata[1]/t._pdata[3])*o.h*(r.y[1]-r.y[0])}}t.exports=function(t){for(var e=t.fullSceneLayout.annotations,r=0;r{"use strict";var n=r(12822),i=r(75815),o=r(35677),a=r(35486),s=r(98368);function l(t,e,r,o){function l(r,i){return n.coerce(t,e,s,r,i)}function c(t){var n=t+"axis",o={_fullLayout:{}};return o._fullLayout[n]=r[n],i.coercePosition(e,o,l,t,t,.5)}l("visible")&&(a(t,e,o.fullLayout,l),c("x"),c("y"),c("z"),n.noneOrAll(t,e,["x","y","z"]),e.xref="x",e.yref="y",e.zref="z",l("xanchor"),l("yanchor"),l("xshift"),l("yshift"),e.showarrow&&(e.axref="pixel",e.ayref="pixel",l("ax",-10),l("ay",-30),n.noneOrAll(t,e,["ax","ay"])))}t.exports=function(t,e,r){o(t,e,{name:"annotations",handleItemDefaults:l,fullLayout:r.fullLayout})}},86191:(t,e,r)=>{"use strict";var n=r(8214).drawRaw,i=r(40747),o=["x","y","z"];t.exports=function(t){for(var e=t.fullSceneLayout,r=t.dataScale,a=e.annotations,s=0;s1){c=!0;break}}c?t.fullLayout._infolayer.select(".annotation-"+t.id+'[data-index="'+s+'"]').remove():(l._pdata=i(t.glplot.cameraParams,[e.xaxis.r2l(l.x)*r[0],e.yaxis.r2l(l.y)*r[1],e.zaxis.r2l(l.z)*r[2]]),n(t.graphDiv,l,s,t.id,l._xa,l._ya))}}},95997:(t,e,r)=>{"use strict";var n=r(25059),i=r(12822);t.exports={moduleType:"component",name:"annotations3d",schema:{subplots:{scene:{annotations:r(98368)}}},layoutAttributes:r(98368),handleDefaults:r(76023),includeBasePlot:function(t,e){var r=n.subplotsRegistry.gl3d;if(r)for(var o=r.attrRegex,a=Object.keys(t),s=0;s{"use strict";e.defaults=["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],e.defaultLine="#444",e.lightLine="#eee",e.background="#fff",e.borderLine="#BEC8D9",e.lightFraction=1e3/11},17499:(t,e,r)=>{"use strict";var n=r(18106),i=r(7370),o=r(98507).isTypedArray,a=t.exports={},s=r(84226);a.defaults=s.defaults;var l=a.defaultLine=s.defaultLine;a.lightLine=s.lightLine;var c=a.background=s.background;function u(t){if(i(t)||"string"!=typeof t)return t;var e=t.trim();if("rgb"!==e.substr(0,3))return t;var r=e.match(/^rgba?\s*\(([^()]*)\)$/);if(!r)return t;var n=r[1].trim().split(/\s*[\s,]\s*/),o="a"===e.charAt(3)&&4===n.length;if(!o&&3!==n.length)return t;for(var a=0;a=0))return t;if(3===a)n[a]>1&&(n[a]=1);else if(n[a]>=1)return t}var s=Math.round(255*n[0])+", "+Math.round(255*n[1])+", "+Math.round(255*n[2]);return o?"rgba("+s+", "+n[3]+")":"rgb("+s+")"}a.tinyRGB=function(t){var e=t.toRgb();return"rgb("+Math.round(e.r)+", "+Math.round(e.g)+", "+Math.round(e.b)+")"},a.rgb=function(t){return a.tinyRGB(n(t))},a.opacity=function(t){return t?n(t).getAlpha():0},a.addOpacity=function(t,e){var r=n(t).toRgb();return"rgba("+Math.round(r.r)+", "+Math.round(r.g)+", "+Math.round(r.b)+", "+e+")"},a.combine=function(t,e){var r=n(t).toRgb();if(1===r.a)return n(t).toRgbString();var i=n(e||c).toRgb(),o=1===i.a?i:{r:255*(1-i.a)+i.r*i.a,g:255*(1-i.a)+i.g*i.a,b:255*(1-i.a)+i.b*i.a},a={r:o.r*(1-r.a)+r.r*r.a,g:o.g*(1-r.a)+r.g*r.a,b:o.b*(1-r.a)+r.b*r.a};return n(a).toRgbString()},a.interpolate=function(t,e,r){var i=n(t).toRgb(),o=n(e).toRgb(),a={r:r*i.r+(1-r)*o.r,g:r*i.g+(1-r)*o.g,b:r*i.b+(1-r)*o.b};return n(a).toRgbString()},a.contrast=function(t,e,r){var i=n(t);return 1!==i.getAlpha()&&(i=n(a.combine(t,c))),(i.isDark()?e?i.lighten(e):c:r?i.darken(r):l).toString()},a.stroke=function(t,e){var r=n(e);t.style({stroke:a.tinyRGB(r),"stroke-opacity":r.getAlpha()})},a.fill=function(t,e){var r=n(e);t.style({fill:a.tinyRGB(r),"fill-opacity":r.getAlpha()})},a.clean=function(t){if(t&&"object"==typeof t){var e,r,n,i,s=Object.keys(t);for(e=0;e{"use strict";var n=r(86130),i=r(75058),o=r(98260).extendFlat,a=r(62309).overrideAll;t.exports=a({orientation:{valType:"enumerated",values:["h","v"],dflt:"v",description:"Sets the orientation of the colorbar."},thicknessmode:{valType:"enumerated",values:["fraction","pixels"],dflt:"pixels",description:["Determines whether this color bar's thickness","(i.e. the measure in the constant color direction)","is set in units of plot *fraction* or in *pixels*.","Use `thickness` to set the value."].join(" ")},thickness:{valType:"number",min:0,dflt:30,description:["Sets the thickness of the color bar","This measure excludes the size of the padding, ticks and labels."].join(" ")},lenmode:{valType:"enumerated",values:["fraction","pixels"],dflt:"fraction",description:["Determines whether this color bar's length","(i.e. the measure in the color variation direction)","is set in units of plot *fraction* or in *pixels.","Use `len` to set the value."].join(" ")},len:{valType:"number",min:0,dflt:1,description:["Sets the length of the color bar","This measure excludes the padding of both ends.","That is, the color bar length is this length minus the","padding on both ends."].join(" ")},x:{valType:"number",description:["Sets the x position with respect to `xref` of the color bar (in plot fraction).","When `xref` is *paper*, defaults to 1.02 when `orientation` is *v* and","0.5 when `orientation` is *h*.","When `xref` is *container*, defaults to *1* when `orientation` is *v* and","0.5 when `orientation` is *h*.","Must be between *0* and *1* if `xref` is *container*","and between *-2* and *3* if `xref` is *paper*."].join(" ")},xref:{valType:"enumerated",dflt:"paper",values:["container","paper"],editType:"layoutstyle",description:["Sets the container `x` refers to.","*container* spans the entire `width` of the plot.","*paper* refers to the width of the plotting area only."].join(" ")},xanchor:{valType:"enumerated",values:["left","center","right"],description:["Sets this color bar's horizontal position anchor.","This anchor binds the `x` position to the *left*, *center*","or *right* of the color bar.","Defaults to *left* when `orientation` is *v* and","*center* when `orientation` is *h*."].join(" ")},xpad:{valType:"number",min:0,dflt:10,description:"Sets the amount of padding (in px) along the x direction."},y:{valType:"number",description:["Sets the y position with respect to `yref` of the color bar (in plot fraction).","When `yref` is *paper*, defaults to 0.5 when `orientation` is *v* and","1.02 when `orientation` is *h*.","When `yref` is *container*, defaults to 0.5 when `orientation` is *v* and","1 when `orientation` is *h*.","Must be between *0* and *1* if `yref` is *container*","and between *-2* and *3* if `yref` is *paper*."].join(" ")},yref:{valType:"enumerated",dflt:"paper",values:["container","paper"],editType:"layoutstyle",description:["Sets the container `y` refers to.","*container* spans the entire `height` of the plot.","*paper* refers to the height of the plotting area only."].join(" ")},yanchor:{valType:"enumerated",values:["top","middle","bottom"],description:["Sets this color bar's vertical position anchor","This anchor binds the `y` position to the *top*, *middle*","or *bottom* of the color bar.","Defaults to *middle* when `orientation` is *v* and","*bottom* when `orientation` is *h*."].join(" ")},ypad:{valType:"number",min:0,dflt:10,description:"Sets the amount of padding (in px) along the y direction."},outlinecolor:n.linecolor,outlinewidth:n.linewidth,bordercolor:n.linecolor,borderwidth:{valType:"number",min:0,dflt:0,description:["Sets the width (in px) or the border enclosing this color bar."].join(" ")},bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)",description:"Sets the color of padded area."},tickmode:n.minor.tickmode,nticks:n.nticks,tick0:n.tick0,dtick:n.dtick,tickvals:n.tickvals,ticktext:n.ticktext,ticks:o({},n.ticks,{dflt:""}),ticklabeloverflow:o({},n.ticklabeloverflow,{description:["Determines how we handle tick labels that would overflow either the graph div or the domain of the axis.","The default value for inside tick labels is *hide past domain*.","In other cases the default is *hide past div*."].join(" ")}),ticklabelposition:{valType:"enumerated",values:["outside","inside","outside top","inside top","outside left","inside left","outside right","inside right","outside bottom","inside bottom"],dflt:"outside",description:["Determines where tick labels are drawn relative to the ticks.","Left and right options are used when `orientation` is *h*,","top and bottom when `orientation` is *v*."].join(" ")},ticklen:n.ticklen,tickwidth:n.tickwidth,tickcolor:n.tickcolor,ticklabelstep:n.ticklabelstep,showticklabels:n.showticklabels,labelalias:n.labelalias,tickfont:i({description:"Sets the color bar's tick label font"}),tickangle:n.tickangle,tickformat:n.tickformat,tickformatstops:n.tickformatstops,tickprefix:n.tickprefix,showtickprefix:n.showtickprefix,ticksuffix:n.ticksuffix,showticksuffix:n.showticksuffix,separatethousands:n.separatethousands,exponentformat:n.exponentformat,minexponent:n.minexponent,showexponent:n.showexponent,title:{text:{valType:"string",description:["Sets the title of the color bar.","Note that before the existence of `title.text`, the title's","contents used to be defined as the `title` attribute itself.","This behavior has been deprecated."].join(" ")},font:i({description:["Sets this color bar's title font.","Note that the title's font used to be set","by the now deprecated `titlefont` attribute."].join(" ")}),side:{valType:"enumerated",values:["right","top","bottom"],description:["Determines the location of color bar's title","with respect to the color bar.","Defaults to *top* when `orientation` if *v* and ","defaults to *right* when `orientation` if *h*.","Note that the title's location used to be set","by the now deprecated `titleside` attribute."].join(" ")}},_deprecated:{title:{valType:"string",description:["Deprecated in favor of color bar's `title.text`.","Note that value of color bar's `title` is no longer a simple","*string* but a set of sub-attributes."].join(" ")},titlefont:i({description:"Deprecated in favor of color bar's `title.font`."}),titleside:{valType:"enumerated",values:["right","top","bottom"],dflt:"top",description:"Deprecated in favor of color bar's `title.side`."}}},"colorbars","from-root")},30733:t=>{"use strict";t.exports={cn:{colorbar:"colorbar",cbbg:"cbbg",cbfill:"cbfill",cbfills:"cbfills",cbline:"cbline",cblines:"cblines",cbaxis:"cbaxis",cbtitleunshift:"cbtitleunshift",cbtitle:"cbtitle",cboutline:"cboutline",crisp:"crisp",jsPlaceholder:"js-placeholder"}}},81692:(t,e,r)=>{"use strict";var n=r(12822),i=r(46121),o=r(49342),a=r(8736),s=r(84411),l=r(12213),c=r(76699);t.exports=function(t,e,r){var u=i.newContainer(e,"colorbar"),h=t.colorbar||{};function d(t,e){return n.coerce(h,u,c,t,e)}var f=r.margin||{t:0,b:0,l:0,r:0},p=r.width-f.l-f.r,m=r.height-f.t-f.b,g="v"===d("orientation"),v=d("thicknessmode");d("thickness","fraction"===v?30/(g?p:m):30);var b=d("lenmode");d("len","fraction"===b?1:g?m:p);var y,x,_,w="paper"===d("yref"),k="paper"===d("xref"),A="left";g?(_="middle",A=k?"left":"right",y=k?1.02:1,x=.5):(_=w?"bottom":"top",A="center",y=.5,x=w?1.02:1),n.coerce(h,u,{x:{valType:"number",min:k?-2:0,max:k?3:1,dflt:y}},"x"),n.coerce(h,u,{y:{valType:"number",min:w?-2:0,max:w?3:1,dflt:x}},"y"),d("xanchor",A),d("xpad"),d("yanchor",_),d("ypad"),n.noneOrAll(h,u,["x","y"]),d("outlinecolor"),d("outlinewidth"),d("bordercolor"),d("borderwidth"),d("bgcolor");var M=n.coerce(h,u,{ticklabelposition:{valType:"enumerated",dflt:"outside",values:g?["outside","inside","outside top","inside top","outside bottom","inside bottom"]:["outside","inside","outside left","inside left","outside right","inside right"]}},"ticklabelposition");d("ticklabeloverflow",-1!==M.indexOf("inside")?"hide past domain":"hide past div"),o(h,u,d,"linear");var T=r.font,S={noAutotickangles:!0,noTicklabelshift:!0,noTicklabelstandoff:!0,outerTicks:!1,font:T};-1!==M.indexOf("inside")&&(S.bgColor="black"),l(h,u,d,"linear",S),s(h,u,d,"linear",S),a(h,u,d,"linear",S),d("title.text",r._dfltTitle.colorbar);var C=u.showticklabels?u.tickfont:T,E=n.extendFlat({},T,{family:C.family,size:n.bigFont(C.size)});n.coerceFont(d,"title.font",E),d("title.side",g?"top":"right")}},29648:(t,e,r)=>{"use strict";var n=r(27941),i=r(18106),o=r(51137),a=r(25059),s=r(75815),l=r(19846),c=r(12822),u=c.strTranslate,h=r(98260).extendFlat,d=r(76292),f=r(40666),p=r(17499),m=r(6883),g=r(80394),v=r(42226).flipScale,b=r(91200),y=r(52869),x=r(86130),_=r(89701),w=_.LINE_SPACING,k=_.FROM_TL,A=_.FROM_BR,M=r(30733).cn;t.exports={draw:function(t){var e=t._fullLayout._infolayer.selectAll("g."+M.colorbar).data(function(t){var e,r,n,i,o=t._fullLayout,a=t.calcdata,s=[];function l(t){return h(t,{_fillcolor:null,_line:{color:null,width:null,dash:null},_levels:{start:null,end:null,size:null},_filllevels:null,_fillgradient:null,_zrange:null})}function c(){"function"==typeof i.calc?i.calc(t,n,e):(e._fillgradient=r.reversescale?v(r.colorscale):r.colorscale,e._zrange=[r[i.min],r[i.max]])}for(var u=0;u0?n>=l:n<=l));i++)n>u&&n0?n>=l:n<=l));i++)n>r[0]&&n1){var ft=Math.pow(10,Math.floor(Math.log(dt)/Math.LN10));ut*=ft*c.roundUp(dt/ft,[2,5,10]),(Math.abs(q.start)/q.size+1e-6)%1<2e-6&&(lt.tick0=0)}lt.dtick=ut}lt.domain=a?[at+O/j.h,at+Q-O/j.h]:[at+z/j.w,at+Q-z/j.w],lt.setScale(),t.attr("transform",u(Math.round(j.l),Math.round(j.t)));var pt,mt=t.select("."+M.cbtitleunshift).attr("transform",u(-Math.round(j.l),-Math.round(j.t))),gt=lt.ticklabelposition,vt=lt.title.font.size,bt=t.select("."+M.cbaxis),yt=0,xt=0;function _t(n,i){var o={propContainer:lt,propName:e._propPrefix+"title",traceIndex:e._traceIndex,_meta:e._meta,placeholder:P._dfltTitle.colorbar,containerGroup:t.select("."+M.cbtitle)},a="h"===n.charAt(0)?n.substr(1):"h"+n;t.selectAll("."+a+",."+a+"-math-group").remove(),m.draw(r,n,h(o,i||{}))}return c.syncOrAsync([o.previousPromises,function(){var t,e;(a&&ct||!a&&!ct)&&("top"===G&&(t=z+j.l+tt*D,e=O+j.t+et*(1-at-Q)+3+.75*vt),"bottom"===G&&(t=z+j.l+tt*D,e=O+j.t+et*(1-at)-3-.25*vt),"right"===G&&(e=O+j.t+et*I+3+.75*vt,t=z+j.l+tt*at),_t(lt._id+"title",{attributes:{x:t,y:e,"text-anchor":a?"start":"middle"}}))},function(){if(!a&&!ct||a&&ct){var o,l=t.select("."+M.cbtitle),h=l.select("text"),d=[-T/2,T/2],p=l.select(".h"+lt._id+"title-math-group").node(),m=15.6;if(h.node()&&(m=parseInt(h.node().style.fontSize,10)*w),p?(o=f.bBox(p),xt=o.width,(yt=o.height)>m&&(d[1]-=(yt-m)/2)):h.node()&&!h.classed(M.jsPlaceholder)&&(o=f.bBox(h.node()),xt=o.width,yt=o.height),a){if(yt){if(yt+=5,"top"===G)lt.domain[1]-=yt/j.h,d[1]*=-1;else{lt.domain[0]+=yt/j.h;var v=g.lineCount(h);d[1]+=(1-v)*m}l.attr("transform",u(d[0],d[1])),lt.setScale()}}else xt&&("right"===G&&(lt.domain[0]+=(xt+vt/2)/j.w),l.attr("transform",u(d[0],d[1])),lt.setScale())}t.selectAll("."+M.cbfills+",."+M.cblines).attr("transform",a?u(0,Math.round(j.h*(1-lt.domain[1]))):u(Math.round(j.w*lt.domain[0]),0)),bt.attr("transform",a?u(0,Math.round(-j.t)):u(Math.round(-j.l),0));var b=t.select("."+M.cbfills).selectAll("rect."+M.cbfill).attr("style","").data(Z);b.enter().append("rect").classed(M.cbfill,!0).attr("style",""),b.exit().remove();var y=V.map(lt.c2p).map(Math.round).sort((function(t,e){return t-e}));b.each((function(t,o){var s=[0===o?V[0]:(Z[o]+Z[o-1])/2,o===Z.length-1?V[1]:(Z[o]+Z[o+1])/2].map(lt.c2p).map(Math.round);a&&(s[1]=c.constrain(s[1]+(s[1]>s[0])?1:-1,y[0],y[1]));var l=n.select(this).attr(a?"x":"y",rt).attr(a?"y":"x",n.min(s)).attr(a?"width":"height",Math.max($,2)).attr(a?"height":"width",Math.max(n.max(s)-n.min(s),2));if(e._fillgradient)f.gradient(l,r,e._id,a?"vertical":"horizontalreversed",e._fillgradient,"fill");else{var u=W(t).replace("e-","");l.attr("fill",i(u).toHexString())}}));var x=t.select("."+M.cblines).selectAll("path."+M.cbline).data(B.color&&B.width?X:[]);x.enter().append("path").classed(M.cbline,!0),x.exit().remove(),x.each((function(t){var e=rt,r=Math.round(lt.c2p(t))+B.width/2%1;n.select(this).attr("d","M"+(a?e+","+r:r+","+e)+(a?"h":"v")+$).call(f.lineGroupStyle,B.width,H(t),B.dash)})),bt.selectAll("g."+lt._id+"tick,path").remove();var _=rt+$+(T||0)/2-("outside"===e.ticks?1:0),k=s.calcTicks(lt),A=s.getTickSigns(lt)[2];return s.drawTicks(r,lt,{vals:"inside"===lt.ticks?s.clipEnds(lt,k):k,layer:bt,path:s.makeTickPath(lt,_,A),transFn:s.makeTransTickFn(lt)}),s.drawLabels(r,lt,{vals:k,layer:bt,transFn:s.makeTransTickLabelFn(lt),labelFns:s.makeLabelFns(lt,_)})},function(){if(a&&!ct||!a&&ct){var t,i,o=lt.position||0,s=lt._offset+lt._length/2;if("right"===G)i=s,t=j.l+tt*o+10+vt*(lt.showticklabels?1:.5);else if(t=s,"bottom"===G&&(i=j.t+et*o+10+(-1===gt.indexOf("inside")?lt.tickfont.size:0)+("intside"!==lt.ticks&&e.ticklen||0)),"top"===G){var l=U.text.split("
").length;i=j.t+et*o+10-$-w*vt*l}_t((a?"h":"v")+lt._id+"title",{avoid:{selection:n.select(r).selectAll("g."+lt._id+"tick"),side:G,offsetTop:a?0:j.t,offsetLeft:a?j.l:0,maxShift:a?P.width:P.height},attributes:{x:t,y:i,"text-anchor":"middle"},transform:{rotate:a?-90:0,offset:0}})}},o.previousPromises,function(){var n,s=$+T/2;-1===gt.indexOf("inside")&&(n=f.bBox(bt.node()),s+=a?n.width:n.height),pt=mt.select("text");var c=0,h=a&&"top"===G,m=!a&&"right"===G,g=0;if(pt.node()&&!pt.classed(M.jsPlaceholder)){var b,y=mt.select(".h"+lt._id+"title-math-group").node();y&&(a&&ct||!a&&!ct)?(c=(n=f.bBox(y)).width,b=n.height):(c=(n=f.bBox(mt.node())).right-j.l-(a?rt:st),b=n.bottom-j.t-(a?st:rt),a||"top"!==G||(s+=n.height,g=n.height)),m&&(pt.attr("transform",u(c/2+vt/2,0)),c*=2),s=Math.max(s,a?c:b)}var x=2*(a?z:O)+s+S+T/2,w=0;!a&&U.text&&"bottom"===L&&I<=0&&(x+=w=x/2,g+=w),P._hColorbarMoveTitle=w,P._hColorbarMoveCBTitle=g;var N=S+T,B=(a?rt:st)-N/2-(a?z:0),V=(a?st:rt)-(a?K:O+g-w);t.select("."+M.cbbg).attr("x",B).attr("y",V).attr(a?"width":"height",Math.max(x-w,2)).attr(a?"height":"width",Math.max(K+N,2)).call(p.fill,C).call(p.stroke,e.bordercolor).style("stroke-width",S);var H=m?Math.max(c-10,0):0;t.selectAll("."+M.cboutline).attr("x",(a?rt:st+z)+H).attr("y",(a?st+O-K:rt)+(h?yt:0)).attr(a?"width":"height",Math.max($,2)).attr(a?"height":"width",Math.max(K-(a?2*O+yt:2*z+H),2)).call(p.stroke,e.outlinecolor).style({fill:"none","stroke-width":T});var W=a?nt*x:0,q=a?0:(1-it)*x-g;if(W=R?j.l-W:-W,q=F?j.t-q:-q,t.attr("transform",u(W,q)),!a&&(S||i(C).getAlpha()&&!i.equals(P.paper_bgcolor,C))){var Y=bt.selectAll("text"),Z=Y[0].length,X=t.select("."+M.cbbg).node(),J=f.bBox(X),Q=f.getTranslate(t);Y.each((function(t,e){var r=Z-1;if(0===e||e===r){var n,i=f.bBox(this),o=f.getTranslate(this);if(e===r){var a=i.right+o.x;(n=J.right+Q.x+st-S-2+D-a)>0&&(n=0)}else if(0===e){var s=i.left+o.x;(n=J.left+Q.x+st+S+2-s)<0&&(n=0)}n&&(Z<3?this.setAttribute("transform","translate("+n+",0) "+this.getAttribute("transform")):this.setAttribute("visibility","hidden"))}}))}var tt={},et=k[E],ot=A[E],at=k[L],ut=A[L],ht=x-$;a?("pixels"===d?(tt.y=I,tt.t=K*at,tt.b=K*ut):(tt.t=tt.b=0,tt.yt=I+l*at,tt.yb=I-l*ut),"pixels"===_?(tt.x=D,tt.l=x*et,tt.r=x*ot):(tt.l=ht*et,tt.r=ht*ot,tt.xl=D-v*et,tt.xr=D+v*ot)):("pixels"===d?(tt.x=D,tt.l=K*et,tt.r=K*ot):(tt.l=tt.r=0,tt.xl=D+l*et,tt.xr=D-l*ot),"pixels"===_?(tt.y=1-I,tt.t=x*at,tt.b=x*ut):(tt.t=ht*at,tt.b=ht*ut,tt.yt=I-v*at,tt.yb=I+v*ut));var dt=e.y<.5?"b":"t",ft=e.x<.5?"l":"r";r._fullLayout._reservedMargin[e._id]={};var xt={r:P.width-B-W,l:B+tt.r,b:P.height-V-q,t:V+tt.b};R&&F?o.autoMargin(r,e._id,tt):R?r._fullLayout._reservedMargin[e._id][dt]=xt[dt]:F||a?r._fullLayout._reservedMargin[e._id][ft]=xt[ft]:r._fullLayout._reservedMargin[e._id][dt]=xt[dt]}],r)}(r,e,t);v&&v.then&&(t._promises||[]).push(v),t._context.edits.colorbarPosition&&function(t,e,r){var n,i,o,s="v"===e.orientation,c=r._fullLayout._size;l.init({element:t.node(),gd:r,prepFn:function(){n=t.attr("transform"),d(t)},moveFn:function(r,a){t.attr("transform",n+u(r,a)),i=l.align((s?e._uFrac:e._vFrac)+r/c.w,s?e._thickFrac:e._lenFrac,0,1,e.xanchor),o=l.align((s?e._vFrac:1-e._uFrac)-a/c.h,s?e._lenFrac:e._thickFrac,0,1,e.yanchor);var h=l.getCursor(i,o,e.xanchor,e.yanchor);d(t,h)},doneFn:function(){if(d(t),void 0!==i&&void 0!==o){var n={};n[e._propPrefix+"x"]=i,n[e._propPrefix+"y"]=o,void 0!==e._traceIndex?a.call("_guiRestyle",r,n,e._traceIndex):a.call("_guiRelayout",r,n)}}})}(r,e,t)})),e.exit().each((function(e){o.autoMargin(t,e._id)})).remove(),e.order()}}},52467:(t,e,r)=>{"use strict";var n=r(12822);t.exports=function(t){return n.isPlainObject(t.colorbar)}},10552:(t,e,r)=>{"use strict";t.exports={moduleType:"component",name:"colorbar",attributes:r(76699),supplyDefaults:r(81692),draw:r(29648).draw,hasColorbar:r(52467)}},89322:(t,e,r)=>{"use strict";var n=r(76699),i=r(46233).counter,o=r(54747),a=r(78920).scales,s=o(a);function l(t){return"`"+t+"`"}t.exports=function(t,e){t=t||"";var r,o,c=(e=e||{}).cLetter||"c",u="onlyIfNumerical"in e?e.onlyIfNumerical:Boolean(t),h="noScale"in e?e.noScale:"marker.line"===t,d="showScaleDflt"in e?e.showScaleDflt:"z"===c,f="string"==typeof e.colorscaleDflt?a[e.colorscaleDflt]:null,p=e.editTypeOverride||"",m=t?t+".":"";"colorAttr"in e?(r=e.colorAttr,o=e.colorAttr):o="in "+l(m+(r={z:"z",c:"color"}[c]));var g=u?" Has an effect only if "+o+" is set to a numerical array.":"",v=c+"auto",b=c+"min",y=c+"max",x=c+"mid",_=l(m+v),w=l(m+b),k=l(m+y),A=w+" and "+k,M={};M[b]=M[y]=void 0;var T={};T[v]=!1;var S={};return"color"===r&&(S.color={valType:"color",arrayOk:!0,editType:p||"style",description:["Sets the",t,"color.","It accepts either a specific color","or an array of numbers that are mapped to the colorscale","relative to the max and min values of the array or relative to",A,"if set."].join(" ")},e.anim&&(S.color.anim=!0)),S[v]={valType:"boolean",dflt:!0,editType:"calc",impliedEdits:M,description:["Determines whether or not the color domain is computed","with respect to the input data (here "+o+") or the bounds set in",A+g,"Defaults to `false` when",A,"are set by the user."].join(" ")},S[b]={valType:"number",dflt:null,editType:p||"plot",impliedEdits:T,description:["Sets the lower bound of the color domain."+g,"Value should have the same units as",o,"and if set,",k,"must be set as well."].join(" ")},S[y]={valType:"number",dflt:null,editType:p||"plot",impliedEdits:T,description:["Sets the upper bound of the color domain."+g,"Value should have the same units as",o,"and if set,",w,"must be set as well."].join(" ")},S[x]={valType:"number",dflt:null,editType:"calc",impliedEdits:M,description:["Sets the mid-point of the color domain by scaling",w,"and/or",k,"to be equidistant to this point."+g,"Value should have the same units as",o+".","Has no effect when",_,"is `false`."].join(" ")},S.colorscale={valType:"colorscale",editType:"calc",dflt:f,impliedEdits:{autocolorscale:!1},description:["Sets the colorscale."+g,"The colorscale must be an array containing","arrays mapping a normalized value to an","rgb, rgba, hex, hsl, hsv, or named color string.","At minimum, a mapping for the lowest (0) and highest (1)","values are required. For example,","`[[0, 'rgb(0,0,255)'], [1, 'rgb(255,0,0)']]`.","To control the bounds of the colorscale in color space,","use",A+".","Alternatively, `colorscale` may be a palette name string","of the following list: "+s+"."].join(" ")},S.autocolorscale={valType:"boolean",dflt:!1!==e.autoColorDflt,editType:"calc",impliedEdits:{colorscale:void 0},description:["Determines whether the colorscale is a default palette (`autocolorscale: true`)","or the palette determined by",l(m+"colorscale")+"."+g,"In case `colorscale` is unspecified or `autocolorscale` is true, the default","palette will be chosen according to whether numbers in the `color` array are","all positive, all negative or mixed."].join(" ")},S.reversescale={valType:"boolean",dflt:!1,editType:"plot",description:["Reverses the color mapping if true."+g,"If true,",w,"will correspond to the last color","in the array and",k,"will correspond to the first color."].join(" ")},h||(S.showscale={valType:"boolean",dflt:d,editType:"calc",description:["Determines whether or not a colorbar is displayed for this trace."+g].join(" ")},S.colorbar=n),e.noColorAxis||(S.coloraxis={valType:"subplotid",regex:i("coloraxis"),dflt:null,editType:"calc",description:["Sets a reference to a shared color axis.","References to these shared color axes are *coloraxis*, *coloraxis2*, *coloraxis3*, etc.","Settings for these shared color axes are set in the layout, under","`layout.coloraxis`, `layout.coloraxis2`, etc.","Note that multiple color scales can be linked to the same color axis."].join(" ")}),S}},62182:(t,e,r)=>{"use strict";var n=r(7370),i=r(12822),o=r(42226).extractOpts;t.exports=function(t,e,r){var a,s=t._fullLayout,l=r.vals,c=r.containerStr,u=c?i.nestedProperty(e,c).get():e,h=o(u),d=!1!==h.auto,f=h.min,p=h.max,m=h.mid,g=function(){return i.aggNums(Math.min,null,l)},v=function(){return i.aggNums(Math.max,null,l)};void 0===f?f=g():d&&(f=u._colorAx&&n(f)?Math.min(f,g()):g()),void 0===p?p=v():d&&(p=u._colorAx&&n(p)?Math.max(p,v()):v()),d&&void 0!==m&&(p-m>m-f?f=m-(p-m):p-m=0?s.colorscale.sequential:s.colorscale.sequentialminus,h._sync("colorscale",a))}},51774:(t,e,r)=>{"use strict";var n=r(12822),i=r(42226).hasColorscale,o=r(42226).extractOpts;t.exports=function(t,e){function r(t,e){var r=t["_"+e];void 0!==r&&(t[e]=r)}function a(t,i){var a=i.container?n.nestedProperty(t,i.container).get():t;if(a)if(a.coloraxis)a._colorAx=e[a.coloraxis];else{var s=o(a),l=s.auto;(l||void 0===s.min)&&r(a,i.min),(l||void 0===s.max)&&r(a,i.max),s.autocolorscale&&r(a,"colorscale")}}for(var s=0;s{"use strict";var n=r(7370),i=r(12822),o=r(52467),a=r(81692),s=r(78920).isValid,l=r(25059).traceIs;function c(t,e){var r=e.slice(0,e.length-1);return e?i.nestedProperty(t,r).get()||{}:t}t.exports=function t(e,r,u,h,d){var f=d.prefix,p=d.cLetter,m="_module"in r,g=c(e,f),v=c(r,f),b=c(r._template||{},f)||{},y=function(){return delete e.coloraxis,delete r.coloraxis,t(e,r,u,h,d)};if(m){var x=u._colorAxes||{},_=h(f+"coloraxis");if(_){var w=l(r,"contour")&&i.nestedProperty(r,"contours.coloring").get()||"heatmap",k=x[_];return void(k?(k[2].push(y),k[0]!==w&&(k[0]=!1,i.warn(["Ignoring coloraxis:",_,"setting","as it is linked to incompatible colorscales."].join(" ")))):x[_]=[w,r,[y]])}}var A=g[p+"min"],M=g[p+"max"],T=n(A)&&n(M)&&A{"use strict";var n=r(27941),i=r(18106),o=r(7370),a=r(12822),s=r(17499),l=r(78920).isValid,c=["showscale","autocolorscale","colorscale","reversescale","colorbar"],u=["min","max","mid","auto"];function h(t){var e,r,n,i=t._colorAx,o=i||t,a={};for(r=0;r=0;n--,i++){var o=t[n];r[i]=[1-o[0],o[1]]}return r}function p(t,e){e=e||{};for(var r=t.domain,a=t.range,l=a.length,c=new Array(l),u=0;u{"use strict";var n=r(78920),i=r(42226);t.exports={moduleType:"component",name:"colorscale",attributes:r(89322),layoutAttributes:r(92425),supplyLayoutDefaults:r(28558),handleDefaults:r(94461),crossTraceDefaults:r(51774),calc:r(62182),scales:n.scales,defaultScale:n.defaultScale,getScale:n.get,isValidScale:n.isValid,hasColorscale:i.hasColorscale,extractOpts:i.extractOpts,extractScale:i.extractScale,flipScale:i.flipScale,makeColorScaleFunc:i.makeColorScaleFunc,makeColorScaleFuncFromTrace:i.makeColorScaleFuncFromTrace}},92425:(t,e,r)=>{"use strict";var n=r(98260).extendFlat,i=r(89322),o=r(78920).scales,a="Note that `autocolorscale` must be true for this attribute to work.";t.exports={editType:"calc",colorscale:{editType:"calc",sequential:{valType:"colorscale",dflt:o.Reds,editType:"calc",description:["Sets the default sequential colorscale for positive values.",a].join(" ")},sequentialminus:{valType:"colorscale",dflt:o.Blues,editType:"calc",description:["Sets the default sequential colorscale for negative values.",a].join(" ")},diverging:{valType:"colorscale",dflt:o.RdBu,editType:"calc",description:["Sets the default diverging colorscale.",a].join(" ")}},coloraxis:n({_isSubplotObj:!0,editType:"calc",description:[""].join(" ")},i("",{colorAttr:"corresponding trace color array(s)",noColorAxis:!0,showScaleDflt:!0}))}},28558:(t,e,r)=>{"use strict";var n=r(12822),i=r(46121),o=r(92425),a=r(94461);t.exports=function(t,e){function r(r,i){return n.coerce(t,e,o,r,i)}r("colorscale.sequential"),r("colorscale.sequentialminus"),r("colorscale.diverging");var s,l,c=e._colorAxes;function u(t,e){return n.coerce(s,l,o.coloraxis,t,e)}for(var h in c){var d=c[h];if(d[0])s=t[h]||{},(l=i.newContainer(e,h,"coloraxis"))._name=h,a(s,l,e,u,{prefix:"",cLetter:"c"});else{for(var f=0;f{"use strict";var n=r(18106),i={Greys:[[0,"rgb(0,0,0)"],[1,"rgb(255,255,255)"]],YlGnBu:[[0,"rgb(8,29,88)"],[.125,"rgb(37,52,148)"],[.25,"rgb(34,94,168)"],[.375,"rgb(29,145,192)"],[.5,"rgb(65,182,196)"],[.625,"rgb(127,205,187)"],[.75,"rgb(199,233,180)"],[.875,"rgb(237,248,217)"],[1,"rgb(255,255,217)"]],Greens:[[0,"rgb(0,68,27)"],[.125,"rgb(0,109,44)"],[.25,"rgb(35,139,69)"],[.375,"rgb(65,171,93)"],[.5,"rgb(116,196,118)"],[.625,"rgb(161,217,155)"],[.75,"rgb(199,233,192)"],[.875,"rgb(229,245,224)"],[1,"rgb(247,252,245)"]],YlOrRd:[[0,"rgb(128,0,38)"],[.125,"rgb(189,0,38)"],[.25,"rgb(227,26,28)"],[.375,"rgb(252,78,42)"],[.5,"rgb(253,141,60)"],[.625,"rgb(254,178,76)"],[.75,"rgb(254,217,118)"],[.875,"rgb(255,237,160)"],[1,"rgb(255,255,204)"]],Bluered:[[0,"rgb(0,0,255)"],[1,"rgb(255,0,0)"]],RdBu:[[0,"rgb(5,10,172)"],[.35,"rgb(106,137,247)"],[.5,"rgb(190,190,190)"],[.6,"rgb(220,170,132)"],[.7,"rgb(230,145,90)"],[1,"rgb(178,10,28)"]],Reds:[[0,"rgb(220,220,220)"],[.2,"rgb(245,195,157)"],[.4,"rgb(245,160,105)"],[1,"rgb(178,10,28)"]],Blues:[[0,"rgb(5,10,172)"],[.35,"rgb(40,60,190)"],[.5,"rgb(70,100,245)"],[.6,"rgb(90,120,245)"],[.7,"rgb(106,137,247)"],[1,"rgb(220,220,220)"]],Picnic:[[0,"rgb(0,0,255)"],[.1,"rgb(51,153,255)"],[.2,"rgb(102,204,255)"],[.3,"rgb(153,204,255)"],[.4,"rgb(204,204,255)"],[.5,"rgb(255,255,255)"],[.6,"rgb(255,204,255)"],[.7,"rgb(255,153,255)"],[.8,"rgb(255,102,204)"],[.9,"rgb(255,102,102)"],[1,"rgb(255,0,0)"]],Rainbow:[[0,"rgb(150,0,90)"],[.125,"rgb(0,0,200)"],[.25,"rgb(0,25,255)"],[.375,"rgb(0,152,255)"],[.5,"rgb(44,255,150)"],[.625,"rgb(151,255,0)"],[.75,"rgb(255,234,0)"],[.875,"rgb(255,111,0)"],[1,"rgb(255,0,0)"]],Portland:[[0,"rgb(12,51,131)"],[.25,"rgb(10,136,186)"],[.5,"rgb(242,211,56)"],[.75,"rgb(242,143,56)"],[1,"rgb(217,30,30)"]],Jet:[[0,"rgb(0,0,131)"],[.125,"rgb(0,60,170)"],[.375,"rgb(5,255,255)"],[.625,"rgb(255,255,0)"],[.875,"rgb(250,0,0)"],[1,"rgb(128,0,0)"]],Hot:[[0,"rgb(0,0,0)"],[.3,"rgb(230,0,0)"],[.6,"rgb(255,210,0)"],[1,"rgb(255,255,255)"]],Blackbody:[[0,"rgb(0,0,0)"],[.2,"rgb(230,0,0)"],[.4,"rgb(230,210,0)"],[.7,"rgb(255,255,255)"],[1,"rgb(160,200,255)"]],Earth:[[0,"rgb(0,0,130)"],[.1,"rgb(0,180,180)"],[.2,"rgb(40,210,40)"],[.4,"rgb(230,230,50)"],[.6,"rgb(120,70,20)"],[1,"rgb(255,255,255)"]],Electric:[[0,"rgb(0,0,0)"],[.15,"rgb(30,0,100)"],[.4,"rgb(120,0,100)"],[.6,"rgb(160,90,0)"],[.8,"rgb(230,200,0)"],[1,"rgb(255,250,220)"]],Viridis:[[0,"#440154"],[.06274509803921569,"#48186a"],[.12549019607843137,"#472d7b"],[.18823529411764706,"#424086"],[.25098039215686274,"#3b528b"],[.3137254901960784,"#33638d"],[.3764705882352941,"#2c728e"],[.4392156862745098,"#26828e"],[.5019607843137255,"#21918c"],[.5647058823529412,"#1fa088"],[.6274509803921569,"#28ae80"],[.6901960784313725,"#3fbc73"],[.7529411764705882,"#5ec962"],[.8156862745098039,"#84d44b"],[.8784313725490196,"#addc30"],[.9411764705882353,"#d8e219"],[1,"#fde725"]],Cividis:[[0,"rgb(0,32,76)"],[.058824,"rgb(0,42,102)"],[.117647,"rgb(0,52,110)"],[.176471,"rgb(39,63,108)"],[.235294,"rgb(60,74,107)"],[.294118,"rgb(76,85,107)"],[.352941,"rgb(91,95,109)"],[.411765,"rgb(104,106,112)"],[.470588,"rgb(117,117,117)"],[.529412,"rgb(131,129,120)"],[.588235,"rgb(146,140,120)"],[.647059,"rgb(161,152,118)"],[.705882,"rgb(176,165,114)"],[.764706,"rgb(192,177,109)"],[.823529,"rgb(209,191,102)"],[.882353,"rgb(225,204,92)"],[.941176,"rgb(243,219,79)"],[1,"rgb(255,233,69)"]]},o=i.RdBu;function a(t){var e=0;if(!Array.isArray(t)||t.length<2)return!1;if(!t[0]||!t[t.length-1])return!1;if(0!=+t[0][0]||1!=+t[t.length-1][0])return!1;for(var r=0;r{"use strict";t.exports=function(t,e,r,n,i){var o=(t-r)/(n-r),a=o+e/(n-r),s=(o+a)/2;return"left"===i||"bottom"===i?o:"center"===i||"middle"===i?s:"right"===i||"top"===i?a:o<2/3-s?o:a>4/3-s?a:s}},29182:(t,e,r)=>{"use strict";var n=r(12822),i=[["sw-resize","s-resize","se-resize"],["w-resize","move","e-resize"],["nw-resize","n-resize","ne-resize"]];t.exports=function(t,e,r,o){return t="left"===r?0:"center"===r?1:"right"===r?2:n.constrain(Math.floor(3*t),0,2),e="bottom"===o?0:"middle"===o?1:"top"===o?2:n.constrain(Math.floor(3*e),0,2),i[e][t]}},14295:(t,e)=>{"use strict";e.selectMode=function(t){return"lasso"===t||"select"===t},e.drawMode=function(t){return"drawclosedpath"===t||"drawopenpath"===t||"drawline"===t||"drawrect"===t||"drawcircle"===t},e.openMode=function(t){return"drawline"===t||"drawopenpath"===t},e.rectMode=function(t){return"select"===t||"drawline"===t||"drawrect"===t||"drawcircle"===t},e.freeMode=function(t){return"lasso"===t||"drawclosedpath"===t||"drawopenpath"===t},e.selectingOrDrawing=function(t){return e.freeMode(t)||e.rectMode(t)}},19846:(t,e,r)=>{"use strict";var n=r(10024),i=r(56885),o=r(17520),a=r(12822).removeElement,s=r(21197),l=t.exports={};l.align=r(45035),l.getCursor=r(29182);var c=r(99573);function u(){var t=document.createElement("div");t.className="dragcover";var e=t.style;return e.position="fixed",e.left=0,e.right=0,e.top=0,e.bottom=0,e.zIndex=999999999,e.background="none",document.body.appendChild(t),t}function h(t){return n(t.changedTouches?t.changedTouches[0]:t,document.body)}l.unhover=c.wrapped,l.unhoverRaw=c.raw,l.init=function(t){var e,r,n,c,d,f,p,m,g=t.gd,v=1,b=g._context.doubleClickDelay,y=t.element;g._mouseDownTime||(g._mouseDownTime=0),y.style.pointerEvents="all",y.onmousedown=_,o?(y._ontouchstart&&y.removeEventListener("touchstart",y._ontouchstart),y._ontouchstart=_,y.addEventListener("touchstart",_,{passive:!1})):y.ontouchstart=_;var x=t.clampFn||function(t,e,r){return Math.abs(t)b&&(v=Math.max(v-1,1)),g._dragged)t.doneFn&&t.doneFn();else if(t.clickFn&&t.clickFn(v,f),!m){var r;try{r=new MouseEvent("click",e)}catch(t){var n=h(e);(r=document.createEvent("MouseEvents")).initMouseEvent("click",e.bubbles,e.cancelable,e.view,e.detail,e.screenX,e.screenY,n[0],n[1],e.ctrlKey,e.altKey,e.shiftKey,e.metaKey,e.button,e.relatedTarget)}p.dispatchEvent(r)}g._dragging=!1,g._dragged=!1}else g._dragged=!1}},l.coverSlip=u},99573:(t,e,r)=>{"use strict";var n=r(16677),i=r(76324),o=r(16822).getGraphDiv,a=r(99259),s=t.exports={};s.wrapped=function(t,e,r){(t=o(t))._fullLayout&&i.clear(t._fullLayout._uid+a.HOVERID),s.raw(t,e,r)},s.raw=function(t,e){var r=t._fullLayout,i=t._hoverdata;e||(e={}),e.target&&!t._dragged&&!1===n.triggerHandler(t,"plotly_beforehover",e)||(r._hoverlayer.selectAll("g").remove(),r._hoverlayer.selectAll("line").remove(),r._hoverlayer.selectAll("circle").remove(),t._hoverdata=void 0,e.target&&i&&t.emit("plotly_unhover",{event:e,points:i}))}},68057:(t,e)=>{"use strict";e.T={valType:"string",values:["solid","dot","dash","longdash","dashdot","longdashdot"],dflt:"solid",editType:"style",description:["Sets the dash style of lines. Set to a dash type string","(*solid*, *dot*, *dash*, *longdash*, *dashdot*, or *longdashdot*)","or a dash length list in px (eg *5px,10px,2px,2px*)."].join(" ")},e.k={shape:{valType:"enumerated",values:["","/","\\","x","-","|","+","."],dflt:"",arrayOk:!0,editType:"style",description:["Sets the shape of the pattern fill.","By default, no pattern is used for filling the area."].join(" ")},fillmode:{valType:"enumerated",values:["replace","overlay"],dflt:"replace",editType:"style",description:["Determines whether `marker.color` should be used","as a default to `bgcolor` or a `fgcolor`."].join(" ")},bgcolor:{valType:"color",arrayOk:!0,editType:"style",description:["When there is no colorscale sets the color of background pattern fill.","Defaults to a `marker.color` background when `fillmode` is *overlay*.","Otherwise, defaults to a transparent background."].join(" ")},fgcolor:{valType:"color",arrayOk:!0,editType:"style",description:["When there is no colorscale sets the color of foreground pattern fill.","Defaults to a `marker.color` background when `fillmode` is *replace*.","Otherwise, defaults to dark grey or white","to increase contrast with the `bgcolor`."].join(" ")},fgopacity:{valType:"number",editType:"style",min:0,max:1,description:["Sets the opacity of the foreground pattern fill.","Defaults to a 0.5 when `fillmode` is *overlay*.","Otherwise, defaults to 1."].join(" ")},size:{valType:"number",min:0,dflt:8,arrayOk:!0,editType:"style",description:["Sets the size of unit squares of the pattern fill in pixels,","which corresponds to the interval of repetition of the pattern."].join(" ")},solidity:{valType:"number",min:0,max:1,dflt:.3,arrayOk:!0,editType:"style",description:["Sets the solidity of the pattern fill.","Solidity is roughly the fraction of the area filled by the pattern.","Solidity of 0 shows only the background color without pattern","and solidty of 1 shows only the foreground color without pattern."].join(" ")},editType:"style",description:["Sets the pattern within the marker."].join(" ")}},40666:(t,e,r)=>{"use strict";var n=r(27941),i=r(12822),o=i.numberFormat,a=r(7370),s=r(18106),l=r(25059),c=r(17499),u=r(80755),h=i.strTranslate,d=r(80394),f=r(25853),p=r(89701).LINE_SPACING,m=r(11891).DESELECTDIM,g=r(677),v=r(43710),b=r(66811).appendArrayPointValue,y=t.exports={};function x(t){return"none"===t?void 0:t}y.font=function(t,e){var r=e.variant,n=e.style,i=e.weight,o=e.color,a=e.size,s=e.family,l=e.shadow,u=e.lineposition,h=e.textcase;s&&t.style("font-family",s),a+1&&t.style("font-size",a+"px"),o&&t.call(c.fill,o),i&&t.style("font-weight",i),n&&t.style("font-style",n),r&&t.style("font-variant",r),h&&t.style("text-transform",x(function(t){return _[t]}(h))),l&&t.style("text-shadow","auto"===l?d.makeTextShadow(c.contrast(o)):x(l)),u&&t.style("text-decoration-line",x(function(t){return t.replace("under","underline").replace("over","overline").replace("through","line-through").split("+").join(" ")}(u)))};var _={normal:"none",lower:"lowercase",upper:"uppercase","word caps":"capitalize"};function w(t,e,r,n){var i=e.fillpattern,o=e.fillgradient,a=i&&y.getPatternAttr(i.shape,0,"");if(a){var s=y.getPatternAttr(i.bgcolor,0,null),l=y.getPatternAttr(i.fgcolor,0,null),u=i.fgopacity,h=y.getPatternAttr(i.size,0,8),d=y.getPatternAttr(i.solidity,0,.3),f=e.uid;y.pattern(t,"point",r,f,a,h,d,void 0,i.fillmode,s,l,u)}else if(o&&"none"!==o.type){var p,m,g=o.type,v="scatterfill-"+e.uid;n&&(v="legendfill-"+e.uid),n||void 0===o.start&&void 0===o.stop?("horizontal"===g&&(g+="reversed"),t.call(y.gradient,r,v,g,o.colorscale,"fill")):("horizontal"===g?(p={x:o.start,y:0},m={x:o.stop,y:0}):"vertical"===g&&(p={x:0,y:o.start},m={x:0,y:o.stop}),p.x=e._xA.c2p(void 0===p.x?e._extremes.x.min[0].val:p.x,!0),p.y=e._yA.c2p(void 0===p.y?e._extremes.y.min[0].val:p.y,!0),m.x=e._xA.c2p(void 0===m.x?e._extremes.x.max[0].val:m.x,!0),m.y=e._yA.c2p(void 0===m.y?e._extremes.y.max[0].val:m.y,!0),t.call(C,r,v,"linear",o.colorscale,"fill",p,m,!0,!1))}else e.fillcolor&&t.call(c.fill,e.fillcolor)}y.setPosition=function(t,e,r){t.attr("x",e).attr("y",r)},y.setSize=function(t,e,r){t.attr("width",e).attr("height",r)},y.setRect=function(t,e,r,n,i){t.call(y.setPosition,e,r).call(y.setSize,n,i)},y.translatePoint=function(t,e,r,n){var i=r.c2p(t.x),o=n.c2p(t.y);return!!(a(i)&&a(o)&&e.node())&&("text"===e.node().nodeName?e.attr("x",i).attr("y",o):e.attr("transform",h(i,o)),!0)},y.translatePoints=function(t,e,r){t.each((function(t){var i=n.select(this);y.translatePoint(t,i,e,r)}))},y.hideOutsideRangePoint=function(t,e,r,n,i,o){e.attr("display",r.isPtWithinRange(t,i)&&n.isPtWithinRange(t,o)?null:"none")},y.hideOutsideRangePoints=function(t,e){if(e._hasClipOnAxisFalse){var r=e.xaxis,i=e.yaxis;t.each((function(e){var o=e[0].trace,a=o.xcalendar,s=o.ycalendar,c=l.traceIs(o,"bar-like")?".bartext":".point,.textpoint";t.selectAll(c).each((function(t){y.hideOutsideRangePoint(t,n.select(this),r,i,a,s)}))}))}},y.crispRound=function(t,e,r){return e&&a(e)?t._context.staticPlot?e:e<1?1:Math.round(e):r||0},y.singleLineStyle=function(t,e,r,n,i){e.style("fill","none");var o=(((t||[])[0]||{}).trace||{}).line||{},a=r||o.width||0,s=i||o.dash||"";c.stroke(e,n||o.color),y.dashLine(e,s,a)},y.lineGroupStyle=function(t,e,r,i){t.style("fill","none").each((function(t){var o=(((t||[])[0]||{}).trace||{}).line||{},a=e||o.width||0,s=i||o.dash||"";n.select(this).call(c.stroke,r||o.color).call(y.dashLine,s,a)}))},y.dashLine=function(t,e,r){r=+r||0,e=y.dashStyle(e,r),t.style({"stroke-dasharray":e,"stroke-width":r+"px"})},y.dashStyle=function(t,e){e=+e||1;var r=Math.max(e,3);return"solid"===t?t="":"dot"===t?t=r+"px,"+r+"px":"dash"===t?t=3*r+"px,"+3*r+"px":"longdash"===t?t=5*r+"px,"+5*r+"px":"dashdot"===t?t=3*r+"px,"+r+"px,"+r+"px,"+r+"px":"longdashdot"===t&&(t=5*r+"px,"+2*r+"px,"+r+"px,"+2*r+"px"),t},y.singleFillStyle=function(t,e){var r=n.select(t.node());w(t,((r.data()[0]||[])[0]||{}).trace||{},e,!1)},y.fillGroupStyle=function(t,e,r){t.style("stroke-width",0).each((function(t){var i=n.select(this);t[0].trace&&w(i,t[0].trace,e,r)}))};var k=r(68735);y.symbolNames=[],y.symbolFuncs=[],y.symbolBackOffs=[],y.symbolNeedLines={},y.symbolNoDot={},y.symbolNoFill={},y.symbolList=[],Object.keys(k).forEach((function(t){var e=k[t],r=e.n;y.symbolList.push(r,String(r),t,r+100,String(r+100),t+"-open"),y.symbolNames[r]=t,y.symbolFuncs[r]=e.f,y.symbolBackOffs[r]=e.backoff||0,e.needLine&&(y.symbolNeedLines[r]=!0),e.noDot?y.symbolNoDot[r]=!0:y.symbolList.push(r+200,String(r+200),t+"-dot",r+300,String(r+300),t+"-open-dot"),e.noFill&&(y.symbolNoFill[r]=!0)}));var A=y.symbolNames.length;function M(t,e,r,n){var i=t%100;return y.symbolFuncs[i](e,r,n)+(t>=200?"M0,0.5L0.5,0L0,-0.5L-0.5,0Z":"")}y.symbolNumber=function(t){if(a(t))t=+t;else if("string"==typeof t){var e=0;t.indexOf("-open")>0&&(e=100,t=t.replace("-open","")),t.indexOf("-dot")>0&&(e+=200,t=t.replace("-dot","")),(t=y.symbolNames.indexOf(t))>=0&&(t+=e)}return t%100>=A||t>=400?0:Math.floor(Math.max(t,0))};var T=o("~f"),S={radial:{type:"radial"},radialreversed:{type:"radial",reversed:!0},horizontal:{type:"linear",start:{x:1,y:0},stop:{x:0,y:0}},horizontalreversed:{type:"linear",start:{x:1,y:0},stop:{x:0,y:0},reversed:!0},vertical:{type:"linear",start:{x:0,y:1},stop:{x:0,y:0}},verticalreversed:{type:"linear",start:{x:0,y:1},stop:{x:0,y:0},reversed:!0}};function C(t,e,r,o,a,l,u,h,d,f){var p,m=a.length;"linear"===o?p={node:"linearGradient",attrs:{x1:u.x,y1:u.y,x2:h.x,y2:h.y,gradientUnits:d?"userSpaceOnUse":"objectBoundingBox"},reversed:f}:"radial"===o&&(p={node:"radialGradient",reversed:f});for(var g=new Array(m),v=0;v=0&&void 0===t.i&&(t.i=a.i),e.style("opacity",n.selectedOpacityFn?n.selectedOpacityFn(t):void 0===t.mo?s.opacity:t.mo),n.ms2mrc){var u;u="various"===t.ms||"various"===s.size?3:n.ms2mrc(t.ms),t.mrc=u,n.selectedSizeFn&&(u=t.mrc=n.selectedSizeFn(t));var h=y.symbolNumber(t.mx||s.symbol)||0;t.om=h%200>=100;var d=nt(t,r),f=q(t,r);e.attr("d",M(h,u,d,f))}var p,m,g,v=!1;if(t.so)g=l.outlierwidth,m=l.outliercolor,p=s.outliercolor;else{var b=(l||{}).width;g=(t.mlw+1||b+1||(t.trace?(t.trace.marker.line||{}).width:0)+1)-1||0,m="mlc"in t?t.mlcc=n.lineScale(t.mlc):i.isArrayOrTypedArray(l.color)?c.defaultLine:l.color,i.isArrayOrTypedArray(s.color)&&(p=c.defaultLine,v=!0),p="mc"in t?t.mcc=n.markerScale(t.mc):s.color||s.colors||"rgba(0,0,0,0)",n.selectedColorFn&&(p=n.selectedColorFn(t))}if(t.om)e.call(c.stroke,p).style({"stroke-width":(g||1)+"px",fill:"none"});else{e.style("stroke-width",(t.isBlank?0:g)+"px");var x=s.gradient,_=t.mgt;_?v=!0:_=x&&x.type,i.isArrayOrTypedArray(_)&&(_=_[0],S[_]||(_=0));var w=s.pattern,k=w&&y.getPatternAttr(w.shape,t.i,"");if(_&&"none"!==_){var A=t.mgc;A?v=!0:A=x.color;var T=r.uid;v&&(T+="-"+t.i),y.gradient(e,o,T,_,[[0,A],[1,p]],"fill")}else if(k){var C=!1,E=w.fgcolor;!E&&a&&a.color&&(E=a.color,C=!0);var L=y.getPatternAttr(E,t.i,a&&a.color||null),z=y.getPatternAttr(w.bgcolor,t.i,null),O=w.fgopacity,D=y.getPatternAttr(w.size,t.i,8),I=y.getPatternAttr(w.solidity,t.i,.3);C=C||t.mcc||i.isArrayOrTypedArray(w.shape)||i.isArrayOrTypedArray(w.bgcolor)||i.isArrayOrTypedArray(w.fgcolor)||i.isArrayOrTypedArray(w.size)||i.isArrayOrTypedArray(w.solidity);var F=r.uid;C&&(F+="-"+t.i),y.pattern(e,"point",o,F,k,D,I,t.mcc,w.fillmode,z,L,O)}else i.isArrayOrTypedArray(p)?c.fill(e,p[t.i]):c.fill(e,p);g&&c.stroke(e,m)}},y.makePointStyleFns=function(t){var e={},r=t.marker;return e.markerScale=y.tryColorscale(r,""),e.lineScale=y.tryColorscale(r,"line"),l.traceIs(t,"symbols")&&(e.ms2mrc=g.isBubble(t)?v(t):function(){return(r.size||6)/2}),t.selectedpoints&&i.extendFlat(e,y.makeSelectedPointStyleFns(t)),e},y.makeSelectedPointStyleFns=function(t){var e={},r=t.selected||{},n=t.unselected||{},o=t.marker||{},a=r.marker||{},s=n.marker||{},c=o.opacity,u=a.opacity,h=s.opacity,d=void 0!==u,f=void 0!==h;(i.isArrayOrTypedArray(c)||d||f)&&(e.selectedOpacityFn=function(t){var e=void 0===t.mo?o.opacity:t.mo;return t.selected?d?u:e:f?h:m*e});var p=o.color,g=a.color,v=s.color;(g||v)&&(e.selectedColorFn=function(t){var e=t.mcc||p;return t.selected?g||e:v||e});var b=o.size,y=a.size,x=s.size,_=void 0!==y,w=void 0!==x;return l.traceIs(t,"symbols")&&(_||w)&&(e.selectedSizeFn=function(t){var e=t.mrc||b/2;return t.selected?_?y/2:e:w?x/2:e}),e},y.makeSelectedTextStyleFns=function(t){var e={},r=t.selected||{},n=t.unselected||{},i=t.textfont||{},o=r.textfont||{},a=n.textfont||{},s=i.color,l=o.color,u=a.color;return e.selectedTextColorFn=function(t){var e=t.tc||s;return t.selected?l||e:u||(l?e:c.addOpacity(e,m))},e},y.selectedPointStyle=function(t,e){if(t.size()&&e.selectedpoints){var r=y.makeSelectedPointStyleFns(e),i=e.marker||{},o=[];r.selectedOpacityFn&&o.push((function(t,e){t.style("opacity",r.selectedOpacityFn(e))})),r.selectedColorFn&&o.push((function(t,e){c.fill(t,r.selectedColorFn(e))})),r.selectedSizeFn&&o.push((function(t,n){var o=n.mx||i.symbol||0,a=r.selectedSizeFn(n);t.attr("d",M(y.symbolNumber(o),a,nt(n,e),q(n,e))),n.mrc2=a})),o.length&&t.each((function(t){for(var e=n.select(this),r=0;r0?r:0}function I(t,e,r){return r&&(t=B(t)),e?R(t[1]):F(t[0])}function F(t){var e=n.round(t,2);return E=e,e}function R(t){var e=n.round(t,2);return L=e,e}function P(t,e,r,n){var i=t[0]-e[0],o=t[1]-e[1],a=r[0]-e[0],s=r[1]-e[1],l=Math.pow(i*i+o*o,.25),c=Math.pow(a*a+s*s,.25),u=(c*c*i-l*l*a)*n,h=(c*c*o-l*l*s)*n,d=3*c*(l+c),f=3*l*(l+c);return[[F(e[0]+(d&&u/d)),R(e[1]+(d&&h/d))],[F(e[0]-(f&&u/f)),R(e[1]-(f&&h/f))]]}y.textPointStyle=function(t,e,r){if(t.size()){var o;if(e.selectedpoints){var a=y.makeSelectedTextStyleFns(e);o=a.selectedTextColorFn}var s=e.texttemplate,l=r._fullLayout;t.each((function(t){var a=n.select(this),c=s?i.extractOption(t,e,"txt","texttemplate"):i.extractOption(t,e,"tx","text");if(c||0===c){if(s){var u=e._module.formatLabels,h=u?u(t,e,l):{},f={};b(f,e,t.i);var p=e._meta||{};c=i.texttemplateString(c,h,l._d3locale,f,t,p)}var m=t.tp||e.textposition,g=D(t,e),v=o?o(t):t.tc||e.textfont.color;a.call(y.font,{family:t.tf||e.textfont.family,weight:t.tw||e.textfont.weight,style:t.ty||e.textfont.style,variant:t.tv||e.textfont.variant,textcase:t.tC||e.textfont.textcase,lineposition:t.tE||e.textfont.lineposition,shadow:t.tS||e.textfont.shadow,size:g,color:v}).text(c).call(d.convertToTspans,r).call(O,m,g,t.mrc)}else a.remove()}))}},y.selectedTextStyle=function(t,e){if(t.size()&&e.selectedpoints){var r=y.makeSelectedTextStyleFns(e);t.each((function(t){var i=n.select(this),o=r.selectedTextColorFn(t),a=t.tp||e.textposition,s=D(t,e);c.fill(i,o);var u=l.traceIs(e,"bar-like");O(i,a,s,t.mrc2||t.mrc,u)}))}},y.smoothopen=function(t,e){if(t.length<3)return"M"+t.join("L");var r,n="M"+t[0],i=[];for(r=1;r=c||w>=h&&w<=c)&&(k<=d&&k>=u||k>=d&&k<=u)&&(t=[w,k])}return t}y.steps=function(t){var e=j[t]||N;return function(t){for(var r="M"+F(t[0][0])+","+R(t[0][1]),n=t.length,i=1;i=1e4&&(y.savedBBoxes={},U=0),r&&(y.savedBBoxes[r]=g),U++,i.extendFlat({},g)},y.setClipUrl=function(t,e,r){t.attr("clip-path",V(e,r))},y.getTranslate=function(t){var e=(t[t.attr?"attr":"getAttribute"]("transform")||"").replace(/.*\btranslate\((-?\d*\.?\d*)[^-\d]*(-?\d*\.?\d*)[^\d].*/,(function(t,e,r){return[e,r].join(" ")})).split(" ");return{x:+e[0]||0,y:+e[1]||0}},y.setTranslate=function(t,e,r){var n=t.attr?"attr":"getAttribute",i=t.attr?"attr":"setAttribute",o=t[n]("transform")||"";return e=e||0,r=r||0,o=o.replace(/(\btranslate\(.*?\);?)/,"").trim(),o=(o+=h(e,r)).trim(),t[i]("transform",o),o},y.getScale=function(t){var e=(t[t.attr?"attr":"getAttribute"]("transform")||"").replace(/.*\bscale\((\d*\.?\d*)[^\d]*(\d*\.?\d*)[^\d].*/,(function(t,e,r){return[e,r].join(" ")})).split(" ");return{x:+e[0]||1,y:+e[1]||1}},y.setScale=function(t,e,r){var n=t.attr?"attr":"getAttribute",i=t.attr?"attr":"setAttribute",o=t[n]("transform")||"";return e=e||1,r=r||1,o=o.replace(/(\bscale\(.*?\);?)/,"").trim(),o=(o+="scale("+e+","+r+")").trim(),t[i]("transform",o),o};var H=/\s*sc.*/;y.setPointGroupScale=function(t,e,r){if(e=e||1,r=r||1,t){var n=1===e&&1===r?"":"scale("+e+","+r+")";t.each((function(){var t=(this.getAttribute("transform")||"").replace(H,"");t=(t+=n).trim(),this.setAttribute("transform",t)}))}};var W=/translate\([^)]*\)\s*$/;function q(t,e){var r;return t&&(r=t.mf),void 0===r&&(r=e.marker&&e.marker.standoff||0),e._geo||e._xA?r:-r}y.setTextPointsScale=function(t,e,r){t&&t.each((function(){var t,i=n.select(this),o=i.select("text");if(o.node()){var a=parseFloat(o.attr("x")||0),s=parseFloat(o.attr("y")||0),l=(i.attr("transform")||"").match(W);t=1===e&&1===r?[]:[h(a,s),"scale("+e+","+r+")",h(-a,-s)],l&&t.push(l),i.attr("transform",t.join(""))}}))},y.getMarkerStandoff=q;var Y,Z,X,$,J,K,Q=Math.atan2,tt=Math.cos,et=Math.sin;function rt(t,e){var r=e[0],n=e[1];return[r*tt(t)-n*et(t),r*et(t)+n*tt(t)]}function nt(t,e){var r,n,o=t.ma;void 0===o&&((o=e.marker.angle)&&!i.isArrayOrTypedArray(o)||(o=0));var s=e.marker.angleref;if("previous"===s||"north"===s){if(e._geo){var l=e._geo.project(t.lonlat);r=l[0],n=l[1]}else{var c=e._xA,u=e._yA;if(!c||!u)return 90;r=c.c2p(t.x),n=u.c2p(t.y)}if(e._geo){var h,d=t.lonlat[0],f=t.lonlat[1],p=e._geo.project([d,f+1e-5]),m=e._geo.project([d+1e-5,f]),g=Q(m[1]-n,m[0]-r),v=Q(p[1]-n,p[0]-r);if("north"===s)h=o/180*Math.PI;else if("previous"===s){var b=d/180*Math.PI,y=f/180*Math.PI,x=Y/180*Math.PI,_=Z/180*Math.PI,w=x-b,k=tt(_)*et(w),A=et(_)*tt(y)-tt(_)*et(y)*tt(w);h=-Q(k,A)-Math.PI,Y=d,Z=f}var M=rt(g,[tt(h),0]),T=rt(v,[et(h),0]);o=Q(M[1]+T[1],M[0]+T[0])/Math.PI*180,"previous"!==s||K===e.uid&&t.i===J+1||(o=null)}if("previous"===s&&!e._geo)if(K===e.uid&&t.i===J+1&&a(r)&&a(n)){var S=r-X,C=n-$,E=e.line&&e.line.shape||"",L=E.slice(E.length-1);"h"===L&&(C=0),"v"===L&&(S=0),o+=Q(C,S)/Math.PI*180+90}else o=null}return X=r,$=n,J=t.i,K=e.uid,o}y.getMarkerAngle=nt},68735:(t,e,r)=>{"use strict";var n,i,o,a,s=r(37974),l=r(27941).round,c="M0,0Z",u=Math.sqrt(2),h=Math.sqrt(3),d=Math.PI,f=Math.cos,p=Math.sin;function m(t){return null===t}function g(t,e,r){if(!(t&&t%360!=0||e))return r;if(o===t&&a===e&&n===r)return i;function l(t,r){var n=f(t),i=p(t),o=r[0],a=r[1]+(e||0);return[o*n-a*i,o*i+a*n]}o=t,a=e,n=r;for(var c=t/180*d,u=0,h=0,m=s(r),g="",v=0;v{"use strict";t.exports={visible:{valType:"boolean",editType:"calc",description:["Determines whether or not this set of error bars is visible."].join(" ")},type:{valType:"enumerated",values:["percent","constant","sqrt","data"],editType:"calc",description:["Determines the rule used to generate the error bars.","If *constant`, the bar lengths are of a constant value.","Set this constant in `value`.","If *percent*, the bar lengths correspond to a percentage of","underlying data. Set this percentage in `value`.","If *sqrt*, the bar lengths correspond to the square of the","underlying data.","If *data*, the bar lengths are set with data set `array`."].join(" ")},symmetric:{valType:"boolean",editType:"calc",description:["Determines whether or not the error bars have the same length","in both direction","(top/bottom for vertical bars, left/right for horizontal bars."].join(" ")},array:{valType:"data_array",editType:"calc",description:["Sets the data corresponding the length of each error bar.","Values are plotted relative to the underlying data."].join(" ")},arrayminus:{valType:"data_array",editType:"calc",description:["Sets the data corresponding the length of each error bar in the","bottom (left) direction for vertical (horizontal) bars","Values are plotted relative to the underlying data."].join(" ")},value:{valType:"number",min:0,dflt:10,editType:"calc",description:["Sets the value of either the percentage","(if `type` is set to *percent*) or the constant","(if `type` is set to *constant*) corresponding to the lengths of","the error bars."].join(" ")},valueminus:{valType:"number",min:0,dflt:10,editType:"calc",description:["Sets the value of either the percentage","(if `type` is set to *percent*) or the constant","(if `type` is set to *constant*) corresponding to the lengths of","the error bars in the","bottom (left) direction for vertical (horizontal) bars"].join(" ")},traceref:{valType:"integer",min:0,dflt:0,editType:"style"},tracerefminus:{valType:"integer",min:0,dflt:0,editType:"style"},copy_ystyle:{valType:"boolean",editType:"plot"},copy_zstyle:{valType:"boolean",editType:"style"},color:{valType:"color",editType:"style",description:"Sets the stoke color of the error bars."},thickness:{valType:"number",min:0,dflt:2,editType:"style",description:"Sets the thickness (in px) of the error bars."},width:{valType:"number",min:0,editType:"plot",description:["Sets the width (in px) of the cross-bar at both ends","of the error bars."].join(" ")},editType:"calc",_deprecated:{opacity:{valType:"number",editType:"style",description:["Obsolete.","Use the alpha channel in error bar `color` to set the opacity."].join(" ")}}}},8295:(t,e,r)=>{"use strict";var n=r(7370),i=r(25059),o=r(75815),a=r(12822),s=r(27512);function l(t,e,r,i){var l=e["error_"+i]||{},c=[];if(l.visible&&-1!==["linear","log"].indexOf(r.type)){for(var u=s(l),h=0;h{"use strict";function e(t,e){return"percent"===t?function(t){return Math.abs(t*e/100)}:"constant"===t?function(){return Math.abs(e)}:"sqrt"===t?function(t){return Math.sqrt(Math.abs(t))}:void 0}t.exports=function(t){var r=t.type,n=t.symmetric;if("data"===r){var i=t.array||[];if(n)return function(t,e){var r=+i[e];return[r,r]};var o=t.arrayminus||[];return function(t,e){var r=+i[e],n=+o[e];return isNaN(r)&&isNaN(n)?[NaN,NaN]:[n||0,r||0]}}var a=e(r,t.value),s=e(r,t.valueminus);return n||void 0===t.valueminus?function(t){var e=a(t);return[e,e]}:function(t){return[s(t),a(t)]}}},69440:(t,e,r)=>{"use strict";var n=r(7370),i=r(25059),o=r(12822),a=r(46121),s=r(96647);t.exports=function(t,e,r,l){var c="error_"+l.axis,u=a.newContainer(e,c),h=t[c]||{};function d(t,e){return o.coerce(h,u,s,t,e)}if(!1!==d("visible",void 0!==h.array||void 0!==h.value||"sqrt"===h.type)){var f=d("type","array"in h?"data":"percent"),p=!0;"sqrt"!==f&&(p=d("symmetric",!(("data"===f?"arrayminus":"valueminus")in h))),"data"===f?(d("array"),d("traceref"),p||(d("arrayminus"),d("tracerefminus"))):"percent"!==f&&"constant"!==f||(d("value"),p||d("valueminus"));var m="copy_"+l.inherit+"style";l.inherit&&(e["error_"+l.inherit]||{}).visible&&d(m,!(h.color||n(h.thickness)||n(h.width))),l.inherit&&u[m]||(d("color",r),d("thickness"),d("width",i.traceIs(e,"gl3d")?0:4))}}},90156:(t,e,r)=>{"use strict";var n=r(12822),i=r(62309).overrideAll,o=r(96647),a={error_x:n.extendFlat({},o),error_y:n.extendFlat({},o)};delete a.error_x.copy_zstyle,delete a.error_y.copy_zstyle,delete a.error_y.copy_ystyle;var s={error_x:n.extendFlat({},o),error_y:n.extendFlat({},o),error_z:n.extendFlat({},o)};delete s.error_x.copy_ystyle,delete s.error_y.copy_ystyle,delete s.error_z.copy_ystyle,delete s.error_z.copy_zstyle,t.exports={moduleType:"component",name:"errorbars",schema:{traces:{scatter:a,bar:a,histogram:a,scatter3d:i(s,"calc","nested"),scattergl:i(a,"calc","nested")}},supplyDefaults:r(69440),calc:r(8295),makeComputeError:r(27512),plot:r(42961),style:r(83821),hoverInfo:function(t,e,r){(e.error_y||{}).visible&&(r.yerr=t.yh-t.y,e.error_y.symmetric||(r.yerrneg=t.y-t.ys)),(e.error_x||{}).visible&&(r.xerr=t.xh-t.x,e.error_x.symmetric||(r.xerrneg=t.x-t.xs))}}},42961:(t,e,r)=>{"use strict";var n=r(27941),i=r(7370),o=r(40666),a=r(677);t.exports=function(t,e,r,s){var l=r.xaxis,c=r.yaxis,u=s&&s.duration>0,h=t._context.staticPlot;e.each((function(e){var d,f=e[0].trace,p=f.error_x||{},m=f.error_y||{};f.ids&&(d=function(t){return t.id});var g=a.hasMarkers(f)&&f.marker.maxdisplayed>0;m.visible||p.visible||(e=[]);var v=n.select(this).selectAll("g.errorbar").data(e,d);if(v.exit().remove(),e.length){p.visible||v.selectAll("path.xerror").remove(),m.visible||v.selectAll("path.yerror").remove(),v.style("opacity",1);var b=v.enter().append("g").classed("errorbar",!0);u&&b.style("opacity",0).transition().duration(s.duration).style("opacity",1),o.setClipUrl(v,r.layerClipId,t),v.each((function(t){var e=n.select(this),r=function(t,e,r){var n={x:e.c2p(t.x),y:r.c2p(t.y)};return void 0!==t.yh&&(n.yh=r.c2p(t.yh),n.ys=r.c2p(t.ys),i(n.ys)||(n.noYS=!0,n.ys=r.c2p(t.ys,!0))),void 0!==t.xh&&(n.xh=e.c2p(t.xh),n.xs=e.c2p(t.xs),i(n.xs)||(n.noXS=!0,n.xs=e.c2p(t.xs,!0))),n}(t,l,c);if(!g||t.vis){var o,a=e.select("path.yerror");if(m.visible&&i(r.x)&&i(r.yh)&&i(r.ys)){var d=m.width;o="M"+(r.x-d)+","+r.yh+"h"+2*d+"m-"+d+",0V"+r.ys,r.noYS||(o+="m-"+d+",0h"+2*d),a.size()?u&&(a=a.transition().duration(s.duration).ease(s.easing)):a=e.append("path").style("vector-effect",h?"none":"non-scaling-stroke").classed("yerror",!0),a.attr("d",o)}else a.remove();var f=e.select("path.xerror");if(p.visible&&i(r.y)&&i(r.xh)&&i(r.xs)){var v=(p.copy_ystyle?m:p).width;o="M"+r.xh+","+(r.y-v)+"v"+2*v+"m0,-"+v+"H"+r.xs,r.noXS||(o+="m0,-"+v+"v"+2*v),f.size()?u&&(f=f.transition().duration(s.duration).ease(s.easing)):f=e.append("path").style("vector-effect",h?"none":"non-scaling-stroke").classed("xerror",!0),f.attr("d",o)}else f.remove()}}))}}))}},83821:(t,e,r)=>{"use strict";var n=r(27941),i=r(17499);t.exports=function(t){t.each((function(t){var e=t[0].trace,r=e.error_y||{},o=e.error_x||{},a=n.select(this);a.selectAll("path.yerror").style("stroke-width",r.thickness+"px").call(i.stroke,r.color),o.copy_ystyle&&(o=r),a.selectAll("path.xerror").style("stroke-width",o.thickness+"px").call(i.stroke,o.color)}))}},60713:(t,e,r)=>{"use strict";var n=r(75058),i=r(53572).hoverlabel,o=r(98260).extendFlat;t.exports={hoverlabel:{bgcolor:o({},i.bgcolor,{arrayOk:!0,description:"Sets the background color of the hover labels for this trace"}),bordercolor:o({},i.bordercolor,{arrayOk:!0,description:"Sets the border color of the hover labels for this trace."}),font:n({arrayOk:!0,editType:"none",description:"Sets the font used in hover labels."}),align:o({},i.align,{arrayOk:!0}),namelength:o({},i.namelength,{arrayOk:!0}),editType:"none"}}},56173:(t,e,r)=>{"use strict";var n=r(12822),i=r(25059);function o(t,e,r,i){i=i||n.identity,Array.isArray(t)&&(e[0][r]=i(t))}t.exports=function(t){var e=t.calcdata,r=t._fullLayout;function a(t){return function(e){return n.coerceHoverinfo({hoverinfo:e},{_module:t._module},r)}}for(var s=0;s{"use strict";var n=r(25059),i=r(87408).hover;t.exports=function(t,e,r){var o=n.getComponentMethod("annotations","onClick")(t,t._hoverdata);function a(){t.emit("plotly_click",{points:t._hoverdata,event:e})}void 0!==r&&i(t,e,r,!0),t._hoverdata&&e&&e.target&&(o&&o.then?o.then(a):a(),e.stopImmediatePropagation&&e.stopImmediatePropagation())}},99259:t=>{"use strict";t.exports={YANGLE:60,HOVERARROWSIZE:6,HOVERTEXTPAD:3,HOVERFONTSIZE:13,HOVERFONT:"Arial, sans-serif",HOVERMINTIME:50,HOVERID:"-hover"}},55470:(t,e,r)=>{"use strict";var n=r(12822),i=r(60713),o=r(33369);t.exports=function(t,e,r,a){var s=n.extendFlat({},a.hoverlabel);e.hovertemplate&&(s.namelength=-1),o(t,e,(function(r,o){return n.coerce(t,e,i,r,o)}),s)}},66811:(t,e,r)=>{"use strict";var n=r(12822);e.getSubplot=function(t){return t.subplot||t.xaxis+t.yaxis||t.geo},e.isTraceInSubplots=function(t,r){if("splom"===t.type){for(var n=t.xaxes||[],i=t.yaxes||[],o=0;o=0&&r.index{"use strict";var n=r(27941),i=r(7370),o=r(18106),a=r(12822),s=a.pushUnique,l=a.strTranslate,c=a.strRotate,u=r(16677),h=r(80394),d=r(27517),f=r(40666),p=r(17499),m=r(19846),g=r(75815),v=r(21197).zindexSeparator,b=r(25059),y=r(66811),x=r(99259),_=r(64083),w=r(67739),k=x.YANGLE,A=Math.PI*k/180,M=1/Math.sin(A),T=Math.cos(A),S=Math.sin(A),C=x.HOVERARROWSIZE,E=x.HOVERTEXTPAD,L={box:!0,ohlc:!0,violin:!0,candlestick:!0},z={scatter:!0,scattergl:!0,splom:!0};function O(t,e){return t.distance-e.distance}function D(t){return[t.trace.index,t.index,t.x0,t.y0,t.name,t.attr,t.xa?t.xa._id:"",t.ya?t.ya._id:""].join(",")}e.hover=function(t,e,r,o){t=a.getGraphDiv(t);var l=e.target;a.throttle(t._fullLayout._uid+x.HOVERID,x.HOVERMINTIME,(function(){!function(t,e,r,o,l){r||(r="xy"),"string"==typeof r&&(r=r.split(v)[0]);var c,h,f,x=Array.isArray(r)?r:[r],_=t._fullLayout,w=_.hoversubplots,k=_._plots||[],A=k[r],T=_._has("cartesian"),S=e.hovermode||_.hovermode,E="x"===(S||"").charAt(0),I="y"===(S||"").charAt(0);if(T&&(E||I)&&"axis"===w)for(var R=x.length,G=0;G$[0]._length||_t<0||_t>J[0]._length)return m.unhoverRaw(t,e)}else xt="xpx"in e?e.xpx:$[0]._length/2,_t="ypx"in e?e.ypx:J[0]._length/2;if(e.pointerX=xt+$[0]._offset,e.pointerY=_t+J[0]._offset,nt="xval"in e?y.flat(x,e.xval):y.p2c($,xt),it="yval"in e?y.flat(x,e.yval):y.p2c(J,_t),!i(nt[0])||!i(it[0]))return a.warn("Fx.hover failed",e,t),m.unhoverRaw(t,e)}var Mt=1/0;function Tt(r,n){for(at=0;atmt&&(gt.splice(0,mt),Mt=gt[0].distance),T&&0!==rt&&0===gt.length){pt.distance=rt,pt.index=!1;var u=lt._module.hoverPoints(pt,dt,ft,"closest",{hoverLayer:_._hoverlayer});if(u&&(u=u.filter((function(t){return t.spikeDistance<=rt}))),u&&u.length){var h,d=u.filter((function(t){return t.xa.showspikes&&"hovered data"!==t.xa.spikesnap}));if(d.length){var f=d[0];i(f.x0)&&i(f.y0)&&(h=Ct(f),(!bt.vLinePoint||bt.vLinePoint.spikeDistance>h.spikeDistance)&&(bt.vLinePoint=h))}var m=u.filter((function(t){return t.ya.showspikes&&"hovered data"!==t.ya.spikesnap}));if(m.length){var g=m[0];i(g.x0)&&i(g.y0)&&(h=Ct(g),(!bt.hLinePoint||bt.hLinePoint.spikeDistance>h.spikeDistance)&&(bt.hLinePoint=h))}}}}}function St(t,e,r){for(var n,i=null,o=1/0,a=0;a0&&Math.abs(t.distance)Nt-1;Bt--)Ht(gt[Bt]);gt=Ut,Ot()}var Wt=t._hoverdata,qt=[],Yt=H(t),Zt=W(t);for(ot=0;ot1||gt.length>1)||"closest"===S&&yt&>.length>1,se=p.combine(_.plot_bgcolor||p.background,_.paper_bgcolor),le=F(gt,{gd:t,hovermode:S,rotateLabels:ae,bgColor:se,container:_._hoverlayer,outerContainer:_._paper.node(),commonLabelOpts:_.hoverlabel,hoverdistance:_.hoverdistance}),ce=le.hoverLabels;if(y.isUnifiedHover(S)||(function(t,e,r,n){var i,o,a,s,l,c,u,h=e?"xa":"ya",d=e?"ya":"xa",f=0,p=1,m=t.size(),g=new Array(m),v=0,b=n.minX,y=n.maxX,x=n.minY,_=n.maxY,w=function(t){return t*r._invScaleX},k=function(t){return t*r._invScaleY};function A(t){var e=t[0],r=t[t.length-1];if(o=e.pmin-e.pos-e.dp+e.size,a=r.pos+r.dp+r.size-e.pmax,o>.01){for(l=t.length-1;l>=0;l--)t[l].dp+=o;i=!1}if(!(a<.01)){if(o<-.01){for(l=t.length-1;l>=0;l--)t[l].dp-=a;i=!1}if(i){var n=0;for(s=0;se.pmax&&n++;for(s=t.length-1;s>=0&&!(n<=0);s--)(c=t[s]).pos>e.pmax-1&&(c.del=!0,n--);for(s=0;s=0;l--)t[l].dp-=a;for(s=t.length-1;s>=0&&!(n<=0);s--)(c=t[s]).pos+c.dp+c.size>e.pmax&&(c.del=!0,n--)}}}for(t.each((function(t){var n=t[h],i=t[d],o="x"===n._id.charAt(0),a=n.range;0===v&&a&&a[0]>a[1]!==o&&(p=-1);var s=0,l=o?r.width:r.height;if("x"===r.hovermode||"y"===r.hovermode){var c,u,f=P(t,e),m=t.anchor,A="end"===m?-1:1;if("middle"===m)u=(c=t.crossPos+(o?k(f.y-t.by/2):w(t.bx/2+t.tx2width/2)))+(o?k(t.by):w(t.bx));else if(o)u=(c=t.crossPos+k(C+f.y)-k(t.by/2-C))+k(t.by);else{var T=w(A*C+f.x),S=T+w(A*t.bx);c=t.crossPos+Math.min(T,S),u=t.crossPos+Math.max(T,S)}o?void 0!==x&&void 0!==_&&Math.min(u,_)-Math.max(c,x)>1&&("left"===i.side?(s=i._mainLinePosition,l=r.width):l=i._mainLinePosition):void 0!==b&&void 0!==y&&Math.min(u,y)-Math.max(c,b)>1&&("top"===i.side?(s=i._mainLinePosition,l=r.height):l=i._mainLinePosition)}g[v++]=[{datum:t,traceIndex:t.trace.index,dp:0,pos:t.pos,posref:t.posref,size:t.by*(o?M:1)/2,pmin:s,pmax:l}]})),g.sort((function(t,e){return t[0].posref-e[0].posref||p*(e[0].traceIndex-t[0].traceIndex)}));!i&&f<=m;){for(f++,i=!0,s=0;s.01){for(l=S.length-1;l>=0;l--)S[l].dp+=o;for(T.push.apply(T,S),g.splice(s+1,1),u=0,l=T.length-1;l>=0;l--)u+=T[l].dp;for(a=u/T.length,l=T.length-1;l>=0;l--)T[l].dp-=a;i=!1}else s++}g.forEach(A)}for(s=g.length-1;s>=0;s--){var z=g[s];for(l=z.length-1;l>=0;l--){var O=z[l],D=O.datum;D.offset=O.dp,D.del=O.del}}}(ce,ae,_,le.commonLabelBoundingBox),j(ce,ae,_._invScaleX,_._invScaleY)),l&&l.tagName){var ue=b.getComponentMethod("annotations","hasClickToShow")(t,qt);d(n.select(l),ue?"pointer":"")}l&&!o&&function(t,e,r){if(!r||r.length!==t._hoverdata.length)return!0;for(var n=r.length-1;n>=0;n--){var i=r[n],o=t._hoverdata[n];if(i.curveNumber!==o.curveNumber||String(i.pointNumber)!==String(o.pointNumber)||String(i.pointNumbers)!==String(o.pointNumbers))return!0}return!1}(t,0,Wt)&&(Wt&&t.emit("plotly_unhover",{event:e,points:Wt}),t.emit("plotly_hover",{event:e,points:t._hoverdata,xaxes:$,yaxes:J,xvals:nt,yvals:it}))}(t,e,r,o,l)}))},e.loneHover=function(t,e){var r=!0;Array.isArray(t)||(r=!1,t=[t]);var i=e.gd,o=H(i),a=W(i),s=!1,l=F(t.map((function(t){var r=t._x0||t.x0||t.x||0,n=t._x1||t.x1||t.x||0,s=t._y0||t.y0||t.y||0,l=t._y1||t.y1||t.y||0,c=t.eventData;if(c){var u=Math.min(r,n),h=Math.max(r,n),d=Math.min(s,l),f=Math.max(s,l),m=t.trace;if(b.traceIs(m,"gl3d")){var g=i._fullLayout[m.scene]._scene.container,v=g.offsetLeft,y=g.offsetTop;u+=v,h+=v,d+=y,f+=y}c.bbox={x0:u+a,x1:h+a,y0:d+o,y1:f+o},e.inOut_bbox&&e.inOut_bbox.push(c.bbox)}else c=!1;return{color:t.color||p.defaultLine,x0:t.x0||t.x||0,x1:t.x1||t.x||0,y0:t.y0||t.y||0,y1:t.y1||t.y||0,xLabel:t.xLabel,yLabel:t.yLabel,zLabel:t.zLabel,text:t.text,name:t.name,idealAlign:t.idealAlign,borderColor:t.borderColor,fontFamily:t.fontFamily,fontSize:t.fontSize,fontColor:t.fontColor,fontWeight:t.fontWeight,fontStyle:t.fontStyle,fontVariant:t.fontVariant,nameLength:t.nameLength,textAlign:t.textAlign,trace:t.trace||{index:0,hoverinfo:""},xa:{_offset:0},ya:{_offset:0},index:0,hovertemplate:t.hovertemplate||!1,hovertemplateLabels:t.hovertemplateLabels||!1,eventData:c}})),{gd:i,hovermode:"closest",rotateLabels:s,bgColor:e.bgColor||p.background,container:n.select(e.container),outerContainer:e.outerContainer||e.container}).hoverLabels,c=0,u=0;return l.sort((function(t,e){return t.y0-e.y0})).each((function(t,r){var n=t.y0-t.by/2;t.offset=n-5([\s\S]*)<\/extra>/;function F(t,e){var r=e.gd,i=r._fullLayout,o=e.hovermode,s=e.rotateLabels,u=e.bgColor,d=e.container,m=e.outerContainer,g=e.commonLabelOpts||{};if(0===t.length)return[[]];var v=e.fontFamily||x.HOVERFONT,A=e.fontSize||x.HOVERFONTSIZE,M=e.fontWeight||i.font.weight,T=e.fontStyle||i.font.style,S=e.fontVariant||i.font.variant,L=e.fontTextcase||i.font.textcase,z=e.fontLineposition||i.font.lineposition,O=e.fontShadow||i.font.shadow,I=t[0],F=I.xa,P=I.ya,j=o.charAt(0),N=j+"Label",B=I[N];if(void 0===B&&"multicategory"===F.type)for(var U=0;Ui.width-k&&(D=i.width-k),e.attr("d","M"+(y-D)+",0L"+(y-D+C)+","+w+C+"H"+k+"v"+w+(2*E+_.height)+"H"+-k+"V"+w+C+"H"+(y-D-C)+"Z"),y=D,Q.minX=y-k,Q.maxX=y+k,"top"===F.side?(Q.minY=x-(2*E+_.height),Q.maxY=x-E):(Q.minY=x+E,Q.maxY=x+(2*E+_.height))}else{var R,j,N;"right"===P.side?(R="start",j=1,N="",y=F._offset+F._length):(R="end",j=-1,N="-",y=F._offset),x=P._offset+(I.y0+I.y1)/2,s.attr("text-anchor",R),e.attr("d","M0,0L"+N+C+","+C+"V"+(E+_.height/2)+"h"+N+(2*E+_.width)+"V-"+(E+_.height/2)+"H"+N+C+"V-"+C+"Z"),Q.minY=x-(E+_.height/2),Q.maxY=x+(E+_.height/2),"right"===P.side?(Q.minX=y+C,Q.maxX=y+C+(2*E+_.width)):(Q.minX=y-C-(2*E+_.width),Q.maxX=y-C);var U,G=_.height/2,H=V-_.top-G,W="clip"+i._uid+"commonlabel"+P._id;if(y<_.width+2*E+C){U="M-"+(C+E)+"-"+G+"h-"+(_.width-E)+"V"+G+"h"+(_.width-E)+"Z";var Y=_.width-y+E;h.positionText(s,Y,H),"end"===R&&s.selectAll("tspan").each((function(){var t=n.select(this),e=f.tester.append("text").text(t.text()).call(f.font,b),i=q(r,e.node());Math.round(i.width)=0?pt:mt+bt=0?mt:Tt+bt=0?dt:ft+yt=0?ft:St+yt=0,"top"!==t.idealAlign&&J||!K?J?(N+=G/2,t.anchor="start"):t.anchor="middle":(N-=G/2,t.anchor="end"),t.crossPos=N;else{if(t.pos=N,J=j+U/2+Q<=H,K=j-U/2-Q>=0,"left"!==t.idealAlign&&J||!K)if(J)j+=U/2,t.anchor="start";else{t.anchor="middle";var tt=Q/2,et=j+tt-H,rt=j-tt;et>0&&(j-=et),rt<0&&(j+=-rt)}else j-=U/2,t.anchor="end";t.crossPos=j}w.attr("text-anchor",t.anchor),I&&D.attr("text-anchor",t.anchor),e.attr("transform",l(j,N)+(s?c(k):""))})),{hoverLabels:Ct,commonLabelBoundingBox:Q}}function R(t,e,r,n,i,o){var s="",l="";void 0!==t.nameOverride&&(t.name=t.nameOverride),t.name&&(t.trace._meta&&(t.name=a.templateString(t.name,t.trace._meta)),s=G(t.name,t.nameLength));var c=r.charAt(0),u="x"===c?"y":"x";void 0!==t.zLabel?(void 0!==t.xLabel&&(l+="x: "+t.xLabel+"
"),void 0!==t.yLabel&&(l+="y: "+t.yLabel+"
"),"choropleth"!==t.trace.type&&"choroplethmapbox"!==t.trace.type&&"choroplethmap"!==t.trace.type&&(l+=(l?"z: ":"")+t.zLabel)):e&&t[c+"Label"]===i?l=t[u+"Label"]||"":void 0===t.xLabel?void 0!==t.yLabel&&"scattercarpet"!==t.trace.type&&(l=t.yLabel):l=void 0===t.yLabel?t.xLabel:"("+t.xLabel+", "+t.yLabel+")",!t.text&&0!==t.text||Array.isArray(t.text)||(l+=(l?"
":"")+t.text),void 0!==t.extraText&&(l+=(l?"
":"")+t.extraText),o&&""===l&&!t.hovertemplate&&(""===s&&o.remove(),l=s);var h=t.hovertemplate||!1;if(h){var d=t.hovertemplateLabels||t;t[c+"Label"]!==i&&(d[c+"other"]=d[c+"Val"],d[c+"otherLabel"]=d[c+"Label"]),l=(l=a.hovertemplateString(h,d,n._d3locale,t.eventData[0]||{},t.trace._meta)).replace(I,(function(e,r){return s=G(r,t.nameLength),""}))}return[l,s]}function P(t,e){var r=0,n=t.offset;return e&&(n*=-S,r=t.offset*T),{x:r,y:n}}function j(t,e,r,i){var o=function(t){return t*r},a=function(t){return t*i};t.each((function(t){var r=n.select(this);if(t.del)return r.remove();var i,s,l,c,u=r.select("text.nums"),d=t.anchor,p="end"===d?-1:1,m=(c=(l=(s={start:1,end:-1,middle:0}[(i=t).anchor])*(C+E))+s*(i.txwidth+E),"middle"===i.anchor&&(l-=i.tx2width/2,c+=i.txwidth/2+E),{alignShift:s,textShiftX:l,text2ShiftX:c}),g=P(t,e),v=g.x,b=g.y,y="middle"===d;r.select("path").attr("d",y?"M-"+o(t.bx/2+t.tx2width/2)+","+a(b-t.by/2)+"h"+o(t.bx)+"v"+a(t.by)+"h-"+o(t.bx)+"Z":"M0,0L"+o(p*C+v)+","+a(C+b)+"v"+a(t.by/2-C)+"h"+o(p*t.bx)+"v-"+a(t.by)+"H"+o(p*C+v)+"V"+a(b-C)+"Z");var x=v+m.textShiftX,_=b+t.ty0-t.by/2+E,w=t.textAlign||"auto";"auto"!==w&&("left"===w&&"start"!==d?(u.attr("text-anchor","start"),x=y?-t.bx/2-t.tx2width/2+E:-t.bx-E):"right"===w&&"end"!==d&&(u.attr("text-anchor","end"),x=y?t.bx/2-t.tx2width/2-E:t.bx+E)),u.call(h.positionText,o(x),a(_)),t.tx2width&&(r.select("text.name").call(h.positionText,o(m.text2ShiftX+m.alignShift*E+v),a(b+t.ty0-t.by/2+E)),r.select("rect").call(f.setRect,o(m.text2ShiftX+(m.alignShift-1)*t.tx2width/2+v),a(b-t.by/2-1),o(t.tx2width),a(t.by+2)))}))}function N(t,e){var r=t.index,n=t.trace||{},o=t.cd[0],s=t.cd[r]||{};function l(t){return t||i(t)&&0===t}var c=Array.isArray(r)?function(t,e){var i=a.castOption(o,r,t);return l(i)?i:a.extractOption({},n,"",e)}:function(t,e){return a.extractOption(s,n,t,e)};function u(e,r,n){var i=c(r,n);l(i)&&(t[e]=i)}if(u("hoverinfo","hi","hoverinfo"),u("bgcolor","hbg","hoverlabel.bgcolor"),u("borderColor","hbc","hoverlabel.bordercolor"),u("fontFamily","htf","hoverlabel.font.family"),u("fontSize","hts","hoverlabel.font.size"),u("fontColor","htc","hoverlabel.font.color"),u("fontWeight","htw","hoverlabel.font.weight"),u("fontStyle","hty","hoverlabel.font.style"),u("fontVariant","htv","hoverlabel.font.variant"),u("nameLength","hnl","hoverlabel.namelength"),u("textAlign","hta","hoverlabel.align"),t.posref="y"===e||"closest"===e&&"h"===n.orientation?t.xa._offset+(t.x0+t.x1)/2:t.ya._offset+(t.y0+t.y1)/2,t.x0=a.constrain(t.x0,0,t.xa._length),t.x1=a.constrain(t.x1,0,t.xa._length),t.y0=a.constrain(t.y0,0,t.ya._length),t.y1=a.constrain(t.y1,0,t.ya._length),void 0!==t.xLabelVal&&(t.xLabel="xLabel"in t?t.xLabel:g.hoverLabelText(t.xa,t.xLabelVal,n.xhoverformat),t.xVal=t.xa.c2d(t.xLabelVal)),void 0!==t.yLabelVal&&(t.yLabel="yLabel"in t?t.yLabel:g.hoverLabelText(t.ya,t.yLabelVal,n.yhoverformat),t.yVal=t.ya.c2d(t.yLabelVal)),void 0!==t.zLabelVal&&void 0===t.zLabel&&(t.zLabel=String(t.zLabelVal)),!(isNaN(t.xerr)||"log"===t.xa.type&&t.xerr<=0)){var h=g.tickText(t.xa,t.xa.c2l(t.xerr),"hover").text;void 0!==t.xerrneg?t.xLabel+=" +"+h+" / -"+g.tickText(t.xa,t.xa.c2l(t.xerrneg),"hover").text:t.xLabel+=" ± "+h,"x"===e&&(t.distance+=1)}if(!(isNaN(t.yerr)||"log"===t.ya.type&&t.yerr<=0)){var d=g.tickText(t.ya,t.ya.c2l(t.yerr),"hover").text;void 0!==t.yerrneg?t.yLabel+=" +"+d+" / -"+g.tickText(t.ya,t.ya.c2l(t.yerrneg),"hover").text:t.yLabel+=" ± "+d,"y"===e&&(t.distance+=1)}var f=t.hoverinfo||t.trace.hoverinfo;return f&&"all"!==f&&(-1===(f=Array.isArray(f)?f:f.split("+")).indexOf("x")&&(t.xLabel=void 0),-1===f.indexOf("y")&&(t.yLabel=void 0),-1===f.indexOf("z")&&(t.zLabel=void 0),-1===f.indexOf("text")&&(t.text=void 0),-1===f.indexOf("name")&&(t.name=void 0)),t}function B(t,e,r){var n,i,a=r.container,s=r.fullLayout,l=s._size,c=r.event,u=!!e.hLinePoint,h=!!e.vLinePoint;if(a.selectAll(".spikeline").remove(),h||u){var d=p.combine(s.plot_bgcolor,s.paper_bgcolor);if(u){var m,v,b=e.hLinePoint;n=b&&b.xa,"cursor"===(i=b&&b.ya).spikesnap?(m=c.pointerX,v=c.pointerY):(m=n._offset+b.x,v=i._offset+b.y);var y,x,_=o.readability(b.color,d)<1.5?p.contrast(d):b.color,w=i.spikemode,k=i.spikethickness,A=i.spikecolor||_,M=g.getPxPosition(t,i);if(-1!==w.indexOf("toaxis")||-1!==w.indexOf("across")){if(-1!==w.indexOf("toaxis")&&(y=M,x=m),-1!==w.indexOf("across")){var T=i._counterDomainMin,S=i._counterDomainMax;"free"===i.anchor&&(T=Math.min(T,i.position),S=Math.max(S,i.position)),y=l.l+T*l.w,x=l.l+S*l.w}a.insert("line",":first-child").attr({x1:y,x2:x,y1:v,y2:v,"stroke-width":k,stroke:A,"stroke-dasharray":f.dashStyle(i.spikedash,k)}).classed("spikeline",!0).classed("crisp",!0),a.insert("line",":first-child").attr({x1:y,x2:x,y1:v,y2:v,"stroke-width":k+2,stroke:d}).classed("spikeline",!0).classed("crisp",!0)}-1!==w.indexOf("marker")&&a.insert("circle",":first-child").attr({cx:M+("right"!==i.side?k:-k),cy:v,r:k,fill:A}).classed("spikeline",!0)}if(h){var C,E,L=e.vLinePoint;n=L&&L.xa,i=L&&L.ya,"cursor"===n.spikesnap?(C=c.pointerX,E=c.pointerY):(C=n._offset+L.x,E=i._offset+L.y);var z,O,D=o.readability(L.color,d)<1.5?p.contrast(d):L.color,I=n.spikemode,F=n.spikethickness,R=n.spikecolor||D,P=g.getPxPosition(t,n);if(-1!==I.indexOf("toaxis")||-1!==I.indexOf("across")){if(-1!==I.indexOf("toaxis")&&(z=P,O=E),-1!==I.indexOf("across")){var j=n._counterDomainMin,N=n._counterDomainMax;"free"===n.anchor&&(j=Math.min(j,n.position),N=Math.max(N,n.position)),z=l.t+(1-N)*l.h,O=l.t+(1-j)*l.h}a.insert("line",":first-child").attr({x1:C,x2:C,y1:z,y2:O,"stroke-width":F,stroke:R,"stroke-dasharray":f.dashStyle(n.spikedash,F)}).classed("spikeline",!0).classed("crisp",!0),a.insert("line",":first-child").attr({x1:C,x2:C,y1:z,y2:O,"stroke-width":F+2,stroke:d}).classed("spikeline",!0).classed("crisp",!0)}-1!==I.indexOf("marker")&&a.insert("circle",":first-child").attr({cx:C,cy:P-("top"!==n.side?F:-F),r:F,fill:R}).classed("spikeline",!0)}}}function U(t,e){return!e||e.vLinePoint!==t._spikepoints.vLinePoint||e.hLinePoint!==t._spikepoints.hLinePoint}function G(t,e){return h.plainText(t||"",{len:e,allowedTags:["br","sub","sup","b","i","em","s","u"]})}function V(t,e,r){var n=e[t+"a"],i=e[t+"Val"],o=e.cd[0];if("category"===n.type||"multicategory"===n.type)i=n._categoriesMap[i];else if("date"===n.type){var a=e.trace[t+"periodalignment"];if(a){var s=e.cd[e.index],l=s[t+"Start"];void 0===l&&(l=s[t]);var c=s[t+"End"];void 0===c&&(c=s[t]);var u=c-l;"end"===a?i+=u:"middle"===a&&(i+=u/2)}i=n.d2c(i)}return o&&o.t&&o.t.posLetter===n._id&&("group"!==r.boxmode&&"group"!==r.violinmode||(i+=o.t.dPos)),i}function H(t){return t.offsetTop+t.clientTop}function W(t){return t.offsetLeft+t.clientLeft}function q(t,e){var r=t._fullLayout,n=e.getBoundingClientRect(),i=n.left,o=n.top,s=i+n.width,l=o+n.height,c=a.apply3DTransform(r._invTransform)(i,o),u=a.apply3DTransform(r._invTransform)(s,l),h=c[0],d=c[1],f=u[0],p=u[1];return{x:h,y:d,width:f-h,height:p-d,top:Math.min(d,p),left:Math.min(h,f),right:Math.max(h,f),bottom:Math.max(d,p)}}},33369:(t,e,r)=>{"use strict";var n=r(12822),i=r(17499),o=r(66811).isUnifiedHover;t.exports=function(t,e,r,a){a=a||{};var s=e.legend;function l(t){a.font[t]||(a.font[t]=s?e.legend.font[t]:e.font[t])}e&&o(e.hovermode)&&(a.font||(a.font={}),l("size"),l("family"),l("color"),l("weight"),l("style"),l("variant"),s?(a.bgcolor||(a.bgcolor=i.combine(e.legend.bgcolor,e.paper_bgcolor)),a.bordercolor||(a.bordercolor=e.legend.bordercolor)):a.bgcolor||(a.bgcolor=e.paper_bgcolor)),r("hoverlabel.bgcolor",a.bgcolor),r("hoverlabel.bordercolor",a.bordercolor),r("hoverlabel.namelength",a.namelength),n.coerceFont(r,"hoverlabel.font",a.font),r("hoverlabel.align",a.align)}},85400:(t,e,r)=>{"use strict";var n=r(12822),i=r(53572);t.exports=function(t,e){function r(r,o){return void 0!==e[r]?e[r]:n.coerce(t,e,i,r,o)}return r("clickmode"),r("hoversubplots"),r("hovermode")}},70410:(t,e,r)=>{"use strict";var n=r(27941),i=r(12822),o=r(19846),a=r(66811),s=r(53572),l=r(87408);t.exports={moduleType:"component",name:"fx",constants:r(99259),schema:{layout:s},attributes:r(60713),layoutAttributes:s,supplyLayoutGlobalDefaults:r(26271),supplyDefaults:r(55470),supplyLayoutDefaults:r(3315),calc:r(56173),getDistanceFunction:a.getDistanceFunction,getClosest:a.getClosest,inbox:a.inbox,quadrature:a.quadrature,appendArrayPointValue:a.appendArrayPointValue,castHoverOption:function(t,e,r){return i.castOption(t,e,"hoverlabel."+r)},castHoverinfo:function(t,e,r){return i.castOption(t,r,"hoverinfo",(function(r){return i.coerceHoverinfo({hoverinfo:r},{_module:t._module},e)}))},hover:l.hover,unhover:o.unhover,loneHover:l.loneHover,loneUnhover:function(t){var e=i.isD3Selection(t)?t:n.select(t);e.selectAll("g.hovertext").remove(),e.selectAll(".spikeline").remove()},click:r(43006)}},53572:(t,e,r)=>{"use strict";var n=r(99259),i=r(75058),o=i({editType:"none",description:"Sets the default hover label font used by all traces on the graph."});o.family.dflt=n.HOVERFONT,o.size.dflt=n.HOVERFONTSIZE,t.exports={clickmode:{valType:"flaglist",flags:["event","select"],dflt:"event",editType:"plot",extras:["none"],description:["Determines the mode of single click interactions.","*event* is the default value and emits the `plotly_click`","event. In addition this mode emits the `plotly_selected` event","in drag modes *lasso* and *select*, but with no event data attached","(kept for compatibility reasons).","The *select* flag enables selecting single","data points via click. This mode also supports persistent selections,","meaning that pressing Shift while clicking, adds to / subtracts from an","existing selection. *select* with `hovermode`: *x* can be confusing, consider","explicitly setting `hovermode`: *closest* when using this feature.","Selection events are sent accordingly as long as *event* flag is set as well.","When the *event* flag is missing, `plotly_click` and `plotly_selected`","events are not fired."].join(" ")},dragmode:{valType:"enumerated",values:["zoom","pan","select","lasso","drawclosedpath","drawopenpath","drawline","drawrect","drawcircle","orbit","turntable",!1],dflt:"zoom",editType:"modebar",description:["Determines the mode of drag interactions.","*select* and *lasso* apply only to scatter traces with","markers or text. *orbit* and *turntable* apply only to","3D scenes."].join(" ")},hovermode:{valType:"enumerated",values:["x","y","closest",!1,"x unified","y unified"],dflt:"closest",editType:"modebar",description:["Determines the mode of hover interactions.","If *closest*, a single hoverlabel will appear","for the *closest* point within the `hoverdistance`.","If *x* (or *y*), multiple hoverlabels will appear for multiple points","at the *closest* x- (or y-) coordinate within the `hoverdistance`,","with the caveat that no more than one hoverlabel will appear per trace.","If *x unified* (or *y unified*), a single hoverlabel will appear","multiple points at the closest x- (or y-) coordinate within the `hoverdistance`","with the caveat that no more than one hoverlabel will appear per trace.","In this mode, spikelines are enabled by default perpendicular to the specified axis.","If false, hover interactions are disabled."].join(" ")},hoversubplots:{valType:"enumerated",values:["single","overlaying","axis"],dflt:"overlaying",editType:"none",description:["Determines expansion of hover effects to other subplots","If *single* just the axis pair of the primary point is included without overlaying subplots.","If *overlaying* all subplots using the main axis and occupying the same space are included.","If *axis*, also include stacked subplots using the same axis","when `hovermode` is set to *x*, *x unified*, *y* or *y unified*."].join(" ")},hoverdistance:{valType:"integer",min:-1,dflt:20,editType:"none",description:["Sets the default distance (in pixels) to look for data","to add hover labels (-1 means no cutoff, 0 means no looking for data).","This is only a real distance for hovering on point-like objects,","like scatter points. For area-like objects (bars, scatter fills, etc)","hovering is on inside the area and off outside, but these objects","will not supersede hover on point-like objects in case of conflict."].join(" ")},spikedistance:{valType:"integer",min:-1,dflt:-1,editType:"none",description:["Sets the default distance (in pixels) to look for data to draw","spikelines to (-1 means no cutoff, 0 means no looking for data).","As with hoverdistance, distance does not apply to area-like objects.","In addition, some objects can be hovered on but will not generate","spikelines, such as scatter fills."].join(" ")},hoverlabel:{bgcolor:{valType:"color",editType:"none",description:["Sets the background color of all hover labels on graph"].join(" ")},bordercolor:{valType:"color",editType:"none",description:["Sets the border color of all hover labels on graph."].join(" ")},font:o,grouptitlefont:i({editType:"none",description:["Sets the font for group titles in hover (unified modes).","Defaults to `hoverlabel.font`."].join(" ")}),align:{valType:"enumerated",values:["left","right","auto"],dflt:"auto",editType:"none",description:["Sets the horizontal alignment of the text content within hover label box.","Has an effect only if the hover label text spans more two or more lines"].join(" ")},namelength:{valType:"integer",min:-1,dflt:15,editType:"none",description:["Sets the default length (in number of characters) of the trace name in","the hover labels for all traces. -1 shows the whole name","regardless of length. 0-3 shows the first 0-3 characters, and","an integer >3 will show the whole name if it is less than that","many characters, but if it is longer, will truncate to","`namelength - 3` characters and add an ellipsis."].join(" ")},editType:"none"},selectdirection:{valType:"enumerated",values:["h","v","d","any"],dflt:"any",description:["When `dragmode` is set to *select*, this limits the selection of the drag to","horizontal, vertical or diagonal. *h* only allows horizontal selection,","*v* only vertical, *d* only diagonal and *any* sets no limit."].join(" "),editType:"none"}}},3315:(t,e,r)=>{"use strict";var n=r(12822),i=r(53572),o=r(85400),a=r(33369);t.exports=function(t,e){function r(r,o){return n.coerce(t,e,i,r,o)}o(t,e)&&(r("hoverdistance"),r("spikedistance")),"select"===r("dragmode")&&r("selectdirection");var s=e._has("mapbox"),l=e._has("map"),c=e._has("geo"),u=e._basePlotModules.length;"zoom"===e.dragmode&&((s||l||c)&&1===u||(s||l)&&c&&2===u)&&(e.dragmode="pan"),a(t,e,r),n.coerceFont(r,"hoverlabel.grouptitlefont",e.hoverlabel.font)}},26271:(t,e,r)=>{"use strict";var n=r(12822),i=r(33369),o=r(53572);t.exports=function(t,e){i(t,e,(function(r,i){return n.coerce(t,e,o,r,i)}))}},4664:(t,e,r)=>{"use strict";var n=r(12822),i=r(46233).counter,o=r(40365).u,a=r(21197).idRegex,s=r(46121),l={rows:{valType:"integer",min:1,editType:"plot",description:["The number of rows in the grid. If you provide a 2D `subplots`","array or a `yaxes` array, its length is used as the default.","But it's also possible to have a different length, if you","want to leave a row at the end for non-cartesian subplots."].join(" ")},roworder:{valType:"enumerated",values:["top to bottom","bottom to top"],dflt:"top to bottom",editType:"plot",description:["Is the first row the top or the bottom? Note that columns","are always enumerated from left to right."].join(" ")},columns:{valType:"integer",min:1,editType:"plot",description:["The number of columns in the grid. If you provide a 2D `subplots`","array, the length of its longest row is used as the default.","If you give an `xaxes` array, its length is used as the default.","But it's also possible to have a different length, if you","want to leave a row at the end for non-cartesian subplots."].join(" ")},subplots:{valType:"info_array",freeLength:!0,dimensions:2,items:{valType:"enumerated",values:[i("xy").toString(),""],editType:"plot"},editType:"plot",description:["Used for freeform grids, where some axes may be shared across subplots","but others are not. Each entry should be a cartesian subplot id, like","*xy* or *x3y2*, or ** to leave that cell empty. You may reuse x axes","within the same column, and y axes within the same row.","Non-cartesian subplots and traces that support `domain` can place themselves","in this grid separately using the `gridcell` attribute."].join(" ")},xaxes:{valType:"info_array",freeLength:!0,items:{valType:"enumerated",values:[a.x.toString(),""],editType:"plot"},editType:"plot",description:["Used with `yaxes` when the x and y axes are shared across columns and rows.","Each entry should be an x axis id like *x*, *x2*, etc., or ** to","not put an x axis in that column. Entries other than ** must be unique.","Ignored if `subplots` is present. If missing but `yaxes` is present,","will generate consecutive IDs."].join(" ")},yaxes:{valType:"info_array",freeLength:!0,items:{valType:"enumerated",values:[a.y.toString(),""],editType:"plot"},editType:"plot",description:["Used with `yaxes` when the x and y axes are shared across columns and rows.","Each entry should be an y axis id like *y*, *y2*, etc., or ** to","not put a y axis in that row. Entries other than ** must be unique.","Ignored if `subplots` is present. If missing but `xaxes` is present,","will generate consecutive IDs."].join(" ")},pattern:{valType:"enumerated",values:["independent","coupled"],dflt:"coupled",editType:"plot",description:["If no `subplots`, `xaxes`, or `yaxes` are given but we do have `rows` and `columns`,","we can generate defaults using consecutive axis IDs, in two ways:","*coupled* gives one x axis per column and one y axis per row.","*independent* uses a new xy pair for each cell, left-to-right across each row","then iterating rows according to `roworder`."].join(" ")},xgap:{valType:"number",min:0,max:1,editType:"plot",description:["Horizontal space between grid cells, expressed as a fraction","of the total width available to one cell. Defaults to 0.1","for coupled-axes grids and 0.2 for independent grids."].join(" ")},ygap:{valType:"number",min:0,max:1,editType:"plot",description:["Vertical space between grid cells, expressed as a fraction","of the total height available to one cell. Defaults to 0.1","for coupled-axes grids and 0.3 for independent grids."].join(" ")},domain:o({name:"grid",editType:"plot",noGridCell:!0},{description:["The first and last cells end exactly at the domain","edges, with no grout around the edges."].join(" ")}),xside:{valType:"enumerated",values:["bottom","bottom plot","top plot","top"],dflt:"bottom plot",editType:"plot",description:["Sets where the x axis labels and titles go. *bottom* means","the very bottom of the grid. *bottom plot* is the lowest plot","that each x axis is used in. *top* and *top plot* are similar."].join(" ")},yside:{valType:"enumerated",values:["left","left plot","right plot","right"],dflt:"left plot",editType:"plot",description:["Sets where the y axis labels and titles go. *left* means","the very left edge of the grid. *left plot* is the leftmost plot","that each y axis is used in. *right* and *right plot* are similar."].join(" ")},editType:"plot"};function c(t,e,r){var n=e[r+"axes"],i=Object.keys((t._splomAxes||{})[r]||{});return Array.isArray(n)?n:i.length?i:void 0}function u(t,e,r,n,i,o){var a=e(t+"gap",r),s=e("domain."+t);e(t+"side",n);for(var l=new Array(i),c=s[0],u=(s[1]-c)/(i-a),h=u*(1-a),d=0;d1){d||f||p||"independent"===A("pattern")&&(d=!0),g._hasSubplotGrid=d;var y,x,_="top to bottom"===A("roworder"),w=d?.2:.1,k=d?.3:.1;m&&e._splomGridDflt&&(y=e._splomGridDflt.xside,x=e._splomGridDflt.yside),g._domains={x:u("x",A,w,y,b),y:u("y",A,k,x,v,_)}}else delete e.grid}function A(t,e){return n.coerce(r,g,l,t,e)}},contentDefaults:function(t,e){var r=e.grid;if(r&&r._domains){var n,i,o,a,s,l,u,d=t.grid||{},f=e._subplots,p=r._hasSubplotGrid,m=r.rows,g=r.columns,v="independent"===r.pattern,b=r._axisMap={};if(p){var y=d.subplots||[];l=r.subplots=new Array(m);var x=1;for(n=0;n{"use strict";var n=r(21197),i=r(46121).templatedArray,o=r(53644);t.exports=i("image",{visible:{valType:"boolean",dflt:!0,editType:"arraydraw",description:["Determines whether or not this image is visible."].join(" ")},source:{valType:"string",editType:"arraydraw",description:["Specifies the URL of the image to be used.","The URL must be accessible from the domain where the","plot code is run, and can be either relative or absolute."].join(" ")},layer:{valType:"enumerated",values:["below","above"],dflt:"above",editType:"arraydraw",description:["Specifies whether images are drawn below or above traces.","When `xref` and `yref` are both set to `paper`,","image is drawn below the entire plot area."].join(" ")},sizex:{valType:"number",dflt:0,editType:"arraydraw",description:["Sets the image container size horizontally.","The image will be sized based on the `position` value.","When `xref` is set to `paper`, units are sized relative","to the plot width.","When `xref` ends with ` domain`, units are sized relative","to the axis width."].join(" ")},sizey:{valType:"number",dflt:0,editType:"arraydraw",description:["Sets the image container size vertically.","The image will be sized based on the `position` value.","When `yref` is set to `paper`, units are sized relative","to the plot height.","When `yref` ends with ` domain`, units are sized relative","to the axis height."].join(" ")},sizing:{valType:"enumerated",values:["fill","contain","stretch"],dflt:"contain",editType:"arraydraw",description:["Specifies which dimension of the image to constrain."].join(" ")},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw",description:"Sets the opacity of the image."},x:{valType:"any",dflt:0,editType:"arraydraw",description:["Sets the image's x position.","When `xref` is set to `paper`, units are sized relative","to the plot height.","See `xref` for more info"].join(" ")},y:{valType:"any",dflt:0,editType:"arraydraw",description:["Sets the image's y position.","When `yref` is set to `paper`, units are sized relative","to the plot height.","See `yref` for more info"].join(" ")},xanchor:{valType:"enumerated",values:["left","center","right"],dflt:"left",editType:"arraydraw",description:"Sets the anchor for the x position"},yanchor:{valType:"enumerated",values:["top","middle","bottom"],dflt:"top",editType:"arraydraw",description:"Sets the anchor for the y position."},xref:{valType:"enumerated",values:["paper",n.idRegex.x.toString()],dflt:"paper",editType:"arraydraw",description:["Sets the images's x coordinate axis.",o.axisRefDescription("x","left","right")].join(" ")},yref:{valType:"enumerated",values:["paper",n.idRegex.y.toString()],dflt:"paper",editType:"arraydraw",description:["Sets the images's y coordinate axis.",o.axisRefDescription("y","bottom","top")].join(" ")},editType:"arraydraw"})},22470:(t,e,r)=>{"use strict";var n=r(7370),i=r(61814);t.exports=function(t,e,r,o){e=e||{};var a="log"===r&&"linear"===e.type,s="linear"===r&&"log"===e.type;if(a||s)for(var l,c,u=t._fullLayout.images,h=e._id.charAt(0),d=0;d{"use strict";var n=r(12822),i=r(75815),o=r(35677),a=r(3653);function s(t,e,r){function o(r,i){return n.coerce(t,e,a,r,i)}var s=o("source");if(!o("visible",!!s))return e;o("layer"),o("xanchor"),o("yanchor"),o("sizex"),o("sizey"),o("sizing"),o("opacity");for(var l={_fullLayout:r},c=["x","y"],u=0;u<2;u++){var h=c[u],d=i.coerceRef(t,e,l,h,"paper",void 0);"paper"!==d&&i.getFromId(l,d)._imgIndices.push(e._index),i.coercePosition(e,l,o,d,h,0)}return e}t.exports=function(t,e){o(t,e,{name:"images",handleItemDefaults:s})}},87030:(t,e,r)=>{"use strict";var n=r(27941),i=r(40666),o=r(75815),a=r(99246),s=r(25853);t.exports=function(t){var e,r,l=t._fullLayout,c=[],u={},h=[];for(r=0;r{"use strict";t.exports={moduleType:"component",name:"images",layoutAttributes:r(3653),supplyLayoutDefaults:r(96658),includeBasePlot:r(39859)("images"),draw:r(87030),convertCoords:r(22470)}},15524:(t,e,r)=>{"use strict";var n=r(75058),i=r(84226);t.exports={_isSubplotObj:!0,visible:{valType:"boolean",dflt:!0,editType:"legend",description:["Determines whether or not this legend is visible."].join(" ")},bgcolor:{valType:"color",editType:"legend",description:["Sets the legend background color.","Defaults to `layout.paper_bgcolor`."].join(" ")},bordercolor:{valType:"color",dflt:i.defaultLine,editType:"legend",description:"Sets the color of the border enclosing the legend."},borderwidth:{valType:"number",min:0,dflt:0,editType:"legend",description:"Sets the width (in px) of the border enclosing the legend."},font:n({editType:"legend",description:"Sets the font used to text the legend items."}),grouptitlefont:n({editType:"legend",description:["Sets the font for group titles in legend.","Defaults to `legend.font` with its size increased about 10%."].join(" ")}),orientation:{valType:"enumerated",values:["v","h"],dflt:"v",editType:"legend",description:"Sets the orientation of the legend."},traceorder:{valType:"flaglist",flags:["reversed","grouped"],extras:["normal"],editType:"legend",description:["Determines the order at which the legend items are displayed.","If *normal*, the items are displayed top-to-bottom in the same","order as the input data.","If *reversed*, the items are displayed in the opposite order","as *normal*.","If *grouped*, the items are displayed in groups","(when a trace `legendgroup` is provided).","if *grouped+reversed*, the items are displayed in the opposite order","as *grouped*."].join(" ")},tracegroupgap:{valType:"number",min:0,dflt:10,editType:"legend",description:["Sets the amount of vertical space (in px) between legend groups."].join(" ")},entrywidth:{valType:"number",min:0,editType:"legend",description:["Sets the width (in px or fraction) of the legend.","Use 0 to size the entry based on the text width,","when `entrywidthmode` is set to *pixels*."].join(" ")},entrywidthmode:{valType:"enumerated",values:["fraction","pixels"],dflt:"pixels",editType:"legend",description:"Determines what entrywidth means."},indentation:{valType:"number",min:-15,dflt:0,editType:"legend",description:"Sets the indentation (in px) of the legend entries."},itemsizing:{valType:"enumerated",values:["trace","constant"],dflt:"trace",editType:"legend",description:["Determines if the legend items symbols scale with their corresponding *trace* attributes","or remain *constant* independent of the symbol size on the graph."].join(" ")},itemwidth:{valType:"number",min:30,dflt:30,editType:"legend",description:"Sets the width (in px) of the legend item symbols (the part other than the title.text)."},itemclick:{valType:"enumerated",values:["toggle","toggleothers",!1],dflt:"toggle",editType:"legend",description:["Determines the behavior on legend item click.","*toggle* toggles the visibility of the item clicked on the graph.","*toggleothers* makes the clicked item the sole visible item on the graph.","*false* disables legend item click interactions."].join(" ")},itemdoubleclick:{valType:"enumerated",values:["toggle","toggleothers",!1],dflt:"toggleothers",editType:"legend",description:["Determines the behavior on legend item double-click.","*toggle* toggles the visibility of the item clicked on the graph.","*toggleothers* makes the clicked item the sole visible item on the graph.","*false* disables legend item double-click interactions."].join(" ")},groupclick:{valType:"enumerated",values:["toggleitem","togglegroup"],dflt:"togglegroup",editType:"legend",description:["Determines the behavior on legend group item click.","*toggleitem* toggles the visibility of the individual item clicked on the graph.","*togglegroup* toggles the visibility of all items in the same legendgroup as the item clicked on the graph."].join(" ")},x:{valType:"number",editType:"legend",description:["Sets the x position with respect to `xref` (in normalized coordinates) of the legend.","When `xref` is *paper*, defaults to *1.02* for vertical legends and","defaults to *0* for horizontal legends.","When `xref` is *container*, defaults to *1* for vertical legends and","defaults to *0* for horizontal legends.","Must be between *0* and *1* if `xref` is *container*.","and between *-2* and *3* if `xref` is *paper*."].join(" ")},xref:{valType:"enumerated",dflt:"paper",values:["container","paper"],editType:"layoutstyle",description:["Sets the container `x` refers to.","*container* spans the entire `width` of the plot.","*paper* refers to the width of the plotting area only."].join(" ")},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"left",editType:"legend",description:["Sets the legend's horizontal position anchor.","This anchor binds the `x` position to the *left*, *center*","or *right* of the legend.","Value *auto* anchors legends to the right for `x` values greater than or equal to 2/3,","anchors legends to the left for `x` values less than or equal to 1/3 and","anchors legends with respect to their center otherwise."].join(" ")},y:{valType:"number",editType:"legend",description:["Sets the y position with respect to `yref` (in normalized coordinates) of the legend.","When `yref` is *paper*, defaults to *1* for vertical legends,","defaults to *-0.1* for horizontal legends on graphs w/o range sliders and","defaults to *1.1* for horizontal legends on graph with one or multiple range sliders.","When `yref` is *container*, defaults to *1*.","Must be between *0* and *1* if `yref` is *container*","and between *-2* and *3* if `yref` is *paper*."].join(" ")},yref:{valType:"enumerated",dflt:"paper",values:["container","paper"],editType:"layoutstyle",description:["Sets the container `y` refers to.","*container* spans the entire `height` of the plot.","*paper* refers to the height of the plotting area only."].join(" ")},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],editType:"legend",description:["Sets the legend's vertical position anchor","This anchor binds the `y` position to the *top*, *middle*","or *bottom* of the legend.","Value *auto* anchors legends at their bottom for `y` values less than or equal to 1/3,","anchors legends to at their top for `y` values greater than or equal to 2/3 and","anchors legends with respect to their middle otherwise."].join(" ")},uirevision:{valType:"any",editType:"none",description:["Controls persistence of legend-driven changes in trace and pie label","visibility. Defaults to `layout.uirevision`."].join(" ")},valign:{valType:"enumerated",values:["top","middle","bottom"],dflt:"middle",editType:"legend",description:["Sets the vertical alignment of the symbols with respect to their associated text."].join(" ")},title:{text:{valType:"string",dflt:"",editType:"legend",description:["Sets the title of the legend."].join(" ")},font:n({editType:"legend",description:["Sets this legend's title font.","Defaults to `legend.font` with its size increased about 20%."].join(" ")}),side:{valType:"enumerated",values:["top","left","top left","top center","top right"],editType:"legend",description:["Determines the location of legend's title","with respect to the legend items.","Defaulted to *top* with `orientation` is *h*.","Defaulted to *left* with `orientation` is *v*.","The *top left* options could be used to expand","top center and top right are for horizontal alignment","legend area in both x and y sides."].join(" ")},editType:"legend"},editType:"legend"}},4496:t=>{"use strict";t.exports={scrollBarWidth:6,scrollBarMinHeight:20,scrollBarColor:"#808BA4",scrollBarMargin:4,scrollBarEnterAttrs:{rx:20,ry:3,width:0,height:0},titlePad:2,itemGap:5}},64083:(t,e,r)=>{"use strict";var n=r(25059),i=r(12822),o=r(46121),a=r(3520),s=r(15524),l=r(13195),c=r(18804);function u(t,e,r,u){var h=e[t]||{},d=o.newContainer(r,t);function f(t,e){return i.coerce(h,d,s,t,e)}var p=i.coerceFont(f,"font",r.font);if(f("bgcolor",r.paper_bgcolor),f("bordercolor"),f("visible")){for(var m,g=function(t,e){var r=m._input,n=m;return i.coerce(r,n,a,t,e)},v=r.font||{},b=i.coerceFont(f,"grouptitlefont",v,{overrideDflt:{size:Math.round(1.1*v.size)}}),y=0,x=!1,_="normal",w=(r.shapes||[]).filter((function(t){return t.showlegend})),k=u.concat(w).filter((function(e){return t===(e.legend||"legend")})),A=0;A("legend"===t?1:0));if(!1===T&&(r[t]=void 0),(!1!==T||h.uirevision)&&(f("uirevision",r.uirevision),!1!==T)){f("borderwidth");var S,C,E,L="h"===f("orientation"),z="paper"===f("yref"),O="paper"===f("xref"),D="left";if(L?(S=0,n.getComponentMethod("rangeslider","isVisible")(e.xaxis)?z?(C=1.1,E="bottom"):(C=1,E="top"):z?(C=-.1,E="top"):(C=0,E="bottom")):(C=1,E="auto",O?S=1.02:(S=1,D="right")),i.coerce(h,d,{x:{valType:"number",editType:"legend",min:O?-2:0,max:O?3:1,dflt:S}},"x"),i.coerce(h,d,{y:{valType:"number",editType:"legend",min:z?-2:0,max:z?3:1,dflt:C}},"y"),f("traceorder",_),c.isGrouped(r[t])&&f("tracegroupgap"),f("entrywidth"),f("entrywidthmode"),f("indentation"),f("itemsizing"),f("itemwidth"),f("itemclick"),f("itemdoubleclick"),f("groupclick"),f("xanchor",D),f("yanchor",E),f("valign"),i.noneOrAll(h,d,["x","y"]),f("title.text")){f("title.side",L?"left":"top");var I=i.extendFlat({},p,{size:i.bigFont(p.size)});i.coerceFont(f,"title.font",I)}}}}t.exports=function(t,e,r){var n,o=r.slice(),a=e.shapes;if(a)for(n=0;n{"use strict";var n=r(27941),i=r(12822),o=r(51137),a=r(25059),s=r(16677),l=r(19846),c=r(40666),u=r(17499),h=r(80394),d=r(52656),f=r(4496),p=r(89701),m=p.LINE_SPACING,g=p.FROM_TL,v=p.FROM_BR,b=r(71988),y=r(26972),x=r(18804),_=/^legend[0-9]*$/;function w(t,e){var r,s,d=e||{},p=t._fullLayout,_=z(d),w=d._inHover;if(w?(s=d.layer,r="hover"):(s=p._infolayer,r=_),s){var T;if(r+=p._uid,t._legendMouseDownTime||(t._legendMouseDownTime=0),w){if(!d.entries)return;T=b(d.entries,d)}else{for(var O=(t.calcdata||[]).slice(),D=p.shapes,I=0;I1)}var P=p.hiddenlabels||[];if(!(w||p.showlegend&&T.length))return s.selectAll("."+_).remove(),p._topdefs.select("#"+r).remove(),o.autoMargin(t,_);var j=i.ensureSingle(s,"g",_,(function(t){w||t.attr("pointer-events","all")})),N=i.ensureSingleById(p._topdefs,"clipPath",r,(function(t){t.append("rect")})),B=i.ensureSingle(j,"rect","bg",(function(t){t.attr("shape-rendering","crispEdges")}));B.call(u.stroke,d.bordercolor).call(u.fill,d.bgcolor).style("stroke-width",d.borderwidth+"px");var U,G=i.ensureSingle(j,"g","scrollbox"),V=d.title;d._titleWidth=0,d._titleHeight=0,V.text?((U=i.ensureSingle(G,"text",_+"titletext")).attr("text-anchor","start").call(c.font,V.font).text(V.text),C(U,G,t,d,1)):G.selectAll("."+_+"titletext").remove();var H=i.ensureSingle(j,"rect","scrollbar",(function(t){t.attr(f.scrollBarEnterAttrs).call(u.fill,f.scrollBarColor)})),W=G.selectAll("g.groups").data(T);W.enter().append("g").attr("class","groups"),W.exit().remove();var q=W.selectAll("g.traces").data(i.identity);q.enter().append("g").attr("class","traces"),q.exit().remove(),q.style("opacity",(function(t){var e=t[0].trace;return a.traceIs(e,"pie-like")?-1!==P.indexOf(t[0].label)?.5:1:"legendonly"===e.visible?.5:1})).each((function(){n.select(this).call(M,t,d)})).call(y,t,d).each((function(){w||n.select(this).call(S,t,_)})),i.syncOrAsync([o.previousPromises,function(){return function(t,e,r,i){var o=t._fullLayout,a=z(i);i||(i=o[a]);var s=o._size,l=x.isVertical(i),u=x.isGrouped(i),h="fraction"===i.entrywidthmode,d=i.borderwidth,p=2*d,m=f.itemGap,g=i.indentation+i.itemwidth+2*m,v=2*(d+m),b=L(i),y=i.y<0||0===i.y&&"top"===b,_=i.y>1||1===i.y&&"bottom"===b,w=i.tracegroupgap,A={};i._maxHeight=Math.max(y||_?o.height/2:s.h,30);var M=0;i._width=0,i._height=0;var T=function(t){var e=0,r=0,n=t.title.side;return n&&(-1!==n.indexOf("left")&&(e=t._titleWidth),-1!==n.indexOf("top")&&(r=t._titleHeight)),[e,r]}(i);if(l)r.each((function(t){var e=t[0].height;c.setTranslate(this,d+T[0],d+T[1]+i._height+e/2+m),i._height+=e,i._width=Math.max(i._width,t[0].width)})),M=g+i._width,i._width+=m+g+p,i._height+=v,u&&(e.each((function(t,e){c.setTranslate(this,0,e*i.tracegroupgap)})),i._height+=(i._lgroupsLength-1)*i.tracegroupgap);else{var S=E(i),C=i.x<0||0===i.x&&"right"===S,O=i.x>1||1===i.x&&"left"===S,D=_||y,I=o.width/2;i._maxWidth=Math.max(C?D&&"left"===S?s.l+s.w:I:O?D&&"right"===S?s.r+s.w:I:s.w,2*g);var F=0,R=0;r.each((function(t){var e=k(t,i,g);F=Math.max(F,e),R+=e})),M=null;var P=0;if(u){var j=0,N=0,B=0;e.each((function(){var t=0,e=0;n.select(this).selectAll("g.traces").each((function(r){var n=k(r,i,g),o=r[0].height;c.setTranslate(this,T[0],T[1]+d+m+o/2+e),e+=o,t=Math.max(t,n),A[r[0].trace.legendgroup]=t}));var r=t+m;N>0&&r+d+N>i._maxWidth?(P=Math.max(P,N),N=0,B+=j+w,j=e):j=Math.max(j,e),c.setTranslate(this,N,B),N+=r})),i._width=Math.max(P,N)+d,i._height=B+j+v}else{var U=r.size(),G=R+p+(U-1)*m=i._maxWidth&&(P=Math.max(P,q),H=0,W+=V,i._height+=V,V=0),c.setTranslate(this,T[0]+d+H,T[1]+d+W+e/2+m),q=H+r+m,H+=n,V=Math.max(V,e)})),G?(i._width=H+p,i._height=V+v):(i._width=Math.max(P,q)+p,i._height+=V+v)}}i._width=Math.ceil(Math.max(i._width+T[0],i._titleWidth+2*(d+f.titlePad))),i._height=Math.ceil(Math.max(i._height+T[1],i._titleHeight+2*(d+f.itemGap))),i._effHeight=Math.min(i._height,i._maxHeight);var Y=t._context.edits,Z=Y.legendText||Y.legendPosition;r.each((function(t){var e=n.select(this).select("."+a+"toggle"),r=t[0].height,o=t[0].trace.legendgroup,s=k(t,i,g);u&&""!==o&&(s=A[o]);var d=Z?g:M||s;l||h||(d+=m/2),c.setRect(e,0,-r/2,d,r)}))}(t,W,q,d)},function(){var e,u,b,y,x=p._size,k=d.borderwidth,M="paper"===d.xref,T="paper"===d.yref;if(V.text&&function(t,e,r){if("top center"===e.title.side||"top right"===e.title.side){var n=e.title.font.size*m,i=0,o=t.node(),a=c.bBox(o).width;"top center"===e.title.side?i=.5*(e._width-2*r-2*f.titlePad-a):"top right"===e.title.side&&(i=e._width-2*r-2*f.titlePad-a),h.positionText(t,r+f.titlePad+i,r+n)}}(U,d,k),!w){var S,C;S=M?x.l+x.w*d.x-g[E(d)]*d._width:p.width*d.x-g[E(d)]*d._width,C=T?x.t+x.h*(1-d.y)-g[L(d)]*d._effHeight:p.height*(1-d.y)-g[L(d)]*d._effHeight;var z=function(t,e,r,n){var i=t._fullLayout,a=i[e],s=E(a),l=L(a),c="paper"===a.xref,u="paper"===a.yref;t._fullLayout._reservedMargin[e]={};var h=a.y<.5?"b":"t",d=a.x<.5?"l":"r",f={r:i.width-r,l:r+a._width,b:i.height-n,t:n+a._effHeight};if(c&&u)return o.autoMargin(t,e,{x:a.x,y:a.y,l:a._width*g[s],r:a._width*v[s],b:a._effHeight*v[l],t:a._effHeight*g[l]});c?t._fullLayout._reservedMargin[e][h]=f[h]:u||"v"===a.orientation?t._fullLayout._reservedMargin[e][d]=f[d]:t._fullLayout._reservedMargin[e][h]=f[h]}(t,_,S,C);if(z)return;if(p.margin.autoexpand){var O=S,D=C;S=M?i.constrain(S,0,p.width-d._width):O,C=T?i.constrain(C,0,p.height-d._effHeight):D,S!==O&&i.log("Constrain "+_+".x to make legend fit inside graph"),C!==D&&i.log("Constrain "+_+".y to make legend fit inside graph")}c.setTranslate(j,S,C)}if(H.on(".drag",null),j.on("wheel",null),w||d._height<=d._maxHeight||t._context.staticPlot){var I=d._effHeight;w&&(I=d._height),B.attr({width:d._width-k,height:I-k,x:k/2,y:k/2}),c.setTranslate(G,0,0),N.select("rect").attr({width:d._width-2*k,height:I-2*k,x:k,y:k}),c.setClipUrl(G,r,t),c.setRect(H,0,0,0,0),delete d._scrollY}else{var F,R,P,W=Math.max(f.scrollBarMinHeight,d._effHeight*d._effHeight/d._height),q=d._effHeight-W-2*f.scrollBarMargin,Y=d._height-d._effHeight,Z=q/Y,X=Math.min(d._scrollY||0,Y);B.attr({width:d._width-2*k+f.scrollBarWidth+f.scrollBarMargin,height:d._effHeight-k,x:k/2,y:k/2}),N.select("rect").attr({width:d._width-2*k+f.scrollBarWidth+f.scrollBarMargin,height:d._effHeight-2*k,x:k,y:k+X}),c.setClipUrl(G,r,t),K(X,W,Z),j.on("wheel",(function(){K(X=i.constrain(d._scrollY+n.event.deltaY/q*Y,0,Y),W,Z),0!==X&&X!==Y&&n.event.preventDefault()}));var $=n.behavior.drag().on("dragstart",(function(){var t=n.event.sourceEvent;F="touchstart"===t.type?t.changedTouches[0].clientY:t.clientY,P=X})).on("drag",(function(){var t=n.event.sourceEvent;2===t.buttons||t.ctrlKey||(R="touchmove"===t.type?t.changedTouches[0].clientY:t.clientY,X=function(t,e,r){var n=(r-e)/Z+t;return i.constrain(n,0,Y)}(P,F,R),K(X,W,Z))}));H.call($);var J=n.behavior.drag().on("dragstart",(function(){var t=n.event.sourceEvent;"touchstart"===t.type&&(F=t.changedTouches[0].clientY,P=X)})).on("drag",(function(){var t=n.event.sourceEvent;"touchmove"===t.type&&(R=t.changedTouches[0].clientY,X=function(t,e,r){var n=(e-r)/Z+t;return i.constrain(n,0,Y)}(P,F,R),K(X,W,Z))}));G.call(J)}function K(e,r,n){d._scrollY=t._fullLayout[_]._scrollY=e,c.setTranslate(G,0,-e),c.setRect(H,d._width,f.scrollBarMargin+e*n,f.scrollBarWidth,r),N.select("rect").attr("y",k+e)}t._context.edits.legendPosition&&(j.classed("cursor-move",!0),l.init({element:j.node(),gd:t,prepFn:function(t){if(t.target!==H.node()){var e=c.getTranslate(j);b=e.x,y=e.y}},moveFn:function(t,r){if(void 0!==b&&void 0!==y){var n=b+t,i=y+r;c.setTranslate(j,n,i),e=l.align(n,d._width,x.l,x.l+x.w,d.xanchor),u=l.align(i+d._height,-d._height,x.t+x.h,x.t,d.yanchor)}},doneFn:function(){if(void 0!==e&&void 0!==u){var r={};r[_+".x"]=e,r[_+".y"]=u,a.call("_guiRelayout",t,r)}},clickFn:function(e,r){var n=s.selectAll("g.traces").filter((function(){var t=this.getBoundingClientRect();return r.clientX>=t.left&&r.clientX<=t.right&&r.clientY>=t.top&&r.clientY<=t.bottom}));n.size()>0&&A(t,j,n,e,r)}}))}],t)}}function k(t,e,r){var n=t[0],i=n.width,o=e.entrywidthmode,a=n.trace.legendwidth||e.entrywidth;return"fraction"===o?e._maxWidth*a:r+(a||i)}function A(t,e,r,n,i){var o=r.data()[0][0].trace,l={event:i,node:r.node(),curveNumber:o.index,expandedIndex:o._expandedIndex,data:t.data,layout:t.layout,frames:t._transitionData._frames,config:t._context,fullData:t._fullData,fullLayout:t._fullLayout};o._group&&(l.group=o._group),a.traceIs(o,"pie-like")&&(l.label=r.datum()[0].label);var c=s.triggerHandler(t,"plotly_legendclick",l);if(1===n){if(!1===c)return;e._clickTimeout=setTimeout((function(){t._fullLayout&&d(r,t,n)}),t._context.doubleClickDelay)}else 2===n&&(e._clickTimeout&&clearTimeout(e._clickTimeout),t._legendMouseDownTime=0,!1!==s.triggerHandler(t,"plotly_legenddoubleclick",l)&&!1!==c&&d(r,t,n))}function M(t,e,r){var n,o,s=z(r),l=t.data()[0][0],u=l.trace,d=a.traceIs(u,"pie-like"),p=!r._inHover&&e._context.edits.legendText&&!d,m=r._maxNameLength;l.groupTitle?(n=l.groupTitle.text,o=l.groupTitle.font):(o=r.font,r.entries?n=l.text:(n=d?l.label:u.name,u._meta&&(n=i.templateString(n,u._meta))));var g=i.ensureSingle(t,"text",s+"text");g.attr("text-anchor","start").call(c.font,o).text(p?T(n,m):n);var v=r.indentation+r.itemwidth+2*f.itemGap;h.positionText(g,v,0),p?g.call(h.makeEditable,{gd:e,text:n}).call(C,t,e,r).on("edit",(function(n){this.text(T(n,m)).call(C,t,e,r);var o=l.trace._fullInput||{},s={};if(a.hasTransform(o,"groupby")){var c=a.getTransformIndices(o,"groupby"),h=c[c.length-1],d=i.keyedContainer(o,"transforms["+h+"].styles","target","value.name");d.set(l.trace._group,n),s=d.constructUpdate()}else s.name=n;return o._isShape?a.call("_guiRelayout",e,"shapes["+u.index+"].name",s.name):a.call("_guiRestyle",e,s,u.index)})):C(g,t,e,r)}function T(t,e){var r=Math.max(4,e);if(t&&t.trim().length>=r/2)return t;for(var n=r-(t=t||"").length;n>0;n--)t+=" ";return t}function S(t,e,r){var o,a=e._context.doubleClickDelay,s=1,l=i.ensureSingle(t,"rect",r+"toggle",(function(t){e._context.staticPlot||t.style("cursor","pointer").attr("pointer-events","all"),t.call(u.fill,"rgba(0,0,0,0)")}));e._context.staticPlot||(l.on("mousedown",(function(){(o=(new Date).getTime())-e._legendMouseDownTimea&&(s=Math.max(s-1,1)),A(e,i,t,s,n.event)}})))}function C(t,e,r,n,i){n._inHover&&t.attr("data-notex",!0),h.convertToTspans(t,r,(function(){!function(t,e,r,n){var i=t.data()[0][0];if(r._inHover||!i||i.trace.showlegend){var o=t.select("g[class*=math-group]"),a=o.node(),s=z(r);r||(r=e._fullLayout[s]);var l,u,d=r.borderwidth,p=(1===n?r.title.font:i.groupTitle?i.groupTitle.font:r.font).size*m;if(a){var g=c.bBox(a);l=g.height,u=g.width,1===n?c.setTranslate(o,d,d+.75*l):c.setTranslate(o,0,.25*l)}else{var v="."+s+(1===n?"title":"")+"text",b=t.select(v),y=h.lineCount(b),x=b.node();if(l=p*y,u=x?c.bBox(x).width:0,1===n)"left"===r.title.side&&(u+=2*f.itemGap),h.positionText(b,d+f.titlePad,d+p);else{var _=2*f.itemGap+r.indentation+r.itemwidth;i.groupTitle&&(_=f.itemGap,u-=r.indentation+r.itemwidth),h.positionText(b,_,-p*((y-1)/2-.3))}}1===n?(r._titleWidth=u,r._titleHeight=l):(i.lineHeight=p,i.height=Math.max(l,16)+3,i.width=u)}else t.remove()}(e,r,n,i)}))}function E(t){return i.isRightAnchor(t)?"right":i.isCenterAnchor(t)?"center":"left"}function L(t){return i.isBottomAnchor(t)?"bottom":i.isMiddleAnchor(t)?"middle":"top"}function z(t){return t._id||"legend"}t.exports=function(t,e){if(e)w(t,e);else{var r=t._fullLayout,i=r._legends;r._infolayer.selectAll('[class^="legend"]').each((function(){var t=n.select(this),e=t.attr("class").split(" ")[0];e.match(_)&&-1===i.indexOf(e)&&t.remove()}));for(var o=0;o{"use strict";var n=r(25059),i=r(18804);t.exports=function(t,e,r){var o,a,s=e._inHover,l=i.isGrouped(e),c=i.isReversed(e),u={},h=[],d=!1,f={},p=0,m=0;function g(t,n,o){if(!1!==e.visible&&(!r||t===e._id))if(""!==n&&i.isGrouped(e))-1===h.indexOf(n)?(h.push(n),d=!0,u[n]=[o]):u[n].push(o);else{var a="~~i"+p;h.push(a),u[a]=[o],p++}}for(o=0;oS&&(T=S)}A[o][0]._groupMinRank=T,A[o][0]._preGroupSort=o}var C=function(t,e){return t.trace.legendrank-e.trace.legendrank||t._preSort-e._preSort};for(A.forEach((function(t,e){t[0]._preGroupSort=e})),A.sort((function(t,e){return t[0]._groupMinRank-e[0]._groupMinRank||t[0]._preGroupSort-e[0]._preGroupSort})),o=0;o{"use strict";var n=r(25059),i=r(12822),o=i.pushUnique,a=!0;t.exports=function(t,e,r){var s=e._fullLayout;if(!e._dragged&&!e._editing){var l,c=s.legend.itemclick,u=s.legend.itemdoubleclick,h=s.legend.groupclick;if(1===r&&"toggle"===c&&"toggleothers"===u&&a&&e.data&&e._context.showTips?(i.notifier(i._(e,"Double-click on legend to isolate one trace"),"long"),a=!1):a=!1,1===r?l=c:2===r&&(l=u),l){var d="togglegroup"===h,f=s.hiddenlabels?s.hiddenlabels.slice():[],p=t.data()[0][0];if(!p.groupTitle||!p.noClick){var m=e._fullData,g=(s.shapes||[]).filter((function(t){return t.showlegend})),v=m.concat(g),b=p.trace;b._isShape&&(b=b._fullInput);var y,x,_,w,k,A=b.legendgroup,M={},T=[],S=[],C=[],E=(s.shapes||[]).map((function(t){return t._input})),L=!1,z=b.legend,O=b._fullInput;if(O&&O._isShape||!n.traceIs(b,"pie-like")){var D,I=A&&A.length,F=[];if(I)for(y=0;y{"use strict";e.isGrouped=function(t){return-1!==(t.traceorder||"").indexOf("grouped")},e.isVertical=function(t){return"h"!==t.orientation},e.isReversed=function(t){return-1!==(t.traceorder||"").indexOf("reversed")}},97833:(t,e,r)=>{"use strict";t.exports={moduleType:"component",name:"legend",layoutAttributes:r(15524),supplyLayoutDefaults:r(64083),draw:r(67739),style:r(26972)}},26972:(t,e,r)=>{"use strict";var n=r(27941),i=r(25059),o=r(12822),a=o.strTranslate,s=r(40666),l=r(17499),c=r(42226).extractOpts,u=r(677),h=r(62970),d=r(17269).castOption,f=r(4496);function p(t,e){return(e?"radial":"horizontal")+(t?"":"reversed")}function m(t){var e=t[0].trace,r=e.contours,n=u.hasLines(e),i=u.hasMarkers(e),o=e.visible&&e.fill&&"none"!==e.fill,a=!1,s=!1;if(r){var l=r.coloring;"lines"===l?a=!0:n="none"===l||"heatmap"===l||r.showlines,"constraint"===r.type?o="="!==r._operation:"fill"!==l&&"heatmap"!==l||(s=!0)}return{showMarker:i,showLine:n,showFill:o,showGradientLine:a,showGradientFill:s,anyLine:n||a,anyFill:o||s}}function g(t,e,r){return t&&o.isArrayOrTypedArray(t)?e:t>r?r:t}t.exports=function(t,e,r){var v=e._fullLayout;r||(r=v.legend);var b="constant"===r.itemsizing,y=r.itemwidth,x=(y+2*f.itemGap)/2,_=a(x,0),w=function(t,e,r,n){var i;if(t+1)i=t;else{if(!(e&&e.width>0))return 0;i=e.width}return b?n:Math.min(i,r)};function k(t,o,a){var u=t[0].trace,h=u.marker||{},d=h.line||{},f=h.cornerradius?"M6,3a3,3,0,0,1-3,3H-3a3,3,0,0,1-3-3V-3a3,3,0,0,1,3-3H3a3,3,0,0,1,3,3Z":"M6,6H-6V-6H6Z",p=a?u.visible&&u.type===a:i.traceIs(u,"bar"),m=n.select(o).select("g.legendpoints").selectAll("path.legend"+a).data(p?[t]:[]);m.enter().append("path").classed("legend"+a,!0).attr("d",f).attr("transform",_),m.exit().remove(),m.each((function(t){var i=n.select(this),o=t[0],a=w(o.mlw,h.line,5,2);i.style("stroke-width",a+"px");var f=o.mcc;if(!r._inHover&&"mc"in o){var p=c(h),m=p.mid;void 0===m&&(m=(p.max+p.min)/2),f=s.tryColorscale(h,"")(m)}var v=f||o.mc||h.color,b=h.pattern,y=b&&s.getPatternAttr(b.shape,0,"");if(y){var x=s.getPatternAttr(b.bgcolor,0,null),_=s.getPatternAttr(b.fgcolor,0,null),k=b.fgopacity,A=g(b.size,8,10),M=g(b.solidity,.5,1),T="legend-"+u.uid;i.call(s.pattern,"legend",e,T,y,A,M,f,b.fillmode,x,_,k)}else i.call(l.fill,v);a&&l.stroke(i,o.mlc||d.color)}))}function A(t,r,a){var s=t[0],l=s.trace,c=a?l.visible&&l.type===a:i.traceIs(l,a),u=n.select(r).select("g.legendpoints").selectAll("path.legend"+a).data(c?[t]:[]);if(u.enter().append("path").classed("legend"+a,!0).attr("d","M6,6H-6V-6H6Z").attr("transform",_),u.exit().remove(),u.size()){var f=l.marker||{},p=w(d(f.line.width,s.pts),f.line,5,2),m="pieLike",g=o.minExtend(l,{marker:{line:{width:p}}},m),v=o.minExtend(s,{trace:g},m);h(u,v,g,e)}}t.each((function(t){var e=n.select(this),i=o.ensureSingle(e,"g","layers");i.style("opacity",t[0].trace.opacity);var s=r.indentation,l=r.valign,c=t[0].lineHeight,u=t[0].height;if("middle"===l&&0===s||!c||!u)i.attr("transform",null);else{var h={top:1,bottom:-1}[l]*(.5*(c-u+3))||0,d=r.indentation;i.attr("transform",a(d,h))}i.selectAll("g.legendfill").data([t]).enter().append("g").classed("legendfill",!0),i.selectAll("g.legendlines").data([t]).enter().append("g").classed("legendlines",!0);var f=i.selectAll("g.legendsymbols").data([t]);f.enter().append("g").classed("legendsymbols",!0),f.selectAll("g.legendpoints").data([t]).enter().append("g").classed("legendpoints",!0)})).each((function(t){var r,i=t[0].trace,a=[];if(i.visible)switch(i.type){case"histogram2d":case"heatmap":a=[["M-15,-2V4H15V-2Z"]],r=!0;break;case"choropleth":case"choroplethmapbox":case"choroplethmap":a=[["M-6,-6V6H6V-6Z"]],r=!0;break;case"densitymapbox":case"densitymap":a=[["M-6,0 a6,6 0 1,0 12,0 a 6,6 0 1,0 -12,0"]],r="radial";break;case"cone":a=[["M-6,2 A2,2 0 0,0 -6,6 V6L6,4Z"],["M-6,-6 A2,2 0 0,0 -6,-2 L6,-4Z"],["M-6,-2 A2,2 0 0,0 -6,2 L6,0Z"]],r=!1;break;case"streamtube":a=[["M-6,2 A2,2 0 0,0 -6,6 H6 A2,2 0 0,1 6,2 Z"],["M-6,-6 A2,2 0 0,0 -6,-2 H6 A2,2 0 0,1 6,-6 Z"],["M-6,-2 A2,2 0 0,0 -6,2 H6 A2,2 0 0,1 6,-2 Z"]],r=!1;break;case"surface":a=[["M-6,-6 A2,3 0 0,0 -6,0 H6 A2,3 0 0,1 6,-6 Z"],["M-6,1 A2,3 0 0,1 -6,6 H6 A2,3 0 0,0 6,0 Z"]],r=!0;break;case"mesh3d":a=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],r=!1;break;case"volume":a=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],r=!0;break;case"isosurface":a=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6 A12,24 0 0,0 6,-6 L0,6Z"]],r=!1}var u=n.select(this).select("g.legendpoints").selectAll("path.legend3dandfriends").data(a);u.enter().append("path").classed("legend3dandfriends",!0).attr("transform",_).style("stroke-miterlimit",1),u.exit().remove(),u.each((function(t,a){var u,h=n.select(this),d=c(i),f=d.colorscale,m=d.reversescale;if(f){if(!r){var g=f.length;u=0===a?f[m?g-1:0][1]:1===a?f[m?0:g-1][1]:f[Math.floor((g-1)/2)][1]}}else{var v=i.vertexcolor||i.facecolor||i.color;u=o.isArrayOrTypedArray(v)?v[a]||v[0]:v}h.attr("d",t[0]),u?h.call(l.fill,u):h.call((function(t){if(t.size()){var n="legendfill-"+i.uid;s.gradient(t,e,n,p(m,"radial"===r),f,"fill")}}))}))})).each((function(t){var e=t[0].trace,r="waterfall"===e.type;if(t[0]._distinct&&r){var i=t[0].trace[t[0].dir].marker;return t[0].mc=i.color,t[0].mlw=i.line.width,t[0].mlc=i.line.color,k(t,this,"waterfall")}var o=[];e.visible&&r&&(o=t[0].hasTotals?[["increasing","M-6,-6V6H0Z"],["totals","M6,6H0L-6,-6H-0Z"],["decreasing","M6,6V-6H0Z"]]:[["increasing","M-6,-6V6H6Z"],["decreasing","M6,6V-6H-6Z"]]);var a=n.select(this).select("g.legendpoints").selectAll("path.legendwaterfall").data(o);a.enter().append("path").classed("legendwaterfall",!0).attr("transform",_).style("stroke-miterlimit",1),a.exit().remove(),a.each((function(t){var r=n.select(this),i=e[t[0]].marker,o=w(void 0,i.line,5,2);r.attr("d",t[1]).style("stroke-width",o+"px").call(l.fill,i.color),o&&r.call(l.stroke,i.line.color)}))})).each((function(t){k(t,this,"funnel")})).each((function(t){k(t,this)})).each((function(t){var r=t[0].trace,a=n.select(this).select("g.legendpoints").selectAll("path.legendbox").data(r.visible&&i.traceIs(r,"box-violin")?[t]:[]);a.enter().append("path").classed("legendbox",!0).attr("d","M6,6H-6V-6H6Z").attr("transform",_),a.exit().remove(),a.each((function(){var t=n.select(this);if("all"!==r.boxpoints&&"all"!==r.points||0!==l.opacity(r.fillcolor)||0!==l.opacity((r.line||{}).color)){var i=w(void 0,r.line,5,2);t.style("stroke-width",i+"px").call(l.fill,r.fillcolor),i&&l.stroke(t,r.line.color)}else{var c=o.minExtend(r,{marker:{size:b?12:o.constrain(r.marker.size,2,16),sizeref:1,sizemin:1,sizemode:"diameter"}});a.call(s.pointStyle,c,e)}}))})).each((function(t){A(t,this,"funnelarea")})).each((function(t){A(t,this,"pie")})).each((function(t){var r,i,a=m(t),l=a.showFill,h=a.showLine,d=a.showGradientLine,f=a.showGradientFill,g=a.anyFill,v=a.anyLine,b=t[0],x=b.trace,_=c(x),k=_.colorscale,A=_.reversescale,M=u.hasMarkers(x)||!g?"M5,0":v?"M5,-2":"M5,-3",T=n.select(this),S=T.select(".legendfill").selectAll("path").data(l||f?[t]:[]);if(S.enter().append("path").classed("js-fill",!0),S.exit().remove(),S.attr("d",M+"h"+y+"v6h-"+y+"z").call((function(t){if(t.size())if(l)s.fillGroupStyle(t,e,!0);else{var r="legendfill-"+x.uid;s.gradient(t,e,r,p(A),k,"fill")}})),h||d){var C=w(void 0,x.line,10,5);i=o.minExtend(x,{line:{width:C}}),r=[o.minExtend(b,{trace:i})]}var E=T.select(".legendlines").selectAll("path").data(h||d?[r]:[]);E.enter().append("path").classed("js-line",!0),E.exit().remove(),E.attr("d",M+(d?"l"+y+",0.0001":"h"+y)).call(h?s.lineGroupStyle:function(t){if(t.size()){var r="legendline-"+x.uid;s.lineGroupStyle(t),s.gradient(t,e,r,p(A),k,"stroke")}})})).each((function(t){var r,i,a=m(t),l=a.anyFill,c=a.anyLine,h=a.showLine,d=a.showMarker,f=t[0],p=f.trace,g=!d&&!c&&!l&&u.hasText(p);function v(t,e,r,n){var i=o.nestedProperty(p,t).get(),a=o.isArrayOrTypedArray(i)&&e?e(i):i;if(b&&a&&void 0!==n&&(a=n),r){if(ar[1])return r[1]}return a}function y(t){return f._distinct&&f.index&&t[f.index]?t[f.index]:t[0]}if(d||g||h){var x={},w={};if(d){x.mc=v("marker.color",y),x.mx=v("marker.symbol",y),x.mo=v("marker.opacity",o.mean,[.2,1]),x.mlc=v("marker.line.color",y),x.mlw=v("marker.line.width",o.mean,[0,5],2),w.marker={sizeref:1,sizemin:1,sizemode:"diameter"};var k=v("marker.size",o.mean,[2,16],12);x.ms=k,w.marker.size=k}h&&(w.line={width:v("line.width",y,[0,10],5)}),g&&(x.tx="Aa",x.tp=v("textposition",y),x.ts=10,x.tc=v("textfont.color",y),x.tf=v("textfont.family",y),x.tw=v("textfont.weight",y),x.ty=v("textfont.style",y),x.tv=v("textfont.variant",y),x.tC=v("textfont.textcase",y),x.tE=v("textfont.lineposition",y),x.tS=v("textfont.shadow",y)),r=[o.minExtend(f,x)],(i=o.minExtend(p,w)).selectedpoints=null,i.texttemplate=null}var A=n.select(this).select("g.legendpoints"),M=A.selectAll("path.scatterpts").data(d?r:[]);M.enter().insert("path",":first-child").classed("scatterpts",!0).attr("transform",_),M.exit().remove(),M.call(s.pointStyle,i,e),d&&(r[0].mrc=3);var T=A.selectAll("g.pointtext").data(g?r:[]);T.enter().append("g").classed("pointtext",!0).append("text").attr("transform",_),T.exit().remove(),T.selectAll("text").call(s.textPointStyle,i,e)})).each((function(t){var e=t[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendcandle").data(e.visible&&"candlestick"===e.type?[t,t]:[]);r.enter().append("path").classed("legendcandle",!0).attr("d",(function(t,e){return e?"M-15,0H-8M-8,6V-6H8Z":"M15,0H8M8,-6V6H-8Z"})).attr("transform",_).style("stroke-miterlimit",1),r.exit().remove(),r.each((function(t,r){var i=n.select(this),o=e[r?"increasing":"decreasing"],a=w(void 0,o.line,5,2);i.style("stroke-width",a+"px").call(l.fill,o.fillcolor),a&&l.stroke(i,o.line.color)}))})).each((function(t){var e=t[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendohlc").data(e.visible&&"ohlc"===e.type?[t,t]:[]);r.enter().append("path").classed("legendohlc",!0).attr("d",(function(t,e){return e?"M-15,0H0M-8,-6V0":"M15,0H0M8,6V0"})).attr("transform",_).style("stroke-miterlimit",1),r.exit().remove(),r.each((function(t,r){var i=n.select(this),o=e[r?"increasing":"decreasing"],a=w(void 0,o.line,5,2);i.style("fill","none").call(s.dashLine,o.line.dash,a),a&&l.stroke(i,o.line.color)}))}))}},62799:(t,e,r)=>{"use strict";var n=r(7113);t.exports={editType:"modebar",orientation:{valType:"enumerated",values:["v","h"],dflt:"h",editType:"modebar",description:"Sets the orientation of the modebar."},bgcolor:{valType:"color",editType:"modebar",description:"Sets the background color of the modebar."},color:{valType:"color",editType:"modebar",description:"Sets the color of the icons in the modebar."},activecolor:{valType:"color",editType:"modebar",description:"Sets the color of the active or hovered on icons in the modebar."},uirevision:{valType:"any",editType:"none",description:["Controls persistence of user-driven changes related to the modebar,","including `hovermode`, `dragmode`, and `showspikes` at both the","root level and inside subplots. Defaults to `layout.uirevision`."].join(" ")},add:{valType:"string",arrayOk:!0,dflt:"",editType:"modebar",description:["Determines which predefined modebar buttons to add.","Please note that these buttons will only be shown if they are","compatible with all trace types used in a graph.","Similar to `config.modeBarButtonsToAdd` option.","This may include *"+n.backButtons.join("*, *")+"*."].join(" ")},remove:{valType:"string",arrayOk:!0,dflt:"",editType:"modebar",description:["Determines which predefined modebar buttons to remove.","Similar to `config.modeBarButtonsToRemove` option.","This may include *"+n.foreButtons.join("*, *")+"*."].join(" ")}}},47685:(t,e,r)=>{"use strict";var n=r(25059),i=r(51137),o=r(99246),a=r(50917),s=r(71422).eraseActiveShape,l=r(12822),c=l._,u=t.exports={};function h(t,e){var r,i,a=e.currentTarget,s=a.getAttribute("data-attr"),l=a.getAttribute("data-val")||!0,c=t._fullLayout,u={},h=o.list(t,null,!0),d=c._cartesianSpikesEnabled;if("zoom"===s){var f,p="in"===l?.5:2,m=(1+p)/2,g=(1-p)/2;for(i=0;i{"use strict";var n=r(47685),i=Object.keys(n),o=["drawline","drawopenpath","drawclosedpath","drawcircle","drawrect","eraseshape"],a=["v1hovermode","hoverclosest","hovercompare","togglehover","togglespikelines"].concat(o),s=[];i.forEach((function(t){!function(t){if(-1===a.indexOf(t._cat||t.name)){var e=t.name,r=(t._cat||t.name).toLowerCase();-1===s.indexOf(e)&&s.push(e),-1===s.indexOf(r)&&s.push(r)}}(n[t])})),s.sort(),t.exports={DRAW_MODES:o,backButtons:a,foreButtons:s}},90120:(t,e,r)=>{"use strict";var n=r(12822),i=r(17499),o=r(46121),a=r(62799);t.exports=function(t,e){var r=t.modebar||{},s=o.newContainer(e,"modebar");function l(t,e){return n.coerce(r,s,a,t,e)}l("orientation"),l("bgcolor",i.addOpacity(e.paper_bgcolor,.5));var c=i.contrast(i.rgb(e.modebar.bgcolor));l("color",i.addOpacity(c,.3)),l("activecolor",i.addOpacity(c,.7)),l("uirevision",e.uirevision),l("add"),l("remove")}},45828:(t,e,r)=>{"use strict";t.exports={moduleType:"component",name:"modebar",layoutAttributes:r(62799),supplyLayoutDefaults:r(90120),manage:r(83493)}},83493:(t,e,r)=>{"use strict";var n=r(99246),i=r(677),o=r(25059),a=r(66811).isUnifiedHover,s=r(27756),l=r(47685),c=r(7113).DRAW_MODES,u=r(12822).extendDeep;t.exports=function(t){var e=t._fullLayout,r=t._context,h=e._modeBar;if(r.displayModeBar||r.watermark){if(!Array.isArray(r.modeBarButtonsToRemove))throw new Error(["*modeBarButtonsToRemove* configuration options","must be an array."].join(" "));if(!Array.isArray(r.modeBarButtonsToAdd))throw new Error(["*modeBarButtonsToAdd* configuration options","must be an array."].join(" "));var d,f=r.modeBarButtons;d=Array.isArray(f)&&f.length?function(t){for(var e=u([],t),r=0;r1?(D=["toggleHover"],I=["resetViews"]):v?(O=["zoomInGeo","zoomOutGeo"],D=["hoverClosestGeo"],I=["resetGeo"]):g?(D=["hoverClosest3d"],I=["resetCameraDefault3d","resetCameraLastSave3d"]):w?(O=["zoomInMapbox","zoomOutMapbox"],D=["toggleHover"],I=["resetViewMapbox"]):k?(O=["zoomInMap","zoomOutMap"],D=["toggleHover"],I=["resetViewMap"]):x?D=["hoverClosestGl2d"]:b?D=["hoverClosestPie"]:T?(D=["hoverClosestCartesian","hoverCompareCartesian"],I=["resetViewSankey"]):D=["toggleHover"],m&&D.push("toggleSpikelines","hoverClosestCartesian","hoverCompareCartesian"),(function(t){for(var e=0;e{"use strict";var n=r(27941),i=r(7370),o=r(12822),a=r(50917),s=r(88566).version,l=new DOMParser;function c(t){this.container=t.container,this.element=document.createElement("div"),this.update(t.graphInfo,t.buttons),this.container.appendChild(this.element)}var u=c.prototype;u.update=function(t,e){this.graphInfo=t;var r=this.graphInfo._context,n=this.graphInfo._fullLayout,i="modebar-"+n._uid;this.element.setAttribute("id",i),this._uid=i,this.element.className="modebar","hover"===r.displayModeBar&&(this.element.className+=" modebar--hover ease-bg"),"v"===n.modebar.orientation&&(this.element.className+=" vertical",e=e.reverse());var a=n.modebar,s="hover"===r.displayModeBar?".js-plotly-plot .plotly:hover ":"";o.deleteRelatedStyleRule(i),o.addRelatedStyleRule(i,s+"#"+i+" .modebar-group","background-color: "+a.bgcolor),o.addRelatedStyleRule(i,"#"+i+" .modebar-btn .icon path","fill: "+a.color),o.addRelatedStyleRule(i,"#"+i+" .modebar-btn:hover .icon path","fill: "+a.activecolor),o.addRelatedStyleRule(i,"#"+i+" .modebar-btn.active .icon path","fill: "+a.activecolor);var l=!this.hasButtons(e),c=this.hasLogo!==r.displaylogo,u=this.locale!==r.locale;if(this.locale=r.locale,(l||c||u)&&(this.removeAllButtons(),this.updateButtons(e),r.watermark||r.displaylogo)){var h=this.getLogo();r.watermark&&(h.className=h.className+" watermark"),"v"===n.modebar.orientation?this.element.insertBefore(h,this.element.childNodes[0]):this.element.appendChild(h),this.hasLogo=!0}this.updateActiveButton()},u.updateButtons=function(t){var e=this;this.buttons=t,this.buttonElements=[],this.buttonsNames=[],this.buttons.forEach((function(t){var r=e.createGroup();t.forEach((function(t){var n=t.name;if(!n)throw new Error("must provide button 'name' in button config");if(-1!==e.buttonsNames.indexOf(n))throw new Error("button name '"+n+"' is taken");e.buttonsNames.push(n);var i=e.createButton(t);e.buttonElements.push(i),r.appendChild(i)})),e.element.appendChild(r)}))},u.createGroup=function(){var t=document.createElement("div");return t.className="modebar-group",t},u.createButton=function(t){var e=this,r=document.createElement("a");r.setAttribute("rel","tooltip"),r.className="modebar-btn";var i=t.title;void 0===i?i=t.name:"function"==typeof i&&(i=i(this.graphInfo)),(i||0===i)&&r.setAttribute("data-title",i),void 0!==t.attr&&r.setAttribute("data-attr",t.attr);var o=t.val;if(void 0!==o&&("function"==typeof o&&(o=o(this.graphInfo)),r.setAttribute("data-val",o)),"function"!=typeof t.click)throw new Error("must provide button 'click' function in button config");r.addEventListener("click",(function(r){t.click(e.graphInfo,r),e.updateActiveButton(r.currentTarget)})),r.setAttribute("data-toggle",t.toggle||!1),t.toggle&&n.select(r).classed("active",!0);var s=t.icon;return"function"==typeof s?r.appendChild(s()):r.appendChild(this.createIcon(s||a.question)),r.setAttribute("data-gravity",t.gravity||"n"),r},u.createIcon=function(t){var e,r=i(t.height)?Number(t.height):t.ascent-t.descent,n="http://www.w3.org/2000/svg";if(t.path){(e=document.createElementNS(n,"svg")).setAttribute("viewBox",[0,0,t.width,r].join(" ")),e.setAttribute("class","icon");var o=document.createElementNS(n,"path");o.setAttribute("d",t.path),t.transform?o.setAttribute("transform",t.transform):void 0!==t.ascent&&o.setAttribute("transform","matrix(1 0 0 -1 0 "+t.ascent+")"),e.appendChild(o)}return t.svg&&(e=l.parseFromString(t.svg,"application/xml").childNodes[0]),e.setAttribute("height","1em"),e.setAttribute("width","1em"),e},u.updateActiveButton=function(t){var e=this.graphInfo._fullLayout,r=void 0!==t?t.getAttribute("data-attr"):null;this.buttonElements.forEach((function(t){var i=t.getAttribute("data-val")||!0,a=t.getAttribute("data-attr"),s="true"===t.getAttribute("data-toggle"),l=n.select(t);if(s)a===r&&l.classed("active",!l.classed("active"));else{var c=null===a?a:o.nestedProperty(e,a).get();l.classed("active",c===i)}}))},u.hasButtons=function(t){var e=this.buttons;if(!e)return!1;if(t.length!==e.length)return!1;for(var r=0;r{"use strict";var n=r(75058),i=r(84226),o=(0,r(46121).templatedArray)("button",{visible:{valType:"boolean",dflt:!0,editType:"plot",description:"Determines whether or not this button is visible."},step:{valType:"enumerated",values:["month","year","day","hour","minute","second","all"],dflt:"month",editType:"plot",description:["The unit of measurement that the `count` value will set the range by."].join(" ")},stepmode:{valType:"enumerated",values:["backward","todate"],dflt:"backward",editType:"plot",description:["Sets the range update mode.","If *backward*, the range update shifts the start of range","back *count* times *step* milliseconds.","If *todate*, the range update shifts the start of range","back to the first timestamp from *count* times","*step* milliseconds back.","For example, with `step` set to *year* and `count` set to *1*","the range update shifts the start of the range back to","January 01 of the current year.","Month and year *todate* are currently available only","for the built-in (Gregorian) calendar."].join(" ")},count:{valType:"number",min:0,dflt:1,editType:"plot",description:["Sets the number of steps to take to update the range.","Use with `step` to specify the update interval."].join(" ")},label:{valType:"string",editType:"plot",description:"Sets the text label to appear on the button."},editType:"plot",description:["Sets the specifications for each buttons.","By default, a range selector comes with no buttons."].join(" ")});t.exports={visible:{valType:"boolean",editType:"plot",description:["Determines whether or not this range selector is visible.","Note that range selectors are only available for x axes of","`type` set to or auto-typed to *date*."].join(" ")},buttons:o,x:{valType:"number",min:-2,max:3,editType:"plot",description:"Sets the x position (in normalized coordinates) of the range selector."},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"left",editType:"plot",description:["Sets the range selector's horizontal position anchor.","This anchor binds the `x` position to the *left*, *center*","or *right* of the range selector."].join(" ")},y:{valType:"number",min:-2,max:3,editType:"plot",description:"Sets the y position (in normalized coordinates) of the range selector."},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"bottom",editType:"plot",description:["Sets the range selector's vertical position anchor","This anchor binds the `y` position to the *top*, *middle*","or *bottom* of the range selector."].join(" ")},font:n({editType:"plot",description:"Sets the font of the range selector button text."}),bgcolor:{valType:"color",dflt:i.lightLine,editType:"plot",description:"Sets the background color of the range selector buttons."},activecolor:{valType:"color",editType:"plot",description:"Sets the background color of the active range selector button."},bordercolor:{valType:"color",dflt:i.defaultLine,editType:"plot",description:"Sets the color of the border enclosing the range selector."},borderwidth:{valType:"number",min:0,dflt:0,editType:"plot",description:"Sets the width (in px) of the border enclosing the range selector."},editType:"plot"}},12057:t=>{"use strict";t.exports={yPad:.02,minButtonWidth:30,rx:3,ry:3,lightAmount:25,darkAmount:10}},4088:(t,e,r)=>{"use strict";var n=r(12822),i=r(17499),o=r(46121),a=r(35677),s=r(76927),l=r(12057);function c(t,e,r,i){var o=i.calendar;function a(r,i){return n.coerce(t,e,s.buttons,r,i)}if(a("visible")){var l=a("step");"all"!==l&&(!o||"gregorian"===o||"month"!==l&&"year"!==l?a("stepmode"):e.stepmode="backward",a("count")),a("label")}}t.exports=function(t,e,r,u,h){var d=t.rangeselector||{},f=o.newContainer(e,"rangeselector");function p(t,e){return n.coerce(d,f,s,t,e)}if(p("visible",a(d,f,{name:"buttons",handleItemDefaults:c,calendar:h}).length>0)){var m=function(t,e,r){for(var n=r.filter((function(r){return e[r].anchor===t._id})),i=0,o=0;o{"use strict";var n=r(27941),i=r(25059),o=r(51137),a=r(17499),s=r(40666),l=r(12822),c=l.strTranslate,u=r(80394),h=r(99246),d=r(89701),f=d.LINE_SPACING,p=d.FROM_TL,m=d.FROM_BR,g=r(12057),v=r(98822);function b(t){return t._id}function y(t,e,r){var n=l.ensureSingle(t,"rect","selector-rect",(function(t){t.attr("shape-rendering","crispEdges")}));n.attr({rx:g.rx,ry:g.ry}),n.call(a.stroke,e.bordercolor).call(a.fill,function(t,e){return e._isActive||e._isHovered?t.activecolor:t.bgcolor}(e,r)).style("stroke-width",e.borderwidth+"px")}function x(t,e,r,n){var i,o;l.ensureSingle(t,"text","selector-text",(function(t){t.attr("text-anchor","middle")})).call(s.font,e.font).text((i=r,o=n._fullLayout._meta,i.label?o?l.templateString(i.label,o):i.label:"all"===i.step?"all":i.count+i.step.charAt(0))).call((function(t){u.convertToTspans(t,n)}))}t.exports=function(t){var e=t._fullLayout._infolayer.selectAll(".rangeselector").data(function(t){for(var e=h.list(t,"x",!0),r=[],n=0;n{"use strict";var n=r(55622),i=r(12822).titleCase;t.exports=function(t,e){var r=t._name,o={};if("all"===e.step)o[r+".autorange"]=!0;else{var a=function(t,e){var r,o=t.range,a=new Date(t.r2l(o[1])),s=e.step,l=n["utc"+i(s)],c=e.count;switch(e.stepmode){case"backward":r=t.l2r(+l.offset(a,-c));break;case"todate":var u=l.offset(a,-c);r=t.l2r(+l.ceil(u))}return[r,o[1]]}(t,e);o[r+".range[0]"]=a[0],o[r+".range[1]"]=a[1]}return o}},36404:(t,e,r)=>{"use strict";t.exports={moduleType:"component",name:"rangeselector",schema:{subplots:{xaxis:{rangeselector:r(76927)}}},layoutAttributes:r(76927),handleDefaults:r(4088),draw:r(58204)}},40959:(t,e,r)=>{"use strict";var n=r(84226);t.exports={bgcolor:{valType:"color",dflt:n.background,editType:"plot",description:"Sets the background color of the range slider."},bordercolor:{valType:"color",dflt:n.defaultLine,editType:"plot",description:"Sets the border color of the range slider."},borderwidth:{valType:"integer",dflt:0,min:0,editType:"plot",description:"Sets the border width of the range slider."},autorange:{valType:"boolean",dflt:!0,editType:"calc",impliedEdits:{"range[0]":void 0,"range[1]":void 0},description:["Determines whether or not the range slider range is","computed in relation to the input data.","If `range` is provided, then `autorange` is set to *false*."].join(" ")},range:{valType:"info_array",items:[{valType:"any",editType:"calc",impliedEdits:{"^autorange":!1}},{valType:"any",editType:"calc",impliedEdits:{"^autorange":!1}}],editType:"calc",impliedEdits:{autorange:!1},description:["Sets the range of the range slider.","If not set, defaults to the full xaxis range.","If the axis `type` is *log*, then you must take the","log of your desired range.","If the axis `type` is *date*, it should be date strings,","like date data, though Date objects and unix milliseconds","will be accepted and converted to strings.","If the axis `type` is *category*, it should be numbers,","using the scale where each category is assigned a serial","number from zero in the order it appears."].join(" ")},thickness:{valType:"number",dflt:.15,min:0,max:1,editType:"plot",description:["The height of the range slider as a fraction of the","total plot area height."].join(" ")},visible:{valType:"boolean",dflt:!0,editType:"calc",description:["Determines whether or not the range slider will be visible.","If visible, perpendicular axes will be set to `fixedrange`"].join(" ")},editType:"calc"}},99224:(t,e,r)=>{"use strict";var n=r(99246).list,i=r(19496).getAutoRange,o=r(92601);t.exports=function(t){for(var e=n(t,"x",!0),r=0;r{"use strict";t.exports={name:"rangeslider",containerClassName:"rangeslider-container",bgClassName:"rangeslider-bg",rangePlotClassName:"rangeslider-rangeplot",maskMinClassName:"rangeslider-mask-min",maskMaxClassName:"rangeslider-mask-max",slideBoxClassName:"rangeslider-slidebox",grabberMinClassName:"rangeslider-grabber-min",grabAreaMinClassName:"rangeslider-grabarea-min",handleMinClassName:"rangeslider-handle-min",grabberMaxClassName:"rangeslider-grabber-max",grabAreaMaxClassName:"rangeslider-grabarea-max",handleMaxClassName:"rangeslider-handle-max",maskMinOppAxisClassName:"rangeslider-mask-min-opp-axis",maskMaxOppAxisClassName:"rangeslider-mask-max-opp-axis",maskColor:"rgba(0,0,0,0.4)",maskOppAxisColor:"rgba(0,0,0,0.2)",slideBoxFill:"transparent",slideBoxCursor:"ew-resize",grabAreaFill:"transparent",grabAreaCursor:"col-resize",grabAreaWidth:10,handleWidth:4,handleRadius:1,handleStrokeWidth:1,extraPad:15}},4504:(t,e,r)=>{"use strict";var n=r(12822),i=r(46121),o=r(99246),a=r(40959),s=r(73290);t.exports=function(t,e,r){var l=t[r],c=e[r];if(l.rangeslider||e._requestRangeslider[c._id]){n.isPlainObject(l.rangeslider)||(l.rangeslider={});var u,h,d=l.rangeslider,f=i.newContainer(c,"rangeslider");if(_("visible")){_("bgcolor",e.plot_bgcolor),_("bordercolor"),_("borderwidth"),_("thickness"),_("autorange",!c.isValidRange(d.range)),_("range");var p=e._subplots;if(p)for(var m=p.cartesian.filter((function(t){return t.substr(0,t.indexOf("y"))===o.name2id(r)})).map((function(t){return t.substr(t.indexOf("y"),t.length)})),g=n.simpleMap(m,o.id2name),v=0;v{"use strict";var n=r(27941),i=r(25059),o=r(51137),a=r(12822),s=a.strTranslate,l=r(40666),c=r(17499),u=r(6883),h=r(29592),d=r(99246),f=r(19846),p=r(76292),m=r(92601);function g(t){return"number"==typeof t.clientX?t.clientX:t.touches&&t.touches.length>0?t.touches[0].clientX:0}function v(t,e,r,n){var i=a.ensureSingle(t,"rect",m.bgClassName,(function(t){t.attr({x:0,y:0,"shape-rendering":"crispEdges"})})),o=n.borderwidth%2==0?n.borderwidth:n.borderwidth-1,u=-n._offsetShift,h=l.crispRound(e,n.borderwidth);i.attr({width:n._width+o,height:n._height+o,transform:s(u,u),"stroke-width":h}).call(c.stroke,n.bordercolor).call(c.fill,n.bgcolor)}function b(t,e,r,n){var i=e._fullLayout;a.ensureSingleById(i._topdefs,"clipPath",n._clipId,(function(t){t.append("rect").attr({x:0,y:0})})).select("rect").attr({width:n._width,height:n._height})}function y(t,e,r,i){var s,c=e.calcdata,u=t.selectAll("g."+m.rangePlotClassName).data(r._subplotsWith,a.identity);u.enter().append("g").attr("class",(function(t){return m.rangePlotClassName+" "+t})).call(l.setClipUrl,i._clipId,e),u.order(),u.exit().remove(),u.each((function(t,a){var l=n.select(this),u=0===a,f=d.getFromId(e,t,"y"),p=f._name,m=i[p],g={data:[],layout:{xaxis:{type:r.type,domain:[0,1],range:i.range.slice(),calendar:r.calendar},width:i._width,height:i._height,margin:{t:0,b:0,l:0,r:0}},_context:e._context};r.rangebreaks&&(g.layout.xaxis.rangebreaks=r.rangebreaks),g.layout[p]={type:f.type,domain:[0,1],range:"match"!==m.rangemode?m.range.slice():f.range.slice(),calendar:f.calendar},f.rangebreaks&&(g.layout[p].rangebreaks=f.rangebreaks),o.supplyDefaults(g);var v=g._fullLayout.xaxis,b=g._fullLayout[p];v.clearCalc(),v.setScale(),b.clearCalc(),b.setScale();var y={id:t,plotgroup:l,xaxis:v,yaxis:b,isRangePlot:!0};u?s=y:(y.mainplot="xy",y.mainplotinfo=s),h.rangePlot(e,y,function(t,e){for(var r=[],n=0;n=n.max)e=j[r+1];else if(t=n.pmax)e=j[r+1];else if(tr._length||b+_<0)return;u=v+_,f=b+_;break;case l:if(x="col-resize",v+_>r._length)return;u=v+_,f=b;break;case c:if(x="col-resize",b+_<0)return;u=v,f=b+_;break;default:x="ew-resize",u=m,f=m+_}if(f{"use strict";var n=r(99246),i=r(80394),o=r(92601),a=r(89701).LINE_SPACING,s=o.name;function l(t){var e=t&&t[s];return e&&e.visible}e.isVisible=l,e.makeData=function(t){var e=n.list({_fullLayout:t},"x",!0),r=t.margin,i=[];if(!t._has("gl2d"))for(var o=0;o{"use strict";var n=r(12822),i=r(40959),o=r(73290),a=r(93729);t.exports={moduleType:"component",name:"rangeslider",schema:{subplots:{xaxis:{rangeslider:n.extendFlat({},i,{yaxis:o})}}},layoutAttributes:r(40959),handleDefaults:r(4504),calcAutorange:r(99224),draw:r(19260),isVisible:a.isVisible,makeData:a.makeData,autoMarginOpts:a.autoMarginOpts}},73290:t=>{"use strict";t.exports={_isSubplotObj:!0,rangemode:{valType:"enumerated",values:["auto","fixed","match"],dflt:"match",editType:"calc",description:["Determines whether or not the range of this axis in","the rangeslider use the same value than in the main plot","when zooming in/out.","If *auto*, the autorange will be used.","If *fixed*, the `range` is used.","If *match*, the current range of the corresponding y-axis on the main subplot is used."].join(" ")},range:{valType:"info_array",items:[{valType:"any",editType:"plot"},{valType:"any",editType:"plot"}],editType:"plot",description:["Sets the range of this axis for the rangeslider."].join(" ")},editType:"calc"}},65586:(t,e,r)=>{"use strict";var n=r(77061),i=r(98387).line,o=r(68057).T,a=r(98260).extendFlat,s=r(62309).overrideAll,l=r(46121).templatedArray,c=r(53644);t.exports=s(l("selection",{type:{valType:"enumerated",values:["rect","path"],description:["Specifies the selection type to be drawn.","If *rect*, a rectangle is drawn linking","(`x0`,`y0`), (`x1`,`y0`), (`x1`,`y1`) and (`x0`,`y1`).","If *path*, draw a custom SVG path using `path`."].join(" ")},xref:a({},n.xref,{description:["Sets the selection's x coordinate axis.",c.axisRefDescription("x","left","right")].join(" ")}),yref:a({},n.yref,{description:["Sets the selection's x coordinate axis.",c.axisRefDescription("y","bottom","top")].join(" ")}),x0:{valType:"any",description:"Sets the selection's starting x position."},x1:{valType:"any",description:"Sets the selection's end x position."},y0:{valType:"any",description:"Sets the selection's starting y position."},y1:{valType:"any",description:"Sets the selection's end y position."},path:{valType:"string",editType:"arraydraw",description:["For `type` *path* - a valid SVG path similar to `shapes.path` in data coordinates.","Allowed segments are: M, L and Z."].join(" ")},opacity:{valType:"number",min:0,max:1,dflt:.7,editType:"arraydraw",description:"Sets the opacity of the selection."},line:{color:i.color,width:a({},i.width,{min:1,dflt:1}),dash:a({},o,{dflt:"dot"})}}),"arraydraw","from-root")},76814:t=>{"use strict";t.exports={BENDPX:1.5,MINSELECT:12,SELECTDELAY:100,SELECTID:"-select"}},8037:(t,e,r)=>{"use strict";var n=r(12822),i=r(75815),o=r(35677),a=r(65586),s=r(23223);function l(t,e,r){function o(r,i){return n.coerce(t,e,a,r,i)}var l=o("path"),c="path"!==o("type",l?"path":"rect");c&&delete e.path,o("opacity"),o("line.color"),o("line.width"),o("line.dash");for(var u=["x","y"],h=0;h<2;h++){var d,f,p,m=u[h],g={_fullLayout:r},v=i.coerceRef(t,e,g,m);if((d=i.getFromId(g,v))._selectionIndices.push(e._index),p=s.rangeToShapePosition(d),f=s.shapePositionToRange(d),c){var b=m+"0",y=m+"1",x=t[b],_=t[y];t[b]=f(t[b],!0),t[y]=f(t[y],!0),i.coercePosition(e,g,o,v,b),i.coercePosition(e,g,o,v,y);var w=e[b],k=e[y];void 0!==w&&void 0!==k&&(e[b]=p(w),e[y]=p(k),t[b]=x,t[y]=_)}}c&&n.noneOrAll(t,e,["x0","x1","y0","y1"])}t.exports=function(t,e){o(t,e,{name:"selections",handleItemDefaults:l});for(var r=e.selections,n=0;n{"use strict";var n=r(59952).readPaths,i=r(49244),o=r(8867).clearOutlineControllers,a=r(17499),s=r(40666),l=r(46121).arrayEditor,c=r(23223),u=c.getPathString;function h(t){var e=t._fullLayout;for(var r in o(t),e._selectionLayer.selectAll("path").remove(),e._plots){var n=e._plots[r].selectionLayer;n&&n.selectAll("path").remove()}for(var i=0;i=0;A--){var M=r.append("path").attr(g).style("opacity",A?.1:v).call(a.stroke,y).call(a.fill,b).call(s.dashLine,A?"solid":_,A?4+x:x);if(p(M,t,o),w){var T=l(t.layout,"selections",o);M.style({cursor:"move"});var S={element:M.node(),plotinfo:f,gd:t,editHelpers:T,isActiveSelection:!0},C=n(c,t);i(C,M,S)}else M.style("pointer-events",A?"all":"none");k[A]=M}var E=k[0];k[1].node().addEventListener("click",(function(){return function(t,e){if(d(t)){var r=+e.node().getAttribute("data-index");if(r>=0){if(r===t._fullLayout._activeSelectionIndex)return void m(t);t._fullLayout._activeSelectionIndex=r,t._fullLayout._deactivateSelection=m,h(t)}}}(t,E)}))}(t._fullLayout._selectionLayer)}function p(t,e,r){var n=r.xref+r.yref;s.setClipUrl(t,"clip"+e._fullLayout._uid+n,e)}function m(t){d(t)&&t._fullLayout._activeSelectionIndex>=0&&(o(t),delete t._fullLayout._activeSelectionIndex,h(t))}t.exports={draw:h,drawOne:f,activateLastSelection:function(t){if(d(t)){var e=t._fullLayout.selections.length-1;t._fullLayout._activeSelectionIndex=e,t._fullLayout._deactivateSelection=m,h(t)}}}},21422:(t,e,r)=>{"use strict";var n=r(68057).T,i=r(98260).extendFlat;t.exports={newselection:{mode:{valType:"enumerated",values:["immediate","gradual"],dflt:"immediate",editType:"none",description:["Describes how a new selection is created.","If `immediate`, a new selection is created after first mouse up.","If `gradual`, a new selection is not created after first mouse.","By adding to and subtracting from the initial selection,","this option allows declaring extra outlines of the selection."].join(" ")},line:{color:{valType:"color",editType:"none",description:["Sets the line color.","By default uses either dark grey or white","to increase contrast with background color."].join(" ")},width:{valType:"number",min:1,dflt:1,editType:"none",description:"Sets the line width (in px)."},dash:i({},n,{dflt:"dot",editType:"none"}),editType:"none"},editType:"none"},activeselection:{fillcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"none",description:"Sets the color filling the active selection' interior."},opacity:{valType:"number",min:0,max:1,dflt:.5,editType:"none",description:"Sets the opacity of the active selection."},editType:"none"}}},80857:t=>{"use strict";t.exports=function(t,e,r){r("newselection.mode"),r("newselection.line.width")&&(r("newselection.line.color"),r("newselection.line.dash")),r("activeselection.fillcolor"),r("activeselection.opacity")}},63750:(t,e,r)=>{"use strict";var n=r(14295).selectMode,i=r(8867).clearOutline,o=r(59952),a=o.readPaths,s=o.writePaths,l=o.fixDatesForPaths;t.exports=function(t,e){if(t.length){var r=t[0][0];if(r){var o=r.getAttribute("d"),c=e.gd,u=c._fullLayout.newselection,h=e.plotinfo,d=h.xaxis,f=h.yaxis,p=e.isActiveSelection,m=e.dragmode,g=(c.layout||{}).selections||[];if(!n(m)&&void 0!==p){var v=c._fullLayout._activeSelectionIndex;if(v{"use strict";var n=r(12822).strTranslate;function i(t,e){switch(t.type){case"log":return t.p2d(e);case"date":return t.p2r(e,0,t.calendar);default:return t.p2r(e)}}t.exports={p2r:i,r2p:function(t,e){switch(t.type){case"log":return t.d2p(e);case"date":return t.r2p(e,0,t.calendar);default:return t.r2p(e)}},axValue:function(t){var e="y"===t._id.charAt(0)?1:0;return function(r){return i(t,r[e])}},getTransform:function(t){return n(t.xaxis._offset,t.yaxis._offset)}}},70059:(t,e,r)=>{"use strict";var n=r(70445),i=r(80191);t.exports={moduleType:"component",name:"selections",layoutAttributes:r(65586),supplyLayoutDefaults:r(8037),supplyDrawNewSelectionDefaults:r(80857),includeBasePlot:r(39859)("selections"),draw:n.draw,drawOne:n.drawOne,reselect:i.reselect,prepSelect:i.prepSelect,clearOutline:i.clearOutline,clearSelectionsCache:i.clearSelectionsCache,selectOnClick:i.selectOnClick}},80191:(t,e,r)=>{"use strict";var n=r(48439),i=r(53824),o=r(25059),a=r(40666).dashStyle,s=r(17499),l=r(70410),c=r(66811).makeEventData,u=r(14295),h=u.freeMode,d=u.rectMode,f=u.drawMode,p=u.openMode,m=u.selectMode,g=r(23223),v=r(6583),b=r(49244),y=r(8867).clearOutline,x=r(59952),_=x.handleEllipse,w=x.readPaths,k=r(81941).newShapes,A=r(63750),M=r(70445).activateLastSelection,T=r(12822),S=T.sorterAsc,C=r(92620),E=r(76324),L=r(99246).getFromId,z=r(86748),O=r(39004).redrawReglTraces,D=r(76814),I=D.MINSELECT,F=C.filter,R=C.tester,P=r(38554),j=P.p2r,N=P.axValue,B=P.getTransform;function U(t){return void 0!==t.subplot}function G(t,e,r,n,i,o,a){var s,l,c,u,h,d,f,m,g,v=e._hoverdata,y=e._fullLayout.clickmode.indexOf("event")>-1,x=[];if(function(t){return t&&Array.isArray(t)&&!0!==t[0].hoverOnBox}(v)){q(t,e,o);var _=function(t,e){var r,n,i=t[0],o=-1,a=[];for(n=0;n0?function(t,e){var r,n,i,o=[];for(i=0;i0&&o.push(r);if(1===o.length&&o[0]===e.searchInfo&&(n=e.searchInfo.cd[0].trace).selectedpoints.length===e.pointNumbers.length){for(i=0;i1)return!1;if((n+=e.selectedpoints.length)>1)return!1}return 1===n}(s)&&(d=J(_))){for(a&&a.remove(),g=0;g=0})(i)&&i._fullLayout._deactivateShape(i),function(t){return t._fullLayout._activeSelectionIndex>=0}(i)&&i._fullLayout._deactivateSelection(i);var a=i._fullLayout._zoomlayer,s=f(r),l=m(r);if(s||l){var c,u,h=a.selectAll(".select-outline-"+n.id);h&&i._fullLayout._outlining&&(s&&(c=k(h,t)),c&&o.call("_guiRelayout",i,{shapes:c}),l&&!U(t)&&(u=A(h,t)),u&&(i._fullLayout._noEmitSelectedAtStart=!0,o.call("_guiRelayout",i,{selections:u}).then((function(){e&&M(i)}))),i._fullLayout._outlining=!1)}n.selection={},n.selection.selectionDefs=t.selectionDefs=[],n.selection.mergedPolygons=t.mergedPolygons=[]}function Z(t){return t._id}function X(t,e,r,n){if(!t.calcdata)return[];var i,o,a,s=[],l=e.map(Z),c=r.map(Z);for(a=0;a0?n[0]:r;return!!e.selectedpoints&&e.selectedpoints.indexOf(i)>-1}function K(t,e,r){var n,i;for(n=0;n-1&&e;if(!o&&e){var et=at(t,!0);if(et.length){var nt=et[0].xref,ft=et[0].yref;if(nt&&ft){var pt=ct(et);ut([L(t,nt,"x"),L(t,ft,"y")])(Q,pt)}}t._fullLayout._noEmitSelectedAtStart?t._fullLayout._noEmitSelectedAtStart=!1:tt&&ht(t,Q),d._reselect=!1}if(!o&&d._deselect){var mt=d._deselect;(function(t,e,r){for(var n=0;n=0)A._fullLayout._deactivateShape(A);else if(!y){var r=M.clickmode;E.done(Tt).then((function(){if(E.clear(Tt),2===t){for(xt.remove(),J=0;J-1&&G(e,A,n.xaxes,n.yaxes,n.subplot,n,xt),"event"===r&&ht(A,void 0);l.click(A,e,z.id)})).catch(T.error)}},n.doneFn=function(){At.remove(),E.done(Tt).then((function(){E.clear(Tt),!S&&$&&n.selectionDefs&&($.subtract=yt,n.selectionDefs.push($),n.mergedPolygons.length=0,[].push.apply(n.mergedPolygons,Z)),(S||y)&&Y(n,S),n.doneFnCompleted&&n.doneFnCompleted(St),x&&ht(A,ot)})).catch(T.error)}},clearOutline:y,clearSelectionsCache:Y,selectOnClick:G}},39677:(t,e,r)=>{"use strict";var n=r(77061),i=r(75058),o=r(98387).line,a=r(68057).T,s=r(98260).extendFlat,l=r(46121).templatedArray,c=r(53644),u=r(3520),h=r(24131).LF,d=r(12086);t.exports=l("shape",{visible:s({},u.visible,{editType:"calc+arraydraw",description:["Determines whether or not this shape is visible.","If *legendonly*, the shape is not drawn,","but can appear as a legend item","(provided that the legend itself is visible)."].join(" ")}),showlegend:{valType:"boolean",dflt:!1,editType:"calc+arraydraw",description:["Determines whether or not this","shape is shown in the legend."].join(" ")},legend:s({},u.legend,{editType:"calc+arraydraw",description:["Sets the reference to a legend to show this shape in.","References to these legends are *legend*, *legend2*, *legend3*, etc.","Settings for these legends are set in the layout, under","`layout.legend`, `layout.legend2`, etc."].join(" ")}),legendgroup:s({},u.legendgroup,{editType:"calc+arraydraw",description:["Sets the legend group for this shape.","Traces and shapes part of the same legend group hide/show at the same time","when toggling legend items."].join(" ")}),legendgrouptitle:{text:s({},u.legendgrouptitle.text,{editType:"calc+arraydraw"}),font:i({editType:"calc+arraydraw",description:["Sets this legend group's title font."].join(" ")}),editType:"calc+arraydraw"},legendrank:s({},u.legendrank,{editType:"calc+arraydraw",description:["Sets the legend rank for this shape.","Items and groups with smaller ranks are presented on top/left side while","with *reversed* `legend.traceorder` they are on bottom/right side.","The default legendrank is 1000,","so that you can use ranks less than 1000 to place certain items before all unranked items,","and ranks greater than 1000 to go after all unranked items.","When having unranked or equal rank items shapes would be displayed after traces","i.e. according to their order in data and layout."].join(" ")}),legendwidth:s({},u.legendwidth,{editType:"calc+arraydraw",description:"Sets the width (in px or fraction) of the legend for this shape."}),type:{valType:"enumerated",values:["circle","rect","path","line"],editType:"calc+arraydraw",description:["Specifies the shape type to be drawn.","If *line*, a line is drawn from (`x0`,`y0`) to (`x1`,`y1`)","with respect to the axes' sizing mode.","If *circle*, a circle is drawn from","((`x0`+`x1`)/2, (`y0`+`y1`)/2))","with radius","(|(`x0`+`x1`)/2 - `x0`|, |(`y0`+`y1`)/2 -`y0`)|)","with respect to the axes' sizing mode.","If *rect*, a rectangle is drawn linking","(`x0`,`y0`), (`x1`,`y0`), (`x1`,`y1`), (`x0`,`y1`), (`x0`,`y0`)","with respect to the axes' sizing mode.","If *path*, draw a custom SVG path using `path`.","with respect to the axes' sizing mode."].join(" ")},layer:{valType:"enumerated",values:["below","above","between"],dflt:"above",editType:"arraydraw",description:["Specifies whether shapes are drawn below gridlines (*below*),","between gridlines and traces (*between*) or above traces (*above*)."].join(" ")},xref:s({},n.xref,{description:["Sets the shape's x coordinate axis.",c.axisRefDescription("x","left","right")].join(" ")}),xsizemode:{valType:"enumerated",values:["scaled","pixel"],dflt:"scaled",editType:"calc+arraydraw",description:["Sets the shapes's sizing mode along the x axis.","If set to *scaled*, `x0`, `x1` and x coordinates within `path` refer to","data values on the x axis or a fraction of the plot area's width","(`xref` set to *paper*).","If set to *pixel*, `xanchor` specifies the x position in terms","of data or plot fraction but `x0`, `x1` and x coordinates within `path`","are pixels relative to `xanchor`. This way, the shape can have","a fixed width while maintaining a position relative to data or","plot fraction."].join(" ")},xanchor:{valType:"any",editType:"calc+arraydraw",description:["Only relevant in conjunction with `xsizemode` set to *pixel*.","Specifies the anchor point on the x axis to which `x0`, `x1`","and x coordinates within `path` are relative to.","E.g. useful to attach a pixel sized shape to a certain data value.","No effect when `xsizemode` not set to *pixel*."].join(" ")},x0:{valType:"any",editType:"calc+arraydraw",description:["Sets the shape's starting x position.","See `type` and `xsizemode` for more info."].join(" ")},x1:{valType:"any",editType:"calc+arraydraw",description:["Sets the shape's end x position.","See `type` and `xsizemode` for more info."].join(" ")},x0shift:{valType:"number",dflt:0,min:-1,max:1,editType:"calc",description:["Shifts `x0` away from the center of the category when `xref` is a *category* or","*multicategory* axis. -0.5 corresponds to the start of the category and 0.5","corresponds to the end of the category."].join(" ")},x1shift:{valType:"number",dflt:0,min:-1,max:1,editType:"calc",description:["Shifts `x1` away from the center of the category when `xref` is a *category* or","*multicategory* axis. -0.5 corresponds to the start of the category and 0.5","corresponds to the end of the category."].join(" ")},yref:s({},n.yref,{description:["Sets the shape's y coordinate axis.",c.axisRefDescription("y","bottom","top")].join(" ")}),ysizemode:{valType:"enumerated",values:["scaled","pixel"],dflt:"scaled",editType:"calc+arraydraw",description:["Sets the shapes's sizing mode along the y axis.","If set to *scaled*, `y0`, `y1` and y coordinates within `path` refer to","data values on the y axis or a fraction of the plot area's height","(`yref` set to *paper*).","If set to *pixel*, `yanchor` specifies the y position in terms","of data or plot fraction but `y0`, `y1` and y coordinates within `path`","are pixels relative to `yanchor`. This way, the shape can have","a fixed height while maintaining a position relative to data or","plot fraction."].join(" ")},yanchor:{valType:"any",editType:"calc+arraydraw",description:["Only relevant in conjunction with `ysizemode` set to *pixel*.","Specifies the anchor point on the y axis to which `y0`, `y1`","and y coordinates within `path` are relative to.","E.g. useful to attach a pixel sized shape to a certain data value.","No effect when `ysizemode` not set to *pixel*."].join(" ")},y0:{valType:"any",editType:"calc+arraydraw",description:["Sets the shape's starting y position.","See `type` and `ysizemode` for more info."].join(" ")},y1:{valType:"any",editType:"calc+arraydraw",description:["Sets the shape's end y position.","See `type` and `ysizemode` for more info."].join(" ")},y0shift:{valType:"number",dflt:0,min:-1,max:1,editType:"calc",description:["Shifts `y0` away from the center of the category when `yref` is a *category* or","*multicategory* axis. -0.5 corresponds to the start of the category and 0.5","corresponds to the end of the category."].join(" ")},y1shift:{valType:"number",dflt:0,min:-1,max:1,editType:"calc",description:["Shifts `y1` away from the center of the category when `yref` is a *category* or","*multicategory* axis. -0.5 corresponds to the start of the category and 0.5","corresponds to the end of the category."].join(" ")},path:{valType:"string",editType:"calc+arraydraw",description:["For `type` *path* - a valid SVG path with the pixel values","replaced by data values in `xsizemode`/`ysizemode` being *scaled*","and taken unmodified as pixels relative to `xanchor` and `yanchor`","in case of *pixel* size mode.","There are a few restrictions / quirks","only absolute instructions, not relative. So the allowed segments","are: M, L, H, V, Q, C, T, S, and Z","arcs (A) are not allowed because radius rx and ry are relative.","In the future we could consider supporting relative commands,","but we would have to decide on how to handle date and log axes.","Note that even as is, Q and C Bezier paths that are smooth on","linear axes may not be smooth on log, and vice versa.",'no chained "polybezier" commands - specify the segment type for',"each one.","On category axes, values are numbers scaled to the serial numbers","of categories because using the categories themselves there would","be no way to describe fractional positions","On data axes: because space and T are both normal components of path","strings, we can't use either to separate date from time parts.","Therefore we'll use underscore for this purpose:","2015-02-21_13:45:56.789"].join(" ")},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw",description:"Sets the opacity of the shape."},line:{color:s({},o.color,{editType:"arraydraw"}),width:s({},o.width,{editType:"calc+arraydraw"}),dash:s({},a,{editType:"arraydraw"}),editType:"calc+arraydraw"},fillcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw",description:["Sets the color filling the shape's interior. Only applies to closed shapes."].join(" ")},fillrule:{valType:"enumerated",values:["evenodd","nonzero"],dflt:"evenodd",editType:"arraydraw",description:["Determines which regions of complex paths constitute the interior.","For more info please visit https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/fill-rule"].join(" ")},editable:{valType:"boolean",dflt:!1,editType:"calc+arraydraw",description:["Determines whether the shape could be activated for edit or not.","Has no effect when the older editable shapes mode is enabled via","`config.editable` or `config.edits.shapePosition`."].join(" ")},label:{text:{valType:"string",dflt:"",editType:"arraydraw",description:["Sets the text to display with shape.","It is also used for legend item if `name` is not provided."].join(" ")},texttemplate:h({},{keys:Object.keys(d)}),font:i({editType:"calc+arraydraw",colorEditType:"arraydraw",description:"Sets the shape label text font."}),textposition:{valType:"enumerated",values:["top left","top center","top right","middle left","middle center","middle right","bottom left","bottom center","bottom right","start","middle","end"],editType:"arraydraw",description:["Sets the position of the label text relative to the shape.","Supported values for rectangles, circles and paths are","*top left*, *top center*, *top right*, *middle left*,","*middle center*, *middle right*, *bottom left*, *bottom center*,","and *bottom right*.","Supported values for lines are *start*, *middle*, and *end*.","Default: *middle center* for rectangles, circles, and paths; *middle* for lines."].join(" ")},textangle:{valType:"angle",dflt:"auto",editType:"calc+arraydraw",description:["Sets the angle at which the label text is drawn","with respect to the horizontal. For lines, angle *auto*","is the same angle as the line. For all other shapes,","angle *auto* is horizontal."].join(" ")},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"auto",editType:"calc+arraydraw",description:["Sets the label's horizontal position anchor","This anchor binds the specified `textposition` to the *left*, *center*","or *right* of the label text.","For example, if `textposition` is set to *top right* and","`xanchor` to *right* then the right-most portion of the","label text lines up with the right-most edge of the","shape."].join(" ")},yanchor:{valType:"enumerated",values:["top","middle","bottom"],editType:"calc+arraydraw",description:["Sets the label's vertical position anchor","This anchor binds the specified `textposition` to the *top*, *middle*","or *bottom* of the label text.","For example, if `textposition` is set to *top right* and","`yanchor` to *top* then the top-most portion of the","label text lines up with the top-most edge of the","shape."].join(" ")},padding:{valType:"number",dflt:3,min:0,editType:"arraydraw",description:"Sets padding (in px) between edge of label and edge of shape."},editType:"arraydraw"},editType:"arraydraw"})},37358:(t,e,r)=>{"use strict";var n=r(12822),i=r(75815),o=r(6583),a=r(23223);function s(t){return c(t.line.width,t.xsizemode,t.x0,t.x1,t.path,!1)}function l(t){return c(t.line.width,t.ysizemode,t.y0,t.y1,t.path,!0)}function c(t,e,r,i,s,l){var c=t/2,u=l;if("pixel"===e){var h=s?a.extractPathCoords(s,l?o.paramIsY:o.paramIsX):[r,i],d=n.aggNums(Math.max,null,h),f=n.aggNums(Math.min,null,h),p=f<0?Math.abs(f)+c:c,m=d>0?d+c:c;return{ppad:c,ppadplus:u?p:m,ppadminus:u?m:p}}return{ppad:c}}function u(t,e,r){var n,i,s="x"===t._id.charAt(0)?"x":"y",l="category"===t.type||"multicategory"===t.type,c=0,u=0,h=l?t.r2c:t.d2c;if("scaled"===e[s+"sizemode"]?(n=e[s+"0"],i=e[s+"1"],l&&(c=e[s+"0shift"],u=e[s+"1shift"])):(n=e[s+"anchor"],i=e[s+"anchor"]),void 0!==n)return[h(n)+c,h(i)+u];if(e.path){var d,f,p,m,g=1/0,v=-1/0,b=e.path.match(o.segmentRE);for("date"===t.type&&(h=a.decodeDate(h)),d=0;dv&&(v=m)));return v>=g?[g,v]:void 0}}t.exports=function(t){var e=t._fullLayout,r=n.filterVisible(e.shapes);if(r.length&&t._fullData.length)for(var a=0;a{"use strict";t.exports={segmentRE:/[MLHVQCTSZ][^MLHVQCTSZ]*/g,paramRE:/[^\s,]+/g,paramIsX:{M:{0:!0,drawn:0},L:{0:!0,drawn:0},H:{0:!0,drawn:0},V:{},Q:{0:!0,2:!0,drawn:2},C:{0:!0,2:!0,4:!0,drawn:4},T:{0:!0,drawn:0},S:{0:!0,2:!0,drawn:2},Z:{}},paramIsY:{M:{1:!0,drawn:1},L:{1:!0,drawn:1},H:{},V:{0:!0,drawn:0},Q:{1:!0,3:!0,drawn:3},C:{1:!0,3:!0,5:!0,drawn:5},T:{1:!0,drawn:1},S:{1:!0,3:!0,drawn:5},Z:{}},numParams:{M:2,L:2,H:1,V:1,Q:4,C:6,T:2,S:4,Z:0}}},12138:(t,e,r)=>{"use strict";var n=r(12822),i=r(75815),o=r(35677),a=r(39677),s=r(23223);function l(t,e,r){function o(r,i){return n.coerce(t,e,a,r,i)}if(e._isShape=!0,o("visible")){o("showlegend")&&(o("legend"),o("legendwidth"),o("legendgroup"),o("legendgrouptitle.text"),n.coerceFont(o,"legendgrouptitle.font"),o("legendrank"));var l=o("path"),c=o("type",l?"path":"rect"),u="path"!==c;u&&delete e.path,o("editable"),o("layer"),o("opacity"),o("fillcolor"),o("fillrule"),o("line.width")&&(o("line.color"),o("line.dash"));for(var h=o("xsizemode"),d=o("ysizemode"),f=["x","y"],p=0;p<2;p++){var m,g,v,b=f[p],y=b+"anchor",x="x"===b?h:d,_={_fullLayout:r},w=i.coerceRef(t,e,_,b,void 0,"paper");if("range"===i.getRefType(w)?((m=i.getFromId(_,w))._shapeIndices.push(e._index),v=s.rangeToShapePosition(m),g=s.shapePositionToRange(m),"category"!==m.type&&"multicategory"!==m.type||(o(b+"0shift"),o(b+"1shift"))):g=v=n.identity,u){var k=b+"0",A=b+"1",M=t[k],T=t[A];t[k]=g(t[k],!0),t[A]=g(t[A],!0),"pixel"===x?(o(k,0),o(A,10)):(i.coercePosition(e,_,o,w,k,.25),i.coercePosition(e,_,o,w,A,.75)),e[k]=v(e[k]),e[A]=v(e[A]),t[k]=M,t[A]=T}if("pixel"===x){var S=t[y];t[y]=g(t[y],!0),i.coercePosition(e,_,o,w,y,.25),e[y]=v(e[y]),t[y]=S}}u&&n.noneOrAll(t,e,["x0","x1","y0","y1"]);var C,E,L="line"===c;if(u&&(C=o("label.texttemplate")),C||(E=o("label.text")),E||C){o("label.textangle");var z=o("label.textposition",L?"middle":"middle center");o("label.xanchor"),o("label.yanchor",function(t,e){return t?"bottom":-1!==e.indexOf("top")?"top":-1!==e.indexOf("bottom")?"bottom":"middle"}(L,z)),o("label.padding"),n.coerceFont(o,"label.font",r.font)}}}t.exports=function(t,e){o(t,e,{name:"shapes",handleItemDefaults:l})}},64620:(t,e,r)=>{"use strict";var n=r(12822),i=r(75815),o=r(80394),a=r(40666),s=r(59952).readPaths,l=r(23223),c=l.getPathString,u=r(12086),h=r(89701).FROM_TL;t.exports=function(t,e,r,d){if(d.selectAll(".shape-label").remove(),r.label.text||r.label.texttemplate){var f;if(r.label.texttemplate){var p={};if("path"!==r.type){var m=i.getFromId(t,r.xref),g=i.getFromId(t,r.yref);for(var v in u){var b=u[v](r,m,g);void 0!==b&&(p[v]=b)}}f=n.texttemplateStringForShapes(r.label.texttemplate,{},t._fullLayout._d3locale,p)}else f=r.label.text;var y,x,_,w,k={"data-index":e},A=r.label.font,M=d.append("g").attr(k).classed("shape-label",!0).append("text").attr({"data-notex":1}).classed("shape-label-text",!0).text(f);if(r.path){var T=c(t,r),S=s(T,t);y=1/0,_=1/0,x=-1/0,w=-1/0;for(var C=0;C=t?e-n:n-e,-180/Math.PI*Math.atan2(i,o)}(y,_,x,w):0),M.call((function(e){return e.call(a.font,A).attr({}),o.convertToTspans(e,t),e}));var W=function(t,e,r,n,i,o,a){var s,l,c,u,d=i.label.textposition,f=i.label.textangle,p=i.label.padding,m=i.type,g=Math.PI/180*o,v=Math.sin(g),b=Math.cos(g),y=i.label.xanchor,x=i.label.yanchor;if("line"===m){"start"===d?(s=t,l=e):"end"===d?(s=r,l=n):(s=(t+r)/2,l=(e+n)/2),"auto"===y&&(y="start"===d?"auto"===f?r>t?"left":rt?"right":rt?"right":rt?"left":r{"use strict";var n=r(12822).strTranslate,i=r(19846),o=r(14295),a=o.drawMode,s=o.selectMode,l=r(25059),c=r(17499),u=r(81436),h=u.i000,d=u.i090,f=u.i180,p=u.i270,m=r(8867).clearOutlineControllers,g=r(59952),v=g.pointsOnRectangle,b=g.pointsOnEllipse,y=g.writePaths,x=r(81941).newShapes,_=r(81941).createShapeObj,w=r(63750),k=r(64620);function A(t,e){var r,n,i,o=t[e][1],a=t[e][2],s=t.length;return n=t[r=(e+1)%s][1],i=t[r][2],n===o&&i===a&&(n=t[r=(e+2)%s][1],i=t[r][2]),[r,n,i]}t.exports=function t(e,r,o,u){u||(u=0);var g=o.gd;function M(){t(e,r,o,u++),(b(e[0])||o.hasText)&&T({redrawing:!0})}function T(t){var e={};void 0!==o.isActiveShape&&(o.isActiveShape=!1,e=x(r,o)),void 0!==o.isActiveSelection&&(o.isActiveSelection=!1,e=w(r,o),g._fullLayout._reselect=!0),Object.keys(e).length&&l.call((t||{}).redrawing?"relayout":"_guiRelayout",g,e)}var S,C,E,L,z,O=g._fullLayout._zoomlayer,D=o.dragmode,I=a(D),F=s(D);if((I||F)&&(g._fullLayout._outlining=!0),m(g),r.attr("d",y(e)),u||!o.isActiveShape&&!o.isActiveSelection||(z=function(t,e){for(var r=0;r1&&(2!==t.length||"Z"!==t[1][0])&&(0===L&&(t[0][0]="M"),e[E]=t,M(),T())}}()}}function G(t,r){!function(t,r){if(e.length)for(var n=0;n{"use strict";var n=r(27941),i=r(25059),o=r(12822),a=r(75815),s=r(59952).readPaths,l=r(49244),c=r(64620),u=r(8867).clearOutlineControllers,h=r(17499),d=r(40666),f=r(46121).arrayEditor,p=r(19846),m=r(76292),g=r(6583),v=r(23223),b=v.getPathString;function y(t){var e=t._fullLayout;for(var r in e._shapeUpperLayer.selectAll("path").remove(),e._shapeLowerLayer.selectAll("path").remove(),e._shapeUpperLayer.selectAll("text").remove(),e._shapeLowerLayer.selectAll("text").remove(),e._plots){var n=e._plots[r].shapelayer;n&&(n.selectAll("path").remove(),n.selectAll("text").remove())}for(var i=0;i_?(T=f,L="y0",S=_,z="y1"):(T=_,L="y1",S=f,z="y0"),rt(n),ot(l,r),function(t,e,r){var n=e.xref,i=e.yref,o=a.getFromId(r,n),s=a.getFromId(r,i),l="";"paper"===n||o.autorange||(l+=n),"paper"===i||s.autorange||(l+=i),d.setClipUrl(t,l?"clip"+r._fullLayout._uid+l:null,r)}(e,r,t),et.moveFn="move"===F?nt:it,et.altKey=n.altKey)},doneFn:function(){x(t)||(m(e),at(l),k(e,t,r),i.call("_guiRelayout",t,u.getUpdateObj()))},clickFn:function(){x(t)||at(l)}};function rt(r){if(x(t))F=null;else if(j)F="path"===r.target.tagName?"move":"start-point"===r.target.attributes["data-line-point"].value?"resize-over-start-point":"resize-over-end-point";else{var n=et.element.getBoundingClientRect(),i=n.right-n.left,o=n.bottom-n.top,a=r.clientX-n.left,s=r.clientY-n.top,l=!N&&i>10&&o>10&&!r.shiftKey?p.getCursor(a/i,1-s/o):"move";m(e,l),F=l.split("-")[0]}}function nt(n,i){if("path"===r.type){var o=function(t){return t},a=o,u=o;R?B("xanchor",r.xanchor=K(w+n)):(a=function(t){return K($(t)+n)},G&&"date"===G.type&&(a=v.encodeDate(a))),P?B("yanchor",r.yanchor=Q(M+i)):(u=function(t){return Q(J(t)+i)},H&&"date"===H.type&&(u=v.encodeDate(u))),B("path",r.path=A(I,a,u))}else R?B("xanchor",r.xanchor=K(w+n)):(B("x0",r.x0=K(h+n)),B("x1",r.x1=K(y+n))),P?B("yanchor",r.yanchor=Q(M+i)):(B("y0",r.y0=Q(f+i)),B("y1",r.y1=Q(_+i)));e.attr("d",b(t,r)),ot(l,r),c(t,s,r,U)}function it(n,i){if(N){var o=function(t){return t},a=o,u=o;R?B("xanchor",r.xanchor=K(w+n)):(a=function(t){return K($(t)+n)},G&&"date"===G.type&&(a=v.encodeDate(a))),P?B("yanchor",r.yanchor=Q(M+i)):(u=function(t){return Q(J(t)+i)},H&&"date"===H.type&&(u=v.encodeDate(u))),B("path",r.path=A(I,a,u))}else if(j){if("resize-over-start-point"===F){var d=h+n,p=P?f-i:f+i;B("x0",r.x0=R?d:K(d)),B("y0",r.y0=P?p:Q(p))}else if("resize-over-end-point"===F){var m=y+n,g=P?_-i:_+i;B("x1",r.x1=R?m:K(m)),B("y1",r.y1=P?g:Q(g))}}else{var x=function(t){return-1!==F.indexOf(t)},k=x("n"),V=x("s"),W=x("w"),q=x("e"),Y=k?T+i:T,Z=V?S+i:S,X=W?C+n:C,tt=q?E+n:E;P&&(k&&(Y=T-i),V&&(Z=S-i)),(!P&&Z-Y>10||P&&Y-Z>10)&&(B(L,r[L]=P?Y:Q(Y)),B(z,r[z]=P?Z:Q(Z))),tt-X>10&&(B(O,r[O]=R?X:K(X)),B(D,r[D]=R?tt:K(tt)))}e.attr("d",b(t,r)),ot(l,r),c(t,s,r,U)}function ot(t,e){(R||P)&&function(){var r="path"!==e.type,n=t.selectAll(".visual-cue").data([0]);n.enter().append("path").attr({fill:"#fff","fill-rule":"evenodd",stroke:"#000","stroke-width":1}).classed("visual-cue",!0);var i=$(R?e.xanchor:o.midRange(r?[e.x0,e.x1]:v.extractPathCoords(e.path,g.paramIsX))),a=J(P?e.yanchor:o.midRange(r?[e.y0,e.y1]:v.extractPathCoords(e.path,g.paramIsY)));if(i=v.roundPositionForSharpStrokeRendering(i,1),a=v.roundPositionForSharpStrokeRendering(a,1),R&&P){var s="M"+(i-1-1)+","+(a-1-1)+"h-8v2h8 v8h2v-8 h8v-2h-8 v-8h-2 Z";n.attr("d",s)}else if(R){var l="M"+(i-1-1)+","+(a-9-1)+"v18 h2 v-18 Z";n.attr("d",l)}else{var c="M"+(i-9-1)+","+(a-1-1)+"h18 v2 h-18 Z";n.attr("d",c)}}()}function at(t){t.selectAll(".visual-cue").remove()}p.init(et),tt.node().onmousemove=rt}(t,P,u,e,r,F):!0===u.editable&&P.style("pointer-events",D||h.opacity(E)*C<=.5?"stroke":"all");P.node().addEventListener("click",(function(){return function(t,e){if(_(t)){var r=+e.node().getAttribute("data-index");if(r>=0){if(r===t._fullLayout._activeShapeIndex)return void M(t);t._fullLayout._activeShapeIndex=r,t._fullLayout._deactivateShape=M,y(t)}}}(t,P)}))}u._input&&!0===u.visible&&("above"===u.layer?T(t._fullLayout._shapeUpperLayer):"paper"===u.xref||"paper"===u.yref?T(t._fullLayout._shapeLowerLayer):"between"===u.layer?T(w.shapelayerBetween):w._hadPlotinfo?T((w.mainplotinfo||w).shapelayer):T(t._fullLayout._shapeLowerLayer))}function k(t,e,r){var n=(r.xref+r.yref).replace(/paper/g,"").replace(/[xyz][1-9]* *domain/g,"");d.setClipUrl(t,n?"clip"+e._fullLayout._uid+n:null,e)}function A(t,e,r){return t.replace(g.segmentRE,(function(t){var n=0,i=t.charAt(0),o=g.paramIsX[i],a=g.paramIsY[i],s=g.numParams[i];return i+t.substr(1).replace(g.paramRE,(function(t){return n>=s||(o[n]?t=e(t):a[n]&&(t=r(t)),n++),t}))}))}function M(t){_(t)&&t._fullLayout._activeShapeIndex>=0&&(u(t),delete t._fullLayout._activeShapeIndex,y(t))}t.exports={draw:y,drawOne:w,eraseActiveShape:function(t){if(_(t)){u(t);var e=t._fullLayout._activeShapeIndex,r=(t.layout||{}).shapes||[];if(e{"use strict";var n=r(62309).overrideAll,i=r(3520),o=r(75058),a=r(68057).T,s=r(98260).extendFlat,l=r(24131).LF,c=r(12086);t.exports=n({newshape:{visible:s({},i.visible,{description:["Determines whether or not new shape is visible.","If *legendonly*, the shape is not drawn,","but can appear as a legend item","(provided that the legend itself is visible)."].join(" ")}),showlegend:{valType:"boolean",dflt:!1,description:["Determines whether or not new","shape is shown in the legend."].join(" ")},legend:s({},i.legend,{description:["Sets the reference to a legend to show new shape in.","References to these legends are *legend*, *legend2*, *legend3*, etc.","Settings for these legends are set in the layout, under","`layout.legend`, `layout.legend2`, etc."].join(" ")}),legendgroup:s({},i.legendgroup,{description:["Sets the legend group for new shape.","Traces and shapes part of the same legend group hide/show at the same time","when toggling legend items."].join(" ")}),legendgrouptitle:{text:s({},i.legendgrouptitle.text,{}),font:o({description:["Sets this legend group's title font."].join(" ")})},legendrank:s({},i.legendrank,{description:["Sets the legend rank for new shape.","Items and groups with smaller ranks are presented on top/left side while","with *reversed* `legend.traceorder` they are on bottom/right side.","The default legendrank is 1000,","so that you can use ranks less than 1000 to place certain items before all unranked items,","and ranks greater than 1000 to go after all unranked items."].join(" ")}),legendwidth:s({},i.legendwidth,{description:"Sets the width (in px or fraction) of the legend for new shape."}),line:{color:{valType:"color",description:["Sets the line color.","By default uses either dark grey or white","to increase contrast with background color."].join(" ")},width:{valType:"number",min:0,dflt:4,description:"Sets the line width (in px)."},dash:s({},a,{dflt:"solid"})},fillcolor:{valType:"color",dflt:"rgba(0,0,0,0)",description:["Sets the color filling new shapes' interior.","Please note that if using a fillcolor with alpha greater than half,","drag inside the active shape starts moving the shape underneath,","otherwise a new shape could be started over."].join(" ")},fillrule:{valType:"enumerated",values:["evenodd","nonzero"],dflt:"evenodd",description:["Determines the path's interior.","For more info please visit https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/fill-rule"].join(" ")},opacity:{valType:"number",min:0,max:1,dflt:1,description:"Sets the opacity of new shapes."},layer:{valType:"enumerated",values:["below","above","between"],dflt:"above",description:["Specifies whether new shapes are drawn below gridlines (*below*),","between gridlines and traces (*between*) or above traces (*above*)."].join(" ")},drawdirection:{valType:"enumerated",values:["ortho","horizontal","vertical","diagonal"],dflt:"diagonal",description:["When `dragmode` is set to *drawrect*, *drawline* or *drawcircle*","this limits the drag to be horizontal, vertical or diagonal.","Using *diagonal* there is no limit e.g. in drawing lines in any direction.","*ortho* limits the draw to be either horizontal or vertical.","*horizontal* allows horizontal extend.","*vertical* allows vertical extend."].join(" ")},name:s({},i.name,{description:["Sets new shape name.","The name appears as the legend item."].join(" ")}),label:{text:{valType:"string",dflt:"",description:["Sets the text to display with the new shape.","It is also used for legend item if `name` is not provided."].join(" ")},texttemplate:l({newshape:!0},{keys:Object.keys(c)}),font:o({description:"Sets the new shape label text font."}),textposition:{valType:"enumerated",values:["top left","top center","top right","middle left","middle center","middle right","bottom left","bottom center","bottom right","start","middle","end"],description:["Sets the position of the label text relative to the new shape.","Supported values for rectangles, circles and paths are","*top left*, *top center*, *top right*, *middle left*,","*middle center*, *middle right*, *bottom left*, *bottom center*,","and *bottom right*.","Supported values for lines are *start*, *middle*, and *end*.","Default: *middle center* for rectangles, circles, and paths; *middle* for lines."].join(" ")},textangle:{valType:"angle",dflt:"auto",description:["Sets the angle at which the label text is drawn","with respect to the horizontal. For lines, angle *auto*","is the same angle as the line. For all other shapes,","angle *auto* is horizontal."].join(" ")},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"auto",description:["Sets the label's horizontal position anchor","This anchor binds the specified `textposition` to the *left*, *center*","or *right* of the label text.","For example, if `textposition` is set to *top right* and","`xanchor` to *right* then the right-most portion of the","label text lines up with the right-most edge of the","new shape."].join(" ")},yanchor:{valType:"enumerated",values:["top","middle","bottom"],description:["Sets the label's vertical position anchor","This anchor binds the specified `textposition` to the *top*, *middle*","or *bottom* of the label text.","For example, if `textposition` is set to *top right* and","`yanchor` to *top* then the top-most portion of the","label text lines up with the top-most edge of the","new shape."].join(" ")},padding:{valType:"number",dflt:3,min:0,description:"Sets padding (in px) between edge of label and edge of new shape."}}},activeshape:{fillcolor:{valType:"color",dflt:"rgb(255,0,255)",description:"Sets the color filling the active shape' interior."},opacity:{valType:"number",min:0,max:1,dflt:.5,description:"Sets the opacity of the active shape."}}},"none","from-root")},81436:t=>{"use strict";t.exports={CIRCLE_SIDES:32,i000:0,i090:8,i180:16,i270:24,cos45:Math.cos(Math.PI/4),sin45:Math.sin(Math.PI/4),SQRT2:Math.sqrt(2)}},24815:(t,e,r)=>{"use strict";var n=r(17499),i=r(12822);t.exports=function(t,e,r){if(r("newshape.visible"),r("newshape.name"),r("newshape.showlegend"),r("newshape.legend"),r("newshape.legendwidth"),r("newshape.legendgroup"),r("newshape.legendgrouptitle.text"),i.coerceFont(r,"newshape.legendgrouptitle.font"),r("newshape.legendrank"),r("newshape.drawdirection"),r("newshape.layer"),r("newshape.fillcolor"),r("newshape.fillrule"),r("newshape.opacity"),r("newshape.line.width")){var o=(t||{}).plot_bgcolor||"#FFF";r("newshape.line.color",n.contrast(o)),r("newshape.line.dash")}var a="drawline"===t.dragmode,s=r("newshape.label.text"),l=r("newshape.label.texttemplate");if(s||l){r("newshape.label.textangle");var c=r("newshape.label.textposition",a?"middle":"middle center");r("newshape.label.xanchor"),r("newshape.label.yanchor",function(t,e){return t?"bottom":-1!==e.indexOf("top")?"top":-1!==e.indexOf("bottom")?"bottom":"middle"}(a,c)),r("newshape.label.padding"),i.coerceFont(r,"newshape.label.font",e.font)}r("activeshape.fillcolor"),r("activeshape.opacity")}},59952:(t,e,r)=>{"use strict";var n=r(37974),i=r(81436),o=i.CIRCLE_SIDES,a=i.SQRT2,s=r(38554),l=s.p2r,c=s.r2p,u=[0,3,4,5,6,1,2],h=[0,3,4,1,2];function d(t,e){return Math.abs(t-e)<=1e-6}function f(t,e){var r=e[1]-t[1],n=e[2]-t[2];return Math.sqrt(r*r+n*n)}e.writePaths=function(t){var e=t.length;if(!e)return"M0,0Z";for(var r="",n=0;n0&&l{"use strict";var n=r(14295),i=n.drawMode,o=n.openMode,a=r(81436),s=a.i000,l=a.i090,c=a.i180,u=a.i270,h=a.cos45,d=a.sin45,f=r(38554),p=f.p2r,m=f.r2p,g=r(8867).clearOutline,v=r(59952),b=v.readPaths,y=v.writePaths,x=v.ellipseOver,_=v.fixDatesForPaths;function w(t,e,r){var n,i=t[0][0],a=e.gd,f=i.getAttribute("d"),g=a._fullLayout.newshape,v=e.plotinfo,w=e.isActiveShape,k=v.xaxis,A=v.yaxis,M=!!v.domain||!v.xaxis,T=!!v.domain||!v.yaxis,S=o(r),C=b(f,a,v,w),E={editable:!0,visible:g.visible,name:g.name,showlegend:g.showlegend,legend:g.legend,legendwidth:g.legendwidth,legendgroup:g.legendgroup,legendgrouptitle:{text:g.legendgrouptitle.text,font:g.legendgrouptitle.font},legendrank:g.legendrank,label:g.label,xref:M?"paper":k._id,yref:T?"paper":A._id,layer:g.layer,opacity:g.opacity,line:{color:g.line.color,width:g.line.width,dash:g.line.dash}};if(S||(E.fillcolor=g.fillcolor,E.fillrule=g.fillrule),1===C.length&&(n=C[0]),n&&5===n.length&&"drawrect"===r)E.type="rect",E.x0=n[0][1],E.y0=n[0][2],E.x1=n[2][1],E.y1=n[2][2];else if(n&&"drawline"===r)E.type="line",E.x0=n[0][1],E.y0=n[0][2],E.x1=n[1][1],E.y1=n[1][2];else if(n&&"drawcircle"===r){E.type="circle";var L=n[s][1],z=n[l][1],O=n[c][1],D=n[u][1],I=n[s][2],F=n[l][2],R=n[c][2],P=n[u][2],j=v.xaxis&&("date"===v.xaxis.type||"log"===v.xaxis.type),N=v.yaxis&&("date"===v.yaxis.type||"log"===v.yaxis.type);j&&(L=m(v.xaxis,L),z=m(v.xaxis,z),O=m(v.xaxis,O),D=m(v.xaxis,D)),N&&(I=m(v.yaxis,I),F=m(v.yaxis,F),R=m(v.yaxis,R),P=m(v.yaxis,P));var B=(z+D)/2,U=(I+R)/2,G=x({x0:B,y0:U,x1:B+(D-z+O-L)/2*h,y1:U+(P-F+R-I)/2*d});j&&(G.x0=p(v.xaxis,G.x0),G.x1=p(v.xaxis,G.x1)),N&&(G.y0=p(v.yaxis,G.y0),G.y1=p(v.yaxis,G.y1)),E.x0=G.x0,E.y0=G.y0,E.x1=G.x1,E.y1=G.y1}else E.type="path",k&&A&&_(C,k,A),E.path=y(C),n=null;return E}t.exports={newShapes:function(t,e){if(t.length&&t[0][0]){var r=e.gd,n=e.isActiveShape,o=e.dragmode,a=(r.layout||{}).shapes||[];if(!i(o)&&void 0!==n){var s=r._fullLayout._activeShapeIndex;if(s{"use strict";t.exports={clearOutlineControllers:function(t){var e=t._fullLayout._zoomlayer;e&&e.selectAll(".outline-controllers").remove()},clearOutline:function(t){var e=t._fullLayout._zoomlayer;e&&e.selectAll(".select-outline").remove(),t._fullLayout._outlining=!1}}},23223:(t,e,r)=>{"use strict";var n=r(6583),i=r(12822),o=r(75815);function a(t,e){var r=0;return(e=e||0)&&t&&("category"===t.type||"multicategory"===t.type)&&(r=(t.r2p(1)-t.r2p(0))*e),r}e.rangeToShapePosition=function(t){return"log"===t.type?t.r2d:function(t){return t}},e.shapePositionToRange=function(t){return"log"===t.type?t.d2r:function(t){return t}},e.decodeDate=function(t){return function(e){return e.replace&&(e=e.replace("_"," ")),t(e)}},e.encodeDate=function(t){return function(e){return t(e).replace(" ","_")}},e.extractPathCoords=function(t,e,r){var o=[];return t.match(n.segmentRE).forEach((function(t){var a=e[t.charAt(0)].drawn;if(void 0!==a){var s=t.substr(1).match(n.paramRE);if(s&&!(s.lengthf&&(t="X"),t}));return o>f&&(p=p.replace(/[\s,]*X.*/,""),i.log("Ignoring extra params in segment "+t)),u+p}))}(r,l,u);if("pixel"===r.xsizemode){var M=l(r.xanchor);h=M+r.x0+_,d=M+r.x1+w}else h=l(r.x0)+_,d=l(r.x1)+w;if("pixel"===r.ysizemode){var T=u(r.yanchor);f=T-r.y0+k,p=T-r.y1+A}else f=u(r.y0)+k,p=u(r.y1)+A;if("line"===m)return"M"+h+","+f+"L"+d+","+p;if("rect"===m)return"M"+h+","+f+"H"+d+"V"+p+"H"+h+"Z";var S=(h+d)/2,C=(f+p)/2,E=Math.abs(S-h),L=Math.abs(C-f),z="A"+E+","+L,O=S+E+","+C;return"M"+O+z+" 0 1,1 "+S+","+(C-L)+z+" 0 0,1 "+O+"Z"}},60166:(t,e,r)=>{"use strict";var n=r(71422);t.exports={moduleType:"component",name:"shapes",layoutAttributes:r(39677),supplyLayoutDefaults:r(12138),supplyDrawNewShapeDefaults:r(24815),includeBasePlot:r(39859)("shapes"),calcAutorange:r(37358),draw:n.draw,drawOne:n.drawOne}},12086:t=>{"use strict";function e(t,e){return e?e.d2l(t):t}function r(t,e){return e?e.l2d(t):t}function n(t){return t.x0shift||0}function i(t){return t.x1shift||0}function o(t){return t.y0shift||0}function a(t){return t.y1shift||0}function s(t,r){return e(t.x1,r)+i(t)-e(t.x0,r)-n(t)}function l(t,r,n){return e(t.y1,n)+a(t)-e(t.y0,n)-o(t)}t.exports={x0:function(t){return t.x0},x1:function(t){return t.x1},y0:function(t){return t.y0},y1:function(t){return t.y1},slope:function(t,e,r){return"line"!==t.type?void 0:l(t,0,r)/s(t,e)},dx:s,dy:l,width:function(t,e){return Math.abs(s(t,e))},height:function(t,e,r){return Math.abs(l(t,0,r))},length:function(t,e,r){return"line"!==t.type?void 0:Math.sqrt(Math.pow(s(t,e),2)+Math.pow(l(t,0,r),2))},xcenter:function(t,o){return r((e(t.x1,o)+i(t)+e(t.x0,o)+n(t))/2,o)},ycenter:function(t,n,i){return r((e(t.y1,i)+a(t)+e(t.y0,i)+o(t))/2,i)}}},8421:(t,e,r)=>{"use strict";var n=r(75058),i=r(85538),o=r(98260).extendDeepAll,a=r(62309).overrideAll,s=r(46367),l=r(46121).templatedArray,c=r(92911),u=l("step",{visible:{valType:"boolean",dflt:!0,description:["Determines whether or not this step is included in the slider."].join(" ")},method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle",description:["Sets the Plotly method to be called when the slider value is changed.","If the `skip` method is used, the API slider will function as normal","but will perform no API calls and will not bind automatically to state","updates. This may be used to create a component interface and attach to","slider events manually via JavaScript."].join(" ")},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}],description:["Sets the arguments values to be passed to the Plotly","method set in `method` on slide."].join(" ")},label:{valType:"string",description:"Sets the text label to appear on the slider"},value:{valType:"string",description:["Sets the value of the slider step, used to refer to the step programatically.","Defaults to the slider label if not provided."].join(" ")},execute:{valType:"boolean",dflt:!0,description:["When true, the API method is executed. When false, all other behaviors are the same","and command execution is skipped. This may be useful when hooking into, for example,","the `plotly_sliderchange` method and executing the API command manually without losing","the benefit of the slider automatically binding to the state of the plot through the","specification of `method` and `args`."].join(" ")}});t.exports=a(l("slider",{visible:{valType:"boolean",dflt:!0,description:["Determines whether or not the slider is visible."].join(" ")},active:{valType:"number",min:0,dflt:0,description:["Determines which button (by index starting from 0) is","considered active."].join(" ")},steps:u,lenmode:{valType:"enumerated",values:["fraction","pixels"],dflt:"fraction",description:["Determines whether this slider length","is set in units of plot *fraction* or in *pixels.","Use `len` to set the value."].join(" ")},len:{valType:"number",min:0,dflt:1,description:["Sets the length of the slider","This measure excludes the padding of both ends.","That is, the slider's length is this length minus the","padding on both ends."].join(" ")},x:{valType:"number",min:-2,max:3,dflt:0,description:"Sets the x position (in normalized coordinates) of the slider."},pad:o(i({editType:"arraydraw"}),{description:"Set the padding of the slider component along each side."},{t:{dflt:20}}),xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"left",description:["Sets the slider's horizontal position anchor.","This anchor binds the `x` position to the *left*, *center*","or *right* of the range selector."].join(" ")},y:{valType:"number",min:-2,max:3,dflt:0,description:"Sets the y position (in normalized coordinates) of the slider."},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"top",description:["Sets the slider's vertical position anchor","This anchor binds the `y` position to the *top*, *middle*","or *bottom* of the range selector."].join(" ")},transition:{duration:{valType:"number",min:0,dflt:150,description:"Sets the duration of the slider transition"},easing:{valType:"enumerated",values:s.transition.easing.values,dflt:"cubic-in-out",description:"Sets the easing function of the slider transition"}},currentvalue:{visible:{valType:"boolean",dflt:!0,description:["Shows the currently-selected value above the slider."].join(" ")},xanchor:{valType:"enumerated",values:["left","center","right"],dflt:"left",description:["The alignment of the value readout relative to the length of the slider."].join(" ")},offset:{valType:"number",dflt:10,description:["The amount of space, in pixels, between the current value label","and the slider."].join(" ")},prefix:{valType:"string",description:"When currentvalue.visible is true, this sets the prefix of the label."},suffix:{valType:"string",description:"When currentvalue.visible is true, this sets the suffix of the label."},font:n({description:"Sets the font of the current value label text."})},font:n({description:"Sets the font of the slider step labels."}),activebgcolor:{valType:"color",dflt:c.gripBgActiveColor,description:["Sets the background color of the slider grip","while dragging."].join(" ")},bgcolor:{valType:"color",dflt:c.railBgColor,description:"Sets the background color of the slider."},bordercolor:{valType:"color",dflt:c.railBorderColor,description:"Sets the color of the border enclosing the slider."},borderwidth:{valType:"number",min:0,dflt:c.railBorderWidth,description:"Sets the width (in px) of the border enclosing the slider."},ticklen:{valType:"number",min:0,dflt:c.tickLength,description:"Sets the length in pixels of step tick marks"},tickcolor:{valType:"color",dflt:c.tickColor,description:"Sets the color of the border enclosing the slider."},tickwidth:{valType:"number",min:0,dflt:1,description:"Sets the tick width (in px)."},minorticklen:{valType:"number",min:0,dflt:c.minorTickLength,description:"Sets the length in pixels of minor step tick marks"}}),"arraydraw","from-root")},92911:t=>{"use strict";t.exports={name:"sliders",containerClassName:"slider-container",groupClassName:"slider-group",inputAreaClass:"slider-input-area",railRectClass:"slider-rail-rect",railTouchRectClass:"slider-rail-touch-rect",gripRectClass:"slider-grip-rect",tickRectClass:"slider-tick-rect",inputProxyClass:"slider-input-proxy",labelsClass:"slider-labels",labelGroupClass:"slider-label-group",labelClass:"slider-label",currentValueClass:"slider-current-value",railHeight:5,menuIndexAttrName:"slider-active-index",autoMarginIdRoot:"slider-",minWidth:30,minHeight:30,textPadX:40,arrowOffsetX:4,railRadius:2,railWidth:5,railBorder:4,railBorderWidth:1,railBorderColor:"#bec8d9",railBgColor:"#f8fafc",railInset:8,stepInset:10,gripRadius:10,gripWidth:20,gripHeight:20,gripBorder:20,gripBorderWidth:1,gripBorderColor:"#bec8d9",gripBgColor:"#f6f8fa",gripBgActiveColor:"#dbdde0",labelPadding:8,labelOffset:0,tickWidth:1,tickColor:"#333",tickOffset:25,tickLength:7,minorTickOffset:25,minorTickColor:"#333",minorTickLength:4,currentValuePadding:8,currentValueInset:0}},60626:(t,e,r)=>{"use strict";var n=r(12822),i=r(35677),o=r(8421),a=r(92911).name,s=o.steps;function l(t,e,r){function a(r,i){return n.coerce(t,e,o,r,i)}for(var s=i(t,e,{name:"steps",handleItemDefaults:c}),l=0,u=0;u{"use strict";var n=r(27941),i=r(51137),o=r(17499),a=r(40666),s=r(12822),l=s.strTranslate,c=r(80394),u=r(46121).arrayEditor,h=r(92911),d=r(89701),f=d.LINE_SPACING,p=d.FROM_TL,m=d.FROM_BR;function g(t){return h.autoMarginIdRoot+t._index}function v(t){return t._index}function b(t,e){var r=a.tester.selectAll("g."+h.labelGroupClass).data(e._visibleSteps);r.enter().append("g").classed(h.labelGroupClass,!0);var o=0,l=0;r.each((function(t){var r=_(n.select(this),{step:t},e).node();if(r){var i=a.bBox(r);l=Math.max(l,i.height),o=Math.max(o,i.width)}})),r.remove();var u=e._dims={};u.inputAreaWidth=Math.max(h.railWidth,h.gripHeight);var d=t._fullLayout._size;u.lx=d.l+d.w*e.x,u.ly=d.t+d.h*(1-e.y),"fraction"===e.lenmode?u.outerLength=Math.round(d.w*e.len):u.outerLength=e.len,u.inputAreaStart=0,u.inputAreaLength=Math.round(u.outerLength-e.pad.l-e.pad.r);var f=(u.inputAreaLength-2*h.stepInset)/(e._stepCount-1),v=o+h.labelPadding;if(u.labelStride=Math.max(1,Math.ceil(v/f)),u.labelHeight=l,u.currentValueMaxWidth=0,u.currentValueHeight=0,u.currentValueTotalHeight=0,u.currentValueMaxLines=1,e.currentvalue.visible){var b=a.tester.append("g");r.each((function(t){var r=y(b,e,t.label),n=r.node()&&a.bBox(r.node())||{width:0,height:0},i=c.lineCount(r);u.currentValueMaxWidth=Math.max(u.currentValueMaxWidth,Math.ceil(n.width)),u.currentValueHeight=Math.max(u.currentValueHeight,Math.ceil(n.height)),u.currentValueMaxLines=Math.max(u.currentValueMaxLines,i)})),u.currentValueTotalHeight=u.currentValueHeight+e.currentvalue.offset,b.remove()}u.height=u.currentValueTotalHeight+h.tickOffset+e.ticklen+h.labelOffset+u.labelHeight+e.pad.t+e.pad.b;var x="left";s.isRightAnchor(e)&&(u.lx-=u.outerLength,x="right"),s.isCenterAnchor(e)&&(u.lx-=u.outerLength/2,x="center");var w="top";s.isBottomAnchor(e)&&(u.ly-=u.height,w="bottom"),s.isMiddleAnchor(e)&&(u.ly-=u.height/2,w="middle"),u.outerLength=Math.ceil(u.outerLength),u.height=Math.ceil(u.height),u.lx=Math.round(u.lx),u.ly=Math.round(u.ly);var k={y:e.y,b:u.height*m[w],t:u.height*p[w]};"fraction"===e.lenmode?(k.l=0,k.xl=e.x-e.len*p[x],k.r=0,k.xr=e.x+e.len*m[x]):(k.x=e.x,k.l=u.outerLength*p[x],k.r=u.outerLength*m[x]),i.autoMargin(t,g(e),k)}function y(t,e,r){if(e.currentvalue.visible){var n,i,o=e._dims;switch(e.currentvalue.xanchor){case"right":n=o.inputAreaLength-h.currentValueInset-o.currentValueMaxWidth,i="left";break;case"center":n=.5*o.inputAreaLength,i="middle";break;default:n=h.currentValueInset,i="left"}var l=s.ensureSingle(t,"text",h.labelClass,(function(t){t.attr({"text-anchor":i,"data-notex":1})})),u=e.currentvalue.prefix?e.currentvalue.prefix:"";if("string"==typeof r)u+=r;else{var d=e.steps[e.active].label,p=e._gd._fullLayout._meta;p&&(d=s.templateString(d,p)),u+=d}e.currentvalue.suffix&&(u+=e.currentvalue.suffix),l.call(a.font,e.currentvalue.font).text(u).call(c.convertToTspans,e._gd);var m=c.lineCount(l),g=(o.currentValueMaxLines+1-m)*e.currentvalue.font.size*f;return c.positionText(l,n,g),l}}function x(t,e,r){s.ensureSingle(t,"rect",h.gripRectClass,(function(n){n.call(M,e,t,r).style("pointer-events","all")})).attr({width:h.gripWidth,height:h.gripHeight,rx:h.gripRadius,ry:h.gripRadius}).call(o.stroke,r.bordercolor).call(o.fill,r.bgcolor).style("stroke-width",r.borderwidth+"px")}function _(t,e,r){var n=s.ensureSingle(t,"text",h.labelClass,(function(t){t.attr({"text-anchor":"middle","data-notex":1})})),i=e.step.label,o=r._gd._fullLayout._meta;return o&&(i=s.templateString(i,o)),n.call(a.font,r.font).text(i).call(c.convertToTspans,r._gd),n}function w(t,e){var r=s.ensureSingle(t,"g",h.labelsClass),i=e._dims,o=r.selectAll("g."+h.labelGroupClass).data(i.labelSteps);o.enter().append("g").classed(h.labelGroupClass,!0),o.exit().remove(),o.each((function(t){var r=n.select(this);r.call(_,t,e),a.setTranslate(r,C(e,t.fraction),h.tickOffset+e.ticklen+e.font.size*f+h.labelOffset+i.currentValueTotalHeight)}))}function k(t,e,r,n,i){var o=Math.round(n*(r._stepCount-1)),a=r._visibleSteps[o]._index;a!==r.active&&A(t,e,r,a,!0,i)}function A(t,e,r,n,o,a){var s=r.active;r.active=n,u(t.layout,h.name,r).applyUpdate("active",n);var l=r.steps[r.active];e.call(S,r,a),e.call(y,r),t.emit("plotly_sliderchange",{slider:r,step:r.steps[r.active],interaction:o,previousActive:s}),l&&l.method&&o&&(e._nextMethod?(e._nextMethod.step=l,e._nextMethod.doCallback=o,e._nextMethod.doTransition=a):(e._nextMethod={step:l,doCallback:o,doTransition:a},e._nextMethodRaf=window.requestAnimationFrame((function(){var r=e._nextMethod.step;r.method&&(r.execute&&i.executeAPICommand(t,r.method,r.args),e._nextMethod=null,e._nextMethodRaf=null)}))))}function M(t,e,r){if(!e._context.staticPlot){var i=r.node(),a=n.select(e);t.on("mousedown",l),t.on("touchstart",l)}function s(){return r.data()[0]}function l(){var t=s();e.emit("plotly_sliderstart",{slider:t});var l=r.select("."+h.gripRectClass);n.event.stopPropagation(),n.event.preventDefault(),l.call(o.fill,t.activebgcolor);var c=E(t,n.mouse(i)[0]);function u(){var t=s(),o=E(t,n.mouse(i)[0]);k(e,r,t,o,!1)}function d(){var t=s();t._dragging=!1,l.call(o.fill,t.bgcolor),a.on("mouseup",null),a.on("mousemove",null),a.on("touchend",null),a.on("touchmove",null),e.emit("plotly_sliderend",{slider:t,step:t.steps[t.active]})}k(e,r,t,c,!0),t._dragging=!0,a.on("mousemove",u),a.on("touchmove",u),a.on("mouseup",d),a.on("touchend",d)}}function T(t,e){var r=t.selectAll("rect."+h.tickRectClass).data(e._visibleSteps),i=e._dims;r.enter().append("rect").classed(h.tickRectClass,!0),r.exit().remove(),r.attr({width:e.tickwidth+"px","shape-rendering":"crispEdges"}),r.each((function(t,r){var s=r%i.labelStride==0,l=n.select(this);l.attr({height:s?e.ticklen:e.minorticklen}).call(o.fill,e.tickcolor),a.setTranslate(l,C(e,r/(e._stepCount-1))-.5*e.tickwidth,(s?h.tickOffset:h.minorTickOffset)+i.currentValueTotalHeight)}))}function S(t,e,r){for(var n=t.select("rect."+h.gripRectClass),i=0,o=0;o0&&(s=s.transition().duration(e.transition.duration).ease(e.transition.easing)),s.attr("transform",l(a-.5*h.gripWidth,e._dims.currentValueTotalHeight))}}function C(t,e){var r=t._dims;return r.inputAreaStart+h.stepInset+(r.inputAreaLength-2*h.stepInset)*Math.min(1,Math.max(0,e))}function E(t,e){var r=t._dims;return Math.min(1,Math.max(0,(e-h.stepInset-r.inputAreaStart)/(r.inputAreaLength-2*h.stepInset-2*r.inputAreaStart)))}function L(t,e,r){var n=r._dims,i=s.ensureSingle(t,"rect",h.railTouchRectClass,(function(n){n.call(M,e,t,r).style("pointer-events","all")}));i.attr({width:n.inputAreaLength,height:Math.max(n.inputAreaWidth,h.tickOffset+r.ticklen+n.labelHeight)}).call(o.fill,r.bgcolor).attr("opacity",0),a.setTranslate(i,0,n.currentValueTotalHeight)}function z(t,e){var r=e._dims,n=r.inputAreaLength-2*h.railInset,i=s.ensureSingle(t,"rect",h.railRectClass);i.attr({width:n,height:h.railWidth,rx:h.railRadius,ry:h.railRadius,"shape-rendering":"crispEdges"}).call(o.stroke,e.bordercolor).call(o.fill,e.bgcolor).style("stroke-width",e.borderwidth+"px"),a.setTranslate(i,h.railInset,.5*(r.inputAreaWidth-h.railWidth)+r.currentValueTotalHeight)}t.exports=function(t){var e=t._context.staticPlot,r=t._fullLayout,o=function(t,e){for(var r=t[h.name],n=[],i=0;i0?[0]:[]);function l(e){e._commandObserver&&(e._commandObserver.remove(),delete e._commandObserver),i.autoMargin(t,g(e))}if(s.enter().append("g").classed(h.containerClassName,!0).style("cursor",e?null:"ew-resize"),s.exit().each((function(){n.select(this).selectAll("g."+h.groupClassName).each(l)})).remove(),0!==o.length){var c=s.selectAll("g."+h.groupClassName).data(o,v);c.enter().append("g").classed(h.groupClassName,!0),c.exit().each(l).remove();for(var u=0;u{"use strict";var n=r(92911);t.exports={moduleType:"component",name:n.name,layoutAttributes:r(8421),supplyLayoutDefaults:r(60626),draw:r(23350)}},6883:(t,e,r)=>{"use strict";var n=r(27941),i=r(7370),o=r(51137),a=r(25059),s=r(12822),l=s.strTranslate,c=r(40666),u=r(17499),h=r(80394),d=r(11891),f=r(89701).OPPOSITE_SIDE,p=/ [XY][0-9]* /;t.exports={draw:function(t,e,r){var m,g=t._fullLayout,v=r.propContainer,b=r.propName,y=r.placeholder,x=r.traceIndex,_=r.avoid||{},w=r.attributes,k=r.transform,A=r.containerGroup,M=1,T=v.title,S=(T&&T.text?T.text:"").trim(),C=!1,E=T&&T.font?T.font:{},L=E.family,z=E.size,O=E.color,D=E.weight,I=E.style,F=E.variant,R=E.textcase,P=E.lineposition,j=E.shadow,N=!!r.subtitlePropName,B=r.subtitlePlaceholder,U=(v.title||{}).subtitle||{text:"",font:{}},G=U.text.trim(),V=!1,H=1,W=U.font,q=W.family,Y=W.size,Z=W.color,X=W.weight,$=W.style,J=W.variant,K=W.textcase,Q=W.lineposition,tt=W.shadow;"title.text"===b?m="titleText":-1!==b.indexOf("axis")?m="axisTitleText":b.indexOf(!0)&&(m="colorbarTitleText");var et=t._context.edits[m];function rt(t,e){return void 0!==t&&void 0!==e&&t.replace(p," % ")===e.replace(p," % ")}""===S?M=0:rt(S,y)&&(et||(S=""),M=.2,C=!0),N&&(""===G?H=0:rt(G,B)&&(et||(G=""),H=.2,V=!0)),r._meta?S=s.templateString(S,r._meta):g._meta&&(S=s.templateString(S,g._meta));var nt,it=S||G||et;A||(A=s.ensureSingle(g._infolayer,"g","g-"+e),nt=g._hColorbarMoveTitle);var ot=A.selectAll("text."+e).data(it?[0]:[]);ot.enter().append("text"),ot.text(S).attr("class",e),ot.exit().remove();var at=null,st=e+"-subtitle",lt=G||et;if(N&<&&((at=A.selectAll("text."+st).data(lt?[0]:[])).enter().append("text"),at.text(G).attr("class",st),at.exit().remove()),!it)return A;function ct(t,e){s.syncOrAsync([ut,ht],{title:t,subtitle:e})}function ut(r){var i,a=r.title,d=r.subtitle;if(!k&&nt&&(k={}),k?(i="",k.rotate&&(i+="rotate("+[k.rotate,w.x,w.y]+")"),(k.offset||nt)&&(i+=l(0,(k.offset||0)-(nt||0)))):i=null,a.attr("transform",i),a.style("opacity",M*u.opacity(O)).call(c.font,{color:u.rgb(O),size:n.round(z,2),family:L,weight:D,style:I,variant:F,textcase:R,shadow:j,lineposition:P}).attr(w).call(h.convertToTspans,t,(function(t){if(t){var e=n.select(t.node().parentNode).select("."+st);if(!e.empty()){var r=t.node().getBBox();if(r.height){var i=r.y+r.height+1.6*Y;e.attr("y",i)}}}})),d){var f=A.select("."+e+"-math-group"),p=a.node().getBBox(),m=f.node()?f.node().getBBox():void 0,g=m?m.y+m.height+1.6*Y:p.y+p.height+1.6*Y,v=s.extendFlat({},w,{y:g});d.attr("transform",i),d.style("opacity",H*u.opacity(Z)).call(c.font,{color:u.rgb(Z),size:n.round(Y,2),family:q,weight:X,style:$,variant:J,textcase:K,shadow:tt,lineposition:Q}).attr(v).call(h.convertToTspans,t)}return o.previousPromises(t)}function ht(e){var r=e.title,o=n.select(r.node().parentNode);if(_&&_.selection&&_.side&&S){o.attr("transform",null);var a=f[_.side],u="left"===_.side||"top"===_.side?-1:1,h=i(_.pad)?_.pad:2,d=c.bBox(o.node()),p={t:0,b:0,l:0,r:0},m=t._fullLayout._reservedMargin;for(var b in m)for(var y in m[b]){var x=m[b][y];p[y]=Math.max(p[y],x)}var w={left:p.l,top:p.t,right:g.width-p.r,bottom:g.height-p.b},k=_.maxShift||u*(w[_.side]-d[_.side]),A=0;if(k<0)A=k;else{var M=_.offsetLeft||0,T=_.offsetTop||0;d.left-=M,d.right-=M,d.top-=T,d.bottom-=T,_.selection.each((function(){var t=c.bBox(this);s.bBoxIntersect(d,t,h)&&(A=Math.max(A,u*(t[_.side]-d[a])+h))})),A=Math.min(k,A),v._titleScoot=Math.abs(A)}if(A>0||k<0){var C={left:[-A,0],right:[A,0],top:[0,-A],bottom:[0,A]}[_.side];o.attr("transform",l(C[0],C[1]))}}}function dt(t,e){t.text(e).on("mouseover.opacity",(function(){n.select(this).transition().duration(d.SHOW_PLACEHOLDER).style("opacity",1)})).on("mouseout.opacity",(function(){n.select(this).transition().duration(d.HIDE_PLACEHOLDER).style("opacity",0)}))}if(ot.call(ct,at),et&&(S?ot.on(".opacity",null):(dt(ot,y),C=!0),ot.call(h.makeEditable,{gd:t}).on("edit",(function(e){void 0!==x?a.call("_guiRestyle",t,b,e,x):a.call("_guiRelayout",t,b,e)})).on("cancel",(function(){this.text(this.attr("data-unformatted")).call(ct)})).on("input",(function(t){this.text(t||" ").call(h.positionText,w.x,w.y)})),N)){if(N&&!S){var ft=ot.node().getBBox(),pt=ft.y+ft.height+1.6*Y;at.attr("y",pt)}G?at.on(".opacity",null):(dt(at,B),V=!0),at.call(h.makeEditable,{gd:t}).on("edit",(function(e){a.call("_guiRelayout",t,"title.subtitle.text",e)})).on("cancel",(function(){this.text(this.attr("data-unformatted")).call(ct)})).on("input",(function(t){this.text(t||" ").call(h.positionText,at.attr("x"),at.attr("y"))}))}return ot.classed("js-placeholder",C),at&&at.classed("js-placeholder",V),A},SUBTITLE_PADDING_EM:1.6,SUBTITLE_PADDING_MATHJAX_EM:1.6}},40658:(t,e,r)=>{"use strict";var n=r(75058),i=r(84226),o=r(98260).extendFlat,a=r(62309).overrideAll,s=r(85538),l=r(46121).templatedArray,c=l("button",{visible:{valType:"boolean",description:"Determines whether or not this button is visible."},method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle",description:["Sets the Plotly method to be called on click.","If the `skip` method is used, the API updatemenu will function as normal","but will perform no API calls and will not bind automatically to state","updates. This may be used to create a component interface and attach to","updatemenu events manually via JavaScript."].join(" ")},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}],description:["Sets the arguments values to be passed to the Plotly","method set in `method` on click."].join(" ")},args2:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}],description:["Sets a 2nd set of `args`,","these arguments values are passed to the Plotly","method set in `method` when clicking this button while in the active state.","Use this to create toggle buttons."].join(" ")},label:{valType:"string",dflt:"",description:"Sets the text label to appear on the button."},execute:{valType:"boolean",dflt:!0,description:["When true, the API method is executed. When false, all other behaviors are the same","and command execution is skipped. This may be useful when hooking into, for example,","the `plotly_buttonclicked` method and executing the API command manually without losing","the benefit of the updatemenu automatically binding to the state of the plot through the","specification of `method` and `args`."].join(" ")}});t.exports=a(l("updatemenu",{_arrayAttrRegexps:[/^updatemenus\[(0|[1-9][0-9]+)\]\.buttons/],visible:{valType:"boolean",description:["Determines whether or not the update menu is visible."].join(" ")},type:{valType:"enumerated",values:["dropdown","buttons"],dflt:"dropdown",description:["Determines whether the buttons are accessible via a dropdown menu","or whether the buttons are stacked horizontally or vertically"].join(" ")},direction:{valType:"enumerated",values:["left","right","up","down"],dflt:"down",description:["Determines the direction in which the buttons are laid out, whether","in a dropdown menu or a row/column of buttons. For `left` and `up`,","the buttons will still appear in left-to-right or top-to-bottom order","respectively."].join(" ")},active:{valType:"integer",min:-1,dflt:0,description:["Determines which button (by index starting from 0) is","considered active."].join(" ")},showactive:{valType:"boolean",dflt:!0,description:"Highlights active dropdown item or active button if true."},buttons:c,x:{valType:"number",min:-2,max:3,dflt:-.05,description:"Sets the x position (in normalized coordinates) of the update menu."},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"right",description:["Sets the update menu's horizontal position anchor.","This anchor binds the `x` position to the *left*, *center*","or *right* of the range selector."].join(" ")},y:{valType:"number",min:-2,max:3,dflt:1,description:"Sets the y position (in normalized coordinates) of the update menu."},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"top",description:["Sets the update menu's vertical position anchor","This anchor binds the `y` position to the *top*, *middle*","or *bottom* of the range selector."].join(" ")},pad:o(s({editType:"arraydraw"}),{description:"Sets the padding around the buttons or dropdown menu."}),font:n({description:"Sets the font of the update menu button text."}),bgcolor:{valType:"color",description:"Sets the background color of the update menu buttons."},bordercolor:{valType:"color",dflt:i.borderLine,description:"Sets the color of the border enclosing the update menu."},borderwidth:{valType:"number",min:0,dflt:1,editType:"arraydraw",description:"Sets the width (in px) of the border enclosing the update menu."}}),"arraydraw","from-root")},13518:t=>{"use strict";t.exports={name:"updatemenus",containerClassName:"updatemenu-container",headerGroupClassName:"updatemenu-header-group",headerClassName:"updatemenu-header",headerArrowClassName:"updatemenu-header-arrow",dropdownButtonGroupClassName:"updatemenu-dropdown-button-group",dropdownButtonClassName:"updatemenu-dropdown-button",buttonClassName:"updatemenu-button",itemRectClassName:"updatemenu-item-rect",itemTextClassName:"updatemenu-item-text",menuIndexAttrName:"updatemenu-active-index",autoMarginIdRoot:"updatemenu-",blankHeaderOpts:{label:" "},minWidth:30,minHeight:30,textPadX:24,arrowPadX:16,rx:2,ry:2,textOffsetX:12,textOffsetY:3,arrowOffsetX:4,gapButtonHeader:5,gapButton:2,activeColor:"#F4FAFF",hoverColor:"#F4FAFF",arrowSymbol:{left:"◄",right:"►",up:"▲",down:"▼"}}},42757:(t,e,r)=>{"use strict";var n=r(12822),i=r(35677),o=r(40658),a=r(13518).name,s=o.buttons;function l(t,e,r){function a(r,i){return n.coerce(t,e,o,r,i)}a("visible",i(t,e,{name:"buttons",handleItemDefaults:c}).length>0)&&(a("active"),a("direction"),a("type"),a("showactive"),a("x"),a("y"),n.noneOrAll(t,e,["x","y"]),a("xanchor"),a("yanchor"),a("pad.t"),a("pad.r"),a("pad.b"),a("pad.l"),n.coerceFont(a,"font",r.font),a("bgcolor",r.paper_bgcolor),a("bordercolor"),a("borderwidth"))}function c(t,e){function r(r,i){return n.coerce(t,e,s,r,i)}r("visible","skip"===t.method||Array.isArray(t.args))&&(r("method"),r("args"),r("args2"),r("label"),r("execute"))}t.exports=function(t,e){i(t,e,{name:a,handleItemDefaults:l})}},86925:(t,e,r)=>{"use strict";var n=r(27941),i=r(51137),o=r(17499),a=r(40666),s=r(12822),l=r(80394),c=r(46121).arrayEditor,u=r(89701).LINE_SPACING,h=r(13518),d=r(90633);function f(t){return t._index}function p(t,e){return+t.attr(h.menuIndexAttrName)===e._index}function m(t,e,r,n,i,o,a,s){e.active=a,c(t.layout,h.name,e).applyUpdate("active",a),"buttons"===e.type?v(t,n,null,null,e):"dropdown"===e.type&&(i.attr(h.menuIndexAttrName,"-1"),g(t,n,i,o,e),s||v(t,n,i,o,e))}function g(t,e,r,n,i){var o=s.ensureSingle(e,"g",h.headerClassName,(function(t){t.style("pointer-events","all")})),l=i._dims,c=i.active,u=i.buttons[c]||h.blankHeaderOpts,d={y:i.pad.t,yPad:0,x:i.pad.l,xPad:0,index:0},f={width:l.headerWidth,height:l.headerHeight};o.call(b,i,u,t).call(T,i,d,f),s.ensureSingle(e,"text",h.headerArrowClassName,(function(t){t.attr("text-anchor","end").call(a.font,i.font).text(h.arrowSymbol[i.direction])})).attr({x:l.headerWidth-h.arrowOffsetX+i.pad.l,y:l.headerHeight/2+h.textOffsetY+i.pad.t}),o.on("click",(function(){r.call(S,String(p(r,i)?-1:i._index)),v(t,e,r,n,i)})),o.on("mouseover",(function(){o.call(w)})),o.on("mouseout",(function(){o.call(k,i)})),a.setTranslate(e,l.lx,l.ly)}function v(t,e,r,o,a){r||(r=e).attr("pointer-events","all");var l=function(t){return-1==+t.attr(h.menuIndexAttrName)}(r)&&"buttons"!==a.type?[]:a.buttons,c="dropdown"===a.type?h.dropdownButtonClassName:h.buttonClassName,u=r.selectAll("g."+c).data(s.filterVisible(l)),d=u.enter().append("g").classed(c,!0),f=u.exit();"dropdown"===a.type?(d.attr("opacity","0").transition().attr("opacity","1"),f.transition().attr("opacity","0").remove()):f.remove();var p=0,g=0,v=a._dims,y=-1!==["up","down"].indexOf(a.direction);"dropdown"===a.type&&(y?g=v.headerHeight+h.gapButtonHeader:p=v.headerWidth+h.gapButtonHeader),"dropdown"===a.type&&"up"===a.direction&&(g=-h.gapButtonHeader+h.gapButton-v.openHeight),"dropdown"===a.type&&"left"===a.direction&&(p=-h.gapButtonHeader+h.gapButton-v.openWidth);var x={x:v.lx+p+a.pad.l,y:v.ly+g+a.pad.t,yPad:h.gapButton,xPad:h.gapButton,index:0},A={l:x.x+a.borderwidth,t:x.y+a.borderwidth};u.each((function(s,l){var c=n.select(this);c.call(b,a,s,t).call(T,a,x),c.on("click",(function(){n.event.defaultPrevented||(s.execute&&(s.args2&&a.active===l?(m(t,a,0,e,r,o,-1),i.executeAPICommand(t,s.method,s.args2)):(m(t,a,0,e,r,o,l),i.executeAPICommand(t,s.method,s.args))),t.emit("plotly_buttonclicked",{menu:a,button:s,active:a.active}))})),c.on("mouseover",(function(){c.call(w)})),c.on("mouseout",(function(){c.call(k,a),u.call(_,a)}))})),u.call(_,a),y?(A.w=Math.max(v.openWidth,v.headerWidth),A.h=x.y-A.t):(A.w=x.x-A.l,A.h=Math.max(v.openHeight,v.headerHeight)),A.direction=a.direction,o&&(u.size()?function(t,e,r,n,i,o){var a,s,l,c=i.direction,u="up"===c||"down"===c,d=i._dims,f=i.active;if(u)for(s=0,l=0;l0?[0]:[]);if(a.enter().append("g").classed(h.containerClassName,!0).style("cursor","pointer"),a.exit().each((function(){n.select(this).selectAll("g."+h.headerGroupClassName).each(o)})).remove(),0!==r.length){var l=a.selectAll("g."+h.headerGroupClassName).data(r,f);l.enter().append("g").classed(h.headerGroupClassName,!0);for(var c=s.ensureSingle(a,"g",h.dropdownButtonGroupClassName,(function(t){t.style("pointer-events","all")})),u=0;u{"use strict";var n=r(13518);t.exports={moduleType:"component",name:n.name,layoutAttributes:r(40658),supplyLayoutDefaults:r(42757),draw:r(86925)}},90633:(t,e,r)=>{"use strict";t.exports=s;var n=r(27941),i=r(17499),o=r(40666),a=r(12822);function s(t,e,r){this.gd=t,this.container=e,this.id=r,this.position=null,this.translateX=null,this.translateY=null,this.hbar=null,this.vbar=null,this.bg=this.container.selectAll("rect.scrollbox-bg").data([0]),this.bg.exit().on(".drag",null).on("wheel",null).remove(),this.bg.enter().append("rect").classed("scrollbox-bg",!0).style("pointer-events","all").attr({opacity:0,x:0,y:0,width:0,height:0})}s.barWidth=2,s.barLength=20,s.barRadius=2,s.barPad=1,s.barColor="#808BA4",s.prototype.enable=function(t,e,r){var a=this.gd._fullLayout,l=a.width,c=a.height;this.position=t;var u,h,d,f,p=this.position.l,m=this.position.w,g=this.position.t,v=this.position.h,b=this.position.direction,y="down"===b,x="left"===b,_="up"===b,w=m,k=v;y||x||"right"===b||_||(this.position.direction="down",y=!0),y||_?(h=(u=p)+w,y?(d=g,k=(f=Math.min(d+k,c))-d):k=(f=g+k)-(d=Math.max(f-k,0))):(f=(d=g)+k,x?w=(h=p+w)-(u=Math.max(h-w,0)):(u=p,w=(h=Math.min(u+w,l))-u)),this._box={l:u,t:d,w,h:k};var A=m>w,M=s.barLength+2*s.barPad,T=s.barWidth+2*s.barPad,S=p,C=g+v;C+T>c&&(C=c-T);var E=this.container.selectAll("rect.scrollbar-horizontal").data(A?[0]:[]);E.exit().on(".drag",null).remove(),E.enter().append("rect").classed("scrollbar-horizontal",!0).call(i.fill,s.barColor),A?(this.hbar=E.attr({rx:s.barRadius,ry:s.barRadius,x:S,y:C,width:M,height:T}),this._hbarXMin=S+M/2,this._hbarTranslateMax=w-M):(delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax);var L=v>k,z=s.barWidth+2*s.barPad,O=s.barLength+2*s.barPad,D=p+m,I=g;D+z>l&&(D=l-z);var F=this.container.selectAll("rect.scrollbar-vertical").data(L?[0]:[]);F.exit().on(".drag",null).remove(),F.enter().append("rect").classed("scrollbar-vertical",!0).call(i.fill,s.barColor),L?(this.vbar=F.attr({rx:s.barRadius,ry:s.barRadius,x:D,y:I,width:z,height:O}),this._vbarYMin=I+O/2,this._vbarTranslateMax=k-O):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var R=this.id,P=u-.5,j=L?h+z+.5:h+.5,N=d-.5,B=A?f+T+.5:f+.5,U=a._topdefs.selectAll("#"+R).data(A||L?[0]:[]);if(U.exit().remove(),U.enter().append("clipPath").attr("id",R).append("rect"),A||L?(this._clipRect=U.select("rect").attr({x:Math.floor(P),y:Math.floor(N),width:Math.ceil(j)-Math.floor(P),height:Math.ceil(B)-Math.floor(N)}),this.container.call(o.setClipUrl,R,this.gd),this.bg.attr({x:p,y:g,width:m,height:v})):(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(o.setClipUrl,null),delete this._clipRect),A||L){var G=n.behavior.drag().on("dragstart",(function(){n.event.sourceEvent.preventDefault()})).on("drag",this._onBoxDrag.bind(this));this.container.on("wheel",null).on("wheel",this._onBoxWheel.bind(this)).on(".drag",null).call(G);var V=n.behavior.drag().on("dragstart",(function(){n.event.sourceEvent.preventDefault(),n.event.sourceEvent.stopPropagation()})).on("drag",this._onBarDrag.bind(this));A&&this.hbar.on(".drag",null).call(V),L&&this.vbar.on(".drag",null).call(V)}this.setTranslate(e,r)},s.prototype.disable=function(){(this.hbar||this.vbar)&&(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(o.setClipUrl,null),delete this._clipRect),this.hbar&&(this.hbar.on(".drag",null),this.hbar.remove(),delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax),this.vbar&&(this.vbar.on(".drag",null),this.vbar.remove(),delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax)},s.prototype._onBoxDrag=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t-=n.event.dx),this.vbar&&(e-=n.event.dy),this.setTranslate(t,e)},s.prototype._onBoxWheel=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t+=n.event.deltaY),this.vbar&&(e+=n.event.deltaY),this.setTranslate(t,e)},s.prototype._onBarDrag=function(){var t=this.translateX,e=this.translateY;if(this.hbar){var r=t+this._hbarXMin,i=r+this._hbarTranslateMax;t=(a.constrain(n.event.x,r,i)-r)/(i-r)*(this.position.w-this._box.w)}if(this.vbar){var o=e+this._vbarYMin,s=o+this._vbarTranslateMax;e=(a.constrain(n.event.y,o,s)-o)/(s-o)*(this.position.h-this._box.h)}this.setTranslate(t,e)},s.prototype.setTranslate=function(t,e){var r=this.position.w-this._box.w,n=this.position.h-this._box.h;if(t=a.constrain(t||0,0,r),e=a.constrain(e||0,0,n),this.translateX=t,this.translateY=e,this.container.call(o.setTranslate,this._box.l-this.position.l-t,this._box.t-this.position.t-e),this._clipRect&&this._clipRect.attr({x:Math.floor(this.position.l+t-.5),y:Math.floor(this.position.t+e-.5)}),this.hbar){var i=t/r;this.hbar.call(o.setTranslate,t+i*this._hbarTranslateMax,e)}if(this.vbar){var s=e/n;this.vbar.call(o.setTranslate,t,e+s*this._vbarTranslateMax)}}},89701:t=>{"use strict";t.exports={FROM_BL:{left:0,center:.5,right:1,bottom:0,middle:.5,top:1},FROM_TL:{left:0,center:.5,right:1,bottom:1,middle:.5,top:0},FROM_BR:{left:1,center:.5,right:0,bottom:0,middle:.5,top:1},LINE_SPACING:1.3,CAP_SHIFT:.7,MID_SHIFT:.35,OPPOSITE_SIDE:{left:"right",right:"left",top:"bottom",bottom:"top"}}},53644:t=>{"use strict";t.exports={axisRefDescription:function(t,e,r){return["If set to a",t,"axis id (e.g. *"+t+"* or","*"+t+"2*), the `"+t+"` position refers to a",t,"coordinate. If set to *paper*, the `"+t+"`","position refers to the distance from the",e,"of the plotting","area in normalized coordinates where *0* (*1*) corresponds to the",e,"("+r+"). If set to a",t,"axis ID followed by","*domain* (separated by a space), the position behaves like for","*paper*, but refers to the distance in fractions of the domain","length from the",e,"of the domain of that axis: e.g.,","*"+t+"2 domain* refers to the domain of the second",t," axis and a",t,"position of 0.5 refers to the","point between the",e,"and the",r,"of the domain of the","second",t,"axis."].join(" ")}}},77201:t=>{"use strict";t.exports={FORMAT_LINK:"https://github.com/d3/d3-format/tree/v1.4.5#d3-format",DATE_FORMAT_LINK:"https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format"}},55697:t=>{"use strict";t.exports={solid:[[],0],dot:[[.5,1],200],dash:[[.5,1],50],longdash:[[.5,1],10],dashdot:[[.5,.625,.875,1],50],longdashdot:[[.5,.7,.8,1],10]}},24134:t=>{"use strict";t.exports={circle:"●","circle-open":"○",square:"■","square-open":"□",diamond:"◆","diamond-open":"◇",cross:"+",x:"❌"}},11891:t=>{"use strict";t.exports={SHOW_PLACEHOLDER:100,HIDE_PLACEHOLDER:1e3,DESELECTDIM:.2}},32994:t=>{"use strict";t.exports={BADNUM:void 0,FP_SAFE:1e-4*Number.MAX_VALUE,ONEMAXYEAR:316224e5,ONEAVGYEAR:315576e5,ONEMINYEAR:31536e6,ONEMAXQUARTER:79488e5,ONEAVGQUARTER:78894e5,ONEMINQUARTER:76896e5,ONEMAXMONTH:26784e5,ONEAVGMONTH:26298e5,ONEMINMONTH:24192e5,ONEWEEK:6048e5,ONEDAY:864e5,ONEHOUR:36e5,ONEMIN:6e4,ONESEC:1e3,ONEMILLI:1,ONEMICROSEC:.001,EPOCHJD:2440587.5,ALMOST_EQUAL:.999999,LOG_CLIP:10,MINUS_SIGN:"−"}},25853:(t,e)=>{"use strict";e.xmlns="http://www.w3.org/2000/xmlns/",e.svg="http://www.w3.org/2000/svg",e.xlink="http://www.w3.org/1999/xlink",e.svgAttrs={xmlns:e.svg,"xmlns:xlink":e.xlink}},7623:(t,e,r)=>{"use strict";e.version=r(88566).version,r(60613),r(1146);for(var n=r(25059),i=e.register=n.register,o=r(41103),a=Object.keys(o),s=0;s{"use strict";t.exports={undo:{width:857.1,height:1e3,path:"m857 350q0-87-34-166t-91-137-137-92-166-34q-96 0-183 41t-147 114q-4 6-4 13t5 11l76 77q6 5 14 5 9-1 13-7 41-53 100-82t126-29q58 0 110 23t92 61 61 91 22 111-22 111-61 91-92 61-110 23q-55 0-105-20t-90-57l77-77q17-16 8-38-10-23-33-23h-250q-15 0-25 11t-11 25v250q0 24 22 33 22 10 39-8l72-72q60 57 137 88t159 31q87 0 166-34t137-92 91-137 34-166z",transform:"matrix(1 0 0 -1 0 850)"},home:{width:928.6,height:1e3,path:"m786 296v-267q0-15-11-26t-25-10h-214v214h-143v-214h-214q-15 0-25 10t-11 26v267q0 1 0 2t0 2l321 264 321-264q1-1 1-4z m124 39l-34-41q-5-5-12-6h-2q-7 0-12 3l-386 322-386-322q-7-4-13-4-7 2-12 7l-35 41q-4 5-3 13t6 12l401 334q18 15 42 15t43-15l136-114v109q0 8 5 13t13 5h107q8 0 13-5t5-13v-227l122-102q5-5 6-12t-4-13z",transform:"matrix(1 0 0 -1 0 850)"},"camera-retro":{width:1e3,height:1e3,path:"m518 386q0 8-5 13t-13 5q-37 0-63-27t-26-63q0-8 5-13t13-5 12 5 5 13q0 23 16 38t38 16q8 0 13 5t5 13z m125-73q0-59-42-101t-101-42-101 42-42 101 42 101 101 42 101-42 42-101z m-572-320h858v71h-858v-71z m643 320q0 89-62 152t-152 62-151-62-63-152 63-151 151-63 152 63 62 151z m-571 358h214v72h-214v-72z m-72-107h858v143h-462l-36-71h-360v-72z m929 143v-714q0-30-21-51t-50-21h-858q-29 0-50 21t-21 51v714q0 30 21 51t50 21h858q29 0 50-21t21-51z",transform:"matrix(1 0 0 -1 0 850)"},zoombox:{width:1e3,height:1e3,path:"m1000-25l-250 251c40 63 63 138 63 218 0 224-182 406-407 406-224 0-406-182-406-406s183-406 407-406c80 0 155 22 218 62l250-250 125 125z m-812 250l0 438 437 0 0-438-437 0z m62 375l313 0 0-312-313 0 0 312z",transform:"matrix(1 0 0 -1 0 850)"},pan:{width:1e3,height:1e3,path:"m1000 350l-187 188 0-125-250 0 0 250 125 0-188 187-187-187 125 0 0-250-250 0 0 125-188-188 186-187 0 125 252 0 0-250-125 0 187-188 188 188-125 0 0 250 250 0 0-126 187 188z",transform:"matrix(1 0 0 -1 0 850)"},zoom_plus:{width:875,height:1e3,path:"m1 787l0-875 875 0 0 875-875 0z m687-500l-187 0 0-187-125 0 0 187-188 0 0 125 188 0 0 187 125 0 0-187 187 0 0-125z",transform:"matrix(1 0 0 -1 0 850)"},zoom_minus:{width:875,height:1e3,path:"m0 788l0-876 875 0 0 876-875 0z m688-500l-500 0 0 125 500 0 0-125z",transform:"matrix(1 0 0 -1 0 850)"},autoscale:{width:1e3,height:1e3,path:"m250 850l-187 0-63 0 0-62 0-188 63 0 0 188 187 0 0 62z m688 0l-188 0 0-62 188 0 0-188 62 0 0 188 0 62-62 0z m-875-938l0 188-63 0 0-188 0-62 63 0 187 0 0 62-187 0z m875 188l0-188-188 0 0-62 188 0 62 0 0 62 0 188-62 0z m-125 188l-1 0-93-94-156 156 156 156 92-93 2 0 0 250-250 0 0-2 93-92-156-156-156 156 94 92 0 2-250 0 0-250 0 0 93 93 157-156-157-156-93 94 0 0 0-250 250 0 0 0-94 93 156 157 156-157-93-93 0 0 250 0 0 250z",transform:"matrix(1 0 0 -1 0 850)"},tooltip_basic:{width:1500,height:1e3,path:"m375 725l0 0-375-375 375-374 0-1 1125 0 0 750-1125 0z",transform:"matrix(1 0 0 -1 0 850)"},tooltip_compare:{width:1125,height:1e3,path:"m187 786l0 2-187-188 188-187 0 0 937 0 0 373-938 0z m0-499l0 1-187-188 188-188 0 0 937 0 0 376-938-1z",transform:"matrix(1 0 0 -1 0 850)"},plotlylogo:{width:1542,height:1e3,path:"m0-10h182v-140h-182v140z m228 146h183v-286h-183v286z m225 714h182v-1000h-182v1000z m225-285h182v-715h-182v715z m225 142h183v-857h-183v857z m231-428h182v-429h-182v429z m225-291h183v-138h-183v138z",transform:"matrix(1 0 0 -1 0 850)"},"z-axis":{width:1e3,height:1e3,path:"m833 5l-17 108v41l-130-65 130-66c0 0 0 38 0 39 0-1 36-14 39-25 4-15-6-22-16-30-15-12-39-16-56-20-90-22-187-23-279-23-261 0-341 34-353 59 3 60 228 110 228 110-140-8-351-35-351-116 0-120 293-142 474-142 155 0 477 22 477 142 0 50-74 79-163 96z m-374 94c-58-5-99-21-99-40 0-24 65-43 144-43 79 0 143 19 143 43 0 19-42 34-98 40v216h87l-132 135-133-135h88v-216z m167 515h-136v1c16 16 31 34 46 52l84 109v54h-230v-71h124v-1c-16-17-28-32-44-51l-89-114v-51h245v72z",transform:"matrix(1 0 0 -1 0 850)"},"3d_rotate":{width:1e3,height:1e3,path:"m922 660c-5 4-9 7-14 11-359 263-580-31-580-31l-102 28 58-400c0 1 1 1 2 2 118 108 351 249 351 249s-62 27-100 42c88 83 222 183 347 122 16-8 30-17 44-27-2 1-4 2-6 4z m36-329c0 0 64 229-88 296-62 27-124 14-175-11 157-78 225-208 249-266 8-19 11-31 11-31 2 5 6 15 11 32-5-13-8-20-8-20z m-775-239c70-31 117-50 198-32-121 80-199 346-199 346l-96-15-58-12c0 0 55-226 155-287z m603 133l-317-139c0 0 4-4 19-14 7-5 24-15 24-15s-177-147-389 4c235-287 536-112 536-112l31-22 100 299-4-1z m-298-153c6-4 14-9 24-15 0 0-17 10-24 15z",transform:"matrix(1 0 0 -1 0 850)"},camera:{width:1e3,height:1e3,path:"m500 450c-83 0-150-67-150-150 0-83 67-150 150-150 83 0 150 67 150 150 0 83-67 150-150 150z m400 150h-120c-16 0-34 13-39 29l-31 93c-6 15-23 28-40 28h-340c-16 0-34-13-39-28l-31-94c-6-15-23-28-40-28h-120c-55 0-100-45-100-100v-450c0-55 45-100 100-100h800c55 0 100 45 100 100v450c0 55-45 100-100 100z m-400-550c-138 0-250 112-250 250 0 138 112 250 250 250 138 0 250-112 250-250 0-138-112-250-250-250z m365 380c-19 0-35 16-35 35 0 19 16 35 35 35 19 0 35-16 35-35 0-19-16-35-35-35z",transform:"matrix(1 0 0 -1 0 850)"},movie:{width:1e3,height:1e3,path:"m938 413l-188-125c0 37-17 71-44 94 64 38 107 107 107 187 0 121-98 219-219 219-121 0-219-98-219-219 0-61 25-117 66-156h-115c30 33 49 76 49 125 0 103-84 187-187 187s-188-84-188-187c0-57 26-107 65-141-38-22-65-62-65-109v-250c0-70 56-126 125-126h500c69 0 125 56 125 126l188-126c34 0 62 28 62 63v375c0 35-28 63-62 63z m-750 0c-69 0-125 56-125 125s56 125 125 125 125-56 125-125-56-125-125-125z m406-1c-87 0-157 70-157 157 0 86 70 156 157 156s156-70 156-156-70-157-156-157z",transform:"matrix(1 0 0 -1 0 850)"},question:{width:857.1,height:1e3,path:"m500 82v107q0 8-5 13t-13 5h-107q-8 0-13-5t-5-13v-107q0-8 5-13t13-5h107q8 0 13 5t5 13z m143 375q0 49-31 91t-77 65-95 23q-136 0-207-119-9-14 4-24l74-55q4-4 10-4 9 0 14 7 30 38 48 51 19 14 48 14 27 0 48-15t21-33q0-21-11-34t-38-25q-35-16-65-48t-29-70v-20q0-8 5-13t13-5h107q8 0 13 5t5 13q0 10 12 27t30 28q18 10 28 16t25 19 25 27 16 34 7 45z m214-107q0-117-57-215t-156-156-215-58-216 58-155 156-58 215 58 215 155 156 216 58 215-58 156-156 57-215z",transform:"matrix(1 0 0 -1 0 850)"},disk:{width:857.1,height:1e3,path:"m214-7h429v214h-429v-214z m500 0h72v500q0 8-6 21t-11 20l-157 156q-5 6-19 12t-22 5v-232q0-22-15-38t-38-16h-322q-22 0-37 16t-16 38v232h-72v-714h72v232q0 22 16 38t37 16h465q22 0 38-16t15-38v-232z m-214 518v178q0 8-5 13t-13 5h-107q-7 0-13-5t-5-13v-178q0-8 5-13t13-5h107q7 0 13 5t5 13z m357-18v-518q0-22-15-38t-38-16h-750q-23 0-38 16t-16 38v750q0 22 16 38t38 16h517q23 0 50-12t42-26l156-157q16-15 27-42t11-49z",transform:"matrix(1 0 0 -1 0 850)"},drawopenpath:{width:70,height:70,path:"M33.21,85.65a7.31,7.31,0,0,1-2.59-.48c-8.16-3.11-9.27-19.8-9.88-41.3-.1-3.58-.19-6.68-.35-9-.15-2.1-.67-3.48-1.43-3.79-2.13-.88-7.91,2.32-12,5.86L3,32.38c1.87-1.64,11.55-9.66,18.27-6.9,2.13.87,4.75,3.14,5.17,9,.17,2.43.26,5.59.36,9.25a224.17,224.17,0,0,0,1.5,23.4c1.54,10.76,4,12.22,4.48,12.4.84.32,2.79-.46,5.76-3.59L43,80.07C41.53,81.57,37.68,85.64,33.21,85.65ZM74.81,69a11.34,11.34,0,0,0,6.09-6.72L87.26,44.5,74.72,32,56.9,38.35c-2.37.86-5.57,3.42-6.61,6L38.65,72.14l8.42,8.43ZM55,46.27a7.91,7.91,0,0,1,3.64-3.17l14.8-5.3,8,8L76.11,60.6l-.06.19a6.37,6.37,0,0,1-3,3.43L48.25,74.59,44.62,71Zm16.57,7.82A6.9,6.9,0,1,0,64.64,61,6.91,6.91,0,0,0,71.54,54.09Zm-4.05,0a2.85,2.85,0,1,1-2.85-2.85A2.86,2.86,0,0,1,67.49,54.09Zm-4.13,5.22L60.5,56.45,44.26,72.7l2.86,2.86ZM97.83,35.67,84.14,22l-8.57,8.57L89.26,44.24Zm-13.69-8,8,8-2.85,2.85-8-8Z",transform:"matrix(1 0 0 1 -15 -15)"},drawclosedpath:{width:90,height:90,path:"M88.41,21.12a26.56,26.56,0,0,0-36.18,0l-2.07,2-2.07-2a26.57,26.57,0,0,0-36.18,0,23.74,23.74,0,0,0,0,34.8L48,90.12a3.22,3.22,0,0,0,4.42,0l36-34.21a23.73,23.73,0,0,0,0-34.79ZM84,51.24,50.16,83.35,16.35,51.25a17.28,17.28,0,0,1,0-25.47,20,20,0,0,1,27.3,0l4.29,4.07a3.23,3.23,0,0,0,4.44,0l4.29-4.07a20,20,0,0,1,27.3,0,17.27,17.27,0,0,1,0,25.46ZM66.76,47.68h-33v6.91h33ZM53.35,35H46.44V68h6.91Z",transform:"matrix(1 0 0 1 -5 -5)"},lasso:{width:1031,height:1e3,path:"m1018 538c-36 207-290 336-568 286-277-48-473-256-436-463 10-57 36-108 76-151-13-66 11-137 68-183 34-28 75-41 114-42l-55-70 0 0c-2-1-3-2-4-3-10-14-8-34 5-45 14-11 34-8 45 4 1 1 2 3 2 5l0 0 113 140c16 11 31 24 45 40 4 3 6 7 8 11 48-3 100 0 151 9 278 48 473 255 436 462z m-624-379c-80 14-149 48-197 96 42 42 109 47 156 9 33-26 47-66 41-105z m-187-74c-19 16-33 37-39 60 50-32 109-55 174-68-42-25-95-24-135 8z m360 75c-34-7-69-9-102-8 8 62-16 128-68 170-73 59-175 54-244-5-9 20-16 40-20 61-28 159 121 317 333 354s407-60 434-217c28-159-121-318-333-355z",transform:"matrix(1 0 0 -1 0 850)"},selectbox:{width:1e3,height:1e3,path:"m0 850l0-143 143 0 0 143-143 0z m286 0l0-143 143 0 0 143-143 0z m285 0l0-143 143 0 0 143-143 0z m286 0l0-143 143 0 0 143-143 0z m-857-286l0-143 143 0 0 143-143 0z m857 0l0-143 143 0 0 143-143 0z m-857-285l0-143 143 0 0 143-143 0z m857 0l0-143 143 0 0 143-143 0z m-857-286l0-143 143 0 0 143-143 0z m286 0l0-143 143 0 0 143-143 0z m285 0l0-143 143 0 0 143-143 0z m286 0l0-143 143 0 0 143-143 0z",transform:"matrix(1 0 0 -1 0 850)"},drawline:{width:70,height:70,path:"M60.64,62.3a11.29,11.29,0,0,0,6.09-6.72l6.35-17.72L60.54,25.31l-17.82,6.4c-2.36.86-5.57,3.41-6.6,6L24.48,65.5l8.42,8.42ZM40.79,39.63a7.89,7.89,0,0,1,3.65-3.17l14.79-5.31,8,8L61.94,54l-.06.19a6.44,6.44,0,0,1-3,3.43L34.07,68l-3.62-3.63Zm16.57,7.81a6.9,6.9,0,1,0-6.89,6.9A6.9,6.9,0,0,0,57.36,47.44Zm-4,0a2.86,2.86,0,1,1-2.85-2.85A2.86,2.86,0,0,1,53.32,47.44Zm-4.13,5.22L46.33,49.8,30.08,66.05l2.86,2.86ZM83.65,29,70,15.34,61.4,23.9,75.09,37.59ZM70,21.06l8,8-2.84,2.85-8-8ZM87,80.49H10.67V87H87Z",transform:"matrix(1 0 0 1 -15 -15)"},drawrect:{width:80,height:80,path:"M78,22V79H21V22H78m9-9H12V88H87V13ZM68,46.22H31V54H68ZM53,32H45.22V69H53Z",transform:"matrix(1 0 0 1 -10 -10)"},drawcircle:{width:80,height:80,path:"M50,84.72C26.84,84.72,8,69.28,8,50.3S26.84,15.87,50,15.87,92,31.31,92,50.3,73.16,84.72,50,84.72Zm0-60.59c-18.6,0-33.74,11.74-33.74,26.17S31.4,76.46,50,76.46,83.74,64.72,83.74,50.3,68.6,24.13,50,24.13Zm17.15,22h-34v7.11h34Zm-13.8-13H46.24v34h7.11Z",transform:"matrix(1 0 0 1 -10 -10)"},eraseshape:{width:80,height:80,path:"M82.77,78H31.85L6,49.57,31.85,21.14H82.77a8.72,8.72,0,0,1,8.65,8.77V69.24A8.72,8.72,0,0,1,82.77,78ZM35.46,69.84H82.77a.57.57,0,0,0,.49-.6V29.91a.57.57,0,0,0-.49-.61H35.46L17,49.57Zm32.68-34.7-24,24,5,5,24-24Zm-19,.53-5,5,24,24,5-5Z",transform:"matrix(1 0 0 1 -10 -10)"},spikeline:{width:1e3,height:1e3,path:"M512 409c0-57-46-104-103-104-57 0-104 47-104 104 0 57 47 103 104 103 57 0 103-46 103-103z m-327-39l92 0 0 92-92 0z m-185 0l92 0 0 92-92 0z m370-186l92 0 0 93-92 0z m0-184l92 0 0 92-92 0z",transform:"matrix(1.5 0 0 -1.5 0 850)"},pencil:{width:1792,height:1792,path:"M491 1536l91-91-235-235-91 91v107h128v128h107zm523-928q0-22-22-22-10 0-17 7l-542 542q-7 7-7 17 0 22 22 22 10 0 17-7l542-542q7-7 7-17zm-54-192l416 416-832 832h-416v-416zm683 96q0 53-37 90l-166 166-416-416 166-165q36-38 90-38 53 0 91 38l235 234q37 39 37 91z",transform:"matrix(1 0 0 1 0 1)"},newplotlylogo:{name:"newplotlylogo",svg:["",""," ",""," plotly-logomark"," "," "," "," "," "," "," "," "," "," "," "," "," ",""].join("")}}},66379:(t,e)=>{"use strict";e.isLeftAnchor=function(t){return"left"===t.xanchor||"auto"===t.xanchor&&t.x<=1/3},e.isCenterAnchor=function(t){return"center"===t.xanchor||"auto"===t.xanchor&&t.x>1/3&&t.x<2/3},e.isRightAnchor=function(t){return"right"===t.xanchor||"auto"===t.xanchor&&t.x>=2/3},e.isTopAnchor=function(t){return"top"===t.yanchor||"auto"===t.yanchor&&t.y>=2/3},e.isMiddleAnchor=function(t){return"middle"===t.yanchor||"auto"===t.yanchor&&t.y>1/3&&t.y<2/3},e.isBottomAnchor=function(t){return"bottom"===t.yanchor||"auto"===t.yanchor&&t.y<=1/3}},59804:(t,e,r)=>{"use strict";var n=r(31918),i=n.mod,o=n.modHalf,a=Math.PI,s=2*a;function l(t){return Math.abs(t[1]-t[0])>s-1e-14}function c(t,e){return o(e-t,s)}function u(t,e){if(l(e))return!0;var r,n;e[0](n=i(n,s))&&(n+=s);var o=i(t,s),a=o+s;return o>=r&&o<=n||a>=r&&a<=n}function h(t,e,r,n,i,o,c){i=i||0,o=o||0;var u,h,d,f,p,m=l([r,n]);function g(t,e){return[t*Math.cos(e)+i,o-t*Math.sin(e)]}m?(u=0,h=a,d=s):r=i&&t<=o);var i,o},pathArc:function(t,e,r,n,i){return h(null,t,e,r,n,i,0)},pathSector:function(t,e,r,n,i){return h(null,t,e,r,n,i,1)},pathAnnulus:function(t,e,r,n,i,o){return h(t,e,r,n,i,o,1)}}},98507:(t,e,r)=>{"use strict";var n=r(44514).decode,i=r(12517),o=Array.isArray,a=ArrayBuffer,s=DataView;function l(t){return a.isView(t)&&!(t instanceof s)}function c(t){return o(t)||l(t)}e.isTypedArray=l,e.isArrayOrTypedArray=c,e.isArray1D=function(t){return!c(t[0])},e.ensureArray=function(t,e){return o(t)||(t=[]),t.length=e,t};var u={u1c:"undefined"==typeof Uint8ClampedArray?void 0:Uint8ClampedArray,i1:"undefined"==typeof Int8Array?void 0:Int8Array,u1:"undefined"==typeof Uint8Array?void 0:Uint8Array,i2:"undefined"==typeof Int16Array?void 0:Int16Array,u2:"undefined"==typeof Uint16Array?void 0:Uint16Array,i4:"undefined"==typeof Int32Array?void 0:Int32Array,u4:"undefined"==typeof Uint32Array?void 0:Uint32Array,f4:"undefined"==typeof Float32Array?void 0:Float32Array,f8:"undefined"==typeof Float64Array?void 0:Float64Array};function h(t){return t.constructor===ArrayBuffer}function d(t,e,r){if(c(t)){if(c(t[0])){for(var n=r,i=0;i{"use strict";var n=r(7370),i=r(32994).BADNUM,o=/^['"%,$#\s']+|[, ]|['"%,$#\s']+$/g;t.exports=function(t){return"string"==typeof t&&(t=t.replace(o,"")),n(t)?Number(t):i}},86748:t=>{"use strict";t.exports=function(t){var e=t._fullLayout;e._glcanvas&&e._glcanvas.size()&&e._glcanvas.each((function(t){t.regl&&t.regl.clear({color:!0,depth:!0})}))}},11704:t=>{"use strict";t.exports=function(t){t._responsiveChartHandler&&(window.removeEventListener("resize",t._responsiveChartHandler),delete t._responsiveChartHandler)}},5365:(t,e,r)=>{"use strict";var n=r(7370),i=r(18106),o=r(98260).extendFlat,a=r(3520),s=r(78920),l=r(17499),c=r(11891).DESELECTDIM,u=r(91355),h=r(46233).counter,d=r(31918).modHalf,f=r(98507).isArrayOrTypedArray,p=r(98507).isTypedArraySpec,m=r(98507).decodeTypedArraySpec;function g(t,r){var n=e.valObjectMeta[r.valType];if(r.arrayOk&&f(t))return!0;if(n.validateFunction)return n.validateFunction(t,r);var i={},o=i,a={set:function(t){o=t}};return n.coerceFunction(t,a,i,r),o!==i}e.valObjectMeta={data_array:{description:["An {array} of data.","The value must represent an {array} or it will be ignored,","but this array can be provided in several forms:","(1) a regular {array} object","(2) a typed array (e.g. Float32Array)","(3) an object with keys dtype, bdata, and optionally shape.","In this 3rd form, dtype is one of","*f8*, *f4*.","*i4*, *u4*,","*i2*, *u2*,","*i1*, *u1* or *u1c* for Uint8ClampedArray.","In addition to shorthand `dtype` above one could also use the following forms:","*float64*, *float32*,","*int32*, *uint32*,","*int16*, *uint16*,","*int8*, *uint8* or *uint8c* for Uint8ClampedArray.","`bdata` is either a base64-encoded string or the ArrayBuffer of","an integer or float typed array.","For either multi-dimensional arrays you must also","provide its dimensions separated by comma via `shape`.","For example using `dtype`: *f4* and `shape`: *5,100* you can","declare a 2-D array that has 5 rows and 100 columns","containing float32 values i.e. 4 bits per value.","`shape` is optional for one dimensional arrays."].join(" "),requiredOpts:[],otherOpts:["dflt"],coerceFunction:function(t,e,r){e.set(f(t)?t:p(t)?m(t):r)}},enumerated:{description:["Enumerated value type. The available values are listed","in `values`."].join(" "),requiredOpts:["values"],otherOpts:["dflt","coerceNumber","arrayOk"],coerceFunction:function(t,e,r,n){n.coerceNumber&&(t=+t),-1===n.values.indexOf(t)?e.set(r):e.set(t)},validateFunction:function(t,e){e.coerceNumber&&(t=+t);for(var r=e.values,n=0;ni.max?e.set(r):e.set(+t)}},integer:{description:["An integer or an integer inside a string.","When applicable, values greater (less) than `max` (`min`)","are coerced to the `dflt`."].join(" "),requiredOpts:[],otherOpts:["dflt","min","max","arrayOk","extras"],coerceFunction:function(t,e,r,i){-1===(i.extras||[]).indexOf(t)?(p(t)&&(t=m(t)),t%1||!n(t)||void 0!==i.min&&ti.max?e.set(r):e.set(+t)):e.set(t)}},string:{description:["A string value.","Numbers are converted to strings except for attributes with","`strict` set to true."].join(" "),requiredOpts:[],otherOpts:["dflt","noBlank","strict","arrayOk","values"],coerceFunction:function(t,e,r,n){if("string"!=typeof t){var i="number"==typeof t;!0!==n.strict&&i?e.set(String(t)):e.set(r)}else n.noBlank&&!t?e.set(r):e.set(t)}},color:{description:["A string describing color.","Supported formats:","- hex (e.g. '#d3d3d3')","- rgb (e.g. 'rgb(255, 0, 0)')","- rgba (e.g. 'rgb(255, 0, 0, 0.5)')","- hsl (e.g. 'hsl(0, 100%, 50%)')","- hsv (e.g. 'hsv(0, 100%, 100%)')","- named colors (full list: http://www.w3.org/TR/css3-color/#svg-color)"].join(" "),requiredOpts:[],otherOpts:["dflt","arrayOk"],coerceFunction:function(t,e,r){p(t)&&(t=m(t)),i(t).isValid()?e.set(t):e.set(r)}},colorlist:{description:["A list of colors.","Must be an {array} containing valid colors."].join(" "),requiredOpts:[],otherOpts:["dflt"],coerceFunction:function(t,e,r){Array.isArray(t)&&t.length&&t.every((function(t){return i(t).isValid()}))?e.set(t):e.set(r)}},colorscale:{description:["A Plotly colorscale either picked by a name:","(any of",Object.keys(s.scales).join(", "),")","customized as an {array} of 2-element {arrays} where","the first element is the normalized color level value","(starting at *0* and ending at *1*),","and the second item is a valid color string."].join(" "),requiredOpts:[],otherOpts:["dflt"],coerceFunction:function(t,e,r){e.set(s.get(t,r))}},angle:{description:["A number (in degree) between -180 and 180."].join(" "),requiredOpts:[],otherOpts:["dflt","arrayOk"],coerceFunction:function(t,e,r){p(t)&&(t=m(t)),"auto"===t?e.set("auto"):n(t)?e.set(d(+t,360)):e.set(r)}},subplotid:{description:["An id string of a subplot type (given by dflt), optionally","followed by an integer >1. e.g. if dflt='geo', we can have","'geo', 'geo2', 'geo3', ..."].join(" "),requiredOpts:["dflt"],otherOpts:["regex"],coerceFunction:function(t,e,r,n){var i=n.regex||h(r);"string"==typeof t&&i.test(t)?e.set(t):e.set(r)},validateFunction:function(t,e){var r=e.dflt;return t===r||"string"==typeof t&&!!h(r).test(t)}},flaglist:{description:["A string representing a combination of flags","(order does not matter here).","Combine any of the available `flags` with *+*.","(e.g. ('lines+markers')).","Values in `extras` cannot be combined."].join(" "),requiredOpts:["flags"],otherOpts:["dflt","extras","arrayOk"],coerceFunction:function(t,e,r,n){if(-1===(n.extras||[]).indexOf(t))if("string"==typeof t){for(var i=t.split("+"),o=0;o{"use strict";var n,i,o=r(79969).DC,a=r(7370),s=r(64347),l=r(31918).mod,c=r(32994),u=c.BADNUM,h=c.ONEDAY,d=c.ONEHOUR,f=c.ONEMIN,p=c.ONESEC,m=c.EPOCHJD,g=r(25059),v=r(79969).aL,b=/^\s*(-?\d\d\d\d|\d\d)(-(\d?\d)(-(\d?\d)([ Tt]([01]?\d|2[0-3])(:([0-5]\d)(:([0-5]\d(\.\d+)?))?(Z|z|[+\-]\d\d(:?\d\d)?)?)?)?)?)?\s*$/m,y=/^\s*(-?\d\d\d\d|\d\d)(-(\d?\di?)(-(\d?\d)([ Tt]([01]?\d|2[0-3])(:([0-5]\d)(:([0-5]\d(\.\d+)?))?(Z|z|[+\-]\d\d(:?\d\d)?)?)?)?)?)?\s*$/m,x=(new Date).getFullYear()-70;function _(t){return t&&g.componentsRegistry.calendars&&"string"==typeof t&&"gregorian"!==t}function w(t,e){return String(t+Math.pow(10,e)).substr(1)}e.dateTick0=function(t,r){var n=function(t,e){return _(t)?e?g.getComponentMethod("calendars","CANONICAL_SUNDAY")[t]:g.getComponentMethod("calendars","CANONICAL_TICK")[t]:e?"2000-01-02":"2000-01-01"}(t,!!r);if(r<2)return n;var i=e.dateTime2ms(n,t);return i+=h*(r-1),e.ms2DateTime(i,0,t)},e.dfltRange=function(t){return _(t)?g.getComponentMethod("calendars","DFLTRANGE")[t]:["2000-01-01","2001-01-01"]},e.isJSDate=function(t){return"object"==typeof t&&null!==t&&"function"==typeof t.getTime},e.dateTime2ms=function(t,r){if(e.isJSDate(t)){var o=t.getTimezoneOffset()*f,a=(t.getUTCMinutes()-t.getMinutes())*f+(t.getUTCSeconds()-t.getSeconds())*p+(t.getUTCMilliseconds()-t.getMilliseconds());if(a){var s=3*f;o=o-s/2+l(a-o+s/2,s)}return(t=Number(t)-o)>=n&&t<=i?t:u}if("string"!=typeof t&&"number"!=typeof t)return u;t=String(t);var c=_(r),v=t.charAt(0);!c||"G"!==v&&"g"!==v||(t=t.substr(1),r="");var w=c&&"chinese"===r.substr(0,7),k=t.match(w?y:b);if(!k)return u;var A=k[1],M=k[3]||"1",T=Number(k[5]||1),S=Number(k[7]||0),C=Number(k[9]||0),E=Number(k[11]||0);if(c){if(2===A.length)return u;var L;A=Number(A);try{var z=g.getComponentMethod("calendars","getCal")(r);if(w){var O="i"===M.charAt(M.length-1);M=parseInt(M,10),L=z.newDate(A,z.toMonthIndex(A,M,O),T)}else L=z.newDate(A,Number(M),T)}catch(t){return u}return L?(L.toJD()-m)*h+S*d+C*f+E*p:u}A=2===A.length?(Number(A)+2e3-x)%100+x:Number(A),M-=1;var D=new Date(Date.UTC(2e3,M,T,S,C));return D.setUTCFullYear(A),D.getUTCMonth()!==M||D.getUTCDate()!==T?u:D.getTime()+E*p},n=e.MIN_MS=e.dateTime2ms("-9999"),i=e.MAX_MS=e.dateTime2ms("9999-12-31 23:59:59.9999"),e.isDateTime=function(t,r){return e.dateTime2ms(t,r)!==u};var k=90*h,A=3*d,M=5*f;function T(t,e,r,n,i){if((e||r||n||i)&&(t+=" "+w(e,2)+":"+w(r,2),(n||i)&&(t+=":"+w(n,2),i))){for(var o=4;i%10==0;)o-=1,i/=10;t+="."+w(i,o)}return t}e.ms2DateTime=function(t,e,r){if("number"!=typeof t||!(t>=n&&t<=i))return u;e||(e=0);var o,a,s,c,b,y,x=Math.floor(10*l(t+.05,1)),w=Math.round(t-x/10);if(_(r)){var S=Math.floor(w/h)+m,C=Math.floor(l(t,h));try{o=g.getComponentMethod("calendars","getCal")(r).fromJD(S).formatDate("yyyy-mm-dd")}catch(t){o=v("G%Y-%m-%d")(new Date(w))}if("-"===o.charAt(0))for(;o.length<11;)o="-0"+o.substr(1);else for(;o.length<10;)o="0"+o;a=e=n+h&&t<=i-h))return u;var e=Math.floor(10*l(t+.05,1)),r=new Date(Math.round(t-e/10));return T(o("%Y-%m-%d")(r),r.getHours(),r.getMinutes(),r.getSeconds(),10*r.getUTCMilliseconds()+e)},e.cleanDate=function(t,r,n){if(t===u)return r;if(e.isJSDate(t)||"number"==typeof t&&isFinite(t)){if(_(n))return s.error("JS Dates and milliseconds are incompatible with world calendars",t),r;if(!(t=e.ms2DateTimeLocal(+t))&&void 0!==r)return r}else if(!e.isDateTime(t,n))return s.error("unrecognized date",t),r;return t};var S=/%\d?f/g,C=/%h/g,E={1:"1",2:"1",3:"2",4:"2"};function L(t,e,r,n){t=t.replace(S,(function(t){var r=Math.min(+t.charAt(1)||6,6);return(e/1e3%1+2).toFixed(r).substr(2).replace(/0+$/,"")||"0"}));var i=new Date(Math.floor(e+.05));if(t=t.replace(C,(function(){return E[r("%q")(i)]})),_(n))try{t=g.getComponentMethod("calendars","worldCalFmt")(t,e,n)}catch(t){return"Invalid"}return r(t)(i)}var z=[59,59.9,59.99,59.999,59.9999];e.formatDate=function(t,e,r,n,i,o){if(i=_(i)&&i,!e)if("y"===r)e=o.year;else if("m"===r)e=o.month;else{if("d"!==r)return function(t,e){var r=l(t+.05,h),n=w(Math.floor(r/d),2)+":"+w(l(Math.floor(r/f),60),2);if("M"!==e){a(e)||(e=0);var i=(100+Math.min(l(t/p,60),z[e])).toFixed(e).substr(1);e>0&&(i=i.replace(/0+$/,"").replace(/[\.]$/,"")),n+=":"+i}return n}(t,r)+"\n"+L(o.dayMonthYear,t,n,i);e=o.dayMonth+"\n"+o.year}return L(e,t,n,i)};var O=3*h;e.incrementMonth=function(t,e,r){r=_(r)&&r;var n=l(t,h);if(t=Math.round(t-n),r)try{var i=Math.round(t/h)+m,o=g.getComponentMethod("calendars","getCal")(r),a=o.fromJD(i);return e%12?o.add(a,e,"m"):o.add(a,e/12,"y"),(a.toJD()-m)*h+n}catch(e){s.error("invalid ms "+t+" in calendar "+r)}var c=new Date(t+O);return c.setUTCMonth(c.getUTCMonth()+e)+n-O},e.findExactDates=function(t,e){for(var r,n,i=0,o=0,s=0,l=0,c=_(e)&&g.getComponentMethod("calendars","getCal")(e),u=0;u{"use strict";var n=r(27941),i=r(64347),o=r(75717),a=r(79538);function s(t){var e=t&&t.parentNode;e&&e.removeChild(t)}function l(t,e,r){var n="plotly.js-style-"+t,o=document.getElementById(n);o||((o=document.createElement("style")).setAttribute("id",n),o.appendChild(document.createTextNode("")),document.head.appendChild(o));var a=o.sheet;a.insertRule?a.insertRule(e+"{"+r+"}",0):a.addRule?a.addRule(e,r,0):i.warn("addStyleRule failed")}function c(t){var e=window.getComputedStyle(t,null),r=e.getPropertyValue("-webkit-transform")||e.getPropertyValue("-moz-transform")||e.getPropertyValue("-ms-transform")||e.getPropertyValue("-o-transform")||e.getPropertyValue("transform");return"none"===r?null:r.replace("matrix","").replace("3d","").slice(1,-1).split(",").map((function(t){return+t}))}function u(t){for(var e=[];h(t);)e.push(t),t=t.parentNode,"function"==typeof ShadowRoot&&t instanceof ShadowRoot&&(t=t.host);return e}function h(t){return t&&(t instanceof Element||t instanceof HTMLElement)}t.exports={getGraphDiv:function(t){var e;if("string"==typeof t){if(null===(e=document.getElementById(t)))throw new Error("No DOM element with id '"+t+"' exists on the page.");return e}if(null==t)throw new Error("DOM element provided is null or undefined");return t},isPlotDiv:function(t){var e=n.select(t);return e.node()instanceof HTMLElement&&e.size()&&e.classed("js-plotly-plot")},removeElement:s,addStyleRule:function(t,e){l("global",t,e)},addRelatedStyleRule:l,deleteRelatedStyleRule:function(t){var e="plotly.js-style-"+t,r=document.getElementById(e);r&&s(r)},getFullTransformMatrix:function(t){var e=u(t),r=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];return e.forEach((function(t){var e=c(t);if(e){var n=o.convertCssMatrix(e);r=a.multiply(r,r,n)}})),r},getElementTransformMatrix:c,getElementAndAncestors:u,equalDomRects:function(t,e){return t&&e&&t.top===e.top&&t.left===e.left&&t.right===e.right&&t.bottom===e.bottom}}},16677:(t,e,r)=>{"use strict";var n=r(86626).EventEmitter,i={init:function(t){if(t._ev instanceof n)return t;var e=new n,r=new n;return t._ev=e,t._internalEv=r,t.on=e.on.bind(e),t.once=e.once.bind(e),t.removeListener=e.removeListener.bind(e),t.removeAllListeners=e.removeAllListeners.bind(e),t._internalOn=r.on.bind(r),t._internalOnce=r.once.bind(r),t._removeInternalListener=r.removeListener.bind(r),t._removeAllInternalListeners=r.removeAllListeners.bind(r),t.emit=function(n,i){"undefined"!=typeof jQuery&&jQuery(t).trigger(n,i),e.emit(n,i),r.emit(n,i)},t},triggerHandler:function(t,e,r){var n,i;"undefined"!=typeof jQuery&&(n=jQuery(t).triggerHandler(e,r));var o=t._ev;if(!o)return n;var a,s=o._events[e];if(!s)return n;function l(t){return t.listener?(o.removeListener(e,t.listener),t.fired?void 0:(t.fired=!0,t.listener.apply(o,[r]))):t.apply(o,[r])}for(s=Array.isArray(s)?s:[s],a=0;a{"use strict";var n=r(12517),i=Array.isArray;function o(t,e,r,a){var s,l,c,u,h,d,f,p=t[0],m=t.length;if(2===m&&i(p)&&i(t[1])&&0===p.length){if(f=function(t,e){var r,n;for(r=0;r{"use strict";t.exports=function(t){for(var e={},r=[],n=0,i=0;i{"use strict";function e(t){return!0===t.visible}function r(t){var e=t[0].trace;return!0===e.visible&&0!==e._length}t.exports=function(t){for(var n,i=(n=t,Array.isArray(n)&&Array.isArray(n[0])&&n[0][0]&&n[0][0].trace?r:e),o=[],a=0;a{"use strict";var n,i,o,a=r(31918).mod;function s(t,e,r,n,i,o,a,s){var l=r-t,c=i-t,u=a-i,h=n-e,d=o-e,f=s-o,p=l*f-u*h;if(0===p)return null;var m=(c*f-u*d)/p,g=(c*h-l*d)/p;return g<0||g>1||m<0||m>1?null:{x:t+l*m,y:e+h*m}}function l(t,e,r,n,i){var o=n*t+i*e;if(o<0)return n*n+i*i;if(o>r){var a=n-t,s=i-e;return a*a+s*s}var l=n*e-i*t;return l*l/r}e.segmentsIntersect=s,e.segmentDistance=function(t,e,r,n,i,o,a,c){if(s(t,e,r,n,i,o,a,c))return 0;var u=r-t,h=n-e,d=a-i,f=c-o,p=u*u+h*h,m=d*d+f*f,g=Math.min(l(u,h,p,i-t,o-e),l(u,h,p,a-t,c-e),l(d,f,m,t-i,e-o),l(d,f,m,r-i,n-o));return Math.sqrt(g)},e.getTextLocation=function(t,e,r,s){if(t===i&&s===o||(n={},i=t,o=s),n[r])return n[r];var l=t.getPointAtLength(a(r-s/2,e)),c=t.getPointAtLength(a(r+s/2,e)),u=Math.atan((c.y-l.y)/(c.x-l.x)),h=t.getPointAtLength(a(r,e)),d={x:(4*h.x+l.x+c.x)/6,y:(4*h.y+l.y+c.y)/6,theta:u};return n[r]=d,d},e.clearLocationCache=function(){i=null},e.getVisibleSegment=function(t,e,r){var n,i,o=e.left,a=e.right,s=e.top,l=e.bottom,c=0,u=t.getTotalLength(),h=u;function d(e){var r=t.getPointAtLength(e);0===e?n=r:e===u&&(i=r);var c=r.xa?r.x-a:0,h=r.yl?r.y-l:0;return Math.sqrt(c*c+h*h)}for(var f=d(c);f;){if((c+=f+r)>h)return;f=d(c)}for(f=d(h);f;){if(c>(h-=f+r))return;f=d(h)}return{min:c,max:h,len:h-c,total:u,isClosed:0===c&&h===u&&Math.abs(n.x-i.x)<.1&&Math.abs(n.y-i.y)<.1}},e.findPointOnPath=function(t,e,r,n){for(var i,o,a,s=(n=n||{}).pathLength||t.getTotalLength(),l=n.tolerance||.001,c=n.iterationLimit||30,u=t.getPointAtLength(0)[r]>t.getPointAtLength(s)[r]?-1:1,h=0,d=0,f=s;h0?f=i:d=i,h++}return o}},25069:(t,e,r)=>{"use strict";var n=r(7370),i=r(18106),o=r(34463),a=r(80755),s=r(84226).defaultLine,l=r(98507).isArrayOrTypedArray,c=o(s);function u(t,e){var r=t;return r[3]*=e,r}function h(t){if(n(t))return c;var e=o(t);return e.length?e:c}function d(t){return n(t)?t:1}t.exports={formatColor:function(t,e,r){var n=t.color;n&&n._inputArray&&(n=n._inputArray);var i,s,f,p,m,g=l(n),v=l(e),b=a.extractOpts(t),y=[];if(i=void 0!==b.colorscale?a.makeColorScaleFuncFromTrace(t):h,s=g?function(t,e){return void 0===t[e]?c:o(i(t[e]))}:h,f=v?function(t,e){return void 0===t[e]?1:d(t[e])}:d,g||v)for(var x=0;x{"use strict";t.exports=function(t){return t}},98803:t=>{"use strict";t.exports=function(t,e){if(!e)return t;var r=1/Math.abs(e),n=r>1?(r*t+r*e)/r:t+e,i=String(n).length;if(i>16){var o=String(e).length;if(i>=String(t).length+o){var a=parseFloat(n).toPrecision(12);-1===a.indexOf("e+")&&(n=+a)}}return n}},12822:(t,e,r)=>{"use strict";var n=r(27941),i=r(79969).aL,o=r(31830).GP,a=r(7370),s=r(32994),l=s.FP_SAFE,c=-l,u=s.BADNUM,h=t.exports={};h.adjustFormat=function(t){return!t||/^\d[.]\df/.test(t)||/[.]\d%/.test(t)?t:"0.f"===t?"~f":/^\d%/.test(t)?"~%":/^\ds/.test(t)?"~s":!/^[~,.0$]/.test(t)&&/[&fps]/.test(t)?"~"+t:t};var d={};h.warnBadFormat=function(t){var e=String(t);d[e]||(d[e]=1,h.warn('encountered bad format: "'+e+'"'))},h.noFormat=function(t){return String(t)},h.numberFormat=function(t){var e;try{e=o(h.adjustFormat(t))}catch(e){return h.warnBadFormat(t),h.noFormat}return e},h.nestedProperty=r(91355),h.keyedContainer=r(68588),h.relativeAttr=r(21904),h.isPlainObject=r(12517),h.toLogRange=r(61814),h.relinkPrivateKeys=r(45905);var f=r(98507);h.isArrayBuffer=f.isArrayBuffer,h.isTypedArray=f.isTypedArray,h.isArrayOrTypedArray=f.isArrayOrTypedArray,h.isArray1D=f.isArray1D,h.ensureArray=f.ensureArray,h.concat=f.concat,h.maxRowLength=f.maxRowLength,h.minRowLength=f.minRowLength;var p=r(31918);h.mod=p.mod,h.modHalf=p.modHalf;var m=r(5365);h.valObjectMeta=m.valObjectMeta,h.coerce=m.coerce,h.coerce2=m.coerce2,h.coerceFont=m.coerceFont,h.coercePattern=m.coercePattern,h.coerceHoverinfo=m.coerceHoverinfo,h.coerceSelectionMarkerOpacity=m.coerceSelectionMarkerOpacity,h.validate=m.validate;var g=r(41095);h.dateTime2ms=g.dateTime2ms,h.isDateTime=g.isDateTime,h.ms2DateTime=g.ms2DateTime,h.ms2DateTimeLocal=g.ms2DateTimeLocal,h.cleanDate=g.cleanDate,h.isJSDate=g.isJSDate,h.formatDate=g.formatDate,h.incrementMonth=g.incrementMonth,h.dateTick0=g.dateTick0,h.dfltRange=g.dfltRange,h.findExactDates=g.findExactDates,h.MIN_MS=g.MIN_MS,h.MAX_MS=g.MAX_MS;var v=r(45380);h.findBin=v.findBin,h.sorterAsc=v.sorterAsc,h.sorterDes=v.sorterDes,h.distinctVals=v.distinctVals,h.roundUp=v.roundUp,h.sort=v.sort,h.findIndexOfMin=v.findIndexOfMin,h.sortObjectKeys=r(54747);var b=r(6749);h.aggNums=b.aggNums,h.len=b.len,h.mean=b.mean,h.geometricMean=b.geometricMean,h.median=b.median,h.midRange=b.midRange,h.variance=b.variance,h.stdev=b.stdev,h.interp=b.interp;var y=r(75717);h.init2dArray=y.init2dArray,h.transposeRagged=y.transposeRagged,h.dot=y.dot,h.translationMatrix=y.translationMatrix,h.rotationMatrix=y.rotationMatrix,h.rotationXYMatrix=y.rotationXYMatrix,h.apply3DTransform=y.apply3DTransform,h.apply2DTransform=y.apply2DTransform,h.apply2DTransform2=y.apply2DTransform2,h.convertCssMatrix=y.convertCssMatrix,h.inverseTransformMatrix=y.inverseTransformMatrix;var x=r(59804);h.deg2rad=x.deg2rad,h.rad2deg=x.rad2deg,h.angleDelta=x.angleDelta,h.angleDist=x.angleDist,h.isFullCircle=x.isFullCircle,h.isAngleInsideSector=x.isAngleInsideSector,h.isPtInsideSector=x.isPtInsideSector,h.pathArc=x.pathArc,h.pathSector=x.pathSector,h.pathAnnulus=x.pathAnnulus;var _=r(66379);h.isLeftAnchor=_.isLeftAnchor,h.isCenterAnchor=_.isCenterAnchor,h.isRightAnchor=_.isRightAnchor,h.isTopAnchor=_.isTopAnchor,h.isMiddleAnchor=_.isMiddleAnchor,h.isBottomAnchor=_.isBottomAnchor;var w=r(8994);h.segmentsIntersect=w.segmentsIntersect,h.segmentDistance=w.segmentDistance,h.getTextLocation=w.getTextLocation,h.clearLocationCache=w.clearLocationCache,h.getVisibleSegment=w.getVisibleSegment,h.findPointOnPath=w.findPointOnPath;var k=r(98260);h.extendFlat=k.extendFlat,h.extendDeep=k.extendDeep,h.extendDeepAll=k.extendDeepAll,h.extendDeepNoArrays=k.extendDeepNoArrays;var A=r(64347);h.log=A.log,h.warn=A.warn,h.error=A.error;var M=r(46233);h.counterRegex=M.counter;var T=r(76324);h.throttle=T.throttle,h.throttleDone=T.done,h.clearThrottle=T.clear;var S=r(16822);function C(t){var e={};for(var r in t)for(var n=t[r],i=0;il||t=e)&&a(t)&&t>=0&&t%1==0},h.noop=r(51648),h.identity=r(75250),h.repeat=function(t,e){for(var r=new Array(e),n=0;nr?Math.max(r,Math.min(e,t)):Math.max(e,Math.min(r,t))},h.bBoxIntersect=function(t,e,r){return r=r||0,t.left<=e.right+r&&e.left<=t.right+r&&t.top<=e.bottom+r&&e.top<=t.bottom+r},h.simpleMap=function(t,e,r,n,i){for(var o=t.length,a=new Array(o),s=0;s=Math.pow(2,r)?i>10?(h.warn("randstr failed uniqueness"),l):t(e,r,n,(i||0)+1):l},h.OptionControl=function(t,e){t||(t={}),e||(e="opt");var r={optionList:[],_newoption:function(n){n[e]=t,r[n.name]=n,r.optionList.push(n)}};return r["_"+e]=t,r},h.smooth=function(t,e){if((e=Math.round(e)||0)<2)return t;var r,n,i,o,a=t.length,s=2*a,l=2*e-1,c=new Array(l),u=new Array(a);for(r=0;r=s&&(i-=s*Math.floor(i/s)),i<0?i=-1-i:i>=a&&(i=s-1-i),o+=t[i]*c[n];u[r]=o}return u},h.syncOrAsync=function(t,e,r){var n;function i(){return h.syncOrAsync(t,e,r)}for(;t.length;)if((n=(0,t.splice(0,1)[0])(e))&&n.then)return n.then(i);return r&&r(e)},h.stripTrailingSlash=function(t){return"/"===t.substr(-1)?t.substr(0,t.length-1):t},h.noneOrAll=function(t,e,r){if(t){var n,i=!1,o=!0;for(n=0;n0?e:0}))},h.fillArray=function(t,e,r,n){if(n=n||h.identity,h.isArrayOrTypedArray(t))for(var i=0;i1?i+a[1]:"";if(o&&(a.length>1||s.length>4||r))for(;n.test(s);)s=s.replace(n,"$1"+o+"$2");return s+l},h.TEMPLATE_STRING_REGEX=/%{([^\s%{}:]*)([:|\|][^}]*)?}/g;var F=/^\w*$/;h.templateString=function(t,e){var r={};return t.replace(h.TEMPLATE_STRING_REGEX,(function(t,n){var i;return F.test(n)?i=e[n]:(r[n]=r[n]||h.nestedProperty(e,n).get,i=r[n]()),h.isValidTextValue(i)?i:""}))};var R={max:10,count:0,name:"hovertemplate"};h.hovertemplateString=function(){return U.apply(R,arguments)};var P={max:10,count:0,name:"texttemplate"};h.texttemplateString=function(){return U.apply(P,arguments)};var j=/^(\S+)([\*\/])(-?\d+(\.\d+)?)$/,N={max:10,count:0,name:"texttemplate",parseMultDiv:!0};h.texttemplateStringForShapes=function(){return U.apply(N,arguments)};var B=/^[:|\|]/;function U(t,e,r){var n=this,o=arguments;e||(e={});var a={};return t.replace(h.TEMPLATE_STRING_REGEX,(function(t,s,l){var c="_xother"===s||"_yother"===s,u="_xother_"===s||"_yother_"===s,d="xother_"===s||"yother_"===s,f="xother"===s||"yother"===s||c||d||u,p=s;(c||u)&&(p=p.substring(1)),(d||u)&&(p=p.substring(0,p.length-1));var m,g,v,b=null,y=null;if(n.parseMultDiv){var x=function(t){var e=t.match(j);return e?{key:e[1],op:e[2],number:Number(e[3])}:{key:t,op:null,number:null}}(p);p=x.key,b=x.op,y=x.number}if(f){if(void 0===(m=e[p]))return""}else for(v=3;v=48&&a<=57,c=s>=48&&s<=57;if(l&&(n=10*n+a-48),c&&(i=10*i+s-48),!l||!c){if(n!==i)return n-i;if(a!==s)return a-s}}return i-n};var G=2e9;h.seedPseudoRandom=function(){G=2e9},h.pseudoRandom=function(){var t=G;return G=(69069*G+1)%4294967296,Math.abs(G-t)<429496729?h.pseudoRandom():G/4294967296},h.fillText=function(t,e,r){var n=Array.isArray(r)?function(t){r.push(t)}:function(t){r.text=t},i=h.extractOption(t,e,"htx","hovertext");if(h.isValidTextValue(i))return n(i);var o=h.extractOption(t,e,"tx","text");return h.isValidTextValue(o)?n(o):void 0},h.isValidTextValue=function(t){return t||0===t},h.formatPercent=function(t,e){e=e||0;for(var r=(Math.round(100*t*Math.pow(10,e))*Math.pow(.1,e)).toFixed(e)+"%",n=0;n1&&(c=1):c=0,h.strTranslate(i-c*(r+a),o-c*(n+s))+h.strScale(c)+(l?"rotate("+l+(e?"":" "+r+" "+n)+")":"")},h.setTransormAndDisplay=function(t,e){t.attr("transform",h.getTextTransform(e)),t.style("display",e.scale?null:"none")},h.ensureUniformFontSize=function(t,e){var r=h.extendFlat({},e);return r.size=Math.max(e.size,t._fullLayout.uniformtext.minsize||0),r},h.join2=function(t,e,r){var n=t.length;return n>1?t.slice(0,-1).join(e)+r+t[n-1]:t.join(e)},h.bigFont=function(t){return Math.round(1.2*t)};var V=h.getFirefoxVersion(),H=null!==V&&V<86;h.getPositionFromD3Event=function(){return H?[n.event.layerX,n.event.layerY]:[n.event.offsetX,n.event.offsetY]}},12517:t=>{"use strict";t.exports=function(t){return window&&window.process&&window.process.versions?"[object Object]"===Object.prototype.toString.call(t):"[object Object]"===Object.prototype.toString.call(t)&&Object.getPrototypeOf(t).hasOwnProperty("hasOwnProperty")}},68588:(t,e,r)=>{"use strict";var n=r(91355),i=/^\w*$/;t.exports=function(t,e,r,o){var a,s,l;r=r||"name",o=o||"value";var c={};e&&e.length?(l=n(t,e),s=l.get()):s=t,e=e||"";var u={};if(s)for(a=0;a2)return c[e]=2|c[e],d.set(t,null);if(h){for(a=e;a{"use strict";var n=r(25059);t.exports=function(t,e){for(var r=t._context.locale,i=0;i<2;i++){for(var o=t._context.locales,a=0;a<2;a++){var s=(o[r]||{}).dictionary;if(s){var l=s[e];if(l)return l}o=n.localeRegistry}var c=r.split("-")[0];if(c===r)break;r=c}return e}},64347:(t,e,r)=>{"use strict";var n=r(58389).dfltConfig,i=r(39382),o=t.exports={};o.log=function(){var t;if(n.logging>1){var e=["LOG:"];for(t=0;t1){var r=[];for(t=0;t"),"long")}},o.warn=function(){var t;if(n.logging>0){var e=["WARN:"];for(t=0;t0){var r=[];for(t=0;t"),"stick")}},o.error=function(){var t;if(n.logging>0){var e=["ERROR:"];for(t=0;t0){var r=[];for(t=0;t"),"stick")}}},51915:(t,e,r)=>{"use strict";var n=r(27941);t.exports=function(t,e,r){var i=t.selectAll("g."+r.replace(/\s/g,".")).data(e,(function(t){return t[0].trace.uid}));i.exit().remove(),i.enter().append("g").attr("class",r),i.order();var o=t.classed("rangeplot")?"nodeRangePlot3":"node3";return i.each((function(t){t[0][o]=n.select(this)})),i}},75717:(t,e,r)=>{"use strict";var n=r(79538);e.init2dArray=function(t,e){for(var r=new Array(t),n=0;n{"use strict";t.exports={mod:function(t,e){var r=t%e;return r<0?r+e:r},modHalf:function(t,e){return Math.abs(t)>e/2?t-Math.round(t/e)*e:t}}},91355:(t,e,r)=>{"use strict";var n=r(7370),i=r(98507).isArrayOrTypedArray;function o(t,e){return function(){var r,n,a,s,l,c=t;for(s=0;s{"use strict";t.exports=function(){}},39382:(t,e,r)=>{"use strict";var n=r(27941),i=r(7370),o=[];t.exports=function(t,e){if(-1===o.indexOf(t)){o.push(t);var r=1e3;i(e)?r=e:"long"===e&&(r=3e3);var a=n.select("body").selectAll(".plotly-notifier").data([0]);a.enter().append("div").classed("plotly-notifier",!0),a.selectAll(".notifier-note").data(o).enter().append("div").classed("notifier-note",!0).style("opacity",0).each((function(t){var i=n.select(this);i.append("button").classed("notifier-close",!0).html("×").on("click",(function(){i.transition().call(s)}));for(var o=i.append("p"),a=t.split(//g),l=0;l{"use strict";var n=r(76292),i="data-savedcursor";t.exports=function(t,e){var r=t.attr(i);if(e){if(!r){for(var o=(t.attr("class")||"").split(" "),a=0;a{"use strict";var n=r(75717).dot,i=r(32994).BADNUM,o=t.exports={};o.tester=function(t){var e,r=t.slice(),n=r[0][0],o=n,a=r[0][1],s=a;for(r[r.length-1][0]===r[0][0]&&r[r.length-1][1]===r[0][1]||r.push(r[0]),e=1;eo||c===i||cs||e&&l(t))}:function(t,e){var l=t[0],c=t[1];if(l===i||lo||c===i||cs)return!1;var u,h,d,f,p,m=r.length,g=r[0][0],v=r[0][1],b=0;for(u=1;uMath.max(h,g)||c>Math.max(d,v)))if(cu||Math.abs(n(a,d))>i)return!0;return!1},o.filter=function(t,e){var r=[t[0]],n=0,i=0;function a(a){t.push(a);var s=r.length,l=n;r.splice(i+1);for(var c=l+1;c1&&a(t.pop()),{addPt:a,raw:t,filtered:r}}},41246:(t,e,r)=>{"use strict";var n=r(91203),i=r(83029);t.exports=function(t,e,o){var a=t._fullLayout,s=!0;return a._glcanvas.each((function(n){if(n.regl)n.regl.preloadCachedCode(o);else if(!n.pick||a._has("parcoords")){try{n.regl=i({canvas:this,attributes:{antialias:!n.pick,preserveDrawingBuffer:!0},pixelRatio:t._context.plotGlPixelRatio||r.g.devicePixelRatio,extensions:e||[],cachedCode:o||{}})}catch(t){s=!1}n.regl||(s=!1),s&&this.addEventListener("webglcontextlost",(function(e){t&&t.emit&&t.emit("plotly_webglcontextlost",{event:e,layer:n.key})}),!1)}})),s||n({container:a._glcontainer.node()}),s}},31406:(t,e,r)=>{"use strict";var n=r(7370),i=r(12431);t.exports=function(t){var e;if("string"!=typeof(e=t&&t.hasOwnProperty("userAgent")?t.userAgent:function(){var t;return"undefined"!=typeof navigator&&(t=navigator.userAgent),t&&t.headers&&"string"==typeof t.headers["user-agent"]&&(t=t.headers["user-agent"]),t}()))return!0;var r=i({ua:{headers:{"user-agent":e}},tablet:!0,featureDetect:!1});if(!r)for(var o=e.split(" "),a=1;a-1;s--){var l=o[s];if("Version/"===l.substr(0,8)){var c=l.substr(8).split(".")[0];if(n(c)&&(c=+c),c>=13)return!0}}return r}},65280:t=>{"use strict";t.exports=function(t,e){if(e instanceof RegExp){for(var r=e.toString(),n=0;n{"use strict";var n=r(12822),i=r(58389).dfltConfig,o={add:function(t,e,r,n,o){var a,s;t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},s=t.undoQueue.index,t.autoplay?t.undoQueue.inSequence||(t.autoplay=!1):(!t.undoQueue.sequence||t.undoQueue.beginSequence?(a={undo:{calls:[],args:[]},redo:{calls:[],args:[]}},t.undoQueue.queue.splice(s,t.undoQueue.queue.length-s,a),t.undoQueue.index+=1):a=t.undoQueue.queue[s-1],t.undoQueue.beginSequence=!1,a&&(a.undo.calls.unshift(e),a.undo.args.unshift(r),a.redo.calls.push(n),a.redo.args.push(o)),t.undoQueue.queue.length>i.queueLength&&(t.undoQueue.queue.shift(),t.undoQueue.index--))},startSequence:function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!0,t.undoQueue.beginSequence=!0},stopSequence:function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!1,t.undoQueue.beginSequence=!1},undo:function(t){var e,r;if(!(void 0===t.undoQueue||isNaN(t.undoQueue.index)||t.undoQueue.index<=0)){for(t.undoQueue.index--,e=t.undoQueue.queue[t.undoQueue.index],t.undoQueue.inSequence=!0,r=0;r=t.undoQueue.queue.length)){for(e=t.undoQueue.queue[t.undoQueue.index],t.undoQueue.inSequence=!0,r=0;r{"use strict";e.counter=function(t,e,r,n){var i=(e||"")+(r?"":"$"),o=!1===n?"":"^";return"xy"===t?new RegExp(o+"x([2-9]|[1-9][0-9]+)?y([2-9]|[1-9][0-9]+)?"+i):new RegExp(o+t+"([2-9]|[1-9][0-9]+)?"+i)}},21904:t=>{"use strict";var e=/^(.*)(\.[^\.\[\]]+|\[\d\])$/,r=/^[^\.\[\]]+$/;t.exports=function(t,n){for(;n;){var i=t.match(e);if(i)t=i[1];else{if(!t.match(r))throw new Error("bad relativeAttr call:"+[t,n]);t=""}if("^"!==n.charAt(0))break;n=n.slice(1)}return t&&"["!==n.charAt(0)?t+"."+n:t+n}},45905:(t,e,r)=>{"use strict";var n=r(98507).isArrayOrTypedArray,i=r(12517);t.exports=function t(e,r){for(var o in r){var a=r[o],s=e[o];if(s!==a)if("_"===o.charAt(0)||"function"==typeof a){if(o in e)continue;e[o]=a}else if(n(a)&&n(s)&&i(a[0])){if("customdata"===o||"ids"===o)continue;for(var l=Math.min(a.length,s.length),c=0;c{"use strict";var n=r(7370),i=r(64347),o=r(75250),a=r(32994).BADNUM,s=1e-9;function l(t,e){return te}function h(t,e){return t>=e}e.findBin=function(t,e,r){if(n(e.start))return r?Math.ceil((t-e.start)/e.size-s)-1:Math.floor((t-e.start)/e.size+s);var o,a,d=0,f=e.length,p=0,m=f>1?(e[f-1]-e[0])/(f-1):1;for(a=m>=0?r?l:c:r?h:u,t+=m*s*(r?-1:1)*(m>=0?1:-1);d90&&i.log("Long binary search..."),d-1},e.sorterAsc=function(t,e){return t-e},e.sorterDes=function(t,e){return e-t},e.distinctVals=function(t){var r,n=t.slice();for(n.sort(e.sorterAsc),r=n.length-1;r>-1&&n[r]===a;r--);for(var i,o=n[r]-n[0]||1,s=o/(r||1)/1e4,l=[],c=0;c<=r;c++){var u=n[c],h=u-i;void 0===i?(l.push(u),i=u):h>s&&(o=Math.min(o,h),l.push(u),i=u)}return{vals:l,minDiff:o}},e.roundUp=function(t,e,r){for(var n,i=0,o=e.length-1,a=0,s=r?0:1,l=r?1:0,c=r?Math.ceil:Math.floor;i0&&(n=1),r&&n)return t.sort(e)}return n?t:t.reverse()},e.findIndexOfMin=function(t,e){e=e||o;for(var r,n=1/0,i=0;i{"use strict";t.exports=function(t,e){(t.attr("class")||"").split(" ").forEach((function(e){0===e.indexOf("cursor-")&&t.classed(e,!1)})),e&&t.classed("cursor-"+e,!0)}},91203:(t,e,r)=>{"use strict";var n=r(17499),i=function(){};t.exports=function(t){for(var e in t)"function"==typeof t[e]&&(t[e]=i);t.destroy=function(){t.container.parentNode.removeChild(t.container)};var r=document.createElement("div");r.className="no-webgl",r.style.cursor="pointer",r.style.fontSize="24px",r.style.color=n.defaults[0],r.style.position="absolute",r.style.left=r.style.top="0px",r.style.width=r.style.height="100%",r.style["background-color"]=n.lightLine,r.style["z-index"]=30;var o=document.createElement("p");return o.textContent="WebGL is not supported by your browser - visit https://get.webgl.org for more info",o.style.position="relative",o.style.top="50%",o.style.left="50%",o.style.height="30%",o.style.width="50%",o.style.margin="-15% 0 0 -25%",r.appendChild(o),t.container.appendChild(r),t.container.style.background="#FFFFFF",t.container.onclick=function(){window.open("https://get.webgl.org")},!1}},54747:t=>{"use strict";t.exports=function(t){return Object.keys(t).sort()}},6749:(t,e,r)=>{"use strict";var n=r(7370),i=r(98507).isArrayOrTypedArray;e.aggNums=function(t,r,o,a){var s,l;if((!a||a>o.length)&&(a=o.length),n(r)||(r=!1),i(o[0])){for(l=new Array(a),s=0;st.length-1)return t[t.length-1];var r=e%1;return r*t[Math.ceil(e)]+(1-r)*t[Math.floor(e)]}},17235:(t,e,r)=>{"use strict";var n=r(34463);t.exports=function(t){return t?n(t):[0,0,0,1]}},80394:(t,e,r)=>{"use strict";var n=r(27941),i=r(12822),o=i.strTranslate,a=r(25853),s=r(89701).LINE_SPACING,l=/([^$]*)([$]+[^$]*[$]+)([^$]*)/;e.convertToTspans=function(t,r,g){var S=t.text(),C=!t.attr("data-notex")&&r&&r._context.typesetMath&&"undefined"!=typeof MathJax&&S.match(l),z=n.select(t.node().parentNode);if(!z.empty()){var O=t.attr("class")?t.attr("class").split(" ")[0]:"text";return O+="-math",z.selectAll("svg."+O).remove(),z.selectAll("g."+O+"-group").remove(),t.style("display",null).attr({"data-unformatted":S,"data-math":"N"}),C?(r&&r._promises||[]).push(new Promise((function(e){t.style("display","none");var r=parseInt(t.node().style.fontSize,10),a={fontSize:r};!function(t,e,r){var o,a,s,l,d=parseInt((MathJax.version||"").split(".")[0]);if(2===d||3===d){var f=function(){var r="math-output-"+i.randstr({},64),o=(l=n.select("body").append("div").attr({id:r}).style({visibility:"hidden",position:"absolute","font-size":e.fontSize+"px"}).text(t.replace(c,"\\lt ").replace(u,"\\gt "))).node();return 2===d?MathJax.Hub.Typeset(o):MathJax.typeset([o])},p=function(){var e=l.select(2===d?".MathJax_SVG":".MathJax"),o=!e.empty()&&l.select("svg").node();if(o){var a,s=o.getBoundingClientRect();a=2===d?n.select("body").select("#MathJax_SVG_glyphs"):e.select("defs"),r(e,a,s)}else i.log("There was an error in the tex syntax.",t),r();l.remove()};2===d?MathJax.Hub.Queue((function(){return a=i.extendDeepAll({},MathJax.Hub.config),s=MathJax.Hub.processSectionDelay,void 0!==MathJax.Hub.processSectionDelay&&(MathJax.Hub.processSectionDelay=0),MathJax.Hub.Config({messageStyle:"none",tex2jax:{inlineMath:h},displayAlign:"left"})}),(function(){if("SVG"!==(o=MathJax.Hub.config.menuSettings.renderer))return MathJax.Hub.setRenderer("SVG")}),f,p,(function(){if("SVG"!==o)return MathJax.Hub.setRenderer(o)}),(function(){return void 0!==s&&(MathJax.Hub.processSectionDelay=s),MathJax.Hub.Config(a)})):3===d&&(a=i.extendDeepAll({},MathJax.config),MathJax.config.tex||(MathJax.config.tex={}),MathJax.config.tex.inlineMath=h,"svg"!==(o=MathJax.config.startup.output)&&(MathJax.config.startup.output="svg"),MathJax.startup.defaultReady(),MathJax.startup.promise.then((function(){f(),p(),"svg"!==o&&(MathJax.config.startup.output=o),MathJax.config=a})))}else i.warn("No MathJax version:",MathJax.version)}(C[2],a,(function(n,i,a){z.selectAll("svg."+O).remove(),z.selectAll("g."+O+"-group").remove();var s=n&&n.select("svg");if(!s||!s.node())return D(),void e();var l=z.append("g").classed(O+"-group",!0).attr({"pointer-events":"none","data-unformatted":S,"data-math":"Y"});l.node().appendChild(s.node()),i&&i.node()&&s.node().insertBefore(i.node().cloneNode(!0),s.node().firstChild);var c=a.width,u=a.height;s.attr({class:O,height:u,preserveAspectRatio:"xMinYMin meet"}).style({overflow:"visible","pointer-events":"none"});var h=t.node().style.fill||"black",d=s.select("g");d.attr({fill:h,stroke:h});var f=d.node().getBoundingClientRect(),p=f.width,m=f.height;(p>c||m>u)&&(s.style("overflow","hidden"),p=(f=s.node().getBoundingClientRect()).width,m=f.height);var v=+t.attr("x"),b=+t.attr("y"),y=-(r||t.node().getBoundingClientRect().height)/4;if("y"===O[0])l.attr({transform:"rotate("+[-90,v,b]+")"+o(-p/2,y-m/2)});else if("l"===O[0])b=y-m/2;else if("a"===O[0]&&0!==O.indexOf("atitle"))v=0,b=y;else{var x=t.attr("text-anchor");v-=p*("middle"===x?.5:"end"===x?1:0),b=b+y-m/2}s.attr({x:v,y:b}),g&&g.call(t,l),e(l)}))}))):D(),t}function D(){z.empty()||(O=t.attr("class")+"-math",z.select("svg."+O).remove()),t.text("").style("white-space","pre");var r=function(t,e){e=e.replace(v," ");var r,o=!1,l=[],c=-1;function u(){c++;var e=document.createElementNS(a.svg,"tspan");n.select(e).attr({class:"line",dy:c*s+"em"}),t.appendChild(e),r=e;var i=l;if(l=[{node:e}],i.length>1)for(var o=1;o doesnt match end tag <"+t+">. Pretending it did match.",e),r=l[l.length-1].node}else i.log("Ignoring unexpected end tag .",e)}x.test(e)?u():(r=t,l=[{node:t}]);for(var C=e.split(b),z=0;z|>|>)/g,h=[["$","$"],["\\(","\\)"]],d={sup:"font-size:70%",sub:"font-size:70%",s:"text-decoration:line-through",u:"text-decoration:underline",b:"font-weight:bold",i:"font-style:italic",a:"cursor:pointer",span:"",em:"font-style:italic;font-weight:bold"},f={sub:"0.3em",sup:"-0.6em"},p={sub:"-0.21em",sup:"0.42em"},m="​",g=["http:","https:","mailto:","",void 0,":"],v=e.NEWLINES=/(\r\n?|\n)/g,b=/(<[^<>]*>)/,y=/<(\/?)([^ >]*)(\s+(.*))?>/i,x=//i;e.BR_TAG_ALL=//gi;var _=/(^|[\s"'])style\s*=\s*("([^"]*);?"|'([^']*);?')/i,w=/(^|[\s"'])href\s*=\s*("([^"]*)"|'([^']*)')/i,k=/(^|[\s"'])target\s*=\s*("([^"\s]*)"|'([^'\s]*)')/i,A=/(^|[\s"'])popup\s*=\s*("([\w=,]*)"|'([\w=,]*)')/i;function M(t,e){if(!t)return null;var r=t.match(e),n=r&&(r[3]||r[4]);return n&&E(n)}var T=/(^|;)\s*color:/;e.plainText=function(t,e){for(var r=void 0!==(e=e||{}).len&&-1!==e.len?e.len:1/0,n=void 0!==e.allowedTags?e.allowedTags:["br"],i=t.split(b),o=[],a="",s=0,l=0;l3?o.push(c.substr(0,f-3)+"..."):o.push(c.substr(0,f));break}a=""}}return o.join("")};var S={mu:"μ",amp:"&",lt:"<",gt:">",nbsp:" ",times:"×",plusmn:"±",deg:"°"},C=/&(#\d+|#x[\da-fA-F]+|[a-z]+);/g;function E(t){return t.replace(C,(function(t,e){return("#"===e.charAt(0)?function(t){if(!(t>1114111)){var e=String.fromCodePoint;if(e)return e(t);var r=String.fromCharCode;return t<=65535?r(t):r(55232+(t>>10),t%1024+56320)}}("x"===e.charAt(1)?parseInt(e.substr(2),16):parseInt(e.substr(1),10)):S[e])||t}))}function L(t){var e=encodeURI(decodeURI(t)),r=document.createElement("a"),n=document.createElement("a");r.href=t,n.href=e;var i=r.protocol,o=n.protocol;return-1!==g.indexOf(i)&&-1!==g.indexOf(o)?e:""}function z(t,e,r){var n,o,a,s=r.horizontalAlign,l=r.verticalAlign||"top",c=t.node().getBoundingClientRect(),u=e.node().getBoundingClientRect();return o="bottom"===l?function(){return c.bottom-n.height}:"middle"===l?function(){return c.top+(c.height-n.height)/2}:function(){return c.top},a="right"===s?function(){return c.right-n.width}:"center"===s?function(){return c.left+(c.width-n.width)/2}:function(){return c.left},function(){n=this.node().getBoundingClientRect();var t=a()-u.left,e=o()-u.top,s=r.gd||{};if(r.gd){s._fullLayout._calcInverseTransform(s);var l=i.apply3DTransform(s._fullLayout._invTransform)(t,e);t=l[0],e=l[1]}return this.style({top:e+"px",left:t+"px","z-index":1e3}),this}}e.convertEntities=E,e.sanitizeHTML=function(t){t=t.replace(v," ");for(var e=document.createElement("p"),r=e,i=[],o=t.split(b),a=0;a{"use strict";var r={};function n(t){t&&null!==t.timer&&(clearTimeout(t.timer),t.timer=null)}e.throttle=function(t,e,i){var o=r[t],a=Date.now();if(!o){for(var s in r)r[s].tso.ts+e?l():o.timer=setTimeout((function(){l(),o.timer=null}),e)},e.done=function(t){var e=r[t];return e&&e.timer?new Promise((function(t){var r=e.onDone;e.onDone=function(){r&&r(),t(),e.onDone=null}})):Promise.resolve()},e.clear=function(t){if(t)n(r[t]),delete r[t];else for(var i in r)e.clear(i)}},61814:(t,e,r)=>{"use strict";var n=r(7370);t.exports=function(t,e){if(t>0)return Math.log(t)/Math.LN10;var r=Math.log(Math.min(e[0],e[1]))/Math.LN10;return n(r)||(r=Math.log(Math.max(e[0],e[1]))/Math.LN10-6),r}},10701:t=>{"use strict";t.exports={moduleType:"locale",name:"en-US",dictionary:{"Click to enter Colorscale title":"Click to enter Colorscale title"},format:{date:"%m/%d/%Y"}}},6048:t=>{"use strict";t.exports={moduleType:"locale",name:"en",dictionary:{"Click to enter Colorscale title":"Click to enter Colourscale title"},format:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],periods:["AM","PM"],dateTime:"%a %b %e %X %Y",date:"%d/%m/%Y",time:"%H:%M:%S",decimal:".",thousands:",",grouping:[3],currency:["$",""],year:"%Y",month:"%b %Y",dayMonth:"%b %-d",dayMonthYear:"%b %-d, %Y"}}},81776:(t,e,r)=>{"use strict";var n=r(25059);t.exports=function(t){for(var e,r,i=n.layoutArrayContainers,o=n.layoutArrayRegexes,a=t.split("[")[0],s=0;s{"use strict";var n=r(98260).extendFlat,i=r(12517),o={valType:"flaglist",extras:["none"],flags:["calc","clearAxisTypes","plot","style","markerSize","colorbars"],description:["trace attributes should include an `editType` string matching this flaglist.","*calc* is the most extensive: a full (re)plot starting by clearing `gd.calcdata`","to force it to be regenerated","*clearAxisTypes* resets the types of the axes this trace is on, because new data could","cause the automatic axis type detection to change. Log type will not be cleared, as that","is never automatically chosen so must have been user-specified.","*plot* (re)plots but without first clearing `gd.calcdata`.","*style* only calls `module.style` (or module.editStyle) for all trace modules and redraws the legend.","*markerSize* is like *style*, but propagate axis-range changes due to scatter `marker.size`","*colorbars* only redraws colorbars."].join(" ")},a={valType:"flaglist",extras:["none"],flags:["calc","plot","legend","ticks","axrange","layoutstyle","modebar","camera","arraydraw","colorbars"],description:["layout attributes should include an `editType` string matching this flaglist.","*calc* is the most extensive: a full (re)plot starting by clearing `gd.calcdata`","to force it to be regenerated","*plot* (re)plots but without first clearing `gd.calcdata`.","*legend* only redraws the legend.","*ticks* only redraws axis ticks, labels, and gridlines.","*axrange* minimal sequence when updating axis ranges.","*layoutstyle* reapplies global and SVG cartesian axis styles.","*modebar* just updates the modebar.","*camera* just updates the camera settings for gl3d scenes.","*arraydraw* allows component arrays to invoke the redraw routines just for the","component(s) that changed.","*colorbars* only redraws colorbars."].join(" ")},s=o.flags.slice().concat(["fullReplot"]),l=a.flags.slice().concat("layoutReplot");function c(t){for(var e={},r=0;r{"use strict";var n=r(7370),i=r(17399),o=r(25059),a=r(12822),s=r(51137),l=r(99246),c=r(17499),u=l.cleanId,h=l.getFromTrace,d=o.traceIs;function f(t,e){var r=t[e],n=e.charAt(0);r&&"paper"!==r&&(t[e]=u(r,n,!0))}function p(t){function e(e,r){var n=t[e],i=t.title&&t.title[r];n&&!i&&(t.title||(t.title={}),t.title[r]=t[e],delete t[e])}t&&("string"!=typeof t.title&&"number"!=typeof t.title||(t.title={text:t.title}),e("titlefont","font"),e("titleposition","position"),e("titleside","side"),e("titleoffset","offset"))}function m(t){if(!a.isPlainObject(t))return!1;var e=t.name;return delete t.name,delete t.showlegend,("string"==typeof e||"number"==typeof e)&&String(e)}function g(t,e,r,n){if(r&&!n)return t;if(n&&!r)return e;if(!t.trim())return e;if(!e.trim())return t;var i,o=Math.min(t.length,e.length);for(i=0;i0&&a.log("Clearing previous rejected promises from queue."),t._promises=[]},e.cleanLayout=function(t){var r,n;t||(t={}),t.xaxis1&&(t.xaxis||(t.xaxis=t.xaxis1),delete t.xaxis1),t.yaxis1&&(t.yaxis||(t.yaxis=t.yaxis1),delete t.yaxis1),t.scene1&&(t.scene||(t.scene=t.scene1),delete t.scene1);var o=(s.subplotsRegistry.cartesian||{}).attrRegex,l=(s.subplotsRegistry.polar||{}).attrRegex,h=(s.subplotsRegistry.ternary||{}).attrRegex,d=(s.subplotsRegistry.gl3d||{}).attrRegex,m=Object.keys(t);for(r=0;r3?(D.x=1.02,D.xanchor="left"):D.x<-2&&(D.x=-.02,D.xanchor="right"),D.y>3?(D.y=1.02,D.yanchor="bottom"):D.y<-2&&(D.y=-.02,D.yanchor="top")),p(t),"rotate"===t.dragmode&&(t.dragmode="orbit"),c.clean(t),t.template&&t.template.layout&&e.cleanLayout(t.template.layout),t},e.cleanData=function(t){for(var r=0;r0)return t.substr(0,e)}e.hasParent=function(t,e){for(var r=x(e);r;){if(r in t)return!0;r=x(r)}return!1};var _=["x","y","z"];e.clearAxisTypes=function(t,e,r){for(var n=0;n{"use strict";var n=r(57755);e._doPlot=n._doPlot,e.newPlot=n.newPlot,e.restyle=n.restyle,e.relayout=n.relayout,e.redraw=n.redraw,e.update=n.update,e._guiRestyle=n._guiRestyle,e._guiRelayout=n._guiRelayout,e._guiUpdate=n._guiUpdate,e._storeDirectGUIEdit=n._storeDirectGUIEdit,e.react=n.react,e.extendTraces=n.extendTraces,e.prependTraces=n.prependTraces,e.addTraces=n.addTraces,e.deleteTraces=n.deleteTraces,e.moveTraces=n.moveTraces,e.purge=n.purge,e.addFrames=n.addFrames,e.deleteFrames=n.deleteFrames,e.animate=n.animate,e.setPlotConfig=n.setPlotConfig;var i=r(16822).getGraphDiv,o=r(71422).eraseActiveShape;e.deleteActiveShape=function(t){return o(i(t))},e.toImage=r(42704),e.validate=r(56205),e.downloadImage=r(56787);var a=r(89170);e.makeTemplate=a.makeTemplate,e.validateTemplate=a.validateTemplate},50305:(t,e,r)=>{"use strict";var n=r(12517),i=r(51648),o=r(64347),a=r(45380).sorterAsc,s=r(25059);e.containerArrayMatch=r(81776);var l=e.isAddVal=function(t){return"add"===t||n(t)},c=e.isRemoveVal=function(t){return null===t||"remove"===t};e.applyContainerArrayChanges=function(t,e,r,n,u){var h=e.astr,d=s.getComponentMethod(h,"supplyLayoutDefaults"),f=s.getComponentMethod(h,"draw"),p=s.getComponentMethod(h,"drawOne"),m=n.replot||n.recalc||d===i||f===i,g=t.layout,v=t._fullLayout;if(r[""]){Object.keys(r).length>1&&o.warn("Full array edits are incompatible with other edits",h);var b=r[""][""];if(c(b))e.set(null);else{if(!Array.isArray(b))return o.warn("Unrecognized full array edit value",h,b),!0;e.set(b)}return!m&&(d(g,v),f(t),!0)}var y,x,_,w,k,A,M,T,S=Object.keys(r).map(Number).sort(a),C=e.get(),E=C||[],L=u(v,h).get(),z=[],O=-1,D=E.length;for(y=0;yE.length-(M?0:1))o.warn("index out of range",h,_);else if(void 0!==A)k.length>1&&o.warn("Insertion & removal are incompatible with edits to the same index.",h,_),c(A)?z.push(_):M?("add"===A&&(A={}),E.splice(_,0,A),L&&L.splice(_,0,{})):o.warn("Unrecognized full object edit value",h,_,A),-1===O&&(O=_);else for(x=0;x=0;y--)E.splice(z[y],1),L&&L.splice(z[y],1);if(E.length?C||e.set(E):e.set(null),m)return!1;if(d(g,v),p!==i){var I;if(-1===O)I=S;else{for(D=Math.max(E.length,D),I=[],y=0;y=O);y++)I.push(_);for(y=O;y{"use strict";var n=r(27941),i=r(7370),o=r(56885),a=r(12822),s=a.nestedProperty,l=r(16677),c=r(79385),u=r(25059),h=r(35852),d=r(51137),f=r(75815),p=r(46458),m=r(86130),g=r(40666),v=r(17499),b=r(30977).initInteractions,y=r(25853),x=r(70059).clearOutline,_=r(58389).dfltConfig,w=r(50305),k=r(32862),A=r(39004),M=r(62309),T=r(21197).AX_NAME_PATTERN,S=0;function C(t){var e=t._fullLayout;e._redrawFromAutoMarginCount?e._redrawFromAutoMarginCount--:t.emit("plotly_afterplot")}function E(t,e){try{t._fullLayout._paper.style("background",e)}catch(t){a.error(t)}}function L(t,e){E(t,v.combine(e,"white"))}function z(t,e){if(!t._context){t._context=a.extendDeep({},_);var r=n.select("base");t._context._baseUrl=r.size()&&r.attr("href")?window.location.href.split("#")[0]:""}var i,s,l,c=t._context;if(e){for(s=Object.keys(e),i=0;i=t.data.length||i<-t.data.length)throw new Error(r+" must be valid indices for gd.data.");if(e.indexOf(i,n+1)>-1||i>=0&&e.indexOf(-t.data.length+i)>-1||i<0&&e.indexOf(t.data.length+i)>-1)throw new Error("each index in "+r+" must be unique.")}}function I(t,e,r){if(!Array.isArray(t.data))throw new Error("gd.data must be an array.");if(void 0===e)throw new Error("currentIndices is a required argument.");if(Array.isArray(e)||(e=[e]),D(t,e,"currentIndices"),void 0===r||Array.isArray(r)||(r=[r]),void 0!==r&&D(t,r,"newIndices"),void 0!==r&&e.length!==r.length)throw new Error("current and new indices must be of equal length.")}function F(t,e,r,n,o){!function(t,e,r,n){var i=a.isPlainObject(n);if(!Array.isArray(t.data))throw new Error("gd.data must be an array");if(!a.isPlainObject(e))throw new Error("update must be a key:value object");if(void 0===r)throw new Error("indices must be an integer or array of integers");for(var o in D(t,r,"indices"),e){if(!Array.isArray(e[o])||e[o].length!==r.length)throw new Error("attribute "+o+" must be an array of length equal to indices array length");if(i&&(!(o in n)||!Array.isArray(n[o])||n[o].length!==e[o].length))throw new Error("when maxPoints is set as a key:value object it must contain a 1:1 corrispondence with the keys and number of traces in the update object")}}(t,e,r,n);for(var l=function(t,e,r,n){var o,l,c,u,h,d=a.isPlainObject(n),f=[];for(var p in Array.isArray(r)||(r=[r]),r=O(r,t.data.length-1),e)for(var m=0;m-1&&-1===r.indexOf("grouptitlefont")?l(r,r.replace("titlefont","title.font")):r.indexOf("titleposition")>-1?l(r,r.replace("titleposition","title.position")):r.indexOf("titleside")>-1?l(r,r.replace("titleside","title.side")):r.indexOf("titleoffset")>-1&&l(r,r.replace("titleoffset","title.offset")):l(r,r.replace("title","title.text"));function l(e,r){t[r]=t[e],delete t[e]}}function V(t,e,r){t=a.getGraphDiv(t),k.clearPromiseQueue(t);var n={};if("string"==typeof e)n[e]=r;else{if(!a.isPlainObject(e))return a.warn("Relayout fail.",e,r),Promise.reject();n=a.extendFlat({},e)}Object.keys(n).length&&(t.changed=!0);var i=X(t,n),o=i.flags;o.calc&&(t.calcdata=void 0);var s=[d.previousPromises];o.layoutReplot?s.push(A.layoutReplot):Object.keys(n).length&&(H(t,o,i)||d.supplyDefaults(t),o.legend&&s.push(A.doLegend),o.layoutstyle&&s.push(A.layoutStyles),o.axrange&&W(s,i.rangesAltered),o.ticks&&s.push(A.doTicksRelayout),o.modebar&&s.push(A.doModeBar),o.camera&&s.push(A.doCamera),o.colorbars&&s.push(A.doColorBars),s.push(C)),s.push(d.rehover,d.redrag,d.reselect),c.add(t,V,[t,i.undoit],V,[t,i.redoit]);var l=a.syncOrAsync(s,t);return l&&l.then||(l=Promise.resolve(t)),l.then((function(){return t.emit("plotly_relayout",i.eventData),t}))}function H(t,e,r){var n,i,o=t._fullLayout;if(!e.axrange)return!1;for(var s in e)if("axrange"!==s&&e[s])return!1;var l=function(t,e){return a.coerce(n,i,m,t,e)},c={};for(var u in r.rangesAltered){var h=f.id2name(u);if(n=t.layout[h],i=o[h],p(n,i,l,c),i._matchGroup)for(var d in i._matchGroup)if(d!==u){var g=o[f.id2name(d)];g.autorange=i.autorange,g.range=i.range.slice(),g._input.range=i.range.slice()}}return!0}function W(t,e){var r=e?function(t){var r=[];for(var n in e){var i=f.getFromId(t,n);if(r.push(n),-1!==(i.ticklabelposition||"").indexOf("inside")&&i._anchorAxis&&r.push(i._anchorAxis._id),i._matchGroup)for(var o in i._matchGroup)e[o]||r.push(o)}return f.draw(t,r,{skipTitle:!0})}:function(t){return f.draw(t,"redraw")};t.push(x,A.doAutoRangeAndConstraints,r,A.drawData,A.finalDraw)}var q=/^[xyz]axis[0-9]*\.range(\[[0|1]\])?$/,Y=/^[xyz]axis[0-9]*\.autorange$/,Z=/^[xyz]axis[0-9]*\.domain(\[[0|1]\])?$/;function X(t,e){var r,n,i,o=t.layout,l=t._fullLayout,c=l._guiEditing,d=N(l._preGUI,c),p=Object.keys(e),m=f.list(t),g=a.extendDeepAll({},e),v={};for(G(e),p=Object.keys(e),n=0;n0&&"string"!=typeof D.parts[F];)F--;var R=D.parts[F],P=D.parts[F-1]+"."+R,B=D.parts.slice(0,F).join("."),U=s(t.layout,B).get(),V=s(l,B).get(),H=D.get();if(void 0!==I){A[O]=I,S[O]="reverse"===R?I:j(H);var W=h.getLayoutValObject(l,D.parts);if(W&&W.impliedEdits&&null!==I)for(var X in W.impliedEdits)C(a.relativeAttr(O,X),W.impliedEdits[X]);if(-1!==["width","height"].indexOf(O))if(I){C("autosize",null);var J="height"===O?"width":"height";C(J,l[J])}else l[O]=t._initialAutoSize[O];else if("autosize"===O)C("width",I?null:l.width),C("height",I?null:l.height);else if(P.match(q))z(P),s(l,B+"._inputRange").set(null);else if(P.match(Y)){z(P),s(l,B+"._inputRange").set(null);var K=s(l,B).get();K._inputDomain&&(K._input.domain=K._inputDomain.slice())}else P.match(Z)&&s(l,B+"._inputDomain").set(null);if("type"===R){E=U;var Q="linear"===V.type&&"log"===I,tt="log"===V.type&&"linear"===I;if(Q||tt){if(E&&E.range)if(V.autorange)Q&&(E.range=E.range[1]>E.range[0]?[1,2]:[2,1]);else{var et=E.range[0],rt=E.range[1];Q?(et<=0&&rt<=0&&C(B+".autorange",!0),et<=0?et=rt/1e6:rt<=0&&(rt=et/1e6),C(B+".range[0]",Math.log(et)/Math.LN10),C(B+".range[1]",Math.log(rt)/Math.LN10)):(C(B+".range[0]",Math.pow(10,et)),C(B+".range[1]",Math.pow(10,rt)))}else C(B+".autorange",!0);Array.isArray(l._subplots.polar)&&l._subplots.polar.length&&l[D.parts[0]]&&"radialaxis"===D.parts[1]&&delete l[D.parts[0]]._subplot.viewInitial["radialaxis.range"],u.getComponentMethod("annotations","convertCoords")(t,V,I,C),u.getComponentMethod("images","convertCoords")(t,V,I,C)}else C(B+".autorange",!0),C(B+".range",null);s(l,B+"._inputRange").set(null)}else if(R.match(T)){var nt=s(l,O).get(),it=(I||{}).type;it&&"-"!==it||(it="linear"),u.getComponentMethod("annotations","convertCoords")(t,nt,it,C),u.getComponentMethod("images","convertCoords")(t,nt,it,C)}var ot=w.containerArrayMatch(O);if(ot){r=ot.array,n=ot.index;var at=ot.property,st=W||{editType:"calc"};""!==n&&""===at&&(w.isAddVal(I)?S[O]=null:w.isRemoveVal(I)?S[O]=(s(o,r).get()||[])[n]:a.warn("unrecognized full object value",e)),M.update(_,st),v[r]||(v[r]={});var lt=v[r][n];lt||(lt=v[r][n]={}),lt[at]=I,delete e[O]}else"reverse"===R?(U.range?U.range.reverse():(C(B+".autorange",!0),U.range=[1,0]),V.autorange?_.calc=!0:_.plot=!0):("dragmode"===O&&(!1===I&&!1!==H||!1!==I&&!1===H)||l._has("scatter-like")&&l._has("regl")&&"dragmode"===O&&("lasso"===I||"select"===I)&&"lasso"!==H&&"select"!==H||l._has("gl2d")?_.plot=!0:W?M.update(_,W):_.calc=!0,D.set(I))}}for(r in v)w.applyContainerArrayChanges(t,d(o,r),v[r],_,d)||(_.plot=!0);for(var ct in L){var ut=(E=f.getFromId(t,ct))&&E._constraintGroup;if(ut)for(var ht in _.calc=!0,ut)L[ht]||(f.getFromId(t,ht)._constraintShrinkable=!0)}($(t)||e.height||e.width)&&(_.plot=!0);var dt=l.shapes;for(n=0;n1;)if(n.pop(),void 0!==(r=s(e,n.join(".")+".uirevision").get()))return r;return e.uirevision}function nt(t,e){for(var r=0;r=i.length?i[0]:i[t]:i}function l(t){return Array.isArray(o)?t>=o.length?o[0]:o[t]:o}function c(t,e){var r=0;return function(){if(t&&++r===e)return t()}}return void 0===n._frameWaitingCnt&&(n._frameWaitingCnt=0),new Promise((function(o,u){function h(){t.emit("plotly_animating"),n._lastFrameAt=-1/0,n._timeToNext=0,n._runningTransitions=0,n._currentFrame=null;var e=function(){n._animationRaf=window.requestAnimationFrame(e),Date.now()-n._lastFrameAt>n._timeToNext&&function(){n._currentFrame&&n._currentFrame.onComplete&&n._currentFrame.onComplete();var e=n._currentFrame=n._frameQueue.shift();if(e){var r=e.name?e.name.toString():null;t._fullLayout._currentFrame=r,n._lastFrameAt=Date.now(),n._timeToNext=e.frameOpts.duration,d.transition(t,e.frame.data,e.frame.layout,k.coerceTraceIndices(t,e.frame.traces),e.frameOpts,e.transitionOpts).then((function(){e.onComplete&&e.onComplete()})),t.emit("plotly_animatingframe",{name:r,frame:e.frame,animation:{frame:e.frameOpts,transition:e.transitionOpts}})}else t.emit("plotly_animated"),window.cancelAnimationFrame(n._animationRaf),n._animationRaf=null}()};e()}var f,p,m=0;function g(t){return Array.isArray(i)?m>=i.length?t.transitionOpts=i[m]:t.transitionOpts=i[0]:t.transitionOpts=i,m++,t}var v=[],b=null==e,y=Array.isArray(e);if(b||y||!a.isPlainObject(e)){if(b||-1!==["string","number"].indexOf(typeof e))for(f=0;f0&&ww)&&A.push(p);v=A}}v.length>0?function(e){if(0!==e.length){for(var i=0;i=0;n--)if(a.isPlainObject(e[n])){var m=e[n].name,g=(u[m]||p[m]||{}).name,v=e[n].name,b=u[g]||p[g];g&&v&&"number"==typeof v&&b&&S<5&&(S++,a.warn('addFrames: overwriting frame "'+(u[g]||p[g]).name+'" with a frame whose name of type "number" also equates to "'+g+'". This is valid but may potentially lead to unexpected behavior since all plotly.js frame names are stored internally as strings.'),5===S&&a.warn("addFrames: This API call has yielded too many of these warnings. For the rest of this call, further warnings about numeric frame names will be suppressed.")),p[m]={name:m},f.push({frame:d.supplyFrameDefaults(e[n]),index:r&&void 0!==r[n]&&null!==r[n]?r[n]:h+n})}f.sort((function(t,e){return t.index>e.index?-1:t.index=0;n--){if("number"==typeof(i=f[n].frame).name&&a.warn("Warning: addFrames accepts frames with numeric names, but the numbers areimplicitly cast to strings"),!i.name)for(;u[i.name="frame "+t._transitionData._counter++];);if(u[i.name]){for(o=0;o=0;r--)n=e[r],o.push({type:"delete",index:n}),s.unshift({type:"insert",index:n,value:i[n]});var l=d.modifyFrames,u=d.modifyFrames,h=[t,s],f=[t,o];return c&&c.add(t,l,h,u,f),d.modifyFrames(t,o)},e.addTraces=function t(r,n,i){r=a.getGraphDiv(r);var o,s,l=[],u=e.deleteTraces,h=t,d=[r,l],f=[r,n];for(function(t,e,r){var n,i;if(!Array.isArray(t.data))throw new Error("gd.data must be an array.");if(void 0===e)throw new Error("traces must be defined.");for(Array.isArray(e)||(e=[e]),n=0;n=0&&r=0&&r{"use strict";var e={staticPlot:{valType:"boolean",dflt:!1,description:["Determines whether the graphs are interactive or not.","If *false*, no interactivity, for export or image generation."].join(" ")},typesetMath:{valType:"boolean",dflt:!0,description:["Determines whether math should be typeset or not,","when MathJax (either v2 or v3) is present on the page."].join(" ")},plotlyServerURL:{valType:"string",dflt:"",description:["When set it determines base URL for","the 'Edit in Chart Studio' `showEditInChartStudio`/`showSendToCloud` mode bar button","and the showLink/sendData on-graph link.","To enable sending your data to Chart Studio Cloud, you need to","set both `plotlyServerURL` to 'https://chart-studio.plotly.com' and","also set `showSendToCloud` to true."].join(" ")},editable:{valType:"boolean",dflt:!1,description:["Determines whether the graph is editable or not.","Sets all pieces of `edits`","unless a separate `edits` config item overrides individual parts."].join(" ")},edits:{annotationPosition:{valType:"boolean",dflt:!1,description:["Determines if the main anchor of the annotation is editable.","The main anchor corresponds to the","text (if no arrow) or the arrow (which drags the whole thing leaving","the arrow length & direction unchanged)."].join(" ")},annotationTail:{valType:"boolean",dflt:!1,description:["Has only an effect for annotations with arrows.","Enables changing the length and direction of the arrow."].join(" ")},annotationText:{valType:"boolean",dflt:!1,description:"Enables editing annotation text."},axisTitleText:{valType:"boolean",dflt:!1,description:"Enables editing axis title text."},colorbarPosition:{valType:"boolean",dflt:!1,description:"Enables moving colorbars."},colorbarTitleText:{valType:"boolean",dflt:!1,description:"Enables editing colorbar title text."},legendPosition:{valType:"boolean",dflt:!1,description:"Enables moving the legend."},legendText:{valType:"boolean",dflt:!1,description:"Enables editing the trace name fields from the legend"},shapePosition:{valType:"boolean",dflt:!1,description:"Enables moving shapes."},titleText:{valType:"boolean",dflt:!1,description:"Enables editing the global layout title."}},editSelection:{valType:"boolean",dflt:!0,description:"Enables moving selections."},autosizable:{valType:"boolean",dflt:!1,description:["Determines whether the graphs are plotted with respect to","layout.autosize:true and infer its container size."].join(" ")},responsive:{valType:"boolean",dflt:!1,description:["Determines whether to change the layout size when window is resized.","In v3, this option will be removed and will always be true."].join(" ")},fillFrame:{valType:"boolean",dflt:!1,description:["When `layout.autosize` is turned on, determines whether the graph","fills the container (the default) or the screen (if set to *true*)."].join(" ")},frameMargins:{valType:"number",dflt:0,min:0,max:.5,description:["When `layout.autosize` is turned on, set the frame margins","in fraction of the graph size."].join(" ")},scrollZoom:{valType:"flaglist",flags:["cartesian","gl3d","geo","mapbox","map"],extras:[!0,!1],dflt:"gl3d+geo+map",description:["Determines whether mouse wheel or two-finger scroll zooms is enable.","Turned on by default for gl3d, geo, mapbox and map subplots","(as these subplot types do not have zoombox via pan),","but turned off by default for cartesian subplots.","Set `scrollZoom` to *false* to disable scrolling for all subplots."].join(" ")},doubleClick:{valType:"enumerated",values:[!1,"reset","autosize","reset+autosize"],dflt:"reset+autosize",description:["Sets the double click interaction mode.","Has an effect only in cartesian plots.","If *false*, double click is disable.","If *reset*, double click resets the axis ranges to their initial values.","If *autosize*, double click set the axis ranges to their autorange values.","If *reset+autosize*, the odd double clicks resets the axis ranges","to their initial values and even double clicks set the axis ranges","to their autorange values."].join(" ")},doubleClickDelay:{valType:"number",dflt:300,min:0,description:["Sets the delay for registering a double-click in ms.","This is the time interval (in ms) between first mousedown and","2nd mouseup to constitute a double-click.","This setting propagates to all on-subplot double clicks","(except for geo, mapbox and map) and on-legend double clicks."].join(" ")},showAxisDragHandles:{valType:"boolean",dflt:!0,description:["Set to *false* to omit cartesian axis pan/zoom drag handles."].join(" ")},showAxisRangeEntryBoxes:{valType:"boolean",dflt:!0,description:["Set to *false* to omit direct range entry at the pan/zoom drag points,","note that `showAxisDragHandles` must be enabled to have an effect."].join(" ")},showTips:{valType:"boolean",dflt:!0,description:["Determines whether or not tips are shown while interacting","with the resulting graphs."].join(" ")},showLink:{valType:"boolean",dflt:!1,description:["Determines whether a link to Chart Studio Cloud is displayed","at the bottom right corner of resulting graphs.","Use with `sendData` and `linkText`."].join(" ")},linkText:{valType:"string",dflt:"Edit chart",noBlank:!0,description:["Sets the text appearing in the `showLink` link."].join(" ")},sendData:{valType:"boolean",dflt:!0,description:["If *showLink* is true, does it contain data","just link to a Chart Studio Cloud file?"].join(" ")},showSources:{valType:"any",dflt:!1,description:["Adds a source-displaying function to show sources on","the resulting graphs."].join(" ")},displayModeBar:{valType:"enumerated",values:["hover",!0,!1],dflt:"hover",description:["Determines the mode bar display mode.","If *true*, the mode bar is always visible.","If *false*, the mode bar is always hidden.","If *hover*, the mode bar is visible while the mouse cursor","is on the graph container."].join(" ")},showSendToCloud:{valType:"boolean",dflt:!1,description:['Should we include a ModeBar button, labeled "Edit in Chart Studio",',"that sends this chart to chart-studio.plotly.com (formerly plot.ly) or another plotly server","as specified by `plotlyServerURL` for editing, export, etc? Prior to version 1.43.0","this button was included by default, now it is opt-in using this flag.","Note that this button can (depending on `plotlyServerURL` being set) send your data","to an external server. However that server does not persist your data",'until you arrive at the Chart Studio and explicitly click "Save".'].join(" ")},showEditInChartStudio:{valType:"boolean",dflt:!1,description:["Same as `showSendToCloud`, but use a pencil icon instead of a floppy-disk.","Note that if both `showSendToCloud` and `showEditInChartStudio` are turned,","only `showEditInChartStudio` will be honored."].join(" ")},modeBarButtonsToRemove:{valType:"any",dflt:[],description:["Remove mode bar buttons by name.","See ./components/modebar/buttons.js for the list of names."].join(" ")},modeBarButtonsToAdd:{valType:"any",dflt:[],description:["Add mode bar button using config objects","See ./components/modebar/buttons.js for list of arguments.","To enable predefined modebar buttons e.g. shape drawing, hover and spikelines,","simply provide their string name(s). This could include:","*v1hovermode*, *hoverclosest*, *hovercompare*, *togglehover*, *togglespikelines*,","*drawline*, *drawopenpath*, *drawclosedpath*, *drawcircle*, *drawrect* and *eraseshape*.","Please note that these predefined buttons will only be shown if they are compatible","with all trace types used in a graph."].join(" ")},modeBarButtons:{valType:"any",dflt:!1,description:["Define fully custom mode bar buttons as nested array,","where the outer arrays represents button groups, and","the inner arrays have buttons config objects or names of default buttons","See ./components/modebar/buttons.js for more info."].join(" ")},toImageButtonOptions:{valType:"any",dflt:{},description:["Statically override options for toImage modebar button","allowed keys are format, filename, width, height, scale","see ../components/modebar/buttons.js"].join(" ")},displaylogo:{valType:"boolean",dflt:!0,description:["Determines whether or not the plotly logo is displayed","on the end of the mode bar."].join(" ")},watermark:{valType:"boolean",dflt:!1,description:"watermark the images with the company's logo"},plotGlPixelRatio:{valType:"number",dflt:2,min:1,max:4,description:["Set the pixel ratio during WebGL image export.","This config option was formerly named `plot3dPixelRatio`","which is now deprecated."].join(" ")},setBackground:{valType:"any",dflt:"transparent",description:["Set function to add the background color (i.e. `layout.paper_color`)","to a different container.","This function take the graph div as first argument and the current background","color as second argument.","Alternatively, set to string *opaque* to ensure there is white behind it."].join(" ")},topojsonURL:{valType:"string",noBlank:!0,dflt:"https://cdn.plot.ly/",description:["Set the URL to topojson used in geo charts.","By default, the topojson files are fetched from cdn.plot.ly.","For example, set this option to:","/dist/topojson/","to render geographical feature using the topojson files","that ship with the plotly.js module."].join(" ")},mapboxAccessToken:{valType:"string",dflt:null,description:["Mapbox access token (required to plot mapbox trace types)","If using an Mapbox Atlas server, set this option to ''","so that plotly.js won't attempt to authenticate to the public Mapbox server."].join(" ")},logging:{valType:"integer",min:0,max:2,dflt:1,description:["Turn all console logging on or off (errors will be thrown)","This should ONLY be set via Plotly.setPlotConfig","Available levels:","0: no logs","1: warnings and errors, but not informational messages","2: verbose logs"].join(" ")},notifyOnLogging:{valType:"integer",min:0,max:2,dflt:0,description:["Set on-graph logging (notifier) level","This should ONLY be set via Plotly.setPlotConfig","Available levels:","0: no on-graph logs","1: warnings and errors, but not informational messages","2: verbose logs"].join(" ")},queueLength:{valType:"integer",min:0,dflt:0,description:"Sets the length of the undo/redo queue."},globalTransforms:{valType:"any",dflt:[],description:["Set global transform to be applied to all traces with no","specification needed"].join(" ")},locale:{valType:"string",dflt:"en-US",description:["Which localization should we use?","Should be a string like 'en' or 'en-US'."].join(" ")},locales:{valType:"any",dflt:{},description:["Localization definitions","Locales can be provided either here (specific to one chart) or globally","by registering them as modules.","Should be an object of objects {locale: {dictionary: {...}, format: {...}}}","{"," da: {"," dictionary: {'Reset axes': 'Nulstil aksler', ...},"," format: {months: [...], shortMonths: [...]}"," },"," ...","}","All parts are optional. When looking for translation or format fields, we","look first for an exact match in a config locale, then in a registered","module. If those fail, we strip off any regionalization ('en-US' -> 'en')","and try each (config, registry) again. The final fallback for translation","is untranslated (which is US English) and for formats is the base English","(the only consequence being the last fallback date format %x is DD/MM/YYYY","instead of MM/DD/YYYY). Currently `grouping` and `currency` are ignored","for our automatic number formatting, but can be used in custom formats."].join(" ")}},r={};!function t(e,r){for(var n in e){var i=e[n];i.valType?r[n]=i.dflt:(r[n]||(r[n]={}),t(i,r[n]))}}(e,r),t.exports={configAttributes:e,dfltConfig:r}},35852:(t,e,r)=>{"use strict";var n=r(25059),i=r(12822),o=r(3520),a=r(13195),s=r(53874),l=r(46367),c=r(58389).configAttributes,u=r(62309),h=i.extendDeepAll,d=i.isPlainObject,f=i.isArrayOrTypedArray,p=i.nestedProperty,m=i.valObjectMeta,g="_isSubplotObj",v="_isLinkedToArray",b="_deprecated",y=[g,v,"_arrayAttrRegexps",b];function x(t,e,r){if(!t)return!1;if(t._isLinkedToArray)if(_(e[r]))r++;else if(r=o.length)return!1;if(2===t.dimensions){if(r++,e.length===r)return t;var a=e[r];if(!_(a))return!1;t=o[i][a]}else t=o[i]}else t=o}}return t}function _(t){return t===Math.round(t)&&t>=0}function w(){var t,e,r={};for(t in h(r,a),n.subplotsRegistry)if((e=n.subplotsRegistry[t]).layoutAttributes)if(Array.isArray(e.attr))for(var i=0;i=l.length)return!1;i=(r=(n.transformsRegistry[l[c].type]||{}).attributes)&&r[e[2]],s=3}else{var u=t._module;if(u||(u=(n.modules[t.type||o.type.dflt]||{})._module),!u)return!1;if(!(i=(r=u.attributes)&&r[a])){var h=u.basePlotModule;h&&h.attributes&&(i=h.attributes[a])}i||(i=o[a])}return x(i,e,s)},e.getLayoutValObject=function(t,e){var r=function(t,e){var r,i,o,s,l=t._basePlotModules;if(l){var c;for(r=0;r{"use strict";var n=r(12822),i=r(3520),o="templateitemname",a={name:{valType:"string",editType:"none",description:["When used in a template, named items are created in the output figure","in addition to any items the figure already has in this array.","You can modify these items in the output figure by making your own","item with `templateitemname` matching this `name`","alongside your modifications (including `visible: false` or","`enabled: false` to hide it).","Has no effect outside of a template."].join(" ")}};function s(t){return t&&"string"==typeof t}function l(t){var e=t.length-1;return"s"!==t.charAt(e)&&n.warn("bad argument to arrayDefaultKey: "+t),t.substr(0,t.length-1)+"defaults"}a[o]={valType:"string",editType:"calc",description:["Used to refer to a named item in this array in the template. Named","items from the template will be created even without a matching item","in the input figure, but you can modify one by making an item with","`templateitemname` matching its `name`, alongside your modifications","(including `visible: false` or `enabled: false` to hide it).","If there is no template or no matching item, this item will be","hidden unless you explicitly show it with `visible: true`."].join(" ")},e.templatedArray=function(t,e){return e._isLinkedToArray=t,e.name=a.name,e[o]=a[o],e},e.traceTemplater=function(t){var e,r,o={};for(e in t)r=t[e],Array.isArray(r)&&r.length&&(o[e]=0);return{newTrace:function(a){var s={type:e=n.coerce(a,{},i,"type"),_template:null};if(e in o){r=t[e];var l=o[e]%r.length;o[e]++,s._template=r[l]}return s}}},e.newContainer=function(t,e,r){var i=t._template,o=i&&(i[e]||r&&i[r]);return n.isPlainObject(o)||(o=null),t[e]={_template:o}},e.arrayTemplater=function(t,e,r){var n=t._template,i=n&&n[l(e)],a=n&&n[e];Array.isArray(a)&&a.length||(a=[]);var c={};return{newItem:function(t){var e={name:t.name,_input:t},n=e[o]=t[o];if(!s(n))return e._template=i,e;for(var l=0;l=i&&(r._input||{})._templateitemname;s&&(a=i);var l,c=e+"["+a+"]";function u(){l={},s&&(l[c]={},l[c][o]=s)}function h(t,e){s?n.nestedProperty(l[c],t).set(e):l[c+"."+t]=e}function d(){var t=l;return u(),t}return u(),{modifyBase:function(t,e){l[t]=e},modifyItem:h,getUpdateObj:d,applyUpdate:function(e,r){e&&h(e,r);var i=d();for(var o in i)n.nestedProperty(t,o).set(i[o])}}}},39004:(t,e,r)=>{"use strict";var n=r(27941),i=r(25059),o=r(51137),a=r(12822),s=r(80394),l=r(86748),c=r(17499),u=r(40666),h=r(6883),d=r(45828),f=r(75815),p=r(89701),m=r(69352),g=m.enforce,v=m.clean,b=r(19496).doAutoRange,y="start",x=r(21197).zindexSeparator;function _(t,e,r){for(var n=0;n=t[1]||i[1]<=t[0])&&o[0]e[0])return!0}return!1}function w(t){var r,i,s,l,h,m,g=t._fullLayout,v=g._size,b=v.p,y=f.list(t,"",!0);if(g._paperdiv.style({width:t._context.responsive&&g.autosize&&!t._context._hasZeroWidth&&!t.layout.width?"100%":g.width+"px",height:t._context.responsive&&g.autosize&&!t._context._hasZeroHeight&&!t.layout.height?"100%":g.height+"px"}).selectAll(".main-svg").call(u.setSize,g.width,g.height),t._context.setBackground(t,g.paper_bgcolor),e.drawMainTitle(t),d.manage(t),!g._has("cartesian"))return o.previousPromises(t);function w(t,e,r){var n=t._lw/2;return"x"===t._id.charAt(0)?e?"top"===r?e._offset-b-n:e._offset+e._length+b+n:v.t+v.h*(1-(t.position||0))+n%1:e?"right"===r?e._offset+e._length+b+n:e._offset-b-n:v.l+v.w*(t.position||0)+n%1}for(r=0;r.5?"t":"b",a=t._fullLayout.margin[o],s=0;return"paper"===e.yref?s=r+e.pad.t+e.pad.b:"container"===e.yref&&(s=function(t,e,r,n,i){var o=0;return"middle"===r&&(o+=i/2),"t"===t?("top"===r&&(o+=i),o+=n-e*n):("bottom"===r&&(o+=i),o+=e*n),o}(o,n,i,t._fullLayout.height,r)+e.pad.t+e.pad.b),s>a?s:0}(t,e,m);if(g>0){!function(t,e,r,n){var i="title.automargin",s=t._fullLayout.title,l=s.y>.5?"t":"b",c={x:s.x,y:s.y,t:0,b:0},u={};"paper"===s.yref&&function(t,e,r,n,i){var o="paper"===e.yref?t._fullLayout._size.h:t._fullLayout.height,s=a.isTopAnchor(e)?n:n-i,l="b"===r?o-s:s;return!(a.isTopAnchor(e)&&"t"===r||a.isBottomAnchor(e)&&"b"===r)&&l{"use strict";var n=r(12822),i=n.isPlainObject,o=r(35852),a=r(51137),s=r(3520),l=r(46121),c=r(58389).dfltConfig;function u(t,e){t=n.extendDeep({},t);var r,o,a=Object.keys(t).sort();function s(e,r,n){if(i(r)&&i(e))u(e,r);else if(Array.isArray(r)&&Array.isArray(e)){var a=l.arrayTemplater({_template:t},n);for(o=0;ok?u.push({code:"unused",traceType:b,templateCount:w,dataCount:k}):k>w&&u.push({code:"reused",traceType:b,templateCount:w,dataCount:k})}}else u.push({code:"data"});if(function t(e,r){for(var n in e)if("_"!==n.charAt(0)){var o=e[n],a=m(e,n,r);i(o)?(Array.isArray(e)&&!1===o._template&&o.templateitemname&&u.push({code:"missing",path:a,templateitemname:o.templateitemname}),t(o,a)):Array.isArray(o)&&g(o)&&t(o,a)}}({data:f,layout:d},""),u.length)return u.map(v)}},42704:(t,e,r)=>{"use strict";var n=r(7370),i=r(57755),o=r(51137),a=r(12822),s=r(13078),l=r(48402),c=r(40241),u=r(88566).version,h={format:{valType:"enumerated",values:["png","jpeg","webp","svg","full-json"],dflt:"png",description:"Sets the format of exported image."},width:{valType:"number",min:1,description:["Sets the exported image width.","Defaults to the value found in `layout.width`","If set to *null*, the exported image width will match the current graph width."].join(" ")},height:{valType:"number",min:1,description:["Sets the exported image height.","Defaults to the value found in `layout.height`","If set to *null*, the exported image height will match the current graph height."].join(" ")},scale:{valType:"number",min:0,dflt:1,description:["Sets a scaling for the generated image.","If set, all features of a graphs (e.g. text, line width)","are scaled, unlike simply setting","a bigger *width* and *height*."].join(" ")},setBackground:{valType:"any",dflt:!1,description:["Sets the image background mode.","By default, the image background is determined by `layout.paper_bgcolor`,","the *transparent* mode.","One might consider setting `setBackground` to *opaque*","when exporting a *jpeg* image as JPEGs do not support opacity."].join(" ")},imageDataOnly:{valType:"boolean",dflt:!1,description:["Determines whether or not the return value is prefixed by","the image format's corresponding 'data:image;' spec."].join(" ")}};t.exports=function(t,e){var r,d,f,p;function m(t){return!(t in e)||a.validate(e[t],h[t])}if(e=e||{},a.isPlainObject(t)?(r=t.data||[],d=t.layout||{},f=t.config||{},p={}):(t=a.getGraphDiv(t),r=a.extendDeep([],t.data),d=a.extendDeep({},t.layout),f=t._context,p=t._fullLayout||{}),!m("width")&&null!==e.width||!m("height")&&null!==e.height)throw new Error("Height and width should be pixel values.");if(!m("format"))throw new Error("Export format is not "+a.join2(h.format.values,", "," or ")+".");var g={};function v(t,r){return a.coerce(e,g,h,t,r)}var b=v("format"),y=v("width"),x=v("height"),_=v("scale"),w=v("setBackground"),k=v("imageDataOnly"),A=document.createElement("div");A.style.position="absolute",A.style.left="-5000px",document.body.appendChild(A);var M=a.extendFlat({},d);y?M.width=y:null===e.width&&n(p.width)&&(M.width=p.width),x?M.height=x:null===e.height&&n(p.height)&&(M.height=p.height);var T=a.extendFlat({},f,{_exportedPlot:!0,staticPlot:!0,setBackground:w}),S=s.getRedrawFunc(A);function C(){return new Promise((function(t){setTimeout(t,s.getDelay(A._fullLayout))}))}function E(){return new Promise((function(t,e){var r=l(A,b,_),n=A._fullLayout.width,h=A._fullLayout.height;function d(){i.purge(A),document.body.removeChild(A)}if("full-json"===b){var f=o.graphJson(A,!1,"keepdata","object",!0,!0);return f.version=u,f=JSON.stringify(f),d(),t(k?f:s.encodeJSON(f))}if(d(),"svg"===b)return t(k?r:s.encodeSVG(r));var p=document.createElement("canvas");p.id=a.randstr(),c({format:b,width:n,height:h,scale:_,canvas:p,svg:r,promise:!0}).then(t).catch(e)}))}return new Promise((function(t,e){i.newPlot(A,r,M,T).then(S).then(C).then(E).then((function(e){t(function(t){return k?t.replace(s.IMAGE_URL_PREFIX,""):t}(e))})).catch((function(t){e(t)}))}))}},56205:(t,e,r)=>{"use strict";var n=r(12822),i=r(51137),o=r(35852),a=r(58389).dfltConfig,s=n.isPlainObject,l=Array.isArray,c=n.isArrayOrTypedArray;function u(t,e,r,i,o,a){a=a||[];for(var h=Object.keys(t),d=0;dy.length&&i.push(f("unused",o,v.concat(y.length)));var M,T,S,C,E,L=y.length,z=Array.isArray(A);if(z&&(L=Math.min(L,A.length)),2===x.dimensions)for(T=0;Ty[T].length&&i.push(f("unused",o,v.concat(T,y[T].length)));var O=y[T].length;for(M=0;M<(z?Math.min(O,A[T].length):O);M++)S=z?A[T][M]:A,C=b[T][M],E=y[T][M],n.validate(C,S)?E!==C&&E!==+C&&i.push(f("dynamic",o,v.concat(T,M),C,E)):i.push(f("value",o,v.concat(T,M),C))}else i.push(f("array",o,v.concat(T),b[T]));else for(T=0;T1&&d.push(f("object","layout"))),i.supplyDefaults(p);for(var m=p._fullData,g=r.length,v=0;v{"use strict";t.exports={mode:{valType:"enumerated",dflt:"afterall",values:["immediate","next","afterall"],description:["Describes how a new animate call interacts with currently-running","animations. If `immediate`, current animations are interrupted and","the new animation is started. If `next`, the current frame is allowed","to complete, after which the new animation is started. If `afterall`","all existing frames are animated to completion before the new animation","is started."].join(" ")},direction:{valType:"enumerated",values:["forward","reverse"],dflt:"forward",description:["The direction in which to play the frames triggered by the animation call"].join(" ")},fromcurrent:{valType:"boolean",dflt:!1,description:["Play frames starting at the current frame instead of the beginning."].join(" ")},frame:{duration:{valType:"number",min:0,dflt:500,description:["The duration in milliseconds of each frame. If greater than the frame","duration, it will be limited to the frame duration."].join(" ")},redraw:{valType:"boolean",dflt:!0,description:["Redraw the plot at completion of the transition. This is desirable","for transitions that include properties that cannot be transitioned,","but may significantly slow down updates that do not require a full","redraw of the plot"].join(" ")}},transition:{duration:{valType:"number",min:0,dflt:500,editType:"none",description:["The duration of the transition, in milliseconds. If equal to zero,","updates are synchronous."].join(" ")},easing:{valType:"enumerated",dflt:"cubic-in-out",values:["linear","quad","cubic","sin","exp","circle","elastic","back","bounce","linear-in","quad-in","cubic-in","sin-in","exp-in","circle-in","elastic-in","back-in","bounce-in","linear-out","quad-out","cubic-out","sin-out","exp-out","circle-out","elastic-out","back-out","bounce-out","linear-in-out","quad-in-out","cubic-in-out","sin-in-out","exp-in-out","circle-in-out","elastic-in-out","back-in-out","bounce-in-out"],editType:"none",description:"The easing function used for the transition"},ordering:{valType:"enumerated",values:["layout first","traces first"],dflt:"layout first",editType:"none",description:["Determines whether the figure's layout or traces smoothly transitions","during updates that make both traces and layout change."].join(" ")}}}},35677:(t,e,r)=>{"use strict";var n=r(12822),i=r(46121);t.exports=function(t,e,r){var o,a,s=r.name,l=r.inclusionAttr||"visible",c=e[s],u=n.isArrayOrTypedArray(t[s])?t[s]:[],h=e[s]=[],d=i.arrayTemplater(e,s,l);for(o=0;o{"use strict";var n=r(75058),i=r(60713);t.exports={type:{valType:"enumerated",values:[],dflt:"scatter",editType:"calc+clearAxisTypes",_noTemplating:!0},visible:{valType:"enumerated",values:[!0,!1,"legendonly"],dflt:!0,editType:"calc",description:["Determines whether or not this trace is visible.","If *legendonly*, the trace is not drawn,","but can appear as a legend item","(provided that the legend itself is visible)."].join(" ")},showlegend:{valType:"boolean",dflt:!0,editType:"style",description:["Determines whether or not an item corresponding to this","trace is shown in the legend."].join(" ")},legend:{valType:"subplotid",dflt:"legend",editType:"style",description:["Sets the reference to a legend to show this trace in.","References to these legends are *legend*, *legend2*, *legend3*, etc.","Settings for these legends are set in the layout, under","`layout.legend`, `layout.legend2`, etc."].join(" ")},legendgroup:{valType:"string",dflt:"",editType:"style",description:["Sets the legend group for this trace.","Traces and shapes part of the same legend group hide/show at the same time","when toggling legend items."].join(" ")},legendgrouptitle:{text:{valType:"string",dflt:"",editType:"style",description:["Sets the title of the legend group."].join(" ")},font:n({editType:"style",description:["Sets this legend group's title font."].join(" ")}),editType:"style"},legendrank:{valType:"number",dflt:1e3,editType:"style",description:["Sets the legend rank for this trace.","Items and groups with smaller ranks are presented on top/left side while","with *reversed* `legend.traceorder` they are on bottom/right side.","The default legendrank is 1000,","so that you can use ranks less than 1000 to place certain items before all unranked items,","and ranks greater than 1000 to go after all unranked items.","When having unranked or equal rank items shapes would be displayed after traces","i.e. according to their order in data and layout."].join(" ")},legendwidth:{valType:"number",min:0,editType:"style",description:"Sets the width (in px or fraction) of the legend for this trace."},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"style",description:"Sets the opacity of the trace."},name:{valType:"string",editType:"style",description:["Sets the trace name.","The trace name appears as the legend item and on hover."].join(" ")},uid:{valType:"string",editType:"plot",anim:!0,description:["Assign an id to this trace,","Use this to provide object constancy between traces during animations","and transitions."].join(" ")},ids:{valType:"data_array",editType:"calc",anim:!0,description:["Assigns id labels to each datum.","These ids for object constancy of data points during animation.","Should be an array of strings, not numbers or any other type."].join(" ")},customdata:{valType:"data_array",editType:"calc",description:["Assigns extra data each datum.","This may be useful when listening to hover, click and selection events.","Note that, *scatter* traces also appends customdata items in the markers","DOM elements"].join(" ")},meta:{valType:"any",arrayOk:!0,editType:"plot",description:["Assigns extra meta information associated with this trace","that can be used in various text attributes.","Attributes such as trace `name`, graph, axis and colorbar `title.text`, annotation `text`","`rangeselector`, `updatemenues` and `sliders` `label` text","all support `meta`.","To access the trace `meta` values in an attribute in the same trace, simply use","`%{meta[i]}` where `i` is the index or key of the `meta`","item in question.","To access trace `meta` in layout attributes, use","`%{data[n[.meta[i]}` where `i` is the index or key of the `meta`","and `n` is the trace index."].join(" ")},selectedpoints:{valType:"any",editType:"calc",description:["Array containing integer indices of selected points.","Has an effect only for traces that support selections.","Note that an empty array means an empty selection where the `unselected`","are turned on for all points, whereas, any other non-array values means no","selection all where the `selected` and `unselected` styles have no effect."].join(" ")},hoverinfo:{valType:"flaglist",flags:["x","y","z","text","name"],extras:["all","none","skip"],arrayOk:!0,dflt:"all",editType:"none",description:["Determines which trace information appear on hover.","If `none` or `skip` are set, no information is displayed upon hovering.","But, if `none` is set, click and hover events are still fired."].join(" ")},hoverlabel:i.hoverlabel,stream:{token:{valType:"string",noBlank:!0,strict:!0,editType:"calc",description:["The stream id number links a data trace on a plot with a stream.","See https://chart-studio.plotly.com/settings for more details."].join(" ")},maxpoints:{valType:"number",min:0,max:1e4,dflt:500,editType:"calc",description:["Sets the maximum number of points to keep on the plots from an","incoming stream.","If `maxpoints` is set to *50*, only the newest 50 points will","be displayed on the plot."].join(" ")},editType:"calc"},transforms:{_isLinkedToArray:"transform",editType:"calc",description:["WARNING: All transforms are deprecated and may be removed from the API in next major version.","An array of operations that manipulate the trace data,","for example filtering or sorting the data arrays."].join(" ")},uirevision:{valType:"any",editType:"none",description:["Controls persistence of some user-driven changes to the trace:","`constraintrange` in `parcoords` traces, as well as some","`editable: true` modifications such as `name` and `colorbar.title`.","Defaults to `layout.uirevision`.","Note that other user-driven trace attribute changes are controlled","by `layout` attributes:","`trace.visible` is controlled by `layout.legend.uirevision`,","`selectedpoints` is controlled by `layout.selectionrevision`,","and `colorbar.(x|y)` (accessible with `config: {editable: true}`)","is controlled by `layout.editrevision`.","Trace changes are tracked by `uid`, which only falls back on trace","index if no `uid` is provided. So if your app can add/remove traces","before the end of the `data` array, such that the same trace has a","different index, you can still preserve user-driven changes if you","give each trace a `uid` that stays with it as it moves."].join(" ")}}},15389:(t,e,r)=>{"use strict";var n=r(7370),i=r(12822),o=i.dateTime2ms,a=i.incrementMonth,s=r(32994).ONEAVGMONTH;t.exports=function(t,e,r,i){if("date"!==e.type)return{vals:i};var l=t[r+"periodalignment"];if(!l)return{vals:i};var c,u=t[r+"period"];if(n(u)){if((u=+u)<=0)return{vals:i}}else if("string"==typeof u&&"M"===u.charAt(0)){var h=+u.substring(1);if(!(h>0&&Math.round(h)===h))return{vals:i};c=h}for(var d=e.calendar,f="start"===l,p="end"===l,m=t[r+"period0"],g=o(m,d)||0,v=[],b=[],y=[],x=i.length,_=0;_M;)A=a(A,-c,d);for(;A<=M;)A=a(A,c,d);k=a(A,-c,d)}else{for(A=g+(w=Math.round((M-g)/u))*u;A>M;)A-=u;for(;A<=M;)A+=u;k=A-u}v[_]=f?k:p?A:(k+A)/2,b[_]=k,y[_]=A}return{vals:v,starts:b,ends:y}}},36187:t=>{"use strict";t.exports={xaxis:{valType:"subplotid",dflt:"x",editType:"calc+clearAxisTypes",description:["Sets a reference between this trace's x coordinates and","a 2D cartesian x axis.","If *x* (the default value), the x coordinates refer to","`layout.xaxis`.","If *x2*, the x coordinates refer to `layout.xaxis2`, and so on."].join(" ")},yaxis:{valType:"subplotid",dflt:"y",editType:"calc+clearAxisTypes",description:["Sets a reference between this trace's y coordinates and","a 2D cartesian y axis.","If *y* (the default value), the y coordinates refer to","`layout.yaxis`.","If *y2*, the y coordinates refer to `layout.yaxis2`, and so on."].join(" ")}}},19496:(t,e,r)=>{"use strict";var n=r(27941),i=r(7370),o=r(12822),a=r(32994).FP_SAFE,s=r(25059),l=r(40666),c=r(99246),u=c.getFromId,h=c.isLinked;function d(t,e){var r,n,i=[],a=t._fullLayout,s=p(a,e,0),l=p(a,e,1),c=g(t,e),u=c.min,h=c.max;if(0===u.length||0===h.length)return o.simpleMap(e.range,e.r2l);var d=u[0].val,m=h[0].val;for(r=1;r0&&((M=L-s(x)-l(_))>z?T/M>O&&(w=x,k=_,O=T/M):T/L>O&&(w={val:x.val,nopad:1},k={val:_.val,nopad:1},O=T/L));if(d===m){var D=d-1,I=d+1;if(C)if(0===d)i=[0,1];else{var F=(d>0?h:u).reduce((function(t,e){return Math.max(t,l(e))}),0),R=d/(1-Math.min(.5,F/L));i=d>0?[0,R]:[R,0]}else i=E?[Math.max(0,D),Math.max(1,I)]:[D,I]}else C?(w.val>=0&&(w={val:0,nopad:1}),k.val<=0&&(k={val:0,nopad:1})):E&&(w.val-O*s(w)<0&&(w={val:0,nopad:1}),k.val<=0&&(k={val:1,nopad:1})),O=(k.val-w.val-f(e,x.val,_.val))/(L-s(w)-l(k)),i=[w.val-O*s(w),k.val+O*l(k)];return i=A(i,e),e.limitRange&&e.limitRange(),b&&i.reverse(),o.simpleMap(i,e.l2r||Number)}function f(t,e,r){var n=0;if(t.rangebreaks)for(var i=t.locateBreaks(e,r),o=0;o0?r.ppadplus:r.ppadminus)||r.ppad||0),S=M((t._m>0?r.ppadminus:r.ppadplus)||r.ppad||0),C=M(r.vpadplus||r.vpad),E=M(r.vpadminus||r.vpad);if(!k){if(d=1/0,f=-1/0,w)for(n=0;n0&&(d=o),o>f&&o-a&&(d=o),o>f&&o=O;n--)z(n);return{min:p,max:m,opts:r}},concatExtremes:g};var m=3;function g(t,e,r){var n,i,o,a=e._id,s=t._fullData,l=t._fullLayout,c=[],h=[];function d(t,e){for(n=0;n=r&&(c.extrapad||!a)){s=!1;break}i(e,c.val)&&c.pad<=r&&(a||!c.extrapad)&&(t.splice(l,1),l--)}if(s){var u=o&&0===e;t.push({val:e,pad:u?0:r,extrapad:!u&&a})}}function x(t){return i(t)&&Math.abs(t)=e}function k(t,e,r){return void 0===e||void 0===r||(e=t.d2l(e))=c&&(a=c,r=c),s<=c&&(s=c,n=c)}}return r=function(t,e){var r=e.autorangeoptions;return r&&void 0!==r.minallowed&&k(e,r.minallowed,r.maxallowed)?r.minallowed:r&&void 0!==r.clipmin&&k(e,r.clipmin,r.clipmax)?Math.max(t,e.d2l(r.clipmin)):t}(r,e),n=function(t,e){var r=e.autorangeoptions;return r&&void 0!==r.maxallowed&&k(e,r.minallowed,r.maxallowed)?r.maxallowed:r&&void 0!==r.clipmax&&k(e,r.clipmin,r.clipmax)?Math.min(t,e.d2l(r.clipmax)):t}(n,e),[r,n]}},49826:t=>{"use strict";t.exports=function(t,e,r){var n,i;if(r){var o="reversed"===e||"min reversed"===e||"max reversed"===e;n=r[o?1:0],i=r[o?0:1]}var a=t("autorangeoptions.minallowed",null===i?n:void 0),s=t("autorangeoptions.maxallowed",null===n?i:void 0);void 0===a&&t("autorangeoptions.clipmin"),void 0===s&&t("autorangeoptions.clipmax"),t("autorangeoptions.include")}},75815:(t,e,r)=>{"use strict";var n=r(27941),i=r(7370),o=r(51137),a=r(25059),s=r(12822),l=s.strTranslate,c=r(80394),u=r(6883),h=r(17499),d=r(40666),f=r(86130),p=r(84696),m=r(32994),g=m.ONEMAXYEAR,v=m.ONEAVGYEAR,b=m.ONEMINYEAR,y=m.ONEMAXQUARTER,x=m.ONEAVGQUARTER,_=m.ONEMINQUARTER,w=m.ONEMAXMONTH,k=m.ONEAVGMONTH,A=m.ONEMINMONTH,M=m.ONEWEEK,T=m.ONEDAY,S=T/2,C=m.ONEHOUR,E=m.ONEMIN,L=m.ONESEC,z=m.ONEMILLI,O=m.ONEMICROSEC,D=m.MINUS_SIGN,I=m.BADNUM,F={K:"zeroline"},R={K:"gridline",L:"path"},P={K:"minor-gridline",L:"path"},j={K:"tick",L:"path"},N={K:"tick",L:"text"},B={width:["x","r","l","xl","xr"],height:["y","t","b","yt","yb"],right:["r","xr"],left:["l","xl"],top:["t","yt"],bottom:["b","yb"]},U=r(89701),G=U.MID_SHIFT,V=U.CAP_SHIFT,H=U.LINE_SPACING,W=U.OPPOSITE_SIDE,q=t.exports={};q.setConvert=r(30632);var Y=r(17821),Z=r(99246),X=Z.idSort,$=Z.isLinked;q.id2name=Z.id2name,q.name2id=Z.name2id,q.cleanId=Z.cleanId,q.list=Z.list,q.listIds=Z.listIds,q.getFromId=Z.getFromId,q.getFromTrace=Z.getFromTrace;var J=r(19496);function K(t){var e=1e-4*(t[1]-t[0]);return[t[0]-e,t[1]+e]}q.getAutoRange=J.getAutoRange,q.findExtremes=J.findExtremes,q.coerceRef=function(t,e,r,n,i,o){var a=n.charAt(n.length-1),l=r._fullLayout._subplots[a+"axis"],c=n+"ref",u={};return i||(i=l[0]||("string"==typeof o?o:o[0])),o||(o=i),l=l.concat(l.map((function(t){return t+" domain"}))),u[c]={valType:"enumerated",values:l.concat(o?"string"==typeof o?[o]:o:[]),dflt:i},s.coerce(t,e,u,c)},q.getRefType=function(t){return void 0===t?t:"paper"===t?"paper":"pixel"===t?"pixel":/( domain)$/.test(t)?"domain":"range"},q.coercePosition=function(t,e,r,n,i,o){var a,l;if("range"!==q.getRefType(n))a=s.ensureNumber,l=r(i,o);else{var c=q.getFromId(e,n);l=r(i,o=c.fraction2r(o)),a=c.cleanPos}t[i]=a(l)},q.cleanPosition=function(t,e,r){return("paper"===r||"pixel"===r?s.ensureNumber:q.getFromId(e,r).cleanPos)(t)},q.redrawComponents=function(t,e){e=e||q.listIds(t);var r=t._fullLayout;function n(n,i,o,s){for(var l=a.getComponentMethod(n,i),c={},u=0;un&&d2e-6||((r-t._forceTick0)/t._minDtick%1+1.000001)%1>2e-6)&&(t._minDtick=0)):t._minDtick=0},q.saveRangeInitial=function(t,e){for(var r=q.list(t,"",!0),n=!1,i=0;i.3*d||u(n)||u(o))){var f=r.dtick/2;t+=t+f.8){var a=Number(r.substr(1));o.exactYears>.8&&a%12==0?t=q.tickIncrement(t,"M6","reverse")+1.5*T:o.exactMonths>.8?t=q.tickIncrement(t,"M1","reverse")+15.5*T:t-=S;var l=q.tickIncrement(t,r);if(l<=n)return l}return t}(b,t,v,c,o)),g=b;g<=u;)g=q.tickIncrement(g,v,!1,o);return{start:e.c2r(b,0,o),end:e.c2r(g,0,o),size:v,_dataSpan:u-c}},q.prepMinorTicks=function(t,e,r){if(!e.minor.dtick){delete t.dtick;var n,o=e.dtick&&i(e._tmin);if(o){var a=q.tickIncrement(e._tmin,e.dtick,!0);n=[e._tmin,.99*a+.01*e._tmin]}else{var l=s.simpleMap(e.range,e.r2l);n=[l[0],.8*l[0]+.2*l[1]]}if(t.range=s.simpleMap(n,e.l2r),t._isMinor=!0,q.prepTicks(t,r),o){var c=i(e.dtick),u=i(t.dtick),h=c?e.dtick:+e.dtick.substring(1),d=u?t.dtick:+t.dtick.substring(1);c&&u?rt(h,d)?h===2*M&&d===2*T&&(t.dtick=M):h===2*M&&d===3*T?t.dtick=M:h!==M||(e._input.minor||{}).nticks?nt(h/d,2.5)?t.dtick=h/2:t.dtick=h:t.dtick=T:"M"===String(e.dtick).charAt(0)?u?t.dtick="M1":rt(h,d)?h>=12&&2===d&&(t.dtick="M3"):t.dtick=e.dtick:"L"===String(t.dtick).charAt(0)?"L"===String(e.dtick).charAt(0)?rt(h,d)||(t.dtick=nt(h/d,2.5)?e.dtick/2:e.dtick):t.dtick="D1":"D2"===t.dtick&&+e.dtick>1&&(t.dtick=1)}t.range=e.range}void 0===e.minor._tick0Init&&(t.tick0=e.tick0)},q.prepTicks=function(t,e){var r=s.simpleMap(t.range,t.r2l,void 0,void 0,e);if("auto"===t.tickmode||!t.dtick){var n,o=t.nticks;o||("category"===t.type||"multicategory"===t.type?(n=t.tickfont?s.bigFont(t.tickfont.size||12):15,o=t._length/n):(n="y"===t._id.charAt(0)?40:80,o=s.constrain(t._length/n,4,9)+1),"radialaxis"===t._name&&(o*=2)),t.minor&&"array"!==t.minor.tickmode||"array"===t.tickmode&&(o*=100),t._roughDTick=Math.abs(r[1]-r[0])/o,q.autoTicks(t,t._roughDTick),t._minDtick>0&&t.dtick<2*t._minDtick&&(t.dtick=t._minDtick,t.tick0=t.l2r(t._forceTick0))}"period"===t.ticklabelmode&&function(t){var e;function r(){return!(i(t.dtick)||"M"!==t.dtick.charAt(0))}var n=r(),o=q.getTickFormat(t);if(o){var a=t._dtickInit!==t.dtick;/%[fLQsSMX]/.test(o)||(/%[HI]/.test(o)?(e=C,a&&!n&&t.dtickt.range[1],f=!t.ticklabelindex||s.isArrayOrTypedArray(t.ticklabelindex)?t.ticklabelindex:[t.ticklabelindex],p=s.simpleMap(t.range,t.r2l,void 0,void 0,e),m=p[1]=(G?0:1);V--){var H=!V;V?(t._dtickInit=t.dtick,t._tick0Init=t.tick0):(t.minor._dtickInit=t.minor.dtick,t.minor._tick0Init=t.minor.tick0);var W=V?t:s.extendFlat({},t,t.minor);if(H?q.prepMinorTicks(W,t,e):q.prepTicks(W,e),"array"!==W.tickmode)if("sync"!==W.tickmode){var Y=K(p),Z=Y[0],X=Y[1],$=i(W.dtick),J="log"===l&&!($||"L"===W.dtick.charAt(0)),Q=q.tickFirst(W,e);if(V){if(t._tmin=Q,Q=X:nt<=X;nt=q.tickIncrement(nt,it,m,c)){if(V&&tt++,W.rangebreaks&&!m){if(nt=F)break}if(N.length>R||nt===rt)break;rt=nt;var ot={value:nt};V?(J&&nt!==(0|nt)&&(ot.simpleLabel=!0),u>1&&tt%u&&(ot.skipLabel=!0),N.push(ot)):(ot.minor=!0,B.push(ot))}}else N=[],P=at(t);else V?(N=[],P=st(t,!H)):(B=[],j=st(t,!H))}!B||B.length<2?f=!1:(r=(B[1].value-B[0].value)*(d?-1:1),n=t.tickformat,(/%f/.test(n)?r>=O:/%L/.test(n)?r>=z:/%[SX]/.test(n)?r>=L:/%M/.test(n)?r>=E:/%[HI]/.test(n)?r>=C:/%p/.test(n)?r>=S:/%[Aadejuwx]/.test(n)?r>=T:/%[UVW]/.test(n)?r>=M:/%[Bbm]/.test(n)?r>=A:/%[q]/.test(n)?r>=_:!/%[Yy]/.test(n)||r>=b)||(f=!1));if(f){var lt=N.concat(B);h&&N.length&&(lt=lt.slice(1)),(lt=lt.sort((function(t,e){return t.value-e.value})).filter((function(t,e,r){return 0===e||t.value!==r[e-1].value}))).map((function(t,e){return void 0!==t.minor||t.skipLabel?null:e})).filter((function(t){return null!==t})).forEach((function(t){f.map((function(e){var r=t+e;r>=0&&r0?(o=n-1,a=n):(o=n,a=n);var s,l=t[o].value,c=t[a].value,u=Math.abs(c-l),h=r||u,d=0;h>=b?d=u>=b&&u<=g?u:v:r===x&&h>=_?d=u>=_&&u<=y?u:x:h>=A?d=u>=A&&u<=w?u:k:r===M&&h>=M?d=M:h>=T?d=T:r===S&&h>=S?d=S:r===C&&h>=C&&(d=C),d>=u&&(d=u,s=!0);var f=i+d;if(e.rangebreaks&&d>0){for(var p=0,m=0;m<84;m++){var E=(m+.5)/84;e.maskBreaks(i*(1-E)+E*f)!==I&&p++}(d*=p/84)||(t[n].drop=!0),s&&u>M&&(d=u)}(d>0||0===n)&&(t[n].periodX=i+d/2)}}(U,t,t._definedDelta),t.rangebreaks){var gt="y"===t._id.charAt(0),vt=1;"auto"===t.tickmode&&(vt=t.tickfont?t.tickfont.size:12);var bt=NaN;for(o=N.length-1;o>-1;o--)if(N[o].drop)N.splice(o,1);else{N[o].value=Rt(N[o].value,t);var yt=t.c2p(N[o].value);(gt?bt>yt-vt:btF||nF&&(r.periodX=F),n10||"01-01"!==n.substr(5)?t._tickround="d":t._tickround=+e.substr(1)%12==0?"y":"m";else if(e>=T&&o<=10||e>=15*T)t._tickround="d";else if(e>=E&&o<=16||e>=C)t._tickround="M";else if(e>=L&&o<=19||e>=E)t._tickround="S";else{var a=t.l2r(r+e).replace(/^-/,"").length;t._tickround=Math.max(o,a)-20,t._tickround<0&&(t._tickround=4)}}else if(i(e)||"L"===e.charAt(0)){var s=t.range.map(t.r2d||Number);i(e)||(e=Number(e.substr(1))),t._tickround=2-Math.floor(Math.log(e)/Math.LN10+.01);var l=Math.max(Math.abs(s[0]),Math.abs(s[1])),c=Math.floor(Math.log(l)/Math.LN10+.01),u=void 0===t.minexponent?3:t.minexponent;Math.abs(c)>u&&(yt(t.exponentformat)&&!xt(c)?t._tickexponent=3*Math.round((c-1)/3):t._tickexponent=c)}else t._tickround=null}function vt(t,e,r){var n=t.tickfont||{};return{x:e,dx:0,dy:0,text:r||"",fontSize:n.size,font:n.family,fontWeight:n.weight,fontStyle:n.style,fontVariant:n.variant,fontTextcase:n.textcase,fontLineposition:n.lineposition,fontShadow:n.shadow,fontColor:n.color}}q.autoTicks=function(t,e,r){var n;function o(t){return Math.pow(t,Math.floor(Math.log(e)/Math.LN10))}if("date"===t.type){t.tick0=s.dateTick0(t.calendar,0);var a=2*e;if(a>v)e/=v,n=o(10),t.dtick="M"+12*mt(e,n,lt);else if(a>k)e/=k,t.dtick="M"+mt(e,1,ct);else if(a>T){if(t.dtick=mt(e,T,t._hasDayOfWeekBreaks?[1,2,7,14]:ht),!r){var l=q.getTickFormat(t),c="period"===t.ticklabelmode;c&&(t._rawTick0=t.tick0),/%[uVW]/.test(l)?t.tick0=s.dateTick0(t.calendar,2):t.tick0=s.dateTick0(t.calendar,1),c&&(t._dowTick0=t.tick0)}}else a>C?t.dtick=mt(e,C,ct):a>E?t.dtick=mt(e,E,ut):a>L?t.dtick=mt(e,L,ut):(n=o(10),t.dtick=mt(e,n,lt))}else if("log"===t.type){t.tick0=0;var u=s.simpleMap(t.range,t.r2l);if(t._isMinor&&(e*=1.5),e>.7)t.dtick=Math.ceil(e);else if(Math.abs(u[1]-u[0])<1){var h=1.5*Math.abs((u[1]-u[0])/e);e=Math.abs(Math.pow(10,u[1])-Math.pow(10,u[0]))/h,n=o(10),t.dtick="L"+mt(e,n,lt)}else t.dtick=e>.3?"D2":"D1"}else"category"===t.type||"multicategory"===t.type?(t.tick0=0,t.dtick=Math.ceil(Math.max(e,1))):Ft(t)?(t.tick0=0,n=1,t.dtick=mt(e,n,pt)):(t.tick0=0,n=o(10),t.dtick=mt(e,n,lt));if(0===t.dtick&&(t.dtick=1),!i(t.dtick)&&"string"!=typeof t.dtick){var d=t.dtick;throw t.dtick=1,"ax.dtick error: "+String(d)}},q.tickIncrement=function(t,e,r,o){var a=r?-1:1;if(i(e))return s.increment(t,a*e);var l=e.charAt(0),c=a*Number(e.substr(1));if("M"===l)return s.incrementMonth(t,c,o);if("L"===l)return Math.log(Math.pow(10,t)+c)/Math.LN10;if("D"===l){var u="D2"===e?ft:dt,h=t+.01*a,d=s.roundUp(s.mod(h,1),u,r);return Math.floor(h)+Math.log(n.round(Math.pow(10,d),1))/Math.LN10}throw"unrecognized dtick "+String(e)},q.tickFirst=function(t,e){var r=t.r2l||Number,o=s.simpleMap(t.range,r,void 0,void 0,e),a=o[1]=0&&r<=t._length?e:null};if(l&&s.isArrayOrTypedArray(t.ticktext)){var f=s.simpleMap(t.range,t.r2l),p=(Math.abs(f[1]-f[0])-(t._lBreaks||0))/1e4;for(o=0;o ")}else t._prevDateHead=l,c+="
"+l;e.text=c}(t,a,r,c):"log"===u?function(t,e,r,n,o){var a=t.dtick,l=e.x,c=t.tickformat,u="string"==typeof a&&a.charAt(0);if("never"===o&&(o=""),n&&"L"!==u&&(a="L3",u="L"),c||"L"===u)e.text=_t(Math.pow(10,l),t,o,n);else if(i(a)||"D"===u&&s.mod(l+.01,1)<.1){var h=Math.round(l),d=Math.abs(h),f=t.exponentformat;"power"===f||yt(f)&&xt(h)?(e.text=0===h?1:1===h?"10":"10"+(h>1?"":D)+d+"",e.fontSize*=1.25):("e"===f||"E"===f)&&d>2?e.text="1"+f+(h>0?"+":D)+d:(e.text=_t(Math.pow(10,l),t,"","fakehover"),"D1"===a&&"y"===t._id.charAt(0)&&(e.dy-=e.fontSize/6))}else{if("D"!==u)throw"unrecognized dtick "+String(a);e.text=String(Math.round(Math.pow(10,s.mod(l,1)))),e.fontSize*=.75}if("D1"===t.dtick){var p=String(e.text).charAt(0);"0"!==p&&"1"!==p||("y"===t._id.charAt(0)?e.dx-=e.fontSize/4:(e.dy+=e.fontSize/2,e.dx+=(t.range[1]>t.range[0]?1:-1)*e.fontSize*(l<0?.5:.25)))}}(t,a,0,c,g):"category"===u?function(t,e){var r=t._categories[Math.round(e.x)];void 0===r&&(r=""),e.text=String(r)}(t,a):"multicategory"===u?function(t,e,r){var n=Math.round(e.x),i=t._categories[n]||[],o=void 0===i[1]?"":String(i[1]),a=void 0===i[0]?"":String(i[0]);r?e.text=a+" - "+o:(e.text=o,e.text2=a)}(t,a,r):Ft(t)?function(t,e,r,n,i){if("radians"!==t.thetaunit||r)e.text=_t(e.x,t,i,n);else{var o=e.x/180;if(0===o)e.text="0";else{var a=function(t){function e(t,e){return Math.abs(t-e)<=1e-6}var r=function(t){for(var r=1;!e(Math.round(t*r)/r,t);)r*=10;return r}(t),n=t*r,i=Math.abs(function t(r,n){return e(n,0)?r:t(n,r%n)}(n,r));return[Math.round(n/i),Math.round(r/i)]}(o);if(a[1]>=100)e.text=_t(s.deg2rad(e.x),t,i,n);else{var l=e.x<0;1===a[1]?1===a[0]?e.text="π":e.text=a[0]+"π":e.text=["",a[0],"","⁄","",a[1],"","π"].join(""),l&&(e.text=D+e.text)}}}}(t,a,r,c,g):function(t,e,r,n,i){"never"===i?i="":"all"===t.showexponent&&Math.abs(e.x/t.dtick)<1e-6&&(i="hide"),e.text=_t(e.x,t,i,n)}(t,a,0,c,g),n||(t.tickprefix&&!m(t.showtickprefix)&&(a.text=t.tickprefix+a.text),t.ticksuffix&&!m(t.showticksuffix)&&(a.text+=t.ticksuffix)),t.labelalias&&t.labelalias.hasOwnProperty(a.text)){var v=t.labelalias[a.text];"string"==typeof v&&(a.text=v)}return("boundaries"===t.tickson||t.showdividers)&&(a.xbnd=[d(a.x-.5),d(a.x+t.dtick-.5)]),a},q.hoverLabelText=function(t,e,r){r&&(t=s.extendFlat({},t,{hoverformat:r}));var n=s.isArrayOrTypedArray(e)?e[0]:e,i=s.isArrayOrTypedArray(e)?e[1]:void 0;if(void 0!==i&&i!==n)return q.hoverLabelText(t,n,r)+" - "+q.hoverLabelText(t,i,r);var o="log"===t.type&&n<=0,a=q.tickText(t,t.c2l(o?-n:n),"hover").text;return o?0===n?"0":D+a:a};var bt=["f","p","n","μ","m","","k","M","G","T"];function yt(t){return"SI"===t||"B"===t}function xt(t){return t>14||t<-15}function _t(t,e,r,n){var o=t<0,a=e._tickround,l=r||e.exponentformat||"B",c=e._tickexponent,u=q.getTickFormat(e),h=e.separatethousands;if(n){var d={exponentformat:l,minexponent:e.minexponent,dtick:"none"===e.showexponent?e.dtick:i(t)&&Math.abs(t)||1,range:"none"===e.showexponent?e.range.map(e.r2d):[0,t||1]};gt(d),a=(Number(d._tickround)||0)+4,c=d._tickexponent,e.hoverformat&&(u=e.hoverformat)}if(u)return e._numFormat(u)(t).replace(/-/g,D);var f,p=Math.pow(10,-a)/2;if("none"===l&&(c=0),(t=Math.abs(t))"+f+"
":"B"===l&&9===c?t+="B":yt(l)&&(t+=bt[c/3+5])),o?D+t:t}function wt(t,e){if(t){var r=Object.keys(B).reduce((function(t,r){return-1!==e.indexOf(r)&&B[r].forEach((function(e){t[e]=1})),t}),{});Object.keys(t).forEach((function(e){r[e]||(1===e.length?t[e]=0:delete t[e])}))}}function kt(t,e){for(var r=[],n={},i=0;i1&&r=i.min&&t=0,o=u(t,e[1])<=0;return(r||i)&&(n||o)}if(t.tickformatstops&&t.tickformatstops.length>0)switch(t.type){case"date":case"linear":for(e=0;e=a(i)))){r=n;break}break;case"log":for(e=0;e=0&&i.unshift(i.splice(n,1).shift())}}));var a={false:{left:0,right:0}};return s.syncOrAsync(i.map((function(e){return function(){if(e){var n=q.getFromId(t,e);r||(r={}),r.axShifts=a,r.overlayingShiftedAx=o;var i=q.drawOne(t,n,r);return n._shiftPusher&&Nt(n,n._fullDepth||0,a,!0),n._r=n.range.slice(),n._rl=s.simpleMap(n._r,n.r2l),i}}})))},q.drawOne=function(t,e,r){var n,i,l,f=(r=r||{}).axShifts||{},p=r.overlayingShiftedAx||[];e.setScale();var m=t._fullLayout,g=e._id,v=g.charAt(0),b=q.counterLetter(g),y=m._plots[e._mainSubplot];if(y){if(e._shiftPusher=e.autoshift||-1!==p.indexOf(e._id)||-1!==p.indexOf(e.overlaying),e._shiftPusher&"free"===e.anchor){var x=e.linewidth/2||0;"inside"===e.ticks&&(x+=e.ticklen),Nt(e,x,f,!0),Nt(e,e.shift||0,f,!1)}!0===r.skipTitle&&void 0!==e._shift||(e._shift=function(t,e){return t.autoshift?e[t.overlaying][t.side]:t.shift||0}(e,f));var _=y[v+"axislayer"],w=e._mainLinePosition,k=w+=e._shift,A=e._mainMirrorPosition,M=e._vals=q.calcTicks(e),T=[e.mirror,k,A].join("_");for(n=0;n0?r.bottom-u:0,h))));var d=0,f=0;if(e._shiftPusher&&(d=Math.max(h,r.height>0?"l"===l?u-r.left:r.right-u:0),e.title.text!==m._dfltTitle[v]&&(f=(e._titleStandoff||0)+(e._titleScoot||0),"l"===l&&(f+=Tt(e))),e._fullDepth=Math.max(d,f)),e.automargin){n={x:0,y:0,r:0,l:0,t:0,b:0};var p=[0,1],g="number"==typeof e._shift?e._shift:0;if("x"===v){if("b"===l?n[l]=e._depth:(n[l]=e._depth=Math.max(r.width>0?u-r.top:0,h),p.reverse()),r.width>0){var y=r.right-(e._offset+e._length);y>0&&(n.xr=1,n.r=y);var x=e._offset-r.left;x>0&&(n.xl=0,n.l=x)}}else if("l"===l?(e._depth=Math.max(r.height>0?u-r.left:0,h),n[l]=e._depth-g):(e._depth=Math.max(r.height>0?r.right-u:0,h),n[l]=e._depth+g,p.reverse()),r.height>0){var _=r.bottom-(e._offset+e._length);_>0&&(n.yb=0,n.b=_);var w=e._offset-r.top;w>0&&(n.yt=1,n.t=w)}n[b]="free"===e.anchor?e.position:e._anchorAxis.domain[p[0]],e.title.text!==m._dfltTitle[v]&&(n[l]+=Tt(e)+(e.title.standoff||0)),e.mirror&&"free"!==e.anchor&&((i={x:0,y:0,r:0,l:0,t:0,b:0})[c]=e.linewidth,e.mirror&&!0!==e.mirror&&(i[c]+=h),!0===e.mirror||"ticks"===e.mirror?i[b]=e._anchorAxis.domain[p[1]]:"all"!==e.mirror&&"allticks"!==e.mirror||(i[b]=[e._counterDomainMin,e._counterDomainMax][p[1]]))}ht&&(s=a.getComponentMethod("rangeslider","autoMarginOpts")(t,e)),"string"==typeof e.automargin&&(wt(n,e.automargin),wt(i,e.automargin)),o.autoMargin(t,Et(e),n),o.autoMargin(t,Lt(e),i),o.autoMargin(t,zt(e),s)})),s.syncOrAsync(ct)}}function dt(t){var r=g+(t||"tick");return S[r]||(S[r]=function(t,e,r){var n,i,o,a;if(t._selections[e].size())n=1/0,i=-1/0,o=1/0,a=-1/0,t._selections[e].each((function(){var t=Ct(this),e=d.bBox(t.node().parentNode);n=Math.min(n,e.top),i=Math.max(i,e.bottom),o=Math.min(o,e.left),a=Math.max(a,e.right)}));else{var s=q.makeLabelFns(t,r);n=i=s.yFn({dx:0,dy:0,fontSize:0}),o=a=s.xFn({dx:0,dy:0,fontSize:0})}return{top:n,bottom:i,left:o,right:a,height:i-n,width:a-o}}(e,r,k)),S[r]}},q.getTickSigns=function(t,e){var r=t._id.charAt(0),n={x:"top",y:"right"}[r],i=t.side===n?1:-1,o=[-1,1,i,-i];return"inside"!==(e?(t.minor||{}).ticks:t.ticks)==("x"===r)&&(o=o.map((function(t){return-t}))),t.side&&o.push({l:-1,t:-1,r:1,b:1}[t.side.charAt(0)]),o},q.makeTransTickFn=function(t){return"x"===t._id.charAt(0)?function(e){return l(t._offset+t.l2p(e.x),0)}:function(e){return l(0,t._offset+t.l2p(e.x))}},q.makeTransTickLabelFn=function(t){var e=function(t){var e=t.ticklabelposition||"",r=function(t){return-1!==e.indexOf(t)},n=r("top"),i=r("left"),o=r("right"),a=r("bottom"),s=r("inside"),l=a||i||n||o;if(!l&&!s)return[0,0];var c=t.side,u=l?(t.tickwidth||0)/2:0,h=3,d=t.tickfont?t.tickfont.size:12;return(a||n)&&(u+=d*V,h+=(t.linewidth||0)/2),(i||o)&&(u+=(t.linewidth||0)/2,h+=3),s&&"top"===c&&(h-=d*(1-V)),(i||n)&&(u=-u),"bottom"!==c&&"right"!==c||(h=-h),[l?u:0,s?h:0]}(t),r=t.ticklabelshift||0,n=t.ticklabelstandoff||0,i=e[0],o=e[1],a=t.range[0]>t.range[1],s=t.ticklabelposition&&-1!==t.ticklabelposition.indexOf("inside"),c=!s;if(r&&(r*=a?-1:1),n){var u=t.side;n*=s&&("top"===u||"left"===u)||c&&("bottom"===u||"right"===u)?1:-1}return"x"===t._id.charAt(0)?function(e){return l(i+t._offset+t.l2p(At(e))+r,o+n)}:function(e){return l(o+n,i+t._offset+t.l2p(At(e))+r)}},q.makeTickPath=function(t,e,r,n){n||(n={});var i=n.minor;if(i&&!t.minor)return"";var o=void 0!==n.len?n.len:i?t.minor.ticklen:t.ticklen,a=t._id.charAt(0),s=(t.linewidth||1)/2;return"x"===a?"M0,"+(e+s*r)+"v"+o*r:"M"+(e+s*r)+",0h"+o*r},q.makeLabelFns=function(t,e,r){var n=t.ticklabelposition||"",o=function(t){return-1!==n.indexOf(t)},a=o("top"),l=o("left"),c=o("right"),u=o("bottom")||l||a||c,h=o("inside"),d="inside"===n&&"inside"===t.ticks||!h&&"outside"===t.ticks&&"boundaries"!==t.tickson,f=0,p=0,m=d?t.ticklen:0;if(h?m*=-1:u&&(m=0),d&&(f+=m,r)){var g=s.deg2rad(r);f=m*Math.cos(g)+1,p=m*Math.sin(g)}t.showticklabels&&(d||t.showline)&&(f+=.2*t.tickfont.size);var v,b,y,x,_,w={labelStandoff:f+=(t.linewidth||1)/2*(h?-1:1),labelShift:p},k=0,A=t.side,M=t._id.charAt(0),T=t.tickangle;if("x"===M)x=(_=!h&&"bottom"===A||h&&"top"===A)?1:-1,h&&(x*=-1),v=p*x,b=e+f*x,y=_?1:-.2,90===Math.abs(T)&&(h?y+=G:y=-90===T&&"bottom"===A?V:90===T&&"top"===A?G:.5,k=G/2*(T/90)),w.xFn=function(t){return t.dx+v+k*t.fontSize},w.yFn=function(t){return t.dy+b+t.fontSize*y},w.anchorFn=function(t,e){if(u){if(l)return"end";if(c)return"start"}return i(e)&&0!==e&&180!==e?e*x<0!==h?"end":"start":"middle"},w.heightFn=function(e,r,n){return r<-60||r>60?-.5*n:"top"===t.side!==h?-n:0};else if("y"===M){if(x=(_=!h&&"left"===A||h&&"right"===A)?1:-1,h&&(x*=-1),v=f,b=p*x,y=0,h||90!==Math.abs(T)||(y=-90===T&&"left"===A||90===T&&"right"===A?V:.5),h){var S=i(T)?+T:0;if(0!==S){var C=s.deg2rad(S);k=Math.abs(Math.sin(C))*V*x,y=0}}w.xFn=function(t){return t.dx+e-(v+t.fontSize*y)*x+k*t.fontSize},w.yFn=function(t){return t.dy+b+t.fontSize*G},w.anchorFn=function(t,e){return i(e)&&90===Math.abs(e)?"middle":_?"end":"start"},w.heightFn=function(e,r,n){return"right"===t.side&&(r*=-1),r<-30?-n:r<30?-.5*n:0}}return w},q.drawTicks=function(t,e,r){r=r||{};var i=e._id+"tick",o=[].concat(e.minor&&e.minor.ticks?r.vals.filter((function(t){return t.minor&&!t.noTick})):[]).concat(e.ticks?r.vals.filter((function(t){return!t.minor&&!t.noTick})):[]),a=r.layer.selectAll("path."+i).data(o,Mt);a.exit().remove(),a.enter().append("path").classed(i,1).classed("ticks",1).classed("crisp",!1!==r.crisp).each((function(t){return h.stroke(n.select(this),t.minor?e.minor.tickcolor:e.tickcolor)})).style("stroke-width",(function(r){return d.crispRound(t,r.minor?e.minor.tickwidth:e.tickwidth,1)+"px"})).attr("d",r.path).style("display",null),jt(e,[j]),a.attr("transform",r.transFn)},q.drawGrid=function(t,e,r){if(r=r||{},"sync"!==e.tickmode){var i=e._id+"grid",o=e.minor&&e.minor.showgrid,a=o?r.vals.filter((function(t){return t.minor})):[],s=e.showgrid?r.vals.filter((function(t){return!t.minor})):[],l=r.counterAxis;if(l&&q.shouldShowZeroLine(t,e,l))for(var c="array"===e.tickmode,u=0;u=0;v--){var b=v?m:g;if(b){var y=b.selectAll("path."+i).data(v?s:a,Mt);y.exit().remove(),y.enter().append("path").classed(i,1).classed("crisp",!1!==r.crisp),y.attr("transform",r.transFn).attr("d",r.path).each((function(t){return h.stroke(n.select(this),t.minor?e.minor.gridcolor:e.gridcolor||"#ddd")})).style("stroke-dasharray",(function(t){return d.dashStyle(t.minor?e.minor.griddash:e.griddash,t.minor?e.minor.gridwidth:e.gridwidth)})).style("stroke-width",(function(t){return(t.minor?p:e._gw)+"px"})).style("display",null),"function"==typeof r.path&&y.attr("d",r.path)}}jt(e,[R,P])}},q.drawZeroLine=function(t,e,r){r=r||r;var n=e._id+"zl",i=q.shouldShowZeroLine(t,e,r.counterAxis),o=r.layer.selectAll("path."+n).data(i?[{x:0,id:e._id}]:[]);o.exit().remove(),o.enter().append("path").classed(n,1).classed("zl",1).classed("crisp",!1!==r.crisp).each((function(){r.layer.selectAll("path").sort((function(t,e){return X(t.id,e.id)}))})),o.attr("transform",r.transFn).attr("d",r.path).call(h.stroke,e.zerolinecolor||h.defaultLine).style("stroke-width",d.crispRound(t,e.zerolinewidth,e._gw||1)+"px").style("display",null),jt(e,[F])},q.drawLabels=function(t,e,r){r=r||{};var o=t._fullLayout,a=e._id,u=r.cls||a+"tick",h=r.vals.filter((function(t){return t.text})),f=r.labelFns,p=r.secondary?0:e.tickangle,m=(e._prevTickAngles||{})[u],g=r.layer.selectAll("g."+u).data(e.showticklabels?h:[],Mt),v=[];function b(t,o){t.each((function(t){var a=n.select(this),s=a.select(".text-math-group"),u=f.anchorFn(t,o),h=r.transFn.call(a.node(),t)+(i(o)&&0!=+o?" rotate("+o+","+f.xFn(t)+","+(f.yFn(t)-t.fontSize/2)+")":""),p=c.lineCount(a),m=H*t.fontSize,g=f.heightFn(t,i(o)?+o:0,(p-1)*m);if(g&&(h+=l(0,g)),s.empty()){var v=a.select("text");v.attr({transform:h,"text-anchor":u}),v.style("opacity",1),e._adjustTickLabelsOverflow&&e._adjustTickLabelsOverflow()}else{var b=d.bBox(s.node()).width*{end:-.5,start:.5}[u];s.attr("transform",h+l(b,0))}}))}g.enter().append("g").classed(u,1).append("text").attr("text-anchor","middle").each((function(e){var r=n.select(this),i=t._promises.length;r.call(c.positionText,f.xFn(e),f.yFn(e)).call(d.font,{family:e.font,size:e.fontSize,color:e.fontColor,weight:e.fontWeight,style:e.fontStyle,variant:e.fontVariant,textcase:e.fontTextcase,lineposition:e.fontLineposition,shadow:e.fontShadow}).text(e.text).call(c.convertToTspans,t),t._promises[i]?v.push(t._promises.pop().then((function(){b(r,p)}))):b(r,p)})),jt(e,[N]),g.exit().remove(),r.repositionOnUpdate&&g.each((function(t){n.select(this).select("text").call(c.positionText,f.xFn(t),f.yFn(t))})),e._adjustTickLabelsOverflow=function(){var r=e.ticklabeloverflow;if(r&&"allow"!==r){var i=-1!==r.indexOf("hide"),a="x"===e._id.charAt(0),l=0,c=a?t._fullLayout.width:t._fullLayout.height;if(-1!==r.indexOf("domain")){var u=s.simpleMap(e.range,e.r2l);l=e.l2p(u[0])+e._offset,c=e.l2p(u[1])+e._offset}var h=Math.min(l,c),f=Math.max(l,c),p=e.side,m=1/0,v=-1/0;for(var b in g.each((function(t){var r=n.select(this);if(r.select(".text-math-group").empty()){var o=d.bBox(r.node()),s=0;a?(o.right>f||o.leftf||o.top+(e.tickangle?0:t.fontSize/4)e["_visibleLabelMin_"+r._id]?l.style("display","none"):"tick"!==t.K||i||l.style("display",null)}))}))}))}))},b(g,m+1?m:p);var y=null;e._selections&&(e._selections[u]=g);var x=[function(){return v.length&&Promise.all(v)}];e.automargin&&o._redrawFromAutoMarginCount&&90===m?(y=m,x.push((function(){b(g,m)}))):x.push((function(){if(b(g,p),h.length&&e.autotickangles&&("log"!==e.type||"D"!==String(e.dtick).charAt(0))){y=e.autotickangles[0];var t,n=0,i=[],o=1;g.each((function(t){n=Math.max(n,t.fontSize);var r=e.l2p(t.x),a=Ct(this),s=d.bBox(a.node());o=Math.max(o,c.lineCount(a)),i.push({top:0,bottom:10,height:10,left:r-s.width/2,right:r+s.width/2+2,width:s.width+2})}));var a=("boundaries"===e.tickson||e.showdividers)&&!r.secondary,l=h.length,u=Math.abs((h[l-1].x-h[0].x)*e._m)/(l-1),f=a?u/2:u,m=a?e.ticklen:1.25*n*o,v=f/Math.sqrt(Math.pow(f,2)+Math.pow(m,2)),x=e.autotickangles.map((function(t){return t*Math.PI/180})),_=x.find((function(t){return Math.abs(Math.cos(t))<=v}));void 0===_&&(_=x.reduce((function(t,e){return Math.abs(Math.cos(t))B*I&&(z=I,C[S]=E[S]=O[S])}var U=Math.abs(z-L);U-A>0?A*=1+A/(U-=A):A=0,"y"!==e._id.charAt(0)&&(A=-A),C[T]=w.p2r(w.r2p(E[T])+M*A),"min"===w.autorange||"max reversed"===w.autorange?(C[0]=null,w._rangeInitial0=void 0,w._rangeInitial1=void 0):"max"!==w.autorange&&"min reversed"!==w.autorange||(C[1]=null,w._rangeInitial0=void 0,w._rangeInitial1=void 0),o._insideTickLabelsUpdaterange[w._name+".range"]=C}var G=s.syncOrAsync(x);return G&&G.then&&t._promises.push(G),G},q.getPxPosition=function(t,e){var r,n=t._fullLayout._size,i=e._id.charAt(0),o=e.side;return"free"!==e.anchor?r=e._anchorAxis:"x"===i?r={_offset:n.t+(1-(e.position||0))*n.h,_length:0}:"y"===i&&(r={_offset:n.l+(e.position||0)*n.w+e._shift,_length:0}),"top"===o||"left"===o?r._offset:"bottom"===o||"right"===o?r._offset+r._length:void 0},q.shouldShowZeroLine=function(t,e,r){var n=s.simpleMap(e.range,e.r2l);return n[0]*n[1]<=0&&e.zeroline&&("linear"===e.type||"-"===e.type)&&!(e.rangebreaks&&e.maskBreaks(0)===I)&&(St(e,0)||!function(t,e,r,n){var i=r._mainAxis;if(i){var o=t._fullLayout,a=e._id.charAt(0),s=q.counterLetter(e._id),l=e._offset+(Math.abs(n[0])1)for(n=1;n{"use strict";var n=r(7370),i=r(12822),o=r(32994).BADNUM,a=i.isArrayOrTypedArray,s=i.isDateTime,l=i.cleanNumber,c=Math.round;function u(t,e){return e?n(t):"number"==typeof t}function h(t){return Math.max(1,(t-1)/1e3)}t.exports=function(t,e,r){var i=t,d=r.noMultiCategory;if(a(i)&&!i.length)return"-";if(!d&&function(t){return a(t[0])&&a(t[1])}(i))return"multicategory";if(d&&Array.isArray(i[0])){for(var f=[],p=0;p2*a}(i,e))return"date";var g="strict"!==r.autotypenumbers;return function(t,e){for(var r=t.length,n=h(r),i=0,a=0,s={},u=0;u2*i}(i,g)?"category":function(t,e){for(var r=t.length,n=0;n{"use strict";var n=r(7370),i=r(25059),o=r(12822),a=r(46121),s=r(35677),l=r(86130),c=r(49342),u=r(8736),h=r(84411),d=r(12213),f=r(33322),p=r(65412),m=r(46458),g=r(30632),v=r(21197).WEEKDAY_PATTERN,b=r(21197).HOUR_PATTERN;function y(t,e,r){function i(r,n){return o.coerce(t,e,l.rangebreaks,r,n)}if(i("enabled")){var a=i("bounds");if(a&&a.length>=2){var s,c,u="";if(2===a.length)for(s=0;s<2;s++)if(c=_(a[s])){u=v;break}var h=i("pattern",u);if(h===v)for(s=0;s<2;s++)(c=_(a[s]))&&(e.bounds[s]=a[s]=c-1);if(h)for(s=0;s<2;s++)switch(c=a[s],h){case v:if(!n(c))return void(e.enabled=!1);if((c=+c)!==Math.floor(c)||c<0||c>=7)return void(e.enabled=!1);e.bounds[s]=a[s]=c;break;case b:if(!n(c))return void(e.enabled=!1);if((c=+c)<0||c>24)return void(e.enabled=!1);e.bounds[s]=a[s]=c}if(!1===r.autorange){var d=r.range;if(d[0]d[1])return void(e.enabled=!1)}else if(a[0]>d[0]&&a[1]{"use strict";var n=r(77201),i=n.FORMAT_LINK,o=n.DATE_FORMAT_LINK;function a(t,e){return["Sets the "+t+" formatting rule"+(e?"for `"+e+"` ":""),"using d3 formatting mini-languages","which are very similar to those in Python. For numbers, see: "+i+"."].join(" ")}function s(t,e){return a(t,e)+[" And for dates see: "+o+".","We add two items to d3's date formatter:","*%h* for half of the year as a decimal number as well as","*%{n}f* for fractional seconds","with n digits. For example, *2016-10-13 09:15:23.456* with tickformat","*%H~%M~%S.%2f* would display *09~15~23.46*"].join(" ")}t.exports={axisHoverFormat:function(t,e){return{valType:"string",dflt:"",editType:"none",description:(e?a:s)("hover text",t)+["By default the values are formatted using "+(e?"generic number format":"`"+t+"axis.hoverformat`")+"."].join(" ")}},descriptionOnlyNumbers:a,descriptionWithDates:s}},99246:(t,e,r)=>{"use strict";var n=r(25059),i=r(21197);function o(t,e){if(e&&e.length)for(var r=0;rn?1:-1:+(t.substr(1)||1)-+(e.substr(1)||1)},e.ref2id=function(t){return!!/^[xyz]/.test(t)&&t.split(" ")[0]},e.isLinked=function(t,e){return o(e,t._axisMatchGroups)||o(e,t._axisConstraintGroups)}},33322:(t,e,r)=>{"use strict";var n=r(98507).isTypedArraySpec;t.exports=function(t,e,r,i){if("category"===e.type){var o,a=t.categoryarray,s=Array.isArray(a)&&a.length>0||n(a);s&&(o="array");var l,c=r("categoryorder",o);"array"===c&&(l=r("categoryarray")),s||"array"!==c||(c=e.categoryorder="trace"),"trace"===c?e._initialCategories=[]:"array"===c?e._initialCategories=l.slice():(l=function(t,e){var r,n,i,o=e.dataAttr||t._id.charAt(0),a={};if(e.axData)r=e.axData;else for(r=[],n=0;n{"use strict";var n=r(7370),i=r(12822),o=r(32994),a=o.ONEDAY,s=o.ONEWEEK;e.dtick=function(t,e){var r="log"===e,i="date"===e,o="category"===e,s=i?a:1;if(!t)return s;if(n(t))return(t=Number(t))<=0?s:o?Math.max(1,Math.round(t)):i?Math.max(.1,t):t;if("string"!=typeof t||!i&&!r)return s;var l=t.charAt(0),c=t.substr(1);return(c=n(c)?Number(c):0)<=0||!(i&&"M"===l&&c===Math.round(c)||r&&"L"===l||r&&"D"===l&&(1===c||2===c))?s:t},e.tick0=function(t,e,r,o){return"date"===e?i.cleanDate(t,i.dateTick0(r,o%s==0?1:0)):"D1"!==o&&"D2"!==o?n(t)?Number(t):0:void 0}},21197:(t,e,r)=>{"use strict";var n=r(46233).counter;t.exports={idRegex:{x:n("x","( domain)?"),y:n("y","( domain)?")},attrRegex:n("[xy]axis"),xAxisMatch:n("xaxis"),yAxisMatch:n("yaxis"),AX_ID_PATTERN:/^[xyz][0-9]*( domain)?$/,AX_NAME_PATTERN:/^[xyz]axis[0-9]*$/,SUBPLOT_PATTERN:/^x([0-9]*)y([0-9]*)$/,HOUR_PATTERN:"hour",WEEKDAY_PATTERN:"day of week",MINDRAG:8,MINZOOM:20,DRAGGERSIZE:20,REDRAWDELAY:50,DFLTRANGEX:[-1,6],DFLTRANGEY:[-1,4],traceLayerClasses:["imagelayer","heatmaplayer","contourcarpetlayer","contourlayer","funnellayer","waterfalllayer","barlayer","carpetlayer","violinlayer","boxlayer","ohlclayer","scattercarpetlayer","scatterlayer"],clipOnAxisFalseQuery:[".scatterlayer",".barlayer",".funnellayer",".waterfalllayer"],layerValue2layerClass:{"above traces":"above","below traces":"below"},zindexSeparator:"z"}},69352:(t,e,r)=>{"use strict";var n=r(12822),i=r(19496),o=r(99246).id2name,a=r(86130),s=r(92578),l=r(30632),c=r(32994).ALMOST_EQUAL,u=r(89701).FROM_BL;function h(t,e,r){var i=r.axIds,s=r.layoutOut,l=r.hasImage,c=s._axisConstraintGroups,u=s._axisMatchGroups,h=e._id,m=h.charAt(0),g=((s._splomAxes||{})[m]||{})[h]||{},v=e._id,b="x"===v.charAt(0);function y(r,i){return n.coerce(t,e,a,r,i)}e._matchGroup=null,e._constraintGroup=null,y("constrain",l?"domain":"range"),n.coerce(t,e,{constraintoward:{valType:"enumerated",values:b?["left","center","right"]:["bottom","middle","top"],dflt:b?"center":"middle"}},"constraintoward");var x,_,w=e.type,k=[];for(x=0;xn?i.substr(n):o.substr(r))+a:i+o+t*e:a}function g(t,e){for(var r=e._size,n=r.h/r.w,i={},o=Object.keys(t),a=0;ac*y)||k)for(r=0;rD&&Pz&&(z=P);d/=(z-L)/(2*O),L=l.l2r(L),z=l.l2r(z),l.range=l._input.range=S{"use strict";var n=r(27941),i=r(12822),o=i.numberFormat,a=r(18106),s=r(17520),l=r(25059),c=i.strTranslate,u=r(80394),h=r(17499),d=r(40666),f=r(70410),p=r(75815),m=r(76292),g=r(19846),v=r(14295),b=v.selectingOrDrawing,y=v.freeMode,x=r(89701).FROM_TL,_=r(86748),w=r(39004).redrawReglTraces,k=r(51137),A=r(99246).getFromId,M=r(70059).prepSelect,T=r(70059).clearOutline,S=r(70059).selectOnClick,C=r(92578),E=r(21197),L=E.MINDRAG,z=E.MINZOOM,O=!0;function D(t,e,r,n){var o=i.ensureSingle(t.draglayer,e,r,(function(e){e.classed("drag",!0).style({fill:"transparent","stroke-width":0}).attr("data-subplot",t.id)}));return o.call(m,n),o.node()}function I(t,e,r,i,o,a,s){var l=D(t,"rect",e,r);return n.select(l).call(d.setRect,i,o,a,s),l}function F(t,e){for(var r=0;r=0?Math.min(t,.9):1/(1/Math.max(t,-.3)+3.222))}function N(t,e,r,n,i){return t.append("path").attr("class","zoombox").style({fill:e>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("transform",c(r,n)).attr("d",i+"Z")}function B(t,e,r){return t.append("path").attr("class","zoombox-corners").style({fill:h.background,stroke:h.defaultLine,"stroke-width":1,opacity:0}).attr("transform",c(e,r)).attr("d","M0,0Z")}function U(t,e,r,n,i,o){t.attr("d",n+"M"+r.l+","+r.t+"v"+r.h+"h"+r.w+"v-"+r.h+"h-"+r.w+"Z"),G(t,e,i,o)}function G(t,e,r,n){r||(t.transition().style("fill",n>.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),e.transition().style("opacity",1).duration(200))}function V(t){n.select(t).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}function H(t){O&&t.data&&t._context.showTips&&(i.notifier(i._(t,"Double-click to zoom back out"),"long"),O=!1)}function W(t){var e=Math.floor(Math.min(t.b-t.t,t.r-t.l,z)/2);return"M"+(t.l-3.5)+","+(t.t-.5+e)+"h3v"+-e+"h"+e+"v-3h-"+(e+3)+"ZM"+(t.r+3.5)+","+(t.t-.5+e)+"h-3v"+-e+"h"+-e+"v-3h"+(e+3)+"ZM"+(t.r+3.5)+","+(t.b+.5-e)+"h-3v"+e+"h"+-e+"v3h"+(e+3)+"ZM"+(t.l-3.5)+","+(t.b+.5-e)+"h3v"+e+"h"+e+"v3h-"+(e+3)+"Z"}function q(t,e,r,n,o){for(var a,s,l,c,u=!1,h={},d={},f=(o||{}).xaHash,p=(o||{}).yaHash,m=0;m=0)i._fullLayout._deactivateShape(i);else{var a=i._fullLayout.clickmode;if(V(i),2!==t||vt||Ht(),gt)a.indexOf("select")>-1&&S(r,i,$,J,e.id,zt),a.indexOf("event")>-1&&f.click(i,r,e.id);else if(1===t&&vt){var s=m?D:O,c="s"===m||"w"===v?0:1,h=s._name+".range["+c+"]",d=function(t,e){var r,n=t.range[e],i=Math.abs(n-t.range[1-e]);return"date"===t.type?n:"log"===t.type?(r=Math.ceil(Math.max(0,-Math.log(i)/Math.LN10))+3,o("."+r+"g")(Math.pow(10,n))):(r=Math.floor(Math.log(Math.abs(n))/Math.LN10)-Math.floor(Math.log(i)/Math.LN10)+4,o("."+String(r)+"g")(n))}(s,c),p="left",g="middle";if(s.fixedrange)return;m?(g="n"===m?"top":"bottom","right"===s.side&&(p="right")):"e"===v&&(p="right"),i._context.showAxisRangeEntryBoxes&&n.select(xt).call(u.makeEditable,{gd:i,immediate:!0,background:i._fullLayout.paper_bgcolor,text:String(d),fill:s.tickfont?s.tickfont.color:"#444",horizontalAlign:p,verticalAlign:g}).on("edit",(function(t){var e=s.d2r(t);void 0!==e&&l.call("_guiRelayout",i,h,e)}))}}}function It(e,r){if(t._transitioningWithDuration)return!1;var n=Math.max(0,Math.min(tt,ft*e+_t)),i=Math.max(0,Math.min(et,pt*r+wt)),o=Math.abs(n-_t),a=Math.abs(i-wt);function s(){St="",kt.r=kt.l,kt.t=kt.b,Et.attr("d","M0,0Z")}if(kt.l=Math.min(_t,n),kt.r=Math.max(_t,n),kt.t=Math.min(wt,i),kt.b=Math.max(wt,i),rt.isSubplotConstrained)o>z||a>z?(St="xy",o/tt>a/et?(a=o*et/tt,wt>i?kt.t=wt-a:kt.b=wt+a):(o=a*tt/et,_t>n?kt.l=_t-o:kt.r=_t+o),Et.attr("d",W(kt))):s();else if(nt.isSubplotConstrained)if(o>z||a>z){St="xy";var l=Math.min(kt.l/tt,(et-kt.b)/et),c=Math.max(kt.r/tt,(et-kt.t)/et);kt.l=l*tt,kt.r=c*tt,kt.b=(1-l)*et,kt.t=(1-c)*et,Et.attr("d",W(kt))}else s();else!ot||a0){var u;if(nt.isSubplotConstrained||!it&&1===ot.length){for(u=0;u<$.length;u++)$[u].range=$[u]._r.slice(),C($[u],1-r/et);a=(e=r*tt/et)/2}if(nt.isSubplotConstrained||!ot&&1===it.length){for(u=0;u1&&(void 0!==o.maxallowed&&st===(o.range[0]1&&(void 0!==a.maxallowed&<===(a.range[0]{"use strict";var n=r(27941),i=r(70410),o=r(19846),a=r(76292),s=r(45731).makeDragBox,l=r(21197).DRAGGERSIZE;e.initInteractions=function(t){var r=t._fullLayout;if(t._context.staticPlot)n.select(t).selectAll(".drag").remove();else if(r._has("cartesian")||r._has("splom")){Object.keys(r._plots||{}).sort((function(t,e){if((r._plots[t].mainplot&&!0)===(r._plots[e].mainplot&&!0)){var n=t.split("y"),i=e.split("y");return n[0]===i[0]?Number(n[1]||1)-Number(i[1]||1):Number(n[0]||1)-Number(i[0]||1)}return r._plots[t].mainplot?1:-1})).forEach((function(e){var n=r._plots[e],a=n.xaxis,c=n.yaxis;if(!n.mainplot){var u=s(t,n,a._offset,c._offset,a._length,c._length,"ns","ew");u.onmousemove=function(r){t._fullLayout._rehover=function(){t._fullLayout._hoversubplot===e&&t._fullLayout._plots[e]&&i.hover(t,r,e)},i.hover(t,r,e),t._fullLayout._lasthover=u,t._fullLayout._hoversubplot=e},u.onmouseout=function(e){t._dragging||(t._fullLayout._hoversubplot=null,o.unhover(t,e))},t._context.showAxisDragHandles&&(s(t,n,a._offset-l,c._offset-l,l,l,"n","w"),s(t,n,a._offset+a._length,c._offset-l,l,l,"n","e"),s(t,n,a._offset-l,c._offset+c._length,l,l,"s","w"),s(t,n,a._offset+a._length,c._offset+c._length,l,l,"s","e"))}if(t._context.showAxisDragHandles){if(e===a._mainSubplot){var h=a._mainLinePosition;"top"===a.side&&(h-=l),s(t,n,a._offset+.1*a._length,h,.8*a._length,l,"","ew"),s(t,n,a._offset,h,.1*a._length,l,"","w"),s(t,n,a._offset+.9*a._length,h,.1*a._length,l,"","e")}if(e===c._mainSubplot){var d=c._mainLinePosition;"right"!==c.side&&(d-=l),s(t,n,d,c._offset+.1*c._length,l,.8*c._length,"ns",""),s(t,n,d,c._offset+.9*c._length,l,.1*c._length,"s",""),s(t,n,d,c._offset,l,.1*c._length,"n","")}}}));var a=r._hoverlayer.node();a.onmousemove=function(e){e.target=t._fullLayout._lasthover,i.hover(t,e,r._hoversubplot)},a.onclick=function(e){e.target=t._fullLayout._lasthover,i.click(t,e)},a.onmousedown=function(e){t._fullLayout._lasthover.onmousedown(e)},e.updateFx(t)}},e.updateFx=function(t){var e=t._fullLayout,r="pan"===e.dragmode?"move":"crosshair";a(e._draggers,r)}},39859:(t,e,r)=>{"use strict";var n=r(25059),i=r(12822),o=r(99246);t.exports=function(t){return function(e,r){var a=e[t];if(Array.isArray(a))for(var s=n.subplotsRegistry.cartesian,l=s.idRegex,c=r._subplots,u=c.xaxis,h=c.yaxis,d=c.cartesian,f=r._has("cartesian")||r._has("gl2d"),p=0;p{"use strict";var n=r(27941),i=r(25059),o=r(12822),a=r(51137),s=r(40666),l=r(47388).eV,c=r(99246),u=r(21197),h=r(25853),d=o.ensureSingle;function f(t,e,r){return o.ensureSingle(t,e,r,(function(t){t.datum(r)}))}var p=u.zindexSeparator;function m(t,e,r,o,a){for(var c,h,d,f=u.traceLayerClasses,p=t._fullLayout,m=p._zindices,g=p._modules,v=[],b=[],y=0;y1)if(l)e.xlines=d(n,"path","xlines-above"),e.ylines=d(n,"path","ylines-above"),e.xaxislayer=d(n,"g","xaxislayer-above"),e.yaxislayer=d(n,"g","yaxislayer-above");else{if(!o){var h=d(n,"g","layer-subplot");e.shapelayer=d(h,"g","shapelayer"),e.imagelayer=d(h,"g","imagelayer"),e.minorGridlayer=d(n,"g","minor-gridlayer"),e.gridlayer=d(n,"g","gridlayer"),e.zerolinelayer=d(n,"g","zerolinelayer");var m=d(n,"g","layer-between");e.shapelayerBetween=d(m,"g","shapelayer"),e.imagelayerBetween=d(m,"g","imagelayer"),d(n,"path","xlines-below"),d(n,"path","ylines-below"),e.overlinesBelow=d(n,"g","overlines-below"),d(n,"g","xaxislayer-below"),d(n,"g","yaxislayer-below"),e.overaxesBelow=d(n,"g","overaxes-below")}e.overplot=d(n,"g","overplot"),e.plot=d(e.overplot,"g",i),o||(e.xlines=d(n,"path","xlines-above"),e.ylines=d(n,"path","ylines-above"),e.overlinesAbove=d(n,"g","overlines-above"),d(n,"g","xaxislayer-above"),d(n,"g","yaxislayer-above"),e.overaxesAbove=d(n,"g","overaxes-above"),e.xlines=n.select(".xlines-"+a),e.ylines=n.select(".ylines-"+s),e.xaxislayer=n.select(".xaxislayer-"+a),e.yaxislayer=n.select(".yaxislayer-"+s))}else{var g=e.mainplotinfo,v=g.plotgroup,b=i+"-x",y=i+"-y";e.minorGridlayer=g.minorGridlayer,e.gridlayer=g.gridlayer,e.zerolinelayer=g.zerolinelayer,d(g.overlinesBelow,"path",b),d(g.overlinesBelow,"path",y),d(g.overaxesBelow,"g",b),d(g.overaxesBelow,"g",y),e.plot=d(g.overplot,"g",i),d(g.overlinesAbove,"path",b),d(g.overlinesAbove,"path",y),d(g.overaxesAbove,"g",b),d(g.overaxesAbove,"g",y),e.xlines=v.select(".overlines-"+a).select("."+b),e.ylines=v.select(".overlines-"+s).select("."+y),e.xaxislayer=v.select(".overaxes-"+a).select("."+b),e.yaxislayer=v.select(".overaxes-"+s).select("."+y)}o||(l||(f(e.minorGridlayer,"g",e.xaxis._id),f(e.minorGridlayer,"g",e.yaxis._id),e.minorGridlayer.selectAll("g").map((function(t){return t[0]})).sort(c.idSort),f(e.gridlayer,"g",e.xaxis._id),f(e.gridlayer,"g",e.yaxis._id),e.gridlayer.selectAll("g").map((function(t){return t[0]})).sort(c.idSort)),e.xlines.style("fill","none").classed("crisp",!0),e.ylines.style("fill","none").classed("crisp",!0))}function v(t,e){if(t){var r={};for(var i in t.each((function(t){var i=t[0];n.select(this).remove(),b(i,e),r[i]=!0})),e._plots)for(var o=e._plots[i].overlays||[],a=0;a0){var g=f.id;if(-1!==g.indexOf(p))continue;g+=p+(u+1),f=o.extendFlat({},f,{id:g,plot:a._cartesianlayer.selectAll(".subplot").select("."+g)})}for(var v,b=[],y=0;y1&&(w+=p+_),x.push(n+w),r=0;r{"use strict";var n=r(75058),i=r(84226),o=r(68057).T,a=r(98260).extendFlat,s=r(46121).templatedArray,l=r(60393).descriptionWithDates,c=r(32994).ONEDAY,u=r(21197),h=u.HOUR_PATTERN,d=u.WEEKDAY_PATTERN,f={valType:"enumerated",values:["auto","linear","array"],editType:"ticks",impliedEdits:{tick0:void 0,dtick:void 0},description:["Sets the tick mode for this axis.","If *auto*, the number of ticks is set via `nticks`.","If *linear*, the placement of the ticks is determined by","a starting position `tick0` and a tick step `dtick`","(*linear* is the default value if `tick0` and `dtick` are provided).","If *array*, the placement of the ticks is set via `tickvals`","and the tick text is `ticktext`.","(*array* is the default value if `tickvals` is provided)."].join(" ")},p=a({},f,{values:f.values.slice().concat(["sync"]),description:[f.description,"If *sync*, the number of ticks will sync with the overlayed axis","set by `overlaying` property."].join(" ")});function m(t){return{valType:"integer",min:0,dflt:t?5:0,editType:"ticks",description:["Specifies the maximum number of ticks for the particular axis.","The actual number of ticks will be chosen automatically to be","less than or equal to `nticks`.","Has an effect only if `tickmode` is set to *auto*."].join(" ")}}var g={valType:"any",editType:"ticks",impliedEdits:{tickmode:"linear"},description:["Sets the placement of the first tick on this axis.","Use with `dtick`.","If the axis `type` is *log*, then you must take the log of your starting tick","(e.g. to set the starting tick to 100, set the `tick0` to 2)","except when `dtick`=*L* (see `dtick` for more info).","If the axis `type` is *date*, it should be a date string, like date data.","If the axis `type` is *category*, it should be a number, using the scale where","each category is assigned a serial number from zero in the order it appears."].join(" ")},v={valType:"any",editType:"ticks",impliedEdits:{tickmode:"linear"},description:["Sets the step in-between ticks on this axis. Use with `tick0`.","Must be a positive number, or special strings available to *log* and *date* axes.","If the axis `type` is *log*, then ticks are set every 10^(n*dtick) where n","is the tick number. For example,","to set a tick mark at 1, 10, 100, 1000, ... set dtick to 1.","To set tick marks at 1, 100, 10000, ... set dtick to 2.","To set tick marks at 1, 5, 25, 125, 625, 3125, ... set dtick to log_10(5), or 0.69897000433.","*log* has several special values; *L*, where `f` is a positive number,","gives ticks linearly spaced in value (but not position).","For example `tick0` = 0.1, `dtick` = *L0.5* will put ticks at 0.1, 0.6, 1.1, 1.6 etc.","To show powers of 10 plus small digits between, use *D1* (all digits) or *D2* (only 2 and 5).","`tick0` is ignored for *D1* and *D2*.","If the axis `type` is *date*, then you must convert the time to milliseconds.","For example, to set the interval between ticks to one day,","set `dtick` to 86400000.0.","*date* also has special values *M* gives ticks spaced by a number of months.","`n` must be a positive integer.","To set ticks on the 15th of every third month, set `tick0` to *2000-01-15* and `dtick` to *M3*.","To set ticks every 4 years, set `dtick` to *M48*"].join(" ")},b={valType:"data_array",editType:"ticks",description:["Sets the values at which ticks on this axis appear.","Only has an effect if `tickmode` is set to *array*.","Used with `ticktext`."].join(" ")},y={valType:"enumerated",values:["outside","inside",""],editType:"ticks",description:["Determines whether ticks are drawn or not.","If **, this axis' ticks are not drawn.","If *outside* (*inside*), this axis' are drawn outside (inside)","the axis lines."].join(" ")};function x(t){var e={valType:"number",min:0,editType:"ticks",description:"Sets the tick length (in px)."};return t||(e.dflt=5),e}function _(t){var e={valType:"number",min:0,editType:"ticks",description:"Sets the tick width (in px)."};return t||(e.dflt=1),e}var w={valType:"color",dflt:i.defaultLine,editType:"ticks",description:"Sets the tick color."},k={valType:"color",dflt:i.lightLine,editType:"ticks",description:"Sets the color of the grid lines."};function A(t){var e={valType:"number",min:0,editType:"ticks",description:"Sets the width (in px) of the grid lines."};return t||(e.dflt=1),e}var M=a({},o,{editType:"ticks"}),T={valType:"boolean",editType:"ticks",description:["Determines whether or not grid lines are drawn.","If *true*, the grid lines are drawn at every tick mark."].join(" ")};t.exports={visible:{valType:"boolean",editType:"plot",description:["A single toggle to hide the axis while preserving interaction like dragging.","Default is true when a cheater plot is present on the axis, otherwise","false"].join(" ")},color:{valType:"color",dflt:i.defaultLine,editType:"ticks",description:["Sets default for all colors associated with this axis","all at once: line, font, tick, and grid colors.","Grid color is lightened by blending this with the plot background","Individual pieces can override this."].join(" ")},title:{text:{valType:"string",editType:"ticks",description:["Sets the title of this axis.","Note that before the existence of `title.text`, the title's","contents used to be defined as the `title` attribute itself.","This behavior has been deprecated."].join(" ")},font:n({editType:"ticks",description:["Sets this axis' title font.","Note that the title's font used to be customized","by the now deprecated `titlefont` attribute."].join(" ")}),standoff:{valType:"number",min:0,editType:"ticks",description:["Sets the standoff distance (in px) between the axis labels and the title text","The default value is a function of the axis tick labels, the title `font.size`","and the axis `linewidth`.","Note that the axis title position is always constrained within the margins,","so the actual standoff distance is always less than the set or default value.","By setting `standoff` and turning on `automargin`, plotly.js will push the","margins to fit the axis title at given standoff distance."].join(" ")},editType:"ticks"},type:{valType:"enumerated",values:["-","linear","log","date","category","multicategory"],dflt:"-",editType:"calc",_noTemplating:!0,description:["Sets the axis type.","By default, plotly attempts to determined the axis type","by looking into the data of the traces that referenced","the axis in question."].join(" ")},autotypenumbers:{valType:"enumerated",values:["convert types","strict"],dflt:"convert types",editType:"calc",description:["Using *strict* a numeric string in trace data is not converted to a number.","Using *convert types* a numeric string in trace data may be","treated as a number during automatic axis `type` detection.","Defaults to layout.autotypenumbers."].join(" ")},autorange:{valType:"enumerated",values:[!0,!1,"reversed","min reversed","max reversed","min","max"],dflt:!0,editType:"axrange",impliedEdits:{"range[0]":void 0,"range[1]":void 0},description:["Determines whether or not the range of this axis is","computed in relation to the input data.","See `rangemode` for more info.","If `range` is provided and it has a value for both the","lower and upper bound, `autorange` is set to *false*.","Using *min* applies autorange only to set the minimum.","Using *max* applies autorange only to set the maximum.","Using *min reversed* applies autorange only to set the minimum on a reversed axis.","Using *max reversed* applies autorange only to set the maximum on a reversed axis.","Using *reversed* applies autorange on both ends and reverses the axis direction."].join(" ")},autorangeoptions:{minallowed:{valType:"any",editType:"plot",impliedEdits:{"range[0]":void 0,"range[1]":void 0},description:["Use this value exactly as autorange minimum."].join(" ")},maxallowed:{valType:"any",editType:"plot",impliedEdits:{"range[0]":void 0,"range[1]":void 0},description:["Use this value exactly as autorange maximum."].join(" ")},clipmin:{valType:"any",editType:"plot",impliedEdits:{"range[0]":void 0,"range[1]":void 0},description:["Clip autorange minimum if it goes beyond this value.","Has no effect when `autorangeoptions.minallowed` is provided."].join(" ")},clipmax:{valType:"any",editType:"plot",impliedEdits:{"range[0]":void 0,"range[1]":void 0},description:["Clip autorange maximum if it goes beyond this value.","Has no effect when `autorangeoptions.maxallowed` is provided."].join(" ")},include:{valType:"any",arrayOk:!0,editType:"plot",impliedEdits:{"range[0]":void 0,"range[1]":void 0},description:["Ensure this value is included in autorange."].join(" ")},editType:"plot"},rangemode:{valType:"enumerated",values:["normal","tozero","nonnegative"],dflt:"normal",editType:"plot",description:["If *normal*, the range is computed in relation to the extrema","of the input data.","If *tozero*`, the range extends to 0,","regardless of the input data","If *nonnegative*, the range is non-negative,","regardless of the input data.","Applies only to linear axes."].join(" ")},range:{valType:"info_array",items:[{valType:"any",editType:"axrange",impliedEdits:{"^autorange":!1},anim:!0},{valType:"any",editType:"axrange",impliedEdits:{"^autorange":!1},anim:!0}],editType:"axrange",impliedEdits:{autorange:!1},anim:!0,description:["Sets the range of this axis.","If the axis `type` is *log*, then you must take the log of your","desired range (e.g. to set the range from 1 to 100,","set the range from 0 to 2).","If the axis `type` is *date*, it should be date strings,","like date data, though Date objects and unix milliseconds","will be accepted and converted to strings.","If the axis `type` is *category*, it should be numbers,","using the scale where each category is assigned a serial","number from zero in the order it appears.","Leaving either or both elements `null` impacts the default `autorange`."].join(" ")},minallowed:{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1},description:["Determines the minimum range of this axis."].join(" ")},maxallowed:{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1},description:["Determines the maximum range of this axis."].join(" ")},fixedrange:{valType:"boolean",dflt:!1,editType:"calc",description:["Determines whether or not this axis is zoom-able.","If true, then zoom is disabled."].join(" ")},insiderange:{valType:"info_array",items:[{valType:"any",editType:"plot"},{valType:"any",editType:"plot"}],editType:"plot",description:["Could be used to set the desired inside range of this axis","(excluding the labels) when `ticklabelposition` of","the anchored axis has *inside*.","Not implemented for axes with `type` *log*.","This would be ignored when `range` is provided."].join(" ")},scaleanchor:{valType:"enumerated",values:[u.idRegex.x.toString(),u.idRegex.y.toString(),!1],editType:"plot",description:["If set to another axis id (e.g. `x2`, `y`), the range of this axis","changes together with the range of the corresponding axis","such that the scale of pixels per unit is in a constant ratio.","Both axes are still zoomable, but when you zoom one, the other will","zoom the same amount, keeping a fixed midpoint.","`constrain` and `constraintoward` determine how we enforce the constraint.","You can chain these, ie `yaxis: {scaleanchor: *x*}, xaxis2: {scaleanchor: *y*}`","but you can only link axes of the same `type`.","The linked axis can have the opposite letter (to constrain the aspect ratio)","or the same letter (to match scales across subplots).","Loops (`yaxis: {scaleanchor: *x*}, xaxis: {scaleanchor: *y*}` or longer) are redundant","and the last constraint encountered will be ignored to avoid possible","inconsistent constraints via `scaleratio`.","Note that setting axes simultaneously in both a `scaleanchor` and a `matches` constraint","is currently forbidden.","Setting `false` allows to remove a default constraint (occasionally,","you may need to prevent a default `scaleanchor` constraint from",'being applied, eg. when having an image trace `yaxis: {scaleanchor: "x"}`',"is set automatically in order for pixels to be rendered as squares,","setting `yaxis: {scaleanchor: false}` allows to remove the constraint)."].join(" ")},scaleratio:{valType:"number",min:0,dflt:1,editType:"plot",description:["If this axis is linked to another by `scaleanchor`, this determines the pixel","to unit scale ratio. For example, if this value is 10, then every unit on","this axis spans 10 times the number of pixels as a unit on the linked axis.","Use this for example to create an elevation profile where the vertical scale","is exaggerated a fixed amount with respect to the horizontal."].join(" ")},constrain:{valType:"enumerated",values:["range","domain"],editType:"plot",description:["If this axis needs to be compressed (either due to its own `scaleanchor` and","`scaleratio` or those of the other axis), determines how that happens:","by increasing the *range*, or by decreasing the *domain*.","Default is *domain* for axes containing image traces, *range* otherwise."].join(" ")},constraintoward:{valType:"enumerated",values:["left","center","right","top","middle","bottom"],editType:"plot",description:["If this axis needs to be compressed (either due to its own `scaleanchor` and","`scaleratio` or those of the other axis), determines which direction we push","the originally specified plot area. Options are *left*, *center* (default),","and *right* for x axes, and *top*, *middle* (default), and *bottom* for y axes."].join(" ")},matches:{valType:"enumerated",values:[u.idRegex.x.toString(),u.idRegex.y.toString()],editType:"calc",description:["If set to another axis id (e.g. `x2`, `y`), the range of this axis","will match the range of the corresponding axis in data-coordinates space.","Moreover, matching axes share auto-range values, category lists and","histogram auto-bins.","Note that setting axes simultaneously in both a `scaleanchor` and a `matches` constraint","is currently forbidden.","Moreover, note that matching axes must have the same `type`."].join(" ")},rangebreaks:s("rangebreak",{enabled:{valType:"boolean",dflt:!0,editType:"calc",description:["Determines whether this axis rangebreak is enabled or disabled.","Please note that `rangebreaks` only work for *date* axis type."].join(" ")},bounds:{valType:"info_array",items:[{valType:"any",editType:"calc"},{valType:"any",editType:"calc"}],editType:"calc",description:["Sets the lower and upper bounds of this axis rangebreak.","Can be used with `pattern`."].join(" ")},pattern:{valType:"enumerated",values:[d,h,""],editType:"calc",description:["Determines a pattern on the time line that generates breaks.","If *"+d+"* - days of the week in English e.g. 'Sunday' or `sun`","(matching is case-insensitive and considers only the first three characters),","as well as Sunday-based integers between 0 and 6.","If *"+h+"* - hour (24-hour clock) as decimal numbers between 0 and 24.","for more info.","Examples:","- { pattern: '"+d+"', bounds: [6, 1] }"," or simply { bounds: ['sat', 'mon'] }"," breaks from Saturday to Monday (i.e. skips the weekends).","- { pattern: '"+h+"', bounds: [17, 8] }"," breaks from 5pm to 8am (i.e. skips non-work hours)."].join(" ")},values:{valType:"info_array",freeLength:!0,editType:"calc",items:{valType:"any",editType:"calc"},description:["Sets the coordinate values corresponding to the rangebreaks.","An alternative to `bounds`.","Use `dvalue` to set the size of the values along the axis."].join(" ")},dvalue:{valType:"number",editType:"calc",min:0,dflt:c,description:["Sets the size of each `values` item.","The default is one day in milliseconds."].join(" ")},editType:"calc"}),tickmode:p,nticks:m(),tick0:g,dtick:v,ticklabelstep:{valType:"integer",min:1,dflt:1,editType:"ticks",description:["Sets the spacing between tick labels as compared to the spacing between ticks.","A value of 1 (default) means each tick gets a label.","A value of 2 means shows every 2nd label.","A larger value n means only every nth tick is labeled.","`tick0` determines which labels are shown.","Not implemented for axes with `type` *log* or *multicategory*, or when `tickmode` is *array*."].join(" ")},tickvals:b,ticktext:{valType:"data_array",editType:"ticks",description:["Sets the text displayed at the ticks position via `tickvals`.","Only has an effect if `tickmode` is set to *array*.","Used with `tickvals`."].join(" ")},ticks:y,tickson:{valType:"enumerated",values:["labels","boundaries"],dflt:"labels",editType:"ticks",description:["Determines where ticks and grid lines are drawn with respect to their","corresponding tick labels.","Only has an effect for axes of `type` *category* or *multicategory*.","When set to *boundaries*, ticks and grid lines are drawn half a category","to the left/bottom of labels."].join(" ")},ticklabelmode:{valType:"enumerated",values:["instant","period"],dflt:"instant",editType:"ticks",description:["Determines where tick labels are drawn with respect to their","corresponding ticks and grid lines.","Only has an effect for axes of `type` *date*","When set to *period*, tick labels are drawn in the middle of the period","between ticks."].join(" ")},ticklabelposition:{valType:"enumerated",values:["outside","inside","outside top","inside top","outside left","inside left","outside right","inside right","outside bottom","inside bottom"],dflt:"outside",editType:"calc",description:["Determines where tick labels are drawn with respect to the axis","Please note that","top or bottom has no effect on x axes or when `ticklabelmode` is set to *period*.","Similarly","left or right has no effect on y axes or when `ticklabelmode` is set to *period*.","Has no effect on *multicategory* axes or when `tickson` is set to *boundaries*.","When used on axes linked by `matches` or `scaleanchor`,","no extra padding for inside labels would be added by autorange,","so that the scales could match."].join(" ")},ticklabeloverflow:{valType:"enumerated",values:["allow","hide past div","hide past domain"],editType:"calc",description:["Determines how we handle tick labels that would overflow either the graph div or the domain of the axis.","The default value for inside tick labels is *hide past domain*.","Otherwise on *category* and *multicategory* axes the default is *allow*.","In other cases the default is *hide past div*."].join(" ")},ticklabelshift:{valType:"integer",dflt:0,editType:"ticks",description:["Shifts the tick labels by the specified number of pixels in parallel to the axis.","Positive values move the labels in the positive direction of the axis."].join(" ")},ticklabelstandoff:{valType:"integer",dflt:0,editType:"ticks",description:["Sets the standoff distance (in px) between the axis tick labels and their default position.","A positive `ticklabelstandoff` moves the labels farther away from the plot area","if `ticklabelposition` is *outside*, and deeper into the plot area if","`ticklabelposition` is *inside*. A negative `ticklabelstandoff` works in the opposite","direction, moving outside ticks towards the plot area and inside ticks towards","the outside. If the negative value is large enough, inside ticks can even end up","outside and vice versa."].join(" ")},ticklabelindex:{valType:"integer",arrayOk:!0,editType:"calc",description:["Only for axes with `type` *date* or *linear*.","Instead of drawing the major tick label, draw the label for the minor tick","that is n positions away from the major tick. E.g. to always draw the label for the","minor tick before each major tick, choose `ticklabelindex` -1. This is useful for date","axes with `ticklabelmode` *period* if you want to label the period that ends with each","major tick instead of the period that begins there."].join(" ")},mirror:{valType:"enumerated",values:[!0,"ticks",!1,"all","allticks"],dflt:!1,editType:"ticks+layoutstyle",description:["Determines if the axis lines or/and ticks are mirrored to","the opposite side of the plotting area.","If *true*, the axis lines are mirrored.","If *ticks*, the axis lines and ticks are mirrored.","If *false*, mirroring is disable.","If *all*, axis lines are mirrored on all shared-axes subplots.","If *allticks*, axis lines and ticks are mirrored","on all shared-axes subplots."].join(" ")},ticklen:x(),tickwidth:_(),tickcolor:w,showticklabels:{valType:"boolean",dflt:!0,editType:"ticks",description:"Determines whether or not the tick labels are drawn."},labelalias:{valType:"any",dflt:!1,editType:"ticks",description:["Replacement text for specific tick or hover labels.","For example using {US: 'USA', CA: 'Canada'} changes US to USA","and CA to Canada. The labels we would have shown must match","the keys exactly, after adding any tickprefix or ticksuffix.","For negative numbers the minus sign symbol used (U+2212) is wider than the regular ascii dash.","That means you need to use −1 instead of -1.","labelalias can be used with any axis type, and both keys (if needed)","and values (if desired) can include html-like tags or MathJax."].join(" ")},automargin:{valType:"flaglist",flags:["height","width","left","right","top","bottom"],extras:[!0,!1],dflt:!1,editType:"ticks",description:["Determines whether long tick labels automatically grow the figure","margins."].join(" ")},showspikes:{valType:"boolean",dflt:!1,editType:"modebar",description:["Determines whether or not spikes (aka droplines) are drawn for this axis.","Note: This only takes affect when hovermode = closest"].join(" ")},spikecolor:{valType:"color",dflt:null,editType:"none",description:"Sets the spike color. If undefined, will use the series color"},spikethickness:{valType:"number",dflt:3,editType:"none",description:"Sets the width (in px) of the zero line."},spikedash:a({},o,{dflt:"dash",editType:"none"}),spikemode:{valType:"flaglist",flags:["toaxis","across","marker"],dflt:"toaxis",editType:"none",description:["Determines the drawing mode for the spike line","If *toaxis*, the line is drawn from the data point to the axis the ","series is plotted on.","If *across*, the line is drawn across the entire plot area, and","supercedes *toaxis*.","If *marker*, then a marker dot is drawn on the axis the series is","plotted on"].join(" ")},spikesnap:{valType:"enumerated",values:["data","cursor","hovered data"],dflt:"hovered data",editType:"none",description:"Determines whether spikelines are stuck to the cursor or to the closest datapoints."},tickfont:n({editType:"ticks",description:"Sets the tick font."}),tickangle:{valType:"angle",dflt:"auto",editType:"ticks",description:["Sets the angle of the tick labels with respect to the horizontal.","For example, a `tickangle` of -90 draws the tick labels","vertically."].join(" ")},autotickangles:{valType:"info_array",freeLength:!0,items:{valType:"angle"},dflt:[0,30,90],editType:"ticks",description:["When `tickangle` is set to *auto*, it will be set to the first","angle in this array that is large enough to prevent label","overlap."].join(" ")},tickprefix:{valType:"string",dflt:"",editType:"ticks",description:"Sets a tick label prefix."},showtickprefix:{valType:"enumerated",values:["all","first","last","none"],dflt:"all",editType:"ticks",description:["If *all*, all tick labels are displayed with a prefix.","If *first*, only the first tick is displayed with a prefix.","If *last*, only the last tick is displayed with a suffix.","If *none*, tick prefixes are hidden."].join(" ")},ticksuffix:{valType:"string",dflt:"",editType:"ticks",description:"Sets a tick label suffix."},showticksuffix:{valType:"enumerated",values:["all","first","last","none"],dflt:"all",editType:"ticks",description:"Same as `showtickprefix` but for tick suffixes."},showexponent:{valType:"enumerated",values:["all","first","last","none"],dflt:"all",editType:"ticks",description:["If *all*, all exponents are shown besides their significands.","If *first*, only the exponent of the first tick is shown.","If *last*, only the exponent of the last tick is shown.","If *none*, no exponents appear."].join(" ")},exponentformat:{valType:"enumerated",values:["none","e","E","power","SI","B"],dflt:"B",editType:"ticks",description:["Determines a formatting rule for the tick exponents.","For example, consider the number 1,000,000,000.","If *none*, it appears as 1,000,000,000.","If *e*, 1e+9.","If *E*, 1E+9.","If *power*, 1x10^9 (with 9 in a super script).","If *SI*, 1G.","If *B*, 1B."].join(" ")},minexponent:{valType:"number",dflt:3,min:0,editType:"ticks",description:["Hide SI prefix for 10^n if |n| is below this number.","This only has an effect when `tickformat` is *SI* or *B*."].join(" ")},separatethousands:{valType:"boolean",dflt:!1,editType:"ticks",description:['If "true", even 4-digit integers are separated'].join(" ")},tickformat:{valType:"string",dflt:"",editType:"ticks",description:l("tick label")},tickformatstops:s("tickformatstop",{enabled:{valType:"boolean",dflt:!0,editType:"ticks",description:["Determines whether or not this stop is used.","If `false`, this stop is ignored even within its `dtickrange`."].join(" ")},dtickrange:{valType:"info_array",items:[{valType:"any",editType:"ticks"},{valType:"any",editType:"ticks"}],editType:"ticks",description:["range [*min*, *max*], where *min*, *max* - dtick values","which describe some zoom level, it is possible to omit *min*","or *max* value by passing *null*"].join(" ")},value:{valType:"string",dflt:"",editType:"ticks",description:["string - dtickformat for described zoom level, the same as *tickformat*"].join(" ")},editType:"ticks"}),hoverformat:{valType:"string",dflt:"",editType:"none",description:l("hover text")},showline:{valType:"boolean",dflt:!1,editType:"ticks+layoutstyle",description:["Determines whether or not a line bounding this axis is drawn."].join(" ")},linecolor:{valType:"color",dflt:i.defaultLine,editType:"layoutstyle",description:"Sets the axis line color."},linewidth:{valType:"number",min:0,dflt:1,editType:"ticks+layoutstyle",description:"Sets the width (in px) of the axis line."},showgrid:T,gridcolor:k,gridwidth:A(),griddash:M,zeroline:{valType:"boolean",editType:"ticks",description:["Determines whether or not a line is drawn at along the 0 value","of this axis.","If *true*, the zero line is drawn on top of the grid lines."].join(" ")},zerolinecolor:{valType:"color",dflt:i.defaultLine,editType:"ticks",description:"Sets the line color of the zero line."},zerolinewidth:{valType:"number",dflt:1,editType:"ticks",description:"Sets the width (in px) of the zero line."},showdividers:{valType:"boolean",dflt:!0,editType:"ticks",description:["Determines whether or not a dividers are drawn","between the category levels of this axis.","Only has an effect on *multicategory* axes."].join(" ")},dividercolor:{valType:"color",dflt:i.defaultLine,editType:"ticks",description:["Sets the color of the dividers","Only has an effect on *multicategory* axes."].join(" ")},dividerwidth:{valType:"number",dflt:1,editType:"ticks",description:["Sets the width (in px) of the dividers","Only has an effect on *multicategory* axes."].join(" ")},anchor:{valType:"enumerated",values:["free",u.idRegex.x.toString(),u.idRegex.y.toString()],editType:"plot",description:["If set to an opposite-letter axis id (e.g. `x2`, `y`), this axis is bound to","the corresponding opposite-letter axis.","If set to *free*, this axis' position is determined by `position`."].join(" ")},side:{valType:"enumerated",values:["top","bottom","left","right"],editType:"plot",description:["Determines whether a x (y) axis is positioned","at the *bottom* (*left*) or *top* (*right*)","of the plotting area."].join(" ")},overlaying:{valType:"enumerated",values:["free",u.idRegex.x.toString(),u.idRegex.y.toString()],editType:"plot",description:["If set a same-letter axis id, this axis is overlaid on top of","the corresponding same-letter axis, with traces and axes visible for both","axes.","If *false*, this axis does not overlay any same-letter axes.","In this case, for axes with overlapping domains only the highest-numbered","axis will be visible."].join(" ")},minor:{tickmode:f,nticks:m("minor"),tick0:g,dtick:v,tickvals:b,ticks:y,ticklen:x("minor"),tickwidth:_("minor"),tickcolor:w,gridcolor:k,gridwidth:A("minor"),griddash:M,showgrid:T,editType:"ticks"},layer:{valType:"enumerated",values:["above traces","below traces"],dflt:"above traces",editType:"plot",description:["Sets the layer on which this axis is displayed.","If *above traces*, this axis is displayed above all the subplot's traces","If *below traces*, this axis is displayed below all the subplot's traces,","but above the grid lines.","Useful when used together with scatter-like traces with `cliponaxis`","set to *false* to show markers and/or text nodes above this axis."].join(" ")},domain:{valType:"info_array",items:[{valType:"number",min:0,max:1,editType:"plot"},{valType:"number",min:0,max:1,editType:"plot"}],dflt:[0,1],editType:"plot",description:["Sets the domain of this axis (in plot fraction)."].join(" ")},position:{valType:"number",min:0,max:1,dflt:0,editType:"plot",description:["Sets the position of this axis in the plotting space","(in normalized coordinates).","Only has an effect if `anchor` is set to *free*."].join(" ")},autoshift:{valType:"boolean",dflt:!1,editType:"plot",description:["Automatically reposition the axis to avoid","overlap with other axes with the same `overlaying` value.","This repositioning will account for any `shift` amount applied to other","axes on the same side with `autoshift` is set to true.","Only has an effect if `anchor` is set to *free*."].join(" ")},shift:{valType:"number",editType:"plot",description:["Moves the axis a given number of pixels from where it would have been otherwise.","Accepts both positive and negative values, which will shift the axis either right","or left, respectively.","If `autoshift` is set to true, then this defaults to a padding of -3 if `side` is set to *left*.","and defaults to +3 if `side` is set to *right*. Defaults to 0 if `autoshift` is set to false.","Only has an effect if `anchor` is set to *free*."].join(" ")},categoryorder:{valType:"enumerated",values:["trace","category ascending","category descending","array","total ascending","total descending","min ascending","min descending","max ascending","max descending","sum ascending","sum descending","mean ascending","mean descending","geometric mean ascending","geometric mean descending","median ascending","median descending"],dflt:"trace",editType:"calc",description:["Specifies the ordering logic for the case of categorical variables.","By default, plotly uses *trace*, which specifies the order that is present in the data supplied.","Set `categoryorder` to *category ascending* or *category descending* if order should be determined by","the alphanumerical order of the category names.","Set `categoryorder` to *array* to derive the ordering from the attribute `categoryarray`. If a category","is not found in the `categoryarray` array, the sorting behavior for that attribute will be identical to","the *trace* mode. The unspecified categories will follow the categories in `categoryarray`.","Set `categoryorder` to *total ascending* or *total descending* if order should be determined by the","numerical order of the values.","Similarly, the order can be determined by the min, max, sum, mean, geometric mean or median of all the values."].join(" ")},categoryarray:{valType:"data_array",editType:"calc",description:["Sets the order in which categories on this axis appear.","Only has an effect if `categoryorder` is set to *array*.","Used with `categoryorder`."].join(" ")},uirevision:{valType:"any",editType:"none",description:["Controls persistence of user-driven changes in axis `range`,","`autorange`, and `title` if in `editable: true` configuration.","Defaults to `layout.uirevision`."].join(" ")},editType:"calc",_deprecated:{autotick:{valType:"boolean",editType:"ticks",description:["Obsolete.","Set `tickmode` to *auto* for old `autotick` *true* behavior.","Set `tickmode` to *linear* for `autotick` *false*."].join(" ")},title:{valType:"string",editType:"ticks",description:["Value of `title` is no longer a simple *string* but a set of sub-attributes.","To set the axis' title, please use `title.text` now."].join(" ")},titlefont:n({editType:"ticks",description:["Former `titlefont` is now the sub-attribute `font` of `title`.","To customize title font properties, please use `title.font` now."].join(" ")})}}},36741:(t,e,r)=>{"use strict";var n=r(12822),i=r(17499),o=r(66811).isUnifiedHover,a=r(85400),s=r(46121),l=r(13195),c=r(86130),u=r(25119),h=r(91200),d=r(69352),f=r(52869),p=r(99246),m=p.id2name,g=p.name2id,v=r(21197).AX_ID_PATTERN,b=r(25059),y=b.traceIs,x=b.getComponentMethod;function _(t,e,r){Array.isArray(t[e])?t[e].push(r):t[e]=[r]}t.exports=function(t,e,r){var b,w,k=e.autotypenumbers,A={},M={},T={},S={},C={},E={},L={},z={},O={},D={};for(b=0;b{"use strict";var n=r(18106).mix,i=r(84226),o=r(12822);t.exports=function(t,e,r,a){var s=(a=a||{}).dfltColor;function l(r,n){return o.coerce2(t,e,a.attributes,r,n)}var c=l("linecolor",s),u=l("linewidth");r("showline",a.showLine||!!c||!!u)||(delete e.linecolor,delete e.linewidth);var h=l("gridcolor",n(s,a.bgColor,a.blend||i.lightFraction).toRgbString()),d=l("gridwidth"),f=l("griddash");if(r("showgrid",a.showGrid||!!h||!!d||!!f)||(delete e.gridcolor,delete e.gridwidth,delete e.griddash),a.hasMinor){var p=l("minor.gridcolor",n(e.gridcolor,a.bgColor,67).toRgbString()),m=l("minor.gridwidth",e.gridwidth||1),g=l("minor.griddash",e.griddash||"solid");r("minor.showgrid",!!p||!!m||!!g)||(delete e.minor.gridcolor,delete e.minor.gridwidth,delete e.minor.griddash)}if(!a.noZeroLine){var v=l("zerolinecolor",s),b=l("zerolinewidth");r("zeroline",a.showGrid||!!v||!!b)||(delete e.zerolinecolor,delete e.zerolinewidth)}}},52869:(t,e,r)=>{"use strict";var n=r(7370),i=r(12822);t.exports=function(t,e,r,o){var a,s,l,c,u,h,d=o.counterAxes||[],f=o.overlayableAxes||[],p=o.letter,m=o.grid,g=o.overlayingDomain;m&&(s=m._domains[p][m._axisMap[e._id]],a=m._anchors[e._id],s&&(l=m[p+"side"].split(" ")[0],c=m.domain[p]["right"===l||"top"===l?1:0])),s=s||[0,1],a=a||(n(t.position)?"free":d[0]||"free"),l=l||("x"===p?"bottom":"left"),c=c||0,u=0,h=!1;var v=i.coerce(t,e,{anchor:{valType:"enumerated",values:["free"].concat(d),dflt:a}},"anchor"),b=i.coerce(t,e,{side:{valType:"enumerated",values:"x"===p?["bottom","top"]:["left","right"],dflt:l}},"side");"free"===v&&("y"===p&&(r("autoshift")&&(c="left"===b?g[0]:g[1],h=!e.automargin||e.automargin,u="left"===b?-3:3),r("shift",u)),r("position",c)),r("automargin",h);var y=!1;if(f.length&&(y=i.coerce(t,e,{overlaying:{valType:"enumerated",values:[!1].concat(f),dflt:!1}},"overlaying")),!y){var x=r("domain",s);x[0]>x[1]-1/4096&&(e.domain=s),i.noneOrAll(t.domain,e.domain,s),"sync"===e.tickmode&&(e.tickmode="auto")}return r("layer"),e}},12213:(t,e,r)=>{"use strict";var n=r(95768);t.exports=function(t,e,r,i,o){o||(o={});var a=o.tickSuffixDflt,s=n(t);r("tickprefix")&&r("showtickprefix",s),r("ticksuffix",a)&&r("showticksuffix",s)}},46458:(t,e,r)=>{"use strict";var n=r(49826);t.exports=function(t,e,r,i){var o=e._template||{},a=e.type||o.type||"-";r("minallowed"),r("maxallowed");var s,l=r("range");l||i.noInsiderange||"log"===a||(!(s=r("insiderange"))||null!==s[0]&&null!==s[1]||(e.insiderange=!1,s=void 0),s&&(l=r("range",s)));var c,u=e.getAutorangeDflt(l,i),h=r("autorange",u);!l||(null!==l[0]||null!==l[1])&&(null!==l[0]&&null!==l[1]||"reversed"!==h&&!0!==h)&&(null===l[0]||"min"!==h&&"max reversed"!==h)&&(null===l[1]||"max"!==h&&"min reversed"!==h)||(l=void 0,delete e.range,e.autorange=!0,c=!0),c||(h=r("autorange",u=e.getAutorangeDflt(l,i))),h&&(n(r,h,l),"linear"!==a&&"-"!==a||r("rangemode")),e.cleanRange()}},92578:(t,e,r)=>{"use strict";var n=r(89701).FROM_BL;t.exports=function(t,e,r){void 0===r&&(r=n[t.constraintoward||"center"]);var i=[t.r2l(t.range[0]),t.r2l(t.range[1])],o=i[0]+(i[1]-i[0])*r;t.range=t._input.range=[t.l2r(o+(i[0]-o)*e),t.l2r(o+(i[1]-o)*e)],t.setScale()}},30632:(t,e,r)=>{"use strict";var n=r(27941),i=r(79969).aL,o=r(12822),a=o.numberFormat,s=r(7370),l=o.cleanNumber,c=o.ms2DateTime,u=o.dateTime2ms,h=o.ensureNumber,d=o.isArrayOrTypedArray,f=r(32994),p=f.FP_SAFE,m=f.BADNUM,g=f.LOG_CLIP,v=f.ONEWEEK,b=f.ONEDAY,y=f.ONEHOUR,x=f.ONEMIN,_=f.ONESEC,w=r(99246),k=r(21197),A=k.HOUR_PATTERN,M=k.WEEKDAY_PATTERN;function T(t){return Math.pow(10,t)}function S(t){return null!=t}t.exports=function(t,e){e=e||{};var r=t._id||"x",f=r.charAt(0);function C(e,r){if(e>0)return Math.log(e)/Math.LN10;if(e<=0&&r&&t.range&&2===t.range.length){var n=t.range[0],i=t.range[1];return.5*(n+i-2*g*Math.abs(n-i))}return m}function E(e,r,n,i){if((i||{}).msUTC&&s(e))return+e;var a=u(e,n||t.calendar);if(a===m){if(!s(e))return m;e=+e;var l=Math.floor(10*o.mod(e+.05,1)),c=Math.round(e-l/10);a=u(new Date(c))+l/10}return a}function L(e,r,n){return c(e,r,n||t.calendar)}function z(e){return t._categories[Math.round(e)]}function O(e){if(S(e)){if(void 0===t._categoriesMap&&(t._categoriesMap={}),void 0!==t._categoriesMap[e])return t._categoriesMap[e];t._categories.push("number"==typeof e?String(e):e);var r=t._categories.length-1;return t._categoriesMap[e]=r,r}return m}function D(e){if(t._categoriesMap)return t._categoriesMap[e]}function I(t){var e=D(t);return void 0!==e?e:s(t)?+t:void 0}function F(t){return s(t)?+t:D(t)}function R(t,e,r){return n.round(r+e*t,2)}function P(t,e,r){return(t-r)/e}var j=function(e){return s(e)?R(e,t._m,t._b):m},N=function(e){return P(e,t._m,t._b)};if(t.rangebreaks){var B="y"===f;j=function(e){if(!s(e))return m;var r=t._rangebreaks.length;if(!r)return R(e,t._m,t._b);var n=B;t.range[0]>t.range[1]&&(n=!n);for(var i=n?-1:1,o=i*e,a=0,l=0;lu)){a=o<(c+u)/2?l:l+1;break}a=l+1}var h=t._B[a]||0;return isFinite(h)?R(e,t._m2,h):0},N=function(e){var r=t._rangebreaks.length;if(!r)return P(e,t._m,t._b);for(var n=0,i=0;it._rangebreaks[i].pmax&&(n=i+1);return P(e,t._m2,t._B[n])}}t.c2l="log"===t.type?C:h,t.l2c="log"===t.type?T:h,t.l2p=j,t.p2l=N,t.c2p="log"===t.type?function(t,e){return j(C(t,e))}:j,t.p2c="log"===t.type?function(t){return T(N(t))}:N,-1!==["linear","-"].indexOf(t.type)?(t.d2r=t.r2d=t.d2c=t.r2c=t.d2l=t.r2l=l,t.c2d=t.c2r=t.l2d=t.l2r=h,t.d2p=t.r2p=function(e){return t.l2p(l(e))},t.p2d=t.p2r=N,t.cleanPos=h):"log"===t.type?(t.d2r=t.d2l=function(t,e){return C(l(t),e)},t.r2d=t.r2c=function(t){return T(l(t))},t.d2c=t.r2l=l,t.c2d=t.l2r=h,t.c2r=C,t.l2d=T,t.d2p=function(e,r){return t.l2p(t.d2r(e,r))},t.p2d=function(t){return T(N(t))},t.r2p=function(e){return t.l2p(l(e))},t.p2r=N,t.cleanPos=h):"date"===t.type?(t.d2r=t.r2d=o.identity,t.d2c=t.r2c=t.d2l=t.r2l=E,t.c2d=t.c2r=t.l2d=t.l2r=L,t.d2p=t.r2p=function(e,r,n){return t.l2p(E(e,0,n))},t.p2d=t.p2r=function(t,e,r){return L(N(t),e,r)},t.cleanPos=function(e){return o.cleanDate(e,m,t.calendar)}):"category"===t.type?(t.d2c=t.d2l=O,t.r2d=t.c2d=t.l2d=z,t.d2r=t.d2l_noadd=I,t.r2c=function(e){var r=F(e);return void 0!==r?r:t.fraction2r(.5)},t.l2r=t.c2r=h,t.r2l=F,t.d2p=function(e){return t.l2p(t.r2c(e))},t.p2d=function(t){return z(N(t))},t.r2p=t.d2p,t.p2r=N,t.cleanPos=function(t){return"string"==typeof t&&""!==t?t:h(t)}):"multicategory"===t.type&&(t.r2d=t.c2d=t.l2d=z,t.d2r=t.d2l_noadd=I,t.r2c=function(e){var r=I(e);return void 0!==r?r:t.fraction2r(.5)},t.r2c_just_indices=D,t.l2r=t.c2r=h,t.r2l=I,t.d2p=function(e){return t.l2p(t.r2c(e))},t.p2d=function(t){return z(N(t))},t.r2p=t.d2p,t.p2r=N,t.cleanPos=function(t){return Array.isArray(t)||"string"==typeof t&&""!==t?t:h(t)},t.setupMultiCategory=function(n){var i,a,s=t._traceIndices,l=t._matchGroup;if(l&&0===t._categories.length)for(var c in l)if(c!==r){var u=e[w.id2name(c)];s=s.concat(u._traceIndices)}var h=[[0,{}],[0,{}]],p=[];for(i=0;il[1]&&(i[s?0:1]=n),i[0]===i[1]){var c=t.l2r(r),u=t.l2r(n);if(void 0!==r){var h=c+1;void 0!==n&&(h=Math.min(h,u)),i[s?1:0]=h}if(void 0!==n){var d=u+1;void 0!==r&&(d=Math.max(d,c)),i[s?0:1]=d}}}},t.cleanRange=function(e,r){t._cleanRange(e,r),t.limitRange(e)},t._cleanRange=function(e,r){r||(r={}),e||(e="range");var n,i,a=o.nestedProperty(t,e).get();if(i=(i="date"===t.type?o.dfltRange(t.calendar):"y"===f?k.DFLTRANGEY:"realaxis"===t._name?[0,1]:r.dfltRange||k.DFLTRANGEX).slice(),"tozero"!==t.rangemode&&"nonnegative"!==t.rangemode||(i[0]=0),a&&2===a.length){var l=null===a[0],c=null===a[1];for("date"!==t.type||t.autorange||(a[0]=o.cleanDate(a[0],m,t.calendar),a[1]=o.cleanDate(a[1],m,t.calendar)),n=0;n<2;n++)if("date"===t.type){if(!o.isDateTime(a[n],t.calendar)){t[e]=i;break}if(t.r2l(a[0])===t.r2l(a[1])){var u=o.constrain(t.r2l(a[0]),o.MIN_MS+1e3,o.MAX_MS-1e3);a[0]=t.l2r(u-1e3),a[1]=t.l2r(u+1e3);break}}else{if(!s(a[n])){if(l||c||!s(a[1-n])){t[e]=i;break}a[n]=a[1-n]*(n?10:.1)}if(a[n]<-p?a[n]=-p:a[n]>p&&(a[n]=p),a[0]===a[1]){var h=Math.max(1,Math.abs(1e-6*a[0]));a[0]-=h,a[1]+=h}}}else o.nestedProperty(t,e).set(i)},t.setScale=function(r){var n=e._size;if(t.overlaying){var i=w.getFromId({_fullLayout:e},t.overlaying);t.domain=i.domain}var o=r&&t._r?"_r":"range",a=t.calendar;t.cleanRange(o);var s,l,c=t.r2l(t[o][0],a),u=t.r2l(t[o][1],a),h="y"===f;if(h?(t._offset=n.t+(1-t.domain[1])*n.h,t._length=n.h*(t.domain[1]-t.domain[0]),t._m=t._length/(c-u),t._b=-t._m*u):(t._offset=n.l+t.domain[0]*n.w,t._length=n.w*(t.domain[1]-t.domain[0]),t._m=t._length/(u-c),t._b=-t._m*c),t._rangebreaks=[],t._lBreaks=0,t._m2=0,t._B=[],t.rangebreaks&&(t._rangebreaks=t.locateBreaks(Math.min(c,u),Math.max(c,u)),t._rangebreaks.length)){for(s=0;su&&(d=!d),d&&t._rangebreaks.reverse();var p=d?-1:1;for(t._m2=p*t._length/(Math.abs(u-c)-t._lBreaks),t._B.push(-t._m2*(h?u:c)),s=0;si&&(i+=7,ai&&(i+=24,a=n&&a=n&&e=s.min&&(ts.max&&(s.max=n),i=!1)}i&&c.push({min:t,max:n})}};for(n=0;n{"use strict";t.exports=function(t){var e=["showexponent","showtickprefix","showticksuffix"].filter((function(e){return void 0!==t[e]}));if(e.every((function(r){return t[r]===t[e[0]]}))||1===e.length)return t[e[0]]}},84411:(t,e,r)=>{"use strict";var n=r(12822),i=r(17499).contrast,o=r(86130),a=r(95768),s=r(35677);function l(t,e){function r(r,i){return n.coerce(t,e,o.tickformatstops,r,i)}r("enabled")&&(r("dtickrange"),r("value"))}t.exports=function(t,e,r,c,u){u||(u={});var h=r("labelalias");n.isPlainObject(h)||delete e.labelalias;var d=a(t);if(r("showticklabels")){u.noTicklabelshift||r("ticklabelshift"),u.noTicklabelstandoff||r("ticklabelstandoff");var f=u.font||{},p=e.color,m=-1!==(e.ticklabelposition||"").indexOf("inside")?i(u.bgColor):p&&p!==o.color.dflt?p:f.color;if(n.coerceFont(r,"tickfont",f,{overrideDflt:{color:m}}),u.noTicklabelstep||"multicategory"===c||"log"===c||r("ticklabelstep"),!u.noAng){var g=r("tickangle");u.noAutotickangles||"auto"!==g||r("autotickangles")}if("category"!==c){var v=r("tickformat");s(t,e,{name:"tickformatstops",inclusionAttr:"enabled",handleItemDefaults:l}),e.tickformatstops.length||delete e.tickformatstops,u.noExp||v||"date"===c||(r("showexponent",d),r("exponentformat"),r("minexponent"),r("separatethousands"))}}}},8736:(t,e,r)=>{"use strict";var n=r(12822),i=r(86130);t.exports=function(t,e,r,o){var a=o.isMinor,s=a?t.minor||{}:t,l=a?e.minor:e,c=a?i.minor:i,u=a?"minor.":"",h=n.coerce2(s,l,c,"ticklen",a?.6*(e.ticklen||5):void 0),d=n.coerce2(s,l,c,"tickwidth",a?e.tickwidth||1:void 0),f=n.coerce2(s,l,c,"tickcolor",(a?e.tickcolor:void 0)||l.color);r(u+"ticks",!a&&o.outerTicks||h||d||f?"outside":"")||(delete l.ticklen,delete l.tickwidth,delete l.tickcolor)}},49342:(t,e,r)=>{"use strict";var n=r(84696),i=r(12822).isArrayOrTypedArray,o=r(98507).isTypedArraySpec,a=r(98507).decodeTypedArraySpec;t.exports=function(t,e,r,s,l){l||(l={});var c=l.isMinor,u=c?t.minor||{}:t,h=c?e.minor:e,d=c?"minor.":"";function f(t){var e=u[t];return o(e)&&(e=a(e)),void 0!==e?e:(h._template||{})[t]}var p=f("tick0"),m=f("dtick"),g=f("tickvals"),v=r(d+"tickmode",i(g)?"array":m?"linear":"auto");if("auto"===v||"sync"===v)r(d+"nticks");else if("linear"===v){var b=h.dtick=n.dtick(m,s);h.tick0=n.tick0(p,s,e.calendar,b)}else"multicategory"!==s&&(void 0===r(d+"tickvals")?h.tickmode="auto":c||r("ticktext"))}},88313:(t,e,r)=>{"use strict";var n=r(27941),i=r(25059),o=r(12822),a=r(40666),s=r(75815);t.exports=function(t,e,r,l){var c=t._fullLayout;if(0!==e.length){var u,h,d,f;l&&(u=l());var p=n.ease(r.easing);return t._transitionData._interruptCallbacks.push((function(){return window.cancelAnimationFrame(f),f=null,function(){for(var r={},n=0;nr.duration?(function(){for(var r={},n=0;n rect").call(a.setTranslate,0,0).call(a.setScale,1,1),t.plot.call(a.setTranslate,e._offset,r._offset).call(a.setScale,1,1);var n=t.plot.selectAll(".scatterlayer .trace");n.selectAll(".point").call(a.setPointGroupScale,1,1),n.selectAll(".textpoint").call(a.setTextPointsScale,1,1),n.call(a.hideOutsideRangePoints,t)}function g(e,r){var n=e.plotinfo,i=n.xaxis,l=n.yaxis,c=i._length,u=l._length,h=!!e.xr1,d=!!e.yr1,f=[];if(h){var p=o.simpleMap(e.xr0,i.r2l),m=o.simpleMap(e.xr1,i.r2l),g=p[1]-p[0],v=m[1]-m[0];f[0]=(p[0]*(1-r)+r*m[0]-p[0])/(p[1]-p[0])*c,f[2]=c*(1-r+r*v/g),i.range[0]=i.l2r(p[0]*(1-r)+r*m[0]),i.range[1]=i.l2r(p[1]*(1-r)+r*m[1])}else f[0]=0,f[2]=c;if(d){var b=o.simpleMap(e.yr0,l.r2l),y=o.simpleMap(e.yr1,l.r2l),x=b[1]-b[0],_=y[1]-y[0];f[1]=(b[1]*(1-r)+r*y[1]-b[1])/(b[0]-b[1])*u,f[3]=u*(1-r+r*_/x),l.range[0]=i.l2r(b[0]*(1-r)+r*y[0]),l.range[1]=l.l2r(b[1]*(1-r)+r*y[1])}else f[1]=0,f[3]=u;s.drawOne(t,i,{skipTitle:!0}),s.drawOne(t,l,{skipTitle:!0}),s.redrawComponents(t,[i._id,l._id]);var w=h?c/f[2]:1,k=d?u/f[3]:1,A=h?f[0]:0,M=d?f[1]:0,T=h?f[0]/f[2]*c:0,S=d?f[1]/f[3]*u:0,C=i._offset-T,E=l._offset-S;n.clipRect.call(a.setTranslate,A,M).call(a.setScale,1/w,1/k),n.plot.call(a.setTranslate,C,E).call(a.setScale,w,k),a.setPointGroupScale(n.zoomScalePts,1/w,1/k),a.setTextPointsScale(n.zoomScaleTxt,1/w,1/k)}s.redrawComponents(t)}},25119:(t,e,r)=>{"use strict";var n=r(25059).traceIs,i=r(17821);function o(t){return{v:"x",h:"y"}[t.orientation||"v"]}function a(t,e){var r=o(t),i=n(t,"box-violin"),a=n(t._fullInput||{},"candlestick");return i&&!a&&e===r&&void 0===t[r]&&void 0===t[r+"0"]}t.exports=function(t,e,r,s){r("autotypenumbers",s.autotypenumbersDflt),"-"===r("type",(s.splomStash||{}).type)&&(function(t,e){if("-"===t.type){var r,s=t._id,l=s.charAt(0);-1!==s.indexOf("scene")&&(s=l);var c=function(t,e,r){for(var n=0;n0&&(i["_"+r+"axes"]||{})[e])return i;if((i[r+"axis"]||r)===e){if(a(i,r))return i;if((i[r]||[]).length||i[r+"0"])return i}}}(e,s,l);if(c)if("histogram"!==c.type||l!=={v:"y",h:"x"}[c.orientation||"v"]){var u=l+"calendar",h=c[u],d={noMultiCategory:!n(c,"cartesian")||n(c,"noMultiCategory")};if("box"===c.type&&c._hasPreCompStats&&l==={h:"x",v:"y"}[c.orientation||"v"]&&(d.noMultiCategory=!0),d.autotypenumbers=t.autotypenumbers,a(c,l)){var f=o(c),p=[];for(r=0;r{"use strict";var n=r(25059),i=r(12822);function o(t,e,r){var n,o,a,s=!1;if("data"===e.type)n=t._fullData[null!==e.traces?e.traces[0]:0];else{if("layout"!==e.type)return!1;n=t._fullLayout}return o=i.nestedProperty(n,e.prop).get(),(a=r[e.type]=r[e.type]||{}).hasOwnProperty(e.prop)&&a[e.prop]!==o&&(s=!0),a[e.prop]=o,{changed:s,value:o}}function a(t,e){var r=[],n=e[0],o={};if("string"==typeof n)o[n]=e[1];else{if(!i.isPlainObject(n))return r;o=n}return l(o,(function(t,e,n){r.push({type:"layout",prop:t,value:n})}),"",0),r}function s(t,e){var r,n,o,a,s=[];if(n=e[0],o=e[1],r=e[2],a={},"string"==typeof n)a[n]=o;else{if(!i.isPlainObject(n))return s;a=n,void 0===r&&(r=o)}return void 0===r&&(r=null),l(a,(function(e,n,i){var o,a;if(Array.isArray(i)){a=i.slice();var l=Math.min(a.length,t.data.length);r&&(l=Math.min(l,r.length)),o=[];for(var c=0;c0?".":"")+o;i.isPlainObject(a)?l(a,e,s,n+1):e(s,o,a)}}))}e.manageCommandObserver=function(t,r,n,a){var s={},l=!0;r&&r._commandObserver&&(s=r._commandObserver),s.cache||(s.cache={}),s.lookupTable={};var c=e.hasSimpleAPICommandBindings(t,n,s.lookupTable);if(r&&r._commandObserver){if(c)return s;if(r._commandObserver.remove)return r._commandObserver.remove(),r._commandObserver=null,s}if(c){o(t,c,s.cache),s.check=function(){if(l){var e=o(t,c,s.cache);return e.changed&&a&&void 0!==s.lookupTable[e.value]&&(s.disable(),Promise.resolve(a({value:e.value,type:c.type,prop:c.prop,traces:c.traces,index:s.lookupTable[e.value]})).then(s.enable,s.enable)),e.changed}};for(var u=["plotly_relayout","plotly_redraw","plotly_restyle","plotly_update","plotly_animatingframe","plotly_afterplot"],h=0;h{"use strict";var n=r(98260).extendFlat;e.u=function(t,e){e=e||{};var r={valType:"info_array",editType:(t=t||{}).editType,items:[{valType:"number",min:0,max:1,editType:t.editType},{valType:"number",min:0,max:1,editType:t.editType}],dflt:[0,1]},i=t.name?t.name+" ":"",o=t.trace?"trace ":"subplot ",a=e.description?" "+e.description:"",s={x:n({},r,{description:["Sets the horizontal domain of this ",i,o,"(in plot fraction).",a].join("")}),y:n({},r,{description:["Sets the vertical domain of this ",i,o,"(in plot fraction).",a].join("")}),editType:t.editType};return t.noGridCell||(s.row={valType:"integer",min:0,dflt:0,editType:t.editType,description:["If there is a layout grid, use the domain ","for this row in the grid for this ",i,o,".",a].join("")},s.column={valType:"integer",min:0,dflt:0,editType:t.editType,description:["If there is a layout grid, use the domain ","for this column in the grid for this ",i,o,".",a].join("")}),s},e.N=function(t,e,r,n){var i=n&&n.x||[0,1],o=n&&n.y||[0,1],a=e.grid;if(a){var s=r("domain.column");void 0!==s&&(s{"use strict";t.exports=function(t){var e=t.variantValues,r=t.editType,n=t.colorEditType;void 0===n&&(n=r);var i={editType:r,valType:"integer",min:1,max:1e3,extras:["normal","bold"],dflt:"normal",description:["Sets the weight (or boldness) of the font."].join(" ")};t.noNumericWeightValues&&(i.valType="enumerated",i.values=i.extras,i.extras=void 0,i.min=void 0,i.max=void 0);var o={family:{valType:"string",noBlank:!0,strict:!0,editType:r,description:["HTML font family - the typeface that will be applied by the web browser.","The web browser will only be able to apply a font if it is available on the system","which it operates. Provide multiple font families, separated by commas, to indicate","the preference in which to apply fonts if they aren't available on the system.","The Chart Studio Cloud (at https://chart-studio.plotly.com or on-premise) generates images on a server,","where only a select number of","fonts are installed and supported.","These include *Arial*, *Balto*, *Courier New*, *Droid Sans*, *Droid Serif*,","*Droid Sans Mono*, *Gravitas One*, *Old Standard TT*, *Open Sans*, *Overpass*,","*PT Sans Narrow*, *Raleway*, *Times New Roman*."].join(" ")},size:{valType:"number",min:1,editType:r},color:{valType:"color",editType:n},weight:i,style:{editType:r,valType:"enumerated",values:["normal","italic"],dflt:"normal",description:["Sets whether a font should be styled with a normal or italic face from its family."].join(" ")},variant:t.noFontVariant?void 0:{editType:r,valType:"enumerated",values:e||["normal","small-caps","all-small-caps","all-petite-caps","petite-caps","unicase"],dflt:"normal",description:["Sets the variant of the font."].join(" ")},textcase:t.noFontTextcase?void 0:{editType:r,valType:"enumerated",values:["normal","word caps","upper","lower"],dflt:"normal",description:["Sets capitalization of text.","It can be used to make text appear in all-uppercase or all-lowercase,","or with each word capitalized."].join(" ")},lineposition:t.noFontLineposition?void 0:{editType:r,valType:"flaglist",flags:["under","over","through"],extras:["none"],dflt:"none",description:["Sets the kind of decoration line(s) with text,","such as an *under*, *over* or *through*","as well as combinations e.g. *under+over*, etc."].join(" ")},shadow:t.noFontShadow?void 0:{editType:r,valType:"string",dflt:t.autoShadowDflt?"auto":"none",description:["Sets the shape and color of the shadow behind text.","*auto* places minimal shadow and applies contrast text font color.","See https://developer.mozilla.org/en-US/docs/Web/CSS/text-shadow for additional options."].join(" ")},editType:r,description:""+(t.description||"")};return t.autoSize&&(o.size.dflt="auto"),t.autoColor&&(o.color.dflt="auto"),t.arrayOk&&(o.family.arrayOk=!0,o.weight.arrayOk=!0,o.style.arrayOk=!0,t.noFontVariant||(o.variant.arrayOk=!0),t.noFontTextcase||(o.textcase.arrayOk=!0),t.noFontLineposition||(o.lineposition.arrayOk=!0),t.noFontShadow||(o.shadow.arrayOk=!0),o.size.arrayOk=!0,o.color.arrayOk=!0),o}},53874:t=>{"use strict";t.exports={_isLinkedToArray:"frames_entry",group:{valType:"string",description:["An identifier that specifies the group to which the frame belongs,","used by animate to select a subset of frames."].join(" ")},name:{valType:"string",description:"A label by which to identify the frame"},traces:{valType:"any",description:["A list of trace indices that identify the respective traces in the","data attribute"].join(" ")},baseframe:{valType:"string",description:["The name of the frame into which this frame's properties are merged","before applying. This is used to unify properties and avoid needing","to specify the same values for the same properties in multiple frames."].join(" ")},data:{valType:"any",description:["A list of traces this frame modifies. The format is identical to the","normal trace definition."].join(" ")},layout:{valType:"any",description:["Layout properties which this frame modifies. The format is identical","to the normal layout definition."].join(" ")}}},47388:(t,e,r)=>{"use strict";var n=r(25059),i=r(21197).SUBPLOT_PATTERN;e.eV=function(t,e,r){var i,o=[],a=[];if(!(i="string"==typeof e?n.getModule(e).plot:"function"==typeof e?e:e.plot))return[o,t];for(var s=r,l=0;l{"use strict";var n=r(62309).overrideAll,i=r(53572),o=r(85833),a=r(47388).KO,s=r(12822),l=r(25853),c="gl3d",u="scene";e.name=c,e.attr=u,e.idRoot=u,e.idRegex=e.attrRegex=s.counterRegex("scene"),e.attributes=r(816),e.layoutAttributes=r(41019),e.baseLayoutAttrOverrides=n({hoverlabel:i.hoverlabel},"plot","nested"),e.supplyLayoutDefaults=r(13351),e.plot=function(t){for(var e=t._fullLayout,r=t._fullData,n=e._subplots[c],i=0;i{"use strict";t.exports={scene:{valType:"subplotid",dflt:"scene",editType:"calc+clearAxisTypes",description:["Sets a reference between this trace's 3D coordinate system and","a 3D scene.","If *scene* (the default value), the (x,y,z) coordinates refer to","`layout.scene`.","If *scene2*, the (x,y,z) coordinates refer to `layout.scene2`,","and so on."].join(" ")}}},82854:(t,e,r)=>{"use strict";var n=r(17499),i=r(86130),o=r(98260).extendFlat,a=r(62309).overrideAll;t.exports=a({visible:i.visible,showspikes:{valType:"boolean",dflt:!0,description:["Sets whether or not spikes starting from","data points to this axis' wall are shown on hover."].join(" ")},spikesides:{valType:"boolean",dflt:!0,description:["Sets whether or not spikes extending from the","projection data points to this axis' wall boundaries","are shown on hover."].join(" ")},spikethickness:{valType:"number",min:0,dflt:2,description:"Sets the thickness (in px) of the spikes."},spikecolor:{valType:"color",dflt:n.defaultLine,description:"Sets the color of the spikes."},showbackground:{valType:"boolean",dflt:!1,description:["Sets whether or not this axis' wall","has a background color."].join(" ")},backgroundcolor:{valType:"color",dflt:"rgba(204, 204, 204, 0.5)",description:"Sets the background color of this axis' wall."},showaxeslabels:{valType:"boolean",dflt:!0,description:"Sets whether or not this axis is labeled"},color:i.color,categoryorder:i.categoryorder,categoryarray:i.categoryarray,title:{text:i.title.text,font:i.title.font},type:o({},i.type,{values:["-","linear","log","date","category"]}),autotypenumbers:i.autotypenumbers,autorange:i.autorange,autorangeoptions:{minallowed:i.autorangeoptions.minallowed,maxallowed:i.autorangeoptions.maxallowed,clipmin:i.autorangeoptions.clipmin,clipmax:i.autorangeoptions.clipmax,include:i.autorangeoptions.include,editType:"plot"},rangemode:i.rangemode,minallowed:i.minallowed,maxallowed:i.maxallowed,range:o({},i.range,{items:[{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1}},{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1}}],anim:!1}),tickmode:i.minor.tickmode,nticks:i.nticks,tick0:i.tick0,dtick:i.dtick,tickvals:i.tickvals,ticktext:i.ticktext,ticks:i.ticks,mirror:i.mirror,ticklen:i.ticklen,tickwidth:i.tickwidth,tickcolor:i.tickcolor,showticklabels:i.showticklabels,labelalias:i.labelalias,tickfont:i.tickfont,tickangle:i.tickangle,tickprefix:i.tickprefix,showtickprefix:i.showtickprefix,ticksuffix:i.ticksuffix,showticksuffix:i.showticksuffix,showexponent:i.showexponent,exponentformat:i.exponentformat,minexponent:i.minexponent,separatethousands:i.separatethousands,tickformat:i.tickformat,tickformatstops:i.tickformatstops,hoverformat:i.hoverformat,showline:i.showline,linecolor:i.linecolor,linewidth:i.linewidth,showgrid:i.showgrid,gridcolor:o({},i.gridcolor,{dflt:"rgb(204, 204, 204)"}),gridwidth:i.gridwidth,zeroline:i.zeroline,zerolinecolor:i.zerolinecolor,zerolinewidth:i.zerolinewidth,_deprecated:{title:i._deprecated.title,titlefont:i._deprecated.titlefont}},"plot","from-root")},20049:(t,e,r)=>{"use strict";var n=r(18106).mix,i=r(12822),o=r(46121),a=r(82854),s=r(25119),l=r(91200),c=["xaxis","yaxis","zaxis"],u=13600/187;t.exports=function(t,e,r){var h,d;function f(t,e){return i.coerce(h,d,a,t,e)}for(var p=0;p{"use strict";var n=r(17235),i=r(12822),o=["xaxis","yaxis","zaxis"];function a(){this.bounds=[[-10,-10,-10],[10,10,10]],this.ticks=[[],[],[]],this.tickEnable=[!0,!0,!0],this.tickFont=["sans-serif","sans-serif","sans-serif"],this.tickSize=[12,12,12],this.tickFontWeight=["normal","normal","normal","normal"],this.tickFontStyle=["normal","normal","normal","normal"],this.tickFontVariant=["normal","normal","normal","normal"],this.tickAngle=[0,0,0],this.tickColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.tickPad=[18,18,18],this.labels=["x","y","z"],this.labelEnable=[!0,!0,!0],this.labelFont=["Open Sans","Open Sans","Open Sans"],this.labelSize=[20,20,20],this.labelFontWeight=["normal","normal","normal","normal"],this.labelFontStyle=["normal","normal","normal","normal"],this.labelFontVariant=["normal","normal","normal","normal"],this.labelColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.labelPad=[30,30,30],this.lineEnable=[!0,!0,!0],this.lineMirror=[!1,!1,!1],this.lineWidth=[1,1,1],this.lineColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.lineTickEnable=[!0,!0,!0],this.lineTickMirror=[!1,!1,!1],this.lineTickLength=[10,10,10],this.lineTickWidth=[1,1,1],this.lineTickColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.gridEnable=[!0,!0,!0],this.gridWidth=[1,1,1],this.gridColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.zeroEnable=[!0,!0,!0],this.zeroLineColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.zeroLineWidth=[2,2,2],this.backgroundEnable=[!0,!0,!0],this.backgroundColor=[[.8,.8,.8,.5],[.8,.8,.8,.5],[.8,.8,.8,.5]],this._defaultTickPad=this.tickPad.slice(),this._defaultLabelPad=this.labelPad.slice(),this._defaultLineTickLength=this.lineTickLength.slice()}a.prototype.merge=function(t,e){for(var r=this,a=0;a<3;++a){var s=e[o[a]];s.visible?(r.labels[a]=t._meta?i.templateString(s.title.text,t._meta):s.title.text,"font"in s.title&&(s.title.font.color&&(r.labelColor[a]=n(s.title.font.color)),s.title.font.family&&(r.labelFont[a]=s.title.font.family),s.title.font.size&&(r.labelSize[a]=s.title.font.size),s.title.font.weight&&(r.labelFontWeight[a]=s.title.font.weight),s.title.font.style&&(r.labelFontStyle[a]=s.title.font.style),s.title.font.variant&&(r.labelFontVariant[a]=s.title.font.variant)),"showline"in s&&(r.lineEnable[a]=s.showline),"linecolor"in s&&(r.lineColor[a]=n(s.linecolor)),"linewidth"in s&&(r.lineWidth[a]=s.linewidth),"showgrid"in s&&(r.gridEnable[a]=s.showgrid),"gridcolor"in s&&(r.gridColor[a]=n(s.gridcolor)),"gridwidth"in s&&(r.gridWidth[a]=s.gridwidth),"log"===s.type?r.zeroEnable[a]=!1:"zeroline"in s&&(r.zeroEnable[a]=s.zeroline),"zerolinecolor"in s&&(r.zeroLineColor[a]=n(s.zerolinecolor)),"zerolinewidth"in s&&(r.zeroLineWidth[a]=s.zerolinewidth),"ticks"in s&&s.ticks?r.lineTickEnable[a]=!0:r.lineTickEnable[a]=!1,"ticklen"in s&&(r.lineTickLength[a]=r._defaultLineTickLength[a]=s.ticklen),"tickcolor"in s&&(r.lineTickColor[a]=n(s.tickcolor)),"tickwidth"in s&&(r.lineTickWidth[a]=s.tickwidth),"tickangle"in s&&(r.tickAngle[a]="auto"===s.tickangle?-3600:Math.PI*-s.tickangle/180),"showticklabels"in s&&(r.tickEnable[a]=s.showticklabels),"tickfont"in s&&(s.tickfont.color&&(r.tickColor[a]=n(s.tickfont.color)),s.tickfont.family&&(r.tickFont[a]=s.tickfont.family),s.tickfont.size&&(r.tickSize[a]=s.tickfont.size),s.tickfont.weight&&(r.tickFontWeight[a]=s.tickfont.weight),s.tickfont.style&&(r.tickFontStyle[a]=s.tickfont.style),s.tickfont.variant&&(r.tickFontVariant[a]=s.tickfont.variant)),"mirror"in s?-1!==["ticks","all","allticks"].indexOf(s.mirror)?(r.lineTickMirror[a]=!0,r.lineMirror[a]=!0):!0===s.mirror?(r.lineTickMirror[a]=!1,r.lineMirror[a]=!0):(r.lineTickMirror[a]=!1,r.lineMirror[a]=!1):r.lineMirror[a]=!1,"showbackground"in s&&!1!==s.showbackground?(r.backgroundEnable[a]=!0,r.backgroundColor[a]=n(s.backgroundcolor)):r.backgroundEnable[a]=!1):(r.tickEnable[a]=!1,r.labelEnable[a]=!1,r.lineEnable[a]=!1,r.lineTickEnable[a]=!1,r.gridEnable[a]=!1,r.zeroEnable[a]=!1,r.backgroundEnable[a]=!1)}},t.exports=function(t,e){var r=new a;return r.merge(t,e),r}},13351:(t,e,r)=>{"use strict";var n=r(12822),i=r(17499),o=r(25059),a=r(84313),s=r(20049),l=r(41019),c=r(47388).KO,u="gl3d";function h(t,e,r,n){for(var a=r("bgcolor"),l=i.combine(a,n.paper_bgcolor),h=["up","center","eye"],d=0;d.999&&(g="turntable"):g="turntable")}else g="turntable";r("dragmode",g),r("hovermode",n.getDfltFromLayout("hovermode"))}t.exports=function(t,e,r){var i=e._basePlotModules.length>1;a(t,e,r,{type:u,attributes:l,handleDefaults:h,fullLayout:e,font:e.font,fullData:r,getDfltFromLayout:function(e){if(!i)return n.validate(t[e],l[e])?t[e]:void 0},autotypenumbersDflt:e.autotypenumbers,paper_bgcolor:e.paper_bgcolor,calendar:e.calendar})}},41019:(t,e,r)=>{"use strict";var n=r(82854),i=r(40365).u,o=r(98260).extendFlat,a=r(12822).counterRegex;function s(t,e,r){return{x:{valType:"number",dflt:t,editType:"camera"},y:{valType:"number",dflt:e,editType:"camera"},z:{valType:"number",dflt:r,editType:"camera"},editType:"camera"}}t.exports={_arrayAttrRegexps:[a("scene",".annotations",!0)],bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"plot"},camera:{up:o(s(0,0,1),{description:["Sets the (x,y,z) components of the 'up' camera vector.","This vector determines the up direction of this scene","with respect to the page.","The default is *{x: 0, y: 0, z: 1}* which means that","the z axis points up."].join(" ")}),center:o(s(0,0,0),{description:["Sets the (x,y,z) components of the 'center' camera vector","This vector determines the translation (x,y,z) space","about the center of this scene.","By default, there is no such translation."].join(" ")}),eye:o(s(1.25,1.25,1.25),{description:["Sets the (x,y,z) components of the 'eye' camera vector.","This vector determines the view point about the origin","of this scene."].join(" ")}),projection:{type:{valType:"enumerated",values:["perspective","orthographic"],dflt:"perspective",editType:"calc",description:["Sets the projection type. The projection type could be","either *perspective* or *orthographic*. The default is","*perspective*."].join(" ")},editType:"calc"},editType:"camera"},domain:i({name:"scene",editType:"plot"}),aspectmode:{valType:"enumerated",values:["auto","cube","data","manual"],dflt:"auto",editType:"plot",impliedEdits:{"aspectratio.x":void 0,"aspectratio.y":void 0,"aspectratio.z":void 0},description:["If *cube*, this scene's axes are drawn as a cube,","regardless of the axes' ranges.","If *data*, this scene's axes are drawn","in proportion with the axes' ranges.","If *manual*, this scene's axes are drawn","in proportion with the input of *aspectratio*","(the default behavior if *aspectratio* is provided).","If *auto*, this scene's axes are drawn","using the results of *data* except when one axis","is more than four times the size of the two others,","where in that case the results of *cube* are used."].join(" ")},aspectratio:{x:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},y:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},z:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},editType:"plot",impliedEdits:{aspectmode:"manual"},description:["Sets this scene's axis aspectratio."].join(" ")},xaxis:n,yaxis:n,zaxis:n,dragmode:{valType:"enumerated",values:["orbit","turntable","zoom","pan",!1],editType:"plot",description:["Determines the mode of drag interactions for this scene."].join(" ")},hovermode:{valType:"enumerated",values:["closest",!1],dflt:"closest",editType:"modebar",description:["Determines the mode of hover interactions for this scene."].join(" ")},uirevision:{valType:"any",editType:"none",description:["Controls persistence of user-driven changes in camera attributes.","Defaults to `layout.uirevision`."].join(" ")},editType:"plot",_deprecated:{cameraposition:{valType:"info_array",editType:"camera",description:"Obsolete. Use `camera` instead."}}}},63306:(t,e,r)=>{"use strict";var n=r(17235),i=["xaxis","yaxis","zaxis"];function o(){this.enabled=[!0,!0,!0],this.colors=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.drawSides=[!0,!0,!0],this.lineWidth=[1,1,1]}o.prototype.merge=function(t){for(var e=0;e<3;++e){var r=t[i[e]];r.visible?(this.enabled[e]=r.showspikes,this.colors[e]=n(r.spikecolor),this.drawSides[e]=r.spikesides,this.lineWidth[e]=r.spikethickness):(this.enabled[e]=!1,this.drawSides[e]=!1)}},t.exports=function(t){var e=new o;return e.merge(t),e}},1285:(t,e,r)=>{"use strict";t.exports=function(t){for(var e=t.axesOptions,r=t.glplot.axesPixels,s=t.fullSceneLayout,l=[[],[],[]],c=0;c<3;++c){var u=s[o[c]];if(u._length=(r[c].hi-r[c].lo)*r[c].pixelsPerDataUnit/t.dataScale[c],Math.abs(u._length)===1/0||isNaN(u._length))l[c]=[];else{u._input_range=u.range.slice(),u.range[0]=r[c].lo/t.dataScale[c],u.range[1]=r[c].hi/t.dataScale[c],u._m=1/(t.dataScale[c]*r[c].pixelsPerDataUnit),u.range[0]===u.range[1]&&(u.range[0]-=1,u.range[1]+=1);var h=u.tickmode;if("auto"===u.tickmode){u.tickmode="linear";var d=u.nticks||i.constrain(u._length/40,4,9);n.autoTicks(u,Math.abs(u.range[1]-u.range[0])/d)}for(var f=n.calcTicks(u,{msUTC:!0}),p=0;p/g," "));l[c]=f,u.tickmode=h}}for(e.ticks=l,c=0;c<3;++c)for(a[c]=.5*(t.glplot.bounds[0][c]+t.glplot.bounds[1][c]),p=0;p<2;++p)e.bounds[p][c]=t.glplot.bounds[p][c];t.contourLevels=function(t){for(var e=new Array(3),r=0;r<3;++r){for(var n=t[r],i=new Array(n.length),o=0;o{"use strict";function e(t,e){var r,n,i=[0,0,0,0];for(r=0;r<4;++r)for(n=0;n<4;++n)i[n]+=t[4*r+n]*e[r];return i}t.exports=function(t,r){return e(t.projection,e(t.view,e(t.model,[r[0],r[1],r[2],1])))}},85833:(t,e,r)=>{"use strict";var n,i,o=r(31845).gl_plot3d,a=o.createCamera,s=o.createScene,l=r(62945),c=r(17520),u=r(25059),h=r(12822),d=h.preserveDrawingBuffer(),f=r(75815),p=r(70410),m=r(17235),g=r(91203),v=r(40747),b=r(82678),y=r(63306),x=r(1285),_=r(19496).applyAutorangeOptions,w=!1;function k(t,e){var r=document.createElement("div"),n=t.container;this.graphDiv=t.graphDiv;var i=document.createElementNS("http://www.w3.org/2000/svg","svg");i.style.position="absolute",i.style.top=i.style.left="0px",i.style.width=i.style.height="100%",i.style["z-index"]=20,i.style["pointer-events"]="none",r.appendChild(i),this.svgContainer=i,r.id=t.id,r.style.position="absolute",r.style.top=r.style.left="0px",r.style.width=r.style.height="100%",n.appendChild(r),this.fullLayout=e,this.id=t.id||"scene",this.fullSceneLayout=e[this.id],this.plotArgs=[[],{},{}],this.axesOptions=b(e,e[this.id]),this.spikeOptions=y(e[this.id]),this.container=r,this.staticMode=!!t.staticPlot,this.pixelRatio=this.pixelRatio||t.plotGlPixelRatio||2,this.dataScale=[1,1,1],this.contourLevels=[[],[],[]],this.convertAnnotations=u.getComponentMethod("annotations3d","convert"),this.drawAnnotations=u.getComponentMethod("annotations3d","draw"),this.initializeGLPlot()}var A=k.prototype;A.prepareOptions=function(){var t=this,e={canvas:t.canvas,gl:t.gl,glOptions:{preserveDrawingBuffer:d,premultipliedAlpha:!0,antialias:!0},container:t.container,axes:t.axesOptions,spikes:t.spikeOptions,pickRadius:10,snapToData:!0,autoScale:!0,autoBounds:!1,cameraObject:t.camera,pixelRatio:t.pixelRatio};if(t.staticMode){if(!(i||(n=document.createElement("canvas"),i=l({canvas:n,preserveDrawingBuffer:!0,premultipliedAlpha:!0,antialias:!0}))))throw new Error("error creating static canvas/context for image server");e.gl=i,e.canvas=n}return e};var M=!0;A.tryCreatePlot=function(){var t=this,e=t.prepareOptions(),r=!0;try{t.glplot=s(e)}catch(n){if(t.staticMode||!M||d)r=!1;else{h.warn(["webgl setup failed possibly due to","false preserveDrawingBuffer config.","The mobile/tablet device may not be detected by is-mobile module.","Enabling preserveDrawingBuffer in second attempt to create webgl scene..."].join(" "));try{d=e.glOptions.preserveDrawingBuffer=!0,t.glplot=s(e)}catch(t){d=e.glOptions.preserveDrawingBuffer=!1,r=!1}}}return M=!1,r},A.initializeGLCamera=function(){var t=this,e=t.fullSceneLayout.camera,r="orthographic"===e.projection.type;t.camera=a(t.container,{center:[e.center.x,e.center.y,e.center.z],eye:[e.eye.x,e.eye.y,e.eye.z],up:[e.up.x,e.up.y,e.up.z],_ortho:r,zoomMin:.01,zoomMax:100,mode:"orbit"})},A.initializeGLPlot=function(){var t=this;if(t.initializeGLCamera(),!t.tryCreatePlot())return g(t);t.traces={},t.make4thDimension();var e=t.graphDiv,r=e.layout,n=function(){var e={};return t.isCameraChanged(r)&&(e[t.id+".camera"]=t.getCamera()),t.isAspectChanged(r)&&(e[t.id+".aspectratio"]=t.glplot.getAspectratio(),"manual"!==r[t.id].aspectmode&&(t.fullSceneLayout.aspectmode=r[t.id].aspectmode=e[t.id+".aspectmode"]="manual")),e},i=function(t){if(!1!==t.fullSceneLayout.dragmode){var e=n();t.saveLayout(r),t.graphDiv.emit("plotly_relayout",e)}};return t.glplot.canvas&&(t.glplot.canvas.addEventListener("mouseup",(function(){i(t)})),t.glplot.canvas.addEventListener("touchstart",(function(){w=!0})),t.glplot.canvas.addEventListener("wheel",(function(r){if(e._context._scrollZoom.gl3d){if(t.camera._ortho){var n=r.deltaX>r.deltaY?1.1:1/1.1,o=t.glplot.getAspectratio();t.glplot.setAspectratio({x:n*o.x,y:n*o.y,z:n*o.z})}i(t)}}),!!c&&{passive:!1}),t.glplot.canvas.addEventListener("mousemove",(function(){if(!1!==t.fullSceneLayout.dragmode&&0!==t.camera.mouseListener.buttons){var e=n();t.graphDiv.emit("plotly_relayouting",e)}})),t.staticMode||t.glplot.canvas.addEventListener("webglcontextlost",(function(r){e&&e.emit&&e.emit("plotly_webglcontextlost",{event:r,layer:t.id})}),!1)),t.glplot.oncontextloss=function(){t.recoverContext()},t.glplot.onrender=function(){t.render()},!0},A.render=function(){var t,e=this,r=e.graphDiv,n=e.svgContainer,i=e.container.getBoundingClientRect();r._fullLayout._calcInverseTransform(r);var o=r._fullLayout._invScaleX,a=r._fullLayout._invScaleY,s=i.width*o,l=i.height*a;n.setAttributeNS(null,"viewBox","0 0 "+s+" "+l),n.setAttributeNS(null,"width",s),n.setAttributeNS(null,"height",l),x(e),e.glplot.axes.update(e.axesOptions);for(var c=Object.keys(e.traces),u=null,d=e.glplot.selection,m=0;m")):"isosurface"===t.type||"volume"===t.type?(A.valueLabel=f.hoverLabelText(e._mockAxis,e._mockAxis.d2l(d.traceCoordinate[3]),t.valuehoverformat),C.push("value: "+A.valueLabel),d.textLabel&&C.push(d.textLabel),y=C.join("
")):y=d.textLabel;var E={x:d.traceCoordinate[0],y:d.traceCoordinate[1],z:d.traceCoordinate[2],data:_._input,fullData:_,curveNumber:_.index,pointNumber:k};p.appendArrayPointValue(E,_,k),t._module.eventData&&(E=_._module.eventData(E,d,_,{},k));var L={points:[E]};if(e.fullSceneLayout.hovermode){var z=[];p.loneHover({trace:_,x:(.5+.5*b[0]/b[3])*s,y:(.5-.5*b[1]/b[3])*l,xLabel:A.xLabel,yLabel:A.yLabel,zLabel:A.zLabel,text:y,name:u.name,color:p.castHoverOption(_,k,"bgcolor")||u.color,borderColor:p.castHoverOption(_,k,"bordercolor"),fontFamily:p.castHoverOption(_,k,"font.family"),fontSize:p.castHoverOption(_,k,"font.size"),fontColor:p.castHoverOption(_,k,"font.color"),nameLength:p.castHoverOption(_,k,"namelength"),textAlign:p.castHoverOption(_,k,"align"),hovertemplate:h.castOption(_,k,"hovertemplate"),hovertemplateLabels:h.extendFlat({},E,A),eventData:[E]},{container:n,gd:r,inOut_bbox:z}),E.bbox=z[0]}d.distance<5&&(d.buttons||w)?r.emit("plotly_click",L):r.emit("plotly_hover",L),this.oldEventData=L}else p.loneUnhover(n),this.oldEventData&&r.emit("plotly_unhover",this.oldEventData),this.oldEventData=void 0;e.drawAnnotations(e)},A.recoverContext=function(){var t=this;t.glplot.dispose();var e=function(){t.glplot.gl.isContextLost()?requestAnimationFrame(e):t.initializeGLPlot()?t.plot.apply(t,t.plotArgs):h.error("Catastrophic and unrecoverable WebGL error. Context lost.")};requestAnimationFrame(e)};var T=["xaxis","yaxis","zaxis"];function S(t,e,r){for(var n=t.fullSceneLayout,i=0;i<3;i++){var o=T[i],a=o.charAt(0),s=n[o],l=e[a],c=e[a+"calendar"],u=e["_"+a+"length"];if(h.isArrayOrTypedArray(l))for(var d,f=0;f<(u||l.length);f++)if(h.isArrayOrTypedArray(l[f]))for(var p=0;pv[1][a])v[0][a]=-1,v[1][a]=1;else{var O=v[1][a]-v[0][a];v[0][a]-=O/32,v[1][a]+=O/32}if(x=[v[0][a],v[1][a]],x=_(x,l),v[0][a]=x[0],v[1][a]=x[1],l.isReversed()){var D=v[0][a];v[0][a]=v[1][a],v[1][a]=D}}else x=l.range,v[0][a]=l.r2l(x[0]),v[1][a]=l.r2l(x[1]);v[0][a]===v[1][a]&&(v[0][a]-=1,v[1][a]+=1),b[a]=v[1][a]-v[0][a],l.range=[v[0][a],v[1][a]],l.limitRange(),n.glplot.setBounds(a,{min:l.range[0]*f[a],max:l.range[1]*f[a]})}var I=u.aspectmode;if("cube"===I)g=[1,1,1];else if("manual"===I){var F=u.aspectratio;g=[F.x,F.y,F.z]}else{if("auto"!==I&&"data"!==I)throw new Error("scene.js aspectRatio was not one of the enumerated types");var R=[1,1,1];for(a=0;a<3;++a){var P=y[c=(l=u[T[a]]).type];R[a]=Math.pow(P.acc,1/P.count)/f[a]}g="data"===I||Math.max.apply(null,R)/Math.min.apply(null,R)<=4?R:[1,1,1]}u.aspectratio.x=h.aspectratio.x=g[0],u.aspectratio.y=h.aspectratio.y=g[1],u.aspectratio.z=h.aspectratio.z=g[2],n.glplot.setAspectratio(u.aspectratio),n.viewInitial.aspectratio||(n.viewInitial.aspectratio={x:u.aspectratio.x,y:u.aspectratio.y,z:u.aspectratio.z}),n.viewInitial.aspectmode||(n.viewInitial.aspectmode=u.aspectmode);var j=u.domain||null,N=e._size||null;if(j&&N){var B=n.container.style;B.position="absolute",B.left=N.l+j.x[0]*N.w+"px",B.top=N.t+(1-j.y[1])*N.h+"px",B.width=N.w*(j.x[1]-j.x[0])+"px",B.height=N.h*(j.y[1]-j.y[0])+"px"}n.glplot.redraw()}},A.destroy=function(){var t=this;t.glplot&&(t.camera.mouseListener.enabled=!1,t.container.removeEventListener("wheel",t.camera.wheelListener),t.camera=null,t.glplot.dispose(),t.container.parentNode.removeChild(t.container),t.glplot=null)},A.getCamera=function(){var t,e=this;return e.camera.view.recalcMatrix(e.camera.view.lastT()),{up:{x:(t=e.camera).up[0],y:t.up[1],z:t.up[2]},center:{x:t.center[0],y:t.center[1],z:t.center[2]},eye:{x:t.eye[0],y:t.eye[1],z:t.eye[2]},projection:{type:!0===t._ortho?"orthographic":"perspective"}}},A.setViewport=function(t){var e,r=this,n=t.camera;r.camera.lookAt.apply(this,[[(e=n).eye.x,e.eye.y,e.eye.z],[e.center.x,e.center.y,e.center.z],[e.up.x,e.up.y,e.up.z]]),r.glplot.setAspectratio(t.aspectratio),"orthographic"===n.projection.type!==r.camera._ortho&&(r.glplot.redraw(),r.glplot.clearRGBA(),r.glplot.dispose(),r.initializeGLPlot())},A.isCameraChanged=function(t){var e=this.getCamera(),r=h.nestedProperty(t,this.id+".camera").get();function n(t,e,r,n){var i=["up","center","eye"],o=["x","y","z"];return e[i[r]]&&t[i[r]][o[n]]===e[i[r]][o[n]]}var i=!1;if(void 0===r)i=!0;else{for(var o=0;o<3;o++)for(var a=0;a<3;a++)if(!n(e,r,o,a)){i=!0;break}(!r.projection||e.projection&&e.projection.type!==r.projection.type)&&(i=!0)}return i},A.isAspectChanged=function(t){var e=this.glplot.getAspectratio(),r=h.nestedProperty(t,this.id+".aspectratio").get();return void 0===r||r.x!==e.x||r.y!==e.y||r.z!==e.z},A.saveLayout=function(t){var e,r,n,i,o,a,s=this,l=s.fullLayout,c=s.isCameraChanged(t),d=s.isAspectChanged(t),f=c||d;if(f){var p={};c&&(e=s.getCamera(),n=(r=h.nestedProperty(t,s.id+".camera")).get(),p[s.id+".camera"]=n),d&&(i=s.glplot.getAspectratio(),a=(o=h.nestedProperty(t,s.id+".aspectratio")).get(),p[s.id+".aspectratio"]=a),u.call("_storeDirectGUIEdit",t,l._preGUI,p),c&&(r.set(e),h.nestedProperty(l,s.id+".camera").set(e)),d&&(o.set(i),h.nestedProperty(l,s.id+".aspectratio").set(i),s.glplot.redraw())}return f},A.updateFx=function(t,e){var r=this,n=r.camera;if(n)if("orbit"===t)n.mode="orbit",n.keyBindingMode="rotate";else if("turntable"===t){n.up=[0,0,1],n.mode="turntable",n.keyBindingMode="rotate";var i=r.graphDiv,o=i._fullLayout,a=r.fullSceneLayout.camera,s=a.up.x,l=a.up.y,c=a.up.z;if(c/Math.sqrt(s*s+l*l+c*c)<.999){var d=r.id+".camera.up",f={x:0,y:0,z:1},p={};p[d]=f;var m=i.layout;u.call("_storeDirectGUIEdit",m,o._preGUI,p),a.up=f,h.nestedProperty(m,d).set(f)}}else n.keyBindingMode=t;r.fullSceneLayout.hovermode=e},A.toImage=function(t){var e=this;t||(t="png"),e.staticMode&&e.container.appendChild(n),e.glplot.redraw();var r=e.glplot.gl,i=r.drawingBufferWidth,o=r.drawingBufferHeight;r.bindFramebuffer(r.FRAMEBUFFER,null);var a=new Uint8Array(i*o*4);r.readPixels(0,0,i,o,r.RGBA,r.UNSIGNED_BYTE,a),function(t,e,r){for(var n=0,i=r-1;n0)for(var s=255/a,l=0;l<3;++l)t[o+l]=Math.min(s*t[o+l],255)}}(a,i,o);var s=document.createElement("canvas");s.width=i,s.height=o;var l,c=s.getContext("2d",{willReadFrequently:!0}),u=c.createImageData(i,o);switch(u.data.set(a),c.putImageData(u,0,0),t){case"jpeg":l=s.toDataURL("image/jpeg");break;case"webp":l=s.toDataURL("image/webp");break;default:l=s.toDataURL("image/png")}return e.staticMode&&e.container.removeChild(n),l},A.setConvert=function(){for(var t=0;t<3;t++){var e=this.fullSceneLayout[T[t]];f.setConvert(e,this.fullLayout),e.setScale=h.noop}},A.make4thDimension=function(){var t=this,e=t.graphDiv._fullLayout;t._mockAxis={type:"linear",showexponent:"all",exponentformat:"B"},f.setConvert(t._mockAxis,e)},t.exports=k},13195:(t,e,r)=>{"use strict";var n=r(75058),i=r(46367),o=r(84226),a=r(18360),s=r(21422),l=r(85538),c=r(98260).extendFlat,u=n({editType:"calc",description:["Sets the global font.","Note that fonts used in traces and other","layout components inherit from the global font."].join(" ")});u.family.dflt='"Open Sans", verdana, arial, sans-serif',u.size.dflt=12,u.color.dflt=o.defaultLine,t.exports={font:u,title:{text:{valType:"string",editType:"layoutstyle",description:["Sets the plot's title.","Note that before the existence of `title.text`, the title's","contents used to be defined as the `title` attribute itself.","This behavior has been deprecated."].join(" ")},font:n({editType:"layoutstyle",description:["Sets the title font.","Note that the title's font used to be customized","by the now deprecated `titlefont` attribute."].join(" ")}),subtitle:{text:{valType:"string",editType:"layoutstyle",description:"Sets the plot's subtitle."},font:n({editType:"layoutstyle",description:"Sets the subtitle font."}),editType:"layoutstyle"},xref:{valType:"enumerated",dflt:"container",values:["container","paper"],editType:"layoutstyle",description:["Sets the container `x` refers to.","*container* spans the entire `width` of the plot.","*paper* refers to the width of the plotting area only."].join(" ")},yref:{valType:"enumerated",dflt:"container",values:["container","paper"],editType:"layoutstyle",description:["Sets the container `y` refers to.","*container* spans the entire `height` of the plot.","*paper* refers to the height of the plotting area only."].join(" ")},x:{valType:"number",min:0,max:1,dflt:.5,editType:"layoutstyle",description:["Sets the x position with respect to `xref` in normalized","coordinates from *0* (left) to *1* (right)."].join(" ")},y:{valType:"number",min:0,max:1,dflt:"auto",editType:"layoutstyle",description:["Sets the y position with respect to `yref` in normalized","coordinates from *0* (bottom) to *1* (top).","*auto* places the baseline of the title onto the","vertical center of the top margin."].join(" ")},xanchor:{valType:"enumerated",dflt:"auto",values:["auto","left","center","right"],editType:"layoutstyle",description:["Sets the title's horizontal alignment with respect to its x position.","*left* means that the title starts at x,","*right* means that the title ends at x","and *center* means that the title's center is at x.","*auto* divides `xref` by three and calculates the `xanchor`","value automatically based on the value of `x`."].join(" ")},yanchor:{valType:"enumerated",dflt:"auto",values:["auto","top","middle","bottom"],editType:"layoutstyle",description:["Sets the title's vertical alignment with respect to its y position.","*top* means that the title's cap line is at y,","*bottom* means that the title's baseline is at y","and *middle* means that the title's midline is at y.","*auto* divides `yref` by three and calculates the `yanchor`","value automatically based on the value of `y`."].join(" ")},pad:c(l({editType:"layoutstyle"}),{description:["Sets the padding of the title.","Each padding value only applies when the corresponding","`xanchor`/`yanchor` value is set accordingly. E.g. for left","padding to take effect, `xanchor` must be set to *left*.","The same rule applies if `xanchor`/`yanchor` is determined automatically.","Padding is muted if the respective anchor value is *middle*/*center*."].join(" ")}),automargin:{valType:"boolean",dflt:!1,editType:"plot",description:["Determines whether the title can automatically push the figure margins.","If `yref='paper'` then the margin will expand to ensure that the title doesn’t","overlap with the edges of the container. If `yref='container'` then the margins","will ensure that the title doesn’t overlap with the plot area, tick labels,","and axis titles. If `automargin=true` and the margins need to be expanded,","then y will be set to a default 1 and yanchor will be set to an appropriate","default to ensure that minimal margin space is needed. Note that when `yref='paper'`,","only 1 or 0 are allowed y values. Invalid values will be reset to the default 1."].join(" ")},editType:"layoutstyle"},uniformtext:{mode:{valType:"enumerated",values:[!1,"hide","show"],dflt:!1,editType:"plot",description:["Determines how the font size for various text","elements are uniformed between each trace type.","If the computed text sizes were smaller than","the minimum size defined by `uniformtext.minsize`","using *hide* option hides the text; and","using *show* option shows the text without further downscaling.","Please note that if the size defined by `minsize` is greater than","the font size defined by trace, then the `minsize` is used."].join(" ")},minsize:{valType:"number",min:0,dflt:0,editType:"plot",description:["Sets the minimum text size between traces of the same type."].join(" ")},editType:"plot"},autosize:{valType:"boolean",dflt:!1,editType:"none",description:["Determines whether or not a layout width or height","that has been left undefined by the user","is initialized on each relayout.","Note that, regardless of this attribute,","an undefined layout width or height","is always initialized on the first call to plot."].join(" ")},width:{valType:"number",min:10,dflt:700,editType:"plot",description:["Sets the plot's width (in px)."].join(" ")},height:{valType:"number",min:10,dflt:450,editType:"plot",description:["Sets the plot's height (in px)."].join(" ")},minreducedwidth:{valType:"number",min:2,dflt:64,editType:"plot",description:"Minimum width of the plot with margin.automargin applied (in px)"},minreducedheight:{valType:"number",min:2,dflt:64,editType:"plot",description:"Minimum height of the plot with margin.automargin applied (in px)"},margin:{l:{valType:"number",min:0,dflt:80,editType:"plot",description:"Sets the left margin (in px)."},r:{valType:"number",min:0,dflt:80,editType:"plot",description:"Sets the right margin (in px)."},t:{valType:"number",min:0,dflt:100,editType:"plot",description:"Sets the top margin (in px)."},b:{valType:"number",min:0,dflt:80,editType:"plot",description:"Sets the bottom margin (in px)."},pad:{valType:"number",min:0,dflt:0,editType:"plot",description:["Sets the amount of padding (in px)","between the plotting area and the axis lines"].join(" ")},autoexpand:{valType:"boolean",dflt:!0,editType:"plot",description:["Turns on/off margin expansion computations.","Legends, colorbars, updatemenus, sliders, axis rangeselector and rangeslider","are allowed to push the margins by defaults."].join(" ")},editType:"plot"},computed:{valType:"any",editType:"none",description:["Placeholder for exporting automargin-impacting values namely","`margin.t`, `margin.b`, `margin.l` and `margin.r` in *full-json* mode."].join(" ")},paper_bgcolor:{valType:"color",dflt:o.background,editType:"plot",description:"Sets the background color of the paper where the graph is drawn."},plot_bgcolor:{valType:"color",dflt:o.background,editType:"layoutstyle",description:["Sets the background color of the plotting area in-between x and y axes."].join(" ")},autotypenumbers:{valType:"enumerated",values:["convert types","strict"],dflt:"convert types",editType:"calc",description:["Using *strict* a numeric string in trace data is not converted to a number.","Using *convert types* a numeric string in trace data may be","treated as a number during automatic axis `type` detection.","This is the default value; however it could be overridden for individual axes."].join(" ")},separators:{valType:"string",editType:"plot",description:["Sets the decimal and thousand separators.","For example, *. * puts a '.' before decimals and a space","between thousands. In English locales, dflt is *.,* but","other locales may alter this default."].join(" ")},hidesources:{valType:"boolean",dflt:!1,editType:"plot",description:["Determines whether or not a text link citing the data source is","placed at the bottom-right cored of the figure.","Has only an effect only on graphs that have been generated via","forked graphs from the Chart Studio Cloud (at https://chart-studio.plotly.com or on-premise)."].join(" ")},showlegend:{valType:"boolean",editType:"legend",description:["Determines whether or not a legend is drawn.","Default is `true` if there is a trace to show and any of these:","a) Two or more traces would by default be shown in the legend.","b) One pie trace is shown in the legend.","c) One trace is explicitly given with `showlegend: true`."].join(" ")},colorway:{valType:"colorlist",dflt:o.defaults,editType:"calc",description:"Sets the default trace colors."},datarevision:{valType:"any",editType:"calc",description:["If provided, a changed value tells `Plotly.react` that","one or more data arrays has changed. This way you can modify","arrays in-place rather than making a complete new copy for an","incremental change.","If NOT provided, `Plotly.react` assumes that data arrays are","being treated as immutable, thus any data array with a","different identity from its predecessor contains new data."].join(" ")},uirevision:{valType:"any",editType:"none",description:["Used to allow user interactions with the plot to persist after","`Plotly.react` calls that are unaware of these interactions.","If `uirevision` is omitted, or if it is given and it changed from","the previous `Plotly.react` call, the exact new figure is used.","If `uirevision` is truthy and did NOT change, any attribute","that has been affected by user interactions and did not receive a","different value in the new figure will keep the interaction value.","`layout.uirevision` attribute serves as the default for","`uirevision` attributes in various sub-containers. For finer","control you can set these sub-attributes directly. For example,","if your app separately controls the data on the x and y axes you","might set `xaxis.uirevision=*time*` and `yaxis.uirevision=*cost*`.","Then if only the y data is changed, you can update","`yaxis.uirevision=*quantity*` and the y axis range will reset but","the x axis range will retain any user-driven zoom."].join(" ")},editrevision:{valType:"any",editType:"none",description:["Controls persistence of user-driven changes in `editable: true`","configuration, other than trace names and axis titles.","Defaults to `layout.uirevision`."].join(" ")},selectionrevision:{valType:"any",editType:"none",description:["Controls persistence of user-driven changes in selected points","from all traces."].join(" ")},template:{valType:"any",editType:"calc",description:["Default attributes to be applied to the plot. Templates can be","created from existing plots using `Plotly.makeTemplate`, or","created manually. They should be objects with format:","`{layout: layoutTemplate, data: {[type]: [traceTemplate, ...]}, ...}`","`layoutTemplate` and `traceTemplate` are objects matching the","attribute structure of `layout` and a data trace. ","Trace templates are applied cyclically to traces of each type.","Container arrays (eg `annotations`) have special handling:","An object ending in `defaults` (eg `annotationdefaults`) is applied","to each array item. But if an item has a `templateitemname` key","we look in the template array for an item with matching `name` and","apply that instead. If no matching `name` is found we mark the item","invisible. Any named template item not referenced is appended to","the end of the array, so you can use this for a watermark annotation","or a logo image, for example. To omit one of these items on the plot,","make an item with matching `templateitemname` and `visible: false`."].join(" ")},newshape:a.newshape,activeshape:a.activeshape,newselection:s.newselection,activeselection:s.activeselection,meta:{valType:"any",arrayOk:!0,editType:"plot",description:["Assigns extra meta information that can be used in various `text` attributes.","Attributes such as the graph, axis and colorbar `title.text`, annotation `text`","`trace.name` in legend items, `rangeselector`, `updatemenus` and `sliders` `label` text","all support `meta`. One can access `meta` fields using template strings:","`%{meta[i]}` where `i` is the index of the `meta`","item in question.","`meta` can also be an object for example `{key: value}` which can be accessed","%{meta[key]}."].join(" ")},transition:c({},i.transition,{description:["Sets transition options used during Plotly.react updates."].join(" "),editType:"none"}),_deprecated:{title:{valType:"string",editType:"layoutstyle",description:["Value of `title` is no longer a simple *string* but a set of sub-attributes.","To set the contents of the title, please use `title.text` now."].join(" ")},titlefont:n({editType:"layoutstyle",description:["Former `titlefont` is now the sub-attribute `font` of `title`.","To customize title font properties, please use `title.font` now."].join(" ")})}}},85538:t=>{"use strict";t.exports=function(t){var e=t.editType;return{t:{valType:"number",dflt:0,editType:e,description:"The amount of padding (in px) along the top of the component."},r:{valType:"number",dflt:0,editType:e,description:"The amount of padding (in px) on the right side of the component."},b:{valType:"number",dflt:0,editType:e,description:"The amount of padding (in px) along the bottom of the component."},l:{valType:"number",dflt:0,editType:e,description:"The amount of padding (in px) on the left side of the component."},editType:e}}},51137:(t,e,r)=>{"use strict";var n=r(27941),i=r(79969).de,o=r(31830).OE,a=r(7370),s=r(44514),l=r(25059),c=r(35852),u=r(46121),h=r(12822),d=r(17499),f=r(32994).BADNUM,p=r(99246),m=r(8867).clearOutline,g=r(49114),v=r(46367),b=r(53874),y=r(47388).eV,x=h.relinkPrivateKeys,_=h._,w=t.exports={};h.extendFlat(w,l),w.attributes=r(3520),w.attributes.type.values=w.allTypes,w.fontAttrs=r(75058),w.layoutAttributes=r(13195);var k=w.transformsRegistry,A=r(74036);w.executeAPICommand=A.executeAPICommand,w.computeAPICommandBindings=A.computeAPICommandBindings,w.manageCommandObserver=A.manageCommandObserver,w.hasSimpleAPICommandBindings=A.hasSimpleAPICommandBindings,w.redrawText=function(t){return t=h.getGraphDiv(t),new Promise((function(e){setTimeout((function(){t._fullLayout&&(l.getComponentMethod("annotations","draw")(t),l.getComponentMethod("legend","draw")(t),l.getComponentMethod("colorbar","draw")(t),e(w.previousPromises(t)))}),300)}))},w.resize=function(t){var e;t=h.getGraphDiv(t);var r=new Promise((function(r,n){t&&!h.isHidden(t)||n(new Error("Resize must be passed a displayed plot div element.")),t._redrawTimer&&clearTimeout(t._redrawTimer),t._resolveResize&&(e=t._resolveResize),t._resolveResize=r,t._redrawTimer=setTimeout((function(){if(!t.layout||t.layout.width&&t.layout.height||h.isHidden(t))r(t);else{delete t.layout.width,delete t.layout.height;var e=t.changed;t.autoplay=!0,l.call("relayout",t,{autosize:!0}).then((function(){t.changed=e,t._resolveResize===r&&(delete t._resolveResize,r(t))}))}}),100)}));return e&&e(r),r},w.previousPromises=function(t){if((t._promises||[]).length)return Promise.all(t._promises).then((function(){t._promises=[]}))},w.addLinks=function(t){if(t._context.showLink||t._context.showSources){var e=t._fullLayout,r=h.ensureSingle(e._paper,"text","js-plot-link-container",(function(t){t.style({"font-family":'"Open Sans", Arial, sans-serif',"font-size":"12px",fill:d.defaultLine,"pointer-events":"all"}).each((function(){var t=n.select(this);t.append("tspan").classed("js-link-to-tool",!0),t.append("tspan").classed("js-link-spacer",!0),t.append("tspan").classed("js-sourcelinks",!0)}))})),i=r.node(),o={y:e._paper.attr("height")-9};document.body.contains(i)&&i.getComputedTextLength()>=e.width-20?(o["text-anchor"]="start",o.x=5):(o["text-anchor"]="end",o.x=e._paper.attr("width")-7),r.attr(o);var a=r.select(".js-link-to-tool"),s=r.select(".js-link-spacer"),l=r.select(".js-sourcelinks");t._context.showSources&&t._context.showSources(t),t._context.showLink&&function(t,e){e.text("");var r=e.append("a").attr({"xlink:xlink:href":"#",class:"link--impt link--embedview","font-weight":"bold"}).text(t._context.linkText+" "+String.fromCharCode(187));if(t._context.sendData)r.on("click",(function(){w.sendDataToCloud(t)}));else{var n=window.location.pathname.split("/"),i=window.location.search;r.attr({"xlink:xlink:show":"new","xlink:xlink:href":"/"+n[2].split(".")[0]+"/"+n[1]+i})}}(t,a),s.text(a.text()&&l.text()?" - ":"")}},w.sendDataToCloud=function(t){var e=(window.PLOTLYENV||{}).BASE_URL||t._context.plotlyServerURL;if(e){t.emit("plotly_beforeexport");var r=n.select(t).append("div").attr("id","hiddenform").style("display","none"),i=r.append("form").attr({action:e+"/external",method:"post",target:"_blank"});return i.append("input").attr({type:"text",name:"data"}).node().value=w.graphJson(t,!1,"keepdata"),i.node().submit(),r.remove(),t.emit("plotly_afterexport"),!1}};var M=["days","shortDays","months","shortMonths","periods","dateTime","date","time","decimal","thousands","grouping","currency"],T=["year","month","dayMonth","dayMonthYear"];function S(t,e){var r=t._context.locale;r||(r="en-US");var n=!1,i={};function o(t){for(var r=!0,o=0;o1&&I.length>1){for(l.getComponentMethod("grid","sizeDefaults")(c,s),a=0;a15&&I.length>15&&0===s.shapes.length&&0===s.images.length,w.linkSubplots(d,s,u,n),w.cleanPlot(d,s,u,n);var N=!(!n._has||!n._has("gl2d")),B=!(!s._has||!s._has("gl2d")),U=!(!n._has||!n._has("cartesian"))||N,G=!(!s._has||!s._has("cartesian"))||B;U&&!G?n._bgLayer.remove():G&&!U&&(s._shouldCreateBgLayer=!0),n._zoomlayer&&!t._dragging&&m({_fullLayout:n}),function(t,e){var r,n=[];e.meta&&(r=e._meta={meta:e.meta,layout:{meta:e.meta}});for(var i=0;i0){var u=1-2*s;n=Math.round(u*n),i=Math.round(u*i)}}var d=w.layoutAttributes.width.min,f=w.layoutAttributes.height.min;n1,m=!e.height&&Math.abs(r.height-i)>1;(m||p)&&(p&&(r.width=n),m&&(r.height=i)),t._initialAutoSize||(t._initialAutoSize={width:n,height:i}),w.sanitizeMargins(r)},w.supplyLayoutModuleDefaults=function(t,e,r,n){var i,o,a,s=l.componentsRegistry,c=e._basePlotModules,u=l.subplotsRegistry.cartesian;for(i in s)(a=s[i]).includeBasePlot&&a.includeBasePlot(t,e);for(var d in c.length||c.push(u),e._has("cartesian")&&(l.getComponentMethod("grid","contentDefaults")(t,e),u.finalizeSubplots(t,e)),e._subplots)e._subplots[d].sort(h.subplotSort);for(o=0;o1&&(r.l/=v,r.r/=v)}if(f){var b=(r.t+r.b)/f;b>1&&(r.t/=b,r.b/=b)}var y=void 0!==r.xl?r.xl:r.x,x=void 0!==r.xr?r.xr:r.x,_=void 0!==r.yt?r.yt:r.y,k=void 0!==r.yb?r.yb:r.y;p[e]={l:{val:y,size:r.l+g},r:{val:x,size:r.r+g},b:{val:k,size:r.b+g},t:{val:_,size:r.t+g}},m[e]=1}else delete p[e],delete m[e];if(!n._replotting)return w.doAutoMargin(t)}},w.doAutoMargin=function(t){var e=t._fullLayout,r=e.width,n=e.height;e._size||(e._size={}),O(e);var i=e._size,o=e.margin,s={t:0,b:0,l:0,r:0},c=h.extendFlat({},i),u=o.l,d=o.r,f=o.t,m=o.b,g=e._pushmargin,v=e._pushmarginIds,b=e.minreducedwidth,y=e.minreducedheight;if(!1!==o.autoexpand){for(var x in g)v[x]||delete g[x];var _=t._fullLayout._reservedMargin;for(var k in _)for(var A in _[k]){var M=_[k][A];s[A]=Math.max(s[A],M)}for(var T in g.base={l:{val:0,size:u},r:{val:1,size:d},t:{val:1,size:f},b:{val:0,size:m}},s){var S=0;for(var C in g)"base"!==C&&a(g[C][T].size)&&(S=g[C][T].size>S?g[C][T].size:S);var E=Math.max(0,o[T]-S);s[T]=Math.max(0,s[T]-E)}for(var L in g){var z=g[L].l||{},D=g[L].b||{},I=z.val,F=z.size,R=D.val,P=D.size,j=r-s.r-s.l,N=n-s.t-s.b;for(var B in g){if(a(F)&&g[B].r){var U=g[B].r.val,G=g[B].r.size;if(U>I){var V=(F*U+(G-j)*I)/(U-I),H=(G*(1-I)+(F-j)*(1-U))/(U-I);V+H>u+d&&(u=V,d=H)}}if(a(P)&&g[B].t){var W=g[B].t.val,q=g[B].t.size;if(W>R){var Y=(P*W+(q-N)*R)/(W-R),Z=(q*(1-R)+(P-N)*(1-W))/(W-R);Y+Z>m+f&&(m=Y,f=Z)}}}}}var X=h.constrain(r-o.l-o.r,2,b),$=h.constrain(n-o.t-o.b,2,y),J=Math.max(0,r-X),K=Math.max(0,n-$);if(J){var Q=(u+d)/J;Q>1&&(u/=Q,d/=Q)}if(K){var tt=(m+f)/K;tt>1&&(m/=tt,f/=tt)}if(i.l=Math.round(u)+s.l,i.r=Math.round(d)+s.r,i.t=Math.round(f)+s.t,i.b=Math.round(m)+s.b,i.p=Math.round(o.pad),i.w=Math.round(r)-i.l-i.r,i.h=Math.round(n)-i.t-i.b,!e._replotting&&(w.didMarginChange(c,i)||function(t){if("_redrawFromAutoMarginCount"in t._fullLayout)return!1;var e=p.list(t,"",!0);for(var r in e)if(e[r].autoshift||e[r].shift)return!0;return!1}(t))){"_redrawFromAutoMarginCount"in e?e._redrawFromAutoMarginCount++:e._redrawFromAutoMarginCount=1;var et=3*(1+Object.keys(v).length);if(e._redrawFromAutoMarginCount0&&(t._transitioningWithDuration=!0),t._transitionData._interruptCallbacks.push((function(){n=!0})),r.redraw&&t._transitionData._interruptCallbacks.push((function(){return l.call("redraw",t)})),t._transitionData._interruptCallbacks.push((function(){t.emit("plotly_transitioninterrupted",[])}));var o=0,a=0;function s(){return o++,function(){var e;a++,n||a!==o||(e=i,t._transitionData&&(function(t){if(t)for(;t.length;)t.shift()}(t._transitionData._interruptCallbacks),Promise.resolve().then((function(){if(r.redraw)return l.call("redraw",t)})).then((function(){t._transitioning=!1,t._transitioningWithDuration=!1,t.emit("plotly_transitioned",[])})).then(e)))}}r.runFn(s),setTimeout(s())}))}],o=h.syncOrAsync(i,t);return o&&o.then||(o=Promise.resolve()),o.then((function(){return t}))}w.didMarginChange=function(t,e){for(var r=0;r1)return!0}return!1},w.graphJson=function(t,e,r,n,i,o){(i&&e&&!t._fullData||i&&!e&&!t._fullLayout)&&w.supplyDefaults(t);var a=i?t._fullData:t.data,l=i?t._fullLayout:t.layout,c=(t._transitionData||{})._frames;function u(t,e){if("function"==typeof t)return e?"_function_":null;if(h.isPlainObject(t)){var n,i={};return Object.keys(t).sort().forEach((function(o){if(-1===["_","["].indexOf(o.charAt(0)))if("function"!=typeof t[o]){if("keepdata"===r){if("src"===o.substr(o.length-3))return}else if("keepstream"===r){if("string"==typeof(n=t[o+"src"])&&n.indexOf(":")>0&&!h.isPlainObject(t.stream))return}else if("keepall"!==r&&"string"==typeof(n=t[o+"src"])&&n.indexOf(":")>0)return;i[o]=u(t[o],e)}else e&&(i[o]="_function")})),i}var o=Array.isArray(t),a=h.isTypedArray(t);if((o||a)&&t.dtype&&t.shape){var l=t.bdata;return u({dtype:t.dtype,shape:t.shape,bdata:h.isArrayBuffer(l)?s.encode(l):l},e)}return o?t.map((function(t){return u(t,e)})):a?h.simpleMap(t,h.identity):h.isJSDate(t)?h.ms2DateTimeLocal(+t):t}var d={data:(a||[]).map((function(t){var r=u(t);return e&&delete r.fit,r}))};if(!e&&(d.layout=u(l),i)){var f=l._size;d.layout.computed={margin:{b:f.b,l:f.l,r:f.r,t:f.t}}}return c&&(d.frames=u(c)),o&&(d.config=u(t._context,!0)),"object"===n?d:JSON.stringify(d)},w.modifyFrames=function(t,e){var r,n,i,o=t._transitionData._frames,a=t._transitionData._frameHash;for(r=0;r=0;o--)if(l[o].enabled){r._indexToPoints=l[o]._indexToPoints;break}n&&n.calc&&(a=n.calc(t,r))}Array.isArray(a)&&a[0]||(a=[{x:f,y:f}]),a[0].t||(a[0].t={}),a[0].trace=r,d[e]=a}}for(R(a,s,u),i=0;i{"use strict";var n=r(12822),i=r(46121),o=r(40365).N;t.exports=function(t,e,r,a){var s,l,c=a.type,u=a.attributes,h=a.handleDefaults,d=a.partition||"x",f=e._subplots[c],p=f.length,m=p&&f[0].replace(/\d+$/,"");function g(t,e){return n.coerce(s,l,u,t,e)}for(var v=0;v{"use strict";var n=r(77201),i=n.FORMAT_LINK,o=n.DATE_FORMAT_LINK;function a(t){return["Variables are inserted using %{variable},",'for example "y: %{y}"'+(t&&t.supportOther?" as well as %{xother}, {%_xother}, {%_xother_}, {%xother_}. When showing info for several points, *xother* will be added to those with different x positions from the first point. An underscore before or after *(x|y)other* will add a space on that side, only when this field is shown.":"."),'Numbers are formatted using d3-format\'s syntax %{variable:d3-format}, for example "Price: %{y:$.2f}".',i,"for details on the formatting syntax.",'Dates are formatted using d3-time-format\'s syntax %{variable|d3-time-format}, for example "Day: %{2019-01-01|%A}".',o,"for details on the date formatting syntax."].join(" ")}function s(t){var e=t.description?" "+t.description:"",r=t.keys||[];if(r.length>0){for(var n=[],i=0;i` is displayed in the secondary box, for example "{fullData.name}".',"To hide the secondary box completely, use an empty tag ``."].join(" ")};return!1!==t.arrayOk&&(n.arrayOk=!0),n},e.ay=function(t,e){t=t||{};var r=s(e=e||{}),n={valType:"string",dflt:"",editType:t.editType||"calc",description:["Template string used for rendering the information text that appear on points.","Note that this will override `textinfo`.",a(),"Every attributes that can be specified per-point (the ones that are `arrayOk: true`) are available.",r].join(" ")};return!1!==t.arrayOk&&(n.arrayOk=!0),n},e.LF=function(t,e){e=e||{};var r=(t=t||{}).newshape?"new ":"",n=s(e);return{valType:"string",dflt:"",editType:t.editType||"arraydraw",description:["Template string used for rendering the "+r+"shape's label.","Note that this will override `text`.",["Variables are inserted using %{variable},",'for example "x0: %{x0}".','Numbers are formatted using d3-format\'s syntax %{variable:d3-format}, for example "Price: %{x0:$.2f}". See',i,"for details on the formatting syntax.",'Dates are formatted using d3-time-format\'s syntax %{variable|d3-time-format}, for example "Day: %{x0|%m %b %Y}". See',o,"for details on the date formatting syntax.","A single multiplication or division operation may be applied to numeric variables, and combined with",'d3 number formatting, for example "Length in cm: %{x0*2.54}", "%{slope*60:.1f} meters per second."',"For log axes, variable values are given in log units.","For date axes, x/y coordinate variables and center variables use datetimes, while all other variable values use values in ms."].join(" "),n].join(" ")}}},25059:(t,e,r)=>{"use strict";var n=r(64347),i=r(51648),o=r(65280),a=r(12517),s=r(16822).addStyleRule,l=r(98260),c=r(3520),u=r(13195),h=l.extendFlat,d=l.extendDeepAll;function f(t){var i=t.name,o=t.categories,a=t.meta;if(e.modules[i])n.log("Type "+i+" already registered");else{e.subplotsRegistry[t.basePlotModule.name]||function(t){var r=t.name;if(e.subplotsRegistry[r])n.log("Plot type "+r+" already registered.");else for(var i in v(t),e.subplotsRegistry[r]=t,e.componentsRegistry)x(i,t.name)}(t.basePlotModule);for(var l={},c=0;c{"use strict";var n=r(25059),i=r(12822),o=i.extendFlat,a=i.extendDeep;function s(t){var e;switch(t){case"themes__thumb":e={autosize:!0,width:150,height:150,title:{text:""},showlegend:!1,margin:{l:5,r:5,t:5,b:5,pad:0},annotations:[]};break;case"thumbnail":e={title:{text:""},hidesources:!0,showlegend:!1,borderwidth:0,bordercolor:"",margin:{l:1,r:1,t:1,b:1,pad:0},annotations:[]};break;default:e={}}return e}t.exports=function(t,e){var r,i,l=t.data,c=t.layout,u=a([],l),h=a({},c,s(e.tileClass)),d=t._context||{};if(e.width&&(h.width=e.width),e.height&&(h.height=e.height),"thumbnail"===e.tileClass||"themes__thumb"===e.tileClass){h.annotations=[];var f=Object.keys(h);for(r=0;r-1&&(h[f[r]].title={text:""});for(r=0;r{"use strict";var n=r(12822),i=r(42704),o=r(11148),a=r(13078);t.exports=function(t,e){var r;return n.isPlainObject(t)||(r=n.getGraphDiv(t)),(e=e||{}).format=e.format||"png",e.width=e.width||null,e.height=e.height||null,e.imageDataOnly=!0,new Promise((function(s,l){r&&r._snapshotInProgress&&l(new Error("Snapshotting already in progress.")),n.isIE()&&"svg"!==e.format&&l(new Error(a.MSG_IE_BAD_FORMAT)),r&&(r._snapshotInProgress=!0);var c=i(t,e),u=e.filename||t.fn||"newplot";u+="."+e.format.replace("-","."),c.then((function(t){return r&&(r._snapshotInProgress=!1),o(t,u,e.format)})).then((function(t){s(t)})).catch((function(t){r&&(r._snapshotInProgress=!1),l(t)}))}))}},11148:(t,e,r)=>{"use strict";var n=r(12822),i=r(13078);t.exports=function(t,e,r){var o=document.createElement("a"),a="download"in o;return new Promise((function(s,l){var c,u;if(n.isIE())return c=i.createBlob(t,"svg"),window.navigator.msSaveBlob(c,e),c=null,s(e);if(a)return c=i.createBlob(t,r),u=i.createObjectURL(c),o.href=u,o.download=e,document.body.appendChild(o),o.click(),document.body.removeChild(o),i.revokeObjectURL(u),c=null,s(e);if(n.isSafari()){var h="svg"===r?",":";base64,";return i.octetStream(h+encodeURIComponent(t)),s(e)}l(new Error("download error"))}))}},13078:(t,e,r)=>{"use strict";var n=r(25059);e.getDelay=function(t){return t._has&&(t._has("gl3d")||t._has("gl2d")||t._has("mapbox")||t._has("map"))?500:0},e.getRedrawFunc=function(t){return function(){n.getComponentMethod("colorbar","draw")(t)}},e.encodeSVG=function(t){return"data:image/svg+xml,"+encodeURIComponent(t)},e.encodeJSON=function(t){return"data:application/json,"+encodeURIComponent(t)};var i=window.URL||window.webkitURL;e.createObjectURL=function(t){return i.createObjectURL(t)},e.revokeObjectURL=function(t){return i.revokeObjectURL(t)},e.createBlob=function(t,e){if("svg"===e)return new window.Blob([t],{type:"image/svg+xml;charset=utf-8"});if("full-json"===e)return new window.Blob([t],{type:"application/json;charset=utf-8"});var r=function(t){for(var e=t.length,r=new ArrayBuffer(e),n=new Uint8Array(r),i=0;i{"use strict";var n=r(13078),i={getDelay:n.getDelay,getRedrawFunc:n.getRedrawFunc,clone:r(5041),toSVG:r(48402),svgToImg:r(40241),toImage:r(91117),downloadImage:r(56787)};t.exports=i},40241:(t,e,r)=>{"use strict";var n=r(12822),i=r(86626).EventEmitter,o=r(13078);t.exports=function(t){var e=t.emitter||new i,r=new Promise((function(i,a){var s=window.Image,l=t.svg,c=t.format||"png";if(n.isIE()&&"svg"!==c){var u=new Error(o.MSG_IE_BAD_FORMAT);return a(u),t.promise?r:e.emit("error",u)}var h,d,f=t.canvas,p=t.scale||1,m=t.width||300,g=t.height||150,v=p*m,b=p*g,y=f.getContext("2d",{willReadFrequently:!0}),x=new s;"svg"===c||n.isSafari()?d=o.encodeSVG(l):(h=o.createBlob(l,"svg"),d=o.createObjectURL(h)),f.width=v,f.height=b,x.onload=function(){var r;switch(h=null,o.revokeObjectURL(d),"svg"!==c&&y.drawImage(x,0,0,v,b),c){case"jpeg":r=f.toDataURL("image/jpeg");break;case"png":r=f.toDataURL("image/png");break;case"webp":r=f.toDataURL("image/webp");break;case"svg":r=d;break;default:var n="Image format is not jpeg, png, svg or webp.";if(a(new Error(n)),!t.promise)return e.emit("error",n)}i(r),t.promise||e.emit("success",r)},x.onerror=function(r){if(h=null,o.revokeObjectURL(d),a(r),!t.promise)return e.emit("error",r)},x.src=d}));return t.promise?r:e}},91117:(t,e,r)=>{"use strict";var n=r(86626).EventEmitter,i=r(25059),o=r(12822),a=r(13078),s=r(5041),l=r(48402),c=r(40241);t.exports=function(t,e){var r=new n,u=s(t,{format:"png"}),h=u.gd;h.style.position="absolute",h.style.left="-5000px",document.body.appendChild(h);var d=a.getRedrawFunc(h);return i.call("_doPlot",h,u.data,u.layout,u.config).then(d).then((function(){var t=a.getDelay(h._fullLayout);setTimeout((function(){var t=l(h),n=document.createElement("canvas");n.id=o.randstr(),(r=c({format:e.format,width:h._fullLayout.width,height:h._fullLayout.height,canvas:n,emitter:r,svg:t})).clean=function(){h&&document.body.removeChild(h)}}),t)})).catch((function(t){r.emit("error",t)})),r}},48402:(t,e,r)=>{"use strict";var n=r(27941),i=r(12822),o=r(40666),a=r(17499),s=r(25853),l=/"/g,c="TOBESTRIPPED",u=new RegExp('("'+c+")|("+c+'")',"g");t.exports=function(t,e,r){var h,d=t._fullLayout,f=d._paper,p=d._toppaper,m=d.width,g=d.height;f.insert("rect",":first-child").call(o.setRect,0,0,m,g).call(a.fill,d.paper_bgcolor);var v=d._basePlotModules||[];for(h=0;h")?"":e.html(t).text()}));return e.remove(),r}(w)).replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&")).replace(u,"'"),i.isIE()&&(w=(w=(w=w.replace(/"/gi,"'")).replace(/(\('#)([^']*)('\))/gi,'("#$2")')).replace(/(\\')/gi,'"')),w}},77881:(t,e,r)=>{"use strict";var n=r(7370),i=r(12822).isArrayOrTypedArray,o=r(32994).BADNUM,a=r(25059),s=r(75815),l=r(69352).getAxisGroup,c=r(53481);function u(t,e,r,a,u){if(a.length){var x,_,w,k;switch(function(t,e){var r,o;for(r=0;rh+c||!n(u))}for(var f=0;f{"use strict";t.exports=i;var n=r(12822).distinctVals;function i(t,e){this.traces=t,this.sepNegVal=e.sepNegVal,this.overlapNoMerge=e.overlapNoMerge;for(var r=1/0,i=e.posAxis._id.charAt(0),o=[],a=0;a{"use strict";var n=r(40666),i=r(17499);t.exports=function(t,e,r,o){var a=r.marker.pattern;a&&a.shape?n.pointStyle(t,r,o,e):i.fill(t,e.color)}},17269:(t,e,r)=>{"use strict";var n=r(12822);function i(t){return-1!==t.indexOf("e")?t.replace(/[.]?0+e/,"e"):-1!==t.indexOf(".")?t.replace(/[.]?0+$/,""):t}e.formatPiePercent=function(t,e){var r=i((100*t).toPrecision(3));return n.numSeparate(r,e)+"%"},e.formatPieValue=function(t,e){var r=i(t.toPrecision(10));return n.numSeparate(r,e)},e.getFirstFilled=function(t,e){if(n.isArrayOrTypedArray(t))for(var r=0;r{"use strict";var n=r(17499),i=r(17269).castOption,o=r(44380);t.exports=function(t,e,r,a){var s=r.marker.line,l=i(s.color,e.pts)||n.defaultLine,c=i(s.width,e.pts)||0;t.call(o,e,r,a).style("stroke-width",c).call(n.stroke,l)}},55508:(t,e,r)=>{"use strict";var n=r(12822);t.exports=function(t,e){for(var r=0;r{"use strict";var n=r(60393).axisHoverFormat,i=r(24131).ay,o=r(24131).rb,a=r(89322),s=r(75058),l=r(68057).T,c=r(68057).k,u=r(40666),h=r(32565),d=r(98260).extendFlat,f=r(43591);function p(t){return{valType:"any",dflt:0,editType:"calc",description:["Only relevant when the axis `type` is *date*.","Sets the period positioning in milliseconds or *M* on the "+t+" axis.","Special values in the form of *M* could be used to declare","the number of months. In this case `n` must be a positive integer."].join(" ")}}function m(t){return{valType:"any",editType:"calc",description:["Only relevant when the axis `type` is *date*.","Sets the base for period positioning in milliseconds or date string on the "+t+" axis.","When `"+t+"period` is round number of weeks,","the `"+t+"period0` by default would be on a Sunday i.e. 2000-01-02,","otherwise it would be at 2000-01-01."].join(" ")}}function g(t){return{valType:"enumerated",values:["start","middle","end"],dflt:"middle",editType:"calc",description:["Only relevant when the axis `type` is *date*.","Sets the alignment of data points on the "+t+" axis."].join(" ")}}t.exports={x:{valType:"data_array",editType:"calc+clearAxisTypes",anim:!0,description:"Sets the x coordinates."},x0:{valType:"any",dflt:0,editType:"calc+clearAxisTypes",anim:!0,description:["Alternate to `x`.","Builds a linear space of x coordinates.","Use with `dx`","where `x0` is the starting coordinate and `dx` the step."].join(" ")},dx:{valType:"number",dflt:1,editType:"calc",anim:!0,description:["Sets the x coordinate step.","See `x0` for more info."].join(" ")},y:{valType:"data_array",editType:"calc+clearAxisTypes",anim:!0,description:"Sets the y coordinates."},y0:{valType:"any",dflt:0,editType:"calc+clearAxisTypes",anim:!0,description:["Alternate to `y`.","Builds a linear space of y coordinates.","Use with `dy`","where `y0` is the starting coordinate and `dy` the step."].join(" ")},dy:{valType:"number",dflt:1,editType:"calc",anim:!0,description:["Sets the y coordinate step.","See `y0` for more info."].join(" ")},xperiod:p("x"),yperiod:p("y"),xperiod0:m("x0"),yperiod0:m("y0"),xperiodalignment:g("x"),yperiodalignment:g("y"),xhoverformat:n("x"),yhoverformat:n("y"),offsetgroup:{valType:"string",dflt:"",editType:"calc",description:["Set several traces linked to the same position axis","or matching axes to the same","offsetgroup where bars of the same position coordinate will line up."].join(" ")},alignmentgroup:{valType:"string",dflt:"",editType:"calc",description:["Set several traces linked to the same position axis","or matching axes to the same","alignmentgroup. This controls whether bars compute their positional","range dependently or independently."].join(" ")},stackgroup:{valType:"string",dflt:"",editType:"calc",description:["Set several scatter traces (on the same subplot) to the same","stackgroup in order to add their y values (or their x values if","`orientation` is *h*). If blank or omitted this trace will not be","stacked. Stacking also turns `fill` on by default, using *tonexty*","(*tonextx*) if `orientation` is *h* (*v*) and sets the default","`mode` to *lines* irrespective of point count.","You can only stack on a numeric (linear or log) axis.","Traces in a `stackgroup` will only fill to (or be filled to) other","traces in the same group. With multiple `stackgroup`s or some","traces stacked and some not, if fill-linked traces are not already","consecutive, the later ones will be pushed down in the drawing order."].join(" ")},orientation:{valType:"enumerated",values:["v","h"],editType:"calc",description:["Only relevant in the following cases:","1. when `scattermode` is set to *group*.","2. when `stackgroup` is used, and only the first","`orientation` found in the `stackgroup` will be used - including","if `visible` is *legendonly* but not if it is `false`. Sets the","stacking direction. With *v* (*h*), the y (x) values of subsequent","traces are added. Also affects the default value of `fill`."].join(" ")},groupnorm:{valType:"enumerated",values:["","fraction","percent"],dflt:"",editType:"calc",description:["Only relevant when `stackgroup` is used, and only the first","`groupnorm` found in the `stackgroup` will be used - including","if `visible` is *legendonly* but not if it is `false`.","Sets the normalization for the sum of this `stackgroup`.","With *fraction*, the value of each trace at each location is","divided by the sum of all trace values at that location.","*percent* is the same but multiplied by 100 to show percentages.","If there are multiple subplots, or multiple `stackgroup`s on one","subplot, each will be normalized within its own set."].join(" ")},stackgaps:{valType:"enumerated",values:["infer zero","interpolate"],dflt:"infer zero",editType:"calc",description:["Only relevant when `stackgroup` is used, and only the first","`stackgaps` found in the `stackgroup` will be used - including","if `visible` is *legendonly* but not if it is `false`.","Determines how we handle locations at which other traces in this","group have data but this one does not.","With *infer zero* we insert a zero at these locations.","With *interpolate* we linearly interpolate between existing","values, and extrapolate a constant beyond the existing values."].join(" ")},text:{valType:"string",dflt:"",arrayOk:!0,editType:"calc",description:["Sets text elements associated with each (x,y) pair.","If a single string, the same string appears over","all the data points.","If an array of string, the items are mapped in order to the","this trace's (x,y) coordinates.","If trace `hoverinfo` contains a *text* flag and *hovertext* is not set,","these elements will be seen in the hover labels."].join(" ")},texttemplate:i({},{}),hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"style",description:["Sets hover text elements associated with each (x,y) pair.","If a single string, the same string appears over","all the data points.","If an array of string, the items are mapped in order to the","this trace's (x,y) coordinates.","To be seen, trace `hoverinfo` must contain a *text* flag."].join(" ")},mode:{valType:"flaglist",flags:["lines","markers","text"],extras:["none"],editType:"calc",description:["Determines the drawing mode for this scatter trace.","If the provided `mode` includes *text* then the `text` elements","appear at the coordinates. Otherwise, the `text` elements","appear on hover.","If there are less than "+h.PTS_LINESONLY+" points","and the trace is not stacked","then the default is *lines+markers*. Otherwise, *lines*."].join(" ")},hoveron:{valType:"flaglist",flags:["points","fills"],editType:"style",description:["Do the hover effects highlight individual points (markers or","line points) or do they highlight filled regions?","If the fill is *toself* or *tonext* and there are no markers","or text, then the default is *fills*, otherwise it is *points*."].join(" ")},hovertemplate:o({},{keys:h.eventDataKeys}),line:{color:{valType:"color",editType:"style",anim:!0,description:"Sets the line color."},width:{valType:"number",min:0,dflt:2,editType:"style",anim:!0,description:"Sets the line width (in px)."},shape:{valType:"enumerated",values:["linear","spline","hv","vh","hvh","vhv"],dflt:"linear",editType:"plot",description:["Determines the line shape.","With *spline* the lines are drawn using spline interpolation.","The other available values correspond to step-wise line shapes."].join(" ")},smoothing:{valType:"number",min:0,max:1.3,dflt:1,editType:"plot",description:["Has an effect only if `shape` is set to *spline*","Sets the amount of smoothing.","*0* corresponds to no smoothing (equivalent to a *linear* shape)."].join(" ")},dash:d({},l,{editType:"style"}),backoff:{valType:"number",min:0,dflt:"auto",arrayOk:!0,editType:"plot",description:["Sets the line back off from the end point of the nth line segment (in px).","This option is useful e.g. to avoid overlap with arrowhead markers.","With *auto* the lines would trim before markers if `marker.angleref` is set to *previous*."].join(" ")},simplify:{valType:"boolean",dflt:!0,editType:"plot",description:["Simplifies lines by removing nearly-collinear points. When transitioning","lines, it may be desirable to disable this so that the number of points","along the resulting SVG path is unaffected."].join(" ")},editType:"plot"},connectgaps:{valType:"boolean",dflt:!1,editType:"calc",description:["Determines whether or not gaps","(i.e. {nan} or missing values)","in the provided data arrays are connected."].join(" ")},cliponaxis:{valType:"boolean",dflt:!0,editType:"plot",description:["Determines whether or not markers and text nodes","are clipped about the subplot axes.","To show markers and text nodes above axis lines and tick labels,","make sure to set `xaxis.layer` and `yaxis.layer` to *below traces*."].join(" ")},fill:{valType:"enumerated",values:["none","tozeroy","tozerox","tonexty","tonextx","toself","tonext"],editType:"calc",description:["Sets the area to fill with a solid color.","Defaults to *none* unless this trace is stacked, then it gets","*tonexty* (*tonextx*) if `orientation` is *v* (*h*)","Use with `fillcolor` if not *none*.","*tozerox* and *tozeroy* fill to x=0 and y=0 respectively.","*tonextx* and *tonexty* fill between the endpoints of this","trace and the endpoints of the trace before it, connecting those","endpoints with straight lines (to make a stacked area graph);","if there is no trace before it, they behave like *tozerox* and","*tozeroy*.","*toself* connects the endpoints of the trace (or each segment","of the trace if it has gaps) into a closed shape.","*tonext* fills the space between two traces if one completely","encloses the other (eg consecutive contour lines), and behaves like","*toself* if there is no trace before it. *tonext* should not be","used if one trace does not enclose the other.","Traces in a `stackgroup` will only fill to (or be filled to) other","traces in the same group. With multiple `stackgroup`s or some","traces stacked and some not, if fill-linked traces are not already","consecutive, the later ones will be pushed down in the drawing order."].join(" ")},fillcolor:f(!0),fillgradient:d({type:{valType:"enumerated",values:["radial","horizontal","vertical","none"],dflt:"none",editType:"calc",description:["Sets the type/orientation of the color gradient for the fill.","Defaults to *none*."].join(" ")},start:{valType:"number",editType:"calc",description:["Sets the gradient start value.","It is given as the absolute position on the axis determined by","the orientiation. E.g., if orientation is *horizontal*, the","gradient will be horizontal and start from the x-position","given by start. If omitted, the gradient starts at the lowest","value of the trace along the respective axis.","Ignored if orientation is *radial*."].join(" ")},stop:{valType:"number",editType:"calc",description:["Sets the gradient end value.","It is given as the absolute position on the axis determined by","the orientiation. E.g., if orientation is *horizontal*, the","gradient will be horizontal and end at the x-position","given by end. If omitted, the gradient ends at the highest","value of the trace along the respective axis.","Ignored if orientation is *radial*."].join(" ")},colorscale:{valType:"colorscale",editType:"style",description:["Sets the fill gradient colors as a color scale.","The color scale is interpreted as a gradient","applied in the direction specified by *orientation*,","from the lowest to the highest value of the scatter","plot along that axis, or from the center to the most","distant point from it, if orientation is *radial*."].join(" ")},editType:"calc",description:["Sets a fill gradient.","If not specified, the fillcolor is used instead."].join(" ")}),fillpattern:c,marker:d({symbol:{valType:"enumerated",values:u.symbolList,dflt:"circle",arrayOk:!0,editType:"style",description:["Sets the marker symbol type.","Adding 100 is equivalent to appending *-open* to a symbol name.","Adding 200 is equivalent to appending *-dot* to a symbol name.","Adding 300 is equivalent to appending *-open-dot*","or *dot-open* to a symbol name."].join(" ")},opacity:{valType:"number",min:0,max:1,arrayOk:!0,editType:"style",anim:!0,description:"Sets the marker opacity."},angle:{valType:"angle",dflt:0,arrayOk:!0,editType:"plot",anim:!1,description:["Sets the marker angle in respect to `angleref`."].join(" ")},angleref:{valType:"enumerated",values:["previous","up"],dflt:"up",editType:"plot",anim:!1,description:["Sets the reference for marker angle.","With *previous*, angle 0 points along the line from the previous point to this one.","With *up*, angle 0 points toward the top of the screen."].join(" ")},standoff:{valType:"number",min:0,dflt:0,arrayOk:!0,editType:"plot",anim:!0,description:["Moves the marker away from the data point in the direction of `angle` (in px).","This can be useful for example if you have another marker at this","location and you want to point an arrowhead marker at it."].join(" ")},size:{valType:"number",min:0,dflt:6,arrayOk:!0,editType:"calc",anim:!0,description:"Sets the marker size (in px)."},maxdisplayed:{valType:"number",min:0,dflt:0,editType:"plot",description:["Sets a maximum number of points to be drawn on the graph.","*0* corresponds to no limit."].join(" ")},sizeref:{valType:"number",dflt:1,editType:"calc",description:["Has an effect only if `marker.size` is set to a numerical array.","Sets the scale factor used to determine the rendered size of","marker points. Use with `sizemin` and `sizemode`."].join(" ")},sizemin:{valType:"number",min:0,dflt:0,editType:"calc",description:["Has an effect only if `marker.size` is set to a numerical array.","Sets the minimum size (in px) of the rendered marker points."].join(" ")},sizemode:{valType:"enumerated",values:["diameter","area"],dflt:"diameter",editType:"calc",description:["Has an effect only if `marker.size` is set to a numerical array.","Sets the rule for which the data in `size` is converted","to pixels."].join(" ")},line:d({width:{valType:"number",min:0,arrayOk:!0,editType:"style",anim:!0,description:"Sets the width (in px) of the lines bounding the marker points."},editType:"calc"},a("marker.line",{anim:!0})),gradient:{type:{valType:"enumerated",values:["radial","horizontal","vertical","none"],arrayOk:!0,dflt:"none",editType:"calc",description:["Sets the type of gradient used to fill the markers"].join(" ")},color:{valType:"color",arrayOk:!0,editType:"calc",description:["Sets the final color of the gradient fill:","the center color for radial, the right for horizontal,","or the bottom for vertical."].join(" ")},editType:"calc"},editType:"calc"},a("marker",{anim:!0})),selected:{marker:{opacity:{valType:"number",min:0,max:1,editType:"style",description:"Sets the marker opacity of selected points."},color:{valType:"color",editType:"style",description:"Sets the marker color of selected points."},size:{valType:"number",min:0,editType:"style",description:"Sets the marker size of selected points."},editType:"style"},textfont:{color:{valType:"color",editType:"style",description:"Sets the text font color of selected points."},editType:"style"},editType:"style"},unselected:{marker:{opacity:{valType:"number",min:0,max:1,editType:"style",description:"Sets the marker opacity of unselected points, applied only when a selection exists."},color:{valType:"color",editType:"style",description:"Sets the marker color of unselected points, applied only when a selection exists."},size:{valType:"number",min:0,editType:"style",description:"Sets the marker size of unselected points, applied only when a selection exists."},editType:"style"},textfont:{color:{valType:"color",editType:"style",description:"Sets the text font color of unselected points, applied only when a selection exists."},editType:"style"},editType:"style"},textposition:{valType:"enumerated",values:["top left","top center","top right","middle left","middle center","middle right","bottom left","bottom center","bottom right"],dflt:"middle center",arrayOk:!0,editType:"calc",description:["Sets the positions of the `text` elements","with respects to the (x,y) coordinates."].join(" ")},textfont:s({editType:"calc",colorEditType:"style",arrayOk:!0,description:"Sets the text font."}),zorder:{valType:"integer",dflt:0,editType:"plot",description:["Sets the layer on which this trace is displayed, relative to","other SVG traces on the same subplot. SVG traces with higher `zorder`","appear in front of those with lower `zorder`."].join(" ")}}},93459:(t,e,r)=>{"use strict";var n=r(7370),i=r(12822),o=r(75815),a=r(15389),s=r(32994).BADNUM,l=r(677),c=r(45065),u=r(55508),h=r(58146);function d(t,e,r,n,i,a,s){var c=e._length,u=t._fullLayout,h=r._id,d=n._id,f=u._firstScatter[m(e)]===e.uid,p=(g(e,u,r,n)||{}).orientation,v=e.fill;r._minDtick=0,n._minDtick=0;var b={padded:!0},y={padded:!0};s&&(b.ppad=y.ppad=s);var x=c<2||i[0]!==i[c-1]||a[0]!==a[c-1];x&&("tozerox"===v||"tonextx"===v&&(f||"h"===p))?b.tozero=!0:(e.error_y||{}).visible||"tonexty"!==v&&"tozeroy"!==v&&(l.hasMarkers(e)||l.hasText(e))||(b.padded=!1,b.ppad=0),x&&("tozeroy"===v||"tonexty"===v&&(f||"v"===p))?y.tozero=!0:"tonextx"!==v&&"tozerox"!==v||(y.padded=!1),h&&(e._extremes[h]=o.findExtremes(r,i,b)),d&&(e._extremes[d]=o.findExtremes(n,a,y))}function f(t,e){if(l.hasMarkers(t)){var r,n=t.marker,a=1.6*(t.marker.sizeref||1);if(r="area"===t.marker.sizemode?function(t){return Math.max(Math.sqrt((t||0)/a),3)}:function(t){return Math.max((t||0)/a,3)},i.isArrayOrTypedArray(n.size)){var s={type:"linear"};o.setConvert(s);for(var c=s.makeCalcdata(t.marker,"size"),u=new Array(e),h=0;hl&&L[v].gap;)v--;for(y=L[v].s,m=L.length-1;m>v;m--)L[m].s=y;for(;l{"use strict";var n=r(12822);t.exports=function(t,e){n.isArrayOrTypedArray(e.selectedpoints)&&n.tagSelected(t,e)}},45065:(t,e,r)=>{"use strict";var n=r(42226).hasColorscale,i=r(62182),o=r(677);t.exports=function(t,e){o.hasLines(e)&&n(e,"line")&&i(t,e,{vals:e.line.color,containerStr:"line",cLetter:"c"}),o.hasMarkers(e)&&(n(e,"marker")&&i(t,e,{vals:e.marker.color,containerStr:"marker",cLetter:"c"}),n(e,"marker.line")&&i(t,e,{vals:e.marker.line.color,containerStr:"marker.line",cLetter:"c"}))}},32565:t=>{"use strict";t.exports={PTS_LINESONLY:20,minTolerance:.2,toleranceGrowth:10,maxScreensAway:20,eventDataKeys:[]}},30888:(t,e,r)=>{"use strict";var n=r(93459),i=r(77881).setGroupPositions;function o(t,e,r,n,i,o,a){i[n]=!0;var s={i:null,gap:!0,s:0};if(s[a]=r,t.splice(e,0,s),e&&r===t[e-1][a]){var l=t[e-1];s.s=l.s,s.i=l.i,s.gap=l.gap}else o&&(s.s=function(t,e,r,n){var i=t[e-1],o=t[e+1];return o?i?i.s+(o.s-i.s)*(r-i[n])/(o[n]-i[n]):o.s:i.s}(t,e,r,a));e||(t[0].t=t[1].t,t[0].trace=t[1].trace,delete t[1].t,delete t[1].trace)}t.exports=function(t,e){"group"===t._fullLayout.scattermode&&function(t,e){for(var r=e.xaxis,n=e.yaxis,o=t._fullLayout,a=t._fullData,s=t.calcdata,l=[],c=[],u=0;uS[h]&&h{"use strict";var n=r(12822),i=r(28104),o=r(98387);t.exports=function(t,e){var r,a,s;function l(t){return n.coerce(a._input,a,o,t)}if("group"===e.scattermode)for(s=0;s=0;h--){var d=t[h];if("scatter"===d.type&&d.xaxis===c.xaxis&&d.yaxis===c.yaxis){d.opacity=void 0;break}}}}}},28724:(t,e,r)=>{"use strict";var n=r(12822),i=r(25059),o=r(98387),a=r(32565),s=r(677),l=r(56666),c=r(45952),u=r(82349),h=r(86277),d=r(51725),f=r(32335),p=r(46574),m=r(12261),g=r(12822).coercePattern;t.exports=function(t,e,r,v){function b(r,i){return n.coerce(t,e,o,r,i)}var y=l(t,e,v,b);if(y||(e.visible=!1),e.visible){c(t,e,v,b),b("xhoverformat"),b("yhoverformat"),b("zorder");var x=u(t,e,v,b);"group"===v.scattermode&&void 0===e.orientation&&b("orientation","v");var _=!x&&y{"use strict";t.exports=function(t){return{valType:"color",editType:"style",anim:!0,description:["Sets the fill color.","Defaults to a half-transparent variant of the line color,","marker color, or marker line color, whichever is available."+(t?" If fillgradient is specified, fillcolor is ignored except for setting the background color of the hover label, if any.":"")].join(" ")}}},12261:(t,e,r)=>{"use strict";var n=r(17499),i=r(12822).isArrayOrTypedArray;t.exports=function(t,e,r,o,a){a||(a={});var s,l=!1;if(e.marker){var c=e.marker.color,u=(e.marker.line||{}).color;c&&!i(c)?l=c:u&&!i(u)&&(l=u)}if(a.moduleHasFillgradient&&"none"!==o("fillgradient.type")){o("fillgradient.start"),o("fillgradient.stop");var h=o("fillgradient.colorscale");h&&(s=function(t){for(var e=n.interpolate(t[0][1],t[1][1],.5),r=2;r{"use strict";var n=r(75815);t.exports=function(t,e,r){var i={},o={_fullLayout:r},a=n.getFromTrace(o,e,"x"),s=n.getFromTrace(o,e,"y"),l=t.orig_x;void 0===l&&(l=t.x);var c=t.orig_y;return void 0===c&&(c=t.y),i.xLabel=n.tickText(a,a.c2l(l),!0).text,i.yLabel=n.tickText(s,s.c2l(c),!0).text,i}},90566:(t,e,r)=>{"use strict";var n=r(17499),i=r(677);t.exports=function(t,e){var r,o;if("lines"===t.mode)return(r=t.line.color)&&n.opacity(r)?r:t.fillcolor;if("none"===t.mode)return t.fill?t.fillcolor:"";var a=e.mcc||(t.marker||{}).color,s=e.mlcc||((t.marker||{}).line||{}).color;return(o=a&&n.opacity(a)?a:s&&n.opacity(s)&&(e.mlw||((t.marker||{}).line||{}).width)?s:"")?n.opacity(o)<.3?n.addOpacity(o,.3):o:(r=(t.line||{}).color)&&n.opacity(r)&&i.hasLines(t)&&t.line.width?r:t.fillcolor}},28104:(t,e,r)=>{"use strict";var n=r(69352).getAxisGroup;t.exports=function(t,e,r,i){var o=e.orientation,a=e[{v:"x",h:"y"}[o]+"axis"],s=n(r,a)+o,l=r._alignmentOpts||{},c=i("alignmentgroup"),u=l[s];u||(u=l[s]={});var h=u[c];h?h.traces.push(e):h=u[c]={traces:[e],alignmentIndex:Object.keys(u).length,offsetGroups:{}};var d=i("offsetgroup"),f=h.offsetGroups,p=f[d];d&&(p||(p=f[d]={offsetIndex:Object.keys(f).length}),e._offsetIndex=p.offsetIndex)}},2686:(t,e,r)=>{"use strict";var n=r(12822),i=r(70410),o=r(25059),a=r(90566),s=r(17499),l=n.fillText;t.exports=function(t,e,r,c){var u=t.cd,h=u[0].trace,d=t.xa,f=t.ya,p=d.c2p(e),m=f.c2p(r),g=[p,m],v=h.hoveron||"",b=-1!==h.mode.indexOf("markers")?3:.5,y=!!h.xperiodalignment,x=!!h.yperiodalignment;if(-1!==v.indexOf("points")){var _=function(t){var e=Math.max(b,t.mrc||0),r=d.c2p(t.x)-p,n=f.c2p(t.y)-m;return Math.max(Math.sqrt(r*r+n*n)-e,1-b/e)},w=i.getDistanceFunction(c,(function(t){if(y){var e=d.c2p(t.xStart),r=d.c2p(t.xEnd);return p>=Math.min(e,r)&&p<=Math.max(e,r)?0:1/0}var n=Math.max(3,t.mrc||0),i=1-1/n,o=Math.abs(d.c2p(t.x)-p);return o=Math.min(e,r)&&m<=Math.max(e,r)?0:1/0}var n=Math.max(3,t.mrc||0),i=1-1/n,o=Math.abs(f.c2p(t.y)-m);return or!=(c=i[n][1])>=r&&(a=i[n-1][0],s=i[n][0],c-l&&(o=a+(s-a)*(r-l)/(c-l),h=Math.min(h,o),p=Math.max(p,o)));return{x0:h=Math.max(h,0),x1:p=Math.min(p,d._length),y0:r,y1:r}}(h._polygons);null===O&&(O={x0:g[0],x1:g[0],y0:g[1],y1:g[1]});var D=s.defaultLine;return s.opacity(h.fillcolor)?D=h.fillcolor:s.opacity((h.line||{}).color)&&(D=h.line.color),n.extendFlat(t,{distance:t.maxHoverDistance,x0:O.x0,x1:O.x1,y0:O.y0,y1:O.y1,color:D,hovertemplate:!1}),delete t.index,h.text&&!n.isArrayOrTypedArray(h.text)?t.text=String(h.text):t.text=h.name,[t]}}},56384:(t,e,r)=>{"use strict";var n=r(677);t.exports={hasLines:n.hasLines,hasMarkers:n.hasMarkers,hasText:n.hasText,isBubble:n.isBubble,attributes:r(98387),layoutAttributes:r(49114),supplyDefaults:r(28724),crossTraceDefaults:r(30415),supplyLayoutDefaults:r(25229),calc:r(93459).calc,crossTraceCalc:r(30888),arraysToCalcdata:r(55508),plot:r(54461),colorbar:r(89927),formatLabels:r(23315),style:r(21905).style,styleOnSelect:r(21905).styleOnSelect,hoverPoints:r(2686),selectPoints:r(96414),animatable:!0,moduleType:"trace",name:"scatter",basePlotModule:r(29592),categories:["cartesian","svg","symbols","errorBarsOK","showLegend","scatter-like","zoomScale"],meta:{description:["The scatter trace type encompasses line charts, scatter charts, text charts, and bubble charts.","The data visualized as scatter point or lines is set in `x` and `y`.","Text (appearing either on the chart or on hover only) is via `text`.","Bubble charts are achieved by setting `marker.size` and/or `marker.color`","to numerical arrays."].join(" ")}}},49114:t=>{"use strict";t.exports={scattermode:{valType:"enumerated",values:["group","overlay"],dflt:"overlay",editType:"calc",description:["Determines how scatter points at the same location coordinate","are displayed on the graph.","With *group*, the scatter points are plotted next to one another","centered around the shared location.","With *overlay*, the scatter points are plotted over one another,","you might need to reduce *opacity* to see multiple scatter points."].join(" ")},scattergap:{valType:"number",min:0,max:1,editType:"calc",description:["Sets the gap (in plot fraction) between scatter points of","adjacent location coordinates.","Defaults to `bargap`."].join(" ")}}},25229:(t,e,r)=>{"use strict";var n=r(12822),i=r(49114);t.exports=function(t,e){var r,o="group"===e.barmode;"group"===e.scattermode&&(r=o?e.bargap:.2,n.coerce(t,e,i,"scattergap",r))}},51725:(t,e,r)=>{"use strict";var n=r(12822).isArrayOrTypedArray,i=r(42226).hasColorscale,o=r(94461);t.exports=function(t,e,r,a,s,l){l||(l={});var c=(t.marker||{}).color;c&&c._inputArray&&(c=c._inputArray),s("line.color",r),i(t,"line")?o(t,e,a,s,{prefix:"line.",cLetter:"c"}):s("line.color",!n(c)&&c||r),s("line.width"),l.noDash||s("line.dash"),l.backoff&&s("line.backoff")}},22980:(t,e,r)=>{"use strict";var n=r(40666),i=r(32994),o=i.BADNUM,a=i.LOG_CLIP,s=a+.5,l=a-.5,c=r(12822),u=c.segmentsIntersect,h=c.constrain,d=r(32565);t.exports=function(t,e){var r,i,a,f,p,m,g,v,b,y,x,_,w,k,A,M,T,S,C=e.trace||{},E=e.xaxis,L=e.yaxis,z="log"===E.type,O="log"===L.type,D=E._length,I=L._length,F=e.backoff,R=C.marker,P=e.connectGaps,j=e.baseTolerance,N=e.shape,B="linear"===N,U=C.fill&&"none"!==C.fill,G=[],V=d.minTolerance,H=t.length,W=new Array(H),q=0;function Y(r){var n=t[r];if(!n)return!1;var i=e.linearized?E.l2p(n.x):E.c2p(n.x),a=e.linearized?L.l2p(n.y):L.c2p(n.y);if(i===o){if(z&&(i=E.c2p(n.x,!0)),i===o)return!1;O&&a===o&&(i*=Math.abs(E._m*I*(E._m>0?s:l)/(L._m*D*(L._m>0?s:l)))),i*=1e3}if(a===o){if(O&&(a=L.c2p(n.y,!0)),a===o)return!1;a*=1e3}return[i,a]}function Z(t,e,r,n){var i=r-t,o=n-e,a=.5-t,s=.5-e,l=i*i+o*o,c=i*a+o*s;if(c>0&&cat||t[1]lt)return[h(t[0],ot,at),h(t[1],st,lt)]}function ht(t,e){return t[0]===e[0]&&(t[0]===ot||t[0]===at)||t[1]===e[1]&&(t[1]===st||t[1]===lt)||void 0}function dt(t,e,r){return function(n,i){var o=ut(n),a=ut(i),s=[];if(o&&a&&ht(o,a))return s;o&&s.push(o),a&&s.push(a);var l=2*c.constrain((n[t]+i[t])/2,e,r)-((o||n)[t]+(a||i)[t]);return l&&((o&&a?l>0==o[t]>a[t]?o:a:o||a)[t]+=l),s}}function ft(t){var e=t[0],r=t[1],n=e===W[q-1][0],i=r===W[q-1][1];if(!n||!i)if(q>1){var o=e===W[q-2][0],a=r===W[q-2][1];n&&(e===ot||e===at)&&o?a?q--:W[q-1]=t:i&&(r===st||r===lt)&&a?o?q--:W[q-1]=t:W[q++]=t}else W[q++]=t}function pt(t){W[q-1][0]!==t[0]&&W[q-1][1]!==t[1]&&ft([Q,tt]),ft(t),et=null,Q=tt=0}"linear"===N||"spline"===N?nt=function(t,e){for(var r=[],n=0,i=0;i<4;i++){var o=ct[i],a=u(t[0],t[1],e[0],e[1],o[0],o[1],o[2],o[3]);a&&(!n||Math.abs(a.x-r[0][0])>1||Math.abs(a.y-r[0][1])>1)&&(a=[a.x,a.y],n&&$(a,t)<$(r[0],t)?r.unshift(a):r.push(a),n++)}return r}:"hv"===N||"vh"===N?nt=function(t,e){var r=[],n=ut(t),i=ut(e);return n&&i&&ht(n,i)||(n&&r.push(n),i&&r.push(i)),r}:"hvh"===N?nt=dt(0,ot,at):"vhv"===N&&(nt=dt(1,st,lt));var mt=c.isArrayOrTypedArray(R);function gt(e){if(e&&F&&(e.i=r,e.d=t,e.trace=C,e.marker=mt?R[e.i]:R,e.backoff=F),T=e[0]/D,S=e[1]/I,J=e[0]at?at:0,K=e[1]lt?lt:0,J||K){if(q)if(et){var n=nt(et,e);n.length>1&&(pt(n[0]),W[q++]=n[1])}else rt=nt(W[q-1],e)[0],W[q++]=rt;else W[q++]=[J||e[0],K||e[1]];var i=W[q-1];J&&K&&(i[0]!==J||i[1]!==K)?(et&&(Q!==J&&tt!==K?ft(Q&&tt?(o=et,s=(a=e)[0]-o[0],l=(a[1]-o[1])/s,(o[1]*a[0]-a[1]*o[0])/s>0?[l>0?ot:at,lt]:[l>0?at:ot,st]):[Q||J,tt||K]):Q&&tt&&ft([Q,tt])),ft([J,K])):Q-J&&tt-K&&ft([J||Q,K||tt]),et=e,Q=J,tt=K}else et&&pt(nt(et,e)[0]),W[q++]=e;var o,a,s,l}for(r=0;rX(m,vt))break;a=m,(w=b[0]*v[0]+b[1]*v[1])>x?(x=w,f=m,g=!1):w<_&&(_=w,p=m,g=!0)}if(g?(gt(f),a!==p&>(p)):(p!==i&>(p),a!==f&>(f)),gt(a),r>=t.length||!m)break;gt(m),i=m}}else gt(f)}et&&ft([Q||et[0],tt||et[1]]),G.push(W.slice(0,q))}var bt=N.slice(N.length-1);if(F&&"h"!==bt&&"v"!==bt){for(var yt=!1,xt=-1,_t=[],wt=0;wt{"use strict";t.exports=function(t,e,r){"spline"===r("line.shape")&&r("line.smoothing")}},57931:t=>{"use strict";var e={tonextx:1,tonexty:1,tonext:1};t.exports=function(t,r,n){var i,o,a,s,l,c={},u=!1,h=-1,d=0,f=-1;for(o=0;o=0?l=f:(l=f=d,d++),l{"use strict";var n=r(7370);t.exports=function(t,e){e||(e=2);var r=t.marker,i=r.sizeref||1,o=r.sizemin||0,a="area"===r.sizemode?function(t){return Math.sqrt(t/i)}:function(t){return t/i};return function(t){var r=a(t/e);return n(r)&&r>0?Math.max(r,o):0}}},89927:t=>{"use strict";t.exports={container:"marker",min:"cmin",max:"cmax"}},86277:(t,e,r)=>{"use strict";var n=r(17499),i=r(42226).hasColorscale,o=r(94461),a=r(677);t.exports=function(t,e,r,s,l,c){var u=a.isBubble(t),h=(t.line||{}).color;c=c||{},h&&(r=h),l("marker.symbol"),l("marker.opacity",u?.7:1),l("marker.size"),c.noAngle||(l("marker.angle"),c.noAngleRef||l("marker.angleref"),c.noStandOff||l("marker.standoff")),l("marker.color",r),i(t,"marker")&&o(t,e,s,l,{prefix:"marker.",cLetter:"c"}),c.noSelect||(l("selected.marker.color"),l("unselected.marker.color"),l("selected.marker.size"),l("unselected.marker.size")),c.noLine||(l("marker.line.color",h&&!Array.isArray(h)&&e.marker.color!==h?h:u?n.background:n.defaultLine),i(t,"marker.line")&&o(t,e,s,l,{prefix:"marker.line.",cLetter:"c"}),l("marker.line.width",u?1:0)),u&&(l("marker.sizeref"),l("marker.sizemin"),l("marker.sizemode")),c.gradient&&"none"!==l("marker.gradient.type")&&l("marker.gradient.color")}},45952:(t,e,r)=>{"use strict";var n=r(12822).dateTick0,i=r(32994).ONEWEEK;function o(t,e){return n(e,t%i==0?1:0)}t.exports=function(t,e,r,n,i){if(i||(i={x:!0,y:!0}),i.x){var a=n("xperiod");a&&(n("xperiod0",o(a,e.xcalendar)),n("xperiodalignment"))}if(i.y){var s=n("yperiod");s&&(n("yperiod0",o(s,e.ycalendar)),n("yperiodalignment"))}}},54461:(t,e,r)=>{"use strict";var n=r(27941),i=r(25059),o=r(12822),a=o.ensureSingle,s=o.identity,l=r(40666),c=r(677),u=r(22980),h=r(57931),d=r(92620).tester;function f(t,e,r,h,f,p,m){var g,v=t._context.staticPlot;!function(t,e,r,i,a){var s=r.xaxis,l=r.yaxis,u=n.extent(o.simpleMap(s.range,s.r2c)),h=n.extent(o.simpleMap(l.range,l.r2c)),d=i[0].trace;if(c.hasMarkers(d)){var f=d.marker.maxdisplayed;if(0!==f){var p=i.filter((function(t){return t.x>=u[0]&&t.x<=u[1]&&t.y>=h[0]&&t.y<=h[1]})),m=Math.ceil(p.length/f),g=0;a.forEach((function(t,r){var n=t[0].trace;c.hasMarkers(n)&&n.marker.maxdisplayed>0&&r0;function y(t){return b?t.transition():t}var x=r.xaxis,_=r.yaxis,w=h[0].trace,k=w.line,A=n.select(p),M=a(A,"g","errorbars"),T=a(A,"g","lines"),S=a(A,"g","points"),C=a(A,"g","text");if(i.getComponentMethod("errorbars","plot")(t,M,r,m),!0===w.visible){var E,L;y(A).style("opacity",w.opacity);var z,O,D=w.fill.charAt(w.fill.length-1);"x"!==D&&"y"!==D&&(D=""),"y"===D?(z=1,O=_.c2p(0,!0)):"x"===D&&(z=0,O=x.c2p(0,!0)),h[0][r.isRangePlot?"nodeRangePlot3":"node3"]=A;var I,F,R="",P=[],j=w._prevtrace,N=null,B=null;j&&(R=j._prevRevpath||"",L=j._nextFill,P=j._ownPolygons,N=j._fillsegments,B=j._fillElement);var U,G,V,H,W,q,Y="",Z="",X=[];w._polygons=[];var $=[],J=[],K=o.noop;if(E=w._ownFill,c.hasLines(w)||"none"!==w.fill){L&&L.datum(h),-1!==["hv","vh","hvh","vhv"].indexOf(k.shape)?(U=l.steps(k.shape),G=l.steps(k.shape.split("").reverse().join(""))):U=G="spline"===k.shape?function(t){var e=t[t.length-1];return t.length>1&&t[0][0]===e[0]&&t[0][1]===e[1]?l.smoothclosed(t.slice(1),k.smoothing):l.smoothopen(t,k.smoothing)}:function(t){return"M"+t.join("L")},V=function(t){return G(t.reverse())},J=u(h,{xaxis:x,yaxis:_,trace:w,connectGaps:w.connectgaps,baseTolerance:Math.max(k.width||1,3)/4,shape:k.shape,backoff:k.backoff,simplify:k.simplify,fill:w.fill}),$=new Array(J.length);var Q=0;for(g=0;g0,g=h(t,e,r);(u=i.selectAll("g.trace").data(g,(function(t){return t[0].trace.uid}))).enter().append("g").attr("class",(function(t){return"trace scatter trace"+t[0].trace.uid})).style("stroke-miterlimit",2),u.order(),function(t,e,r){e.each((function(e){var i=a(n.select(this),"g","fills");l.setClipUrl(i,r.layerClipId,t);var o=e[0].trace,c=[];o._ownfill&&c.push("_ownFill"),o._nexttrace&&c.push("_nextFill");var u=i.selectAll("g").data(c,s);u.enter().append("g"),u.exit().each((function(t){o[t]=null})).remove(),u.order().each((function(t){o[t]=a(n.select(this),"path","js-fill")}))}))}(t,u,e),m?(c&&(d=c()),n.transition().duration(o.duration).ease(o.easing).each("end",(function(){d&&d()})).each("interrupt",(function(){d&&d()})).each((function(){i.selectAll("g.trace").each((function(r,n){f(t,n,e,r,g,this,o)}))}))):u.each((function(r,n){f(t,n,e,r,g,this,o)})),p&&u.exit().remove(),i.selectAll("path:not([d])").remove()}},96414:(t,e,r)=>{"use strict";var n=r(677);t.exports=function(t,e){var r,i,o,a,s=t.cd,l=t.xaxis,c=t.yaxis,u=[],h=s[0].trace;if(!n.hasMarkers(h)&&!n.hasText(h))return[];if(!1===e)for(r=0;r{"use strict";var e=["orientation","groupnorm","stackgaps"];t.exports=function(t,r,n,i){var o=n._scatterStackOpts,a=i("stackgroup");if(a){var s=r.xaxis+r.yaxis,l=o[s];l||(l=o[s]={});var c=l[a],u=!1;c?c.traces.push(r):(c=l[a]={traceIndices:[],traces:[r]},u=!0);for(var h={orientation:r.x&&!r.y?"h":"v"},d=0;d{"use strict";var n=r(27941),i=r(40666),o=r(25059);function a(t,e,r){i.pointStyle(t.selectAll("path.point"),e,r)}function s(t,e,r){i.textPointStyle(t.selectAll("text"),e,r)}t.exports={style:function(t){var e=n.select(t).selectAll("g.trace.scatter");e.style("opacity",(function(t){return t[0].trace.opacity})),e.selectAll("g.points").each((function(e){a(n.select(this),e.trace||e[0].trace,t)})),e.selectAll("g.text").each((function(e){s(n.select(this),e.trace||e[0].trace,t)})),e.selectAll("g.trace path.js-line").call(i.lineGroupStyle),e.selectAll("g.trace path.js-fill").call(i.fillGroupStyle,t,!1),o.getComponentMethod("errorbars","style")(e)},stylePoints:a,styleText:s,styleOnSelect:function(t,e,r){var n=e[0].trace;n.selectedpoints?(i.selectedPointStyle(r.selectAll("path.point"),n),i.selectedTextStyle(r.selectAll("text"),n)):(a(r,n,t),s(r,n,t))}}},677:(t,e,r)=>{"use strict";var n=r(12822),i=r(98507).isTypedArraySpec;t.exports={hasLines:function(t){return t.visible&&t.mode&&-1!==t.mode.indexOf("lines")},hasMarkers:function(t){return t.visible&&(t.mode&&-1!==t.mode.indexOf("markers")||"splom"===t.type)},hasText:function(t){return t.visible&&t.mode&&-1!==t.mode.indexOf("text")},isBubble:function(t){var e=t.marker;return n.isPlainObject(e)&&(n.isArrayOrTypedArray(e.size)||i(e.size))}}},46574:(t,e,r)=>{"use strict";var n=r(12822);t.exports=function(t,e,r,i,o){o=o||{},i("textposition"),n.coerceFont(i,"textfont",o.font||r.font,o),o.noSelect||(i("selected.textfont.color"),i("unselected.textfont.color"))}},56666:(t,e,r)=>{"use strict";var n=r(12822),i=r(25059);t.exports=function(t,e,r,o){var a,s=o("x"),l=o("y");if(i.getComponentMethod("calendars","handleTraceDefaults")(t,e,["x","y"],r),s){var c=n.minRowLength(s);l?a=Math.min(c,n.minRowLength(l)):(a=c,o("y0"),o("dy"))}else{if(!l)return 0;a=n.minRowLength(l),o("x0"),o("dx")}return e._length=a,a}},42674:(t,e,r)=>{"use strict";var n=r(98387),i=r(75058),o=r(89322),a=r(60393).axisHoverFormat,s=r(24131).rb,l=r(24131).ay,c=r(3520),u=r(55697),h=r(24134),d=r(98260).extendFlat,f=r(62309).overrideAll,p=r(54747),m=n.line,g=n.marker,v=g.line,b=d({width:m.width,dash:{valType:"enumerated",values:p(u),dflt:"solid",description:"Sets the dash style of the lines."}},o("line"));function y(t){return{show:{valType:"boolean",dflt:!1,description:["Sets whether or not projections are shown along the",t,"axis."].join(" ")},opacity:{valType:"number",min:0,max:1,dflt:1,description:"Sets the projection color."},scale:{valType:"number",min:0,max:10,dflt:2/3,description:["Sets the scale factor determining the size of the","projection marker points."].join(" ")}}}var x=t.exports=f({x:n.x,y:n.y,z:{valType:"data_array",description:"Sets the z coordinates."},text:d({},n.text,{description:["Sets text elements associated with each (x,y,z) triplet.","If a single string, the same string appears over","all the data points.","If an array of string, the items are mapped in order to the","this trace's (x,y,z) coordinates.","If trace `hoverinfo` contains a *text* flag and *hovertext* is not set,","these elements will be seen in the hover labels."].join(" ")}),texttemplate:l({},{}),hovertext:d({},n.hovertext,{description:["Sets text elements associated with each (x,y,z) triplet.","If a single string, the same string appears over","all the data points.","If an array of string, the items are mapped in order to the","this trace's (x,y,z) coordinates.","To be seen, trace `hoverinfo` must contain a *text* flag."].join(" ")}),hovertemplate:s(),xhoverformat:a("x"),yhoverformat:a("y"),zhoverformat:a("z"),mode:d({},n.mode,{dflt:"lines+markers"}),surfaceaxis:{valType:"enumerated",values:[-1,0,1,2],dflt:-1,description:["If *-1*, the scatter points are not fill with a surface","If *0*, *1*, *2*, the scatter points are filled with","a Delaunay surface about the x, y, z respectively."].join(" ")},surfacecolor:{valType:"color",description:"Sets the surface fill color."},projection:{x:y("x"),y:y("y"),z:y("z")},connectgaps:n.connectgaps,line:b,marker:d({symbol:{valType:"enumerated",values:p(h),dflt:"circle",arrayOk:!0,description:"Sets the marker symbol type."},size:d({},g.size,{dflt:8}),sizeref:g.sizeref,sizemin:g.sizemin,sizemode:g.sizemode,opacity:d({},g.opacity,{arrayOk:!1,description:["Sets the marker opacity.","Note that the marker opacity for scatter3d traces","must be a scalar value for performance reasons.","To set a blending opacity value","(i.e. which is not transparent), set *marker.color*","to an rgba color and use its alpha channel."].join(" ")}),colorbar:g.colorbar,line:d({width:d({},v.width,{arrayOk:!1})},o("marker.line"))},o("marker")),textposition:d({},n.textposition,{dflt:"top center"}),textfont:i({noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0,editType:"calc",colorEditType:"style",arrayOk:!0,variantValues:["normal","small-caps"],description:"Sets the text font."}),opacity:c.opacity,hoverinfo:d({},c.hoverinfo)},"calc","nested");x.x.editType=x.y.editType=x.z.editType="calc+clearAxisTypes"},34670:(t,e,r)=>{"use strict";var n=r(55508),i=r(45065);t.exports=function(t,e){var r=[{x:!1,y:!1,trace:e,t:{}}];return n(r,e),i(t,e),r}},35650:(t,e,r)=>{"use strict";var n=r(25059);function i(t,e,r,i){if(!e||!e.visible)return null;for(var o=n.getComponentMethod("errorbars","makeComputeError")(e),a=new Array(t.length),s=0;s0){var d=i.c2l(u);i._lowerLogErrorBound||(i._lowerLogErrorBound=d),i._lowerErrorBound=Math.min(i._lowerLogErrorBound,d)}}else a[s]=[-l[0]*r,l[1]*r]}return a}t.exports=function(t,e,r){var n=[i(t.x,t.error_x,e[0],r.xaxis),i(t.y,t.error_y,e[1],r.yaxis),i(t.z,t.error_z,e[2],r.zaxis)],o=function(t){for(var e=0;e{"use strict";var n=r(31845).gl_line3d,i=r(31845).gl_scatter3d,o=r(31845).gl_error3d,a=r(31845).gl_mesh3d,s=r(31845).delaunay_triangulate,l=r(12822),c=r(17235),u=r(25069).formatColor,h=r(43710),d=r(55697),f=r(24134),p=r(75815),m=r(66811).appendArrayPointValue,g=r(35650);function v(t,e){this.scene=t,this.uid=e,this.linePlot=null,this.scatterPlot=null,this.errorBars=null,this.textMarkers=null,this.delaunayMesh=null,this.color=null,this.mode="",this.dataPoints=[],this.axesBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.textLabels=null,this.data=null}var b=v.prototype;function y(t){return null==t?0:t.indexOf("left")>-1?-1:t.indexOf("right")>-1?1:0}function x(t){return null==t?0:t.indexOf("top")>-1?-1:t.indexOf("bottom")>-1?1:0}function _(t,e){return e(4*t)}function w(t){return f[t]}function k(t,e,r,n,i){var o=null;if(l.isArrayOrTypedArray(t)){o=[];for(var a=0;a=0){var C=function(t,e,r){var n,i=(r+1)%3,o=(r+2)%3,a=[],l=[];for(n=0;n{"use strict";var n=r(25059),i=r(12822),o=r(677),a=r(86277),s=r(51725),l=r(46574),c=r(42674);t.exports=function(t,e,r,u){function h(r,n){return i.coerce(t,e,c,r,n)}var d=function(t,e,r,i){var o=0,a=r("x"),s=r("y"),l=r("z");return n.getComponentMethod("calendars","handleTraceDefaults")(t,e,["x","y","z"],i),a&&s&&l&&(o=Math.min(a.length,s.length,l.length),e._length=e._xlength=e._ylength=e._zlength=o),o}(t,e,h,u);if(d){h("text"),h("hovertext"),h("hovertemplate"),h("xhoverformat"),h("yhoverformat"),h("zhoverformat"),h("mode"),o.hasMarkers(e)&&a(t,e,r,u,h,{noSelect:!0,noAngle:!0}),o.hasLines(e)&&(h("connectgaps"),s(t,e,r,u,h)),o.hasText(e)&&(h("texttemplate"),l(t,e,u,h,{noSelect:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0}));var f=(e.line||{}).color,p=(e.marker||{}).color;h("surfaceaxis")>=0&&h("surfacecolor",f||p);for(var m=["x","y","z"],g=0;g<3;++g){var v="projection."+m[g];h(v+".show")&&(h(v+".opacity"),h(v+".scale"))}var b=n.getComponentMethod("errorbars","supplyDefaults");b(t,e,f||p||r,{axis:"z"}),b(t,e,f||p||r,{axis:"y",inherit:"z"}),b(t,e,f||p||r,{axis:"x",inherit:"z"})}else e.visible=!1}},46443:(t,e,r)=>{"use strict";t.exports={plot:r(37031),attributes:r(42674),markerSymbols:r(24134),supplyDefaults:r(49957),colorbar:[{container:"marker",min:"cmin",max:"cmax"},{container:"line",min:"cmin",max:"cmax"}],calc:r(34670),moduleType:"trace",name:"scatter3d",basePlotModule:r(98030),categories:["gl3d","symbols","showLegend","scatter-like"],meta:{hrName:"scatter_3d",description:["The data visualized as scatter point or lines in 3D dimension","is set in `x`, `y`, `z`.","Text (appearing either on the chart or on hover only) is via `text`.","Bubble charts are achieved by setting `marker.size` and/or `marker.color`","Projections are achieved via `projection`.","Surface fills are achieved via `surfaceaxis`."].join(" ")}}},77982:(t,e,r)=>{"use strict";var n=r(3520),i=r(75058),o=r(43591),a=r(98387),s=r(60393).axisHoverFormat,l=r(89322),c=r(54747),u=r(98260).extendFlat,h=r(62309).overrideAll,d=r(49538).DASHES,f=a.line,p=a.marker,m=p.line,g=t.exports=h({x:a.x,x0:a.x0,dx:a.dx,y:a.y,y0:a.y0,dy:a.dy,xperiod:a.xperiod,yperiod:a.yperiod,xperiod0:a.xperiod0,yperiod0:a.yperiod0,xperiodalignment:a.xperiodalignment,yperiodalignment:a.yperiodalignment,xhoverformat:s("x"),yhoverformat:s("y"),text:a.text,hovertext:a.hovertext,textposition:a.textposition,textfont:i({noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0,editType:"calc",colorEditType:"style",arrayOk:!0,noNumericWeightValues:!0,variantValues:["normal","small-caps"],description:"Sets the text font."}),mode:{valType:"flaglist",flags:["lines","markers","text"],extras:["none"],description:["Determines the drawing mode for this scatter trace."].join(" ")},line:{color:f.color,width:f.width,shape:{valType:"enumerated",values:["linear","hv","vh","hvh","vhv"],dflt:"linear",editType:"plot",description:["Determines the line shape.","The values correspond to step-wise line shapes."].join(" ")},dash:{valType:"enumerated",values:c(d),dflt:"solid",description:"Sets the style of the lines."}},marker:u({},l("marker"),{symbol:p.symbol,angle:p.angle,size:p.size,sizeref:p.sizeref,sizemin:p.sizemin,sizemode:p.sizemode,opacity:p.opacity,colorbar:p.colorbar,line:u({},l("marker.line"),{width:m.width})}),connectgaps:a.connectgaps,fill:u({},a.fill,{dflt:"none"}),fillcolor:o(),selected:{marker:a.selected.marker,textfont:a.selected.textfont},unselected:{marker:a.unselected.marker,textfont:a.unselected.textfont},opacity:n.opacity},"calc","nested");g.x.editType=g.y.editType=g.x0.editType=g.y0.editType="calc+clearAxisTypes",g.hovertemplate=a.hovertemplate,g.texttemplate=a.texttemplate},78737:(t,e,r)=>{"use strict";var n=r(88625);t.exports={moduleType:"trace",name:"scattergl",basePlotModule:r(29592),categories:["gl","regl","cartesian","symbols","errorBarsOK","showLegend","scatter-like"],attributes:r(77982),supplyDefaults:r(51465),crossTraceDefaults:r(30415),colorbar:r(89927),formatLabels:r(18948),calc:r(54874),hoverPoints:n.hoverPoints,selectPoints:r(76787),meta:{hrName:"scatter_gl",description:["The data visualized as scatter point or lines is set in `x` and `y`","using the WebGL plotting engine.","Bubble charts are achieved by setting `marker.size` and/or `marker.color`","to a numerical arrays."].join(" ")}}},54874:(t,e,r)=>{"use strict";var n=r(4832),i=r(12822),o=r(99246),a=r(19496).findExtremes,s=r(15389),l=r(93459),c=l.calcMarkerSize,u=l.calcAxisExpansion,h=l.setFirstScatter,d=r(45065),f=r(77064),p=r(7111),m=r(32994).BADNUM,g=r(49538).TOO_MANY_POINTS;function v(t,e,r){var n=t._extremes[e._id],i=a(e,r._bnds,{padded:!0});n.min=n.min.concat(i.min),n.max=n.max.concat(i.max)}t.exports=function(t,e){var r,a=t._fullLayout,l=e._xA=o.getFromId(t,e.xaxis,"x"),b=e._yA=o.getFromId(t,e.yaxis,"y"),y=a._plots[e.xaxis+e.yaxis],x=e._length,_=x>=g,w=2*x,k={},A=l.makeCalcdata(e,"x"),M=b.makeCalcdata(e,"y"),T=s(e,l,"x",A),S=s(e,b,"y",M),C=T.vals,E=S.vals;e._x=C,e._y=E,e.xperiodalignment&&(e._origX=A,e._xStarts=T.starts,e._xEnds=T.ends),e.yperiodalignment&&(e._origY=M,e._yStarts=S.starts,e._yEnds=S.ends);var L=new Array(w),z=new Array(x);for(r=0;r1&&i.extendFlat(s.line,f.linePositions(t,r,n)),s.errorX||s.errorY){var l=f.errorBarPositions(t,r,n,o,a);s.errorX&&i.extendFlat(s.errorX,l.x),s.errorY&&i.extendFlat(s.errorY,l.y)}return s.text&&(i.extendFlat(s.text,{positions:n},f.textPosition(t,r,s.text,s.marker)),i.extendFlat(s.textSel,{positions:n},f.textPosition(t,r,s.text,s.markerSel)),i.extendFlat(s.textUnsel,{positions:n},f.textPosition(t,r,s.text,s.markerUnsel))),s}(t,0,e,L,C,E),I=p(t,y);return h(a,e),_?D.marker&&(O=D.marker.sizeAvg||Math.max(D.marker.size,3)):O=c(e,x),u(t,e,l,b,C,E,O),D.errorX&&v(e,l,D.errorX),D.errorY&&v(e,b,D.errorY),D.fill&&!I.fill2d&&(I.fill2d=!0),D.marker&&!I.scatter2d&&(I.scatter2d=!0),D.line&&!I.line2d&&(I.line2d=!0),!D.errorX&&!D.errorY||I.error2d||(I.error2d=!0),D.text&&!I.glText&&(I.glText=!0),D.marker&&(D.marker.snap=x),I.lineOptions.push(D.line),I.errorXOptions.push(D.errorX),I.errorYOptions.push(D.errorY),I.fillOptions.push(D.fill),I.markerOptions.push(D.marker),I.markerSelectedOptions.push(D.markerSel),I.markerUnselectedOptions.push(D.markerUnsel),I.textOptions.push(D.text),I.textSelectedOptions.push(D.textSel),I.textUnselectedOptions.push(D.textUnsel),I.selectBatch.push([]),I.unselectBatch.push([]),k._scene=I,k.index=I.count,k.x=C,k.y=E,k.positions=L,I.count++,[{x:!1,y:!1,t:k,trace:e}]}},49538:t=>{"use strict";t.exports={TOO_MANY_POINTS:1e5,SYMBOL_SDF_SIZE:200,SYMBOL_SIZE:20,SYMBOL_STROKE:1,DOT_RE:/-dot/,OPEN_RE:/-open/,DASHES:{solid:[1],dot:[1,1],dash:[4,1],longdash:[8,1],dashdot:[4,1,1,1],longdashdot:[8,1,1,1]}}},77064:(t,e,r)=>{"use strict";var n=r(7370),i=r(77622),o=r(34463),a=r(25059),s=r(12822),l=s.isArrayOrTypedArray,c=r(40666),u=r(99246),h=r(25069).formatColor,d=r(677),f=r(43710),p=r(91886),m=r(49538),g=r(11891).DESELECTDIM,v={start:1,left:1,end:-1,right:-1,middle:0,center:0,bottom:1,top:-1},b=r(66811).appendArrayPointValue;function y(t,e){var r,i=t._fullLayout,o=e._length,a=e.textfont,c=e.textposition,u=l(c)?c:[c],h=a.color,d=a.size,f=a.family,p=a.weight,m=a.style,g=a.variant,v={},y=t._context.plotGlPixelRatio,_=e.texttemplate;if(_){v.text=[];var w=i._d3locale,k=Array.isArray(_),A=k?Math.min(_.length,o):o,M=k?function(t){return _[t]}:function(){return _};for(r=0;r500?"bold":"normal":t}function _(t,e){var r,n,i=e._length,a=e.marker,s={},c=l(a.symbol),u=l(a.angle),d=l(a.color),m=l(a.line.color),g=l(a.opacity),v=l(a.size),b=l(a.line.width);if(c||(n=p.isOpenSymbol(a.symbol)),c||d||m||g||u){s.symbols=new Array(i),s.angles=new Array(i),s.colors=new Array(i),s.borderColors=new Array(i);var y=a.symbol,x=a.angle,_=h(a,a.opacity,i),w=h(a.line,a.opacity,i);if(!l(w[0])){var k=w;for(w=Array(i),r=0;rm.TOO_MANY_POINTS||d.hasMarkers(e)?"rect":"round";if(c&&e.connectgaps){var h=n[0],f=n[1];for(i=0;i1?c[i]:c[0]:c,m=l(u)?u.length>1?u[i]:u[0]:u,g=v[p],b=v[m],y=h?h/.8+1:0,x=-b*y-.5*b;a.offset[i]=[g*y/f,x/f]}}return a}}},51465:(t,e,r)=>{"use strict";var n=r(12822),i=r(25059),o=r(91886),a=r(77982),s=r(32565),l=r(677),c=r(56666),u=r(45952),h=r(86277),d=r(51725),f=r(12261),p=r(46574);t.exports=function(t,e,r,m){function g(r,i){return n.coerce(t,e,a,r,i)}var v=!!t.marker&&o.isOpenSymbol(t.marker.symbol),b=l.isBubble(t),y=c(t,e,m,g);if(y){u(t,e,m,g),g("xhoverformat"),g("yhoverformat");var x=y{"use strict";var n=r(12822),i=r(17499),o=r(11891).DESELECTDIM;t.exports={styleTextSelection:function(t){var e,r,a=t[0],s=a.trace,l=a.t,c=l._scene,u=l.index,h=c.selectBatch[u],d=c.unselectBatch[u],f=c.textOptions[u],p=c.textSelectedOptions[u]||{},m=c.textUnselectedOptions[u]||{},g=n.extendFlat({},f);if(h.length||d.length){var v=p.color,b=m.color,y=f.color,x=n.isArrayOrTypedArray(y);for(g.color=new Array(s._length),e=0;e{"use strict";var n=r(23315);t.exports=function(t,e,r){var i=t.i;return"x"in t||(t.x=e._x[i]),"y"in t||(t.y=e._y[i]),n(t,e,r)}},91886:(t,e,r)=>{"use strict";var n=r(49538);e.isOpenSymbol=function(t){return"string"==typeof t?n.OPEN_RE.test(t):t%200>100},e.isDotSymbol=function(t){return"string"==typeof t?n.DOT_RE.test(t):t>200}},88625:(t,e,r)=>{"use strict";var n=r(25059),i=r(12822),o=r(90566);function a(t,e,r,a){var s=t.xa,l=t.ya,c=t.distance,u=t.dxy,h=t.index,d={pointNumber:h,x:e[h],y:r[h]};d.tx=i.isArrayOrTypedArray(a.text)?a.text[h]:a.text,d.htx=Array.isArray(a.hovertext)?a.hovertext[h]:a.hovertext,d.data=Array.isArray(a.customdata)?a.customdata[h]:a.customdata,d.tp=Array.isArray(a.textposition)?a.textposition[h]:a.textposition;var f=a.textfont;f&&(d.ts=i.isArrayOrTypedArray(f.size)?f.size[h]:f.size,d.tc=i.isArrayOrTypedArray(f.color)?f.color[h]:f.color,d.tf=Array.isArray(f.family)?f.family[h]:f.family,d.tw=Array.isArray(f.weight)?f.weight[h]:f.weight,d.ty=Array.isArray(f.style)?f.style[h]:f.style,d.tv=Array.isArray(f.variant)?f.variant[h]:f.variant);var p=a.marker;p&&(d.ms=i.isArrayOrTypedArray(p.size)?p.size[h]:p.size,d.mo=i.isArrayOrTypedArray(p.opacity)?p.opacity[h]:p.opacity,d.mx=i.isArrayOrTypedArray(p.symbol)?p.symbol[h]:p.symbol,d.ma=i.isArrayOrTypedArray(p.angle)?p.angle[h]:p.angle,d.mc=i.isArrayOrTypedArray(p.color)?p.color[h]:p.color);var m=p&&p.line;m&&(d.mlc=Array.isArray(m.color)?m.color[h]:m.color,d.mlw=i.isArrayOrTypedArray(m.width)?m.width[h]:m.width);var g=p&&p.gradient;g&&"none"!==g.type&&(d.mgt=Array.isArray(g.type)?g.type[h]:g.type,d.mgc=Array.isArray(g.color)?g.color[h]:g.color);var v=s.c2p(d.x,!0),b=l.c2p(d.y,!0),y=d.mrc||1,x=a.hoverlabel;x&&(d.hbg=Array.isArray(x.bgcolor)?x.bgcolor[h]:x.bgcolor,d.hbc=Array.isArray(x.bordercolor)?x.bordercolor[h]:x.bordercolor,d.hts=i.isArrayOrTypedArray(x.font.size)?x.font.size[h]:x.font.size,d.htc=Array.isArray(x.font.color)?x.font.color[h]:x.font.color,d.htf=Array.isArray(x.font.family)?x.font.family[h]:x.font.family,d.hnl=i.isArrayOrTypedArray(x.namelength)?x.namelength[h]:x.namelength);var _=a.hoverinfo;_&&(d.hi=Array.isArray(_)?_[h]:_);var w=a.hovertemplate;w&&(d.ht=Array.isArray(w)?w[h]:w);var k={};k[t.index]=d;var A=a._origX,M=a._origY,T=i.extendFlat({},t,{color:o(a,d),x0:v-y,x1:v+y,xLabelVal:A?A[h]:d.x,y0:b-y,y1:b+y,yLabelVal:M?M[h]:d.y,cd:k,distance:c,spikeDistance:u,hovertemplate:d.ht});return d.htx?T.text=d.htx:d.tx?T.text=d.tx:a.text&&(T.text=a.text),i.fillText(d,a,T),n.getComponentMethod("errorbars","hoverInfo")(d,a,T),T}t.exports={hoverPoints:function(t,e,r,n){var i,o,s,l,c,u,h,d,f,p,m=t.cd,g=m[0].t,v=m[0].trace,b=t.xa,y=t.ya,x=g.x,_=g.y,w=b.c2p(e),k=y.c2p(r),A=t.distance;if(g.tree){var M=b.p2c(w-A),T=b.p2c(w+A),S=y.p2c(k-A),C=y.p2c(k+A);i="x"===n?g.tree.range(Math.min(M,T),Math.min(y._rl[0],y._rl[1]),Math.max(M,T),Math.max(y._rl[0],y._rl[1])):g.tree.range(Math.min(M,T),Math.min(S,C),Math.max(M,T),Math.max(S,C))}else i=g.ids;var E=A;if("x"===n){var L=!!v.xperiodalignment,z=!!v.yperiodalignment;for(u=0;u=Math.min(O,D)&&w<=Math.max(O,D)?0:1/0}if(h=Math.min(I,F)&&k<=Math.max(I,F)?0:1/0}p=Math.sqrt(h*h+d*d),s=i[u]}}}else for(u=i.length-1;u>-1;u--)l=x[o=i[u]],c=_[o],h=b.c2p(l)-w,d=y.c2p(c)-k,(f=Math.sqrt(h*h+d*d)){"use strict";var n=r(78737);n.plot=r(96360),t.exports=n},96360:(t,e,r)=>{"use strict";var n=r(51645),i=r(98331),o=r(86373),a=r(69499),s=r(12822),l=r(14295).selectMode,c=r(41246),u=r(677),h=r(57931),d=r(4673).styleTextSelection,f={};function p(t,e,r,n){var i=t._size,o=t.width*n,a=t.height*n,s=i.l*n,l=i.b*n,c=i.r*n,u=i.t*n,h=i.w*n,d=i.h*n;return[s+e.domain[0]*h,l+r.domain[0]*d,o-c-(1-e.domain[1])*h,a-u-(1-r.domain[1])*d]}(t.exports=function(t,e,r){if(r.length){var m,g,v=t._fullLayout,b=e._scene,y=e.xaxis,x=e.yaxis;if(b)if(c(t,["ANGLE_instanced_arrays","OES_element_index_uint"],f)){var _=b.count,w=v._glcanvas.data()[0].regl;if(h(t,e,r),b.dirty){if(!b.line2d&&!b.error2d||b.scatter2d||b.fill2d||b.glText||w.clear({}),!0===b.error2d&&(b.error2d=o(w)),!0===b.line2d&&(b.line2d=i(w)),!0===b.scatter2d&&(b.scatter2d=n(w)),!0===b.fill2d&&(b.fill2d=i(w)),!0===b.glText)for(b.glText=new Array(_),m=0;m<_;m++)b.glText[m]=new a(w);if(b.glText){if(_>b.glText.length){var k=_-b.glText.length;for(m=0;mr&&(isNaN(e[n])||isNaN(e[n+1]));)n-=2;t.positions=e.slice(r,n+2)}return t})),b.line2d.update(b.lineOptions)),b.error2d){var M=(b.errorXOptions||[]).concat(b.errorYOptions||[]);b.error2d.update(M)}b.scatter2d&&b.scatter2d.update(b.markerOptions),b.fillOrder=s.repeat(null,_),b.fill2d&&(b.fillOptions=b.fillOptions.map((function(t,e){var n=r[e];if(t&&n&&n[0]&&n[0].trace){var i,o,a=n[0],s=a.trace,l=a.t,c=b.lineOptions[e],u=[];s._ownfill&&u.push(e),s._nexttrace&&u.push(e+1),u.length&&(b.fillOrder[e]=u);var h,d,f=[],p=c&&c.positions||l.positions;if("tozeroy"===s.fill){for(h=0;hh&&isNaN(p[d+1]);)d-=2;0!==p[h+1]&&(f=[p[h],0]),f=f.concat(p.slice(h,d+2)),0!==p[d+1]&&(f=f.concat([p[d],0]))}else if("tozerox"===s.fill){for(h=0;hh&&isNaN(p[d]);)d-=2;0!==p[h]&&(f=[0,p[h+1]]),f=f.concat(p.slice(h,d+2)),0!==p[d]&&(f=f.concat([0,p[d+1]]))}else if("toself"===s.fill||"tonext"===s.fill){for(f=[],i=0,t.splitNull=!0,o=0;o-1;for(m=0;m<_;m++){var E=r[m][0],L=E.trace,z=E.t,O=z.index,D=L._length,I=z.x,F=z.y;if(L.selectedpoints||S||C){if(S||(S=!0),L.selectedpoints){var R=b.selectBatch[O]=s.selIndices2selPoints(L),P={};for(g=0;g{"use strict";var n=r(12822);t.exports=function(t,e){var r=e._scene,i={count:0,dirty:!0,lineOptions:[],fillOptions:[],markerOptions:[],markerSelectedOptions:[],markerUnselectedOptions:[],errorXOptions:[],errorYOptions:[],textOptions:[],textSelectedOptions:[],textUnselectedOptions:[],selectBatch:[],unselectBatch:[]},o={fill2d:!1,scatter2d:!1,error2d:!1,line2d:!1,glText:!1,select2d:!1};return e._scene||((r=e._scene={}).init=function(){n.extendFlat(r,o,i)},r.init(),r.update=function(t){var e=n.repeat(t,r.count);if(r.fill2d&&r.fill2d.update(e),r.scatter2d&&r.scatter2d.update(e),r.line2d&&r.line2d.update(e),r.error2d&&r.error2d.update(e.concat(e)),r.select2d&&r.select2d.update(e),r.glText)for(var i=0;i{"use strict";var n=r(677),i=r(4673).styleTextSelection;t.exports=function(t,e){var r=t.cd,o=t.xaxis,a=t.yaxis,s=[],l=r[0].trace,c=r[0].t,u=l._length,h=c.x,d=c.y,f=c._scene,p=c.index;if(!f)return s;var m=n.hasText(l),g=n.hasMarkers(l),v=!g&&!m;if(!0!==l.visible||v)return s;var b=[],y=[];if(!1!==e&&!e.degenerate)for(var x=0;x{"use strict";e.version="2.35.2"},31845:(t,e,r)=>{var n=r(39807);!function(){var e={1964:function(t,e,r){t.exports={alpha_shape:r(3502),convex_hull:r(7352),delaunay_triangulate:r(7642),gl_cone3d:r(6405),gl_error3d:r(9165),gl_heatmap2d:r(2510),gl_line3d:r(5714),gl_mesh3d:r(7201),gl_plot2d:r(1850),gl_plot3d:r(4100),gl_pointcloud2d:r(4696),gl_scatter3d:r(8418),gl_select_box:r(3161),gl_spikes2d:r(4098),gl_streamtube3d:r(7815),gl_surface3d:r(9499),ndarray:r(9618),ndarray_linear_interpolate:r(4317)}},4793:function(t,e,r){"use strict";function n(t,e){for(var r=0;rd)throw new RangeError('The value "'+t+'" is invalid for option "size"');var e=new Uint8Array(t);return Object.setPrototypeOf(e,p.prototype),e}function p(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return v(t)}return m(t,e,r)}function m(t,e,r){if("string"==typeof t)return function(t,e){if("string"==typeof e&&""!==e||(e="utf8"),!p.isEncoding(e))throw new TypeError("Unknown encoding: "+e);var r=0|_(t,e),n=f(r),i=n.write(t,e);return i!==r&&(n=n.slice(0,i)),n}(t,e);if(ArrayBuffer.isView(t))return function(t){if(et(t,Uint8Array)){var e=new Uint8Array(t);return y(e.buffer,e.byteOffset,e.byteLength)}return b(t)}(t);if(null==t)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+l(t));if(et(t,ArrayBuffer)||t&&et(t.buffer,ArrayBuffer))return y(t,e,r);if("undefined"!=typeof SharedArrayBuffer&&(et(t,SharedArrayBuffer)||t&&et(t.buffer,SharedArrayBuffer)))return y(t,e,r);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');var n=t.valueOf&&t.valueOf();if(null!=n&&n!==t)return p.from(n,e,r);var i=function(t){if(p.isBuffer(t)){var e=0|x(t.length),r=f(e);return 0===r.length||t.copy(r,0,0,e),r}return void 0!==t.length?"number"!=typeof t.length||rt(t.length)?f(0):b(t):"Buffer"===t.type&&Array.isArray(t.data)?b(t.data):void 0}(t);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return p.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+l(t))}function g(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function v(t){return g(t),f(t<0?0:0|x(t))}function b(t){for(var e=t.length<0?0:0|x(t.length),r=f(e),n=0;n=d)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+d.toString(16)+" bytes");return 0|t}function _(t,e){if(p.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||et(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+l(t));var r=t.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var i=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return K(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return Q(t).length;default:if(i)return n?-1:K(t).length;e=(""+e).toLowerCase(),i=!0}}function w(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return R(this,e,r);case"utf8":case"utf-8":return O(this,e,r);case"ascii":return I(this,e,r);case"latin1":case"binary":return F(this,e,r);case"base64":return z(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return P(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function k(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function A(t,e,r,n,i){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),rt(r=+r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof e&&(e=p.from(e,n)),p.isBuffer(e))return 0===e.length?-1:M(t,e,r,n,i);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):M(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function M(t,e,r,n,i){var o,a=1,s=t.length,l=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;a=2,s/=2,l/=2,r/=2}function c(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}if(i){var u=-1;for(o=r;os&&(r=s-l),o=r;o>=0;o--){for(var h=!0,d=0;di&&(n=i):n=i;var o,a=e.length;for(n>a/2&&(n=a/2),o=0;o>8,i=r%256,o.push(i),o.push(n);return o}(e,t.length-r),t,r,n)}function z(t,e,r){return 0===e&&r===t.length?c.fromByteArray(t):c.fromByteArray(t.slice(e,r))}function O(t,e,r){r=Math.min(t.length,r);for(var n=[],i=e;i239?4:o>223?3:o>191?2:1;if(i+s<=r){var l=void 0,c=void 0,u=void 0,h=void 0;switch(s){case 1:o<128&&(a=o);break;case 2:128==(192&(l=t[i+1]))&&(h=(31&o)<<6|63&l)>127&&(a=h);break;case 3:l=t[i+1],c=t[i+2],128==(192&l)&&128==(192&c)&&(h=(15&o)<<12|(63&l)<<6|63&c)>2047&&(h<55296||h>57343)&&(a=h);break;case 4:l=t[i+1],c=t[i+2],u=t[i+3],128==(192&l)&&128==(192&c)&&128==(192&u)&&(h=(15&o)<<18|(63&l)<<12|(63&c)<<6|63&u)>65535&&h<1114112&&(a=h)}}null===a?(a=65533,s=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|1023&a),n.push(a),i+=s}return function(t){var e=t.length;if(e<=D)return String.fromCharCode.apply(String,t);for(var r="",n=0;nn.length?(p.isBuffer(o)||(o=p.from(o)),o.copy(n,i)):Uint8Array.prototype.set.call(n,o,i);else{if(!p.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(n,i)}i+=o.length}return n},p.byteLength=_,p.prototype._isBuffer=!0,p.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;er&&(t+=" ... "),""},h&&(p.prototype[h]=p.prototype.inspect),p.prototype.compare=function(t,e,r,n,i){if(et(t,Uint8Array)&&(t=p.from(t,t.offset,t.byteLength)),!p.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+l(t));if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(this===t)return 0;for(var o=(i>>>=0)-(n>>>=0),a=(r>>>=0)-(e>>>=0),s=Math.min(o,a),c=this.slice(n,i),u=t.slice(e,r),h=0;h>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-e;if((void 0===r||r>i)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return T(this,t,e,r);case"utf8":case"utf-8":return S(this,t,e,r);case"ascii":case"latin1":case"binary":return C(this,t,e,r);case"base64":return E(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return L(this,t,e,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},p.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var D=4096;function I(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;in)&&(r=n);for(var i="",o=e;or)throw new RangeError("Trying to access beyond buffer length")}function N(t,e,r,n,i,o){if(!p.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||et.length)throw new RangeError("Index out of range")}function B(t,e,r,n,i){Z(e,n,i,t,r,7);var o=Number(e&BigInt(4294967295));t[r++]=o,o>>=8,t[r++]=o,o>>=8,t[r++]=o,o>>=8,t[r++]=o;var a=Number(e>>BigInt(32)&BigInt(4294967295));return t[r++]=a,a>>=8,t[r++]=a,a>>=8,t[r++]=a,a>>=8,t[r++]=a,r}function U(t,e,r,n,i){Z(e,n,i,t,r,7);var o=Number(e&BigInt(4294967295));t[r+7]=o,o>>=8,t[r+6]=o,o>>=8,t[r+5]=o,o>>=8,t[r+4]=o;var a=Number(e>>BigInt(32)&BigInt(4294967295));return t[r+3]=a,a>>=8,t[r+2]=a,a>>=8,t[r+1]=a,a>>=8,t[r]=a,r+8}function G(t,e,r,n,i,o){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function V(t,e,r,n,i){return e=+e,r>>>=0,i||G(t,0,r,4),u.write(t,e,r,n,23,4),r+4}function H(t,e,r,n,i){return e=+e,r>>>=0,i||G(t,0,r,8),u.write(t,e,r,n,52,8),r+8}p.prototype.slice=function(t,e){var r=this.length;(t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e>>=0,e>>>=0,r||j(t,e,this.length);for(var n=this[t],i=1,o=0;++o>>=0,e>>>=0,r||j(t,e,this.length);for(var n=this[t+--e],i=1;e>0&&(i*=256);)n+=this[t+--e]*i;return n},p.prototype.readUint8=p.prototype.readUInt8=function(t,e){return t>>>=0,e||j(t,1,this.length),this[t]},p.prototype.readUint16LE=p.prototype.readUInt16LE=function(t,e){return t>>>=0,e||j(t,2,this.length),this[t]|this[t+1]<<8},p.prototype.readUint16BE=p.prototype.readUInt16BE=function(t,e){return t>>>=0,e||j(t,2,this.length),this[t]<<8|this[t+1]},p.prototype.readUint32LE=p.prototype.readUInt32LE=function(t,e){return t>>>=0,e||j(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},p.prototype.readUint32BE=p.prototype.readUInt32BE=function(t,e){return t>>>=0,e||j(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},p.prototype.readBigUInt64LE=it((function(t){X(t>>>=0,"offset");var e=this[t],r=this[t+7];void 0!==e&&void 0!==r||$(t,this.length-8);var n=e+this[++t]*Math.pow(2,8)+this[++t]*Math.pow(2,16)+this[++t]*Math.pow(2,24),i=this[++t]+this[++t]*Math.pow(2,8)+this[++t]*Math.pow(2,16)+r*Math.pow(2,24);return BigInt(n)+(BigInt(i)<>>=0,"offset");var e=this[t],r=this[t+7];void 0!==e&&void 0!==r||$(t,this.length-8);var n=e*Math.pow(2,24)+this[++t]*Math.pow(2,16)+this[++t]*Math.pow(2,8)+this[++t],i=this[++t]*Math.pow(2,24)+this[++t]*Math.pow(2,16)+this[++t]*Math.pow(2,8)+r;return(BigInt(n)<>>=0,e>>>=0,r||j(t,e,this.length);for(var n=this[t],i=1,o=0;++o=(i*=128)&&(n-=Math.pow(2,8*e)),n},p.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||j(t,e,this.length);for(var n=e,i=1,o=this[t+--n];n>0&&(i*=256);)o+=this[t+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*e)),o},p.prototype.readInt8=function(t,e){return t>>>=0,e||j(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},p.prototype.readInt16LE=function(t,e){t>>>=0,e||j(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},p.prototype.readInt16BE=function(t,e){t>>>=0,e||j(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},p.prototype.readInt32LE=function(t,e){return t>>>=0,e||j(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},p.prototype.readInt32BE=function(t,e){return t>>>=0,e||j(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},p.prototype.readBigInt64LE=it((function(t){X(t>>>=0,"offset");var e=this[t],r=this[t+7];void 0!==e&&void 0!==r||$(t,this.length-8);var n=this[t+4]+this[t+5]*Math.pow(2,8)+this[t+6]*Math.pow(2,16)+(r<<24);return(BigInt(n)<>>=0,"offset");var e=this[t],r=this[t+7];void 0!==e&&void 0!==r||$(t,this.length-8);var n=(e<<24)+this[++t]*Math.pow(2,16)+this[++t]*Math.pow(2,8)+this[++t];return(BigInt(n)<>>=0,e||j(t,4,this.length),u.read(this,t,!0,23,4)},p.prototype.readFloatBE=function(t,e){return t>>>=0,e||j(t,4,this.length),u.read(this,t,!1,23,4)},p.prototype.readDoubleLE=function(t,e){return t>>>=0,e||j(t,8,this.length),u.read(this,t,!0,52,8)},p.prototype.readDoubleBE=function(t,e){return t>>>=0,e||j(t,8,this.length),u.read(this,t,!1,52,8)},p.prototype.writeUintLE=p.prototype.writeUIntLE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||N(this,t,e,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[e]=255&t;++o>>=0,r>>>=0,n||N(this,t,e,r,Math.pow(2,8*r)-1,0);var i=r-1,o=1;for(this[e+i]=255&t;--i>=0&&(o*=256);)this[e+i]=t/o&255;return e+r},p.prototype.writeUint8=p.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||N(this,t,e,1,255,0),this[e]=255&t,e+1},p.prototype.writeUint16LE=p.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||N(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},p.prototype.writeUint16BE=p.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||N(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},p.prototype.writeUint32LE=p.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||N(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},p.prototype.writeUint32BE=p.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||N(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},p.prototype.writeBigUInt64LE=it((function(t){return B(this,t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,BigInt(0),BigInt("0xffffffffffffffff"))})),p.prototype.writeBigUInt64BE=it((function(t){return U(this,t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,BigInt(0),BigInt("0xffffffffffffffff"))})),p.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var i=Math.pow(2,8*r-1);N(this,t,e,r,i-1,-i)}var o=0,a=1,s=0;for(this[e]=255&t;++o>>=0,!n){var i=Math.pow(2,8*r-1);N(this,t,e,r,i-1,-i)}var o=r-1,a=1,s=0;for(this[e+o]=255&t;--o>=0&&(a*=256);)t<0&&0===s&&0!==this[e+o+1]&&(s=1),this[e+o]=(t/a|0)-s&255;return e+r},p.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||N(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},p.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||N(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},p.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||N(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},p.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||N(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},p.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||N(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},p.prototype.writeBigInt64LE=it((function(t){return B(this,t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),p.prototype.writeBigInt64BE=it((function(t){return U(this,t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),p.prototype.writeFloatLE=function(t,e,r){return V(this,t,e,!0,r)},p.prototype.writeFloatBE=function(t,e,r){return V(this,t,e,!1,r)},p.prototype.writeDoubleLE=function(t,e,r){return H(this,t,e,!0,r)},p.prototype.writeDoubleBE=function(t,e,r){return H(this,t,e,!1,r)},p.prototype.copy=function(t,e,r,n){if(!p.isBuffer(t))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(o=e;o=n+4;r-=3)e="_".concat(t.slice(r-3,r)).concat(e);return"".concat(t.slice(0,r)).concat(e)}function Z(t,e,r,n,i,o){if(t>r||t3?0===e||e===BigInt(0)?">= 0".concat(s," and < 2").concat(s," ** ").concat(8*(o+1)).concat(s):">= -(2".concat(s," ** ").concat(8*(o+1)-1).concat(s,") and < 2 ** ")+"".concat(8*(o+1)-1).concat(s):">= ".concat(e).concat(s," and <= ").concat(r).concat(s),new W.ERR_OUT_OF_RANGE("value",a,t)}!function(t,e,r){X(e,"offset"),void 0!==t[e]&&void 0!==t[e+r]||$(e,t.length-(r+1))}(n,i,o)}function X(t,e){if("number"!=typeof t)throw new W.ERR_INVALID_ARG_TYPE(e,"number",t)}function $(t,e,r){if(Math.floor(t)!==t)throw X(t,r),new W.ERR_OUT_OF_RANGE(r||"offset","an integer",t);if(e<0)throw new W.ERR_BUFFER_OUT_OF_BOUNDS;throw new W.ERR_OUT_OF_RANGE(r||"offset",">= ".concat(r?1:0," and <= ").concat(e),t)}q("ERR_BUFFER_OUT_OF_BOUNDS",(function(t){return t?"".concat(t," is outside of buffer bounds"):"Attempt to access memory outside buffer bounds"}),RangeError),q("ERR_INVALID_ARG_TYPE",(function(t,e){return'The "'.concat(t,'" argument must be of type number. Received type ').concat(l(e))}),TypeError),q("ERR_OUT_OF_RANGE",(function(t,e,r){var n='The value of "'.concat(t,'" is out of range.'),i=r;return Number.isInteger(r)&&Math.abs(r)>Math.pow(2,32)?i=Y(String(r)):"bigint"==typeof r&&(i=String(r),(r>Math.pow(BigInt(2),BigInt(32))||r<-Math.pow(BigInt(2),BigInt(32)))&&(i=Y(i)),i+="n"),n+" It must be ".concat(e,". Received ").concat(i)}),RangeError);var J=/[^+/0-9A-Za-z-_]/g;function K(t,e){var r;e=e||1/0;for(var n=t.length,i=null,o=[],a=0;a55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(a+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function Q(t){return c.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(J,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function tt(t,e,r,n){var i;for(i=0;i=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function et(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function rt(t){return t!=t}var nt=function(){for(var t="0123456789abcdef",e=new Array(256),r=0;r<16;++r)for(var n=16*r,i=0;i<16;++i)e[n+i]=t[r]+t[i];return e}();function it(t){return"undefined"==typeof BigInt?ot:t}function ot(){throw new Error("BigInt not supported")}},9216:function(t){"use strict";t.exports=i,t.exports.isMobile=i,t.exports.default=i;var e=/(android|bb\d+|meego).+mobile|armv7l|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series[46]0|samsungbrowser.*mobile|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i,r=/CrOS/,n=/android|ipad|playbook|silk/i;function i(t){t||(t={});var i=t.ua;if(i||"undefined"==typeof navigator||(i=navigator.userAgent),i&&i.headers&&"string"==typeof i.headers["user-agent"]&&(i=i.headers["user-agent"]),"string"!=typeof i)return!1;var o=e.test(i)&&!r.test(i)||!!t.tablet&&n.test(i);return!o&&t.tablet&&t.featureDetect&&navigator&&navigator.maxTouchPoints>1&&-1!==i.indexOf("Macintosh")&&-1!==i.indexOf("Safari")&&(o=!0),o}},6296:function(t,e,r){"use strict";t.exports=function(t){var e=(t=t||{}).eye||[0,0,1],r=t.center||[0,0,0],s=t.up||[0,1,0],l=t.distanceLimits||[0,1/0],c=t.mode||"turntable",u=n(),h=i(),d=o();return u.setDistanceLimits(l[0],l[1]),u.lookAt(0,e,r,s),h.setDistanceLimits(l[0],l[1]),h.lookAt(0,e,r,s),d.setDistanceLimits(l[0],l[1]),d.lookAt(0,e,r,s),new a({turntable:u,orbit:h,matrix:d},c)};var n=r(7261),i=r(9977),o=r(4192);function a(t,e){this._controllerNames=Object.keys(t),this._controllerList=this._controllerNames.map((function(e){return t[e]})),this._mode=e,this._active=t[e],this._active||(this._mode="turntable",this._active=t.turntable),this.modes=this._controllerNames,this.computedMatrix=this._active.computedMatrix,this.computedEye=this._active.computedEye,this.computedUp=this._active.computedUp,this.computedCenter=this._active.computedCenter,this.computedRadius=this._active.computedRadius}var s=a.prototype;s.flush=function(t){for(var e=this._controllerList,r=0;r0?a-4:a;for(r=0;r>16&255,c[u++]=e>>8&255,c[u++]=255&e;return 2===l&&(e=n[t.charCodeAt(r)]<<2|n[t.charCodeAt(r+1)]>>4,c[u++]=255&e),1===l&&(e=n[t.charCodeAt(r)]<<10|n[t.charCodeAt(r+1)]<<4|n[t.charCodeAt(r+2)]>>2,c[u++]=e>>8&255,c[u++]=255&e),c},e.fromByteArray=function(t){for(var e,n=t.length,i=n%3,o=[],a=16383,s=0,c=n-i;sc?c:s+a));return 1===i?(e=t[n-1],o.push(r[e>>2]+r[e<<4&63]+"==")):2===i&&(e=(t[n-2]<<8)+t[n-1],o.push(r[e>>10]+r[e>>4&63]+r[e<<2&63]+"=")),o.join("")};for(var r=[],n=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0;a<64;++a)r[a]=o[a],n[o.charCodeAt(a)]=a;function s(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function l(t,e,n){for(var i,o,a=[],s=e;s>18&63]+r[o>>12&63]+r[o>>6&63]+r[63&o]);return a.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},3865:function(t,e,r){"use strict";var n=r(869);t.exports=function(t,e){return n(t[0].mul(e[1]).add(e[0].mul(t[1])),t[1].mul(e[1]))}},1318:function(t){"use strict";t.exports=function(t,e){return t[0].mul(e[1]).cmp(e[0].mul(t[1]))}},8697:function(t,e,r){"use strict";var n=r(869);t.exports=function(t,e){return n(t[0].mul(e[1]),t[1].mul(e[0]))}},7842:function(t,e,r){"use strict";var n=r(6330),i=r(1533),o=r(2651),a=r(4387),s=r(869),l=r(8697);t.exports=function t(e,r){if(n(e))return r?l(e,t(r)):[e[0].clone(),e[1].clone()];var c,u,h=0;if(i(e))c=e.clone();else if("string"==typeof e)c=a(e);else{if(0===e)return[o(0),o(1)];if(e===Math.floor(e))c=o(e);else{for(;e!==Math.floor(e);)e*=Math.pow(2,256),h-=256;c=o(e)}}if(n(r))c.mul(r[1]),u=r[0].clone();else if(i(r))u=r.clone();else if("string"==typeof r)u=a(r);else if(r)if(r===Math.floor(r))u=o(r);else{for(;r!==Math.floor(r);)r*=Math.pow(2,256),h+=256;u=o(r)}else u=o(1);return h>0?c=c.ushln(h):h<0&&(u=u.ushln(-h)),s(c,u)}},6330:function(t,e,r){"use strict";var n=r(1533);t.exports=function(t){return Array.isArray(t)&&2===t.length&&n(t[0])&&n(t[1])}},5716:function(t,e,r){"use strict";var n=r(6859);t.exports=function(t){return t.cmp(new n(0))}},1369:function(t,e,r){"use strict";var n=r(5716);t.exports=function(t){var e=t.length,r=t.words,i=0;if(1===e)i=r[0];else if(2===e)i=r[0]+67108864*r[1];else for(var o=0;o20?52:r+32}},1533:function(t,e,r){"use strict";r(6859),t.exports=function(t){return t&&"object"==typeof t&&Boolean(t.words)}},2651:function(t,e,r){"use strict";var n=r(6859),i=r(2361);t.exports=function(t){var e=i.exponent(t);return e<52?new n(t):new n(t*Math.pow(2,52-e)).ushln(e-52)}},869:function(t,e,r){"use strict";var n=r(2651),i=r(5716);t.exports=function(t,e){var r=i(t),o=i(e);if(0===r)return[n(0),n(1)];if(0===o)return[n(0),n(0)];o<0&&(t=t.neg(),e=e.neg());var a=t.gcd(e);return a.cmpn(1)?[t.div(a),e.div(a)]:[t,e]}},4387:function(t,e,r){"use strict";var n=r(6859);t.exports=function(t){return new n(t)}},6504:function(t,e,r){"use strict";var n=r(869);t.exports=function(t,e){return n(t[0].mul(e[0]),t[1].mul(e[1]))}},7721:function(t,e,r){"use strict";var n=r(5716);t.exports=function(t){return n(t[0])*n(t[1])}},5572:function(t,e,r){"use strict";var n=r(869);t.exports=function(t,e){return n(t[0].mul(e[1]).sub(t[1].mul(e[0])),t[1].mul(e[1]))}},946:function(t,e,r){"use strict";var n=r(1369),i=r(4025);t.exports=function(t){var e=t[0],r=t[1];if(0===e.cmpn(0))return 0;var o=e.abs().divmod(r.abs()),a=o.div,s=n(a),l=o.mod,c=e.negative!==r.negative?-1:1;if(0===l.cmpn(0))return c*s;if(s){var u=i(s)+4;return c*(s+(d=n(l.ushln(u).divRound(r)))*Math.pow(2,-u))}var h=r.bitLength()-l.bitLength()+53,d=n(l.ushln(h).divRound(r));return h<1023?c*d*Math.pow(2,-h):c*(d*=Math.pow(2,-1023))*Math.pow(2,1023-h)}},2478:function(t){"use strict";function e(t,e,r,n,i){for(var o=i+1;n<=i;){var a=n+i>>>1,s=t[a];(void 0!==r?r(s,e):s-e)>=0?(o=a,i=a-1):n=a+1}return o}function r(t,e,r,n,i){for(var o=i+1;n<=i;){var a=n+i>>>1,s=t[a];(void 0!==r?r(s,e):s-e)>0?(o=a,i=a-1):n=a+1}return o}function n(t,e,r,n,i){for(var o=n-1;n<=i;){var a=n+i>>>1,s=t[a];(void 0!==r?r(s,e):s-e)<0?(o=a,n=a+1):i=a-1}return o}function i(t,e,r,n,i){for(var o=n-1;n<=i;){var a=n+i>>>1,s=t[a];(void 0!==r?r(s,e):s-e)<=0?(o=a,n=a+1):i=a-1}return o}function o(t,e,r,n,i){for(;n<=i;){var o=n+i>>>1,a=t[o],s=void 0!==r?r(a,e):a-e;if(0===s)return o;s<=0?n=o+1:i=o-1}return-1}function a(t,e,r,n,i,o){return"function"==typeof r?o(t,e,r,void 0===n?0:0|n,void 0===i?t.length-1:0|i):o(t,e,void 0,void 0===r?0:0|r,void 0===n?t.length-1:0|n)}t.exports={ge:function(t,r,n,i,o){return a(t,r,n,i,o,e)},gt:function(t,e,n,i,o){return a(t,e,n,i,o,r)},lt:function(t,e,r,i,o){return a(t,e,r,i,o,n)},le:function(t,e,r,n,o){return a(t,e,r,n,o,i)},eq:function(t,e,r,n,i){return a(t,e,r,n,i,o)}}},8828:function(t,e){"use strict";function r(t){var e=32;return(t&=-t)&&e--,65535&t&&(e-=16),16711935&t&&(e-=8),252645135&t&&(e-=4),858993459&t&&(e-=2),1431655765&t&&(e-=1),e}e.INT_BITS=32,e.INT_MAX=2147483647,e.INT_MIN=-1<<31,e.sign=function(t){return(t>0)-(t<0)},e.abs=function(t){var e=t>>31;return(t^e)-e},e.min=function(t,e){return e^(t^e)&-(t65535)<<4,e|=r=((t>>>=e)>255)<<3,e|=r=((t>>>=r)>15)<<2,(e|=r=((t>>>=r)>3)<<1)|(t>>>=r)>>1},e.log10=function(t){return t>=1e9?9:t>=1e8?8:t>=1e7?7:t>=1e6?6:t>=1e5?5:t>=1e4?4:t>=1e3?3:t>=100?2:t>=10?1:0},e.popCount=function(t){return 16843009*((t=(858993459&(t-=t>>>1&1431655765))+(t>>>2&858993459))+(t>>>4)&252645135)>>>24},e.countTrailingZeros=r,e.nextPow2=function(t){return t+=0===t,--t,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,1+(t|=t>>>16)},e.prevPow2=function(t){return t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)-(t>>>1)},e.parity=function(t){return t^=t>>>16,t^=t>>>8,t^=t>>>4,27030>>>(t&=15)&1};var n=new Array(256);!function(t){for(var e=0;e<256;++e){var r=e,n=e,i=7;for(r>>>=1;r;r>>>=1)n<<=1,n|=1&r,--i;t[e]=n<>>8&255]<<16|n[t>>>16&255]<<8|n[t>>>24&255]},e.interleave2=function(t,e){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t&=65535)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e&=65535)|e<<8))|e<<4))|e<<2))|e<<1))<<1},e.deinterleave2=function(t,e){return(t=65535&((t=16711935&((t=252645135&((t=858993459&((t=t>>>e&1431655765)|t>>>1))|t>>>2))|t>>>4))|t>>>16))<<16>>16},e.interleave3=function(t,e,r){return t=1227133513&((t=3272356035&((t=251719695&((t=4278190335&((t&=1023)|t<<16))|t<<8))|t<<4))|t<<2),(t|=(e=1227133513&((e=3272356035&((e=251719695&((e=4278190335&((e&=1023)|e<<16))|e<<8))|e<<4))|e<<2))<<1)|(r=1227133513&((r=3272356035&((r=251719695&((r=4278190335&((r&=1023)|r<<16))|r<<8))|r<<4))|r<<2))<<2},e.deinterleave3=function(t,e){return(t=1023&((t=4278190335&((t=251719695&((t=3272356035&((t=t>>>e&1227133513)|t>>>2))|t>>>4))|t>>>8))|t>>>16))<<22>>22},e.nextCombination=function(t){var e=t|t-1;return e+1|(~e&-~e)-1>>>r(t)+1}},6859:function(t,e,r){!function(t,e){"use strict";function n(t,e){if(!t)throw new Error(e||"Assertion failed")}function i(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function o(t,e,r){if(o.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var a;"object"==typeof t?t.exports=o:e.BN=o,o.BN=o,o.wordSize=26;try{a="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(7790).Buffer}catch(t){}function s(t,e){var r=t.charCodeAt(e);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function l(t,e,r){var n=s(t,r);return r-1>=e&&(n|=s(t,r-1)<<4),n}function c(t,e,r,n){for(var i=0,o=Math.min(t.length,r),a=e;a=49?s-49+10:s>=17?s-17+10:s}return i}o.isBN=function(t){return t instanceof o||null!==t&&"object"==typeof t&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return t.cmp(e)>0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),n(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i=0;i-=3)a=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[o]|=a<>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);else if("le"===r)for(i=0,o=0;i>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);return this.strip()},o.prototype._parseHex=function(t,e,r){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var n=0;n=e;n-=2)i=l(t,e,n)<=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;else for(n=(t.length-e)%2==0?e+1:e;n=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;this.strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var o=t.length-r,a=o%n,s=Math.min(o,o-a)+r,l=0,u=r;u1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?""};var u=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],h=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],d=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function f(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],o=0|e.words[0],a=i*o,s=67108863&a,l=a/67108864|0;r.words[0]=s;for(var c=1;c>>26,h=67108863&l,d=Math.min(c,e.length-1),f=Math.max(0,c-t.length+1);f<=d;f++){var p=c-f|0;u+=(a=(i=0|t.words[p])*(o=0|e.words[f])+h)/67108864|0,h=67108863&a}r.words[c]=0|h,l=0|u}return 0!==l?r.words[c]=0|l:r.length--,r.strip()}o.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var i=0,o=0,a=0;a>>24-i&16777215)||a!==this.length-1?u[6-l.length]+l+r:l+r,(i+=2)>=26&&(i-=26,a--)}for(0!==o&&(r=o.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var c=h[t],f=d[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(f).toString(t);r=(p=p.idivn(f)).isZero()?m+r:u[c-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(t,e){return n(void 0!==a),this.toArrayLike(a,t,e)},o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},o.prototype.toArrayLike=function(t,e,r){var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0"),this.strip();var a,s,l="le"===e,c=new t(o),u=this.clone();if(l){for(s=0;!u.isZero();s++)a=u.andln(255),u.iushrn(8),c[s]=a;for(;s=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 8191&e||(r+=13,e>>>=13),127&e||(r+=7,e>>>=7),15&e||(r+=4,e>>>=4),3&e||(r+=2,e>>>=2),1&e||r++,r},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var n=0;nt.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){n("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){n("number"==typeof t&&t>=0);var r=t/26|0,i=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(r=this,n=t):(r=t,n=this);for(var i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;ot.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,n,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=t):(r=t,n=this);for(var o=0,a=0;a>26,this.words[a]=67108863&e;for(;0!==o&&a>26,this.words[a]=67108863&e;if(0===o&&a>>13,f=0|a[1],p=8191&f,m=f>>>13,g=0|a[2],v=8191&g,b=g>>>13,y=0|a[3],x=8191&y,_=y>>>13,w=0|a[4],k=8191&w,A=w>>>13,M=0|a[5],T=8191&M,S=M>>>13,C=0|a[6],E=8191&C,L=C>>>13,z=0|a[7],O=8191&z,D=z>>>13,I=0|a[8],F=8191&I,R=I>>>13,P=0|a[9],j=8191&P,N=P>>>13,B=0|s[0],U=8191&B,G=B>>>13,V=0|s[1],H=8191&V,W=V>>>13,q=0|s[2],Y=8191&q,Z=q>>>13,X=0|s[3],$=8191&X,J=X>>>13,K=0|s[4],Q=8191&K,tt=K>>>13,et=0|s[5],rt=8191&et,nt=et>>>13,it=0|s[6],ot=8191&it,at=it>>>13,st=0|s[7],lt=8191&st,ct=st>>>13,ut=0|s[8],ht=8191&ut,dt=ut>>>13,ft=0|s[9],pt=8191&ft,mt=ft>>>13;r.negative=t.negative^e.negative,r.length=19;var gt=(c+(n=Math.imul(h,U))|0)+((8191&(i=(i=Math.imul(h,G))+Math.imul(d,U)|0))<<13)|0;c=((o=Math.imul(d,G))+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(p,U),i=(i=Math.imul(p,G))+Math.imul(m,U)|0,o=Math.imul(m,G);var vt=(c+(n=n+Math.imul(h,H)|0)|0)+((8191&(i=(i=i+Math.imul(h,W)|0)+Math.imul(d,H)|0))<<13)|0;c=((o=o+Math.imul(d,W)|0)+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(v,U),i=(i=Math.imul(v,G))+Math.imul(b,U)|0,o=Math.imul(b,G),n=n+Math.imul(p,H)|0,i=(i=i+Math.imul(p,W)|0)+Math.imul(m,H)|0,o=o+Math.imul(m,W)|0;var bt=(c+(n=n+Math.imul(h,Y)|0)|0)+((8191&(i=(i=i+Math.imul(h,Z)|0)+Math.imul(d,Y)|0))<<13)|0;c=((o=o+Math.imul(d,Z)|0)+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(x,U),i=(i=Math.imul(x,G))+Math.imul(_,U)|0,o=Math.imul(_,G),n=n+Math.imul(v,H)|0,i=(i=i+Math.imul(v,W)|0)+Math.imul(b,H)|0,o=o+Math.imul(b,W)|0,n=n+Math.imul(p,Y)|0,i=(i=i+Math.imul(p,Z)|0)+Math.imul(m,Y)|0,o=o+Math.imul(m,Z)|0;var yt=(c+(n=n+Math.imul(h,$)|0)|0)+((8191&(i=(i=i+Math.imul(h,J)|0)+Math.imul(d,$)|0))<<13)|0;c=((o=o+Math.imul(d,J)|0)+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(k,U),i=(i=Math.imul(k,G))+Math.imul(A,U)|0,o=Math.imul(A,G),n=n+Math.imul(x,H)|0,i=(i=i+Math.imul(x,W)|0)+Math.imul(_,H)|0,o=o+Math.imul(_,W)|0,n=n+Math.imul(v,Y)|0,i=(i=i+Math.imul(v,Z)|0)+Math.imul(b,Y)|0,o=o+Math.imul(b,Z)|0,n=n+Math.imul(p,$)|0,i=(i=i+Math.imul(p,J)|0)+Math.imul(m,$)|0,o=o+Math.imul(m,J)|0;var xt=(c+(n=n+Math.imul(h,Q)|0)|0)+((8191&(i=(i=i+Math.imul(h,tt)|0)+Math.imul(d,Q)|0))<<13)|0;c=((o=o+Math.imul(d,tt)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(T,U),i=(i=Math.imul(T,G))+Math.imul(S,U)|0,o=Math.imul(S,G),n=n+Math.imul(k,H)|0,i=(i=i+Math.imul(k,W)|0)+Math.imul(A,H)|0,o=o+Math.imul(A,W)|0,n=n+Math.imul(x,Y)|0,i=(i=i+Math.imul(x,Z)|0)+Math.imul(_,Y)|0,o=o+Math.imul(_,Z)|0,n=n+Math.imul(v,$)|0,i=(i=i+Math.imul(v,J)|0)+Math.imul(b,$)|0,o=o+Math.imul(b,J)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,tt)|0;var _t=(c+(n=n+Math.imul(h,rt)|0)|0)+((8191&(i=(i=i+Math.imul(h,nt)|0)+Math.imul(d,rt)|0))<<13)|0;c=((o=o+Math.imul(d,nt)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(E,U),i=(i=Math.imul(E,G))+Math.imul(L,U)|0,o=Math.imul(L,G),n=n+Math.imul(T,H)|0,i=(i=i+Math.imul(T,W)|0)+Math.imul(S,H)|0,o=o+Math.imul(S,W)|0,n=n+Math.imul(k,Y)|0,i=(i=i+Math.imul(k,Z)|0)+Math.imul(A,Y)|0,o=o+Math.imul(A,Z)|0,n=n+Math.imul(x,$)|0,i=(i=i+Math.imul(x,J)|0)+Math.imul(_,$)|0,o=o+Math.imul(_,J)|0,n=n+Math.imul(v,Q)|0,i=(i=i+Math.imul(v,tt)|0)+Math.imul(b,Q)|0,o=o+Math.imul(b,tt)|0,n=n+Math.imul(p,rt)|0,i=(i=i+Math.imul(p,nt)|0)+Math.imul(m,rt)|0,o=o+Math.imul(m,nt)|0;var wt=(c+(n=n+Math.imul(h,ot)|0)|0)+((8191&(i=(i=i+Math.imul(h,at)|0)+Math.imul(d,ot)|0))<<13)|0;c=((o=o+Math.imul(d,at)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(O,U),i=(i=Math.imul(O,G))+Math.imul(D,U)|0,o=Math.imul(D,G),n=n+Math.imul(E,H)|0,i=(i=i+Math.imul(E,W)|0)+Math.imul(L,H)|0,o=o+Math.imul(L,W)|0,n=n+Math.imul(T,Y)|0,i=(i=i+Math.imul(T,Z)|0)+Math.imul(S,Y)|0,o=o+Math.imul(S,Z)|0,n=n+Math.imul(k,$)|0,i=(i=i+Math.imul(k,J)|0)+Math.imul(A,$)|0,o=o+Math.imul(A,J)|0,n=n+Math.imul(x,Q)|0,i=(i=i+Math.imul(x,tt)|0)+Math.imul(_,Q)|0,o=o+Math.imul(_,tt)|0,n=n+Math.imul(v,rt)|0,i=(i=i+Math.imul(v,nt)|0)+Math.imul(b,rt)|0,o=o+Math.imul(b,nt)|0,n=n+Math.imul(p,ot)|0,i=(i=i+Math.imul(p,at)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,at)|0;var kt=(c+(n=n+Math.imul(h,lt)|0)|0)+((8191&(i=(i=i+Math.imul(h,ct)|0)+Math.imul(d,lt)|0))<<13)|0;c=((o=o+Math.imul(d,ct)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(F,U),i=(i=Math.imul(F,G))+Math.imul(R,U)|0,o=Math.imul(R,G),n=n+Math.imul(O,H)|0,i=(i=i+Math.imul(O,W)|0)+Math.imul(D,H)|0,o=o+Math.imul(D,W)|0,n=n+Math.imul(E,Y)|0,i=(i=i+Math.imul(E,Z)|0)+Math.imul(L,Y)|0,o=o+Math.imul(L,Z)|0,n=n+Math.imul(T,$)|0,i=(i=i+Math.imul(T,J)|0)+Math.imul(S,$)|0,o=o+Math.imul(S,J)|0,n=n+Math.imul(k,Q)|0,i=(i=i+Math.imul(k,tt)|0)+Math.imul(A,Q)|0,o=o+Math.imul(A,tt)|0,n=n+Math.imul(x,rt)|0,i=(i=i+Math.imul(x,nt)|0)+Math.imul(_,rt)|0,o=o+Math.imul(_,nt)|0,n=n+Math.imul(v,ot)|0,i=(i=i+Math.imul(v,at)|0)+Math.imul(b,ot)|0,o=o+Math.imul(b,at)|0,n=n+Math.imul(p,lt)|0,i=(i=i+Math.imul(p,ct)|0)+Math.imul(m,lt)|0,o=o+Math.imul(m,ct)|0;var At=(c+(n=n+Math.imul(h,ht)|0)|0)+((8191&(i=(i=i+Math.imul(h,dt)|0)+Math.imul(d,ht)|0))<<13)|0;c=((o=o+Math.imul(d,dt)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(j,U),i=(i=Math.imul(j,G))+Math.imul(N,U)|0,o=Math.imul(N,G),n=n+Math.imul(F,H)|0,i=(i=i+Math.imul(F,W)|0)+Math.imul(R,H)|0,o=o+Math.imul(R,W)|0,n=n+Math.imul(O,Y)|0,i=(i=i+Math.imul(O,Z)|0)+Math.imul(D,Y)|0,o=o+Math.imul(D,Z)|0,n=n+Math.imul(E,$)|0,i=(i=i+Math.imul(E,J)|0)+Math.imul(L,$)|0,o=o+Math.imul(L,J)|0,n=n+Math.imul(T,Q)|0,i=(i=i+Math.imul(T,tt)|0)+Math.imul(S,Q)|0,o=o+Math.imul(S,tt)|0,n=n+Math.imul(k,rt)|0,i=(i=i+Math.imul(k,nt)|0)+Math.imul(A,rt)|0,o=o+Math.imul(A,nt)|0,n=n+Math.imul(x,ot)|0,i=(i=i+Math.imul(x,at)|0)+Math.imul(_,ot)|0,o=o+Math.imul(_,at)|0,n=n+Math.imul(v,lt)|0,i=(i=i+Math.imul(v,ct)|0)+Math.imul(b,lt)|0,o=o+Math.imul(b,ct)|0,n=n+Math.imul(p,ht)|0,i=(i=i+Math.imul(p,dt)|0)+Math.imul(m,ht)|0,o=o+Math.imul(m,dt)|0;var Mt=(c+(n=n+Math.imul(h,pt)|0)|0)+((8191&(i=(i=i+Math.imul(h,mt)|0)+Math.imul(d,pt)|0))<<13)|0;c=((o=o+Math.imul(d,mt)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(j,H),i=(i=Math.imul(j,W))+Math.imul(N,H)|0,o=Math.imul(N,W),n=n+Math.imul(F,Y)|0,i=(i=i+Math.imul(F,Z)|0)+Math.imul(R,Y)|0,o=o+Math.imul(R,Z)|0,n=n+Math.imul(O,$)|0,i=(i=i+Math.imul(O,J)|0)+Math.imul(D,$)|0,o=o+Math.imul(D,J)|0,n=n+Math.imul(E,Q)|0,i=(i=i+Math.imul(E,tt)|0)+Math.imul(L,Q)|0,o=o+Math.imul(L,tt)|0,n=n+Math.imul(T,rt)|0,i=(i=i+Math.imul(T,nt)|0)+Math.imul(S,rt)|0,o=o+Math.imul(S,nt)|0,n=n+Math.imul(k,ot)|0,i=(i=i+Math.imul(k,at)|0)+Math.imul(A,ot)|0,o=o+Math.imul(A,at)|0,n=n+Math.imul(x,lt)|0,i=(i=i+Math.imul(x,ct)|0)+Math.imul(_,lt)|0,o=o+Math.imul(_,ct)|0,n=n+Math.imul(v,ht)|0,i=(i=i+Math.imul(v,dt)|0)+Math.imul(b,ht)|0,o=o+Math.imul(b,dt)|0;var Tt=(c+(n=n+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,mt)|0)+Math.imul(m,pt)|0))<<13)|0;c=((o=o+Math.imul(m,mt)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(j,Y),i=(i=Math.imul(j,Z))+Math.imul(N,Y)|0,o=Math.imul(N,Z),n=n+Math.imul(F,$)|0,i=(i=i+Math.imul(F,J)|0)+Math.imul(R,$)|0,o=o+Math.imul(R,J)|0,n=n+Math.imul(O,Q)|0,i=(i=i+Math.imul(O,tt)|0)+Math.imul(D,Q)|0,o=o+Math.imul(D,tt)|0,n=n+Math.imul(E,rt)|0,i=(i=i+Math.imul(E,nt)|0)+Math.imul(L,rt)|0,o=o+Math.imul(L,nt)|0,n=n+Math.imul(T,ot)|0,i=(i=i+Math.imul(T,at)|0)+Math.imul(S,ot)|0,o=o+Math.imul(S,at)|0,n=n+Math.imul(k,lt)|0,i=(i=i+Math.imul(k,ct)|0)+Math.imul(A,lt)|0,o=o+Math.imul(A,ct)|0,n=n+Math.imul(x,ht)|0,i=(i=i+Math.imul(x,dt)|0)+Math.imul(_,ht)|0,o=o+Math.imul(_,dt)|0;var St=(c+(n=n+Math.imul(v,pt)|0)|0)+((8191&(i=(i=i+Math.imul(v,mt)|0)+Math.imul(b,pt)|0))<<13)|0;c=((o=o+Math.imul(b,mt)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(j,$),i=(i=Math.imul(j,J))+Math.imul(N,$)|0,o=Math.imul(N,J),n=n+Math.imul(F,Q)|0,i=(i=i+Math.imul(F,tt)|0)+Math.imul(R,Q)|0,o=o+Math.imul(R,tt)|0,n=n+Math.imul(O,rt)|0,i=(i=i+Math.imul(O,nt)|0)+Math.imul(D,rt)|0,o=o+Math.imul(D,nt)|0,n=n+Math.imul(E,ot)|0,i=(i=i+Math.imul(E,at)|0)+Math.imul(L,ot)|0,o=o+Math.imul(L,at)|0,n=n+Math.imul(T,lt)|0,i=(i=i+Math.imul(T,ct)|0)+Math.imul(S,lt)|0,o=o+Math.imul(S,ct)|0,n=n+Math.imul(k,ht)|0,i=(i=i+Math.imul(k,dt)|0)+Math.imul(A,ht)|0,o=o+Math.imul(A,dt)|0;var Ct=(c+(n=n+Math.imul(x,pt)|0)|0)+((8191&(i=(i=i+Math.imul(x,mt)|0)+Math.imul(_,pt)|0))<<13)|0;c=((o=o+Math.imul(_,mt)|0)+(i>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,n=Math.imul(j,Q),i=(i=Math.imul(j,tt))+Math.imul(N,Q)|0,o=Math.imul(N,tt),n=n+Math.imul(F,rt)|0,i=(i=i+Math.imul(F,nt)|0)+Math.imul(R,rt)|0,o=o+Math.imul(R,nt)|0,n=n+Math.imul(O,ot)|0,i=(i=i+Math.imul(O,at)|0)+Math.imul(D,ot)|0,o=o+Math.imul(D,at)|0,n=n+Math.imul(E,lt)|0,i=(i=i+Math.imul(E,ct)|0)+Math.imul(L,lt)|0,o=o+Math.imul(L,ct)|0,n=n+Math.imul(T,ht)|0,i=(i=i+Math.imul(T,dt)|0)+Math.imul(S,ht)|0,o=o+Math.imul(S,dt)|0;var Et=(c+(n=n+Math.imul(k,pt)|0)|0)+((8191&(i=(i=i+Math.imul(k,mt)|0)+Math.imul(A,pt)|0))<<13)|0;c=((o=o+Math.imul(A,mt)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(j,rt),i=(i=Math.imul(j,nt))+Math.imul(N,rt)|0,o=Math.imul(N,nt),n=n+Math.imul(F,ot)|0,i=(i=i+Math.imul(F,at)|0)+Math.imul(R,ot)|0,o=o+Math.imul(R,at)|0,n=n+Math.imul(O,lt)|0,i=(i=i+Math.imul(O,ct)|0)+Math.imul(D,lt)|0,o=o+Math.imul(D,ct)|0,n=n+Math.imul(E,ht)|0,i=(i=i+Math.imul(E,dt)|0)+Math.imul(L,ht)|0,o=o+Math.imul(L,dt)|0;var Lt=(c+(n=n+Math.imul(T,pt)|0)|0)+((8191&(i=(i=i+Math.imul(T,mt)|0)+Math.imul(S,pt)|0))<<13)|0;c=((o=o+Math.imul(S,mt)|0)+(i>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,n=Math.imul(j,ot),i=(i=Math.imul(j,at))+Math.imul(N,ot)|0,o=Math.imul(N,at),n=n+Math.imul(F,lt)|0,i=(i=i+Math.imul(F,ct)|0)+Math.imul(R,lt)|0,o=o+Math.imul(R,ct)|0,n=n+Math.imul(O,ht)|0,i=(i=i+Math.imul(O,dt)|0)+Math.imul(D,ht)|0,o=o+Math.imul(D,dt)|0;var zt=(c+(n=n+Math.imul(E,pt)|0)|0)+((8191&(i=(i=i+Math.imul(E,mt)|0)+Math.imul(L,pt)|0))<<13)|0;c=((o=o+Math.imul(L,mt)|0)+(i>>>13)|0)+(zt>>>26)|0,zt&=67108863,n=Math.imul(j,lt),i=(i=Math.imul(j,ct))+Math.imul(N,lt)|0,o=Math.imul(N,ct),n=n+Math.imul(F,ht)|0,i=(i=i+Math.imul(F,dt)|0)+Math.imul(R,ht)|0,o=o+Math.imul(R,dt)|0;var Ot=(c+(n=n+Math.imul(O,pt)|0)|0)+((8191&(i=(i=i+Math.imul(O,mt)|0)+Math.imul(D,pt)|0))<<13)|0;c=((o=o+Math.imul(D,mt)|0)+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,n=Math.imul(j,ht),i=(i=Math.imul(j,dt))+Math.imul(N,ht)|0,o=Math.imul(N,dt);var Dt=(c+(n=n+Math.imul(F,pt)|0)|0)+((8191&(i=(i=i+Math.imul(F,mt)|0)+Math.imul(R,pt)|0))<<13)|0;c=((o=o+Math.imul(R,mt)|0)+(i>>>13)|0)+(Dt>>>26)|0,Dt&=67108863;var It=(c+(n=Math.imul(j,pt))|0)+((8191&(i=(i=Math.imul(j,mt))+Math.imul(N,pt)|0))<<13)|0;return c=((o=Math.imul(N,mt))+(i>>>13)|0)+(It>>>26)|0,It&=67108863,l[0]=gt,l[1]=vt,l[2]=bt,l[3]=yt,l[4]=xt,l[5]=_t,l[6]=wt,l[7]=kt,l[8]=At,l[9]=Mt,l[10]=Tt,l[11]=St,l[12]=Ct,l[13]=Et,l[14]=Lt,l[15]=zt,l[16]=Ot,l[17]=Dt,l[18]=It,0!==c&&(l[19]=c,r.length++),r};function m(t,e,r){return(new g).mulp(t,e,r)}function g(t,e){this.x=t,this.y=e}Math.imul||(p=f),o.prototype.mulTo=function(t,e){var r,n=this.length+t.length;return r=10===this.length&&10===t.length?p(this,t,e):n<63?f(this,t,e):n<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,o=0;o>>26)|0)>>>26,a&=67108863}r.words[o]=s,n=a,a=i}return 0!==n?r.words[o]=n:r.length--,r.strip()}(this,t,e):m(this,t,e),r},g.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,n=0;n>=1;return n},g.prototype.permute=function(t,e,r,n,i,o){for(var a=0;a>>=1)i++;return 1<>>=13,r[2*a+1]=8191&o,o>>>=13;for(a=2*e;a>=26,e+=i/67108864|0,e+=o>>>26,this.words[r]=67108863&o}return 0!==e&&(this.words[r]=e,this.length++),this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r>>i}return e}(t);if(0===e.length)return new o(1);for(var r=this,n=0;n=0);var e,r=t%26,i=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var a=0;for(e=0;e>>26-r}a&&(this.words[e]=a,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e=0),i=e?(e-e%26)/26:0;var o=t%26,a=Math.min((t-o)/26,this.length),s=67108863^67108863>>>o<a)for(this.length-=a,c=0;c=0&&(0!==u||c>=i);c--){var h=0|this.words[c];this.words[c]=u<<26-o|h>>>o,u=h&s}return l&&0!==u&&(l.words[l.length++]=u),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(t,e,r){return n(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,i=1<=0);var e=t%26,r=(t-e)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var i=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(n("number"==typeof t),n(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(l/67108864|0),this.words[i+r]=67108863&o}for(;i>26,this.words[i+r]=67108863&o;if(0===s)return this.strip();for(n(-1===s),s=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),i=t,a=0|i.words[i.length-1];0!=(r=26-this._countBits(a))&&(i=i.ushln(r),n.iushln(r),a=0|i.words[i.length-1]);var s,l=n.length-i.length;if("mod"!==e){(s=new o(null)).length=l+1,s.words=new Array(s.length);for(var c=0;c=0;h--){var d=67108864*(0|n.words[i.length+h])+(0|n.words[i.length+h-1]);for(d=Math.min(d/a|0,67108863),n._ishlnsubmul(i,d,h);0!==n.negative;)d--,n.negative=0,n._ishlnsubmul(i,1,h),n.isZero()||(n.negative^=1);s&&(s.words[h]=d)}return s&&s.strip(),n.strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},o.prototype.divmod=function(t,e,r){return n(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(s=this.neg().divmod(t,e),"mod"!==e&&(i=s.div.neg()),"div"!==e&&(a=s.mod.neg(),r&&0!==a.negative&&a.iadd(t)),{div:i,mod:a}):0===this.negative&&0!==t.negative?(s=this.divmod(t.neg(),e),"mod"!==e&&(i=s.div.neg()),{div:i,mod:s.mod}):this.negative&t.negative?(s=this.neg().divmod(t.neg(),e),"div"!==e&&(a=s.mod.neg(),r&&0!==a.negative&&a.isub(t)),{div:s.div,mod:a}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modn(t.words[0]))}:this._wordDiv(t,e);var i,a,s},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,n=t.ushrn(1),i=t.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modn=function(t){n(t<=67108863);for(var e=(1<<26)%t,r=0,i=this.length-1;i>=0;i--)r=(e*r+(0|this.words[i]))%t;return r},o.prototype.idivn=function(t){n(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*e;this.words[r]=i/t|0,e=i%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new o(1),a=new o(0),s=new o(0),l=new o(1),c=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++c;for(var u=r.clone(),h=e.clone();!e.isZero();){for(var d=0,f=1;!(e.words[0]&f)&&d<26;++d,f<<=1);if(d>0)for(e.iushrn(d);d-- >0;)(i.isOdd()||a.isOdd())&&(i.iadd(u),a.isub(h)),i.iushrn(1),a.iushrn(1);for(var p=0,m=1;!(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(s.isOdd()||l.isOdd())&&(s.iadd(u),l.isub(h)),s.iushrn(1),l.iushrn(1);e.cmp(r)>=0?(e.isub(r),i.isub(s),a.isub(l)):(r.isub(e),s.isub(i),l.isub(a))}return{a:s,b:l,gcd:r.iushln(c)}},o.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i,a=new o(1),s=new o(0),l=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var c=0,u=1;!(e.words[0]&u)&&c<26;++c,u<<=1);if(c>0)for(e.iushrn(c);c-- >0;)a.isOdd()&&a.iadd(l),a.iushrn(1);for(var h=0,d=1;!(r.words[0]&d)&&h<26;++h,d<<=1);if(h>0)for(r.iushrn(h);h-- >0;)s.isOdd()&&s.iadd(l),s.iushrn(1);e.cmp(r)>=0?(e.isub(r),a.isub(s)):(r.isub(e),s.isub(a))}return(i=0===e.cmpn(1)?a:s).cmpn(0)<0&&i.iadd(t),i},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0){var o=e;e=r,r=o}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return!(1&this.words[0])},o.prototype.isOdd=function(){return!(1&~this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){n("number"==typeof t);var e=t%26,r=(t-e)/26,i=1<>>26,s&=67108863,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),n(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:it.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){ni&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new k(t)},o.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return n(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return n(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var v={k256:null,p224:null,p192:null,p25519:null};function b(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){b.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function x(){b.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function _(){b.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function w(){b.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function k(t){if("string"==typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function A(t){k.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}b.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},b.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var n=e0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},b.prototype.split=function(t,e){t.iushrn(this.n,0,e)},b.prototype.imulK=function(t){return t.imul(this.k)},i(y,b),y.prototype.split=function(t,e){for(var r=4194303,n=Math.min(t.length,9),i=0;i>>22,o=a}o>>>=22,t.words[i-10]=o,0===o&&t.length>10?t.length-=10:t.length-=9},y.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(v[t])return v[t];var e;if("k256"===t)e=new y;else if("p224"===t)e=new x;else if("p192"===t)e=new _;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new w}return v[t]=e,e},k.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},k.prototype._verify2=function(t,e){n(!(t.negative|e.negative),"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},k.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},k.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},k.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},k.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},k.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},k.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},k.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},k.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},k.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},k.prototype.isqr=function(t){return this.imul(t,t.clone())},k.prototype.sqr=function(t){return this.mul(t,t)},k.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2==1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var i=this.m.subn(1),a=0;!i.isZero()&&0===i.andln(1);)a++,i.iushrn(1);n(!i.isZero());var s=new o(1).toRed(this),l=s.redNeg(),c=this.m.subn(1).iushrn(1),u=this.m.bitLength();for(u=new o(2*u*u).toRed(this);0!==this.pow(u,c).cmp(l);)u.redIAdd(l);for(var h=this.pow(u,i),d=this.pow(t,i.addn(1).iushrn(1)),f=this.pow(t,i),p=a;0!==f.cmp(s);){for(var m=f,g=0;0!==m.cmp(s);g++)m=m.redSqr();n(g=0;n--){for(var c=e.words[n],u=l-1;u>=0;u--){var h=c>>u&1;i!==r[0]&&(i=this.sqr(i)),0!==h||0!==a?(a<<=1,a|=h,(4==++s||0===n&&0===u)&&(i=this.mul(i,r[a]),s=0,a=0)):s=0}l=26}return i},k.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},k.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new A(t)},i(A,k),A.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},A.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},A.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},A.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},A.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t=r.nmd(t),this)},6204:function(t){"use strict";t.exports=function(t){var e,r,n,i=t.length,o=0;for(e=0;e>>1;if(!(u<=0)){var h,d=i.mallocDouble(2*u*s),f=i.mallocInt32(s);if((s=l(t,u,d,f))>0){if(1===u&&n)o.init(s),h=o.sweepComplete(u,r,0,s,d,f,0,s,d,f);else{var p=i.mallocDouble(2*u*c),m=i.mallocInt32(c);(c=l(e,u,p,m))>0&&(o.init(s+c),h=1===u?o.sweepBipartite(u,r,0,s,d,f,0,c,p,m):a(u,r,n,s,d,f,c,p,m),i.free(p),i.free(m))}i.free(d),i.free(f)}return h}}}function u(t,e){n.push([t,e])}},2455:function(t,e){"use strict";function r(t){return t?function(t,e,r,n,i,o,a,s,l,c,u){return i-n>l-s?function(t,e,r,n,i,o,a,s,l,c,u){for(var h=2*t,d=n,f=h*n;dc-l?n?function(t,e,r,n,i,o,a,s,l,c,u){for(var h=2*t,d=n,f=h*n;d0;){var I=(O-=1)*x,F=w[I],R=w[I+1],P=w[I+2],j=w[I+3],N=w[I+4],B=w[I+5],U=O*_,G=k[U],V=k[U+1],H=1&B,W=!!(16&B),q=u,Y=S,Z=E,X=L;if(H&&(q=E,Y=L,Z=u,X=S),!(2&B&&R>=(P=g(t,F,R,P,q,Y,V))||4&B&&(R=v(t,F,R,P,q,Y,G))>=P)){var $=P-R,J=N-j;if(W){if(t*$*($+J)=p0)&&!(p1>=hi)"),m=u("lo===p0"),g=u("lo>>1,d=2*t,f=h,p=s[d*h+e];c=y?(f=b,p=y):v>=_?(f=g,p=v):(f=x,p=_):y>=_?(f=b,p=y):_>=v?(f=g,p=v):(f=x,p=_);for(var w=d*(u-1),k=d*f,A=0;Ar&&i[h+e]>c;--u,h-=a){for(var d=h,f=h+a,p=0;pd;++d,l+=s)if(i[l+h]===a)if(u===d)u+=1,c+=s;else{for(var f=0;s>f;++f){var p=i[l+f];i[l+f]=i[c],i[c++]=p}var m=o[d];o[d]=o[u],o[u++]=m}return u},"lod;++d,l+=s)if(i[l+h]f;++f){var p=i[l+f];i[l+f]=i[c],i[c++]=p}var m=o[d];o[d]=o[u],o[u++]=m}return u},"lo<=p0":function(t,e,r,n,i,o,a){for(var s=2*t,l=s*r,c=l,u=r,h=t+e,d=r;n>d;++d,l+=s)if(i[l+h]<=a)if(u===d)u+=1,c+=s;else{for(var f=0;s>f;++f){var p=i[l+f];i[l+f]=i[c],i[c++]=p}var m=o[d];o[d]=o[u],o[u++]=m}return u},"hi<=p0":function(t,e,r,n,i,o,a){for(var s=2*t,l=s*r,c=l,u=r,h=t+e,d=r;n>d;++d,l+=s)if(i[l+h]<=a)if(u===d)u+=1,c+=s;else{for(var f=0;s>f;++f){var p=i[l+f];i[l+f]=i[c],i[c++]=p}var m=o[d];o[d]=o[u],o[u++]=m}return u},"lof;++f,l+=s){var p=i[l+h],m=i[l+d];if(pg;++g){var v=i[l+g];i[l+g]=i[c],i[c++]=v}var b=o[f];o[f]=o[u],o[u++]=b}}return u},"lo<=p0&&p0<=hi":function(t,e,r,n,i,o,a){for(var s=2*t,l=s*r,c=l,u=r,h=e,d=t+e,f=r;n>f;++f,l+=s){var p=i[l+h],m=i[l+d];if(p<=a&&a<=m)if(u===f)u+=1,c+=s;else{for(var g=0;s>g;++g){var v=i[l+g];i[l+g]=i[c],i[c++]=v}var b=o[f];o[f]=o[u],o[u++]=b}}return u},"!(lo>=p0)&&!(p1>=hi)":function(t,e,r,n,i,o,a,s){for(var l=2*t,c=l*r,u=c,h=r,d=e,f=t+e,p=r;n>p;++p,c+=l){var m=i[c+d],g=i[c+f];if(!(m>=a||s>=g))if(h===p)h+=1,u+=l;else{for(var v=0;l>v;++v){var b=i[c+v];i[c+v]=i[u],i[u++]=b}var y=o[p];o[p]=o[h],o[h++]=y}}return h}}},1811:function(t){"use strict";t.exports=function(t,n){n<=4*e?r(0,n-1,t):c(0,n-1,t)};var e=32;function r(t,e,r){for(var n=2*(t+1),i=t+1;i<=e;++i){for(var o=r[n++],a=r[n++],s=i,l=n-2;s-- >t;){var c=r[l-2],u=r[l-1];if(cr[e+1])}function l(t,e,r,n){var i=n[t*=2];return i>1,g=m-d,v=m+d,b=f,y=g,x=m,_=v,w=p,k=t+1,A=u-1,M=0;s(b,y,h)&&(M=b,b=y,y=M),s(_,w,h)&&(M=_,_=w,w=M),s(b,x,h)&&(M=b,b=x,x=M),s(y,x,h)&&(M=y,y=x,x=M),s(b,_,h)&&(M=b,b=_,_=M),s(x,_,h)&&(M=x,x=_,_=M),s(y,w,h)&&(M=y,y=w,w=M),s(y,x,h)&&(M=y,y=x,x=M),s(_,w,h)&&(M=_,_=w,w=M);for(var T=h[2*y],S=h[2*y+1],C=h[2*_],E=h[2*_+1],L=2*b,z=2*x,O=2*w,D=2*f,I=2*m,F=2*p,R=0;R<2;++R){var P=h[L+R],j=h[z+R],N=h[O+R];h[D+R]=P,h[I+R]=j,h[F+R]=N}i(g,t,h),i(v,u,h);for(var B=k;B<=A;++B)if(l(B,T,S,h))B!==k&&n(B,k,h),++k;else if(!l(B,C,E,h))for(;;){if(l(A,C,E,h)){l(A,T,S,h)?(o(B,k,A,h),++k,--A):(n(B,A,h),--A);break}if(--A>>1;o(p,S);var C=0,E=0;for(k=0;k=a)m(u,h,E--,L=L-a|0);else if(L>=0)m(l,c,C--,L);else if(L<=-a){L=-L-a|0;for(var z=0;z>>1;o(p,C);var E=0,L=0,z=0;for(A=0;A>1==p[2*A+3]>>1&&(D=2,A+=1),O<0){for(var I=-(O>>1)-1,F=0;F>1)-1,0===D?m(l,c,E--,I):1===D?m(u,h,L--,I):2===D&&m(d,f,z--,I)}},scanBipartite:function(t,e,r,n,i,s,u,h,d,f,v,b){var y=0,x=2*t,_=e,w=e+t,k=1,A=1;n?A=a:k=a;for(var M=i;M>>1;o(p,E);var L=0;for(M=0;M=a?(O=!n,T-=a):(O=!!n,T-=1),O)g(l,c,L++,T);else{var D=b[T],I=x*T,F=v[I+e+1],R=v[I+e+1+t];t:for(var P=0;P>>1;o(p,k);var A=0;for(y=0;y=a)l[A++]=x-a;else{var T=f[x-=1],S=g*x,C=d[S+e+1],E=d[S+e+1+t];t:for(var L=0;L=0;--L)if(l[L]===x){for(I=L+1;I0;){for(var f=r.pop(),p=(u=-1,h=-1,l=a[s=r.pop()],1);p=0||(e.flip(s,f),i(t,e,r,u,s,h),i(t,e,r,s,h,u),i(t,e,r,h,f,u),i(t,e,r,f,u,h))}}},5023:function(t,e,r){"use strict";var n,i=r(2478);function o(t,e,r,n,i,o,a){this.cells=t,this.neighbor=e,this.flags=n,this.constraint=r,this.active=i,this.next=o,this.boundary=a}function a(t,e){return t[0]-e[0]||t[1]-e[1]||t[2]-e[2]}t.exports=function(t,e,r){var n=function(t,e){for(var r=t.cells(),n=r.length,i=0;i0||l.length>0;){for(;s.length>0;){var f=s.pop();if(c[f]!==-i){c[f]=i,u[f];for(var p=0;p<3;++p){var m=d[3*f+p];m>=0&&0===c[m]&&(h[3*f+p]?l.push(m):(s.push(m),c[m]=i))}}}var g=l;l=s,s=g,l.length=0,i=-i}var v=function(t,e,r){for(var n=0,i=0;i1&&i(r[d[f-2]],r[d[f-1]],o)>0;)t.push([d[f-1],d[f-2],a]),f-=1;d.length=f,d.push(a);var p=h.upperIds;for(f=p.length;f>1&&i(r[p[f-2]],r[p[f-1]],o)<0;)t.push([p[f-2],p[f-1],a]),f-=1;p.length=f,p.push(a)}}function u(t,e){var r;return(r=t.a[0]p[0]&&i.push(new a(p,f,2,l),new a(f,p,1,l))}i.sort(s);for(var m=i[0].a[0]-(1+Math.abs(i[0].a[0]))*Math.pow(2,-52),g=[new o([m,1],[m,0],-1,[],[],[],[])],v=[],b=(l=0,i.length);l=0}}(),o.removeTriangle=function(t,e,r){var n=this.stars;a(n[t],e,r),a(n[e],r,t),a(n[r],t,e)},o.addTriangle=function(t,e,r){var n=this.stars;n[t].push(e,r),n[e].push(r,t),n[r].push(t,e)},o.opposite=function(t,e){for(var r=this.stars[e],n=1,i=r.length;ne[2]?1:0)}function v(t,e,r){if(0!==t.length){if(e)for(var n=0;n=0;--o){var y=e[u=(S=n[o])[0]],x=y[0],_=y[1],w=t[x],k=t[_];if((w[0]-k[0]||w[1]-k[1])<0){var A=x;x=_,_=A}y[0]=x;var M,T=y[1]=S[1];for(i&&(M=y[2]);o>0&&n[o-1][0]===u;){var S,C=(S=n[--o])[1];i?e.push([T,C,M]):e.push([T,C]),T=C}i?e.push([T,_,M]):e.push([T,_])}return d}(t,e,d,m,r),b=p(t,g);return v(e,b,r),!!b||d.length>0||m.length>0}},3637:function(t,e,r){"use strict";t.exports=function(t,e,r,n){var o=s(e,t),h=s(n,r),d=u(o,h);if(0===a(d))return null;var f=u(h,s(t,r)),p=i(f,d),m=c(o,p);return l(t,m)};var n=r(6504),i=r(8697),o=r(5572),a=r(7721),s=r(544),l=r(2653),c=r(8987);function u(t,e){return o(n(t[0],e[1]),n(t[1],e[0]))}},3642:function(t){t.exports={jet:[{index:0,rgb:[0,0,131]},{index:.125,rgb:[0,60,170]},{index:.375,rgb:[5,255,255]},{index:.625,rgb:[255,255,0]},{index:.875,rgb:[250,0,0]},{index:1,rgb:[128,0,0]}],hsv:[{index:0,rgb:[255,0,0]},{index:.169,rgb:[253,255,2]},{index:.173,rgb:[247,255,2]},{index:.337,rgb:[0,252,4]},{index:.341,rgb:[0,252,10]},{index:.506,rgb:[1,249,255]},{index:.671,rgb:[2,0,253]},{index:.675,rgb:[8,0,253]},{index:.839,rgb:[255,0,251]},{index:.843,rgb:[255,0,245]},{index:1,rgb:[255,0,6]}],hot:[{index:0,rgb:[0,0,0]},{index:.3,rgb:[230,0,0]},{index:.6,rgb:[255,210,0]},{index:1,rgb:[255,255,255]}],spring:[{index:0,rgb:[255,0,255]},{index:1,rgb:[255,255,0]}],summer:[{index:0,rgb:[0,128,102]},{index:1,rgb:[255,255,102]}],autumn:[{index:0,rgb:[255,0,0]},{index:1,rgb:[255,255,0]}],winter:[{index:0,rgb:[0,0,255]},{index:1,rgb:[0,255,128]}],bone:[{index:0,rgb:[0,0,0]},{index:.376,rgb:[84,84,116]},{index:.753,rgb:[169,200,200]},{index:1,rgb:[255,255,255]}],copper:[{index:0,rgb:[0,0,0]},{index:.804,rgb:[255,160,102]},{index:1,rgb:[255,199,127]}],greys:[{index:0,rgb:[0,0,0]},{index:1,rgb:[255,255,255]}],yignbu:[{index:0,rgb:[8,29,88]},{index:.125,rgb:[37,52,148]},{index:.25,rgb:[34,94,168]},{index:.375,rgb:[29,145,192]},{index:.5,rgb:[65,182,196]},{index:.625,rgb:[127,205,187]},{index:.75,rgb:[199,233,180]},{index:.875,rgb:[237,248,217]},{index:1,rgb:[255,255,217]}],greens:[{index:0,rgb:[0,68,27]},{index:.125,rgb:[0,109,44]},{index:.25,rgb:[35,139,69]},{index:.375,rgb:[65,171,93]},{index:.5,rgb:[116,196,118]},{index:.625,rgb:[161,217,155]},{index:.75,rgb:[199,233,192]},{index:.875,rgb:[229,245,224]},{index:1,rgb:[247,252,245]}],yiorrd:[{index:0,rgb:[128,0,38]},{index:.125,rgb:[189,0,38]},{index:.25,rgb:[227,26,28]},{index:.375,rgb:[252,78,42]},{index:.5,rgb:[253,141,60]},{index:.625,rgb:[254,178,76]},{index:.75,rgb:[254,217,118]},{index:.875,rgb:[255,237,160]},{index:1,rgb:[255,255,204]}],bluered:[{index:0,rgb:[0,0,255]},{index:1,rgb:[255,0,0]}],rdbu:[{index:0,rgb:[5,10,172]},{index:.35,rgb:[106,137,247]},{index:.5,rgb:[190,190,190]},{index:.6,rgb:[220,170,132]},{index:.7,rgb:[230,145,90]},{index:1,rgb:[178,10,28]}],picnic:[{index:0,rgb:[0,0,255]},{index:.1,rgb:[51,153,255]},{index:.2,rgb:[102,204,255]},{index:.3,rgb:[153,204,255]},{index:.4,rgb:[204,204,255]},{index:.5,rgb:[255,255,255]},{index:.6,rgb:[255,204,255]},{index:.7,rgb:[255,153,255]},{index:.8,rgb:[255,102,204]},{index:.9,rgb:[255,102,102]},{index:1,rgb:[255,0,0]}],rainbow:[{index:0,rgb:[150,0,90]},{index:.125,rgb:[0,0,200]},{index:.25,rgb:[0,25,255]},{index:.375,rgb:[0,152,255]},{index:.5,rgb:[44,255,150]},{index:.625,rgb:[151,255,0]},{index:.75,rgb:[255,234,0]},{index:.875,rgb:[255,111,0]},{index:1,rgb:[255,0,0]}],portland:[{index:0,rgb:[12,51,131]},{index:.25,rgb:[10,136,186]},{index:.5,rgb:[242,211,56]},{index:.75,rgb:[242,143,56]},{index:1,rgb:[217,30,30]}],blackbody:[{index:0,rgb:[0,0,0]},{index:.2,rgb:[230,0,0]},{index:.4,rgb:[230,210,0]},{index:.7,rgb:[255,255,255]},{index:1,rgb:[160,200,255]}],earth:[{index:0,rgb:[0,0,130]},{index:.1,rgb:[0,180,180]},{index:.2,rgb:[40,210,40]},{index:.4,rgb:[230,230,50]},{index:.6,rgb:[120,70,20]},{index:1,rgb:[255,255,255]}],electric:[{index:0,rgb:[0,0,0]},{index:.15,rgb:[30,0,100]},{index:.4,rgb:[120,0,100]},{index:.6,rgb:[160,90,0]},{index:.8,rgb:[230,200,0]},{index:1,rgb:[255,250,220]}],alpha:[{index:0,rgb:[255,255,255,0]},{index:1,rgb:[255,255,255,1]}],viridis:[{index:0,rgb:[68,1,84]},{index:.13,rgb:[71,44,122]},{index:.25,rgb:[59,81,139]},{index:.38,rgb:[44,113,142]},{index:.5,rgb:[33,144,141]},{index:.63,rgb:[39,173,129]},{index:.75,rgb:[92,200,99]},{index:.88,rgb:[170,220,50]},{index:1,rgb:[253,231,37]}],inferno:[{index:0,rgb:[0,0,4]},{index:.13,rgb:[31,12,72]},{index:.25,rgb:[85,15,109]},{index:.38,rgb:[136,34,106]},{index:.5,rgb:[186,54,85]},{index:.63,rgb:[227,89,51]},{index:.75,rgb:[249,140,10]},{index:.88,rgb:[249,201,50]},{index:1,rgb:[252,255,164]}],magma:[{index:0,rgb:[0,0,4]},{index:.13,rgb:[28,16,68]},{index:.25,rgb:[79,18,123]},{index:.38,rgb:[129,37,129]},{index:.5,rgb:[181,54,122]},{index:.63,rgb:[229,80,100]},{index:.75,rgb:[251,135,97]},{index:.88,rgb:[254,194,135]},{index:1,rgb:[252,253,191]}],plasma:[{index:0,rgb:[13,8,135]},{index:.13,rgb:[75,3,161]},{index:.25,rgb:[125,3,168]},{index:.38,rgb:[168,34,150]},{index:.5,rgb:[203,70,121]},{index:.63,rgb:[229,107,93]},{index:.75,rgb:[248,148,65]},{index:.88,rgb:[253,195,40]},{index:1,rgb:[240,249,33]}],warm:[{index:0,rgb:[125,0,179]},{index:.13,rgb:[172,0,187]},{index:.25,rgb:[219,0,170]},{index:.38,rgb:[255,0,130]},{index:.5,rgb:[255,63,74]},{index:.63,rgb:[255,123,0]},{index:.75,rgb:[234,176,0]},{index:.88,rgb:[190,228,0]},{index:1,rgb:[147,255,0]}],cool:[{index:0,rgb:[125,0,179]},{index:.13,rgb:[116,0,218]},{index:.25,rgb:[98,74,237]},{index:.38,rgb:[68,146,231]},{index:.5,rgb:[0,204,197]},{index:.63,rgb:[0,247,146]},{index:.75,rgb:[0,255,88]},{index:.88,rgb:[40,255,8]},{index:1,rgb:[147,255,0]}],"rainbow-soft":[{index:0,rgb:[125,0,179]},{index:.1,rgb:[199,0,180]},{index:.2,rgb:[255,0,121]},{index:.3,rgb:[255,108,0]},{index:.4,rgb:[222,194,0]},{index:.5,rgb:[150,255,0]},{index:.6,rgb:[0,255,55]},{index:.7,rgb:[0,246,150]},{index:.8,rgb:[50,167,222]},{index:.9,rgb:[103,51,235]},{index:1,rgb:[124,0,186]}],bathymetry:[{index:0,rgb:[40,26,44]},{index:.13,rgb:[59,49,90]},{index:.25,rgb:[64,76,139]},{index:.38,rgb:[63,110,151]},{index:.5,rgb:[72,142,158]},{index:.63,rgb:[85,174,163]},{index:.75,rgb:[120,206,163]},{index:.88,rgb:[187,230,172]},{index:1,rgb:[253,254,204]}],cdom:[{index:0,rgb:[47,15,62]},{index:.13,rgb:[87,23,86]},{index:.25,rgb:[130,28,99]},{index:.38,rgb:[171,41,96]},{index:.5,rgb:[206,67,86]},{index:.63,rgb:[230,106,84]},{index:.75,rgb:[242,149,103]},{index:.88,rgb:[249,193,135]},{index:1,rgb:[254,237,176]}],chlorophyll:[{index:0,rgb:[18,36,20]},{index:.13,rgb:[25,63,41]},{index:.25,rgb:[24,91,59]},{index:.38,rgb:[13,119,72]},{index:.5,rgb:[18,148,80]},{index:.63,rgb:[80,173,89]},{index:.75,rgb:[132,196,122]},{index:.88,rgb:[175,221,162]},{index:1,rgb:[215,249,208]}],density:[{index:0,rgb:[54,14,36]},{index:.13,rgb:[89,23,80]},{index:.25,rgb:[110,45,132]},{index:.38,rgb:[120,77,178]},{index:.5,rgb:[120,113,213]},{index:.63,rgb:[115,151,228]},{index:.75,rgb:[134,185,227]},{index:.88,rgb:[177,214,227]},{index:1,rgb:[230,241,241]}],"freesurface-blue":[{index:0,rgb:[30,4,110]},{index:.13,rgb:[47,14,176]},{index:.25,rgb:[41,45,236]},{index:.38,rgb:[25,99,212]},{index:.5,rgb:[68,131,200]},{index:.63,rgb:[114,156,197]},{index:.75,rgb:[157,181,203]},{index:.88,rgb:[200,208,216]},{index:1,rgb:[241,237,236]}],"freesurface-red":[{index:0,rgb:[60,9,18]},{index:.13,rgb:[100,17,27]},{index:.25,rgb:[142,20,29]},{index:.38,rgb:[177,43,27]},{index:.5,rgb:[192,87,63]},{index:.63,rgb:[205,125,105]},{index:.75,rgb:[216,162,148]},{index:.88,rgb:[227,199,193]},{index:1,rgb:[241,237,236]}],oxygen:[{index:0,rgb:[64,5,5]},{index:.13,rgb:[106,6,15]},{index:.25,rgb:[144,26,7]},{index:.38,rgb:[168,64,3]},{index:.5,rgb:[188,100,4]},{index:.63,rgb:[206,136,11]},{index:.75,rgb:[220,174,25]},{index:.88,rgb:[231,215,44]},{index:1,rgb:[248,254,105]}],par:[{index:0,rgb:[51,20,24]},{index:.13,rgb:[90,32,35]},{index:.25,rgb:[129,44,34]},{index:.38,rgb:[159,68,25]},{index:.5,rgb:[182,99,19]},{index:.63,rgb:[199,134,22]},{index:.75,rgb:[212,171,35]},{index:.88,rgb:[221,210,54]},{index:1,rgb:[225,253,75]}],phase:[{index:0,rgb:[145,105,18]},{index:.13,rgb:[184,71,38]},{index:.25,rgb:[186,58,115]},{index:.38,rgb:[160,71,185]},{index:.5,rgb:[110,97,218]},{index:.63,rgb:[50,123,164]},{index:.75,rgb:[31,131,110]},{index:.88,rgb:[77,129,34]},{index:1,rgb:[145,105,18]}],salinity:[{index:0,rgb:[42,24,108]},{index:.13,rgb:[33,50,162]},{index:.25,rgb:[15,90,145]},{index:.38,rgb:[40,118,137]},{index:.5,rgb:[59,146,135]},{index:.63,rgb:[79,175,126]},{index:.75,rgb:[120,203,104]},{index:.88,rgb:[193,221,100]},{index:1,rgb:[253,239,154]}],temperature:[{index:0,rgb:[4,35,51]},{index:.13,rgb:[23,51,122]},{index:.25,rgb:[85,59,157]},{index:.38,rgb:[129,79,143]},{index:.5,rgb:[175,95,130]},{index:.63,rgb:[222,112,101]},{index:.75,rgb:[249,146,66]},{index:.88,rgb:[249,196,65]},{index:1,rgb:[232,250,91]}],turbidity:[{index:0,rgb:[34,31,27]},{index:.13,rgb:[65,50,41]},{index:.25,rgb:[98,69,52]},{index:.38,rgb:[131,89,57]},{index:.5,rgb:[161,112,59]},{index:.63,rgb:[185,140,66]},{index:.75,rgb:[202,174,88]},{index:.88,rgb:[216,209,126]},{index:1,rgb:[233,246,171]}],"velocity-blue":[{index:0,rgb:[17,32,64]},{index:.13,rgb:[35,52,116]},{index:.25,rgb:[29,81,156]},{index:.38,rgb:[31,113,162]},{index:.5,rgb:[50,144,169]},{index:.63,rgb:[87,173,176]},{index:.75,rgb:[149,196,189]},{index:.88,rgb:[203,221,211]},{index:1,rgb:[254,251,230]}],"velocity-green":[{index:0,rgb:[23,35,19]},{index:.13,rgb:[24,64,38]},{index:.25,rgb:[11,95,45]},{index:.38,rgb:[39,123,35]},{index:.5,rgb:[95,146,12]},{index:.63,rgb:[152,165,18]},{index:.75,rgb:[201,186,69]},{index:.88,rgb:[233,216,137]},{index:1,rgb:[255,253,205]}],cubehelix:[{index:0,rgb:[0,0,0]},{index:.07,rgb:[22,5,59]},{index:.13,rgb:[60,4,105]},{index:.2,rgb:[109,1,135]},{index:.27,rgb:[161,0,147]},{index:.33,rgb:[210,2,142]},{index:.4,rgb:[251,11,123]},{index:.47,rgb:[255,29,97]},{index:.53,rgb:[255,54,69]},{index:.6,rgb:[255,85,46]},{index:.67,rgb:[255,120,34]},{index:.73,rgb:[255,157,37]},{index:.8,rgb:[241,191,57]},{index:.87,rgb:[224,220,93]},{index:.93,rgb:[218,241,142]},{index:1,rgb:[227,253,198]}]}},6729:function(t,e,r){"use strict";var n=r(3642),i=r(395);function o(t){return[t[0]/255,t[1]/255,t[2]/255,t[3]]}function a(t){for(var e,r="#",n=0;n<3;++n)r+=("00"+(e=(e=t[n]).toString(16))).substr(e.length);return r}function s(t){return"rgba("+t.join(",")+")"}t.exports=function(t){var e,r,l,c,u,h,d,f,p,m;if(t||(t={}),f=(t.nshades||72)-1,d=t.format||"hex",(h=t.colormap)||(h="jet"),"string"==typeof h){if(h=h.toLowerCase(),!n[h])throw Error(h+" not a supported colorscale");u=n[h]}else{if(!Array.isArray(h))throw Error("unsupported colormap option",h);u=h.slice()}if(u.length>f+1)throw new Error(h+" map requires nshades to be at least size "+u.length);p=Array.isArray(t.alpha)?2!==t.alpha.length?[1,1]:t.alpha.slice():"number"==typeof t.alpha?[t.alpha,t.alpha]:[1,1],e=u.map((function(t){return Math.round(t.index*f)})),p[0]=Math.min(Math.max(p[0],0),1),p[1]=Math.min(Math.max(p[1],0),1);var g=u.map((function(t,e){var r=u[e].index,n=u[e].rgb.slice();return 4===n.length&&n[3]>=0&&n[3]<=1||(n[3]=p[0]+(p[1]-p[0])*r),n})),v=[];for(m=0;m0||l(t,e,o)?-1:1:0===s?c>0||l(t,e,r)?1:-1:i(c-s)}var h=n(t,e,r);return h>0?a>0&&n(t,e,o)>0?1:-1:h<0?a>0||n(t,e,o)>0?1:-1:n(t,e,o)>0||l(t,e,r)?1:-1};var n=r(3250),i=r(8572),o=r(9362),a=r(5382),s=r(8210);function l(t,e,r){var n=o(t[0],-e[0]),i=o(t[1],-e[1]),l=o(r[0],-e[0]),c=o(r[1],-e[1]),u=s(a(n,l),a(i,c));return u[u.length-1]>=0}},8572:function(t){"use strict";t.exports=function(t){return t<0?-1:t>0?1:0}},8507:function(t){t.exports=function(t,n){var i=t.length,o=t.length-n.length;if(o)return o;switch(i){case 0:return 0;case 1:return t[0]-n[0];case 2:return t[0]+t[1]-n[0]-n[1]||e(t[0],t[1])-e(n[0],n[1]);case 3:var a=t[0]+t[1],s=n[0]+n[1];if(o=a+t[2]-(s+n[2]))return o;var l=e(t[0],t[1]),c=e(n[0],n[1]);return e(l,t[2])-e(c,n[2])||e(l+t[2],a)-e(c+n[2],s);case 4:var u=t[0],h=t[1],d=t[2],f=t[3],p=n[0],m=n[1],g=n[2],v=n[3];return u+h+d+f-(p+m+g+v)||e(u,h,d,f)-e(p,m,g,v,p)||e(u+h,u+d,u+f,h+d,h+f,d+f)-e(p+m,p+g,p+v,m+g,m+v,g+v)||e(u+h+d,u+h+f,u+d+f,h+d+f)-e(p+m+g,p+m+v,p+g+v,m+g+v);default:for(var b=t.slice().sort(r),y=n.slice().sort(r),x=0;xt[r][0]&&(r=n);return er?[[r],[e]]:[[e]]}},4750:function(t,e,r){"use strict";t.exports=function(t){var e=n(t),r=e.length;if(r<=2)return[];for(var i=new Array(r),o=e[r-1],a=0;a=e[l]&&(s+=1);o[a]=s}}return t}(n(o,!0),r)}};var n=r(8954),i=r(3952)},4769:function(t){"use strict";t.exports=function(t,e,r,n,i,o){var a=i-1,s=i*i,l=a*a,c=(1+2*i)*l,u=i*l,h=s*(3-2*i),d=s*a;if(t.length){o||(o=new Array(t.length));for(var f=t.length-1;f>=0;--f)o[f]=c*t[f]+u*e[f]+h*r[f]+d*n[f];return o}return c*t+u*e+h*r+d*n},t.exports.derivative=function(t,e,r,n,i,o){var a=6*i*i-6*i,s=3*i*i-4*i+1,l=-6*i*i+6*i,c=3*i*i-2*i;if(t.length){o||(o=new Array(t.length));for(var u=t.length-1;u>=0;--u)o[u]=a*t[u]+s*e[u]+l*r[u]+c*n[u];return o}return a*t+s*e+l*r[u]+c*n}},7642:function(t,e,r){"use strict";var n=r(8954),i=r(1682);function o(t,e){this.point=t,this.index=e}function a(t,e){for(var r=t.point,n=e.point,i=r.length,o=0;o=2)return!1;t[r]=n}return!0})):_.filter((function(t){for(var e=0;e<=s;++e){var r=v[t[e]];if(r<0)return!1;t[e]=r}return!0})),1&s)for(u=0;u<_.length;++u)d=(x=_[u])[0],x[0]=x[1],x[1]=d;return _}},2361:function(t){var e=!1;if("undefined"!=typeof Float64Array){var r=new Float64Array(1),n=new Uint32Array(r.buffer);r[0]=1,e=!0,1072693248===n[1]?(t.exports=function(t){return r[0]=t,[n[0],n[1]]},t.exports.pack=function(t,e){return n[0]=t,n[1]=e,r[0]},t.exports.lo=function(t){return r[0]=t,n[0]},t.exports.hi=function(t){return r[0]=t,n[1]}):1072693248===n[0]?(t.exports=function(t){return r[0]=t,[n[1],n[0]]},t.exports.pack=function(t,e){return n[1]=t,n[0]=e,r[0]},t.exports.lo=function(t){return r[0]=t,n[1]},t.exports.hi=function(t){return r[0]=t,n[0]}):e=!1}if(!e){var i=new Buffer(8);t.exports=function(t){return i.writeDoubleLE(t,0,!0),[i.readUInt32LE(0,!0),i.readUInt32LE(4,!0)]},t.exports.pack=function(t,e){return i.writeUInt32LE(t,0,!0),i.writeUInt32LE(e,4,!0),i.readDoubleLE(0,!0)},t.exports.lo=function(t){return i.writeDoubleLE(t,0,!0),i.readUInt32LE(0,!0)},t.exports.hi=function(t){return i.writeDoubleLE(t,0,!0),i.readUInt32LE(4,!0)}}t.exports.sign=function(e){return t.exports.hi(e)>>>31},t.exports.exponent=function(e){return(t.exports.hi(e)<<1>>>21)-1023},t.exports.fraction=function(e){var r=t.exports.lo(e),n=t.exports.hi(e),i=1048575&n;return 2146435072&n&&(i+=1<<20),[r,i]},t.exports.denormalized=function(e){return!(2146435072&t.exports.hi(e))}},1338:function(t){"use strict";function e(t,r,n){var i=0|t[n];if(i<=0)return[];var o,a=new Array(i);if(n===t.length-1)for(o=0;o0)return function(t,e){var r,n;for(r=new Array(t),n=0;n=r-1){d=l.length-1;var p=t-e[r-1];for(f=0;f=r-1)for(var u=s.length-1,h=(e[r-1],0);h=0;--r)if(t[--e])return!1;return!0},s.jump=function(t){var e=this.lastT(),r=this.dimension;if(!(t0;--h)n.push(o(l[h-1],c[h-1],arguments[h])),i.push(0)}},s.push=function(t){var e=this.lastT(),r=this.dimension;if(!(t1e-6?1/s:0;this._time.push(t);for(var d=r;d>0;--d){var f=o(c[d-1],u[d-1],arguments[d]);n.push(f),i.push((f-n[a++])*h)}}},s.set=function(t){var e=this.dimension;if(!(t0;--l)r.push(o(a[l-1],s[l-1],arguments[l])),n.push(0)}},s.move=function(t){var e=this.lastT(),r=this.dimension;if(!(t<=e||arguments.length!==r+1)){var n=this._state,i=this._velocity,a=n.length-this.dimension,s=this.bounds,l=s[0],c=s[1],u=t-e,h=u>1e-6?1/u:0;this._time.push(t);for(var d=r;d>0;--d){var f=arguments[d];n.push(o(l[d-1],c[d-1],n[a++]+f)),i.push(f*h)}}},s.idle=function(t){var e=this.lastT();if(!(t=0;--h)n.push(o(l[h],c[h],n[a]+u*i[a])),i.push(0),a+=1}}},3840:function(t){"use strict";function e(t,e,r,n,i,o){this._color=t,this.key=e,this.value=r,this.left=n,this.right=i,this._count=o}function r(t){return new e(t._color,t.key,t.value,t.left,t.right,t._count)}function n(t,r){return new e(t,r.key,r.value,r.left,r.right,r._count)}function i(t){t._count=1+(t.left?t.left._count:0)+(t.right?t.right._count:0)}function o(t,e){this._compare=t,this.root=e}t.exports=function(t){return new o(t||f,null)};var a=o.prototype;function s(t,e){var r;return e.left&&(r=s(t,e.left))?r:(r=t(e.key,e.value))||(e.right?s(t,e.right):void 0)}function l(t,e,r,n){if(e(t,n.key)<=0){var i;if(n.left&&(i=l(t,e,r,n.left)))return i;if(i=r(n.key,n.value))return i}if(n.right)return l(t,e,r,n.right)}function c(t,e,r,n,i){var o,a=r(t,i.key),s=r(e,i.key);if(a<=0){if(i.left&&(o=c(t,e,r,n,i.left)))return o;if(s>0&&(o=n(i.key,i.value)))return o}if(s>0&&i.right)return c(t,e,r,n,i.right)}function u(t,e){this.tree=t,this._stack=e}Object.defineProperty(a,"keys",{get:function(){var t=[];return this.forEach((function(e,r){t.push(e)})),t}}),Object.defineProperty(a,"values",{get:function(){var t=[];return this.forEach((function(e,r){t.push(r)})),t}}),Object.defineProperty(a,"length",{get:function(){return this.root?this.root._count:0}}),a.insert=function(t,r){for(var a=this._compare,s=this.root,l=[],c=[];s;){var u=a(t,s.key);l.push(s),c.push(u),s=u<=0?s.left:s.right}l.push(new e(0,t,r,null,null,1));for(var h=l.length-2;h>=0;--h)s=l[h],c[h]<=0?l[h]=new e(s._color,s.key,s.value,l[h+1],s.right,s._count+1):l[h]=new e(s._color,s.key,s.value,s.left,l[h+1],s._count+1);for(h=l.length-1;h>1;--h){var d=l[h-1];if(s=l[h],1===d._color||1===s._color)break;var f=l[h-2];if(f.left===d)if(d.left===s){if(!(p=f.right)||0!==p._color){f._color=0,f.left=d.right,d._color=1,d.right=f,l[h-2]=d,l[h-1]=s,i(f),i(d),h>=3&&((m=l[h-3]).left===f?m.left=d:m.right=d);break}d._color=1,f.right=n(1,p),f._color=0,h-=1}else{if(!(p=f.right)||0!==p._color){d.right=s.left,f._color=0,f.left=s.right,s._color=1,s.left=d,s.right=f,l[h-2]=s,l[h-1]=d,i(f),i(d),i(s),h>=3&&((m=l[h-3]).left===f?m.left=s:m.right=s);break}d._color=1,f.right=n(1,p),f._color=0,h-=1}else if(d.right===s){if(!(p=f.left)||0!==p._color){f._color=0,f.right=d.left,d._color=1,d.left=f,l[h-2]=d,l[h-1]=s,i(f),i(d),h>=3&&((m=l[h-3]).right===f?m.right=d:m.left=d);break}d._color=1,f.left=n(1,p),f._color=0,h-=1}else{var p;if(!(p=f.left)||0!==p._color){var m;d.left=s.right,f._color=0,f.right=s.left,s._color=1,s.right=d,s.left=f,l[h-2]=s,l[h-1]=d,i(f),i(d),i(s),h>=3&&((m=l[h-3]).right===f?m.right=s:m.left=s);break}d._color=1,f.left=n(1,p),f._color=0,h-=1}}return l[0]._color=1,new o(a,l[0])},a.forEach=function(t,e,r){if(this.root)switch(arguments.length){case 1:return s(t,this.root);case 2:return l(e,this._compare,t,this.root);case 3:if(this._compare(e,r)>=0)return;return c(e,r,this._compare,t,this.root)}},Object.defineProperty(a,"begin",{get:function(){for(var t=[],e=this.root;e;)t.push(e),e=e.left;return new u(this,t)}}),Object.defineProperty(a,"end",{get:function(){for(var t=[],e=this.root;e;)t.push(e),e=e.right;return new u(this,t)}}),a.at=function(t){if(t<0)return new u(this,[]);for(var e=this.root,r=[];;){if(r.push(e),e.left){if(t=e.right._count)break;e=e.right}return new u(this,[])},a.ge=function(t){for(var e=this._compare,r=this.root,n=[],i=0;r;){var o=e(t,r.key);n.push(r),o<=0&&(i=n.length),r=o<=0?r.left:r.right}return n.length=i,new u(this,n)},a.gt=function(t){for(var e=this._compare,r=this.root,n=[],i=0;r;){var o=e(t,r.key);n.push(r),o<0&&(i=n.length),r=o<0?r.left:r.right}return n.length=i,new u(this,n)},a.lt=function(t){for(var e=this._compare,r=this.root,n=[],i=0;r;){var o=e(t,r.key);n.push(r),o>0&&(i=n.length),r=o<=0?r.left:r.right}return n.length=i,new u(this,n)},a.le=function(t){for(var e=this._compare,r=this.root,n=[],i=0;r;){var o=e(t,r.key);n.push(r),o>=0&&(i=n.length),r=o<0?r.left:r.right}return n.length=i,new u(this,n)},a.find=function(t){for(var e=this._compare,r=this.root,n=[];r;){var i=e(t,r.key);if(n.push(r),0===i)return new u(this,n);r=i<=0?r.left:r.right}return new u(this,[])},a.remove=function(t){var e=this.find(t);return e?e.remove():this},a.get=function(t){for(var e=this._compare,r=this.root;r;){var n=e(t,r.key);if(0===n)return r.value;r=n<=0?r.left:r.right}};var h=u.prototype;function d(t,e){t.key=e.key,t.value=e.value,t.left=e.left,t.right=e.right,t._color=e._color,t._count=e._count}function f(t,e){return te?1:0}Object.defineProperty(h,"valid",{get:function(){return this._stack.length>0}}),Object.defineProperty(h,"node",{get:function(){return this._stack.length>0?this._stack[this._stack.length-1]:null},enumerable:!0}),h.clone=function(){return new u(this.tree,this._stack.slice())},h.remove=function(){var t=this._stack;if(0===t.length)return this.tree;var a=new Array(t.length),s=t[t.length-1];a[a.length-1]=new e(s._color,s.key,s.value,s.left,s.right,s._count);for(var l=t.length-2;l>=0;--l)(s=t[l]).left===t[l+1]?a[l]=new e(s._color,s.key,s.value,a[l+1],s.right,s._count):a[l]=new e(s._color,s.key,s.value,s.left,a[l+1],s._count);if((s=a[a.length-1]).left&&s.right){var c=a.length;for(s=s.left;s.right;)a.push(s),s=s.right;var u=a[c-1];for(a.push(new e(s._color,u.key,u.value,s.left,s.right,s._count)),a[c-1].key=s.key,a[c-1].value=s.value,l=a.length-2;l>=c;--l)s=a[l],a[l]=new e(s._color,s.key,s.value,s.left,a[l+1],s._count);a[c-1].left=a[c]}if(0===(s=a[a.length-1])._color){var h=a[a.length-2];for(h.left===s?h.left=null:h.right===s&&(h.right=null),a.pop(),l=0;l=0;--l){if(e=t[l],0===l)return void(e._color=1);if((o=t[l-1]).left===e){if((a=o.right).right&&0===a.right._color)return s=(a=o.right=r(a)).right=r(a.right),o.right=a.left,a.left=o,a.right=s,a._color=o._color,e._color=1,o._color=1,s._color=1,i(o),i(a),l>1&&((c=t[l-2]).left===o?c.left=a:c.right=a),void(t[l-1]=a);if(a.left&&0===a.left._color)return s=(a=o.right=r(a)).left=r(a.left),o.right=s.left,a.left=s.right,s.left=o,s.right=a,s._color=o._color,o._color=1,a._color=1,e._color=1,i(o),i(a),i(s),l>1&&((c=t[l-2]).left===o?c.left=s:c.right=s),void(t[l-1]=s);if(1===a._color){if(0===o._color)return o._color=1,void(o.right=n(0,a));o.right=n(0,a);continue}a=r(a),o.right=a.left,a.left=o,a._color=o._color,o._color=0,i(o),i(a),l>1&&((c=t[l-2]).left===o?c.left=a:c.right=a),t[l-1]=a,t[l]=o,l+11&&((c=t[l-2]).right===o?c.right=a:c.left=a),void(t[l-1]=a);if(a.right&&0===a.right._color)return s=(a=o.left=r(a)).right=r(a.right),o.left=s.right,a.right=s.left,s.right=o,s.left=a,s._color=o._color,o._color=1,a._color=1,e._color=1,i(o),i(a),i(s),l>1&&((c=t[l-2]).right===o?c.right=s:c.left=s),void(t[l-1]=s);if(1===a._color){if(0===o._color)return o._color=1,void(o.left=n(0,a));o.left=n(0,a);continue}var c;a=r(a),o.left=a.right,a.right=o,a._color=o._color,o._color=0,i(o),i(a),l>1&&((c=t[l-2]).right===o?c.right=a:c.left=a),t[l-1]=a,t[l]=o,l+10)return this._stack[this._stack.length-1].key},enumerable:!0}),Object.defineProperty(h,"value",{get:function(){if(this._stack.length>0)return this._stack[this._stack.length-1].value},enumerable:!0}),Object.defineProperty(h,"index",{get:function(){var t=0,e=this._stack;if(0===e.length){var r=this.tree.root;return r?r._count:0}e[e.length-1].left&&(t=e[e.length-1].left._count);for(var n=e.length-2;n>=0;--n)e[n+1]===e[n].right&&(++t,e[n].left&&(t+=e[n].left._count));return t},enumerable:!0}),h.next=function(){var t=this._stack;if(0!==t.length){var e=t[t.length-1];if(e.right)for(e=e.right;e;)t.push(e),e=e.left;else for(t.pop();t.length>0&&t[t.length-1].right===e;)e=t[t.length-1],t.pop()}},Object.defineProperty(h,"hasNext",{get:function(){var t=this._stack;if(0===t.length)return!1;if(t[t.length-1].right)return!0;for(var e=t.length-1;e>0;--e)if(t[e-1].left===t[e])return!0;return!1}}),h.update=function(t){var r=this._stack;if(0===r.length)throw new Error("Can't update empty node!");var n=new Array(r.length),i=r[r.length-1];n[n.length-1]=new e(i._color,i.key,t,i.left,i.right,i._count);for(var a=r.length-2;a>=0;--a)(i=r[a]).left===r[a+1]?n[a]=new e(i._color,i.key,i.value,n[a+1],i.right,i._count):n[a]=new e(i._color,i.key,i.value,i.left,n[a+1],i._count);return new o(this.tree._compare,n[0])},h.prev=function(){var t=this._stack;if(0!==t.length){var e=t[t.length-1];if(e.left)for(e=e.left;e;)t.push(e),e=e.right;else for(t.pop();t.length>0&&t[t.length-1].left===e;)e=t[t.length-1],t.pop()}},Object.defineProperty(h,"hasPrev",{get:function(){var t=this._stack;if(0===t.length)return!1;if(t[t.length-1].left)return!0;for(var e=t.length-1;e>0;--e)if(t[e-1].right===t[e])return!0;return!1}})},3837:function(t,e,r){"use strict";t.exports=function(t,e){var r=new f(t);return r.update(e),r};var n=r(4935),i=r(501),o=r(5304),a=r(6429),s=r(6444),l=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),c=ArrayBuffer,u=DataView;function h(t){return Array.isArray(t)||function(t){return c.isView(t)&&!(t instanceof u)}(t)}function d(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function f(t){this.gl=t,this.pixelRatio=1,this.bounds=[[-10,-10,-10],[10,10,10]],this.ticks=[[],[],[]],this.autoTicks=!0,this.tickSpacing=[1,1,1],this.tickEnable=[!0,!0,!0],this.tickFont=["sans-serif","sans-serif","sans-serif"],this.tickFontStyle=["normal","normal","normal"],this.tickFontWeight=["normal","normal","normal"],this.tickFontVariant=["normal","normal","normal"],this.tickSize=[12,12,12],this.tickAngle=[0,0,0],this.tickAlign=["auto","auto","auto"],this.tickColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.tickPad=[10,10,10],this.lastCubeProps={cubeEdges:[0,0,0],axis:[0,0,0]},this.labels=["x","y","z"],this.labelEnable=[!0,!0,!0],this.labelFont=["sans-serif","sans-serif","sans-serif"],this.labelFontStyle=["normal","normal","normal"],this.labelFontWeight=["normal","normal","normal"],this.labelFontVariant=["normal","normal","normal"],this.labelSize=[20,20,20],this.labelAngle=[0,0,0],this.labelAlign=["auto","auto","auto"],this.labelColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.labelPad=[10,10,10],this.lineEnable=[!0,!0,!0],this.lineMirror=[!1,!1,!1],this.lineWidth=[1,1,1],this.lineColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.lineTickEnable=[!0,!0,!0],this.lineTickMirror=[!1,!1,!1],this.lineTickLength=[0,0,0],this.lineTickWidth=[1,1,1],this.lineTickColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.gridEnable=[!0,!0,!0],this.gridWidth=[1,1,1],this.gridColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.zeroEnable=[!0,!0,!0],this.zeroLineColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.zeroLineWidth=[2,2,2],this.backgroundEnable=[!1,!1,!1],this.backgroundColor=[[.8,.8,.8,.5],[.8,.8,.8,.5],[.8,.8,.8,.5]],this._firstInit=!0,this._text=null,this._lines=null,this._background=o(t)}var p=f.prototype;function m(){this.primalOffset=[0,0,0],this.primalMinor=[0,0,0],this.mirrorOffset=[0,0,0],this.mirrorMinor=[0,0,0]}p.update=function(t){function e(e,r,n){if(n in t){var i,o=t[n],a=this[n];(e?h(o)&&h(o[0]):h(o))?this[n]=i=[r(o[0]),r(o[1]),r(o[2])]:this[n]=i=[r(o),r(o),r(o)];for(var s=0;s<3;++s)if(i[s]!==a[s])return!0}return!1}t=t||{};var r,o=e.bind(this,!1,Number),a=e.bind(this,!1,Boolean),l=e.bind(this,!1,String),c=e.bind(this,!0,(function(t){if(h(t)){if(3===t.length)return[+t[0],+t[1],+t[2],1];if(4===t.length)return[+t[0],+t[1],+t[2],+t[3]]}return[0,0,0,1]})),u=!1,d=!1;if("bounds"in t)for(var f=t.bounds,p=0;p<2;++p)for(var m=0;m<3;++m)f[p][m]!==this.bounds[p][m]&&(d=!0),this.bounds[p][m]=f[p][m];if("ticks"in t)for(r=t.ticks,u=!0,this.autoTicks=!1,p=0;p<3;++p)this.tickSpacing[p]=0;else o("tickSpacing")&&(this.autoTicks=!0,d=!0);if(this._firstInit&&("ticks"in t||"tickSpacing"in t||(this.autoTicks=!0),d=!0,u=!0,this._firstInit=!1),d&&this.autoTicks&&(r=s.create(this.bounds,this.tickSpacing),u=!0),u){for(p=0;p<3;++p)r[p].sort((function(t,e){return t.x-e.x}));s.equal(r,this.ticks)?u=!1:this.ticks=r}a("tickEnable"),l("tickFont")&&(u=!0),l("tickFontStyle")&&(u=!0),l("tickFontWeight")&&(u=!0),l("tickFontVariant")&&(u=!0),o("tickSize"),o("tickAngle"),o("tickPad"),c("tickColor");var g=l("labels");l("labelFont")&&(g=!0),l("labelFontStyle")&&(g=!0),l("labelFontWeight")&&(g=!0),l("labelFontVariant")&&(g=!0),a("labelEnable"),o("labelSize"),o("labelPad"),c("labelColor"),a("lineEnable"),a("lineMirror"),o("lineWidth"),c("lineColor"),a("lineTickEnable"),a("lineTickMirror"),o("lineTickLength"),o("lineTickWidth"),c("lineTickColor"),a("gridEnable"),o("gridWidth"),c("gridColor"),a("zeroEnable"),c("zeroLineColor"),o("zeroLineWidth"),a("backgroundEnable"),c("backgroundColor");var v=[{family:this.labelFont[0],style:this.labelFontStyle[0],weight:this.labelFontWeight[0],variant:this.labelFontVariant[0]},{family:this.labelFont[1],style:this.labelFontStyle[1],weight:this.labelFontWeight[1],variant:this.labelFontVariant[1]},{family:this.labelFont[2],style:this.labelFontStyle[2],weight:this.labelFontWeight[2],variant:this.labelFontVariant[2]}],b=[{family:this.tickFont[0],style:this.tickFontStyle[0],weight:this.tickFontWeight[0],variant:this.tickFontVariant[0]},{family:this.tickFont[1],style:this.tickFontStyle[1],weight:this.tickFontWeight[1],variant:this.tickFontVariant[1]},{family:this.tickFont[2],style:this.tickFontStyle[2],weight:this.tickFontWeight[2],variant:this.tickFontVariant[2]}];this._text?this._text&&(g||u)&&this._text.update(this.bounds,this.labels,v,this.ticks,b):this._text=n(this.gl,this.bounds,this.labels,v,this.ticks,b),this._lines&&u&&(this._lines.dispose(),this._lines=null),this._lines||(this._lines=i(this.gl,this.bounds,this.ticks))};var g=[new m,new m,new m];function v(t,e,r,n,i){for(var o=t.primalOffset,a=t.primalMinor,s=t.mirrorOffset,l=t.mirrorMinor,c=n[e],u=0;u<3;++u)if(e!==u){var h=o,d=s,f=a,p=l;c&1<0?(f[u]=-1,p[u]=0):(f[u]=0,p[u]=1)}}var b=[0,0,0],y={model:l,view:l,projection:l,_ortho:!1};p.isOpaque=function(){return!0},p.isTransparent=function(){return!1},p.drawTransparent=function(t){};var x=[0,0,0],_=[0,0,0],w=[0,0,0];p.draw=function(t){t=t||y;for(var e=this.gl,r=t.model||l,n=t.view||l,i=t.projection||l,o=this.bounds,s=t._ortho||!1,c=a(r,n,i,o,s),u=c.cubeEdges,h=c.axis,f=n[12],p=n[13],m=n[14],k=n[15],A=(s?2:1)*this.pixelRatio*(i[3]*f+i[7]*p+i[11]*m+i[15]*k)/e.drawingBufferHeight,M=0;M<3;++M)this.lastCubeProps.cubeEdges[M]=u[M],this.lastCubeProps.axis[M]=h[M];var T=g;for(M=0;M<3;++M)v(g[M],M,this.bounds,u,h);e=this.gl;var S,C,E,L=b;for(M=0;M<3;++M)this.backgroundEnable[M]?L[M]=h[M]:L[M]=0;for(this._background.draw(r,n,i,o,L,this.backgroundColor),this._lines.bind(r,n,i,this),M=0;M<3;++M){var z=[0,0,0];h[M]>0?z[M]=o[1][M]:z[M]=o[0][M];for(var O=0;O<2;++O){var D=(M+1+O)%3,I=(M+1+(1^O))%3;this.gridEnable[D]&&this._lines.drawGrid(D,I,this.bounds,z,this.gridColor[D],this.gridWidth[D]*this.pixelRatio)}for(O=0;O<2;++O)D=(M+1+O)%3,I=(M+1+(1^O))%3,this.zeroEnable[I]&&Math.min(o[0][I],o[1][I])<=0&&Math.max(o[0][I],o[1][I])>=0&&this._lines.drawZero(D,I,this.bounds,z,this.zeroLineColor[I],this.zeroLineWidth[I]*this.pixelRatio)}for(M=0;M<3;++M){this.lineEnable[M]&&this._lines.drawAxisLine(M,this.bounds,T[M].primalOffset,this.lineColor[M],this.lineWidth[M]*this.pixelRatio),this.lineMirror[M]&&this._lines.drawAxisLine(M,this.bounds,T[M].mirrorOffset,this.lineColor[M],this.lineWidth[M]*this.pixelRatio);var F=d(x,T[M].primalMinor),R=d(_,T[M].mirrorMinor),P=this.lineTickLength;for(O=0;O<3;++O){var j=A/r[5*O];F[O]*=P[O]*j,R[O]*=P[O]*j}this.lineTickEnable[M]&&this._lines.drawAxisTicks(M,T[M].primalOffset,F,this.lineTickColor[M],this.lineTickWidth[M]*this.pixelRatio),this.lineTickMirror[M]&&this._lines.drawAxisTicks(M,T[M].mirrorOffset,R,this.lineTickColor[M],this.lineTickWidth[M]*this.pixelRatio)}function N(t){(E=[0,0,0])[t]=1}function B(t,e,r){var n=(t+1)%3,i=(t+2)%3,o=e[n],a=e[i],s=r[n],l=r[i];o>0&&l>0||o>0&&l<0||o<0&&l>0||o<0&&l<0?N(n):(a>0&&s>0||a>0&&s<0||a<0&&s>0||a<0&&s<0)&&N(i)}for(this._lines.unbind(),this._text.bind(r,n,i,this.pixelRatio),M=0;M<3;++M){var U=T[M].primalMinor,G=T[M].mirrorMinor,V=d(w,T[M].primalOffset);for(O=0;O<3;++O)this.lineTickEnable[M]&&(V[O]+=A*U[O]*Math.max(this.lineTickLength[O],0)/r[5*O]);var H=[0,0,0];if(H[M]=1,this.tickEnable[M]){for(-3600===this.tickAngle[M]?(this.tickAngle[M]=0,this.tickAlign[M]="auto"):this.tickAlign[M]=-1,C=1,"auto"===(S=[this.tickAlign[M],.5,C])[0]?S[0]=0:S[0]=parseInt(""+S[0]),E=[0,0,0],B(M,U,G),O=0;O<3;++O)V[O]+=A*U[O]*this.tickPad[O]/r[5*O];this._text.drawTicks(M,this.tickSize[M],this.tickAngle[M],V,this.tickColor[M],H,E,S)}if(this.labelEnable[M]){for(C=0,E=[0,0,0],this.labels[M].length>4&&(N(M),C=1),"auto"===(S=[this.labelAlign[M],.5,C])[0]?S[0]=0:S[0]=parseInt(""+S[0]),O=0;O<3;++O)V[O]+=A*U[O]*this.labelPad[O]/r[5*O];V[M]+=.5*(o[0][M]+o[1][M]),this._text.drawLabel(M,this.labelSize[M],this.labelAngle[M],V,this.labelColor[M],[0,0,0],E,S)}}this._text.unbind()},p.dispose=function(){this._text.dispose(),this._lines.dispose(),this._background.dispose(),this._lines=null,this._text=null,this._background=null,this.gl=null}},5304:function(t,e,r){"use strict";t.exports=function(t){for(var e=[],r=[],s=0,l=0;l<3;++l)for(var c=(l+1)%3,u=(l+2)%3,h=[0,0,0],d=[0,0,0],f=-1;f<=1;f+=2){r.push(s,s+2,s+1,s+1,s+2,s+3),h[l]=f,d[l]=f;for(var p=-1;p<=1;p+=2){h[c]=p;for(var m=-1;m<=1;m+=2)h[u]=m,e.push(h[0],h[1],h[2],d[0],d[1],d[2]),s+=1}var g=c;c=u,u=g}var v=n(t,new Float32Array(e)),b=n(t,new Uint16Array(r),t.ELEMENT_ARRAY_BUFFER),y=i(t,[{buffer:v,type:t.FLOAT,size:3,offset:0,stride:24},{buffer:v,type:t.FLOAT,size:3,offset:12,stride:24}],b),x=o(t);return x.attributes.position.location=0,x.attributes.normal.location=1,new a(t,v,y,x)};var n=r(2762),i=r(8116),o=r(1879).bg;function a(t,e,r,n){this.gl=t,this.buffer=e,this.vao=r,this.shader=n}var s=a.prototype;s.draw=function(t,e,r,n,i,o){for(var a=!1,s=0;s<3;++s)a=a||i[s];if(a){var l=this.gl;l.enable(l.POLYGON_OFFSET_FILL),l.polygonOffset(1,2),this.shader.bind(),this.shader.uniforms={model:t,view:e,projection:r,bounds:n,enable:i,colors:o},this.vao.bind(),this.vao.draw(this.gl.TRIANGLES,36),this.vao.unbind(),l.disable(l.POLYGON_OFFSET_FILL)}},s.dispose=function(){this.vao.dispose(),this.buffer.dispose(),this.shader.dispose()}},6429:function(t,e,r){"use strict";t.exports=function(t,e,r,o,f){i(s,e,t),i(s,r,s);for(var b=0,y=0;y<2;++y){u[2]=o[y][2];for(var x=0;x<2;++x){u[1]=o[x][1];for(var _=0;_<2;++_)u[0]=o[_][0],d(l[b],u,s),b+=1}}var w=-1;for(y=0;y<8;++y){for(var k=l[y][3],A=0;A<3;++A)c[y][A]=l[y][A]/k;f&&(c[y][2]*=-1),k<0&&(w<0||c[y][2]C&&(w|=1<C&&(w|=1<c[y][1])&&(R=y);var P=-1;for(y=0;y<3;++y)(N=R^1<c[j][0]&&(j=N))}var B=m;B[0]=B[1]=B[2]=0,B[n.log2(P^R)]=R&P,B[n.log2(R^j)]=R&j;var U=7^j;U===w||U===F?(U=7^P,B[n.log2(j^U)]=U&j):B[n.log2(P^U)]=U&P;var G=g,V=w;for(M=0;M<3;++M)G[M]=V&1< HALF_PI) && (b <= ONE_AND_HALF_PI)) ?\n b - PI :\n b;\n}\n\nfloat look_horizontal_or_vertical(float a, float ratio) {\n // ratio controls the ratio between being horizontal to (vertical + horizontal)\n // if ratio is set to 0.5 then it is 50%, 50%.\n // when using a higher ratio e.g. 0.75 the result would\n // likely be more horizontal than vertical.\n\n float b = positive_angle(a);\n\n return\n (b < ( ratio) * HALF_PI) ? 0.0 :\n (b < (2.0 - ratio) * HALF_PI) ? -HALF_PI :\n (b < (2.0 + ratio) * HALF_PI) ? 0.0 :\n (b < (4.0 - ratio) * HALF_PI) ? HALF_PI :\n 0.0;\n}\n\nfloat roundTo(float a, float b) {\n return float(b * floor((a + 0.5 * b) / b));\n}\n\nfloat look_round_n_directions(float a, int n) {\n float b = positive_angle(a);\n float div = TWO_PI / float(n);\n float c = roundTo(b, div);\n return look_upwards(c);\n}\n\nfloat applyAlignOption(float rawAngle, float delta) {\n return\n (option > 2) ? look_round_n_directions(rawAngle + delta, option) : // option 3-n: round to n directions\n (option == 2) ? look_horizontal_or_vertical(rawAngle + delta, hv_ratio) : // horizontal or vertical\n (option == 1) ? rawAngle + delta : // use free angle, and flip to align with one direction of the axis\n (option == 0) ? look_upwards(rawAngle) : // use free angle, and stay upwards\n (option ==-1) ? 0.0 : // useful for backward compatibility, all texts remains horizontal\n rawAngle; // otherwise return back raw input angle\n}\n\nbool isAxisTitle = (axis.x == 0.0) &&\n (axis.y == 0.0) &&\n (axis.z == 0.0);\n\nvoid main() {\n //Compute world offset\n float axisDistance = position.z;\n vec3 dataPosition = axisDistance * axis + offset;\n\n float beta = angle; // i.e. user defined attributes for each tick\n\n float axisAngle;\n float clipAngle;\n float flip;\n\n if (enableAlign) {\n axisAngle = (isAxisTitle) ? HALF_PI :\n computeViewAngle(dataPosition, dataPosition + axis);\n clipAngle = computeViewAngle(dataPosition, dataPosition + alignDir);\n\n axisAngle += (sin(axisAngle) < 0.0) ? PI : 0.0;\n clipAngle += (sin(clipAngle) < 0.0) ? PI : 0.0;\n\n flip = (dot(vec2(cos(axisAngle), sin(axisAngle)),\n vec2(sin(clipAngle),-cos(clipAngle))) > 0.0) ? 1.0 : 0.0;\n\n beta += applyAlignOption(clipAngle, flip * PI);\n }\n\n //Compute plane offset\n vec2 planeCoord = position.xy * pixelScale;\n\n mat2 planeXform = scale * mat2(\n cos(beta), sin(beta),\n -sin(beta), cos(beta)\n );\n\n vec2 viewOffset = 2.0 * planeXform * planeCoord / resolution;\n\n //Compute clip position\n vec3 clipPosition = project(dataPosition);\n\n //Apply text offset in clip coordinates\n clipPosition += vec3(viewOffset, 0.0);\n\n //Done\n gl_Position = vec4(clipPosition, 1.0);\n}\n"]),l=n(["precision highp float;\n#define GLSLIFY 1\n\nuniform vec4 color;\nvoid main() {\n gl_FragColor = color;\n}"]);e.Q=function(t){return i(t,s,l,null,[{name:"position",type:"vec3"}])};var c=n(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec3 position;\nattribute vec3 normal;\n\nuniform mat4 model, view, projection;\nuniform vec3 enable;\nuniform vec3 bounds[2];\n\nvarying vec3 colorChannel;\n\nvoid main() {\n\n vec3 signAxis = sign(bounds[1] - bounds[0]);\n\n vec3 realNormal = signAxis * normal;\n\n if(dot(realNormal, enable) > 0.0) {\n vec3 minRange = min(bounds[0], bounds[1]);\n vec3 maxRange = max(bounds[0], bounds[1]);\n vec3 nPosition = mix(minRange, maxRange, 0.5 * (position + 1.0));\n gl_Position = projection * (view * (model * vec4(nPosition, 1.0)));\n } else {\n gl_Position = vec4(0,0,0,0);\n }\n\n colorChannel = abs(realNormal);\n}\n"]),u=n(["precision highp float;\n#define GLSLIFY 1\n\nuniform vec4 colors[3];\n\nvarying vec3 colorChannel;\n\nvoid main() {\n gl_FragColor = colorChannel.x * colors[0] +\n colorChannel.y * colors[1] +\n colorChannel.z * colors[2];\n}"]);e.bg=function(t){return i(t,c,u,null,[{name:"position",type:"vec3"},{name:"normal",type:"vec3"}])}},4935:function(t,e,r){"use strict";t.exports=function(t,e,r,n,a,l){var c=i(t),h=o(t,[{buffer:c,size:3}]),d=s(t);d.attributes.position.location=0;var f=new u(t,d,c,h);return f.update(e,r,n,a,l),f};var i=r(2762),o=r(8116),a=r(4359),s=r(1879).Q,l=window||n.global||{},c=l.__TEXT_CACHE||{};function u(t,e,r,n){this.gl=t,this.shader=e,this.buffer=r,this.vao=n,this.tickOffset=this.tickCount=this.labelOffset=this.labelCount=null}l.__TEXT_CACHE={};var h=u.prototype,d=[0,0];h.bind=function(t,e,r,n){this.vao.bind(),this.shader.bind();var i=this.shader.uniforms;i.model=t,i.view=e,i.projection=r,i.pixelScale=n,d[0]=this.gl.drawingBufferWidth,d[1]=this.gl.drawingBufferHeight,this.shader.uniforms.resolution=d},h.unbind=function(){this.vao.unbind()},h.update=function(t,e,r,n,i){var o=[];function s(t,e,r,n,i,s){var l=[r.style,r.weight,r.variant,r.family].join("_"),u=c[l];u||(u=c[l]={});var h=u[e];h||(h=u[e]=function(t,e){try{return a(t,e)}catch(e){return console.warn('error vectorizing text:"'+t+'" error:',e),{cells:[],positions:[]}}}(e,{triangles:!0,font:r.family,fontStyle:r.style,fontWeight:r.weight,fontVariant:r.variant,textAlign:"center",textBaseline:"middle",lineSpacing:i,styletags:s}));for(var d=(n||12)/12,f=h.positions,p=h.cells,m=0,g=p.length;m=0;--b){var y=f[v[b]];o.push(d*y[0],-d*y[1],t)}}for(var l=[0,0,0],u=[0,0,0],h=[0,0,0],d=[0,0,0],f={breaklines:!0,bolds:!0,italics:!0,subscripts:!0,superscripts:!0},p=0;p<3;++p){h[p]=o.length/3|0,s(.5*(t[0][p]+t[1][p]),e[p],r[p],12,1.25,f),d[p]=(o.length/3|0)-h[p],l[p]=o.length/3|0;for(var m=0;m=0&&(i=r.length-n-1);var o=Math.pow(10,i),a=Math.round(t*e*o),s=a+"";if(s.indexOf("e")>=0)return s;var l=a/o,c=a%o;a<0?(l=0|-Math.ceil(l),c=0|-c):(l=0|Math.floor(l),c|=0);var u=""+l;if(a<0&&(u="-"+u),i){for(var h=""+c;h.length=t[0][i];--a)o.push({x:a*e[i],text:r(e[i],a)});n.push(o)}return n},e.equal=function(t,e){for(var r=0;r<3;++r){if(t[r].length!==e[r].length)return!1;for(var n=0;nr)throw new Error("gl-buffer: If resizing buffer, must not specify offset");return t.bufferSubData(e,o,i),r}function u(t,e){for(var r=n.malloc(t.length,e),i=t.length,o=0;o=0;--n){if(e[n]!==r)return!1;r*=t[n]}return!0}(t.shape,t.stride))0===t.offset&&t.data.length===t.shape[0]?this.length=c(this.gl,this.type,this.length,this.usage,t.data,e):this.length=c(this.gl,this.type,this.length,this.usage,t.data.subarray(t.offset,t.shape[0]),e);else{var s=n.malloc(t.size,r),l=o(s,t.shape);i.assign(l,t),this.length=c(this.gl,this.type,this.length,this.usage,e<0?s:s.subarray(0,t.size),e),n.free(s)}}else if(Array.isArray(t)){var h;h=this.type===this.gl.ELEMENT_ARRAY_BUFFER?u(t,"uint16"):u(t,"float32"),this.length=c(this.gl,this.type,this.length,this.usage,e<0?h:h.subarray(0,t.length),e),n.free(h)}else if("object"==typeof t&&"number"==typeof t.length)this.length=c(this.gl,this.type,this.length,this.usage,t,e);else{if("number"!=typeof t&&void 0!==t)throw new Error("gl-buffer: Invalid data type");if(e>=0)throw new Error("gl-buffer: Cannot specify offset when resizing buffer");(t|=0)<=0&&(t=1),this.gl.bufferData(this.type,0|t,this.usage),this.length=t}},t.exports=function(t,e,r,n){if(r=r||t.ARRAY_BUFFER,n=n||t.DYNAMIC_DRAW,r!==t.ARRAY_BUFFER&&r!==t.ELEMENT_ARRAY_BUFFER)throw new Error("gl-buffer: Invalid type for webgl buffer, must be either gl.ARRAY_BUFFER or gl.ELEMENT_ARRAY_BUFFER");if(n!==t.DYNAMIC_DRAW&&n!==t.STATIC_DRAW&&n!==t.STREAM_DRAW)throw new Error("gl-buffer: Invalid usage for buffer, must be either gl.DYNAMIC_DRAW, gl.STATIC_DRAW or gl.STREAM_DRAW");var i=t.createBuffer(),o=new s(t,r,i,0,n);return o.update(e),o}},6405:function(t,e,r){"use strict";var n=r(2931);t.exports=function(t,e){var r=t.positions,i=t.vectors,o={positions:[],vertexIntensity:[],vertexIntensityBounds:t.vertexIntensityBounds,vectors:[],cells:[],coneOffset:t.coneOffset,colormap:t.colormap};if(0===t.positions.length)return e&&(e[0]=[0,0,0],e[1]=[0,0,0]),o;for(var a=0,s=1/0,l=-1/0,c=1/0,u=-1/0,h=1/0,d=-1/0,f=null,p=null,m=[],g=1/0,v=!1,b="raw"===t.coneSizemode,y=0;ya&&(a=n.length(_)),y&&!b){var w=2*n.distance(f,x)/(n.length(p)+n.length(_));w?(g=Math.min(g,w),v=!1):v=!0}v||(f=x,p=_),m.push(_)}var k=[s,c,h],A=[l,u,d];e&&(e[0]=k,e[1]=A),0===a&&(a=1);var M=1/a;isFinite(g)||(g=1),o.vectorScale=g;var T=t.coneSize||(b?1:.5);t.absoluteConeSize&&(T=t.absoluteConeSize*M),o.coneScale=T,y=0;for(var S=0;y=1},f.isTransparent=function(){return this.opacity<1},f.pickSlots=1,f.setPickBase=function(t){this.pickId=t},f.update=function(t){t=t||{};var e=this.gl;this.dirty=!0,"lightPosition"in t&&(this.lightPosition=t.lightPosition),"opacity"in t&&(this.opacity=t.opacity),"ambient"in t&&(this.ambientLight=t.ambient),"diffuse"in t&&(this.diffuseLight=t.diffuse),"specular"in t&&(this.specularLight=t.specular),"roughness"in t&&(this.roughness=t.roughness),"fresnel"in t&&(this.fresnel=t.fresnel),void 0!==t.tubeScale&&(this.tubeScale=t.tubeScale),void 0!==t.vectorScale&&(this.vectorScale=t.vectorScale),void 0!==t.coneScale&&(this.coneScale=t.coneScale),void 0!==t.coneOffset&&(this.coneOffset=t.coneOffset),t.colormap&&(this.texture.shape=[256,256],this.texture.minFilter=e.LINEAR_MIPMAP_LINEAR,this.texture.magFilter=e.LINEAR,this.texture.setPixels(function(t){for(var e=u({colormap:t,nshades:256,format:"rgba"}),r=new Uint8Array(1024),n=0;n<256;++n){for(var i=e[n],o=0;o<3;++o)r[4*n+o]=i[o];r[4*n+3]=255*i[3]}return c(r,[256,256,4],[4,0,1])}(t.colormap)),this.texture.generateMipmap());var r=t.cells,n=t.positions,i=t.vectors;if(n&&r&&i){var o=[],a=[],s=[],l=[],h=[];this.cells=r,this.positions=n,this.vectors=i;var d=t.meshColor||[1,1,1,1],f=t.vertexIntensity,p=1/0,m=-1/0;if(f)if(t.vertexIntensityBounds)p=+t.vertexIntensityBounds[0],m=+t.vertexIntensityBounds[1];else for(var g=0;g0){var m=this.triShader;m.bind(),m.uniforms=c,this.triangleVAO.bind(),e.drawArrays(e.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind()}},f.drawPick=function(t){t=t||{};for(var e=this.gl,r=t.model||h,n=t.view||h,i=t.projection||h,o=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],a=0;a<3;++a)o[0][a]=Math.max(o[0][a],this.clipBounds[0][a]),o[1][a]=Math.min(o[1][a],this.clipBounds[1][a]);this._model=[].slice.call(r),this._view=[].slice.call(n),this._projection=[].slice.call(i),this._resolution=[e.drawingBufferWidth,e.drawingBufferHeight];var s={model:r,view:n,projection:i,clipBounds:o,tubeScale:this.tubeScale,vectorScale:this.vectorScale,coneScale:this.coneScale,coneOffset:this.coneOffset,pickId:this.pickId/255},l=this.pickShader;l.bind(),l.uniforms=s,this.triangleCount>0&&(this.triangleVAO.bind(),e.drawArrays(e.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind())},f.pick=function(t){if(!t)return null;if(t.id!==this.pickId)return null;var e=t.value[0]+256*t.value[1]+65536*t.value[2],r=this.cells[e],n=this.positions[r[1]].slice(0,3),i={position:n,dataCoordinate:n,index:Math.floor(r[1]/48)};return"cone"===this.traceType?i.index=Math.floor(r[1]/48):"streamtube"===this.traceType&&(i.intensity=this.intensity[r[1]],i.velocity=this.vectors[r[1]].slice(0,3),i.divergence=this.vectors[r[1]][3],i.index=e),i},f.dispose=function(){this.texture.dispose(),this.triShader.dispose(),this.pickShader.dispose(),this.triangleVAO.dispose(),this.trianglePositions.dispose(),this.triangleVectors.dispose(),this.triangleColors.dispose(),this.triangleUVs.dispose(),this.triangleIds.dispose()},t.exports=function(t,e,r){var s=r.shaders;1===arguments.length&&(t=(e=t).gl);var l=function(t,e){var r=n(t,e.meshShader.vertex,e.meshShader.fragment,null,e.meshShader.attributes);return r.attributes.position.location=0,r.attributes.color.location=2,r.attributes.uv.location=3,r.attributes.vector.location=4,r}(t,s),u=function(t,e){var r=n(t,e.pickShader.vertex,e.pickShader.fragment,null,e.pickShader.attributes);return r.attributes.position.location=0,r.attributes.id.location=1,r.attributes.vector.location=4,r}(t,s),h=a(t,c(new Uint8Array([255,255,255,255]),[1,1,4]));h.generateMipmap(),h.minFilter=t.LINEAR_MIPMAP_LINEAR,h.magFilter=t.LINEAR;var f=i(t),p=i(t),m=i(t),g=i(t),v=i(t),b=new d(t,h,l,u,f,p,v,m,g,o(t,[{buffer:f,type:t.FLOAT,size:4},{buffer:v,type:t.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:m,type:t.FLOAT,size:4},{buffer:g,type:t.FLOAT,size:2},{buffer:p,type:t.FLOAT,size:4}]),r.traceType||"cone");return b.update(e),b}},614:function(t,e,r){var n=r(3236),i=n(["precision highp float;\n\nprecision highp float;\n#define GLSLIFY 1\n\nvec3 getOrthogonalVector(vec3 v) {\n // Return up-vector for only-z vector.\n // Return ax + by + cz = 0, a point that lies on the plane that has v as a normal and that isn't (0,0,0).\n // From the above if-statement we have ||a|| > 0 U ||b|| > 0.\n // Assign z = 0, x = -b, y = a:\n // a*-b + b*a + c*0 = -ba + ba + 0 = 0\n if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) {\n return normalize(vec3(-v.y, v.x, 0.0));\n } else {\n return normalize(vec3(0.0, v.z, -v.y));\n }\n}\n\n// Calculate the cone vertex and normal at the given index.\n//\n// The returned vertex is for a cone with its top at origin and height of 1.0,\n// pointing in the direction of the vector attribute.\n//\n// Each cone is made up of a top vertex, a center base vertex and base perimeter vertices.\n// These vertices are used to make up the triangles of the cone by the following:\n// segment + 0 top vertex\n// segment + 1 perimeter vertex a+1\n// segment + 2 perimeter vertex a\n// segment + 3 center base vertex\n// segment + 4 perimeter vertex a\n// segment + 5 perimeter vertex a+1\n// Where segment is the number of the radial segment * 6 and a is the angle at that radial segment.\n// To go from index to segment, floor(index / 6)\n// To go from segment to angle, 2*pi * (segment/segmentCount)\n// To go from index to segment index, index - (segment*6)\n//\nvec3 getConePosition(vec3 d, float rawIndex, float coneOffset, out vec3 normal) {\n\n const float segmentCount = 8.0;\n\n float index = rawIndex - floor(rawIndex /\n (segmentCount * 6.0)) *\n (segmentCount * 6.0);\n\n float segment = floor(0.001 + index/6.0);\n float segmentIndex = index - (segment*6.0);\n\n normal = -normalize(d);\n\n if (segmentIndex > 2.99 && segmentIndex < 3.01) {\n return mix(vec3(0.0), -d, coneOffset);\n }\n\n float nextAngle = (\n (segmentIndex > 0.99 && segmentIndex < 1.01) ||\n (segmentIndex > 4.99 && segmentIndex < 5.01)\n ) ? 1.0 : 0.0;\n float angle = 2.0 * 3.14159 * ((segment + nextAngle) / segmentCount);\n\n vec3 v1 = mix(d, vec3(0.0), coneOffset);\n vec3 v2 = v1 - d;\n\n vec3 u = getOrthogonalVector(d);\n vec3 v = normalize(cross(u, d));\n\n vec3 x = u * cos(angle) * length(d)*0.25;\n vec3 y = v * sin(angle) * length(d)*0.25;\n vec3 v3 = v2 + x + y;\n if (segmentIndex < 3.0) {\n vec3 tx = u * sin(angle);\n vec3 ty = v * -cos(angle);\n vec3 tangent = tx + ty;\n normal = normalize(cross(v3 - v1, tangent));\n }\n\n if (segmentIndex == 0.0) {\n return mix(d, vec3(0.0), coneOffset);\n }\n return v3;\n}\n\nattribute vec3 vector;\nattribute vec4 color, position;\nattribute vec2 uv;\n\nuniform float vectorScale, coneScale, coneOffset;\nuniform mat4 model, view, projection, inverseModel;\nuniform vec3 eyePosition, lightPosition;\n\nvarying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n // Scale the vector magnitude to stay constant with\n // model & view changes.\n vec3 normal;\n vec3 XYZ = getConePosition(mat3(model) * ((vectorScale * coneScale) * vector), position.w, coneOffset, normal);\n vec4 conePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0);\n\n //Lighting geometry parameters\n vec4 cameraCoordinate = view * conePosition;\n cameraCoordinate.xyz /= cameraCoordinate.w;\n f_lightDirection = lightPosition - cameraCoordinate.xyz;\n f_eyeDirection = eyePosition - cameraCoordinate.xyz;\n f_normal = normalize((vec4(normal, 0.0) * inverseModel).xyz);\n\n // vec4 m_position = model * vec4(conePosition, 1.0);\n vec4 t_position = view * conePosition;\n gl_Position = projection * t_position;\n\n f_color = color;\n f_data = conePosition.xyz;\n f_position = position.xyz;\n f_uv = uv;\n}\n"]),o=n(["#extension GL_OES_standard_derivatives : enable\n\nprecision highp float;\n#define GLSLIFY 1\n\nfloat beckmannDistribution(float x, float roughness) {\n float NdotH = max(x, 0.0001);\n float cos2Alpha = NdotH * NdotH;\n float tan2Alpha = (cos2Alpha - 1.0) / cos2Alpha;\n float roughness2 = roughness * roughness;\n float denom = 3.141592653589793 * roughness2 * cos2Alpha * cos2Alpha;\n return exp(tan2Alpha / roughness2) / denom;\n}\n\nfloat cookTorranceSpecular(\n vec3 lightDirection,\n vec3 viewDirection,\n vec3 surfaceNormal,\n float roughness,\n float fresnel) {\n\n float VdotN = max(dot(viewDirection, surfaceNormal), 0.0);\n float LdotN = max(dot(lightDirection, surfaceNormal), 0.0);\n\n //Half angle vector\n vec3 H = normalize(lightDirection + viewDirection);\n\n //Geometric term\n float NdotH = max(dot(surfaceNormal, H), 0.0);\n float VdotH = max(dot(viewDirection, H), 0.000001);\n float LdotH = max(dot(lightDirection, H), 0.000001);\n float G1 = (2.0 * NdotH * VdotN) / VdotH;\n float G2 = (2.0 * NdotH * LdotN) / LdotH;\n float G = min(1.0, min(G1, G2));\n \n //Distribution term\n float D = beckmannDistribution(NdotH, roughness);\n\n //Fresnel term\n float F = pow(1.0 - VdotN, fresnel);\n\n //Multiply terms and done\n return G * F * D / max(3.14159265 * VdotN, 0.000001);\n}\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float roughness, fresnel, kambient, kdiffuse, kspecular, opacity;\nuniform sampler2D texture;\n\nvarying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;\n vec3 N = normalize(f_normal);\n vec3 L = normalize(f_lightDirection);\n vec3 V = normalize(f_eyeDirection);\n\n if(gl_FrontFacing) {\n N = -N;\n }\n\n float specular = min(1.0, max(0.0, cookTorranceSpecular(L, V, N, roughness, fresnel)));\n float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0);\n\n vec4 surfaceColor = f_color * texture2D(texture, f_uv);\n vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular, 1.0);\n\n gl_FragColor = litColor * opacity;\n}\n"]),a=n(["precision highp float;\n\nprecision highp float;\n#define GLSLIFY 1\n\nvec3 getOrthogonalVector(vec3 v) {\n // Return up-vector for only-z vector.\n // Return ax + by + cz = 0, a point that lies on the plane that has v as a normal and that isn't (0,0,0).\n // From the above if-statement we have ||a|| > 0 U ||b|| > 0.\n // Assign z = 0, x = -b, y = a:\n // a*-b + b*a + c*0 = -ba + ba + 0 = 0\n if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) {\n return normalize(vec3(-v.y, v.x, 0.0));\n } else {\n return normalize(vec3(0.0, v.z, -v.y));\n }\n}\n\n// Calculate the cone vertex and normal at the given index.\n//\n// The returned vertex is for a cone with its top at origin and height of 1.0,\n// pointing in the direction of the vector attribute.\n//\n// Each cone is made up of a top vertex, a center base vertex and base perimeter vertices.\n// These vertices are used to make up the triangles of the cone by the following:\n// segment + 0 top vertex\n// segment + 1 perimeter vertex a+1\n// segment + 2 perimeter vertex a\n// segment + 3 center base vertex\n// segment + 4 perimeter vertex a\n// segment + 5 perimeter vertex a+1\n// Where segment is the number of the radial segment * 6 and a is the angle at that radial segment.\n// To go from index to segment, floor(index / 6)\n// To go from segment to angle, 2*pi * (segment/segmentCount)\n// To go from index to segment index, index - (segment*6)\n//\nvec3 getConePosition(vec3 d, float rawIndex, float coneOffset, out vec3 normal) {\n\n const float segmentCount = 8.0;\n\n float index = rawIndex - floor(rawIndex /\n (segmentCount * 6.0)) *\n (segmentCount * 6.0);\n\n float segment = floor(0.001 + index/6.0);\n float segmentIndex = index - (segment*6.0);\n\n normal = -normalize(d);\n\n if (segmentIndex > 2.99 && segmentIndex < 3.01) {\n return mix(vec3(0.0), -d, coneOffset);\n }\n\n float nextAngle = (\n (segmentIndex > 0.99 && segmentIndex < 1.01) ||\n (segmentIndex > 4.99 && segmentIndex < 5.01)\n ) ? 1.0 : 0.0;\n float angle = 2.0 * 3.14159 * ((segment + nextAngle) / segmentCount);\n\n vec3 v1 = mix(d, vec3(0.0), coneOffset);\n vec3 v2 = v1 - d;\n\n vec3 u = getOrthogonalVector(d);\n vec3 v = normalize(cross(u, d));\n\n vec3 x = u * cos(angle) * length(d)*0.25;\n vec3 y = v * sin(angle) * length(d)*0.25;\n vec3 v3 = v2 + x + y;\n if (segmentIndex < 3.0) {\n vec3 tx = u * sin(angle);\n vec3 ty = v * -cos(angle);\n vec3 tangent = tx + ty;\n normal = normalize(cross(v3 - v1, tangent));\n }\n\n if (segmentIndex == 0.0) {\n return mix(d, vec3(0.0), coneOffset);\n }\n return v3;\n}\n\nattribute vec4 vector;\nattribute vec4 position;\nattribute vec4 id;\n\nuniform mat4 model, view, projection;\nuniform float vectorScale, coneScale, coneOffset;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n vec3 normal;\n vec3 XYZ = getConePosition(mat3(model) * ((vectorScale * coneScale) * vector.xyz), position.w, coneOffset, normal);\n vec4 conePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0);\n gl_Position = projection * (view * conePosition);\n f_id = id;\n f_position = position.xyz;\n}\n"]),s=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float pickId;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;\n\n gl_FragColor = vec4(pickId, f_id.xyz);\n}"]);e.meshShader={vertex:i,fragment:o,attributes:[{name:"position",type:"vec4"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"vector",type:"vec3"}]},e.pickShader={vertex:a,fragment:s,attributes:[{name:"position",type:"vec4"},{name:"id",type:"vec4"},{name:"vector",type:"vec3"}]}},737:function(t){t.exports={0:"NONE",1:"ONE",2:"LINE_LOOP",3:"LINE_STRIP",4:"TRIANGLES",5:"TRIANGLE_STRIP",6:"TRIANGLE_FAN",256:"DEPTH_BUFFER_BIT",512:"NEVER",513:"LESS",514:"EQUAL",515:"LEQUAL",516:"GREATER",517:"NOTEQUAL",518:"GEQUAL",519:"ALWAYS",768:"SRC_COLOR",769:"ONE_MINUS_SRC_COLOR",770:"SRC_ALPHA",771:"ONE_MINUS_SRC_ALPHA",772:"DST_ALPHA",773:"ONE_MINUS_DST_ALPHA",774:"DST_COLOR",775:"ONE_MINUS_DST_COLOR",776:"SRC_ALPHA_SATURATE",1024:"STENCIL_BUFFER_BIT",1028:"FRONT",1029:"BACK",1032:"FRONT_AND_BACK",1280:"INVALID_ENUM",1281:"INVALID_VALUE",1282:"INVALID_OPERATION",1285:"OUT_OF_MEMORY",1286:"INVALID_FRAMEBUFFER_OPERATION",2304:"CW",2305:"CCW",2849:"LINE_WIDTH",2884:"CULL_FACE",2885:"CULL_FACE_MODE",2886:"FRONT_FACE",2928:"DEPTH_RANGE",2929:"DEPTH_TEST",2930:"DEPTH_WRITEMASK",2931:"DEPTH_CLEAR_VALUE",2932:"DEPTH_FUNC",2960:"STENCIL_TEST",2961:"STENCIL_CLEAR_VALUE",2962:"STENCIL_FUNC",2963:"STENCIL_VALUE_MASK",2964:"STENCIL_FAIL",2965:"STENCIL_PASS_DEPTH_FAIL",2966:"STENCIL_PASS_DEPTH_PASS",2967:"STENCIL_REF",2968:"STENCIL_WRITEMASK",2978:"VIEWPORT",3024:"DITHER",3042:"BLEND",3088:"SCISSOR_BOX",3089:"SCISSOR_TEST",3106:"COLOR_CLEAR_VALUE",3107:"COLOR_WRITEMASK",3317:"UNPACK_ALIGNMENT",3333:"PACK_ALIGNMENT",3379:"MAX_TEXTURE_SIZE",3386:"MAX_VIEWPORT_DIMS",3408:"SUBPIXEL_BITS",3410:"RED_BITS",3411:"GREEN_BITS",3412:"BLUE_BITS",3413:"ALPHA_BITS",3414:"DEPTH_BITS",3415:"STENCIL_BITS",3553:"TEXTURE_2D",4352:"DONT_CARE",4353:"FASTEST",4354:"NICEST",5120:"BYTE",5121:"UNSIGNED_BYTE",5122:"SHORT",5123:"UNSIGNED_SHORT",5124:"INT",5125:"UNSIGNED_INT",5126:"FLOAT",5386:"INVERT",5890:"TEXTURE",6401:"STENCIL_INDEX",6402:"DEPTH_COMPONENT",6406:"ALPHA",6407:"RGB",6408:"RGBA",6409:"LUMINANCE",6410:"LUMINANCE_ALPHA",7680:"KEEP",7681:"REPLACE",7682:"INCR",7683:"DECR",7936:"VENDOR",7937:"RENDERER",7938:"VERSION",9728:"NEAREST",9729:"LINEAR",9984:"NEAREST_MIPMAP_NEAREST",9985:"LINEAR_MIPMAP_NEAREST",9986:"NEAREST_MIPMAP_LINEAR",9987:"LINEAR_MIPMAP_LINEAR",10240:"TEXTURE_MAG_FILTER",10241:"TEXTURE_MIN_FILTER",10242:"TEXTURE_WRAP_S",10243:"TEXTURE_WRAP_T",10497:"REPEAT",10752:"POLYGON_OFFSET_UNITS",16384:"COLOR_BUFFER_BIT",32769:"CONSTANT_COLOR",32770:"ONE_MINUS_CONSTANT_COLOR",32771:"CONSTANT_ALPHA",32772:"ONE_MINUS_CONSTANT_ALPHA",32773:"BLEND_COLOR",32774:"FUNC_ADD",32777:"BLEND_EQUATION_RGB",32778:"FUNC_SUBTRACT",32779:"FUNC_REVERSE_SUBTRACT",32819:"UNSIGNED_SHORT_4_4_4_4",32820:"UNSIGNED_SHORT_5_5_5_1",32823:"POLYGON_OFFSET_FILL",32824:"POLYGON_OFFSET_FACTOR",32854:"RGBA4",32855:"RGB5_A1",32873:"TEXTURE_BINDING_2D",32926:"SAMPLE_ALPHA_TO_COVERAGE",32928:"SAMPLE_COVERAGE",32936:"SAMPLE_BUFFERS",32937:"SAMPLES",32938:"SAMPLE_COVERAGE_VALUE",32939:"SAMPLE_COVERAGE_INVERT",32968:"BLEND_DST_RGB",32969:"BLEND_SRC_RGB",32970:"BLEND_DST_ALPHA",32971:"BLEND_SRC_ALPHA",33071:"CLAMP_TO_EDGE",33170:"GENERATE_MIPMAP_HINT",33189:"DEPTH_COMPONENT16",33306:"DEPTH_STENCIL_ATTACHMENT",33635:"UNSIGNED_SHORT_5_6_5",33648:"MIRRORED_REPEAT",33901:"ALIASED_POINT_SIZE_RANGE",33902:"ALIASED_LINE_WIDTH_RANGE",33984:"TEXTURE0",33985:"TEXTURE1",33986:"TEXTURE2",33987:"TEXTURE3",33988:"TEXTURE4",33989:"TEXTURE5",33990:"TEXTURE6",33991:"TEXTURE7",33992:"TEXTURE8",33993:"TEXTURE9",33994:"TEXTURE10",33995:"TEXTURE11",33996:"TEXTURE12",33997:"TEXTURE13",33998:"TEXTURE14",33999:"TEXTURE15",34e3:"TEXTURE16",34001:"TEXTURE17",34002:"TEXTURE18",34003:"TEXTURE19",34004:"TEXTURE20",34005:"TEXTURE21",34006:"TEXTURE22",34007:"TEXTURE23",34008:"TEXTURE24",34009:"TEXTURE25",34010:"TEXTURE26",34011:"TEXTURE27",34012:"TEXTURE28",34013:"TEXTURE29",34014:"TEXTURE30",34015:"TEXTURE31",34016:"ACTIVE_TEXTURE",34024:"MAX_RENDERBUFFER_SIZE",34041:"DEPTH_STENCIL",34055:"INCR_WRAP",34056:"DECR_WRAP",34067:"TEXTURE_CUBE_MAP",34068:"TEXTURE_BINDING_CUBE_MAP",34069:"TEXTURE_CUBE_MAP_POSITIVE_X",34070:"TEXTURE_CUBE_MAP_NEGATIVE_X",34071:"TEXTURE_CUBE_MAP_POSITIVE_Y",34072:"TEXTURE_CUBE_MAP_NEGATIVE_Y",34073:"TEXTURE_CUBE_MAP_POSITIVE_Z",34074:"TEXTURE_CUBE_MAP_NEGATIVE_Z",34076:"MAX_CUBE_MAP_TEXTURE_SIZE",34338:"VERTEX_ATTRIB_ARRAY_ENABLED",34339:"VERTEX_ATTRIB_ARRAY_SIZE",34340:"VERTEX_ATTRIB_ARRAY_STRIDE",34341:"VERTEX_ATTRIB_ARRAY_TYPE",34342:"CURRENT_VERTEX_ATTRIB",34373:"VERTEX_ATTRIB_ARRAY_POINTER",34466:"NUM_COMPRESSED_TEXTURE_FORMATS",34467:"COMPRESSED_TEXTURE_FORMATS",34660:"BUFFER_SIZE",34661:"BUFFER_USAGE",34816:"STENCIL_BACK_FUNC",34817:"STENCIL_BACK_FAIL",34818:"STENCIL_BACK_PASS_DEPTH_FAIL",34819:"STENCIL_BACK_PASS_DEPTH_PASS",34877:"BLEND_EQUATION_ALPHA",34921:"MAX_VERTEX_ATTRIBS",34922:"VERTEX_ATTRIB_ARRAY_NORMALIZED",34930:"MAX_TEXTURE_IMAGE_UNITS",34962:"ARRAY_BUFFER",34963:"ELEMENT_ARRAY_BUFFER",34964:"ARRAY_BUFFER_BINDING",34965:"ELEMENT_ARRAY_BUFFER_BINDING",34975:"VERTEX_ATTRIB_ARRAY_BUFFER_BINDING",35040:"STREAM_DRAW",35044:"STATIC_DRAW",35048:"DYNAMIC_DRAW",35632:"FRAGMENT_SHADER",35633:"VERTEX_SHADER",35660:"MAX_VERTEX_TEXTURE_IMAGE_UNITS",35661:"MAX_COMBINED_TEXTURE_IMAGE_UNITS",35663:"SHADER_TYPE",35664:"FLOAT_VEC2",35665:"FLOAT_VEC3",35666:"FLOAT_VEC4",35667:"INT_VEC2",35668:"INT_VEC3",35669:"INT_VEC4",35670:"BOOL",35671:"BOOL_VEC2",35672:"BOOL_VEC3",35673:"BOOL_VEC4",35674:"FLOAT_MAT2",35675:"FLOAT_MAT3",35676:"FLOAT_MAT4",35678:"SAMPLER_2D",35680:"SAMPLER_CUBE",35712:"DELETE_STATUS",35713:"COMPILE_STATUS",35714:"LINK_STATUS",35715:"VALIDATE_STATUS",35716:"INFO_LOG_LENGTH",35717:"ATTACHED_SHADERS",35718:"ACTIVE_UNIFORMS",35719:"ACTIVE_UNIFORM_MAX_LENGTH",35720:"SHADER_SOURCE_LENGTH",35721:"ACTIVE_ATTRIBUTES",35722:"ACTIVE_ATTRIBUTE_MAX_LENGTH",35724:"SHADING_LANGUAGE_VERSION",35725:"CURRENT_PROGRAM",36003:"STENCIL_BACK_REF",36004:"STENCIL_BACK_VALUE_MASK",36005:"STENCIL_BACK_WRITEMASK",36006:"FRAMEBUFFER_BINDING",36007:"RENDERBUFFER_BINDING",36048:"FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE",36049:"FRAMEBUFFER_ATTACHMENT_OBJECT_NAME",36050:"FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL",36051:"FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE",36053:"FRAMEBUFFER_COMPLETE",36054:"FRAMEBUFFER_INCOMPLETE_ATTACHMENT",36055:"FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT",36057:"FRAMEBUFFER_INCOMPLETE_DIMENSIONS",36061:"FRAMEBUFFER_UNSUPPORTED",36064:"COLOR_ATTACHMENT0",36096:"DEPTH_ATTACHMENT",36128:"STENCIL_ATTACHMENT",36160:"FRAMEBUFFER",36161:"RENDERBUFFER",36162:"RENDERBUFFER_WIDTH",36163:"RENDERBUFFER_HEIGHT",36164:"RENDERBUFFER_INTERNAL_FORMAT",36168:"STENCIL_INDEX8",36176:"RENDERBUFFER_RED_SIZE",36177:"RENDERBUFFER_GREEN_SIZE",36178:"RENDERBUFFER_BLUE_SIZE",36179:"RENDERBUFFER_ALPHA_SIZE",36180:"RENDERBUFFER_DEPTH_SIZE",36181:"RENDERBUFFER_STENCIL_SIZE",36194:"RGB565",36336:"LOW_FLOAT",36337:"MEDIUM_FLOAT",36338:"HIGH_FLOAT",36339:"LOW_INT",36340:"MEDIUM_INT",36341:"HIGH_INT",36346:"SHADER_COMPILER",36347:"MAX_VERTEX_UNIFORM_VECTORS",36348:"MAX_VARYING_VECTORS",36349:"MAX_FRAGMENT_UNIFORM_VECTORS",37440:"UNPACK_FLIP_Y_WEBGL",37441:"UNPACK_PREMULTIPLY_ALPHA_WEBGL",37442:"CONTEXT_LOST_WEBGL",37443:"UNPACK_COLORSPACE_CONVERSION_WEBGL",37444:"BROWSER_DEFAULT_WEBGL"}},5171:function(t,e,r){var n=r(737);t.exports=function(t){return n[t]}},9165:function(t,e,r){"use strict";t.exports=function(t){var e=t.gl,r=n(e),a=i(e,[{buffer:r,type:e.FLOAT,size:3,offset:0,stride:40},{buffer:r,type:e.FLOAT,size:4,offset:12,stride:40},{buffer:r,type:e.FLOAT,size:3,offset:28,stride:40}]),l=o(e);l.attributes.position.location=0,l.attributes.color.location=1,l.attributes.offset.location=2;var c=new s(e,r,a,l);return c.update(t),c};var n=r(2762),i=r(8116),o=r(3436),a=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function s(t,e,r,n){this.gl=t,this.shader=n,this.buffer=e,this.vao=r,this.pixelRatio=1,this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.lineWidth=[1,1,1],this.capSize=[10,10,10],this.lineCount=[0,0,0],this.lineOffset=[0,0,0],this.opacity=1,this.hasAlpha=!1}var l=s.prototype;function c(t,e){for(var r=0;r<3;++r)t[0][r]=Math.min(t[0][r],e[r]),t[1][r]=Math.max(t[1][r],e[r])}l.isOpaque=function(){return!this.hasAlpha},l.isTransparent=function(){return this.hasAlpha},l.drawTransparent=l.draw=function(t){var e=this.gl,r=this.shader.uniforms;this.shader.bind();var n=r.view=t.view||a,i=r.projection=t.projection||a;r.model=t.model||a,r.clipBounds=this.clipBounds,r.opacity=this.opacity;var o=n[12],s=n[13],l=n[14],c=n[15],u=(t._ortho?2:1)*this.pixelRatio*(i[3]*o+i[7]*s+i[11]*l+i[15]*c)/e.drawingBufferHeight;this.vao.bind();for(var h=0;h<3;++h)e.lineWidth(this.lineWidth[h]*this.pixelRatio),r.capSize=this.capSize[h]*u,this.lineCount[h]&&e.drawArrays(e.LINES,this.lineOffset[h],this.lineCount[h]);this.vao.unbind()};var u=function(){for(var t=new Array(3),e=0;e<3;++e){for(var r=[],n=1;n<=2;++n)for(var i=-1;i<=1;i+=2){var o=[0,0,0];o[(n+e)%3]=i,r.push(o)}t[e]=r}return t}();function h(t,e,r,n){for(var i=u[n],o=0;o0&&((f=u.slice())[s]+=p[1][s],i.push(u[0],u[1],u[2],m[0],m[1],m[2],m[3],0,0,0,f[0],f[1],f[2],m[0],m[1],m[2],m[3],0,0,0),c(this.bounds,f),a+=2+h(i,f,m,s))}this.lineCount[s]=a-this.lineOffset[s]}this.buffer.update(i)}},l.dispose=function(){this.shader.dispose(),this.buffer.dispose(),this.vao.dispose()}},3436:function(t,e,r){"use strict";var n=r(3236),i=r(9405),o=n(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec3 position, offset;\nattribute vec4 color;\nuniform mat4 model, view, projection;\nuniform float capSize;\nvarying vec4 fragColor;\nvarying vec3 fragPosition;\n\nvoid main() {\n vec4 worldPosition = model * vec4(position, 1.0);\n worldPosition = (worldPosition / worldPosition.w) + vec4(capSize * offset, 0.0);\n gl_Position = projection * (view * worldPosition);\n fragColor = color;\n fragPosition = position;\n}"]),a=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float opacity;\nvarying vec3 fragPosition;\nvarying vec4 fragColor;\n\nvoid main() {\n if (\n outOfRange(clipBounds[0], clipBounds[1], fragPosition) ||\n fragColor.a * opacity == 0.\n ) discard;\n\n gl_FragColor = opacity * fragColor;\n}"]);t.exports=function(t){return i(t,o,a,null,[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"offset",type:"vec3"}])}},2260:function(t,e,r){"use strict";var n=r(7766);t.exports=function(t,e,r,n){i||(i=t.FRAMEBUFFER_UNSUPPORTED,o=t.FRAMEBUFFER_INCOMPLETE_ATTACHMENT,a=t.FRAMEBUFFER_INCOMPLETE_DIMENSIONS,s=t.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT);var c=t.getExtension("WEBGL_draw_buffers");if(!l&&c&&function(t,e){var r=t.getParameter(e.MAX_COLOR_ATTACHMENTS_WEBGL);l=new Array(r+1);for(var n=0;n<=r;++n){for(var i=new Array(r),o=0;ou||r<0||r>u)throw new Error("gl-fbo: Parameters are too large for FBO");var h=1;if("color"in(n=n||{})){if((h=Math.max(0|n.color,0))<0)throw new Error("gl-fbo: Must specify a nonnegative number of colors");if(h>1){if(!c)throw new Error("gl-fbo: Multiple draw buffer extension not supported");if(h>t.getParameter(c.MAX_COLOR_ATTACHMENTS_WEBGL))throw new Error("gl-fbo: Context does not support "+h+" draw buffers")}}var d=t.UNSIGNED_BYTE,f=t.getExtension("OES_texture_float");if(n.float&&h>0){if(!f)throw new Error("gl-fbo: Context does not support floating point textures");d=t.FLOAT}else n.preferFloat&&h>0&&f&&(d=t.FLOAT);var m=!0;"depth"in n&&(m=!!n.depth);var g=!1;return"stencil"in n&&(g=!!n.stencil),new p(t,e,r,d,h,m,g,c)};var i,o,a,s,l=null;function c(t){return[t.getParameter(t.FRAMEBUFFER_BINDING),t.getParameter(t.RENDERBUFFER_BINDING),t.getParameter(t.TEXTURE_BINDING_2D)]}function u(t,e){t.bindFramebuffer(t.FRAMEBUFFER,e[0]),t.bindRenderbuffer(t.RENDERBUFFER,e[1]),t.bindTexture(t.TEXTURE_2D,e[2])}function h(t){switch(t){case i:throw new Error("gl-fbo: Framebuffer unsupported");case o:throw new Error("gl-fbo: Framebuffer incomplete attachment");case a:throw new Error("gl-fbo: Framebuffer incomplete dimensions");case s:throw new Error("gl-fbo: Framebuffer incomplete missing attachment");default:throw new Error("gl-fbo: Framebuffer failed for unspecified reason")}}function d(t,e,r,i,o,a){if(!i)return null;var s=n(t,e,r,o,i);return s.magFilter=t.NEAREST,s.minFilter=t.NEAREST,s.mipSamples=1,s.bind(),t.framebufferTexture2D(t.FRAMEBUFFER,a,t.TEXTURE_2D,s.handle,0),s}function f(t,e,r,n,i){var o=t.createRenderbuffer();return t.bindRenderbuffer(t.RENDERBUFFER,o),t.renderbufferStorage(t.RENDERBUFFER,n,e,r),t.framebufferRenderbuffer(t.FRAMEBUFFER,i,t.RENDERBUFFER,o),o}function p(t,e,r,n,i,o,a,s){this.gl=t,this._shape=[0|e,0|r],this._destroyed=!1,this._ext=s,this.color=new Array(i);for(var p=0;p1&&s.drawBuffersWEBGL(l[a]);var b=r.getExtension("WEBGL_depth_texture");b?p?t.depth=d(r,i,o,b.UNSIGNED_INT_24_8_WEBGL,r.DEPTH_STENCIL,r.DEPTH_STENCIL_ATTACHMENT):m&&(t.depth=d(r,i,o,r.UNSIGNED_SHORT,r.DEPTH_COMPONENT,r.DEPTH_ATTACHMENT)):m&&p?t._depth_rb=f(r,i,o,r.DEPTH_STENCIL,r.DEPTH_STENCIL_ATTACHMENT):m?t._depth_rb=f(r,i,o,r.DEPTH_COMPONENT16,r.DEPTH_ATTACHMENT):p&&(t._depth_rb=f(r,i,o,r.STENCIL_INDEX,r.STENCIL_ATTACHMENT));var y=r.checkFramebufferStatus(r.FRAMEBUFFER);if(y!==r.FRAMEBUFFER_COMPLETE){for(t._destroyed=!0,r.bindFramebuffer(r.FRAMEBUFFER,null),r.deleteFramebuffer(t.handle),t.handle=null,t.depth&&(t.depth.dispose(),t.depth=null),t._depth_rb&&(r.deleteRenderbuffer(t._depth_rb),t._depth_rb=null),v=0;vi||r<0||r>i)throw new Error("gl-fbo: Can't resize FBO, invalid dimensions");t._shape[0]=e,t._shape[1]=r;for(var o=c(n),a=0;a>8*f&255;this.pickOffset=r,i.bind();var p=i.uniforms;p.viewTransform=t,p.pickOffset=e,p.shape=this.shape;var m=i.attributes;return this.positionBuffer.bind(),m.position.pointer(),this.weightBuffer.bind(),m.weight.pointer(s.UNSIGNED_BYTE,!1),this.idBuffer.bind(),m.pickId.pointer(s.UNSIGNED_BYTE,!1),s.drawArrays(s.TRIANGLES,0,a),r+this.shape[0]*this.shape[1]}}}(),h.pick=function(t,e,r){var n=this.pickOffset,i=this.shape[0]*this.shape[1];if(r=n+i)return null;var o=r-n,a=this.xData,s=this.yData;return{object:this,pointId:o,dataCoord:[a[o%this.shape[0]],s[o/this.shape[0]|0]]}},h.update=function(t){var e=(t=t||{}).shape||[0,0],r=t.x||i(e[0]),a=t.y||i(e[1]),s=t.z||new Float32Array(e[0]*e[1]),l=!1!==t.zsmooth;this.xData=r,this.yData=a;var c,u,h,f,p=t.colorLevels||[0],m=t.colorValues||[0,0,0,1],g=p.length,v=this.bounds;l?(c=v[0]=r[0],u=v[1]=a[0],h=v[2]=r[r.length-1],f=v[3]=a[a.length-1]):(c=v[0]=r[0]+(r[1]-r[0])/2,u=v[1]=a[0]+(a[1]-a[0])/2,h=v[2]=r[r.length-1]+(r[r.length-1]-r[r.length-2])/2,f=v[3]=a[a.length-1]+(a[a.length-1]-a[a.length-2])/2);var b=1/(h-c),y=1/(f-u),x=e[0],_=e[1];this.shape=[x,_];var w=(l?(x-1)*(_-1):x*_)*(d.length>>>1);this.numVertices=w;for(var k=o.mallocUint8(4*w),A=o.mallocFloat32(2*w),M=o.mallocUint8(2*w),T=o.mallocUint32(w),S=0,C=l?x-1:x,E=l?_-1:_,L=0;L max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform sampler2D dashTexture;\nuniform float dashScale;\nuniform float opacity;\n\nvarying vec3 worldPosition;\nvarying float pixelArcLength;\nvarying vec4 fragColor;\n\nvoid main() {\n if (\n outOfRange(clipBounds[0], clipBounds[1], worldPosition) ||\n fragColor.a * opacity == 0.\n ) discard;\n\n float dashWeight = texture2D(dashTexture, vec2(dashScale * pixelArcLength, 0)).r;\n if(dashWeight < 0.5) {\n discard;\n }\n gl_FragColor = fragColor * opacity;\n}\n"]),s=n(["precision highp float;\n#define GLSLIFY 1\n\n#define FLOAT_MAX 1.70141184e38\n#define FLOAT_MIN 1.17549435e-38\n\n// https://github.com/mikolalysenko/glsl-read-float/blob/master/index.glsl\nvec4 packFloat(float v) {\n float av = abs(v);\n\n //Handle special cases\n if(av < FLOAT_MIN) {\n return vec4(0.0, 0.0, 0.0, 0.0);\n } else if(v > FLOAT_MAX) {\n return vec4(127.0, 128.0, 0.0, 0.0) / 255.0;\n } else if(v < -FLOAT_MAX) {\n return vec4(255.0, 128.0, 0.0, 0.0) / 255.0;\n }\n\n vec4 c = vec4(0,0,0,0);\n\n //Compute exponent and mantissa\n float e = floor(log2(av));\n float m = av * pow(2.0, -e) - 1.0;\n\n //Unpack mantissa\n c[1] = floor(128.0 * m);\n m -= c[1] / 128.0;\n c[2] = floor(32768.0 * m);\n m -= c[2] / 32768.0;\n c[3] = floor(8388608.0 * m);\n\n //Unpack exponent\n float ebias = e + 127.0;\n c[0] = floor(ebias / 2.0);\n ebias -= c[0] * 2.0;\n c[1] += floor(ebias) * 128.0;\n\n //Unpack sign bit\n c[0] += 128.0 * step(0.0, -v);\n\n //Scale back to range\n return c / 255.0;\n}\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform float pickId;\nuniform vec3 clipBounds[2];\n\nvarying vec3 worldPosition;\nvarying float pixelArcLength;\nvarying vec4 fragColor;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], worldPosition)) discard;\n\n gl_FragColor = vec4(pickId/255.0, packFloat(pixelArcLength).xyz);\n}"]),l=[{name:"position",type:"vec3"},{name:"nextPosition",type:"vec3"},{name:"arcLength",type:"float"},{name:"lineWidth",type:"float"},{name:"color",type:"vec4"}];e.createShader=function(t){return i(t,o,a,null,l)},e.createPickShader=function(t){return i(t,o,s,null,l)}},5714:function(t,e,r){"use strict";t.exports=function(t){var e=t.gl||t.scene&&t.scene.gl,r=h(e);r.attributes.position.location=0,r.attributes.nextPosition.location=1,r.attributes.arcLength.location=2,r.attributes.lineWidth.location=3,r.attributes.color.location=4;var a=d(e);a.attributes.position.location=0,a.attributes.nextPosition.location=1,a.attributes.arcLength.location=2,a.attributes.lineWidth.location=3,a.attributes.color.location=4;for(var s=n(e),l=i(e,[{buffer:s,size:3,offset:0,stride:48},{buffer:s,size:3,offset:12,stride:48},{buffer:s,size:1,offset:24,stride:48},{buffer:s,size:1,offset:28,stride:48},{buffer:s,size:4,offset:32,stride:48}]),u=c(new Array(1024),[256,1,4]),f=0;f<1024;++f)u.data[f]=255;var p=o(e,u);p.wrap=e.REPEAT;var m=new v(e,r,a,s,l,p);return m.update(t),m};var n=r(2762),i=r(8116),o=r(7766),a=new Uint8Array(4),s=new Float32Array(a.buffer),l=r(2478),c=r(9618),u=r(7319),h=u.createShader,d=u.createPickShader,f=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function p(t,e){for(var r=0,n=0;n<3;++n){var i=t[n]-e[n];r+=i*i}return Math.sqrt(r)}function m(t){for(var e=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],r=0;r<3;++r)e[0][r]=Math.max(t[0][r],e[0][r]),e[1][r]=Math.min(t[1][r],e[1][r]);return e}function g(t,e,r,n){this.arcLength=t,this.position=e,this.index=r,this.dataCoordinate=n}function v(t,e,r,n,i,o){this.gl=t,this.shader=e,this.pickShader=r,this.buffer=n,this.vao=i,this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.points=[],this.arcLength=[],this.vertexCount=0,this.bounds=[[0,0,0],[0,0,0]],this.pickId=0,this.lineWidth=1,this.texture=o,this.dashScale=1,this.opacity=1,this.hasAlpha=!1,this.dirty=!0,this.pixelRatio=1}var b=v.prototype;b.isTransparent=function(){return this.hasAlpha},b.isOpaque=function(){return!this.hasAlpha},b.pickSlots=1,b.setPickBase=function(t){this.pickId=t},b.drawTransparent=b.draw=function(t){if(this.vertexCount){var e=this.gl,r=this.shader,n=this.vao;r.bind(),r.uniforms={model:t.model||f,view:t.view||f,projection:t.projection||f,clipBounds:m(this.clipBounds),dashTexture:this.texture.bind(),dashScale:this.dashScale/this.arcLength[this.arcLength.length-1],opacity:this.opacity,screenShape:[e.drawingBufferWidth,e.drawingBufferHeight],pixelRatio:this.pixelRatio},n.bind(),n.draw(e.TRIANGLE_STRIP,this.vertexCount),n.unbind()}},b.drawPick=function(t){if(this.vertexCount){var e=this.gl,r=this.pickShader,n=this.vao;r.bind(),r.uniforms={model:t.model||f,view:t.view||f,projection:t.projection||f,pickId:this.pickId,clipBounds:m(this.clipBounds),screenShape:[e.drawingBufferWidth,e.drawingBufferHeight],pixelRatio:this.pixelRatio},n.bind(),n.draw(e.TRIANGLE_STRIP,this.vertexCount),n.unbind()}},b.update=function(t){var e,r;this.dirty=!0;var n=!!t.connectGaps;"dashScale"in t&&(this.dashScale=t.dashScale),this.hasAlpha=!1,"opacity"in t&&(this.opacity=+t.opacity,this.opacity<1&&(this.hasAlpha=!0));var i=[],o=[],a=[],s=0,u=0,h=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],d=t.position||t.positions;if(d){var f=t.color||t.colors||[0,0,0,1],m=t.lineWidth||1,g=!1;t:for(e=1;e0){for(var w=0;w<24;++w)i.push(i[i.length-12]);u+=2,g=!0}continue t}h[0][r]=Math.min(h[0][r],x[r],_[r]),h[1][r]=Math.max(h[1][r],x[r],_[r])}Array.isArray(f[0])?(v=f.length>e-1?f[e-1]:f.length>0?f[f.length-1]:[0,0,0,1],b=f.length>e?f[e]:f.length>0?f[f.length-1]:[0,0,0,1]):v=b=f,3===v.length&&(v=[v[0],v[1],v[2],1]),3===b.length&&(b=[b[0],b[1],b[2],1]),!this.hasAlpha&&v[3]<1&&(this.hasAlpha=!0),y=Array.isArray(m)?m.length>e-1?m[e-1]:m.length>0?m[m.length-1]:[0,0,0,1]:m;var k=s;if(s+=p(x,_),g){for(r=0;r<2;++r)i.push(x[0],x[1],x[2],_[0],_[1],_[2],k,y,v[0],v[1],v[2],v[3]);u+=2,g=!1}i.push(x[0],x[1],x[2],_[0],_[1],_[2],k,y,v[0],v[1],v[2],v[3],x[0],x[1],x[2],_[0],_[1],_[2],k,-y,v[0],v[1],v[2],v[3],_[0],_[1],_[2],x[0],x[1],x[2],s,-y,b[0],b[1],b[2],b[3],_[0],_[1],_[2],x[0],x[1],x[2],s,y,b[0],b[1],b[2],b[3]),u+=4}}if(this.buffer.update(i),o.push(s),a.push(d[d.length-1].slice()),this.bounds=h,this.vertexCount=u,this.points=a,this.arcLength=o,"dashes"in t){var A=t.dashes.slice();for(A.unshift(0),e=1;e1.0001)return null;v+=g[h]}return Math.abs(v-1)>.001?null:[d,s(t,g),g]}},840:function(t,e,r){var n=r(3236),i=n(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec3 position, normal;\nattribute vec4 color;\nattribute vec2 uv;\n\nuniform mat4 model\n , view\n , projection\n , inverseModel;\nuniform vec3 eyePosition\n , lightPosition;\n\nvarying vec3 f_normal\n , f_lightDirection\n , f_eyeDirection\n , f_data;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvec4 project(vec3 p) {\n return projection * (view * (model * vec4(p, 1.0)));\n}\n\nvoid main() {\n gl_Position = project(position);\n\n //Lighting geometry parameters\n vec4 cameraCoordinate = view * vec4(position , 1.0);\n cameraCoordinate.xyz /= cameraCoordinate.w;\n f_lightDirection = lightPosition - cameraCoordinate.xyz;\n f_eyeDirection = eyePosition - cameraCoordinate.xyz;\n f_normal = normalize((vec4(normal, 0.0) * inverseModel).xyz);\n\n f_color = color;\n f_data = position;\n f_uv = uv;\n}\n"]),o=n(["#extension GL_OES_standard_derivatives : enable\n\nprecision highp float;\n#define GLSLIFY 1\n\nfloat beckmannDistribution(float x, float roughness) {\n float NdotH = max(x, 0.0001);\n float cos2Alpha = NdotH * NdotH;\n float tan2Alpha = (cos2Alpha - 1.0) / cos2Alpha;\n float roughness2 = roughness * roughness;\n float denom = 3.141592653589793 * roughness2 * cos2Alpha * cos2Alpha;\n return exp(tan2Alpha / roughness2) / denom;\n}\n\nfloat cookTorranceSpecular(\n vec3 lightDirection,\n vec3 viewDirection,\n vec3 surfaceNormal,\n float roughness,\n float fresnel) {\n\n float VdotN = max(dot(viewDirection, surfaceNormal), 0.0);\n float LdotN = max(dot(lightDirection, surfaceNormal), 0.0);\n\n //Half angle vector\n vec3 H = normalize(lightDirection + viewDirection);\n\n //Geometric term\n float NdotH = max(dot(surfaceNormal, H), 0.0);\n float VdotH = max(dot(viewDirection, H), 0.000001);\n float LdotH = max(dot(lightDirection, H), 0.000001);\n float G1 = (2.0 * NdotH * VdotN) / VdotH;\n float G2 = (2.0 * NdotH * LdotN) / LdotH;\n float G = min(1.0, min(G1, G2));\n \n //Distribution term\n float D = beckmannDistribution(NdotH, roughness);\n\n //Fresnel term\n float F = pow(1.0 - VdotN, fresnel);\n\n //Multiply terms and done\n return G * F * D / max(3.14159265 * VdotN, 0.000001);\n}\n\n//#pragma glslify: beckmann = require(glsl-specular-beckmann) // used in gl-surface3d\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float roughness\n , fresnel\n , kambient\n , kdiffuse\n , kspecular;\nuniform sampler2D texture;\n\nvarying vec3 f_normal\n , f_lightDirection\n , f_eyeDirection\n , f_data;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n if (f_color.a == 0.0 ||\n outOfRange(clipBounds[0], clipBounds[1], f_data)\n ) discard;\n\n vec3 N = normalize(f_normal);\n vec3 L = normalize(f_lightDirection);\n vec3 V = normalize(f_eyeDirection);\n\n if(gl_FrontFacing) {\n N = -N;\n }\n\n float specular = min(1.0, max(0.0, cookTorranceSpecular(L, V, N, roughness, fresnel)));\n //float specular = max(0.0, beckmann(L, V, N, roughness)); // used in gl-surface3d\n\n float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0);\n\n vec4 surfaceColor = vec4(f_color.rgb, 1.0) * texture2D(texture, f_uv);\n vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular, 1.0);\n\n gl_FragColor = litColor * f_color.a;\n}\n"]),a=n(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec3 position;\nattribute vec4 color;\nattribute vec2 uv;\n\nuniform mat4 model, view, projection;\n\nvarying vec4 f_color;\nvarying vec3 f_data;\nvarying vec2 f_uv;\n\nvoid main() {\n gl_Position = projection * (view * (model * vec4(position, 1.0)));\n f_color = color;\n f_data = position;\n f_uv = uv;\n}"]),s=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform sampler2D texture;\nuniform float opacity;\n\nvarying vec4 f_color;\nvarying vec3 f_data;\nvarying vec2 f_uv;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], f_data)) discard;\n\n gl_FragColor = f_color * texture2D(texture, f_uv) * opacity;\n}"]),l=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nattribute vec3 position;\nattribute vec4 color;\nattribute vec2 uv;\nattribute float pointSize;\n\nuniform mat4 model, view, projection;\nuniform vec3 clipBounds[2];\n\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], position)) {\n\n gl_Position = vec4(0.0, 0.0 ,0.0 ,0.0);\n } else {\n gl_Position = projection * (view * (model * vec4(position, 1.0)));\n }\n gl_PointSize = pointSize;\n f_color = color;\n f_uv = uv;\n}"]),c=n(["precision highp float;\n#define GLSLIFY 1\n\nuniform sampler2D texture;\nuniform float opacity;\n\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n vec2 pointR = gl_PointCoord.xy - vec2(0.5, 0.5);\n if(dot(pointR, pointR) > 0.25) {\n discard;\n }\n gl_FragColor = f_color * texture2D(texture, f_uv) * opacity;\n}"]),u=n(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec3 position;\nattribute vec4 id;\n\nuniform mat4 model, view, projection;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n gl_Position = projection * (view * (model * vec4(position, 1.0)));\n f_id = id;\n f_position = position;\n}"]),h=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float pickId;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;\n\n gl_FragColor = vec4(pickId, f_id.xyz);\n}"]),d=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nattribute vec3 position;\nattribute float pointSize;\nattribute vec4 id;\n\nuniform mat4 model, view, projection;\nuniform vec3 clipBounds[2];\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], position)) {\n\n gl_Position = vec4(0.0, 0.0, 0.0, 0.0);\n } else {\n gl_Position = projection * (view * (model * vec4(position, 1.0)));\n gl_PointSize = pointSize;\n }\n f_id = id;\n f_position = position;\n}"]),f=n(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec3 position;\n\nuniform mat4 model, view, projection;\n\nvoid main() {\n gl_Position = projection * (view * (model * vec4(position, 1.0)));\n}"]),p=n(["precision highp float;\n#define GLSLIFY 1\n\nuniform vec3 contourColor;\n\nvoid main() {\n gl_FragColor = vec4(contourColor, 1.0);\n}\n"]);e.meshShader={vertex:i,fragment:o,attributes:[{name:"position",type:"vec3"},{name:"normal",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"}]},e.wireShader={vertex:a,fragment:s,attributes:[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"}]},e.pointShader={vertex:l,fragment:c,attributes:[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"pointSize",type:"float"}]},e.pickShader={vertex:u,fragment:h,attributes:[{name:"position",type:"vec3"},{name:"id",type:"vec4"}]},e.pointPickShader={vertex:d,fragment:h,attributes:[{name:"position",type:"vec3"},{name:"pointSize",type:"float"},{name:"id",type:"vec4"}]},e.contourShader={vertex:f,fragment:p,attributes:[{name:"position",type:"vec3"}]}},7201:function(t,e,r){"use strict";var n=r(9405),i=r(2762),o=r(8116),a=r(7766),s=r(8406),l=r(6760),c=r(7608),u=r(9618),h=r(6729),d=r(7765),f=r(1888),p=r(840),m=r(7626),g=p.meshShader,v=p.wireShader,b=p.pointShader,y=p.pickShader,x=p.pointPickShader,_=p.contourShader,w=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function k(t,e,r,n,i,o,a,s,l,c,u,h,d,f,p,m,g,v,b,y,x,_,k,A,M,T,S){this.gl=t,this.pixelRatio=1,this.cells=[],this.positions=[],this.intensity=[],this.texture=e,this.dirty=!0,this.triShader=r,this.lineShader=n,this.pointShader=i,this.pickShader=o,this.pointPickShader=a,this.contourShader=s,this.trianglePositions=l,this.triangleColors=u,this.triangleNormals=d,this.triangleUVs=h,this.triangleIds=c,this.triangleVAO=f,this.triangleCount=0,this.lineWidth=1,this.edgePositions=p,this.edgeColors=g,this.edgeUVs=v,this.edgeIds=m,this.edgeVAO=b,this.edgeCount=0,this.pointPositions=y,this.pointColors=_,this.pointUVs=k,this.pointSizes=A,this.pointIds=x,this.pointVAO=M,this.pointCount=0,this.contourLineWidth=1,this.contourPositions=T,this.contourVAO=S,this.contourCount=0,this.contourColor=[0,0,0],this.contourEnable=!0,this.pickVertex=!0,this.pickId=1,this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.lightPosition=[1e5,1e5,0],this.ambientLight=.8,this.diffuseLight=.8,this.specularLight=2,this.roughness=.5,this.fresnel=1.5,this.opacity=1,this.hasAlpha=!1,this.opacityscale=!1,this._model=w,this._view=w,this._projection=w,this._resolution=[1,1]}var A=k.prototype;function M(t,e){if(!e)return 1;if(!e.length)return 1;for(var r=0;rt&&r>0){var n=(e[r][0]-t)/(e[r][0]-e[r-1][0]);return e[r][1]*(1-n)+n*e[r-1][1]}}return 1}function T(t){var e=n(t,b.vertex,b.fragment);return e.attributes.position.location=0,e.attributes.color.location=2,e.attributes.uv.location=3,e.attributes.pointSize.location=4,e}function S(t){var e=n(t,y.vertex,y.fragment);return e.attributes.position.location=0,e.attributes.id.location=1,e}function C(t){var e=n(t,x.vertex,x.fragment);return e.attributes.position.location=0,e.attributes.id.location=1,e.attributes.pointSize.location=4,e}function E(t){var e=n(t,_.vertex,_.fragment);return e.attributes.position.location=0,e}A.isOpaque=function(){return!this.hasAlpha},A.isTransparent=function(){return this.hasAlpha},A.pickSlots=1,A.setPickBase=function(t){this.pickId=t},A.highlight=function(t){if(t&&this.contourEnable){for(var e=d(this.cells,this.intensity,t.intensity),r=e.cells,n=e.vertexIds,i=e.vertexWeights,o=r.length,a=f.mallocFloat32(6*o),s=0,l=0;l0&&((h=this.triShader).bind(),h.uniforms=s,this.triangleVAO.bind(),e.drawArrays(e.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind()),this.edgeCount>0&&this.lineWidth>0&&((h=this.lineShader).bind(),h.uniforms=s,this.edgeVAO.bind(),e.lineWidth(this.lineWidth*this.pixelRatio),e.drawArrays(e.LINES,0,2*this.edgeCount),this.edgeVAO.unbind()),this.pointCount>0&&((h=this.pointShader).bind(),h.uniforms=s,this.pointVAO.bind(),e.drawArrays(e.POINTS,0,this.pointCount),this.pointVAO.unbind()),this.contourEnable&&this.contourCount>0&&this.contourLineWidth>0&&((h=this.contourShader).bind(),h.uniforms=s,this.contourVAO.bind(),e.drawArrays(e.LINES,0,this.contourCount),this.contourVAO.unbind())},A.drawPick=function(t){t=t||{};for(var e=this.gl,r=t.model||w,n=t.view||w,i=t.projection||w,o=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],a=0;a<3;++a)o[0][a]=Math.max(o[0][a],this.clipBounds[0][a]),o[1][a]=Math.min(o[1][a],this.clipBounds[1][a]);this._model=[].slice.call(r),this._view=[].slice.call(n),this._projection=[].slice.call(i),this._resolution=[e.drawingBufferWidth,e.drawingBufferHeight];var s,l={model:r,view:n,projection:i,clipBounds:o,pickId:this.pickId/255};(s=this.pickShader).bind(),s.uniforms=l,this.triangleCount>0&&(this.triangleVAO.bind(),e.drawArrays(e.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind()),this.edgeCount>0&&(this.edgeVAO.bind(),e.lineWidth(this.lineWidth*this.pixelRatio),e.drawArrays(e.LINES,0,2*this.edgeCount),this.edgeVAO.unbind()),this.pointCount>0&&((s=this.pointPickShader).bind(),s.uniforms=l,this.pointVAO.bind(),e.drawArrays(e.POINTS,0,this.pointCount),this.pointVAO.unbind())},A.pick=function(t){if(!t)return null;if(t.id!==this.pickId)return null;for(var e=t.value[0]+256*t.value[1]+65536*t.value[2],r=this.cells[e],n=this.positions,i=new Array(r.length),o=0;oi[A]&&(r.uniforms.dataAxis=c,r.uniforms.screenOffset=u,r.uniforms.color=g[t],r.uniforms.angle=v[t],o.drawArrays(o.TRIANGLES,i[A],i[M]-i[A]))),b[t]&&k&&(u[1^t]-=T*f*y[t],r.uniforms.dataAxis=h,r.uniforms.screenOffset=u,r.uniforms.color=x[t],r.uniforms.angle=_[t],o.drawArrays(o.TRIANGLES,w,k)),u[1^t]=T*s[2+(1^t)]-1,p[t+2]&&(u[1^t]+=T*f*m[t+2],Ai[A]&&(r.uniforms.dataAxis=c,r.uniforms.screenOffset=u,r.uniforms.color=g[t+2],r.uniforms.angle=v[t+2],o.drawArrays(o.TRIANGLES,i[A],i[M]-i[A]))),b[t+2]&&k&&(u[1^t]+=T*f*y[t+2],r.uniforms.dataAxis=h,r.uniforms.screenOffset=u,r.uniforms.color=x[t+2],r.uniforms.angle=_[t+2],o.drawArrays(o.TRIANGLES,w,k))}),m.drawTitle=function(){var t=[0,0],e=[0,0];return function(){var r=this.plot,n=this.shader,i=r.gl,o=r.screenBox,a=r.titleCenter,s=r.titleAngle,l=r.titleColor,c=r.pixelRatio;if(this.titleCount){for(var u=0;u<2;++u)e[u]=2*(a[u]*c-o[u])/(o[2+u]-o[u])-1;n.bind(),n.uniforms.dataAxis=t,n.uniforms.screenOffset=e,n.uniforms.angle=s,n.uniforms.color=l,i.drawArrays(i.TRIANGLES,this.titleOffset,this.titleCount)}}}(),m.bind=(d=[0,0],f=[0,0],p=[0,0],function(){var t=this.plot,e=this.shader,r=t._tickBounds,n=t.dataBox,i=t.screenBox,o=t.viewBox;e.bind();for(var a=0;a<2;++a){var s=r[a],l=r[a+2]-s,c=.5*(n[a+2]+n[a]),u=n[a+2]-n[a],h=o[a],m=o[a+2]-h,g=i[a],v=i[a+2]-g;f[a]=2*l/u*m/v,d[a]=2*(s-c)/u*m/v}p[1]=2*t.pixelRatio/(i[3]-i[1]),p[0]=p[1]*(i[3]-i[1])/(i[2]-i[0]),e.uniforms.dataScale=f,e.uniforms.dataShift=d,e.uniforms.textScale=p,this.vbo.bind(),e.attributes.textCoordinate.pointer()}),m.update=function(t){var e,r,n,i,a,s=[],l=t.ticks,c=t.bounds;for(a=0;a<2;++a){var u=[Math.floor(s.length/3)],h=[-1/0],d=l[a];for(e=0;e=0){var m=e[p]-n[p]*(e[p+2]-e[p])/(n[p+2]-n[p]);0===p?a.drawLine(m,e[1],m,e[3],f[p],d[p]):a.drawLine(e[0],m,e[2],m,f[p],d[p])}}for(p=0;p=0;--t)this.objects[t].dispose();for(this.objects.length=0,t=this.overlays.length-1;t>=0;--t)this.overlays[t].dispose();this.overlays.length=0,this.gl=null},c.addObject=function(t){this.objects.indexOf(t)<0&&(this.objects.push(t),this.setDirty())},c.removeObject=function(t){for(var e=this.objects,r=0;rMath.abs(e))c.rotate(o,0,0,-t*r*Math.PI*p.rotateSpeed/window.innerWidth);else if(!p._ortho){var a=-p.zoomSpeed*i*e/window.innerHeight*(o-c.lastT())/20;c.pan(o,0,0,h*(Math.exp(a)-1))}}}),!0)},p.enableMouseListeners(),p};var n=r(3025),i=r(6296),o=r(351),a=r(8512),s=r(24),l=r(7520)},799:function(t,e,r){var n=r(3236),i=r(9405),o=n(["precision mediump float;\n#define GLSLIFY 1\nattribute vec2 position;\nvarying vec2 uv;\nvoid main() {\n uv = position;\n gl_Position = vec4(position, 0, 1);\n}"]),a=n(["precision mediump float;\n#define GLSLIFY 1\n\nuniform sampler2D accumBuffer;\nvarying vec2 uv;\n\nvoid main() {\n vec4 accum = texture2D(accumBuffer, 0.5 * (uv + 1.0));\n gl_FragColor = min(vec4(1,1,1,1), accum);\n}"]);t.exports=function(t){return i(t,o,a,null,[{name:"position",type:"vec2"}])}},4100:function(t,e,r){"use strict";var n=r(4437),i=r(3837),o=r(5445),a=r(4449),s=r(3589),l=r(2260),c=r(7169),u=r(351),h=r(4772),d=r(4040),f=r(799),p=r(9216)({tablet:!0,featureDetect:!0});function m(){this.mouse=[-1,-1],this.screen=null,this.distance=1/0,this.index=null,this.dataCoordinate=null,this.dataPosition=null,this.object=null,this.data=null}function g(t){var e=Math.round(Math.log(Math.abs(t))/Math.log(10));if(e<0){var r=Math.round(Math.pow(10,-e));return Math.ceil(t*r)/r}return e>0?(r=Math.round(Math.pow(10,e)),Math.ceil(t/r)*r):Math.ceil(t)}function v(t){return"boolean"!=typeof t||t}t.exports={createScene:function(t){(t=t||{}).camera=t.camera||{};var e=t.canvas;e||(e=document.createElement("canvas"),t.container?t.container.appendChild(e):document.body.appendChild(e));var r=t.gl;if(r||(t.glOptions&&(p=!!t.glOptions.preserveDrawingBuffer),r=function(t,e){var r=null;try{(r=t.getContext("webgl",e))||(r=t.getContext("experimental-webgl",e))}catch(t){return null}return r}(e,t.glOptions||{premultipliedAlpha:!0,antialias:!0,preserveDrawingBuffer:p})),!r)throw new Error("webgl not supported");var b=t.bounds||[[-10,-10,-10],[10,10,10]],y=new m,x=l(r,r.drawingBufferWidth,r.drawingBufferHeight,{preferFloat:!p}),_=f(r),w=t.cameraObject&&!0===t.cameraObject._ortho||t.camera.projection&&"orthographic"===t.camera.projection.type||!1,k={eye:t.camera.eye||[2,0,0],center:t.camera.center||[0,0,0],up:t.camera.up||[0,1,0],zoomMin:t.camera.zoomMax||.1,zoomMax:t.camera.zoomMin||100,mode:t.camera.mode||"turntable",_ortho:w},A=t.axes||{},M=i(r,A);M.enable=!A.disable;var T=t.spikes||{},S=a(r,T),C=[],E=[],L=[],z=[],O=!0,D=!0,I={view:null,projection:new Array(16),model:new Array(16),_ortho:!1},F=(D=!0,[r.drawingBufferWidth,r.drawingBufferHeight]),R=t.cameraObject||n(e,k),P={gl:r,contextLost:!1,pixelRatio:t.pixelRatio||1,canvas:e,selection:y,camera:R,axes:M,axesPixels:null,spikes:S,bounds:b,objects:C,shape:F,aspect:t.aspectRatio||[1,1,1],pickRadius:t.pickRadius||10,zNear:t.zNear||.01,zFar:t.zFar||1e3,fovy:t.fovy||Math.PI/4,clearColor:t.clearColor||[0,0,0,0],autoResize:v(t.autoResize),autoBounds:v(t.autoBounds),autoScale:!!t.autoScale,autoCenter:v(t.autoCenter),clipToBounds:v(t.clipToBounds),snapToData:!!t.snapToData,onselect:t.onselect||null,onrender:t.onrender||null,onclick:t.onclick||null,cameraParams:I,oncontextloss:null,mouseListener:null,_stopped:!1,getAspectratio:function(){return{x:this.aspect[0],y:this.aspect[1],z:this.aspect[2]}},setAspectratio:function(t){this.aspect[0]=t.x,this.aspect[1]=t.y,this.aspect[2]=t.z,D=!0},setBounds:function(t,e){this.bounds[0][t]=e.min,this.bounds[1][t]=e.max},setClearColor:function(t){this.clearColor=t},clearRGBA:function(){this.gl.clearColor(this.clearColor[0],this.clearColor[1],this.clearColor[2],this.clearColor[3]),this.gl.clear(this.gl.COLOR_BUFFER_BIT|this.gl.DEPTH_BUFFER_BIT)}},j=[r.drawingBufferWidth/P.pixelRatio|0,r.drawingBufferHeight/P.pixelRatio|0];function N(){if(!P._stopped&&P.autoResize){var t=e.parentNode,r=1,n=1;t&&t!==document.body?(r=t.clientWidth,n=t.clientHeight):(r=window.innerWidth,n=window.innerHeight);var i=0|Math.ceil(r*P.pixelRatio),o=0|Math.ceil(n*P.pixelRatio);if(i!==e.width||o!==e.height){e.width=i,e.height=o;var a=e.style;a.position=a.position||"absolute",a.left="0px",a.top="0px",a.width=r+"px",a.height=n+"px",O=!0}}}function B(){for(var t=C.length,e=z.length,n=0;n0&&0===L[e-1];)L.pop(),z.pop().dispose()}function U(){if(P.contextLost)return!0;r.isContextLost()&&(P.contextLost=!0,P.mouseListener.enabled=!1,P.selection.object=null,P.oncontextloss&&P.oncontextloss())}P.autoResize&&N(),window.addEventListener("resize",N),P.update=function(t){P._stopped||(t=t||{},O=!0,D=!0)},P.add=function(t){P._stopped||(t.axes=M,C.push(t),E.push(-1),O=!0,D=!0,B())},P.remove=function(t){if(!P._stopped){var e=C.indexOf(t);e<0||(C.splice(e,1),E.pop(),O=!0,D=!0,B())}},P.dispose=function(){if(!P._stopped&&(P._stopped=!0,window.removeEventListener("resize",N),e.removeEventListener("webglcontextlost",U),P.mouseListener.enabled=!1,!P.contextLost)){M.dispose(),S.dispose();for(var t=0;ty.distance)continue;for(var c=0;c 1.0) {\n discard;\n }\n baseColor = mix(borderColor, color, step(radius, centerFraction));\n gl_FragColor = vec4(baseColor.rgb * baseColor.a, baseColor.a);\n }\n}\n"]),e.pickVertex=n(["precision mediump float;\n#define GLSLIFY 1\n\nattribute vec2 position;\nattribute vec4 pickId;\n\nuniform mat3 matrix;\nuniform float pointSize;\nuniform vec4 pickOffset;\n\nvarying vec4 fragId;\n\nvoid main() {\n vec3 hgPosition = matrix * vec3(position, 1);\n gl_Position = vec4(hgPosition.xy, 0, hgPosition.z);\n gl_PointSize = pointSize;\n\n vec4 id = pickId + pickOffset;\n id.y += floor(id.x / 256.0);\n id.x -= floor(id.x / 256.0) * 256.0;\n\n id.z += floor(id.y / 256.0);\n id.y -= floor(id.y / 256.0) * 256.0;\n\n id.w += floor(id.z / 256.0);\n id.z -= floor(id.z / 256.0) * 256.0;\n\n fragId = id;\n}\n"]),e.pickFragment=n(["precision mediump float;\n#define GLSLIFY 1\n\nvarying vec4 fragId;\n\nvoid main() {\n float radius = length(2.0 * gl_PointCoord.xy - 1.0);\n if(radius > 1.0) {\n discard;\n }\n gl_FragColor = fragId / 255.0;\n}\n"])},4696:function(t,e,r){"use strict";var n=r(9405),i=r(2762),o=r(1888),a=r(6640);function s(t,e,r,n,i){this.plot=t,this.offsetBuffer=e,this.pickBuffer=r,this.shader=n,this.pickShader=i,this.sizeMin=.5,this.sizeMinCap=2,this.sizeMax=20,this.areaRatio=1,this.pointCount=0,this.color=[1,0,0,1],this.borderColor=[0,0,0,1],this.blend=!1,this.pickOffset=0,this.points=null}t.exports=function(t,e){var r=t.gl,o=new s(t,i(r),i(r),n(r,a.pointVertex,a.pointFragment),n(r,a.pickVertex,a.pickFragment));return o.update(e),t.addObject(o),o};var l,c,u=s.prototype;u.dispose=function(){this.shader.dispose(),this.pickShader.dispose(),this.offsetBuffer.dispose(),this.pickBuffer.dispose(),this.plot.removeObject(this)},u.update=function(t){var e;function r(e,r){return e in t?t[e]:r}t=t||{},this.sizeMin=r("sizeMin",.5),this.sizeMax=r("sizeMax",20),this.color=r("color",[1,0,0,1]).slice(),this.areaRatio=r("areaRatio",1),this.borderColor=r("borderColor",[0,0,0,1]).slice(),this.blend=r("blend",!1);var n=t.positions.length>>>1,i=t.positions instanceof Float32Array,a=t.idToIndex instanceof Int32Array&&t.idToIndex.length>=n,s=t.positions,l=i?s:o.mallocFloat32(s.length),c=a?t.idToIndex:o.mallocInt32(n);if(i||l.set(s),!a)for(l.set(s),e=0;e>>1;for(r=0;r=e[0]&&o<=e[2]&&a>=e[1]&&a<=e[3]&&n++}return n}(this.points,i),u=this.plot.pickPixelRatio*Math.max(Math.min(this.sizeMinCap,this.sizeMin),Math.min(this.sizeMax,this.sizeMax/Math.pow(s,.33333)));l[0]=2/o,l[4]=2/a,l[6]=-2*i[0]/o-1,l[7]=-2*i[1]/a-1,this.offsetBuffer.bind(),r.bind(),r.attributes.position.pointer(),r.uniforms.matrix=l,r.uniforms.color=this.color,r.uniforms.borderColor=this.borderColor,r.uniforms.pointCloud=u<5,r.uniforms.pointSize=u,r.uniforms.centerFraction=Math.min(1,Math.max(0,Math.sqrt(1-this.areaRatio))),e&&(c[0]=255&t,c[1]=t>>8&255,c[2]=t>>16&255,c[3]=t>>24&255,this.pickBuffer.bind(),r.attributes.pickId.pointer(n.UNSIGNED_BYTE),r.uniforms.pickOffset=c,this.pickOffset=t);var h=n.getParameter(n.BLEND),d=n.getParameter(n.DITHER);return h&&!this.blend&&n.disable(n.BLEND),d&&n.disable(n.DITHER),n.drawArrays(n.POINTS,0,this.pointCount),h&&!this.blend&&n.enable(n.BLEND),d&&n.enable(n.DITHER),t+this.pointCount}),u.draw=u.unifiedDraw,u.drawPick=u.unifiedDraw,u.pick=function(t,e,r){var n=this.pickOffset,i=this.pointCount;if(r=n+i)return null;var o=r-n,a=this.points;return{object:this,pointId:o,dataCoord:[a[2*o],a[2*o+1]]}}},783:function(t){t.exports=function(t,e,r,n){var i,o,a,s,l,c=e[0],u=e[1],h=e[2],d=e[3],f=r[0],p=r[1],m=r[2],g=r[3];return(o=c*f+u*p+h*m+d*g)<0&&(o=-o,f=-f,p=-p,m=-m,g=-g),1-o>1e-6?(i=Math.acos(o),a=Math.sin(i),s=Math.sin((1-n)*i)/a,l=Math.sin(n*i)/a):(s=1-n,l=n),t[0]=s*c+l*f,t[1]=s*u+l*p,t[2]=s*h+l*m,t[3]=s*d+l*g,t}},5964:function(t){"use strict";t.exports=function(t){return t||0===t?t.toString():""}},9366:function(t,e,r){"use strict";var n=r(4359);t.exports=function(t,e,r){var o=[e.style,e.weight,e.variant,e.family].join("_"),a=i[o];if(a||(a=i[o]={}),t in a)return a[t];var s={textAlign:"center",textBaseline:"middle",lineHeight:1,font:e.family,fontStyle:e.style,fontWeight:e.weight,fontVariant:e.variant,lineSpacing:1.25,styletags:{breaklines:!0,bolds:!0,italics:!0,subscripts:!0,superscripts:!0},triangles:!0},l=n(t,s);s.triangles=!1;var c,u,h=n(t,s);if(r&&1!==r){for(c=0;c max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nattribute vec3 position;\nattribute vec4 color;\nattribute vec2 glyph;\nattribute vec4 id;\n\nuniform vec4 highlightId;\nuniform float highlightScale;\nuniform mat4 model, view, projection;\nuniform vec3 clipBounds[2];\n\nvarying vec4 interpColor;\nvarying vec4 pickId;\nvarying vec3 dataCoordinate;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], position)) {\n\n gl_Position = vec4(0,0,0,0);\n } else {\n float scale = 1.0;\n if(distance(highlightId, id) < 0.0001) {\n scale = highlightScale;\n }\n\n vec4 worldPosition = model * vec4(position, 1);\n vec4 viewPosition = view * worldPosition;\n viewPosition = viewPosition / viewPosition.w;\n vec4 clipPosition = projection * (viewPosition + scale * vec4(glyph.x, -glyph.y, 0, 0));\n\n gl_Position = clipPosition;\n interpColor = color;\n pickId = id;\n dataCoordinate = position;\n }\n}"]),a=i(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nattribute vec3 position;\nattribute vec4 color;\nattribute vec2 glyph;\nattribute vec4 id;\n\nuniform mat4 model, view, projection;\nuniform vec2 screenSize;\nuniform vec3 clipBounds[2];\nuniform float highlightScale, pixelRatio;\nuniform vec4 highlightId;\n\nvarying vec4 interpColor;\nvarying vec4 pickId;\nvarying vec3 dataCoordinate;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], position)) {\n\n gl_Position = vec4(0,0,0,0);\n } else {\n float scale = pixelRatio;\n if(distance(highlightId.bgr, id.bgr) < 0.001) {\n scale *= highlightScale;\n }\n\n vec4 worldPosition = model * vec4(position, 1.0);\n vec4 viewPosition = view * worldPosition;\n vec4 clipPosition = projection * viewPosition;\n clipPosition /= clipPosition.w;\n\n gl_Position = clipPosition + vec4(screenSize * scale * vec2(glyph.x, -glyph.y), 0.0, 0.0);\n interpColor = color;\n pickId = id;\n dataCoordinate = position;\n }\n}"]),s=i(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nattribute vec3 position;\nattribute vec4 color;\nattribute vec2 glyph;\nattribute vec4 id;\n\nuniform float highlightScale;\nuniform vec4 highlightId;\nuniform vec3 axes[2];\nuniform mat4 model, view, projection;\nuniform vec2 screenSize;\nuniform vec3 clipBounds[2];\nuniform float scale, pixelRatio;\n\nvarying vec4 interpColor;\nvarying vec4 pickId;\nvarying vec3 dataCoordinate;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], position)) {\n\n gl_Position = vec4(0,0,0,0);\n } else {\n float lscale = pixelRatio * scale;\n if(distance(highlightId, id) < 0.0001) {\n lscale *= highlightScale;\n }\n\n vec4 clipCenter = projection * (view * (model * vec4(position, 1)));\n vec3 dataPosition = position + 0.5*lscale*(axes[0] * glyph.x + axes[1] * glyph.y) * clipCenter.w * screenSize.y;\n vec4 clipPosition = projection * (view * (model * vec4(dataPosition, 1)));\n\n gl_Position = clipPosition;\n interpColor = color;\n pickId = id;\n dataCoordinate = dataPosition;\n }\n}\n"]),l=i(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 fragClipBounds[2];\nuniform float opacity;\n\nvarying vec4 interpColor;\nvarying vec3 dataCoordinate;\n\nvoid main() {\n if (\n outOfRange(fragClipBounds[0], fragClipBounds[1], dataCoordinate) ||\n interpColor.a * opacity == 0.\n ) discard;\n gl_FragColor = interpColor * opacity;\n}\n"]),c=i(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 fragClipBounds[2];\nuniform float pickGroup;\n\nvarying vec4 pickId;\nvarying vec3 dataCoordinate;\n\nvoid main() {\n if (outOfRange(fragClipBounds[0], fragClipBounds[1], dataCoordinate)) discard;\n\n gl_FragColor = vec4(pickGroup, pickId.bgr);\n}"]),u=[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"glyph",type:"vec2"},{name:"id",type:"vec4"}],h={vertex:o,fragment:l,attributes:u},d={vertex:a,fragment:l,attributes:u},f={vertex:s,fragment:l,attributes:u},p={vertex:o,fragment:c,attributes:u},m={vertex:a,fragment:c,attributes:u},g={vertex:s,fragment:c,attributes:u};function v(t,e){var r=n(t,e),i=r.attributes;return i.position.location=0,i.color.location=1,i.glyph.location=2,i.id.location=3,r}e.createPerspective=function(t){return v(t,h)},e.createOrtho=function(t){return v(t,d)},e.createProject=function(t){return v(t,f)},e.createPickPerspective=function(t){return v(t,p)},e.createPickOrtho=function(t){return v(t,m)},e.createPickProject=function(t){return v(t,g)}},8418:function(t,e,r){"use strict";var n=r(5219),i=r(2762),o=r(8116),a=r(1888),s=r(6760),l=r(1283),c=r(9366),u=r(5964),h=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],d=ArrayBuffer,f=DataView;function p(t){return Array.isArray(t)||function(t){return d.isView(t)&&!(t instanceof f)}(t)}function m(t,e){var r=t[0],n=t[1],i=t[2],o=t[3];return t[0]=e[0]*r+e[4]*n+e[8]*i+e[12]*o,t[1]=e[1]*r+e[5]*n+e[9]*i+e[13]*o,t[2]=e[2]*r+e[6]*n+e[10]*i+e[14]*o,t[3]=e[3]*r+e[7]*n+e[11]*i+e[15]*o,t}function g(t,e,r,n){return m(n,n),m(n,n),m(n,n)}function v(t,e){this.index=t,this.dataCoordinate=this.position=e}function b(t){return!0===t||t>1?1:t}function y(t,e,r,n,i,o,a,s,l,c,u,h){this.gl=t,this.pixelRatio=1,this.shader=e,this.orthoShader=r,this.projectShader=n,this.pointBuffer=i,this.colorBuffer=o,this.glyphBuffer=a,this.idBuffer=s,this.vao=l,this.vertexCount=0,this.lineVertexCount=0,this.opacity=1,this.hasAlpha=!1,this.lineWidth=0,this.projectScale=[2/3,2/3,2/3],this.projectOpacity=[1,1,1],this.projectHasAlpha=!1,this.pickId=0,this.pickPerspectiveShader=c,this.pickOrthoShader=u,this.pickProjectShader=h,this.points=[],this._selectResult=new v(0,[0,0,0]),this.useOrtho=!0,this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.axesProject=[!0,!0,!0],this.axesBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.highlightId=[1,1,1,1],this.highlightScale=2,this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.dirty=!0}t.exports=function(t){var e=t.gl,r=l.createPerspective(e),n=l.createOrtho(e),a=l.createProject(e),s=l.createPickPerspective(e),c=l.createPickOrtho(e),u=l.createPickProject(e),h=i(e),d=i(e),f=i(e),p=i(e),m=new y(e,r,n,a,h,d,f,p,o(e,[{buffer:h,size:3,type:e.FLOAT},{buffer:d,size:4,type:e.FLOAT},{buffer:f,size:2,type:e.FLOAT},{buffer:p,size:4,type:e.UNSIGNED_BYTE,normalized:!0}]),s,c,u);return m.update(t),m};var x=y.prototype;x.pickSlots=1,x.setPickBase=function(t){this.pickId=t},x.isTransparent=function(){if(this.hasAlpha)return!0;for(var t=0;t<3;++t)if(this.axesProject[t]&&this.projectHasAlpha)return!0;return!1},x.isOpaque=function(){if(!this.hasAlpha)return!0;for(var t=0;t<3;++t)if(this.axesProject[t]&&!this.projectHasAlpha)return!0;return!1};var _=[0,0],w=[0,0,0],k=[0,0,0],A=[0,0,0,1],M=[0,0,0,1],T=h.slice(),S=[0,0,0],C=[[0,0,0],[0,0,0]];function E(t){return t[0]=t[1]=t[2]=0,t}function L(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=1,t}function z(t,e,r,n){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[r]=n,t}var O=[[-1e8,-1e8,-1e8],[1e8,1e8,1e8]];function D(t,e,r,n,i,o,a){var l=r.gl;if((o===r.projectHasAlpha||a)&&function(t,e,r,n){var i,o=e.axesProject,a=e.gl,l=t.uniforms,c=r.model||h,u=r.view||h,d=r.projection||h,f=e.axesBounds,p=function(t){for(var e=C,r=0;r<2;++r)for(var n=0;n<3;++n)e[r][n]=Math.max(Math.min(t[r][n],1e8),-1e8);return e}(e.clipBounds);i=e.axes&&e.axes.lastCubeProps?e.axes.lastCubeProps.axis:[1,1,1],_[0]=2/a.drawingBufferWidth,_[1]=2/a.drawingBufferHeight,t.bind(),l.view=u,l.projection=d,l.screenSize=_,l.highlightId=e.highlightId,l.highlightScale=e.highlightScale,l.clipBounds=p,l.pickGroup=e.pickId/255,l.pixelRatio=n;for(var m=0;m<3;++m)if(o[m]){l.scale=e.projectScale[m],l.opacity=e.projectOpacity[m];for(var v=T,b=0;b<16;++b)v[b]=0;for(b=0;b<4;++b)v[5*b]=1;v[5*m]=0,i[m]<0?v[12+m]=f[0][m]:v[12+m]=f[1][m],s(v,c,v),l.model=v;var y=(m+1)%3,x=(m+2)%3,O=E(w),D=E(k);O[y]=1,D[x]=1;var I=g(0,0,0,L(A,O)),F=g(0,0,0,L(M,D));if(Math.abs(I[1])>Math.abs(F[1])){var R=I;I=F,F=R,R=O,O=D,D=R;var P=y;y=x,x=P}I[0]<0&&(O[y]=-1),F[1]>0&&(D[x]=-1);var j=0,N=0;for(b=0;b<4;++b)j+=Math.pow(c[4*y+b],2),N+=Math.pow(c[4*x+b],2);O[y]/=Math.sqrt(j),D[x]/=Math.sqrt(N),l.axes[0]=O,l.axes[1]=D,l.fragClipBounds[0]=z(S,p[0],m,-1e8),l.fragClipBounds[1]=z(S,p[1],m,1e8),e.vao.bind(),e.vao.draw(a.TRIANGLES,e.vertexCount),e.lineWidth>0&&(a.lineWidth(e.lineWidth*n),e.vao.draw(a.LINES,e.lineVertexCount,e.vertexCount)),e.vao.unbind()}}(e,r,n,i),o===r.hasAlpha||a){t.bind();var c=t.uniforms;c.model=n.model||h,c.view=n.view||h,c.projection=n.projection||h,_[0]=2/l.drawingBufferWidth,_[1]=2/l.drawingBufferHeight,c.screenSize=_,c.highlightId=r.highlightId,c.highlightScale=r.highlightScale,c.fragClipBounds=O,c.clipBounds=r.axes.bounds,c.opacity=r.opacity,c.pickGroup=r.pickId/255,c.pixelRatio=i,r.vao.bind(),r.vao.draw(l.TRIANGLES,r.vertexCount),r.lineWidth>0&&(l.lineWidth(r.lineWidth*i),r.vao.draw(l.LINES,r.lineVertexCount,r.vertexCount)),r.vao.unbind()}}function I(t,e,r,i){var o;o=p(t)?e=this.pointCount||e<0)return null;var r=this.points[e],n=this._selectResult;n.index=e;for(var i=0;i<3;++i)n.position[i]=n.dataCoordinate[i]=r[i];return n},x.highlight=function(t){if(t){var e=t.index,r=255&e,n=e>>8&255,i=e>>16&255;this.highlightId=[r/255,n/255,i/255,0]}else this.highlightId=[1,1,1,1]},x.update=function(t){if("perspective"in(t=t||{})&&(this.useOrtho=!t.perspective),"orthographic"in t&&(this.useOrtho=!!t.orthographic),"lineWidth"in t&&(this.lineWidth=t.lineWidth),"project"in t)if(p(t.project))this.axesProject=t.project;else{var e=!!t.project;this.axesProject=[e,e,e]}if("projectScale"in t)if(p(t.projectScale))this.projectScale=t.projectScale.slice();else{var r=+t.projectScale;this.projectScale=[r,r,r]}if(this.projectHasAlpha=!1,"projectOpacity"in t){p(t.projectOpacity)?this.projectOpacity=t.projectOpacity.slice():(r=+t.projectOpacity,this.projectOpacity=[r,r,r]);for(var n=0;n<3;++n)this.projectOpacity[n]=b(this.projectOpacity[n]),this.projectOpacity[n]<1&&(this.projectHasAlpha=!0)}this.hasAlpha=!1,"opacity"in t&&(this.opacity=b(t.opacity),this.opacity<1&&(this.hasAlpha=!0)),this.dirty=!0;var i,o,s=t.position,l={family:t.font||"normal",style:t.fontStyle||"normal",weight:t.fontWeight||"normal",variant:t.fontVariant||"normal"},c=t.alignment||[0,0];if(2===c.length)i=c[0],o=c[1];else for(i=[],o=[],n=0;n0){var D=0,F=x,R=[0,0,0,1],P=[0,0,0,1],j=p(f)&&p(f[0]),N=p(v)&&p(v[0]);t:for(n=0;n0?1-S[0][0]:Y<0?1+S[1][0]:1,Z*=Z>0?1-S[0][1]:Z<0?1+S[1][1]:1],$=M.cells||[],J=M.positions||[];for(A=0;A<$.length;++A)for(var K=$[A],Q=0;Q<3;++Q){for(var tt=0;tt<3;++tt)E[3*D+tt]=k[tt];for(tt=0;tt<4;++tt)L[4*D+tt]=R[tt];O[D]=y;var et=J[K[Q]];z[2*D]=V*(W*et[0]-q*et[1]+X[0]),z[2*D+1]=V*(q*et[0]+W*et[1]+X[1]),D+=1}for($=T.edges,J=T.positions,A=0;A<$.length;++A)for(K=$[A],Q=0;Q<2;++Q){for(tt=0;tt<3;++tt)E[3*F+tt]=k[tt];for(tt=0;tt<4;++tt)L[4*F+tt]=P[tt];O[F]=y,et=J[K[Q]],z[2*F]=V*(W*et[0]-q*et[1]+X[0]),z[2*F+1]=V*(q*et[0]+W*et[1]+X[1]),F+=1}}}this.bounds=[u,h],this.points=s,this.pointCount=s.length,this.vertexCount=x,this.lineVertexCount=_,this.pointBuffer.update(E),this.colorBuffer.update(L),this.glyphBuffer.update(z),this.idBuffer.update(O),a.free(E),a.free(L),a.free(z),a.free(O)},x.dispose=function(){this.shader.dispose(),this.orthoShader.dispose(),this.pickPerspectiveShader.dispose(),this.pickOrthoShader.dispose(),this.vao.dispose(),this.pointBuffer.dispose(),this.colorBuffer.dispose(),this.glyphBuffer.dispose(),this.idBuffer.dispose()}},4298:function(t,e,r){"use strict";var n=r(3236);e.boxVertex=n(["precision mediump float;\n#define GLSLIFY 1\n\nattribute vec2 vertex;\n\nuniform vec2 cornerA, cornerB;\n\nvoid main() {\n gl_Position = vec4(mix(cornerA, cornerB, vertex), 0, 1);\n}\n"]),e.boxFragment=n(["precision mediump float;\n#define GLSLIFY 1\n\nuniform vec4 color;\n\nvoid main() {\n gl_FragColor = color;\n}\n"])},3161:function(t,e,r){"use strict";var n=r(9405),i=r(2762),o=r(4298);function a(t,e,r){this.plot=t,this.boxBuffer=e,this.boxShader=r,this.enabled=!0,this.selectBox=[1/0,1/0,-1/0,-1/0],this.borderColor=[0,0,0,1],this.innerFill=!1,this.innerColor=[0,0,0,.25],this.outerFill=!0,this.outerColor=[0,0,0,.5],this.borderWidth=10}t.exports=function(t,e){var r=t.gl,s=new a(t,i(r,[0,0,0,1,1,0,1,1]),n(r,o.boxVertex,o.boxFragment));return s.update(e),t.addOverlay(s),s};var s=a.prototype;s.draw=function(){if(this.enabled){var t=this.plot,e=this.selectBox,r=this.borderWidth,n=(this.innerFill,this.innerColor),i=(this.outerFill,this.outerColor),o=this.borderColor,a=t.box,s=t.screenBox,l=t.dataBox,c=t.viewBox,u=t.pixelRatio,h=(e[0]-l[0])*(c[2]-c[0])/(l[2]-l[0])+c[0],d=(e[1]-l[1])*(c[3]-c[1])/(l[3]-l[1])+c[1],f=(e[2]-l[0])*(c[2]-c[0])/(l[2]-l[0])+c[0],p=(e[3]-l[1])*(c[3]-c[1])/(l[3]-l[1])+c[1];if(h=Math.max(h,c[0]),d=Math.max(d,c[1]),f=Math.min(f,c[2]),p=Math.min(p,c[3]),!(f0){var v=r*u;a.drawBox(h-v,d-v,f+v,d+v,o),a.drawBox(h-v,p-v,f+v,p+v,o),a.drawBox(h-v,d-v,h+v,p+v,o),a.drawBox(f-v,d-v,f+v,p+v,o)}}}},s.update=function(t){t=t||{},this.innerFill=!!t.innerFill,this.outerFill=!!t.outerFill,this.innerColor=(t.innerColor||[0,0,0,.5]).slice(),this.outerColor=(t.outerColor||[0,0,0,.5]).slice(),this.borderColor=(t.borderColor||[0,0,0,1]).slice(),this.borderWidth=t.borderWidth||0,this.selectBox=(t.selectBox||this.selectBox).slice()},s.dispose=function(){this.boxBuffer.dispose(),this.boxShader.dispose(),this.plot.removeOverlay(this)}},3589:function(t,e,r){"use strict";t.exports=function(t,e){var r=e[0],o=e[1];return new l(t,n(t,r,o,{}),i.mallocUint8(r*o*4))};var n=r(2260),i=r(1888),o=r(9618),a=r(8828).nextPow2;function s(t,e,r,n,i){this.coord=[t,e],this.id=r,this.value=n,this.distance=i}function l(t,e,r){this.gl=t,this.fbo=e,this.buffer=r,this._readTimeout=null;var n=this;this._readCallback=function(){n.gl&&(e.bind(),t.readPixels(0,0,e.shape[0],e.shape[1],t.RGBA,t.UNSIGNED_BYTE,n.buffer),n._readTimeout=null)}}var c=l.prototype;Object.defineProperty(c,"shape",{get:function(){return this.gl?this.fbo.shape.slice():[0,0]},set:function(t){if(this.gl){this.fbo.shape=t;var e=this.fbo.shape[0],r=this.fbo.shape[1];if(r*e*4>this.buffer.length){i.free(this.buffer);for(var n=this.buffer=i.mallocUint8(a(r*e*4)),o=0;or)for(t=r;te)for(t=e;t=0){for(var k=0|w.type.charAt(w.type.length-1),A=new Array(k),M=0;M=0;)T+=1;_[b]=T}var S=new Array(r.length);function C(){d.program=a.program(f,d._vref,d._fref,x,_);for(var t=0;t=0){if((p=d.charCodeAt(d.length-1)-48)<2||p>4)throw new n("","Invalid data type for attribute "+h+": "+d);s(t,e,f[0],i,p,o,h)}else{if(!(d.indexOf("mat")>=0))throw new n("","Unknown data type for attribute "+h+": "+d);var p;if((p=d.charCodeAt(d.length-1)-48)<2||p>4)throw new n("","Invalid data type for attribute "+h+": "+d);l(t,e,f,i,p,o,h)}}}return o};var n=r(8866);function i(t,e,r,n,i,o){this._gl=t,this._wrapper=e,this._index=r,this._locations=n,this._dimension=i,this._constFunc=o}var o=i.prototype;o.pointer=function(t,e,r,n){var i=this,o=i._gl,a=i._locations[i._index];o.vertexAttribPointer(a,i._dimension,t||o.FLOAT,!!e,r||0,n||0),o.enableVertexAttribArray(a)},o.set=function(t,e,r,n){return this._constFunc(this._locations[this._index],t,e,r,n)},Object.defineProperty(o,"location",{get:function(){return this._locations[this._index]},set:function(t){return t!==this._locations[this._index]&&(this._locations[this._index]=0|t,this._wrapper.program=null),0|t}});var a=[function(t,e,r){return void 0===r.length?t.vertexAttrib1f(e,r):t.vertexAttrib1fv(e,r)},function(t,e,r,n){return void 0===r.length?t.vertexAttrib2f(e,r,n):t.vertexAttrib2fv(e,r)},function(t,e,r,n,i){return void 0===r.length?t.vertexAttrib3f(e,r,n,i):t.vertexAttrib3fv(e,r)},function(t,e,r,n,i,o){return void 0===r.length?t.vertexAttrib4f(e,r,n,i,o):t.vertexAttrib4fv(e,r)}];function s(t,e,r,n,o,s,l){var c=a[o],u=new i(t,e,r,n,o,c);Object.defineProperty(s,l,{set:function(e){return t.disableVertexAttribArray(n[r]),c(t,n[r],e),e},get:function(){return u},enumerable:!0})}function l(t,e,r,n,i,o,a){for(var l=new Array(i),c=new Array(i),u=0;u4)throw new i("","Invalid uniform dimension type for matrix "+name+": "+b);t["uniformMatrix"+v+"fv"](s[h],!1,d);break}throw new i("","Unknown uniform data type for "+name+": "+b)}if((v=b.charCodeAt(b.length-1)-48)<2||v>4)throw new i("","Invalid data type");switch(b.charAt(0)){case"b":case"i":t["uniform"+v+"iv"](s[h],d);break;case"v":t["uniform"+v+"fv"](s[h],d);break;default:throw new i("","Unrecognized data type for vector "+name+": "+b)}}}}}}function c(t,e){if("object"!=typeof e)return[[t,e]];var r=[];for(var n in e){var i=e[n],o=t;parseInt(n)+""===n?o+="["+n+"]":o+="."+n,"object"==typeof i?r.push.apply(r,c(o,i)):r.push([o,i])}return r}function u(t,e,n){if("object"==typeof n){var c=h(n);Object.defineProperty(t,e,{get:o(c),set:l(n),enumerable:!0,configurable:!1})}else s[n]?Object.defineProperty(t,e,{get:(u=n,function(t,e,r){return t.getUniform(e.program,r[u])}),set:l(n),enumerable:!0,configurable:!1}):t[e]=function(t){switch(t){case"bool":return!1;case"int":case"sampler2D":case"samplerCube":case"float":return 0;default:var e=t.indexOf("vec");if(0<=e&&e<=1&&t.length===4+e){if((r=t.charCodeAt(t.length-1)-48)<2||r>4)throw new i("","Invalid data type");return"b"===t.charAt(0)?a(r,!1):a(r,0)}if(0===t.indexOf("mat")&&4===t.length){var r;if((r=t.charCodeAt(t.length-1)-48)<2||r>4)throw new i("","Invalid uniform dimension type for matrix "+name+": "+t);return a(r*r,0)}throw new i("","Unknown uniform data type for "+name+": "+t)}}(r[n].type);var u}function h(t){var e;if(Array.isArray(t)){e=new Array(t.length);for(var r=0;r1){s[0]in o||(o[s[0]]=[]),o=o[s[0]];for(var l=1;l1)for(var l=0;l 0 U ||b|| > 0.\n // Assign z = 0, x = -b, y = a:\n // a*-b + b*a + c*0 = -ba + ba + 0 = 0\n if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) {\n return normalize(vec3(-v.y, v.x, 0.0));\n } else {\n return normalize(vec3(0.0, v.z, -v.y));\n }\n}\n\n// Calculate the tube vertex and normal at the given index.\n//\n// The returned vertex is for a tube ring with its center at origin, radius of length(d), pointing in the direction of d.\n//\n// Each tube segment is made up of a ring of vertices.\n// These vertices are used to make up the triangles of the tube by connecting them together in the vertex array.\n// The indexes of tube segments run from 0 to 8.\n//\nvec3 getTubePosition(vec3 d, float index, out vec3 normal) {\n float segmentCount = 8.0;\n\n float angle = 2.0 * 3.14159 * (index / segmentCount);\n\n vec3 u = getOrthogonalVector(d);\n vec3 v = normalize(cross(u, d));\n\n vec3 x = u * cos(angle) * length(d);\n vec3 y = v * sin(angle) * length(d);\n vec3 v3 = x + y;\n\n normal = normalize(v3);\n\n return v3;\n}\n\nattribute vec4 vector;\nattribute vec4 color, position;\nattribute vec2 uv;\n\nuniform float vectorScale, tubeScale;\nuniform mat4 model, view, projection, inverseModel;\nuniform vec3 eyePosition, lightPosition;\n\nvarying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n // Scale the vector magnitude to stay constant with\n // model & view changes.\n vec3 normal;\n vec3 XYZ = getTubePosition(mat3(model) * (tubeScale * vector.w * normalize(vector.xyz)), position.w, normal);\n vec4 tubePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0);\n\n //Lighting geometry parameters\n vec4 cameraCoordinate = view * tubePosition;\n cameraCoordinate.xyz /= cameraCoordinate.w;\n f_lightDirection = lightPosition - cameraCoordinate.xyz;\n f_eyeDirection = eyePosition - cameraCoordinate.xyz;\n f_normal = normalize((vec4(normal, 0.0) * inverseModel).xyz);\n\n // vec4 m_position = model * vec4(tubePosition, 1.0);\n vec4 t_position = view * tubePosition;\n gl_Position = projection * t_position;\n\n f_color = color;\n f_data = tubePosition.xyz;\n f_position = position.xyz;\n f_uv = uv;\n}\n"]),o=n(["#extension GL_OES_standard_derivatives : enable\n\nprecision highp float;\n#define GLSLIFY 1\n\nfloat beckmannDistribution(float x, float roughness) {\n float NdotH = max(x, 0.0001);\n float cos2Alpha = NdotH * NdotH;\n float tan2Alpha = (cos2Alpha - 1.0) / cos2Alpha;\n float roughness2 = roughness * roughness;\n float denom = 3.141592653589793 * roughness2 * cos2Alpha * cos2Alpha;\n return exp(tan2Alpha / roughness2) / denom;\n}\n\nfloat cookTorranceSpecular(\n vec3 lightDirection,\n vec3 viewDirection,\n vec3 surfaceNormal,\n float roughness,\n float fresnel) {\n\n float VdotN = max(dot(viewDirection, surfaceNormal), 0.0);\n float LdotN = max(dot(lightDirection, surfaceNormal), 0.0);\n\n //Half angle vector\n vec3 H = normalize(lightDirection + viewDirection);\n\n //Geometric term\n float NdotH = max(dot(surfaceNormal, H), 0.0);\n float VdotH = max(dot(viewDirection, H), 0.000001);\n float LdotH = max(dot(lightDirection, H), 0.000001);\n float G1 = (2.0 * NdotH * VdotN) / VdotH;\n float G2 = (2.0 * NdotH * LdotN) / LdotH;\n float G = min(1.0, min(G1, G2));\n \n //Distribution term\n float D = beckmannDistribution(NdotH, roughness);\n\n //Fresnel term\n float F = pow(1.0 - VdotN, fresnel);\n\n //Multiply terms and done\n return G * F * D / max(3.14159265 * VdotN, 0.000001);\n}\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float roughness, fresnel, kambient, kdiffuse, kspecular, opacity;\nuniform sampler2D texture;\n\nvarying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;\n vec3 N = normalize(f_normal);\n vec3 L = normalize(f_lightDirection);\n vec3 V = normalize(f_eyeDirection);\n\n if(gl_FrontFacing) {\n N = -N;\n }\n\n float specular = min(1.0, max(0.0, cookTorranceSpecular(L, V, N, roughness, fresnel)));\n float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0);\n\n vec4 surfaceColor = f_color * texture2D(texture, f_uv);\n vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular, 1.0);\n\n gl_FragColor = litColor * opacity;\n}\n"]),a=n(["precision highp float;\n\nprecision highp float;\n#define GLSLIFY 1\n\nvec3 getOrthogonalVector(vec3 v) {\n // Return up-vector for only-z vector.\n // Return ax + by + cz = 0, a point that lies on the plane that has v as a normal and that isn't (0,0,0).\n // From the above if-statement we have ||a|| > 0 U ||b|| > 0.\n // Assign z = 0, x = -b, y = a:\n // a*-b + b*a + c*0 = -ba + ba + 0 = 0\n if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) {\n return normalize(vec3(-v.y, v.x, 0.0));\n } else {\n return normalize(vec3(0.0, v.z, -v.y));\n }\n}\n\n// Calculate the tube vertex and normal at the given index.\n//\n// The returned vertex is for a tube ring with its center at origin, radius of length(d), pointing in the direction of d.\n//\n// Each tube segment is made up of a ring of vertices.\n// These vertices are used to make up the triangles of the tube by connecting them together in the vertex array.\n// The indexes of tube segments run from 0 to 8.\n//\nvec3 getTubePosition(vec3 d, float index, out vec3 normal) {\n float segmentCount = 8.0;\n\n float angle = 2.0 * 3.14159 * (index / segmentCount);\n\n vec3 u = getOrthogonalVector(d);\n vec3 v = normalize(cross(u, d));\n\n vec3 x = u * cos(angle) * length(d);\n vec3 y = v * sin(angle) * length(d);\n vec3 v3 = x + y;\n\n normal = normalize(v3);\n\n return v3;\n}\n\nattribute vec4 vector;\nattribute vec4 position;\nattribute vec4 id;\n\nuniform mat4 model, view, projection;\nuniform float tubeScale;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n vec3 normal;\n vec3 XYZ = getTubePosition(mat3(model) * (tubeScale * vector.w * normalize(vector.xyz)), position.w, normal);\n vec4 tubePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0);\n\n gl_Position = projection * (view * tubePosition);\n f_id = id;\n f_position = position.xyz;\n}\n"]),s=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float pickId;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;\n\n gl_FragColor = vec4(pickId, f_id.xyz);\n}"]);e.meshShader={vertex:i,fragment:o,attributes:[{name:"position",type:"vec4"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"vector",type:"vec4"}]},e.pickShader={vertex:a,fragment:s,attributes:[{name:"position",type:"vec4"},{name:"id",type:"vec4"},{name:"vector",type:"vec4"}]}},7815:function(t,e,r){"use strict";var n=r(2931),i=r(9970),o=["xyz","xzy","yxz","yzx","zxy","zyx"],a=function(t,e){var r,n=t.length;for(r=0;re)return r-1}return r},s=function(t,e,r){return tr?r:t},l=function(t){var e=1/0;t.sort((function(t,e){return t-e}));for(var r=t.length,n=1;nh-1||b>d-1||y>f-1)return n.create();var x,_,w,k,A,M,T=o[0][p],S=o[0][v],C=o[1][m],E=o[1][b],L=o[2][g],z=(l-T)/(S-T),O=(c-C)/(E-C),D=(u-L)/(o[2][y]-L);switch(isFinite(z)||(z=.5),isFinite(O)||(O=.5),isFinite(D)||(D=.5),r.reversedX&&(p=h-1-p,v=h-1-v),r.reversedY&&(m=d-1-m,b=d-1-b),r.reversedZ&&(g=f-1-g,y=f-1-y),r.filled){case 5:A=g,M=y,w=m*f,k=b*f,x=p*f*d,_=v*f*d;break;case 4:A=g,M=y,x=p*f,_=v*f,w=m*f*h,k=b*f*h;break;case 3:w=m,k=b,A=g*d,M=y*d,x=p*d*f,_=v*d*f;break;case 2:w=m,k=b,x=p*d,_=v*d,A=g*d*h,M=y*d*h;break;case 1:x=p,_=v,A=g*h,M=y*h,w=m*h*f,k=b*h*f;break;default:x=p,_=v,w=m*h,k=b*h,A=g*h*d,M=y*h*d}var I=i[x+w+A],F=i[x+w+M],R=i[x+k+A],P=i[x+k+M],j=i[_+w+A],N=i[_+w+M],B=i[_+k+A],U=i[_+k+M],G=n.create(),V=n.create(),H=n.create(),W=n.create();n.lerp(G,I,j,z),n.lerp(V,F,N,z),n.lerp(H,R,B,z),n.lerp(W,P,U,z);var q=n.create(),Y=n.create();n.lerp(q,G,H,O),n.lerp(Y,V,W,O);var Z=n.create();return n.lerp(Z,q,Y,D),Z}(e,t,f)},m=t.getDivergence||function(t,e){var r=n.create(),i=1e-4;n.add(r,t,[i,0,0]);var o=p(r);n.subtract(o,o,e),n.scale(o,o,1/i),n.add(r,t,[0,i,0]);var a=p(r);n.subtract(a,a,e),n.scale(a,a,1/i),n.add(r,t,[0,0,i]);var s=p(r);return n.subtract(s,s,e),n.scale(s,s,1/i),n.add(r,o,a),n.add(r,r,s),r},g=[],v=e[0][0],b=e[0][1],y=e[0][2],x=e[1][0],_=e[1][1],w=e[1][2],k=function(t){var e=t[0],r=t[1],n=t[2];return!(ex||r_||nw)},A=10*n.distance(e[0],e[1])/c,M=A*A,T=1,S=0,C=r.length;C>1&&(T=function(t){for(var e=[],r=[],n=[],i={},o={},a={},s=t.length,c=0;cS&&(S=P),F.push(P),g.push({points:z,velocities:O,divergences:F});for(var j=0;j<100*c&&z.lengthM&&n.scale(N,N,A/Math.sqrt(B)),n.add(N,N,L),D=p(N),n.squaredDistance(I,N)-M>-1e-4*M&&(z.push(N),I=N,O.push(D),R=m(N,D),P=n.length(R),isFinite(P)&&P>S&&(S=P),F.push(P)),L=N}}var U=function(t,e,r,o){for(var a=0,s=0;s0)for(k=0;k<8;k++){var A=(k+1)%8;c.push(d[k],f[k],f[A],f[A],d[A],d[k]),h.push(b,v,v,v,b,b),p.push(m,g,g,g,m,m);var M=c.length;u.push([M-6,M-5,M-4],[M-3,M-2,M-1])}var T=d;d=f,f=T;var S=b;b=v,v=S;var C=m;m=g,g=C}return{positions:c,cells:u,vectors:h,vertexIntensity:p}}(t,r,o,a)})),h=[],d=[],f=[],p=[];for(s=0;s max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 lowerBound, upperBound;\nuniform float contourTint;\nuniform vec4 contourColor;\nuniform sampler2D colormap;\nuniform vec3 clipBounds[2];\nuniform float roughness, fresnel, kambient, kdiffuse, kspecular, opacity;\nuniform float vertexColor;\n\nvarying float value, kill;\nvarying vec3 worldCoordinate;\nvarying vec3 lightDirection, eyeDirection, surfaceNormal;\nvarying vec4 vColor;\n\nvoid main() {\n if (\n kill > 0.0 ||\n vColor.a == 0.0 ||\n outOfRange(clipBounds[0], clipBounds[1], worldCoordinate)\n ) discard;\n\n vec3 N = normalize(surfaceNormal);\n vec3 V = normalize(eyeDirection);\n vec3 L = normalize(lightDirection);\n\n if(gl_FrontFacing) {\n N = -N;\n }\n\n float specular = max(beckmannSpecular(L, V, N, roughness), 0.);\n float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0);\n\n //decide how to interpolate color — in vertex or in fragment\n vec4 surfaceColor =\n step(vertexColor, .5) * texture2D(colormap, vec2(value, value)) +\n step(.5, vertexColor) * vColor;\n\n vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular, 1.0);\n\n gl_FragColor = mix(litColor, contourColor, contourTint) * opacity;\n}\n"]),s=i(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec4 uv;\nattribute float f;\n\nuniform vec3 objectOffset;\nuniform mat3 permutation;\nuniform mat4 model, view, projection;\nuniform float height, zOffset;\nuniform sampler2D colormap;\n\nvarying float value, kill;\nvarying vec3 worldCoordinate;\nvarying vec2 planeCoordinate;\nvarying vec3 lightDirection, eyeDirection, surfaceNormal;\nvarying vec4 vColor;\n\nvoid main() {\n vec3 dataCoordinate = permutation * vec3(uv.xy, height);\n worldCoordinate = objectOffset + dataCoordinate;\n mat4 objectOffsetTranslation = mat4(1.0) + mat4(vec4(0), vec4(0), vec4(0), vec4(objectOffset, 0));\n vec4 worldPosition = (model * objectOffsetTranslation) * vec4(dataCoordinate, 1.0);\n\n vec4 clipPosition = projection * (view * worldPosition);\n clipPosition.z += zOffset;\n\n gl_Position = clipPosition;\n value = f + objectOffset.z;\n kill = -1.0;\n planeCoordinate = uv.zw;\n\n vColor = texture2D(colormap, vec2(value, value));\n\n //Don't do lighting for contours\n surfaceNormal = vec3(1,0,0);\n eyeDirection = vec3(0,1,0);\n lightDirection = vec3(0,0,1);\n}\n"]),l=i(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec2 shape;\nuniform vec3 clipBounds[2];\nuniform float pickId;\n\nvarying float value, kill;\nvarying vec3 worldCoordinate;\nvarying vec2 planeCoordinate;\nvarying vec3 surfaceNormal;\n\nvec2 splitFloat(float v) {\n float vh = 255.0 * v;\n float upper = floor(vh);\n float lower = fract(vh);\n return vec2(upper / 255.0, floor(lower * 16.0) / 16.0);\n}\n\nvoid main() {\n if ((kill > 0.0) ||\n (outOfRange(clipBounds[0], clipBounds[1], worldCoordinate))) discard;\n\n vec2 ux = splitFloat(planeCoordinate.x / shape.x);\n vec2 uy = splitFloat(planeCoordinate.y / shape.y);\n gl_FragColor = vec4(pickId, ux.x, uy.x, ux.y + (uy.y/16.0));\n}\n"]);e.createShader=function(t){var e=n(t,o,a,null,[{name:"uv",type:"vec4"},{name:"f",type:"vec3"},{name:"normal",type:"vec3"}]);return e.attributes.uv.location=0,e.attributes.f.location=1,e.attributes.normal.location=2,e},e.createPickShader=function(t){var e=n(t,o,l,null,[{name:"uv",type:"vec4"},{name:"f",type:"vec3"},{name:"normal",type:"vec3"}]);return e.attributes.uv.location=0,e.attributes.f.location=1,e.attributes.normal.location=2,e},e.createContourShader=function(t){var e=n(t,s,a,null,[{name:"uv",type:"vec4"},{name:"f",type:"float"}]);return e.attributes.uv.location=0,e.attributes.f.location=1,e},e.createPickContourShader=function(t){var e=n(t,s,l,null,[{name:"uv",type:"vec4"},{name:"f",type:"float"}]);return e.attributes.uv.location=0,e.attributes.f.location=1,e}},9499:function(t,e,r){"use strict";t.exports=function(t){var e=t.gl,r=b(e),n=x(e),s=y(e),l=_(e),c=i(e),u=o(e,[{buffer:c,size:4,stride:w,offset:0},{buffer:c,size:3,stride:w,offset:16},{buffer:c,size:3,stride:w,offset:28}]),h=i(e),d=o(e,[{buffer:h,size:4,stride:20,offset:0},{buffer:h,size:1,stride:20,offset:16}]),f=i(e),p=o(e,[{buffer:f,size:2,type:e.FLOAT}]),m=a(e,1,S,e.RGBA,e.UNSIGNED_BYTE);m.minFilter=e.LINEAR,m.magFilter=e.LINEAR;var g=new C(e,[0,0],[[0,0,0],[0,0,0]],r,n,c,u,m,s,l,h,d,f,p,[0,0,0]),v={levels:[[],[],[]]};for(var k in t)v[k]=t[k];return v.colormap=v.colormap||"jet",g.update(v),g};var n=r(8828),i=r(2762),o=r(8116),a=r(7766),s=r(1888),l=r(6729),c=r(5298),u=r(9994),h=r(9618),d=r(3711),f=r(6760),p=r(7608),m=r(2478),g=r(6199),v=r(990),b=v.createShader,y=v.createContourShader,x=v.createPickShader,_=v.createPickContourShader,w=40,k=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],A=[[0,0],[0,1],[1,0],[1,1],[1,0],[0,1]],M=[[0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0]];function T(t,e,r,n,i){this.position=t,this.index=e,this.uv=r,this.level=n,this.dataCoordinate=i}!function(){for(var t=0;t<3;++t){var e=M[t],r=(t+2)%3;e[(t+1)%3+0]=1,e[r+3]=1,e[t+6]=1}}();var S=256;function C(t,e,r,n,i,o,a,l,c,u,d,f,p,m,g){this.gl=t,this.shape=e,this.bounds=r,this.objectOffset=g,this.intensityBounds=[],this._shader=n,this._pickShader=i,this._coordinateBuffer=o,this._vao=a,this._colorMap=l,this._contourShader=c,this._contourPickShader=u,this._contourBuffer=d,this._contourVAO=f,this._contourOffsets=[[],[],[]],this._contourCounts=[[],[],[]],this._vertexCount=0,this._pickResult=new T([0,0,0],[0,0],[0,0],[0,0,0],[0,0,0]),this._dynamicBuffer=p,this._dynamicVAO=m,this._dynamicOffsets=[0,0,0],this._dynamicCounts=[0,0,0],this.contourWidth=[1,1,1],this.contourLevels=[[1],[1],[1]],this.contourTint=[0,0,0],this.contourColor=[[.5,.5,.5,1],[.5,.5,.5,1],[.5,.5,.5,1]],this.showContour=!0,this.showSurface=!0,this.enableHighlight=[!0,!0,!0],this.highlightColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.highlightTint=[1,1,1],this.highlightLevel=[-1,-1,-1],this.enableDynamic=[!0,!0,!0],this.dynamicLevel=[NaN,NaN,NaN],this.dynamicColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.dynamicTint=[1,1,1],this.dynamicWidth=[1,1,1],this.axesBounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.surfaceProject=[!1,!1,!1],this.contourProject=[[!1,!1,!1],[!1,!1,!1],[!1,!1,!1]],this.colorBounds=[!1,!1],this._field=[h(s.mallocFloat(1024),[0,0]),h(s.mallocFloat(1024),[0,0]),h(s.mallocFloat(1024),[0,0])],this.pickId=1,this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.snapToData=!1,this.pixelRatio=1,this.opacity=1,this.lightPosition=[10,1e4,0],this.ambientLight=.8,this.diffuseLight=.8,this.specularLight=2,this.roughness=.5,this.fresnel=1.5,this.vertexColor=0,this.dirty=!0}var E=C.prototype;E.genColormap=function(t,e){var r=!1,n=u([l({colormap:t,nshades:S,format:"rgba"}).map((function(t,n){var i=e?function(t,e){if(!e)return 1;if(!e.length)return 1;for(var r=0;rt&&r>0){var n=(e[r][0]-t)/(e[r][0]-e[r-1][0]);return e[r][1]*(1-n)+n*e[r-1][1]}}return 1}(n/255,e):t[3];return i<1&&(r=!0),[t[0],t[1],t[2],255*i]}))]);return c.divseq(n,255),this.hasAlphaScale=r,n},E.isTransparent=function(){return this.opacity<1||this.hasAlphaScale},E.isOpaque=function(){return!this.isTransparent()},E.pickSlots=1,E.setPickBase=function(t){this.pickId=t};var L=[0,0,0],z={showSurface:!1,showContour:!1,projections:[k.slice(),k.slice(),k.slice()],clipBounds:[[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]]]};function O(t,e){var r,n,i,o=e.axes&&e.axes.lastCubeProps.axis||L,a=e.showSurface,s=e.showContour;for(r=0;r<3;++r)for(a=a||e.surfaceProject[r],n=0;n<3;++n)s=s||e.contourProject[r][n];for(r=0;r<3;++r){var l=z.projections[r];for(n=0;n<16;++n)l[n]=0;for(n=0;n<4;++n)l[5*n]=1;l[5*r]=0,l[12+r]=e.axesBounds[+(o[r]>0)][r],f(l,t.model,l);var c=z.clipBounds[r];for(i=0;i<2;++i)for(n=0;n<3;++n)c[i][n]=t.clipBounds[i][n];c[0][r]=-1e8,c[1][r]=1e8}return z.showSurface=a,z.showContour=s,z}var D={model:k,view:k,projection:k,inverseModel:k.slice(),lowerBound:[0,0,0],upperBound:[0,0,0],colorMap:0,clipBounds:[[0,0,0],[0,0,0]],height:0,contourTint:0,contourColor:[0,0,0,1],permutation:[1,0,0,0,1,0,0,0,1],zOffset:-1e-4,objectOffset:[0,0,0],kambient:1,kdiffuse:1,kspecular:1,lightPosition:[1e3,1e3,1e3],eyePosition:[0,0,0],roughness:1,fresnel:1,opacity:1,vertexColor:0},I=k.slice(),F=[1,0,0,0,1,0,0,0,1];function R(t,e){t=t||{};var r=this.gl;r.disable(r.CULL_FACE),this._colorMap.bind(0);var n=D;n.model=t.model||k,n.view=t.view||k,n.projection=t.projection||k,n.lowerBound=[this.bounds[0][0],this.bounds[0][1],this.colorBounds[0]||this.bounds[0][2]],n.upperBound=[this.bounds[1][0],this.bounds[1][1],this.colorBounds[1]||this.bounds[1][2]],n.objectOffset=this.objectOffset,n.contourColor=this.contourColor[0],n.inverseModel=p(n.inverseModel,n.model);for(var i=0;i<2;++i)for(var o=n.clipBounds[i],a=0;a<3;++a)o[a]=Math.min(Math.max(this.clipBounds[i][a],-1e8),1e8);n.kambient=this.ambientLight,n.kdiffuse=this.diffuseLight,n.kspecular=this.specularLight,n.roughness=this.roughness,n.fresnel=this.fresnel,n.opacity=this.opacity,n.height=0,n.permutation=F,n.vertexColor=this.vertexColor;var s=I;for(f(s,n.view,n.model),f(s,n.projection,s),p(s,s),i=0;i<3;++i)n.eyePosition[i]=s[12+i]/s[15];var l=s[15];for(i=0;i<3;++i)l+=this.lightPosition[i]*s[4*i+3];for(i=0;i<3;++i){var c=s[12+i];for(a=0;a<3;++a)c+=s[4*a+i]*this.lightPosition[a];n.lightPosition[i]=c/l}var u=O(n,this);if(u.showSurface){for(this._shader.bind(),this._shader.uniforms=n,this._vao.bind(),this.showSurface&&this._vertexCount&&this._vao.draw(r.TRIANGLES,this._vertexCount),i=0;i<3;++i)this.surfaceProject[i]&&this.vertexCount&&(this._shader.uniforms.model=u.projections[i],this._shader.uniforms.clipBounds=u.clipBounds[i],this._vao.draw(r.TRIANGLES,this._vertexCount));this._vao.unbind()}if(u.showContour){var h=this._contourShader;n.kambient=1,n.kdiffuse=0,n.kspecular=0,n.opacity=1,h.bind(),h.uniforms=n;var d=this._contourVAO;for(d.bind(),i=0;i<3;++i)for(h.uniforms.permutation=M[i],r.lineWidth(this.contourWidth[i]*this.pixelRatio),a=0;a>4)/16)/255,i=Math.floor(n),o=n-i,a=e[1]*(t.value[1]+(15&t.value[2])/16)/255,s=Math.floor(a),l=a-s;i+=1,s+=1;var c=r.position;c[0]=c[1]=c[2]=0;for(var u=0;u<2;++u)for(var h=u?o:1-o,d=0;d<2;++d)for(var f=i+u,p=s+d,g=h*(d?l:1-l),v=0;v<3;++v)c[v]+=this._field[v].get(f,p)*g;for(var b=this._pickResult.level,y=0;y<3;++y)if(b[y]=m.le(this.contourLevels[y],c[y]),b[y]<0)this.contourLevels[y].length>0&&(b[y]=0);else if(b[y]Math.abs(_-c[y])&&(b[y]+=1)}for(r.index[0]=o<.5?i:i+1,r.index[1]=l<.5?s:s+1,r.uv[0]=n/e[0],r.uv[1]=a/e[1],v=0;v<3;++v)r.dataCoordinate[v]=this._field[v].get(r.index[0],r.index[1]);return r},E.padField=function(t,e){var r=e.shape.slice(),n=t.shape.slice();c.assign(t.lo(1,1).hi(r[0],r[1]),e),c.assign(t.lo(1).hi(r[0],1),e.hi(r[0],1)),c.assign(t.lo(1,n[1]-1).hi(r[0],1),e.lo(0,r[1]-1).hi(r[0],1)),c.assign(t.lo(0,1).hi(1,r[1]),e.hi(1)),c.assign(t.lo(n[0]-1,1).hi(1,r[1]),e.lo(r[0]-1)),t.set(0,0,e.get(0,0)),t.set(0,n[1]-1,e.get(0,r[1]-1)),t.set(n[0]-1,0,e.get(r[0]-1,0)),t.set(n[0]-1,n[1]-1,e.get(r[0]-1,r[1]-1))},E.update=function(t){t=t||{},this.objectOffset=t.objectOffset||this.objectOffset,this.dirty=!0,"contourWidth"in t&&(this.contourWidth=j(t.contourWidth,Number)),"showContour"in t&&(this.showContour=j(t.showContour,Boolean)),"showSurface"in t&&(this.showSurface=!!t.showSurface),"contourTint"in t&&(this.contourTint=j(t.contourTint,Boolean)),"contourColor"in t&&(this.contourColor=B(t.contourColor)),"contourProject"in t&&(this.contourProject=j(t.contourProject,(function(t){return j(t,Boolean)}))),"surfaceProject"in t&&(this.surfaceProject=t.surfaceProject),"dynamicColor"in t&&(this.dynamicColor=B(t.dynamicColor)),"dynamicTint"in t&&(this.dynamicTint=j(t.dynamicTint,Number)),"dynamicWidth"in t&&(this.dynamicWidth=j(t.dynamicWidth,Number)),"opacity"in t&&(this.opacity=t.opacity),"opacityscale"in t&&(this.opacityscale=t.opacityscale),"colorBounds"in t&&(this.colorBounds=t.colorBounds),"vertexColor"in t&&(this.vertexColor=t.vertexColor?1:0),"colormap"in t&&this._colorMap.setPixels(this.genColormap(t.colormap,this.opacityscale));var e=t.field||t.coords&&t.coords[2]||null,r=!1;if(e||(e=this._field[2].shape[0]||this._field[2].shape[2]?this._field[2].lo(1,1).hi(this._field[2].shape[0]-2,this._field[2].shape[1]-2):this._field[2].hi(0,0)),"field"in t||"coords"in t){var i=(e.shape[0]+2)*(e.shape[1]+2);i>this._field[2].data.length&&(s.freeFloat(this._field[2].data),this._field[2].data=s.mallocFloat(n.nextPow2(i))),this._field[2]=h(this._field[2].data,[e.shape[0]+2,e.shape[1]+2]),this.padField(this._field[2],e),this.shape=e.shape.slice();for(var o=this.shape,a=0;a<2;++a)this._field[2].size>this._field[a].data.length&&(s.freeFloat(this._field[a].data),this._field[a].data=s.mallocFloat(this._field[2].size)),this._field[a]=h(this._field[a].data,[o[0]+2,o[1]+2]);if(t.coords){var l=t.coords;if(!Array.isArray(l)||3!==l.length)throw new Error("gl-surface: invalid coordinates for x/y");for(a=0;a<2;++a){var c=l[a];for(v=0;v<2;++v)if(c.shape[v]!==o[v])throw new Error("gl-surface: coords have incorrect shape");this.padField(this._field[a],c)}}else if(t.ticks){var u=t.ticks;if(!Array.isArray(u)||2!==u.length)throw new Error("gl-surface: invalid ticks");for(a=0;a<2;++a){var f=u[a];if((Array.isArray(f)||f.length)&&(f=h(f)),f.shape[0]!==o[a])throw new Error("gl-surface: invalid tick length");var p=h(f.data,o);p.stride[a]=f.stride[0],p.stride[1^a]=0,this.padField(this._field[a],p)}}else{for(a=0;a<2;++a){var m=[0,0];m[a]=1,this._field[a]=h(this._field[a].data,[o[0]+2,o[1]+2],m,0)}this._field[0].set(0,0,0);for(var v=0;v0){for(var yt=0;yt<5;++yt)K.pop();U-=1}continue t}K.push(nt[0],nt[1],at[0],at[1],nt[2]),U+=1}}rt.push(U)}this._contourOffsets[Q]=et,this._contourCounts[Q]=rt}var xt=s.mallocFloat(K.length);for(a=0;as||a[1]<0||a[1]>s)throw new Error("gl-texture2d: Invalid texture size");var l=p(a,e.stride.slice()),c=0;"float32"===r?c=t.FLOAT:"float64"===r?(c=t.FLOAT,l=!1,r="float32"):"uint8"===r?c=t.UNSIGNED_BYTE:(c=t.UNSIGNED_BYTE,l=!1,r="uint8");var h,f,g=0;if(2===a.length)g=t.LUMINANCE,a=[a[0],a[1],1],e=n(e.data,a,[e.stride[0],e.stride[1],1],e.offset);else{if(3!==a.length)throw new Error("gl-texture2d: Invalid shape for texture");if(1===a[2])g=t.ALPHA;else if(2===a[2])g=t.LUMINANCE_ALPHA;else if(3===a[2])g=t.RGB;else{if(4!==a[2])throw new Error("gl-texture2d: Invalid shape for pixel coords");g=t.RGBA}}c!==t.FLOAT||t.getExtension("OES_texture_float")||(c=t.UNSIGNED_BYTE,l=!1);var v=e.size;if(l)h=0===e.offset&&e.data.length===v?e.data:e.data.subarray(e.offset,e.offset+v);else{var b=[a[2],a[2]*a[0],1];f=o.malloc(v,r);var y=n(f,a,b,0);"float32"!==r&&"float64"!==r||c!==t.UNSIGNED_BYTE?i.assign(y,e):u(y,e),h=f.subarray(0,v)}var x=m(t);return t.texImage2D(t.TEXTURE_2D,0,g,a[0],a[1],0,g,c,h),l||o.free(f),new d(t,x,a[0],a[1],g,c)}(t,e)}throw new Error("gl-texture2d: Invalid arguments for texture2d constructor")};var a=null,s=null,l=null;function c(t){return"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!=typeof HTMLVideoElement&&t instanceof HTMLVideoElement||"undefined"!=typeof ImageData&&t instanceof ImageData}var u=function(t,e){i.muls(t,e,255)};function h(t,e,r){var n=t.gl,i=n.getParameter(n.MAX_TEXTURE_SIZE);if(e<0||e>i||r<0||r>i)throw new Error("gl-texture2d: Invalid texture size");return t._shape=[e,r],t.bind(),n.texImage2D(n.TEXTURE_2D,0,t.format,e,r,0,t.format,t.type,null),t._mipLevels=[0],t}function d(t,e,r,n,i,o){this.gl=t,this.handle=e,this.format=i,this.type=o,this._shape=[r,n],this._mipLevels=[0],this._magFilter=t.NEAREST,this._minFilter=t.NEAREST,this._wrapS=t.CLAMP_TO_EDGE,this._wrapT=t.CLAMP_TO_EDGE,this._anisoSamples=1;var a=this,s=[this._wrapS,this._wrapT];Object.defineProperties(s,[{get:function(){return a._wrapS},set:function(t){return a.wrapS=t}},{get:function(){return a._wrapT},set:function(t){return a.wrapT=t}}]),this._wrapVector=s;var l=[this._shape[0],this._shape[1]];Object.defineProperties(l,[{get:function(){return a._shape[0]},set:function(t){return a.width=t}},{get:function(){return a._shape[1]},set:function(t){return a.height=t}}]),this._shapeVector=l}var f=d.prototype;function p(t,e){return 3===t.length?1===e[2]&&e[1]===t[0]*t[2]&&e[0]===t[2]:1===e[0]&&e[1]===t[0]}function m(t){var e=t.createTexture();return t.bindTexture(t.TEXTURE_2D,e),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),e}function g(t,e,r,n,i){var o=t.getParameter(t.MAX_TEXTURE_SIZE);if(e<0||e>o||r<0||r>o)throw new Error("gl-texture2d: Invalid texture shape");if(i===t.FLOAT&&!t.getExtension("OES_texture_float"))throw new Error("gl-texture2d: Floating point textures not supported on this platform");var a=m(t);return t.texImage2D(t.TEXTURE_2D,0,n,e,r,0,n,i,null),new d(t,a,e,r,n,i)}Object.defineProperties(f,{minFilter:{get:function(){return this._minFilter},set:function(t){this.bind();var e=this.gl;if(this.type===e.FLOAT&&a.indexOf(t)>=0&&(e.getExtension("OES_texture_float_linear")||(t=e.NEAREST)),s.indexOf(t)<0)throw new Error("gl-texture2d: Unknown filter mode "+t);return e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,t),this._minFilter=t}},magFilter:{get:function(){return this._magFilter},set:function(t){this.bind();var e=this.gl;if(this.type===e.FLOAT&&a.indexOf(t)>=0&&(e.getExtension("OES_texture_float_linear")||(t=e.NEAREST)),s.indexOf(t)<0)throw new Error("gl-texture2d: Unknown filter mode "+t);return e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,t),this._magFilter=t}},mipSamples:{get:function(){return this._anisoSamples},set:function(t){var e=this._anisoSamples;if(this._anisoSamples=0|Math.max(t,1),e!==this._anisoSamples){var r=this.gl.getExtension("EXT_texture_filter_anisotropic");r&&this.gl.texParameterf(this.gl.TEXTURE_2D,r.TEXTURE_MAX_ANISOTROPY_EXT,this._anisoSamples)}return this._anisoSamples}},wrapS:{get:function(){return this._wrapS},set:function(t){if(this.bind(),l.indexOf(t)<0)throw new Error("gl-texture2d: Unknown wrap mode "+t);return this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_S,t),this._wrapS=t}},wrapT:{get:function(){return this._wrapT},set:function(t){if(this.bind(),l.indexOf(t)<0)throw new Error("gl-texture2d: Unknown wrap mode "+t);return this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_T,t),this._wrapT=t}},wrap:{get:function(){return this._wrapVector},set:function(t){if(Array.isArray(t)||(t=[t,t]),2!==t.length)throw new Error("gl-texture2d: Must specify wrap mode for rows and columns");for(var e=0;e<2;++e)if(l.indexOf(t[e])<0)throw new Error("gl-texture2d: Unknown wrap mode "+t);this._wrapS=t[0],this._wrapT=t[1];var r=this.gl;return this.bind(),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,this._wrapS),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,this._wrapT),t}},shape:{get:function(){return this._shapeVector},set:function(t){if(Array.isArray(t)){if(2!==t.length)throw new Error("gl-texture2d: Invalid texture shape")}else t=[0|t,0|t];return h(this,0|t[0],0|t[1]),[0|t[0],0|t[1]]}},width:{get:function(){return this._shape[0]},set:function(t){return h(this,t|=0,this._shape[1]),t}},height:{get:function(){return this._shape[1]},set:function(t){return t|=0,h(this,this._shape[0],t),t}}}),f.bind=function(t){var e=this.gl;return void 0!==t&&e.activeTexture(e.TEXTURE0+(0|t)),e.bindTexture(e.TEXTURE_2D,this.handle),void 0!==t?0|t:e.getParameter(e.ACTIVE_TEXTURE)-e.TEXTURE0},f.dispose=function(){this.gl.deleteTexture(this.handle)},f.generateMipmap=function(){this.bind(),this.gl.generateMipmap(this.gl.TEXTURE_2D);for(var t=Math.min(this._shape[0],this._shape[1]),e=0;t>0;++e,t>>>=1)this._mipLevels.indexOf(e)<0&&this._mipLevels.push(e)},f.setPixels=function(t,e,r,a){var s=this.gl;this.bind(),Array.isArray(e)?(a=r,r=0|e[1],e=0|e[0]):(e=e||0,r=r||0),a=a||0;var l=c(t)?t:t.raw;if(l)this._mipLevels.indexOf(a)<0?(s.texImage2D(s.TEXTURE_2D,0,this.format,this.format,this.type,l),this._mipLevels.push(a)):s.texSubImage2D(s.TEXTURE_2D,a,e,r,this.format,this.type,l);else{if(!(t.shape&&t.stride&&t.data))throw new Error("gl-texture2d: Unsupported data type");if(t.shape.length<2||e+t.shape[1]>this._shape[1]>>>a||r+t.shape[0]>this._shape[0]>>>a||e<0||r<0)throw new Error("gl-texture2d: Texture dimensions are out of bounds");!function(t,e,r,a,s,l,c,h){var d=h.dtype,f=h.shape.slice();if(f.length<2||f.length>3)throw new Error("gl-texture2d: Invalid ndarray, must be 2d or 3d");var m=0,g=0,v=p(f,h.stride.slice());if("float32"===d?m=t.FLOAT:"float64"===d?(m=t.FLOAT,v=!1,d="float32"):"uint8"===d?m=t.UNSIGNED_BYTE:(m=t.UNSIGNED_BYTE,v=!1,d="uint8"),2===f.length)g=t.LUMINANCE,f=[f[0],f[1],1],h=n(h.data,f,[h.stride[0],h.stride[1],1],h.offset);else{if(3!==f.length)throw new Error("gl-texture2d: Invalid shape for texture");if(1===f[2])g=t.ALPHA;else if(2===f[2])g=t.LUMINANCE_ALPHA;else if(3===f[2])g=t.RGB;else{if(4!==f[2])throw new Error("gl-texture2d: Invalid shape for pixel coords");g=t.RGBA}f[2]}if(g!==t.LUMINANCE&&g!==t.ALPHA||s!==t.LUMINANCE&&s!==t.ALPHA||(g=s),g!==s)throw new Error("gl-texture2d: Incompatible texture format for setPixels");var b=h.size,y=c.indexOf(a)<0;if(y&&c.push(a),m===l&&v)0===h.offset&&h.data.length===b?y?t.texImage2D(t.TEXTURE_2D,a,s,f[0],f[1],0,s,l,h.data):t.texSubImage2D(t.TEXTURE_2D,a,e,r,f[0],f[1],s,l,h.data):y?t.texImage2D(t.TEXTURE_2D,a,s,f[0],f[1],0,s,l,h.data.subarray(h.offset,h.offset+b)):t.texSubImage2D(t.TEXTURE_2D,a,e,r,f[0],f[1],s,l,h.data.subarray(h.offset,h.offset+b));else{var x;x=l===t.FLOAT?o.mallocFloat32(b):o.mallocUint8(b);var _=n(x,f,[f[2],f[2]*f[0],1]);m===t.FLOAT&&l===t.UNSIGNED_BYTE?u(_,h):i.assign(_,h),y?t.texImage2D(t.TEXTURE_2D,a,s,f[0],f[1],0,s,l,x.subarray(0,b)):t.texSubImage2D(t.TEXTURE_2D,a,e,r,f[0],f[1],s,l,x.subarray(0,b)),l===t.FLOAT?o.freeFloat32(x):o.freeUint8(x)}}(s,e,r,a,this.format,this.type,this._mipLevels,t)}}},1433:function(t){"use strict";t.exports=function(t,e,r){e?e.bind():t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,null);var n=0|t.getParameter(t.MAX_VERTEX_ATTRIBS);if(r){if(r.length>n)throw new Error("gl-vao: Too many vertex attributes");for(var i=0;i1?0:Math.acos(s)};var n=r(2825),i=r(3536),o=r(244)},9226:function(t){t.exports=function(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t}},3126:function(t){t.exports=function(t){var e=new Float32Array(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}},3990:function(t){t.exports=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}},1091:function(t){t.exports=function(){var t=new Float32Array(3);return t[0]=0,t[1]=0,t[2]=0,t}},5911:function(t){t.exports=function(t,e,r){var n=e[0],i=e[1],o=e[2],a=r[0],s=r[1],l=r[2];return t[0]=i*l-o*s,t[1]=o*a-n*l,t[2]=n*s-i*a,t}},5455:function(t,e,r){t.exports=r(7056)},7056:function(t){t.exports=function(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2];return Math.sqrt(r*r+n*n+i*i)}},4008:function(t,e,r){t.exports=r(6690)},6690:function(t){t.exports=function(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t[2]=e[2]/r[2],t}},244:function(t){t.exports=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}},2613:function(t){t.exports=1e-6},9922:function(t,e,r){t.exports=function(t,e){var r=t[0],i=t[1],o=t[2],a=e[0],s=e[1],l=e[2];return Math.abs(r-a)<=n*Math.max(1,Math.abs(r),Math.abs(a))&&Math.abs(i-s)<=n*Math.max(1,Math.abs(i),Math.abs(s))&&Math.abs(o-l)<=n*Math.max(1,Math.abs(o),Math.abs(l))};var n=r(2613)},9265:function(t){t.exports=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]}},2681:function(t){t.exports=function(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t}},5137:function(t,e,r){t.exports=function(t,e,r,i,o,a){var s,l;for(e||(e=3),r||(r=0),l=i?Math.min(i*e+r,t.length):t.length,s=r;s0&&(o=1/Math.sqrt(o),t[0]=e[0]*o,t[1]=e[1]*o,t[2]=e[2]*o),t}},7636:function(t){t.exports=function(t,e){e=e||1;var r=2*Math.random()*Math.PI,n=2*Math.random()-1,i=Math.sqrt(1-n*n)*e;return t[0]=Math.cos(r)*i,t[1]=Math.sin(r)*i,t[2]=n*e,t}},6894:function(t){t.exports=function(t,e,r,n){var i=r[1],o=r[2],a=e[1]-i,s=e[2]-o,l=Math.sin(n),c=Math.cos(n);return t[0]=e[0],t[1]=i+a*c-s*l,t[2]=o+a*l+s*c,t}},109:function(t){t.exports=function(t,e,r,n){var i=r[0],o=r[2],a=e[0]-i,s=e[2]-o,l=Math.sin(n),c=Math.cos(n);return t[0]=i+s*l+a*c,t[1]=e[1],t[2]=o+s*c-a*l,t}},8692:function(t){t.exports=function(t,e,r,n){var i=r[0],o=r[1],a=e[0]-i,s=e[1]-o,l=Math.sin(n),c=Math.cos(n);return t[0]=i+a*c-s*l,t[1]=o+a*l+s*c,t[2]=e[2],t}},2447:function(t){t.exports=function(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t[2]=Math.round(e[2]),t}},6621:function(t){t.exports=function(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t}},8489:function(t){t.exports=function(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t}},1463:function(t){t.exports=function(t,e,r,n){return t[0]=e,t[1]=r,t[2]=n,t}},6141:function(t,e,r){t.exports=r(2953)},5486:function(t,e,r){t.exports=r(3066)},2953:function(t){t.exports=function(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2];return r*r+n*n+i*i}},3066:function(t){t.exports=function(t){var e=t[0],r=t[1],n=t[2];return e*e+r*r+n*n}},2229:function(t,e,r){t.exports=r(6843)},6843:function(t){t.exports=function(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t}},492:function(t){t.exports=function(t,e,r){var n=e[0],i=e[1],o=e[2];return t[0]=n*r[0]+i*r[3]+o*r[6],t[1]=n*r[1]+i*r[4]+o*r[7],t[2]=n*r[2]+i*r[5]+o*r[8],t}},5673:function(t){t.exports=function(t,e,r){var n=e[0],i=e[1],o=e[2],a=r[3]*n+r[7]*i+r[11]*o+r[15];return a=a||1,t[0]=(r[0]*n+r[4]*i+r[8]*o+r[12])/a,t[1]=(r[1]*n+r[5]*i+r[9]*o+r[13])/a,t[2]=(r[2]*n+r[6]*i+r[10]*o+r[14])/a,t}},264:function(t){t.exports=function(t,e,r){var n=e[0],i=e[1],o=e[2],a=r[0],s=r[1],l=r[2],c=r[3],u=c*n+s*o-l*i,h=c*i+l*n-a*o,d=c*o+a*i-s*n,f=-a*n-s*i-l*o;return t[0]=u*c+f*-a+h*-l-d*-s,t[1]=h*c+f*-s+d*-a-u*-l,t[2]=d*c+f*-l+u*-s-h*-a,t}},4361:function(t){t.exports=function(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t}},2335:function(t){t.exports=function(t){var e=new Float32Array(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}},2933:function(t){t.exports=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}},7536:function(t){t.exports=function(){var t=new Float32Array(4);return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t}},4691:function(t){t.exports=function(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2],o=e[3]-t[3];return Math.sqrt(r*r+n*n+i*i+o*o)}},1373:function(t){t.exports=function(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t[2]=e[2]/r[2],t[3]=e[3]/r[3],t}},3750:function(t){t.exports=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}},3390:function(t){t.exports=function(t,e,r,n){var i=new Float32Array(4);return i[0]=t,i[1]=e,i[2]=r,i[3]=n,i}},9970:function(t,e,r){t.exports={create:r(7536),clone:r(2335),fromValues:r(3390),copy:r(2933),set:r(4578),add:r(4361),subtract:r(6860),multiply:r(3576),divide:r(1373),min:r(2334),max:r(160),scale:r(9288),scaleAndAdd:r(4844),distance:r(4691),squaredDistance:r(7960),length:r(6808),squaredLength:r(483),negate:r(1498),inverse:r(4494),normalize:r(5177),dot:r(3750),lerp:r(2573),random:r(9131),transformMat4:r(5352),transformQuat:r(4041)}},4494:function(t){t.exports=function(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t[3]=1/e[3],t}},6808:function(t){t.exports=function(t){var e=t[0],r=t[1],n=t[2],i=t[3];return Math.sqrt(e*e+r*r+n*n+i*i)}},2573:function(t){t.exports=function(t,e,r,n){var i=e[0],o=e[1],a=e[2],s=e[3];return t[0]=i+n*(r[0]-i),t[1]=o+n*(r[1]-o),t[2]=a+n*(r[2]-a),t[3]=s+n*(r[3]-s),t}},160:function(t){t.exports=function(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t[2]=Math.max(e[2],r[2]),t[3]=Math.max(e[3],r[3]),t}},2334:function(t){t.exports=function(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t[2]=Math.min(e[2],r[2]),t[3]=Math.min(e[3],r[3]),t}},3576:function(t){t.exports=function(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t[2]=e[2]*r[2],t[3]=e[3]*r[3],t}},1498:function(t){t.exports=function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t}},5177:function(t){t.exports=function(t,e){var r=e[0],n=e[1],i=e[2],o=e[3],a=r*r+n*n+i*i+o*o;return a>0&&(a=1/Math.sqrt(a),t[0]=r*a,t[1]=n*a,t[2]=i*a,t[3]=o*a),t}},9131:function(t,e,r){var n=r(5177),i=r(9288);t.exports=function(t,e){return e=e||1,t[0]=Math.random(),t[1]=Math.random(),t[2]=Math.random(),t[3]=Math.random(),n(t,t),i(t,t,e),t}},9288:function(t){t.exports=function(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t}},4844:function(t){t.exports=function(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t}},4578:function(t){t.exports=function(t,e,r,n,i){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t}},7960:function(t){t.exports=function(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2],o=e[3]-t[3];return r*r+n*n+i*i+o*o}},483:function(t){t.exports=function(t){var e=t[0],r=t[1],n=t[2],i=t[3];return e*e+r*r+n*n+i*i}},6860:function(t){t.exports=function(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t}},5352:function(t){t.exports=function(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3];return t[0]=r[0]*n+r[4]*i+r[8]*o+r[12]*a,t[1]=r[1]*n+r[5]*i+r[9]*o+r[13]*a,t[2]=r[2]*n+r[6]*i+r[10]*o+r[14]*a,t[3]=r[3]*n+r[7]*i+r[11]*o+r[15]*a,t}},4041:function(t){t.exports=function(t,e,r){var n=e[0],i=e[1],o=e[2],a=r[0],s=r[1],l=r[2],c=r[3],u=c*n+s*o-l*i,h=c*i+l*n-a*o,d=c*o+a*i-s*n,f=-a*n-s*i-l*o;return t[0]=u*c+f*-a+h*-l-d*-s,t[1]=h*c+f*-s+d*-a-u*-l,t[2]=d*c+f*-l+u*-s-h*-a,t[3]=e[3],t}},1848:function(t,e,r){var n=r(4905),i=r(6468);t.exports=function(t){for(var e=Array.isArray(t)?t:n(t),r=0;r0)continue;r=t.slice(0,1).join("")}return N(r),z+=r.length,(S=S.slice(r.length)).length}}function q(){return/[^a-fA-F0-9]/.test(e)?(N(S.join("")),T=l,A):(S.push(e),r=e,A+1)}function Y(){return"."===e||/[eE]/.test(e)?(S.push(e),T=m,r=e,A+1):"x"===e&&1===S.length&&"0"===S[0]?(T=_,S.push(e),r=e,A+1):/[^\d]/.test(e)?(N(S.join("")),T=l,A):(S.push(e),r=e,A+1)}function Z(){return"f"===e&&(S.push(e),r=e,A+=1),/[eE]/.test(e)?(S.push(e),r=e,A+1):("-"!==e&&"+"!==e||!/[eE]/.test(r))&&/[^\d]/.test(e)?(N(S.join("")),T=l,A):(S.push(e),r=e,A+1)}function X(){if(/[^\d\w_]/.test(e)){var t=S.join("");return T=j[t]?b:P[t]?v:g,N(S.join("")),T=l,A}return S.push(e),r=e,A+1}};var n=r(620),i=r(7827),o=r(6852),a=r(7932),s=r(3508),l=999,c=9999,u=0,h=1,d=2,f=3,p=4,m=5,g=6,v=7,b=8,y=9,x=10,_=11,w=["block-comment","line-comment","preprocessor","operator","integer","float","ident","builtin","keyword","whitespace","eof","integer"]},3508:function(t,e,r){var n=r(6852);n=n.slice().filter((function(t){return!/^(gl\_|texture)/.test(t)})),t.exports=n.concat(["gl_VertexID","gl_InstanceID","gl_Position","gl_PointSize","gl_FragCoord","gl_FrontFacing","gl_FragDepth","gl_PointCoord","gl_MaxVertexAttribs","gl_MaxVertexUniformVectors","gl_MaxVertexOutputVectors","gl_MaxFragmentInputVectors","gl_MaxVertexTextureImageUnits","gl_MaxCombinedTextureImageUnits","gl_MaxTextureImageUnits","gl_MaxFragmentUniformVectors","gl_MaxDrawBuffers","gl_MinProgramTexelOffset","gl_MaxProgramTexelOffset","gl_DepthRangeParameters","gl_DepthRange","trunc","round","roundEven","isnan","isinf","floatBitsToInt","floatBitsToUint","intBitsToFloat","uintBitsToFloat","packSnorm2x16","unpackSnorm2x16","packUnorm2x16","unpackUnorm2x16","packHalf2x16","unpackHalf2x16","outerProduct","transpose","determinant","inverse","texture","textureSize","textureProj","textureLod","textureOffset","texelFetch","texelFetchOffset","textureProjOffset","textureLodOffset","textureProjLod","textureProjLodOffset","textureGrad","textureGradOffset","textureProjGrad","textureProjGradOffset"])},6852:function(t){t.exports=["abs","acos","all","any","asin","atan","ceil","clamp","cos","cross","dFdx","dFdy","degrees","distance","dot","equal","exp","exp2","faceforward","floor","fract","gl_BackColor","gl_BackLightModelProduct","gl_BackLightProduct","gl_BackMaterial","gl_BackSecondaryColor","gl_ClipPlane","gl_ClipVertex","gl_Color","gl_DepthRange","gl_DepthRangeParameters","gl_EyePlaneQ","gl_EyePlaneR","gl_EyePlaneS","gl_EyePlaneT","gl_Fog","gl_FogCoord","gl_FogFragCoord","gl_FogParameters","gl_FragColor","gl_FragCoord","gl_FragData","gl_FragDepth","gl_FragDepthEXT","gl_FrontColor","gl_FrontFacing","gl_FrontLightModelProduct","gl_FrontLightProduct","gl_FrontMaterial","gl_FrontSecondaryColor","gl_LightModel","gl_LightModelParameters","gl_LightModelProducts","gl_LightProducts","gl_LightSource","gl_LightSourceParameters","gl_MaterialParameters","gl_MaxClipPlanes","gl_MaxCombinedTextureImageUnits","gl_MaxDrawBuffers","gl_MaxFragmentUniformComponents","gl_MaxLights","gl_MaxTextureCoords","gl_MaxTextureImageUnits","gl_MaxTextureUnits","gl_MaxVaryingFloats","gl_MaxVertexAttribs","gl_MaxVertexTextureImageUnits","gl_MaxVertexUniformComponents","gl_ModelViewMatrix","gl_ModelViewMatrixInverse","gl_ModelViewMatrixInverseTranspose","gl_ModelViewMatrixTranspose","gl_ModelViewProjectionMatrix","gl_ModelViewProjectionMatrixInverse","gl_ModelViewProjectionMatrixInverseTranspose","gl_ModelViewProjectionMatrixTranspose","gl_MultiTexCoord0","gl_MultiTexCoord1","gl_MultiTexCoord2","gl_MultiTexCoord3","gl_MultiTexCoord4","gl_MultiTexCoord5","gl_MultiTexCoord6","gl_MultiTexCoord7","gl_Normal","gl_NormalMatrix","gl_NormalScale","gl_ObjectPlaneQ","gl_ObjectPlaneR","gl_ObjectPlaneS","gl_ObjectPlaneT","gl_Point","gl_PointCoord","gl_PointParameters","gl_PointSize","gl_Position","gl_ProjectionMatrix","gl_ProjectionMatrixInverse","gl_ProjectionMatrixInverseTranspose","gl_ProjectionMatrixTranspose","gl_SecondaryColor","gl_TexCoord","gl_TextureEnvColor","gl_TextureMatrix","gl_TextureMatrixInverse","gl_TextureMatrixInverseTranspose","gl_TextureMatrixTranspose","gl_Vertex","greaterThan","greaterThanEqual","inversesqrt","length","lessThan","lessThanEqual","log","log2","matrixCompMult","max","min","mix","mod","normalize","not","notEqual","pow","radians","reflect","refract","sign","sin","smoothstep","sqrt","step","tan","texture2D","texture2DLod","texture2DProj","texture2DProjLod","textureCube","textureCubeLod","texture2DLodEXT","texture2DProjLodEXT","textureCubeLodEXT","texture2DGradEXT","texture2DProjGradEXT","textureCubeGradEXT"]},7932:function(t,e,r){var n=r(620);t.exports=n.slice().concat(["layout","centroid","smooth","case","mat2x2","mat2x3","mat2x4","mat3x2","mat3x3","mat3x4","mat4x2","mat4x3","mat4x4","uvec2","uvec3","uvec4","samplerCubeShadow","sampler2DArray","sampler2DArrayShadow","isampler2D","isampler3D","isamplerCube","isampler2DArray","usampler2D","usampler3D","usamplerCube","usampler2DArray","coherent","restrict","readonly","writeonly","resource","atomic_uint","noperspective","patch","sample","subroutine","common","partition","active","filter","image1D","image2D","image3D","imageCube","iimage1D","iimage2D","iimage3D","iimageCube","uimage1D","uimage2D","uimage3D","uimageCube","image1DArray","image2DArray","iimage1DArray","iimage2DArray","uimage1DArray","uimage2DArray","image1DShadow","image2DShadow","image1DArrayShadow","image2DArrayShadow","imageBuffer","iimageBuffer","uimageBuffer","sampler1DArray","sampler1DArrayShadow","isampler1D","isampler1DArray","usampler1D","usampler1DArray","isampler2DRect","usampler2DRect","samplerBuffer","isamplerBuffer","usamplerBuffer","sampler2DMS","isampler2DMS","usampler2DMS","sampler2DMSArray","isampler2DMSArray","usampler2DMSArray"])},620:function(t){t.exports=["precision","highp","mediump","lowp","attribute","const","uniform","varying","break","continue","do","for","while","if","else","in","out","inout","float","int","uint","void","bool","true","false","discard","return","mat2","mat3","mat4","vec2","vec3","vec4","ivec2","ivec3","ivec4","bvec2","bvec3","bvec4","sampler1D","sampler2D","sampler3D","samplerCube","sampler1DShadow","sampler2DShadow","struct","asm","class","union","enum","typedef","template","this","packed","goto","switch","default","inline","noinline","volatile","public","static","extern","external","interface","long","short","double","half","fixed","unsigned","input","output","hvec2","hvec3","hvec4","dvec2","dvec3","dvec4","fvec2","fvec3","fvec4","sampler2DRect","sampler3DRect","sampler2DRectShadow","sizeof","cast","namespace","using"]},7827:function(t){t.exports=["<<=",">>=","++","--","<<",">>","<=",">=","==","!=","&&","||","+=","-=","*=","/=","%=","&=","^^","^=","|=","(",")","[","]",".","!","~","*","/","%","+","-","<",">","&","^","|","?",":","=",",",";","{","}"]},4905:function(t,e,r){var n=r(5874);t.exports=function(t,e){var r=n(e),i=[];return(i=i.concat(r(t))).concat(r(null))}},3236:function(t){t.exports=function(t){"string"==typeof t&&(t=[t]);for(var e=[].slice.call(arguments,1),r=[],n=0;n>1,u=-7,h=r?i-1:0,d=r?-1:1,f=t[e+h];for(h+=d,o=f&(1<<-u)-1,f>>=-u,u+=s;u>0;o=256*o+t[e+h],h+=d,u-=8);for(a=o&(1<<-u)-1,o>>=-u,u+=n;u>0;a=256*a+t[e+h],h+=d,u-=8);if(0===o)o=1-c;else{if(o===l)return a?NaN:1/0*(f?-1:1);a+=Math.pow(2,n),o-=c}return(f?-1:1)*a*Math.pow(2,o-n)},e.write=function(t,e,r,n,i,o){var a,s,l,c=8*o-i-1,u=(1<>1,d=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,f=n?0:o-1,p=n?1:-1,m=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,a=u):(a=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-a))<1&&(a--,l*=2),(e+=a+h>=1?d/l:d*Math.pow(2,1-h))*l>=2&&(a++,l/=2),a+h>=u?(s=0,a=u):a+h>=1?(s=(e*l-1)*Math.pow(2,i),a+=h):(s=e*Math.pow(2,h-1)*Math.pow(2,i),a=0));i>=8;t[r+f]=255&s,f+=p,s/=256,i-=8);for(a=a<0;t[r+f]=255&a,f+=p,a/=256,c-=8);t[r+f-p]|=128*m}},8954:function(t,e,r){"use strict";t.exports=function(t,e){var r=t.length;if(0===r)throw new Error("Must have at least d+1 points");var i=t[0].length;if(r<=i)throw new Error("Must input at least d+1 points");var a=t.slice(0,i+1),s=n.apply(void 0,a);if(0===s)throw new Error("Input not in general position");for(var l=new Array(i+1),u=0;u<=i;++u)l[u]=u;s<0&&(l[0]=1,l[1]=0);var h=new o(l,new Array(i+1),!1),d=h.adjacent,f=new Array(i+2);for(u=0;u<=i;++u){for(var p=l.slice(),m=0;m<=i;++m)m===u&&(p[m]=-1);var g=p[0];p[0]=p[1],p[1]=g;var v=new o(p,new Array(i+1),!0);d[u]=v,f[u]=v}for(f[i+1]=h,u=0;u<=i;++u){p=d[u].vertices;var b=d[u].adjacent;for(m=0;m<=i;++m){var y=p[m];if(y<0)b[m]=h;else for(var x=0;x<=i;++x)d[x].vertices.indexOf(y)<0&&(b[m]=d[x])}}var _=new c(i,a,f),w=!!e;for(u=i+1;u0;)for(var s=(t=a.pop()).adjacent,l=0;l<=r;++l){var c=s[l];if(c.boundary&&!(c.lastVisited<=-n)){for(var u=c.vertices,h=0;h<=r;++h){var d=u[h];i[h]=d<0?e:o[d]}var f=this.orient();if(f>0)return c;c.lastVisited=-n,0===f&&a.push(c)}}return null},u.walk=function(t,e){var r=this.vertices.length-1,n=this.dimension,i=this.vertices,o=this.tuple,a=e?this.interior.length*Math.random()|0:this.interior.length-1,s=this.interior[a];t:for(;!s.boundary;){for(var l=s.vertices,c=s.adjacent,u=0;u<=n;++u)o[u]=i[l[u]];for(s.lastVisited=r,u=0;u<=n;++u){var h=c[u];if(!(h.lastVisited>=r)){var d=o[u];o[u]=t;var f=this.orient();if(o[u]=d,f<0){s=h;continue t}h.boundary?h.lastVisited=-r:h.lastVisited=r}}return}return s},u.addPeaks=function(t,e){var r=this.vertices.length-1,n=this.dimension,i=this.vertices,l=this.tuple,c=this.interior,u=this.simplices,h=[e];e.lastVisited=r,e.vertices[e.vertices.indexOf(-1)]=r,e.boundary=!1,c.push(e);for(var d=[];h.length>0;){var f=(e=h.pop()).vertices,p=e.adjacent,m=f.indexOf(r);if(!(m<0))for(var g=0;g<=n;++g)if(g!==m){var v=p[g];if(v.boundary&&!(v.lastVisited>=r)){var b=v.vertices;if(v.lastVisited!==-r){for(var y=0,x=0;x<=n;++x)b[x]<0?(y=x,l[x]=t):l[x]=i[b[x]];if(this.orient()>0){b[y]=r,v.boundary=!1,c.push(v),h.push(v),v.lastVisited=r;continue}v.lastVisited=-r}var _=v.adjacent,w=f.slice(),k=p.slice(),A=new o(w,k,!0);u.push(A);var M=_.indexOf(e);if(!(M<0))for(_[M]=A,k[m]=v,w[g]=-1,k[g]=e,p[g]=A,A.flip(),x=0;x<=n;++x){var T=w[x];if(!(T<0||T===r)){for(var S=new Array(n-1),C=0,E=0;E<=n;++E){var L=w[E];L<0||E===x||(S[C++]=L)}d.push(new a(S,A,x))}}}}}for(d.sort(s),g=0;g+1=0?a[l++]=s[u]:c=1&u;if(c===(1&t)){var h=a[0];a[0]=a[1],a[1]=h}e.push(a)}}return e}},3352:function(t,e,r){"use strict";var n=r(2478);function i(t,e,r,n,i){this.mid=t,this.left=e,this.right=r,this.leftPoints=n,this.rightPoints=i,this.count=(e?e.count:0)+(r?r.count:0)+n.length}t.exports=function(t){return t&&0!==t.length?new v(g(t)):new v(null)};var o=i.prototype;function a(t,e){t.mid=e.mid,t.left=e.left,t.right=e.right,t.leftPoints=e.leftPoints,t.rightPoints=e.rightPoints,t.count=e.count}function s(t,e){var r=g(e);t.mid=r.mid,t.left=r.left,t.right=r.right,t.leftPoints=r.leftPoints,t.rightPoints=r.rightPoints,t.count=r.count}function l(t,e){var r=t.intervals([]);r.push(e),s(t,r)}function c(t,e){var r=t.intervals([]),n=r.indexOf(e);return n<0?0:(r.splice(n,1),s(t,r),1)}function u(t,e,r){for(var n=0;n=0&&t[n][1]>=e;--n){var i=r(t[n]);if(i)return i}}function d(t,e){for(var r=0;r>1],o=[],a=[],s=[];for(r=0;r3*(e+1)?l(this,t):this.left.insert(t):this.left=g([t]);else if(t[0]>this.mid)this.right?4*(this.right.count+1)>3*(e+1)?l(this,t):this.right.insert(t):this.right=g([t]);else{var r=n.ge(this.leftPoints,t,p),i=n.ge(this.rightPoints,t,m);this.leftPoints.splice(r,0,t),this.rightPoints.splice(i,0,t)}},o.remove=function(t){var e=this.count-this.leftPoints;if(t[1]3*(e-1)?c(this,t):2===(s=this.left.remove(t))?(this.left=null,this.count-=1,1):(1===s&&(this.count-=1),s):0;if(t[0]>this.mid)return this.right?4*(this.left?this.left.count:0)>3*(e-1)?c(this,t):2===(s=this.right.remove(t))?(this.right=null,this.count-=1,1):(1===s&&(this.count-=1),s):0;if(1===this.count)return this.leftPoints[0]===t?2:0;if(1===this.leftPoints.length&&this.leftPoints[0]===t){if(this.left&&this.right){for(var r=this,i=this.left;i.right;)r=i,i=i.right;if(r===this)i.right=this.right;else{var o=this.left,s=this.right;r.count-=i.count,r.right=i.left,i.left=o,i.right=s}a(this,i),this.count=(this.left?this.left.count:0)+(this.right?this.right.count:0)+this.leftPoints.length}else this.left?a(this,this.left):a(this,this.right);return 1}for(o=n.ge(this.leftPoints,t,p);othis.mid?this.right&&(r=this.right.queryPoint(t,e))?r:h(this.rightPoints,t,e):d(this.leftPoints,e);var r},o.queryInterval=function(t,e,r){var n;return tthis.mid&&this.right&&(n=this.right.queryInterval(t,e,r))?n:ethis.mid?h(this.rightPoints,t,r):d(this.leftPoints,r)};var b=v.prototype;b.insert=function(t){this.root?this.root.insert(t):this.root=new i(t[0],null,null,[t],[t])},b.remove=function(t){if(this.root){var e=this.root.remove(t);return 2===e&&(this.root=null),0!==e}return!1},b.queryPoint=function(t,e){if(this.root)return this.root.queryPoint(t,e)},b.queryInterval=function(t,e,r){if(t<=e&&this.root)return this.root.queryInterval(t,e,r)},Object.defineProperty(b,"count",{get:function(){return this.root?this.root.count:0}}),Object.defineProperty(b,"intervals",{get:function(){return this.root?this.root.intervals([]):[]}})},7762:function(t){"use strict";t.exports=function(t){for(var e=new Array(t),r=0;r13)&&32!==e&&133!==e&&160!==e&&5760!==e&&6158!==e&&(e<8192||e>8205)&&8232!==e&&8233!==e&&8239!==e&&8287!==e&&8288!==e&&12288!==e&&65279!==e)return!1;return!0}},395:function(t){t.exports=function(t,e,r){return t*(1-r)+e*r}},2652:function(t,e,r){var n=r(4335),i=r(6864),o=r(1903),a=r(9921),s=r(7608),l=r(5665),c={length:r(1387),normalize:r(3536),dot:r(244),cross:r(5911)},u=i(),h=i(),d=[0,0,0,0],f=[[0,0,0],[0,0,0],[0,0,0]],p=[0,0,0];function m(t,e,r,n,i){t[0]=e[0]*n+r[0]*i,t[1]=e[1]*n+r[1]*i,t[2]=e[2]*n+r[2]*i}t.exports=function(t,e,r,i,g,v){if(e||(e=[0,0,0]),r||(r=[0,0,0]),i||(i=[0,0,0]),g||(g=[0,0,0,1]),v||(v=[0,0,0,1]),!n(u,t))return!1;if(o(h,u),h[3]=0,h[7]=0,h[11]=0,h[15]=1,Math.abs(a(h)<1e-8))return!1;var b,y,x,_,w,k,A,M=u[3],T=u[7],S=u[11],C=u[12],E=u[13],L=u[14],z=u[15];if(0!==M||0!==T||0!==S){if(d[0]=M,d[1]=T,d[2]=S,d[3]=z,!s(h,h))return!1;l(h,h),b=g,x=h,_=(y=d)[0],w=y[1],k=y[2],A=y[3],b[0]=x[0]*_+x[4]*w+x[8]*k+x[12]*A,b[1]=x[1]*_+x[5]*w+x[9]*k+x[13]*A,b[2]=x[2]*_+x[6]*w+x[10]*k+x[14]*A,b[3]=x[3]*_+x[7]*w+x[11]*k+x[15]*A}else g[0]=g[1]=g[2]=0,g[3]=1;if(e[0]=C,e[1]=E,e[2]=L,function(t,e){t[0][0]=e[0],t[0][1]=e[1],t[0][2]=e[2],t[1][0]=e[4],t[1][1]=e[5],t[1][2]=e[6],t[2][0]=e[8],t[2][1]=e[9],t[2][2]=e[10]}(f,u),r[0]=c.length(f[0]),c.normalize(f[0],f[0]),i[0]=c.dot(f[0],f[1]),m(f[1],f[1],f[0],1,-i[0]),r[1]=c.length(f[1]),c.normalize(f[1],f[1]),i[0]/=r[1],i[1]=c.dot(f[0],f[2]),m(f[2],f[2],f[0],1,-i[1]),i[2]=c.dot(f[1],f[2]),m(f[2],f[2],f[1],1,-i[2]),r[2]=c.length(f[2]),c.normalize(f[2],f[2]),i[1]/=r[2],i[2]/=r[2],c.cross(p,f[1],f[2]),c.dot(f[0],p)<0)for(var O=0;O<3;O++)r[O]*=-1,f[O][0]*=-1,f[O][1]*=-1,f[O][2]*=-1;return v[0]=.5*Math.sqrt(Math.max(1+f[0][0]-f[1][1]-f[2][2],0)),v[1]=.5*Math.sqrt(Math.max(1-f[0][0]+f[1][1]-f[2][2],0)),v[2]=.5*Math.sqrt(Math.max(1-f[0][0]-f[1][1]+f[2][2],0)),v[3]=.5*Math.sqrt(Math.max(1+f[0][0]+f[1][1]+f[2][2],0)),f[2][1]>f[1][2]&&(v[0]=-v[0]),f[0][2]>f[2][0]&&(v[1]=-v[1]),f[1][0]>f[0][1]&&(v[2]=-v[2]),!0}},4335:function(t){t.exports=function(t,e){var r=e[15];if(0===r)return!1;for(var n=1/r,i=0;i<16;i++)t[i]=e[i]*n;return!0}},7442:function(t,e,r){var n=r(6658),i=r(7182),o=r(2652),a=r(9921),s=r(8648),l=h(),c=h(),u=h();function h(){return{translate:d(),scale:d(1),skew:d(),perspective:[0,0,0,1],quaternion:[0,0,0,1]}}function d(t){return[t||0,t||0,t||0]}t.exports=function(t,e,r,h){if(0===a(e)||0===a(r))return!1;var d=o(e,l.translate,l.scale,l.skew,l.perspective,l.quaternion),f=o(r,c.translate,c.scale,c.skew,c.perspective,c.quaternion);return!(!d||!f||(n(u.translate,l.translate,c.translate,h),n(u.skew,l.skew,c.skew,h),n(u.scale,l.scale,c.scale,h),n(u.perspective,l.perspective,c.perspective,h),s(u.quaternion,l.quaternion,c.quaternion,h),i(t,u.translate,u.scale,u.skew,u.perspective,u.quaternion),0))}},7182:function(t,e,r){var n={identity:r(7894),translate:r(7656),multiply:r(6760),create:r(6864),scale:r(2504),fromRotationTranslation:r(6743)},i=(n.create(),n.create());t.exports=function(t,e,r,o,a,s){return n.identity(t),n.fromRotationTranslation(t,s,e),t[3]=a[0],t[7]=a[1],t[11]=a[2],t[15]=a[3],n.identity(i),0!==o[2]&&(i[9]=o[2],n.multiply(t,t,i)),0!==o[1]&&(i[9]=0,i[8]=o[1],n.multiply(t,t,i)),0!==o[0]&&(i[8]=0,i[4]=o[0],n.multiply(t,t,i)),n.scale(t,t,r),t}},4192:function(t,e,r){"use strict";var n=r(2478),i=r(7442),o=r(7608),a=r(5567),s=r(2408),l=r(7089),c=r(6582),u=r(7656),h=(r(2504),r(3536)),d=[0,0,0];function f(t){this._components=t.slice(),this._time=[0],this.prevMatrix=t.slice(),this.nextMatrix=t.slice(),this.computedMatrix=t.slice(),this.computedInverse=t.slice(),this.computedEye=[0,0,0],this.computedUp=[0,0,0],this.computedCenter=[0,0,0],this.computedRadius=[0],this._limits=[-1/0,1/0]}t.exports=function(t){return new f((t=t||{}).matrix||[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])};var p=f.prototype;p.recalcMatrix=function(t){var e=this._time,r=n.le(e,t),a=this.computedMatrix;if(!(r<0)){var s=this._components;if(r===e.length-1)for(var l=16*r,c=0;c<16;++c)a[c]=s[l++];else{var u=e[r+1]-e[r],d=(l=16*r,this.prevMatrix),f=!0;for(c=0;c<16;++c)d[c]=s[l++];var p=this.nextMatrix;for(c=0;c<16;++c)p[c]=s[l++],f=f&&d[c]===p[c];if(u<1e-6||f)for(c=0;c<16;++c)a[c]=d[c];else i(a,d,p,(t-e[r])/u)}var m=this.computedUp;m[0]=a[1],m[1]=a[5],m[2]=a[9],h(m,m);var g=this.computedInverse;o(g,a);var v=this.computedEye,b=g[15];v[0]=g[12]/b,v[1]=g[13]/b,v[2]=g[14]/b;var y=this.computedCenter,x=Math.exp(this.computedRadius[0]);for(c=0;c<3;++c)y[c]=v[c]-a[2+4*c]*x}},p.idle=function(t){if(!(t1&&n(t[a[u-2]],t[a[u-1]],c)<=0;)u-=1,a.pop();for(a.push(l),u=s.length;u>1&&n(t[s[u-2]],t[s[u-1]],c)>=0;)u-=1,s.pop();s.push(l)}r=new Array(s.length+a.length-2);for(var h=0,d=(i=0,a.length);i0;--f)r[h++]=s[f];return r};var n=r(3250)[3]},351:function(t,e,r){"use strict";t.exports=function(t,e){e||(e=t,t=window);var r=0,i=0,o=0,a={shift:!1,alt:!1,control:!1,meta:!1},s=!1;function l(t){var e=!1;return"altKey"in t&&(e=e||t.altKey!==a.alt,a.alt=!!t.altKey),"shiftKey"in t&&(e=e||t.shiftKey!==a.shift,a.shift=!!t.shiftKey),"ctrlKey"in t&&(e=e||t.ctrlKey!==a.control,a.control=!!t.ctrlKey),"metaKey"in t&&(e=e||t.metaKey!==a.meta,a.meta=!!t.metaKey),e}function c(t,s){var c=n.x(s),u=n.y(s);"buttons"in s&&(t=0|s.buttons),(t!==r||c!==i||u!==o||l(s))&&(r=0|t,i=c||0,o=u||0,e&&e(r,i,o,a))}function u(t){c(0,t)}function h(){(r||i||o||a.shift||a.alt||a.meta||a.control)&&(i=o=0,r=0,a.shift=a.alt=a.control=a.meta=!1,e&&e(0,0,0,a))}function d(t){l(t)&&e&&e(r,i,o,a)}function f(t){0===n.buttons(t)?c(0,t):c(r,t)}function p(t){c(r|n.buttons(t),t)}function m(t){c(r&~n.buttons(t),t)}function g(){s||(s=!0,t.addEventListener("mousemove",f),t.addEventListener("mousedown",p),t.addEventListener("mouseup",m),t.addEventListener("mouseleave",u),t.addEventListener("mouseenter",u),t.addEventListener("mouseout",u),t.addEventListener("mouseover",u),t.addEventListener("blur",h),t.addEventListener("keyup",d),t.addEventListener("keydown",d),t.addEventListener("keypress",d),t!==window&&(window.addEventListener("blur",h),window.addEventListener("keyup",d),window.addEventListener("keydown",d),window.addEventListener("keypress",d)))}g();var v={element:t};return Object.defineProperties(v,{enabled:{get:function(){return s},set:function(e){e?g():s&&(s=!1,t.removeEventListener("mousemove",f),t.removeEventListener("mousedown",p),t.removeEventListener("mouseup",m),t.removeEventListener("mouseleave",u),t.removeEventListener("mouseenter",u),t.removeEventListener("mouseout",u),t.removeEventListener("mouseover",u),t.removeEventListener("blur",h),t.removeEventListener("keyup",d),t.removeEventListener("keydown",d),t.removeEventListener("keypress",d),t!==window&&(window.removeEventListener("blur",h),window.removeEventListener("keyup",d),window.removeEventListener("keydown",d),window.removeEventListener("keypress",d)))},enumerable:!0},buttons:{get:function(){return r},enumerable:!0},x:{get:function(){return i},enumerable:!0},y:{get:function(){return o},enumerable:!0},mods:{get:function(){return a},enumerable:!0}}),v};var n=r(4687)},24:function(t){var e={left:0,top:0};t.exports=function(t,r,n){r=r||t.currentTarget||t.srcElement,Array.isArray(n)||(n=[0,0]);var i,o=t.clientX||0,a=t.clientY||0,s=(i=r)===window||i===document||i===document.body?e:i.getBoundingClientRect();return n[0]=o-s.left,n[1]=a-s.top,n}},4687:function(t,e){"use strict";function r(t){return t.target||t.srcElement||window}e.buttons=function(t){if("object"==typeof t){if("buttons"in t)return t.buttons;if("which"in t){if(2===(e=t.which))return 4;if(3===e)return 2;if(e>0)return 1<=0)return 1< 0"),"function"!=typeof t.vertex&&e("Must specify vertex creation function"),"function"!=typeof t.cell&&e("Must specify cell creation function"),"function"!=typeof t.phase&&e("Must specify phase function");for(var a=t.getters||[],s=new Array(o),l=0;l=0?s[l]=!0:s[l]=!1;return function(t,e,r,o,a,s){var l=[s,a].join(",");return(0,i[l])(t,e,r,n.mallocUint32,n.freeUint32)}(t.vertex,t.cell,t.phase,0,r,s)};var i={"false,0,1":function(t,e,r,n,i){return function(o,a,s,l){var c,u=0|o.shape[0],h=0|o.shape[1],d=o.data,f=0|o.offset,p=0|o.stride[0],m=0|o.stride[1],g=f,v=0|-p,b=0,y=0|-m,x=0,_=-p-m|0,w=0,k=0|p,A=m-p*u|0,M=0,T=0,S=0,C=2*u|0,E=n(C),L=n(C),z=0,O=0,D=-1,I=-1,F=0,R=0|-u,P=0|u,j=0,N=-u-1|0,B=u-1|0,U=0,G=0,V=0;for(M=0;M0){if(T=1,E[z++]=r(d[g],a,s,l),g+=k,u>0)for(M=1,c=d[g],O=E[z]=r(c,a,s,l),F=E[z+D],j=E[z+R],U=E[z+N],O===F&&O===j&&O===U||(b=d[g+v],x=d[g+y],w=d[g+_],t(M,T,c,b,x,w,O,F,j,U,a,s,l),G=L[z]=S++),z+=1,g+=k,M=2;M0)for(M=1,c=d[g],O=E[z]=r(c,a,s,l),F=E[z+D],j=E[z+R],U=E[z+N],O===F&&O===j&&O===U||(b=d[g+v],x=d[g+y],w=d[g+_],t(M,T,c,b,x,w,O,F,j,U,a,s,l),G=L[z]=S++,U!==j&&e(L[z+R],G,x,w,j,U,a,s,l)),z+=1,g+=k,M=2;M0){if(M=1,E[z++]=r(d[g],a,s,l),g+=k,h>0)for(T=1,c=d[g],O=E[z]=r(c,a,s,l),j=E[z+R],F=E[z+D],U=E[z+N],O===j&&O===F&&O===U||(b=d[g+v],x=d[g+y],w=d[g+_],t(M,T,c,b,x,w,O,j,F,U,a,s,l),G=L[z]=S++),z+=1,g+=k,T=2;T0)for(T=1,c=d[g],O=E[z]=r(c,a,s,l),j=E[z+R],F=E[z+D],U=E[z+N],O===j&&O===F&&O===U||(b=d[g+v],x=d[g+y],w=d[g+_],t(M,T,c,b,x,w,O,j,F,U,a,s,l),G=L[z]=S++,U!==j&&e(L[z+R],G,w,b,U,j,a,s,l)),z+=1,g+=k,T=2;T2&&o[1]>2&&n(i.pick(-1,-1).lo(1,1).hi(o[0]-2,o[1]-2),t.pick(-1,-1,0).lo(1,1).hi(o[0]-2,o[1]-2),t.pick(-1,-1,1).lo(1,1).hi(o[0]-2,o[1]-2)),o[1]>2&&(r(i.pick(0,-1).lo(1).hi(o[1]-2),t.pick(0,-1,1).lo(1).hi(o[1]-2)),e(t.pick(0,-1,0).lo(1).hi(o[1]-2))),o[1]>2&&(r(i.pick(o[0]-1,-1).lo(1).hi(o[1]-2),t.pick(o[0]-1,-1,1).lo(1).hi(o[1]-2)),e(t.pick(o[0]-1,-1,0).lo(1).hi(o[1]-2))),o[0]>2&&(r(i.pick(-1,0).lo(1).hi(o[0]-2),t.pick(-1,0,0).lo(1).hi(o[0]-2)),e(t.pick(-1,0,1).lo(1).hi(o[0]-2))),o[0]>2&&(r(i.pick(-1,o[1]-1).lo(1).hi(o[0]-2),t.pick(-1,o[1]-1,0).lo(1).hi(o[0]-2)),e(t.pick(-1,o[1]-1,1).lo(1).hi(o[0]-2))),t.set(0,0,0,0),t.set(0,0,1,0),t.set(o[0]-1,0,0,0),t.set(o[0]-1,0,1,0),t.set(0,o[1]-1,0,0),t.set(0,o[1]-1,1,0),t.set(o[0]-1,o[1]-1,0,0),t.set(o[0]-1,o[1]-1,1,0),t}}t.exports=function(t,e,r){return Array.isArray(r)||(r=n(e.dimension,"string"==typeof r?r:"clamp")),0===e.size?t:0===e.dimension?(t.set(0),t):function(t){var e=t.join();if(o=u[e])return o;for(var r=t.length,n=[h,d],i=1;i<=r;++i)n.push(f(i));var o=p.apply(void 0,n);return u[e]=o,o}(r)(t,e)}},4317:function(t){"use strict";function e(t,e){var r=Math.floor(e),n=e-r,i=0<=r&&r0;){y<64?(l=y,y=0):(l=64,y-=64);for(var x=0|t[1];x>0;){x<64?(c=x,x=0):(c=64,x-=64),n=v+y*h+x*d,a=b+y*p+x*m;var _=0,w=0,k=0,A=f,M=h-u*f,T=d-l*h,S=g,C=p-u*g,E=m-l*p;for(k=0;k0;){m<64?(l=m,m=0):(l=64,m-=64);for(var g=0|t[0];g>0;){g<64?(s=g,g=0):(s=64,g-=64),n=f+m*u+g*c,a=p+m*d+g*h;var v=0,b=0,y=u,x=c-l*u,_=d,w=h-l*d;for(b=0;b0;){b<64?(c=b,b=0):(c=64,b-=64);for(var y=0|t[0];y>0;){y<64?(s=y,y=0):(s=64,y-=64);for(var x=0|t[1];x>0;){x<64?(l=x,x=0):(l=64,x-=64),n=g+b*d+y*u+x*h,a=v+b*m+y*f+x*p;var _=0,w=0,k=0,A=d,M=u-c*d,T=h-s*u,S=m,C=f-c*m,E=p-s*f;for(k=0;kr;){v=0,b=m-a;e:for(g=0;gx)break e;b+=h,v+=d}for(v=m,b=m-a,g=0;g>1,H=V-B,W=V+B,q=U,Y=H,Z=V,X=W,$=G,J=i+1,K=o-1,Q=!0,tt=0,et=0,rt=0,nt=h,it=e(nt),ot=e(nt);M=l*q,T=l*Y,N=s;t:for(A=0;A0){g=q,q=Y,Y=g;break t}if(rt<0)break t;N+=f}M=l*X,T=l*$,N=s;t:for(A=0;A0){g=X,X=$,$=g;break t}if(rt<0)break t;N+=f}M=l*q,T=l*Z,N=s;t:for(A=0;A0){g=q,q=Z,Z=g;break t}if(rt<0)break t;N+=f}M=l*Y,T=l*Z,N=s;t:for(A=0;A0){g=Y,Y=Z,Z=g;break t}if(rt<0)break t;N+=f}M=l*q,T=l*X,N=s;t:for(A=0;A0){g=q,q=X,X=g;break t}if(rt<0)break t;N+=f}M=l*Z,T=l*X,N=s;t:for(A=0;A0){g=Z,Z=X,X=g;break t}if(rt<0)break t;N+=f}M=l*Y,T=l*$,N=s;t:for(A=0;A0){g=Y,Y=$,$=g;break t}if(rt<0)break t;N+=f}M=l*Y,T=l*Z,N=s;t:for(A=0;A0){g=Y,Y=Z,Z=g;break t}if(rt<0)break t;N+=f}M=l*X,T=l*$,N=s;t:for(A=0;A0){g=X,X=$,$=g;break t}if(rt<0)break t;N+=f}for(M=l*q,T=l*Y,S=l*Z,C=l*X,E=l*$,L=l*U,z=l*V,O=l*G,j=0,N=s,A=0;A0)){if(rt<0){for(M=l*x,T=l*J,S=l*K,N=s,A=0;A0)for(;;){for(_=s+K*l,j=0,A=0;A0)){for(_=s+K*l,j=0,A=0;AG){t:for(;;){for(_=s+J*l,j=0,N=s,A=0;A1&&n?s(r,n[0],n[1]):s(r)}(t,e,l);return n(l,c)}},446:function(t,e,r){"use strict";var n=r(7640),i={};t.exports=function(t){var e=t.order,r=t.dtype,o=[e,r].join(":"),a=i[o];return a||(i[o]=a=n(e,r)),a(t),t}},9618:function(t,e,r){var n=r(7163),i="undefined"!=typeof Float64Array;function o(t,e){return t[0]-e[0]}function a(){var t,e=this.stride,r=new Array(e.length);for(t=0;t=0&&(e+=o*(r=0|t),i-=r),new n(this.data,i,o,e)},i.step=function(t){var e=this.shape[0],r=this.stride[0],i=this.offset,o=0,a=Math.ceil;return"number"==typeof t&&((o=0|t)<0?(i+=r*(e-1),e=a(-e/o)):e=a(e/o),r*=o),new n(this.data,e,r,i)},i.transpose=function(t){t=void 0===t?0:0|t;var e=this.shape,r=this.stride;return new n(this.data,e[t],r[t],this.offset)},i.pick=function(t){var r=[],n=[],i=this.offset;return"number"==typeof t&&t>=0?i=i+this.stride[0]*t|0:(r.push(this.shape[0]),n.push(this.stride[0])),(0,e[r.length+1])(this.data,r,n,i)},function(t,e,r,i){return new n(t,e[0],r[0],i)}},2:function(t,e,r){function n(t,e,r,n,i,o){this.data=t,this.shape=[e,r],this.stride=[n,i],this.offset=0|o}var i=n.prototype;return i.dtype=t,i.dimension=2,Object.defineProperty(i,"size",{get:function(){return this.shape[0]*this.shape[1]}}),Object.defineProperty(i,"order",{get:function(){return Math.abs(this.stride[0])>Math.abs(this.stride[1])?[1,0]:[0,1]}}),i.set=function(e,r,n){return"generic"===t?this.data.set(this.offset+this.stride[0]*e+this.stride[1]*r,n):this.data[this.offset+this.stride[0]*e+this.stride[1]*r]=n},i.get=function(e,r){return"generic"===t?this.data.get(this.offset+this.stride[0]*e+this.stride[1]*r):this.data[this.offset+this.stride[0]*e+this.stride[1]*r]},i.index=function(t,e){return this.offset+this.stride[0]*t+this.stride[1]*e},i.hi=function(t,e){return new n(this.data,"number"!=typeof t||t<0?this.shape[0]:0|t,"number"!=typeof e||e<0?this.shape[1]:0|e,this.stride[0],this.stride[1],this.offset)},i.lo=function(t,e){var r=this.offset,i=0,o=this.shape[0],a=this.shape[1],s=this.stride[0],l=this.stride[1];return"number"==typeof t&&t>=0&&(r+=s*(i=0|t),o-=i),"number"==typeof e&&e>=0&&(r+=l*(i=0|e),a-=i),new n(this.data,o,a,s,l,r)},i.step=function(t,e){var r=this.shape[0],i=this.shape[1],o=this.stride[0],a=this.stride[1],s=this.offset,l=0,c=Math.ceil;return"number"==typeof t&&((l=0|t)<0?(s+=o*(r-1),r=c(-r/l)):r=c(r/l),o*=l),"number"==typeof e&&((l=0|e)<0?(s+=a*(i-1),i=c(-i/l)):i=c(i/l),a*=l),new n(this.data,r,i,o,a,s)},i.transpose=function(t,e){t=void 0===t?0:0|t,e=void 0===e?1:0|e;var r=this.shape,i=this.stride;return new n(this.data,r[t],r[e],i[t],i[e],this.offset)},i.pick=function(t,r){var n=[],i=[],o=this.offset;return"number"==typeof t&&t>=0?o=o+this.stride[0]*t|0:(n.push(this.shape[0]),i.push(this.stride[0])),"number"==typeof r&&r>=0?o=o+this.stride[1]*r|0:(n.push(this.shape[1]),i.push(this.stride[1])),(0,e[n.length+1])(this.data,n,i,o)},function(t,e,r,i){return new n(t,e[0],e[1],r[0],r[1],i)}},3:function(t,e,r){function n(t,e,r,n,i,o,a,s){this.data=t,this.shape=[e,r,n],this.stride=[i,o,a],this.offset=0|s}var i=n.prototype;return i.dtype=t,i.dimension=3,Object.defineProperty(i,"size",{get:function(){return this.shape[0]*this.shape[1]*this.shape[2]}}),Object.defineProperty(i,"order",{get:function(){var t=Math.abs(this.stride[0]),e=Math.abs(this.stride[1]),r=Math.abs(this.stride[2]);return t>e?e>r?[2,1,0]:t>r?[1,2,0]:[1,0,2]:t>r?[2,0,1]:r>e?[0,1,2]:[0,2,1]}}),i.set=function(e,r,n,i){return"generic"===t?this.data.set(this.offset+this.stride[0]*e+this.stride[1]*r+this.stride[2]*n,i):this.data[this.offset+this.stride[0]*e+this.stride[1]*r+this.stride[2]*n]=i},i.get=function(e,r,n){return"generic"===t?this.data.get(this.offset+this.stride[0]*e+this.stride[1]*r+this.stride[2]*n):this.data[this.offset+this.stride[0]*e+this.stride[1]*r+this.stride[2]*n]},i.index=function(t,e,r){return this.offset+this.stride[0]*t+this.stride[1]*e+this.stride[2]*r},i.hi=function(t,e,r){return new n(this.data,"number"!=typeof t||t<0?this.shape[0]:0|t,"number"!=typeof e||e<0?this.shape[1]:0|e,"number"!=typeof r||r<0?this.shape[2]:0|r,this.stride[0],this.stride[1],this.stride[2],this.offset)},i.lo=function(t,e,r){var i=this.offset,o=0,a=this.shape[0],s=this.shape[1],l=this.shape[2],c=this.stride[0],u=this.stride[1],h=this.stride[2];return"number"==typeof t&&t>=0&&(i+=c*(o=0|t),a-=o),"number"==typeof e&&e>=0&&(i+=u*(o=0|e),s-=o),"number"==typeof r&&r>=0&&(i+=h*(o=0|r),l-=o),new n(this.data,a,s,l,c,u,h,i)},i.step=function(t,e,r){var i=this.shape[0],o=this.shape[1],a=this.shape[2],s=this.stride[0],l=this.stride[1],c=this.stride[2],u=this.offset,h=0,d=Math.ceil;return"number"==typeof t&&((h=0|t)<0?(u+=s*(i-1),i=d(-i/h)):i=d(i/h),s*=h),"number"==typeof e&&((h=0|e)<0?(u+=l*(o-1),o=d(-o/h)):o=d(o/h),l*=h),"number"==typeof r&&((h=0|r)<0?(u+=c*(a-1),a=d(-a/h)):a=d(a/h),c*=h),new n(this.data,i,o,a,s,l,c,u)},i.transpose=function(t,e,r){t=void 0===t?0:0|t,e=void 0===e?1:0|e,r=void 0===r?2:0|r;var i=this.shape,o=this.stride;return new n(this.data,i[t],i[e],i[r],o[t],o[e],o[r],this.offset)},i.pick=function(t,r,n){var i=[],o=[],a=this.offset;return"number"==typeof t&&t>=0?a=a+this.stride[0]*t|0:(i.push(this.shape[0]),o.push(this.stride[0])),"number"==typeof r&&r>=0?a=a+this.stride[1]*r|0:(i.push(this.shape[1]),o.push(this.stride[1])),"number"==typeof n&&n>=0?a=a+this.stride[2]*n|0:(i.push(this.shape[2]),o.push(this.stride[2])),(0,e[i.length+1])(this.data,i,o,a)},function(t,e,r,i){return new n(t,e[0],e[1],e[2],r[0],r[1],r[2],i)}},4:function(t,e,r){function n(t,e,r,n,i,o,a,s,l,c){this.data=t,this.shape=[e,r,n,i],this.stride=[o,a,s,l],this.offset=0|c}var i=n.prototype;return i.dtype=t,i.dimension=4,Object.defineProperty(i,"size",{get:function(){return this.shape[0]*this.shape[1]*this.shape[2]*this.shape[3]}}),Object.defineProperty(i,"order",{get:r}),i.set=function(e,r,n,i,o){return"generic"===t?this.data.set(this.offset+this.stride[0]*e+this.stride[1]*r+this.stride[2]*n+this.stride[3]*i,o):this.data[this.offset+this.stride[0]*e+this.stride[1]*r+this.stride[2]*n+this.stride[3]*i]=o},i.get=function(e,r,n,i){return"generic"===t?this.data.get(this.offset+this.stride[0]*e+this.stride[1]*r+this.stride[2]*n+this.stride[3]*i):this.data[this.offset+this.stride[0]*e+this.stride[1]*r+this.stride[2]*n+this.stride[3]*i]},i.index=function(t,e,r,n){return this.offset+this.stride[0]*t+this.stride[1]*e+this.stride[2]*r+this.stride[3]*n},i.hi=function(t,e,r,i){return new n(this.data,"number"!=typeof t||t<0?this.shape[0]:0|t,"number"!=typeof e||e<0?this.shape[1]:0|e,"number"!=typeof r||r<0?this.shape[2]:0|r,"number"!=typeof i||i<0?this.shape[3]:0|i,this.stride[0],this.stride[1],this.stride[2],this.stride[3],this.offset)},i.lo=function(t,e,r,i){var o=this.offset,a=0,s=this.shape[0],l=this.shape[1],c=this.shape[2],u=this.shape[3],h=this.stride[0],d=this.stride[1],f=this.stride[2],p=this.stride[3];return"number"==typeof t&&t>=0&&(o+=h*(a=0|t),s-=a),"number"==typeof e&&e>=0&&(o+=d*(a=0|e),l-=a),"number"==typeof r&&r>=0&&(o+=f*(a=0|r),c-=a),"number"==typeof i&&i>=0&&(o+=p*(a=0|i),u-=a),new n(this.data,s,l,c,u,h,d,f,p,o)},i.step=function(t,e,r,i){var o=this.shape[0],a=this.shape[1],s=this.shape[2],l=this.shape[3],c=this.stride[0],u=this.stride[1],h=this.stride[2],d=this.stride[3],f=this.offset,p=0,m=Math.ceil;return"number"==typeof t&&((p=0|t)<0?(f+=c*(o-1),o=m(-o/p)):o=m(o/p),c*=p),"number"==typeof e&&((p=0|e)<0?(f+=u*(a-1),a=m(-a/p)):a=m(a/p),u*=p),"number"==typeof r&&((p=0|r)<0?(f+=h*(s-1),s=m(-s/p)):s=m(s/p),h*=p),"number"==typeof i&&((p=0|i)<0?(f+=d*(l-1),l=m(-l/p)):l=m(l/p),d*=p),new n(this.data,o,a,s,l,c,u,h,d,f)},i.transpose=function(t,e,r,i){t=void 0===t?0:0|t,e=void 0===e?1:0|e,r=void 0===r?2:0|r,i=void 0===i?3:0|i;var o=this.shape,a=this.stride;return new n(this.data,o[t],o[e],o[r],o[i],a[t],a[e],a[r],a[i],this.offset)},i.pick=function(t,r,n,i){var o=[],a=[],s=this.offset;return"number"==typeof t&&t>=0?s=s+this.stride[0]*t|0:(o.push(this.shape[0]),a.push(this.stride[0])),"number"==typeof r&&r>=0?s=s+this.stride[1]*r|0:(o.push(this.shape[1]),a.push(this.stride[1])),"number"==typeof n&&n>=0?s=s+this.stride[2]*n|0:(o.push(this.shape[2]),a.push(this.stride[2])),"number"==typeof i&&i>=0?s=s+this.stride[3]*i|0:(o.push(this.shape[3]),a.push(this.stride[3])),(0,e[o.length+1])(this.data,o,a,s)},function(t,e,r,i){return new n(t,e[0],e[1],e[2],e[3],r[0],r[1],r[2],r[3],i)}},5:function(t,e,r){function n(t,e,r,n,i,o,a,s,l,c,u,h){this.data=t,this.shape=[e,r,n,i,o],this.stride=[a,s,l,c,u],this.offset=0|h}var i=n.prototype;return i.dtype=t,i.dimension=5,Object.defineProperty(i,"size",{get:function(){return this.shape[0]*this.shape[1]*this.shape[2]*this.shape[3]*this.shape[4]}}),Object.defineProperty(i,"order",{get:r}),i.set=function(e,r,n,i,o,a){return"generic"===t?this.data.set(this.offset+this.stride[0]*e+this.stride[1]*r+this.stride[2]*n+this.stride[3]*i+this.stride[4]*o,a):this.data[this.offset+this.stride[0]*e+this.stride[1]*r+this.stride[2]*n+this.stride[3]*i+this.stride[4]*o]=a},i.get=function(e,r,n,i,o){return"generic"===t?this.data.get(this.offset+this.stride[0]*e+this.stride[1]*r+this.stride[2]*n+this.stride[3]*i+this.stride[4]*o):this.data[this.offset+this.stride[0]*e+this.stride[1]*r+this.stride[2]*n+this.stride[3]*i+this.stride[4]*o]},i.index=function(t,e,r,n,i){return this.offset+this.stride[0]*t+this.stride[1]*e+this.stride[2]*r+this.stride[3]*n+this.stride[4]*i},i.hi=function(t,e,r,i,o){return new n(this.data,"number"!=typeof t||t<0?this.shape[0]:0|t,"number"!=typeof e||e<0?this.shape[1]:0|e,"number"!=typeof r||r<0?this.shape[2]:0|r,"number"!=typeof i||i<0?this.shape[3]:0|i,"number"!=typeof o||o<0?this.shape[4]:0|o,this.stride[0],this.stride[1],this.stride[2],this.stride[3],this.stride[4],this.offset)},i.lo=function(t,e,r,i,o){var a=this.offset,s=0,l=this.shape[0],c=this.shape[1],u=this.shape[2],h=this.shape[3],d=this.shape[4],f=this.stride[0],p=this.stride[1],m=this.stride[2],g=this.stride[3],v=this.stride[4];return"number"==typeof t&&t>=0&&(a+=f*(s=0|t),l-=s),"number"==typeof e&&e>=0&&(a+=p*(s=0|e),c-=s),"number"==typeof r&&r>=0&&(a+=m*(s=0|r),u-=s),"number"==typeof i&&i>=0&&(a+=g*(s=0|i),h-=s),"number"==typeof o&&o>=0&&(a+=v*(s=0|o),d-=s),new n(this.data,l,c,u,h,d,f,p,m,g,v,a)},i.step=function(t,e,r,i,o){var a=this.shape[0],s=this.shape[1],l=this.shape[2],c=this.shape[3],u=this.shape[4],h=this.stride[0],d=this.stride[1],f=this.stride[2],p=this.stride[3],m=this.stride[4],g=this.offset,v=0,b=Math.ceil;return"number"==typeof t&&((v=0|t)<0?(g+=h*(a-1),a=b(-a/v)):a=b(a/v),h*=v),"number"==typeof e&&((v=0|e)<0?(g+=d*(s-1),s=b(-s/v)):s=b(s/v),d*=v),"number"==typeof r&&((v=0|r)<0?(g+=f*(l-1),l=b(-l/v)):l=b(l/v),f*=v),"number"==typeof i&&((v=0|i)<0?(g+=p*(c-1),c=b(-c/v)):c=b(c/v),p*=v),"number"==typeof o&&((v=0|o)<0?(g+=m*(u-1),u=b(-u/v)):u=b(u/v),m*=v),new n(this.data,a,s,l,c,u,h,d,f,p,m,g)},i.transpose=function(t,e,r,i,o){t=void 0===t?0:0|t,e=void 0===e?1:0|e,r=void 0===r?2:0|r,i=void 0===i?3:0|i,o=void 0===o?4:0|o;var a=this.shape,s=this.stride;return new n(this.data,a[t],a[e],a[r],a[i],a[o],s[t],s[e],s[r],s[i],s[o],this.offset)},i.pick=function(t,r,n,i,o){var a=[],s=[],l=this.offset;return"number"==typeof t&&t>=0?l=l+this.stride[0]*t|0:(a.push(this.shape[0]),s.push(this.stride[0])),"number"==typeof r&&r>=0?l=l+this.stride[1]*r|0:(a.push(this.shape[1]),s.push(this.stride[1])),"number"==typeof n&&n>=0?l=l+this.stride[2]*n|0:(a.push(this.shape[2]),s.push(this.stride[2])),"number"==typeof i&&i>=0?l=l+this.stride[3]*i|0:(a.push(this.shape[3]),s.push(this.stride[3])),"number"==typeof o&&o>=0?l=l+this.stride[4]*o|0:(a.push(this.shape[4]),s.push(this.stride[4])),(0,e[a.length+1])(this.data,a,s,l)},function(t,e,r,i){return new n(t,e[0],e[1],e[2],e[3],e[4],r[0],r[1],r[2],r[3],r[4],i)}}};function l(t,e){var r=-1===e?"T":String(e),n=s[r];return-1===e?n(t):0===e?n(t,c[t][0]):n(t,c[t],a)}var c={generic:[],buffer:[],array:[],float32:[],float64:[],int8:[],int16:[],int32:[],uint8_clamped:[],uint8:[],uint16:[],uint32:[],bigint64:[],biguint64:[]};t.exports=function(t,e,r,o){if(void 0===t)return(0,c.array[0])([]);"number"==typeof t&&(t=[t]),void 0===e&&(e=[t.length]);var a=e.length;if(void 0===r){r=new Array(a);for(var s=a-1,u=1;s>=0;--s)r[s]=u,u*=e[s]}if(void 0===o)for(o=0,s=0;s>>0;t.exports=function(t,e){if(isNaN(t)||isNaN(e))return NaN;if(t===e)return t;if(0===t)return e<0?-i:i;var r=n.hi(t),a=n.lo(t);return e>t==t>0?a===o?(r+=1,a=0):a+=1:0===a?(a=o,r-=1):a-=1,n.pack(a,r)}},8406:function(t,e){e.vertexNormals=function(t,e,r){for(var n=e.length,i=new Array(n),o=void 0===r?1e-6:r,a=0;ao){var x=i[c],_=1/Math.sqrt(g*b);for(y=0;y<3;++y){var w=(y+1)%3,k=(y+2)%3;x[y]+=_*(v[w]*m[k]-v[k]*m[w])}}}for(a=0;ao)for(_=1/Math.sqrt(A),y=0;y<3;++y)x[y]*=_;else for(y=0;y<3;++y)x[y]=0}return i},e.faceNormals=function(t,e,r){for(var n=t.length,i=new Array(n),o=void 0===r?1e-6:r,a=0;ao?1/Math.sqrt(f):0,c=0;c<3;++c)d[c]*=f;i[a]=d}return i}},4081:function(t){"use strict";t.exports=function(t,e,r,n,i,o,a,s,l,c){var u=e+o+c;if(h>0){var h=Math.sqrt(u+1);t[0]=.5*(a-l)/h,t[1]=.5*(s-n)/h,t[2]=.5*(r-o)/h,t[3]=.5*h}else{var d=Math.max(e,o,c);h=Math.sqrt(2*d-u+1),e>=d?(t[0]=.5*h,t[1]=.5*(i+r)/h,t[2]=.5*(s+n)/h,t[3]=.5*(a-l)/h):o>=d?(t[0]=.5*(r+i)/h,t[1]=.5*h,t[2]=.5*(l+a)/h,t[3]=.5*(s-n)/h):(t[0]=.5*(n+s)/h,t[1]=.5*(a+l)/h,t[2]=.5*h,t[3]=.5*(r-i)/h)}return t}},9977:function(t,e,r){"use strict";t.exports=function(t){var e=(t=t||{}).center||[0,0,0],r=t.rotation||[0,0,0,1],n=t.radius||1;e=[].slice.call(e,0,3),u(r=[].slice.call(r,0,4),r);var i=new h(r,e,Math.log(n));return i.setDistanceLimits(t.zoomMin,t.zoomMax),("eye"in t||"up"in t)&&i.lookAt(0,t.eye,t.center,t.up),i};var n=r(9215),i=r(6582),o=r(7399),a=r(7608),s=r(4081);function l(t,e,r){return Math.sqrt(Math.pow(t,2)+Math.pow(e,2)+Math.pow(r,2))}function c(t,e,r,n){return Math.sqrt(Math.pow(t,2)+Math.pow(e,2)+Math.pow(r,2)+Math.pow(n,2))}function u(t,e){var r=e[0],n=e[1],i=e[2],o=e[3],a=c(r,n,i,o);a>1e-6?(t[0]=r/a,t[1]=n/a,t[2]=i/a,t[3]=o/a):(t[0]=t[1]=t[2]=0,t[3]=1)}function h(t,e,r){this.radius=n([r]),this.center=n(e),this.rotation=n(t),this.computedRadius=this.radius.curve(0),this.computedCenter=this.center.curve(0),this.computedRotation=this.rotation.curve(0),this.computedUp=[.1,0,0],this.computedEye=[.1,0,0],this.computedMatrix=[.1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],this.recalcMatrix(0)}var d=h.prototype;d.lastT=function(){return Math.max(this.radius.lastT(),this.center.lastT(),this.rotation.lastT())},d.recalcMatrix=function(t){this.radius.curve(t),this.center.curve(t),this.rotation.curve(t);var e=this.computedRotation;u(e,e);var r=this.computedMatrix;o(r,e);var n=this.computedCenter,i=this.computedEye,a=this.computedUp,s=Math.exp(this.computedRadius[0]);i[0]=n[0]+s*r[2],i[1]=n[1]+s*r[6],i[2]=n[2]+s*r[10],a[0]=r[1],a[1]=r[5],a[2]=r[9];for(var l=0;l<3;++l){for(var c=0,h=0;h<3;++h)c+=r[l+4*h]*i[h];r[12+l]=-c}},d.getMatrix=function(t,e){this.recalcMatrix(t);var r=this.computedMatrix;if(e){for(var n=0;n<16;++n)e[n]=r[n];return e}return r},d.idle=function(t){this.center.idle(t),this.radius.idle(t),this.rotation.idle(t)},d.flush=function(t){this.center.flush(t),this.radius.flush(t),this.rotation.flush(t)},d.pan=function(t,e,r,n){e=e||0,r=r||0,n=n||0,this.recalcMatrix(t);var i=this.computedMatrix,o=i[1],a=i[5],s=i[9],c=l(o,a,s);o/=c,a/=c,s/=c;var u=i[0],h=i[4],d=i[8],f=u*o+h*a+d*s,p=l(u-=o*f,h-=a*f,d-=s*f);u/=p,h/=p,d/=p;var m=i[2],g=i[6],v=i[10],b=m*o+g*a+v*s,y=m*u+g*h+v*d,x=l(m-=b*o+y*u,g-=b*a+y*h,v-=b*s+y*d);m/=x,g/=x,v/=x;var _=u*e+o*r,w=h*e+a*r,k=d*e+s*r;this.center.move(t,_,w,k);var A=Math.exp(this.computedRadius[0]);A=Math.max(1e-4,A+n),this.radius.set(t,Math.log(A))},d.rotate=function(t,e,r,n){this.recalcMatrix(t),e=e||0,r=r||0;var i=this.computedMatrix,o=i[0],a=i[4],s=i[8],u=i[1],h=i[5],d=i[9],f=i[2],p=i[6],m=i[10],g=e*o+r*u,v=e*a+r*h,b=e*s+r*d,y=-(p*b-m*v),x=-(m*g-f*b),_=-(f*v-p*g),w=Math.sqrt(Math.max(0,1-Math.pow(y,2)-Math.pow(x,2)-Math.pow(_,2))),k=c(y,x,_,w);k>1e-6?(y/=k,x/=k,_/=k,w/=k):(y=x=_=0,w=1);var A=this.computedRotation,M=A[0],T=A[1],S=A[2],C=A[3],E=M*w+C*y+T*_-S*x,L=T*w+C*x+S*y-M*_,z=S*w+C*_+M*x-T*y,O=C*w-M*y-T*x-S*_;if(n){y=f,x=p,_=m;var D=Math.sin(n)/l(y,x,_);y*=D,x*=D,_*=D,O=O*(w=Math.cos(e))-(E=E*w+O*y+L*_-z*x)*y-(L=L*w+O*x+z*y-E*_)*x-(z=z*w+O*_+E*x-L*y)*_}var I=c(E,L,z,O);I>1e-6?(E/=I,L/=I,z/=I,O/=I):(E=L=z=0,O=1),this.rotation.set(t,E,L,z,O)},d.lookAt=function(t,e,r,n){this.recalcMatrix(t),r=r||this.computedCenter,e=e||this.computedEye,n=n||this.computedUp;var o=this.computedMatrix;i(o,e,r,n);var a=this.computedRotation;s(a,o[0],o[1],o[2],o[4],o[5],o[6],o[8],o[9],o[10]),u(a,a),this.rotation.set(t,a[0],a[1],a[2],a[3]);for(var l=0,c=0;c<3;++c)l+=Math.pow(r[c]-e[c],2);this.radius.set(t,.5*Math.log(Math.max(l,1e-6))),this.center.set(t,r[0],r[1],r[2])},d.translate=function(t,e,r,n){this.center.move(t,e||0,r||0,n||0)},d.setMatrix=function(t,e){var r=this.computedRotation;s(r,e[0],e[1],e[2],e[4],e[5],e[6],e[8],e[9],e[10]),u(r,r),this.rotation.set(t,r[0],r[1],r[2],r[3]);var n=this.computedMatrix;a(n,e);var i=n[15];if(Math.abs(i)>1e-6){var o=n[12]/i,l=n[13]/i,c=n[14]/i;this.recalcMatrix(t);var h=Math.exp(this.computedRadius[0]);this.center.set(t,o-n[2]*h,l-n[6]*h,c-n[10]*h),this.radius.idle(t)}else this.center.idle(t),this.radius.idle(t)},d.setDistance=function(t,e){e>0&&this.radius.set(t,Math.log(e))},d.setDistanceLimits=function(t,e){t=t>0?Math.log(t):-1/0,e=e>0?Math.log(e):1/0,e=Math.max(e,t),this.radius.bounds[0][0]=t,this.radius.bounds[1][0]=e},d.getDistanceLimits=function(t){var e=this.radius.bounds;return t?(t[0]=Math.exp(e[0][0]),t[1]=Math.exp(e[1][0]),t):[Math.exp(e[0][0]),Math.exp(e[1][0])]},d.toJSON=function(){return this.recalcMatrix(this.lastT()),{center:this.computedCenter.slice(),rotation:this.computedRotation.slice(),distance:Math.log(this.computedRadius[0]),zoomMin:this.radius.bounds[0][0],zoomMax:this.radius.bounds[1][0]}},d.fromJSON=function(t){var e=this.lastT(),r=t.center;r&&this.center.set(e,r[0],r[1],r[2]);var n=t.rotation;n&&this.rotation.set(e,n[0],n[1],n[2],n[3]);var i=t.distance;i&&i>0&&this.radius.set(e,Math.log(i)),this.setDistanceLimits(t.zoomMin,t.zoomMax)}},1371:function(t,e,r){"use strict";var n=r(3233);t.exports=function(t,e,r){return n(r=void 0!==r?r+"":" ",e)+t}},3202:function(t){t.exports=function(t,e){e||(e=[0,""]),t=String(t);var r=parseFloat(t,10);return e[0]=r,e[1]=t.match(/[\d.\-\+]*\s*(.*)/)[1]||"",e}},3088:function(t,e,r){"use strict";t.exports=function(t,e){for(var r=0|e.length,i=t.length,o=[new Array(r),new Array(r)],a=0;a0){a=o[u][r][0],l=u;break}s=a[1^l];for(var h=0;h<2;++h)for(var d=o[h][r],f=0;f0&&(a=p,s=m,l=h)}return i||a&&c(a,l),s}function h(t,r){var i=o[r][t][0],a=[t];c(i,r);for(var s=i[1^r];;){for(;s!==t;)a.push(s),s=u(a[a.length-2],s,!1);if(o[0][t].length+o[1][t].length===0)break;var l=a[a.length-1],h=t,d=a[1],f=u(l,h,!0);if(n(e[l],e[h],e[d],e[f])<0)break;a.push(t),s=u(l,h)}return a}function d(t,e){return e[1]===e[e.length-1]}for(a=0;a0;){o[0][a].length;var m=h(a,f);d(0,m)?p.push.apply(p,m):(p.length>0&&l.push(p),p=m)}p.length>0&&l.push(p)}return l};var n=r(3140)},5609:function(t,e,r){"use strict";t.exports=function(t,e){for(var r=n(t,e.length),i=new Array(e.length),o=new Array(e.length),a=[],s=0;s0;){i[f=a.pop()]=!1;var c=r[f];for(s=0;s0}))).length,g=new Array(m),v=new Array(m);for(f=0;f0;){var j=R.pop(),N=C[j];l(N,(function(t,e){return t-e}));var B,U=N.length,G=P[j];for(0===G&&(B=[V=p[j]]),f=0;f=0||(P[H]=1^G,R.push(H),0===G&&(F(V=p[H])||(V.reverse(),B.push(V))))}0===G&&r.push(B)}return r};var n=r(3134),i=r(3088),o=r(5085),a=r(5250),s=r(8210),l=r(1682),c=r(5609);function u(t,e){for(var r=new Array(t),n=0;n0&&e[i]===r[0]))return 1;o=t[i-1]}for(var s=1;o;){var l=o.key,c=n(r,l[0],l[1]);if(l[0][0]0))return 0;s=-1,o=o.right}else if(c>0)o=o.left;else{if(!(c<0))return 0;s=1,o=o.right}}return s}}(v.slabs,v.coordinates);return 0===o.length?b:function(t,e){return function(r){return t(r[0],r[1])?0:e(r)}}(l(o),b)};var n=r(3250)[3],i=r(4209),o=r(3352),a=r(2478);function s(){return!0}function l(t){for(var e={},r=0;r=c?(A=1,b=c+2*d+p):b=d*(A=-d/c)+p):(A=0,f>=0?(M=0,b=p):-f>=h?(M=1,b=h+2*f+p):b=f*(M=-f/h)+p);else if(M<0)M=0,d>=0?(A=0,b=p):-d>=c?(A=1,b=c+2*d+p):b=d*(A=-d/c)+p;else{var T=1/k;b=(A*=T)*(c*A+u*(M*=T)+2*d)+M*(u*A+h*M+2*f)+p}else A<0?(x=h+f)>(y=u+d)?(_=x-y)>=(w=c-2*u+h)?(A=1,M=0,b=c+2*d+p):b=(A=_/w)*(c*A+u*(M=1-A)+2*d)+M*(u*A+h*M+2*f)+p:(A=0,x<=0?(M=1,b=h+2*f+p):f>=0?(M=0,b=p):b=f*(M=-f/h)+p):M<0?(x=c+d)>(y=u+f)?(_=x-y)>=(w=c-2*u+h)?(M=1,A=0,b=h+2*f+p):b=(A=1-(M=_/w))*(c*A+u*M+2*d)+M*(u*A+h*M+2*f)+p:(M=0,x<=0?(A=1,b=c+2*d+p):d>=0?(A=0,b=p):b=d*(A=-d/c)+p):(_=h+f-u-d)<=0?(A=0,M=1,b=h+2*f+p):_>=(w=c-2*u+h)?(A=1,M=0,b=c+2*d+p):b=(A=_/w)*(c*A+u*(M=1-A)+2*d)+M*(u*A+h*M+2*f)+p;var S=1-A-M;for(l=0;l0){var c=t[r-1];if(0===n(s,c)&&o(c)!==l){r-=1;continue}}t[r++]=s}}return t.length=r,t}},3233:function(t){"use strict";var e,r="";t.exports=function(t,n){if("string"!=typeof t)throw new TypeError("expected a string");if(1===n)return t;if(2===n)return t+t;var i=t.length*n;if(e!==t||void 0===e)e=t,r="";else if(r.length>=i)return r.substr(0,i);for(;i>r.length&&n>1;)1&n&&(r+=t),n>>=1,t+=t;return r=(r+=t).substr(0,i)}},3025:function(t,e,r){t.exports=r.g.performance&&r.g.performance.now?function(){return performance.now()}:Date.now||function(){return+new Date}},7004:function(t){"use strict";t.exports=function(t){for(var e=t.length,r=t[t.length-1],n=e,i=e-2;i>=0;--i){var o=r;(l=(s=t[i])-((r=o+s)-o))&&(t[--n]=r,r=l)}var a=0;for(i=n;i0){if(o<=0)return a;n=i+o}else{if(!(i<0))return a;if(o>=0)return a;n=-(i+o)}var s=33306690738754716e-32*n;return a>=s||a<=-s?a:h(t,e,r)},function(t,e,r,n){var i=t[0]-n[0],o=e[0]-n[0],a=r[0]-n[0],s=t[1]-n[1],l=e[1]-n[1],c=r[1]-n[1],u=t[2]-n[2],h=e[2]-n[2],f=r[2]-n[2],p=o*c,m=a*l,g=a*s,v=i*c,b=i*l,y=o*s,x=u*(p-m)+h*(g-v)+f*(b-y),_=7771561172376103e-31*((Math.abs(p)+Math.abs(m))*Math.abs(u)+(Math.abs(g)+Math.abs(v))*Math.abs(h)+(Math.abs(b)+Math.abs(y))*Math.abs(f));return x>_||-x>_?x:d(t,e,r,n)}];function p(t){var e=f[t.length];return e||(e=f[t.length]=u(t.length)),e.apply(void 0,t)}function m(t,e,r,n,i,o,a){return function(e,r,s,l,c){switch(arguments.length){case 0:case 1:return 0;case 2:return n(e,r);case 3:return i(e,r,s);case 4:return o(e,r,s,l);case 5:return a(e,r,s,l,c)}for(var u=new Array(arguments.length),h=0;h0&&a>0||o<0&&a<0)return!1;var s=n(r,t,e),l=n(i,t,e);return!(s>0&&l>0||s<0&&l<0)&&(0!==o||0!==a||0!==s||0!==l||function(t,e,r,n){for(var i=0;i<2;++i){var o=t[i],a=e[i],s=Math.min(o,a),l=Math.max(o,a),c=r[i],u=n[i],h=Math.min(c,u);if(Math.max(c,u)=n?(i=h,(l+=1)=n?(i=h,(l+=1)>1,c=e[2*l+1];if(c===o)return l;o>1,c=e[2*l+1];if(c===o)return l;o>1,c=e[2*l+1];if(c===o)return l;o0)-(t<0)},e.abs=function(t){var e=t>>31;return(t^e)-e},e.min=function(t,e){return e^(t^e)&-(t65535)<<4,e|=r=((t>>>=e)>255)<<3,e|=r=((t>>>=r)>15)<<2,(e|=r=((t>>>=r)>3)<<1)|(t>>>=r)>>1},e.log10=function(t){return t>=1e9?9:t>=1e8?8:t>=1e7?7:t>=1e6?6:t>=1e5?5:t>=1e4?4:t>=1e3?3:t>=100?2:t>=10?1:0},e.popCount=function(t){return 16843009*((t=(858993459&(t-=t>>>1&1431655765))+(t>>>2&858993459))+(t>>>4)&252645135)>>>24},e.countTrailingZeros=r,e.nextPow2=function(t){return t+=0===t,--t,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,1+(t|=t>>>16)},e.prevPow2=function(t){return t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)-(t>>>1)},e.parity=function(t){return t^=t>>>16,t^=t>>>8,t^=t>>>4,27030>>>(t&=15)&1};var n=new Array(256);!function(t){for(var e=0;e<256;++e){var r=e,n=e,i=7;for(r>>>=1;r;r>>>=1)n<<=1,n|=1&r,--i;t[e]=n<>>8&255]<<16|n[t>>>16&255]<<8|n[t>>>24&255]},e.interleave2=function(t,e){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t&=65535)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e&=65535)|e<<8))|e<<4))|e<<2))|e<<1))<<1},e.deinterleave2=function(t,e){return(t=65535&((t=16711935&((t=252645135&((t=858993459&((t=t>>>e&1431655765)|t>>>1))|t>>>2))|t>>>4))|t>>>16))<<16>>16},e.interleave3=function(t,e,r){return t=1227133513&((t=3272356035&((t=251719695&((t=4278190335&((t&=1023)|t<<16))|t<<8))|t<<4))|t<<2),(t|=(e=1227133513&((e=3272356035&((e=251719695&((e=4278190335&((e&=1023)|e<<16))|e<<8))|e<<4))|e<<2))<<1)|(r=1227133513&((r=3272356035&((r=251719695&((r=4278190335&((r&=1023)|r<<16))|r<<8))|r<<4))|r<<2))<<2},e.deinterleave3=function(t,e){return(t=1023&((t=4278190335&((t=251719695&((t=3272356035&((t=t>>>e&1227133513)|t>>>2))|t>>>4))|t>>>8))|t>>>16))<<22>>22},e.nextCombination=function(t){var e=t|t-1;return e+1|(~e&-~e)-1>>>r(t)+1}},2014:function(t,e,r){"use strict";var n=r(3105),i=r(4623);function o(t,e){var r=t.length,n=t.length-e.length,i=Math.min;if(n)return n;switch(r){case 0:return 0;case 1:return t[0]-e[0];case 2:return(s=t[0]+t[1]-e[0]-e[1])||i(t[0],t[1])-i(e[0],e[1]);case 3:var o=t[0]+t[1],a=e[0]+e[1];if(s=o+t[2]-(a+e[2]))return s;var s,l=i(t[0],t[1]),c=i(e[0],e[1]);return(s=i(l,t[2])-i(c,e[2]))||i(l+t[2],o)-i(c+e[2],a);default:var u=t.slice(0);u.sort();var h=e.slice(0);h.sort();for(var d=0;d>1,s=o(t[a],e);s<=0?(0===s&&(i=a),r=a+1):s>0&&(n=a-1)}return i}function u(t,e){for(var r=new Array(t.length),i=0,a=r.length;i=t.length||0!==o(t[g],s)););}return r}function h(t,e){if(e<0)return[];for(var r=[],i=(1<>>u&1&&c.push(i[u]);e.push(c)}return s(e)},e.skeleton=h,e.boundary=function(t){for(var e=[],r=0,n=t.length;r>1:(t>>1)-1}function y(t){for(var e=v(t);;){var r=e,n=2*t+1,i=2*(t+1),o=t;if(n0;){var r=b(t);if(!(r>=0&&e0){var t=A[0];return g(0,T-1),T-=1,y(0),t}return-1}function w(t,e){var r=A[t];return c[r]===e?t:(c[r]=-1/0,x(t),_(),c[r]=e,x((T+=1)-1))}function k(t){if(!u[t]){u[t]=!0;var e=s[t],r=l[t];s[r]>=0&&(s[r]=e),l[e]>=0&&(l[e]=r),M[e]>=0&&w(M[e],m(e)),M[r]>=0&&w(M[r],m(r))}}var A=[],M=new Array(o);for(h=0;h>1;h>=0;--h)y(h);for(;;){var S=_();if(S<0||c[S]>r)break;k(S)}var C=[];for(h=0;h=0&&r>=0&&e!==r){var n=M[e],i=M[r];n!==i&&L.push([n,i])}})),i.unique(i.normalize(L)),{positions:C,edges:L}};var n=r(3250),i=r(2014)},1303:function(t,e,r){"use strict";t.exports=function(t,e){var r,o,a,s;if(e[0][0]e[1][0]))return i(e,t);r=e[1],o=e[0]}if(t[0][0]t[1][0]))return-i(t,e);a=t[1],s=t[0]}var l=n(r,o,s),c=n(r,o,a);if(l<0){if(c<=0)return l}else if(l>0){if(c>=0)return l}else if(c)return c;if(l=n(s,a,o),c=n(s,a,r),l<0){if(c<=0)return l}else if(l>0){if(c>=0)return l}else if(c)return c;return o[0]-s[0]};var n=r(3250);function i(t,e){var r,i,o,a;if(e[0][0]e[1][0])){var s=Math.min(t[0][1],t[1][1]),l=Math.max(t[0][1],t[1][1]),c=Math.min(e[0][1],e[1][1]),u=Math.max(e[0][1],e[1][1]);return lu?s-u:l-u}r=e[1],i=e[0]}t[0][1]0)if(e[0]!==a[1][0])r=t,t=t.right;else{if(l=c(t.right,e))return l;t=t.left}else{if(e[0]!==a[1][0])return t;var l;if(l=c(t.right,e))return l;t=t.left}}return r}function u(t,e,r,n){this.y=t,this.index=e,this.start=r,this.closed=n}function h(t,e,r,n){this.x=t,this.segment=e,this.create=r,this.index=n}s.prototype.castUp=function(t){var e=n.le(this.coordinates,t[0]);if(e<0)return-1;this.slabs[e];var r=c(this.slabs[e],t),i=-1;if(r&&(i=r.value),this.coordinates[e]===t[0]){var s=null;if(r&&(s=r.key),e>0){var u=c(this.slabs[e-1],t);u&&(s?a(u.key,s)>0&&(s=u.key,i=u.value):(i=u.value,s=u.key))}var h=this.horizontal[e];if(h.length>0){var d=n.ge(h,t[1],l);if(d=h.length)return i;f=h[d]}}if(f.start)if(s){var p=o(s[0],s[1],[t[0],f.y]);s[0][0]>s[1][0]&&(p=-p),p>0&&(i=f.index)}else i=f.index;else f.y!==t[1]&&(i=f.index)}}}return i}},5202:function(t,e,r){"use strict";var n=r(1944),i=r(8210);function o(t,e){var r=i(n(t,e),[e[e.length-1]]);return r[r.length-1]}function a(t,e,r,n){var i=-e/(n-e);i<0?i=0:i>1&&(i=1);for(var o=1-i,a=t.length,s=new Array(a),l=0;l0||i>0&&u<0){var h=a(s,u,l,i);r.push(h),n.push(h.slice())}u<0?n.push(l.slice()):u>0?r.push(l.slice()):(r.push(l.slice()),n.push(l.slice())),i=u}return{positive:r,negative:n}},t.exports.positive=function(t,e){for(var r=[],n=o(t[t.length-1],e),i=t[t.length-1],s=t[0],l=0;l0||n>0&&c<0)&&r.push(a(i,c,s,n)),c>=0&&r.push(s.slice()),n=c}return r},t.exports.negative=function(t,e){for(var r=[],n=o(t[t.length-1],e),i=t[t.length-1],s=t[0],l=0;l0||n>0&&c<0)&&r.push(a(i,c,s,n)),c<=0&&r.push(s.slice()),n=c}return r}},3387:function(t,e,r){var n;!function(){"use strict";var i={not_string:/[^s]/,not_bool:/[^t]/,not_type:/[^T]/,not_primitive:/[^v]/,number:/[diefg]/,numeric_arg:/[bcdiefguxX]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[+-]/};function o(t){return function(t,e){var r,n,a,s,l,c,u,h,d,f=1,p=t.length,m="";for(n=0;n=0),s.type){case"b":r=parseInt(r,10).toString(2);break;case"c":r=String.fromCharCode(parseInt(r,10));break;case"d":case"i":r=parseInt(r,10);break;case"j":r=JSON.stringify(r,null,s.width?parseInt(s.width):0);break;case"e":r=s.precision?parseFloat(r).toExponential(s.precision):parseFloat(r).toExponential();break;case"f":r=s.precision?parseFloat(r).toFixed(s.precision):parseFloat(r);break;case"g":r=s.precision?String(Number(r.toPrecision(s.precision))):parseFloat(r);break;case"o":r=(parseInt(r,10)>>>0).toString(8);break;case"s":r=String(r),r=s.precision?r.substring(0,s.precision):r;break;case"t":r=String(!!r),r=s.precision?r.substring(0,s.precision):r;break;case"T":r=Object.prototype.toString.call(r).slice(8,-1).toLowerCase(),r=s.precision?r.substring(0,s.precision):r;break;case"u":r=parseInt(r,10)>>>0;break;case"v":r=r.valueOf(),r=s.precision?r.substring(0,s.precision):r;break;case"x":r=(parseInt(r,10)>>>0).toString(16);break;case"X":r=(parseInt(r,10)>>>0).toString(16).toUpperCase()}i.json.test(s.type)?m+=r:(!i.number.test(s.type)||h&&!s.sign?d="":(d=h?"+":"-",r=r.toString().replace(i.sign,"")),c=s.pad_char?"0"===s.pad_char?"0":s.pad_char.charAt(1):" ",u=s.width-(d+r).length,l=s.width&&u>0?c.repeat(u):"",m+=s.align?d+r+l:"0"===c?d+l+r:l+d+r)}return m}(function(t){if(s[t])return s[t];for(var e,r=t,n=[],o=0;r;){if(null!==(e=i.text.exec(r)))n.push(e[0]);else if(null!==(e=i.modulo.exec(r)))n.push("%");else{if(null===(e=i.placeholder.exec(r)))throw new SyntaxError("[sprintf] unexpected placeholder");if(e[2]){o|=1;var a=[],l=e[2],c=[];if(null===(c=i.key.exec(l)))throw new SyntaxError("[sprintf] failed to parse named argument key");for(a.push(c[1]);""!==(l=l.substring(c[0].length));)if(null!==(c=i.key_access.exec(l)))a.push(c[1]);else{if(null===(c=i.index_access.exec(l)))throw new SyntaxError("[sprintf] failed to parse named argument key");a.push(c[1])}e[2]=a}else o|=2;if(3===o)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");n.push({placeholder:e[0],param_no:e[1],keys:e[2],sign:e[3],pad_char:e[4],align:e[5],width:e[6],precision:e[7],type:e[8]})}r=r.substring(e[0].length)}return s[t]=n}(t),arguments)}function a(t,e){return o.apply(null,[t].concat(e||[]))}var s=Object.create(null);e.sprintf=o,e.vsprintf=a,"undefined"!=typeof window&&(window.sprintf=o,window.vsprintf=a,void 0===(n=function(){return{sprintf:o,vsprintf:a}}.call(e,r,e,t))||(t.exports=n))}()},3711:function(t,e,r){"use strict";t.exports=function(t,e){if(t.dimension<=0)return{positions:[],cells:[]};if(1===t.dimension)return function(t,e){for(var r=i(t,e),n=r.length,o=new Array(n),a=new Array(n),s=0;sn|0},vertex:function(t,e,r,n,i,o,a,s,l,c,u,h,d){var f=(0|a)+(s<<1)+(l<<2)+(c<<3)|0;if(0!==f&&15!==f)switch(f){case 0:case 15:u.push([t-.5,e-.5]);break;case 1:u.push([t-.25-.25*(n+r-2*d)/(r-n),e-.25-.25*(i+r-2*d)/(r-i)]);break;case 2:u.push([t-.75-.25*(-n-r+2*d)/(n-r),e-.25-.25*(o+n-2*d)/(n-o)]);break;case 3:u.push([t-.5,e-.5-.5*(i+r+o+n-4*d)/(r-i+n-o)]);break;case 4:u.push([t-.25-.25*(o+i-2*d)/(i-o),e-.75-.25*(-i-r+2*d)/(i-r)]);break;case 5:u.push([t-.5-.5*(n+r+o+i-4*d)/(r-n+i-o),e-.5]);break;case 6:u.push([t-.5-.25*(-n-r+o+i)/(n-r+i-o),e-.5-.25*(-i-r+o+n)/(i-r+n-o)]);break;case 7:u.push([t-.75-.25*(o+i-2*d)/(i-o),e-.75-.25*(o+n-2*d)/(n-o)]);break;case 8:u.push([t-.75-.25*(-o-i+2*d)/(o-i),e-.75-.25*(-o-n+2*d)/(o-n)]);break;case 9:u.push([t-.5-.25*(n+r+-o-i)/(r-n+o-i),e-.5-.25*(i+r+-o-n)/(r-i+o-n)]);break;case 10:u.push([t-.5-.5*(-n-r-o-i+4*d)/(n-r+o-i),e-.5]);break;case 11:u.push([t-.25-.25*(-o-i+2*d)/(o-i),e-.75-.25*(i+r-2*d)/(r-i)]);break;case 12:u.push([t-.5,e-.5-.5*(-i-r-o-n+4*d)/(i-r+o-n)]);break;case 13:u.push([t-.75-.25*(n+r-2*d)/(r-n),e-.25-.25*(-o-n+2*d)/(o-n)]);break;case 14:u.push([t-.25-.25*(-n-r+2*d)/(n-r),e-.25-.25*(-i-r+2*d)/(i-r)])}},cell:function(t,e,r,n,i,o,a,s,l){i?s.push([t,e]):s.push([e,t])}});return function(t,e){var r=[],i=[];return n(t,r,i,e),{positions:r,cells:i}}}},a={}},529:function(t,e,r){"use strict";t.exports=function t(e,r,n){var o=(n=n||{}).fontStyle||"normal",s=n.fontWeight||"normal",l=n.fontVariant||"normal",c=[o,s,l,e].join("_"),u=a[c];u||(u=a[c]={" ":{data:new Float32Array(0),shape:.2}});var h=u[r];if(!h)if(r.length<=1||!/\d/.test(r))h=u[r]=function(t){for(var e=t.cells,r=t.positions,n=new Float32Array(6*e.length),i=0,o=0,a=0;a0&&(m+=.02);var v=new Float32Array(p),b=0,y=-.5*m;for(g=0;gMath.max(r,n)?i[2]=1:r>Math.max(e,n)?i[0]=1:i[1]=1;for(var o=0,a=0,l=0;l<3;++l)o+=t[l]*t[l],a+=i[l]*t[l];for(l=0;l<3;++l)i[l]-=a/o*t[l];return s(i,i),i}function d(t,e,r,i,o,a,s,l){this.center=n(r),this.up=n(i),this.right=n(o),this.radius=n([a]),this.angle=n([s,l]),this.angle.bounds=[[-1/0,-Math.PI/2],[1/0,Math.PI/2]],this.setDistanceLimits(t,e),this.computedCenter=this.center.curve(0),this.computedUp=this.up.curve(0),this.computedRight=this.right.curve(0),this.computedRadius=this.radius.curve(0),this.computedAngle=this.angle.curve(0),this.computedToward=[0,0,0],this.computedEye=[0,0,0],this.computedMatrix=new Array(16);for(var c=0;c<16;++c)this.computedMatrix[c]=.5;this.recalcMatrix(0)}var f=d.prototype;f.setDistanceLimits=function(t,e){t=t>0?Math.log(t):-1/0,e=e>0?Math.log(e):1/0,e=Math.max(e,t),this.radius.bounds[0][0]=t,this.radius.bounds[1][0]=e},f.getDistanceLimits=function(t){var e=this.radius.bounds[0];return t?(t[0]=Math.exp(e[0][0]),t[1]=Math.exp(e[1][0]),t):[Math.exp(e[0][0]),Math.exp(e[1][0])]},f.recalcMatrix=function(t){this.center.curve(t),this.up.curve(t),this.right.curve(t),this.radius.curve(t),this.angle.curve(t);for(var e=this.computedUp,r=this.computedRight,n=0,i=0,o=0;o<3;++o)i+=e[o]*r[o],n+=e[o]*e[o];var l=Math.sqrt(n),u=0;for(o=0;o<3;++o)r[o]-=e[o]*i/n,u+=r[o]*r[o],e[o]/=l;var h=Math.sqrt(u);for(o=0;o<3;++o)r[o]/=h;var d=this.computedToward;a(d,e,r),s(d,d);var f=Math.exp(this.computedRadius[0]),p=this.computedAngle[0],m=this.computedAngle[1],g=Math.cos(p),v=Math.sin(p),b=Math.cos(m),y=Math.sin(m),x=this.computedCenter,_=g*b,w=v*b,k=y,A=-g*y,M=-v*y,T=b,S=this.computedEye,C=this.computedMatrix;for(o=0;o<3;++o){var E=_*r[o]+w*d[o]+k*e[o];C[4*o+1]=A*r[o]+M*d[o]+T*e[o],C[4*o+2]=E,C[4*o+3]=0}var L=C[1],z=C[5],O=C[9],D=C[2],I=C[6],F=C[10],R=z*F-O*I,P=O*D-L*F,j=L*I-z*D,N=c(R,P,j);for(R/=N,P/=N,j/=N,C[0]=R,C[4]=P,C[8]=j,o=0;o<3;++o)S[o]=x[o]+C[2+4*o]*f;for(o=0;o<3;++o){u=0;for(var B=0;B<3;++B)u+=C[o+4*B]*S[B];C[12+o]=-u}C[15]=1},f.getMatrix=function(t,e){this.recalcMatrix(t);var r=this.computedMatrix;if(e){for(var n=0;n<16;++n)e[n]=r[n];return e}return r};var p=[0,0,0];f.rotate=function(t,e,r,n){if(this.angle.move(t,e,r),n){this.recalcMatrix(t);var i=this.computedMatrix;p[0]=i[2],p[1]=i[6],p[2]=i[10];for(var a=this.computedUp,s=this.computedRight,l=this.computedToward,c=0;c<3;++c)i[4*c]=a[c],i[4*c+1]=s[c],i[4*c+2]=l[c];for(o(i,i,n,p),c=0;c<3;++c)a[c]=i[4*c],s[c]=i[4*c+1];this.up.set(t,a[0],a[1],a[2]),this.right.set(t,s[0],s[1],s[2])}},f.pan=function(t,e,r,n){e=e||0,r=r||0,n=n||0,this.recalcMatrix(t);var i=this.computedMatrix,o=(Math.exp(this.computedRadius[0]),i[1]),a=i[5],s=i[9],l=c(o,a,s);o/=l,a/=l,s/=l;var u=i[0],h=i[4],d=i[8],f=u*o+h*a+d*s,p=c(u-=o*f,h-=a*f,d-=s*f),m=(u/=p)*e+o*r,g=(h/=p)*e+a*r,v=(d/=p)*e+s*r;this.center.move(t,m,g,v);var b=Math.exp(this.computedRadius[0]);b=Math.max(1e-4,b+n),this.radius.set(t,Math.log(b))},f.translate=function(t,e,r,n){this.center.move(t,e||0,r||0,n||0)},f.setMatrix=function(t,e,r,n){var o=1;"number"==typeof r&&(o=0|r),(o<0||o>3)&&(o=1);var a=(o+2)%3;e||(this.recalcMatrix(t),e=this.computedMatrix);var s=e[o],l=e[o+4],h=e[o+8];if(n){var d=Math.abs(s),f=Math.abs(l),p=Math.abs(h),m=Math.max(d,f,p);d===m?(s=s<0?-1:1,l=h=0):p===m?(h=h<0?-1:1,s=l=0):(l=l<0?-1:1,s=h=0)}else{var g=c(s,l,h);s/=g,l/=g,h/=g}var v,b,y=e[a],x=e[a+4],_=e[a+8],w=y*s+x*l+_*h,k=c(y-=s*w,x-=l*w,_-=h*w),A=l*(_/=k)-h*(x/=k),M=h*(y/=k)-s*_,T=s*x-l*y,S=c(A,M,T);if(A/=S,M/=S,T/=S,this.center.jump(t,H,W,q),this.radius.idle(t),this.up.jump(t,s,l,h),this.right.jump(t,y,x,_),2===o){var C=e[1],E=e[5],L=e[9],z=C*y+E*x+L*_,O=C*A+E*M+L*T;v=R<0?-Math.PI/2:Math.PI/2,b=Math.atan2(O,z)}else{var D=e[2],I=e[6],F=e[10],R=D*s+I*l+F*h,P=D*y+I*x+F*_,j=D*A+I*M+F*T;v=Math.asin(u(R)),b=Math.atan2(j,P)}this.angle.jump(t,b,v),this.recalcMatrix(t);var N=e[2],B=e[6],U=e[10],G=this.computedMatrix;i(G,e);var V=G[15],H=G[12]/V,W=G[13]/V,q=G[14]/V,Y=Math.exp(this.computedRadius[0]);this.center.jump(t,H-N*Y,W-B*Y,q-U*Y)},f.lastT=function(){return Math.max(this.center.lastT(),this.up.lastT(),this.right.lastT(),this.radius.lastT(),this.angle.lastT())},f.idle=function(t){this.center.idle(t),this.up.idle(t),this.right.idle(t),this.radius.idle(t),this.angle.idle(t)},f.flush=function(t){this.center.flush(t),this.up.flush(t),this.right.flush(t),this.radius.flush(t),this.angle.flush(t)},f.setDistance=function(t,e){e>0&&this.radius.set(t,Math.log(e))},f.lookAt=function(t,e,r,n){this.recalcMatrix(t),e=e||this.computedEye,r=r||this.computedCenter;var i=(n=n||this.computedUp)[0],o=n[1],a=n[2],s=c(i,o,a);if(!(s<1e-6)){i/=s,o/=s,a/=s;var l=e[0]-r[0],h=e[1]-r[1],d=e[2]-r[2],f=c(l,h,d);if(!(f<1e-6)){l/=f,h/=f,d/=f;var p=this.computedRight,m=p[0],g=p[1],v=p[2],b=i*m+o*g+a*v,y=c(m-=b*i,g-=b*o,v-=b*a);if(!(y<.01&&(y=c(m=o*d-a*h,g=a*l-i*d,v=i*h-o*l))<1e-6)){m/=y,g/=y,v/=y,this.up.set(t,i,o,a),this.right.set(t,m,g,v),this.center.set(t,r[0],r[1],r[2]),this.radius.set(t,Math.log(f));var x=o*v-a*g,_=a*m-i*v,w=i*g-o*m,k=c(x,_,w),A=i*l+o*h+a*d,M=m*l+g*h+v*d,T=(x/=k)*l+(_/=k)*h+(w/=k)*d,S=Math.asin(u(A)),C=Math.atan2(T,M),E=this.angle._state,L=E[E.length-1],z=E[E.length-2];L%=2*Math.PI;var O=Math.abs(L+2*Math.PI-C),D=Math.abs(L-C),I=Math.abs(L-2*Math.PI-C);O0?r.pop():new ArrayBuffer(t)}function p(t){return new Uint8Array(f(t),0,t)}function m(t){return new Uint16Array(f(2*t),0,t)}function g(t){return new Uint32Array(f(4*t),0,t)}function v(t){return new Int8Array(f(t),0,t)}function b(t){return new Int16Array(f(2*t),0,t)}function y(t){return new Int32Array(f(4*t),0,t)}function x(t){return new Float32Array(f(4*t),0,t)}function _(t){return new Float64Array(f(8*t),0,t)}function w(t){return a?new Uint8ClampedArray(f(t),0,t):p(t)}function k(t){return s?new BigUint64Array(f(8*t),0,t):null}function A(t){return l?new BigInt64Array(f(8*t),0,t):null}function M(t){return new DataView(f(t),0,t)}function T(t){t=n.nextPow2(t);var e=n.log2(t),r=h[e];return r.length>0?r.pop():new o(t)}e.free=function(t){if(o.isBuffer(t))h[n.log2(t.length)].push(t);else{if("[object ArrayBuffer]"!==Object.prototype.toString.call(t)&&(t=t.buffer),!t)return;var e=t.length||t.byteLength,r=0|n.log2(e);u[r].push(t)}},e.freeUint8=e.freeUint16=e.freeUint32=e.freeBigUint64=e.freeInt8=e.freeInt16=e.freeInt32=e.freeBigInt64=e.freeFloat32=e.freeFloat=e.freeFloat64=e.freeDouble=e.freeUint8Clamped=e.freeDataView=function(t){d(t.buffer)},e.freeArrayBuffer=d,e.freeBuffer=function(t){h[n.log2(t.length)].push(t)},e.malloc=function(t,e){if(void 0===e||"arraybuffer"===e)return f(t);switch(e){case"uint8":return p(t);case"uint16":return m(t);case"uint32":return g(t);case"int8":return v(t);case"int16":return b(t);case"int32":return y(t);case"float":case"float32":return x(t);case"double":case"float64":return _(t);case"uint8_clamped":return w(t);case"bigint64":return A(t);case"biguint64":return k(t);case"buffer":return T(t);case"data":case"dataview":return M(t);default:return null}return null},e.mallocArrayBuffer=f,e.mallocUint8=p,e.mallocUint16=m,e.mallocUint32=g,e.mallocInt8=v,e.mallocInt16=b,e.mallocInt32=y,e.mallocFloat32=e.mallocFloat=x,e.mallocFloat64=e.mallocDouble=_,e.mallocUint8Clamped=w,e.mallocBigUint64=k,e.mallocBigInt64=A,e.mallocDataView=M,e.mallocBuffer=T,e.clearCache=function(){for(var t=0;t<32;++t)c.UINT8[t].length=0,c.UINT16[t].length=0,c.UINT32[t].length=0,c.INT8[t].length=0,c.INT16[t].length=0,c.INT32[t].length=0,c.FLOAT[t].length=0,c.DOUBLE[t].length=0,c.BIGUINT64[t].length=0,c.BIGINT64[t].length=0,c.UINT8C[t].length=0,u[t].length=0,h[t].length=0}},1755:function(t){"use strict";function e(t){this.roots=new Array(t),this.ranks=new Array(t);for(var e=0;e0&&(o=n.size),n.lineSpacing&&n.lineSpacing>0&&(a=n.lineSpacing),n.styletags&&n.styletags.breaklines&&(s.breaklines=!!n.styletags.breaklines),n.styletags&&n.styletags.bolds&&(s.bolds=!!n.styletags.bolds),n.styletags&&n.styletags.italics&&(s.italics=!!n.styletags.italics),n.styletags&&n.styletags.subscripts&&(s.subscripts=!!n.styletags.subscripts),n.styletags&&n.styletags.superscripts&&(s.superscripts=!!n.styletags.superscripts)),r.font=[n.fontStyle,n.fontVariant,n.fontWeight,o+"px",n.font].filter((function(t){return t})).join(" "),r.textAlign="start",r.textBaseline="alphabetic",r.direction="ltr",w(function(t,e,r,n,o,a){r=r.replace(/\n/g,""),r=!0===a.breaklines?r.replace(/\/g,"\n"):r.replace(/\/g," ");var s="",l=[];for(k=0;k-1?parseInt(t[1+i]):0,l=o>-1?parseInt(r[1+o]):0;s!==l&&(n=n.replace(P(),"?px "),T*=Math.pow(.75,l-s),n=n.replace("?px ",P())),M+=.25*E*(l-s)}if(!0===a.superscripts){var c=t.indexOf(p),h=r.indexOf(p),f=c>-1?parseInt(t[1+c]):0,m=h>-1?parseInt(r[1+h]):0;f!==m&&(n=n.replace(P(),"?px "),T*=Math.pow(.75,m-f),n=n.replace("?px ",P())),M-=.25*E*(m-f)}if(!0===a.bolds){var g=t.indexOf(u)>-1,b=r.indexOf(u)>-1;!g&&b&&(n=y?n.replace("italic ","italic bold "):"bold "+n),g&&!b&&(n=n.replace("bold ",""))}if(!0===a.italics){var y=t.indexOf(d)>-1,x=r.indexOf(d)>-1;!y&&x&&(n="italic "+n),y&&!x&&(n=n.replace("italic ",""))}e.font=n}for(w=0;w",o="",a=i.length,s=o.length,l=e[0]===p||e[0]===v,c=0,u=-s;c>-1&&-1!==(c=r.indexOf(i,c))&&-1!==(u=r.indexOf(o,c+a))&&!(u<=c);){for(var h=c;h=u)n[h]=null,r=r.substr(0,h)+" "+r.substr(h+1);else if(null!==n[h]){var d=n[h].indexOf(e[0]);-1===d?n[h]+=e:l&&(n[h]=n[h].substr(0,d+1)+(1+parseInt(n[h][d+1]))+n[h].substr(d+2))}var f=c+a,m=r.substr(f,u-f).indexOf(i);c=-1!==m?m:u+s}return n}function x(t,e){var r=n(t,128);return e?o(r.cells,r.positions,.25):{edges:r.cells,positions:r.positions}}function _(t,e,r,n){var i=x(t,n),o=function(t,e,r){for(var n=e.textAlign||"start",i=e.textBaseline||"alphabetic",o=[1<<30,1<<30],a=[0,0],s=t.length,l=0;l=0?e[o]:i}))},has___:{value:y((function(e){var n=b(e);return n?r in n:t.indexOf(e)>=0}))},set___:{value:y((function(n,i){var o,a=b(n);return a?a[r]=i:(o=t.indexOf(n))>=0?e[o]=i:(o=t.length,e[o]=i,t[o]=n),this}))},delete___:{value:y((function(n){var i,o,a=b(n);return a?r in a&&delete a[r]:!((i=t.indexOf(n))<0||(o=t.length-1,t[i]=void 0,e[i]=e[o],t[i]=t[o],t.length=o,e.length=o,0))}))}})};m.prototype=Object.create(Object.prototype,{get:{value:function(t,e){return this.get___(t,e)},writable:!0,configurable:!0},has:{value:function(t){return this.has___(t)},writable:!0,configurable:!0},set:{value:function(t,e){return this.set___(t,e)},writable:!0,configurable:!0},delete:{value:function(t){return this.delete___(t)},writable:!0,configurable:!0}}),"function"==typeof r?function(){function n(){this instanceof m||x();var t,n=new r,i=void 0,o=!1;return t=e?function(t,e){return n.set(t,e),n.has(t)||(i||(i=new m),i.set(t,e)),this}:function(t,e){if(o)try{n.set(t,e)}catch(r){i||(i=new m),i.set___(t,e)}else n.set(t,e);return this},Object.create(m.prototype,{get___:{value:y((function(t,e){return i?n.has(t)?n.get(t):i.get___(t,e):n.get(t,e)}))},has___:{value:y((function(t){return n.has(t)||!!i&&i.has___(t)}))},set___:{value:y(t)},delete___:{value:y((function(t){var e=!!n.delete(t);return i&&i.delete___(t)||e}))},permitHostObjects___:{value:y((function(t){if(t!==g)throw new Error("bogus call to permitHostObjects___");o=!0}))}})}e&&"undefined"!=typeof Proxy&&(Proxy=void 0),n.prototype=m.prototype,t.exports=n,Object.defineProperty(WeakMap.prototype,"constructor",{value:WeakMap,enumerable:!1,configurable:!0,writable:!0})}():("undefined"!=typeof Proxy&&(Proxy=void 0),t.exports=m)}function g(t){t.permitHostObjects___&&t.permitHostObjects___(g)}function v(t){return!(t.substr(0,8)==l&&"___"===t.substr(t.length-3))}function b(t){if(t!==Object(t))throw new TypeError("Not an object: "+t);var e=t[c];if(e&&e.key===t)return e;if(s(t)){e={key:t};try{return a(t,c,{value:e,writable:!1,enumerable:!1,configurable:!1}),e}catch(t){return}}}function y(t){return t.prototype=null,Object.freeze(t)}function x(){f||"undefined"==typeof console||(f=!0,console.warn("WeakMap should be invoked as new WeakMap(), not WeakMap(). This will be an error in the future."))}}()},236:function(t,e,r){var n=r(8284);t.exports=function(){var t={};return function(e){if(("object"!=typeof e||null===e)&&"function"!=typeof e)throw new Error("Weakmap-shim: Key must be object");var r=e.valueOf(t);return r&&r.identity===t?r:n(e,t)}}},8284:function(t){t.exports=function(t,e){var r={identity:e},n=t.valueOf;return Object.defineProperty(t,"valueOf",{value:function(t){return t!==e?n.apply(this,arguments):r},writable:!0}),r}},606:function(t,e,r){var n=r(236);t.exports=function(){var t=n();return{get:function(e,r){var n=t(e);return n.hasOwnProperty("value")?n.value:r},set:function(e,r){return t(e).value=r,this},has:function(e){return"value"in t(e)},delete:function(e){return delete t(e).value}}}},3349:function(t){"use strict";t.exports=function(t){var e={};return function(r,n,i){var o=r.dtype,a=r.order,s=[o,a.join()].join(),l=e[s];return l||(e[s]=l=t([o,a])),l(r.shape.slice(0),r.data,r.stride,0|r.offset,n,i)}}(function(){return function(t,e,r,n,i,o){var a=t[0],s=r[0],l=[0],c=s;n|=0;var u=0,h=s;for(u=0;u=0!=f>=0&&i.push(l[0]+.5+.5*(d+f)/(d-f)),n+=h,++l[0]}}}.bind(void 0,{funcName:"zeroCrossings"}))},781:function(t,e,r){"use strict";t.exports=function(t,e){var r=[];return e=+e||0,n(t.hi(t.shape[0]-1),r,e),r};var n=r(3349)},7790:function(){}},r={};function i(t){var n=r[t];if(void 0!==n)return n.exports;var o=r[t]={id:t,loaded:!1,exports:{}};return e[t].call(o.exports,o,o.exports,i),o.loaded=!0,o.exports}i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),i.nmd=function(t){return t.paths=[],t.children||(t.children=[]),t};var o=i(1964);t.exports=o}()},53824:t=>{t.exports=function(t,e,r,n){var i=t[0],o=t[1],a=!1;void 0===r&&(r=0),void 0===n&&(n=e.length);for(var s=n-r,l=0,c=s-1;lo!=f>o&&i<(d-u)*(o-h)/(f-h)+u&&(a=!a)}return a}},48439:(t,e,r)=>{var n,i=r(89528),o=r(45505),a=r(25645),s=r(31997),l=r(94638),c=r(52148),u=!1,h=o();function d(t,e,r){var i=n.segments(t),o=n.segments(e),a=r(n.combine(i,o));return n.polygon(a)}n={buildLog:function(t){return!0===t?u=i():!1===t&&(u=!1),!1!==u&&u.list},epsilon:function(t){return h.epsilon(t)},segments:function(t){var e=a(!0,h,u);return t.regions.forEach(e.addRegion),{segments:e.calculate(t.inverted),inverted:t.inverted}},combine:function(t,e){return{combined:a(!1,h,u).calculate(t.segments,t.inverted,e.segments,e.inverted),inverted1:t.inverted,inverted2:e.inverted}},selectUnion:function(t){return{segments:l.union(t.combined,u),inverted:t.inverted1||t.inverted2}},selectIntersect:function(t){return{segments:l.intersect(t.combined,u),inverted:t.inverted1&&t.inverted2}},selectDifference:function(t){return{segments:l.difference(t.combined,u),inverted:t.inverted1&&!t.inverted2}},selectDifferenceRev:function(t){return{segments:l.differenceRev(t.combined,u),inverted:!t.inverted1&&t.inverted2}},selectXor:function(t){return{segments:l.xor(t.combined,u),inverted:t.inverted1!==t.inverted2}},polygon:function(t){return{regions:s(t.segments,h,u),inverted:t.inverted}},polygonFromGeoJSON:function(t){return c.toPolygon(n,t)},polygonToGeoJSON:function(t){return c.fromPolygon(n,h,t)},union:function(t,e){return d(t,e,n.selectUnion)},intersect:function(t,e){return d(t,e,n.selectIntersect)},difference:function(t,e){return d(t,e,n.selectDifference)},differenceRev:function(t,e){return d(t,e,n.selectDifferenceRev)},xor:function(t,e){return d(t,e,n.selectXor)}},"object"==typeof window&&(window.PolyBool=n),t.exports=n},89528:t=>{t.exports=function(){var t,e=0,r=!1;function n(e,r){return t.list.push({type:e,data:r?JSON.parse(JSON.stringify(r)):void 0}),t}return t={list:[],segmentId:function(){return e++},checkIntersection:function(t,e){return n("check",{seg1:t,seg2:e})},segmentChop:function(t,e){return n("div_seg",{seg:t,pt:e}),n("chop",{seg:t,pt:e})},statusRemove:function(t){return n("pop_seg",{seg:t})},segmentUpdate:function(t){return n("seg_update",{seg:t})},segmentNew:function(t,e){return n("new_seg",{seg:t,primary:e})},segmentRemove:function(t){return n("rem_seg",{seg:t})},tempStatus:function(t,e,r){return n("temp_status",{seg:t,above:e,below:r})},rewind:function(t){return n("rewind",{seg:t})},status:function(t,e,r){return n("status",{seg:t,above:e,below:r})},vert:function(e){return e===r?t:(r=e,n("vert",{x:e}))},log:function(t){return"string"!=typeof t&&(t=JSON.stringify(t,!1," ")),n("log",{txt:t})},reset:function(){return n("reset")},selected:function(t){return n("selected",{segs:t})},chainStart:function(t){return n("chain_start",{seg:t})},chainRemoveHead:function(t,e){return n("chain_rem_head",{index:t,pt:e})},chainRemoveTail:function(t,e){return n("chain_rem_tail",{index:t,pt:e})},chainNew:function(t,e){return n("chain_new",{pt1:t,pt2:e})},chainMatch:function(t){return n("chain_match",{index:t})},chainClose:function(t){return n("chain_close",{index:t})},chainAddHead:function(t,e){return n("chain_add_head",{index:t,pt:e})},chainAddTail:function(t,e){return n("chain_add_tail",{index:t,pt:e})},chainConnect:function(t,e){return n("chain_con",{index1:t,index2:e})},chainReverse:function(t){return n("chain_rev",{index:t})},chainJoin:function(t,e){return n("chain_join",{index1:t,index2:e})},done:function(){return n("done")}}}},45505:t=>{t.exports=function(t){"number"!=typeof t&&(t=1e-10);var e={epsilon:function(e){return"number"==typeof e&&(t=e),t},pointAboveOrOnLine:function(e,r,n){var i=r[0],o=r[1],a=n[0],s=n[1],l=e[0];return(a-i)*(e[1]-o)-(s-o)*(l-i)>=-t},pointBetween:function(e,r,n){var i=e[1]-r[1],o=n[0]-r[0],a=e[0]-r[0],s=n[1]-r[1],l=a*o+i*s;return!(l-t)},pointsSameX:function(e,r){return Math.abs(e[0]-r[0])t!=a-i>t&&(o-c)*(i-u)/(a-u)+c-n>t&&(s=!s),o=c,a=u}return s}};return e}},52148:t=>{var e={toPolygon:function(t,e){function r(e){if(e.length<=0)return t.segments({inverted:!1,regions:[]});function r(e){var r=e.slice(0,e.length-1);return t.segments({inverted:!1,regions:[r]})}for(var n=r(e[0]),i=1;i{var n=r(68871);t.exports=function(t,e,r){function i(t,e,n){return{id:r?r.segmentId():-1,start:t,end:e,myFill:{above:n.myFill.above,below:n.myFill.below},otherFill:null}}var o=n.create();function a(t,r){o.insertBefore(t,(function(n){return i=t.isStart,o=t.pt,a=r,s=n.isStart,l=n.pt,c=n.other.pt,(0!==(u=e.pointsCompare(o,l))?u:e.pointsSame(a,c)?0:i!==s?i?1:-1:e.pointAboveOrOnLine(a,s?l:c,s?c:l)?1:-1)<0;var i,o,a,s,l,c,u}))}function s(t,e){var r=function(t,e){var r=n.node({isStart:!0,pt:t.start,seg:t,primary:e,other:null,status:null});return a(r,t.end),r}(t,e);return function(t,e,r){var i=n.node({isStart:!1,pt:e.end,seg:e,primary:r,other:t,status:null});t.other=i,a(i,t.pt)}(r,t,e),r}function l(t,e){var n=i(e,t.seg.end,t.seg);return function(t,e){r&&r.segmentChop(t.seg,e),t.other.remove(),t.seg.end=e,t.other.pt=e,a(t.other,t.pt)}(t,e),s(n,t.primary)}function c(i,a){var s=n.create();function c(t){return s.findTransition((function(r){var n,i,o,a,s,l;return n=t,i=r.ev,o=n.seg.start,a=n.seg.end,s=i.seg.start,l=i.seg.end,(e.pointsCollinear(o,s,l)?e.pointsCollinear(a,s,l)||e.pointAboveOrOnLine(a,s,l)?1:-1:e.pointAboveOrOnLine(o,s,l)?1:-1)>0}))}function u(t,n){var i=t.seg,o=n.seg,a=i.start,s=i.end,c=o.start,u=o.end;r&&r.checkIntersection(i,o);var h=e.linesIntersect(a,s,c,u);if(!1===h){if(!e.pointsCollinear(a,s,c))return!1;if(e.pointsSame(a,u)||e.pointsSame(s,c))return!1;var d=e.pointsSame(a,c),f=e.pointsSame(s,u);if(d&&f)return n;var p=!d&&e.pointBetween(a,c,u),m=!f&&e.pointBetween(s,c,u);if(d)return m?l(n,s):l(t,u),n;p&&(f||(m?l(n,s):l(t,u)),l(n,a))}else 0===h.alongA&&(-1===h.alongB?l(t,c):0===h.alongB?l(t,h.pt):1===h.alongB&&l(t,u)),0===h.alongB&&(-1===h.alongA?l(n,a):0===h.alongA?l(n,h.pt):1===h.alongA&&l(n,s));return!1}for(var h=[];!o.isEmpty();){var d=o.getHead();if(r&&r.vert(d.pt[0]),d.isStart){r&&r.segmentNew(d.seg,d.primary);var f=c(d),p=f.before?f.before.ev:null,m=f.after?f.after.ev:null;function g(){if(p){var t=u(d,p);if(t)return t}return!!m&&u(d,m)}r&&r.tempStatus(d.seg,!!p&&p.seg,!!m&&m.seg);var v,b,y=g();if(y)t?(b=null===d.seg.myFill.below||d.seg.myFill.above!==d.seg.myFill.below)&&(y.seg.myFill.above=!y.seg.myFill.above):y.seg.otherFill=d.seg.myFill,r&&r.segmentUpdate(y.seg),d.other.remove(),d.remove();if(o.getHead()!==d){r&&r.rewind(d.seg);continue}t?(b=null===d.seg.myFill.below||d.seg.myFill.above!==d.seg.myFill.below,d.seg.myFill.below=m?m.seg.myFill.above:i,d.seg.myFill.above=b?!d.seg.myFill.below:d.seg.myFill.below):null===d.seg.otherFill&&(v=m?d.primary===m.primary?m.seg.otherFill.above:m.seg.myFill.above:d.primary?a:i,d.seg.otherFill={above:v,below:v}),r&&r.status(d.seg,!!p&&p.seg,!!m&&m.seg),d.other.status=f.insert(n.node({ev:d}))}else{var x=d.status;if(null===x)throw new Error("PolyBool: Zero-length segment detected; your epsilon is probably too small or too large");if(s.exists(x.prev)&&s.exists(x.next)&&u(x.prev.ev,x.next.ev),r&&r.statusRemove(x.ev.seg),x.remove(),!d.primary){var _=d.seg.myFill;d.seg.myFill=d.seg.otherFill,d.seg.otherFill=_}h.push(d.seg)}o.getHead().remove()}return r&&r.done(),h}return t?{addRegion:function(t){for(var n,i,o,a=t[t.length-1],l=0;l{t.exports={create:function(){var t={root:{root:!0,next:null},exists:function(e){return null!==e&&e!==t.root},isEmpty:function(){return null===t.root.next},getHead:function(){return t.root.next},insertBefore:function(e,r){for(var n=t.root,i=t.root.next;null!==i;){if(r(i))return e.prev=i.prev,e.next=i,i.prev.next=e,void(i.prev=e);n=i,i=i.next}n.next=e,e.prev=n,e.next=null},findTransition:function(e){for(var r=t.root,n=t.root.next;null!==n&&!e(n);)r=n,n=n.next;return{before:r===t.root?null:r,after:n,insert:function(t){return t.prev=r,t.next=n,r.next=t,null!==n&&(n.prev=t),t}}}};return t},node:function(t){return t.prev=null,t.next=null,t.remove=function(){t.prev.next=t.next,t.next&&(t.next.prev=t.prev),t.prev=null,t.next=null},t}}},31997:t=>{t.exports=function(t,e,r){var n=[],i=[];return t.forEach((function(t){var o=t.start,a=t.end;if(e.pointsSame(o,a))console.warn("PolyBool: Warning: Zero-length segment detected; your epsilon is probably too small or too large");else{r&&r.chainStart(t);for(var s={index:0,matches_head:!1,matches_pt1:!1},l={index:0,matches_head:!1,matches_pt1:!1},c=s,u=0;u{function e(t,e,r){var n=[];return t.forEach((function(t){var i=(t.myFill.above?8:0)+(t.myFill.below?4:0)+(t.otherFill&&t.otherFill.above?2:0)+(t.otherFill&&t.otherFill.below?1:0);0!==e[i]&&n.push({id:r?r.segmentId():-1,start:t.start,end:t.end,myFill:{above:1===e[i],below:2===e[i]},otherFill:null})})),r&&r.selected(n),n}var r={union:function(t,r){return e(t,[0,2,1,0,2,2,0,0,1,0,1,0,0,0,0,0],r)},intersect:function(t,r){return e(t,[0,0,0,0,0,2,0,2,0,0,1,1,0,2,1,0],r)},difference:function(t,r){return e(t,[0,0,0,0,2,0,2,0,1,1,0,0,0,1,2,0],r)},differenceRev:function(t,r){return e(t,[0,2,1,0,0,0,1,1,0,2,0,2,0,0,0,0],r)},xor:function(t,r){return e(t,[0,2,1,0,2,0,0,1,1,0,0,2,0,1,2,0],r)}};t.exports=r},97905:t=>{"use strict";t.exports=["Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]},39807:t=>{var e,r,n=t.exports={};function i(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function a(t){if(e===setTimeout)return setTimeout(t,0);if((e===i||!e)&&setTimeout)return e=setTimeout,setTimeout(t,0);try{return e(t,0)}catch(r){try{return e.call(null,t,0)}catch(r){return e.call(this,t,0)}}}!function(){try{e="function"==typeof setTimeout?setTimeout:i}catch(t){e=i}try{r="function"==typeof clearTimeout?clearTimeout:o}catch(t){r=o}}();var s,l=[],c=!1,u=-1;function h(){c&&s&&(c=!1,s.length?l=s.concat(l):u=-1,l.length&&d())}function d(){if(!c){var t=a(h);c=!0;for(var e=l.length;e;){for(s=l,l=[];++u1)for(var r=1;r{"use strict";var n=r(25359),i=r(34463),o=r(6313),a=r(9994),s=r(34597),l=r(97e3),c=r(91101),u=c.float32,h=c.fract32;t.exports=function(t,e){if("function"==typeof t?(e||(e={}),e.regl=t):e=t,e.length&&(e.positions=e),!(t=e.regl).hasExtension("ANGLE_instanced_arrays"))throw Error("regl-error2d: `ANGLE_instanced_arrays` extension should be enabled");var r,c,f,p,m,g,v=t._gl,b={color:"black",capSize:5,lineWidth:1,opacity:1,viewport:null,range:null,offset:0,count:0,bounds:null,positions:[],errors:[]},y=[];return p=t.buffer({usage:"dynamic",type:"uint8",data:new Uint8Array(0)}),c=t.buffer({usage:"dynamic",type:"float",data:new Uint8Array(0)}),f=t.buffer({usage:"dynamic",type:"float",data:new Uint8Array(0)}),m=t.buffer({usage:"dynamic",type:"float",data:new Uint8Array(0)}),g=t.buffer({usage:"static",type:"float",data:d}),k(e),r=t({vert:"\n\t\tprecision highp float;\n\n\t\tattribute vec2 position, positionFract;\n\t\tattribute vec4 error;\n\t\tattribute vec4 color;\n\n\t\tattribute vec2 direction, lineOffset, capOffset;\n\n\t\tuniform vec4 viewport;\n\t\tuniform float lineWidth, capSize;\n\t\tuniform vec2 scale, scaleFract, translate, translateFract;\n\n\t\tvarying vec4 fragColor;\n\n\t\tvoid main() {\n\t\t\tfragColor = color / 255.;\n\n\t\t\tvec2 pixelOffset = lineWidth * lineOffset + (capSize + lineWidth) * capOffset;\n\n\t\t\tvec2 dxy = -step(.5, direction.xy) * error.xz + step(direction.xy, vec2(-.5)) * error.yw;\n\n\t\t\tvec2 position = position + dxy;\n\n\t\t\tvec2 pos = (position + translate) * scale\n\t\t\t\t+ (positionFract + translateFract) * scale\n\t\t\t\t+ (position + translate) * scaleFract\n\t\t\t\t+ (positionFract + translateFract) * scaleFract;\n\n\t\t\tpos += pixelOffset / viewport.zw;\n\n\t\t\tgl_Position = vec4(pos * 2. - 1., 0, 1);\n\t\t}\n\t\t",frag:"\n\t\tprecision highp float;\n\n\t\tvarying vec4 fragColor;\n\n\t\tuniform float opacity;\n\n\t\tvoid main() {\n\t\t\tgl_FragColor = fragColor;\n\t\t\tgl_FragColor.a *= opacity;\n\t\t}\n\t\t",uniforms:{range:t.prop("range"),lineWidth:t.prop("lineWidth"),capSize:t.prop("capSize"),opacity:t.prop("opacity"),scale:t.prop("scale"),translate:t.prop("translate"),scaleFract:t.prop("scaleFract"),translateFract:t.prop("translateFract"),viewport:function(t,e){return[e.viewport.x,e.viewport.y,t.viewportWidth,t.viewportHeight]}},attributes:{color:{buffer:p,offset:function(t,e){return 4*e.offset},divisor:1},position:{buffer:c,offset:function(t,e){return 8*e.offset},divisor:1},positionFract:{buffer:f,offset:function(t,e){return 8*e.offset},divisor:1},error:{buffer:m,offset:function(t,e){return 16*e.offset},divisor:1},direction:{buffer:g,stride:24,offset:0},lineOffset:{buffer:g,stride:24,offset:8},capOffset:{buffer:g,stride:24,offset:16}},primitive:"triangles",blend:{enable:!0,color:[0,0,0,0],equation:{rgb:"add",alpha:"add"},func:{srcRGB:"src alpha",dstRGB:"one minus src alpha",srcAlpha:"one minus dst alpha",dstAlpha:"one"}},depth:{enable:!1},scissor:{enable:!0,box:t.prop("viewport")},viewport:t.prop("viewport"),stencil:!1,instances:t.prop("count"),count:d.length}),s(x,{update:k,draw:_,destroy:A,regl:t,gl:v,canvas:v.canvas,groups:y}),x;function x(t){t?k(t):null===t&&A(),_()}function _(e){if("number"==typeof e)return w(e);e&&!Array.isArray(e)&&(e=[e]),t._refresh(),y.forEach((function(t,r){t&&(e&&(e[r]?t.draw=!0:t.draw=!1),t.draw?w(r):t.draw=!0)}))}function w(t){"number"==typeof t&&(t=y[t]),null!=t&&t&&t.count&&t.color&&t.opacity&&t.positions&&t.positions.length>1&&(t.scaleRatio=[t.scale[0]*t.viewport.width,t.scale[1]*t.viewport.height],r(t),t.after&&t.after(t))}function k(t){if(t){null!=t.length?"number"==typeof t[0]&&(t=[{positions:t}]):Array.isArray(t)||(t=[t]);var e=0,r=0;if(x.groups=y=t.map((function(t,c){var u=y[c];return t?("function"==typeof t?t={after:t}:"number"==typeof t[0]&&(t={positions:t}),t=a(t,{color:"color colors fill",capSize:"capSize cap capsize cap-size",lineWidth:"lineWidth line-width width line thickness",opacity:"opacity alpha",range:"range dataBox",viewport:"viewport viewBox",errors:"errors error",positions:"positions position data points"}),u||(y[c]=u={id:c,scale:null,translate:null,scaleFract:null,translateFract:null,draw:!0},t=s({},b,t)),o(u,t,[{lineWidth:function(t){return.5*+t},capSize:function(t){return.5*+t},opacity:parseFloat,errors:function(t){return t=l(t),r+=t.length,t},positions:function(t,r){return t=l(t,"float64"),r.count=Math.floor(t.length/2),r.bounds=n(t,2),r.offset=e,e+=r.count,t}},{color:function(t,e){var r=e.count;if(t||(t="transparent"),!Array.isArray(t)||"number"==typeof t[0]){var n=t;t=Array(r);for(var o=0;o{"use strict";var n=r(34463),i=r(25359),o=r(34597),a=r(9994),s=r(97e3),l=r(31587),c=r(2433),u=r(91101),h=u.float32,d=u.fract32,f=r(41456),p=r(94698),m=r(72268);function g(t,e){if(!(this instanceof g))return new g(t,e);if("function"==typeof t?(e||(e={}),e.regl=t):e=t,e.length&&(e.positions=e),!(t=e.regl).hasExtension("ANGLE_instanced_arrays"))throw Error("regl-error2d: `ANGLE_instanced_arrays` extension should be enabled");this.gl=t._gl,this.regl=t,this.passes=[],this.shaders=g.shaders.has(t)?g.shaders.get(t):g.shaders.set(t,g.createShaders(t)).get(t),this.update(e)}t.exports=g,g.dashMult=2,g.maxPatternLength=256,g.precisionThreshold=3e6,g.maxPoints=1e4,g.maxLines=2048,g.shaders=new f,g.createShaders=function(t){var e,r=t.buffer({usage:"static",type:"float",data:[0,1,0,0,1,1,1,0]}),n={primitive:"triangle strip",instances:t.prop("count"),count:4,offset:0,uniforms:{miterMode:function(t,e){return"round"===e.join?2:1},miterLimit:t.prop("miterLimit"),scale:t.prop("scale"),scaleFract:t.prop("scaleFract"),translateFract:t.prop("translateFract"),translate:t.prop("translate"),thickness:t.prop("thickness"),dashTexture:t.prop("dashTexture"),opacity:t.prop("opacity"),pixelRatio:t.context("pixelRatio"),id:t.prop("id"),dashLength:t.prop("dashLength"),viewport:function(t,e){return[e.viewport.x,e.viewport.y,t.viewportWidth,t.viewportHeight]},depth:t.prop("depth")},blend:{enable:!0,color:[0,0,0,0],equation:{rgb:"add",alpha:"add"},func:{srcRGB:"src alpha",dstRGB:"one minus src alpha",srcAlpha:"one minus dst alpha",dstAlpha:"one"}},depth:{enable:function(t,e){return!e.overlay}},stencil:{enable:!1},scissor:{enable:!0,box:t.prop("viewport")},viewport:t.prop("viewport")},i=t(o({vert:"\nprecision highp float;\n\nattribute vec2 aCoord, bCoord, aCoordFract, bCoordFract;\nattribute vec4 color;\nattribute float lineEnd, lineTop;\n\nuniform vec2 scale, scaleFract, translate, translateFract;\nuniform float thickness, pixelRatio, id, depth;\nuniform vec4 viewport;\n\nvarying vec4 fragColor;\nvarying vec2 tangent;\n\nvec2 project(vec2 position, vec2 positionFract, vec2 scale, vec2 scaleFract, vec2 translate, vec2 translateFract) {\n\t// the order is important\n\treturn position * scale + translate\n + positionFract * scale + translateFract\n + position * scaleFract\n + positionFract * scaleFract;\n}\n\nvoid main() {\n\tfloat lineStart = 1. - lineEnd;\n\tfloat lineOffset = lineTop * 2. - 1.;\n\n\tvec2 diff = (bCoord + bCoordFract - aCoord - aCoordFract);\n\ttangent = normalize(diff * scale * viewport.zw);\n\tvec2 normal = vec2(-tangent.y, tangent.x);\n\n\tvec2 position = project(aCoord, aCoordFract, scale, scaleFract, translate, translateFract) * lineStart\n\t\t+ project(bCoord, bCoordFract, scale, scaleFract, translate, translateFract) * lineEnd\n\n\t\t+ thickness * normal * .5 * lineOffset / viewport.zw;\n\n\tgl_Position = vec4(position * 2.0 - 1.0, depth, 1);\n\n\tfragColor = color / 255.;\n}\n",frag:"\nprecision highp float;\n\nuniform float dashLength, pixelRatio, thickness, opacity, id;\nuniform sampler2D dashTexture;\n\nvarying vec4 fragColor;\nvarying vec2 tangent;\n\nvoid main() {\n\tfloat alpha = 1.;\n\n\tfloat t = fract(dot(tangent, gl_FragCoord.xy) / dashLength) * .5 + .25;\n\tfloat dash = texture2D(dashTexture, vec2(t, .5)).r;\n\n\tgl_FragColor = fragColor;\n\tgl_FragColor.a *= alpha * opacity * dash;\n}\n",attributes:{lineEnd:{buffer:r,divisor:0,stride:8,offset:0},lineTop:{buffer:r,divisor:0,stride:8,offset:4},aCoord:{buffer:t.prop("positionBuffer"),stride:8,offset:8,divisor:1},bCoord:{buffer:t.prop("positionBuffer"),stride:8,offset:16,divisor:1},aCoordFract:{buffer:t.prop("positionFractBuffer"),stride:8,offset:8,divisor:1},bCoordFract:{buffer:t.prop("positionFractBuffer"),stride:8,offset:16,divisor:1},color:{buffer:t.prop("colorBuffer"),stride:4,offset:0,divisor:1}}},n));try{e=t(o({cull:{enable:!0,face:"back"},vert:"\nprecision highp float;\n\nattribute vec2 aCoord, bCoord, nextCoord, prevCoord;\nattribute vec4 aColor, bColor;\nattribute float lineEnd, lineTop;\n\nuniform vec2 scale, translate;\nuniform float thickness, pixelRatio, id, depth;\nuniform vec4 viewport;\nuniform float miterLimit, miterMode;\n\nvarying vec4 fragColor;\nvarying vec4 startCutoff, endCutoff;\nvarying vec2 tangent;\nvarying vec2 startCoord, endCoord;\nvarying float enableStartMiter, enableEndMiter;\n\nconst float REVERSE_THRESHOLD = -.875;\nconst float MIN_DIFF = 1e-6;\n\n// TODO: possible optimizations: avoid overcalculating all for vertices and calc just one instead\n// TODO: precalculate dot products, normalize things beforehead etc.\n// TODO: refactor to rectangular algorithm\n\nfloat distToLine(vec2 p, vec2 a, vec2 b) {\n\tvec2 diff = b - a;\n\tvec2 perp = normalize(vec2(-diff.y, diff.x));\n\treturn dot(p - a, perp);\n}\n\nbool isNaN( float val ){\n return ( val < 0.0 || 0.0 < val || val == 0.0 ) ? false : true;\n}\n\nvoid main() {\n\tvec2 aCoord = aCoord, bCoord = bCoord, prevCoord = prevCoord, nextCoord = nextCoord;\n\n vec2 adjustedScale;\n adjustedScale.x = (abs(scale.x) < MIN_DIFF) ? MIN_DIFF : scale.x;\n adjustedScale.y = (abs(scale.y) < MIN_DIFF) ? MIN_DIFF : scale.y;\n\n vec2 scaleRatio = adjustedScale * viewport.zw;\n\tvec2 normalWidth = thickness / scaleRatio;\n\n\tfloat lineStart = 1. - lineEnd;\n\tfloat lineBot = 1. - lineTop;\n\n\tfragColor = (lineStart * aColor + lineEnd * bColor) / 255.;\n\n\tif (isNaN(aCoord.x) || isNaN(aCoord.y) || isNaN(bCoord.x) || isNaN(bCoord.y)) return;\n\n\tif (aCoord == prevCoord) prevCoord = aCoord + normalize(bCoord - aCoord);\n\tif (bCoord == nextCoord) nextCoord = bCoord - normalize(bCoord - aCoord);\n\n\n\tvec2 prevDiff = aCoord - prevCoord;\n\tvec2 currDiff = bCoord - aCoord;\n\tvec2 nextDiff = nextCoord - bCoord;\n\n\tvec2 prevTangent = normalize(prevDiff * scaleRatio);\n\tvec2 currTangent = normalize(currDiff * scaleRatio);\n\tvec2 nextTangent = normalize(nextDiff * scaleRatio);\n\n\tvec2 prevNormal = vec2(-prevTangent.y, prevTangent.x);\n\tvec2 currNormal = vec2(-currTangent.y, currTangent.x);\n\tvec2 nextNormal = vec2(-nextTangent.y, nextTangent.x);\n\n\tvec2 startJoinDirection = normalize(prevTangent - currTangent);\n\tvec2 endJoinDirection = normalize(currTangent - nextTangent);\n\n\t// collapsed/unidirectional segment cases\n\t// FIXME: there should be more elegant solution\n\tvec2 prevTanDiff = abs(prevTangent - currTangent);\n\tvec2 nextTanDiff = abs(nextTangent - currTangent);\n\tif (max(prevTanDiff.x, prevTanDiff.y) < MIN_DIFF) {\n\t\tstartJoinDirection = currNormal;\n\t}\n\tif (max(nextTanDiff.x, nextTanDiff.y) < MIN_DIFF) {\n\t\tendJoinDirection = currNormal;\n\t}\n\tif (aCoord == bCoord) {\n\t\tendJoinDirection = startJoinDirection;\n\t\tcurrNormal = prevNormal;\n\t\tcurrTangent = prevTangent;\n\t}\n\n\ttangent = currTangent;\n\n\t//calculate join shifts relative to normals\n\tfloat startJoinShift = dot(currNormal, startJoinDirection);\n\tfloat endJoinShift = dot(currNormal, endJoinDirection);\n\n\tfloat startMiterRatio = abs(1. / startJoinShift);\n\tfloat endMiterRatio = abs(1. / endJoinShift);\n\n\tvec2 startJoin = startJoinDirection * startMiterRatio;\n\tvec2 endJoin = endJoinDirection * endMiterRatio;\n\n\tvec2 startTopJoin, startBotJoin, endTopJoin, endBotJoin;\n\tstartTopJoin = sign(startJoinShift) * startJoin * .5;\n\tstartBotJoin = -startTopJoin;\n\n\tendTopJoin = sign(endJoinShift) * endJoin * .5;\n\tendBotJoin = -endTopJoin;\n\n\tvec2 aTopCoord = aCoord + normalWidth * startTopJoin;\n\tvec2 bTopCoord = bCoord + normalWidth * endTopJoin;\n\tvec2 aBotCoord = aCoord + normalWidth * startBotJoin;\n\tvec2 bBotCoord = bCoord + normalWidth * endBotJoin;\n\n\t//miter anti-clipping\n\tfloat baClipping = distToLine(bCoord, aCoord, aBotCoord) / dot(normalize(normalWidth * endBotJoin), normalize(normalWidth.yx * vec2(-startBotJoin.y, startBotJoin.x)));\n\tfloat abClipping = distToLine(aCoord, bCoord, bTopCoord) / dot(normalize(normalWidth * startBotJoin), normalize(normalWidth.yx * vec2(-endBotJoin.y, endBotJoin.x)));\n\n\t//prevent close to reverse direction switch\n\tbool prevReverse = dot(currTangent, prevTangent) <= REVERSE_THRESHOLD && abs(dot(currTangent, prevNormal)) * min(length(prevDiff), length(currDiff)) < length(normalWidth * currNormal);\n\tbool nextReverse = dot(currTangent, nextTangent) <= REVERSE_THRESHOLD && abs(dot(currTangent, nextNormal)) * min(length(nextDiff), length(currDiff)) < length(normalWidth * currNormal);\n\n\tif (prevReverse) {\n\t\t//make join rectangular\n\t\tvec2 miterShift = normalWidth * startJoinDirection * miterLimit * .5;\n\t\tfloat normalAdjust = 1. - min(miterLimit / startMiterRatio, 1.);\n\t\taBotCoord = aCoord + miterShift - normalAdjust * normalWidth * currNormal * .5;\n\t\taTopCoord = aCoord + miterShift + normalAdjust * normalWidth * currNormal * .5;\n\t}\n\telse if (!nextReverse && baClipping > 0. && baClipping < length(normalWidth * endBotJoin)) {\n\t\t//handle miter clipping\n\t\tbTopCoord -= normalWidth * endTopJoin;\n\t\tbTopCoord += normalize(endTopJoin * normalWidth) * baClipping;\n\t}\n\n\tif (nextReverse) {\n\t\t//make join rectangular\n\t\tvec2 miterShift = normalWidth * endJoinDirection * miterLimit * .5;\n\t\tfloat normalAdjust = 1. - min(miterLimit / endMiterRatio, 1.);\n\t\tbBotCoord = bCoord + miterShift - normalAdjust * normalWidth * currNormal * .5;\n\t\tbTopCoord = bCoord + miterShift + normalAdjust * normalWidth * currNormal * .5;\n\t}\n\telse if (!prevReverse && abClipping > 0. && abClipping < length(normalWidth * startBotJoin)) {\n\t\t//handle miter clipping\n\t\taBotCoord -= normalWidth * startBotJoin;\n\t\taBotCoord += normalize(startBotJoin * normalWidth) * abClipping;\n\t}\n\n\tvec2 aTopPosition = (aTopCoord) * adjustedScale + translate;\n\tvec2 aBotPosition = (aBotCoord) * adjustedScale + translate;\n\n\tvec2 bTopPosition = (bTopCoord) * adjustedScale + translate;\n\tvec2 bBotPosition = (bBotCoord) * adjustedScale + translate;\n\n\t//position is normalized 0..1 coord on the screen\n\tvec2 position = (aTopPosition * lineTop + aBotPosition * lineBot) * lineStart + (bTopPosition * lineTop + bBotPosition * lineBot) * lineEnd;\n\n\tstartCoord = aCoord * scaleRatio + translate * viewport.zw + viewport.xy;\n\tendCoord = bCoord * scaleRatio + translate * viewport.zw + viewport.xy;\n\n\tgl_Position = vec4(position * 2.0 - 1.0, depth, 1);\n\n\tenableStartMiter = step(dot(currTangent, prevTangent), .5);\n\tenableEndMiter = step(dot(currTangent, nextTangent), .5);\n\n\t//bevel miter cutoffs\n\tif (miterMode == 1.) {\n\t\tif (enableStartMiter == 1.) {\n\t\t\tvec2 startMiterWidth = vec2(startJoinDirection) * thickness * miterLimit * .5;\n\t\t\tstartCutoff = vec4(aCoord, aCoord);\n\t\t\tstartCutoff.zw += vec2(-startJoinDirection.y, startJoinDirection.x) / scaleRatio;\n\t\t\tstartCutoff = startCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw;\n\t\t\tstartCutoff += viewport.xyxy;\n\t\t\tstartCutoff += startMiterWidth.xyxy;\n\t\t}\n\n\t\tif (enableEndMiter == 1.) {\n\t\t\tvec2 endMiterWidth = vec2(endJoinDirection) * thickness * miterLimit * .5;\n\t\t\tendCutoff = vec4(bCoord, bCoord);\n\t\t\tendCutoff.zw += vec2(-endJoinDirection.y, endJoinDirection.x) / scaleRatio;\n\t\t\tendCutoff = endCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw;\n\t\t\tendCutoff += viewport.xyxy;\n\t\t\tendCutoff += endMiterWidth.xyxy;\n\t\t}\n\t}\n\n\t//round miter cutoffs\n\telse if (miterMode == 2.) {\n\t\tif (enableStartMiter == 1.) {\n\t\t\tvec2 startMiterWidth = vec2(startJoinDirection) * thickness * abs(dot(startJoinDirection, currNormal)) * .5;\n\t\t\tstartCutoff = vec4(aCoord, aCoord);\n\t\t\tstartCutoff.zw += vec2(-startJoinDirection.y, startJoinDirection.x) / scaleRatio;\n\t\t\tstartCutoff = startCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw;\n\t\t\tstartCutoff += viewport.xyxy;\n\t\t\tstartCutoff += startMiterWidth.xyxy;\n\t\t}\n\n\t\tif (enableEndMiter == 1.) {\n\t\t\tvec2 endMiterWidth = vec2(endJoinDirection) * thickness * abs(dot(endJoinDirection, currNormal)) * .5;\n\t\t\tendCutoff = vec4(bCoord, bCoord);\n\t\t\tendCutoff.zw += vec2(-endJoinDirection.y, endJoinDirection.x) / scaleRatio;\n\t\t\tendCutoff = endCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw;\n\t\t\tendCutoff += viewport.xyxy;\n\t\t\tendCutoff += endMiterWidth.xyxy;\n\t\t}\n\t}\n}\n",frag:"\nprecision highp float;\n\nuniform float dashLength, pixelRatio, thickness, opacity, id, miterMode;\nuniform sampler2D dashTexture;\n\nvarying vec4 fragColor;\nvarying vec2 tangent;\nvarying vec4 startCutoff, endCutoff;\nvarying vec2 startCoord, endCoord;\nvarying float enableStartMiter, enableEndMiter;\n\nfloat distToLine(vec2 p, vec2 a, vec2 b) {\n\tvec2 diff = b - a;\n\tvec2 perp = normalize(vec2(-diff.y, diff.x));\n\treturn dot(p - a, perp);\n}\n\nvoid main() {\n\tfloat alpha = 1., distToStart, distToEnd;\n\tfloat cutoff = thickness * .5;\n\n\t//bevel miter\n\tif (miterMode == 1.) {\n\t\tif (enableStartMiter == 1.) {\n\t\t\tdistToStart = distToLine(gl_FragCoord.xy, startCutoff.xy, startCutoff.zw);\n\t\t\tif (distToStart < -1.) {\n\t\t\t\tdiscard;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\talpha *= min(max(distToStart + 1., 0.), 1.);\n\t\t}\n\n\t\tif (enableEndMiter == 1.) {\n\t\t\tdistToEnd = distToLine(gl_FragCoord.xy, endCutoff.xy, endCutoff.zw);\n\t\t\tif (distToEnd < -1.) {\n\t\t\t\tdiscard;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\talpha *= min(max(distToEnd + 1., 0.), 1.);\n\t\t}\n\t}\n\n\t// round miter\n\telse if (miterMode == 2.) {\n\t\tif (enableStartMiter == 1.) {\n\t\t\tdistToStart = distToLine(gl_FragCoord.xy, startCutoff.xy, startCutoff.zw);\n\t\t\tif (distToStart < 0.) {\n\t\t\t\tfloat radius = length(gl_FragCoord.xy - startCoord);\n\n\t\t\t\tif(radius > cutoff + .5) {\n\t\t\t\t\tdiscard;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\talpha -= smoothstep(cutoff - .5, cutoff + .5, radius);\n\t\t\t}\n\t\t}\n\n\t\tif (enableEndMiter == 1.) {\n\t\t\tdistToEnd = distToLine(gl_FragCoord.xy, endCutoff.xy, endCutoff.zw);\n\t\t\tif (distToEnd < 0.) {\n\t\t\t\tfloat radius = length(gl_FragCoord.xy - endCoord);\n\n\t\t\t\tif(radius > cutoff + .5) {\n\t\t\t\t\tdiscard;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\talpha -= smoothstep(cutoff - .5, cutoff + .5, radius);\n\t\t\t}\n\t\t}\n\t}\n\n\tfloat t = fract(dot(tangent, gl_FragCoord.xy) / dashLength) * .5 + .25;\n\tfloat dash = texture2D(dashTexture, vec2(t, .5)).r;\n\n\tgl_FragColor = fragColor;\n\tgl_FragColor.a *= alpha * opacity * dash;\n}\n",attributes:{lineEnd:{buffer:r,divisor:0,stride:8,offset:0},lineTop:{buffer:r,divisor:0,stride:8,offset:4},aColor:{buffer:t.prop("colorBuffer"),stride:4,offset:0,divisor:1},bColor:{buffer:t.prop("colorBuffer"),stride:4,offset:4,divisor:1},prevCoord:{buffer:t.prop("positionBuffer"),stride:8,offset:0,divisor:1},aCoord:{buffer:t.prop("positionBuffer"),stride:8,offset:8,divisor:1},bCoord:{buffer:t.prop("positionBuffer"),stride:8,offset:16,divisor:1},nextCoord:{buffer:t.prop("positionBuffer"),stride:8,offset:24,divisor:1}}},n))}catch(t){e=i}return{fill:t({primitive:"triangle",elements:function(t,e){return e.triangles},offset:0,vert:"\nprecision highp float;\n\nattribute vec2 position, positionFract;\n\nuniform vec4 color;\nuniform vec2 scale, scaleFract, translate, translateFract;\nuniform float pixelRatio, id;\nuniform vec4 viewport;\nuniform float opacity;\n\nvarying vec4 fragColor;\n\nconst float MAX_LINES = 256.;\n\nvoid main() {\n\tfloat depth = (MAX_LINES - 4. - id) / (MAX_LINES);\n\n\tvec2 position = position * scale + translate\n + positionFract * scale + translateFract\n + position * scaleFract\n + positionFract * scaleFract;\n\n\tgl_Position = vec4(position * 2.0 - 1.0, depth, 1);\n\n\tfragColor = color / 255.;\n\tfragColor.a *= opacity;\n}\n",frag:"\nprecision highp float;\nvarying vec4 fragColor;\n\nvoid main() {\n\tgl_FragColor = fragColor;\n}\n",uniforms:{scale:t.prop("scale"),color:t.prop("fill"),scaleFract:t.prop("scaleFract"),translateFract:t.prop("translateFract"),translate:t.prop("translate"),opacity:t.prop("opacity"),pixelRatio:t.context("pixelRatio"),id:t.prop("id"),viewport:function(t,e){return[e.viewport.x,e.viewport.y,t.viewportWidth,t.viewportHeight]}},attributes:{position:{buffer:t.prop("positionBuffer"),stride:8,offset:8},positionFract:{buffer:t.prop("positionFractBuffer"),stride:8,offset:8}},blend:n.blend,depth:{enable:!1},scissor:n.scissor,stencil:n.stencil,viewport:n.viewport}),rect:i,miter:e}},g.defaults={dashes:null,join:"miter",miterLimit:1,thickness:10,cap:"square",color:"black",opacity:1,overlay:!1,viewport:null,range:null,close:!1,fill:null},g.prototype.render=function(){for(var t,e=[],r=arguments.length;r--;)e[r]=arguments[r];e.length&&(t=this).update.apply(t,e),this.draw()},g.prototype.draw=function(){for(var t=this,e=[],r=arguments.length;r--;)e[r]=arguments[r];return(e.length?e:this.passes).forEach((function(e,r){var n;if(e&&Array.isArray(e))return(n=t).draw.apply(n,e);"number"==typeof e&&(e=t.passes[e]),e&&e.count>1&&e.opacity&&(t.regl._refresh(),e.fill&&e.triangles&&e.triangles.length>2&&t.shaders.fill(e),e.thickness&&(e.scale[0]*e.viewport.width>g.precisionThreshold||e.scale[1]*e.viewport.height>g.precisionThreshold||"rect"===e.join||!e.join&&(e.thickness<=2||e.count>=g.maxPoints)?t.shaders.rect(e):t.shaders.miter(e)))})),this},g.prototype.update=function(t){var e=this;if(t){null!=t.length?"number"==typeof t[0]&&(t=[{positions:t}]):Array.isArray(t)||(t=[t]);var r=this.regl,u=this.gl;if(t.forEach((function(t,f){var v=e.passes[f];if(void 0!==t)if(null!==t){if("number"==typeof t[0]&&(t={positions:t}),t=a(t,{positions:"positions points data coords",thickness:"thickness lineWidth lineWidths line-width linewidth width stroke-width strokewidth strokeWidth",join:"lineJoin linejoin join type mode",miterLimit:"miterlimit miterLimit",dashes:"dash dashes dasharray dash-array dashArray",color:"color colour stroke colors colours stroke-color strokeColor",fill:"fill fill-color fillColor",opacity:"alpha opacity",overlay:"overlay crease overlap intersect",close:"closed close closed-path closePath",range:"range dataBox",viewport:"viewport viewBox",hole:"holes hole hollow",splitNull:"splitNull"}),v||(e.passes[f]=v={id:f,scale:null,scaleFract:null,translate:null,translateFract:null,count:0,hole:[],depth:0,dashLength:1,dashTexture:r.texture({channels:1,data:new Uint8Array([255]),width:1,height:1,mag:"linear",min:"linear"}),colorBuffer:r.buffer({usage:"dynamic",type:"uint8",data:new Uint8Array}),positionBuffer:r.buffer({usage:"dynamic",type:"float",data:new Uint8Array}),positionFractBuffer:r.buffer({usage:"dynamic",type:"float",data:new Uint8Array})},t=o({},g.defaults,t)),null!=t.thickness&&(v.thickness=parseFloat(t.thickness)),null!=t.opacity&&(v.opacity=parseFloat(t.opacity)),null!=t.miterLimit&&(v.miterLimit=parseFloat(t.miterLimit)),null!=t.overlay&&(v.overlay=!!t.overlay,f=F}));(O=O.slice(0,R)).push(F)}for(var P=function(t){var e=A.slice(2*I,2*O[t]).concat(F?A.slice(2*F):[]),r=(v.hole||[]).map((function(e){return e-F+(O[t]-I)})),n=l(e,r);n=n.map((function(e){return e+I+(e+I{"use strict";function n(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,o,a,s=[],l=!0,c=!1;try{if(o=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=o.call(r)).done)&&(s.push(n.value),s.length!==e);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw i}}return s}}(t,e)||i(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(t,e){if(t){if("string"==typeof t)return o(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?o(t,e):void 0}}function o(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r 1.0 + delta) {\n\t\tdiscard;\n\t}\n\n\talpha -= smoothstep(1.0 - delta, 1.0 + delta, radius);\n\n\tfloat borderRadius = fragBorderRadius;\n\tfloat ratio = smoothstep(borderRadius - delta, borderRadius + delta, radius);\n\tvec4 color = mix(fragColor, fragBorderColor, ratio);\n\tcolor.a *= alpha * opacity;\n\tgl_FragColor = color;\n}\n"]),l.vert=h(["precision highp float;\n#define GLSLIFY 1\n\nattribute float x, y, xFract, yFract;\nattribute float size, borderSize;\nattribute vec4 colorId, borderColorId;\nattribute float isActive;\n\n// `invariant` effectively turns off optimizations for the position.\n// We need this because -fast-math on M1 Macs is re-ordering\n// floating point operations in a way that causes floating point\n// precision limits to put points in the wrong locations.\ninvariant gl_Position;\n\nuniform bool constPointSize;\nuniform float pixelRatio;\nuniform vec2 paletteSize, scale, scaleFract, translate, translateFract;\nuniform sampler2D paletteTexture;\n\nconst float maxSize = 100.;\n\nvarying vec4 fragColor, fragBorderColor;\nvarying float fragBorderRadius, fragWidth;\n\nfloat pointSizeScale = (constPointSize) ? 2. : pixelRatio;\n\nbool isDirect = (paletteSize.x < 1.);\n\nvec4 getColor(vec4 id) {\n return isDirect ? id / 255. : texture2D(paletteTexture,\n vec2(\n (id.x + .5) / paletteSize.x,\n (id.y + .5) / paletteSize.y\n )\n );\n}\n\nvoid main() {\n // ignore inactive points\n if (isActive == 0.) return;\n\n vec2 position = vec2(x, y);\n vec2 positionFract = vec2(xFract, yFract);\n\n vec4 color = getColor(colorId);\n vec4 borderColor = getColor(borderColorId);\n\n float size = size * maxSize / 255.;\n float borderSize = borderSize * maxSize / 255.;\n\n gl_PointSize = (size + borderSize) * pointSizeScale;\n\n vec2 pos = (position + translate) * scale\n + (positionFract + translateFract) * scale\n + (position + translate) * scaleFract\n + (positionFract + translateFract) * scaleFract;\n\n gl_Position = vec4(pos * 2. - 1., 0., 1.);\n\n fragBorderRadius = 1. - 2. * borderSize / (size + borderSize);\n fragColor = color;\n fragBorderColor = borderColor.a == 0. || borderSize == 0. ? vec4(color.rgb, 0.) : borderColor;\n fragWidth = 1. / gl_PointSize;\n}\n"]),m&&(l.frag=l.frag.replace("smoothstep","smoothStep"),s.frag=s.frag.replace("smoothstep","smoothStep")),this.drawCircle=t(l)}y.defaults={color:"black",borderColor:"transparent",borderSize:0,size:12,opacity:1,marker:void 0,viewport:null,range:null,pixelSize:null,count:0,offset:0,bounds:null,positions:[],snap:1e4},y.prototype.render=function(){return arguments.length&&this.update.apply(this,arguments),this.draw(),this},y.prototype.draw=function(){for(var t=this,e=arguments.length,r=new Array(e),n=0;nn)?e.tree=c(t,{bounds:h}):n&&n.length&&(e.tree=n),e.tree){var d={primitive:"points",usage:"static",data:e.tree,type:"uint32"};e.elements?e.elements(d):e.elements=a.elements(d)}var f=g.float32(t);return i({data:f,usage:"dynamic"}),o({data:g.fract32(t,f),usage:"dynamic"}),l({data:new Uint8Array(u),type:"uint8",usage:"stream"}),t}},{marker:function(e,r,n){var i=r.activation;if(i.forEach((function(t){return t&&t.destroy&&t.destroy()})),i.length=0,e&&"number"!=typeof e[0]){for(var o=[],s=0,l=Math.min(e.length,r.count);s=0)return o;if(t instanceof Uint8Array||t instanceof Uint8ClampedArray)e=t;else{e=new Uint8Array(t.length);for(var a=0,s=t.length;a4*n&&(this.tooManyColors=!0),this.updatePalette(r),1===i.length?i[0]:i},y.prototype.updatePalette=function(t){if(!this.tooManyColors){var e=this.maxColors,r=this.paletteTexture,n=Math.ceil(.25*t.length/e);if(n>1)for(var i=.25*(t=t.slice()).length%e;i>>=e))<<3,(e|=r=(15<(t>>>=r))<<2)|(r=(3<(t>>>=r))<<1)|t>>>r>>1}function l(){function t(t){t:{for(var e=16;268435456>=e;e*=16)if(t<=e){t=e;break t}t=0}return 0<(e=r[s(t)>>2]).length?e.pop():new ArrayBuffer(t)}function e(t){r[s(t.byteLength)>>2].push(t)}var r=a(8,(function(){return[]}));return{alloc:t,free:e,allocType:function(e,r){var n=null;switch(e){case 5120:n=new Int8Array(t(r),0,r);break;case 5121:n=new Uint8Array(t(r),0,r);break;case 5122:n=new Int16Array(t(2*r),0,r);break;case 5123:n=new Uint16Array(t(2*r),0,r);break;case 5124:n=new Int32Array(t(4*r),0,r);break;case 5125:n=new Uint32Array(t(4*r),0,r);break;case 5126:n=new Float32Array(t(4*r),0,r);break;default:return null}return n.length!==r?n.subarray(0,r):n},freeType:function(t){e(t.buffer)}}}function c(t){return!!t&&"object"==typeof t&&Array.isArray(t.shape)&&Array.isArray(t.stride)&&"number"==typeof t.offset&&t.shape.length===t.stride.length&&(Array.isArray(t.data)||K(t.data))}function u(t,e,r,n,i,o){for(var a=0;a(i=s)&&(i=n.buffer.byteLength,5123===h?i>>=1:5125===h&&(i>>=2)),n.vertCount=i,i=a,0>a&&(i=4,1===(a=n.buffer.dimension)&&(i=0),2===a&&(i=1),3===a&&(i=4)),n.primType=i}function a(t){n.elementsCount--,delete s[t.id],t.buffer.destroy(),t.buffer=null}var s={},l=0,u={uint8:5121,uint16:5123};e.oes_element_index_uint&&(u.uint32=5125),i.prototype.bind=function(){this.buffer.bind()};var h=[];return{create:function(t,e){function s(t){if(t)if("number"==typeof t)l(t),h.primType=4,h.vertCount=0|t,h.type=5121;else{var e=null,r=35044,n=-1,i=-1,a=0,d=0;Array.isArray(t)||K(t)||c(t)?e=t:("data"in t&&(e=t.data),"usage"in t&&(r=nt[t.usage]),"primitive"in t&&(n=st[t.primitive]),"count"in t&&(i=0|t.count),"type"in t&&(d=u[t.type]),"length"in t?a=0|t.length:(a=i,5123===d||5122===d?a*=2:5125!==d&&5124!==d||(a*=4))),o(h,e,r,n,i,a,d)}else l(),h.primType=4,h.vertCount=0,h.type=5121;return s}var l=r.create(null,34963,!0),h=new i(l._buffer);return n.elementsCount++,s(t),s._reglType="elements",s._elements=h,s.subdata=function(t,e){return l.subdata(t,e),s},s.destroy=function(){a(h)},s},createStream:function(t){var e=h.pop();return e||(e=new i(r.create(null,34963,!0,!1)._buffer)),o(e,t,35040,-1,-1,0,0),e},destroyStream:function(t){h.push(t)},getElements:function(t){return"function"==typeof t&&t._elements instanceof i?t._elements:null},clear:function(){Q(s).forEach(a)}}}function v(t){for(var e=$.allocType(5123,t.length),r=0;r>>31<<15,i=(o<<1>>>24)-127,o=o>>13&1023;e[r]=-24>i?n:-14>i?n+(o+1024>>-14-i):15>=i,r.height>>=i,f(r,n[i]),t.mipmask|=1<e;++e)t.images[e]=null;return t}function L(t){for(var e=t.images,r=0;re){for(var r=0;r=--this.refCount&&P(this)}}),a.profile&&(o.getTotalTextureSize=function(){var t=0;return Object.keys(ct).forEach((function(e){t+=ct[e].stats.size})),t}),{create2D:function(e,r){function n(t,e){var r=i.texInfo;z.call(r);var o=E();return"number"==typeof t?T(o,0|t,"number"==typeof e?0|e:0|t):t?(O(r,t),S(o,t)):T(o,1,1),r.genMipmaps&&(o.mipmask=(o.width<<1)-1),i.mipmask=o.mipmask,l(i,o),i.internalformat=o.internalformat,n.width=o.width,n.height=o.height,F(i),C(o,3553),D(r,3553),R(),L(o),a.profile&&(i.stats.size=M(i.internalformat,i.type,o.width,o.height,r.genMipmaps,!1)),n.format=X[i.internalformat],n.type=J[i.type],n.mag=rt[r.magFilter],n.min=nt[r.minFilter],n.wrapS=it[r.wrapS],n.wrapT=it[r.wrapT],n}var i=new I(3553);return ct[i.id]=i,o.textureCount++,n(e,r),n.subimage=function(t,e,r,o){e|=0,r|=0,o|=0;var a=m();return l(a,i),a.width=0,a.height=0,f(a,t),a.width=a.width||(i.width>>o)-e,a.height=a.height||(i.height>>o)-r,F(i),p(a,3553,e,r,o),R(),g(a),n},n.resize=function(e,r){var o=0|e,s=0|r||o;if(o===i.width&&s===i.height)return n;n.width=i.width=o,n.height=i.height=s,F(i);for(var l=0;i.mipmask>>l;++l){var c=o>>l,u=s>>l;if(!c||!u)break;t.texImage2D(3553,l,i.format,c,u,0,i.format,i.type,null)}return R(),a.profile&&(i.stats.size=M(i.internalformat,i.type,o,s,!1,!1)),n},n._reglType="texture2d",n._texture=i,a.profile&&(n.stats=i.stats),n.destroy=function(){i.decRef()},n},createCube:function(e,r,n,i,s,c){function h(t,e,r,n,i,o){var s,c=d.texInfo;for(z.call(c),s=0;6>s;++s)v[s]=E();if("number"!=typeof t&&t){if("object"==typeof t)if(e)S(v[0],t),S(v[1],e),S(v[2],r),S(v[3],n),S(v[4],i),S(v[5],o);else if(O(c,t),u(d,t),"faces"in t)for(t=t.faces,s=0;6>s;++s)l(v[s],d),S(v[s],t[s]);else for(s=0;6>s;++s)S(v[s],t)}else for(t=0|t||1,s=0;6>s;++s)T(v[s],t,t);for(l(d,v[0]),d.mipmask=c.genMipmaps?(v[0].width<<1)-1:v[0].mipmask,d.internalformat=v[0].internalformat,h.width=v[0].width,h.height=v[0].height,F(d),s=0;6>s;++s)C(v[s],34069+s);for(D(c,34067),R(),a.profile&&(d.stats.size=M(d.internalformat,d.type,h.width,h.height,c.genMipmaps,!0)),h.format=X[d.internalformat],h.type=J[d.type],h.mag=rt[c.magFilter],h.min=nt[c.minFilter],h.wrapS=it[c.wrapS],h.wrapT=it[c.wrapT],s=0;6>s;++s)L(v[s]);return h}var d=new I(34067);ct[d.id]=d,o.cubeCount++;var v=Array(6);return h(e,r,n,i,s,c),h.subimage=function(t,e,r,n,i){r|=0,n|=0,i|=0;var o=m();return l(o,d),o.width=0,o.height=0,f(o,e),o.width=o.width||(d.width>>i)-r,o.height=o.height||(d.height>>i)-n,F(d),p(o,34069+t,r,n,i),R(),g(o),h},h.resize=function(e){if((e|=0)!==d.width){h.width=d.width=e,h.height=d.height=e,F(d);for(var r=0;6>r;++r)for(var n=0;d.mipmask>>n;++n)t.texImage2D(34069+r,n,d.format,e>>n,e>>n,0,d.format,d.type,null);return R(),a.profile&&(d.stats.size=M(d.internalformat,d.type,h.width,h.height,!1,!0)),h}},h._reglType="textureCube",h._texture=d,a.profile&&(h.stats=d.stats),h.destroy=function(){d.decRef()},h},clear:function(){for(var e=0;er;++r)if(e.mipmask&1<>r,e.height>>r,0,e.internalformat,e.type,null);else for(var n=0;6>n;++n)t.texImage2D(34069+n,r,e.internalformat,e.width>>r,e.height>>r,0,e.internalformat,e.type,null);D(e.texInfo,e.target)}))},refresh:function(){for(var e=0;ei;++i){for(c=0;ct;++t)r[t].resize(n);return e.width=e.height=n,e},_reglType:"framebufferCube",destroy:function(){r.forEach((function(t){t.destroy()}))}})},clear:function(){Q(A).forEach(g)},restore:function(){y.cur=null,y.next=null,y.dirty=!0,Q(A).forEach((function(e){e.framebuffer=t.createFramebuffer(),v(e)}))}})}function C(){this.w=this.z=this.y=this.x=this.state=0,this.buffer=null,this.size=0,this.normalized=!1,this.type=5126,this.divisor=this.stride=this.offset=0}function E(t,e,r,n,i,o,a){function s(){this.id=++h,this.attributes=[],this.elements=null,this.ownsElements=!1,this.offset=this.count=0,this.instances=-1,this.primitive=4;var t=e.oes_vertex_array_object;this.vao=t?t.createVertexArrayOES():null,d[this.id]=this,this.buffers=[]}var l=r.maxAttributes,u=Array(l);for(r=0;r=d.byteLength?l.subdata(d):(l.destroy(),r.buffers[s]=null)),r.buffers[s]||(l=r.buffers[s]=i.create(u,34962,!1,!0)),h.buffer=i.getBuffer(l),h.size=0|h.buffer.dimension,h.normalized=!1,h.type=h.buffer.dtype,h.offset=0,h.stride=0,h.divisor=0,h.state=1,t[s]=1):i.getBuffer(u)?(h.buffer=i.getBuffer(u),h.size=0|h.buffer.dimension,h.normalized=!1,h.type=h.buffer.dtype,h.offset=0,h.stride=0,h.divisor=0,h.state=1):i.getBuffer(u.buffer)?(h.buffer=i.getBuffer(u.buffer),h.size=0|(+u.size||h.buffer.dimension),h.normalized=!!u.normalized||!1,h.type="type"in u?rt[u.type]:h.buffer.dtype,h.offset=0|(u.offset||0),h.stride=0|(u.stride||0),h.divisor=0|(u.divisor||0),h.state=1):"x"in u&&(h.x=+u.x||0,h.y=+u.y||0,h.z=+u.z||0,h.w=+u.w||0,h.state=2)}for(l=0;lt&&(t=e.stats.uniformsCount)})),t},r.getMaxAttributesCount=function(){var t=0;return d.forEach((function(e){e.stats.attributesCount>t&&(t=e.stats.attributesCount)})),t}),{clear:function(){var e=t.deleteShader.bind(t);Q(c).forEach(e),c={},Q(u).forEach(e),u={},d.forEach((function(e){t.deleteProgram(e.program)})),d.length=0,h={},r.shaderCount=0},program:function(e,n,i,o){var a=h[n];a||(a=h[n]={});var f=a[e];if(f&&(f.refCount++,!o))return f;var p=new s(n,e);return r.shaderCount++,l(p,i,o),f||(a[e]=p),d.push(p),W(p,{destroy:function(){if(p.refCount--,0>=p.refCount){t.deleteProgram(p.program);var e=d.indexOf(p);d.splice(e,1),r.shaderCount--}0>=a[p.vertId].refCount&&(t.deleteShader(u[p.vertId]),delete u[p.vertId],delete h[p.fragId][p.vertId]),Object.keys(h[p.fragId]).length||(t.deleteShader(c[p.fragId]),delete c[p.fragId],delete h[p.fragId])}})},restore:function(){c={},u={};for(var t=0;t>>e|t<<32-e}function D(t,e){var r=(65535&t)+(65535&e);return(t>>16)+(e>>16)+(r>>16)<<16|65535&r}function I(t){return Array.prototype.slice.call(t)}function F(t){return I(t).join("")}function R(t){function e(){var t=[],e=[];return W((function(){t.push.apply(t,I(arguments))}),{def:function(){var r="v"+i++;return e.push(r),0>>4&15)+"0123456789abcdef".charAt(15&e);return r}(function(t){for(var e=Array(t.length>>2),r=0;r>5]|=(255&t.charCodeAt(r/8))<<24-r%32;var n,i,o,a,s,l,c,u,h,d,f,p=8*t.length;for(t=[1779033703,-1150833019,1013904242,-1521486534,1359893119,-1694144372,528734635,1541459225],r=Array(64),e[p>>5]|=128<<24-p%32,e[15+(p+64>>9<<4)]=p,u=0;uh;h++){var m;16>h?r[h]=e[h+u]:(d=h,f=D(f=O(f=r[h-2],17)^O(f,19)^f>>>10,r[h-7]),m=O(m=r[h-15],7)^O(m,18)^m>>>3,r[d]=D(D(f,m),r[h-16])),d=D(D(D(D(c,d=O(d=a,6)^O(d,11)^O(d,25)),a&s^~a&l),Tt[h]),r[h]),f=D(c=O(c=p,2)^O(c,13)^O(c,22),p&n^p&i^n&i),c=l,l=s,s=a,a=D(o,d),o=i,i=n,n=p,p=D(d,f)}t[0]=D(p,t[0]),t[1]=D(n,t[1]),t[2]=D(i,t[2]),t[3]=D(o,t[3]),t[4]=D(a,t[4]),t[5]=D(s,t[5]),t[6]=D(l,t[6]),t[7]=D(c,t[7])}for(e="",r=0;r<32*t.length;r+=8)e+=String.fromCharCode(t[r>>5]>>>24-r%32&255);return e}(function(t){for(var e,r,n="",i=-1;++i=e&&56320<=r&&57343>=r&&(e=65536+((1023&e)<<10)+(1023&r),i++),127>=e?n+=String.fromCharCode(e):2047>=e?n+=String.fromCharCode(192|e>>>6&31,128|63&e):65535>=e?n+=String.fromCharCode(224|e>>>12&15,128|e>>>6&63,128|63&e):2097151>=e&&(n+=String.fromCharCode(240|e>>>18&7,128|e>>>12&63,128|e>>>6&63,128|63&e));return n}(r))),n[e])?n[e].apply(null,a):(r=Function.apply(null,o.concat(r)),n&&(n[e]=r),r.apply(null,a))}}}function P(t){return Array.isArray(t)||K(t)||c(t)}function j(t){return t.sort((function(t,e){return"viewport"===t?-1:"viewport"===e?1:t"+e+"?"+i+".constant["+e+"]:0;"})).join(""),"}}else{","if(",s,"(",i,".buffer)){",u,"=",o,".createStream(",34962,",",i,".buffer);","}else{",u,"=",o,".getBuffer(",i,".buffer);","}",h,'="type" in ',i,"?",a.glTypes,"[",i,".type]:",u,".dtype;",l.normalized,"=!!",i,".normalized;"),n("size"),n("offset"),n("stride"),n("divisor"),r("}}"),r.exit("if(",l.isStream,"){",o,".destroyStream(",u,");","}"),l}))})),a}function T(t,e,n,i,o){function s(t){var e=c[t];e&&(d[t]=e)}var l=function(t,e){if("string"==typeof(r=t.static).frag&&"string"==typeof r.vert){if(0>1)",s],");")}function e(){r(l,".drawArraysInstancedANGLE(",[p,m,g,s],");")}f&&"null"!==f?b?t():(r("if(",f,"){"),t(),r("}else{"),e(),r("}")):e()}function a(){function t(){r(u+".drawElements("+[p,g,v,m+"<<(("+v+"-5121)>>1)"]+");")}function e(){r(u+".drawArrays("+[p,m,g]+");")}f&&"null"!==f?b?t():(r("if(",f,"){"),t(),r("}else{"),e(),r("}")):e()}var s,l,c=t.shared,u=c.gl,h=c.draw,d=n.draw,f=function(){var i=d.elements,o=e;return i?((i.contextDep&&n.contextDynamic||i.propDep)&&(o=r),i=i.append(t,o),d.elementsActive&&o("if("+i+")"+u+".bindBuffer(34963,"+i+".buffer.buffer);")):(i=o.def(),o(i,"=",h,".","elements",";","if(",i,"){",u,".bindBuffer(",34963,",",i,".buffer.buffer);}","else if(",c.vao,".currentVAO){",i,"=",t.shared.elements+".getElements("+c.vao,".currentVAO.elements);",et?"":"if("+i+")"+u+".bindBuffer(34963,"+i+".buffer.buffer);","}")),i}(),p=i("primitive"),m=i("offset"),g=function(){var i=d.count,o=e;return i?((i.contextDep&&n.contextDynamic||i.propDep)&&(o=r),i=i.append(t,o)):i=o.def(h,".","count"),i}();if("number"==typeof g){if(0===g)return}else r("if(",g,"){"),r.exit("}");Q&&(s=i("instances"),l=t.instancing);var v=f+".type",b=d.elements&&B(d.elements)&&!d.vaoActive;Q&&("number"!=typeof s||0<=s)?"string"==typeof s?(r("if(",s,">0){"),o(),r("}else if(",s,"<0){"),a(),r("}")):o():a()}function V(t,e,r,n,i){return i=(e=_()).proc("body",i),Q&&(e.instancing=i.def(e.shared.extensions,".angle_instanced_arrays")),t(e,i,r,n),e.compile().body}function H(t,e,r,n){z(t,e),r.useVAO?r.drawVAO?e(t.shared.vao,".setVAO(",r.drawVAO.append(t,e),");"):e(t.shared.vao,".setVAO(",t.shared.vao,".targetVAO);"):(e(t.shared.vao,".setVAO(null);"),D(t,e,r,n.attributes,(function(){return!0}))),I(t,e,r,n.uniforms,(function(){return!0}),!1),F(t,e,e,r)}function q(t,e,r,n){function i(){return!0}t.batchId="a1",z(t,e),D(t,e,r,n.attributes,i),I(t,e,r,n.uniforms,i,!1),F(t,e,e,r)}function Z(t,e,r,n){function i(t){return t.contextDep&&a||t.propDep}function o(t){return!i(t)}z(t,e);var a=r.contextDep,s=e.def(),l=e.def();t.shared.props=l,t.batchId=s;var c=t.scope(),u=t.scope();e(c.entry,"for(",s,"=0;",s,"<","a1",";++",s,"){",l,"=","a0","[",s,"];",u,"}",c.exit),r.needsContext&&S(t,u,r.context),r.needsFramebuffer&&C(t,u,r.framebuffer),L(t,u,r.state,i),r.profile&&i(r.profile)&&O(t,u,r,!1,!0),n?(r.useVAO?r.drawVAO?i(r.drawVAO)?u(t.shared.vao,".setVAO(",r.drawVAO.append(t,u),");"):c(t.shared.vao,".setVAO(",r.drawVAO.append(t,c),");"):c(t.shared.vao,".setVAO(",t.shared.vao,".targetVAO);"):(c(t.shared.vao,".setVAO(null);"),D(t,c,r,n.attributes,o),D(t,u,r,n.attributes,i)),I(t,c,r,n.uniforms,o,!1),I(t,u,r,n.uniforms,i,!0),F(t,c,u,r)):(e=t.global.def("{}"),n=r.shader.progVar.append(t,u),l=u.def(n,".id"),c=u.def(e,"[",l,"]"),u(t.shared.gl,".useProgram(",n,".program);","if(!",c,"){",c,"=",e,"[",l,"]=",t.link((function(e){return V(q,t,r,e,2)})),"(",n,");}",c,".call(this,a0[",s,"],",s,");"))}function X(t,r){function n(e){var n=r.shader[e];n&&(n=n.append(t,i),isNaN(n)?i.set(o.shader,"."+e,n):i.set(o.shader,"."+e,t.link(n,{stable:!0})))}var i=t.proc("scope",3);t.batchId="a2";var o=t.shared,a=o.current;if(S(t,i,r.context),r.framebuffer&&r.framebuffer.append(t,i),j(Object.keys(r.state)).forEach((function(e){var n=r.state[e],a=n.append(t,i);b(a)?a.forEach((function(r,n){isNaN(r)?i.set(t.next[e],"["+n+"]",r):i.set(t.next[e],"["+n+"]",t.link(r,{stable:!0}))})):B(n)?i.set(o.next,"."+e,t.link(a,{stable:!0})):i.set(o.next,"."+e,a)})),O(t,i,r,!0,!0),["elements","offset","count","instances","primitive"].forEach((function(e){var n=r.draw[e];n&&(n=n.append(t,i),isNaN(n)?i.set(o.draw,"."+e,n):i.set(o.draw,"."+e,t.link(n),{stable:!0}))})),Object.keys(r.uniforms).forEach((function(n){var a=r.uniforms[n].append(t,i);Array.isArray(a)&&(a="["+a.map((function(e){return isNaN(e)?e:t.link(e,{stable:!0})}))+"]"),i.set(o.uniforms,"["+t.link(e.id(n),{stable:!0})+"]",a)})),Object.keys(r.attributes).forEach((function(e){var n=r.attributes[e].append(t,i),o=t.scopeAttrib(e);Object.keys(new J).forEach((function(t){i.set(o,"."+t,n[t])}))})),r.scopeVAO){var s=r.scopeVAO.append(t,i);isNaN(s)?i.set(o.vao,".targetVAO",s):i.set(o.vao,".targetVAO",t.link(s,{stable:!0}))}n("vert"),n("frag"),0=--this.refCount&&a(this)},i.profile&&(n.getTotalRenderbufferSize=function(){var t=0;return Object.keys(u).forEach((function(e){t+=u[e].stats.size})),t}),{create:function(e,r){function a(e,r){var n=0,o=0,u=32854;if("object"==typeof e&&e?("shape"in e?(n=0|(o=e.shape)[0],o=0|o[1]):("radius"in e&&(n=o=0|e.radius),"width"in e&&(n=0|e.width),"height"in e&&(o=0|e.height)),"format"in e&&(u=s[e.format])):"number"==typeof e?(n=0|e,o="number"==typeof r?0|r:n):e||(n=o=1),n!==c.width||o!==c.height||u!==c.format)return a.width=c.width=n,a.height=c.height=o,c.format=u,t.bindRenderbuffer(36161,c.renderbuffer),t.renderbufferStorage(36161,u,n,o),i.profile&&(c.stats.size=wt[c.format]*c.width*c.height),a.format=l[c.format],a}var c=new o(t.createRenderbuffer());return u[c.id]=c,n.renderbufferCount++,a(e,r),a.resize=function(e,r){var n=0|e,o=0|r||n;return n===c.width&&o===c.height||(a.width=c.width=n,a.height=c.height=o,t.bindRenderbuffer(36161,c.renderbuffer),t.renderbufferStorage(36161,c.format,n,o),i.profile&&(c.stats.size=wt[c.format]*c.width*c.height)),a},a._reglType="renderbuffer",a._renderbuffer=c,i.profile&&(a.stats=c.stats),a.destroy=function(){c.decRef()},a},clear:function(){Q(u).forEach(a)},restore:function(){Q(u).forEach((function(e){e.renderbuffer=t.createRenderbuffer(),t.bindRenderbuffer(36161,e.renderbuffer),t.renderbufferStorage(36161,e.format,e.width,e.height)})),t.bindRenderbuffer(36161,null)}}},At=[];At[6408]=4,At[6407]=3;var Mt=[];Mt[5121]=1,Mt[5126]=4,Mt[36193]=2;var Tt=[1116352408,1899447441,-1245643825,-373957723,961987163,1508970993,-1841331548,-1424204075,-670586216,310598401,607225278,1426881987,1925078388,-2132889090,-1680079193,-1046744716,-459576895,-272742522,264347078,604807628,770255983,1249150122,1555081692,1996064986,-1740746414,-1473132947,-1341970488,-1084653625,-958395405,-710438585,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,-2117940946,-1838011259,-1564481375,-1474664885,-1035236496,-949202525,-778901479,-694614492,-200395387,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,-2067236844,-1933114872,-1866530822,-1538233109,-1090935817,-965641998],St=["x","y","z","w"],Ct="blend.func blend.equation stencil.func stencil.opFront stencil.opBack sample.coverage viewport scissor.box polygonOffset.offset".split(" "),Et={0:0,1:1,zero:0,one:1,"src color":768,"one minus src color":769,"src alpha":770,"one minus src alpha":771,"dst color":774,"one minus dst color":775,"dst alpha":772,"one minus dst alpha":773,"constant color":32769,"one minus constant color":32770,"constant alpha":32771,"one minus constant alpha":32772,"src alpha saturate":776},Lt={never:512,less:513,"<":513,equal:514,"=":514,"==":514,"===":514,lequal:515,"<=":515,greater:516,">":516,notequal:517,"!=":517,"!==":517,gequal:518,">=":518,always:519},zt={0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},Ot={cw:2304,ccw:2305},Dt=new N(!1,!1,!1,(function(){}));return function(t){function e(){if(0===$.length)k&&k.update(),et=null;else{et=Z.next(e),h();for(var t=$.length-1;0<=t;--t){var r=$[t];r&&r(O,null,0)}p.flush(),k&&k.update()}}function r(){!et&&0<$.length&&(et=Z.next(e))}function n(){et&&(Z.cancel(e),et=null)}function i(t){t.preventDefault(),n(),K.forEach((function(t){t()}))}function a(t){p.getError(),b.restore(),P.restore(),I.restore(),j.restore(),N.restore(),B.restore(),R.restore(),k&&k.restore(),U.procs.refresh(),r(),Q.forEach((function(t){t()}))}function s(t){function e(t,e){var r={},n={};return Object.keys(t).forEach((function(i){var o=t[i];if(Y.isDynamic(o))n[i]=Y.unbox(o,i);else{if(e&&Array.isArray(o))for(var a=0;a=$.length&&n()}}}}function u(){var t=G.viewport,e=G.scissor_box;t[0]=t[1]=e[0]=e[1]=0,O.viewportWidth=O.framebufferWidth=O.drawingBufferWidth=t[2]=e[2]=p.drawingBufferWidth,O.viewportHeight=O.framebufferHeight=O.drawingBufferHeight=t[3]=e[3]=p.drawingBufferHeight}function h(){O.tick+=1,O.time=f(),u(),U.procs.poll()}function d(){j.refresh(),u(),U.procs.refresh(),k&&k.update()}function f(){return(X()-A)/1e3}if(!(t=o(t)))return null;var p=t.gl,v=p.getContextAttributes();p.isContextLost();var b=function(t,e){function r(e){var r;e=e.toLowerCase();try{r=n[e]=t.getExtension(e)}catch(t){}return!!r}for(var n={},i=0;ie;++e)rt(W({framebuffer:t.framebuffer.faces[e]},t),l);else rt(t,l);else l(0,t)},prop:Y.define.bind(null,1),context:Y.define.bind(null,2),this:Y.define.bind(null,3),draw:s({}),buffer:function(t){return I.create(t,34962,!1,!1)},elements:function(t){return F.create(t,!1)},texture:j.create2D,cube:j.createCube,renderbuffer:N.create,framebuffer:B.create,framebufferCube:B.createCube,vao:R.createVAO,attributes:v,frame:c,on:function(t,e){var r;switch(t){case"frame":return c(e);case"lost":r=K;break;case"restore":r=Q;break;case"destroy":r=tt}return r.push(e),{cancel:function(){for(var t=0;t{"use strict";var n=r(59412),i=r(43362),o=r(20419)(),a=r(55572),s=r(48744),l=n("%Math.floor%");t.exports=function(t,e){if("function"!=typeof t)throw new s("`fn` is not a function");if("number"!=typeof e||e<0||e>4294967295||l(e)!==e)throw new s("`length` must be a positive 32-bit integer");var r=arguments.length>2&&!!arguments[2],n=!0,c=!0;if("length"in t&&a){var u=a(t,"length");u&&!u.configurable&&(n=!1),u&&!u.writable&&(c=!1)}return(n||c||!r)&&(o?i(t,"length",e,!0,!0):i(t,"length",e)),t}},46492:(t,e,r)=>{"use strict";var n=r(2214);t.exports=function(t,e,r){if(null==t)throw Error("First argument should be a string");if(null==e)throw Error("Separator should be a string or a RegExp");r?("string"==typeof r||Array.isArray(r))&&(r={ignore:r}):r={},null==r.escape&&(r.escape=!0),null==r.ignore?r.ignore=["[]","()","{}","<>",'""',"''","``","“”","«»"]:("string"==typeof r.ignore&&(r.ignore=[r.ignore]),r.ignore=r.ignore.map((function(t){return 1===t.length&&(t+=t),t})));var i=n.parse(t,{flat:!0,brackets:r.ignore}),o=i[0].split(e);if(r.escape){for(var a=[],s=0;s{"use strict";var n=r(37974),i=r(97883),o=r(25058),a=r(12611);t.exports=function(t){if(Array.isArray(t)&&1===t.length&&"string"==typeof t[0]&&(t=t[0]),"string"==typeof t){if(!a(t))throw Error("String is not an SVG path.");t=n(t)}if(!Array.isArray(t))throw Error("Argument should be a string or an array of path segments.");if(t=i(t),!(t=o(t)).length)return[0,0,0,0];for(var e=[1/0,1/0,-1/0,-1/0],r=0,s=t.length;re[2]&&(e[2]=l[c+0]),l[c+1]>e[3]&&(e[3]=l[c+1]);return e}},77622:(t,e,r)=>{"use strict";var n,i=r(75798),o=r(37974),a=r(61085),s=r(12611),l=r(25875),c=document.createElement("canvas"),u=c.getContext("2d");t.exports=function(t,e){if(!s(t))throw Error("Argument should be valid svg path string");var r,h;e||(e={}),e.shape?(r=e.shape[0],h=e.shape[1]):(r=c.width=e.w||e.width||200,h=c.height=e.h||e.height||200);var d=Math.min(r,h),f=e.stroke||0,p=e.viewbox||e.viewBox||i(t),m=[r/(p[2]-p[0]),h/(p[3]-p[1])],g=Math.min(m[0]||0,m[1]||0)/2;if(u.fillStyle="black",u.fillRect(0,0,r,h),u.fillStyle="white",f&&("number"!=typeof f&&(f=1),u.strokeStyle=f>0?"white":"black",u.lineWidth=Math.abs(f)),u.translate(.5*r,.5*h),u.scale(g,g),function(){if(null!=n)return n;var t=document.createElement("canvas").getContext("2d");if(t.canvas.width=t.canvas.height=1,!window.Path2D)return n=!1;var e=new Path2D("M0,0h1v1h-1v-1Z");t.fillStyle="black",t.fill(e);var r=t.getImageData(0,0,1,1);return n=r&&r.data&&255===r.data[3]}()){var v=new Path2D(t);u.fill(v),f&&u.stroke(v)}else{var b=o(t);a(u,b),u.fill(),f&&u.stroke()}return u.setTransform(1,0,0,1,0,0),l(u,{cutoff:null!=e.cutoff?e.cutoff:.5,radius:null!=e.radius?e.radius:.5*d})}},91101:t=>{"use strict";t.exports=r,t.exports.float32=t.exports.float=r,t.exports.fract32=t.exports.fract=function(t,e){if(t.length){if(t instanceof Float32Array)return new Float32Array(t.length);e instanceof Float32Array||(e=r(t));for(var n=0,i=e.length;n{"use strict";var n=r(3202);t.exports=a;var i=96;function o(t,e){var r=n(getComputedStyle(t).getPropertyValue(e));return r[0]*a(r[1],t)}function a(t,e){switch(e=e||document.body,t=(t||"px").trim().toLowerCase(),e!==window&&e!==document||(e=document.body),t){case"%":return e.clientHeight/100;case"ch":case"ex":return function(t,e){var r=document.createElement("div");r.style["font-size"]="128"+t,e.appendChild(r);var n=o(r,"font-size")/128;return e.removeChild(r),n}(t,e);case"em":return o(e,"font-size");case"rem":return o(document.body,"font-size");case"vw":return window.innerWidth/100;case"vh":return window.innerHeight/100;case"vmin":return Math.min(window.innerWidth,window.innerHeight)/100;case"vmax":return Math.max(window.innerWidth,window.innerHeight)/100;case"in":return i;case"cm":return i/2.54;case"mm":return i/25.4;case"pt":return i/72;case"pc":return i/6}return 1}},98479:(t,e,r)=>{"use strict";var n=r(38251);t.exports=function(t){if("function"!=typeof t)return!1;if(!hasOwnProperty.call(t,"length"))return!1;try{if("number"!=typeof t.length)return!1;if("function"!=typeof t.call)return!1;if("function"!=typeof t.apply)return!1}catch(t){return!1}return!n(t)}},55351:(t,e,r)=>{"use strict";var n=r(36181),i=r(50406);t.exports=function(t,e,r){r&&r.errorMessage&&(t=n(r.errorMessage));var o=t.indexOf("%v"),a=o>-1?i(e):null;if(r&&r.name){var s,l,c,u,h=t.indexOf("%n");if(h>-1)return o>-1?(h>o?(s=a,c=o,l=r.name,u=h):(s=r.name,c=h,l=a,u=o),t.slice(0,c)+s+t.slice(c+2,u)+l+t.slice(u+2)):t.slice(0,h)+r.name+t.slice(h+2)}return o>-1?t.slice(0,o)+a+t.slice(o+2):t}},81114:(t,e,r)=>{"use strict";var n=r(59738),i=r(55351);t.exports=function(t,e,r){if(r&&!n(t)){if("default"in r)return r.default;if(r.isOptional)return null}var o=new(r&&r.Error||TypeError)(i(e,t,r));throw r&&r.errorCode&&(o.code=r.errorCode),o}},74165:t=>{"use strict";t.exports=function(t){try{return t.toString()}catch(e){try{return String(t)}catch(t){return null}}}},50406:(t,e,r)=>{"use strict";var n=r(74165),i=/[\n\r\u2028\u2029]/g;t.exports=function(t){var e=n(t);return null===e?"":(e.length>100&&(e=e.slice(0,99)+"…"),e=e.replace(i,(function(t){switch(t){case"\n":return"\\n";case"\r":return"\\r";case"\u2028":return"\\u2028";case"\u2029":return"\\u2029";default:throw new Error("Unexpected character")}})))}},10818:(t,e,r)=>{"use strict";var n=r(59738),i={object:!0,function:!0,undefined:!0};t.exports=function(t){return!!n(t)&&hasOwnProperty.call(i,typeof t)}},4216:(t,e,r)=>{"use strict";var n=r(81114),i=r(15034);t.exports=function(t){if(i(t))return t;var e=arguments[1],r=e&&e.name?"Expected a plain function for %n, received %v":"%v is not a plain function";return n(t,r,e)}},15034:(t,e,r)=>{"use strict";var n=r(98479),i=/^\s*class[\s{/}]/,o=Function.prototype.toString;t.exports=function(t){return!!n(t)&&!i.test(o.call(t))}},38251:(t,e,r)=>{"use strict";var n=r(10818);t.exports=function(t){if(!n(t))return!1;try{return!!t.constructor&&t.constructor.prototype===t}catch(t){return!1}}},36181:(t,e,r)=>{"use strict";var n=r(59738),i=r(10818),o=Object.prototype.toString;t.exports=function(t){if(!n(t))return null;if(i(t)){var e=t.toString;if("function"!=typeof e)return null;if(e===o)return null}try{return""+t}catch(t){return null}}},10040:(t,e,r)=>{"use strict";var n=r(81114),i=r(59738);t.exports=function(t){if(i(t))return t;var e=arguments[1],r=e&&e.name?"Expected a value for %n, received %v":"Cannot use %v";return n(t,r,e)}},59738:t=>{"use strict";t.exports=function(t){return null!=t}},31888:(t,e,r)=>{"use strict";var n=r(88828),i=r(31338),o=r(65500).hp;r.g.__TYPEDARRAY_POOL||(r.g.__TYPEDARRAY_POOL={UINT8:i([32,0]),UINT16:i([32,0]),UINT32:i([32,0]),BIGUINT64:i([32,0]),INT8:i([32,0]),INT16:i([32,0]),INT32:i([32,0]),BIGINT64:i([32,0]),FLOAT:i([32,0]),DOUBLE:i([32,0]),DATA:i([32,0]),UINT8C:i([32,0]),BUFFER:i([32,0])});var a="undefined"!=typeof Uint8ClampedArray,s="undefined"!=typeof BigUint64Array,l="undefined"!=typeof BigInt64Array,c=r.g.__TYPEDARRAY_POOL;c.UINT8C||(c.UINT8C=i([32,0])),c.BIGUINT64||(c.BIGUINT64=i([32,0])),c.BIGINT64||(c.BIGINT64=i([32,0])),c.BUFFER||(c.BUFFER=i([32,0]));var u=c.DATA,h=c.BUFFER;function d(t){if(t){var e=t.length||t.byteLength,r=n.log2(e);u[r].push(t)}}function f(t){t=n.nextPow2(t);var e=n.log2(t),r=u[e];return r.length>0?r.pop():new ArrayBuffer(t)}function p(t){return new Uint8Array(f(t),0,t)}function m(t){return new Uint16Array(f(2*t),0,t)}function g(t){return new Uint32Array(f(4*t),0,t)}function v(t){return new Int8Array(f(t),0,t)}function b(t){return new Int16Array(f(2*t),0,t)}function y(t){return new Int32Array(f(4*t),0,t)}function x(t){return new Float32Array(f(4*t),0,t)}function _(t){return new Float64Array(f(8*t),0,t)}function w(t){return a?new Uint8ClampedArray(f(t),0,t):p(t)}function k(t){return s?new BigUint64Array(f(8*t),0,t):null}function A(t){return l?new BigInt64Array(f(8*t),0,t):null}function M(t){return new DataView(f(t),0,t)}function T(t){t=n.nextPow2(t);var e=n.log2(t),r=h[e];return r.length>0?r.pop():new o(t)}e.free=function(t){if(o.isBuffer(t))h[n.log2(t.length)].push(t);else{if("[object ArrayBuffer]"!==Object.prototype.toString.call(t)&&(t=t.buffer),!t)return;var e=t.length||t.byteLength,r=0|n.log2(e);u[r].push(t)}},e.freeUint8=e.freeUint16=e.freeUint32=e.freeBigUint64=e.freeInt8=e.freeInt16=e.freeInt32=e.freeBigInt64=e.freeFloat32=e.freeFloat=e.freeFloat64=e.freeDouble=e.freeUint8Clamped=e.freeDataView=function(t){d(t.buffer)},e.freeArrayBuffer=d,e.freeBuffer=function(t){h[n.log2(t.length)].push(t)},e.malloc=function(t,e){if(void 0===e||"arraybuffer"===e)return f(t);switch(e){case"uint8":return p(t);case"uint16":return m(t);case"uint32":return g(t);case"int8":return v(t);case"int16":return b(t);case"int32":return y(t);case"float":case"float32":return x(t);case"double":case"float64":return _(t);case"uint8_clamped":return w(t);case"bigint64":return A(t);case"biguint64":return k(t);case"buffer":return T(t);case"data":case"dataview":return M(t);default:return null}return null},e.mallocArrayBuffer=f,e.mallocUint8=p,e.mallocUint16=m,e.mallocUint32=g,e.mallocInt8=v,e.mallocInt16=b,e.mallocInt32=y,e.mallocFloat32=e.mallocFloat=x,e.mallocFloat64=e.mallocDouble=_,e.mallocUint8Clamped=w,e.mallocBigUint64=k,e.mallocBigInt64=A,e.mallocDataView=M,e.mallocBuffer=T,e.clearCache=function(){for(var t=0;t<32;++t)c.UINT8[t].length=0,c.UINT16[t].length=0,c.UINT32[t].length=0,c.INT8[t].length=0,c.INT16[t].length=0,c.INT32[t].length=0,c.FLOAT[t].length=0,c.DOUBLE[t].length=0,c.BIGUINT64[t].length=0,c.BIGINT64[t].length=0,c.UINT8C[t].length=0,u[t].length=0,h[t].length=0}},51183:t=>{var e=/[\'\"]/;t.exports=function(t){return t?(e.test(t.charAt(0))&&(t=t.substr(1)),e.test(t.charAt(t.length-1))&&(t=t.substr(0,t.length-1)),t):""}},6313:t=>{"use strict";t.exports=function(t,e,r){Array.isArray(r)||(r=[].slice.call(arguments,2));for(var n=0,i=r.length;n{t.exports=function(t){return t&&"object"==typeof t&&"function"==typeof t.copy&&"function"==typeof t.fill&&"function"==typeof t.readUInt8}},41071:(t,e,r)=>{"use strict";var n=r(68007),i=r(74205),o=r(17478),a=r(94179);function s(t){return t.call.bind(t)}var l="undefined"!=typeof BigInt,c="undefined"!=typeof Symbol,u=s(Object.prototype.toString),h=s(Number.prototype.valueOf),d=s(String.prototype.valueOf),f=s(Boolean.prototype.valueOf);if(l)var p=s(BigInt.prototype.valueOf);if(c)var m=s(Symbol.prototype.valueOf);function g(t,e){if("object"!=typeof t)return!1;try{return e(t),!0}catch(t){return!1}}function v(t){return"[object Map]"===u(t)}function b(t){return"[object Set]"===u(t)}function y(t){return"[object WeakMap]"===u(t)}function x(t){return"[object WeakSet]"===u(t)}function _(t){return"[object ArrayBuffer]"===u(t)}function w(t){return"undefined"!=typeof ArrayBuffer&&(_.working?_(t):t instanceof ArrayBuffer)}function k(t){return"[object DataView]"===u(t)}function A(t){return"undefined"!=typeof DataView&&(k.working?k(t):t instanceof DataView)}e.isArgumentsObject=n,e.isGeneratorFunction=i,e.isTypedArray=a,e.isPromise=function(t){return"undefined"!=typeof Promise&&t instanceof Promise||null!==t&&"object"==typeof t&&"function"==typeof t.then&&"function"==typeof t.catch},e.isArrayBufferView=function(t){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):a(t)||A(t)},e.isUint8Array=function(t){return"Uint8Array"===o(t)},e.isUint8ClampedArray=function(t){return"Uint8ClampedArray"===o(t)},e.isUint16Array=function(t){return"Uint16Array"===o(t)},e.isUint32Array=function(t){return"Uint32Array"===o(t)},e.isInt8Array=function(t){return"Int8Array"===o(t)},e.isInt16Array=function(t){return"Int16Array"===o(t)},e.isInt32Array=function(t){return"Int32Array"===o(t)},e.isFloat32Array=function(t){return"Float32Array"===o(t)},e.isFloat64Array=function(t){return"Float64Array"===o(t)},e.isBigInt64Array=function(t){return"BigInt64Array"===o(t)},e.isBigUint64Array=function(t){return"BigUint64Array"===o(t)},v.working="undefined"!=typeof Map&&v(new Map),e.isMap=function(t){return"undefined"!=typeof Map&&(v.working?v(t):t instanceof Map)},b.working="undefined"!=typeof Set&&b(new Set),e.isSet=function(t){return"undefined"!=typeof Set&&(b.working?b(t):t instanceof Set)},y.working="undefined"!=typeof WeakMap&&y(new WeakMap),e.isWeakMap=function(t){return"undefined"!=typeof WeakMap&&(y.working?y(t):t instanceof WeakMap)},x.working="undefined"!=typeof WeakSet&&x(new WeakSet),e.isWeakSet=function(t){return x(t)},_.working="undefined"!=typeof ArrayBuffer&&_(new ArrayBuffer),e.isArrayBuffer=w,k.working="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView&&k(new DataView(new ArrayBuffer(1),0,1)),e.isDataView=A;var M="undefined"!=typeof SharedArrayBuffer?SharedArrayBuffer:void 0;function T(t){return"[object SharedArrayBuffer]"===u(t)}function S(t){return void 0!==M&&(void 0===T.working&&(T.working=T(new M)),T.working?T(t):t instanceof M)}function C(t){return g(t,h)}function E(t){return g(t,d)}function L(t){return g(t,f)}function z(t){return l&&g(t,p)}function O(t){return c&&g(t,m)}e.isSharedArrayBuffer=S,e.isAsyncFunction=function(t){return"[object AsyncFunction]"===u(t)},e.isMapIterator=function(t){return"[object Map Iterator]"===u(t)},e.isSetIterator=function(t){return"[object Set Iterator]"===u(t)},e.isGeneratorObject=function(t){return"[object Generator]"===u(t)},e.isWebAssemblyCompiledModule=function(t){return"[object WebAssembly.Module]"===u(t)},e.isNumberObject=C,e.isStringObject=E,e.isBooleanObject=L,e.isBigIntObject=z,e.isSymbolObject=O,e.isBoxedPrimitive=function(t){return C(t)||E(t)||L(t)||z(t)||O(t)},e.isAnyArrayBuffer=function(t){return"undefined"!=typeof Uint8Array&&(w(t)||S(t))},["isProxy","isExternal","isModuleNamespaceObject"].forEach((function(t){Object.defineProperty(e,t,{enumerable:!1,value:function(){throw new Error(t+" is not supported in userland")}})}))},11276:(t,e,r)=>{var n=r(39807),i=Object.getOwnPropertyDescriptors||function(t){for(var e=Object.keys(t),r={},n=0;n=i)return t;switch(t){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(t){return"[Circular]"}default:return t}})),s=n[r];r=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),g(r)?n.showHidden=r:r&&e._extend(n,r),x(n.showHidden)&&(n.showHidden=!1),x(n.depth)&&(n.depth=2),x(n.colors)&&(n.colors=!1),x(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=u),d(n,t,n.depth)}function u(t,e){var r=c.styles[e];return r?"["+c.colors[r][0]+"m"+t+"["+c.colors[r][1]+"m":t}function h(t,e){return t}function d(t,r,n){if(t.customInspect&&r&&M(r.inspect)&&r.inspect!==e.inspect&&(!r.constructor||r.constructor.prototype!==r)){var i=r.inspect(n,t);return y(i)||(i=d(t,i,n)),i}var o=function(t,e){if(x(e))return t.stylize("undefined","undefined");if(y(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}return b(e)?t.stylize(""+e,"number"):g(e)?t.stylize(""+e,"boolean"):v(e)?t.stylize("null","null"):void 0}(t,r);if(o)return o;var a=Object.keys(r),s=function(t){var e={};return t.forEach((function(t,r){e[t]=!0})),e}(a);if(t.showHidden&&(a=Object.getOwnPropertyNames(r)),A(r)&&(a.indexOf("message")>=0||a.indexOf("description")>=0))return f(r);if(0===a.length){if(M(r)){var l=r.name?": "+r.name:"";return t.stylize("[Function"+l+"]","special")}if(_(r))return t.stylize(RegExp.prototype.toString.call(r),"regexp");if(k(r))return t.stylize(Date.prototype.toString.call(r),"date");if(A(r))return f(r)}var c,u="",h=!1,w=["{","}"];return m(r)&&(h=!0,w=["[","]"]),M(r)&&(u=" [Function"+(r.name?": "+r.name:"")+"]"),_(r)&&(u=" "+RegExp.prototype.toString.call(r)),k(r)&&(u=" "+Date.prototype.toUTCString.call(r)),A(r)&&(u=" "+f(r)),0!==a.length||h&&0!=r.length?n<0?_(r)?t.stylize(RegExp.prototype.toString.call(r),"regexp"):t.stylize("[Object]","special"):(t.seen.push(r),c=h?function(t,e,r,n,i){for(var o=[],a=0,s=e.length;a60?r[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+r[1]:r[0]+e+" "+t.join(", ")+" "+r[1]}(c,u,w)):w[0]+u+w[1]}function f(t){return"["+Error.prototype.toString.call(t)+"]"}function p(t,e,r,n,i,o){var a,s,l;if((l=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]}).get?s=l.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):l.set&&(s=t.stylize("[Setter]","special")),E(n,i)||(a="["+i+"]"),s||(t.seen.indexOf(l.value)<0?(s=v(r)?d(t,l.value,null):d(t,l.value,r-1)).indexOf("\n")>-1&&(s=o?s.split("\n").map((function(t){return" "+t})).join("\n").slice(2):"\n"+s.split("\n").map((function(t){return" "+t})).join("\n")):s=t.stylize("[Circular]","special")),x(a)){if(o&&i.match(/^\d+$/))return s;(a=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.slice(1,-1),a=t.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=t.stylize(a,"string"))}return a+": "+s}function m(t){return Array.isArray(t)}function g(t){return"boolean"==typeof t}function v(t){return null===t}function b(t){return"number"==typeof t}function y(t){return"string"==typeof t}function x(t){return void 0===t}function _(t){return w(t)&&"[object RegExp]"===T(t)}function w(t){return"object"==typeof t&&null!==t}function k(t){return w(t)&&"[object Date]"===T(t)}function A(t){return w(t)&&("[object Error]"===T(t)||t instanceof Error)}function M(t){return"function"==typeof t}function T(t){return Object.prototype.toString.call(t)}function S(t){return t<10?"0"+t.toString(10):t.toString(10)}e.debuglog=function(t){if(t=t.toUpperCase(),!a[t])if(s.test(t)){var r=n.pid;a[t]=function(){var n=e.format.apply(e,arguments);console.error("%s %d: %s",t,r,n)}}else a[t]=function(){};return a[t]},e.inspect=c,c.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},c.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},e.types=r(41071),e.isArray=m,e.isBoolean=g,e.isNull=v,e.isNullOrUndefined=function(t){return null==t},e.isNumber=b,e.isString=y,e.isSymbol=function(t){return"symbol"==typeof t},e.isUndefined=x,e.isRegExp=_,e.types.isRegExp=_,e.isObject=w,e.isDate=k,e.types.isDate=k,e.isError=A,e.types.isNativeError=A,e.isFunction=M,e.isPrimitive=function(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||void 0===t},e.isBuffer=r(26900);var C=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function E(t,e){return Object.prototype.hasOwnProperty.call(t,e)}e.log=function(){var t,r;console.log("%s - %s",(r=[S((t=new Date).getHours()),S(t.getMinutes()),S(t.getSeconds())].join(":"),[t.getDate(),C[t.getMonth()],r].join(" ")),e.format.apply(e,arguments))},e.inherits=r(9715),e._extend=function(t,e){if(!e||!w(e))return t;for(var r=Object.keys(e),n=r.length;n--;)t[r[n]]=e[r[n]];return t};var L="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function z(t,e){if(!t){var r=new Error("Promise was rejected with a falsy value");r.reason=t,t=r}return e(t)}e.promisify=function(t){if("function"!=typeof t)throw new TypeError('The "original" argument must be of type Function');if(L&&t[L]){var e;if("function"!=typeof(e=t[L]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(e,L,{value:e,enumerable:!1,writable:!1,configurable:!0}),e}function e(){for(var e,r,n=new Promise((function(t,n){e=t,r=n})),i=[],o=0;o{var n=r(64487);t.exports=function(t){return n("webgl",t)}},17478:(t,e,r)=>{"use strict";var n=r(85573),i=r(75208),o=r(61398),a=r(24310),s=r(55572),l=a("Object.prototype.toString"),c=r(15541)(),u="undefined"==typeof globalThis?r.g:globalThis,h=i(),d=a("String.prototype.slice"),f=Object.getPrototypeOf,p=a("Array.prototype.indexOf",!0)||function(t,e){for(var r=0;r-1?e:"Object"===e&&function(t){var e=!1;return n(m,(function(r,n){if(!e)try{r(t),e=d(n,1)}catch(t){}})),e}(t)}return s?function(t){var e=!1;return n(m,(function(r,n){if(!e)try{"$"+r(t)===n&&(e=d(n,1))}catch(t){}})),e}(t):null}},32688:(t,e,r)=>{"use strict";const n=r(12028);n.register([r(94646),r(72010)]),t.exports=n},90170:(t,e,r)=>{"use strict";r.d(e,{A:()=>n});const n='\n'},96144:(t,e,r)=>{"use strict";r.r(e),r.d(e,{default:()=>v});var n=r(85072),i=r.n(n),o=r(97825),a=r.n(o),s=r(77659),l=r.n(s),c=r(55056),u=r.n(c),h=r(10540),d=r.n(h),f=r(41113),p=r.n(f),m=r(5955),g={};g.styleTagTransform=p(),g.setAttributes=u(),g.insert=l().bind(null,"head"),g.domAPI=a(),g.insertStyleElement=d(),i()(m.A,g);const v=m.A&&m.A.locals?m.A.locals:void 0},85072:t=>{"use strict";var e=[];function r(t){for(var r=-1,n=0;n{"use strict";var e={};t.exports=function(t,r){var n=function(t){if(void 0===e[t]){var r=document.querySelector(t);if(window.HTMLIFrameElement&&r instanceof window.HTMLIFrameElement)try{r=r.contentDocument.head}catch(t){r=null}e[t]=r}return e[t]}(t);if(!n)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");n.appendChild(r)}},10540:t=>{"use strict";t.exports=function(t){var e=document.createElement("style");return t.setAttributes(e,t.attributes),t.insert(e,t.options),e}},55056:(t,e,r)=>{"use strict";t.exports=function(t){var e=r.nc;e&&t.setAttribute("nonce",e)}},97825:t=>{"use strict";t.exports=function(t){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var e=t.insertStyleElement(t);return{update:function(r){!function(t,e,r){var n="";r.supports&&(n+="@supports (".concat(r.supports,") {")),r.media&&(n+="@media ".concat(r.media," {"));var i=void 0!==r.layer;i&&(n+="@layer".concat(r.layer.length>0?" ".concat(r.layer):""," {")),n+=r.css,i&&(n+="}"),r.media&&(n+="}"),r.supports&&(n+="}");var o=r.sourceMap;o&&"undefined"!=typeof btoa&&(n+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(o))))," */")),e.styleTagTransform(n,t,e.options)}(e,t,r)},remove:function(){!function(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t)}(e)}}}},41113:t=>{"use strict";t.exports=function(t,e){if(e.styleSheet)e.styleSheet.cssText=t;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(t))}}},88862:(t,e,r)=>{"use strict";r.d(e,{A:()=>o});var n=r(34961),i=r.n(n);class o{constructor(t,e){this._element=t,this._parent=null,this._visible=!1,this._horizontal=this._element.classList.contains("horizontal"),this._property=this._horizontal?"width":"height";const r=this._element.dataset.bsParent;r&&(this._parent=e.querySelector(r),i()(this._parent,"this._parent")),this._element.addEventListener("transitionend",(t=>{t.target===t.currentTarget&&t.propertyName===this._property&&(this._element.classList.replace("collapsing","collapse"),this._visible&&(this._element.classList.add("show"),this._element.style.removeProperty(this._property)))}))}hide(){if(this._visible){const t=this._element.getBoundingClientRect()[this._property];this._element.style.setProperty(this._property,`${t}px`),this._element.classList.replace("collapse","collapsing"),this._element.classList.remove("show"),this._element.offsetHeight,this._element.style.removeProperty(this._property),this._visible=!1,this._parent&&u.get(this._parent)===this&&u.set(this._parent,null)}}show(){var t;if(!this._visible){this._parent&&(null===(t=u.get(this._parent))||void 0===t||t.hide(),u.set(this._parent,this));const e=this._horizontal?"scrollWidth":"scrollHeight";this._element.classList.replace("collapse","collapsing"),this._element.style.setProperty(this._property,"0");const r=this._element[e];this._element.style.setProperty(this._property,`${r}px`),this._visible=!0}}toggle(t=!this._visible){t?this.show():this.hide()}addTrigger(t){t.addEventListener("click",(t=>{t.preventDefault(),this.toggle()}))}static initialize(t=document.body){for(const e of t.querySelectorAll("[data-bs-toggle]"))if(e instanceof HTMLElement&&"bsTarget"in e.dataset){const r=t.querySelector(e.dataset.bsTarget);r&&s(r,t).addTrigger(e)}}}const a=new WeakMap,s=(l=a,c=(t,e)=>new o(t,e),(t,...e)=>{l.has(t)||l.set(t,c(t,...e));const r=l.get(t);return i()(r,"value"),r});var l,c;const u=new WeakMap},17136:(t,e,r)=>{"use strict";function n(t){return t.map((t=>[t[0],`rgb(${t[1][0]}, ${t[1][1]}, ${t[1][2]})`]))}r.d(e,{s:()=>i});const i={inferno:n([[0,[0,0,3]],[.0159,[1,1,9]],[.0317,[3,2,18]],[.0476,[6,4,27]],[.0635,[10,7,35]],[.0794,[15,9,45]],[.0952,[20,11,54]],[.1111,[26,11,64]],[.127,[32,12,74]],[.1429,[39,11,82]],[.1587,[46,10,90]],[.1746,[53,9,96]],[.1905,[60,9,101]],[.2063,[67,10,104]],[.2222,[74,11,106]],[.2381,[80,13,108]],[.254,[88,16,109]],[.2698,[95,18,110]],[.2857,[101,21,110]],[.3016,[107,23,110]],[.3175,[114,25,109]],[.3333,[120,28,109]],[.3492,[126,30,108]],[.3651,[133,32,106]],[.381,[139,34,105]],[.3968,[145,37,103]],[.4127,[152,39,101]],[.4286,[158,41,99]],[.4444,[164,44,96]],[.4603,[171,46,93]],[.4762,[177,49,90]],[.4921,[183,52,86]],[.5079,[190,56,82]],[.5238,[196,60,78]],[.5397,[201,63,74]],[.5556,[207,68,70]],[.5714,[212,72,65]],[.5873,[217,77,61]],[.6032,[221,82,56]],[.619,[226,87,51]],[.6349,[230,92,46]],[.6508,[233,98,42]],[.6667,[237,104,37]],[.6825,[240,111,31]],[.6984,[242,117,26]],[.7143,[245,124,21]],[.7302,[247,131,16]],[.746,[248,138,11]],[.7619,[250,147,6]],[.7778,[251,155,6]],[.7937,[251,162,8]],[.8095,[251,170,14]],[.8254,[251,177,22]],[.8413,[251,185,30]],[.8571,[250,193,40]],[.873,[248,201,49]],[.8889,[247,209,60]],[.9048,[245,217,72]],[.9206,[243,224,86]],[.9365,[241,232,100]],[.9524,[241,238,116]],[.9683,[242,244,133]],[.9841,[246,250,149]],[1,[252,254,164]]]),magma:n([[0,[0,0,3]],[.0159,[1,1,9]],[.0317,[3,3,17]],[.0476,[6,5,25]],[.0635,[10,7,34]],[.0794,[14,10,42]],[.0952,[18,13,51]],[.1111,[23,15,60]],[.127,[28,16,70]],[.1429,[34,17,80]],[.1587,[40,17,89]],[.1746,[47,16,98]],[.1905,[53,15,106]],[.2063,[60,15,113]],[.2222,[67,15,117]],[.2381,[74,16,121]],[.254,[82,18,124]],[.2698,[88,21,126]],[.2857,[94,23,127]],[.3016,[101,26,128]],[.3175,[107,28,128]],[.3333,[113,31,129]],[.3492,[119,33,129]],[.3651,[126,36,129]],[.381,[132,38,129]],[.3968,[138,40,129]],[.4127,[145,42,128]],[.4286,[151,44,127]],[.4444,[158,46,126]],[.4603,[164,48,125]],[.4762,[171,51,124]],[.4921,[177,53,122]],[.5079,[185,55,120]],[.5238,[192,58,117]],[.5397,[198,60,115]],[.5556,[205,63,112]],[.5714,[211,66,109]],[.5873,[217,70,106]],[.6032,[222,74,103]],[.619,[228,78,100]],[.6349,[232,84,97]],[.6508,[237,89,95]],[.6667,[240,96,93]],[.6825,[243,103,91]],[.6984,[246,110,91]],[.7143,[248,117,92]],[.7302,[249,125,93]],[.746,[251,132,96]],[.7619,[252,142,99]],[.7778,[253,149,103]],[.7937,[253,157,107]],[.8095,[253,164,112]],[.8254,[254,172,117]],[.8413,[254,179,123]],[.8571,[254,187,128]],[.873,[254,194,134]],[.8889,[254,201,141]],[.9048,[253,209,147]],[.9206,[253,216,154]],[.9365,[253,223,161]],[.9524,[252,230,168]],[.9683,[252,238,176]],[.9841,[252,245,183]],[1,[251,252,191]]]),plasma:n([[0,[12,7,134]],[.0159,[24,6,139]],[.0317,[33,5,143]],[.0476,[41,5,147]],[.0635,[49,4,150]],[.0794,[56,4,153]],[.0952,[63,3,156]],[.1111,[69,3,158]],[.127,[76,2,161]],[.1429,[82,1,163]],[.1587,[89,1,164]],[.1746,[95,0,166]],[.1905,[101,0,167]],[.2063,[108,0,168]],[.2222,[114,0,168]],[.2381,[120,1,168]],[.254,[127,3,167]],[.2698,[133,6,166]],[.2857,[139,9,164]],[.3016,[144,14,163]],[.3175,[150,18,160]],[.3333,[155,23,158]],[.3492,[160,27,155]],[.3651,[165,31,151]],[.381,[170,36,148]],[.3968,[175,40,144]],[.4127,[180,45,141]],[.4286,[184,50,137]],[.4444,[188,54,133]],[.4603,[192,59,129]],[.4762,[196,63,126]],[.4921,[200,68,122]],[.5079,[205,73,117]],[.5238,[209,78,114]],[.5397,[212,82,110]],[.5556,[215,87,107]],[.5714,[219,91,103]],[.5873,[222,96,100]],[.6032,[225,101,96]],[.619,[228,106,93]],[.6349,[231,110,90]],[.6508,[234,115,86]],[.6667,[236,120,83]],[.6825,[239,125,79]],[.6984,[241,130,76]],[.7143,[243,135,72]],[.7302,[245,141,69]],[.746,[247,146,65]],[.7619,[249,153,61]],[.7778,[250,159,58]],[.7937,[251,164,54]],[.8095,[252,170,51]],[.8254,[253,176,48]],[.8413,[253,182,45]],[.8571,[253,188,42]],[.873,[253,195,40]],[.8889,[252,201,38]],[.9048,[251,208,36]],[.9206,[250,214,36]],[.9365,[248,221,36]],[.9524,[246,228,37]],[.9683,[244,234,38]],[.9841,[242,241,38]],[1,[239,248,33]]]),viridis:n([[0,[68,1,84]],[.0159,[69,6,90]],[.0317,[70,12,95]],[.0476,[71,18,101]],[.0635,[71,24,106]],[.0794,[72,29,111]],[.0952,[72,34,115]],[.1111,[71,39,119]],[.127,[71,44,123]],[.1429,[70,49,126]],[.1587,[69,54,129]],[.1746,[67,59,131]],[.1905,[66,64,133]],[.2063,[64,68,135]],[.2222,[62,73,137]],[.2381,[60,77,138]],[.254,[58,83,139]],[.2698,[56,87,140]],[.2857,[54,91,140]],[.3016,[52,95,141]],[.3175,[50,99,141]],[.3333,[48,103,141]],[.3492,[46,107,142]],[.3651,[45,111,142]],[.381,[43,115,142]],[.3968,[42,119,142]],[.4127,[40,122,142]],[.4286,[39,126,142]],[.4444,[37,130,142]],[.4603,[36,134,141]],[.4762,[34,137,141]],[.4921,[33,141,140]],[.5079,[31,146,140]],[.5238,[31,150,139]],[.5397,[30,153,138]],[.5556,[30,157,136]],[.5714,[31,161,135]],[.5873,[32,165,133]],[.6032,[35,168,131]],[.619,[38,172,129]],[.6349,[42,176,126]],[.6508,[47,179,123]],[.6667,[53,183,120]],[.6825,[59,186,117]],[.6984,[66,190,113]],[.7143,[73,193,109]],[.7302,[81,196,104]],[.746,[89,199,100]],[.7619,[100,203,93]],[.7778,[109,206,88]],[.7937,[119,208,82]],[.8095,[129,211,76]],[.8254,[139,213,70]],[.8413,[149,215,63]],[.8571,[159,217,56]],[.873,[170,219,50]],[.8889,[181,221,43]],[.9048,[191,223,36]],[.9206,[202,224,30]],[.9365,[212,225,26]],[.9524,[223,227,24]],[.9683,[233,228,25]],[.9841,[243,229,30]],[1,[253,231,36]]]),cividis:n([[0,[0,34,77]],[.0159,[0,37,84]],[.0317,[0,40,91]],[.0476,[0,42,98]],[.0635,[0,45,105]],[.0794,[0,48,112]],[.0952,[4,50,112]],[.1111,[17,53,111]],[.127,[26,56,111]],[.1429,[33,59,110]],[.1587,[39,61,109]],[.1746,[44,64,109]],[.1905,[49,67,108]],[.2063,[54,70,108]],[.2222,[58,72,107]],[.2381,[63,75,107]],[.254,[68,79,107]],[.2698,[72,81,107]],[.2857,[76,84,108]],[.3016,[79,87,108]],[.3175,[83,90,108]],[.3333,[87,93,109]],[.3492,[90,95,109]],[.3651,[94,98,110]],[.381,[97,101,111]],[.3968,[101,104,112]],[.4127,[104,107,113]],[.4286,[108,109,114]],[.4444,[111,112,115]],[.4603,[115,115,116]],[.4762,[118,118,118]],[.4921,[121,121,119]],[.5079,[126,125,120]],[.5238,[130,128,120]],[.5397,[133,131,120]],[.5556,[137,134,120]],[.5714,[141,137,120]],[.5873,[145,140,119]],[.6032,[149,143,119]],[.619,[153,146,118]],[.6349,[157,149,117]],[.6508,[161,152,116]],[.6667,[165,155,115]],[.6825,[169,158,114]],[.6984,[173,162,113]],[.7143,[177,165,112]],[.7302,[181,168,110]],[.746,[185,171,109]],[.7619,[190,176,106]],[.7778,[195,179,104]],[.7937,[199,182,102]],[.8095,[203,186,100]],[.8254,[207,189,97]],[.8413,[212,193,94]],[.8571,[216,196,91]],[.873,[220,200,88]],[.8889,[225,204,84]],[.9048,[229,207,80]],[.9206,[234,211,76]],[.9365,[238,215,71]],[.9524,[243,218,66]],[.9683,[248,222,59]],[.9841,[253,226,52]],[1,[253,231,55]]]),seismic:n([[0,[0,0,77]],[.0159,[0,0,88]],[.0317,[0,0,99]],[.0476,[0,0,111]],[.0635,[0,0,122]],[.0794,[0,0,133]],[.0952,[0,0,144]],[.1111,[0,0,156]],[.127,[0,0,167]],[.1429,[0,0,178]],[.1587,[0,0,189]],[.1746,[0,0,200]],[.1905,[0,0,212]],[.2063,[0,0,223]],[.2222,[0,0,234]],[.2381,[0,0,245]],[.254,[5,5,255]],[.2698,[21,21,255]],[.2857,[37,37,255]],[.3016,[53,53,255]],[.3175,[69,69,255]],[.3333,[85,85,255]],[.3492,[101,101,255]],[.3651,[117,117,255]],[.381,[134,134,255]],[.3968,[150,150,255]],[.4127,[166,166,255]],[.4286,[182,182,255]],[.4444,[198,198,255]],[.4603,[214,214,255]],[.4762,[230,230,255]],[.4921,[246,246,255]],[.5079,[255,246,246]],[.5238,[255,230,230]],[.5397,[255,214,214]],[.5556,[255,198,198]],[.5714,[255,182,182]],[.5873,[255,166,166]],[.6032,[255,150,150]],[.619,[255,134,134]],[.6349,[255,117,117]],[.6508,[255,101,101]],[.6667,[255,85,85]],[.6825,[255,69,69]],[.6984,[255,53,53]],[.7143,[255,37,37]],[.7302,[255,21,21]],[.746,[255,5,5]],[.7619,[248,0,0]],[.7778,[240,0,0]],[.7937,[232,0,0]],[.8095,[224,0,0]],[.8254,[216,0,0]],[.8413,[208,0,0]],[.8571,[200,0,0]],[.873,[192,0,0]],[.8889,[184,0,0]],[.9048,[176,0,0]],[.9206,[168,0,0]],[.9365,[160,0,0]],[.9524,[152,0,0]],[.9683,[144,0,0]],[.9841,[136,0,0]],[1,[128,0,0]]]),brg:n([[0,[0,0,255]],[.0159,[8,0,248]],[.0317,[16,0,240]],[.0476,[24,0,232]],[.0635,[32,0,224]],[.0794,[40,0,216]],[.0952,[48,0,208]],[.1111,[56,0,200]],[.127,[64,0,192]],[.1429,[72,0,184]],[.1587,[80,0,176]],[.1746,[88,0,168]],[.1905,[96,0,160]],[.2063,[104,0,152]],[.2222,[112,0,144]],[.2381,[120,0,136]],[.254,[131,0,125]],[.2698,[139,0,117]],[.2857,[147,0,109]],[.3016,[155,0,101]],[.3175,[163,0,93]],[.3333,[171,0,85]],[.3492,[179,0,77]],[.3651,[187,0,69]],[.381,[195,0,61]],[.3968,[203,0,53]],[.4127,[211,0,45]],[.4286,[219,0,37]],[.4444,[227,0,29]],[.4603,[235,0,21]],[.4762,[243,0,13]],[.4921,[251,0,5]],[.5079,[251,5,0]],[.5238,[243,13,0]],[.5397,[235,21,0]],[.5556,[227,29,0]],[.5714,[219,37,0]],[.5873,[211,45,0]],[.6032,[203,53,0]],[.619,[195,61,0]],[.6349,[187,69,0]],[.6508,[179,77,0]],[.6667,[171,85,0]],[.6825,[163,93,0]],[.6984,[155,101,0]],[.7143,[147,109,0]],[.7302,[139,117,0]],[.746,[131,125,0]],[.7619,[120,136,0]],[.7778,[112,144,0]],[.7937,[104,152,0]],[.8095,[96,160,0]],[.8254,[88,168,0]],[.8413,[80,176,0]],[.8571,[72,184,0]],[.873,[64,192,0]],[.8889,[56,200,0]],[.9048,[48,208,0]],[.9206,[40,216,0]],[.9365,[32,224,0]],[.9524,[24,232,0]],[.9683,[16,240,0]],[.9841,[8,248,0]],[1,[0,255,0]]]),bwr:n([[0,[0,0,255]],[.01587,[8,8,255]],[.03175,[16,16,255]],[.04762,[24,24,255]],[.06349,[32,32,255]],[.07937,[40,40,255]],[.09524,[48,48,255]],[.1111,[56,56,255]],[.127,[64,64,255]],[.1429,[72,72,255]],[.1587,[80,80,255]],[.1746,[89,89,255]],[.1905,[97,97,255]],[.2063,[105,105,255]],[.2222,[113,113,255]],[.2381,[121,121,255]],[.254,[129,129,255]],[.2698,[137,137,255]],[.2857,[145,145,255]],[.3016,[153,153,255]],[.3175,[161,161,255]],[.3333,[170,170,255]],[.3492,[178,178,255]],[.3651,[186,186,255]],[.381,[194,194,255]],[.3968,[202,202,255]],[.4127,[210,210,255]],[.4286,[218,218,255]],[.4444,[226,226,255]],[.4603,[234,234,255]],[.4762,[242,242,255]],[.4921,[250,250,255]],[.5079,[255,250,250]],[.5238,[254,242,242]],[.5397,[255,234,234]],[.5556,[255,226,226]],[.5714,[255,218,218]],[.5873,[254,210,210]],[.6032,[255,202,202]],[.619,[255,194,194]],[.6349,[255,186,186]],[.6508,[254,178,178]],[.6667,[255,170,170]],[.6825,[255,161,161]],[.6984,[255,153,153]],[.7143,[254,145,145]],[.7302,[255,137,137]],[.746,[255,129,129]],[.7619,[255,121,121]],[.7778,[255,113,113]],[.7937,[255,105,105]],[.8095,[255,97,97]],[.8254,[255,89,89]],[.8413,[255,80,80]],[.8571,[255,72,72]],[.873,[255,64,64]],[.8889,[255,56,56]],[.9048,[255,48,48]],[.9206,[255,40,40]],[.9365,[255,32,32]],[.9524,[255,24,24]],[.9683,[255,16,16]],[.9841,[255,8,8]],[1,[255,0,0]]]),rwg:n([[0,[200,0,0]],[.01587,[201,8,8]],[.03175,[203,16,16]],[.04762,[205,24,24]],[.06349,[206,32,32]],[.07937,[208,40,40]],[.09524,[210,48,48]],[.1111,[212,56,56]],[.127,[213,64,64]],[.1429,[215,72,72]],[.1587,[217,80,80]],[.1746,[219,89,89]],[.1905,[220,97,97]],[.2063,[222,105,105]],[.2222,[224,113,113]],[.2381,[226,121,121]],[.254,[227,129,129]],[.2698,[229,137,137]],[.2857,[231,145,145]],[.3016,[233,153,153]],[.3175,[234,161,161]],[.3333,[236,170,170]],[.3492,[238,178,178]],[.3651,[240,186,186]],[.381,[241,194,194]],[.3968,[243,202,202]],[.4127,[245,210,210]],[.4286,[247,218,218]],[.4444,[248,226,226]],[.4603,[250,234,234]],[.4762,[252,242,242]],[.4921,[254,250,250]],[.5079,[250,252,250]],[.5238,[242,248,242]],[.5397,[234,244,234]],[.5556,[226,240,226]],[.5714,[218,236,218]],[.5873,[210,232,210]],[.6032,[202,228,202]],[.619,[194,224,194]],[.6349,[186,220,186]],[.6508,[178,216,178]],[.6667,[170,212,170]],[.6825,[161,208,161]],[.6984,[153,204,153]],[.7143,[145,200,145]],[.7302,[137,196,137]],[.746,[129,192,129]],[.7619,[121,188,121]],[.7778,[113,184,113]],[.7937,[105,180,105]],[.8095,[97,176,97]],[.8254,[89,172,89]],[.8413,[80,168,80]],[.8571,[72,164,72]],[.873,[64,160,64]],[.8889,[56,156,56]],[.9048,[48,152,48]],[.9206,[40,148,40]],[.9365,[32,144,32]],[.9524,[24,140,24]],[.9683,[16,136,16]],[.9841,[8,132,8]],[1,[0,128,0]]]),"twilight (periodic)":n([[0,[225,216,226]],[.0159,[221,217,224]],[.0317,[214,214,220]],[.0476,[205,210,216]],[.0635,[194,205,211]],[.0794,[182,199,207]],[.0952,[170,193,203]],[.1111,[158,187,200]],[.127,[147,180,198]],[.1429,[137,172,196]],[.1587,[128,165,195]],[.1746,[119,156,193]],[.1905,[112,149,192]],[.2063,[107,141,191]],[.2222,[102,132,189]],[.2381,[99,124,187]],[.254,[97,115,185]],[.2698,[96,106,183]],[.2857,[95,97,180]],[.3016,[94,87,176]],[.3175,[94,78,171]],[.3333,[93,67,164]],[.3492,[92,57,157]],[.3651,[90,48,149]],[.381,[88,39,139]],[.3968,[84,31,127]],[.4127,[79,25,114]],[.4286,[73,21,100]],[.4444,[66,18,87]],[.4603,[59,17,75]],[.4762,[54,16,65]],[.4921,[50,17,58]],[.5079,[49,18,55]],[.5238,[55,17,56]],[.5397,[62,17,60]],[.5556,[70,18,64]],[.5714,[80,20,68]],[.5873,[90,22,72]],[.6032,[101,25,75]],[.619,[111,28,78]],[.6349,[122,32,79]],[.6508,[131,37,80]],[.6667,[141,44,80]],[.6825,[150,50,79]],[.6984,[157,58,79]],[.7143,[164,66,79]],[.7302,[170,75,80]],[.746,[176,84,81]],[.7619,[181,93,83]],[.7778,[186,102,87]],[.7937,[190,112,91]],[.8095,[193,121,96]],[.8254,[196,131,104]],[.8413,[199,142,113]],[.8571,[201,152,123]],[.873,[203,162,135]],[.8889,[206,171,148]],[.9048,[209,180,161]],[.9206,[212,189,175]],[.9365,[216,197,188]],[.9524,[219,205,201]],[.9683,[222,211,212]],[.9841,[224,215,220]],[1,[225,216,225]]]),"twilight dark (periodic)":n([[0,[47,19,55]],[.0159,[51,17,61]],[.0317,[56,16,70]],[.0476,[62,17,81]],[.0635,[69,19,93]],[.0794,[76,22,107]],[.0952,[82,27,120]],[.1111,[86,34,133]],[.127,[89,43,144]],[.1429,[91,52,153]],[.1587,[93,62,161]],[.1746,[93,73,168]],[.1905,[94,83,173]],[.2063,[94,92,178]],[.2222,[95,101,181]],[.2381,[96,110,184]],[.254,[98,119,186]],[.2698,[101,128,188]],[.2857,[104,136,190]],[.3016,[109,145,191]],[.3175,[115,153,193]],[.3333,[124,161,194]],[.3492,[132,169,195]],[.3651,[142,176,197]],[.381,[152,183,199]],[.3968,[164,190,202]],[.4127,[176,196,205]],[.4286,[188,202,209]],[.4444,[199,208,214]],[.4603,[210,213,218]],[.4762,[217,216,222]],[.4921,[223,217,225]],[.5079,[225,216,223]],[.5238,[223,213,216]],[.5397,[221,208,207]],[.5556,[217,201,195]],[.5714,[214,193,181]],[.5873,[210,185,168]],[.6032,[207,176,154]],[.619,[204,167,141]],[.6349,[202,157,129]],[.6508,[200,147,118]],[.6667,[197,136,108]],[.6825,[195,126,100]],[.6984,[192,116,93]],[.7143,[188,107,89]],[.7302,[184,97,85]],[.746,[179,88,82]],[.7619,[173,79,80]],[.7778,[167,70,79]],[.7937,[161,62,79]],[.8095,[154,54,79]],[.8254,[146,47,79]],[.8413,[136,40,80]],[.8571,[127,34,80]],[.873,[117,30,79]],[.8889,[106,26,77]],[.9048,[95,23,74]],[.9206,[85,21,70]],[.9365,[75,19,66]],[.9524,[66,17,61]],[.9683,[58,17,58]],[.9841,[52,17,55]],[1,[47,20,54]]]),"hsv (periodic)":n([[0,[165,38,38]],[.0159,[172,57,45]],[.0317,[179,76,52]],[.0476,[187,94,59]],[.0635,[194,113,66]],[.0794,[201,132,73]],[.0952,[208,151,80]],[.1111,[215,170,87]],[.127,[222,189,94]],[.1429,[229,208,102]],[.1587,[236,227,109]],[.1746,[237,239,113]],[.1905,[223,237,110]],[.2063,[208,234,106]],[.2222,[193,230,103]],[.2381,[177,227,99]],[.254,[158,222,95]],[.2698,[143,219,91]],[.2857,[127,215,88]],[.3016,[112,212,84]],[.3175,[97,208,81]],[.3333,[81,205,77]],[.3492,[77,204,85]],[.3651,[78,205,98]],[.381,[79,207,111]],[.3968,[80,208,124]],[.4127,[82,209,137]],[.4286,[83,210,150]],[.4444,[84,211,163]],[.4603,[85,213,176]],[.4762,[86,214,189]],[.4921,[87,215,202]],[.5079,[88,214,215]],[.5238,[81,195,208]],[.5397,[74,176,201]],[.5556,[67,157,194]],[.5714,[60,138,187]],[.5873,[52,120,180]],[.6032,[45,101,173]],[.619,[38,82,166]],[.6349,[31,63,159]],[.6508,[24,44,152]],[.6667,[17,25,145]],[.6825,[17,14,141]],[.6984,[33,17,144]],[.7143,[48,20,148]],[.7302,[63,24,152]],[.746,[79,28,155]],[.7619,[98,32,160]],[.7778,[113,36,163]],[.7937,[129,39,167]],[.8095,[144,43,170]],[.8254,[159,46,174]],[.8413,[173,49,176]],[.8571,[177,50,168]],[.873,[176,48,155]],[.8889,[175,47,142]],[.9048,[174,46,129]],[.9206,[172,45,116]],[.9365,[171,44,103]],[.9524,[170,42,90]],[.9683,[169,41,77]],[.9841,[168,40,64]],[1,[166,39,51]]])}},50112:(t,e,r)=>{"use strict";r.d(e,{A:()=>n});class n{constructor(t){this._element=t,this._activeElement=null,this._open=!1;const e=document.createElement("div");document.body.appendChild(e),this.shadow=e.attachShadow({mode:"open"}),this.shadow.appendChild(this._element),this._backdrop=document.createElement("div"),this._backdrop.classList.add("modal-backdrop","fade"),this._element.addEventListener("click",(t=>{t.target===t.currentTarget&&this.close()}));for(const t of this._element.querySelectorAll('[data-bs-dismiss="modal"]'))t.addEventListener("click",(()=>{this.close()}));document.addEventListener("keydown",(t=>{"Escape"===t.key&&(t.preventDefault(),this.close())})),this._element.addEventListener("transitionend",(t=>{t.target!==t.currentTarget||this._open||this._element.style.setProperty("display","none")})),this._backdrop.addEventListener("transitionend",(()=>{this._open||(this._backdrop.remove(),this._activeElement&&this._activeElement instanceof HTMLElement&&this._activeElement.focus(),this._activeElement=null)}))}close(){this._backdrop.classList.remove("show"),this._element.classList.remove("show"),this._open=!1}open(){this._element.getRootNode().appendChild(this._backdrop),this._element.style.setProperty("display","block"),this._element.offsetHeight,this._backdrop.classList.add("show"),this._element.classList.add("show"),this._activeElement=i(),this._activeElement&&this._activeElement instanceof HTMLElement&&this._activeElement.blur(),this._open=!0}toggle(t=!this.open){t?this.open():this.close()}remove(){this.shadow.host.remove()}}function i(t=document){const e=t.activeElement;return(null==e?void 0:e.shadowRoot)?i(e.shadowRoot):e}},45127:(t,e,r)=>{"use strict";r.d(e,{Je:()=>s,W2:()=>l,qP:()=>a});var n=r(34961),i=r.n(n),o=r(91683);function a(t,e=""){return r=>{if(!t.includes(r))throw Error(`invalid property '${r}' for ${e}, are you sure the settings correspond to the current dataset?`)}}class s{constructor(t,e){this.type=t,this._value=e,this._previous_value=e,this._boundList=[],this.validate=()=>{},this.onchange=[],Object.preventExtensions(this)}get value(){return this._value}set value(t){this._update(t.toString(),"JS")}changed(t){for(const t of this._boundList)if("multival"===t.attribute){const e=this._value.split(","),r=t.element;for(const t of r.options)t.selected=e.includes(t.value)}else t.element[t.attribute]=this._value;for(const e of this.onchange)e(this._value,t)}reset(){this.value=this._previous_value}bind(t,e){let r;if("string"==typeof t&&(t=(0,o.VT)(t)),"multival"===e){r=t=>{i()(null!==t.target,"event.target !== null");const e=t.target,r=Array.from(e.options).filter((t=>t.selected)).map((t=>t.value));this._update(r.toString(),"DOM")};const e=this._value.split(",");for(const r of t.options)r.selected=e.includes(r.value)}else r=t=>{i()(null!==t.target,"event.target !== null"),this._update(t.target[e].toString(),"DOM")},t[e]=this._value;t.addEventListener("change",r),this._boundList.push({element:t,attribute:e,listener:r})}disable(){for(const t of this._boundList){const e=t.element;"disabled"in e&&(e.disabled=!0)}}enable(){for(const t of this._boundList){const e=t.element;"disabled"in e&&(e.disabled=!1)}}unbindAll(){for(const t of this._boundList)t.element.removeEventListener("change",t.listener);this._boundList=[]}_update(t,e){const r=function(t,e){if("string"===t)return e;if("int"===t)return parseInt(e,10);if("number"===t)return parseFloat(e);if("boolean"===t){if("false"===e)return!1;if("true"===e)return!0;throw Error(`invalid value for boolean: ${e}`)}throw Error(`unknown type '${t}' passed to parse`)}(this.type,t);this._value!==r&&(this.validate(r),this._previous_value=this.value,this._value=r,this.changed(e))}}class l{saveSettings(){const t={};return this.foreachOption(((e,r)=>{i()(e.length>=1,"keys.length >= 1");const n=r.value;if(void 0!==n||null!==n||!Number.isNaN(n)){let r=t;for(const t of e.slice(0,e.length-1))t in r||(r[t]={}),r=r[t];r[e[e.length-1]]=n}})),t}applySettings(t){const e=JSON.parse(JSON.stringify(t));this.foreachOption(((t,r)=>{i()(t.length>=1,"keys.length >= 1");let n,a=e;for(const e of t.slice(0,t.length-1)){if(!(e in a))return;n=a,a=a[e]}const s=t[t.length-1];if(s in a){const e=a[s];if(null==e||Number.isNaN(e))return void(0,o.R4)(`ignored setting '${s}' with invalid value '${e}'`);r.value=e,delete a[s],void 0!==n&&0===Object.keys(a).length&&(i()(t.length>=2,"keys.length >= 2"),delete n[t[t.length-2]])}})),0!==Object.keys(e).length&&(0,o.R4)(`ignored unknown settings '${JSON.stringify(e)}'`)}onSettingChange(t){this.foreachOption(((e,r)=>{r.onchange.push((r=>t(e,r)))}))}foreachOption(t){c(this,t,[])}}function c(t,e,r=[]){if(r.length>10)throw Error("setting object is too deep");for(const n in t){if(n.startsWith("_"))continue;const i=r.concat([n]),o=t[n];o instanceof s?e(i,o):"object"==typeof o&&null!==o&&c(o,e,i)}}},59838:(t,e,r)=>{"use strict";r.d(e,{O:()=>h});var n=r(34961),i=r.n(n),o=r(88862),a=r(50112),s=r(45127),l=r(91683),c=r(17136),u=r(90170);class h extends s.W2{constructor(t,e,r=[]){super(),this.bonds=new s.Je("boolean",!0),this.atoms=new s.Je("boolean",!0),this.spaceFilling=new s.Je("boolean",!1),this.atomLabels=new s.Je("boolean",!1),this.shape=new s.Je("string",""),this.unitCell=new s.Je("boolean",!1),this.rotation=new s.Je("boolean",!1),this.supercell=[new s.Je("int",1),new s.Je("int",1),new s.Je("int",1)];const n=t=>{if(!(Number.isInteger(t)&&t>0))throw Error("supercell count should be a positive integer")};this.supercell[0].validate=n,this.supercell[1].validate=n,this.supercell[2].validate=n,this.axes=new s.Je("string","off"),this.axes.validate=(0,s.qP)(["off","abc","xyz"],"axes"),this.keepOrientation=new s.Je("boolean",!1),this.playbackDelay=new s.Je("number",700),this.environments={activated:new s.Je("boolean",!0),bgColor:new s.Je("string","grey"),bgStyle:new s.Je("string","ball-stick"),center:new s.Je("boolean",!1),cutoff:new s.Je("number",4)},this.color={property:new s.Je("string","element"),min:new s.Je("number",0),max:new s.Je("number",0),transform:new s.Je("string","linear"),palette:new s.Je("string","bwr")},r.includes("element")?this.color.property.validate=(0,s.qP)(r,"color"):this.color.property.validate=(0,s.qP)(r.concat(["element"]),"color"),this.color.transform.validate=(0,s.qP)(["linear","log","sqrt","inverse"],"transform"),this.color.palette.validate=(0,s.qP)(Object.keys(c.s),"palette"),this.environments.bgColor.validate=(0,s.qP)(["grey","CPK","property"],"background atoms coloring"),this.environments.bgStyle.validate=(0,s.qP)(["ball-stick","licorice","hide"],"background atoms style"),this.environments.cutoff.validate=t=>{if(t<0)throw Error("cutoff should be a positive number")},this._positionSettingsModal=e;const{openModal:i,modal:o}=this._createSettingsHTML();this._modal=o,this._modal.shadow.adoptedStyleSheets=t.getRootNode().adoptedStyleSheets,this._openModal=i,t.appendChild(this._openModal),this._bind(r)}getModalElement(t){return(0,l.VT)(t,this._modal.shadow)}get modal(){return this._modal}remove(){this._modal.remove(),this._openModal.remove()}applySettings(t){"packedCell"in t&&(!1!==t.packedCell&&(0,l.R4)("packedCell option has been removed, but it is set to true in the settings"),delete t.packedCell),super.applySettings(t)}_createSettingsHTML(){const t=document.createElement("template");t.innerHTML=`\n
${u.A}
\n `;const e=t.content.firstChild;t.innerHTML='\n';const r=t.content.querySelector(".modal");i()(null!==r&&r instanceof HTMLElement,"modalElement !== null && modalElement instanceof HTMLElement");const n=r.querySelector(".modal-dialog");i()(null!==n&&n instanceof HTMLElement,"modalDialog !== null && modalDialog instanceof HTMLElement"),e.addEventListener("click",(()=>{if(null===n.getAttribute("data-initial-modal-positions-set")){n.setAttribute("data-initial-modal-positions-set","true"),n.parentNode.style.display="block";const{top:t,left:e}=this._positionSettingsModal(n.getBoundingClientRect());n.style.width=n.offsetWidth/1.5+"px",n.style.minWidth="500px",n.style.margin="0",n.style.position="fixed",n.style.top=`${t}px`,n.style.left=`${e}px`}s.open()})),(0,l.eB)(n,".modal-header"),r.addEventListener("keydown",(t=>t.stopPropagation()));const s=new a.A(r);return o.A.initialize(r),{modal:s,openModal:e}}_bind(t){this.atomLabels.bind(this.getModalElement("atom-labels"),"checked");const e=this.getModalElement("shapes");this.shape.bind(e,"multival"),this.spaceFilling.bind(this.getModalElement("space-filling"),"checked"),this.bonds.bind(this.getModalElement("bonds"),"checked"),this.atoms.bind(this.getModalElement("atoms"),"checked"),this.rotation.bind(this.getModalElement("rotation"),"checked"),this.unitCell.bind(this.getModalElement("unit-cell"),"checked"),this.supercell[0].bind(this.getModalElement("supercell-a"),"value"),this.supercell[1].bind(this.getModalElement("supercell-b"),"value"),this.supercell[2].bind(this.getModalElement("supercell-c"),"value");const r=this.getModalElement("atom-color-property");r.options.length=0,t.includes("element")||r.options.add(new Option("element","element"));for(const e of t)r.options.add(new Option(e,e));this.color.property.bind(r,"value"),this.color.transform.bind(this.getModalElement("atom-color-transform"),"value"),this.color.min.bind(this.getModalElement("atom-color-min"),"value"),this.color.max.bind(this.getModalElement("atom-color-max"),"value");const n=this.getModalElement("atom-color-palette");n.options.length=0;for(const t in c.s)n.options.add(new Option(t,t));this.color.palette.bind(n,"value"),this.axes.bind(this.getModalElement("axes"),"value"),this.keepOrientation.bind(this.getModalElement("keep-orientation"),"checked"),this.playbackDelay.bind(this.getModalElement("playback-delay"),"value"),this.environments.activated.bind(this.getModalElement("env-activated"),"checked"),this.environments.bgColor.bind(this.getModalElement("env-bg-color"),"value"),this.environments.bgStyle.bind(this.getModalElement("env-bg-style"),"value"),this.environments.cutoff.bind(this.getModalElement("env-cutoff"),"value"),this.environments.center.bind(this.getModalElement("env-center"),"checked")}}},14761:(t,e,r)=>{"use strict";r.d(e,{C1:()=>b,N2:()=>k,Nh:()=>_,T:()=>x,i3:()=>y,iy:()=>v});var n=r(34961),i=r.n(n),o=r(37821);function a(t,e){return{x:t.x+e.x,y:t.y+e.y,z:t.z+e.z}}function s(t,e){return{x:t.x-e.x,y:t.y-e.y,z:t.z-e.z}}function l(t,e){return{x:t.x*e,y:t.y*e,z:t.z*e}}function c(t,e){return t.x*e.x+t.y*e.y+t.z*e.z}function u(t,e){return{x:t.y*e.z-t.z*e.y,y:t.z*e.x-t.x*e.z,z:t.x*e.y-t.y*e.x}}function h(t,e,r){const n=new o.Quaternion(t.x,t.y,t.z,0);return n.multiplyQuaternions(e.clone(),n),n.multiply(e.clone().inverse()),a({x:n.x,y:n.y,z:n.z},r)}function d(t,e){const r=[],n=[];for(let e=0;e1e-6)throw Error(`orientation must be normalized to 1 for "${e}" shapes`);return""}function g(t){return"number"==typeof t&&Number.isInteger(t)&&t>=0}class v extends f{constructor(t){super(t),this.radius=(t.radius||1)*this.scale}static validateParameters(t){return"radius"in t?"orientation"in t?'"orientation" has no effect on a sphere shape':"number"!=typeof t.radius?'"radius" must be a number in "sphere" shape':"":'"radius" is required for "sphere" shapes'}outputTo3Dmol(t,e=20){const r=p([this.radius,this.radius,this.radius],e),n=r.vertices,i=r.indices,o=[],s=[];for(const t of n){const e=a(t,this.position);o.push(e);const r={x:t.x/Math.pow(this.radius,2),y:t.y/Math.pow(this.radius,2),z:t.z/Math.pow(this.radius,2)};s.push(r)}return{vertexArr:o,normalArr:s,faceArr:i,color:t}}}class b extends f{constructor(t){super(t),i()(t.semiaxes,"data.semiaxes"),this.semiaxes=[this.scale*t.semiaxes[0],this.scale*t.semiaxes[1],this.scale*t.semiaxes[2]]}static validateParameters(t){if(!("semiaxes"in t))return'"semiaxes" is required for "ellipsoid" shapes';if(!Array.isArray(t.semiaxes)||3!==t.semiaxes.length)return'"semiaxes" must be an array with 3 elements for "ellipsoid" shapes';const[e,r,n]=t.semiaxes;if("number"!=typeof e||"number"!=typeof r||"number"!=typeof n)return'"semiaxes" elements must be numbers for "ellipsoid" shapes';if("orientation"in t){const e=m(t.orientation,"ellipsoid");if(""!==e)return e}return""}outputTo3Dmol(t,e=20){const r=p(this.semiaxes,e),n=r.vertices,i=r.indices,o=[],a=[];for(const t of n){const e=h(t,this.orientation,this.position);o.push(e);const r=h({x:t.x/Math.pow(this.semiaxes[0],2),y:t.y/Math.pow(this.semiaxes[1],2),z:t.z/Math.pow(this.semiaxes[2],2)},this.orientation,{x:0,y:0,z:0});a.push(r)}return{vertexArr:o,normalArr:a,faceArr:i,color:t}}}class y extends f{constructor(t){super(t),i()(t.vector,"data.vector"),this.vector=[this.scale*t.vector[0],this.scale*t.vector[1],this.scale*t.vector[2]],this.baseRadius=this.scale*(t.baseRadius||.1),this.headRadius=this.scale*(t.headRadius||.15),this.headLength=this.scale*(t.headLength||.2)}static validateParameters(t){if(!("vector"in t))return'"vector" is required for "arrow" shapes';if(!Array.isArray(t.vector)||3!==t.vector.length)return'"vector" must be an array with 3 elements for "vector" shapes';const[e,r,n]=t.vector;return"number"!=typeof e||"number"!=typeof r||"number"!=typeof n?'"vector" elements must be numbers for "vector" shapes':"orientation"in t?'"orientation" cannot be used on "arrow" shapes. define "vector" instead':""}outputTo3Dmol(t,e=20){const r=function(t,e,r,n,i=20){const[o,s,h]=t,d={x:o,y:s,z:h},f=Math.sqrt(o*o+s*s+h*h);n>f&&(n=f);const p={x:d.x*(1-n/f),y:d.y*(1-n/f),z:d.z*(1-n/f)},m=l(d,1/f);let g;g=0!==m.x||0!==m.y?{x:0,y:0,z:1}:{x:0,y:1,z:0};let v=a(g,l(m,-c(g,m)));v=l(v,1/Math.sqrt(c(v,v)));const b=u(v,m),y=[];for(let t=0;t=w&&(r.addCustom(t),t.vertexArr.length=0,Array.isArray(t.normalArr)&&(t.normalArr.length=0),Array.isArray(t.faceArr)&&(t.faceArr.length=0),Array.isArray(t.color)&&(t.color.length=0)),t.faceArr&&e.faceArr&&t.vertexArr){const r=null!==(n=t.vertexArr.length)&&void 0!==n?n:0,i=e.faceArr.map((t=>t+r));t.faceArr.push(...i)}if(t.vertexArr&&e.vertexArr&&(null===(i=t.vertexArr)||void 0===i||i.push(...e.vertexArr)),t.normalArr&&e.normalArr&&(null===(o=t.normalArr)||void 0===o||o.push(...e.normalArr)),e.vertexArr&&Array.isArray(t.color)){const r=e.color&&!Array.isArray(e.color)?e.color:16777215,n=Array(null!==(a=e.vertexArr.length)&&void 0!==a?a:0).fill(r);t.color.push(...n)}}},79352:(t,e,r)=>{"use strict";r.d(e,{MoleculeViewer:()=>v});var n=r(34961),i=r.n(n),o=r(37821);const a={H:.37,He:.32,Li:1.34,Be:.9,B:.82,C:.77,N:.75,O:.73,F:.71,Ne:.69,Na:1.54,Mg:1.3,Al:1.18,Si:1.11,P:1.06,S:1.02,Cl:.99,Ar:.97,K:1.96,Ca:1.74,Sc:1.44,Ti:1.56,V:1.25,Mn:1.39,Fe:1.25,Co:1.26,Ni:1.21,Cu:1.38,Zn:1.31,Ga:1.26,Ge:1.22,Se:1.16,Br:1.14,Kr:1.1,Rb:2.11,Sr:1.92,Y:1.62,Zr:1.48,Nb:1.37,Mo:1.45,Tc:1.56,Ru:1.26,Rh:1.35,Pd:1.31,Ag:1.53,Cd:1.48,In:1.44,Sn:1.41,Sb:1.38,Te:1.35,I:1.33,Xe:1.3,Cs:2.25,Ba:1.98,Lu:1.6,Hf:1.5,Ta:1.38,W:1.46,Re:1.59,Os:1.44,Ir:1.37,Pt:1.28,Au:1.44,Hg:1.49,Tl:1.48,Pb:1.47,Bi:1.46,Rn:1.45};function s(t){return a[t]||1.6}function l(t,e){if("X"===t.elem||"X"===e.elem)return!1;let r=s(t.elem)+s(e.elem);r+=.25,r*=r;let n=t.x-e.x;if(n*=n,n>r)return!1;let i=t.y-e.y;if(i*=i,i>r)return!1;let o=t.z-e.z;if(o*=o,o>r)return!1;const a=n+i+o;return!(isNaN(a)||a<.5||a>r)}function c(t,e){for(let r=0;r-1&&-1===navigator.userAgent.indexOf("CriOS")&&-1===navigator.userAgent.indexOf("FxiOS");function g(){return m?.87:.7}class v{constructor(t,e){const r=(0,h.V6)(t),n=document.createElement("div");r.appendChild(n),n.style.setProperty("height","100%"),this._shadow=n.attachShadow({mode:"open"}),this._root=document.createElement("div"),this._shadow.appendChild(this._root),this._root.style.position="relative",this._root.style.width="100%",this._root.style.height="100%";const a=o.createViewer(this._root,{antialias:!0,defaultcolors:o.elementColors.Jmol,backgroundColor:"0xffffff",backgroundAlpha:0,disableFog:!0,orthographic:!0});if(void 0===a)throw Error("unable to create WebGL canvas");this._viewer=a,this.onselect=()=>{},this._cellInfo=document.createElement("span"),this._cellInfo.classList.add("chsp-cell-info","chsp-hide-if-no-cell","badge","bg-light","text-dark"),this._root.appendChild(this._cellInfo);const s=new CSSStyleSheet,l=new CSSStyleSheet,c=new CSSStyleSheet,u=new CSSStyleSheet;this._styles={noCell:s,noEnvs:l,noShape:c,noProperties:u},this._shadow.adoptedStyleSheets=[...r.getRootNode().adoptedStyleSheets,s,l,c,u],this._options=new f.O(this._root,(t=>this.positionSettingsModal(t)),e),this._options.modal.shadow.adoptedStyleSheets=[...this._options.modal.shadow.adoptedStyleSheets,s,l,c,u],this._colorReset=this._options.getModalElement("atom-color-reset"),this._colorMoreOptions=this._options.getModalElement("atom-color-more-options"),this._colorMoreOptions.disabled=!0,this._connectOptions(),this._trajectoryOptions=this._options.getModalElement("trajectory-settings-group"),this.positionSettingsModal=t=>{const e=this._root.getBoundingClientRect();return{left:e.left+e.width/2-t.width/2,top:e.top+20}},this._root.addEventListener("wheel",(t=>{if(t.isTrusted){t.preventDefault(),t.stopImmediatePropagation();const e=new Event("wheel");Object.assign(e,{ctrlKey:!0,detail:t.detail,wheelDelta:t.wheelDelta,pageX:t.pageX,pageY:t.pageY}),i()(t.target,"event.target"),t.target.dispatchEvent(e)}}),{capture:!0}),window.addEventListener("resize",(()=>this.resize())),window.requestAnimationFrame((()=>{window.dispatchEvent(new Event("resize"))}))}refreshOptions(t,e){const r=this._options.modal.shadow.adoptedStyleSheets;this._options.remove(),this._options=new f.O(this._root,(t=>this.positionSettingsModal(t)),e),this._options.modal.shadow.adoptedStyleSheets=r,this._colorReset=this._options.getModalElement("atom-color-reset"),this._colorMoreOptions=this._options.getModalElement("atom-color-more-options"),this._trajectoryOptions=this._options.getModalElement("trajectory-settings-group"),this._colorReset.disabled=!0,this._colorMoreOptions.disabled=!0,this._connectOptions(),t?this._options.environments.activated.enable():this._options.environments.activated.disable()}remove(){null!==this._root.parentElement&&(this._root.parentElement.innerHTML=""),this._options.remove()}resize(){this._viewer.resize(),this._updateColorBar()}natoms(){return void 0===this._current?void 0:this._current.structure.size}set environments(t){this._environments=t}load(t,e,r={},n){let a,s,l,c,h;if(this.resize(),this._properties=e,void 0!==this._highlighted&&(a=this._defaultCutoff(this._highlighted.center)),this._environments=r.environments,s=void 0===r.keepOrientation?this._options.keepOrientation.value:r.keepOrientation,void 0===r.supercell?[l,c,h]=[this._options.supercell[0].value,this._options.supercell[1].value,this._options.supercell[2].value]:([l,c,h]=r.supercell,this._options.supercell[0].value=l,this._options.supercell[1].value=c,this._options.supercell[2].value=h),void 0===this._initialSupercell&&(this._initialSupercell=[l,c,h],this._resetSupercell.innerHTML=`reset ${l}x${c}x${h} supercell`),void 0===t.cell?this._styles.noCell.replaceSync(".chsp-hide-if-no-cell { display: none; }"):this._styles.noCell.replaceSync(""),this._showSupercellInfo(),void 0!==r.trajectory&&r.trajectory?this._trajectoryOptions.style.display="block":this._trajectoryOptions.style.display="none",this._options.unitCell.value&&void 0!==this._current&&this._viewer.removeUnitCell(this._current.model),this._viewer.removeAllModels(),void 0!==this._current)for(const t of this._current.atomLabels)this._viewer.removeLabel(t);void 0!==this._highlighted&&(this._viewer.removeModel(this._highlighted.model),this._highlighted=void 0),this._current={model:this._viewer.addModel(),structure:t,atomLabels:[]},function(t,e){if(void 0!==e.cell){const r=e.cell,n=new o.Matrix3(r[0],r[3],r[6],r[1],r[4],r[7],r[2],r[5],r[8]);t.setCrystMatrix(n)}const r=[];for(let t=0;t{n&&n()}))}_setEnvironmentInteractions(){if(void 0===this._environments)return;const t=this._environments.filter((t=>void 0!==t)).map((t=>t.center));for(const t of this._viewer.selectedAtoms({}))t.clickable=!1,t.hoverable=!1;i()(void 0!==this._current,"this._current !== undefined"),this._viewer.setClickable({model:this._current.model,index:t},!0,(t=>this._selectAtom(t))),this._setHoverable(t)}highlight(t){let e;void 0!==this._highlighted&&(e=this._defaultCutoff(this._highlighted.center)),this._changeHighlighted(t,e),this._updateStyle();const r=this._options.environments.center.value;void 0!==this._highlighted&&r&&(this._options.keepOrientation.value||this._resetView(),this._centerView()),this._viewer.render()}applySettings(t){this._options.applySettings(t)}saveSettings(){return this._options.saveSettings()}onSettingChange(t){this._options.onSettingChange(t)}exportPNG(){return this._viewer.pngURI()}_setHoverable(t){i()(void 0!==this._current,"this._current !== undefined"),this._viewer.setHoverDuration(0);const e=this.natoms();i()(void 0!==e,"n_atoms !== undefined");const r=new Map;this._viewer.setHoverable({model:this._current.model,index:t},!0,(t=>{if(i()(void 0!==t.index,"atom.index !== undefined"),void 0!==r.get(t.index))return;const e=this._viewer.addModel();e.addAtoms([t]),e.setStyle({},this._centralStyle(.3));const n=e.selectedAtoms({});n[0].clickable=!1,n[0].hoverable=!1,r.set(t.index,e),this._viewer.render()}),(t=>{i()(void 0!==t.index,"atom.index !== undefined");const e=r.get(t.index);void 0!==e&&(this._viewer.removeModel(e),r.delete(t.index),this._viewer.render())}))}_connectOptions(){const t=()=>{this._updateStyle(),this._viewer.render()};this._options.spaceFilling.onchange.push(t),this._options.bonds.onchange.push(t),this._options.atoms.onchange.push(t),this._options.atomLabels.onchange.push((t=>{if(void 0!==this._current)if(t){i()(0===this._current.atomLabels.length,"this._current.atomLabels.length === 0");const t=this._current.structure;for(let e=0;ethis._addAxes(t))),this._options.rotation.onchange.push((t=>{t?this._viewer.spin("vy"):this._viewer.spin(!1)})),this._options.unitCell.onchange.push((t=>{void 0!==this._current&&(t?this._viewer.addUnitCell(this._current.model,{box:{color:"black"},astyle:{hidden:!0},bstyle:{hidden:!0},cstyle:{hidden:!0}}):this._viewer.removeUnitCell(this._current.model),this._viewer.render())})),this._options.shape.onchange.push((()=>{void 0!==this._current&&(this._updateStyle(),this._viewer.render())}));const e=()=>{if(this._showSupercellInfo(),void 0===this._current)return;const t=this._current.model.selectedAtoms({});this._current.model.removeAtoms(t.splice(this._current.structure.size));const e=this._options.supercell[0].value,r=this._options.supercell[1].value,n=this._options.supercell[2].value;if(1===e&&1===r&&1===n||this._viewer.replicateUnitCell(this._options.supercell[0].value,this._options.supercell[1].value,this._options.supercell[2].value,this._current.model),u(this._current.model.selectedAtoms({})),void 0!==this._highlighted){const t=this._defaultCutoff(this._highlighted.center);this._changeHighlighted(this._highlighted.center,t)}this._environmentsEnabled()&&this._setEnvironmentInteractions(),this._updateStyle(),this._viewer.render()};this._options.supercell[0].onchange.push(e),this._options.supercell[1].onchange.push(e),this._options.supercell[2].onchange.push(e),this._options.environments.bgColor.onchange.push(t),this._options.environments.bgStyle.onchange.push(t),this._options.environments.cutoff.onchange.push((()=>{if(void 0!==this._highlighted){const t=this._defaultCutoff(this._highlighted.center);this._changeHighlighted(this._highlighted.center,t)}t()})),this._options.environments.center.onchange.push((t=>{this._options.keepOrientation.value||this._resetView(),t&&this._centerView(),this._viewer.render()})),this._options.environments.activated.onchange.push((e=>{if(this._enableEnvironmentSettings(e),e){i()(void 0!==this._lastHighlighted,"this._lastHighlighted !== undefined"),this._options.environments.cutoff.value=this._lastHighlighted.cutoff;const t=this._lastHighlighted.center,e=this._defaultCutoff(t);this._changeHighlighted(t,e)}else i()(void 0!==this._highlighted,"this._highlighted !== undefined"),this._viewer.removeModel(this._highlighted.model),this._lastHighlighted={center:this._highlighted.center,cutoff:this._options.environments.cutoff.value};t()})),this._options.color.property.onchange.push((()=>{const e=this._options.color.property.value;if("element"!==e){this._options.color.transform.enable(),this._options.color.transform.value="linear",this._options.color.min.enable(),this._options.color.max.enable(),this._colorReset.disabled=!1,this._colorMoreOptions.disabled=!1,this._options.color.palette.enable();const t=this._colorValues(e,"linear");t.some((t=>null===t))&&(0,h.R4)("The selected structure has undefined properties for some atoms, these atoms will be colored in light gray.");const{max:r,min:n}=(0,h.GI)(t);this._options.color.min.value=Number.NEGATIVE_INFINITY,this._options.color.max.value=r,this._options.color.min.value=n,this._setScaleStep([n,r])}else this._options.color.transform.disable(),this._options.color.min.disable(),this._options.color.max.disable(),this._options.getModalElement("atom-color-extra").classList.contains("show")&&this._colorMoreOptions.click(),this._colorReset.disabled=!0,this._colorMoreOptions.disabled=!0,this._options.color.palette.disable(),this._viewer.setColorByElement({},o.elementColors.Jmol);this._updateColorBar(),t()}));const r=e=>{const r=this._options.color.min.value,n=this._options.color.max.value;if(r>n)return(0,h.R4)("The inserted min and max values in color are such that min > max! The last inserted value was reset."),void("min"===e?this._options.color.min.reset():this._options.color.max.reset());this._setScaleStep([r,n]),this._updateColorBar(),t()};this._options.color.transform.onchange.push((()=>{const e=this._options.color.property.value;i()("element"!==e,"property !== 'element'");const r=this._options.color.transform.value,n=this._colorValues(e,r),{min:o,max:a}=(0,h.GI)(n);this._options.color.min.value=Number.NEGATIVE_INFINITY,this._options.color.max.value=a,this._options.color.min.value=o,this._setScaleStep([o,a]),this._updateColorBar(),t()})),this._options.color.min.onchange.push((()=>{r("min"),t()})),this._options.color.max.onchange.push((()=>{r("max"),t()})),this._colorReset.addEventListener("click",(()=>{const e=JSON.parse(JSON.stringify(this._properties))[this._options.color.property.value].filter((t=>!isNaN(Number(t)))),[r,n]=[Math.min(...e),Math.max(...e)];this._options.color.min.value=r,this._options.color.max.value=n,this._setScaleStep([r,n]),this._updateColorBar(),t()})),this._options.color.palette.onchange.push((()=>{this._updateColorBar(),t()})),this._resetEnvCutoff=this._options.getModalElement("env-reset"),this._resetEnvCutoff.onclick=()=>{i()(void 0!==this._highlighted,"this._highlighted !== undefined"),this._options.environments.cutoff.value=this._defaultCutoff(this._highlighted.center),t()},this._options.getModalElement("align-x").onclick=()=>this._viewAlong([1,0,0]),this._options.getModalElement("align-y").onclick=()=>this._viewAlong([0,1,0]),this._options.getModalElement("align-z").onclick=()=>this._viewAlong([0,0,1]),this._options.getModalElement("align-a").onclick=()=>{if(void 0===this._current||void 0===this._current.structure.cell)return;const t=this._current.structure.cell,e=[t[0],t[1],t[2]];this._viewAlong(e)},this._options.getModalElement("align-b").onclick=()=>{if(void 0===this._current||void 0===this._current.structure.cell)return;const t=this._current.structure.cell,e=[t[3],t[4],t[5]];this._viewAlong(e)},this._options.getModalElement("align-c").onclick=()=>{if(void 0===this._current||void 0===this._current.structure.cell)return;const t=this._current.structure.cell,e=[t[6],t[7],t[8]];this._viewAlong(e)},this._resetSupercell=this._options.getModalElement("reset-supercell"),this._resetSupercell.onclick=()=>{i()(void 0!==this._initialSupercell,"this._initialSupercell !== undefined"),this._options.supercell[0].value=this._initialSupercell[0],this._options.supercell[1].value=this._initialSupercell[1],this._options.supercell[2].value=this._initialSupercell[2]},this._root.ondblclick=()=>{this._resetView(),this._options.environments.center.value&&this._centerView(),this._viewer.render()}}_selectAtom(t){i()(void 0!==t.serial,"atom.serial !== undefined"),this.onselect(t.serial)}_updateStyle(){void 0!==this._current&&(""!==this._options.shape.value&&this._addShapes(),this._environmentsEnabled()?(i()(void 0!==this._highlighted,"this._highlighted !== undefined"),this._current.model.setStyle({},this._hiddenStyle()),this._current.model.setStyle({index:this._highlighted.center},this._centralStyle(.4),!0),this._highlighted.model.setStyle({},this._mainStyle())):this._current.model.setStyle({},this._mainStyle()))}_addAxes(t){if(void 0!==this._axes&&(this._viewer.removeShape(this._axes[0].arrow),this._viewer.removeLabel(this._axes[0].label),this._viewer.removeShape(this._axes[1].arrow),this._viewer.removeLabel(this._axes[1].label),this._viewer.removeShape(this._axes[2].arrow),this._viewer.removeLabel(this._axes[2].label),this._axes=void 0),"off"===t);else if("xyz"===t)this._axes=[this._addLabeledArrow([2,0,0],"red","X"),this._addLabeledArrow([0,2,0],"green","Y"),this._addLabeledArrow([0,0,2],"blue","Z")];else if("abc"===t){if(void 0===this._current||void 0===this._current.structure.cell)return;const t=this._current.structure.cell,e=[t[0],t[1],t[2]],r=[t[3],t[4],t[5]],n=[t[6],t[7],t[8]];this._axes=[this._addLabeledArrow(e,"red","A"),this._addLabeledArrow(r,"green","B"),this._addLabeledArrow(n,"blue","C")]}this._viewer.render()}_addShapes(){if(void 0===this._current)return;if(""===this._options.shape.value)return;this._viewer.removeAllShapes(),this._options.unitCell.value&&this._viewer.addUnitCell(this._current.model,{box:{color:"black"},astyle:{hidden:!0},bstyle:{hidden:!0},cstyle:{hidden:!0}}),this._addAxes(this._options.axes.value),i()(0===this._current.atomLabels.length,"this._current.atomLabels.length === 0");const t=this._current.structure;i()(!(void 0===t.shapes),"!(structure.shapes === undefined)");const e=this._options.shape.value.split(","),r={vertexArr:[],normalArr:[],faceArr:[],color:[]},n=this._colorFunction(),a={};for(const s of e){if(""===s)continue;i()(s in t.shapes,"shape in structure.shapes");const e=t.shapes[s];let l=this._options.supercell[0].value,c=this._options.supercell[1].value,u=this._options.supercell[2].value,h=this._current.structure.cell;void 0===h&&(h=[1,0,0,0,1,0,0,0,1],(l>1||c>1||u>1)&&(l=1,c=1,u=1));for(let s=0;s0&&this._viewer.addCustom(r),this._viewer.render()}_mainStyle(){const t={};return this._options.atoms.value&&(t.sphere={scale:this._options.spaceFilling.value?1:.22,colorfunc:this._colorFunction()}),this._options.bonds.value&&(t.stick={radius:.15,colorfunc:this._colorFunction()}),t}_colorValues(t,e){i()(void 0!==this._properties,"this._properties !== undefined"),i()(Object.keys(this._properties).includes(t),"Object.keys(this._properties).includes(property)");let r=JSON.parse(JSON.stringify(this._properties[t])),n=t=>t;return"log"===e?n=Math.log10:"sqrt"===e?n=Math.sqrt:"inverse"===e&&(n=t=>1/t),r=r.map((t=>null===t||isNaN(t)?t:n(t))),r}_colorFunction(){if(void 0===this._properties)return;const t=this._options.color.property.value;if("element"===t)return;const e=this._options.color.transform.value,r=this._colorValues(t,e),n=this._options.color.min.value,a=this._options.color.max.value,s=p.s[this._options.color.palette.value],l=[];for(let t=0;t{i()(void 0!==t.serial,"atom.serial !== undefined");const e=r[t.serial];return null===e?14540253:isNaN(e)?2236962:Number.isFinite(n)&&Number.isFinite(a)?c.valueToHex(e):2236962}}_hiddenStyle(){const t={},e=this._options.environments.bgStyle.value;"hide"===e||("licorice"===e||"ball-stick"===e?(t.stick={radius:.149,opacity:g(),hidden:!this._options.bonds.value},"ball-stick"===e&&""===this._options.shape.value&&(t.sphere={scale:this._options.spaceFilling.value?.999:.219,opacity:g()})):(0,h.HB)());const r=this._options.environments.bgColor.value;return"CPK"===r||("grey"===r?(void 0!==t.stick&&(t.stick.color=8421504),void 0!==t.sphere&&(t.sphere.color=8421504)):"property"===r?(void 0!==t.stick&&(t.stick={radius:.149,opacity:g(),hidden:!this._options.bonds.value,colorfunc:this._colorFunction()}),void 0!==t.sphere&&(t.sphere={scale:this._options.spaceFilling.value?.999:.219,opacity:g(),colorfunc:this._colorFunction()})):(0,h.HB)()),t}_centralStyle(t){return{sphere:{scale:t,color:"green",opacity:g()}}}_showSupercellInfo(){const t=this._options.supercell[0].value,e=this._options.supercell[1].value,r=this._options.supercell[2].value;this._cellInfo.innerText=1!==t||1!==e||1!==r?`${t}x${e}x${r} supercell`:""}_environmentsEnabled(){return void 0!==this._highlighted&&!this._resetEnvCutoff.disabled}_enableEnvironmentSettings(t){const e=this._options.getModalElement("env-activated").nextElementSibling;i()(null!==e,"toggle !== null");const r=this._resetEnvCutoff;if(t){if(this._environmentsEnabled())return;r.disabled=!1,e.innerText="Disable",this._options.environments.cutoff.enable(),this._options.environments.bgStyle.enable(),this._options.environments.bgColor.enable()}else{if(!this._environmentsEnabled())return;r.disabled=!0,e.innerText="Enable",this._options.environments.cutoff.disable(),this._options.environments.bgStyle.disable(),this._options.environments.bgColor.disable()}}_defaultCutoff(t){i()(void 0!==this._environments,"this._environments !== undefined");const e=this._environments[t];return i()(void 0!==e,"environment !== undefined"),e.cutoff}_changeHighlighted(t,e){if(void 0!==this._highlighted&&this._viewer.removeModel(this._highlighted.model),void 0===t)this._options.environments.cutoff.value=0,this._highlighted=void 0;else{if(void 0===this._environments)throw Error("can not highlight an atom without having a list of environments");const r=this._environments[t];if(void 0===r)throw Error(`can not highlight atom ${t}: it is not part of the list of environments`);const n=this._options.environments.cutoff.value;void 0!==e&&e!==n||(this._options.environments.cutoff.value=r.cutoff);const i={or:[{index:t},{within:{distance:this._options.environments.cutoff.value,sel:{index:t}}}]};this._highlighted={model:this._viewer.createModelFrom(i),center:t},this._highlighted.model.setStyle({},this._mainStyle())}}_resetView(){this._viewer.zoomTo(),this._viewer.zoom(2),this._viewer.setSlab(-1e3,1e3)}_centerView(){void 0!==this._highlighted&&void 0!==this._current&&this._viewer.center({index:this._highlighted.center,model:this._current.model})}_viewAlong(t){const e=Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]),r=Math.acos(t[2]/e),n=[t[1]/e*Math.sin(r/2),-t[0]/e*Math.sin(r/2),0,Math.cos(r/2)],i=this._viewer.getView();i[4]=n[0],i[5]=n[1],i[6]=n[2],i[7]=n[3],this._viewer.setView(i)}_addLabeledArrow(t,e,r){const n=new o.Vector3(t[0],t[1],t[2]);return{arrow:this._viewer.addArrow({start:new o.Vector3(0,0,0),end:n,radius:.1,color:e,midpos:-1}),label:this._viewer.addLabel(r,{position:n,inFront:!0,fontColor:"black",fontSize:14,showBackground:!1})}}_setScaleStep(t){if(void 0!==t){const e=Math.round((t[1]-t[0])/20*Math.pow(10,10))/Math.pow(10,10),r=this._options.getModalElement("atom-color-min"),n=this._options.getModalElement("atom-color-max");r.step=`${e}`,n.step=`${e}`}}_colorTitle(){let t=this._options.color.property.value;switch(this._options.color.transform.value){case"inverse":t=`(${t})⁻¹`;break;case"log":t=`log10(${t})`;break;case"sqrt":t=`√(${t})`}return t}_addColorBar(){var t,e;const r=this._options.color.palette.value,n=this._colorTitle(),a=null===(t=this._viewer.container)||void 0===t?void 0:t.clientWidth,s=null===(e=this._viewer.container)||void 0===e?void 0:e.clientHeight;i()(void 0!==a&&void 0!==s,"viewerWidth !== undefined && viewerHeight !== undefined");const l=s-80,c=document.createElement("canvas");c.width=20,c.height=l;const u=p.s[r],h=c.getContext("2d");if(!h)throw new Error("Could not get 2D context from canvas");const d=h.createLinearGradient(0,l,0,0);for(let t=0;t0){if(t<1e4&&t>.009){if(Number.isInteger(t))return t.toString();{let e=t.toFixed(3).substring(0,4);return"."===e[3]&&(e=e.substring(0,3)),e}}return t.toExponential(0).replace("+","")}if(t>-1e3&&t<-.09){if(Number.isInteger(t))return t.toString();{let e=t.toFixed(3).substring(0,4);return"."===e[3]&&(e=e.substring(0,3)),e}}return t.toExponential(0).replace("+","")}},91683:(t,e,r)=>{"use strict";r.d(e,{eK:()=>l,GI:()=>m,El:()=>b,HL:()=>f,Nl:()=>h,VT:()=>d,V6:()=>v,o:()=>p,Lz:()=>u,eB:()=>o,R4:()=>s,HB:()=>g});var n=r(34961),i=r.n(n);function o(t,e){const r=t.querySelector(e);if(null===r)throw Error(`no element matching '${e}'`);const n=e=>{const r=t.dragOffset;i()(void 0!==r,"offset !== undefined");const n=e.clientX-r.x,o=e.clientY-r.y;t.style.left=`${n}px`,t.style.top=`${o}px`},o=()=>{document.removeEventListener("mousemove",n),document.removeEventListener("mouseup",o)};r.addEventListener("mousedown",(e=>{const r=e;t.dragOffset={x:r.clientX-t.offsetLeft,y:r.clientY-t.offsetTop},t.style.left=`${t.offsetLeft}px`,t.style.top=`${t.offsetTop}px`,t.style.width=`${t.offsetWidth}px`,t.style.margin="0",t.style.position="absolute",document.addEventListener("mousemove",n,!1),document.addEventListener("mouseup",o,!1)}),!1)}const a=[t=>console.warn(t)];function s(t){for(const e of a)e(t)}function l(t){a.push(t)}const c=["red","yellow","green","blue","orange","aqua","purple","teal","silver"];function u(t){for(const e of c)if(!t.includes(e))return e;throw Error("required more colors than available")}function h(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(t=>{const e=16*Math.random()|0;return("x"===t?e:3&e|8).toString(16)}))}function d(t,e=document){let r;if(r=e instanceof HTMLElement?e.querySelector(`#${t}`):e.getElementById(t),null===r)throw Error(`unable to get element with id ${t}`);return r}function f(t){return{[Symbol.iterator]:function*(){let e=0;for(const r of t)yield[e,r],e++}}}function p(t,e){i()(t.size>=1,"map.size >= 1");const r=t.keys(),n=r.next().value;return void 0!==e&&n===e?(i()(t.size>=2,"map.size >= 2"),r.next().value):n}function m(t){let e=Number.NEGATIVE_INFINITY,r=Number.POSITIVE_INFINITY;for(const n of t)null!==n&&(n>e&&isFinite(n)&&(e=n),n>>1,t[r]===e)return r;t[r]{"use strict";t.exports="data:image/svg+xml,%3csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%27-4 -4 8 8%27%3e%3ccircle r=%272%27 fill=%27%23fff%27/%3e%3c/svg%3e"},35782:t=>{"use strict";t.exports="data:image/svg+xml,%3csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%27-4 -4 8 8%27%3e%3ccircle r=%273%27 fill=%27%2386b7fe%27/%3e%3c/svg%3e"},54718:t=>{"use strict";t.exports="data:image/svg+xml,%3csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%27-4 -4 8 8%27%3e%3ccircle r=%273%27 fill=%27%23fff%27/%3e%3c/svg%3e"},57154:t=>{"use strict";t.exports="data:image/svg+xml,%3csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%27-4 -4 8 8%27%3e%3ccircle r=%273%27 fill=%27rgba%280, 0, 0, 0.25%29%27/%3e%3c/svg%3e"},35372:t=>{"use strict";t.exports="data:image/svg+xml,%3csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 12 12%27 width=%2712%27 height=%2712%27 fill=%27none%27 stroke=%27%23dc3545%27%3e%3ccircle cx=%276%27 cy=%276%27 r=%274.5%27/%3e%3cpath stroke-linejoin=%27round%27 d=%27M5.8 3.6h.4L6 6.5z%27/%3e%3ccircle cx=%276%27 cy=%278.2%27 r=%27.6%27 fill=%27%23dc3545%27 stroke=%27none%27/%3e%3c/svg%3e"},57249:t=>{"use strict";t.exports="data:image/svg+xml,%3csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 16 16%27 fill=%27%23000%27%3e%3cpath d=%27M.293.293a1 1 0 0 1 1.414 0L8 6.586 14.293.293a1 1 0 1 1 1.414 1.414L9.414 8l6.293 6.293a1 1 0 0 1-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 0 1-1.414-1.414L6.586 8 .293 1.707a1 1 0 0 1 0-1.414z%27/%3e%3c/svg%3e"},88832:t=>{"use strict";t.exports="data:image/svg+xml,%3csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 16 16%27 fill=%27%230c63e4%27%3e%3cpath fill-rule=%27evenodd%27 d=%27M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z%27/%3e%3c/svg%3e"},67830:t=>{"use strict";t.exports="data:image/svg+xml,%3csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 16 16%27 fill=%27%23212529%27%3e%3cpath fill-rule=%27evenodd%27 d=%27M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z%27/%3e%3c/svg%3e"},75932:t=>{"use strict";t.exports="data:image/svg+xml,%3csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 16 16%27 fill=%27%23fff%27%3e%3cpath d=%27M11.354 1.646a.5.5 0 0 1 0 .708L5.707 8l5.647 5.646a.5.5 0 0 1-.708.708l-6-6a.5.5 0 0 1 0-.708l6-6a.5.5 0 0 1 .708 0z%27/%3e%3c/svg%3e"},11144:t=>{"use strict";t.exports="data:image/svg+xml,%3csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 16 16%27 fill=%27%23fff%27%3e%3cpath d=%27M4.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L10.293 8 4.646 2.354a.5.5 0 0 1 0-.708z%27/%3e%3c/svg%3e"},35531:t=>{"use strict";t.exports="data:image/svg+xml,%3csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 16 16%27%3e%3cpath fill=%27none%27 stroke=%27%23343a40%27 stroke-linecap=%27round%27 stroke-linejoin=%27round%27 stroke-width=%272%27 d=%27m2 5 6 6 6-6%27/%3e%3c/svg%3e"},14274:t=>{"use strict";t.exports="data:image/svg+xml,%3csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 20 20%27%3e%3cpath fill=%27none%27 stroke=%27%23fff%27 stroke-linecap=%27round%27 stroke-linejoin=%27round%27 stroke-width=%273%27 d=%27M6 10h8%27/%3e%3c/svg%3e"},45419:t=>{"use strict";t.exports="data:image/svg+xml,%3csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 20 20%27%3e%3cpath fill=%27none%27 stroke=%27%23fff%27 stroke-linecap=%27round%27 stroke-linejoin=%27round%27 stroke-width=%273%27 d=%27m6 10 3 3 6-6%27/%3e%3c/svg%3e"},17914:t=>{"use strict";t.exports="data:image/svg+xml,%3csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 30 30%27%3e%3cpath stroke=%27rgba%280, 0, 0, 0.55%29%27 stroke-linecap=%27round%27 stroke-miterlimit=%2710%27 stroke-width=%272%27 d=%27M4 7h22M4 15h22M4 23h22%27/%3e%3c/svg%3e"},36366:t=>{"use strict";t.exports="data:image/svg+xml,%3csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 30 30%27%3e%3cpath stroke=%27rgba%28255, 255, 255, 0.55%29%27 stroke-linecap=%27round%27 stroke-miterlimit=%2710%27 stroke-width=%272%27 d=%27M4 7h22M4 15h22M4 23h22%27/%3e%3c/svg%3e"},48487:t=>{"use strict";t.exports="data:image/svg+xml,%3csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 8 8%27%3e%3cpath fill=%27%23198754%27 d=%27M2.3 6.73.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z%27/%3e%3c/svg%3e"},25446:t=>{"use strict";t.exports="data:image/svg+xml;charset=utf-8,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2722%27 height=%2722%27 fill=%27%23333%27 viewBox=%270 0 22 22%27%3E%3Cpath d=%27m1.754 13.406 4.453-4.851 3.09 3.09 3.281 3.277.969-.969-3.309-3.312 3.844-4.121 6.148 6.886h1.082v-.855l-7.207-8.07-4.84 5.187L6.169 6.57l-5.48 5.965v.871ZM.688 16.844h20.625v1.375H.688Zm0 0%27/%3E%3C/svg%3E"},56694:t=>{"use strict";t.exports="data:image/svg+xml;charset=utf-8,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2722%27 height=%2722%27 fill=%27%2333b5e5%27 viewBox=%270 0 22 22%27%3E%3Cpath d=%27m1.754 13.406 4.453-4.851 3.09 3.09 3.281 3.277.969-.969-3.309-3.312 3.844-4.121 6.148 6.886h1.082v-.855l-7.207-8.07-4.84 5.187L6.169 6.57l-5.48 5.965v.871ZM.688 16.844h20.625v1.375H.688Zm0 0%27/%3E%3C/svg%3E"},26117:t=>{"use strict";t.exports="data:image/svg+xml;charset=utf-8,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2724%27 height=%2724%27 fill-rule=%27evenodd%27 viewBox=%270 0 20 20%27%3E%3Cpath d=%27M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0%27/%3E%3C/svg%3E"},66311:t=>{"use strict";t.exports="data:image/svg+xml;charset=utf-8,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2724%27 height=%2724%27 fill=%27%23fff%27 fill-rule=%27evenodd%27 viewBox=%270 0 20 20%27%3E%3Cpath d=%27M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0%27/%3E%3C/svg%3E"},24420:t=>{"use strict";t.exports="data:image/svg+xml;charset=utf-8,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2729%27 height=%2729%27 fill=%27%23333%27 viewBox=%270 0 20 20%27%3E%3Cpath d=%27M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7%27/%3E%3Ccircle cx=%2710%27 cy=%2710%27 r=%272%27/%3E%3C/svg%3E"},77035:t=>{"use strict";t.exports="data:image/svg+xml;charset=utf-8,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2729%27 height=%2729%27 fill=%27%23333%27 viewBox=%270 0 29 29%27%3E%3Cpath d=%27M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13z%27/%3E%3C/svg%3E"},43470:t=>{"use strict";t.exports="data:image/svg+xml;charset=utf-8,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2729%27 height=%2729%27 fill=%27%23333%27 viewBox=%270 0 29 29%27%3E%3Cpath d=%27M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5%27/%3E%3C/svg%3E"},13490:t=>{"use strict";t.exports="data:image/svg+xml;charset=utf-8,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2729%27 height=%2729%27 fill=%27%23333%27 viewBox=%270 0 29 29%27%3E%3Cpath d=%27M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1z%27/%3E%3C/svg%3E"},80216:t=>{"use strict";t.exports="data:image/svg+xml;charset=utf-8,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2729%27 height=%2729%27 fill=%27%23333%27 viewBox=%270 0 29 29%27%3E%3Cpath d=%27m10.5 14 4-8 4 8z%27/%3E%3Cpath fill=%27%23ccc%27 d=%27m10.5 16 4 8 4-8z%27/%3E%3C/svg%3E"},47695:t=>{"use strict";t.exports="data:image/svg+xml;charset=utf-8,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2729%27 height=%2729%27 fill=%27%2333b5e5%27 viewBox=%270 0 20 20%27%3E%3Cpath d=%27M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7%27/%3E%3C/svg%3E"},92228:t=>{"use strict";t.exports="data:image/svg+xml;charset=utf-8,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2729%27 height=%2729%27 fill=%27%2333b5e5%27 viewBox=%270 0 20 20%27%3E%3Cpath d=%27M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7%27/%3E%3Ccircle cx=%2710%27 cy=%2710%27 r=%272%27/%3E%3C/svg%3E"},43737:t=>{"use strict";t.exports="data:image/svg+xml;charset=utf-8,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2729%27 height=%2729%27 fill=%27%23666%27 viewBox=%270 0 20 20%27%3E%3Cpath d=%27M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7%27/%3E%3Ccircle cx=%2710%27 cy=%2710%27 r=%272%27/%3E%3Cpath fill=%27red%27 d=%27m14 5 1 1-9 9-1-1z%27/%3E%3C/svg%3E"},48460:t=>{"use strict";t.exports="data:image/svg+xml;charset=utf-8,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2729%27 height=%2729%27 fill=%27%23999%27 viewBox=%270 0 20 20%27%3E%3Cpath d=%27M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7%27/%3E%3Ccircle cx=%2710%27 cy=%2710%27 r=%272%27/%3E%3Cpath fill=%27red%27 d=%27m14 5 1 1-9 9-1-1z%27/%3E%3C/svg%3E"},75796:t=>{"use strict";t.exports="data:image/svg+xml;charset=utf-8,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2729%27 height=%2729%27 fill=%27%23aaa%27 viewBox=%270 0 20 20%27%3E%3Cpath d=%27M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7%27/%3E%3Ccircle cx=%2710%27 cy=%2710%27 r=%272%27/%3E%3Cpath fill=%27red%27 d=%27m14 5 1 1-9 9-1-1z%27/%3E%3C/svg%3E"},28869:t=>{"use strict";t.exports="data:image/svg+xml;charset=utf-8,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2729%27 height=%2729%27 fill=%27%23e54e33%27 viewBox=%270 0 20 20%27%3E%3Cpath d=%27M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7%27/%3E%3C/svg%3E"},9819:t=>{"use strict";t.exports="data:image/svg+xml;charset=utf-8,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2729%27 height=%2729%27 fill=%27%23e58978%27 viewBox=%270 0 20 20%27%3E%3Cpath d=%27M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7%27/%3E%3Ccircle cx=%2710%27 cy=%2710%27 r=%272%27/%3E%3C/svg%3E"},30557:t=>{"use strict";t.exports="data:image/svg+xml;charset=utf-8,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2729%27 height=%2729%27 fill=%27%23fff%27 viewBox=%270 0 20 20%27%3E%3Cpath d=%27M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7%27/%3E%3Ccircle cx=%2710%27 cy=%2710%27 r=%272%27/%3E%3C/svg%3E"},68164:t=>{"use strict";t.exports="data:image/svg+xml;charset=utf-8,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2729%27 height=%2729%27 fill=%27%23fff%27 viewBox=%270 0 29 29%27%3E%3Cpath d=%27M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13z%27/%3E%3C/svg%3E"},64665:t=>{"use strict";t.exports="data:image/svg+xml;charset=utf-8,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2729%27 height=%2729%27 fill=%27%23fff%27 viewBox=%270 0 29 29%27%3E%3Cpath d=%27M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5%27/%3E%3C/svg%3E"},91413:t=>{"use strict";t.exports="data:image/svg+xml;charset=utf-8,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2729%27 height=%2729%27 fill=%27%23fff%27 viewBox=%270 0 29 29%27%3E%3Cpath d=%27M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1z%27/%3E%3C/svg%3E"},13913:t=>{"use strict";t.exports="data:image/svg+xml;charset=utf-8,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2729%27 height=%2729%27 fill=%27%23fff%27 viewBox=%270 0 29 29%27%3E%3Cpath d=%27M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1z%27/%3E%3C/svg%3E"},61907:t=>{"use strict";t.exports="data:image/svg+xml;charset=utf-8,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2729%27 height=%2729%27 fill=%27%23fff%27 viewBox=%270 0 29 29%27%3E%3Cpath d=%27m10.5 14 4-8 4 8z%27/%3E%3Cpath fill=%27%23ccc%27 d=%27m10.5 16 4 8 4-8z%27/%3E%3C/svg%3E"},56539:t=>{"use strict";t.exports="data:image/svg+xml;charset=utf-8,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2729%27 height=%2729%27 viewBox=%270 0 20 20%27%3E%3Cpath d=%27M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7%27/%3E%3Ccircle cx=%2710%27 cy=%2710%27 r=%272%27/%3E%3C/svg%3E"},4890:t=>{"use strict";t.exports="data:image/svg+xml;charset=utf-8,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2729%27 height=%2729%27 viewBox=%270 0 29 29%27%3E%3Cpath d=%27M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13z%27/%3E%3C/svg%3E"},13363:t=>{"use strict";t.exports="data:image/svg+xml;charset=utf-8,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2729%27 height=%2729%27 viewBox=%270 0 29 29%27%3E%3Cpath d=%27M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5%27/%3E%3C/svg%3E"},47603:t=>{"use strict";t.exports="data:image/svg+xml;charset=utf-8,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2729%27 height=%2729%27 viewBox=%270 0 29 29%27%3E%3Cpath d=%27M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1z%27/%3E%3C/svg%3E"},64643:t=>{"use strict";t.exports="data:image/svg+xml;charset=utf-8,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2729%27 height=%2729%27 viewBox=%270 0 29 29%27%3E%3Cpath d=%27M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1z%27/%3E%3C/svg%3E"},68605:t=>{"use strict";t.exports="data:image/svg+xml;charset=utf-8,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2729%27 height=%2729%27 viewBox=%270 0 29 29%27%3E%3Cpath d=%27m10.5 14 4-8 4 8z%27/%3E%3Cpath fill=%27%23ccc%27 d=%27m10.5 16 4 8 4-8z%27/%3E%3C/svg%3E"},47914:t=>{"use strict";t.exports="data:image/svg+xml;charset=utf-8,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2788%27 height=%2723%27 fill=%27none%27%3E%3Cpath fill=%27%23000%27 fill-opacity=%27.4%27 fill-rule=%27evenodd%27 d=%27M17.408 16.796h-1.827l2.501-12.095h.198l3.324 6.533.988 2.19.988-2.19 3.258-6.533h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.929 5.644h-.098l-2.914-5.644-.757-1.71-.345 1.71zm1.958-3.42-.726 3.663a1.255 1.255 0 0 1-1.232 1.011h-1.827a1.255 1.255 0 0 1-1.229-1.509l2.501-12.095a1.255 1.255 0 0 1 1.23-1.001h.197a1.25 1.25 0 0 1 1.12.685l3.19 6.273 3.125-6.263a1.25 1.25 0 0 1 1.123-.695h.181a1.255 1.255 0 0 1 1.227.991l1.443 6.71a5 5 0 0 1 .314-.787l.009-.016a4.6 4.6 0 0 1 1.777-1.887c.782-.46 1.668-.667 2.611-.667a4.6 4.6 0 0 1 1.7.32l.306.134c.21-.16.474-.256.759-.256h1.694a1.255 1.255 0 0 1 1.212.925 1.255 1.255 0 0 1 1.212-.925h1.711c.284 0 .545.094.755.252.613-.3 1.312-.45 2.075-.45 1.356 0 2.557.445 3.482 1.4q.47.48.763 1.064V4.701a1.255 1.255 0 0 1 1.255-1.255h1.86A1.255 1.255 0 0 1 54.44 4.7v9.194h2.217c.19 0 .37.043.532.118v-4.77c0-.356.147-.678.385-.906a2.42 2.42 0 0 1-.682-1.71c0-.665.267-1.253.735-1.7a2.45 2.45 0 0 1 1.722-.674 2.43 2.43 0 0 1 1.705.675q.318.302.504.683V4.7a1.255 1.255 0 0 1 1.255-1.255h1.744A1.255 1.255 0 0 1 65.812 4.7v3.335a4.8 4.8 0 0 1 1.526-.246c.938 0 1.817.214 2.59.69a4.47 4.47 0 0 1 1.67 1.743v-.98a1.255 1.255 0 0 1 1.256-1.256h1.777c.233 0 .451.064.639.174a3.4 3.4 0 0 1 1.567-.372c.346 0 .861.02 1.285.232a1.25 1.25 0 0 1 .689 1.004 4.7 4.7 0 0 1 .853-.588c.795-.44 1.675-.647 2.61-.647 1.385 0 2.65.39 3.525 1.396.836.938 1.168 2.173 1.168 3.528q-.001.515-.056 1.051a1.255 1.255 0 0 1-.947 1.09l.408.952a1.255 1.255 0 0 1-.477 1.552c-.418.268-.92.463-1.458.612-.613.171-1.304.244-2.049.244-1.06 0-2.043-.207-2.886-.698l-.015-.008c-.798-.48-1.419-1.135-1.818-1.963l-.004-.008a5.8 5.8 0 0 1-.548-2.512q0-.429.053-.843a1.3 1.3 0 0 1-.333-.086l-.166-.004c-.223 0-.426.062-.643.228-.03.024-.142.139-.142.59v3.883a1.255 1.255 0 0 1-1.256 1.256h-1.777a1.255 1.255 0 0 1-1.256-1.256V15.69l-.032.057a4.8 4.8 0 0 1-1.86 1.833 5.04 5.04 0 0 1-2.484.634 4.5 4.5 0 0 1-1.935-.424 1.25 1.25 0 0 1-.764.258h-1.71a1.255 1.255 0 0 1-1.256-1.255V7.687a2.4 2.4 0 0 1-.428.625c.253.23.412.561.412.93v7.553a1.255 1.255 0 0 1-1.256 1.255h-1.843a1.25 1.25 0 0 1-.894-.373c-.228.23-.544.373-.894.373H51.32a1.255 1.255 0 0 1-1.256-1.255v-1.251l-.061.117a4.7 4.7 0 0 1-1.782 1.884 4.77 4.77 0 0 1-2.485.67 5.6 5.6 0 0 1-1.485-.188l.009 2.764a1.255 1.255 0 0 1-1.255 1.259h-1.729a1.255 1.255 0 0 1-1.255-1.255v-3.537a1.255 1.255 0 0 1-1.167.793h-1.679a1.25 1.25 0 0 1-.77-.263 4.5 4.5 0 0 1-1.945.429c-.885 0-1.724-.21-2.495-.632l-.017-.01a5 5 0 0 1-1.081-.836 1.255 1.255 0 0 1-1.254 1.312h-1.81a1.255 1.255 0 0 1-1.228-.99l-.782-3.625-2.044 3.939a1.25 1.25 0 0 1-1.115.676h-.098a1.25 1.25 0 0 1-1.116-.68l-2.061-3.994zM35.92 16.63l.207-.114.223-.15q.493-.356.735-.785l.061-.118.033 1.332h1.678V9.242h-1.694l-.033 1.267q-.133-.329-.526-.658l-.032-.028a3.2 3.2 0 0 0-.668-.428l-.27-.12a3.3 3.3 0 0 0-1.235-.23q-1.136-.001-1.974.493a3.36 3.36 0 0 0-1.3 1.382q-.445.89-.444 2.074 0 1.2.51 2.107a3.8 3.8 0 0 0 1.382 1.381 3.9 3.9 0 0 0 1.893.477q.795 0 1.455-.33zm-2.789-5.38q-.576.675-.575 1.762 0 1.102.559 1.794.576.675 1.645.675a2.25 2.25 0 0 0 .934-.19 2.2 2.2 0 0 0 .468-.29l.178-.161a2.2 2.2 0 0 0 .397-.561q.244-.5.244-1.15v-.115q0-.708-.296-1.267l-.043-.077a2.2 2.2 0 0 0-.633-.709l-.13-.086-.047-.028a2.1 2.1 0 0 0-1.073-.285q-1.052 0-1.629.692zm2.316 2.706c.163-.17.28-.407.28-.83v-.114c0-.292-.06-.508-.15-.68a.96.96 0 0 0-.353-.389.85.85 0 0 0-.464-.127c-.4 0-.56.114-.664.239l-.01.012c-.148.174-.275.45-.275.945 0 .506.122.801.27.99.097.11.266.224.68.224.303 0 .504-.09.687-.269zm7.545 1.705a2.6 2.6 0 0 0 .331.423q.319.33.755.548l.173.074q.65.255 1.49.255 1.02 0 1.844-.493a3.45 3.45 0 0 0 1.316-1.4q.493-.904.493-2.089 0-1.909-.988-2.913-.988-1.02-2.584-1.02-.898 0-1.575.347a3 3 0 0 0-.415.262l-.199.166a3.4 3.4 0 0 0-.64.82V9.242h-1.712v11.553h1.729l-.017-5.134zm.53-1.138q.206.29.48.5l.155.11.053.034q.51.296 1.119.297 1.07 0 1.645-.675.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.435 0-.835.16a2 2 0 0 0-.284.136 2 2 0 0 0-.363.254 2.2 2.2 0 0 0-.46.569l-.082.162a2.6 2.6 0 0 0-.213 1.072v.115q0 .707.296 1.267l.135.211zm.964-.818a1.1 1.1 0 0 0 .367.385.94.94 0 0 0 .476.118c.423 0 .59-.117.687-.23.159-.194.28-.478.28-.95 0-.53-.133-.8-.266-.952l-.021-.025c-.078-.094-.231-.221-.68-.221a1 1 0 0 0-.503.135l-.012.007a.86.86 0 0 0-.335.343c-.073.133-.132.324-.132.614v.115a1.4 1.4 0 0 0 .14.66zm15.7-6.222q.347-.346.346-.856a1.05 1.05 0 0 0-.345-.79 1.18 1.18 0 0 0-.84-.329q-.51 0-.855.33a1.05 1.05 0 0 0-.346.79q0 .51.346.855.345.346.856.346.51 0 .839-.346zm4.337 9.314.033-1.332q.191.403.59.747l.098.081a4 4 0 0 0 .316.224l.223.122a3.2 3.2 0 0 0 1.44.322 3.8 3.8 0 0 0 1.875-.477 3.5 3.5 0 0 0 1.382-1.366q.527-.89.526-2.09 0-1.184-.444-2.073a3.24 3.24 0 0 0-1.283-1.399q-.823-.51-1.942-.51a3.5 3.5 0 0 0-1.527.344l-.086.043-.165.09a3 3 0 0 0-.33.214q-.432.315-.656.707a2 2 0 0 0-.099.198l.082-1.283V4.701h-1.744v12.095zm.473-2.509a2.5 2.5 0 0 0 .566.7q.117.098.245.18l.144.08a2.1 2.1 0 0 0 .975.232q1.07 0 1.645-.675.576-.69.576-1.778 0-1.102-.576-1.777-.56-.691-1.645-.692a2.2 2.2 0 0 0-1.015.235q-.22.113-.415.282l-.15.142a2.1 2.1 0 0 0-.42.594q-.223.479-.223 1.1v.115q0 .705.293 1.26zm2.616-.293c.157-.191.28-.479.28-.967 0-.51-.13-.79-.276-.961l-.021-.026c-.082-.1-.232-.225-.67-.225a.87.87 0 0 0-.681.279l-.012.011c-.154.155-.274.38-.274.807v.115c0 .285.057.499.144.669a1.1 1.1 0 0 0 .367.405c.137.082.28.123.455.123.423 0 .59-.118.686-.23zm8.266-3.013q.345-.13.724-.14l.069-.002q.493 0 .642.099l.247-1.794q-.196-.099-.717-.099a2.3 2.3 0 0 0-.545.063 2 2 0 0 0-.411.148 2.2 2.2 0 0 0-.4.249 2.5 2.5 0 0 0-.485.499 2.7 2.7 0 0 0-.32.581l-.05.137v-1.48h-1.778v7.553h1.777v-3.884q0-.546.159-.943a1.5 1.5 0 0 1 .466-.636 2.5 2.5 0 0 1 .399-.253 2 2 0 0 1 .224-.099zm9.784 2.656.05-.922q0-1.743-.856-2.698-.838-.97-2.584-.97-1.119-.001-2.007.493a3.46 3.46 0 0 0-1.4 1.382q-.493.906-.493 2.106 0 1.07.428 1.975.428.89 1.332 1.432.906.526 2.255.526.973 0 1.668-.185l.044-.012.135-.04q.613-.184.984-.421l-.542-1.267q-.3.162-.642.274l-.297.087q-.51.131-1.3.131-.954 0-1.497-.444a1.6 1.6 0 0 1-.192-.193q-.366-.44-.512-1.234l-.004-.021zm-5.427-1.256-.003.022h3.752v-.138q-.011-.727-.288-1.118a1 1 0 0 0-.156-.176q-.46-.428-1.316-.428-.986 0-1.494.604-.379.45-.494 1.234zm-27.053 2.77V4.7h-1.86v12.095h5.333V15.15zm7.103-5.908v7.553h-1.843V9.242h1.843z%27/%3E%3Cpath fill=%27%23fff%27 d=%27m19.63 11.151-.757-1.71-.345 1.71-1.12 5.644h-1.827L18.083 4.7h.197l3.325 6.533.988 2.19.988-2.19L26.839 4.7h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.93 5.644h-.098l-2.913-5.644zm14.836 5.81q-1.02 0-1.893-.478a3.8 3.8 0 0 1-1.381-1.382q-.51-.906-.51-2.106 0-1.185.444-2.074a3.36 3.36 0 0 1 1.3-1.382q.839-.494 1.974-.494a3.3 3.3 0 0 1 1.234.231 3.3 3.3 0 0 1 .97.575q.396.33.527.659l.033-1.267h1.694v7.553H37.18l-.033-1.332q-.279.593-1.02 1.053a3.17 3.17 0 0 1-1.662.444zm.296-1.482q.938 0 1.58-.642.642-.66.642-1.711v-.115q0-.708-.296-1.267a2.2 2.2 0 0 0-.807-.872 2.1 2.1 0 0 0-1.119-.313q-1.053 0-1.629.692-.575.675-.575 1.76 0 1.103.559 1.795.577.675 1.645.675zm6.521-6.237h1.711v1.4q.906-1.597 2.83-1.597 1.596 0 2.584 1.02.988 1.005.988 2.914 0 1.185-.493 2.09a3.46 3.46 0 0 1-1.316 1.399 3.5 3.5 0 0 1-1.844.493q-.954 0-1.662-.329a2.67 2.67 0 0 1-1.086-.97l.017 5.134h-1.728zm4.048 6.22q1.07 0 1.645-.674.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.592 0-1.12.296-.51.28-.822.823-.296.527-.296 1.234v.115q0 .708.296 1.267.313.543.823.855.51.296 1.119.297z%27/%3E%3Cpath fill=%27%23e1e3e9%27 d=%27M51.325 4.7h1.86v10.45h3.473v1.646h-5.333zm7.12 4.542h1.843v7.553h-1.843zm.905-1.415a1.16 1.16 0 0 1-.856-.346 1.17 1.17 0 0 1-.346-.856 1.05 1.05 0 0 1 .346-.79q.346-.329.856-.329.494 0 .839.33a1.05 1.05 0 0 1 .345.79 1.16 1.16 0 0 1-.345.855q-.33.346-.84.346zm7.875 9.133a3.17 3.17 0 0 1-1.662-.444q-.723-.46-1.004-1.053l-.033 1.332h-1.71V4.701h1.743v4.657l-.082 1.283q.279-.658 1.086-1.119a3.5 3.5 0 0 1 1.778-.477q1.119 0 1.942.51a3.24 3.24 0 0 1 1.283 1.4q.445.888.444 2.072 0 1.201-.526 2.09a3.5 3.5 0 0 1-1.382 1.366 3.8 3.8 0 0 1-1.876.477zm-.296-1.481q1.069 0 1.645-.675.577-.69.577-1.778 0-1.102-.577-1.776-.56-.691-1.645-.692a2.12 2.12 0 0 0-1.58.659q-.642.641-.642 1.694v.115q0 .71.296 1.267a2.4 2.4 0 0 0 .807.872 2.1 2.1 0 0 0 1.119.313zm5.927-6.237h1.777v1.481q.263-.757.856-1.217a2.14 2.14 0 0 1 1.349-.46q.527 0 .724.098l-.247 1.794q-.149-.099-.642-.099-.774 0-1.416.494-.626.493-.626 1.58v3.883h-1.777V9.242zm9.534 7.718q-1.35 0-2.255-.526-.904-.543-1.332-1.432a4.6 4.6 0 0 1-.428-1.975q0-1.2.493-2.106a3.46 3.46 0 0 1 1.4-1.382q.889-.495 2.007-.494 1.744 0 2.584.97.855.956.856 2.7 0 .444-.05.92h-5.43q.18 1.005.708 1.45.542.443 1.497.443.79 0 1.3-.131a4 4 0 0 0 .938-.362l.542 1.267q-.411.263-1.119.46-.708.198-1.711.197zm1.596-4.558q.016-1.02-.444-1.432-.46-.428-1.316-.428-1.728 0-1.991 1.86z%27/%3E%3Cpath d=%27M5.074 15.948a.484.657 0 0 0-.486.659v1.84a.484.657 0 0 0 .486.659h4.101a.484.657 0 0 0 .486-.659v-1.84a.484.657 0 0 0-.486-.659zm3.56 1.16H5.617v.838h3.017z%27 style=%27fill:%23fff;fill-rule:evenodd;stroke-width:1.03600001%27/%3E%3Cg style=%27stroke-width:1.12603545%27%3E%3Cpath d=%27M-9.408-1.416c-3.833-.025-7.056 2.912-7.08 6.615-.02 3.08 1.653 4.832 3.107 6.268.903.892 1.721 1.74 2.32 2.902l-.525-.004c-.543-.003-.992.304-1.24.639a1.87 1.87 0 0 0-.362 1.121l-.011 1.877c-.003.402.104.787.347 1.125.244.338.688.653 1.23.656l4.142.028c.542.003.99-.306 1.238-.641a1.87 1.87 0 0 0 .363-1.121l.012-1.875a1.87 1.87 0 0 0-.348-1.127c-.243-.338-.688-.653-1.23-.656l-.518-.004c.597-1.145 1.425-1.983 2.348-2.87 1.473-1.414 3.18-3.149 3.2-6.226-.016-3.59-2.923-6.684-6.993-6.707m-.006 1.1v.002c3.274.02 5.92 2.532 5.9 5.6-.017 2.706-1.39 4.026-2.863 5.44-1.034.994-2.118 2.033-2.814 3.633-.018.041-.052.055-.075.065q-.013.004-.02.01a.34.34 0 0 1-.226.084.34.34 0 0 1-.224-.086l-.092-.077c-.699-1.615-1.768-2.669-2.781-3.67-1.454-1.435-2.797-2.762-2.78-5.478.02-3.067 2.7-5.545 5.975-5.523m-.02 2.826c-1.62-.01-2.944 1.315-2.955 2.96-.01 1.646 1.295 2.988 2.916 2.999h.002c1.621.01 2.943-1.316 2.953-2.961.011-1.646-1.294-2.988-2.916-2.998m-.005 1.1c1.017.006 1.829.83 1.822 1.89s-.83 1.874-1.848 1.867c-1.018-.006-1.829-.83-1.822-1.89s.83-1.874 1.848-1.868m-2.155 11.857 4.14.025c.271.002.49.305.487.676l-.013 1.875c-.003.37-.224.67-.495.668l-4.14-.025c-.27-.002-.487-.306-.485-.676l.012-1.875c.003-.37.224-.67.494-.668%27 style=%27color:%23000;font-style:normal;font-variant:normal;font-weight:400;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:%23000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:evenodd;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:%23000;solid-opacity:1;vector-effect:none;fill:%23000;fill-opacity:.4;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto%27 transform=%27translate%2815.553 2.85%29scale%28.88807%29%27/%3E%3Cpath d=%27M-9.415-.316C-12.69-.338-15.37 2.14-15.39 5.207c-.017 2.716 1.326 4.041 2.78 5.477 1.013 1 2.081 2.055 2.78 3.67l.092.076a.34.34 0 0 0 .225.086.34.34 0 0 0 .227-.083l.019-.01c.022-.009.057-.024.074-.064.697-1.6 1.78-2.64 2.814-3.634 1.473-1.414 2.847-2.733 2.864-5.44.02-3.067-2.627-5.58-5.901-5.601m-.057 8.784c1.621.011 2.944-1.315 2.955-2.96.01-1.646-1.295-2.988-2.916-2.999-1.622-.01-2.945 1.315-2.955 2.96s1.295 2.989 2.916 3%27 style=%27clip-rule:evenodd;fill:%23e1e3e9;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4%27 transform=%27translate%2815.553 2.85%29scale%28.88807%29%27/%3E%3Cpath d=%27M-11.594 15.465c-.27-.002-.492.297-.494.668l-.012 1.876c-.003.371.214.673.485.675l4.14.027c.271.002.492-.298.495-.668l.012-1.877c.003-.37-.215-.672-.485-.674z%27 style=%27clip-rule:evenodd;fill:%23fff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4%27 transform=%27translate%2815.553 2.85%29scale%28.88807%29%27/%3E%3C/g%3E%3C/svg%3E"},75208:(t,e,r)=>{"use strict";var n=r(97905),i="undefined"==typeof globalThis?r.g:globalThis;t.exports=function(){for(var t=[],e=0;e1&&(r-=1),r<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t}if(t=k(t,360),e=k(e,100),r=k(r,100),0===e)n=i=o=r;else{var s=r<.5?r*(1+e):r+e-r*e,l=2*r-s;n=a(l,s,t+1/3),i=a(l,s,t),o=a(l,s,t-1/3)}return{r:255*n,g:255*i,b:255*o}}(n.h,a,l),c=!0,u="hsl"),n.hasOwnProperty("a")&&(o=n.a)),o=w(o),{ok:c,format:n.format||u,r:Math.min(255,Math.max(i.r,0)),g:Math.min(255,Math.max(i.g,0)),b:Math.min(255,Math.max(i.b,0)),a:o};var h,d,f}(i);this._originalInput=i,this._r=a.r,this._g=a.g,this._b=a.b,this._a=a.a,this._roundA=Math.round(100*this._a)/100,this._format=o.format||a.format,this._gradientType=o.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=a.ok}function i(t,e,r){t=k(t,255),e=k(e,255),r=k(r,255);var n,i,o=Math.max(t,e,r),a=Math.min(t,e,r),s=(o+a)/2;if(o==a)n=i=0;else{var l=o-a;switch(i=s>.5?l/(2-o-a):l/(o+a),o){case t:n=(e-r)/l+(e>1)+720)%360;--e;)i.h=(i.h+o)%360,a.push(n(i));return a}function y(t,e){e=e||6;for(var r=n(t).toHsv(),i=r.h,o=r.s,a=r.v,s=[],l=1/e;e--;)s.push(n({h:i,s:o,v:a})),a=(a+l)%1;return s}n.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var t=this.toRgb();return(299*t.r+587*t.g+114*t.b)/1e3},getLuminance:function(){var t,e,r,n=this.toRgb();return t=n.r/255,e=n.g/255,r=n.b/255,.2126*(t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4))+.7152*(e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4))+.0722*(r<=.03928?r/12.92:Math.pow((r+.055)/1.055,2.4))},setAlpha:function(t){return this._a=w(t),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var t=o(this._r,this._g,this._b);return{h:360*t.h,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=o(this._r,this._g,this._b),e=Math.round(360*t.h),r=Math.round(100*t.s),n=Math.round(100*t.v);return 1==this._a?"hsv("+e+", "+r+"%, "+n+"%)":"hsva("+e+", "+r+"%, "+n+"%, "+this._roundA+")"},toHsl:function(){var t=i(this._r,this._g,this._b);return{h:360*t.h,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=i(this._r,this._g,this._b),e=Math.round(360*t.h),r=Math.round(100*t.s),n=Math.round(100*t.l);return 1==this._a?"hsl("+e+", "+r+"%, "+n+"%)":"hsla("+e+", "+r+"%, "+n+"%, "+this._roundA+")"},toHex:function(t){return a(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(t){return function(t,e,r,n,i){var o=[T(Math.round(t).toString(16)),T(Math.round(e).toString(16)),T(Math.round(r).toString(16)),T(C(n))];return i&&o[0].charAt(0)==o[0].charAt(1)&&o[1].charAt(0)==o[1].charAt(1)&&o[2].charAt(0)==o[2].charAt(1)&&o[3].charAt(0)==o[3].charAt(1)?o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0)+o[3].charAt(0):o.join("")}(this._r,this._g,this._b,this._a,t)},toHex8String:function(t){return"#"+this.toHex8(t)},toRgb:function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:Math.round(100*k(this._r,255))+"%",g:Math.round(100*k(this._g,255))+"%",b:Math.round(100*k(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+Math.round(100*k(this._r,255))+"%, "+Math.round(100*k(this._g,255))+"%, "+Math.round(100*k(this._b,255))+"%)":"rgba("+Math.round(100*k(this._r,255))+"%, "+Math.round(100*k(this._g,255))+"%, "+Math.round(100*k(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(_[a(this._r,this._g,this._b,!0)]||!1)},toFilter:function(t){var e="#"+s(this._r,this._g,this._b,this._a),r=e,i=this._gradientType?"GradientType = 1, ":"";if(t){var o=n(t);r="#"+s(o._r,o._g,o._b,o._a)}return"progid:DXImageTransform.Microsoft.gradient("+i+"startColorstr="+e+",endColorstr="+r+")"},toString:function(t){var e=!!t;t=t||this._format;var r=!1,n=this._a<1&&this._a>=0;return e||!n||"hex"!==t&&"hex6"!==t&&"hex3"!==t&&"hex4"!==t&&"hex8"!==t&&"name"!==t?("rgb"===t&&(r=this.toRgbString()),"prgb"===t&&(r=this.toPercentageRgbString()),"hex"!==t&&"hex6"!==t||(r=this.toHexString()),"hex3"===t&&(r=this.toHexString(!0)),"hex4"===t&&(r=this.toHex8String(!0)),"hex8"===t&&(r=this.toHex8String()),"name"===t&&(r=this.toName()),"hsl"===t&&(r=this.toHslString()),"hsv"===t&&(r=this.toHsvString()),r||this.toHexString()):"name"===t&&0===this._a?this.toName():this.toRgbString()},clone:function(){return n(this.toString())},_applyModification:function(t,e){var r=t.apply(null,[this].concat([].slice.call(e)));return this._r=r._r,this._g=r._g,this._b=r._b,this.setAlpha(r._a),this},lighten:function(){return this._applyModification(h,arguments)},brighten:function(){return this._applyModification(d,arguments)},darken:function(){return this._applyModification(f,arguments)},desaturate:function(){return this._applyModification(l,arguments)},saturate:function(){return this._applyModification(c,arguments)},greyscale:function(){return this._applyModification(u,arguments)},spin:function(){return this._applyModification(p,arguments)},_applyCombination:function(t,e){return t.apply(null,[this].concat([].slice.call(e)))},analogous:function(){return this._applyCombination(b,arguments)},complement:function(){return this._applyCombination(m,arguments)},monochromatic:function(){return this._applyCombination(y,arguments)},splitcomplement:function(){return this._applyCombination(v,arguments)},triad:function(){return this._applyCombination(g,[3])},tetrad:function(){return this._applyCombination(g,[4])}},n.fromRatio=function(e,r){if("object"==t(e)){var i={};for(var o in e)e.hasOwnProperty(o)&&(i[o]="a"===o?e[o]:S(e[o]));e=i}return n(e,r)},n.equals=function(t,e){return!(!t||!e)&&n(t).toRgbString()==n(e).toRgbString()},n.random=function(){return n.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})},n.mix=function(t,e,r){r=0===r?0:r||50;var i=n(t).toRgb(),o=n(e).toRgb(),a=r/100;return n({r:(o.r-i.r)*a+i.r,g:(o.g-i.g)*a+i.g,b:(o.b-i.b)*a+i.b,a:(o.a-i.a)*a+i.a})},n.readability=function(t,e){var r=n(t),i=n(e);return(Math.max(r.getLuminance(),i.getLuminance())+.05)/(Math.min(r.getLuminance(),i.getLuminance())+.05)},n.isReadable=function(t,e,r){var i,o,a,s,l,c=n.readability(t,e);switch(o=!1,(a=r,"AA"!==(s=((a=a||{level:"AA",size:"small"}).level||"AA").toUpperCase())&&"AAA"!==s&&(s="AA"),"small"!==(l=(a.size||"small").toLowerCase())&&"large"!==l&&(l="small"),i={level:s,size:l}).level+i.size){case"AAsmall":case"AAAlarge":o=c>=4.5;break;case"AAlarge":o=c>=3;break;case"AAAsmall":o=c>=7}return o},n.mostReadable=function(t,e,r){var i,o,a,s,l=null,c=0;o=(r=r||{}).includeFallbackColors,a=r.level,s=r.size;for(var u=0;uc&&(c=i,l=n(e[u]));return n.isReadable(t,l,{level:a,size:s})||!o?l:(r.includeFallbackColors=!1,n.mostReadable(t,["#fff","#000"],r))};var x=n.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},_=n.hexNames=function(t){var e={};for(var r in t)t.hasOwnProperty(r)&&(e[t[r]]=r);return e}(x);function w(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function k(t,e){(function(t){return"string"==typeof t&&-1!=t.indexOf(".")&&1===parseFloat(t)})(t)&&(t="100%");var r=function(t){return"string"==typeof t&&-1!=t.indexOf("%")}(t);return t=Math.min(e,Math.max(0,parseFloat(t))),r&&(t=parseInt(t*e,10)/100),Math.abs(t-e)<1e-6?1:t%e/parseFloat(e)}function A(t){return Math.min(1,Math.max(0,t))}function M(t){return parseInt(t,16)}function T(t){return 1==t.length?"0"+t:""+t}function S(t){return t<=1&&(t=100*t+"%"),t}function C(t){return Math.round(255*parseFloat(t)).toString(16)}function E(t){return M(t)/255}var L,z,O,D=(z="[\\s|\\(]+("+(L="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+L+")[,|\\s]+("+L+")\\s*\\)?",O="[\\s|\\(]+("+L+")[,|\\s]+("+L+")[,|\\s]+("+L+")[,|\\s]+("+L+")\\s*\\)?",{CSS_UNIT:new RegExp(L),rgb:new RegExp("rgb"+z),rgba:new RegExp("rgba"+O),hsl:new RegExp("hsl"+z),hsla:new RegExp("hsla"+O),hsv:new RegExp("hsv"+z),hsva:new RegExp("hsva"+O),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});function I(t){return!!D.CSS_UNIT.exec(t)}return n}()},23648:t=>{"use strict";t.exports=JSON.parse('["xx-small","x-small","small","medium","large","x-large","xx-large","larger","smaller"]')},2362:t=>{"use strict";t.exports=JSON.parse('["normal","condensed","semi-condensed","extra-condensed","ultra-condensed","expanded","semi-expanded","extra-expanded","ultra-expanded"]')},87486:t=>{"use strict";t.exports=JSON.parse('["normal","italic","oblique"]')},99803:t=>{"use strict";t.exports=JSON.parse('["normal","bold","bolder","lighter","100","200","300","400","500","600","700","800","900"]')},54324:t=>{"use strict";t.exports=JSON.parse('["inherit","initial","unset"]')},94316:t=>{"use strict";t.exports=JSON.parse('["caption","icon","menu","message-box","small-caption","status-bar"]')}},__webpack_module_cache__={};function __webpack_require__(t){var e=__webpack_module_cache__[t];if(void 0!==e)return e.exports;var r=__webpack_module_cache__[t]={id:t,exports:{}};return __webpack_modules__[t].call(r.exports,r,r.exports,__webpack_require__),r.exports}__webpack_require__.m=__webpack_modules__,__webpack_require__.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return __webpack_require__.d(e,{a:e}),e},__webpack_require__.d=(t,e)=>{for(var r in e)__webpack_require__.o(e,r)&&!__webpack_require__.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),__webpack_require__.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),__webpack_require__.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},__webpack_require__.b=document.baseURI||self.location.href,__webpack_require__.nc=void 0;var __webpack_exports__={};return(()=>{"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{DefaultVisualizer:()=>Sn,EnvironmentIndexer:()=>a,EnvironmentInfo:()=>x,MapVisualizer:()=>En,MetadataPanel:()=>Zr,MoleculeViewer:()=>on.MoleculeViewer,PropertiesMap:()=>P,StructureOptions:()=>cn.O,StructureVisualizer:()=>Cn,ViewersGrid:()=>sn,addWarningHandler:()=>s.eK,version:()=>Ln});var t={};__webpack_require__.r(t),__webpack_require__.d(t,{decode:()=>U,encode:()=>H,format:()=>W,parse:()=>it});var e={};__webpack_require__.r(e),__webpack_require__.d(e,{Any:()=>st,Cc:()=>lt,Cf:()=>ct,P:()=>ot,S:()=>at,Z:()=>ut});var r={};__webpack_require__.r(r),__webpack_require__.d(r,{arrayReplaceAt:()=>Rt,assign:()=>Ft,escapeHtml:()=>Zt,escapeRE:()=>$t,fromCodePoint:()=>jt,has:()=>It,isMdAsciiPunct:()=>te,isPunctChar:()=>Qt,isSpace:()=>Jt,isString:()=>Ot,isValidEntityCode:()=>Pt,isWhiteSpace:()=>Kt,lib:()=>re,normalizeReference:()=>ee,unescapeAll:()=>Vt,unescapeMd:()=>Gt});var n={};__webpack_require__.r(n),__webpack_require__.d(n,{parseLinkDestination:()=>ie,parseLinkLabel:()=>ne,parseLinkTitle:()=>oe}),__webpack_require__(86643);var i=__webpack_require__(34961),o=__webpack_require__.n(i);class a{constructor(t,e){if(this._structures=t,this._environments=e,this._activeStructures=[],this._activeAtoms=Array.from({length:this._structures.length}).map((()=>[])),void 0!==this._environments){for(const t of this._environments)this._activeAtoms[t.structure].push(t.center);for(let t=0;t0){this._activeStructures.push(t);for(let r=0;rt-e));for(let t=0;tt-e))}fromEnvironment(t,e){if("structure"===e)return{environment:t,structure:t};o()(void 0!==this._environments,"this._environments !== undefined"),o()(t\n
\n \n
`;const n=r.content.firstChild;t.appendChild(n),this._valid=[],this._slider=n.querySelector("input"),this._play=n.querySelector(".chsp-play-button"),this._play.onclick=()=>{this._play.classList.toggle("chsp-playing"),this.startPlayback((()=>this._play.classList.contains("chsp-playing")))},this._slider.onchange=()=>this.onchange(),this.onchange=()=>{},this.startPlayback=()=>{}}reset(t){this._valid=t,this._slider.value="0",this._slider.max=""+(this._valid.length-1)}update(t){const e=(0,s.El)(this._valid,t);o()(-1!==e,"position !== -1"),this._slider.value=e.toString()}value(){return this._valid[parseInt(this._slider.value,10)]}}function p(t,e,r,n,i,o){const a={xref:"paper",yref:"paper",xaxis:{title:i,titlefont:{size:12},showgrid:!1,zeroline:!1,showline:!0,nticks:5},yaxis:{title:o,titlefont:{size:12},showgrid:!1,showline:!0,zeroline:!1,nticks:4},showlegend:!1,x:.2,legend:{y:.5},margin:{l:n/6,r:0,b:n/6,t:0,pad:0},width:n,height:n/1.35,tracetoggle:!1},s=[{x:t,y:e,type:"scatter",mode:"lines"}];c().newPlot(r,s,a,{displayModeBar:!1,responsive:!0,staticPlot:!1})}class m{constructor(t,e,r,n,i){const o=document.createElement("template");o.innerHTML=`
\n
\n \n \n \n
\n
`;const a=o.content.firstChild;t.appendChild(a),this._root=t,this._header=a.querySelector("th"),this._target=e,this._properties=[];const s=a.querySelector("tbody");for(const t in n){const e=document.createElement("tr"),r=document.createElement("td"),o=n[t].units;let a=t;void 0!==o&&(a+=`/${o}`);const l=n[t].description;if(void 0!==l){r.innerHTML='';const t=r.firstChild;t.innerText=a,t.setAttribute("title",l)}else r.innerText=a;e.appendChild(r);const c=document.createElement("td");e.appendChild(c),s.appendChild(e);const u=n[t].parameters;if(void 0===u)this._properties.push({cell:c,values:n[t].values});else if(i&&"string"==typeof u[0]){let e=u[0];const o=i[u[0]].units;void 0!==o&&(e+=`/${o}`);const s=document.createElement("div");s.style.display="block",s.style.width="100%",c.appendChild(s),this._properties.push({cell:c,values:n[t].values,parameter:i[u[0]].values,xlabel:e,ylabel:a});const l=document.createElement("button");l.classList.add("btn","btn-secondary","btn-sm","chsp-toggle-plot-btn"),l.textContent="Show/Hide",l.onclick=()=>{"block"===s.style.display?s.style.display="none":s.style.display="block"},r.appendChild(l)}}this.show({environment:0,structure:0,atom:0})}show(t){let e,r;"structure"===this._target?(e=t.structure+1,r=t.structure):(o()("atom"===this._target,"this._target === 'atom'"),o()(void 0!==t.atom,"indexes.atom !== undefined"),e=t.atom+1,r=t.environment),this._header.innerText=`Properties for ${this._target} ${e}`;for(const t of this._properties)if(Array.isArray(t.values[r])){const e=this._root.offsetWidth/1.5;o()(null!==t.cell.firstElementChild,"s.cell.firstElementChild !== null"),p(t.parameter,t.values[r],t.cell.firstElementChild,e,t.xlabel,t.ylabel)}else t.cell.innerText=t.values[r].toString()}}const g='\n\n \n \n \n \n \n\n\x3c!--Icon taken from www.icons8.com and edited in Inkscape--\x3e\n';var v=__webpack_require__(48654),b=__webpack_require__(62621);function y(t,e){const r={};for(const n in t)Object.hasOwnProperty.call(t,n)&&e(t[n])&&(r[n]=t[n]);return r}class x{constructor(t,e,r,n,i){this.onchange=()=>{},this.playbackDelay=700;const o=(0,s.V6)(t),a=document.createElement("div");o.appendChild(a),this._shadow=a.attachShadow({mode:"open"}),this._shadow.adoptedStyleSheets=[v.A,b.A,u],this._root=document.createElement("div"),this._shadow.appendChild(this._root),this._indexer=r,this._target=n,this._properties=e,this._parameters=i,this._structure={number:document.createElement("input"),slider:new f(document.createElement("div"),"structure"),table:new m(document.createElement("div"),"structure","structure",e,i)},this._renderTargetPart()}switchTarget(t){this._target=t,this._renderTargetPart()}show(t){const e=this._indexes().structure;if(this._structure.number.value=`${t.structure+1}`,this._structure.slider.update(t.structure),this._structure.table.show(t),t.structure!==e&&void 0!==this._atom){const e=this._indexer.activeAtoms(t.structure);this._atom.number.value=`${e[0]+1}`,this._atom.slider.reset(e)}if(void 0!==t.atom)if(void 0===this._atom){if(0!==t.atom)throw Error("Invalid state: got an atomic number to update, but I am displaying only structures")}else this._atom.number.value=`${t.atom+1}`,this._atom.slider.update(t.atom),this._atom.table.show(t)}remove(){this._shadow.host.remove()}_renderTargetPart(){this._root.innerHTML=this._getMainHTMLStructure();const t=y(this._properties,(t=>"structure"===t.target));if(this._structure=this._createStructure(t,this._parameters),"atom"===this._target){const t=y(this._properties,(t=>"atom"===t.target));this._atom=this._createAtom(t,this._parameters)}else this._atom=void 0;d.A.initialize(this._root)}_getMainHTMLStructure(){const t="atom"===this._target?`\n `:"
";return`\n
\n
\n \n ${t}\n
`}_createStructure(t,e){const r=new f(this._root,"structure");r.reset(this._indexer.activeStructures()),r.startPlayback=t=>{setTimeout((()=>{if(t()){const e=this._findNextValidIndex(this._indexes().structure,this._indexer.structuresCount(),(t=>this._indexer.fromStructure(t,this._target)));void 0!==e&&(this.show(this._indexer.fromStructure(e,this._target)),this.onchange(this._indexes()),r.startPlayback(t))}}),this.playbackDelay)},r.onchange=()=>{const t=this._structure.slider.value();if(void 0!==this._atom){const e=this._indexer.activeAtoms(t);if(0===e.length)return void(0,s.R4)(`Cannot change to structure ${t+1}, which does not contain any active atoms`);this._atom.number.value=`${e[0]+1}`,this._atom.number.max=`${e.length}`,this._atom.slider.reset(e)}const e=this._indexes();o()(void 0!==e,"indexes !== undefined"),this._structure.table.show(e),this._structure.number.value=`${e.structure+1}`,void 0!==this._atom&&this._atom.table.show(e),this.onchange(e)};const n=this._root.children[0];o()("div"===n.tagName.toLowerCase(),"tableRoot.tagName.toLowerCase() === 'div'");const i=new m(n,"structure","structure",t,e),a=this._createNumberInput(".chsp-info-structure-btn .chsp-info-number",this._indexer.structuresCount().toString(),(t=>{if(isNaN(t)||t<0||t>=parseInt(a.max,10))a.value=`${this._structure.slider.value()+1}`;else if(-1===(0,s.El)(this._indexer.activeStructures(),t))a.value=`${this._structure.slider.value()+1}`;else{if(this._structure.slider.update(t),void 0!==this._atom){const e=this._indexer.activeAtoms(t);this._atom.number.value=`${e[0]+1}`,this._atom.number.max=`${e.length}`,this._atom.slider.reset(e)}const e=this._indexes();this._structure.table.show(e),void 0!==this._atom&&this._atom.table.show(e),this.onchange(e)}}));return{number:a,slider:r,table:i}}_createAtom(t,e){const r=new f(this._root,"atom");r.reset(this._indexer.activeAtoms(this._structure.slider.value())),r.startPlayback=t=>{setTimeout((()=>{if(t()){const e=this._indexes();o()(void 0!==e.atom,"current.atom !== undefined");const n=this._findNextValidIndex(e.atom,this._indexer.atomsCount(e.structure),(t=>this._indexer.fromStructureAtom(this._target,e.structure,t)));void 0!==n&&(this.show(this._indexer.fromStructureAtom(this._target,e.structure,n)),this.onchange(this._indexes()),r.startPlayback(t))}}),this.playbackDelay)},r.onchange=()=>{o()(void 0!==this._atom,"this._atom !== undefined");const t=this._indexes();if(void 0!==t)o()(void 0!==t.atom,"indexes.atom !== undefined"),this._atom.table.show(t),this._atom.number.value=`${t.atom+1}`,this.onchange(t);else{const t=this._structure.slider.value(),e=this._atom.slider.value();(0,s.R4)(`Environment for atom ${e} in structure ${t} is not part of this dataset`)}};const n=this._root.children[0];o()("div"===n.tagName.toLowerCase(),"tableRoot.tagName.toLowerCase() === 'div'");const i=new m(n,"atom","atom",t,e),a=this._createNumberInput(".chsp-info-atom-btn .chsp-info-number",this._indexer.atomsCount(this._structure.slider.value()).toString(),(t=>{o()(void 0!==this._atom,"this._atom !== undefined");const e=this._indexer.activeAtoms(this._structure.slider.value());if(isNaN(t)||t<0||t>=parseInt(a.max,10))a.value=`${this._atom.slider.value()+1}`;else if(-1===(0,s.El)(e,t))a.value=`${this._atom.slider.value()+1}`;else{this._atom.slider.update(t);const e=this._indexes();this._atom.table.show(e),this.onchange(e)}}));return{number:a,slider:r,table:i}}_findNextValidIndex(t,e,r){let n=0;for(;n<=e;){if(void 0!==r(t=(t+1)%e))return t;n++}}_createNumberInput(t,e,r){const n=this._root.querySelector(t);return n.max=e,n.onchange=()=>r(parseInt(n.value,10)-1),n.onclick=t=>t.stopPropagation(),n}_indexes(){const t=this._structure.slider.value();let e;if(void 0!==this._atom){const r=this._atom.slider.value();e=this._indexer.fromStructureAtom(this._target,t,r)}else o()("atom"!==this._target,"this._target !== 'atom'"),e=this._indexer.fromStructureAtom(this._target,t);return o()(void 0!==e,"indexes !== undefined"),e}}class _{constructor(){this._values=[]}get(t){let e=this._values.findIndex((e=>e===t));return-1===e&&(e=this._values.length,this._values.push(t)),e}string(t){if(t>=this._values.length)throw Error("requested unknown string from interner");return this._values[t]}strings(){return this._values}}function w(t,e){const r=typeof e.values[0];if("number"===r)return{values:e.values,units:e.units};if("string"===r){const r=new _,n=[];for(const i of e.values){const e=r.get(i);if(n.push(e),e>20)throw Error(`the '${t}' property contains more than 50 different values, it can not be interpreted as categories`)}return{string:r,values:n,units:e.units}}if(!Array.isArray(e.values[0]))throw Error(`unexpected property type '${r}'`)}function k(t,e){let r,n;for(const i in e)if(void 0!==r){if(e[i].values.length!==r)throw Error(`${t} property '${i}' do not have the same size as the first property '${n}': expected ${r}, got ${e[i].values.length}`)}else r=e[i].values.length,n=i}class A{constructor(t){this.structure={},this.atom={},this.maxSymbols=-1;for(const e in t){let r;try{r=w(e,t[e])}catch(t){(0,s.R4)(`warning: ${t.message}`);continue}void 0!==r&&(this[t[e].target][e]=r,void 0!==r.string&&(this.maxSymbols=Math.max(this.maxSymbols,r.string.strings().length)))}k("structure",this.structure),k("atom",this.atom)}}class M{constructor(t,e,r,n=!0){const i=document.createElement("div");i.classList.add("chsp-pin-marker","chsp-map-pin-marker"),i.id=`chsp-selected-${t}`,i.style.backgroundColor=e,this.marker=i,this.toggleVisible(n),this.color=e,this.current=r}update(t){isFinite(t.x)&&isFinite(t.y)?(this.marker.style.top=`${t.y}px`,this.marker.style.right=`${t.x}px`):this.toggleVisible(!1)}select(t){return this.current!==t.environment&&(this.current=t.environment,!0)}activate(){this.marker.classList.toggle("chsp-active-pin",!0)}deactivate(){this.marker.classList.toggle("chsp-active-pin",!1)}remove(){o()(null!==this.marker.parentNode,"this.marker.parentNode !== null"),this.marker.parentNode.removeChild(this.marker)}toggleVisible(t){this.marker.style.display=t?"block":"none"}}var T=__webpack_require__(50112),S=__webpack_require__(45127),C=__webpack_require__(17136),E=__webpack_require__(90170);const L=["circle","square","diamond","cross","x"];function z(t){return L[t%L.length]}class O extends S.W2{constructor(t){o()(t.length>0,"validProperties.length > 0"),super(),this.max=new S.Je("number",NaN),this.min=new S.Je("number",NaN),this.property=new S.Je("string",t[0]),this.scale=new S.Je("string","linear"),this.property.validate=(0,S.qP)(t,"axis"),this.scale.validate=(0,S.qP)(["linear","log"],"axis scale")}disable(){this.max.disable(),this.min.disable(),this.scale.disable()}enable(){this.max.enable(),this.min.enable(),this.scale.enable()}}class D extends S.W2{constructor(t,e,r,n={}){super();const i=Object.keys(e);if(i.length<2)throw new Error("Cannot show a map because the dataset contains fewer than two properties.");this.x=new O(i),this.y=new O(i),this.z=new O(i.concat([""])),this.symbol=new S.Je("string","");const o=[""];for(const t in e)void 0!==e[t].string&&o.push(t);this.symbol.validate=(0,S.qP)(o,"symbol"),this.palette=new S.Je("string","inferno"),this.palette.validate=(0,S.qP)(Object.keys(C.s),"palette"),this.color={mode:new S.Je("string","linear"),property:new S.Je("string",""),min:new S.Je("number",NaN),max:new S.Je("number",NaN)},this.color.property.validate=(0,S.qP)(i.concat([""]),"color"),this.color.mode.validate=(0,S.qP)(["linear","log","sqrt","inverse"],"mode"),this.size={factor:new S.Je("number",50),mode:new S.Je("string","linear"),property:new S.Je("string","")},this.size.property.validate=(0,S.qP)(i.concat([""]),"size"),this.size.factor.validate=t=>{if(t<1||t>100)throw Error(`size factor must be between 0 and 100, got ${t}`)},this.size.mode.validate=(0,S.qP)(["linear","log","sqrt","inverse","flip-linear","proportional"],"mode"),this.markerOutline=new S.Je("boolean",!0),this.joinPoints=new S.Je("boolean",!1),this.x.property.value=i[0],this.y.property.value=i[1],this.z.property.value="",i.length>2?this.color.property.value=i[2]:this.color.property.value="",this._positionSettingsModal=r;const{openModal:a,modal:s}=this._createSettingsHTML();this._modal=s,this._openModal=a,t.appendChild(this._openModal),this._bind(e),this.applySettings(n)}getModalElement(t){return(0,s.VT)(t,this._modal.shadow)}applySettings(t){if("size"in t){const e=t.size;"mode"in e&&"constant"===e.mode&&(delete e.mode,e.property="")}if("color"in t){const e=t.color;"scale"in e&&(e.mode=e.scale,delete e.scale)}super.applySettings(t)}remove(){this._modal.remove(),this._openModal.remove()}is3D(){return""!==this.z.property.value}hasColors(){return""!==this.color.property.value}hovertemplate(){if(this.hasColors()){let t=this.color.property.value;switch(this.color.mode.value){case"inverse":t=`(${t})-1`;break;case"log":t=`log(${t})`;break;case"sqrt":t=`sqrt(${t})`}return t+": %{marker.color:.2f}"}return"%{x:.2f}, %{y:.2f}"}calculateColors(t){let e=this.color.mode.value;const{min:r,max:n}=(0,s.GI)(t);return n===r&&(e="fixed"),t.map((t=>{let r=.5;switch(e){case"inverse":r=1/t;break;case"log":r=Math.log10(t);break;case"sqrt":r=Math.sqrt(t);break;case"linear":r=1*t;break;default:r=.5}return isNaN(r)?"#aaaaaa":r}))}calculateSizes(t){const e=(t=>{const e=Math.log(1/6),r=(Math.log(6)-e)/99;return Math.exp(e+r*(t-1))})(this.size.factor.value);let r=this.size.mode.value;const{min:n,max:i}=(0,s.GI)(t),o=this.is3D()?800:300,a=n>0?n:1e-6*(i-n),l=t.map((t=>{let s=.3;switch(i===n?r="fixed":s=(t-n)/(i-n),r){case"proportional":s=t/Math.abs(i);break;case"inverse":s=a/t;break;case"log":s=Math.log(t/a)/Math.log(i/a);break;case"sqrt":s=Math.sqrt(t/Math.abs(i));break;case"linear":s*=1;break;case"flip-linear":s=1-s;break;default:s=.3-.1}return s+=.1,o*s*e}));return l.some((t=>isNaN(t)||t<0))?((0,s.R4)(`After applying the selected scaling mode ${r}, some point sizesevaluated to invalid values. These points will be displayed at the minimum size.`),l.map((t=>isNaN(t)?.1*o*e:t))):l}getSymbols(t){o()(void 0!==t.string,"property.string !== undefined");const e=t.string.strings().length;return this.is3D()?(e>L.length&&(0,s.R4)(`${e} symbols are required, but we only have ${L.length}. Some symbols will be repeated`),t.values.map(z)):t.values}_createSettingsHTML(){const t=document.createElement("template");t.innerHTML=`\n
${E.A}
\n `;const e=t.content.firstChild;t.innerHTML='\n';const r=t.content.querySelector(".modal");o()(null!==r&&r instanceof HTMLElement,"modalElement !== null && modalElement instanceof HTMLElement");const n=r.querySelector(".modal-dialog");o()(null!==n&&n instanceof HTMLElement,"modalDialog !== null && modalDialog instanceof HTMLElement"),(0,s.eB)(n,".modal-header");const i=new T.A(r);return i.shadow.adoptedStyleSheets=[v.A,b.A],d.A.initialize(r),e.addEventListener("click",(()=>{if(null===n.getAttribute("data-initial-modal-positions-set")){n.setAttribute("data-initial-modal-positions-set","true"),n.parentNode.style.display="block",n.style.width=n.offsetWidth/1.5+"px",n.style.minWidth="500px",n.style.margin="0",n.style.position="fixed";const{top:t,left:e}=this._positionSettingsModal(n.getBoundingClientRect());n.style.top=`${t}px`,n.style.left=`${e}px`}i.open()})),r.addEventListener("keydown",(t=>{t.stopPropagation()})),{openModal:e,modal:i}}_bind(t){const e=this.getModalElement("map-x-property");e.options.length=0;for(const r in t)e.options.add(new Option(r,r));this.x.property.bind(e,"value"),this.x.min.bind(this.getModalElement("map-x-min"),"value"),this.x.max.bind(this.getModalElement("map-x-max"),"value"),this.x.scale.bind(this.getModalElement("map-x-scale"),"value");const r=this.getModalElement("map-y-property");r.options.length=0;for(const e in t)r.options.add(new Option(e,e));this.y.property.bind(r,"value"),this.y.min.bind(this.getModalElement("map-y-min"),"value"),this.y.max.bind(this.getModalElement("map-y-max"),"value"),this.y.scale.bind(this.getModalElement("map-y-scale"),"value");const n=this.getModalElement("map-z-property");n.options.length=0,n.options.add(new Option("none",""));for(const e in t)n.options.add(new Option(e,e));this.z.property.bind(n,"value"),this.z.min.bind(this.getModalElement("map-z-min"),"value"),this.z.max.bind(this.getModalElement("map-z-max"),"value"),this.z.scale.bind(this.getModalElement("map-z-scale"),"value");const i=this.getModalElement("map-color-property");i.options.length=0,i.options.add(new Option("fixed",""));for(const e in t)i.options.add(new Option(e,e));this.color.property.bind(i,"value"),this.color.mode.bind(this.getModalElement("map-color-transform"),"value"),this.color.min.bind(this.getModalElement("map-color-min"),"value"),this.color.max.bind(this.getModalElement("map-color-max"),"value");const o=this.getModalElement("map-color-palette");o.length=0;for(const t in C.s)o.options.add(new Option(t,t));this.palette.bind(o,"value");const a=this.getModalElement("map-symbol-property");a.options.length=0,a.options.add(new Option("fixed",""));for(const e in t)void 0!==t[e].string&&a.options.add(new Option(e,e));this.symbol.bind(a,"value");const s=this.getModalElement("map-size-property");s.options.length=0,s.options.add(new Option("fixed",""));for(const e in t)s.options.add(new Option(e,e));this.size.property.bind(s,"value"),this.size.factor.bind(this.getModalElement("map-size-factor"),"value"),this.size.mode.bind(this.getModalElement("map-size-transform"),"value"),this.markerOutline.bind(this.getModalElement("map-marker-outline"),"checked"),this.joinPoints.bind(this.getModalElement("map-join-points"),"checked")}colorScale(){return C.s[this.palette.value]}setLogLabel(t,e){const r=this.getModalElement(`map-${e}-min-label`),n=this.getModalElement(`map-${e}-max-label`);"log"===t.scale.value?(r.innerHTML="min: 10^",n.innerHTML="max: 10^"):(r.innerHTML="min:",n.innerHTML="max:")}}const I='\n\n \n \n\n\x3c!--Icon taken from www.uxwing.com and edited in Inkscape--\x3e\n\n';const F={coloraxis:{cmax:0,cmin:0,colorbar:{len:1,thickness:20,title:{text:"",side:"right",font:{size:15}},y:0,yanchor:"bottom"},colorscale:[],showscale:!0},hovermode:"closest",legend:{itemclick:!1,itemdoubleclick:!1,tracegroupgap:5,y:1,yanchor:"top"},margin:{b:50,l:50,r:50,t:50},scene:{camera:{projection:{type:"orthographic"}},xaxis:{showspikes:!1,title:""},yaxis:{showspikes:!1,title:""},zaxis:{showspikes:!1,title:""}},showlegend:!0,xaxis:{range:void 0,title:"",type:"linear",zeroline:!1},yaxis:{range:void 0,title:"",type:"linear",zeroline:!1},zaxis:{range:void 0,title:"",type:"linear",zeroline:!1}},R={displayModeBar:!0,displaylogo:!1,responsive:!0,scrollZoom:!0,modeBarButtonsToRemove:["hoverClosestCartesian","hoverCompareCartesian","toggleSpikelines","autoScale2d","zoomIn2d","zoomOut2d","select2d","lasso2d","hoverClosest3d","tableRotation","resetCameraLastSave3d","toImage"],modeBarButtonsToAdd:[[{name:"Download PNG",icon:{width:400,height:447,path:j(I)},click:function(t){c().downloadImage(t,{filename:"chemiscope-map",format:"png",width:Math.max(t._fullLayout.width,600),height:Math.max(t._fullLayout.width,600)}).catch((t=>setTimeout((()=>{throw t}))))}}],[{name:"Download SVG",icon:{width:400,height:447,path:j('\n\n \n \n \n\x3c!--Icon taken from www.uxwing.com and edited in Inkscape--\x3e\n\n')},click:function(t){c().downloadImage(t,{filename:"chemiscope-map",format:"svg",width:Math.max(t._fullLayout.width,600),height:Math.max(t._fullLayout.height,600)}).catch((t=>setTimeout((()=>{throw t}))))}}]]};class P{constructor(t,e,r,n,i){this._getAxisRange=(t,e,r)=>{const n=!isNaN(t),i=!isNaN(e);if(n&&i){if(t<=e)return[t,e];(0,s.R4)(`The inserted min and max values in ${r} are such that min > max!The default values will be used.`)}return[n?t:void 0,i?e:void 0]},this._indexer=r,this._target=n,this.onselect=()=>{},this.activeChanged=()=>{},this._selected=new Map;const o=(0,s.V6)(t),a=document.createElement("div");a.style.setProperty("height","100%"),o.appendChild(a),this._shadow=a.attachShadow({mode:"open"}),this._root=document.createElement("div"),this._root.style.setProperty("height","100%"),this._shadow.appendChild(this._root),""===this._root.style.position&&(this._root.style.position="relative"),this._plot=document.createElement("div"),this._plot.style.width="100%",this._plot.style.height="100%",this._root.appendChild(this._plot),this._data=new A(i);const l=this._getCurrentProperties();var c;this._options=new D(this._root,l,(t=>this.positionSettingsModal(t)),e),this._colorReset=this._options.getModalElement("map-color-reset"),this._connectSettings(),this.positionSettingsModal=t=>{const e=this._root.getBoundingClientRect();return{left:e.left+e.width/2-t.width/2,top:e.top+20}},this._createPlot(),this._shadow.adoptedStyleSheets=[v.A,b.A,u,(c=this._plot,h(c._fullLayout._modeBar._uid))]}switchTarget(t){return e=this,r=void 0,i=function*(){if(t!==this._target){if(this._target=t,this._handleMarkers(),void 0!==this._active){const t=this._selected.get(this._active);void 0!==t&&this.onselect(this._indexer.fromEnvironment(t.current,this._target))}this._setupMapOptions(),this._connectSettings(),yield this._react(this._getTraces(),this._getLayout())}},new((n=void 0)||(n=Promise))((function(t,o){function a(t){try{l(i.next(t))}catch(t){o(t)}}function s(t){try{l(i.throw(t))}catch(t){o(t)}}function l(e){var r;e.done?t(e.value):(r=e.value,r instanceof n?r:new n((function(t){t(r)}))).then(a,s)}l((i=i.apply(e,r||[])).next())}));var e,r,n,i}_handleMarkers(){var t;for(const[e,r]of this._selected.entries()){if("structure"===this._target)r.current=this._indexer.fromEnvironment(r.current,"atom").structure;else{const e=null===(t=this._indexer.fromStructure(r.current,"atom"))||void 0===t?void 0:t.environment;o()(void 0!==e,"environment !== undefined"),r.current=e}this._selected.set(e,r)}}remove(){var t;this._shadow.host.remove(),this._options.remove(),null===(t=document.getElementById("js-plotly-tester"))||void 0===t||t.remove(),this._plotFix.disable()}select(t){if(void 0===this._active)throw Error("tries to update selected environment, but there is no active marker");if(void 0===t.environment){const e=this._indexer.fromStructureAtom(this._target,t.structure,t.atom);if(void 0===e){const e=void 0===t.atom?"":` / atom ${t.atom}`;throw Error(`can not find the environnement for structure ${t.structure}`+e)}t=e}const e=this._selected.get(this._active);o()(void 0!==e,"data !== undefined"),e.select(t)&&this._updateMarkers()}setActive(t){if(void 0!==this._active){const t=this._selected.get(this._active);o()(void 0!==t,"oldData !== undefined"),t.deactivate()}this._active=t;const e=this._selected.get(this._active);o()(void 0!==e,"data !== undefined"),e.activate(),this._is3D()&&this._restyle({"marker.size":this._sizes(1)},1)}addMarker(t,e,r){o()(!this._selected.has(t),"!this._selected.has(guid)");const n=new M(t,e,r.environment);this._root.appendChild(n.marker),n.marker.onclick=()=>{this.setActive(t),this.activeChanged(t,this._indexer.fromEnvironment(n.current,this._target))},this._selected.set(t,n),this._updateMarkers([n]),this.setActive(t)}removeMarker(t){this._active===t&&(1===this._selected.size?this._active=void 0:this.setActive((0,s.o)(this._selected,t)));const e=this._selected.get(t);o()(void 0!==e,"data !== undefined"),e.remove(),this._selected.delete(t),this._updateMarkers()}applySettings(t){this._options.applySettings(t)}saveSettings(){return this._options.saveSettings()}onSettingChange(t){this._options.onSettingChange(t)}_getTraces(){const t=this._is3D()?"scatter3d":"scattergl",e=[{name:"",type:t,x:this._coordinates(this._options.x,0)[0],y:this._coordinates(this._options.y,0)[0],z:this._coordinates(this._options.z,0)[0],hovertemplate:this._options.hovertemplate(),marker:{color:this._colors(0)[0],coloraxis:"coloraxis",line:{color:"black",width:this._options.markerOutline.value?.5:0},opacity:1,size:this._sizes(0)[0],sizemode:"area",symbol:this._symbols(0)[0]},line:{color:"black",width:.5,dash:"solid"},mode:this._options.joinPoints.value?"lines+markers":"markers",showlegend:!1},{name:"selected",type:t,x:[],y:[],z:[],hoverinfo:"none",marker:{color:[],line:{color:[],width:2},opacity:1,size:[],sizemode:"area"},mode:"markers",showlegend:!1}],r=this._legendNames().slice(2),n=this._showlegend().slice(2);o()(r.length===n.length,"legendNames.length === showlegend.length");const i=r.length;this._data.maxSymbols>0&&(r.length=this._data.maxSymbols,r.fill("",i),n.length=this._data.maxSymbols,n.fill(!1,i));for(let i=0;i{t&&Object.keys(t).length>1&&(this._options.remove(),this._options=new D(this._root,this._getCurrentProperties(),(t=>this.positionSettingsModal(t)),{}))};"atom"!==this._target?t(this._data.structure):t(this._data.atom)}_getCurrentProperties(){const t=this._data[this._target],e=Object.keys(t);if(e.length<2){if("structure"===this._target&&!this._indexer.hasEnvironments()&&Object.keys(this._data.atom).length>=2)throw Error("could not find enough structure properties to display, but there are atom properties. Please provide the environment list to display them");let t="we need at least two properties to plot in the map";throw 0===e.length?t+=", we have none":t+=`, we have only one: '${e[0]}'`,Error(t)}return t}_restyle(t,e){c().restyle(this._plot,t,e).catch((t=>setTimeout((()=>{throw t}))))}_relayout(t){c().relayout(this._plot,t).catch((t=>setTimeout((()=>{throw t}))))}_react(t,e){return new Promise(((r,n)=>{c().react(this._plot,t,e).then((()=>{r()})).catch((t=>{setTimeout((()=>{n(t)}))}))}))}_connectSettings(){const t=t=>{"log"===t.scale.value&&(0,s.GI)(this._coordinates(t,0)[0]).min<0&&t.min.value<=0&&(0,s.R4)("This property contains negative values. Note that taking the log will discard them.")};this._options.x.property.onchange.push((()=>{t(this._options.x);const e=this._coordinates(this._options.x);this._restyle({x:e},[0,1]),this._relayout({"scene.xaxis.title":this._title(this._options.x.property.value),"xaxis.title":this._title(this._options.x.property.value)}),this._is3D()?this._relayout({"scene.xaxis.autorange":!0}):this._relayout({"xaxis.autorange":!0}),this._setScaleStep(this._getBounds().x,"x")})),this._options.x.scale.onchange.push((()=>{t(this._options.x),this._options.setLogLabel(this._options.x,"x"),this._is3D()?this._relayout({"scene.xaxis.type":this._options.x.scale.value}):this._relayout({"xaxis.type":this._options.x.scale.value})}));const e=(e,r,n)=>(i,o)=>{if("JS"===o)return;const a=r.min.value,l=r.max.value;if(a>l)return(0,s.R4)(`The inserted min and max values in ${e} are such that min > max! The last inserted value was reset.`),void("min"===n?r.min.reset():r.max.reset());t(r),this._is3D()?this._relayout({[`scene.${e}.range`]:[a,l]}):this._relayout({[`${e}.range`]:[a,l]})};if(this._options.x.min.onchange.push(e("xaxis",this._options.x,"min")),this._options.x.max.onchange.push(e("xaxis",this._options.x,"max")),this._options.y.property.onchange.push((()=>{t(this._options.y);const e=this._coordinates(this._options.y);this._restyle({y:e},[0,1]),this._relayout({"scene.yaxis.title":this._title(this._options.y.property.value),"yaxis.title":this._title(this._options.y.property.value)}),this._is3D()?this._relayout({"scene.yaxis.autorange":!0}):this._relayout({"yaxis.autorange":!0}),this._setScaleStep(this._getBounds().y,"y")})),this._options.y.scale.onchange.push((()=>{t(this._options.y),this._options.setLogLabel(this._options.y,"y"),this._is3D()?this._relayout({"scene.yaxis.type":this._options.y.scale.value}):this._relayout({"yaxis.type":this._options.y.scale.value})})),this._options.y.min.onchange.push(e("yaxis",this._options.y,"min")),this._options.y.max.onchange.push(e("yaxis",this._options.y,"max")),""===this._options.z.property.value?this._options.z.disable():this._options.z.enable(),this._options.z.property.onchange.push((()=>{t(this._options.z);const e="scatter3d"===this._plot._fullData[0].type;if(""===this._options.z.property.value)return void(e&&this._switch2D());e||this._switch3D();const r=this._coordinates(this._options.z);this._restyle({z:r},[0,1]),this._relayout({"scene.zaxis.title":this._title(this._options.z.property.value),"scene.zaxis.autorange":!0}),this._is3D()&&this._setScaleStep(this._getBounds().z,"z")})),this._options.z.scale.onchange.push((()=>{t(this._options.z),this._options.setLogLabel(this._options.z,"z"),""!==this._options.z.property.value&&this._relayout({"scene.zaxis.type":this._options.z.scale.value})})),this._options.z.min.onchange.push(e("zaxis",this._options.z,"min")),this._options.z.max.onchange.push(e("zaxis",this._options.z,"max")),this._options.hasColors()){const t=(t,e)=>{const[r,n]=this._getAxisRange(t,e,"map.color"),i=void 0!==r,o=void 0!==n,a=()=>{const t=this._colors(0)[0];return(0,s.GI)(t)};if(i||o){const{min:r,max:n}=a();return{min:i?t:r,max:o?e:n}}return a()},{min:e,max:r}=t(this._options.color.min.value,this._options.color.max.value);this._options.color.min.value=e,this._options.color.max.value=r,this._setScaleStep([e,r],"color")}else this._options.color.min.value=0,this._options.color.max.value=0;this._options.color.property.onchange.push((()=>{if(this._options.hasColors()){this._options.color.mode.enable(),this._options.color.min.enable(),this._options.color.max.enable(),this._colorReset.disabled=!1;const t=this._colors(0)[0];if(n(t,"property")){const{min:e,max:r}=(0,s.GI)(t);this._options.color.min.value=Number.NEGATIVE_INFINITY,this._options.color.max.value=r,this._options.color.min.value=e,this._setScaleStep([e,r],"color"),this._relayout({"coloraxis.colorbar.title.text":this._colorTitle(),"coloraxis.showscale":!0})}}else this._options.color.mode.disable(),this._options.color.min.disable(),this._options.color.max.disable(),this._colorReset.disabled=!0,this._options.color.min.value=0,this._options.color.max.value=0,this._relayout({"coloraxis.colorbar.title.text":void 0,"coloraxis.showscale":!1});this._restyle({hovertemplate:this._options.hovertemplate(),"marker.color":this._colors(0)},[0])}));const r=t=>{const e=this._options.color.min.value,r=this._options.color.max.value;if(e>r)return(0,s.R4)("The inserted min and max values in color are such that min > max! The last inserted value was reset."),void("min"===t?this._options.color.min.reset():this._options.color.max.reset());this._relayout({"coloraxis.cmax":r,"coloraxis.cmin":e,"coloraxis.colorscale":this._options.colorScale()})},n=(t,e)=>{const r=this._options.color.mode.value;let n="";"log"===r||"sqrt"===r?n="<= 0":"inverse"===r&&(n="== 0");const i=t.every((t=>isNaN(t))),o=t.some((t=>isNaN(t)));return i?((0,s.R4)(`The selected property contains only values ${n}. To display this property, select an appropriate color scale. The ${e} will be set to its last value.`),"property"===e?this._options.color.property.reset():this._options.color.mode.reset(),!1):!o||((0,s.R4)(`The selected property contains some values ${n}. These values will be colored in grey.`),!0)};this._options.color.mode.onchange.push((()=>{const t=this._colors(0)[0];if(n(t,"color scale")){const{min:e,max:r}=(0,s.GI)(t);this._options.color.min.value=Number.NEGATIVE_INFINITY,this._options.color.max.value=r,this._options.color.min.value=e,this._setScaleStep([e,r],"color"),this._relayout({"coloraxis.colorbar.title.text":this._colorTitle(),"coloraxis.showscale":!0}),this._restyle({hovertemplate:this._options.hovertemplate(),"marker.color":this._colors(0)},[0])}})),this._options.color.min.onchange.push((()=>{r("min")})),this._options.color.max.onchange.push((()=>{r("max")})),this._colorReset.onclick=()=>{const t=this._colors(0)[0],{min:e,max:r}=(0,s.GI)(t);this._options.color.min.value=e,this._options.color.max.value=r,this._relayout({"coloraxis.cmax":r,"coloraxis.cmin":e,"coloraxis.colorscale":this._options.colorScale()})},this._options.color.property.enable(),this._options.hasColors()?(this._options.color.mode.enable(),this._options.color.min.enable(),this._options.color.max.enable(),this._colorReset.disabled=!1):(this._options.color.min.disable(),this._options.color.max.disable(),this._colorReset.disabled=!0),this._options.palette.onchange.push((()=>{this._relayout({"coloraxis.colorscale":this._options.colorScale()})})),this._options.symbol.onchange.push((()=>{this._restyle({"marker.symbol":this._symbols()},[0,1]),this._restyle({name:this._legendNames(),showlegend:this._showlegend()}),this._relayout({"coloraxis.colorbar.len":this._colorbarLen()})})),""===this._options.size.property.value?this._options.size.mode.disable():this._options.size.mode.enable(),this._options.size.property.onchange.push((()=>{""!==this._options.size.property.value?this._options.size.mode.enable():this._options.size.mode.disable(),this._restyle({"marker.size":this._sizes(0)},0)})),this._options.size.factor.onchange.push((()=>{this._restyle({"marker.size":this._sizes(0)},0)})),this._options.size.mode.onchange.push((()=>{this._restyle({"marker.size":this._sizes(0)},0)})),this._options.markerOutline.onchange.push((()=>{const t=this._options.markerOutline.value?.5:0;this._restyle({"marker.line.width":t},[0])})),this._options.joinPoints.onchange.push((()=>{const t=this._options.joinPoints.value?"lines+markers":"markers";this._restyle({mode:t},[0])}))}_createPlot(){this._plot.innerHTML="";const t=this._getTraces(),e=this._getLayout();c().newPlot(this._plot,t,e,R).then((()=>{window.requestAnimationFrame((()=>{window.dispatchEvent(new Event("resize"))}))})).catch((t=>setTimeout((()=>{throw t})))),this._plot.classList.add("chsp-map"),this._plotFix=function(t){let e=null;const r=t=>{t.isTrusted&&t.target&&(t.preventDefault(),t.stopPropagation(),e={data:t instanceof MouseEvent?{buttons:t.buttons,clientX:t.clientX,clientY:t.clientY,ctrlKey:t.ctrlKey}:{buttons:1,clientX:t.touches[0].clientX,clientY:t.touches[0].clientY,ctrlKey:t.ctrlKey},target:t.target})},n=t=>{if(e&&t.target){t.preventDefault(),t.stopImmediatePropagation();const r=new Event("mousedown",{composed:!0});Object.assign(r,Object.assign(Object.assign({},e.data),{clientX:e.data.clientX-50,clientY:e.data.clientY-50}));const n=e.target;e=null,n.dispatchEvent(r);const i=new Event("mouseup",{bubbles:!0,composed:!0});t.target.dispatchEvent(i)}},i=t=>{if(e){t.preventDefault(),t.stopImmediatePropagation();const r=t instanceof MouseEvent?t:t.changedTouches[0];if(Math.abs(r.clientX-e.data.clientX)>5||Math.abs(r.clientY-e.data.clientY)>5){const t=new Event("mousedown",{composed:!0});Object.assign(t,e.data);const r=e.target;e=null,r.dispatchEvent(t)}}};let o=!1;const a=()=>{o=!0,t.addEventListener("mousedown",r,{capture:!0}),document.addEventListener("mouseup",n),document.addEventListener("mousemove",i),t.addEventListener("touchstart",r,{capture:!0}),document.addEventListener("touchmove",i,{passive:!1}),document.addEventListener("touchend",n,{passive:!1})},s=()=>{o=!1,t.removeEventListener("mousedown",r,{capture:!0}),document.removeEventListener("mouseup",n),document.removeEventListener("mousemove",i),t.removeEventListener("touchstart",r,{capture:!0}),document.removeEventListener("touchmove",i),document.removeEventListener("touchend",n)};return t.on("plotly_restyle",(([t])=>{"type"in t&&(o&&"scatter3d"===t.type&&s(),o||"scattergl"!==t.type||a())})),"scattergl"===t._fullData[0].type&&a(),{disable:s,enable:a}}(this._plot),this._plot.on("plotly_click",(t=>{if(t.event&&2===t.event.detail)return;let e=t.points[0].pointNumber;if(this._is3D()&&"selected"===t.points[0].data.name)for(const[r,[n,i]]of(0,s.HL)(this._selected.entries()))if(t.points[0].pointNumber===r){e=i.current,this._active!==n&&(this.setActive(n),this.activeChanged(n,this._indexer.fromEnvironment(i.current,this._target)));break}const r=this._indexer.fromEnvironment(e,this._target);this.select(r),this.onselect(r)})),this._plot.on("plotly_afterplot",(()=>this._afterplot())),this._updateMarkers();const r=this._getBounds();this._setScaleStep(r.x,"x"),this._setScaleStep(r.y,"y"),void 0!==r.z&&this._setScaleStep(r.z,"z"),this._plot.addEventListener("wheel",(()=>{}))}_getLayout(){const t=JSON.parse(JSON.stringify(F));return t.xaxis.title=this._title(this._options.x.property.value),t.yaxis.title=this._title(this._options.y.property.value),t.xaxis.type=this._options.x.scale.value,t.yaxis.type=this._options.y.scale.value,t.scene.xaxis.title=this._title(this._options.x.property.value),t.scene.yaxis.title=this._title(this._options.y.property.value),t.scene.zaxis.title=this._title(this._options.z.property.value),t.coloraxis.colorscale=this._options.colorScale(),t.coloraxis.cmin=this._options.color.min.value,t.coloraxis.cmax=this._options.color.max.value,t.coloraxis.colorbar.title.text=this._colorTitle(),t.coloraxis.colorbar.len=this._colorbarLen(),t.coloraxis.showscale=this._options.hasColors(),t.xaxis.range=this._getAxisRange(this._options.x.min.value,this._options.x.max.value,"map.x"),t.yaxis.range=this._getAxisRange(this._options.y.min.value,this._options.y.max.value,"map.y"),t.zaxis.range=this._getAxisRange(this._options.z.min.value,this._options.z.max.value,"map.z"),t}_property(t){const e=this._data[this._target][t];if(void 0===e)throw Error(`unknown property '${t}' requested in map`);return e}_coordinates(t,e){if(""===t.property.value)return this._selectTrace(void 0,void 0,e);const r=this._property(t.property.value).values,n=[];for(const t of this._selected.values())this._is3D()?n.push(r[t.current]):n.push(NaN);return this._selectTrace(r,n,e)}_title(t){let e=t;if(""!==t){const r=this._property(t).units;void 0!==r&&(e=t+` / ${r}`)}return e}_colorTitle(){let t=this._title(this._options.color.property.value);switch(this._options.color.mode.value){case"inverse":t=`(${t})-1`;break;case"log":t=`log10(${t})`;break;case"sqrt":t=`√(${t})`}return t}_colors(t){let e;e=this._options.hasColors()?this._property(this._options.color.property.value).values:new Array(this._property(this._options.x.property.value).values.length).fill(.5);const r=this._options.calculateColors(e),n=[];for(const t of this._selected.values())n.push(t.color);return this._selectTrace(r,n,t)}_sizes(t){let e;e=""!==this._options.size.property.value?this._property(this._options.size.property.value).values:new Array(this._property(this._options.x.property.value).values.length).fill(1);const r=this._options.calculateSizes(e),n=[];if(this._is3D())for(const t of this._selected.keys())t===this._active?n.push(1e3):n.push(500);return this._selectTrace(r,n,t)}_symbols(t){if(""===this._options.symbol.value)return this._selectTrace("circle","circle",t);const e=this._property(this._options.symbol.value),r=this._options.getSymbols(e),n=[];for(const t of this._selected.values())n.push(r[t.current]);return this._selectTrace(r,n,t)}_showlegend(){const t=[!1,!1];if(""!==this._options.symbol.value){for(let e=0;e{t.min.value=isNaN(t.min.value)?e:t.min.value,t.max.value=isNaN(t.max.value)?r:t.max.value};e(this._options.x,t.x),e(this._options.y,t.y),void 0!==t.z&&e(this._options.z,t.z),this._is3D()||this._updateMarkers()}_updateMarkers(t){if(void 0===t&&(t=Array.from(this._selected.values())),this._is3D())t.forEach((t=>t.toggleVisible(!1))),this._restyle({"marker.color":this._colors(1),"marker.size":this._sizes(1),"marker.symbol":this._symbols(1),x:this._coordinates(this._options.x,1),y:this._coordinates(this._options.y,1),z:this._coordinates(this._options.z,1)},1);else{const e=this._coordinates(this._options.x,0)[0],r=this._coordinates(this._options.y,0)[0],n=this._plot.getBoundingClientRect().width;for(const i of t){let t=e[i.current],o=r[i.current];"log"===this._options.x.scale.value&&(t=Math.log10(t)),"log"===this._options.y.scale.value&&(o=Math.log10(o)),t=n-this._pixelCoordinate(t,"x"),o=this._pixelCoordinate(o,"y");const a=this._getBounds(),s=n-this._pixelCoordinate(a.x[1],"x"),l=n-this._pixelCoordinate(a.x[0],"x"),c=this._pixelCoordinate(a.y[1],"y"),u=this._pixelCoordinate(a.y[0],"y"),h=(t,e,r)=>t+10>e&&t-10=55296&&t<=57343?"���":String.fromCharCode(t),n+=6;continue}}if(240==(248&o)&&n+91114111?e+="����":(t-=65536,e+=String.fromCharCode(55296+(t>>10),56320+(1023&t))),n+=9;continue}}e+="�"}}return e}))}B.defaultChars=";/?:@&=+$,#",B.componentChars="";const U=B,G={};function V(t,e,r){"string"!=typeof e&&(r=e,e=V.defaultChars),void 0===r&&(r=!0);const n=function(t){let e=G[t];if(e)return e;e=G[t]=[];for(let t=0;t<128;t++){const r=String.fromCharCode(t);/^[0-9a-z]$/i.test(r)?e.push(r):e.push("%"+("0"+t.toString(16).toUpperCase()).slice(-2))}for(let r=0;r=55296&&a<=57343){if(a>=55296&&a<=56319&&e+1=56320&&r<=57343){i+=encodeURIComponent(t[e]+t[e+1]),e++;continue}}i+="%EF%BF%BD"}else i+=encodeURIComponent(t[e])}return i}V.defaultChars=";/?:@&=+$,-_.!~*'()#",V.componentChars="-_.!~*'()";const H=V;function W(t){let e="";return e+=t.protocol||"",e+=t.slashes?"//":"",e+=t.auth?t.auth+"@":"",t.hostname&&-1!==t.hostname.indexOf(":")?e+="["+t.hostname+"]":e+=t.hostname||"",e+=t.port?":"+t.port:"",e+=t.pathname||"",e+=t.search||"",e+=t.hash||"",e}function q(){this.protocol=null,this.slashes=null,this.auth=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null}const Y=/^([a-z0-9.+-]+:)/i,Z=/:[0-9]*$/,X=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,$=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),J=["'"].concat($),K=["%","/","?",";","#"].concat(J),Q=["/","?","#"],tt=/^[+a-z0-9A-Z_-]{0,63}$/,et=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,rt={javascript:!0,"javascript:":!0},nt={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};q.prototype.parse=function(t,e){let r,n,i,o=t;if(o=o.trim(),!e&&1===t.split("#").length){const t=X.exec(o);if(t)return this.pathname=t[1],t[2]&&(this.search=t[2]),this}let a=Y.exec(o);if(a&&(a=a[0],r=a.toLowerCase(),this.protocol=a,o=o.substr(a.length)),(e||a||o.match(/^\/\/[^@\/]+@[^@\/]+/))&&(i="//"===o.substr(0,2),!i||a&&rt[a]||(o=o.substr(2),this.slashes=!0)),!rt[a]&&(i||a&&!nt[a])){let t,e,r=-1;for(let t=0;t127?n+="x":n+=r[t];if(!n.match(tt)){const n=t.slice(0,e),i=t.slice(e+1),a=r.match(et);a&&(n.push(a[1]),i.unshift(a[2])),i.length&&(o=i.join(".")+o),this.hostname=n.join(".");break}}}}this.hostname.length>255&&(this.hostname=""),a&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}const s=o.indexOf("#");-1!==s&&(this.hash=o.substr(s),o=o.slice(0,s));const l=o.indexOf("?");return-1!==l&&(this.search=o.substr(l),o=o.slice(0,l)),o&&(this.pathname=o),nt[r]&&this.hostname&&!this.pathname&&(this.pathname=""),this},q.prototype.parseHost=function(t){let e=Z.exec(t);e&&(e=e[0],":"!==e&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)};const it=function(t,e){if(t&&t instanceof q)return t;const r=new q;return r.parse(t,e),r},ot=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDEAD\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/,at=/[\$\+<->\^`\|~\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u07FE\u07FF\u0888\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u166D\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20C0\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2B95\u2B97-\u2BFF\u2CE5-\u2CEA\u2E50\u2E51\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u31EF\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uAB5B\uAB6A\uAB6B\uFB29\uFBB2-\uFBC2\uFD40-\uFD4F\uFDCF\uFDFC-\uFDFF\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD]|\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD807[\uDFD5-\uDFF1]|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD833[\uDF50-\uDFC3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDEA\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD838[\uDD4F\uDEFF]|\uD83B[\uDCAC\uDCB0\uDD2E\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED7\uDEDC-\uDEEC\uDEF0-\uDEFC\uDF00-\uDF76\uDF7B-\uDFD9\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0\uDCB1\uDD00-\uDE53\uDE60-\uDE6D\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC5\uDECE-\uDEDB\uDEE0-\uDEE8\uDEF0-\uDEF8\uDF00-\uDF92\uDF94-\uDFCA]/,st=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,lt=/[\0-\x1F\x7F-\x9F]/,ct=/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u0890\u0891\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD80D[\uDC30-\uDC3F]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/,ut=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/,ht=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏ੊ઑඡ๭༉༦჊ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ὾⁠↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms„‹•˜¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲ΂ϏϢϸontourIntegraìȹoɴ͹\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՗՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲ׌y;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱cò׋؀JTabcdfgorstר׬ׯ׺؀ؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d׷׸䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇܎ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ޷޼߂ߐĀiyޱ޵rc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄΀HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶߻dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣ঳সে্਷ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗ࡜ࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४Ānrࢃ࢏gleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpw৔ਖਛgȀLRlr৞৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼੝੠੷੼અઋ઎p;椅y;䐜Ādl੥੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑ඗ඞcy;䐊cute;䅃ƀaey઴હાron;䅇dil;䅅;䐝ƀgswે૰଎ativeƀMTV૓૟૨ediumSpace;怋hiĀcn૦૘ë૙eryThiî૙tedĀGL૸ଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷ଺reak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪୼஡௫ఄ౞಄ದ೘ൡඅ櫬Āou୛୤ngruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊ஛ement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater΀;EFGLSTஶஷ஽௉௓௘௥扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲௽ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ೒拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨೹setĀ;E೰ೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂ෉෕ෛ෠෧෼ขภยา฿ไlig;䅒cute耻Ó䃓Āiy෎ීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲ෶cr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬื฼de耻Õ䃕es;樷ml耻Ö䃖erĀBP๋๠Āar๐๓r;怾acĀek๚๜;揞et;掴arenthesis;揜Ҁacfhilors๿ງຊຏຒດຝະ໼rtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ໠໤檻cedesȀ;EST່້໏໚扺qual;檯lantEqual;扼ilde;找me;怳Ādp໩໮uct;戏ortionĀ;aȥ໹l;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬؀BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁࿫࿳ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL࿜࿝࿡憒ar;懥eftArrow;懄eiling;按oǵ࿹\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»࿝pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄ቉ቕ቞ቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHc቎ቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗Āeiቻ኉Dzኀ\0ኇefore;戴a;䎘Ācn኎ኘkSpace;쀀  Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0᏿ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0጖y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻፿on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtè૙a;䎖r;愨pf;愤cr;쀀𝒵௡ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚΀;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒΀;Eaeiop዁ᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;e዁ᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;e዁ᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰ᜼ᝃᝈ᝸᝽០៦ᠹᡐᜍ᤽᥈ᥰot;櫭Ācrᛶ᜞kȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e᜚᜛戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;t፜᜷brk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓ᝛ᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯ᝱ᝳ;䎲;愶een;扬r;쀀𝔟g΀costuvwឍឝឳេ៕៛៞ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀako៭ᠦᠵĀcn៲ᠣkƀlst៺֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘᠝斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈؀DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬ᣿ᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教΀;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ᣷᣹᣻᣽;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ᤟;敛;敘;攘;攔΀;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģ᥂bar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;e᜚᜜lƀ;bhᥨᥩᥫ䁜;槅sub;柈Ŭᥴ᥾lĀ;e᥹᥺怢t»᥺pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭍᭒\0᯽\0ᰌƀcpr᦭ᦲ᧝ute;䄇̀;abcdsᦿᧀᧄ᧊᧕᧙戩nd;橄rcup;橉Āau᧏᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r΀;Ecefms᩟᩠ᩢᩫ᪤᪪᪮旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖᪚᪟»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇᫔᫺\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ᫙\0\0᫢aĀ;t᫞᫟䀬;䁀ƀ;fl᫨᫩᫫戁îᅠeĀmx᫱᫶ent»᫩eóɍǧ᫾\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯΀delprvw᭠᭬᭷ᮂᮬᯔ᯹arrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;p᭿ᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰸᰻᰿ᱝᱩᱵᲊᲞᲬᲷ᳻᳿ᴍᵻᶑᶫᶻ᷆᷍rò΁ar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂͸᳖᳜᳠mƀ;oș᳊᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄ὎὚ĀDoḆᴴoôᲉĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»Ṻƀaeiἒ἖Ἒls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙ῜ῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao‌⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧‪‬\0‮耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₟₥₰₴⃰⃵⃺⃿℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕ₝ute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽⃉ƀ;qsؾٌ⃄lanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqr׮ⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0↎proø₞r;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢␧␭␱␵␻ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀஀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼rò৆òΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonó྘quigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d྘➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ᠛旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐௏쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop඄⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roø඄urĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓΀;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨í஘istĀ;s஠டr;쀀𝔫ȀEest௅⩦⩹⩼ƀ;qs஼⩭௡ƀ;qs஼௅⩴lanô௢ií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚΀AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs఻⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs఻⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast୻⭕⭚⭟lleì୻l;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖ΀chimpqu⮽⯍⯙⬄୸⯤⯯Ȁ;cerല⯆ഷ⯉uå൅;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭å೸åഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñ೗Ā;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰⳴ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥ⵲ⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;c᪞ⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācr⵩⵭ir;榿;쀀𝔬ͯ⵹\0\0⵼\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕ⶘ⶥⶨrò᪀Āir⶝ⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔ⷗ǒr;榷rp;榹΀;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ⹞\0⹽\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ⹧⹲຅脀¶;l⹭⹮䂶leìЃɩ⹸\0\0⹻m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳⻴ᤈ⻹⻽⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp໬⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t໻⾴ï໻rel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⿚⋢⿟⿥⿫⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei⿾々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔઀ABHabcdefhilmnoprstux぀けさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤΀cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstw࿜ガクシスゼゾダッデナp;極Ā;f࿠ゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes㄂㄄;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ì࿲âヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘㇤㇮rrowĀ;t࿜ㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowó࿪arpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓rò࿪aòՑ;怏oustĀ;a㈞㈟掱che»㈟mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦΀Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼਴t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì⹯耻­䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;q኱ኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫ਩war;椪lig耻ß䃟௡㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rë๟ƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproø዁im»ኬsðኞĀas㚺㚮ð዁rn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈ΀adempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xô᝷headĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜΀eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roð໻tré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚΀cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜ៟tré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map((t=>t.charCodeAt(0)))),dt=new Uint16Array("Ȁaglq\tɭ\0\0p;䀦os;䀧t;䀾t;䀼uot;䀢".split("").map((t=>t.charCodeAt(0))));var ft;const pt=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]),mt=null!==(ft=String.fromCodePoint)&&void 0!==ft?ft:function(t){let e="";return t>65535&&(t-=65536,e+=String.fromCharCode(t>>>10&1023|55296),t=56320|1023&t),e+=String.fromCharCode(t),e};var gt,vt,bt,yt,xt;function _t(t){return t>=gt.ZERO&&t<=gt.NINE}!function(t){t[t.NUM=35]="NUM",t[t.SEMI=59]="SEMI",t[t.EQUALS=61]="EQUALS",t[t.ZERO=48]="ZERO",t[t.NINE=57]="NINE",t[t.LOWER_A=97]="LOWER_A",t[t.LOWER_F=102]="LOWER_F",t[t.LOWER_X=120]="LOWER_X",t[t.LOWER_Z=122]="LOWER_Z",t[t.UPPER_A=65]="UPPER_A",t[t.UPPER_F=70]="UPPER_F",t[t.UPPER_Z=90]="UPPER_Z"}(gt||(gt={})),function(t){t[t.VALUE_LENGTH=49152]="VALUE_LENGTH",t[t.BRANCH_LENGTH=16256]="BRANCH_LENGTH",t[t.JUMP_TABLE=127]="JUMP_TABLE"}(vt||(vt={})),function(t){t[t.EntityStart=0]="EntityStart",t[t.NumericStart=1]="NumericStart",t[t.NumericDecimal=2]="NumericDecimal",t[t.NumericHex=3]="NumericHex",t[t.NamedEntity=4]="NamedEntity"}(bt||(bt={})),(xt=yt||(yt={}))[xt.Legacy=0]="Legacy",xt[xt.Strict=1]="Strict",xt[xt.Attribute=2]="Attribute";class wt{constructor(t,e,r){this.decodeTree=t,this.emitCodePoint=e,this.errors=r,this.state=bt.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=yt.Strict}startEntity(t){this.decodeMode=t,this.state=bt.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(t,e){switch(this.state){case bt.EntityStart:return t.charCodeAt(e)===gt.NUM?(this.state=bt.NumericStart,this.consumed+=1,this.stateNumericStart(t,e+1)):(this.state=bt.NamedEntity,this.stateNamedEntity(t,e));case bt.NumericStart:return this.stateNumericStart(t,e);case bt.NumericDecimal:return this.stateNumericDecimal(t,e);case bt.NumericHex:return this.stateNumericHex(t,e);case bt.NamedEntity:return this.stateNamedEntity(t,e)}}stateNumericStart(t,e){return e>=t.length?-1:(32|t.charCodeAt(e))===gt.LOWER_X?(this.state=bt.NumericHex,this.consumed+=1,this.stateNumericHex(t,e+1)):(this.state=bt.NumericDecimal,this.stateNumericDecimal(t,e))}addToNumericResult(t,e,r,n){if(e!==r){const i=r-e;this.result=this.result*Math.pow(n,i)+parseInt(t.substr(e,i),n),this.consumed+=i}}stateNumericHex(t,e){const r=e;for(;e=gt.UPPER_A&&n<=gt.UPPER_F||n>=gt.LOWER_A&&n<=gt.LOWER_F)))return this.addToNumericResult(t,r,e,16),this.emitNumericEntity(i,3);e+=1}var n;return this.addToNumericResult(t,r,e,16),-1}stateNumericDecimal(t,e){const r=e;for(;e=55296&&t<=57343||t>1114111?65533:null!==(e=pt.get(t))&&void 0!==e?e:t}(this.result),this.consumed),this.errors&&(t!==gt.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(t,e){const{decodeTree:r}=this;let n=r[this.treeIndex],i=(n&vt.VALUE_LENGTH)>>14;for(;e=gt.UPPER_A&&t<=gt.UPPER_Z||t>=gt.LOWER_A&&t<=gt.LOWER_Z||_t(t)}(o)))?0:this.emitNotTerminatedNamedEntity();if(n=r[this.treeIndex],i=(n&vt.VALUE_LENGTH)>>14,0!==i){if(a===gt.SEMI)return this.emitNamedEntityData(this.treeIndex,i,this.consumed+this.excess);this.decodeMode!==yt.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}var o;return-1}emitNotTerminatedNamedEntity(){var t;const{result:e,decodeTree:r}=this,n=(r[e]&vt.VALUE_LENGTH)>>14;return this.emitNamedEntityData(e,n,this.consumed),null===(t=this.errors)||void 0===t||t.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(t,e,r){const{decodeTree:n}=this;return this.emitCodePoint(1===e?n[t]&~vt.VALUE_LENGTH:n[t+1],r),3===e&&this.emitCodePoint(n[t+2],r),r}end(){var t;switch(this.state){case bt.NamedEntity:return 0===this.result||this.decodeMode===yt.Attribute&&this.result!==this.treeIndex?0:this.emitNotTerminatedNamedEntity();case bt.NumericDecimal:return this.emitNumericEntity(0,2);case bt.NumericHex:return this.emitNumericEntity(0,3);case bt.NumericStart:return null===(t=this.errors)||void 0===t||t.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case bt.EntityStart:return 0}}}function kt(t){let e="";const r=new wt(t,(t=>e+=mt(t)));return function(t,n){let i=0,o=0;for(;(o=t.indexOf("&",o))>=0;){e+=t.slice(i,o),r.startEntity(n);const a=r.write(t,o+1);if(a<0){i=o+r.end();break}i=o+a,o=0===a?i+1:i}const a=e+t.slice(i);return e="",a}}function At(t,e,r,n){const i=(e&vt.BRANCH_LENGTH)>>7,o=e&vt.JUMP_TABLE;if(0===i)return 0!==o&&n===o?r:-1;if(o){const e=n-o;return e<0||e>=i?-1:t[r+e]-1}let a=r,s=a+i-1;for(;a<=s;){const e=a+s>>>1,r=t[e];if(rn))return t[e+i];s=e-1}}return-1}const Mt=kt(ht);function Tt(t,e=yt.Legacy){return Mt(t,e)}function St(t){for(let e=1;e'"]/g,Ct),Et(/["&\u00A0]/g,new Map([[34,"""],[38,"&"],[160," "]])),Et(/[&<>\u00A0]/g,new Map([[38,"&"],[60,"<"],[62,">"],[160," "]])),function(t){t[t.XML=0]="XML",t[t.HTML=1]="HTML"}(Lt||(Lt={})),function(t){t[t.UTF8=0]="UTF8",t[t.ASCII=1]="ASCII",t[t.Extensive=2]="Extensive",t[t.Attribute=3]="Attribute",t[t.Text=4]="Text"}(zt||(zt={}));const Dt=Object.prototype.hasOwnProperty;function It(t,e){return Dt.call(t,e)}function Ft(t){return Array.prototype.slice.call(arguments,1).forEach((function(e){if(e){if("object"!=typeof e)throw new TypeError(e+"must be object");Object.keys(e).forEach((function(r){t[r]=e[r]}))}})),t}function Rt(t,e,r){return[].concat(t.slice(0,e),r,t.slice(e+1))}function Pt(t){return!(t>=55296&&t<=57343||t>=64976&&t<=65007||!(65535&~t&&65534!=(65535&t))||t>=0&&t<=8||11===t||t>=14&&t<=31||t>=127&&t<=159||t>1114111)}function jt(t){if(t>65535){const e=55296+((t-=65536)>>10),r=56320+(1023&t);return String.fromCharCode(e,r)}return String.fromCharCode(t)}const Nt=/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g,Bt=new RegExp(Nt.source+"|"+/&([a-z#][a-z0-9]{1,31});/gi.source,"gi"),Ut=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function Gt(t){return t.indexOf("\\")<0?t:t.replace(Nt,"$1")}function Vt(t){return t.indexOf("\\")<0&&t.indexOf("&")<0?t:t.replace(Bt,(function(t,e,r){return e||function(t,e){if(35===e.charCodeAt(0)&&Ut.test(e)){const r="x"===e[1].toLowerCase()?parseInt(e.slice(2),16):parseInt(e.slice(1),10);return Pt(r)?jt(r):t}const r=Tt(t);return r!==t?r:t}(t,r)}))}const Ht=/[&<>"]/,Wt=/[&<>"]/g,qt={"&":"&","<":"<",">":">",'"':"""};function Yt(t){return qt[t]}function Zt(t){return Ht.test(t)?t.replace(Wt,Yt):t}const Xt=/[.?*+^$[\]\\(){}|-]/g;function $t(t){return t.replace(Xt,"\\$&")}function Jt(t){switch(t){case 9:case 32:return!0}return!1}function Kt(t){if(t>=8192&&t<=8202)return!0;switch(t){case 9:case 10:case 11:case 12:case 13:case 32:case 160:case 5760:case 8239:case 8287:case 12288:return!0}return!1}function Qt(t){return ot.test(t)||at.test(t)}function te(t){switch(t){case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 124:case 125:case 126:return!0;default:return!1}}function ee(t){return t=t.trim().replace(/\s+/g," "),"Ṿ"==="ẞ".toLowerCase()&&(t=t.replace(/ẞ/g,"ß")),t.toLowerCase().toUpperCase()}const re={mdurl:t,ucmicro:e};function ne(t,e,r){let n,i,o,a;const s=t.posMax,l=t.pos;for(t.pos=e+1,n=1;t.pos32))return o;if(41===n){if(0===a)break;a--}i++}return e===i||0!==a||(o.str=Vt(t.slice(e,i)),o.pos=i,o.ok=!0),o}function oe(t,e,r,n){let i,o=e;const a={ok:!1,can_continue:!1,pos:0,str:"",marker:0};if(n)a.str=n.str,a.marker=n.marker;else{if(o>=r)return a;let n=t.charCodeAt(o);if(34!==n&&39!==n&&40!==n)return a;e++,o++,40===n&&(n=41),a.marker=n}for(;o"+Zt(o.content)+""},ae.code_block=function(t,e,r,n,i){const o=t[e];return""+Zt(t[e].content)+"\n"},ae.fence=function(t,e,r,n,i){const o=t[e],a=o.info?Vt(o.info).trim():"";let s,l="",c="";if(a){const t=a.split(/(\s+)/g);l=t[0],c=t.slice(2).join("")}if(s=r.highlight&&r.highlight(o.content,l,c)||Zt(o.content),0===s.indexOf("${s}\n`}return`
${s}
\n`},ae.image=function(t,e,r,n,i){const o=t[e];return o.attrs[o.attrIndex("alt")][1]=i.renderInlineAsText(o.children,r,n),i.renderToken(t,e,r)},ae.hardbreak=function(t,e,r){return r.xhtmlOut?"
\n":"
\n"},ae.softbreak=function(t,e,r){return r.breaks?r.xhtmlOut?"
\n":"
\n":"\n"},ae.text=function(t,e){return Zt(t[e].content)},ae.html_block=function(t,e){return t[e].content},ae.html_inline=function(t,e){return t[e].content},se.prototype.renderAttrs=function(t){let e,r,n;if(!t.attrs)return"";for(n="",e=0,r=t.attrs.length;e\n":">",i},se.prototype.renderInline=function(t,e,r){let n="";const i=this.rules;for(let o=0,a=t.length;o=0&&(r=this.attrs[e][1]),r},he.prototype.attrJoin=function(t,e){const r=this.attrIndex(t);r<0?this.attrPush([t,e]):this.attrs[r][1]=this.attrs[r][1]+" "+e};const de=he;function fe(t,e,r){this.src=t,this.env=r,this.tokens=[],this.inlineMode=!1,this.md=e}fe.prototype.Token=de;const pe=fe,me=/\r\n?|\n/g,ge=/\0/g;function ve(t){return/^<\/a\s*>/i.test(t)}const be=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,ye=/\((c|tm|r)\)/i,xe=/\((c|tm|r)\)/gi,_e={c:"©",r:"®",tm:"™"};function we(t,e){return _e[e.toLowerCase()]}function ke(t){let e=0;for(let r=t.length-1;r>=0;r--){const n=t[r];"text"!==n.type||e||(n.content=n.content.replace(xe,we)),"link_open"===n.type&&"auto"===n.info&&e--,"link_close"===n.type&&"auto"===n.info&&e++}}function Ae(t){let e=0;for(let r=t.length-1;r>=0;r--){const n=t[r];"text"!==n.type||e||be.test(n.content)&&(n.content=n.content.replace(/\+-/g,"±").replace(/\.{2,}/g,"…").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---(?=[^-]|$)/gm,"$1—").replace(/(^|\s)--(?=\s|$)/gm,"$1–").replace(/(^|[^-\s])--(?=[^-\s]|$)/gm,"$1–")),"link_open"===n.type&&"auto"===n.info&&e--,"link_close"===n.type&&"auto"===n.info&&e++}}const Me=/['"]/,Te=/['"]/g;function Se(t,e,r){return t.slice(0,e)+r+t.slice(e+1)}function Ce(t,e){let r;const n=[];for(let i=0;i=0&&!(n[r].level<=a);r--);if(n.length=r+1,"text"!==o.type)continue;let s=o.content,l=0,c=s.length;t:for(;l=0)p=s.charCodeAt(u.index-1);else for(r=i-1;r>=0&&"softbreak"!==t[r].type&&"hardbreak"!==t[r].type;r--)if(t[r].content){p=t[r].content.charCodeAt(t[r].content.length-1);break}let m=32;if(l=48&&p<=57&&(d=h=!1),h&&d&&(h=g,d=v),h||d){if(d)for(r=n.length-1;r>=0;r--){let h=n[r];if(n[r].level=0;a--){const s=i[a];if("link_close"!==s.type){if("html_inline"===s.type&&(r=s.content,/^\s]/i.test(r)&&o>0&&o--,ve(s.content)&&o++),!(o>0)&&"text"===s.type&&t.md.linkify.test(s.content)){const r=s.content;let o=t.md.linkify.match(r);const l=[];let c=s.level,u=0;o.length>0&&0===o[0].index&&a>0&&"text_special"===i[a-1].type&&(o=o.slice(1));for(let e=0;eu){const e=new t.Token("text","",0);e.content=r.slice(u,s),e.level=c,l.push(e)}const h=new t.Token("link_open","a",1);h.attrs=[["href",i]],h.level=c++,h.markup="linkify",h.info="auto",l.push(h);const d=new t.Token("text","",0);d.content=a,d.level=c,l.push(d);const f=new t.Token("link_close","a",-1);f.level=--c,f.markup="linkify",f.info="auto",l.push(f),u=o[e].lastIndex}if(u=0;e--)"inline"===t.tokens[e].type&&(ye.test(t.tokens[e].content)&&ke(t.tokens[e].children),be.test(t.tokens[e].content)&&Ae(t.tokens[e].children))}],["smartquotes",function(t){if(t.md.options.typographer)for(let e=t.tokens.length-1;e>=0;e--)"inline"===t.tokens[e].type&&Me.test(t.tokens[e].content)&&Ce(t.tokens[e].children,t)}],["text_join",function(t){let e,r;const n=t.tokens,i=n.length;for(let t=0;t0&&this.level++,this.tokens.push(n),n},Oe.prototype.isEmpty=function(t){return this.bMarks[t]+this.tShift[t]>=this.eMarks[t]},Oe.prototype.skipEmptyLines=function(t){for(let e=this.lineMax;te;)if(!Jt(this.src.charCodeAt(--t)))return t+1;return t},Oe.prototype.skipChars=function(t,e){for(let r=this.src.length;tr;)if(e!==this.src.charCodeAt(--t))return t+1;return t},Oe.prototype.getLines=function(t,e,r,n){if(t>=e)return"";const i=new Array(e-t);for(let o=0,a=t;ar?new Array(t-r+1).join(" ")+this.src.slice(c,l):this.src.slice(c,l)}return i.join("")},Oe.prototype.Token=de;const De=Oe;function Ie(t,e){const r=t.bMarks[e]+t.tShift[e],n=t.eMarks[e];return t.src.slice(r,n)}function Fe(t){const e=[],r=t.length;let n=0,i=t.charCodeAt(n),o=!1,a=0,s="";for(;n=n)return-1;let o=t.src.charCodeAt(i++);if(o<48||o>57)return-1;for(;;){if(i>=n)return-1;if(o=t.src.charCodeAt(i++),!(o>=48&&o<=57)){if(41===o||46===o)break;return-1}if(i-r>=10)return-1}return i`\\x00-\\x20]+|'[^']*'|\"[^\"]*\"))?)*\\s*\\/?>",Ne="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",Be=new RegExp("^(?:"+je+"|"+Ne+"|\x3c!---?>|\x3c!--(?:[^-]|-[^-]|--[^>])*--\x3e|<[?][\\s\\S]*?[?]>|]*>|)"),Ue=new RegExp("^(?:"+je+"|"+Ne+")"),Ge=[[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^/,!0],[/^<\?/,/\?>/,!0],[/^/,!0],[/^/,!0],[new RegExp("^|$))","i"),/^$/,!0],[new RegExp(Ue.source+"\\s*$"),/^$/,!1]],Ve=[["table",function(t,e,r,n){if(e+2>r)return!1;let i=e+1;if(t.sCount[i]=4)return!1;let o=t.bMarks[i]+t.tShift[i];if(o>=t.eMarks[i])return!1;const a=t.src.charCodeAt(o++);if(124!==a&&45!==a&&58!==a)return!1;if(o>=t.eMarks[i])return!1;const s=t.src.charCodeAt(o++);if(124!==s&&45!==s&&58!==s&&!Jt(s))return!1;if(45===a&&Jt(s))return!1;for(;o=4)return!1;c=Fe(l),c.length&&""===c[0]&&c.shift(),c.length&&""===c[c.length-1]&&c.pop();const h=c.length;if(0===h||h!==u.length)return!1;if(n)return!0;const d=t.parentType;t.parentType="table";const f=t.md.block.ruler.getRules("blockquote"),p=[e,0];t.push("table_open","table",1).map=p,t.push("thead_open","thead",1).map=[e,e+1],t.push("tr_open","tr",1).map=[e,e+1];for(let e=0;e=4)break;if(c=Fe(l),c.length&&""===c[0]&&c.shift(),c.length&&""===c[c.length-1]&&c.pop(),g+=h-c.length,g>65536)break;i===e+2&&(t.push("tbody_open","tbody",1).map=m=[e+2,0]),t.push("tr_open","tr",1).map=[i,i+1];for(let e=0;e=4))break;n++,i=n}t.line=i;const o=t.push("code_block","code",0);return o.content=t.getLines(e,i,4+t.blkIndent,!1)+"\n",o.map=[e,t.line],!0}],["fence",function(t,e,r,n){let i=t.bMarks[e]+t.tShift[e],o=t.eMarks[e];if(t.sCount[e]-t.blkIndent>=4)return!1;if(i+3>o)return!1;const a=t.src.charCodeAt(i);if(126!==a&&96!==a)return!1;let s=i;i=t.skipChars(i,a);let l=i-s;if(l<3)return!1;const c=t.src.slice(s,i),u=t.src.slice(i,o);if(96===a&&u.indexOf(String.fromCharCode(a))>=0)return!1;if(n)return!0;let h=e,d=!1;for(;!(h++,h>=r||(i=s=t.bMarks[h]+t.tShift[h],o=t.eMarks[h],i=4||(i=t.skipChars(i,a),i-s=4)return!1;if(62!==t.src.charCodeAt(i))return!1;if(n)return!0;const s=[],l=[],c=[],u=[],h=t.md.block.ruler.getRules("blockquote"),d=t.parentType;t.parentType="blockquote";let f,p=!1;for(f=e;f=o)break;if(62===t.src.charCodeAt(i++)&&!e){let e,r,n=t.sCount[f]+1;32===t.src.charCodeAt(i)?(i++,n++,r=!1,e=!0):9===t.src.charCodeAt(i)?(e=!0,(t.bsCount[f]+n)%4==3?(i++,n++,r=!1):r=!0):e=!1;let a=n;for(s.push(t.bMarks[f]),t.bMarks[f]=i;i=o,l.push(t.bsCount[f]),t.bsCount[f]=t.sCount[f]+1+(e?1:0),c.push(t.sCount[f]),t.sCount[f]=a-n,u.push(t.tShift[f]),t.tShift[f]=i-t.bMarks[f];continue}if(p)break;let n=!1;for(let e=0,i=h.length;e";const v=[e,0];g.map=v,t.md.block.tokenize(t,e,f),t.push("blockquote_close","blockquote",-1).markup=">",t.lineMax=a,t.parentType=d,v[1]=t.line;for(let r=0;r=4)return!1;let o=t.bMarks[e]+t.tShift[e];const a=t.src.charCodeAt(o++);if(42!==a&&45!==a&&95!==a)return!1;let s=1;for(;o=4)return!1;if(t.listIndent>=0&&t.sCount[l]-t.listIndent>=4&&t.sCount[l]=t.blkIndent&&(f=!0),(d=Pe(t,l))>=0){if(u=!0,a=t.bMarks[l]+t.tShift[l],h=Number(t.src.slice(a,d-1)),f&&1!==h)return!1}else{if(!((d=Re(t,l))>=0))return!1;u=!1}if(f&&t.skipSpaces(d)>=t.eMarks[l])return!1;if(n)return!0;const p=t.src.charCodeAt(d-1),m=t.tokens.length;u?(s=t.push("ordered_list_open","ol",1),1!==h&&(s.attrs=[["start",h]])):s=t.push("bullet_list_open","ul",1);const g=[l,0];s.map=g,s.markup=String.fromCharCode(p);let v=!1;const b=t.md.block.ruler.getRules("list"),y=t.parentType;for(t.parentType="list";l=i?1:n-e,f>4&&(f=1);const m=e+f;s=t.push("list_item_open","li",1),s.markup=String.fromCharCode(p);const g=[l,0];s.map=g,u&&(s.info=t.src.slice(a,d-1));const y=t.tight,x=t.tShift[l],_=t.sCount[l],w=t.listIndent;if(t.listIndent=t.blkIndent,t.blkIndent=m,t.tight=!0,t.tShift[l]=h-t.bMarks[l],t.sCount[l]=n,h>=i&&t.isEmpty(l+1)?t.line=Math.min(t.line+2,r):t.md.block.tokenize(t,l,r,!0),t.tight&&!v||(c=!1),v=t.line-l>1&&t.isEmpty(t.line-1),t.blkIndent=t.listIndent,t.listIndent=w,t.tShift[l]=x,t.sCount[l]=_,t.tight=y,s=t.push("list_item_close","li",-1),s.markup=String.fromCharCode(p),l=t.line,g[1]=l,l>=r)break;if(t.sCount[l]=4)break;let k=!1;for(let e=0,n=b.length;e=4)return!1;if(91!==t.src.charCodeAt(i))return!1;function s(e){const r=t.lineMax;if(e>=r||t.isEmpty(e))return null;let n=!1;if(t.sCount[e]-t.blkIndent>3&&(n=!0),t.sCount[e]<0&&(n=!0),!n){const n=t.md.block.ruler.getRules("reference"),i=t.parentType;t.parentType="reference";let o=!1;for(let i=0,a=n.length;i=4)return!1;if(!t.md.options.html)return!1;if(60!==t.src.charCodeAt(i))return!1;let a=t.src.slice(i,o),s=0;for(;s=4)return!1;let a=t.src.charCodeAt(i);if(35!==a||i>=o)return!1;let s=1;for(a=t.src.charCodeAt(++i);35===a&&i6||ii&&Jt(t.src.charCodeAt(l-1))&&(o=l),t.line=e+1;const c=t.push("heading_open","h"+String(s),1);c.markup="########".slice(0,s),c.map=[e,t.line];const u=t.push("inline","",0);return u.content=t.src.slice(i,o).trim(),u.map=[e,t.line],u.children=[],t.push("heading_close","h"+String(s),-1).markup="########".slice(0,s),!0},["paragraph","reference","blockquote"]],["lheading",function(t,e,r){const n=t.md.block.ruler.getRules("paragraph");if(t.sCount[e]-t.blkIndent>=4)return!1;const i=t.parentType;t.parentType="paragraph";let o,a=0,s=e+1;for(;s3)continue;if(t.sCount[s]>=t.blkIndent){let e=t.bMarks[s]+t.tShift[s];const r=t.eMarks[s];if(e=r))){a=61===o?1:2;break}}if(t.sCount[s]<0)continue;let e=!1;for(let i=0,o=n.length;i3)continue;if(t.sCount[o]<0)continue;let e=!1;for(let i=0,a=n.length;i=r))&&!(t.sCount[a]=o){t.line=r;break}const e=t.line;let l=!1;for(let o=0;o=t.line)throw new Error("block rule didn't increment state.line");break}if(!l)throw new Error("none of the block rules matched");t.tight=!s,t.isEmpty(t.line-1)&&(s=!0),a=t.line,a0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],i={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(n),this.tokens_meta.push(i),n},qe.prototype.scanDelims=function(t,e){const r=this.posMax,n=this.src.charCodeAt(t),i=t>0?this.src.charCodeAt(t-1):32;let o=t;for(;o?@[]^_`{|}~-".split("").forEach((function(t){$e[t.charCodeAt(0)]=1}));const Ke={tokenize:function(t,e){const r=t.pos,n=t.src.charCodeAt(r);if(e)return!1;if(126!==n)return!1;const i=t.scanDelims(t.pos,!0);let o=i.length;const a=String.fromCharCode(n);if(o<2)return!1;let s;o%2&&(s=t.push("text","",0),s.content=a,o--);for(let e=0;e=0;r--){const n=e[r];if(95!==n.marker&&42!==n.marker)continue;if(-1===n.end)continue;const i=e[n.end],o=r>0&&e[r-1].end===n.end+1&&e[r-1].marker===n.marker&&e[r-1].token===n.token-1&&e[n.end+1].token===i.token+1,a=String.fromCharCode(n.marker),s=t.tokens[n.token];s.type=o?"strong_open":"em_open",s.tag=o?"strong":"em",s.nesting=1,s.markup=o?a+a:a,s.content="";const l=t.tokens[i.token];l.type=o?"strong_close":"em_close",l.tag=o?"strong":"em",l.nesting=-1,l.markup=o?a+a:a,l.content="",o&&(t.tokens[e[r-1].token].content="",t.tokens[e[n.end+1].token].content="",r--)}}const tr={tokenize:function(t,e){const r=t.pos,n=t.src.charCodeAt(r);if(e)return!1;if(95!==n&&42!==n)return!1;const i=t.scanDelims(t.pos,42===n);for(let e=0;e\x00-\x20]*)$/,nr=/^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i,ir=/^&([a-z][a-z0-9]{1,31});/i;function or(t){const e={},r=t.length;if(!r)return;let n=0,i=-2;const o=[];for(let a=0;as;l-=o[l]+1){const e=t[l];if(e.marker===r.marker&&e.open&&e.end<0){let n=!1;if((e.close||r.open)&&(e.length+r.length)%3==0&&(e.length%3==0&&r.length%3==0||(n=!0)),!n){const n=l>0&&!t[l-1].open?o[l-1]+1:0;o[a]=a-l+n,o[l]=n,r.open=!1,e.end=a,e.close=!1,c=-1,i=-2;break}}}-1!==c&&(e[r.marker][(r.open?3:0)+(r.length||0)%3]=c)}}const ar=[["text",function(t,e){let r=t.pos;for(;r0)return!1;const r=t.pos;if(r+3>t.posMax)return!1;if(58!==t.src.charCodeAt(r))return!1;if(47!==t.src.charCodeAt(r+1))return!1;if(47!==t.src.charCodeAt(r+2))return!1;const n=t.pending.match(Xe);if(!n)return!1;const i=n[1],o=t.md.linkify.matchAtStart(t.src.slice(r-i.length));if(!o)return!1;let a=o.url;if(a.length<=i.length)return!1;a=a.replace(/\*+$/,"");const s=t.md.normalizeLink(a);if(!t.md.validateLink(s))return!1;if(!e){t.pending=t.pending.slice(0,-i.length);const e=t.push("link_open","a",1);e.attrs=[["href",s]],e.markup="linkify",e.info="auto",t.push("text","",0).content=t.md.normalizeLinkText(a);const r=t.push("link_close","a",-1);r.markup="linkify",r.info="auto"}return t.pos+=a.length-i.length,!0}],["newline",function(t,e){let r=t.pos;if(10!==t.src.charCodeAt(r))return!1;const n=t.pending.length-1,i=t.posMax;if(!e)if(n>=0&&32===t.pending.charCodeAt(n))if(n>=1&&32===t.pending.charCodeAt(n-1)){let e=n-1;for(;e>=1&&32===t.pending.charCodeAt(e-1);)e--;t.pending=t.pending.slice(0,e),t.push("hardbreak","br",0)}else t.pending=t.pending.slice(0,-1),t.push("softbreak","br",0);else t.push("softbreak","br",0);for(r++;r=n)return!1;let i=t.src.charCodeAt(r);if(10===i){for(e||t.push("hardbreak","br",0),r++;r=55296&&i<=56319&&r+1=56320&&e<=57343&&(o+=t.src[r+1],r++)}const a="\\"+o;if(!e){const e=t.push("text_special","",0);i<256&&0!==$e[i]?e.content=o:e.content=a,e.markup=a,e.info="escape"}return t.pos=r+1,!0}],["backticks",function(t,e){let r=t.pos;if(96!==t.src.charCodeAt(r))return!1;const n=r;r++;const i=t.posMax;for(;r=h)return!1;if(l=p,i=t.md.helpers.parseLinkDestination(t.src,p,t.posMax),i.ok){for(a=t.md.normalizeLink(i.str),t.md.validateLink(a)?p=i.pos:a="",l=p;p=h||41!==t.src.charCodeAt(p))&&(c=!0),p++}if(c){if(void 0===t.env.references)return!1;if(p=0?n=t.src.slice(l,p++):p=f+1):p=f+1,n||(n=t.src.slice(d,f)),o=t.env.references[ee(n)],!o)return t.pos=u,!1;a=o.href,s=o.title}if(!e){t.pos=d,t.posMax=f;const e=[["href",a]];t.push("link_open","a",1).attrs=e,s&&e.push(["title",s]),t.linkLevel++,t.md.inline.tokenize(t),t.linkLevel--,t.push("link_close","a",-1)}return t.pos=p,t.posMax=h,!0}],["image",function(t,e){let r,n,i,o,a,s,l,c,u="";const h=t.pos,d=t.posMax;if(33!==t.src.charCodeAt(t.pos))return!1;if(91!==t.src.charCodeAt(t.pos+1))return!1;const f=t.pos+2,p=t.md.helpers.parseLinkLabel(t,t.pos+1,!1);if(p<0)return!1;if(o=p+1,o=d)return!1;for(c=o,s=t.md.helpers.parseLinkDestination(t.src,o,t.posMax),s.ok&&(u=t.md.normalizeLink(s.str),t.md.validateLink(u)?o=s.pos:u=""),c=o;o=d||41!==t.src.charCodeAt(o))return t.pos=h,!1;o++}else{if(void 0===t.env.references)return!1;if(o=0?i=t.src.slice(c,o++):o=p+1):o=p+1,i||(i=t.src.slice(f,p)),a=t.env.references[ee(i)],!a)return t.pos=h,!1;u=a.href,l=a.title}if(!e){n=t.src.slice(f,p);const e=[];t.md.inline.parse(n,t.md,t.env,e);const r=t.push("image","img",0),i=[["src",u],["alt",""]];r.attrs=i,r.children=e,r.content=n,l&&i.push(["title",l])}return t.pos=o,t.posMax=d,!0}],["autolink",function(t,e){let r=t.pos;if(60!==t.src.charCodeAt(r))return!1;const n=t.pos,i=t.posMax;for(;;){if(++r>=i)return!1;const e=t.src.charCodeAt(r);if(60===e)return!1;if(62===e)break}const o=t.src.slice(n+1,r);if(rr.test(o)){const r=t.md.normalizeLink(o);if(!t.md.validateLink(r))return!1;if(!e){const e=t.push("link_open","a",1);e.attrs=[["href",r]],e.markup="autolink",e.info="auto",t.push("text","",0).content=t.md.normalizeLinkText(o);const n=t.push("link_close","a",-1);n.markup="autolink",n.info="auto"}return t.pos+=o.length+2,!0}if(er.test(o)){const r=t.md.normalizeLink("mailto:"+o);if(!t.md.validateLink(r))return!1;if(!e){const e=t.push("link_open","a",1);e.attrs=[["href",r]],e.markup="autolink",e.info="auto",t.push("text","",0).content=t.md.normalizeLinkText(o);const n=t.push("link_close","a",-1);n.markup="autolink",n.info="auto"}return t.pos+=o.length+2,!0}return!1}],["html_inline",function(t,e){if(!t.md.options.html)return!1;const r=t.posMax,n=t.pos;if(60!==t.src.charCodeAt(n)||n+2>=r)return!1;const i=t.src.charCodeAt(n+1);if(33!==i&&63!==i&&47!==i&&!function(t){const e=32|t;return e>=97&&e<=122}(i))return!1;const o=t.src.slice(n).match(Be);if(!o)return!1;if(!e){const e=t.push("html_inline","",0);e.content=o[0],a=e.content,/^\s]/i.test(a)&&t.linkLevel++,function(t){return/^<\/a\s*>/i.test(t)}(e.content)&&t.linkLevel--}var a;return t.pos+=o[0].length,!0}],["entity",function(t,e){const r=t.pos,n=t.posMax;if(38!==t.src.charCodeAt(r))return!1;if(r+1>=n)return!1;if(35===t.src.charCodeAt(r+1)){const n=t.src.slice(r).match(nr);if(n){if(!e){const e="x"===n[1][0].toLowerCase()?parseInt(n[1].slice(1),16):parseInt(n[1],10),r=t.push("text_special","",0);r.content=Pt(e)?jt(e):jt(65533),r.markup=n[0],r.info="entity"}return t.pos+=n[0].length,!0}}else{const n=t.src.slice(r).match(ir);if(n){const r=Tt(n[0]);if(r!==n[0]){if(!e){const e=t.push("text_special","",0);e.content=r,e.markup=n[0],e.info="entity"}return t.pos+=n[0].length,!0}}}return!1}]],sr=[["balance_pairs",function(t){const e=t.tokens_meta,r=t.tokens_meta.length;or(t.delimiters);for(let t=0;t0&&n++,"text"===i[e].type&&e+1=t.pos)throw new Error("inline rule didn't increment state.pos");break}}else t.pos=t.posMax;a||t.pos++,o[e]=t.pos},lr.prototype.tokenize=function(t){const e=this.ruler.getRules(""),r=e.length,n=t.posMax,i=t.md.options.maxNesting;for(;t.pos=t.pos)throw new Error("inline rule didn't increment state.pos");break}if(a){if(t.pos>=n)break}else t.pending+=t.src[t.pos++]}t.pending&&t.pushPending()},lr.prototype.parse=function(t,e,r,n){const i=new this.State(t,e,r,n);this.tokenize(i);const o=this.ruler2.getRules(""),a=o.length;for(let t=0;t=3&&":"===t[e-3]||e>=3&&"/"===t[e-3]?0:n.match(r.re.no_http)[0].length:0}},"mailto:":{validate:function(t,e,r){const n=t.slice(e);return r.re.mailto||(r.re.mailto=new RegExp("^"+r.re.src_email_name+"@"+r.re.src_host_strict,"i")),r.re.mailto.test(n)?n.match(r.re.mailto)[0].length:0}}},gr="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function vr(t){const e=t.re=function(t){const e={};t=t||{},e.src_Any=st.source,e.src_Cc=lt.source,e.src_Z=ut.source,e.src_P=ot.source,e.src_ZPCc=[e.src_Z,e.src_P,e.src_Cc].join("|"),e.src_ZCc=[e.src_Z,e.src_Cc].join("|");return e.src_pseudo_letter="(?:(?![><|]|"+e.src_ZPCc+")"+e.src_Any+")",e.src_ip4="(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)",e.src_auth="(?:(?:(?!"+e.src_ZCc+"|[@/\\[\\]()]).)+@)?",e.src_port="(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?",e.src_host_terminator="(?=$|[><|]|"+e.src_ZPCc+")(?!"+(t["---"]?"-(?!--)|":"-|")+"_|:\\d|\\.-|\\.(?!$|"+e.src_ZPCc+"))",e.src_path="(?:[/?#](?:(?!"+e.src_ZCc+"|[><|]|[()[\\]{}.,\"'?!\\-;]).|\\[(?:(?!"+e.src_ZCc+"|\\]).)*\\]|\\((?:(?!"+e.src_ZCc+"|[)]).)*\\)|\\{(?:(?!"+e.src_ZCc+'|[}]).)*\\}|\\"(?:(?!'+e.src_ZCc+'|["]).)+\\"|\\\'(?:(?!'+e.src_ZCc+"|[']).)+\\'|\\'(?="+e.src_pseudo_letter+"|[-])|\\.{2,}[a-zA-Z0-9%/&]|\\.(?!"+e.src_ZCc+"|[.]|$)|"+(t["---"]?"\\-(?!--(?:[^-]|$))(?:-*)|":"\\-+|")+",(?!"+e.src_ZCc+"|$)|;(?!"+e.src_ZCc+"|$)|\\!+(?!"+e.src_ZCc+"|[!]|$)|\\?(?!"+e.src_ZCc+"|[?]|$))+|\\/)?",e.src_email_name='[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]*',e.src_xn="xn--[a-z0-9\\-]{1,59}",e.src_domain_root="(?:"+e.src_xn+"|"+e.src_pseudo_letter+"{1,63})",e.src_domain="(?:"+e.src_xn+"|(?:"+e.src_pseudo_letter+")|(?:"+e.src_pseudo_letter+"(?:-|"+e.src_pseudo_letter+"){0,61}"+e.src_pseudo_letter+"))",e.src_host="(?:(?:(?:(?:"+e.src_domain+")\\.)*"+e.src_domain+"))",e.tpl_host_fuzzy="(?:"+e.src_ip4+"|(?:(?:(?:"+e.src_domain+")\\.)+(?:%TLDS%)))",e.tpl_host_no_ip_fuzzy="(?:(?:(?:"+e.src_domain+")\\.)+(?:%TLDS%))",e.src_host_strict=e.src_host+e.src_host_terminator,e.tpl_host_fuzzy_strict=e.tpl_host_fuzzy+e.src_host_terminator,e.src_host_port_strict=e.src_host+e.src_port+e.src_host_terminator,e.tpl_host_port_fuzzy_strict=e.tpl_host_fuzzy+e.src_port+e.src_host_terminator,e.tpl_host_port_no_ip_fuzzy_strict=e.tpl_host_no_ip_fuzzy+e.src_port+e.src_host_terminator,e.tpl_host_fuzzy_test="localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:"+e.src_ZPCc+"|>|$))",e.tpl_email_fuzzy='(^|[><|]|"|\\(|'+e.src_ZCc+")("+e.src_email_name+"@"+e.tpl_host_fuzzy_strict+")",e.tpl_link_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+e.src_ZPCc+"))((?![$+<=>^`||])"+e.tpl_host_port_fuzzy_strict+e.src_path+")",e.tpl_link_no_ip_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+e.src_ZPCc+"))((?![$+<=>^`||])"+e.tpl_host_port_no_ip_fuzzy_strict+e.src_path+")",e}(t.__opts__),r=t.__tlds__.slice();function n(t){return t.replace("%TLDS%",e.src_tlds)}t.onCompile(),t.__tlds_replaced__||r.push("a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]"),r.push(e.src_xn),e.src_tlds=r.join("|"),e.email_fuzzy=RegExp(n(e.tpl_email_fuzzy),"i"),e.link_fuzzy=RegExp(n(e.tpl_link_fuzzy),"i"),e.link_no_ip_fuzzy=RegExp(n(e.tpl_link_no_ip_fuzzy),"i"),e.host_fuzzy_test=RegExp(n(e.tpl_host_fuzzy_test),"i");const i=[];function o(t,e){throw new Error('(LinkifyIt) Invalid schema "'+t+'": '+e)}t.__compiled__={},Object.keys(t.__schemas__).forEach((function(e){const r=t.__schemas__[e];if(null===r)return;const n={validate:null,link:null};if(t.__compiled__[e]=n,"[object Object]"===hr(r))return"[object RegExp]"!==hr(r.validate)?dr(r.validate)?n.validate=r.validate:o(e,r):n.validate=function(t){return function(e,r){const n=e.slice(r);return t.test(n)?n.match(t)[0].length:0}}(r.validate),void(dr(r.normalize)?n.normalize=r.normalize:r.normalize?o(e,r):n.normalize=function(t,e){e.normalize(t)});!function(t){return"[object String]"===hr(t)}(r)?o(e,r):i.push(e)})),i.forEach((function(e){t.__compiled__[t.__schemas__[e]]&&(t.__compiled__[e].validate=t.__compiled__[t.__schemas__[e]].validate,t.__compiled__[e].normalize=t.__compiled__[t.__schemas__[e]].normalize)})),t.__compiled__[""]={validate:null,normalize:function(t,e){e.normalize(t)}};const a=Object.keys(t.__compiled__).filter((function(e){return e.length>0&&t.__compiled__[e]})).map(fr).join("|");t.re.schema_test=RegExp("(^|(?!_)(?:[><|]|"+e.src_ZPCc+"))("+a+")","i"),t.re.schema_search=RegExp("(^|(?!_)(?:[><|]|"+e.src_ZPCc+"))("+a+")","ig"),t.re.schema_at_start=RegExp("^"+t.re.schema_search.source,"i"),t.re.pretest=RegExp("("+t.re.schema_test.source+")|("+t.re.host_fuzzy_test.source+")|@","i"),function(t){t.__index__=-1,t.__text_cache__=""}(t)}function br(t,e){const r=t.__index__,n=t.__last_index__,i=t.__text_cache__.slice(r,n);this.schema=t.__schema__.toLowerCase(),this.index=r+e,this.lastIndex=n+e,this.raw=i,this.text=i,this.url=i}function yr(t,e){const r=new br(t,e);return t.__compiled__[r.schema].normalize(r,t),r}function xr(t,e){if(!(this instanceof xr))return new xr(t,e);var r;e||(r=t,Object.keys(r||{}).reduce((function(t,e){return t||pr.hasOwnProperty(e)}),!1)&&(e=t,t={})),this.__opts__=ur({},pr,e),this.__index__=-1,this.__last_index__=-1,this.__schema__="",this.__text_cache__="",this.__schemas__=ur({},mr,t),this.__compiled__={},this.__tlds__=gr,this.__tlds_replaced__=!1,this.re={},vr(this)}xr.prototype.add=function(t,e){return this.__schemas__[t]=e,vr(this),this},xr.prototype.set=function(t){return this.__opts__=ur(this.__opts__,t),this},xr.prototype.test=function(t){if(this.__text_cache__=t,this.__index__=-1,!t.length)return!1;let e,r,n,i,o,a,s,l,c;if(this.re.schema_test.test(t))for(s=this.re.schema_search,s.lastIndex=0;null!==(e=s.exec(t));)if(i=this.testSchemaAt(t,e[2],s.lastIndex),i){this.__schema__=e[2],this.__index__=e.index+e[1].length,this.__last_index__=e.index+e[0].length+i;break}return this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&(l=t.search(this.re.host_fuzzy_test),l>=0&&(this.__index__<0||l=0&&null!==(n=t.match(this.re.email_fuzzy))&&(o=n.index+n[1].length,a=n.index+n[0].length,(this.__index__<0||othis.__last_index__)&&(this.__schema__="mailto:",this.__index__=o,this.__last_index__=a))),this.__index__>=0},xr.prototype.pretest=function(t){return this.re.pretest.test(t)},xr.prototype.testSchemaAt=function(t,e,r){return this.__compiled__[e.toLowerCase()]?this.__compiled__[e.toLowerCase()].validate(t,r,this):0},xr.prototype.match=function(t){const e=[];let r=0;this.__index__>=0&&this.__text_cache__===t&&(e.push(yr(this,r)),r=this.__last_index__);let n=r?t.slice(r):t;for(;this.test(n);)e.push(yr(this,r)),n=n.slice(this.__last_index__),r+=this.__last_index__;return e.length?e:null},xr.prototype.matchAtStart=function(t){if(this.__text_cache__=t,this.__index__=-1,!t.length)return null;const e=this.re.schema_at_start.exec(t);if(!e)return null;const r=this.testSchemaAt(t,e[2],e[0].length);return r?(this.__schema__=e[2],this.__index__=e.index+e[1].length,this.__last_index__=e.index+e[0].length+r,yr(this,0)):null},xr.prototype.tlds=function(t,e){return t=Array.isArray(t)?t:[t],e?(this.__tlds__=this.__tlds__.concat(t).sort().filter((function(t,e,r){return t!==r[e-1]})).reverse(),vr(this),this):(this.__tlds__=t.slice(),this.__tlds_replaced__=!0,vr(this),this)},xr.prototype.normalize=function(t){t.schema||(t.url="http://"+t.url),"mailto:"!==t.schema||/^mailto:/i.test(t.url)||(t.url="mailto:"+t.url)},xr.prototype.onCompile=function(){};const _r=xr,wr=2147483647,kr=36,Ar=/^xn--/,Mr=/[^\0-\x7F]/,Tr=/[\x2E\u3002\uFF0E\uFF61]/g,Sr={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},Cr=Math.floor,Er=String.fromCharCode;function Lr(t){throw new RangeError(Sr[t])}function zr(t,e){const r=t.split("@");let n="";r.length>1&&(n=r[0]+"@",t=r[1]);const i=function(t,e){const r=[];let n=t.length;for(;n--;)r[n]=e(t[n]);return r}((t=t.replace(Tr,".")).split("."),e).join(".");return n+i}function Or(t){const e=[];let r=0;const n=t.length;for(;r=55296&&i<=56319&&r>1,t+=Cr(t/e);t>455;n+=kr)t=Cr(t/35);return Cr(n+36*t/(t+38))},Fr=function(t){const e=[],r=t.length;let n=0,i=128,o=72,a=t.lastIndexOf("-");a<0&&(a=0);for(let r=0;r=128&&Lr("not-basic"),e.push(t.charCodeAt(r));for(let l=a>0?a+1:0;l=r&&Lr("invalid-input");const a=(s=t.charCodeAt(l++))>=48&&s<58?s-48+26:s>=65&&s<91?s-65:s>=97&&s<123?s-97:kr;a>=kr&&Lr("invalid-input"),a>Cr((wr-n)/e)&&Lr("overflow"),n+=a*e;const c=i<=o?1:i>=o+26?26:i-o;if(aCr(wr/u)&&Lr("overflow"),e*=u}const c=e.length+1;o=Ir(n-a,c,0==a),Cr(n/c)>wr-i&&Lr("overflow"),i+=Cr(n/c),n%=c,e.splice(n++,0,i)}var s;return String.fromCodePoint(...e)},Rr=function(t){const e=[],r=(t=Or(t)).length;let n=128,i=0,o=72;for(const r of t)r<128&&e.push(Er(r));const a=e.length;let s=a;for(a&&e.push("-");s=n&&eCr((wr-i)/l)&&Lr("overflow"),i+=(r-n)*l,n=r;for(const r of t)if(rwr&&Lr("overflow"),r===n){let t=i;for(let r=kr;;r+=kr){const n=r<=o?1:r>=o+26?26:r-o;if(t=0))try{e.hostname=Pr(e.hostname)}catch(t){}return H(W(e))}function Wr(t){const e=it(t,!0);if(e.hostname&&(!e.protocol||Vr.indexOf(e.protocol)>=0))try{e.hostname=jr(e.hostname)}catch(t){}return U(W(e),U.defaultChars+"%")}function qr(t,e){if(!(this instanceof qr))return new qr(t,e);e||Ot(t)||(e=t||{},t="default"),this.inline=new cr,this.block=new We,this.core=new ze,this.renderer=new le,this.linkify=new _r,this.validateLink=Gr,this.normalizeLink=Hr,this.normalizeLinkText=Wr,this.utils=r,this.helpers=Ft({},n),this.options={},this.configure(t),e&&this.set(e)}qr.prototype.set=function(t){return Ft(this.options,t),this},qr.prototype.configure=function(t){const e=this;if(Ot(t)){const e=t;if(!(t=Nr[e]))throw new Error('Wrong `markdown-it` preset "'+e+'", check name')}if(!t)throw new Error("Wrong `markdown-it` preset, can't be empty");return t.options&&e.set(t.options),t.components&&Object.keys(t.components).forEach((function(r){t.components[r].rules&&e[r].ruler.enableOnly(t.components[r].rules),t.components[r].rules2&&e[r].ruler2.enableOnly(t.components[r].rules2)})),this},qr.prototype.enable=function(t,e){let r=[];Array.isArray(t)||(t=[t]),["core","block","inline"].forEach((function(e){r=r.concat(this[e].ruler.enable(t,!0))}),this),r=r.concat(this.inline.ruler2.enable(t,!0));const n=t.filter((function(t){return r.indexOf(t)<0}));if(n.length&&!e)throw new Error("MarkdownIt. Failed to enable unknown rule(s): "+n);return this},qr.prototype.disable=function(t,e){let r=[];Array.isArray(t)||(t=[t]),["core","block","inline"].forEach((function(e){r=r.concat(this[e].ruler.disable(t,!0))}),this),r=r.concat(this.inline.ruler2.disable(t,!0));const n=t.filter((function(t){return r.indexOf(t)<0}));if(n.length&&!e)throw new Error("MarkdownIt. Failed to disable unknown rule(s): "+n);return this},qr.prototype.use=function(t){const e=[this].concat(Array.prototype.slice.call(arguments,1));return t.apply(t,e),this},qr.prototype.parse=function(t,e){if("string"!=typeof t)throw new Error("Input data should be a String");const r=new this.core.State(t,this,e);return this.core.process(r),r.tokens},qr.prototype.render=function(t,e){return e=e||{},this.renderer.render(this.parse(t,e),this.options,e)},qr.prototype.parseInline=function(t,e){const r=new this.core.State(t,this,e);return r.inlineMode=!0,this.core.process(r),r.tokens},qr.prototype.renderInline=function(t,e){return e=e||{},this.renderer.render(this.parseInline(t,e),this.options,e)};const Yr=qr;class Zr{constructor(t,e){e.name=e.name.replace(//g,">");const r=(0,s.V6)(t),n=document.createElement("div");n.style.setProperty("height","100%"),r.appendChild(n),this._shadow=n.attachShadow({mode:"open"}),this._shadow.adoptedStyleSheets=[v.A,b.A],this._name=document.createElement("div"),this._shadow.appendChild(this._name),this._name.innerHTML=`
\n ${e.name} \n
${g}
\n
`;const i=document.createElement("template");i.innerHTML=function(t){const e=Yr({html:!1,linkify:!0,typographer:!0});let r="No description for this dataset.";void 0!==t.description&&(r=t.description);let n="No authors for this dataset.";if(void 0!==t.authors){n='
    ';for(const r of t.authors)n+=`
  • ${e.render(r).slice(3,-5)}
  • `;n+="
"}let i="No references for this dataset.";if(void 0!==t.references){i="
    ";for(const r of t.references)i+=`
  • ${e.render(r)}
  • `;i+="
"}return``}(e);const o=i.content.firstChild;this._modal=new T.A(o),this._modal.shadow.adoptedStyleSheets=[v.A,b.A],this._name.onclick=()=>this._modal.open(),o.addEventListener("keydown",(t=>{t.stopPropagation()}))}remove(){this._modal.remove(),this._shadow.host.remove()}}var Xr=__webpack_require__(14761);function $r(t){if("object"!=typeof t||null===t)throw Error("the dataset must be a JavaScript object");if(!("meta"in t))throw Error('missing "meta" key in the dataset');if("object"!=typeof t.meta||null===t.meta)throw Error('"meta" must be an object in the dataset');if(function(t){if(o()(null!==t,"o !== null"),!("name"in t))throw Error('missing "meta.name" key in the dataset');if("string"!=typeof t.name)throw Error('"meta.name" must be a string in the dataset');if("description"in t&&"string"!=typeof t.description)throw Error('"meta.description" should be a string in the dataset');if("authors"in t){if(!Array.isArray(t.authors))throw Error('"meta.authors" must be an array in the dataset');for(const e of t.authors)if("string"!=typeof e)throw Error('"meta.authors" must be an array of strings in the dataset')}if("references"in t){if(!Array.isArray(t.references))throw Error('"meta.references" must be an array in the dataset');for(const e of t.references)if("string"!=typeof e)throw Error('"meta.references" must be an array of strings in the dataset')}}(t.meta),!("structures"in t))throw Error('missing "structures" key in the dataset');if(!Array.isArray(t.structures))throw Error('"structures" must be an array in the dataset');const[e,r]=function(t){let e=0;for(let r=0;r=e.length)throw Error(`out of bounds 'structure' for environment ${r}: index is ${n.structure}, we have ${e.length} structures`);if(!("center"in n)||"number"!=typeof n.center)throw Error(`missing 'center' for environment ${r}`);const i=e[n.structure].size;if(!tn(n.center)||n.center>=i)throw Error(`out of bounds 'center' for environment ${r}: index is ${n.center}, we have ${i} atoms in structure ${n.structure}`);if(!("cutoff"in n)||"number"!=typeof n.cutoff)throw Error(`missing 'cutoff' for environment ${r}`)}}(t.environments,t.structures)}if("shapes"in t){const r=function(t,e,r){if("object"!=typeof t||null===t)return"'shapes' must be an object";for(const[n,i]of Object.entries(t)){const t=i;if(!("kind"in t))return`missing "kind" in shape ${n}`;if("string"!=typeof t.kind)return`shapes 'kind' must be a string for shape ${n}`;if(!("parameters"in t))return`missing "parameters" in shape ${n}`;const o=t.parameters;if("structure"in o){const t=o.structure;if(!Array.isArray(t))return`'structure' parameters should be an array in shape ${n}`;if(t.length!==e)return`'structure' parameters in shape ${n} contain ${t.length} entries, but there are ${e} structures.`}if("atom"in o){const t=o.atom;if(!Array.isArray(t))return`'atom' parameters should be an array in shape ${n}`;if(t.length!==r)return`'atom' parameters in shape ${n} contain ${t.length} entries, but there are ${r} environments.`}}return""}(t.shapes,e,n);if(""!==r)throw Error("Error checking shape definitions: "+r);const i=function(t,e){let r=0;for(let n=0;n0&&a.values.length!==s)throw Error(`wrong size for 'properties['${i}'].values': expected ${s}, got ${a.values.length}`);const l=typeof a.values[0];if("string"!==l&&"number"!==l&&!en(a.values))throw Error(`'properties['${i}'].values' should contain string or number or an array of numbers`);for(const t of a.values)if(typeof t!==l)throw Error(`'properties['${i}'].values' should be of a single type`);if(en(a.values)){if(!n)throw Error(`'parameters' should be provided for multidimensional properties '${i}'`);const t=a.parameters;if(!nn(t))throw Error(`'properties['${i}'].parameters' should be an array of strings`);if(1!==t.length)throw Error(`'properties['${i}'].parameters' should contain a single parameter`);for(const e of t)if(!(e in n))throw Error(`parameter '${e}' of 'properties['${i}']' does not appear in the list provided parameters`);const e=a.values[0];for(const r of t){const t=n[r].values;if(e.length!==t.length)throw Error(`'properties['${i}'].values' and 'parameters['${r}'].values' should have the same length`)}if(!rn(a.values))throw Error(`'properties['${i}].values' should contain arrays of the same length`)}if("description"in a&&"string"!=typeof a.description)throw Error(`'properties['${i}'].description' should contain a string`);if("units"in a&&"string"!=typeof a.units)throw Error(`'properties['${i}'].units' should contain a string`)}}(t.properties,e,n,t.parameters)}function Jr(t){var e;const r=null===(e=t.settings)||void 0===e?void 0:e.target;if(void 0!==r){if("atom"===r&&void 0===t.environments)throw new Error('To use "atom" target, a list of environments should be provided');return r}const n=Object.values(t.properties).filter((t=>"atom"===t.target));return void 0!==t.environments&&n.length>0?"atom":"structure"}function Kr(t,e){return"sphere"===t?Xr.iy.validateParameters(e):"ellipsoid"===t?Xr.C1.validateParameters(e):"arrow"===t?Xr.i3.validateParameters(e):"cylinder"===t?Xr.T.validateParameters(e):"custom"===t?Xr.Nh.validateParameters(e):""}function Qr(t){if("object"!=typeof t||null===t)throw Error("the structure must be a JavaScript object");if(!("size"in t)||"number"!=typeof t.size||!tn(t.size))return'missing "size"';for(const e of["names","x","y","z"]){if(!(e in t))return`missing "${e}"`;const r=t[e];if(!Array.isArray(r))return`"${e}" must be an array`;if(t.size>0&&r.length!==t.size)return`wrong size for "${e}", expected ${t.size}, got ${r.length}`}return!("cell"in t)||Array.isArray(t.cell)&&9===t.cell.length?"":'"cell" must be an array of size 9'}function tn(t){return Number.isInteger(t)&&t>=0}function en(t){let e=!0;for(const r of t)e=Array.isArray(r)&&e;return e}function rn(t){const e=t[0];let r=!0;for(const n of t)r=n.length===e.length&&r;return r}function nn(t){if(Array.isArray(t)){let e=!0;for(const r of t)e="string"==typeof r&&e;return e}return!1}var on=__webpack_require__(79352),an=function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function a(t){try{l(n.next(t))}catch(t){o(t)}}function s(t){try{l(n.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}l((n=n.apply(t,e||[])).next())}))};class sn{constructor(t,e,r,n,i,o,a=9){if(this._target=n,this._structures=r,void 0===i)this._properties={};else{const t=y(i,(t=>Object.values(t.values).every((t=>"number"==typeof t)))),e=y(t,(t=>"atom"===t.target));this._properties=Object.fromEntries(Object.entries(e).map((([t,e])=>[t,e.values])))}if(this._resolvedStructures=new Array(r.length),this._indexer=e,this._calculatedEnvironments=function(t,e){if(void 0===e)return;const r=Array.from({length:t.length}).map(((e,r)=>Array.from({length:t[r].size})));for(let t=0;t{if(""!==Qr(e))throw Error(`got custom data for this structure, but no custom loadStructure callback\nthe object was ${JSON.stringify(e)}`);return e},this._cellsData=new Map,this.onselect=()=>{},this.onremove=()=>{},this.oncreate=()=>{},this.activeChanged=()=>{},this.delayChanged=()=>{},this._onSettingChangeCallbacks=[],a>9)throw Error("chemiscope only supports up to 9 structure viewers in the grid");this._maxViewers=a;const l=(0,s.V6)(t),c=document.createElement("div");c.style.setProperty("height","100%"),l.appendChild(c),this._shadow=c.attachShadow({mode:"open"}),this._shadow.adoptedStyleSheets=[v.A,b.A],this._root=document.createElement("div"),this._root.id="grid-root",this._root.className="chsp-structure-viewer-grid",this._shadow.appendChild(this._root),this._setupGrid(1),this._active=(0,s.o)(this._cellsData),this.setActive(this._active)}_getById(t){return(0,s.VT)(t,this._shadow)}get active(){return this._active}pinned(){const t=[];for(const e of this._cellsData.values())t.push(e.current);return t}show(t){this._showInViewer(this.active,t).catch((t=>{throw t}))}addViewer(){const t=this._setupGrid(this._cellsData.size+1);if(0===t.length)return{guid:void 0,color:""};o()(1===t.length,"newGUIDs.length === 1");const e=t[0],r=this._cellsData.get(e);o()(void 0!==r,"newData !== undefined");for(const t of this._onSettingChangeCallbacks)r.viewer.onSettingChange(((r,n)=>{let i=0;for(const t of this._cellsData.keys()){if(e===t)break;i+=1}r.unshift(i.toString()),t(r,n)}));return{guid:e,color:r.color}}removeViewer(t){o()(this._cellsData.size>1,"this._cellsData.size > 1"),this._active===t&&this.setActive((0,s.o)(this._cellsData,t));const e=this._cellsData.get(t);o()(void 0!==e,"data !== undefined"),e.viewer.remove(),this._getById(`gi-${t}`).remove(),this._cellsData.delete(t)}remove(){for(const t of this._cellsData.values())t.viewer.remove();this._shadow.host.remove()}setActive(t){const e=(t,e)=>{const r=this._getById(`chsp-activate-${t}`);r.classList.toggle("chsp-active-pin",e),o()(null!==r.parentElement,"button.parentElement !== null");const n=r.parentElement.querySelector(".chsp-tooltip");o()(null!==n,"tooltip !== null"),n.innerHTML=e?"Active viewer":"Choose as active",this._getById(`gi-${t}`).classList.toggle("chsp-structure-viewer-cell-active",e)},r=this._cellsData.get(this._active);o()(void 0!==r,"current !== undefined"),e(this._active,!1),this._active=t;const n=this._cellsData.get(this._active);o()(void 0!==n,"newData !== undefined"),n.viewer._options.playbackDelay.onchange.push((t=>{this.delayChanged(t)})),this.delayChanged(n.viewer._options.playbackDelay.value),e(this._active,!0)}set positionSettingsModal(t){this._positionSettingsModal=t;for(const e of this._cellsData.values())e.viewer.positionSettingsModal=t}applySettings(t){if(0!==t.length){o()(t.length===this._cellsData.size,"settings.length === this._cellsData.size");for(const[e,r]of(0,s.HL)(this._cellsData.values()))r.viewer.applySettings(t[e])}}saveSettings(){const t=[];for(const e of this._cellsData.values())t.push(e.viewer.saveSettings());return t}onSettingChange(t){for(const e of this._cellsData.keys()){const r=this._cellsData.get(e);o()(void 0!==r,"data !== undefined"),r.viewer.onSettingChange(((r,n)=>{(r=JSON.parse(JSON.stringify(r))).unshift(this._getCurrentPositionInGrid(e).toString()),t(r,n)}))}this._onSettingChangeCallbacks.push(t)}switchTarget(t){return an(this,void 0,void 0,(function*(){this._target=t,this._updateEnvironments("atom"===this._target);const e=Array.from(this._cellsData.entries()).map((([t,e])=>this._refreshCell(t,e,"atom"===this._target)));yield Promise.all(e)}))}_updateEnvironments(t){if(this._environments=t?this._calculatedEnvironments:void 0,t){o()(void 0!==this._environments,"this._environments !== undefined");for(const t of this._cellsData.values())t.viewer.environments=this._environments[t.current.structure]}}_refreshCell(t,e,r){return an(this,void 0,void 0,(function*(){e.current.atom=r?this._indexer.fromEnvironment(e.current.environment,this._target).atom:void 0,this._cellsData.set(t,e);const n=this._properties?Object.keys(this._properties):[];e.viewer.refreshOptions(r,n),yield this._loadViewer(e.viewer,e.current.structure,e.current.atom)}))}_duplicate(t){return an(this,void 0,void 0,(function*(){const e=this._cellsData.get(t);o()(void 0!==e,"data !== undefined");const r=this.addViewer().guid;if(void 0===r)return;const n=this._cellsData.get(r);return o()(void 0!==n,"newData !== undefined"),yield this._showInViewer(r,e.current),n.viewer.applySettings(e.viewer.saveSettings()),this.setActive(r),n}))}_structure(t){if(void 0===this._resolvedStructures[t]){const e=this.loadStructure(t,this._structures[t]),r=Qr(e);if(""!==r)throw Error(`got invalid object as structure: ${r}\n the object was ${JSON.stringify(e)}`);this._resolvedStructures[t]=e}return this._resolvedStructures[t]}_propertiesForStructure(t){const e={};if(void 0!==this._environments){const r=this._environments[t];for(const t in this._properties){const n=this._properties[t];e[t]=[];for(const i of r)void 0!==i?e[t].push(n[i.index]):e[t].push(void 0)}return e}}_showInViewer(t,e){return an(this,void 0,void 0,(function*(){const r=this._cellsData.get(t);o()(void 0!==r,"data !== undefined");const n=r.viewer;r.current.structure!==e.structure&&(yield this._loadViewer(n,e.structure,e.atom),r.current=e),n.highlight("atom"===this._target?e.atom:void 0),r.current=e}))}_loadViewer(t,e,r){return new Promise((n=>{const i={trajectory:!0};void 0!==this._environments&&(i.environments=this._environments[e],"atom"===this._target&&(i.highlight=r)),t.load(this._structure(e),this._propertiesForStructure(e),i,(()=>{n()}))}))}_getNextColor(){const t=[];for(const e of this._cellsData.values())t.push(e.color);return(0,s.Lz)(t)}_setupCell(t,e,r){const n=`gi-${t}`;let i=this._root.querySelector(`#${n}`),a="";if(null===i){i=document.createElement("div"),i.id=n,i.classList.add("chsp-structure-viewer-cell","grid-item"),i.style.gridColumn=`${e}`,i.style.gridRow=`${r}`,a=this._getNextColor();const l=document.createElement("template");l.innerHTML=`\n
\n WILL BE FILLED LATER\n `;const c=l.content.firstChild;c.onclick=()=>{this.setActive(t);const e=this._cellsData.get(this._active);o()(void 0!==e,"data !== undefined"),this.activeChanged(t,e.current)},i.appendChild(c),l.innerHTML='\n \n\n Remove viewer\n ';const u=l.content.firstChild;u.onclick=()=>{1!==this._cellsData.size?(this.onremove(t),this.removeViewer(t),this._setupGrid(this._cellsData.size)):(0,s.R4)("can not remove the last viewer from the grid")},i.appendChild(u),l.innerHTML='\n \n\n Duplicate viewer\n ';const h=l.content.firstChild;h.onclick=()=>an(this,void 0,void 0,(function*(){const e=yield this._duplicate(t);void 0!==e&&this.oncreate(this.active,e.color,e.current)})),i.appendChild(h),l.innerHTML=`\n ${I}\n Download PNG\n `;const d=l.content.firstChild;return d.onclick=()=>{const e=this._cellsData.get(t);o()(void 0!==e,"data !== undefined");const r=e.viewer,n=e.current.structure;if(void 0!==e.current.atom){const t=e.current.atom;ln(r.exportPNG(),`chemiscope-structure-${n+1}-atom-${t+1}.png`)}else ln(r.exportPNG(),`chemiscope-structure-${n+1}.png`)},i.appendChild(d),this._root.appendChild(i),a}return i.style.gridColumn=`${e}`,i.style.gridRow=`${r}`,""}_setupGrid(t){const e=[];if(t<1)return(0,s.R4)("Cannot delete last molecular viewer."),e;if(t>this._maxViewers)return(0,s.R4)(`Viewer grid cannot contain more than ${this._maxViewers} viewers.`),e;const r=this.bestGridArrangement(t);if(this._cellsData.size>t){(0,s.R4)(`Eliminating last ${this._cellsData.size-t} viewers.`);let e=0;for(const r of this._cellsData.keys())e>=t&&this.removeViewer(r),e+=1}let n=1,i=1;const a=this._cellsData.keys();for(let l=0;l=this._cellsData.size?(0,s.Nl)():a.next().value;let c=this._setupCell(t,i,n);if(""===c&&(c=this._getNextColor()),i++,i>r.columns&&(n++,i=1),!this._cellsData.has(t)){const r=this._properties?Object.keys(this._properties):[],n=new on.MoleculeViewer(this._getById(`gi-${t}`),r);n.onselect=e=>{if("atom"!==this._target||this._active!==t)return;const r=this._cellsData.get(this._active);o()(void 0!==r,"data !== undefined");const i=n.natoms();o()(void 0!==i,"natoms !== undefined");const a=this._indexer.fromStructureAtom(this._target,r.current.structure,e%i);void 0!==a&&(n.highlight(e),this.onselect(a))};const i={atom:void 0,structure:-1,environment:-1};this._cellsData.set(t,{color:c,current:i,viewer:n}),void 0!==this._positionSettingsModal&&(n.positionSettingsModal=this._positionSettingsModal),e.push(t)}}for(const t of this._cellsData.values())t.viewer.resize();return e}bestGridArrangement(t){switch(t){case 1:case 2:return{rows:t,columns:1};case 3:case 4:return{rows:2,columns:2};case 5:case 6:return{rows:3,columns:2};case 8:case 7:case 9:return{rows:3,columns:3};default:throw Error("reached unreachable code: too many viewer in the grid")}}_getCurrentPositionInGrid(t){let e=0;for(const r of this._cellsData.keys()){if(t===r)break;e+=1}return e}}function ln(t,e){const r=document.createElement("a");r.download=e,r.href=t,document.body.appendChild(r),r.click(),document.body.removeChild(r),r.remove()}var cn=__webpack_require__(59838);class un{constructor(t,e){this._containerElement=(0,s.V6)(t);const r=document.createElement("div");this._containerElement.appendChild(r),this._shadow=r.attachShadow({mode:"open"}),this._shadow.adoptedStyleSheets=[v.A,b.A],this._toggleContainer=this._createToggleElement("atom"===e),this._shadow.appendChild(this._toggleContainer),this._containerElement.style.setProperty("height",`calc(100% - ${this._toggleContainer.offsetHeight}px)`),this.onchange=()=>{}}_createToggleElement(t){const e=document.createElement("div");return e.innerHTML=`\n
\n \x3c!-- Spinner --\x3e\n \n\n \x3c!-- Buttons --\x3e\n
\n \n \n
\n
\n `,e.querySelector("#structure-btn").onclick=()=>this._select("structure"),e.querySelector("#atom-btn").onclick=()=>this._select("atom"),e.firstElementChild}_select(t){const e="atom"===t;this._toggleContainer.querySelector("#structure-btn").classList.toggle("active",!e),this._toggleContainer.querySelector("#atom-btn").classList.toggle("active",e),this.onchange(t)}loader(t){this._toggleContainer.querySelector("#chsp-target-spinner").style.display=t?"inline-block":"none",this._toggleContainer.querySelectorAll(".btn-outline-secondary").forEach((e=>{t?e.setAttribute("disabled","true"):e.removeAttribute("disabled")}))}remove(){this._shadow.host.remove(),this._containerElement.style.setProperty("height","100%")}}var hn=__webpack_require__(85072),dn=__webpack_require__.n(hn),fn=__webpack_require__(97825),pn=__webpack_require__.n(fn),mn=__webpack_require__(77659),gn=__webpack_require__.n(mn),vn=__webpack_require__(55056),bn=__webpack_require__.n(vn),yn=__webpack_require__(10540),xn=__webpack_require__.n(yn),_n=__webpack_require__(41113),wn=__webpack_require__.n(_n),kn=__webpack_require__(5018),An={};An.styleTagTransform=wn(),An.setAttributes=bn(),An.insert=gn().bind(null,"head"),An.domAPI=pn(),An.insertStyleElement=xn(),dn()(kn.A,An),kn.A&&kn.A.locals&&kn.A.locals;function Mn(t,e){if("object"!=typeof t||null===t)throw Error("the configuration must be a JavaScript object");for(const r of e)if(!(r in t)||!("string"==typeof t[r]||t[r]instanceof HTMLElement))throw Error(`missing "${r}" key in chemiscope configuration`);if("settings"in t){if("object"!=typeof t.settings||null===t.settings)throw Error('"settings" must be an object in chemiscope configuration');Tn(t.settings)}if("loadStructure"in t&&void 0!==t.loadStructure&&!((r=t.loadStructure)&&r.constructor&&r.call&&r.apply))throw Error('"loadStructure" should be a function in chemiscope config');var r;if("maxStructureViewers"in t&&"number"!=typeof t.maxStructureViewers)throw Error('"maxStructureViewers" should be a number in chemiscope config')}function Tn(t){const e=(t,e)=>{if("object"!=typeof e||null===e)throw Error(`"settings.${t}" must be an object`)},r=(t,e)=>{if(!(Array.isArray(e)&&e.length>0))throw Error(`"settings.${t}" must be an array containing at least one element`)};for(const n in t)if("map"===n)e(n,t.map);else if("structure"===n){r(n,t.structure);for(const r of t.structure)e("structure entry",r)}else if("pinned"===n){r(n,t.pinned);for(const e of t.pinned)if(!(Number.isInteger(e)&&e>=0))throw Error('"settings.pinned" must be an array of number')}else{if("target"!==n)throw Error(`invalid key "${n}" in settings`);if(!["atom","structure"].includes(t.target))throw Error('"settings.target" should be either "atom" or "structure"')}}class Sn{static load(t,e){return new Promise((r=>{r(new Sn(t,e))}))}constructor(t,e){var r;this._target="structure",Mn(t,["meta","map","info","structure"]),$r(e),this._dataset=e,this._pinned=[],this._target=Jr(e),this._indexer=new a(e.structures,e.environments),this.meta=new Zr(t.meta,e.meta),this.structure=new sn(t.structure,this._indexer,e.structures,this._target,e.properties,e.environments,t.maxStructureViewers),void 0!==t.loadStructure&&(this.structure.loadStructure=t.loadStructure),this.structure.activeChanged=(t,e)=>{this.map.setActive(t),this.info.show(e)},this.structure.onselect=t=>{this.map.select(t),this.info.show(t)},this.structure.onremove=t=>{this.map.removeMarker(t);const e=this._pinned.indexOf(t);o()(e>-1,"index > -1"),this._pinned.splice(e,1)},this.structure.oncreate=(t,e,r)=>{this.map.addMarker(t,e,r),this.info.show(r),this._pinned.push(t)},this.map=new P(t.map,zn(e.settings),this._indexer,this._target,e.properties),this.map.onselect=t=>{this.info.show(t),this.structure.show(t)},this.map.activeChanged=(t,e)=>{this.info.show(e),this.structure.setActive(t)};const n="atom"===this._target?"structure":"atom",i=Object.values(e.properties).filter((t=>t.target===n));void 0!==e.environments&&i.length>1&&(this._toggle=new un(t.map,this._target),this._toggle.onchange=t=>this._switchTarget(t)),this.info=new x(t.info,e.properties,this._indexer,this._target,e.parameters),this.info.onchange=t=>{this.map.select(t),this.structure.show(t)},this.structure.delayChanged=t=>{this.info.playbackDelay=t};let l={environment:0,structure:0,atom:0};if(void 0!==e.environments&&(l=this._indexer.fromEnvironment(0,this._target)),e.settings&&e.settings.pinned){if(!Array.isArray(e.settings.pinned)||"number"!=typeof e.settings.pinned[0])throw Error("settings.pinned must be an array of numbers");l=this._indexer.fromEnvironment(e.settings.pinned[0],this._target)}const c=this.structure.active;this.map.addMarker(c,(0,s.Lz)([]),l),this._pinned.push(c),this.structure.show(l),this.info.show(l),void 0!==e.settings&&(delete e.settings.map,this.applySettings(e.settings)),void 0!==this._toggle&&(null===(r=e.settings)||void 0===r?void 0:r.target)&&this._switchTarget(this._target,!0)}_switchTarget(t,e=!1){(e||this._target!==t)&&(o()(void 0!==this._toggle,"this._toggle !== undefined"),this._toggle.loader(!0),this._target=t,setTimeout((()=>{return t=this,e=void 0,n=function*(){var t;try{this.info.switchTarget(this._target),yield this.map.switchTarget(this._target),yield this.structure.switchTarget(this._target)}finally{null===(t=this._toggle)||void 0===t||t.loader(!1)}},new((r=void 0)||(r=Promise))((function(i,o){function a(t){try{l(n.next(t))}catch(t){o(t)}}function s(t){try{l(n.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}l((n=n.apply(t,e||[])).next())}));var t,e,r,n}),0))}remove(){var t;this.map.remove(),this.meta.remove(),this.info.remove(),this.structure.remove(),null===(t=this._toggle)||void 0===t||t.remove()}saveSettings(){return{target:this._target,map:this.map.saveSettings(),pinned:this.structure.pinned().map((t=>"atom"===this._target?t.environment:t.structure)),structure:this.structure.saveSettings()}}applySettings(t){if(Tn(t),void 0!==t.map&&this.map.applySettings(t.map),void 0!==t.pinned){if(!Array.isArray(t.pinned))throw Error("settings.pinned must be an array");for(const t of this._pinned.slice(1))this.map.removeMarker(t),this.structure.removeViewer(t);if(this._pinned=[this._pinned[0]],o()(t.pinned.length>0,"settings.pinned.length > 0"),"number"!=typeof t.pinned[0])throw Error("settings.pinned must be an array of numbers");const e=this._indexer.fromEnvironment(t.pinned[0],this._target);this.map.select(e),this.info.show(e),this.structure.show(e);for(const e of t.pinned.slice(1)){if("number"!=typeof e)throw Error("settings.pinned must be an array of numbers");const{guid:t,color:r}=this.structure.addViewer();if(void 0===t)throw Error("too many environments in 'pinned' setting");const n=this._indexer.fromEnvironment(e,this._target);this.map.addMarker(t,r,n),this.map.setActive(t),this._pinned.push(t),this.info.show(n),this.structure.setActive(t),this.structure.show(n)}}void 0!==t.structure&&this.structure.applySettings(t.structure)}onSettingChange(t){this.map.onSettingChange(((e,r)=>{(e=JSON.parse(JSON.stringify(e))).unshift("map"),t(e,r)})),this.structure.onSettingChange(((e,r)=>{(e=JSON.parse(JSON.stringify(e))).unshift("structure"),t(e,r)}))}dataset(t=!1){const e=JSON.parse(JSON.stringify(this._dataset,((t,e)=>"number"==typeof e&&isNaN(e)?"***NaN***":e)),((t,e)=>"***NaN***"===e?NaN:e));if(t){e.structures=[];for(let t=0;t{r(new Cn(t,e))}))}constructor(t,e){Mn(t,["meta","info","structure"]),$r(e),this._target=Jr(e),this._indexer=new a(e.structures,e.environments),this.meta=new Zr(t.meta,e.meta),this.structure=new sn(t.structure,this._indexer,e.structures,this._target,e.properties,e.environments,1),void 0!==t.loadStructure&&(this.structure.loadStructure=t.loadStructure),this.structure.activeChanged=(t,e)=>{this.info.show(e)},this.structure.onselect=t=>{this.info.show(t)},this.structure.oncreate=(t,e,r)=>{this.info.show(r)},this.info=new x(t.info,e.properties,this._indexer,this._target),this.info.onchange=t=>{this.structure.show(t)},this.structure.delayChanged=t=>{this.info.playbackDelay=t};let r={environment:0,structure:0,atom:0};if(void 0!==e.environments&&(r=this._indexer.fromEnvironment(0,this._target)),e.settings&&e.settings.pinned){if(!Array.isArray(e.settings.pinned)||"number"!=typeof e.settings.pinned[0])throw Error("settings.pinned must be an array of numbers");r=this._indexer.fromEnvironment(e.settings.pinned[0],this._target)}this.structure.show(r),this.info.show(r),void 0!==e.settings&&this.applySettings(e.settings)}remove(){this.meta.remove(),this.info.remove(),this.structure.remove()}applySettings(t){Tn(t),void 0!==t.structure&&this.structure.applySettings(t.structure)}saveSettings(){return{target:this._target,pinned:this.structure.pinned().map((t=>t.environment)),structure:this.structure.saveSettings()}}onSettingChange(t){this.structure.onSettingChange(((e,r)=>{(e=JSON.parse(JSON.stringify(e))).unshift("structure"),t(e,r)}))}}class En{static load(t,e){return new Promise((r=>{r(new En(t,e))}))}constructor(t,e){let r;this._target="structure",Mn(t,["meta","map","info"]),$r(e);for(const t in e.properties){const n=e.properties[t];"atom"===n.target?(0,s.R4)("unsupported per-atom property in a map-only viewer"):(o()("structure"===n.target,"property.target === 'structure'"),r=n.values.length)}this._indexer=new a(new Array(r).fill({size:1,data:0})),this.meta=new Zr(t.meta,e.meta),this.map=new P(t.map,zn(e.settings),this._indexer,this._target,e.properties),this.map.onselect=t=>{this.info.show(t)},this.map.activeChanged=(t,e)=>{this.info.show(e)},this.info=new x(t.info,e.properties,this._indexer,this._target),this.info.onchange=t=>{this.map.select(t)};let n={environment:0,structure:0,atom:0};if(void 0!==e.environments&&(n=this._indexer.fromEnvironment(0,this._target)),e.settings&&e.settings.pinned){if(!Array.isArray(e.settings.pinned)||"number"!=typeof e.settings.pinned[0])throw Error("settings.pinned must be an array of numbers");n=this._indexer.fromEnvironment(e.settings.pinned[0],this._target)}this.map.addMarker("map-0","red",n),this.info.show(n)}remove(){this.meta.remove(),this.info.remove(),this.map.remove()}saveSettings(){return{target:this._target,map:this.map.saveSettings()}}applySettings(t){Tn(t),void 0!==t.map&&this.map.applySettings(zn(t))}onSettingChange(t){this.map.onSettingChange(((e,r)=>{(e=JSON.parse(JSON.stringify(e))).unshift("map"),t(e,r)}))}}function Ln(){return"v0.8.2"}function zn(t){if(void 0===t)return{};if("map"in t){const e=t.map;if("object"==typeof e){if(null===e)throw Error("invalid settings for map, should not be null");return e}throw Error(`invalid type '${typeof e}' for map, should be an object`)}return{}}})(),__webpack_exports__})())); \ No newline at end of file diff --git a/_static/cookbook-icon.png b/_static/cookbook-icon.png new file mode 100644 index 00000000..d1143962 Binary files /dev/null and b/_static/cookbook-icon.png differ diff --git a/_static/cookbook-icon.svg b/_static/cookbook-icon.svg new file mode 100644 index 00000000..6852f0fe --- /dev/null +++ b/_static/cookbook-icon.svg @@ -0,0 +1,283 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/_static/daily-recipe.js b/_static/daily-recipe.js new file mode 100644 index 00000000..844a5096 --- /dev/null +++ b/_static/daily-recipe.js @@ -0,0 +1,34 @@ +(function() { + // Calculate days since Unix epoch (January 1, 1970) + var millisecondsPerDay = 1000 * 60 * 60 * 24; + var today = new Date(); + var utcMidnight = Date.UTC(today.getFullYear(), today.getMonth(), today.getDate()); + var epoch = Date.UTC(1970, 0, 1); + var daysSinceEpoch = Math.floor((utcMidnight - epoch) / millisecondsPerDay); + + // Calculate index based on the day of the year + var index = daysSinceEpoch % examplesData.length; + + // Get the example + var example = examplesData[index]; + + // Build the HTML code + var html = ''; + html += '
'; + html += '
'; + html += '
'; + html += ' '; + html += '

' + example.title + '

'; + html += ' ' + example.html + ''; + html += '
'; + html += ' ' + example.html; + html += '
'; + html += '
'; + html += '
'; + + // Insert the HTML into the page + var container = document.getElementById('daily-thumbnail'); + if (container) { + container.innerHTML = html; + } +})(); diff --git a/_static/debug.css b/_static/debug.css new file mode 100644 index 00000000..74d4aec3 --- /dev/null +++ b/_static/debug.css @@ -0,0 +1,69 @@ +/* + This CSS file should be overridden by the theme authors. It's + meant for debugging and developing the skeleton that this theme provides. +*/ +body { + font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, + "Apple Color Emoji", "Segoe UI Emoji"; + background: lavender; +} +.sb-announcement { + background: rgb(131, 131, 131); +} +.sb-announcement__inner { + background: black; + color: white; +} +.sb-header { + background: lightskyblue; +} +.sb-header__inner { + background: royalblue; + color: white; +} +.sb-header-secondary { + background: lightcyan; +} +.sb-header-secondary__inner { + background: cornflowerblue; + color: white; +} +.sb-sidebar-primary { + background: lightgreen; +} +.sb-main { + background: blanchedalmond; +} +.sb-main__inner { + background: antiquewhite; +} +.sb-header-article { + background: lightsteelblue; +} +.sb-article-container { + background: snow; +} +.sb-article-main { + background: white; +} +.sb-footer-article { + background: lightpink; +} +.sb-sidebar-secondary { + background: lightgoldenrodyellow; +} +.sb-footer-content { + background: plum; +} +.sb-footer-content__inner { + background: palevioletred; +} +.sb-footer { + background: pink; +} +.sb-footer__inner { + background: salmon; +} +.sb-article { + background: white; +} diff --git a/_static/design-tabs.js b/_static/design-tabs.js new file mode 100644 index 00000000..b25bd6a4 --- /dev/null +++ b/_static/design-tabs.js @@ -0,0 +1,101 @@ +// @ts-check + +// Extra JS capability for selected tabs to be synced +// The selection is stored in local storage so that it persists across page loads. + +/** + * @type {Record} + */ +let sd_id_to_elements = {}; +const storageKeyPrefix = "sphinx-design-tab-id-"; + +/** + * Create a key for a tab element. + * @param {HTMLElement} el - The tab element. + * @returns {[string, string, string] | null} - The key. + * + */ +function create_key(el) { + let syncId = el.getAttribute("data-sync-id"); + let syncGroup = el.getAttribute("data-sync-group"); + if (!syncId || !syncGroup) return null; + return [syncGroup, syncId, syncGroup + "--" + syncId]; +} + +/** + * Initialize the tab selection. + * + */ +function ready() { + // Find all tabs with sync data + + /** @type {string[]} */ + let groups = []; + + document.querySelectorAll(".sd-tab-label").forEach((label) => { + if (label instanceof HTMLElement) { + let data = create_key(label); + if (data) { + let [group, id, key] = data; + + // add click event listener + // @ts-ignore + label.onclick = onSDLabelClick; + + // store map of key to elements + if (!sd_id_to_elements[key]) { + sd_id_to_elements[key] = []; + } + sd_id_to_elements[key].push(label); + + if (groups.indexOf(group) === -1) { + groups.push(group); + // Check if a specific tab has been selected via URL parameter + const tabParam = new URLSearchParams(window.location.search).get( + group + ); + if (tabParam) { + console.log( + "sphinx-design: Selecting tab id for group '" + + group + + "' from URL parameter: " + + tabParam + ); + window.sessionStorage.setItem(storageKeyPrefix + group, tabParam); + } + } + + // Check is a specific tab has been selected previously + let previousId = window.sessionStorage.getItem( + storageKeyPrefix + group + ); + if (previousId === id) { + // console.log( + // "sphinx-design: Selecting tab from session storage: " + id + // ); + // @ts-ignore + label.previousElementSibling.checked = true; + } + } + } + }); +} + +/** + * Activate other tabs with the same sync id. + * + * @this {HTMLElement} - The element that was clicked. + */ +function onSDLabelClick() { + let data = create_key(this); + if (!data) return; + let [group, id, key] = data; + for (const label of sd_id_to_elements[key]) { + if (label === this) continue; + // @ts-ignore + label.previousElementSibling.checked = true; + } + window.sessionStorage.setItem(storageKeyPrefix + group, id); +} + +document.addEventListener("DOMContentLoaded", ready, false); diff --git a/_static/doctools.js b/_static/doctools.js new file mode 100644 index 00000000..4d67807d --- /dev/null +++ b/_static/doctools.js @@ -0,0 +1,156 @@ +/* + * doctools.js + * ~~~~~~~~~~~ + * + * Base JavaScript utilities for all Sphinx HTML documentation. + * + * :copyright: Copyright 2007-2024 by the Sphinx team, see AUTHORS. + * :license: BSD, see LICENSE for details. + * + */ +"use strict"; + +const BLACKLISTED_KEY_CONTROL_ELEMENTS = new Set([ + "TEXTAREA", + "INPUT", + "SELECT", + "BUTTON", +]); + +const _ready = (callback) => { + if (document.readyState !== "loading") { + callback(); + } else { + document.addEventListener("DOMContentLoaded", callback); + } +}; + +/** + * Small JavaScript module for the documentation. + */ +const Documentation = { + init: () => { + Documentation.initDomainIndexTable(); + Documentation.initOnKeyListeners(); + }, + + /** + * i18n support + */ + TRANSLATIONS: {}, + PLURAL_EXPR: (n) => (n === 1 ? 0 : 1), + LOCALE: "unknown", + + // gettext and ngettext don't access this so that the functions + // can safely bound to a different name (_ = Documentation.gettext) + gettext: (string) => { + const translated = Documentation.TRANSLATIONS[string]; + switch (typeof translated) { + case "undefined": + return string; // no translation + case "string": + return translated; // translation exists + default: + return translated[0]; // (singular, plural) translation tuple exists + } + }, + + ngettext: (singular, plural, n) => { + const translated = Documentation.TRANSLATIONS[singular]; + if (typeof translated !== "undefined") + return translated[Documentation.PLURAL_EXPR(n)]; + return n === 1 ? singular : plural; + }, + + addTranslations: (catalog) => { + Object.assign(Documentation.TRANSLATIONS, catalog.messages); + Documentation.PLURAL_EXPR = new Function( + "n", + `return (${catalog.plural_expr})` + ); + Documentation.LOCALE = catalog.locale; + }, + + /** + * helper function to focus on search bar + */ + focusSearchBar: () => { + document.querySelectorAll("input[name=q]")[0]?.focus(); + }, + + /** + * Initialise the domain index toggle buttons + */ + initDomainIndexTable: () => { + const toggler = (el) => { + const idNumber = el.id.substr(7); + const toggledRows = document.querySelectorAll(`tr.cg-${idNumber}`); + if (el.src.substr(-9) === "minus.png") { + el.src = `${el.src.substr(0, el.src.length - 9)}plus.png`; + toggledRows.forEach((el) => (el.style.display = "none")); + } else { + el.src = `${el.src.substr(0, el.src.length - 8)}minus.png`; + toggledRows.forEach((el) => (el.style.display = "")); + } + }; + + const togglerElements = document.querySelectorAll("img.toggler"); + togglerElements.forEach((el) => + el.addEventListener("click", (event) => toggler(event.currentTarget)) + ); + togglerElements.forEach((el) => (el.style.display = "")); + if (DOCUMENTATION_OPTIONS.COLLAPSE_INDEX) togglerElements.forEach(toggler); + }, + + initOnKeyListeners: () => { + // only install a listener if it is really needed + if ( + !DOCUMENTATION_OPTIONS.NAVIGATION_WITH_KEYS && + !DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS + ) + return; + + document.addEventListener("keydown", (event) => { + // bail for input elements + if (BLACKLISTED_KEY_CONTROL_ELEMENTS.has(document.activeElement.tagName)) return; + // bail with special keys + if (event.altKey || event.ctrlKey || event.metaKey) return; + + if (!event.shiftKey) { + switch (event.key) { + case "ArrowLeft": + if (!DOCUMENTATION_OPTIONS.NAVIGATION_WITH_KEYS) break; + + const prevLink = document.querySelector('link[rel="prev"]'); + if (prevLink && prevLink.href) { + window.location.href = prevLink.href; + event.preventDefault(); + } + break; + case "ArrowRight": + if (!DOCUMENTATION_OPTIONS.NAVIGATION_WITH_KEYS) break; + + const nextLink = document.querySelector('link[rel="next"]'); + if (nextLink && nextLink.href) { + window.location.href = nextLink.href; + event.preventDefault(); + } + break; + } + } + + // some keyboard layouts may need Shift to get / + switch (event.key) { + case "/": + if (!DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS) break; + Documentation.focusSearchBar(); + event.preventDefault(); + } + }); + }, +}; + +// quick alias for translations +const _ = Documentation.gettext; + +_ready(Documentation.init); diff --git a/_static/documentation_options.js b/_static/documentation_options.js new file mode 100644 index 00000000..7e4c114f --- /dev/null +++ b/_static/documentation_options.js @@ -0,0 +1,13 @@ +const DOCUMENTATION_OPTIONS = { + VERSION: '', + LANGUAGE: 'en', + COLLAPSE_INDEX: false, + BUILDER: 'html', + FILE_SUFFIX: '.html', + LINK_SUFFIX: '.html', + HAS_SOURCE: true, + SOURCELINK_SUFFIX: '.txt', + NAVIGATION_WITH_KEYS: false, + SHOW_SEARCH_SUMMARY: true, + ENABLE_SEARCH_SHORTCUTS: true, +}; \ No newline at end of file diff --git a/_static/file.png b/_static/file.png new file mode 100644 index 00000000..a858a410 Binary files /dev/null and b/_static/file.png differ diff --git a/_static/jupyterlite_badge_logo.svg b/_static/jupyterlite_badge_logo.svg new file mode 100644 index 00000000..5de36d7f --- /dev/null +++ b/_static/jupyterlite_badge_logo.svg @@ -0,0 +1,3 @@ + + +launchlaunchlitelite \ No newline at end of file diff --git a/_static/language_data.js b/_static/language_data.js new file mode 100644 index 00000000..367b8ed8 --- /dev/null +++ b/_static/language_data.js @@ -0,0 +1,199 @@ +/* + * language_data.js + * ~~~~~~~~~~~~~~~~ + * + * This script contains the language-specific data used by searchtools.js, + * namely the list of stopwords, stemmer, scorer and splitter. + * + * :copyright: Copyright 2007-2024 by the Sphinx team, see AUTHORS. + * :license: BSD, see LICENSE for details. + * + */ + +var stopwords = ["a", "and", "are", "as", "at", "be", "but", "by", "for", "if", "in", "into", "is", "it", "near", "no", "not", "of", "on", "or", "such", "that", "the", "their", "then", "there", "these", "they", "this", "to", "was", "will", "with"]; + + +/* Non-minified version is copied as a separate JS file, if available */ + +/** + * Porter Stemmer + */ +var Stemmer = function() { + + var step2list = { + ational: 'ate', + tional: 'tion', + enci: 'ence', + anci: 'ance', + izer: 'ize', + bli: 'ble', + alli: 'al', + entli: 'ent', + eli: 'e', + ousli: 'ous', + ization: 'ize', + ation: 'ate', + ator: 'ate', + alism: 'al', + iveness: 'ive', + fulness: 'ful', + ousness: 'ous', + aliti: 'al', + iviti: 'ive', + biliti: 'ble', + logi: 'log' + }; + + var step3list = { + icate: 'ic', + ative: '', + alize: 'al', + iciti: 'ic', + ical: 'ic', + ful: '', + ness: '' + }; + + var c = "[^aeiou]"; // consonant + var v = "[aeiouy]"; // vowel + var C = c + "[^aeiouy]*"; // consonant sequence + var V = v + "[aeiou]*"; // vowel sequence + + var mgr0 = "^(" + C + ")?" + V + C; // [C]VC... is m>0 + var meq1 = "^(" + C + ")?" + V + C + "(" + V + ")?$"; // [C]VC[V] is m=1 + var mgr1 = "^(" + C + ")?" + V + C + V + C; // [C]VCVC... is m>1 + var s_v = "^(" + C + ")?" + v; // vowel in stem + + this.stemWord = function (w) { + var stem; + var suffix; + var firstch; + var origword = w; + + if (w.length < 3) + return w; + + var re; + var re2; + var re3; + var re4; + + firstch = w.substr(0,1); + if (firstch == "y") + w = firstch.toUpperCase() + w.substr(1); + + // Step 1a + re = /^(.+?)(ss|i)es$/; + re2 = /^(.+?)([^s])s$/; + + if (re.test(w)) + w = w.replace(re,"$1$2"); + else if (re2.test(w)) + w = w.replace(re2,"$1$2"); + + // Step 1b + re = /^(.+?)eed$/; + re2 = /^(.+?)(ed|ing)$/; + if (re.test(w)) { + var fp = re.exec(w); + re = new RegExp(mgr0); + if (re.test(fp[1])) { + re = /.$/; + w = w.replace(re,""); + } + } + else if (re2.test(w)) { + var fp = re2.exec(w); + stem = fp[1]; + re2 = new RegExp(s_v); + if (re2.test(stem)) { + w = stem; + re2 = /(at|bl|iz)$/; + re3 = new RegExp("([^aeiouylsz])\\1$"); + re4 = new RegExp("^" + C + v + "[^aeiouwxy]$"); + if (re2.test(w)) + w = w + "e"; + else if (re3.test(w)) { + re = /.$/; + w = w.replace(re,""); + } + else if (re4.test(w)) + w = w + "e"; + } + } + + // Step 1c + re = /^(.+?)y$/; + if (re.test(w)) { + var fp = re.exec(w); + stem = fp[1]; + re = new RegExp(s_v); + if (re.test(stem)) + w = stem + "i"; + } + + // Step 2 + re = /^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/; + if (re.test(w)) { + var fp = re.exec(w); + stem = fp[1]; + suffix = fp[2]; + re = new RegExp(mgr0); + if (re.test(stem)) + w = stem + step2list[suffix]; + } + + // Step 3 + re = /^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/; + if (re.test(w)) { + var fp = re.exec(w); + stem = fp[1]; + suffix = fp[2]; + re = new RegExp(mgr0); + if (re.test(stem)) + w = stem + step3list[suffix]; + } + + // Step 4 + re = /^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/; + re2 = /^(.+?)(s|t)(ion)$/; + if (re.test(w)) { + var fp = re.exec(w); + stem = fp[1]; + re = new RegExp(mgr1); + if (re.test(stem)) + w = stem; + } + else if (re2.test(w)) { + var fp = re2.exec(w); + stem = fp[1] + fp[2]; + re2 = new RegExp(mgr1); + if (re2.test(stem)) + w = stem; + } + + // Step 5 + re = /^(.+?)e$/; + if (re.test(w)) { + var fp = re.exec(w); + stem = fp[1]; + re = new RegExp(mgr1); + re2 = new RegExp(meq1); + re3 = new RegExp("^" + C + v + "[^aeiouwxy]$"); + if (re.test(stem) || (re2.test(stem) && !(re3.test(stem)))) + w = stem; + } + re = /ll$/; + re2 = new RegExp(mgr1); + if (re.test(w) && re2.test(w)) { + re = /.$/; + w = w.replace(re,""); + } + + // and turn initial Y back to y + if (firstch == "y") + w = firstch.toLowerCase() + w.substr(1); + return w; + } +} + diff --git a/_static/minus.png b/_static/minus.png new file mode 100644 index 00000000..d96755fd Binary files /dev/null and b/_static/minus.png differ diff --git a/_static/no_image.png b/_static/no_image.png new file mode 100644 index 00000000..8c2d48d5 Binary files /dev/null and b/_static/no_image.png differ diff --git a/_static/plus.png b/_static/plus.png new file mode 100644 index 00000000..7107cec9 Binary files /dev/null and b/_static/plus.png differ diff --git a/_static/pygments.css b/_static/pygments.css new file mode 100644 index 00000000..02b4b128 --- /dev/null +++ b/_static/pygments.css @@ -0,0 +1,258 @@ +.highlight pre { line-height: 125%; } +.highlight td.linenos .normal { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; } +.highlight span.linenos { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; } +.highlight td.linenos .special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; } +.highlight span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; } +.highlight .hll { background-color: #ffffcc } +.highlight { background: #f8f8f8; } +.highlight .c { color: #8f5902; font-style: italic } /* Comment */ +.highlight .err { color: #a40000; border: 1px solid #ef2929 } /* Error */ +.highlight .g { color: #000000 } /* Generic */ +.highlight .k { color: #204a87; font-weight: bold } /* Keyword */ +.highlight .l { color: #000000 } /* Literal */ +.highlight .n { color: #000000 } /* Name */ +.highlight .o { color: #ce5c00; font-weight: bold } /* Operator */ +.highlight .x { color: #000000 } /* Other */ +.highlight .p { color: #000000; font-weight: bold } /* Punctuation */ +.highlight .ch { color: #8f5902; font-style: italic } /* Comment.Hashbang */ +.highlight .cm { color: #8f5902; font-style: italic } /* Comment.Multiline */ +.highlight .cp { color: #8f5902; font-style: italic } /* Comment.Preproc */ +.highlight .cpf { color: #8f5902; font-style: italic } /* Comment.PreprocFile */ +.highlight .c1 { color: #8f5902; font-style: italic } /* Comment.Single */ +.highlight .cs { color: #8f5902; font-style: italic } /* Comment.Special */ +.highlight .gd { color: #a40000 } /* Generic.Deleted */ +.highlight .ge { color: #000000; font-style: italic } /* Generic.Emph */ +.highlight .ges { color: #000000; font-weight: bold; font-style: italic } /* Generic.EmphStrong */ +.highlight .gr { color: #ef2929 } /* Generic.Error */ +.highlight .gh { color: #000080; font-weight: bold } /* Generic.Heading */ +.highlight .gi { color: #00A000 } /* Generic.Inserted */ +.highlight .go { color: #000000; font-style: italic } /* Generic.Output */ +.highlight .gp { color: #8f5902 } /* Generic.Prompt */ +.highlight .gs { color: #000000; font-weight: bold } /* Generic.Strong */ +.highlight .gu { color: #800080; font-weight: bold } /* Generic.Subheading */ +.highlight .gt { color: #a40000; font-weight: bold } /* Generic.Traceback */ +.highlight .kc { color: #204a87; font-weight: bold } /* Keyword.Constant */ +.highlight .kd { color: #204a87; font-weight: bold } /* Keyword.Declaration */ +.highlight .kn { color: #204a87; font-weight: bold } /* Keyword.Namespace */ +.highlight .kp { color: #204a87; font-weight: bold } /* Keyword.Pseudo */ +.highlight .kr { color: #204a87; font-weight: bold } /* Keyword.Reserved */ +.highlight .kt { color: #204a87; font-weight: bold } /* Keyword.Type */ +.highlight .ld { color: #000000 } /* Literal.Date */ +.highlight .m { color: #0000cf; font-weight: bold } /* Literal.Number */ +.highlight .s { color: #4e9a06 } /* Literal.String */ +.highlight .na { color: #c4a000 } /* Name.Attribute */ +.highlight .nb { color: #204a87 } /* Name.Builtin */ +.highlight .nc { color: #000000 } /* Name.Class */ +.highlight .no { color: #000000 } /* Name.Constant */ +.highlight .nd { color: #5c35cc; font-weight: bold } /* Name.Decorator */ +.highlight .ni { color: #ce5c00 } /* Name.Entity */ +.highlight .ne { color: #cc0000; font-weight: bold } /* Name.Exception */ +.highlight .nf { color: #000000 } /* Name.Function */ +.highlight .nl { color: #f57900 } /* Name.Label */ +.highlight .nn { color: #000000 } /* Name.Namespace */ +.highlight .nx { color: #000000 } /* Name.Other */ +.highlight .py { color: #000000 } /* Name.Property */ +.highlight .nt { color: #204a87; font-weight: bold } /* Name.Tag */ +.highlight .nv { color: #000000 } /* Name.Variable */ +.highlight .ow { color: #204a87; font-weight: bold } /* Operator.Word */ +.highlight .pm { color: #000000; font-weight: bold } /* Punctuation.Marker */ +.highlight .w { color: #f8f8f8 } /* Text.Whitespace */ +.highlight .mb { color: #0000cf; font-weight: bold } /* Literal.Number.Bin */ +.highlight .mf { color: #0000cf; font-weight: bold } /* Literal.Number.Float */ +.highlight .mh { color: #0000cf; font-weight: bold } /* Literal.Number.Hex */ +.highlight .mi { color: #0000cf; font-weight: bold } /* Literal.Number.Integer */ +.highlight .mo { color: #0000cf; font-weight: bold } /* Literal.Number.Oct */ +.highlight .sa { color: #4e9a06 } /* Literal.String.Affix */ +.highlight .sb { color: #4e9a06 } /* Literal.String.Backtick */ +.highlight .sc { color: #4e9a06 } /* Literal.String.Char */ +.highlight .dl { color: #4e9a06 } /* Literal.String.Delimiter */ +.highlight .sd { color: #8f5902; font-style: italic } /* Literal.String.Doc */ +.highlight .s2 { color: #4e9a06 } /* Literal.String.Double */ +.highlight .se { color: #4e9a06 } /* Literal.String.Escape */ +.highlight .sh { color: #4e9a06 } /* Literal.String.Heredoc */ +.highlight .si { color: #4e9a06 } /* Literal.String.Interpol */ +.highlight .sx { color: #4e9a06 } /* Literal.String.Other */ +.highlight .sr { color: #4e9a06 } /* Literal.String.Regex */ +.highlight .s1 { color: #4e9a06 } /* Literal.String.Single */ +.highlight .ss { color: #4e9a06 } /* Literal.String.Symbol */ +.highlight .bp { color: #3465a4 } /* Name.Builtin.Pseudo */ +.highlight .fm { color: #000000 } /* Name.Function.Magic */ +.highlight .vc { color: #000000 } /* Name.Variable.Class */ +.highlight .vg { color: #000000 } /* Name.Variable.Global */ +.highlight .vi { color: #000000 } /* Name.Variable.Instance */ +.highlight .vm { color: #000000 } /* Name.Variable.Magic */ +.highlight .il { color: #0000cf; font-weight: bold } /* Literal.Number.Integer.Long */ +@media not print { +body[data-theme="dark"] .highlight pre { line-height: 125%; } +body[data-theme="dark"] .highlight td.linenos .normal { color: #aaaaaa; background-color: transparent; padding-left: 5px; padding-right: 5px; } +body[data-theme="dark"] .highlight span.linenos { color: #aaaaaa; background-color: transparent; padding-left: 5px; padding-right: 5px; } +body[data-theme="dark"] .highlight td.linenos .special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; } +body[data-theme="dark"] .highlight span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; } +body[data-theme="dark"] .highlight .hll { background-color: #404040 } +body[data-theme="dark"] .highlight { background: #202020; color: #d0d0d0 } +body[data-theme="dark"] .highlight .c { color: #ababab; font-style: italic } /* Comment */ +body[data-theme="dark"] .highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */ +body[data-theme="dark"] .highlight .esc { color: #d0d0d0 } /* Escape */ +body[data-theme="dark"] .highlight .g { color: #d0d0d0 } /* Generic */ +body[data-theme="dark"] .highlight .k { color: #6ebf26; font-weight: bold } /* Keyword */ +body[data-theme="dark"] .highlight .l { color: #d0d0d0 } /* Literal */ +body[data-theme="dark"] .highlight .n { color: #d0d0d0 } /* Name */ +body[data-theme="dark"] .highlight .o { color: #d0d0d0 } /* Operator */ +body[data-theme="dark"] .highlight .x { color: #d0d0d0 } /* Other */ +body[data-theme="dark"] .highlight .p { color: #d0d0d0 } /* Punctuation */ +body[data-theme="dark"] .highlight .ch { color: #ababab; font-style: italic } /* Comment.Hashbang */ +body[data-theme="dark"] .highlight .cm { color: #ababab; font-style: italic } /* Comment.Multiline */ +body[data-theme="dark"] .highlight .cp { color: #ff3a3a; font-weight: bold } /* Comment.Preproc */ +body[data-theme="dark"] .highlight .cpf { color: #ababab; font-style: italic } /* Comment.PreprocFile */ +body[data-theme="dark"] .highlight .c1 { color: #ababab; font-style: italic } /* Comment.Single */ +body[data-theme="dark"] .highlight .cs { color: #e50808; font-weight: bold; background-color: #520000 } /* Comment.Special */ +body[data-theme="dark"] .highlight .gd { color: #ff3a3a } /* Generic.Deleted */ +body[data-theme="dark"] .highlight .ge { color: #d0d0d0; font-style: italic } /* Generic.Emph */ +body[data-theme="dark"] .highlight .ges { color: #d0d0d0; font-weight: bold; font-style: italic } /* Generic.EmphStrong */ +body[data-theme="dark"] .highlight .gr { color: #ff3a3a } /* Generic.Error */ +body[data-theme="dark"] .highlight .gh { color: #ffffff; font-weight: bold } /* Generic.Heading */ +body[data-theme="dark"] .highlight .gi { color: #589819 } /* Generic.Inserted */ +body[data-theme="dark"] .highlight .go { color: #cccccc } /* Generic.Output */ +body[data-theme="dark"] .highlight .gp { color: #aaaaaa } /* Generic.Prompt */ +body[data-theme="dark"] .highlight .gs { color: #d0d0d0; font-weight: bold } /* Generic.Strong */ +body[data-theme="dark"] .highlight .gu { color: #ffffff; text-decoration: underline } /* Generic.Subheading */ +body[data-theme="dark"] .highlight .gt { color: #ff3a3a } /* Generic.Traceback */ +body[data-theme="dark"] .highlight .kc { color: #6ebf26; font-weight: bold } /* Keyword.Constant */ +body[data-theme="dark"] .highlight .kd { color: #6ebf26; font-weight: bold } /* Keyword.Declaration */ +body[data-theme="dark"] .highlight .kn { color: #6ebf26; font-weight: bold } /* Keyword.Namespace */ +body[data-theme="dark"] .highlight .kp { color: #6ebf26 } /* Keyword.Pseudo */ +body[data-theme="dark"] .highlight .kr { color: #6ebf26; font-weight: bold } /* Keyword.Reserved */ +body[data-theme="dark"] .highlight .kt { color: #6ebf26; font-weight: bold } /* Keyword.Type */ +body[data-theme="dark"] .highlight .ld { color: #d0d0d0 } /* Literal.Date */ +body[data-theme="dark"] .highlight .m { color: #51b2fd } /* Literal.Number */ +body[data-theme="dark"] .highlight .s { color: #ed9d13 } /* Literal.String */ +body[data-theme="dark"] .highlight .na { color: #bbbbbb } /* Name.Attribute */ +body[data-theme="dark"] .highlight .nb { color: #2fbccd } /* Name.Builtin */ +body[data-theme="dark"] .highlight .nc { color: #71adff; text-decoration: underline } /* Name.Class */ +body[data-theme="dark"] .highlight .no { color: #40ffff } /* Name.Constant */ +body[data-theme="dark"] .highlight .nd { color: #ffa500 } /* Name.Decorator */ +body[data-theme="dark"] .highlight .ni { color: #d0d0d0 } /* Name.Entity */ +body[data-theme="dark"] .highlight .ne { color: #bbbbbb } /* Name.Exception */ +body[data-theme="dark"] .highlight .nf { color: #71adff } /* Name.Function */ +body[data-theme="dark"] .highlight .nl { color: #d0d0d0 } /* Name.Label */ +body[data-theme="dark"] .highlight .nn { color: #71adff; text-decoration: underline } /* Name.Namespace */ +body[data-theme="dark"] .highlight .nx { color: #d0d0d0 } /* Name.Other */ +body[data-theme="dark"] .highlight .py { color: #d0d0d0 } /* Name.Property */ +body[data-theme="dark"] .highlight .nt { color: #6ebf26; font-weight: bold } /* Name.Tag */ +body[data-theme="dark"] .highlight .nv { color: #40ffff } /* Name.Variable */ +body[data-theme="dark"] .highlight .ow { color: #6ebf26; font-weight: bold } /* Operator.Word */ +body[data-theme="dark"] .highlight .pm { color: #d0d0d0 } /* Punctuation.Marker */ +body[data-theme="dark"] .highlight .w { color: #666666 } /* Text.Whitespace */ +body[data-theme="dark"] .highlight .mb { color: #51b2fd } /* Literal.Number.Bin */ +body[data-theme="dark"] .highlight .mf { color: #51b2fd } /* Literal.Number.Float */ +body[data-theme="dark"] .highlight .mh { color: #51b2fd } /* Literal.Number.Hex */ +body[data-theme="dark"] .highlight .mi { color: #51b2fd } /* Literal.Number.Integer */ +body[data-theme="dark"] .highlight .mo { color: #51b2fd } /* Literal.Number.Oct */ +body[data-theme="dark"] .highlight .sa { color: #ed9d13 } /* Literal.String.Affix */ +body[data-theme="dark"] .highlight .sb { color: #ed9d13 } /* Literal.String.Backtick */ +body[data-theme="dark"] .highlight .sc { color: #ed9d13 } /* Literal.String.Char */ +body[data-theme="dark"] .highlight .dl { color: #ed9d13 } /* Literal.String.Delimiter */ +body[data-theme="dark"] .highlight .sd { color: #ed9d13 } /* Literal.String.Doc */ +body[data-theme="dark"] .highlight .s2 { color: #ed9d13 } /* Literal.String.Double */ +body[data-theme="dark"] .highlight .se { color: #ed9d13 } /* Literal.String.Escape */ +body[data-theme="dark"] .highlight .sh { color: #ed9d13 } /* Literal.String.Heredoc */ +body[data-theme="dark"] .highlight .si { color: #ed9d13 } /* Literal.String.Interpol */ +body[data-theme="dark"] .highlight .sx { color: #ffa500 } /* Literal.String.Other */ +body[data-theme="dark"] .highlight .sr { color: #ed9d13 } /* Literal.String.Regex */ +body[data-theme="dark"] .highlight .s1 { color: #ed9d13 } /* Literal.String.Single */ +body[data-theme="dark"] .highlight .ss { color: #ed9d13 } /* Literal.String.Symbol */ +body[data-theme="dark"] .highlight .bp { color: #2fbccd } /* Name.Builtin.Pseudo */ +body[data-theme="dark"] .highlight .fm { color: #71adff } /* Name.Function.Magic */ +body[data-theme="dark"] .highlight .vc { color: #40ffff } /* Name.Variable.Class */ +body[data-theme="dark"] .highlight .vg { color: #40ffff } /* Name.Variable.Global */ +body[data-theme="dark"] .highlight .vi { color: #40ffff } /* Name.Variable.Instance */ +body[data-theme="dark"] .highlight .vm { color: #40ffff } /* Name.Variable.Magic */ +body[data-theme="dark"] .highlight .il { color: #51b2fd } /* Literal.Number.Integer.Long */ +@media (prefers-color-scheme: dark) { +body:not([data-theme="light"]) .highlight pre { line-height: 125%; } +body:not([data-theme="light"]) .highlight td.linenos .normal { color: #aaaaaa; background-color: transparent; padding-left: 5px; padding-right: 5px; } +body:not([data-theme="light"]) .highlight span.linenos { color: #aaaaaa; background-color: transparent; padding-left: 5px; padding-right: 5px; } +body:not([data-theme="light"]) .highlight td.linenos .special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; } +body:not([data-theme="light"]) .highlight span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; } +body:not([data-theme="light"]) .highlight .hll { background-color: #404040 } +body:not([data-theme="light"]) .highlight { background: #202020; color: #d0d0d0 } +body:not([data-theme="light"]) .highlight .c { color: #ababab; font-style: italic } /* Comment */ +body:not([data-theme="light"]) .highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */ +body:not([data-theme="light"]) .highlight .esc { color: #d0d0d0 } /* Escape */ +body:not([data-theme="light"]) .highlight .g { color: #d0d0d0 } /* Generic */ +body:not([data-theme="light"]) .highlight .k { color: #6ebf26; font-weight: bold } /* Keyword */ +body:not([data-theme="light"]) .highlight .l { color: #d0d0d0 } /* Literal */ +body:not([data-theme="light"]) .highlight .n { color: #d0d0d0 } /* Name */ +body:not([data-theme="light"]) .highlight .o { color: #d0d0d0 } /* Operator */ +body:not([data-theme="light"]) .highlight .x { color: #d0d0d0 } /* Other */ +body:not([data-theme="light"]) .highlight .p { color: #d0d0d0 } /* Punctuation */ +body:not([data-theme="light"]) .highlight .ch { color: #ababab; font-style: italic } /* Comment.Hashbang */ +body:not([data-theme="light"]) .highlight .cm { color: #ababab; font-style: italic } /* Comment.Multiline */ +body:not([data-theme="light"]) .highlight .cp { color: #ff3a3a; font-weight: bold } /* Comment.Preproc */ +body:not([data-theme="light"]) .highlight .cpf { color: #ababab; font-style: italic } /* Comment.PreprocFile */ +body:not([data-theme="light"]) .highlight .c1 { color: #ababab; font-style: italic } /* Comment.Single */ +body:not([data-theme="light"]) .highlight .cs { color: #e50808; font-weight: bold; background-color: #520000 } /* Comment.Special */ +body:not([data-theme="light"]) .highlight .gd { color: #ff3a3a } /* Generic.Deleted */ +body:not([data-theme="light"]) .highlight .ge { color: #d0d0d0; font-style: italic } /* Generic.Emph */ +body:not([data-theme="light"]) .highlight .ges { color: #d0d0d0; font-weight: bold; font-style: italic } /* Generic.EmphStrong */ +body:not([data-theme="light"]) .highlight .gr { color: #ff3a3a } /* Generic.Error */ +body:not([data-theme="light"]) .highlight .gh { color: #ffffff; font-weight: bold } /* Generic.Heading */ +body:not([data-theme="light"]) .highlight .gi { color: #589819 } /* Generic.Inserted */ +body:not([data-theme="light"]) .highlight .go { color: #cccccc } /* Generic.Output */ +body:not([data-theme="light"]) .highlight .gp { color: #aaaaaa } /* Generic.Prompt */ +body:not([data-theme="light"]) .highlight .gs { color: #d0d0d0; font-weight: bold } /* Generic.Strong */ +body:not([data-theme="light"]) .highlight .gu { color: #ffffff; text-decoration: underline } /* Generic.Subheading */ +body:not([data-theme="light"]) .highlight .gt { color: #ff3a3a } /* Generic.Traceback */ +body:not([data-theme="light"]) .highlight .kc { color: #6ebf26; font-weight: bold } /* Keyword.Constant */ +body:not([data-theme="light"]) .highlight .kd { color: #6ebf26; font-weight: bold } /* Keyword.Declaration */ +body:not([data-theme="light"]) .highlight .kn { color: #6ebf26; font-weight: bold } /* Keyword.Namespace */ +body:not([data-theme="light"]) .highlight .kp { color: #6ebf26 } /* Keyword.Pseudo */ +body:not([data-theme="light"]) .highlight .kr { color: #6ebf26; font-weight: bold } /* Keyword.Reserved */ +body:not([data-theme="light"]) .highlight .kt { color: #6ebf26; font-weight: bold } /* Keyword.Type */ +body:not([data-theme="light"]) .highlight .ld { color: #d0d0d0 } /* Literal.Date */ +body:not([data-theme="light"]) .highlight .m { color: #51b2fd } /* Literal.Number */ +body:not([data-theme="light"]) .highlight .s { color: #ed9d13 } /* Literal.String */ +body:not([data-theme="light"]) .highlight .na { color: #bbbbbb } /* Name.Attribute */ +body:not([data-theme="light"]) .highlight .nb { color: #2fbccd } /* Name.Builtin */ +body:not([data-theme="light"]) .highlight .nc { color: #71adff; text-decoration: underline } /* Name.Class */ +body:not([data-theme="light"]) .highlight .no { color: #40ffff } /* Name.Constant */ +body:not([data-theme="light"]) .highlight .nd { color: #ffa500 } /* Name.Decorator */ +body:not([data-theme="light"]) .highlight .ni { color: #d0d0d0 } /* Name.Entity */ +body:not([data-theme="light"]) .highlight .ne { color: #bbbbbb } /* Name.Exception */ +body:not([data-theme="light"]) .highlight .nf { color: #71adff } /* Name.Function */ +body:not([data-theme="light"]) .highlight .nl { color: #d0d0d0 } /* Name.Label */ +body:not([data-theme="light"]) .highlight .nn { color: #71adff; text-decoration: underline } /* Name.Namespace */ +body:not([data-theme="light"]) .highlight .nx { color: #d0d0d0 } /* Name.Other */ +body:not([data-theme="light"]) .highlight .py { color: #d0d0d0 } /* Name.Property */ +body:not([data-theme="light"]) .highlight .nt { color: #6ebf26; font-weight: bold } /* Name.Tag */ +body:not([data-theme="light"]) .highlight .nv { color: #40ffff } /* Name.Variable */ +body:not([data-theme="light"]) .highlight .ow { color: #6ebf26; font-weight: bold } /* Operator.Word */ +body:not([data-theme="light"]) .highlight .pm { color: #d0d0d0 } /* Punctuation.Marker */ +body:not([data-theme="light"]) .highlight .w { color: #666666 } /* Text.Whitespace */ +body:not([data-theme="light"]) .highlight .mb { color: #51b2fd } /* Literal.Number.Bin */ +body:not([data-theme="light"]) .highlight .mf { color: #51b2fd } /* Literal.Number.Float */ +body:not([data-theme="light"]) .highlight .mh { color: #51b2fd } /* Literal.Number.Hex */ +body:not([data-theme="light"]) .highlight .mi { color: #51b2fd } /* Literal.Number.Integer */ +body:not([data-theme="light"]) .highlight .mo { color: #51b2fd } /* Literal.Number.Oct */ +body:not([data-theme="light"]) .highlight .sa { color: #ed9d13 } /* Literal.String.Affix */ +body:not([data-theme="light"]) .highlight .sb { color: #ed9d13 } /* Literal.String.Backtick */ +body:not([data-theme="light"]) .highlight .sc { color: #ed9d13 } /* Literal.String.Char */ +body:not([data-theme="light"]) .highlight .dl { color: #ed9d13 } /* Literal.String.Delimiter */ +body:not([data-theme="light"]) .highlight .sd { color: #ed9d13 } /* Literal.String.Doc */ +body:not([data-theme="light"]) .highlight .s2 { color: #ed9d13 } /* Literal.String.Double */ +body:not([data-theme="light"]) .highlight .se { color: #ed9d13 } /* Literal.String.Escape */ +body:not([data-theme="light"]) .highlight .sh { color: #ed9d13 } /* Literal.String.Heredoc */ +body:not([data-theme="light"]) .highlight .si { color: #ed9d13 } /* Literal.String.Interpol */ +body:not([data-theme="light"]) .highlight .sx { color: #ffa500 } /* Literal.String.Other */ +body:not([data-theme="light"]) .highlight .sr { color: #ed9d13 } /* Literal.String.Regex */ +body:not([data-theme="light"]) .highlight .s1 { color: #ed9d13 } /* Literal.String.Single */ +body:not([data-theme="light"]) .highlight .ss { color: #ed9d13 } /* Literal.String.Symbol */ +body:not([data-theme="light"]) .highlight .bp { color: #2fbccd } /* Name.Builtin.Pseudo */ +body:not([data-theme="light"]) .highlight .fm { color: #71adff } /* Name.Function.Magic */ +body:not([data-theme="light"]) .highlight .vc { color: #40ffff } /* Name.Variable.Class */ +body:not([data-theme="light"]) .highlight .vg { color: #40ffff } /* Name.Variable.Global */ +body:not([data-theme="light"]) .highlight .vi { color: #40ffff } /* Name.Variable.Instance */ +body:not([data-theme="light"]) .highlight .vm { color: #40ffff } /* Name.Variable.Magic */ +body:not([data-theme="light"]) .highlight .il { color: #51b2fd } /* Literal.Number.Integer.Long */ +} +} \ No newline at end of file diff --git a/_static/scripts/furo-extensions.js b/_static/scripts/furo-extensions.js new file mode 100644 index 00000000..e69de29b diff --git a/_static/scripts/furo.js b/_static/scripts/furo.js new file mode 100644 index 00000000..0abb2afa --- /dev/null +++ b/_static/scripts/furo.js @@ -0,0 +1,3 @@ +/*! For license information please see furo.js.LICENSE.txt */ +(()=>{var t={856:function(t,e,n){var o,r;r=void 0!==n.g?n.g:"undefined"!=typeof window?window:this,o=function(){return function(t){"use strict";var e={navClass:"active",contentClass:"active",nested:!1,nestedClass:"active",offset:0,reflow:!1,events:!0},n=function(t,e,n){if(n.settings.events){var o=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:n});e.dispatchEvent(o)}},o=function(t){var e=0;if(t.offsetParent)for(;t;)e+=t.offsetTop,t=t.offsetParent;return e>=0?e:0},r=function(t){t&&t.sort((function(t,e){return o(t.content)=Math.max(document.body.scrollHeight,document.documentElement.scrollHeight,document.body.offsetHeight,document.documentElement.offsetHeight,document.body.clientHeight,document.documentElement.clientHeight)},l=function(t,e){var n=t[t.length-1];if(function(t,e){return!(!s()||!c(t.content,e,!0))}(n,e))return n;for(var o=t.length-1;o>=0;o--)if(c(t[o].content,e))return t[o]},a=function(t,e){if(e.nested&&t.parentNode){var n=t.parentNode.closest("li");n&&(n.classList.remove(e.nestedClass),a(n,e))}},i=function(t,e){if(t){var o=t.nav.closest("li");o&&(o.classList.remove(e.navClass),t.content.classList.remove(e.contentClass),a(o,e),n("gumshoeDeactivate",o,{link:t.nav,content:t.content,settings:e}))}},u=function(t,e){if(e.nested){var n=t.parentNode.closest("li");n&&(n.classList.add(e.nestedClass),u(n,e))}};return function(o,c){var s,a,d,f,m,v={setup:function(){s=document.querySelectorAll(o),a=[],Array.prototype.forEach.call(s,(function(t){var e=document.getElementById(decodeURIComponent(t.hash.substr(1)));e&&a.push({nav:t,content:e})})),r(a)},detect:function(){var t=l(a,m);t?d&&t.content===d.content||(i(d,m),function(t,e){if(t){var o=t.nav.closest("li");o&&(o.classList.add(e.navClass),t.content.classList.add(e.contentClass),u(o,e),n("gumshoeActivate",o,{link:t.nav,content:t.content,settings:e}))}}(t,m),d=t):d&&(i(d,m),d=null)}},h=function(e){f&&t.cancelAnimationFrame(f),f=t.requestAnimationFrame(v.detect)},g=function(e){f&&t.cancelAnimationFrame(f),f=t.requestAnimationFrame((function(){r(a),v.detect()}))};return v.destroy=function(){d&&i(d,m),t.removeEventListener("scroll",h,!1),m.reflow&&t.removeEventListener("resize",g,!1),a=null,s=null,d=null,f=null,m=null},m=function(){var t={};return Array.prototype.forEach.call(arguments,(function(e){for(var n in e){if(!e.hasOwnProperty(n))return;t[n]=e[n]}})),t}(e,c||{}),v.setup(),v.detect(),t.addEventListener("scroll",h,!1),m.reflow&&t.addEventListener("resize",g,!1),v}}(r)}.apply(e,[]),void 0===o||(t.exports=o)}},e={};function n(o){var r=e[o];if(void 0!==r)return r.exports;var c=e[o]={exports:{}};return t[o].call(c.exports,c,c.exports,n),c.exports}n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var o in e)n.o(e,o)&&!n.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:e[o]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),(()=>{"use strict";var t=n(856),e=n.n(t),o=null,r=null,c=document.documentElement.scrollTop;const s=64;function l(){const t=localStorage.getItem("theme")||"auto";var e;"light"!==(e=window.matchMedia("(prefers-color-scheme: dark)").matches?"auto"===t?"light":"light"==t?"dark":"auto":"auto"===t?"dark":"dark"==t?"light":"auto")&&"dark"!==e&&"auto"!==e&&(console.error(`Got invalid theme mode: ${e}. Resetting to auto.`),e="auto"),document.body.dataset.theme=e,localStorage.setItem("theme",e),console.log(`Changed to ${e} mode.`)}function a(){!function(){const t=document.getElementsByClassName("theme-toggle");Array.from(t).forEach((t=>{t.addEventListener("click",l)}))}(),function(){let t=0,e=!1;window.addEventListener("scroll",(function(n){t=window.scrollY,e||(window.requestAnimationFrame((function(){var n;(function(t){const e=Math.floor(r.getBoundingClientRect().top);console.log(`headerTop: ${e}`),0==e&&t!=e?r.classList.add("scrolled"):r.classList.remove("scrolled")})(n=t),function(t){tc&&document.documentElement.classList.remove("show-back-to-top"),c=t}(n),function(t){null!==o&&(0==t?o.scrollTo(0,0):Math.ceil(t)>=Math.floor(document.documentElement.scrollHeight-window.innerHeight)?o.scrollTo(0,o.scrollHeight):document.querySelector(".scroll-current"))}(n),e=!1})),e=!0)})),window.scroll()}(),null!==o&&new(e())(".toc-tree a",{reflow:!0,recursive:!0,navClass:"scroll-current",offset:()=>{let t=parseFloat(getComputedStyle(document.documentElement).fontSize);return r.getBoundingClientRect().height+2.5*t+1}})}document.addEventListener("DOMContentLoaded",(function(){document.body.parentNode.classList.remove("no-js"),r=document.querySelector("header"),o=document.querySelector(".toc-scroll"),a()}))})()})(); +//# sourceMappingURL=furo.js.map \ No newline at end of file diff --git a/_static/scripts/furo.js.LICENSE.txt b/_static/scripts/furo.js.LICENSE.txt new file mode 100644 index 00000000..1632189c --- /dev/null +++ b/_static/scripts/furo.js.LICENSE.txt @@ -0,0 +1,7 @@ +/*! + * gumshoejs v5.1.2 (patched by @pradyunsg) + * A simple, framework-agnostic scrollspy script. + * (c) 2019 Chris Ferdinandi + * MIT License + * http://github.com/cferdinandi/gumshoe + */ diff --git a/_static/scripts/furo.js.map b/_static/scripts/furo.js.map new file mode 100644 index 00000000..80ea12b8 --- /dev/null +++ b/_static/scripts/furo.js.map @@ -0,0 +1 @@ +{"version":3,"file":"scripts/furo.js","mappings":";iCAAA,MAQWA,SAWS,IAAX,EAAAC,EACH,EAAAA,EACkB,oBAAXC,OACLA,OACAC,KAbO,EAAF,WACP,OAaJ,SAAUD,GACR,aAMA,IAAIE,EAAW,CAEbC,SAAU,SACVC,aAAc,SAGdC,QAAQ,EACRC,YAAa,SAGbC,OAAQ,EACRC,QAAQ,EAGRC,QAAQ,GA6BNC,EAAY,SAAUC,EAAMC,EAAMC,GAEpC,GAAKA,EAAOC,SAASL,OAArB,CAGA,IAAIM,EAAQ,IAAIC,YAAYL,EAAM,CAChCM,SAAS,EACTC,YAAY,EACZL,OAAQA,IAIVD,EAAKO,cAAcJ,EAVgB,CAWrC,EAOIK,EAAe,SAAUR,GAC3B,IAAIS,EAAW,EACf,GAAIT,EAAKU,aACP,KAAOV,GACLS,GAAYT,EAAKW,UACjBX,EAAOA,EAAKU,aAGhB,OAAOD,GAAY,EAAIA,EAAW,CACpC,EAMIG,EAAe,SAAUC,GACvBA,GACFA,EAASC,MAAK,SAAUC,EAAOC,GAG7B,OAFcR,EAAaO,EAAME,SACnBT,EAAaQ,EAAMC,UACF,EACxB,CACT,GAEJ,EAwCIC,EAAW,SAAUlB,EAAME,EAAUiB,GACvC,IAAIC,EAASpB,EAAKqB,wBACd1B,EAnCU,SAAUO,GAExB,MAA+B,mBAApBA,EAASP,OACX2B,WAAWpB,EAASP,UAItB2B,WAAWpB,EAASP,OAC7B,CA2Be4B,CAAUrB,GACvB,OAAIiB,EAEAK,SAASJ,EAAOD,OAAQ,KACvB/B,EAAOqC,aAAeC,SAASC,gBAAgBC,cAG7CJ,SAASJ,EAAOS,IAAK,KAAOlC,CACrC,EAMImC,EAAa,WACf,OACEC,KAAKC,KAAK5C,EAAOqC,YAAcrC,EAAO6C,cAnCjCF,KAAKG,IACVR,SAASS,KAAKC,aACdV,SAASC,gBAAgBS,aACzBV,SAASS,KAAKE,aACdX,SAASC,gBAAgBU,aACzBX,SAASS,KAAKP,aACdF,SAASC,gBAAgBC,aAkC7B,EAmBIU,EAAY,SAAUzB,EAAUX,GAClC,IAAIqC,EAAO1B,EAASA,EAAS2B,OAAS,GACtC,GAbgB,SAAUC,EAAMvC,GAChC,SAAI4B,MAAgBZ,EAASuB,EAAKxB,QAASf,GAAU,GAEvD,CAUMwC,CAAYH,EAAMrC,GAAW,OAAOqC,EACxC,IAAK,IAAII,EAAI9B,EAAS2B,OAAS,EAAGG,GAAK,EAAGA,IACxC,GAAIzB,EAASL,EAAS8B,GAAG1B,QAASf,GAAW,OAAOW,EAAS8B,EAEjE,EAOIC,EAAmB,SAAUC,EAAK3C,GAEpC,GAAKA,EAAST,QAAWoD,EAAIC,WAA7B,CAGA,IAAIC,EAAKF,EAAIC,WAAWE,QAAQ,MAC3BD,IAGLA,EAAGE,UAAUC,OAAOhD,EAASR,aAG7BkD,EAAiBG,EAAI7C,GAV0B,CAWjD,EAOIiD,EAAa,SAAUC,EAAOlD,GAEhC,GAAKkD,EAAL,CAGA,IAAIL,EAAKK,EAAMP,IAAIG,QAAQ,MACtBD,IAGLA,EAAGE,UAAUC,OAAOhD,EAASX,UAC7B6D,EAAMnC,QAAQgC,UAAUC,OAAOhD,EAASV,cAGxCoD,EAAiBG,EAAI7C,GAGrBJ,EAAU,oBAAqBiD,EAAI,CACjCM,KAAMD,EAAMP,IACZ5B,QAASmC,EAAMnC,QACff,SAAUA,IAjBM,CAmBpB,EAOIoD,EAAiB,SAAUT,EAAK3C,GAElC,GAAKA,EAAST,OAAd,CAGA,IAAIsD,EAAKF,EAAIC,WAAWE,QAAQ,MAC3BD,IAGLA,EAAGE,UAAUM,IAAIrD,EAASR,aAG1B4D,EAAeP,EAAI7C,GAVS,CAW9B,EA6LA,OA1JkB,SAAUsD,EAAUC,GAKpC,IACIC,EAAU7C,EAAU8C,EAASC,EAAS1D,EADtC2D,EAAa,CAUjBA,MAAmB,WAEjBH,EAAWhC,SAASoC,iBAAiBN,GAGrC3C,EAAW,GAGXkD,MAAMC,UAAUC,QAAQC,KAAKR,GAAU,SAAUjB,GAE/C,IAAIxB,EAAUS,SAASyC,eACrBC,mBAAmB3B,EAAK4B,KAAKC,OAAO,KAEjCrD,GAGLJ,EAAS0D,KAAK,CACZ1B,IAAKJ,EACLxB,QAASA,GAEb,IAGAL,EAAaC,EACf,EAKAgD,OAAoB,WAElB,IAAIW,EAASlC,EAAUzB,EAAUX,GAG5BsE,EASDb,GAAWa,EAAOvD,UAAY0C,EAAQ1C,UAG1CkC,EAAWQ,EAASzD,GAzFT,SAAUkD,EAAOlD,GAE9B,GAAKkD,EAAL,CAGA,IAAIL,EAAKK,EAAMP,IAAIG,QAAQ,MACtBD,IAGLA,EAAGE,UAAUM,IAAIrD,EAASX,UAC1B6D,EAAMnC,QAAQgC,UAAUM,IAAIrD,EAASV,cAGrC8D,EAAeP,EAAI7C,GAGnBJ,EAAU,kBAAmBiD,EAAI,CAC/BM,KAAMD,EAAMP,IACZ5B,QAASmC,EAAMnC,QACff,SAAUA,IAjBM,CAmBpB,CAqEIuE,CAASD,EAAQtE,GAGjByD,EAAUa,GAfJb,IACFR,EAAWQ,EAASzD,GACpByD,EAAU,KAchB,GAMIe,EAAgB,SAAUvE,GAExByD,GACFxE,EAAOuF,qBAAqBf,GAI9BA,EAAUxE,EAAOwF,sBAAsBf,EAAWgB,OACpD,EAMIC,EAAgB,SAAU3E,GAExByD,GACFxE,EAAOuF,qBAAqBf,GAI9BA,EAAUxE,EAAOwF,uBAAsB,WACrChE,EAAaC,GACbgD,EAAWgB,QACb,GACF,EAkDA,OA7CAhB,EAAWkB,QAAU,WAEfpB,GACFR,EAAWQ,EAASzD,GAItBd,EAAO4F,oBAAoB,SAAUN,GAAe,GAChDxE,EAASN,QACXR,EAAO4F,oBAAoB,SAAUF,GAAe,GAItDjE,EAAW,KACX6C,EAAW,KACXC,EAAU,KACVC,EAAU,KACV1D,EAAW,IACb,EAOEA,EA3XS,WACX,IAAI+E,EAAS,CAAC,EAOd,OANAlB,MAAMC,UAAUC,QAAQC,KAAKgB,WAAW,SAAUC,GAChD,IAAK,IAAIC,KAAOD,EAAK,CACnB,IAAKA,EAAIE,eAAeD,GAAM,OAC9BH,EAAOG,GAAOD,EAAIC,EACpB,CACF,IACOH,CACT,CAkXeK,CAAOhG,EAAUmE,GAAW,CAAC,GAGxCI,EAAW0B,QAGX1B,EAAWgB,SAGXzF,EAAOoG,iBAAiB,SAAUd,GAAe,GAC7CxE,EAASN,QACXR,EAAOoG,iBAAiB,SAAUV,GAAe,GAS9CjB,CACT,CAOF,CArcW4B,CAAQvG,EAChB,UAFM,SAEN,uBCXDwG,EAA2B,CAAC,EAGhC,SAASC,EAAoBC,GAE5B,IAAIC,EAAeH,EAAyBE,GAC5C,QAAqBE,IAAjBD,EACH,OAAOA,EAAaE,QAGrB,IAAIC,EAASN,EAAyBE,GAAY,CAGjDG,QAAS,CAAC,GAOX,OAHAE,EAAoBL,GAAU1B,KAAK8B,EAAOD,QAASC,EAAQA,EAAOD,QAASJ,GAGpEK,EAAOD,OACf,CCrBAJ,EAAoBO,EAAKF,IACxB,IAAIG,EAASH,GAAUA,EAAOI,WAC7B,IAAOJ,EAAiB,QACxB,IAAM,EAEP,OADAL,EAAoBU,EAAEF,EAAQ,CAAEG,EAAGH,IAC5BA,CAAM,ECLdR,EAAoBU,EAAI,CAACN,EAASQ,KACjC,IAAI,IAAInB,KAAOmB,EACXZ,EAAoBa,EAAED,EAAYnB,KAASO,EAAoBa,EAAET,EAASX,IAC5EqB,OAAOC,eAAeX,EAASX,EAAK,CAAEuB,YAAY,EAAMC,IAAKL,EAAWnB,IAE1E,ECNDO,EAAoBxG,EAAI,WACvB,GAA0B,iBAAf0H,WAAyB,OAAOA,WAC3C,IACC,OAAOxH,MAAQ,IAAIyH,SAAS,cAAb,EAChB,CAAE,MAAOC,GACR,GAAsB,iBAAX3H,OAAqB,OAAOA,MACxC,CACA,CAPuB,GCAxBuG,EAAoBa,EAAI,CAACrB,EAAK6B,IAAUP,OAAOzC,UAAUqB,eAAenB,KAAKiB,EAAK6B,4CCK9EC,EAAY,KACZC,EAAS,KACTC,EAAgBzF,SAASC,gBAAgByF,UAC7C,MAAMC,EAAmB,GA8EzB,SAASC,IACP,MAAMC,EAAeC,aAAaC,QAAQ,UAAY,OAZxD,IAAkBC,EACH,WADGA,EAaItI,OAAOuI,WAAW,gCAAgCC,QAI/C,SAAjBL,EACO,QACgB,SAAhBA,EACA,OAEA,OAIU,SAAjBA,EACO,OACgB,QAAhBA,EACA,QAEA,SA9BoB,SAATG,GAA4B,SAATA,IACzCG,QAAQC,MAAM,2BAA2BJ,yBACzCA,EAAO,QAGThG,SAASS,KAAK4F,QAAQC,MAAQN,EAC9BF,aAAaS,QAAQ,QAASP,GAC9BG,QAAQK,IAAI,cAAcR,UA0B5B,CAkDA,SAASnC,KART,WAEE,MAAM4C,EAAUzG,SAAS0G,uBAAuB,gBAChDrE,MAAMsE,KAAKF,GAASlE,SAASqE,IAC3BA,EAAI9C,iBAAiB,QAAS8B,EAAe,GAEjD,CAGEiB,GA9CF,WAEE,IAAIC,EAA6B,EAC7BC,GAAU,EAEdrJ,OAAOoG,iBAAiB,UAAU,SAAUuB,GAC1CyB,EAA6BpJ,OAAOsJ,QAE/BD,IACHrJ,OAAOwF,uBAAsB,WAzDnC,IAAuB+D,GAxDvB,SAAgCA,GAC9B,MAAMC,EAAY7G,KAAK8G,MAAM3B,EAAO7F,wBAAwBQ,KAE5DgG,QAAQK,IAAI,cAAcU,KACT,GAAbA,GAAkBD,GAAaC,EACjC1B,EAAOjE,UAAUM,IAAI,YAErB2D,EAAOjE,UAAUC,OAAO,WAE5B,EAgDE4F,CADqBH,EA0DDH,GAvGtB,SAAmCG,GAC7BA,EAAYtB,EACd3F,SAASC,gBAAgBsB,UAAUC,OAAO,oBAEtCyF,EAAYxB,EACdzF,SAASC,gBAAgBsB,UAAUM,IAAI,oBAC9BoF,EAAYxB,GACrBzF,SAASC,gBAAgBsB,UAAUC,OAAO,oBAG9CiE,EAAgBwB,CAClB,CAoCEI,CAA0BJ,GAlC5B,SAA6BA,GACT,OAAd1B,IAKa,GAAb0B,EACF1B,EAAU+B,SAAS,EAAG,GAGtBjH,KAAKC,KAAK2G,IACV5G,KAAK8G,MAAMnH,SAASC,gBAAgBS,aAAehD,OAAOqC,aAE1DwF,EAAU+B,SAAS,EAAG/B,EAAU7E,cAGhBV,SAASuH,cAAc,mBAc3C,CAKEC,CAAoBP,GAwDdF,GAAU,CACZ,IAEAA,GAAU,EAEd,IACArJ,OAAO+J,QACT,CA6BEC,GA1BkB,OAAdnC,GAKJ,IAAI,IAAJ,CAAY,cAAe,CACzBrH,QAAQ,EACRyJ,WAAW,EACX9J,SAAU,iBACVI,OAAQ,KACN,IAAI2J,EAAMhI,WAAWiI,iBAAiB7H,SAASC,iBAAiB6H,UAChE,OAAOtC,EAAO7F,wBAAwBoI,OAAS,IAAMH,EAAM,CAAC,GAiBlE,CAcA5H,SAAS8D,iBAAiB,oBAT1B,WACE9D,SAASS,KAAKW,WAAWG,UAAUC,OAAO,SAE1CgE,EAASxF,SAASuH,cAAc,UAChChC,EAAYvF,SAASuH,cAAc,eAEnC1D,GACF","sources":["webpack:///./src/furo/assets/scripts/gumshoe-patched.js","webpack:///webpack/bootstrap","webpack:///webpack/runtime/compat get default export","webpack:///webpack/runtime/define property getters","webpack:///webpack/runtime/global","webpack:///webpack/runtime/hasOwnProperty shorthand","webpack:///./src/furo/assets/scripts/furo.js"],"sourcesContent":["/*!\n * gumshoejs v5.1.2 (patched by @pradyunsg)\n * A simple, framework-agnostic scrollspy script.\n * (c) 2019 Chris Ferdinandi\n * MIT License\n * http://github.com/cferdinandi/gumshoe\n */\n\n(function (root, factory) {\n if (typeof define === \"function\" && define.amd) {\n define([], function () {\n return factory(root);\n });\n } else if (typeof exports === \"object\") {\n module.exports = factory(root);\n } else {\n root.Gumshoe = factory(root);\n }\n})(\n typeof global !== \"undefined\"\n ? global\n : typeof window !== \"undefined\"\n ? window\n : this,\n function (window) {\n \"use strict\";\n\n //\n // Defaults\n //\n\n var defaults = {\n // Active classes\n navClass: \"active\",\n contentClass: \"active\",\n\n // Nested navigation\n nested: false,\n nestedClass: \"active\",\n\n // Offset & reflow\n offset: 0,\n reflow: false,\n\n // Event support\n events: true,\n };\n\n //\n // Methods\n //\n\n /**\n * Merge two or more objects together.\n * @param {Object} objects The objects to merge together\n * @returns {Object} Merged values of defaults and options\n */\n var extend = function () {\n var merged = {};\n Array.prototype.forEach.call(arguments, function (obj) {\n for (var key in obj) {\n if (!obj.hasOwnProperty(key)) return;\n merged[key] = obj[key];\n }\n });\n return merged;\n };\n\n /**\n * Emit a custom event\n * @param {String} type The event type\n * @param {Node} elem The element to attach the event to\n * @param {Object} detail Any details to pass along with the event\n */\n var emitEvent = function (type, elem, detail) {\n // Make sure events are enabled\n if (!detail.settings.events) return;\n\n // Create a new event\n var event = new CustomEvent(type, {\n bubbles: true,\n cancelable: true,\n detail: detail,\n });\n\n // Dispatch the event\n elem.dispatchEvent(event);\n };\n\n /**\n * Get an element's distance from the top of the Document.\n * @param {Node} elem The element\n * @return {Number} Distance from the top in pixels\n */\n var getOffsetTop = function (elem) {\n var location = 0;\n if (elem.offsetParent) {\n while (elem) {\n location += elem.offsetTop;\n elem = elem.offsetParent;\n }\n }\n return location >= 0 ? location : 0;\n };\n\n /**\n * Sort content from first to last in the DOM\n * @param {Array} contents The content areas\n */\n var sortContents = function (contents) {\n if (contents) {\n contents.sort(function (item1, item2) {\n var offset1 = getOffsetTop(item1.content);\n var offset2 = getOffsetTop(item2.content);\n if (offset1 < offset2) return -1;\n return 1;\n });\n }\n };\n\n /**\n * Get the offset to use for calculating position\n * @param {Object} settings The settings for this instantiation\n * @return {Float} The number of pixels to offset the calculations\n */\n var getOffset = function (settings) {\n // if the offset is a function run it\n if (typeof settings.offset === \"function\") {\n return parseFloat(settings.offset());\n }\n\n // Otherwise, return it as-is\n return parseFloat(settings.offset);\n };\n\n /**\n * Get the document element's height\n * @private\n * @returns {Number}\n */\n var getDocumentHeight = function () {\n return Math.max(\n document.body.scrollHeight,\n document.documentElement.scrollHeight,\n document.body.offsetHeight,\n document.documentElement.offsetHeight,\n document.body.clientHeight,\n document.documentElement.clientHeight,\n );\n };\n\n /**\n * Determine if an element is in view\n * @param {Node} elem The element\n * @param {Object} settings The settings for this instantiation\n * @param {Boolean} bottom If true, check if element is above bottom of viewport instead\n * @return {Boolean} Returns true if element is in the viewport\n */\n var isInView = function (elem, settings, bottom) {\n var bounds = elem.getBoundingClientRect();\n var offset = getOffset(settings);\n if (bottom) {\n return (\n parseInt(bounds.bottom, 10) <\n (window.innerHeight || document.documentElement.clientHeight)\n );\n }\n return parseInt(bounds.top, 10) <= offset;\n };\n\n /**\n * Check if at the bottom of the viewport\n * @return {Boolean} If true, page is at the bottom of the viewport\n */\n var isAtBottom = function () {\n if (\n Math.ceil(window.innerHeight + window.pageYOffset) >=\n getDocumentHeight()\n )\n return true;\n return false;\n };\n\n /**\n * Check if the last item should be used (even if not at the top of the page)\n * @param {Object} item The last item\n * @param {Object} settings The settings for this instantiation\n * @return {Boolean} If true, use the last item\n */\n var useLastItem = function (item, settings) {\n if (isAtBottom() && isInView(item.content, settings, true)) return true;\n return false;\n };\n\n /**\n * Get the active content\n * @param {Array} contents The content areas\n * @param {Object} settings The settings for this instantiation\n * @return {Object} The content area and matching navigation link\n */\n var getActive = function (contents, settings) {\n var last = contents[contents.length - 1];\n if (useLastItem(last, settings)) return last;\n for (var i = contents.length - 1; i >= 0; i--) {\n if (isInView(contents[i].content, settings)) return contents[i];\n }\n };\n\n /**\n * Deactivate parent navs in a nested navigation\n * @param {Node} nav The starting navigation element\n * @param {Object} settings The settings for this instantiation\n */\n var deactivateNested = function (nav, settings) {\n // If nesting isn't activated, bail\n if (!settings.nested || !nav.parentNode) return;\n\n // Get the parent navigation\n var li = nav.parentNode.closest(\"li\");\n if (!li) return;\n\n // Remove the active class\n li.classList.remove(settings.nestedClass);\n\n // Apply recursively to any parent navigation elements\n deactivateNested(li, settings);\n };\n\n /**\n * Deactivate a nav and content area\n * @param {Object} items The nav item and content to deactivate\n * @param {Object} settings The settings for this instantiation\n */\n var deactivate = function (items, settings) {\n // Make sure there are items to deactivate\n if (!items) return;\n\n // Get the parent list item\n var li = items.nav.closest(\"li\");\n if (!li) return;\n\n // Remove the active class from the nav and content\n li.classList.remove(settings.navClass);\n items.content.classList.remove(settings.contentClass);\n\n // Deactivate any parent navs in a nested navigation\n deactivateNested(li, settings);\n\n // Emit a custom event\n emitEvent(\"gumshoeDeactivate\", li, {\n link: items.nav,\n content: items.content,\n settings: settings,\n });\n };\n\n /**\n * Activate parent navs in a nested navigation\n * @param {Node} nav The starting navigation element\n * @param {Object} settings The settings for this instantiation\n */\n var activateNested = function (nav, settings) {\n // If nesting isn't activated, bail\n if (!settings.nested) return;\n\n // Get the parent navigation\n var li = nav.parentNode.closest(\"li\");\n if (!li) return;\n\n // Add the active class\n li.classList.add(settings.nestedClass);\n\n // Apply recursively to any parent navigation elements\n activateNested(li, settings);\n };\n\n /**\n * Activate a nav and content area\n * @param {Object} items The nav item and content to activate\n * @param {Object} settings The settings for this instantiation\n */\n var activate = function (items, settings) {\n // Make sure there are items to activate\n if (!items) return;\n\n // Get the parent list item\n var li = items.nav.closest(\"li\");\n if (!li) return;\n\n // Add the active class to the nav and content\n li.classList.add(settings.navClass);\n items.content.classList.add(settings.contentClass);\n\n // Activate any parent navs in a nested navigation\n activateNested(li, settings);\n\n // Emit a custom event\n emitEvent(\"gumshoeActivate\", li, {\n link: items.nav,\n content: items.content,\n settings: settings,\n });\n };\n\n /**\n * Create the Constructor object\n * @param {String} selector The selector to use for navigation items\n * @param {Object} options User options and settings\n */\n var Constructor = function (selector, options) {\n //\n // Variables\n //\n\n var publicAPIs = {};\n var navItems, contents, current, timeout, settings;\n\n //\n // Methods\n //\n\n /**\n * Set variables from DOM elements\n */\n publicAPIs.setup = function () {\n // Get all nav items\n navItems = document.querySelectorAll(selector);\n\n // Create contents array\n contents = [];\n\n // Loop through each item, get it's matching content, and push to the array\n Array.prototype.forEach.call(navItems, function (item) {\n // Get the content for the nav item\n var content = document.getElementById(\n decodeURIComponent(item.hash.substr(1)),\n );\n if (!content) return;\n\n // Push to the contents array\n contents.push({\n nav: item,\n content: content,\n });\n });\n\n // Sort contents by the order they appear in the DOM\n sortContents(contents);\n };\n\n /**\n * Detect which content is currently active\n */\n publicAPIs.detect = function () {\n // Get the active content\n var active = getActive(contents, settings);\n\n // if there's no active content, deactivate and bail\n if (!active) {\n if (current) {\n deactivate(current, settings);\n current = null;\n }\n return;\n }\n\n // If the active content is the one currently active, do nothing\n if (current && active.content === current.content) return;\n\n // Deactivate the current content and activate the new content\n deactivate(current, settings);\n activate(active, settings);\n\n // Update the currently active content\n current = active;\n };\n\n /**\n * Detect the active content on scroll\n * Debounced for performance\n */\n var scrollHandler = function (event) {\n // If there's a timer, cancel it\n if (timeout) {\n window.cancelAnimationFrame(timeout);\n }\n\n // Setup debounce callback\n timeout = window.requestAnimationFrame(publicAPIs.detect);\n };\n\n /**\n * Update content sorting on resize\n * Debounced for performance\n */\n var resizeHandler = function (event) {\n // If there's a timer, cancel it\n if (timeout) {\n window.cancelAnimationFrame(timeout);\n }\n\n // Setup debounce callback\n timeout = window.requestAnimationFrame(function () {\n sortContents(contents);\n publicAPIs.detect();\n });\n };\n\n /**\n * Destroy the current instantiation\n */\n publicAPIs.destroy = function () {\n // Undo DOM changes\n if (current) {\n deactivate(current, settings);\n }\n\n // Remove event listeners\n window.removeEventListener(\"scroll\", scrollHandler, false);\n if (settings.reflow) {\n window.removeEventListener(\"resize\", resizeHandler, false);\n }\n\n // Reset variables\n contents = null;\n navItems = null;\n current = null;\n timeout = null;\n settings = null;\n };\n\n /**\n * Initialize the current instantiation\n */\n var init = function () {\n // Merge user options into defaults\n settings = extend(defaults, options || {});\n\n // Setup variables based on the current DOM\n publicAPIs.setup();\n\n // Find the currently active content\n publicAPIs.detect();\n\n // Setup event listeners\n window.addEventListener(\"scroll\", scrollHandler, false);\n if (settings.reflow) {\n window.addEventListener(\"resize\", resizeHandler, false);\n }\n };\n\n //\n // Initialize and return the public APIs\n //\n\n init();\n return publicAPIs;\n };\n\n //\n // Return the Constructor\n //\n\n return Constructor;\n },\n);\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","import Gumshoe from \"./gumshoe-patched.js\";\n\n////////////////////////////////////////////////////////////////////////////////\n// Scroll Handling\n////////////////////////////////////////////////////////////////////////////////\nvar tocScroll = null;\nvar header = null;\nvar lastScrollTop = document.documentElement.scrollTop;\nconst GO_TO_TOP_OFFSET = 64;\n\nfunction scrollHandlerForHeader(positionY) {\n const headerTop = Math.floor(header.getBoundingClientRect().top);\n\n console.log(`headerTop: ${headerTop}`);\n if (headerTop == 0 && positionY != headerTop) {\n header.classList.add(\"scrolled\");\n } else {\n header.classList.remove(\"scrolled\");\n }\n}\n\nfunction scrollHandlerForBackToTop(positionY) {\n if (positionY < GO_TO_TOP_OFFSET) {\n document.documentElement.classList.remove(\"show-back-to-top\");\n } else {\n if (positionY < lastScrollTop) {\n document.documentElement.classList.add(\"show-back-to-top\");\n } else if (positionY > lastScrollTop) {\n document.documentElement.classList.remove(\"show-back-to-top\");\n }\n }\n lastScrollTop = positionY;\n}\n\nfunction scrollHandlerForTOC(positionY) {\n if (tocScroll === null) {\n return;\n }\n\n // top of page.\n if (positionY == 0) {\n tocScroll.scrollTo(0, 0);\n } else if (\n // bottom of page.\n Math.ceil(positionY) >=\n Math.floor(document.documentElement.scrollHeight - window.innerHeight)\n ) {\n tocScroll.scrollTo(0, tocScroll.scrollHeight);\n } else {\n // somewhere in the middle.\n const current = document.querySelector(\".scroll-current\");\n if (current == null) {\n return;\n }\n\n // https://github.com/pypa/pip/issues/9159 This breaks scroll behaviours.\n // // scroll the currently \"active\" heading in toc, into view.\n // const rect = current.getBoundingClientRect();\n // if (0 > rect.top) {\n // current.scrollIntoView(true); // the argument is \"alignTop\"\n // } else if (rect.bottom > window.innerHeight) {\n // current.scrollIntoView(false);\n // }\n }\n}\n\nfunction scrollHandler(positionY) {\n scrollHandlerForHeader(positionY);\n scrollHandlerForBackToTop(positionY);\n scrollHandlerForTOC(positionY);\n}\n\n////////////////////////////////////////////////////////////////////////////////\n// Theme Toggle\n////////////////////////////////////////////////////////////////////////////////\nfunction setTheme(mode) {\n if (mode !== \"light\" && mode !== \"dark\" && mode !== \"auto\") {\n console.error(`Got invalid theme mode: ${mode}. Resetting to auto.`);\n mode = \"auto\";\n }\n\n document.body.dataset.theme = mode;\n localStorage.setItem(\"theme\", mode);\n console.log(`Changed to ${mode} mode.`);\n}\n\nfunction cycleThemeOnce() {\n const currentTheme = localStorage.getItem(\"theme\") || \"auto\";\n const prefersDark = window.matchMedia(\"(prefers-color-scheme: dark)\").matches;\n\n if (prefersDark) {\n // Auto (dark) -> Light -> Dark\n if (currentTheme === \"auto\") {\n setTheme(\"light\");\n } else if (currentTheme == \"light\") {\n setTheme(\"dark\");\n } else {\n setTheme(\"auto\");\n }\n } else {\n // Auto (light) -> Dark -> Light\n if (currentTheme === \"auto\") {\n setTheme(\"dark\");\n } else if (currentTheme == \"dark\") {\n setTheme(\"light\");\n } else {\n setTheme(\"auto\");\n }\n }\n}\n\n////////////////////////////////////////////////////////////////////////////////\n// Setup\n////////////////////////////////////////////////////////////////////////////////\nfunction setupScrollHandler() {\n // Taken from https://developer.mozilla.org/en-US/docs/Web/API/Document/scroll_event\n let last_known_scroll_position = 0;\n let ticking = false;\n\n window.addEventListener(\"scroll\", function (e) {\n last_known_scroll_position = window.scrollY;\n\n if (!ticking) {\n window.requestAnimationFrame(function () {\n scrollHandler(last_known_scroll_position);\n ticking = false;\n });\n\n ticking = true;\n }\n });\n window.scroll();\n}\n\nfunction setupScrollSpy() {\n if (tocScroll === null) {\n return;\n }\n\n // Scrollspy -- highlight table on contents, based on scroll\n new Gumshoe(\".toc-tree a\", {\n reflow: true,\n recursive: true,\n navClass: \"scroll-current\",\n offset: () => {\n let rem = parseFloat(getComputedStyle(document.documentElement).fontSize);\n return header.getBoundingClientRect().height + 2.5 * rem + 1;\n },\n });\n}\n\nfunction setupTheme() {\n // Attach event handlers for toggling themes\n const buttons = document.getElementsByClassName(\"theme-toggle\");\n Array.from(buttons).forEach((btn) => {\n btn.addEventListener(\"click\", cycleThemeOnce);\n });\n}\n\nfunction setup() {\n setupTheme();\n setupScrollHandler();\n setupScrollSpy();\n}\n\n////////////////////////////////////////////////////////////////////////////////\n// Main entrypoint\n////////////////////////////////////////////////////////////////////////////////\nfunction main() {\n document.body.parentNode.classList.remove(\"no-js\");\n\n header = document.querySelector(\"header\");\n tocScroll = document.querySelector(\".toc-scroll\");\n\n setup();\n}\n\ndocument.addEventListener(\"DOMContentLoaded\", main);\n"],"names":["root","g","window","this","defaults","navClass","contentClass","nested","nestedClass","offset","reflow","events","emitEvent","type","elem","detail","settings","event","CustomEvent","bubbles","cancelable","dispatchEvent","getOffsetTop","location","offsetParent","offsetTop","sortContents","contents","sort","item1","item2","content","isInView","bottom","bounds","getBoundingClientRect","parseFloat","getOffset","parseInt","innerHeight","document","documentElement","clientHeight","top","isAtBottom","Math","ceil","pageYOffset","max","body","scrollHeight","offsetHeight","getActive","last","length","item","useLastItem","i","deactivateNested","nav","parentNode","li","closest","classList","remove","deactivate","items","link","activateNested","add","selector","options","navItems","current","timeout","publicAPIs","querySelectorAll","Array","prototype","forEach","call","getElementById","decodeURIComponent","hash","substr","push","active","activate","scrollHandler","cancelAnimationFrame","requestAnimationFrame","detect","resizeHandler","destroy","removeEventListener","merged","arguments","obj","key","hasOwnProperty","extend","setup","addEventListener","factory","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","exports","module","__webpack_modules__","n","getter","__esModule","d","a","definition","o","Object","defineProperty","enumerable","get","globalThis","Function","e","prop","tocScroll","header","lastScrollTop","scrollTop","GO_TO_TOP_OFFSET","cycleThemeOnce","currentTheme","localStorage","getItem","mode","matchMedia","matches","console","error","dataset","theme","setItem","log","buttons","getElementsByClassName","from","btn","setupTheme","last_known_scroll_position","ticking","scrollY","positionY","headerTop","floor","scrollHandlerForHeader","scrollHandlerForBackToTop","scrollTo","querySelector","scrollHandlerForTOC","scroll","setupScrollHandler","recursive","rem","getComputedStyle","fontSize","height"],"sourceRoot":""} \ No newline at end of file diff --git a/_static/searchtools.js b/_static/searchtools.js new file mode 100644 index 00000000..b08d58c9 --- /dev/null +++ b/_static/searchtools.js @@ -0,0 +1,620 @@ +/* + * searchtools.js + * ~~~~~~~~~~~~~~~~ + * + * Sphinx JavaScript utilities for the full-text search. + * + * :copyright: Copyright 2007-2024 by the Sphinx team, see AUTHORS. + * :license: BSD, see LICENSE for details. + * + */ +"use strict"; + +/** + * Simple result scoring code. + */ +if (typeof Scorer === "undefined") { + var Scorer = { + // Implement the following function to further tweak the score for each result + // The function takes a result array [docname, title, anchor, descr, score, filename] + // and returns the new score. + /* + score: result => { + const [docname, title, anchor, descr, score, filename] = result + return score + }, + */ + + // query matches the full name of an object + objNameMatch: 11, + // or matches in the last dotted part of the object name + objPartialMatch: 6, + // Additive scores depending on the priority of the object + objPrio: { + 0: 15, // used to be importantResults + 1: 5, // used to be objectResults + 2: -5, // used to be unimportantResults + }, + // Used when the priority is not in the mapping. + objPrioDefault: 0, + + // query found in title + title: 15, + partialTitle: 7, + // query found in terms + term: 5, + partialTerm: 2, + }; +} + +const _removeChildren = (element) => { + while (element && element.lastChild) element.removeChild(element.lastChild); +}; + +/** + * See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions#escaping + */ +const _escapeRegExp = (string) => + string.replace(/[.*+\-?^${}()|[\]\\]/g, "\\$&"); // $& means the whole matched string + +const _displayItem = (item, searchTerms, highlightTerms) => { + const docBuilder = DOCUMENTATION_OPTIONS.BUILDER; + const docFileSuffix = DOCUMENTATION_OPTIONS.FILE_SUFFIX; + const docLinkSuffix = DOCUMENTATION_OPTIONS.LINK_SUFFIX; + const showSearchSummary = DOCUMENTATION_OPTIONS.SHOW_SEARCH_SUMMARY; + const contentRoot = document.documentElement.dataset.content_root; + + const [docName, title, anchor, descr, score, _filename] = item; + + let listItem = document.createElement("li"); + let requestUrl; + let linkUrl; + if (docBuilder === "dirhtml") { + // dirhtml builder + let dirname = docName + "/"; + if (dirname.match(/\/index\/$/)) + dirname = dirname.substring(0, dirname.length - 6); + else if (dirname === "index/") dirname = ""; + requestUrl = contentRoot + dirname; + linkUrl = requestUrl; + } else { + // normal html builders + requestUrl = contentRoot + docName + docFileSuffix; + linkUrl = docName + docLinkSuffix; + } + let linkEl = listItem.appendChild(document.createElement("a")); + linkEl.href = linkUrl + anchor; + linkEl.dataset.score = score; + linkEl.innerHTML = title; + if (descr) { + listItem.appendChild(document.createElement("span")).innerHTML = + " (" + descr + ")"; + // highlight search terms in the description + if (SPHINX_HIGHLIGHT_ENABLED) // set in sphinx_highlight.js + highlightTerms.forEach((term) => _highlightText(listItem, term, "highlighted")); + } + else if (showSearchSummary) + fetch(requestUrl) + .then((responseData) => responseData.text()) + .then((data) => { + if (data) + listItem.appendChild( + Search.makeSearchSummary(data, searchTerms, anchor) + ); + // highlight search terms in the summary + if (SPHINX_HIGHLIGHT_ENABLED) // set in sphinx_highlight.js + highlightTerms.forEach((term) => _highlightText(listItem, term, "highlighted")); + }); + Search.output.appendChild(listItem); +}; +const _finishSearch = (resultCount) => { + Search.stopPulse(); + Search.title.innerText = _("Search Results"); + if (!resultCount) + Search.status.innerText = Documentation.gettext( + "Your search did not match any documents. Please make sure that all words are spelled correctly and that you've selected enough categories." + ); + else + Search.status.innerText = _( + "Search finished, found ${resultCount} page(s) matching the search query." + ).replace('${resultCount}', resultCount); +}; +const _displayNextItem = ( + results, + resultCount, + searchTerms, + highlightTerms, +) => { + // results left, load the summary and display it + // this is intended to be dynamic (don't sub resultsCount) + if (results.length) { + _displayItem(results.pop(), searchTerms, highlightTerms); + setTimeout( + () => _displayNextItem(results, resultCount, searchTerms, highlightTerms), + 5 + ); + } + // search finished, update title and status message + else _finishSearch(resultCount); +}; +// Helper function used by query() to order search results. +// Each input is an array of [docname, title, anchor, descr, score, filename]. +// Order the results by score (in opposite order of appearance, since the +// `_displayNextItem` function uses pop() to retrieve items) and then alphabetically. +const _orderResultsByScoreThenName = (a, b) => { + const leftScore = a[4]; + const rightScore = b[4]; + if (leftScore === rightScore) { + // same score: sort alphabetically + const leftTitle = a[1].toLowerCase(); + const rightTitle = b[1].toLowerCase(); + if (leftTitle === rightTitle) return 0; + return leftTitle > rightTitle ? -1 : 1; // inverted is intentional + } + return leftScore > rightScore ? 1 : -1; +}; + +/** + * Default splitQuery function. Can be overridden in ``sphinx.search`` with a + * custom function per language. + * + * The regular expression works by splitting the string on consecutive characters + * that are not Unicode letters, numbers, underscores, or emoji characters. + * This is the same as ``\W+`` in Python, preserving the surrogate pair area. + */ +if (typeof splitQuery === "undefined") { + var splitQuery = (query) => query + .split(/[^\p{Letter}\p{Number}_\p{Emoji_Presentation}]+/gu) + .filter(term => term) // remove remaining empty strings +} + +/** + * Search Module + */ +const Search = { + _index: null, + _queued_query: null, + _pulse_status: -1, + + htmlToText: (htmlString, anchor) => { + const htmlElement = new DOMParser().parseFromString(htmlString, 'text/html'); + for (const removalQuery of [".headerlink", "script", "style"]) { + htmlElement.querySelectorAll(removalQuery).forEach((el) => { el.remove() }); + } + if (anchor) { + const anchorContent = htmlElement.querySelector(`[role="main"] ${anchor}`); + if (anchorContent) return anchorContent.textContent; + + console.warn( + `Anchored content block not found. Sphinx search tries to obtain it via DOM query '[role=main] ${anchor}'. Check your theme or template.` + ); + } + + // if anchor not specified or not found, fall back to main content + const docContent = htmlElement.querySelector('[role="main"]'); + if (docContent) return docContent.textContent; + + console.warn( + "Content block not found. Sphinx search tries to obtain it via DOM query '[role=main]'. Check your theme or template." + ); + return ""; + }, + + init: () => { + const query = new URLSearchParams(window.location.search).get("q"); + document + .querySelectorAll('input[name="q"]') + .forEach((el) => (el.value = query)); + if (query) Search.performSearch(query); + }, + + loadIndex: (url) => + (document.body.appendChild(document.createElement("script")).src = url), + + setIndex: (index) => { + Search._index = index; + if (Search._queued_query !== null) { + const query = Search._queued_query; + Search._queued_query = null; + Search.query(query); + } + }, + + hasIndex: () => Search._index !== null, + + deferQuery: (query) => (Search._queued_query = query), + + stopPulse: () => (Search._pulse_status = -1), + + startPulse: () => { + if (Search._pulse_status >= 0) return; + + const pulse = () => { + Search._pulse_status = (Search._pulse_status + 1) % 4; + Search.dots.innerText = ".".repeat(Search._pulse_status); + if (Search._pulse_status >= 0) window.setTimeout(pulse, 500); + }; + pulse(); + }, + + /** + * perform a search for something (or wait until index is loaded) + */ + performSearch: (query) => { + // create the required interface elements + const searchText = document.createElement("h2"); + searchText.textContent = _("Searching"); + const searchSummary = document.createElement("p"); + searchSummary.classList.add("search-summary"); + searchSummary.innerText = ""; + const searchList = document.createElement("ul"); + searchList.classList.add("search"); + + const out = document.getElementById("search-results"); + Search.title = out.appendChild(searchText); + Search.dots = Search.title.appendChild(document.createElement("span")); + Search.status = out.appendChild(searchSummary); + Search.output = out.appendChild(searchList); + + const searchProgress = document.getElementById("search-progress"); + // Some themes don't use the search progress node + if (searchProgress) { + searchProgress.innerText = _("Preparing search..."); + } + Search.startPulse(); + + // index already loaded, the browser was quick! + if (Search.hasIndex()) Search.query(query); + else Search.deferQuery(query); + }, + + _parseQuery: (query) => { + // stem the search terms and add them to the correct list + const stemmer = new Stemmer(); + const searchTerms = new Set(); + const excludedTerms = new Set(); + const highlightTerms = new Set(); + const objectTerms = new Set(splitQuery(query.toLowerCase().trim())); + splitQuery(query.trim()).forEach((queryTerm) => { + const queryTermLower = queryTerm.toLowerCase(); + + // maybe skip this "word" + // stopwords array is from language_data.js + if ( + stopwords.indexOf(queryTermLower) !== -1 || + queryTerm.match(/^\d+$/) + ) + return; + + // stem the word + let word = stemmer.stemWord(queryTermLower); + // select the correct list + if (word[0] === "-") excludedTerms.add(word.substr(1)); + else { + searchTerms.add(word); + highlightTerms.add(queryTermLower); + } + }); + + if (SPHINX_HIGHLIGHT_ENABLED) { // set in sphinx_highlight.js + localStorage.setItem("sphinx_highlight_terms", [...highlightTerms].join(" ")) + } + + // console.debug("SEARCH: searching for:"); + // console.info("required: ", [...searchTerms]); + // console.info("excluded: ", [...excludedTerms]); + + return [query, searchTerms, excludedTerms, highlightTerms, objectTerms]; + }, + + /** + * execute search (requires search index to be loaded) + */ + _performSearch: (query, searchTerms, excludedTerms, highlightTerms, objectTerms) => { + const filenames = Search._index.filenames; + const docNames = Search._index.docnames; + const titles = Search._index.titles; + const allTitles = Search._index.alltitles; + const indexEntries = Search._index.indexentries; + + // Collect multiple result groups to be sorted separately and then ordered. + // Each is an array of [docname, title, anchor, descr, score, filename]. + const normalResults = []; + const nonMainIndexResults = []; + + _removeChildren(document.getElementById("search-progress")); + + const queryLower = query.toLowerCase().trim(); + for (const [title, foundTitles] of Object.entries(allTitles)) { + if (title.toLowerCase().trim().includes(queryLower) && (queryLower.length >= title.length/2)) { + for (const [file, id] of foundTitles) { + const score = Math.round(Scorer.title * queryLower.length / title.length); + const boost = titles[file] === title ? 1 : 0; // add a boost for document titles + normalResults.push([ + docNames[file], + titles[file] !== title ? `${titles[file]} > ${title}` : title, + id !== null ? "#" + id : "", + null, + score + boost, + filenames[file], + ]); + } + } + } + + // search for explicit entries in index directives + for (const [entry, foundEntries] of Object.entries(indexEntries)) { + if (entry.includes(queryLower) && (queryLower.length >= entry.length/2)) { + for (const [file, id, isMain] of foundEntries) { + const score = Math.round(100 * queryLower.length / entry.length); + const result = [ + docNames[file], + titles[file], + id ? "#" + id : "", + null, + score, + filenames[file], + ]; + if (isMain) { + normalResults.push(result); + } else { + nonMainIndexResults.push(result); + } + } + } + } + + // lookup as object + objectTerms.forEach((term) => + normalResults.push(...Search.performObjectSearch(term, objectTerms)) + ); + + // lookup as search terms in fulltext + normalResults.push(...Search.performTermsSearch(searchTerms, excludedTerms)); + + // let the scorer override scores with a custom scoring function + if (Scorer.score) { + normalResults.forEach((item) => (item[4] = Scorer.score(item))); + nonMainIndexResults.forEach((item) => (item[4] = Scorer.score(item))); + } + + // Sort each group of results by score and then alphabetically by name. + normalResults.sort(_orderResultsByScoreThenName); + nonMainIndexResults.sort(_orderResultsByScoreThenName); + + // Combine the result groups in (reverse) order. + // Non-main index entries are typically arbitrary cross-references, + // so display them after other results. + let results = [...nonMainIndexResults, ...normalResults]; + + // remove duplicate search results + // note the reversing of results, so that in the case of duplicates, the highest-scoring entry is kept + let seen = new Set(); + results = results.reverse().reduce((acc, result) => { + let resultStr = result.slice(0, 4).concat([result[5]]).map(v => String(v)).join(','); + if (!seen.has(resultStr)) { + acc.push(result); + seen.add(resultStr); + } + return acc; + }, []); + + return results.reverse(); + }, + + query: (query) => { + const [searchQuery, searchTerms, excludedTerms, highlightTerms, objectTerms] = Search._parseQuery(query); + const results = Search._performSearch(searchQuery, searchTerms, excludedTerms, highlightTerms, objectTerms); + + // for debugging + //Search.lastresults = results.slice(); // a copy + // console.info("search results:", Search.lastresults); + + // print the results + _displayNextItem(results, results.length, searchTerms, highlightTerms); + }, + + /** + * search for object names + */ + performObjectSearch: (object, objectTerms) => { + const filenames = Search._index.filenames; + const docNames = Search._index.docnames; + const objects = Search._index.objects; + const objNames = Search._index.objnames; + const titles = Search._index.titles; + + const results = []; + + const objectSearchCallback = (prefix, match) => { + const name = match[4] + const fullname = (prefix ? prefix + "." : "") + name; + const fullnameLower = fullname.toLowerCase(); + if (fullnameLower.indexOf(object) < 0) return; + + let score = 0; + const parts = fullnameLower.split("."); + + // check for different match types: exact matches of full name or + // "last name" (i.e. last dotted part) + if (fullnameLower === object || parts.slice(-1)[0] === object) + score += Scorer.objNameMatch; + else if (parts.slice(-1)[0].indexOf(object) > -1) + score += Scorer.objPartialMatch; // matches in last name + + const objName = objNames[match[1]][2]; + const title = titles[match[0]]; + + // If more than one term searched for, we require other words to be + // found in the name/title/description + const otherTerms = new Set(objectTerms); + otherTerms.delete(object); + if (otherTerms.size > 0) { + const haystack = `${prefix} ${name} ${objName} ${title}`.toLowerCase(); + if ( + [...otherTerms].some((otherTerm) => haystack.indexOf(otherTerm) < 0) + ) + return; + } + + let anchor = match[3]; + if (anchor === "") anchor = fullname; + else if (anchor === "-") anchor = objNames[match[1]][1] + "-" + fullname; + + const descr = objName + _(", in ") + title; + + // add custom score for some objects according to scorer + if (Scorer.objPrio.hasOwnProperty(match[2])) + score += Scorer.objPrio[match[2]]; + else score += Scorer.objPrioDefault; + + results.push([ + docNames[match[0]], + fullname, + "#" + anchor, + descr, + score, + filenames[match[0]], + ]); + }; + Object.keys(objects).forEach((prefix) => + objects[prefix].forEach((array) => + objectSearchCallback(prefix, array) + ) + ); + return results; + }, + + /** + * search for full-text terms in the index + */ + performTermsSearch: (searchTerms, excludedTerms) => { + // prepare search + const terms = Search._index.terms; + const titleTerms = Search._index.titleterms; + const filenames = Search._index.filenames; + const docNames = Search._index.docnames; + const titles = Search._index.titles; + + const scoreMap = new Map(); + const fileMap = new Map(); + + // perform the search on the required terms + searchTerms.forEach((word) => { + const files = []; + const arr = [ + { files: terms[word], score: Scorer.term }, + { files: titleTerms[word], score: Scorer.title }, + ]; + // add support for partial matches + if (word.length > 2) { + const escapedWord = _escapeRegExp(word); + if (!terms.hasOwnProperty(word)) { + Object.keys(terms).forEach((term) => { + if (term.match(escapedWord)) + arr.push({ files: terms[term], score: Scorer.partialTerm }); + }); + } + if (!titleTerms.hasOwnProperty(word)) { + Object.keys(titleTerms).forEach((term) => { + if (term.match(escapedWord)) + arr.push({ files: titleTerms[term], score: Scorer.partialTitle }); + }); + } + } + + // no match but word was a required one + if (arr.every((record) => record.files === undefined)) return; + + // found search word in contents + arr.forEach((record) => { + if (record.files === undefined) return; + + let recordFiles = record.files; + if (recordFiles.length === undefined) recordFiles = [recordFiles]; + files.push(...recordFiles); + + // set score for the word in each file + recordFiles.forEach((file) => { + if (!scoreMap.has(file)) scoreMap.set(file, {}); + scoreMap.get(file)[word] = record.score; + }); + }); + + // create the mapping + files.forEach((file) => { + if (!fileMap.has(file)) fileMap.set(file, [word]); + else if (fileMap.get(file).indexOf(word) === -1) fileMap.get(file).push(word); + }); + }); + + // now check if the files don't contain excluded terms + const results = []; + for (const [file, wordList] of fileMap) { + // check if all requirements are matched + + // as search terms with length < 3 are discarded + const filteredTermCount = [...searchTerms].filter( + (term) => term.length > 2 + ).length; + if ( + wordList.length !== searchTerms.size && + wordList.length !== filteredTermCount + ) + continue; + + // ensure that none of the excluded terms is in the search result + if ( + [...excludedTerms].some( + (term) => + terms[term] === file || + titleTerms[term] === file || + (terms[term] || []).includes(file) || + (titleTerms[term] || []).includes(file) + ) + ) + break; + + // select one (max) score for the file. + const score = Math.max(...wordList.map((w) => scoreMap.get(file)[w])); + // add result to the result list + results.push([ + docNames[file], + titles[file], + "", + null, + score, + filenames[file], + ]); + } + return results; + }, + + /** + * helper function to return a node containing the + * search summary for a given text. keywords is a list + * of stemmed words. + */ + makeSearchSummary: (htmlText, keywords, anchor) => { + const text = Search.htmlToText(htmlText, anchor); + if (text === "") return null; + + const textLower = text.toLowerCase(); + const actualStartPosition = [...keywords] + .map((k) => textLower.indexOf(k.toLowerCase())) + .filter((i) => i > -1) + .slice(-1)[0]; + const startWithContext = Math.max(actualStartPosition - 120, 0); + + const top = startWithContext === 0 ? "" : "..."; + const tail = startWithContext + 240 < text.length ? "..." : ""; + + let summary = document.createElement("p"); + summary.classList.add("context"); + summary.textContent = top + text.substr(startWithContext, 240).trim() + tail; + + return summary; + }, +}; + +_ready(Search.init); diff --git a/_static/sg_gallery-binder.css b/_static/sg_gallery-binder.css new file mode 100644 index 00000000..420005d2 --- /dev/null +++ b/_static/sg_gallery-binder.css @@ -0,0 +1,11 @@ +/* CSS for binder integration */ + +div.binder-badge { + margin: 1em auto; + vertical-align: middle; +} + +div.lite-badge { + margin: 1em auto; + vertical-align: middle; +} diff --git a/_static/sg_gallery-dataframe.css b/_static/sg_gallery-dataframe.css new file mode 100644 index 00000000..fac74c43 --- /dev/null +++ b/_static/sg_gallery-dataframe.css @@ -0,0 +1,47 @@ +/* Pandas dataframe css */ +/* Taken from: https://github.com/spatialaudio/nbsphinx/blob/fb3ba670fc1ba5f54d4c487573dbc1b4ecf7e9ff/src/nbsphinx.py#L587-L619 */ +html[data-theme="light"] { + --sg-text-color: #000; + --sg-tr-odd-color: #f5f5f5; + --sg-tr-hover-color: rgba(66, 165, 245, 0.2); +} +html[data-theme="dark"] { + --sg-text-color: #fff; + --sg-tr-odd-color: #373737; + --sg-tr-hover-color: rgba(30, 81, 122, 0.2); +} + +table.dataframe { + border: none !important; + border-collapse: collapse; + border-spacing: 0; + border-color: transparent; + color: var(--sg-text-color); + font-size: 12px; + table-layout: fixed; + width: auto; +} +table.dataframe thead { + border-bottom: 1px solid var(--sg-text-color); + vertical-align: bottom; +} +table.dataframe tr, +table.dataframe th, +table.dataframe td { + text-align: right; + vertical-align: middle; + padding: 0.5em 0.5em; + line-height: normal; + white-space: normal; + max-width: none; + border: none; +} +table.dataframe th { + font-weight: bold; +} +table.dataframe tbody tr:nth-child(odd) { + background: var(--sg-tr-odd-color); +} +table.dataframe tbody tr:hover { + background: var(--sg-tr-hover-color); +} diff --git a/_static/sg_gallery-rendered-html.css b/_static/sg_gallery-rendered-html.css new file mode 100644 index 00000000..93dc2ffb --- /dev/null +++ b/_static/sg_gallery-rendered-html.css @@ -0,0 +1,224 @@ +/* Adapted from notebook/static/style/style.min.css */ +html[data-theme="light"] { + --sg-text-color: #000; + --sg-background-color: #ffffff; + --sg-code-background-color: #eff0f1; + --sg-tr-hover-color: rgba(66, 165, 245, 0.2); + --sg-tr-odd-color: #f5f5f5; +} +html[data-theme="dark"] { + --sg-text-color: #fff; + --sg-background-color: #121212; + --sg-code-background-color: #2f2f30; + --sg-tr-hover-color: rgba(66, 165, 245, 0.2); + --sg-tr-odd-color: #1f1f1f; +} + +.rendered_html { + color: var(--sg-text-color); + /* any extras will just be numbers: */ +} +.rendered_html em { + font-style: italic; +} +.rendered_html strong { + font-weight: bold; +} +.rendered_html u { + text-decoration: underline; +} +.rendered_html :link { + text-decoration: underline; +} +.rendered_html :visited { + text-decoration: underline; +} +.rendered_html h1 { + font-size: 185.7%; + margin: 1.08em 0 0 0; + font-weight: bold; + line-height: 1.0; +} +.rendered_html h2 { + font-size: 157.1%; + margin: 1.27em 0 0 0; + font-weight: bold; + line-height: 1.0; +} +.rendered_html h3 { + font-size: 128.6%; + margin: 1.55em 0 0 0; + font-weight: bold; + line-height: 1.0; +} +.rendered_html h4 { + font-size: 100%; + margin: 2em 0 0 0; + font-weight: bold; + line-height: 1.0; +} +.rendered_html h5 { + font-size: 100%; + margin: 2em 0 0 0; + font-weight: bold; + line-height: 1.0; + font-style: italic; +} +.rendered_html h6 { + font-size: 100%; + margin: 2em 0 0 0; + font-weight: bold; + line-height: 1.0; + font-style: italic; +} +.rendered_html h1:first-child { + margin-top: 0.538em; +} +.rendered_html h2:first-child { + margin-top: 0.636em; +} +.rendered_html h3:first-child { + margin-top: 0.777em; +} +.rendered_html h4:first-child { + margin-top: 1em; +} +.rendered_html h5:first-child { + margin-top: 1em; +} +.rendered_html h6:first-child { + margin-top: 1em; +} +.rendered_html ul:not(.list-inline), +.rendered_html ol:not(.list-inline) { + padding-left: 2em; +} +.rendered_html ul { + list-style: disc; +} +.rendered_html ul ul { + list-style: square; + margin-top: 0; +} +.rendered_html ul ul ul { + list-style: circle; +} +.rendered_html ol { + list-style: decimal; +} +.rendered_html ol ol { + list-style: upper-alpha; + margin-top: 0; +} +.rendered_html ol ol ol { + list-style: lower-alpha; +} +.rendered_html ol ol ol ol { + list-style: lower-roman; +} +.rendered_html ol ol ol ol ol { + list-style: decimal; +} +.rendered_html * + ul { + margin-top: 1em; +} +.rendered_html * + ol { + margin-top: 1em; +} +.rendered_html hr { + color: var(--sg-text-color); + background-color: var(--sg-text-color); +} +.rendered_html pre { + margin: 1em 2em; + padding: 0px; + background-color: var(--sg-background-color); +} +.rendered_html code { + background-color: var(--sg-code-background-color); +} +.rendered_html p code { + padding: 1px 5px; +} +.rendered_html pre code { + background-color: var(--sg-background-color); +} +.rendered_html pre, +.rendered_html code { + border: 0; + color: var(--sg-text-color); + font-size: 100%; +} +.rendered_html blockquote { + margin: 1em 2em; +} +.rendered_html table { + margin-left: auto; + margin-right: auto; + border: none; + border-collapse: collapse; + border-spacing: 0; + color: var(--sg-text-color); + font-size: 12px; + table-layout: fixed; +} +.rendered_html thead { + border-bottom: 1px solid var(--sg-text-color); + vertical-align: bottom; +} +.rendered_html tr, +.rendered_html th, +.rendered_html td { + text-align: right; + vertical-align: middle; + padding: 0.5em 0.5em; + line-height: normal; + white-space: normal; + max-width: none; + border: none; +} +.rendered_html th { + font-weight: bold; +} +.rendered_html tbody tr:nth-child(odd) { + background: var(--sg-tr-odd-color); +} +.rendered_html tbody tr:hover { + color: var(--sg-text-color); + background: var(--sg-tr-hover-color); +} +.rendered_html * + table { + margin-top: 1em; +} +.rendered_html p { + text-align: left; +} +.rendered_html * + p { + margin-top: 1em; +} +.rendered_html img { + display: block; + margin-left: auto; + margin-right: auto; +} +.rendered_html * + img { + margin-top: 1em; +} +.rendered_html img, +.rendered_html svg { + max-width: 100%; + height: auto; +} +.rendered_html img.unconfined, +.rendered_html svg.unconfined { + max-width: none; +} +.rendered_html .alert { + margin-bottom: initial; +} +.rendered_html * + .alert { + margin-top: 1em; +} +[dir="rtl"] .rendered_html p { + text-align: right; +} diff --git a/_static/sg_gallery.css b/_static/sg_gallery.css new file mode 100644 index 00000000..9bcd33c8 --- /dev/null +++ b/_static/sg_gallery.css @@ -0,0 +1,367 @@ +/* +Sphinx-Gallery has compatible CSS to fix default sphinx themes +Tested for Sphinx 1.3.1 for all themes: default, alabaster, sphinxdoc, +scrolls, agogo, traditional, nature, haiku, pyramid +Tested for Read the Docs theme 0.1.7 */ + +/* Define light colors */ +:root, html[data-theme="light"], body[data-theme="light"]{ + --sg-tooltip-foreground: black; + --sg-tooltip-background: rgba(250, 250, 250, 0.9); + --sg-tooltip-border: #ccc transparent; + --sg-thumb-box-shadow-color: #6c757d40; + --sg-thumb-hover-border: #0069d9; + --sg-script-out: #888; + --sg-script-pre: #fafae2; + --sg-pytb-foreground: #000; + --sg-pytb-background: #ffe4e4; + --sg-pytb-border-color: #f66; + --sg-download-a-background-color: #ffc; + --sg-download-a-background-image: linear-gradient(to bottom, #ffc, #d5d57e); + --sg-download-a-border-color: 1px solid #c2c22d; + --sg-download-a-color: #000; + --sg-download-a-hover-background-color: #d5d57e; + --sg-download-a-hover-box-shadow-1: rgba(255, 255, 255, 0.1); + --sg-download-a-hover-box-shadow-2: rgba(0, 0, 0, 0.25); +} +@media(prefers-color-scheme: light) { + :root[data-theme="auto"], html[data-theme="auto"], body[data-theme="auto"] { + --sg-tooltip-foreground: black; + --sg-tooltip-background: rgba(250, 250, 250, 0.9); + --sg-tooltip-border: #ccc transparent; + --sg-thumb-box-shadow-color: #6c757d40; + --sg-thumb-hover-border: #0069d9; + --sg-script-out: #888; + --sg-script-pre: #fafae2; + --sg-pytb-foreground: #000; + --sg-pytb-background: #ffe4e4; + --sg-pytb-border-color: #f66; + --sg-download-a-background-color: #ffc; + --sg-download-a-background-image: linear-gradient(to bottom, #ffc, #d5d57e); + --sg-download-a-border-color: 1px solid #c2c22d; + --sg-download-a-color: #000; + --sg-download-a-hover-background-color: #d5d57e; + --sg-download-a-hover-box-shadow-1: rgba(255, 255, 255, 0.1); + --sg-download-a-hover-box-shadow-2: rgba(0, 0, 0, 0.25); + } +} + +html[data-theme="dark"], body[data-theme="dark"] { + --sg-tooltip-foreground: white; + --sg-tooltip-background: rgba(10, 10, 10, 0.9); + --sg-tooltip-border: #333 transparent; + --sg-thumb-box-shadow-color: #79848d40; + --sg-thumb-hover-border: #003975; + --sg-script-out: rgb(179, 179, 179); + --sg-script-pre: #2e2e22; + --sg-pytb-foreground: #fff; + --sg-pytb-background: #1b1717; + --sg-pytb-border-color: #622; + --sg-download-a-background-color: #443; + --sg-download-a-background-image: linear-gradient(to bottom, #443, #221); + --sg-download-a-border-color: 1px solid #3a3a0d; + --sg-download-a-color: #fff; + --sg-download-a-hover-background-color: #616135; + --sg-download-a-hover-box-shadow-1: rgba(0, 0, 0, 0.1); + --sg-download-a-hover-box-shadow-2: rgba(255, 255, 255, 0.25); +} +@media(prefers-color-scheme: dark){ + html[data-theme="auto"], body[data-theme="auto"] { + --sg-tooltip-foreground: white; + --sg-tooltip-background: rgba(10, 10, 10, 0.9); + --sg-tooltip-border: #333 transparent; + --sg-thumb-box-shadow-color: #79848d40; + --sg-thumb-hover-border: #003975; + --sg-script-out: rgb(179, 179, 179); + --sg-script-pre: #2e2e22; + --sg-pytb-foreground: #fff; + --sg-pytb-background: #1b1717; + --sg-pytb-border-color: #622; + --sg-download-a-background-color: #443; + --sg-download-a-background-image: linear-gradient(to bottom, #443, #221); + --sg-download-a-border-color: 1px solid #3a3a0d; + --sg-download-a-color: #fff; + --sg-download-a-hover-background-color: #616135; + --sg-download-a-hover-box-shadow-1: rgba(0, 0, 0, 0.1); + --sg-download-a-hover-box-shadow-2: rgba(255, 255, 255, 0.25); + } +} + +.sphx-glr-thumbnails { + width: 100%; + margin: 0px 0px 20px 0px; + + /* align thumbnails on a grid */ + justify-content: space-between; + display: grid; + /* each grid column should be at least 160px (this will determine + the actual number of columns) and then take as much of the + remaining width as possible */ + grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); + gap: 15px; +} +.sphx-glr-thumbnails .toctree-wrapper { + /* hide empty toctree divs added to the DOM + by sphinx even though the toctree is hidden + (they would fill grid places with empty divs) */ + display: none; +} +.sphx-glr-thumbcontainer { + background: transparent; + -moz-border-radius: 5px; + -webkit-border-radius: 5px; + border-radius: 5px; + box-shadow: 0 0 10px var(--sg-thumb-box-shadow-color); + + /* useful to absolutely position link in div */ + position: relative; + + /* thumbnail width should include padding and borders + and take all available space */ + box-sizing: border-box; + width: 100%; + padding: 10px; + border: 1px solid transparent; + + /* align content in thumbnail */ + display: flex; + flex-direction: column; + align-items: center; + gap: 7px; +} +.sphx-glr-thumbcontainer p { + position: absolute; + top: 0; + left: 0; +} +.sphx-glr-thumbcontainer p, +.sphx-glr-thumbcontainer p a { + /* link should cover the whole thumbnail div */ + width: 100%; + height: 100%; +} +.sphx-glr-thumbcontainer p a span { + /* text within link should be masked + (we are just interested in the href) */ + display: none; +} +.sphx-glr-thumbcontainer:hover { + border: 1px solid; + border-color: var(--sg-thumb-hover-border); + cursor: pointer; +} +.sphx-glr-thumbcontainer a.internal { + bottom: 0; + display: block; + left: 0; + box-sizing: border-box; + padding: 150px 10px 0; + position: absolute; + right: 0; + top: 0; +} +/* Next one is to avoid Sphinx traditional theme to cover all the +thumbnail with its default link Background color */ +.sphx-glr-thumbcontainer a.internal:hover { + background-color: transparent; +} + +.sphx-glr-thumbcontainer p { + margin: 0 0 0.1em 0; +} +.sphx-glr-thumbcontainer .figure { + margin: 10px; + width: 160px; +} +.sphx-glr-thumbcontainer img { + display: inline; + max-height: 112px; + max-width: 160px; +} + +.sphx-glr-thumbcontainer[tooltip]::before { + content: ""; + position: absolute; + pointer-events: none; + top: 0; + left: 0; + width: 100%; + height: 100%; + z-index: 97; + background-color: var(--sg-tooltip-background); + backdrop-filter: blur(3px); + opacity: 0; + transition: opacity 0.3s; +} + +.sphx-glr-thumbcontainer[tooltip]:hover::before { + opacity: 1; +} + +.sphx-glr-thumbcontainer[tooltip]:hover::after { + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; + color: var(--sg-tooltip-foreground); + content: attr(tooltip); + padding: 10px 10px 5px; + z-index: 98; + width: 100%; + max-height: 100%; + position: absolute; + pointer-events: none; + top: 0; + box-sizing: border-box; + overflow: hidden; + display: -webkit-box; + -webkit-box-orient: vertical; + -webkit-line-clamp: 6; +} + +.sphx-glr-script-out { + color: var(--sg-script-out); + display: flex; + gap: 0.5em; +} +.sphx-glr-script-out::before { + content: "Out:"; + /* These numbers come from the pre style in the pydata sphinx theme. This + * turns out to match perfectly on the rtd theme, but be a bit too low for + * the pydata sphinx theme. As I could not find a dimension to use that was + * scaled the same way, I just picked one option that worked pretty close for + * both. */ + line-height: 1.4; + padding-top: 10px; +} +.sphx-glr-script-out .highlight { + background-color: transparent; + /* These options make the div expand... */ + flex-grow: 1; + /* ... but also keep it from overflowing its flex container. */ + overflow: auto; +} +.sphx-glr-script-out .highlight pre { + background-color: var(--sg-script-pre); + border: 0; + max-height: 30em; + overflow: auto; + padding-left: 1ex; + /* This margin is necessary in the pydata sphinx theme because pre has a box + * shadow which would be clipped by the overflow:auto in the parent div + * above. */ + margin: 2px; + word-break: break-word; +} +.sphx-glr-script-out + p { + margin-top: 1.8em; +} +blockquote.sphx-glr-script-out { + margin-left: 0pt; +} +.sphx-glr-script-out.highlight-pytb .highlight pre { + color: var(--sg-pytb-foreground); + background-color: var(--sg-pytb-background); + border: 1px solid var(--sg-pytb-border-color); + margin-top: 10px; + padding: 7px; +} + +div.sphx-glr-footer { + text-align: center; +} + +div.sphx-glr-download { + margin: 1em auto; + vertical-align: middle; +} + +div.sphx-glr-download a { + background-color: var(--sg-download-a-background-color); + background-image: var(--sg-download-a-background-image); + border-radius: 4px; + border: 1px solid var(--sg-download-a-border-color); + color: var(--sg-download-a-color); + display: inline-block; + font-weight: bold; + padding: 1ex; + text-align: center; +} + +div.sphx-glr-download code.download { + display: inline-block; + white-space: normal; + word-break: normal; + overflow-wrap: break-word; + /* border and background are given by the enclosing 'a' */ + border: none; + background: none; +} + +div.sphx-glr-download a:hover { + box-shadow: inset 0 1px 0 var(--sg-download-a-hover-box-shadow-1), 0 1px 5px var(--sg-download-a-hover-box-shadow-2); + text-decoration: none; + background-image: none; + background-color: var(--sg-download-a-hover-background-color); +} + +div.sphx-glr-sidebar-item img { + max-height: 20px; +} + +.sphx-glr-example-title:target::before { + display: block; + content: ""; + margin-top: -50px; + height: 50px; + visibility: hidden; +} + +ul.sphx-glr-horizontal { + list-style: none; + padding: 0; +} +ul.sphx-glr-horizontal li { + display: inline; +} +ul.sphx-glr-horizontal img { + height: auto !important; +} + +.sphx-glr-single-img { + margin: auto; + display: block; + max-width: 100%; +} + +.sphx-glr-multi-img { + max-width: 42%; + height: auto; +} + +div.sphx-glr-animation { + margin: auto; + display: block; + max-width: 100%; +} +div.sphx-glr-animation .animation { + display: block; +} + +p.sphx-glr-signature a.reference.external { + -moz-border-radius: 5px; + -webkit-border-radius: 5px; + border-radius: 5px; + padding: 3px; + font-size: 75%; + text-align: right; + margin-left: auto; + display: table; +} + +.sphx-glr-clear { + clear: both; +} + +a.sphx-glr-backref-instance { + text-decoration: none; +} diff --git a/_static/skeleton.css b/_static/skeleton.css new file mode 100644 index 00000000..467c878c --- /dev/null +++ b/_static/skeleton.css @@ -0,0 +1,296 @@ +/* Some sane resets. */ +html { + height: 100%; +} + +body { + margin: 0; + min-height: 100%; +} + +/* All the flexbox magic! */ +body, +.sb-announcement, +.sb-content, +.sb-main, +.sb-container, +.sb-container__inner, +.sb-article-container, +.sb-footer-content, +.sb-header, +.sb-header-secondary, +.sb-footer { + display: flex; +} + +/* These order things vertically */ +body, +.sb-main, +.sb-article-container { + flex-direction: column; +} + +/* Put elements in the center */ +.sb-header, +.sb-header-secondary, +.sb-container, +.sb-content, +.sb-footer, +.sb-footer-content { + justify-content: center; +} +/* Put elements at the ends */ +.sb-article-container { + justify-content: space-between; +} + +/* These elements grow. */ +.sb-main, +.sb-content, +.sb-container, +article { + flex-grow: 1; +} + +/* Because padding making this wider is not fun */ +article { + box-sizing: border-box; +} + +/* The announcements element should never be wider than the page. */ +.sb-announcement { + max-width: 100%; +} + +.sb-sidebar-primary, +.sb-sidebar-secondary { + flex-shrink: 0; + width: 17rem; +} + +.sb-announcement__inner { + justify-content: center; + + box-sizing: border-box; + height: 3rem; + + overflow-x: auto; + white-space: nowrap; +} + +/* Sidebars, with checkbox-based toggle */ +.sb-sidebar-primary, +.sb-sidebar-secondary { + position: fixed; + height: 100%; + top: 0; +} + +.sb-sidebar-primary { + left: -17rem; + transition: left 250ms ease-in-out; +} +.sb-sidebar-secondary { + right: -17rem; + transition: right 250ms ease-in-out; +} + +.sb-sidebar-toggle { + display: none; +} +.sb-sidebar-overlay { + position: fixed; + top: 0; + width: 0; + height: 0; + + transition: width 0ms ease 250ms, height 0ms ease 250ms, opacity 250ms ease; + + opacity: 0; + background-color: rgba(0, 0, 0, 0.54); +} + +#sb-sidebar-toggle--primary:checked + ~ .sb-sidebar-overlay[for="sb-sidebar-toggle--primary"], +#sb-sidebar-toggle--secondary:checked + ~ .sb-sidebar-overlay[for="sb-sidebar-toggle--secondary"] { + width: 100%; + height: 100%; + opacity: 1; + transition: width 0ms ease, height 0ms ease, opacity 250ms ease; +} + +#sb-sidebar-toggle--primary:checked ~ .sb-container .sb-sidebar-primary { + left: 0; +} +#sb-sidebar-toggle--secondary:checked ~ .sb-container .sb-sidebar-secondary { + right: 0; +} + +/* Full-width mode */ +.drop-secondary-sidebar-for-full-width-content + .hide-when-secondary-sidebar-shown { + display: none !important; +} +.drop-secondary-sidebar-for-full-width-content .sb-sidebar-secondary { + display: none !important; +} + +/* Mobile views */ +.sb-page-width { + width: 100%; +} + +.sb-article-container, +.sb-footer-content__inner, +.drop-secondary-sidebar-for-full-width-content .sb-article, +.drop-secondary-sidebar-for-full-width-content .match-content-width { + width: 100vw; +} + +.sb-article, +.match-content-width { + padding: 0 1rem; + box-sizing: border-box; +} + +@media (min-width: 32rem) { + .sb-article, + .match-content-width { + padding: 0 2rem; + } +} + +/* Tablet views */ +@media (min-width: 42rem) { + .sb-article-container { + width: auto; + } + .sb-footer-content__inner, + .drop-secondary-sidebar-for-full-width-content .sb-article, + .drop-secondary-sidebar-for-full-width-content .match-content-width { + width: 42rem; + } + .sb-article, + .match-content-width { + width: 42rem; + } +} +@media (min-width: 46rem) { + .sb-footer-content__inner, + .drop-secondary-sidebar-for-full-width-content .sb-article, + .drop-secondary-sidebar-for-full-width-content .match-content-width { + width: 46rem; + } + .sb-article, + .match-content-width { + width: 46rem; + } +} +@media (min-width: 50rem) { + .sb-footer-content__inner, + .drop-secondary-sidebar-for-full-width-content .sb-article, + .drop-secondary-sidebar-for-full-width-content .match-content-width { + width: 50rem; + } + .sb-article, + .match-content-width { + width: 50rem; + } +} + +/* Tablet views */ +@media (min-width: 59rem) { + .sb-sidebar-secondary { + position: static; + } + .hide-when-secondary-sidebar-shown { + display: none !important; + } + .sb-footer-content__inner, + .drop-secondary-sidebar-for-full-width-content .sb-article, + .drop-secondary-sidebar-for-full-width-content .match-content-width { + width: 59rem; + } + .sb-article, + .match-content-width { + width: 42rem; + } +} +@media (min-width: 63rem) { + .sb-footer-content__inner, + .drop-secondary-sidebar-for-full-width-content .sb-article, + .drop-secondary-sidebar-for-full-width-content .match-content-width { + width: 63rem; + } + .sb-article, + .match-content-width { + width: 46rem; + } +} +@media (min-width: 67rem) { + .sb-footer-content__inner, + .drop-secondary-sidebar-for-full-width-content .sb-article, + .drop-secondary-sidebar-for-full-width-content .match-content-width { + width: 67rem; + } + .sb-article, + .match-content-width { + width: 50rem; + } +} + +/* Desktop views */ +@media (min-width: 76rem) { + .sb-sidebar-primary { + position: static; + } + .hide-when-primary-sidebar-shown { + display: none !important; + } + .sb-footer-content__inner, + .drop-secondary-sidebar-for-full-width-content .sb-article, + .drop-secondary-sidebar-for-full-width-content .match-content-width { + width: 59rem; + } + .sb-article, + .match-content-width { + width: 42rem; + } +} + +/* Full desktop views */ +@media (min-width: 80rem) { + .sb-article, + .match-content-width { + width: 46rem; + } + .sb-footer-content__inner, + .drop-secondary-sidebar-for-full-width-content .sb-article, + .drop-secondary-sidebar-for-full-width-content .match-content-width { + width: 63rem; + } +} + +@media (min-width: 84rem) { + .sb-article, + .match-content-width { + width: 50rem; + } + .sb-footer-content__inner, + .drop-secondary-sidebar-for-full-width-content .sb-article, + .drop-secondary-sidebar-for-full-width-content .match-content-width { + width: 67rem; + } +} + +@media (min-width: 88rem) { + .sb-footer-content__inner, + .drop-secondary-sidebar-for-full-width-content .sb-article, + .drop-secondary-sidebar-for-full-width-content .match-content-width { + width: 67rem; + } + .sb-page-width { + width: 88rem; + } +} diff --git a/_static/sphinx-design.min.css b/_static/sphinx-design.min.css new file mode 100644 index 00000000..860c36da --- /dev/null +++ b/_static/sphinx-design.min.css @@ -0,0 +1 @@ +.sd-bg-primary{background-color:var(--sd-color-primary) !important}.sd-bg-text-primary{color:var(--sd-color-primary-text) !important}button.sd-bg-primary:focus,button.sd-bg-primary:hover{background-color:var(--sd-color-primary-highlight) !important}a.sd-bg-primary:focus,a.sd-bg-primary:hover{background-color:var(--sd-color-primary-highlight) !important}.sd-bg-secondary{background-color:var(--sd-color-secondary) !important}.sd-bg-text-secondary{color:var(--sd-color-secondary-text) !important}button.sd-bg-secondary:focus,button.sd-bg-secondary:hover{background-color:var(--sd-color-secondary-highlight) !important}a.sd-bg-secondary:focus,a.sd-bg-secondary:hover{background-color:var(--sd-color-secondary-highlight) !important}.sd-bg-success{background-color:var(--sd-color-success) !important}.sd-bg-text-success{color:var(--sd-color-success-text) !important}button.sd-bg-success:focus,button.sd-bg-success:hover{background-color:var(--sd-color-success-highlight) !important}a.sd-bg-success:focus,a.sd-bg-success:hover{background-color:var(--sd-color-success-highlight) !important}.sd-bg-info{background-color:var(--sd-color-info) !important}.sd-bg-text-info{color:var(--sd-color-info-text) !important}button.sd-bg-info:focus,button.sd-bg-info:hover{background-color:var(--sd-color-info-highlight) !important}a.sd-bg-info:focus,a.sd-bg-info:hover{background-color:var(--sd-color-info-highlight) !important}.sd-bg-warning{background-color:var(--sd-color-warning) !important}.sd-bg-text-warning{color:var(--sd-color-warning-text) !important}button.sd-bg-warning:focus,button.sd-bg-warning:hover{background-color:var(--sd-color-warning-highlight) !important}a.sd-bg-warning:focus,a.sd-bg-warning:hover{background-color:var(--sd-color-warning-highlight) !important}.sd-bg-danger{background-color:var(--sd-color-danger) !important}.sd-bg-text-danger{color:var(--sd-color-danger-text) !important}button.sd-bg-danger:focus,button.sd-bg-danger:hover{background-color:var(--sd-color-danger-highlight) !important}a.sd-bg-danger:focus,a.sd-bg-danger:hover{background-color:var(--sd-color-danger-highlight) !important}.sd-bg-light{background-color:var(--sd-color-light) !important}.sd-bg-text-light{color:var(--sd-color-light-text) !important}button.sd-bg-light:focus,button.sd-bg-light:hover{background-color:var(--sd-color-light-highlight) !important}a.sd-bg-light:focus,a.sd-bg-light:hover{background-color:var(--sd-color-light-highlight) !important}.sd-bg-muted{background-color:var(--sd-color-muted) !important}.sd-bg-text-muted{color:var(--sd-color-muted-text) !important}button.sd-bg-muted:focus,button.sd-bg-muted:hover{background-color:var(--sd-color-muted-highlight) !important}a.sd-bg-muted:focus,a.sd-bg-muted:hover{background-color:var(--sd-color-muted-highlight) !important}.sd-bg-dark{background-color:var(--sd-color-dark) !important}.sd-bg-text-dark{color:var(--sd-color-dark-text) !important}button.sd-bg-dark:focus,button.sd-bg-dark:hover{background-color:var(--sd-color-dark-highlight) !important}a.sd-bg-dark:focus,a.sd-bg-dark:hover{background-color:var(--sd-color-dark-highlight) !important}.sd-bg-black{background-color:var(--sd-color-black) !important}.sd-bg-text-black{color:var(--sd-color-black-text) !important}button.sd-bg-black:focus,button.sd-bg-black:hover{background-color:var(--sd-color-black-highlight) !important}a.sd-bg-black:focus,a.sd-bg-black:hover{background-color:var(--sd-color-black-highlight) !important}.sd-bg-white{background-color:var(--sd-color-white) !important}.sd-bg-text-white{color:var(--sd-color-white-text) !important}button.sd-bg-white:focus,button.sd-bg-white:hover{background-color:var(--sd-color-white-highlight) !important}a.sd-bg-white:focus,a.sd-bg-white:hover{background-color:var(--sd-color-white-highlight) !important}.sd-text-primary,.sd-text-primary>p{color:var(--sd-color-primary) !important}a.sd-text-primary:focus,a.sd-text-primary:hover{color:var(--sd-color-primary-highlight) !important}.sd-text-secondary,.sd-text-secondary>p{color:var(--sd-color-secondary) !important}a.sd-text-secondary:focus,a.sd-text-secondary:hover{color:var(--sd-color-secondary-highlight) !important}.sd-text-success,.sd-text-success>p{color:var(--sd-color-success) !important}a.sd-text-success:focus,a.sd-text-success:hover{color:var(--sd-color-success-highlight) !important}.sd-text-info,.sd-text-info>p{color:var(--sd-color-info) !important}a.sd-text-info:focus,a.sd-text-info:hover{color:var(--sd-color-info-highlight) !important}.sd-text-warning,.sd-text-warning>p{color:var(--sd-color-warning) !important}a.sd-text-warning:focus,a.sd-text-warning:hover{color:var(--sd-color-warning-highlight) !important}.sd-text-danger,.sd-text-danger>p{color:var(--sd-color-danger) !important}a.sd-text-danger:focus,a.sd-text-danger:hover{color:var(--sd-color-danger-highlight) !important}.sd-text-light,.sd-text-light>p{color:var(--sd-color-light) !important}a.sd-text-light:focus,a.sd-text-light:hover{color:var(--sd-color-light-highlight) !important}.sd-text-muted,.sd-text-muted>p{color:var(--sd-color-muted) !important}a.sd-text-muted:focus,a.sd-text-muted:hover{color:var(--sd-color-muted-highlight) !important}.sd-text-dark,.sd-text-dark>p{color:var(--sd-color-dark) !important}a.sd-text-dark:focus,a.sd-text-dark:hover{color:var(--sd-color-dark-highlight) !important}.sd-text-black,.sd-text-black>p{color:var(--sd-color-black) !important}a.sd-text-black:focus,a.sd-text-black:hover{color:var(--sd-color-black-highlight) !important}.sd-text-white,.sd-text-white>p{color:var(--sd-color-white) !important}a.sd-text-white:focus,a.sd-text-white:hover{color:var(--sd-color-white-highlight) !important}.sd-outline-primary{border-color:var(--sd-color-primary) !important;border-style:solid !important;border-width:1px !important}a.sd-outline-primary:focus,a.sd-outline-primary:hover{border-color:var(--sd-color-primary-highlight) !important}.sd-outline-secondary{border-color:var(--sd-color-secondary) !important;border-style:solid !important;border-width:1px !important}a.sd-outline-secondary:focus,a.sd-outline-secondary:hover{border-color:var(--sd-color-secondary-highlight) !important}.sd-outline-success{border-color:var(--sd-color-success) !important;border-style:solid !important;border-width:1px !important}a.sd-outline-success:focus,a.sd-outline-success:hover{border-color:var(--sd-color-success-highlight) !important}.sd-outline-info{border-color:var(--sd-color-info) !important;border-style:solid !important;border-width:1px !important}a.sd-outline-info:focus,a.sd-outline-info:hover{border-color:var(--sd-color-info-highlight) !important}.sd-outline-warning{border-color:var(--sd-color-warning) !important;border-style:solid !important;border-width:1px !important}a.sd-outline-warning:focus,a.sd-outline-warning:hover{border-color:var(--sd-color-warning-highlight) !important}.sd-outline-danger{border-color:var(--sd-color-danger) !important;border-style:solid !important;border-width:1px !important}a.sd-outline-danger:focus,a.sd-outline-danger:hover{border-color:var(--sd-color-danger-highlight) !important}.sd-outline-light{border-color:var(--sd-color-light) !important;border-style:solid !important;border-width:1px !important}a.sd-outline-light:focus,a.sd-outline-light:hover{border-color:var(--sd-color-light-highlight) !important}.sd-outline-muted{border-color:var(--sd-color-muted) !important;border-style:solid !important;border-width:1px !important}a.sd-outline-muted:focus,a.sd-outline-muted:hover{border-color:var(--sd-color-muted-highlight) !important}.sd-outline-dark{border-color:var(--sd-color-dark) !important;border-style:solid !important;border-width:1px !important}a.sd-outline-dark:focus,a.sd-outline-dark:hover{border-color:var(--sd-color-dark-highlight) !important}.sd-outline-black{border-color:var(--sd-color-black) !important;border-style:solid !important;border-width:1px !important}a.sd-outline-black:focus,a.sd-outline-black:hover{border-color:var(--sd-color-black-highlight) !important}.sd-outline-white{border-color:var(--sd-color-white) !important;border-style:solid !important;border-width:1px !important}a.sd-outline-white:focus,a.sd-outline-white:hover{border-color:var(--sd-color-white-highlight) !important}.sd-bg-transparent{background-color:transparent !important}.sd-outline-transparent{border-color:transparent !important}.sd-text-transparent{color:transparent !important}.sd-p-0{padding:0 !important}.sd-pt-0,.sd-py-0{padding-top:0 !important}.sd-pr-0,.sd-px-0{padding-right:0 !important}.sd-pb-0,.sd-py-0{padding-bottom:0 !important}.sd-pl-0,.sd-px-0{padding-left:0 !important}.sd-p-1{padding:.25rem !important}.sd-pt-1,.sd-py-1{padding-top:.25rem !important}.sd-pr-1,.sd-px-1{padding-right:.25rem !important}.sd-pb-1,.sd-py-1{padding-bottom:.25rem !important}.sd-pl-1,.sd-px-1{padding-left:.25rem !important}.sd-p-2{padding:.5rem !important}.sd-pt-2,.sd-py-2{padding-top:.5rem !important}.sd-pr-2,.sd-px-2{padding-right:.5rem !important}.sd-pb-2,.sd-py-2{padding-bottom:.5rem !important}.sd-pl-2,.sd-px-2{padding-left:.5rem !important}.sd-p-3{padding:1rem !important}.sd-pt-3,.sd-py-3{padding-top:1rem !important}.sd-pr-3,.sd-px-3{padding-right:1rem !important}.sd-pb-3,.sd-py-3{padding-bottom:1rem !important}.sd-pl-3,.sd-px-3{padding-left:1rem !important}.sd-p-4{padding:1.5rem !important}.sd-pt-4,.sd-py-4{padding-top:1.5rem !important}.sd-pr-4,.sd-px-4{padding-right:1.5rem !important}.sd-pb-4,.sd-py-4{padding-bottom:1.5rem !important}.sd-pl-4,.sd-px-4{padding-left:1.5rem !important}.sd-p-5{padding:3rem !important}.sd-pt-5,.sd-py-5{padding-top:3rem !important}.sd-pr-5,.sd-px-5{padding-right:3rem !important}.sd-pb-5,.sd-py-5{padding-bottom:3rem !important}.sd-pl-5,.sd-px-5{padding-left:3rem !important}.sd-m-auto{margin:auto !important}.sd-mt-auto,.sd-my-auto{margin-top:auto !important}.sd-mr-auto,.sd-mx-auto{margin-right:auto !important}.sd-mb-auto,.sd-my-auto{margin-bottom:auto !important}.sd-ml-auto,.sd-mx-auto{margin-left:auto !important}.sd-m-0{margin:0 !important}.sd-mt-0,.sd-my-0{margin-top:0 !important}.sd-mr-0,.sd-mx-0{margin-right:0 !important}.sd-mb-0,.sd-my-0{margin-bottom:0 !important}.sd-ml-0,.sd-mx-0{margin-left:0 !important}.sd-m-1{margin:.25rem !important}.sd-mt-1,.sd-my-1{margin-top:.25rem !important}.sd-mr-1,.sd-mx-1{margin-right:.25rem !important}.sd-mb-1,.sd-my-1{margin-bottom:.25rem !important}.sd-ml-1,.sd-mx-1{margin-left:.25rem !important}.sd-m-2{margin:.5rem !important}.sd-mt-2,.sd-my-2{margin-top:.5rem !important}.sd-mr-2,.sd-mx-2{margin-right:.5rem !important}.sd-mb-2,.sd-my-2{margin-bottom:.5rem !important}.sd-ml-2,.sd-mx-2{margin-left:.5rem !important}.sd-m-3{margin:1rem !important}.sd-mt-3,.sd-my-3{margin-top:1rem !important}.sd-mr-3,.sd-mx-3{margin-right:1rem !important}.sd-mb-3,.sd-my-3{margin-bottom:1rem !important}.sd-ml-3,.sd-mx-3{margin-left:1rem !important}.sd-m-4{margin:1.5rem !important}.sd-mt-4,.sd-my-4{margin-top:1.5rem !important}.sd-mr-4,.sd-mx-4{margin-right:1.5rem !important}.sd-mb-4,.sd-my-4{margin-bottom:1.5rem !important}.sd-ml-4,.sd-mx-4{margin-left:1.5rem !important}.sd-m-5{margin:3rem !important}.sd-mt-5,.sd-my-5{margin-top:3rem !important}.sd-mr-5,.sd-mx-5{margin-right:3rem !important}.sd-mb-5,.sd-my-5{margin-bottom:3rem !important}.sd-ml-5,.sd-mx-5{margin-left:3rem !important}.sd-w-25{width:25% !important}.sd-w-50{width:50% !important}.sd-w-75{width:75% !important}.sd-w-100{width:100% !important}.sd-w-auto{width:auto !important}.sd-h-25{height:25% !important}.sd-h-50{height:50% !important}.sd-h-75{height:75% !important}.sd-h-100{height:100% !important}.sd-h-auto{height:auto !important}.sd-d-none{display:none !important}.sd-d-inline{display:inline !important}.sd-d-inline-block{display:inline-block !important}.sd-d-block{display:block !important}.sd-d-grid{display:grid !important}.sd-d-flex-row{display:-ms-flexbox !important;display:flex !important;flex-direction:row !important}.sd-d-flex-column{display:-ms-flexbox !important;display:flex !important;flex-direction:column !important}.sd-d-inline-flex{display:-ms-inline-flexbox !important;display:inline-flex !important}@media(min-width: 576px){.sd-d-sm-none{display:none !important}.sd-d-sm-inline{display:inline !important}.sd-d-sm-inline-block{display:inline-block !important}.sd-d-sm-block{display:block !important}.sd-d-sm-grid{display:grid !important}.sd-d-sm-flex{display:-ms-flexbox !important;display:flex !important}.sd-d-sm-inline-flex{display:-ms-inline-flexbox !important;display:inline-flex !important}}@media(min-width: 768px){.sd-d-md-none{display:none !important}.sd-d-md-inline{display:inline !important}.sd-d-md-inline-block{display:inline-block !important}.sd-d-md-block{display:block !important}.sd-d-md-grid{display:grid !important}.sd-d-md-flex{display:-ms-flexbox !important;display:flex !important}.sd-d-md-inline-flex{display:-ms-inline-flexbox !important;display:inline-flex !important}}@media(min-width: 992px){.sd-d-lg-none{display:none !important}.sd-d-lg-inline{display:inline !important}.sd-d-lg-inline-block{display:inline-block !important}.sd-d-lg-block{display:block !important}.sd-d-lg-grid{display:grid !important}.sd-d-lg-flex{display:-ms-flexbox !important;display:flex !important}.sd-d-lg-inline-flex{display:-ms-inline-flexbox !important;display:inline-flex !important}}@media(min-width: 1200px){.sd-d-xl-none{display:none !important}.sd-d-xl-inline{display:inline !important}.sd-d-xl-inline-block{display:inline-block !important}.sd-d-xl-block{display:block !important}.sd-d-xl-grid{display:grid !important}.sd-d-xl-flex{display:-ms-flexbox !important;display:flex !important}.sd-d-xl-inline-flex{display:-ms-inline-flexbox !important;display:inline-flex !important}}.sd-align-major-start{justify-content:flex-start !important}.sd-align-major-end{justify-content:flex-end !important}.sd-align-major-center{justify-content:center !important}.sd-align-major-justify{justify-content:space-between !important}.sd-align-major-spaced{justify-content:space-evenly !important}.sd-align-minor-start{align-items:flex-start !important}.sd-align-minor-end{align-items:flex-end !important}.sd-align-minor-center{align-items:center !important}.sd-align-minor-stretch{align-items:stretch !important}.sd-text-justify{text-align:justify !important}.sd-text-left{text-align:left !important}.sd-text-right{text-align:right !important}.sd-text-center{text-align:center !important}.sd-font-weight-light{font-weight:300 !important}.sd-font-weight-lighter{font-weight:lighter !important}.sd-font-weight-normal{font-weight:400 !important}.sd-font-weight-bold{font-weight:700 !important}.sd-font-weight-bolder{font-weight:bolder !important}.sd-font-italic{font-style:italic !important}.sd-text-decoration-none{text-decoration:none !important}.sd-text-lowercase{text-transform:lowercase !important}.sd-text-uppercase{text-transform:uppercase !important}.sd-text-capitalize{text-transform:capitalize !important}.sd-text-wrap{white-space:normal !important}.sd-text-nowrap{white-space:nowrap !important}.sd-text-truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.sd-fs-1,.sd-fs-1>p{font-size:calc(1.375rem + 1.5vw) !important;line-height:unset !important}.sd-fs-2,.sd-fs-2>p{font-size:calc(1.325rem + 0.9vw) !important;line-height:unset !important}.sd-fs-3,.sd-fs-3>p{font-size:calc(1.3rem + 0.6vw) !important;line-height:unset !important}.sd-fs-4,.sd-fs-4>p{font-size:calc(1.275rem + 0.3vw) !important;line-height:unset !important}.sd-fs-5,.sd-fs-5>p{font-size:1.25rem !important;line-height:unset !important}.sd-fs-6,.sd-fs-6>p{font-size:1rem !important;line-height:unset !important}.sd-border-0{border:0 solid !important}.sd-border-top-0{border-top:0 solid !important}.sd-border-bottom-0{border-bottom:0 solid !important}.sd-border-right-0{border-right:0 solid !important}.sd-border-left-0{border-left:0 solid !important}.sd-border-1{border:1px solid !important}.sd-border-top-1{border-top:1px solid !important}.sd-border-bottom-1{border-bottom:1px solid !important}.sd-border-right-1{border-right:1px solid !important}.sd-border-left-1{border-left:1px solid !important}.sd-border-2{border:2px solid !important}.sd-border-top-2{border-top:2px solid !important}.sd-border-bottom-2{border-bottom:2px solid !important}.sd-border-right-2{border-right:2px solid !important}.sd-border-left-2{border-left:2px solid !important}.sd-border-3{border:3px solid !important}.sd-border-top-3{border-top:3px solid !important}.sd-border-bottom-3{border-bottom:3px solid !important}.sd-border-right-3{border-right:3px solid !important}.sd-border-left-3{border-left:3px solid !important}.sd-border-4{border:4px solid !important}.sd-border-top-4{border-top:4px solid !important}.sd-border-bottom-4{border-bottom:4px solid !important}.sd-border-right-4{border-right:4px solid !important}.sd-border-left-4{border-left:4px solid !important}.sd-border-5{border:5px solid !important}.sd-border-top-5{border-top:5px solid !important}.sd-border-bottom-5{border-bottom:5px solid !important}.sd-border-right-5{border-right:5px solid !important}.sd-border-left-5{border-left:5px solid !important}.sd-rounded-0{border-radius:0 !important}.sd-rounded-1{border-radius:.2rem !important}.sd-rounded-2{border-radius:.3rem !important}.sd-rounded-3{border-radius:.5rem !important}.sd-rounded-pill{border-radius:50rem !important}.sd-rounded-circle{border-radius:50% !important}.shadow-none{box-shadow:none !important}.sd-shadow-sm{box-shadow:0 .125rem .25rem var(--sd-color-shadow) !important}.sd-shadow-md{box-shadow:0 .5rem 1rem var(--sd-color-shadow) !important}.sd-shadow-lg{box-shadow:0 1rem 3rem var(--sd-color-shadow) !important}@keyframes sd-slide-from-left{0%{transform:translateX(-100%)}100%{transform:translateX(0)}}@keyframes sd-slide-from-right{0%{transform:translateX(200%)}100%{transform:translateX(0)}}@keyframes sd-grow100{0%{transform:scale(0);opacity:.5}100%{transform:scale(1);opacity:1}}@keyframes sd-grow50{0%{transform:scale(0.5);opacity:.5}100%{transform:scale(1);opacity:1}}@keyframes sd-grow50-rot20{0%{transform:scale(0.5) rotateZ(-20deg);opacity:.5}75%{transform:scale(1) rotateZ(5deg);opacity:1}95%{transform:scale(1) rotateZ(-1deg);opacity:1}100%{transform:scale(1) rotateZ(0);opacity:1}}.sd-animate-slide-from-left{animation:1s ease-out 0s 1 normal none running sd-slide-from-left}.sd-animate-slide-from-right{animation:1s ease-out 0s 1 normal none running sd-slide-from-right}.sd-animate-grow100{animation:1s ease-out 0s 1 normal none running sd-grow100}.sd-animate-grow50{animation:1s ease-out 0s 1 normal none running sd-grow50}.sd-animate-grow50-rot20{animation:1s ease-out 0s 1 normal none running sd-grow50-rot20}.sd-badge{display:inline-block;padding:.35em .65em;font-size:.75em;font-weight:700;line-height:1;text-align:center;white-space:nowrap;vertical-align:baseline;border-radius:.25rem}.sd-badge:empty{display:none}a.sd-badge{text-decoration:none}.sd-btn .sd-badge{position:relative;top:-1px}.sd-btn{background-color:transparent;border:1px solid transparent;border-radius:.25rem;cursor:pointer;display:inline-block;font-weight:400;font-size:1rem;line-height:1.5;padding:.375rem .75rem;text-align:center;text-decoration:none;transition:color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;vertical-align:middle;user-select:none;-moz-user-select:none;-ms-user-select:none;-webkit-user-select:none}.sd-btn:hover{text-decoration:none}@media(prefers-reduced-motion: reduce){.sd-btn{transition:none}}.sd-btn-primary,.sd-btn-outline-primary:hover,.sd-btn-outline-primary:focus{color:var(--sd-color-primary-text) !important;background-color:var(--sd-color-primary) !important;border-color:var(--sd-color-primary) !important;border-width:1px !important;border-style:solid !important}.sd-btn-primary:hover,.sd-btn-primary:focus{color:var(--sd-color-primary-text) !important;background-color:var(--sd-color-primary-highlight) !important;border-color:var(--sd-color-primary-highlight) !important;border-width:1px !important;border-style:solid !important}.sd-btn-outline-primary{color:var(--sd-color-primary) !important;border-color:var(--sd-color-primary) !important;border-width:1px !important;border-style:solid !important}.sd-btn-secondary,.sd-btn-outline-secondary:hover,.sd-btn-outline-secondary:focus{color:var(--sd-color-secondary-text) !important;background-color:var(--sd-color-secondary) !important;border-color:var(--sd-color-secondary) !important;border-width:1px !important;border-style:solid !important}.sd-btn-secondary:hover,.sd-btn-secondary:focus{color:var(--sd-color-secondary-text) !important;background-color:var(--sd-color-secondary-highlight) !important;border-color:var(--sd-color-secondary-highlight) !important;border-width:1px !important;border-style:solid !important}.sd-btn-outline-secondary{color:var(--sd-color-secondary) !important;border-color:var(--sd-color-secondary) !important;border-width:1px !important;border-style:solid !important}.sd-btn-success,.sd-btn-outline-success:hover,.sd-btn-outline-success:focus{color:var(--sd-color-success-text) !important;background-color:var(--sd-color-success) !important;border-color:var(--sd-color-success) !important;border-width:1px !important;border-style:solid !important}.sd-btn-success:hover,.sd-btn-success:focus{color:var(--sd-color-success-text) !important;background-color:var(--sd-color-success-highlight) !important;border-color:var(--sd-color-success-highlight) !important;border-width:1px !important;border-style:solid !important}.sd-btn-outline-success{color:var(--sd-color-success) !important;border-color:var(--sd-color-success) !important;border-width:1px !important;border-style:solid !important}.sd-btn-info,.sd-btn-outline-info:hover,.sd-btn-outline-info:focus{color:var(--sd-color-info-text) !important;background-color:var(--sd-color-info) !important;border-color:var(--sd-color-info) !important;border-width:1px !important;border-style:solid !important}.sd-btn-info:hover,.sd-btn-info:focus{color:var(--sd-color-info-text) !important;background-color:var(--sd-color-info-highlight) !important;border-color:var(--sd-color-info-highlight) !important;border-width:1px !important;border-style:solid !important}.sd-btn-outline-info{color:var(--sd-color-info) !important;border-color:var(--sd-color-info) !important;border-width:1px !important;border-style:solid !important}.sd-btn-warning,.sd-btn-outline-warning:hover,.sd-btn-outline-warning:focus{color:var(--sd-color-warning-text) !important;background-color:var(--sd-color-warning) !important;border-color:var(--sd-color-warning) !important;border-width:1px !important;border-style:solid !important}.sd-btn-warning:hover,.sd-btn-warning:focus{color:var(--sd-color-warning-text) !important;background-color:var(--sd-color-warning-highlight) !important;border-color:var(--sd-color-warning-highlight) !important;border-width:1px !important;border-style:solid !important}.sd-btn-outline-warning{color:var(--sd-color-warning) !important;border-color:var(--sd-color-warning) !important;border-width:1px !important;border-style:solid !important}.sd-btn-danger,.sd-btn-outline-danger:hover,.sd-btn-outline-danger:focus{color:var(--sd-color-danger-text) !important;background-color:var(--sd-color-danger) !important;border-color:var(--sd-color-danger) !important;border-width:1px !important;border-style:solid !important}.sd-btn-danger:hover,.sd-btn-danger:focus{color:var(--sd-color-danger-text) !important;background-color:var(--sd-color-danger-highlight) !important;border-color:var(--sd-color-danger-highlight) !important;border-width:1px !important;border-style:solid !important}.sd-btn-outline-danger{color:var(--sd-color-danger) !important;border-color:var(--sd-color-danger) !important;border-width:1px !important;border-style:solid !important}.sd-btn-light,.sd-btn-outline-light:hover,.sd-btn-outline-light:focus{color:var(--sd-color-light-text) !important;background-color:var(--sd-color-light) !important;border-color:var(--sd-color-light) !important;border-width:1px !important;border-style:solid !important}.sd-btn-light:hover,.sd-btn-light:focus{color:var(--sd-color-light-text) !important;background-color:var(--sd-color-light-highlight) !important;border-color:var(--sd-color-light-highlight) !important;border-width:1px !important;border-style:solid !important}.sd-btn-outline-light{color:var(--sd-color-light) !important;border-color:var(--sd-color-light) !important;border-width:1px !important;border-style:solid !important}.sd-btn-muted,.sd-btn-outline-muted:hover,.sd-btn-outline-muted:focus{color:var(--sd-color-muted-text) !important;background-color:var(--sd-color-muted) !important;border-color:var(--sd-color-muted) !important;border-width:1px !important;border-style:solid !important}.sd-btn-muted:hover,.sd-btn-muted:focus{color:var(--sd-color-muted-text) !important;background-color:var(--sd-color-muted-highlight) !important;border-color:var(--sd-color-muted-highlight) !important;border-width:1px !important;border-style:solid !important}.sd-btn-outline-muted{color:var(--sd-color-muted) !important;border-color:var(--sd-color-muted) !important;border-width:1px !important;border-style:solid !important}.sd-btn-dark,.sd-btn-outline-dark:hover,.sd-btn-outline-dark:focus{color:var(--sd-color-dark-text) !important;background-color:var(--sd-color-dark) !important;border-color:var(--sd-color-dark) !important;border-width:1px !important;border-style:solid !important}.sd-btn-dark:hover,.sd-btn-dark:focus{color:var(--sd-color-dark-text) !important;background-color:var(--sd-color-dark-highlight) !important;border-color:var(--sd-color-dark-highlight) !important;border-width:1px !important;border-style:solid !important}.sd-btn-outline-dark{color:var(--sd-color-dark) !important;border-color:var(--sd-color-dark) !important;border-width:1px !important;border-style:solid !important}.sd-btn-black,.sd-btn-outline-black:hover,.sd-btn-outline-black:focus{color:var(--sd-color-black-text) !important;background-color:var(--sd-color-black) !important;border-color:var(--sd-color-black) !important;border-width:1px !important;border-style:solid !important}.sd-btn-black:hover,.sd-btn-black:focus{color:var(--sd-color-black-text) !important;background-color:var(--sd-color-black-highlight) !important;border-color:var(--sd-color-black-highlight) !important;border-width:1px !important;border-style:solid !important}.sd-btn-outline-black{color:var(--sd-color-black) !important;border-color:var(--sd-color-black) !important;border-width:1px !important;border-style:solid !important}.sd-btn-white,.sd-btn-outline-white:hover,.sd-btn-outline-white:focus{color:var(--sd-color-white-text) !important;background-color:var(--sd-color-white) !important;border-color:var(--sd-color-white) !important;border-width:1px !important;border-style:solid !important}.sd-btn-white:hover,.sd-btn-white:focus{color:var(--sd-color-white-text) !important;background-color:var(--sd-color-white-highlight) !important;border-color:var(--sd-color-white-highlight) !important;border-width:1px !important;border-style:solid !important}.sd-btn-outline-white{color:var(--sd-color-white) !important;border-color:var(--sd-color-white) !important;border-width:1px !important;border-style:solid !important}.sd-stretched-link::after{position:absolute;top:0;right:0;bottom:0;left:0;z-index:1;content:""}.sd-hide-link-text{font-size:0}.sd-octicon,.sd-material-icon{display:inline-block;fill:currentColor;vertical-align:middle}.sd-avatar-xs{border-radius:50%;object-fit:cover;object-position:center;width:1rem;height:1rem}.sd-avatar-sm{border-radius:50%;object-fit:cover;object-position:center;width:3rem;height:3rem}.sd-avatar-md{border-radius:50%;object-fit:cover;object-position:center;width:5rem;height:5rem}.sd-avatar-lg{border-radius:50%;object-fit:cover;object-position:center;width:7rem;height:7rem}.sd-avatar-xl{border-radius:50%;object-fit:cover;object-position:center;width:10rem;height:10rem}.sd-avatar-inherit{border-radius:50%;object-fit:cover;object-position:center;width:inherit;height:inherit}.sd-avatar-initial{border-radius:50%;object-fit:cover;object-position:center;width:initial;height:initial}.sd-card{background-clip:border-box;background-color:var(--sd-color-card-background);border:1px solid var(--sd-color-card-border);border-radius:.25rem;color:var(--sd-color-card-text);display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;min-width:0;position:relative;word-wrap:break-word}.sd-card>hr{margin-left:0;margin-right:0}.sd-card-hover:hover{border-color:var(--sd-color-card-border-hover);transform:scale(1.01)}.sd-card-body{-ms-flex:1 1 auto;flex:1 1 auto;padding:1rem 1rem}.sd-card-title{margin-bottom:.5rem}.sd-card-subtitle{margin-top:-0.25rem;margin-bottom:0}.sd-card-text:last-child{margin-bottom:0}.sd-card-link:hover{text-decoration:none}.sd-card-link+.card-link{margin-left:1rem}.sd-card-header{padding:.5rem 1rem;margin-bottom:0;background-color:var(--sd-color-card-header);border-bottom:1px solid var(--sd-color-card-border)}.sd-card-header:first-child{border-radius:calc(0.25rem - 1px) calc(0.25rem - 1px) 0 0}.sd-card-footer{padding:.5rem 1rem;background-color:var(--sd-color-card-footer);border-top:1px solid var(--sd-color-card-border)}.sd-card-footer:last-child{border-radius:0 0 calc(0.25rem - 1px) calc(0.25rem - 1px)}.sd-card-header-tabs{margin-right:-0.5rem;margin-bottom:-0.5rem;margin-left:-0.5rem;border-bottom:0}.sd-card-header-pills{margin-right:-0.5rem;margin-left:-0.5rem}.sd-card-img-overlay{position:absolute;top:0;right:0;bottom:0;left:0;padding:1rem;border-radius:calc(0.25rem - 1px)}.sd-card-img,.sd-card-img-bottom,.sd-card-img-top{width:100%}.sd-card-img,.sd-card-img-top{border-top-left-radius:calc(0.25rem - 1px);border-top-right-radius:calc(0.25rem - 1px)}.sd-card-img,.sd-card-img-bottom{border-bottom-left-radius:calc(0.25rem - 1px);border-bottom-right-radius:calc(0.25rem - 1px)}.sd-cards-carousel{width:100%;display:flex;flex-wrap:nowrap;-ms-flex-direction:row;flex-direction:row;overflow-x:hidden;scroll-snap-type:x mandatory}.sd-cards-carousel.sd-show-scrollbar{overflow-x:auto}.sd-cards-carousel:hover,.sd-cards-carousel:focus{overflow-x:auto}.sd-cards-carousel>.sd-card{flex-shrink:0;scroll-snap-align:start}.sd-cards-carousel>.sd-card:not(:last-child){margin-right:3px}.sd-card-cols-1>.sd-card{width:90%}.sd-card-cols-2>.sd-card{width:45%}.sd-card-cols-3>.sd-card{width:30%}.sd-card-cols-4>.sd-card{width:22.5%}.sd-card-cols-5>.sd-card{width:18%}.sd-card-cols-6>.sd-card{width:15%}.sd-card-cols-7>.sd-card{width:12.8571428571%}.sd-card-cols-8>.sd-card{width:11.25%}.sd-card-cols-9>.sd-card{width:10%}.sd-card-cols-10>.sd-card{width:9%}.sd-card-cols-11>.sd-card{width:8.1818181818%}.sd-card-cols-12>.sd-card{width:7.5%}.sd-container,.sd-container-fluid,.sd-container-lg,.sd-container-md,.sd-container-sm,.sd-container-xl{margin-left:auto;margin-right:auto;padding-left:var(--sd-gutter-x, 0.75rem);padding-right:var(--sd-gutter-x, 0.75rem);width:100%}@media(min-width: 576px){.sd-container-sm,.sd-container{max-width:540px}}@media(min-width: 768px){.sd-container-md,.sd-container-sm,.sd-container{max-width:720px}}@media(min-width: 992px){.sd-container-lg,.sd-container-md,.sd-container-sm,.sd-container{max-width:960px}}@media(min-width: 1200px){.sd-container-xl,.sd-container-lg,.sd-container-md,.sd-container-sm,.sd-container{max-width:1140px}}.sd-row{--sd-gutter-x: 1.5rem;--sd-gutter-y: 0;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;margin-top:calc(var(--sd-gutter-y) * -1);margin-right:calc(var(--sd-gutter-x) * -0.5);margin-left:calc(var(--sd-gutter-x) * -0.5)}.sd-row>*{box-sizing:border-box;flex-shrink:0;width:100%;max-width:100%;padding-right:calc(var(--sd-gutter-x) * 0.5);padding-left:calc(var(--sd-gutter-x) * 0.5);margin-top:var(--sd-gutter-y)}.sd-col{flex:1 0 0%;-ms-flex:1 0 0%}.sd-row-cols-auto>*{flex:0 0 auto;width:auto}.sd-row-cols-1>*{flex:0 0 auto;-ms-flex:0 0 auto;width:100%}.sd-row-cols-2>*{flex:0 0 auto;-ms-flex:0 0 auto;width:50%}.sd-row-cols-3>*{flex:0 0 auto;-ms-flex:0 0 auto;width:33.3333333333%}.sd-row-cols-4>*{flex:0 0 auto;-ms-flex:0 0 auto;width:25%}.sd-row-cols-5>*{flex:0 0 auto;-ms-flex:0 0 auto;width:20%}.sd-row-cols-6>*{flex:0 0 auto;-ms-flex:0 0 auto;width:16.6666666667%}.sd-row-cols-7>*{flex:0 0 auto;-ms-flex:0 0 auto;width:14.2857142857%}.sd-row-cols-8>*{flex:0 0 auto;-ms-flex:0 0 auto;width:12.5%}.sd-row-cols-9>*{flex:0 0 auto;-ms-flex:0 0 auto;width:11.1111111111%}.sd-row-cols-10>*{flex:0 0 auto;-ms-flex:0 0 auto;width:10%}.sd-row-cols-11>*{flex:0 0 auto;-ms-flex:0 0 auto;width:9.0909090909%}.sd-row-cols-12>*{flex:0 0 auto;-ms-flex:0 0 auto;width:8.3333333333%}@media(min-width: 576px){.sd-col-sm{flex:1 0 0%;-ms-flex:1 0 0%}.sd-row-cols-sm-auto{flex:1 0 auto;-ms-flex:1 0 auto;width:100%}.sd-row-cols-sm-1>*{flex:0 0 auto;-ms-flex:0 0 auto;width:100%}.sd-row-cols-sm-2>*{flex:0 0 auto;-ms-flex:0 0 auto;width:50%}.sd-row-cols-sm-3>*{flex:0 0 auto;-ms-flex:0 0 auto;width:33.3333333333%}.sd-row-cols-sm-4>*{flex:0 0 auto;-ms-flex:0 0 auto;width:25%}.sd-row-cols-sm-5>*{flex:0 0 auto;-ms-flex:0 0 auto;width:20%}.sd-row-cols-sm-6>*{flex:0 0 auto;-ms-flex:0 0 auto;width:16.6666666667%}.sd-row-cols-sm-7>*{flex:0 0 auto;-ms-flex:0 0 auto;width:14.2857142857%}.sd-row-cols-sm-8>*{flex:0 0 auto;-ms-flex:0 0 auto;width:12.5%}.sd-row-cols-sm-9>*{flex:0 0 auto;-ms-flex:0 0 auto;width:11.1111111111%}.sd-row-cols-sm-10>*{flex:0 0 auto;-ms-flex:0 0 auto;width:10%}.sd-row-cols-sm-11>*{flex:0 0 auto;-ms-flex:0 0 auto;width:9.0909090909%}.sd-row-cols-sm-12>*{flex:0 0 auto;-ms-flex:0 0 auto;width:8.3333333333%}}@media(min-width: 768px){.sd-col-md{flex:1 0 0%;-ms-flex:1 0 0%}.sd-row-cols-md-auto{flex:1 0 auto;-ms-flex:1 0 auto;width:100%}.sd-row-cols-md-1>*{flex:0 0 auto;-ms-flex:0 0 auto;width:100%}.sd-row-cols-md-2>*{flex:0 0 auto;-ms-flex:0 0 auto;width:50%}.sd-row-cols-md-3>*{flex:0 0 auto;-ms-flex:0 0 auto;width:33.3333333333%}.sd-row-cols-md-4>*{flex:0 0 auto;-ms-flex:0 0 auto;width:25%}.sd-row-cols-md-5>*{flex:0 0 auto;-ms-flex:0 0 auto;width:20%}.sd-row-cols-md-6>*{flex:0 0 auto;-ms-flex:0 0 auto;width:16.6666666667%}.sd-row-cols-md-7>*{flex:0 0 auto;-ms-flex:0 0 auto;width:14.2857142857%}.sd-row-cols-md-8>*{flex:0 0 auto;-ms-flex:0 0 auto;width:12.5%}.sd-row-cols-md-9>*{flex:0 0 auto;-ms-flex:0 0 auto;width:11.1111111111%}.sd-row-cols-md-10>*{flex:0 0 auto;-ms-flex:0 0 auto;width:10%}.sd-row-cols-md-11>*{flex:0 0 auto;-ms-flex:0 0 auto;width:9.0909090909%}.sd-row-cols-md-12>*{flex:0 0 auto;-ms-flex:0 0 auto;width:8.3333333333%}}@media(min-width: 992px){.sd-col-lg{flex:1 0 0%;-ms-flex:1 0 0%}.sd-row-cols-lg-auto{flex:1 0 auto;-ms-flex:1 0 auto;width:100%}.sd-row-cols-lg-1>*{flex:0 0 auto;-ms-flex:0 0 auto;width:100%}.sd-row-cols-lg-2>*{flex:0 0 auto;-ms-flex:0 0 auto;width:50%}.sd-row-cols-lg-3>*{flex:0 0 auto;-ms-flex:0 0 auto;width:33.3333333333%}.sd-row-cols-lg-4>*{flex:0 0 auto;-ms-flex:0 0 auto;width:25%}.sd-row-cols-lg-5>*{flex:0 0 auto;-ms-flex:0 0 auto;width:20%}.sd-row-cols-lg-6>*{flex:0 0 auto;-ms-flex:0 0 auto;width:16.6666666667%}.sd-row-cols-lg-7>*{flex:0 0 auto;-ms-flex:0 0 auto;width:14.2857142857%}.sd-row-cols-lg-8>*{flex:0 0 auto;-ms-flex:0 0 auto;width:12.5%}.sd-row-cols-lg-9>*{flex:0 0 auto;-ms-flex:0 0 auto;width:11.1111111111%}.sd-row-cols-lg-10>*{flex:0 0 auto;-ms-flex:0 0 auto;width:10%}.sd-row-cols-lg-11>*{flex:0 0 auto;-ms-flex:0 0 auto;width:9.0909090909%}.sd-row-cols-lg-12>*{flex:0 0 auto;-ms-flex:0 0 auto;width:8.3333333333%}}@media(min-width: 1200px){.sd-col-xl{flex:1 0 0%;-ms-flex:1 0 0%}.sd-row-cols-xl-auto{flex:1 0 auto;-ms-flex:1 0 auto;width:100%}.sd-row-cols-xl-1>*{flex:0 0 auto;-ms-flex:0 0 auto;width:100%}.sd-row-cols-xl-2>*{flex:0 0 auto;-ms-flex:0 0 auto;width:50%}.sd-row-cols-xl-3>*{flex:0 0 auto;-ms-flex:0 0 auto;width:33.3333333333%}.sd-row-cols-xl-4>*{flex:0 0 auto;-ms-flex:0 0 auto;width:25%}.sd-row-cols-xl-5>*{flex:0 0 auto;-ms-flex:0 0 auto;width:20%}.sd-row-cols-xl-6>*{flex:0 0 auto;-ms-flex:0 0 auto;width:16.6666666667%}.sd-row-cols-xl-7>*{flex:0 0 auto;-ms-flex:0 0 auto;width:14.2857142857%}.sd-row-cols-xl-8>*{flex:0 0 auto;-ms-flex:0 0 auto;width:12.5%}.sd-row-cols-xl-9>*{flex:0 0 auto;-ms-flex:0 0 auto;width:11.1111111111%}.sd-row-cols-xl-10>*{flex:0 0 auto;-ms-flex:0 0 auto;width:10%}.sd-row-cols-xl-11>*{flex:0 0 auto;-ms-flex:0 0 auto;width:9.0909090909%}.sd-row-cols-xl-12>*{flex:0 0 auto;-ms-flex:0 0 auto;width:8.3333333333%}}.sd-col-auto{flex:0 0 auto;-ms-flex:0 0 auto;width:auto}.sd-col-1{flex:0 0 auto;-ms-flex:0 0 auto;width:8.3333333333%}.sd-col-2{flex:0 0 auto;-ms-flex:0 0 auto;width:16.6666666667%}.sd-col-3{flex:0 0 auto;-ms-flex:0 0 auto;width:25%}.sd-col-4{flex:0 0 auto;-ms-flex:0 0 auto;width:33.3333333333%}.sd-col-5{flex:0 0 auto;-ms-flex:0 0 auto;width:41.6666666667%}.sd-col-6{flex:0 0 auto;-ms-flex:0 0 auto;width:50%}.sd-col-7{flex:0 0 auto;-ms-flex:0 0 auto;width:58.3333333333%}.sd-col-8{flex:0 0 auto;-ms-flex:0 0 auto;width:66.6666666667%}.sd-col-9{flex:0 0 auto;-ms-flex:0 0 auto;width:75%}.sd-col-10{flex:0 0 auto;-ms-flex:0 0 auto;width:83.3333333333%}.sd-col-11{flex:0 0 auto;-ms-flex:0 0 auto;width:91.6666666667%}.sd-col-12{flex:0 0 auto;-ms-flex:0 0 auto;width:100%}.sd-g-0,.sd-gy-0{--sd-gutter-y: 0}.sd-g-0,.sd-gx-0{--sd-gutter-x: 0}.sd-g-1,.sd-gy-1{--sd-gutter-y: 0.25rem}.sd-g-1,.sd-gx-1{--sd-gutter-x: 0.25rem}.sd-g-2,.sd-gy-2{--sd-gutter-y: 0.5rem}.sd-g-2,.sd-gx-2{--sd-gutter-x: 0.5rem}.sd-g-3,.sd-gy-3{--sd-gutter-y: 1rem}.sd-g-3,.sd-gx-3{--sd-gutter-x: 1rem}.sd-g-4,.sd-gy-4{--sd-gutter-y: 1.5rem}.sd-g-4,.sd-gx-4{--sd-gutter-x: 1.5rem}.sd-g-5,.sd-gy-5{--sd-gutter-y: 3rem}.sd-g-5,.sd-gx-5{--sd-gutter-x: 3rem}@media(min-width: 576px){.sd-col-sm-auto{-ms-flex:0 0 auto;flex:0 0 auto;width:auto}.sd-col-sm-1{-ms-flex:0 0 auto;flex:0 0 auto;width:8.3333333333%}.sd-col-sm-2{-ms-flex:0 0 auto;flex:0 0 auto;width:16.6666666667%}.sd-col-sm-3{-ms-flex:0 0 auto;flex:0 0 auto;width:25%}.sd-col-sm-4{-ms-flex:0 0 auto;flex:0 0 auto;width:33.3333333333%}.sd-col-sm-5{-ms-flex:0 0 auto;flex:0 0 auto;width:41.6666666667%}.sd-col-sm-6{-ms-flex:0 0 auto;flex:0 0 auto;width:50%}.sd-col-sm-7{-ms-flex:0 0 auto;flex:0 0 auto;width:58.3333333333%}.sd-col-sm-8{-ms-flex:0 0 auto;flex:0 0 auto;width:66.6666666667%}.sd-col-sm-9{-ms-flex:0 0 auto;flex:0 0 auto;width:75%}.sd-col-sm-10{-ms-flex:0 0 auto;flex:0 0 auto;width:83.3333333333%}.sd-col-sm-11{-ms-flex:0 0 auto;flex:0 0 auto;width:91.6666666667%}.sd-col-sm-12{-ms-flex:0 0 auto;flex:0 0 auto;width:100%}.sd-g-sm-0,.sd-gy-sm-0{--sd-gutter-y: 0}.sd-g-sm-0,.sd-gx-sm-0{--sd-gutter-x: 0}.sd-g-sm-1,.sd-gy-sm-1{--sd-gutter-y: 0.25rem}.sd-g-sm-1,.sd-gx-sm-1{--sd-gutter-x: 0.25rem}.sd-g-sm-2,.sd-gy-sm-2{--sd-gutter-y: 0.5rem}.sd-g-sm-2,.sd-gx-sm-2{--sd-gutter-x: 0.5rem}.sd-g-sm-3,.sd-gy-sm-3{--sd-gutter-y: 1rem}.sd-g-sm-3,.sd-gx-sm-3{--sd-gutter-x: 1rem}.sd-g-sm-4,.sd-gy-sm-4{--sd-gutter-y: 1.5rem}.sd-g-sm-4,.sd-gx-sm-4{--sd-gutter-x: 1.5rem}.sd-g-sm-5,.sd-gy-sm-5{--sd-gutter-y: 3rem}.sd-g-sm-5,.sd-gx-sm-5{--sd-gutter-x: 3rem}}@media(min-width: 768px){.sd-col-md-auto{-ms-flex:0 0 auto;flex:0 0 auto;width:auto}.sd-col-md-1{-ms-flex:0 0 auto;flex:0 0 auto;width:8.3333333333%}.sd-col-md-2{-ms-flex:0 0 auto;flex:0 0 auto;width:16.6666666667%}.sd-col-md-3{-ms-flex:0 0 auto;flex:0 0 auto;width:25%}.sd-col-md-4{-ms-flex:0 0 auto;flex:0 0 auto;width:33.3333333333%}.sd-col-md-5{-ms-flex:0 0 auto;flex:0 0 auto;width:41.6666666667%}.sd-col-md-6{-ms-flex:0 0 auto;flex:0 0 auto;width:50%}.sd-col-md-7{-ms-flex:0 0 auto;flex:0 0 auto;width:58.3333333333%}.sd-col-md-8{-ms-flex:0 0 auto;flex:0 0 auto;width:66.6666666667%}.sd-col-md-9{-ms-flex:0 0 auto;flex:0 0 auto;width:75%}.sd-col-md-10{-ms-flex:0 0 auto;flex:0 0 auto;width:83.3333333333%}.sd-col-md-11{-ms-flex:0 0 auto;flex:0 0 auto;width:91.6666666667%}.sd-col-md-12{-ms-flex:0 0 auto;flex:0 0 auto;width:100%}.sd-g-md-0,.sd-gy-md-0{--sd-gutter-y: 0}.sd-g-md-0,.sd-gx-md-0{--sd-gutter-x: 0}.sd-g-md-1,.sd-gy-md-1{--sd-gutter-y: 0.25rem}.sd-g-md-1,.sd-gx-md-1{--sd-gutter-x: 0.25rem}.sd-g-md-2,.sd-gy-md-2{--sd-gutter-y: 0.5rem}.sd-g-md-2,.sd-gx-md-2{--sd-gutter-x: 0.5rem}.sd-g-md-3,.sd-gy-md-3{--sd-gutter-y: 1rem}.sd-g-md-3,.sd-gx-md-3{--sd-gutter-x: 1rem}.sd-g-md-4,.sd-gy-md-4{--sd-gutter-y: 1.5rem}.sd-g-md-4,.sd-gx-md-4{--sd-gutter-x: 1.5rem}.sd-g-md-5,.sd-gy-md-5{--sd-gutter-y: 3rem}.sd-g-md-5,.sd-gx-md-5{--sd-gutter-x: 3rem}}@media(min-width: 992px){.sd-col-lg-auto{-ms-flex:0 0 auto;flex:0 0 auto;width:auto}.sd-col-lg-1{-ms-flex:0 0 auto;flex:0 0 auto;width:8.3333333333%}.sd-col-lg-2{-ms-flex:0 0 auto;flex:0 0 auto;width:16.6666666667%}.sd-col-lg-3{-ms-flex:0 0 auto;flex:0 0 auto;width:25%}.sd-col-lg-4{-ms-flex:0 0 auto;flex:0 0 auto;width:33.3333333333%}.sd-col-lg-5{-ms-flex:0 0 auto;flex:0 0 auto;width:41.6666666667%}.sd-col-lg-6{-ms-flex:0 0 auto;flex:0 0 auto;width:50%}.sd-col-lg-7{-ms-flex:0 0 auto;flex:0 0 auto;width:58.3333333333%}.sd-col-lg-8{-ms-flex:0 0 auto;flex:0 0 auto;width:66.6666666667%}.sd-col-lg-9{-ms-flex:0 0 auto;flex:0 0 auto;width:75%}.sd-col-lg-10{-ms-flex:0 0 auto;flex:0 0 auto;width:83.3333333333%}.sd-col-lg-11{-ms-flex:0 0 auto;flex:0 0 auto;width:91.6666666667%}.sd-col-lg-12{-ms-flex:0 0 auto;flex:0 0 auto;width:100%}.sd-g-lg-0,.sd-gy-lg-0{--sd-gutter-y: 0}.sd-g-lg-0,.sd-gx-lg-0{--sd-gutter-x: 0}.sd-g-lg-1,.sd-gy-lg-1{--sd-gutter-y: 0.25rem}.sd-g-lg-1,.sd-gx-lg-1{--sd-gutter-x: 0.25rem}.sd-g-lg-2,.sd-gy-lg-2{--sd-gutter-y: 0.5rem}.sd-g-lg-2,.sd-gx-lg-2{--sd-gutter-x: 0.5rem}.sd-g-lg-3,.sd-gy-lg-3{--sd-gutter-y: 1rem}.sd-g-lg-3,.sd-gx-lg-3{--sd-gutter-x: 1rem}.sd-g-lg-4,.sd-gy-lg-4{--sd-gutter-y: 1.5rem}.sd-g-lg-4,.sd-gx-lg-4{--sd-gutter-x: 1.5rem}.sd-g-lg-5,.sd-gy-lg-5{--sd-gutter-y: 3rem}.sd-g-lg-5,.sd-gx-lg-5{--sd-gutter-x: 3rem}}@media(min-width: 1200px){.sd-col-xl-auto{-ms-flex:0 0 auto;flex:0 0 auto;width:auto}.sd-col-xl-1{-ms-flex:0 0 auto;flex:0 0 auto;width:8.3333333333%}.sd-col-xl-2{-ms-flex:0 0 auto;flex:0 0 auto;width:16.6666666667%}.sd-col-xl-3{-ms-flex:0 0 auto;flex:0 0 auto;width:25%}.sd-col-xl-4{-ms-flex:0 0 auto;flex:0 0 auto;width:33.3333333333%}.sd-col-xl-5{-ms-flex:0 0 auto;flex:0 0 auto;width:41.6666666667%}.sd-col-xl-6{-ms-flex:0 0 auto;flex:0 0 auto;width:50%}.sd-col-xl-7{-ms-flex:0 0 auto;flex:0 0 auto;width:58.3333333333%}.sd-col-xl-8{-ms-flex:0 0 auto;flex:0 0 auto;width:66.6666666667%}.sd-col-xl-9{-ms-flex:0 0 auto;flex:0 0 auto;width:75%}.sd-col-xl-10{-ms-flex:0 0 auto;flex:0 0 auto;width:83.3333333333%}.sd-col-xl-11{-ms-flex:0 0 auto;flex:0 0 auto;width:91.6666666667%}.sd-col-xl-12{-ms-flex:0 0 auto;flex:0 0 auto;width:100%}.sd-g-xl-0,.sd-gy-xl-0{--sd-gutter-y: 0}.sd-g-xl-0,.sd-gx-xl-0{--sd-gutter-x: 0}.sd-g-xl-1,.sd-gy-xl-1{--sd-gutter-y: 0.25rem}.sd-g-xl-1,.sd-gx-xl-1{--sd-gutter-x: 0.25rem}.sd-g-xl-2,.sd-gy-xl-2{--sd-gutter-y: 0.5rem}.sd-g-xl-2,.sd-gx-xl-2{--sd-gutter-x: 0.5rem}.sd-g-xl-3,.sd-gy-xl-3{--sd-gutter-y: 1rem}.sd-g-xl-3,.sd-gx-xl-3{--sd-gutter-x: 1rem}.sd-g-xl-4,.sd-gy-xl-4{--sd-gutter-y: 1.5rem}.sd-g-xl-4,.sd-gx-xl-4{--sd-gutter-x: 1.5rem}.sd-g-xl-5,.sd-gy-xl-5{--sd-gutter-y: 3rem}.sd-g-xl-5,.sd-gx-xl-5{--sd-gutter-x: 3rem}}.sd-flex-row-reverse{flex-direction:row-reverse !important}details.sd-dropdown{position:relative;font-size:var(--sd-fontsize-dropdown)}details.sd-dropdown:hover{cursor:pointer}details.sd-dropdown .sd-summary-content{cursor:default}details.sd-dropdown summary.sd-summary-title{padding:.5em .6em .5em 1em;font-size:var(--sd-fontsize-dropdown-title);font-weight:var(--sd-fontweight-dropdown-title);user-select:none;-moz-user-select:none;-ms-user-select:none;-webkit-user-select:none;list-style:none;display:inline-flex;justify-content:space-between}details.sd-dropdown summary.sd-summary-title::-webkit-details-marker{display:none}details.sd-dropdown summary.sd-summary-title:focus{outline:none}details.sd-dropdown summary.sd-summary-title .sd-summary-icon{margin-right:.6em;display:inline-flex;align-items:center}details.sd-dropdown summary.sd-summary-title .sd-summary-icon svg{opacity:.8}details.sd-dropdown summary.sd-summary-title .sd-summary-text{flex-grow:1;line-height:1.5;padding-right:.5rem}details.sd-dropdown summary.sd-summary-title .sd-summary-state-marker{pointer-events:none;display:inline-flex;align-items:center}details.sd-dropdown summary.sd-summary-title .sd-summary-state-marker svg{opacity:.6}details.sd-dropdown summary.sd-summary-title:hover .sd-summary-state-marker svg{opacity:1;transform:scale(1.1)}details.sd-dropdown[open] summary .sd-octicon.no-title{visibility:hidden}details.sd-dropdown .sd-summary-chevron-right{transition:.25s}details.sd-dropdown[open]>.sd-summary-title .sd-summary-chevron-right{transform:rotate(90deg)}details.sd-dropdown[open]>.sd-summary-title .sd-summary-chevron-down{transform:rotate(180deg)}details.sd-dropdown:not([open]).sd-card{border:none}details.sd-dropdown:not([open])>.sd-card-header{border:1px solid var(--sd-color-card-border);border-radius:.25rem}details.sd-dropdown.sd-fade-in[open] summary~*{-moz-animation:sd-fade-in .5s ease-in-out;-webkit-animation:sd-fade-in .5s ease-in-out;animation:sd-fade-in .5s ease-in-out}details.sd-dropdown.sd-fade-in-slide-down[open] summary~*{-moz-animation:sd-fade-in .5s ease-in-out,sd-slide-down .5s ease-in-out;-webkit-animation:sd-fade-in .5s ease-in-out,sd-slide-down .5s ease-in-out;animation:sd-fade-in .5s ease-in-out,sd-slide-down .5s ease-in-out}.sd-col>.sd-dropdown{width:100%}.sd-summary-content>.sd-tab-set:first-child{margin-top:0}@keyframes sd-fade-in{0%{opacity:0}100%{opacity:1}}@keyframes sd-slide-down{0%{transform:translate(0, -10px)}100%{transform:translate(0, 0)}}.sd-tab-set{border-radius:.125rem;display:flex;flex-wrap:wrap;margin:1em 0;position:relative}.sd-tab-set>input{opacity:0;position:absolute}.sd-tab-set>input:checked+label{border-color:var(--sd-color-tabs-underline-active);color:var(--sd-color-tabs-label-active)}.sd-tab-set>input:checked+label+.sd-tab-content{display:block}.sd-tab-set>input:not(:checked)+label:hover{color:var(--sd-color-tabs-label-hover);border-color:var(--sd-color-tabs-underline-hover)}.sd-tab-set>input:focus+label{outline-style:auto}.sd-tab-set>input:not(.focus-visible)+label{outline:none;-webkit-tap-highlight-color:transparent}.sd-tab-set>label{border-bottom:.125rem solid transparent;margin-bottom:0;color:var(--sd-color-tabs-label-inactive);border-color:var(--sd-color-tabs-underline-inactive);cursor:pointer;font-size:var(--sd-fontsize-tabs-label);font-weight:700;padding:1em 1.25em .5em;transition:color 250ms;width:auto;z-index:1}html .sd-tab-set>label:hover{color:var(--sd-color-tabs-label-active)}.sd-col>.sd-tab-set{width:100%}.sd-tab-content{box-shadow:0 -0.0625rem var(--sd-color-tabs-overline),0 .0625rem var(--sd-color-tabs-underline);display:none;order:99;padding-bottom:.75rem;padding-top:.75rem;width:100%}.sd-tab-content>:first-child{margin-top:0 !important}.sd-tab-content>:last-child{margin-bottom:0 !important}.sd-tab-content>.sd-tab-set{margin:0}.sd-sphinx-override,.sd-sphinx-override *{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}.sd-sphinx-override p{margin-top:0}:root{--sd-color-primary: #0071bc;--sd-color-secondary: #6c757d;--sd-color-success: #28a745;--sd-color-info: #17a2b8;--sd-color-warning: #f0b37e;--sd-color-danger: #dc3545;--sd-color-light: #f8f9fa;--sd-color-muted: #6c757d;--sd-color-dark: #212529;--sd-color-black: black;--sd-color-white: white;--sd-color-primary-highlight: #0060a0;--sd-color-secondary-highlight: #5c636a;--sd-color-success-highlight: #228e3b;--sd-color-info-highlight: #148a9c;--sd-color-warning-highlight: #cc986b;--sd-color-danger-highlight: #bb2d3b;--sd-color-light-highlight: #d3d4d5;--sd-color-muted-highlight: #5c636a;--sd-color-dark-highlight: #1c1f23;--sd-color-black-highlight: black;--sd-color-white-highlight: #d9d9d9;--sd-color-primary-bg: rgba(0, 113, 188, 0.2);--sd-color-secondary-bg: rgba(108, 117, 125, 0.2);--sd-color-success-bg: rgba(40, 167, 69, 0.2);--sd-color-info-bg: rgba(23, 162, 184, 0.2);--sd-color-warning-bg: rgba(240, 179, 126, 0.2);--sd-color-danger-bg: rgba(220, 53, 69, 0.2);--sd-color-light-bg: rgba(248, 249, 250, 0.2);--sd-color-muted-bg: rgba(108, 117, 125, 0.2);--sd-color-dark-bg: rgba(33, 37, 41, 0.2);--sd-color-black-bg: rgba(0, 0, 0, 0.2);--sd-color-white-bg: rgba(255, 255, 255, 0.2);--sd-color-primary-text: #fff;--sd-color-secondary-text: #fff;--sd-color-success-text: #fff;--sd-color-info-text: #fff;--sd-color-warning-text: #212529;--sd-color-danger-text: #fff;--sd-color-light-text: #212529;--sd-color-muted-text: #fff;--sd-color-dark-text: #fff;--sd-color-black-text: #fff;--sd-color-white-text: #212529;--sd-color-shadow: rgba(0, 0, 0, 0.15);--sd-color-card-border: rgba(0, 0, 0, 0.125);--sd-color-card-border-hover: hsla(231, 99%, 66%, 1);--sd-color-card-background: transparent;--sd-color-card-text: inherit;--sd-color-card-header: transparent;--sd-color-card-footer: transparent;--sd-color-tabs-label-active: hsla(231, 99%, 66%, 1);--sd-color-tabs-label-hover: hsla(231, 99%, 66%, 1);--sd-color-tabs-label-inactive: hsl(0, 0%, 66%);--sd-color-tabs-underline-active: hsla(231, 99%, 66%, 1);--sd-color-tabs-underline-hover: rgba(178, 206, 245, 0.62);--sd-color-tabs-underline-inactive: transparent;--sd-color-tabs-overline: rgb(222, 222, 222);--sd-color-tabs-underline: rgb(222, 222, 222);--sd-fontsize-tabs-label: 1rem;--sd-fontsize-dropdown: inherit;--sd-fontsize-dropdown-title: 1rem;--sd-fontweight-dropdown-title: 700} diff --git a/_static/sphinx_highlight.js b/_static/sphinx_highlight.js new file mode 100644 index 00000000..8a96c69a --- /dev/null +++ b/_static/sphinx_highlight.js @@ -0,0 +1,154 @@ +/* Highlighting utilities for Sphinx HTML documentation. */ +"use strict"; + +const SPHINX_HIGHLIGHT_ENABLED = true + +/** + * highlight a given string on a node by wrapping it in + * span elements with the given class name. + */ +const _highlight = (node, addItems, text, className) => { + if (node.nodeType === Node.TEXT_NODE) { + const val = node.nodeValue; + const parent = node.parentNode; + const pos = val.toLowerCase().indexOf(text); + if ( + pos >= 0 && + !parent.classList.contains(className) && + !parent.classList.contains("nohighlight") + ) { + let span; + + const closestNode = parent.closest("body, svg, foreignObject"); + const isInSVG = closestNode && closestNode.matches("svg"); + if (isInSVG) { + span = document.createElementNS("http://www.w3.org/2000/svg", "tspan"); + } else { + span = document.createElement("span"); + span.classList.add(className); + } + + span.appendChild(document.createTextNode(val.substr(pos, text.length))); + const rest = document.createTextNode(val.substr(pos + text.length)); + parent.insertBefore( + span, + parent.insertBefore( + rest, + node.nextSibling + ) + ); + node.nodeValue = val.substr(0, pos); + /* There may be more occurrences of search term in this node. So call this + * function recursively on the remaining fragment. + */ + _highlight(rest, addItems, text, className); + + if (isInSVG) { + const rect = document.createElementNS( + "http://www.w3.org/2000/svg", + "rect" + ); + const bbox = parent.getBBox(); + rect.x.baseVal.value = bbox.x; + rect.y.baseVal.value = bbox.y; + rect.width.baseVal.value = bbox.width; + rect.height.baseVal.value = bbox.height; + rect.setAttribute("class", className); + addItems.push({ parent: parent, target: rect }); + } + } + } else if (node.matches && !node.matches("button, select, textarea")) { + node.childNodes.forEach((el) => _highlight(el, addItems, text, className)); + } +}; +const _highlightText = (thisNode, text, className) => { + let addItems = []; + _highlight(thisNode, addItems, text, className); + addItems.forEach((obj) => + obj.parent.insertAdjacentElement("beforebegin", obj.target) + ); +}; + +/** + * Small JavaScript module for the documentation. + */ +const SphinxHighlight = { + + /** + * highlight the search words provided in localstorage in the text + */ + highlightSearchWords: () => { + if (!SPHINX_HIGHLIGHT_ENABLED) return; // bail if no highlight + + // get and clear terms from localstorage + const url = new URL(window.location); + const highlight = + localStorage.getItem("sphinx_highlight_terms") + || url.searchParams.get("highlight") + || ""; + localStorage.removeItem("sphinx_highlight_terms") + url.searchParams.delete("highlight"); + window.history.replaceState({}, "", url); + + // get individual terms from highlight string + const terms = highlight.toLowerCase().split(/\s+/).filter(x => x); + if (terms.length === 0) return; // nothing to do + + // There should never be more than one element matching "div.body" + const divBody = document.querySelectorAll("div.body"); + const body = divBody.length ? divBody[0] : document.querySelector("body"); + window.setTimeout(() => { + terms.forEach((term) => _highlightText(body, term, "highlighted")); + }, 10); + + const searchBox = document.getElementById("searchbox"); + if (searchBox === null) return; + searchBox.appendChild( + document + .createRange() + .createContextualFragment( + '" + ) + ); + }, + + /** + * helper function to hide the search marks again + */ + hideSearchWords: () => { + document + .querySelectorAll("#searchbox .highlight-link") + .forEach((el) => el.remove()); + document + .querySelectorAll("span.highlighted") + .forEach((el) => el.classList.remove("highlighted")); + localStorage.removeItem("sphinx_highlight_terms") + }, + + initEscapeListener: () => { + // only install a listener if it is really needed + if (!DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS) return; + + document.addEventListener("keydown", (event) => { + // bail for input elements + if (BLACKLISTED_KEY_CONTROL_ELEMENTS.has(document.activeElement.tagName)) return; + // bail with special keys + if (event.shiftKey || event.altKey || event.ctrlKey || event.metaKey) return; + if (DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS && (event.key === "Escape")) { + SphinxHighlight.hideSearchWords(); + event.preventDefault(); + } + }); + }, +}; + +_ready(() => { + /* Do not call highlightSearchWords() when we are on the search page. + * It will highlight words from the *previous* search query. + */ + if (typeof Search === "undefined") SphinxHighlight.highlightSearchWords(); + SphinxHighlight.initEscapeListener(); +}); diff --git a/_static/styles/furo-extensions.css b/_static/styles/furo-extensions.css new file mode 100644 index 00000000..82295876 --- /dev/null +++ b/_static/styles/furo-extensions.css @@ -0,0 +1,2 @@ +#furo-sidebar-ad-placement{padding:var(--sidebar-item-spacing-vertical) var(--sidebar-item-spacing-horizontal)}#furo-sidebar-ad-placement .ethical-sidebar{background:var(--color-background-secondary);border:none;box-shadow:none}#furo-sidebar-ad-placement .ethical-sidebar:hover{background:var(--color-background-hover)}#furo-sidebar-ad-placement .ethical-sidebar a{color:var(--color-foreground-primary)}#furo-sidebar-ad-placement .ethical-callout a{color:var(--color-foreground-secondary)!important}#furo-readthedocs-versions{background:transparent;display:block;position:static;width:100%}#furo-readthedocs-versions .rst-versions{background:#1a1c1e}#furo-readthedocs-versions .rst-current-version{background:var(--color-sidebar-item-background);cursor:unset}#furo-readthedocs-versions .rst-current-version:hover{background:var(--color-sidebar-item-background)}#furo-readthedocs-versions .rst-current-version .fa-book{color:var(--color-foreground-primary)}#furo-readthedocs-versions>.rst-other-versions{padding:0}#furo-readthedocs-versions>.rst-other-versions small{opacity:1}#furo-readthedocs-versions .injected .rst-versions{position:unset}#furo-readthedocs-versions:focus-within,#furo-readthedocs-versions:hover{box-shadow:0 0 0 1px var(--color-sidebar-background-border)}#furo-readthedocs-versions:focus-within .rst-current-version,#furo-readthedocs-versions:hover .rst-current-version{background:#1a1c1e;font-size:inherit;height:auto;line-height:inherit;padding:12px;text-align:right}#furo-readthedocs-versions:focus-within .rst-current-version .fa-book,#furo-readthedocs-versions:hover .rst-current-version .fa-book{color:#fff;float:left}#furo-readthedocs-versions:focus-within .fa-caret-down,#furo-readthedocs-versions:hover .fa-caret-down{display:none}#furo-readthedocs-versions:focus-within .injected,#furo-readthedocs-versions:focus-within .rst-current-version,#furo-readthedocs-versions:focus-within .rst-other-versions,#furo-readthedocs-versions:hover .injected,#furo-readthedocs-versions:hover .rst-current-version,#furo-readthedocs-versions:hover .rst-other-versions{display:block}#furo-readthedocs-versions:focus-within>.rst-current-version,#furo-readthedocs-versions:hover>.rst-current-version{display:none}.highlight:hover button.copybtn{color:var(--color-code-foreground)}.highlight button.copybtn{align-items:center;background-color:var(--color-code-background);border:none;color:var(--color-background-item);cursor:pointer;height:1.25em;right:.5rem;top:.625rem;transition:color .3s,opacity .3s;width:1.25em}.highlight button.copybtn:hover{background-color:var(--color-code-background);color:var(--color-brand-content)}.highlight button.copybtn:after{background-color:transparent;color:var(--color-code-foreground);display:none}.highlight button.copybtn.success{color:#22863a;transition:color 0ms}.highlight button.copybtn.success:after{display:block}.highlight button.copybtn svg{padding:0}body{--sd-color-primary:var(--color-brand-primary);--sd-color-primary-highlight:var(--color-brand-content);--sd-color-primary-text:var(--color-background-primary);--sd-color-shadow:rgba(0,0,0,.05);--sd-color-card-border:var(--color-card-border);--sd-color-card-border-hover:var(--color-brand-content);--sd-color-card-background:var(--color-card-background);--sd-color-card-text:var(--color-foreground-primary);--sd-color-card-header:var(--color-card-marginals-background);--sd-color-card-footer:var(--color-card-marginals-background);--sd-color-tabs-label-active:var(--color-brand-content);--sd-color-tabs-label-hover:var(--color-foreground-muted);--sd-color-tabs-label-inactive:var(--color-foreground-muted);--sd-color-tabs-underline-active:var(--color-brand-content);--sd-color-tabs-underline-hover:var(--color-foreground-border);--sd-color-tabs-underline-inactive:var(--color-background-border);--sd-color-tabs-overline:var(--color-background-border);--sd-color-tabs-underline:var(--color-background-border)}.sd-tab-content{box-shadow:0 -2px var(--sd-color-tabs-overline),0 1px var(--sd-color-tabs-underline)}.sd-card{box-shadow:0 .1rem .25rem var(--sd-color-shadow),0 0 .0625rem rgba(0,0,0,.1)}.sd-shadow-sm{box-shadow:0 .1rem .25rem var(--sd-color-shadow),0 0 .0625rem rgba(0,0,0,.1)!important}.sd-shadow-md{box-shadow:0 .3rem .75rem var(--sd-color-shadow),0 0 .0625rem rgba(0,0,0,.1)!important}.sd-shadow-lg{box-shadow:0 .6rem 1.5rem var(--sd-color-shadow),0 0 .0625rem rgba(0,0,0,.1)!important}.sd-card-hover:hover{transform:none}.sd-cards-carousel{gap:.25rem;padding:.25rem}body{--tabs--label-text:var(--color-foreground-muted);--tabs--label-text--hover:var(--color-foreground-muted);--tabs--label-text--active:var(--color-brand-content);--tabs--label-text--active--hover:var(--color-brand-content);--tabs--label-background:transparent;--tabs--label-background--hover:transparent;--tabs--label-background--active:transparent;--tabs--label-background--active--hover:transparent;--tabs--padding-x:0.25em;--tabs--margin-x:1em;--tabs--border:var(--color-background-border);--tabs--label-border:transparent;--tabs--label-border--hover:var(--color-foreground-muted);--tabs--label-border--active:var(--color-brand-content);--tabs--label-border--active--hover:var(--color-brand-content)}[role=main] .container{max-width:none;padding-left:0;padding-right:0}.shadow.docutils{border:none;box-shadow:0 .2rem .5rem rgba(0,0,0,.05),0 0 .0625rem rgba(0,0,0,.1)!important}.sphinx-bs .card{background-color:var(--color-background-secondary);color:var(--color-foreground)} +/*# sourceMappingURL=furo-extensions.css.map*/ \ No newline at end of file diff --git a/_static/styles/furo-extensions.css.map b/_static/styles/furo-extensions.css.map new file mode 100644 index 00000000..c26eac7f --- /dev/null +++ b/_static/styles/furo-extensions.css.map @@ -0,0 +1 @@ +{"version":3,"file":"styles/furo-extensions.css","mappings":"AAGA,2BACE,oFACA,4CAKE,6CAHA,YACA,eAEA,CACA,kDACE,yCAEF,8CACE,sCAEJ,8CACE,kDAEJ,2BAGE,uBACA,cAHA,gBACA,UAEA,CAGA,yCACE,mBAEF,gDAEE,gDADA,YACA,CACA,sDACE,gDACF,yDACE,sCAEJ,+CACE,UACA,qDACE,UAGF,mDACE,eAEJ,yEAEE,4DAEA,mHASE,mBAPA,kBAEA,YADA,oBAGA,aADA,gBAIA,CAEA,qIAEE,WADA,UACA,CAEJ,uGACE,aAEF,iUAGE,cAEF,mHACE,aC1EJ,gCACE,mCAEF,0BAEE,mBAUA,8CACA,YAFA,mCAKA,eAZA,cAIA,YADA,YAYA,iCAdA,YAcA,CAEA,gCAEE,8CADA,gCACA,CAEF,gCAGE,6BADA,mCADA,YAEA,CAEF,kCAEE,cADA,oBACA,CACA,wCACE,cAEJ,8BACE,UCzCN,KAEE,6CAA8C,CAC9C,uDAAwD,CACxD,uDAAwD,CAGxD,iCAAsC,CAGtC,+CAAgD,CAChD,uDAAwD,CACxD,uDAAwD,CACxD,oDAAqD,CACrD,6DAA8D,CAC9D,6DAA8D,CAG9D,uDAAwD,CACxD,yDAA0D,CAC1D,4DAA6D,CAC7D,2DAA4D,CAC5D,8DAA+D,CAC/D,iEAAkE,CAClE,uDAAwD,CACxD,wDAAyD,CAG3D,gBACE,qFAGF,SACE,6EAEF,cACE,uFAEF,cACE,uFAEF,cACE,uFAGF,qBACE,eAEF,mBACE,WACA,eChDF,KACE,gDAAiD,CACjD,uDAAwD,CACxD,qDAAsD,CACtD,4DAA6D,CAC7D,oCAAqC,CACrC,2CAA4C,CAC5C,4CAA6C,CAC7C,mDAAoD,CACpD,wBAAyB,CACzB,oBAAqB,CACrB,6CAA8C,CAC9C,gCAAiC,CACjC,yDAA0D,CAC1D,uDAAwD,CACxD,8DAA+D,CCbjE,uBACE,eACA,eACA,gBAGF,iBACE,YACA,+EAGF,iBACE,mDACA","sources":["webpack:///./src/furo/assets/styles/extensions/_readthedocs.sass","webpack:///./src/furo/assets/styles/extensions/_copybutton.sass","webpack:///./src/furo/assets/styles/extensions/_sphinx-design.sass","webpack:///./src/furo/assets/styles/extensions/_sphinx-inline-tabs.sass","webpack:///./src/furo/assets/styles/extensions/_sphinx-panels.sass"],"sourcesContent":["// This file contains the styles used for tweaking how ReadTheDoc's embedded\n// contents would show up inside the theme.\n\n#furo-sidebar-ad-placement\n padding: var(--sidebar-item-spacing-vertical) var(--sidebar-item-spacing-horizontal)\n .ethical-sidebar\n // Remove the border and box-shadow.\n border: none\n box-shadow: none\n // Manage the background colors.\n background: var(--color-background-secondary)\n &:hover\n background: var(--color-background-hover)\n // Ensure the text is legible.\n a\n color: var(--color-foreground-primary)\n\n .ethical-callout a\n color: var(--color-foreground-secondary) !important\n\n#furo-readthedocs-versions\n position: static\n width: 100%\n background: transparent\n display: block\n\n // Make the background color fit with the theme's aesthetic.\n .rst-versions\n background: rgb(26, 28, 30)\n\n .rst-current-version\n cursor: unset\n background: var(--color-sidebar-item-background)\n &:hover\n background: var(--color-sidebar-item-background)\n .fa-book\n color: var(--color-foreground-primary)\n\n > .rst-other-versions\n padding: 0\n small\n opacity: 1\n\n .injected\n .rst-versions\n position: unset\n\n &:hover,\n &:focus-within\n box-shadow: 0 0 0 1px var(--color-sidebar-background-border)\n\n .rst-current-version\n // Undo the tweaks done in RTD's CSS\n font-size: inherit\n line-height: inherit\n height: auto\n text-align: right\n padding: 12px\n\n // Match the rest of the body\n background: #1a1c1e\n\n .fa-book\n float: left\n color: white\n\n .fa-caret-down\n display: none\n\n .rst-current-version,\n .rst-other-versions,\n .injected\n display: block\n\n > .rst-current-version\n display: none\n",".highlight\n &:hover button.copybtn\n color: var(--color-code-foreground)\n\n button.copybtn\n // Align things correctly\n align-items: center\n\n height: 1.25em\n width: 1.25em\n\n top: 0.625rem // $code-spacing-vertical\n right: 0.5rem\n\n // Make it look better\n color: var(--color-background-item)\n background-color: var(--color-code-background)\n border: none\n\n // Change to cursor to make it obvious that you can click on it\n cursor: pointer\n\n // Transition smoothly, for aesthetics\n transition: color 300ms, opacity 300ms\n\n &:hover\n color: var(--color-brand-content)\n background-color: var(--color-code-background)\n\n &::after\n display: none\n color: var(--color-code-foreground)\n background-color: transparent\n\n &.success\n transition: color 0ms\n color: #22863a\n &::after\n display: block\n\n svg\n padding: 0\n","body\n // Colors\n --sd-color-primary: var(--color-brand-primary)\n --sd-color-primary-highlight: var(--color-brand-content)\n --sd-color-primary-text: var(--color-background-primary)\n\n // Shadows\n --sd-color-shadow: rgba(0, 0, 0, 0.05)\n\n // Cards\n --sd-color-card-border: var(--color-card-border)\n --sd-color-card-border-hover: var(--color-brand-content)\n --sd-color-card-background: var(--color-card-background)\n --sd-color-card-text: var(--color-foreground-primary)\n --sd-color-card-header: var(--color-card-marginals-background)\n --sd-color-card-footer: var(--color-card-marginals-background)\n\n // Tabs\n --sd-color-tabs-label-active: var(--color-brand-content)\n --sd-color-tabs-label-hover: var(--color-foreground-muted)\n --sd-color-tabs-label-inactive: var(--color-foreground-muted)\n --sd-color-tabs-underline-active: var(--color-brand-content)\n --sd-color-tabs-underline-hover: var(--color-foreground-border)\n --sd-color-tabs-underline-inactive: var(--color-background-border)\n --sd-color-tabs-overline: var(--color-background-border)\n --sd-color-tabs-underline: var(--color-background-border)\n\n// Tabs\n.sd-tab-content\n box-shadow: 0 -2px var(--sd-color-tabs-overline), 0 1px var(--sd-color-tabs-underline)\n\n// Shadows\n.sd-card // Have a shadow by default\n box-shadow: 0 0.1rem 0.25rem var(--sd-color-shadow), 0 0 0.0625rem rgba(0, 0, 0, 0.1)\n\n.sd-shadow-sm\n box-shadow: 0 0.1rem 0.25rem var(--sd-color-shadow), 0 0 0.0625rem rgba(0, 0, 0, 0.1) !important\n\n.sd-shadow-md\n box-shadow: 0 0.3rem 0.75rem var(--sd-color-shadow), 0 0 0.0625rem rgba(0, 0, 0, 0.1) !important\n\n.sd-shadow-lg\n box-shadow: 0 0.6rem 1.5rem var(--sd-color-shadow), 0 0 0.0625rem rgba(0, 0, 0, 0.1) !important\n\n// Cards\n.sd-card-hover:hover // Don't change scale on hover\n transform: none\n\n.sd-cards-carousel // Have a bit of gap in the carousel by default\n gap: 0.25rem\n padding: 0.25rem\n","// This file contains styles to tweak sphinx-inline-tabs to work well with Furo.\n\nbody\n --tabs--label-text: var(--color-foreground-muted)\n --tabs--label-text--hover: var(--color-foreground-muted)\n --tabs--label-text--active: var(--color-brand-content)\n --tabs--label-text--active--hover: var(--color-brand-content)\n --tabs--label-background: transparent\n --tabs--label-background--hover: transparent\n --tabs--label-background--active: transparent\n --tabs--label-background--active--hover: transparent\n --tabs--padding-x: 0.25em\n --tabs--margin-x: 1em\n --tabs--border: var(--color-background-border)\n --tabs--label-border: transparent\n --tabs--label-border--hover: var(--color-foreground-muted)\n --tabs--label-border--active: var(--color-brand-content)\n --tabs--label-border--active--hover: var(--color-brand-content)\n","// This file contains styles to tweak sphinx-panels to work well with Furo.\n\n// sphinx-panels includes Bootstrap 4, which uses .container which can conflict\n// with docutils' `.. container::` directive.\n[role=\"main\"] .container\n max-width: initial\n padding-left: initial\n padding-right: initial\n\n// Make the panels look nicer!\n.shadow.docutils\n border: none\n box-shadow: 0 0.2rem 0.5rem rgba(0, 0, 0, 0.05), 0 0 0.0625rem rgba(0, 0, 0, 0.1) !important\n\n// Make panel colors respond to dark mode\n.sphinx-bs .card\n background-color: var(--color-background-secondary)\n color: var(--color-foreground)\n"],"names":[],"sourceRoot":""} \ No newline at end of file diff --git a/_static/styles/furo.css b/_static/styles/furo.css new file mode 100644 index 00000000..05a56b17 --- /dev/null +++ b/_static/styles/furo.css @@ -0,0 +1,2 @@ +/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */html{line-height:1.15;-webkit-text-size-adjust:100%}body{margin:0}main{display:block}h1{font-size:2em;margin:.67em 0}hr{box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace,monospace;font-size:1em}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;text-decoration:underline dotted}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace,monospace;font-size:1em}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}button,select{text-transform:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{border-style:none;padding:0}[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring,button:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:.35em .75em .625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details{display:block}summary{display:list-item}[hidden],template{display:none}@media print{.content-icon-container,.headerlink,.mobile-header,.related-pages{display:none!important}.highlight{border:.1pt solid var(--color-foreground-border)}a,blockquote,dl,ol,p,pre,table,ul{page-break-inside:avoid}caption,figure,h1,h2,h3,h4,h5,h6,img{page-break-after:avoid;page-break-inside:avoid}dl,ol,ul{page-break-before:avoid}}.visually-hidden{height:1px!important;margin:-1px!important;overflow:hidden!important;padding:0!important;position:absolute!important;width:1px!important;clip:rect(0,0,0,0)!important;background:var(--color-background-primary);border:0!important;color:var(--color-foreground-primary);white-space:nowrap!important}:-moz-focusring{outline:auto}body{--font-stack:-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji;--font-stack--monospace:"SFMono-Regular",Menlo,Consolas,Monaco,Liberation Mono,Lucida Console,monospace;--font-stack--headings:var(--font-stack);--font-size--normal:100%;--font-size--small:87.5%;--font-size--small--2:81.25%;--font-size--small--3:75%;--font-size--small--4:62.5%;--sidebar-caption-font-size:var(--font-size--small--2);--sidebar-item-font-size:var(--font-size--small);--sidebar-search-input-font-size:var(--font-size--small);--toc-font-size:var(--font-size--small--3);--toc-font-size--mobile:var(--font-size--normal);--toc-title-font-size:var(--font-size--small--4);--admonition-font-size:0.8125rem;--admonition-title-font-size:0.8125rem;--code-font-size:var(--font-size--small--2);--api-font-size:var(--font-size--small);--header-height:calc(var(--sidebar-item-line-height) + var(--sidebar-item-spacing-vertical)*4);--header-padding:0.5rem;--sidebar-tree-space-above:1.5rem;--sidebar-caption-space-above:1rem;--sidebar-item-line-height:1rem;--sidebar-item-spacing-vertical:0.5rem;--sidebar-item-spacing-horizontal:1rem;--sidebar-item-height:calc(var(--sidebar-item-line-height) + var(--sidebar-item-spacing-vertical)*2);--sidebar-expander-width:var(--sidebar-item-height);--sidebar-search-space-above:0.5rem;--sidebar-search-input-spacing-vertical:0.5rem;--sidebar-search-input-spacing-horizontal:0.5rem;--sidebar-search-input-height:1rem;--sidebar-search-icon-size:var(--sidebar-search-input-height);--toc-title-padding:0.25rem 0;--toc-spacing-vertical:1.5rem;--toc-spacing-horizontal:1.5rem;--toc-item-spacing-vertical:0.4rem;--toc-item-spacing-horizontal:1rem;--icon-search:url('data:image/svg+xml;charset=utf-8,');--icon-pencil:url('data:image/svg+xml;charset=utf-8,');--icon-abstract:url('data:image/svg+xml;charset=utf-8,');--icon-info:url('data:image/svg+xml;charset=utf-8,');--icon-flame:url('data:image/svg+xml;charset=utf-8,');--icon-question:url('data:image/svg+xml;charset=utf-8,');--icon-warning:url('data:image/svg+xml;charset=utf-8,');--icon-failure:url('data:image/svg+xml;charset=utf-8,');--icon-spark:url('data:image/svg+xml;charset=utf-8,');--color-admonition-title--caution:#ff9100;--color-admonition-title-background--caution:rgba(255,145,0,.2);--color-admonition-title--warning:#ff9100;--color-admonition-title-background--warning:rgba(255,145,0,.2);--color-admonition-title--danger:#ff5252;--color-admonition-title-background--danger:rgba(255,82,82,.2);--color-admonition-title--attention:#ff5252;--color-admonition-title-background--attention:rgba(255,82,82,.2);--color-admonition-title--error:#ff5252;--color-admonition-title-background--error:rgba(255,82,82,.2);--color-admonition-title--hint:#00c852;--color-admonition-title-background--hint:rgba(0,200,82,.2);--color-admonition-title--tip:#00c852;--color-admonition-title-background--tip:rgba(0,200,82,.2);--color-admonition-title--important:#00bfa5;--color-admonition-title-background--important:rgba(0,191,165,.2);--color-admonition-title--note:#00b0ff;--color-admonition-title-background--note:rgba(0,176,255,.2);--color-admonition-title--seealso:#448aff;--color-admonition-title-background--seealso:rgba(68,138,255,.2);--color-admonition-title--admonition-todo:grey;--color-admonition-title-background--admonition-todo:hsla(0,0%,50%,.2);--color-admonition-title:#651fff;--color-admonition-title-background:rgba(101,31,255,.2);--icon-admonition-default:var(--icon-abstract);--color-topic-title:#14b8a6;--color-topic-title-background:rgba(20,184,166,.2);--icon-topic-default:var(--icon-pencil);--color-problematic:#b30000;--color-foreground-primary:#000;--color-foreground-secondary:#5a5c63;--color-foreground-muted:#6b6f76;--color-foreground-border:#878787;--color-background-primary:#fff;--color-background-secondary:#f8f9fb;--color-background-hover:#efeff4;--color-background-hover--transparent:#efeff400;--color-background-border:#eeebee;--color-background-item:#ccc;--color-announcement-background:#000000dd;--color-announcement-text:#eeebee;--color-brand-primary:#0a4bff;--color-brand-content:#2757dd;--color-brand-visited:#872ee0;--color-api-background:var(--color-background-hover--transparent);--color-api-background-hover:var(--color-background-hover);--color-api-overall:var(--color-foreground-secondary);--color-api-name:var(--color-problematic);--color-api-pre-name:var(--color-problematic);--color-api-paren:var(--color-foreground-secondary);--color-api-keyword:var(--color-foreground-primary);--color-api-added:#21632c;--color-api-added-border:#38a84d;--color-api-changed:#046172;--color-api-changed-border:#06a1bc;--color-api-deprecated:#605706;--color-api-deprecated-border:#f0d90f;--color-api-removed:#b30000;--color-api-removed-border:#ff5c5c;--color-highlight-on-target:#ffc;--color-inline-code-background:var(--color-background-secondary);--color-highlighted-background:#def;--color-highlighted-text:var(--color-foreground-primary);--color-guilabel-background:#ddeeff80;--color-guilabel-border:#bedaf580;--color-guilabel-text:var(--color-foreground-primary);--color-admonition-background:transparent;--color-table-header-background:var(--color-background-secondary);--color-table-border:var(--color-background-border);--color-card-border:var(--color-background-secondary);--color-card-background:transparent;--color-card-marginals-background:var(--color-background-secondary);--color-header-background:var(--color-background-primary);--color-header-border:var(--color-background-border);--color-header-text:var(--color-foreground-primary);--color-sidebar-background:var(--color-background-secondary);--color-sidebar-background-border:var(--color-background-border);--color-sidebar-brand-text:var(--color-foreground-primary);--color-sidebar-caption-text:var(--color-foreground-muted);--color-sidebar-link-text:var(--color-foreground-secondary);--color-sidebar-link-text--top-level:var(--color-brand-primary);--color-sidebar-item-background:var(--color-sidebar-background);--color-sidebar-item-background--current:var( --color-sidebar-item-background );--color-sidebar-item-background--hover:linear-gradient(90deg,var(--color-background-hover--transparent) 0%,var(--color-background-hover) var(--sidebar-item-spacing-horizontal),var(--color-background-hover) 100%);--color-sidebar-item-expander-background:transparent;--color-sidebar-item-expander-background--hover:var( --color-background-hover );--color-sidebar-search-text:var(--color-foreground-primary);--color-sidebar-search-background:var(--color-background-secondary);--color-sidebar-search-background--focus:var(--color-background-primary);--color-sidebar-search-border:var(--color-background-border);--color-sidebar-search-icon:var(--color-foreground-muted);--color-toc-background:var(--color-background-primary);--color-toc-title-text:var(--color-foreground-muted);--color-toc-item-text:var(--color-foreground-secondary);--color-toc-item-text--hover:var(--color-foreground-primary);--color-toc-item-text--active:var(--color-brand-primary);--color-content-foreground:var(--color-foreground-primary);--color-content-background:transparent;--color-link:var(--color-brand-content);--color-link-underline:var(--color-background-border);--color-link--hover:var(--color-brand-content);--color-link-underline--hover:var(--color-foreground-border);--color-link--visited:var(--color-brand-visited);--color-link-underline--visited:var(--color-background-border);--color-link--visited--hover:var(--color-brand-visited);--color-link-underline--visited--hover:var(--color-foreground-border)}.only-light{display:block!important}html body .only-dark{display:none!important}@media not print{body[data-theme=dark]{--color-problematic:#ee5151;--color-foreground-primary:#cfd0d0;--color-foreground-secondary:#9ca0a5;--color-foreground-muted:#81868d;--color-foreground-border:#666;--color-background-primary:#131416;--color-background-secondary:#1a1c1e;--color-background-hover:#1e2124;--color-background-hover--transparent:#1e212400;--color-background-border:#303335;--color-background-item:#444;--color-announcement-background:#000000dd;--color-announcement-text:#eeebee;--color-brand-primary:#3d94ff;--color-brand-content:#5ca5ff;--color-brand-visited:#b27aeb;--color-highlighted-background:#083563;--color-guilabel-background:#08356380;--color-guilabel-border:#13395f80;--color-api-keyword:var(--color-foreground-secondary);--color-highlight-on-target:#330;--color-api-added:#3db854;--color-api-added-border:#267334;--color-api-changed:#09b0ce;--color-api-changed-border:#056d80;--color-api-deprecated:#b1a10b;--color-api-deprecated-border:#6e6407;--color-api-removed:#ff7575;--color-api-removed-border:#b03b3b;--color-admonition-background:#18181a;--color-card-border:var(--color-background-secondary);--color-card-background:#18181a;--color-card-marginals-background:var(--color-background-hover)}html body[data-theme=dark] .only-light{display:none!important}body[data-theme=dark] .only-dark{display:block!important}@media(prefers-color-scheme:dark){body:not([data-theme=light]){--color-problematic:#ee5151;--color-foreground-primary:#cfd0d0;--color-foreground-secondary:#9ca0a5;--color-foreground-muted:#81868d;--color-foreground-border:#666;--color-background-primary:#131416;--color-background-secondary:#1a1c1e;--color-background-hover:#1e2124;--color-background-hover--transparent:#1e212400;--color-background-border:#303335;--color-background-item:#444;--color-announcement-background:#000000dd;--color-announcement-text:#eeebee;--color-brand-primary:#3d94ff;--color-brand-content:#5ca5ff;--color-brand-visited:#b27aeb;--color-highlighted-background:#083563;--color-guilabel-background:#08356380;--color-guilabel-border:#13395f80;--color-api-keyword:var(--color-foreground-secondary);--color-highlight-on-target:#330;--color-api-added:#3db854;--color-api-added-border:#267334;--color-api-changed:#09b0ce;--color-api-changed-border:#056d80;--color-api-deprecated:#b1a10b;--color-api-deprecated-border:#6e6407;--color-api-removed:#ff7575;--color-api-removed-border:#b03b3b;--color-admonition-background:#18181a;--color-card-border:var(--color-background-secondary);--color-card-background:#18181a;--color-card-marginals-background:var(--color-background-hover)}html body:not([data-theme=light]) .only-light{display:none!important}body:not([data-theme=light]) .only-dark{display:block!important}}}body[data-theme=auto] .theme-toggle svg.theme-icon-when-auto-light{display:block}@media(prefers-color-scheme:dark){body[data-theme=auto] .theme-toggle svg.theme-icon-when-auto-dark{display:block}body[data-theme=auto] .theme-toggle svg.theme-icon-when-auto-light{display:none}}body[data-theme=dark] .theme-toggle svg.theme-icon-when-dark,body[data-theme=light] .theme-toggle svg.theme-icon-when-light{display:block}body{font-family:var(--font-stack)}code,kbd,pre,samp{font-family:var(--font-stack--monospace)}body{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}article{line-height:1.5}h1,h2,h3,h4,h5,h6{border-radius:.5rem;font-family:var(--font-stack--headings);font-weight:700;line-height:1.25;margin:.5rem -.5rem;padding-left:.5rem;padding-right:.5rem}h1+p,h2+p,h3+p,h4+p,h5+p,h6+p{margin-top:0}h1{font-size:2.5em;margin-bottom:1rem}h1,h2{margin-top:1.75rem}h2{font-size:2em}h3{font-size:1.5em}h4{font-size:1.25em}h5{font-size:1.125em}h6{font-size:1em}small{font-size:80%;opacity:75%}p{margin-bottom:.75rem;margin-top:.5rem}hr.docutils{background-color:var(--color-background-border);border:0;height:1px;margin:2rem 0;padding:0}.centered{text-align:center}a{color:var(--color-link);text-decoration:underline;text-decoration-color:var(--color-link-underline)}a:visited{color:var(--color-link--visited);text-decoration-color:var(--color-link-underline--visited)}a:visited:hover{color:var(--color-link--visited--hover);text-decoration-color:var(--color-link-underline--visited--hover)}a:hover{color:var(--color-link--hover);text-decoration-color:var(--color-link-underline--hover)}a.muted-link{color:inherit}a.muted-link:hover{color:var(--color-link--hover);text-decoration-color:var(--color-link-underline--hover)}a.muted-link:hover:visited{color:var(--color-link--visited--hover);text-decoration-color:var(--color-link-underline--visited--hover)}html{overflow-x:hidden;overflow-y:scroll;scroll-behavior:smooth}.sidebar-scroll,.toc-scroll,article[role=main] *{scrollbar-color:var(--color-foreground-border) transparent;scrollbar-width:thin}.sidebar-scroll::-webkit-scrollbar,.toc-scroll::-webkit-scrollbar,article[role=main] ::-webkit-scrollbar{height:.25rem;width:.25rem}.sidebar-scroll::-webkit-scrollbar-thumb,.toc-scroll::-webkit-scrollbar-thumb,article[role=main] ::-webkit-scrollbar-thumb{background-color:var(--color-foreground-border);border-radius:.125rem}body,html{height:100%}.skip-to-content,body,html{background:var(--color-background-primary);color:var(--color-foreground-primary)}.skip-to-content{border-radius:1rem;left:.25rem;padding:1rem;position:fixed;top:.25rem;transform:translateY(-200%);transition:transform .3s ease-in-out;z-index:40}.skip-to-content:focus-within{transform:translateY(0)}article{background:var(--color-content-background);color:var(--color-content-foreground);overflow-wrap:break-word}.page{display:flex;min-height:100%}.mobile-header{background-color:var(--color-header-background);border-bottom:1px solid var(--color-header-border);color:var(--color-header-text);display:none;height:var(--header-height);width:100%;z-index:10}.mobile-header.scrolled{border-bottom:none;box-shadow:0 0 .2rem rgba(0,0,0,.1),0 .2rem .4rem rgba(0,0,0,.2)}.mobile-header .header-center a{color:var(--color-header-text);text-decoration:none}.main{display:flex;flex:1}.sidebar-drawer{background:var(--color-sidebar-background);border-right:1px solid var(--color-sidebar-background-border);box-sizing:border-box;display:flex;justify-content:flex-end;min-width:15em;width:calc(50% - 26em)}.sidebar-container,.toc-drawer{box-sizing:border-box;width:15em}.toc-drawer{background:var(--color-toc-background);padding-right:1rem}.sidebar-sticky,.toc-sticky{display:flex;flex-direction:column;height:min(100%,100vh);height:100vh;position:sticky;top:0}.sidebar-scroll,.toc-scroll{flex-grow:1;flex-shrink:1;overflow:auto;scroll-behavior:smooth}.content{display:flex;flex-direction:column;justify-content:space-between;padding:0 3em;width:46em}.icon{display:inline-block;height:1rem;width:1rem}.icon svg{height:100%;width:100%}.announcement{align-items:center;background-color:var(--color-announcement-background);color:var(--color-announcement-text);display:flex;height:var(--header-height);overflow-x:auto}.announcement+.page{min-height:calc(100% - var(--header-height))}.announcement-content{box-sizing:border-box;min-width:100%;padding:.5rem;text-align:center;white-space:nowrap}.announcement-content a{color:var(--color-announcement-text);text-decoration-color:var(--color-announcement-text)}.announcement-content a:hover{color:var(--color-announcement-text);text-decoration-color:var(--color-link--hover)}.no-js .theme-toggle-container{display:none}.theme-toggle-container{display:flex}.theme-toggle{background:transparent;border:none;cursor:pointer;display:flex;padding:0}.theme-toggle svg{color:var(--color-foreground-primary);display:none;height:1.25rem;width:1.25rem}.theme-toggle-header{align-items:center;display:flex;justify-content:center}.nav-overlay-icon,.toc-overlay-icon{cursor:pointer;display:none}.nav-overlay-icon .icon,.toc-overlay-icon .icon{color:var(--color-foreground-secondary);height:1.5rem;width:1.5rem}.nav-overlay-icon,.toc-header-icon{align-items:center;justify-content:center}.toc-content-icon{height:1.5rem;width:1.5rem}.content-icon-container{display:flex;float:right;gap:.5rem;margin-bottom:1rem;margin-left:1rem;margin-top:1.5rem}.content-icon-container .edit-this-page svg,.content-icon-container .view-this-page svg{color:inherit;height:1.25rem;width:1.25rem}.sidebar-toggle{display:none;position:absolute}.sidebar-toggle[name=__toc]{left:20px}.sidebar-toggle:checked{left:40px}.overlay{background-color:rgba(0,0,0,.54);height:0;opacity:0;position:fixed;top:0;transition:width 0ms,height 0ms,opacity .25s ease-out;width:0}.sidebar-overlay{z-index:20}.toc-overlay{z-index:40}.sidebar-drawer{transition:left .25s ease-in-out;z-index:30}.toc-drawer{transition:right .25s ease-in-out;z-index:50}#__navigation:checked~.sidebar-overlay{height:100%;opacity:1;width:100%}#__navigation:checked~.page .sidebar-drawer{left:0;top:0}#__toc:checked~.toc-overlay{height:100%;opacity:1;width:100%}#__toc:checked~.page .toc-drawer{right:0;top:0}.back-to-top{background:var(--color-background-primary);border-radius:1rem;box-shadow:0 .2rem .5rem rgba(0,0,0,.05),0 0 1px 0 hsla(220,9%,46%,.502);display:none;font-size:.8125rem;left:0;margin-left:50%;padding:.5rem .75rem .5rem .5rem;position:fixed;text-decoration:none;top:1rem;transform:translateX(-50%);z-index:10}.back-to-top svg{height:1rem;width:1rem;fill:currentColor;display:inline-block}.back-to-top span{margin-left:.25rem}.show-back-to-top .back-to-top{align-items:center;display:flex}@media(min-width:97em){html{font-size:110%}}@media(max-width:82em){.toc-content-icon{display:flex}.toc-drawer{border-left:1px solid var(--color-background-muted);height:100vh;position:fixed;right:-15em;top:0}.toc-tree{border-left:none;font-size:var(--toc-font-size--mobile)}.sidebar-drawer{width:calc(50% - 18.5em)}}@media(max-width:67em){.content{margin-left:auto;margin-right:auto;padding:0 1em}}@media(max-width:63em){.nav-overlay-icon{display:flex}.sidebar-drawer{height:100vh;left:-15em;position:fixed;top:0;width:15em}.theme-toggle-header,.toc-header-icon{display:flex}.theme-toggle-content,.toc-content-icon{display:none}.mobile-header{align-items:center;display:flex;justify-content:space-between;position:sticky;top:0}.mobile-header .header-left,.mobile-header .header-right{display:flex;height:var(--header-height);padding:0 var(--header-padding)}.mobile-header .header-left label,.mobile-header .header-right label{height:100%;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:100%}.nav-overlay-icon .icon,.theme-toggle svg{height:1.5rem;width:1.5rem}:target{scroll-margin-top:calc(var(--header-height) + 2.5rem)}.back-to-top{top:calc(var(--header-height) + .5rem)}.page{flex-direction:column;justify-content:center}}@media(max-width:48em){.content{overflow-x:auto;width:100%}}@media(max-width:46em){article[role=main] aside.sidebar{float:none;margin:1rem 0;width:100%}}.admonition,.topic{background:var(--color-admonition-background);border-radius:.2rem;box-shadow:0 .2rem .5rem rgba(0,0,0,.05),0 0 .0625rem rgba(0,0,0,.1);font-size:var(--admonition-font-size);margin:1rem auto;overflow:hidden;padding:0 .5rem .5rem;page-break-inside:avoid}.admonition>:nth-child(2),.topic>:nth-child(2){margin-top:0}.admonition>:last-child,.topic>:last-child{margin-bottom:0}.admonition p.admonition-title,p.topic-title{font-size:var(--admonition-title-font-size);font-weight:500;line-height:1.3;margin:0 -.5rem .5rem;padding:.4rem .5rem .4rem 2rem;position:relative}.admonition p.admonition-title:before,p.topic-title:before{content:"";height:1rem;left:.5rem;position:absolute;width:1rem}p.admonition-title{background-color:var(--color-admonition-title-background)}p.admonition-title:before{background-color:var(--color-admonition-title);-webkit-mask-image:var(--icon-admonition-default);mask-image:var(--icon-admonition-default);-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat}p.topic-title{background-color:var(--color-topic-title-background)}p.topic-title:before{background-color:var(--color-topic-title);-webkit-mask-image:var(--icon-topic-default);mask-image:var(--icon-topic-default);-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat}.admonition{border-left:.2rem solid var(--color-admonition-title)}.admonition.caution{border-left-color:var(--color-admonition-title--caution)}.admonition.caution>.admonition-title{background-color:var(--color-admonition-title-background--caution)}.admonition.caution>.admonition-title:before{background-color:var(--color-admonition-title--caution);-webkit-mask-image:var(--icon-spark);mask-image:var(--icon-spark)}.admonition.warning{border-left-color:var(--color-admonition-title--warning)}.admonition.warning>.admonition-title{background-color:var(--color-admonition-title-background--warning)}.admonition.warning>.admonition-title:before{background-color:var(--color-admonition-title--warning);-webkit-mask-image:var(--icon-warning);mask-image:var(--icon-warning)}.admonition.danger{border-left-color:var(--color-admonition-title--danger)}.admonition.danger>.admonition-title{background-color:var(--color-admonition-title-background--danger)}.admonition.danger>.admonition-title:before{background-color:var(--color-admonition-title--danger);-webkit-mask-image:var(--icon-spark);mask-image:var(--icon-spark)}.admonition.attention{border-left-color:var(--color-admonition-title--attention)}.admonition.attention>.admonition-title{background-color:var(--color-admonition-title-background--attention)}.admonition.attention>.admonition-title:before{background-color:var(--color-admonition-title--attention);-webkit-mask-image:var(--icon-warning);mask-image:var(--icon-warning)}.admonition.error{border-left-color:var(--color-admonition-title--error)}.admonition.error>.admonition-title{background-color:var(--color-admonition-title-background--error)}.admonition.error>.admonition-title:before{background-color:var(--color-admonition-title--error);-webkit-mask-image:var(--icon-failure);mask-image:var(--icon-failure)}.admonition.hint{border-left-color:var(--color-admonition-title--hint)}.admonition.hint>.admonition-title{background-color:var(--color-admonition-title-background--hint)}.admonition.hint>.admonition-title:before{background-color:var(--color-admonition-title--hint);-webkit-mask-image:var(--icon-question);mask-image:var(--icon-question)}.admonition.tip{border-left-color:var(--color-admonition-title--tip)}.admonition.tip>.admonition-title{background-color:var(--color-admonition-title-background--tip)}.admonition.tip>.admonition-title:before{background-color:var(--color-admonition-title--tip);-webkit-mask-image:var(--icon-info);mask-image:var(--icon-info)}.admonition.important{border-left-color:var(--color-admonition-title--important)}.admonition.important>.admonition-title{background-color:var(--color-admonition-title-background--important)}.admonition.important>.admonition-title:before{background-color:var(--color-admonition-title--important);-webkit-mask-image:var(--icon-flame);mask-image:var(--icon-flame)}.admonition.note{border-left-color:var(--color-admonition-title--note)}.admonition.note>.admonition-title{background-color:var(--color-admonition-title-background--note)}.admonition.note>.admonition-title:before{background-color:var(--color-admonition-title--note);-webkit-mask-image:var(--icon-pencil);mask-image:var(--icon-pencil)}.admonition.seealso{border-left-color:var(--color-admonition-title--seealso)}.admonition.seealso>.admonition-title{background-color:var(--color-admonition-title-background--seealso)}.admonition.seealso>.admonition-title:before{background-color:var(--color-admonition-title--seealso);-webkit-mask-image:var(--icon-info);mask-image:var(--icon-info)}.admonition.admonition-todo{border-left-color:var(--color-admonition-title--admonition-todo)}.admonition.admonition-todo>.admonition-title{background-color:var(--color-admonition-title-background--admonition-todo)}.admonition.admonition-todo>.admonition-title:before{background-color:var(--color-admonition-title--admonition-todo);-webkit-mask-image:var(--icon-pencil);mask-image:var(--icon-pencil)}.admonition-todo>.admonition-title{text-transform:uppercase}dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) dd{margin-left:2rem}dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) dd>:first-child{margin-top:.125rem}dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) .field-list,dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) dd>:last-child{margin-bottom:.75rem}dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) .field-list>dt{font-size:var(--font-size--small);text-transform:uppercase}dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) .field-list dd:empty{margin-bottom:.5rem}dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) .field-list dd>ul{margin-left:-1.2rem}dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) .field-list dd>ul>li>p:nth-child(2){margin-top:0}dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) .field-list dd>ul>li>p+p:last-child:empty{margin-bottom:0;margin-top:0}dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple)>dt{color:var(--color-api-overall)}.sig:not(.sig-inline){background:var(--color-api-background);border-radius:.25rem;font-family:var(--font-stack--monospace);font-size:var(--api-font-size);font-weight:700;margin-left:-.25rem;margin-right:-.25rem;padding:.25rem .5rem .25rem 3em;text-indent:-2.5em;transition:background .1s ease-out}.sig:not(.sig-inline):hover{background:var(--color-api-background-hover)}.sig:not(.sig-inline) a.reference .viewcode-link{font-weight:400;width:4.25rem}em.property{font-style:normal}em.property:first-child{color:var(--color-api-keyword)}.sig-name{color:var(--color-api-name)}.sig-prename{color:var(--color-api-pre-name);font-weight:400}.sig-paren{color:var(--color-api-paren)}.sig-param{font-style:normal}div.deprecated,div.versionadded,div.versionchanged,div.versionremoved{border-left:.1875rem solid;border-radius:.125rem;padding-left:.75rem}div.deprecated p,div.versionadded p,div.versionchanged p,div.versionremoved p{margin-bottom:.125rem;margin-top:.125rem}div.versionadded{border-color:var(--color-api-added-border)}div.versionadded .versionmodified{color:var(--color-api-added)}div.versionchanged{border-color:var(--color-api-changed-border)}div.versionchanged .versionmodified{color:var(--color-api-changed)}div.deprecated{border-color:var(--color-api-deprecated-border)}div.deprecated .versionmodified{color:var(--color-api-deprecated)}div.versionremoved{border-color:var(--color-api-removed-border)}div.versionremoved .versionmodified{color:var(--color-api-removed)}.viewcode-back,.viewcode-link{float:right;text-align:right}.line-block{margin-bottom:.75rem;margin-top:.5rem}.line-block .line-block{margin-bottom:0;margin-top:0;padding-left:1rem}.code-block-caption,article p.caption,table>caption{font-size:var(--font-size--small);text-align:center}.toctree-wrapper.compound .caption,.toctree-wrapper.compound :not(.caption)>.caption-text{font-size:var(--font-size--small);margin-bottom:0;text-align:initial;text-transform:uppercase}.toctree-wrapper.compound>ul{margin-bottom:0;margin-top:0}.sig-inline,code.literal{background:var(--color-inline-code-background);border-radius:.2em;font-size:var(--font-size--small--2);padding:.1em .2em}pre.literal-block .sig-inline,pre.literal-block code.literal{font-size:inherit;padding:0}p .sig-inline,p code.literal{border:1px solid var(--color-background-border)}.sig-inline{font-family:var(--font-stack--monospace)}div[class*=" highlight-"],div[class^=highlight-]{display:flex;margin:1em 0}div[class*=" highlight-"] .table-wrapper,div[class^=highlight-] .table-wrapper,pre{margin:0;padding:0}pre{overflow:auto}article[role=main] .highlight pre{line-height:1.5}.highlight pre,pre.literal-block{font-size:var(--code-font-size);padding:.625rem .875rem}pre.literal-block{background-color:var(--color-code-background);border-radius:.2rem;color:var(--color-code-foreground);margin-bottom:1rem;margin-top:1rem}.highlight{border-radius:.2rem;width:100%}.highlight .gp,.highlight span.linenos{pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.highlight .hll{display:block;margin-left:-.875rem;margin-right:-.875rem;padding-left:.875rem;padding-right:.875rem}.code-block-caption{background-color:var(--color-code-background);border-bottom:1px solid;border-radius:.25rem;border-bottom-left-radius:0;border-bottom-right-radius:0;border-color:var(--color-background-border);color:var(--color-code-foreground);display:flex;font-weight:300;padding:.625rem .875rem}.code-block-caption+div[class]{margin-top:0}.code-block-caption+div[class] pre{border-top-left-radius:0;border-top-right-radius:0}.highlighttable{display:block;width:100%}.highlighttable tbody{display:block}.highlighttable tr{display:flex}.highlighttable td.linenos{background-color:var(--color-code-background);border-bottom-left-radius:.2rem;border-top-left-radius:.2rem;color:var(--color-code-foreground);padding:.625rem 0 .625rem .875rem}.highlighttable .linenodiv{box-shadow:-.0625rem 0 var(--color-foreground-border) inset;font-size:var(--code-font-size);padding-right:.875rem}.highlighttable td.code{display:block;flex:1;overflow:hidden;padding:0}.highlighttable td.code .highlight{border-bottom-left-radius:0;border-top-left-radius:0}.highlight span.linenos{box-shadow:-.0625rem 0 var(--color-foreground-border) inset;display:inline-block;margin-right:.875rem;padding-left:0;padding-right:.875rem}.footnote-reference{font-size:var(--font-size--small--4);vertical-align:super}dl.footnote.brackets{color:var(--color-foreground-secondary);display:grid;font-size:var(--font-size--small);grid-template-columns:max-content auto}dl.footnote.brackets dt{margin:0}dl.footnote.brackets dt>.fn-backref{margin-left:.25rem}dl.footnote.brackets dt:after{content:":"}dl.footnote.brackets dt .brackets:before{content:"["}dl.footnote.brackets dt .brackets:after{content:"]"}dl.footnote.brackets dd{margin:0;padding:0 1rem}aside.footnote{color:var(--color-foreground-secondary);font-size:var(--font-size--small)}aside.footnote>span,div.citation>span{float:left;font-weight:500;padding-right:.25rem}aside.footnote>:not(span),div.citation>p{margin-left:2rem}img{box-sizing:border-box;height:auto;max-width:100%}article .figure,article figure{border-radius:.2rem;margin:0}article .figure :last-child,article figure :last-child{margin-bottom:0}article .align-left{clear:left;float:left;margin:0 1rem 1rem}article .align-right{clear:right;float:right;margin:0 1rem 1rem}article .align-center,article .align-default{display:block;margin-left:auto;margin-right:auto;text-align:center}article table.align-default{display:table;text-align:initial}.domainindex-jumpbox,.genindex-jumpbox{border-bottom:1px solid var(--color-background-border);border-top:1px solid var(--color-background-border);padding:.25rem}.domainindex-section h2,.genindex-section h2{margin-bottom:.5rem;margin-top:.75rem}.domainindex-section ul,.genindex-section ul{margin-bottom:0;margin-top:0}ol,ul{margin-bottom:1rem;margin-top:1rem;padding-left:1.2rem}ol li>p:first-child,ul li>p:first-child{margin-bottom:.25rem;margin-top:.25rem}ol li>p:last-child,ul li>p:last-child{margin-top:.25rem}ol li>ol,ol li>ul,ul li>ol,ul li>ul{margin-bottom:.5rem;margin-top:.5rem}ol.arabic{list-style:decimal}ol.loweralpha{list-style:lower-alpha}ol.upperalpha{list-style:upper-alpha}ol.lowerroman{list-style:lower-roman}ol.upperroman{list-style:upper-roman}.simple li>ol,.simple li>ul,.toctree-wrapper li>ol,.toctree-wrapper li>ul{margin-bottom:0;margin-top:0}.field-list dt,.option-list dt,dl.footnote dt,dl.glossary dt,dl.simple dt,dl:not([class]) dt{font-weight:500;margin-top:.25rem}.field-list dt+dt,.option-list dt+dt,dl.footnote dt+dt,dl.glossary dt+dt,dl.simple dt+dt,dl:not([class]) dt+dt{margin-top:0}.field-list dt .classifier:before,.option-list dt .classifier:before,dl.footnote dt .classifier:before,dl.glossary dt .classifier:before,dl.simple dt .classifier:before,dl:not([class]) dt .classifier:before{content:":";margin-left:.2rem;margin-right:.2rem}.field-list dd ul,.field-list dd>p:first-child,.option-list dd ul,.option-list dd>p:first-child,dl.footnote dd ul,dl.footnote dd>p:first-child,dl.glossary dd ul,dl.glossary dd>p:first-child,dl.simple dd ul,dl.simple dd>p:first-child,dl:not([class]) dd ul,dl:not([class]) dd>p:first-child{margin-top:.125rem}.field-list dd ul,.option-list dd ul,dl.footnote dd ul,dl.glossary dd ul,dl.simple dd ul,dl:not([class]) dd ul{margin-bottom:.125rem}.math-wrapper{overflow-x:auto;width:100%}div.math{position:relative;text-align:center}div.math .headerlink,div.math:focus .headerlink{display:none}div.math:hover .headerlink{display:inline-block}div.math span.eqno{position:absolute;right:.5rem;top:50%;transform:translateY(-50%);z-index:1}abbr[title]{cursor:help}.problematic{color:var(--color-problematic)}kbd:not(.compound){background-color:var(--color-background-secondary);border:1px solid var(--color-foreground-border);border-radius:.2rem;box-shadow:0 .0625rem 0 rgba(0,0,0,.2),inset 0 0 0 .125rem var(--color-background-primary);color:var(--color-foreground-primary);display:inline-block;font-size:var(--font-size--small--3);margin:0 .2rem;padding:0 .2rem;vertical-align:text-bottom}blockquote{background:var(--color-background-secondary);border-left:4px solid var(--color-background-border);margin-left:0;margin-right:0;padding:.5rem 1rem}blockquote .attribution{font-weight:600;text-align:right}blockquote.highlights,blockquote.pull-quote{font-size:1.25em}blockquote.epigraph,blockquote.pull-quote{border-left-width:0;border-radius:.5rem}blockquote.highlights{background:transparent;border-left-width:0}p .reference img{vertical-align:middle}p.rubric{font-size:1.125em;font-weight:700;line-height:1.25}dd p.rubric{font-size:var(--font-size--small);font-weight:inherit;line-height:inherit;text-transform:uppercase}article .sidebar{background-color:var(--color-background-secondary);border:1px solid var(--color-background-border);border-radius:.2rem;clear:right;float:right;margin-left:1rem;margin-right:0;width:30%}article .sidebar>*{padding-left:1rem;padding-right:1rem}article .sidebar>ol,article .sidebar>ul{padding-left:2.2rem}article .sidebar .sidebar-title{border-bottom:1px solid var(--color-background-border);font-weight:500;margin:0;padding:.5rem 1rem}[role=main] .table-wrapper.container{margin-bottom:.5rem;margin-top:1rem;overflow-x:auto;padding:.2rem .2rem .75rem;width:100%}table.docutils{border-collapse:collapse;border-radius:.2rem;border-spacing:0;box-shadow:0 .2rem .5rem rgba(0,0,0,.05),0 0 .0625rem rgba(0,0,0,.1)}table.docutils th{background:var(--color-table-header-background)}table.docutils td,table.docutils th{border-bottom:1px solid var(--color-table-border);border-left:1px solid var(--color-table-border);border-right:1px solid var(--color-table-border);padding:0 .25rem}table.docutils td p,table.docutils th p{margin:.25rem}table.docutils td:first-child,table.docutils th:first-child{border-left:none}table.docutils td:last-child,table.docutils th:last-child{border-right:none}table.docutils td.text-left,table.docutils th.text-left{text-align:left}table.docutils td.text-right,table.docutils th.text-right{text-align:right}table.docutils td.text-center,table.docutils th.text-center{text-align:center}:target{scroll-margin-top:2.5rem}@media(max-width:67em){:target{scroll-margin-top:calc(2.5rem + var(--header-height))}section>span:target{scroll-margin-top:calc(2.8rem + var(--header-height))}}.headerlink{font-weight:100;-webkit-user-select:none;-moz-user-select:none;user-select:none}.code-block-caption>.headerlink,dl dt>.headerlink,figcaption p>.headerlink,h1>.headerlink,h2>.headerlink,h3>.headerlink,h4>.headerlink,h5>.headerlink,h6>.headerlink,p.caption>.headerlink,table>caption>.headerlink{margin-left:.5rem;visibility:hidden}.code-block-caption:hover>.headerlink,dl dt:hover>.headerlink,figcaption p:hover>.headerlink,h1:hover>.headerlink,h2:hover>.headerlink,h3:hover>.headerlink,h4:hover>.headerlink,h5:hover>.headerlink,h6:hover>.headerlink,p.caption:hover>.headerlink,table>caption:hover>.headerlink{visibility:visible}.code-block-caption>.toc-backref,dl dt>.toc-backref,figcaption p>.toc-backref,h1>.toc-backref,h2>.toc-backref,h3>.toc-backref,h4>.toc-backref,h5>.toc-backref,h6>.toc-backref,p.caption>.toc-backref,table>caption>.toc-backref{color:inherit;text-decoration-line:none}figure:hover>figcaption>p>.headerlink,table:hover>caption>.headerlink{visibility:visible}:target>h1:first-of-type,:target>h2:first-of-type,:target>h3:first-of-type,:target>h4:first-of-type,:target>h5:first-of-type,:target>h6:first-of-type,span:target~h1:first-of-type,span:target~h2:first-of-type,span:target~h3:first-of-type,span:target~h4:first-of-type,span:target~h5:first-of-type,span:target~h6:first-of-type{background-color:var(--color-highlight-on-target)}:target>h1:first-of-type code.literal,:target>h2:first-of-type code.literal,:target>h3:first-of-type code.literal,:target>h4:first-of-type code.literal,:target>h5:first-of-type code.literal,:target>h6:first-of-type code.literal,span:target~h1:first-of-type code.literal,span:target~h2:first-of-type code.literal,span:target~h3:first-of-type code.literal,span:target~h4:first-of-type code.literal,span:target~h5:first-of-type code.literal,span:target~h6:first-of-type code.literal{background-color:transparent}.literal-block-wrapper:target .code-block-caption,.this-will-duplicate-information-and-it-is-still-useful-here li :target,figure:target,table:target>caption{background-color:var(--color-highlight-on-target)}dt:target{background-color:var(--color-highlight-on-target)!important}.footnote-reference:target,.footnote>dt:target+dd{background-color:var(--color-highlight-on-target)}.guilabel{background-color:var(--color-guilabel-background);border:1px solid var(--color-guilabel-border);border-radius:.5em;color:var(--color-guilabel-text);font-size:.9em;padding:0 .3em}footer{display:flex;flex-direction:column;font-size:var(--font-size--small);margin-top:2rem}.bottom-of-page{align-items:center;border-top:1px solid var(--color-background-border);color:var(--color-foreground-secondary);display:flex;justify-content:space-between;line-height:1.5;margin-top:1rem;padding-bottom:1rem;padding-top:1rem}@media(max-width:46em){.bottom-of-page{flex-direction:column-reverse;gap:.25rem;text-align:center}}.bottom-of-page .left-details{font-size:var(--font-size--small)}.bottom-of-page .right-details{display:flex;flex-direction:column;gap:.25rem;text-align:right}.bottom-of-page .icons{display:flex;font-size:1rem;gap:.25rem;justify-content:flex-end}.bottom-of-page .icons a{text-decoration:none}.bottom-of-page .icons img,.bottom-of-page .icons svg{font-size:1.125rem;height:1em;width:1em}.related-pages a{align-items:center;display:flex;text-decoration:none}.related-pages a:hover .page-info .title{color:var(--color-link);text-decoration:underline;text-decoration-color:var(--color-link-underline)}.related-pages a svg.furo-related-icon,.related-pages a svg.furo-related-icon>use{color:var(--color-foreground-border);flex-shrink:0;height:.75rem;margin:0 .5rem;width:.75rem}.related-pages a.next-page{clear:right;float:right;max-width:50%;text-align:right}.related-pages a.prev-page{clear:left;float:left;max-width:50%}.related-pages a.prev-page svg{transform:rotate(180deg)}.page-info{display:flex;flex-direction:column;overflow-wrap:anywhere}.next-page .page-info{align-items:flex-end}.page-info .context{align-items:center;color:var(--color-foreground-muted);display:flex;font-size:var(--font-size--small);padding-bottom:.1rem;text-decoration:none}ul.search{list-style:none;padding-left:0}ul.search li{border-bottom:1px solid var(--color-background-border);padding:1rem 0}[role=main] .highlighted{background-color:var(--color-highlighted-background);color:var(--color-highlighted-text)}.sidebar-brand{display:flex;flex-direction:column;flex-shrink:0;padding:var(--sidebar-item-spacing-vertical) var(--sidebar-item-spacing-horizontal);text-decoration:none}.sidebar-brand-text{color:var(--color-sidebar-brand-text);font-size:1.5rem;overflow-wrap:break-word}.sidebar-brand-text,.sidebar-logo-container{margin:var(--sidebar-item-spacing-vertical) 0}.sidebar-logo{display:block;margin:0 auto;max-width:100%}.sidebar-search-container{align-items:center;background:var(--color-sidebar-search-background);display:flex;margin-top:var(--sidebar-search-space-above);position:relative}.sidebar-search-container:focus-within,.sidebar-search-container:hover{background:var(--color-sidebar-search-background--focus)}.sidebar-search-container:before{background-color:var(--color-sidebar-search-icon);content:"";height:var(--sidebar-search-icon-size);left:var(--sidebar-item-spacing-horizontal);-webkit-mask-image:var(--icon-search);mask-image:var(--icon-search);position:absolute;width:var(--sidebar-search-icon-size)}.sidebar-search{background:transparent;border:none;border-bottom:1px solid var(--color-sidebar-search-border);border-top:1px solid var(--color-sidebar-search-border);box-sizing:border-box;color:var(--color-sidebar-search-foreground);padding:var(--sidebar-search-input-spacing-vertical) var(--sidebar-search-input-spacing-horizontal) var(--sidebar-search-input-spacing-vertical) calc(var(--sidebar-item-spacing-horizontal) + var(--sidebar-search-input-spacing-horizontal) + var(--sidebar-search-icon-size));width:100%;z-index:10}.sidebar-search:focus{outline:none}.sidebar-search::-moz-placeholder{font-size:var(--sidebar-search-input-font-size)}.sidebar-search::placeholder{font-size:var(--sidebar-search-input-font-size)}#searchbox .highlight-link{margin:0;padding:var(--sidebar-item-spacing-vertical) var(--sidebar-item-spacing-horizontal) 0;text-align:center}#searchbox .highlight-link a{color:var(--color-sidebar-search-icon);font-size:var(--font-size--small--2)}.sidebar-tree{font-size:var(--sidebar-item-font-size);margin-bottom:var(--sidebar-item-spacing-vertical);margin-top:var(--sidebar-tree-space-above)}.sidebar-tree ul{display:flex;flex-direction:column;list-style:none;margin-bottom:0;margin-top:0;padding:0}.sidebar-tree li{margin:0;position:relative}.sidebar-tree li>ul{margin-left:var(--sidebar-item-spacing-horizontal)}.sidebar-tree .icon,.sidebar-tree .reference{color:var(--color-sidebar-link-text)}.sidebar-tree .reference{box-sizing:border-box;display:inline-block;height:100%;line-height:var(--sidebar-item-line-height);overflow-wrap:anywhere;padding:var(--sidebar-item-spacing-vertical) var(--sidebar-item-spacing-horizontal);text-decoration:none;width:100%}.sidebar-tree .reference:hover{background:var(--color-sidebar-item-background--hover);color:var(--color-sidebar-link-text)}.sidebar-tree .reference.external:after{color:var(--color-sidebar-link-text);content:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%23607D8B' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' viewBox='0 0 24 24'%3E%3Cpath stroke='none' d='M0 0h24v24H0z'/%3E%3Cpath d='M11 7H6a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h9a2 2 0 0 0 2-2v-5M10 14 20 4M15 4h5v5'/%3E%3C/svg%3E");margin:0 .25rem;vertical-align:middle}.sidebar-tree .current-page>.reference{font-weight:700}.sidebar-tree label{align-items:center;cursor:pointer;display:flex;height:var(--sidebar-item-height);justify-content:center;position:absolute;right:0;top:0;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:var(--sidebar-expander-width)}.sidebar-tree .caption,.sidebar-tree :not(.caption)>.caption-text{color:var(--color-sidebar-caption-text);font-size:var(--sidebar-caption-font-size);font-weight:700;margin:var(--sidebar-caption-space-above) 0 0 0;padding:var(--sidebar-item-spacing-vertical) var(--sidebar-item-spacing-horizontal);text-transform:uppercase}.sidebar-tree li.has-children>.reference{padding-right:var(--sidebar-expander-width)}.sidebar-tree .toctree-l1>.reference,.sidebar-tree .toctree-l1>label .icon{color:var(--color-sidebar-link-text--top-level)}.sidebar-tree label{background:var(--color-sidebar-item-expander-background)}.sidebar-tree label:hover{background:var(--color-sidebar-item-expander-background--hover)}.sidebar-tree .current>.reference{background:var(--color-sidebar-item-background--current)}.sidebar-tree .current>.reference:hover{background:var(--color-sidebar-item-background--hover)}.toctree-checkbox{display:none;position:absolute}.toctree-checkbox~ul{display:none}.toctree-checkbox~label .icon svg{transform:rotate(90deg)}.toctree-checkbox:checked~ul{display:block}.toctree-checkbox:checked~label .icon svg{transform:rotate(-90deg)}.toc-title-container{padding:var(--toc-title-padding);padding-top:var(--toc-spacing-vertical)}.toc-title{color:var(--color-toc-title-text);font-size:var(--toc-title-font-size);padding-left:var(--toc-spacing-horizontal);text-transform:uppercase}.no-toc{display:none}.toc-tree-container{padding-bottom:var(--toc-spacing-vertical)}.toc-tree{border-left:1px solid var(--color-background-border);font-size:var(--toc-font-size);line-height:1.3;padding-left:calc(var(--toc-spacing-horizontal) - var(--toc-item-spacing-horizontal))}.toc-tree>ul>li:first-child{padding-top:0}.toc-tree>ul>li:first-child>ul{padding-left:0}.toc-tree>ul>li:first-child>a{display:none}.toc-tree ul{list-style-type:none;margin-bottom:0;margin-top:0;padding-left:var(--toc-item-spacing-horizontal)}.toc-tree li{padding-top:var(--toc-item-spacing-vertical)}.toc-tree li.scroll-current>.reference{color:var(--color-toc-item-text--active);font-weight:700}.toc-tree a.reference{color:var(--color-toc-item-text);overflow-wrap:anywhere;text-decoration:none}.toc-scroll{max-height:100vh;overflow-y:scroll}.contents:not(.this-will-duplicate-information-and-it-is-still-useful-here){background:rgba(255,0,0,.25);color:var(--color-problematic)}.contents:not(.this-will-duplicate-information-and-it-is-still-useful-here):before{content:"ERROR: Adding a table of contents in Furo-based documentation is unnecessary, and does not work well with existing styling. Add a 'this-will-duplicate-information-and-it-is-still-useful-here' class, if you want an escape hatch."}.text-align\:left>p{text-align:left}.text-align\:center>p{text-align:center}.text-align\:right>p{text-align:right} +/*# sourceMappingURL=furo.css.map*/ \ No newline at end of file diff --git a/_static/styles/furo.css.map b/_static/styles/furo.css.map new file mode 100644 index 00000000..3ecc3715 --- /dev/null +++ b/_static/styles/furo.css.map @@ -0,0 +1 @@ +{"version":3,"file":"styles/furo.css","mappings":"AAAA,2EAA2E,CAU3E,KACE,gBAAiB,CACjB,6BACF,CASA,KACE,QACF,CAMA,KACE,aACF,CAOA,GACE,aAAc,CACd,cACF,CAUA,GACE,sBAAuB,CACvB,QAAS,CACT,gBACF,CAOA,IACE,+BAAiC,CACjC,aACF,CASA,EACE,4BACF,CAOA,YACE,kBAAmB,CACnB,yBAA0B,CAC1B,gCACF,CAMA,SAEE,kBACF,CAOA,cAGE,+BAAiC,CACjC,aACF,CAeA,QAEE,aAAc,CACd,aAAc,CACd,iBAAkB,CAClB,uBACF,CAEA,IACE,aACF,CAEA,IACE,SACF,CASA,IACE,iBACF,CAUA,sCAKE,mBAAoB,CACpB,cAAe,CACf,gBAAiB,CACjB,QACF,CAOA,aAEE,gBACF,CAOA,cAEE,mBACF,CAMA,gDAIE,yBACF,CAMA,wHAIE,iBAAkB,CAClB,SACF,CAMA,4GAIE,6BACF,CAMA,SACE,0BACF,CASA,OACE,qBAAsB,CACtB,aAAc,CACd,aAAc,CACd,cAAe,CACf,SAAU,CACV,kBACF,CAMA,SACE,uBACF,CAMA,SACE,aACF,CAOA,6BAEE,qBAAsB,CACtB,SACF,CAMA,kFAEE,WACF,CAOA,cACE,4BAA6B,CAC7B,mBACF,CAMA,yCACE,uBACF,CAOA,6BACE,yBAA0B,CAC1B,YACF,CASA,QACE,aACF,CAMA,QACE,iBACF,CAiBA,kBACE,YACF,CCvVA,aAcE,kEACE,uBAOF,WACE,iDAMF,kCACE,wBAEF,qCAEE,uBADA,uBACA,CAEF,SACE,wBAtBA,CCpBJ,iBAGE,qBAEA,sBACA,0BAFA,oBAHA,4BACA,oBAKA,6BAIA,2CAFA,mBACA,sCAFA,4BAGA,CAEF,gBACE,aCTF,KCGE,mHAEA,wGAEA,wCAAyC,CAEzC,wBAAyB,CACzB,wBAAyB,CACzB,4BAA6B,CAC7B,yBAA0B,CAC1B,2BAA4B,CAG5B,sDAAuD,CACvD,gDAAiD,CACjD,wDAAyD,CAGzD,0CAA2C,CAC3C,gDAAiD,CACjD,gDAAiD,CAKjD,gCAAiC,CACjC,sCAAuC,CAGvC,2CAA4C,CAG5C,uCAAwC,CCjCxC,+FAGA,uBAAwB,CAGxB,iCAAkC,CAClC,kCAAmC,CAEnC,+BAAgC,CAChC,sCAAuC,CACvC,sCAAuC,CACvC,qGAIA,mDAAoD,CAEpD,mCAAoC,CACpC,8CAA+C,CAC/C,gDAAiD,CACjD,kCAAmC,CACnC,6DAA8D,CAG9D,6BAA8B,CAC9B,6BAA8B,CAC9B,+BAAgC,CAChC,kCAAmC,CACnC,kCAAmC,CCPjC,+jBCYA,iqCAZF,iaCVA,8KAOA,4SAWA,4SAUA,0CACA,gEAGA,0CAGA,gEAGA,yCACA,+DAIA,4CACA,kEAGA,wCAUA,8DACA,uCAGA,4DACA,sCACA,2DAGA,4CACA,kEACA,uCAGA,6DACA,2GAGA,sHAEA,yFAEA,+CACA,+EAGA,4MAOA,gCACA,sHAIA,kCACA,uEACA,gEACA,4DACA,kEAGA,2DACA,sDACA,0CACA,8CACA,wGAGA,0BACA,iCAGA,+DACA,+BACA,sCACA,+DAEA,kGACA,oCACA,yDACA,sCL7HF,kCAEA,sDAIA,0CK2HE,kEAIA,oDACA,sDAGA,oCACA,oEAEA,0DACA,qDAIA,oDACA,6DAIA,iEAIA,2DAIA,2DAGA,4DACA,gEAIA,gEAEA,gFAEA,oNASA,qDLxKE,gFAGE,4DAIF,oEKkHF,yEAEA,6DAGA,0DAEA,uDACA,qDACA,wDAIA,6DAIA,yDACA,2DAIA,uCAGA,wCACA,sDAGA,+CAGA,6DAEA,iDACA,+DAEA,wDAEA,sEAMA,0DACA,sBACA,mEL9JI,wEAEA,iCACE,+BAMN,wEAGA,iCACE,kFAEA,uEAIF,gEACE,8BAGF,qEMvDA,sCAKA,wFAKA,iCAIA,0BAWA,iCACA,4BACA,mCAGA,+BAEA,sCACA,4BAEA,mCAEA,sCAKA,sDAIA,gCAEA,gEAQF,wCAME,sBACA,kCAKA,uBAEA,gEAIA,2BAIA,mCAEA,qCACA,iCAGE,+BACA,wEAEE,iCACA,kFAGF,6BACA,0CACF,kCAEE,8BACE,8BACA,qEAEE,sCACA,wFCnFN,iCAGF,2DAEE,4BACA,oCAGA,mIAGA,4HACE,gEAMJ,+CAGE,sBACA,yCAEF,uBAEE,sEAKA,gDACA,kEAGA,iFAGE,YAGF,EACA,4HAQF,mBACE,6BACA,mBACA,wCACA,wCACA,2CAIA,eAGA,mBAKE,mBAGA,CAJA,uCACA,iBAFF,gBACE,CAKE,mBACA,mBAGJ,oBAIF,+BAGE,kDACA,OADA,kBAGA,CAFA,gBAEA,mBACA,oBAEA,sCACA,OAGF,cAHE,WAGF,GAEE,oBACA,CAHF,gBAGE,CC9Gc,YDiHd,+CAIF,SAEE,CAPF,UACE,wBAMA,4BAEA,GAGA,uBACA,CAJA,yBAGA,CACA,iDAKA,2CAGA,2DAQA,iBACA,uCAGA,kEAKE,SAKJ,8BACE,yDACA,2BAEA,oBACA,8BAEA,yDAEE,4BAEJ,uCACE,CACA,iEAGA,CAEA,wCACE,uBACA,kDAEA,0DAEE,CAJF,oBAIE,0GAWN,aACE,CAHA,YAGA,4HASA,+CAGF,sBACE,WACA,WAQA,4BAFF,0CAEE,CARA,qCAsBA,CAdA,iBAEA,kBACE,aADF,4BACE,WAMF,2BAGF,qCAEE,CAXE,UAWF,+BAGA,uBAEA,SAEA,0CAIE,CANF,qCAEA,CAIE,2DACE,gBAIN,+CAIA,CAEA,kDAKE,CAPF,8BAEA,CAOE,YACA,CAjBI,2BAGN,CAHM,WAcJ,UAGA,CAEA,2GAIF,iCAGE,8BAIA,qBACA,oBACF,uBAOI,0CAIA,CATF,6DAKE,CALF,sBASE,qCAKF,CACE,cACA,CAFF,sBAEE,CACA,+BAEA,qBAEE,WAKN,aACE,sCAGA,mBAEA,6BAMA,kCACA,CAJA,sBACA,aAEA,CAJA,eACA,MAIA,2FAEA,UAGA,YACA,sBACE,8BAEA,CALF,aACA,WAIE,OACA,oBAEF,uBACE,WAEF,YAFE,UAEF,eAgBA,kBACE,CAhBA,qDAQF,qCAGF,CAGI,YACF,CAJF,2BAGI,CAEA,eACA,qBAGA,mEAEA,qBACA,8BAIA,kBADF,kBACE,yBAEJ,oCAGI,qDAIJ,+BAGI,oCAEA,+CAQF,4CACE,yBACF,2BAOE,sBACA,CAHA,WACA,CAFF,cACE,CAJA,YAGF,CAEE,SAEA,mBAGA,kDAEE,CAJF,cAEA,cAEE,sBAEA,mBADA,YACA,uBACA,mDACE,CADF,YACE,iDAEA,uCAEN,+DAOE,mBADF,sBACE,mBAGF,aACE,sCAIA,aADF,WACE,CAKF,SACE,CAHJ,kBAEE,CAJE,gBAEJ,CAHI,iBAMA,yFAKA,aACA,eACA,cElbJ,iBAEE,aADA,iBACA,6BAEA,kCAEA,SACA,UAIA,gCACA,CALA,SAEA,SAEA,CAJA,0EAEA,CAFA,OAKA,CAGA,mDACE,iBAGF,gCACE,CADF,UACE,aAEJ,iCAEE,CAFF,UAEE,wCAEA,WACA,WADA,UACA,CACA,4CAGA,MACA,CADA,KACA,wCACA,UAGA,CAJA,UAIA,6DAUA,0CACE,CAFF,mBAEE,wEACA,CAVA,YACA,CAMF,mBAJE,OAOA,gBAJJ,gCACE,CANE,cACA,CAHA,oBACA,CAGA,QAGJ,CAII,0BACA,CADA,UACA,wCAEJ,kBACE,0DACA,gCACE,kBACA,CADA,YACA,oEACA,2CAMF,mDAII,CALN,YACE,CANE,cAKJ,CACE,iBAII,kEACA,yCACE,kDACA,yDACE,+CACA,uBANN,CAMM,+BANN,uCACE,qDACA,4BAEE,mBADA,0CACA,CADA,qBACA,0DACE,wCACA,sGALJ,oCACA,sBACE,kBAFF,UAEE,2CACA,wFACE,cACA,kEANN,uBACE,iDACA,CADA,UACA,0DACE,wDAEE,iEACA,qEANN,sCACE,CAGE,iBAHF,gBAGE,qBACE,CAJJ,uBACA,gDACE,wDACA,6DAHF,2CACA,CADA,gBACA,eACE,CAGE,sBANN,8BACE,CAII,iBAFF,4DACA,WACE,YADF,uCACE,6EACA,2BANN,8CACE,kDACA,0CACE,8BACA,yFACE,sBACA,sFALJ,mEACA,sBACE,kEACA,6EACE,uCACA,kEALJ,qGAEE,kEACA,6EACE,uCACA,kEALJ,8CACA,uDACE,sEACA,2EACE,sCACA,iEALJ,mGACA,qCACE,oDACA,0DACE,6GACA,gDAGR,yDCrEA,sEACE,CACA,6GACE,gEACF,iGAIF,wFACE,qDAGA,mGAEE,2CAEF,4FACE,gCACF,wGACE,8DAEE,6FAIA,iJAKN,6GACE,gDAKF,yDACA,qCAGA,6BACA,kBACA,qDAKA,oCAEA,+DAGA,2CAGE,oDAIA,oEAEE,qBAGJ,wDAEE,uCAEF,kEAGA,8CAEA,uDAIF,gEAIE,6BACA,gEAIA,+CACE,0EAIF,sDAEE,+DAGF,sCACA,8BACE,oCAEJ,wBACE,4FAEE,gBAEJ,yGAGI,kBAGJ,CCnHE,2MCFF,oBAGE,wGAKA,iCACE,CADF,wBACE,8GAQA,mBCjBJ,2GAIE,mBACA,6HAMA,YACE,mIAYF,eACA,CAHF,YAGE,4FAGE,8BAKF,uBAkBE,sCACA,CADA,qBAbA,wCAIA,CALF,8BACE,CADF,gBAKE,wCACA,CAOA,kDACA,CACA,kCAKF,6BAGA,4CACE,kDACA,eAGF,cACE,aACA,iBACA,yBACA,8BACA,WAGJ,2BACE,cAGA,+BACA,CAHA,eAGA,wCACA,YACA,iBACA,uEAGA,0BACA,2CAEA,8EAGI,qBACA,CAFF,kBAEE,kBAGN,0CAGE,mCAGA,4BAIA,gEACE,qCACA,8BAEA,gBACA,+CACA,iCAEF,iCAEE,gEACA,qCAGF,8BAEE,+BAIA,yCAEE,qBADA,gBACA,yBAKF,eACA,CAFF,YACE,CACA,iBACA,qDAEA,mDCvIJ,2FAOE,iCACA,CAEA,eACA,CAHA,kBAEA,CAFA,wBAGA,8BACA,eACE,CAFF,YAEE,0BACA,8CAGA,oBACE,oCAGA,kBACE,8DAEA,iBAEN,UACE,8BAIJ,+CAEE,qDAEF,kDAIE,YAEF,CAFE,YAEF,CCpCE,mFADA,kBAKE,CAJF,IAGA,aACE,mCAGA,iDACE,+BAEJ,wBAEE,mBAMA,6CAEF,CAJE,mBAEA,CAEF,kCAGE,CARF,kBACE,CAHA,eAUA,YACA,mBACA,CADA,UACA,wCC9BF,oBDkCE,wBCnCJ,uCACE,+BACA,+DACA,sBAGA,qBCDA,6CAIE,CAPF,uBAGA,CDGE,oBACF,yDAEE,CCDE,2CAGF,CAJA,kCACE,CDJJ,YACE,CAIA,eCTF,CDKE,uBCMA,gCACE,YAEF,oCAEE,wBACA,0BAIF,iBAEA,cADF,UACE,uBAEA,iCAEA,wCAEA,6CAMA,CAYF,gCATI,4BASJ,CAZE,mCAEE,iCAUJ,4BAGE,4DADA,+BACA,CAHF,qBAGE,sCACE,OAEF,iBAHA,SAGA,iHACE,2DAKF,CANA,8EAMA,uSAEE,kBAEF,+FACE,yCCjEJ,WACA,yBAGA,uBACA,gBAEA,uCAIA,CAJA,iCAIA,uCAGA,UACE,gBACA,qBAEA,0CClBJ,gBACE,KAGF,qBACE,YAGF,CAHE,cAGF,gCAEE,mBACA,iEAEA,oCACA,wCAEA,sBACA,WAEA,CAFA,YAEA,8EAEA,mCAFA,iBAEA,6BAIA,wEAKA,sDAIE,CARF,mDAIA,CAIE,cAEF,8CAIA,oBAFE,iBAEF,8CAGE,eAEF,CAFE,YAEF,OAEE,kBAGJ,CAJI,eACA,CAFF,mBAKF,yCCjDE,oBACA,CAFA,iBAEA,uCAKE,iBACA,qCAGA,mBCZJ,CDWI,gBCXJ,6BAEE,eACA,sBAGA,eAEA,sBACA,oDACA,iGAMA,gBAFE,YAEF,8FAME,iJCnBF,YACA,gNAWE,gDAEF,iSAaE,kBACE,gHAKF,oCACE,eACF,CADE,UACF,8CACE,gDACF,wCACE,oBCxCJ,oBAEF,6BACE,QACE,kDAGF,yBACE,kDAmBA,kDAEF,CAhBA,+CAaA,CAbA,oBAaA,0FACE,CADF,gGAfF,cACE,gBACA,CAaA,0BAGA,mQACE,gBAGF,oMACE,iBACA,CAFF,eACE,CADF,gBAEE,aAGJ,iCAEE,CAFF,wCAEE,wBAUE,+VAIE,uEAHA,2BAGA,wXAKJ,iDAGF,CARM,+CACE,iDAIN,CALI,gBAQN,mHACE,gBAGF,2DACE,0EAOA,0EAGF,gBAEE,6DC/EA,kDACA,gCACA,qDAGA,qBACA,qDCFA,cACA,eAEA,yBAGF,sBAEE,iBACA,sNAWA,iBACE,kBACA,wRAgBA,kBAEA,iOAgBA,uCACE,uEAEA,kBAEF,qUAuBE,iDAIJ,CACA,geCxFF,4BAEE,CAQA,6JACA,iDAIA,sEAGA,mDAOF,iDAGE,4DAIA,8CACA,qDAEE,eAFF,cAEE,oBAEF,uBAFE,kCAGA,eACA,iBACA,mBAIA,mDACA,CAHA,uCAEA,CAJA,0CACA,CAIA,gBAJA,gBACA,oBADA,gBAIA,wBAEJ,gBAGE,6BACA,YAHA,iBAGA,gCACA,iEAEA,6CACA,sDACA,0BADA,wBACA,0BACA,oIAIA,mBAFA,YAEA,qBACA,0CAIE,uBAEF,CAHA,yBACE,CAEF,iDACE,mFAKJ,oCACE,CANE,aAKJ,CACE,qEAIA,YAFA,WAEA,CAHA,aACA,CAEA,gBACE,4BACA,sBADA,aACA,gCAMF,oCACA,yDACA,2CAEA,qBAGE,kBAEA,CACA,mCAIF,CARE,YACA,CAOF,iCAEE,CAPA,oBACA,CAQA,oBACE,uDAEJ,sDAGA,CAHA,cAGA,0BACE,oDAIA,oCACA,4BACA,sBAGA,cAEA,oFAGA,sBAEA,yDACE,CAIF,iBAJE,wBAIF,6CAHE,6CAKA,eACA,aACA,CADA,cACA,yCAGJ,kBACE,CAKA,iDAEA,CARF,aACE,4CAGA,kBAIA,wEAGA,wDAGA,kCAOA,iDAGA,CAPF,WAEE,sCAEA,CAJF,2CACE,CAMA,qCACA,+BARF,kBACE,qCAOA,iBAsBA,sBACE,CAvBF,WAKA,CACE,0DAIF,CALA,uDACE,CANF,sBAqBA,4CACA,CALA,gRAIA,YAEE,6CAEN,mCAEE,+CASA,6EAIA,4BChNA,SDmNA,qFCnNA,gDACA,sCAGA,qCACA,sDACA,CAKA,kDAGA,CARA,0CAQA,kBAGA,YACA,sBACA,iBAFA,gBADF,YACE,CAHA,SAKA,kBAEA,SAFA,iBAEA,uEAGA,CAEE,6CAFF,oCAgBI,CAdF,yBACE,qBACF,CAGF,oBACE,CAIF,WACE,CALA,2CAGA,uBACF,CACE,mFAGE,CALF,qBAEA,UAGE,gCAIF,sDAEA,CALE,oCAKF,yCC7CJ,oCACE,CD+CA,yXAQE,sCCrDJ,wCAGA,oCACE","sources":["webpack:///./node_modules/normalize.css/normalize.css","webpack:///./src/furo/assets/styles/base/_print.sass","webpack:///./src/furo/assets/styles/base/_screen-readers.sass","webpack:///./src/furo/assets/styles/base/_theme.sass","webpack:///./src/furo/assets/styles/variables/_fonts.scss","webpack:///./src/furo/assets/styles/variables/_spacing.scss","webpack:///./src/furo/assets/styles/variables/_icons.scss","webpack:///./src/furo/assets/styles/variables/_admonitions.scss","webpack:///./src/furo/assets/styles/variables/_colors.scss","webpack:///./src/furo/assets/styles/base/_typography.sass","webpack:///./src/furo/assets/styles/_scaffold.sass","webpack:///./src/furo/assets/styles/variables/_layout.scss","webpack:///./src/furo/assets/styles/content/_admonitions.sass","webpack:///./src/furo/assets/styles/content/_api.sass","webpack:///./src/furo/assets/styles/content/_blocks.sass","webpack:///./src/furo/assets/styles/content/_captions.sass","webpack:///./src/furo/assets/styles/content/_code.sass","webpack:///./src/furo/assets/styles/content/_footnotes.sass","webpack:///./src/furo/assets/styles/content/_images.sass","webpack:///./src/furo/assets/styles/content/_indexes.sass","webpack:///./src/furo/assets/styles/content/_lists.sass","webpack:///./src/furo/assets/styles/content/_math.sass","webpack:///./src/furo/assets/styles/content/_misc.sass","webpack:///./src/furo/assets/styles/content/_rubrics.sass","webpack:///./src/furo/assets/styles/content/_sidebar.sass","webpack:///./src/furo/assets/styles/content/_tables.sass","webpack:///./src/furo/assets/styles/content/_target.sass","webpack:///./src/furo/assets/styles/content/_gui-labels.sass","webpack:///./src/furo/assets/styles/components/_footer.sass","webpack:///./src/furo/assets/styles/components/_sidebar.sass","webpack:///./src/furo/assets/styles/components/_table_of_contents.sass","webpack:///./src/furo/assets/styles/_shame.sass"],"sourcesContent":["/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */\n\n/* Document\n ========================================================================== */\n\n/**\n * 1. Correct the line height in all browsers.\n * 2. Prevent adjustments of font size after orientation changes in iOS.\n */\n\nhtml {\n line-height: 1.15; /* 1 */\n -webkit-text-size-adjust: 100%; /* 2 */\n}\n\n/* Sections\n ========================================================================== */\n\n/**\n * Remove the margin in all browsers.\n */\n\nbody {\n margin: 0;\n}\n\n/**\n * Render the `main` element consistently in IE.\n */\n\nmain {\n display: block;\n}\n\n/**\n * Correct the font size and margin on `h1` elements within `section` and\n * `article` contexts in Chrome, Firefox, and Safari.\n */\n\nh1 {\n font-size: 2em;\n margin: 0.67em 0;\n}\n\n/* Grouping content\n ========================================================================== */\n\n/**\n * 1. Add the correct box sizing in Firefox.\n * 2. Show the overflow in Edge and IE.\n */\n\nhr {\n box-sizing: content-box; /* 1 */\n height: 0; /* 1 */\n overflow: visible; /* 2 */\n}\n\n/**\n * 1. Correct the inheritance and scaling of font size in all browsers.\n * 2. Correct the odd `em` font sizing in all browsers.\n */\n\npre {\n font-family: monospace, monospace; /* 1 */\n font-size: 1em; /* 2 */\n}\n\n/* Text-level semantics\n ========================================================================== */\n\n/**\n * Remove the gray background on active links in IE 10.\n */\n\na {\n background-color: transparent;\n}\n\n/**\n * 1. Remove the bottom border in Chrome 57-\n * 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari.\n */\n\nabbr[title] {\n border-bottom: none; /* 1 */\n text-decoration: underline; /* 2 */\n text-decoration: underline dotted; /* 2 */\n}\n\n/**\n * Add the correct font weight in Chrome, Edge, and Safari.\n */\n\nb,\nstrong {\n font-weight: bolder;\n}\n\n/**\n * 1. Correct the inheritance and scaling of font size in all browsers.\n * 2. Correct the odd `em` font sizing in all browsers.\n */\n\ncode,\nkbd,\nsamp {\n font-family: monospace, monospace; /* 1 */\n font-size: 1em; /* 2 */\n}\n\n/**\n * Add the correct font size in all browsers.\n */\n\nsmall {\n font-size: 80%;\n}\n\n/**\n * Prevent `sub` and `sup` elements from affecting the line height in\n * all browsers.\n */\n\nsub,\nsup {\n font-size: 75%;\n line-height: 0;\n position: relative;\n vertical-align: baseline;\n}\n\nsub {\n bottom: -0.25em;\n}\n\nsup {\n top: -0.5em;\n}\n\n/* Embedded content\n ========================================================================== */\n\n/**\n * Remove the border on images inside links in IE 10.\n */\n\nimg {\n border-style: none;\n}\n\n/* Forms\n ========================================================================== */\n\n/**\n * 1. Change the font styles in all browsers.\n * 2. Remove the margin in Firefox and Safari.\n */\n\nbutton,\ninput,\noptgroup,\nselect,\ntextarea {\n font-family: inherit; /* 1 */\n font-size: 100%; /* 1 */\n line-height: 1.15; /* 1 */\n margin: 0; /* 2 */\n}\n\n/**\n * Show the overflow in IE.\n * 1. Show the overflow in Edge.\n */\n\nbutton,\ninput { /* 1 */\n overflow: visible;\n}\n\n/**\n * Remove the inheritance of text transform in Edge, Firefox, and IE.\n * 1. Remove the inheritance of text transform in Firefox.\n */\n\nbutton,\nselect { /* 1 */\n text-transform: none;\n}\n\n/**\n * Correct the inability to style clickable types in iOS and Safari.\n */\n\nbutton,\n[type=\"button\"],\n[type=\"reset\"],\n[type=\"submit\"] {\n -webkit-appearance: button;\n}\n\n/**\n * Remove the inner border and padding in Firefox.\n */\n\nbutton::-moz-focus-inner,\n[type=\"button\"]::-moz-focus-inner,\n[type=\"reset\"]::-moz-focus-inner,\n[type=\"submit\"]::-moz-focus-inner {\n border-style: none;\n padding: 0;\n}\n\n/**\n * Restore the focus styles unset by the previous rule.\n */\n\nbutton:-moz-focusring,\n[type=\"button\"]:-moz-focusring,\n[type=\"reset\"]:-moz-focusring,\n[type=\"submit\"]:-moz-focusring {\n outline: 1px dotted ButtonText;\n}\n\n/**\n * Correct the padding in Firefox.\n */\n\nfieldset {\n padding: 0.35em 0.75em 0.625em;\n}\n\n/**\n * 1. Correct the text wrapping in Edge and IE.\n * 2. Correct the color inheritance from `fieldset` elements in IE.\n * 3. Remove the padding so developers are not caught out when they zero out\n * `fieldset` elements in all browsers.\n */\n\nlegend {\n box-sizing: border-box; /* 1 */\n color: inherit; /* 2 */\n display: table; /* 1 */\n max-width: 100%; /* 1 */\n padding: 0; /* 3 */\n white-space: normal; /* 1 */\n}\n\n/**\n * Add the correct vertical alignment in Chrome, Firefox, and Opera.\n */\n\nprogress {\n vertical-align: baseline;\n}\n\n/**\n * Remove the default vertical scrollbar in IE 10+.\n */\n\ntextarea {\n overflow: auto;\n}\n\n/**\n * 1. Add the correct box sizing in IE 10.\n * 2. Remove the padding in IE 10.\n */\n\n[type=\"checkbox\"],\n[type=\"radio\"] {\n box-sizing: border-box; /* 1 */\n padding: 0; /* 2 */\n}\n\n/**\n * Correct the cursor style of increment and decrement buttons in Chrome.\n */\n\n[type=\"number\"]::-webkit-inner-spin-button,\n[type=\"number\"]::-webkit-outer-spin-button {\n height: auto;\n}\n\n/**\n * 1. Correct the odd appearance in Chrome and Safari.\n * 2. Correct the outline style in Safari.\n */\n\n[type=\"search\"] {\n -webkit-appearance: textfield; /* 1 */\n outline-offset: -2px; /* 2 */\n}\n\n/**\n * Remove the inner padding in Chrome and Safari on macOS.\n */\n\n[type=\"search\"]::-webkit-search-decoration {\n -webkit-appearance: none;\n}\n\n/**\n * 1. Correct the inability to style clickable types in iOS and Safari.\n * 2. Change font properties to `inherit` in Safari.\n */\n\n::-webkit-file-upload-button {\n -webkit-appearance: button; /* 1 */\n font: inherit; /* 2 */\n}\n\n/* Interactive\n ========================================================================== */\n\n/*\n * Add the correct display in Edge, IE 10+, and Firefox.\n */\n\ndetails {\n display: block;\n}\n\n/*\n * Add the correct display in all browsers.\n */\n\nsummary {\n display: list-item;\n}\n\n/* Misc\n ========================================================================== */\n\n/**\n * Add the correct display in IE 10+.\n */\n\ntemplate {\n display: none;\n}\n\n/**\n * Add the correct display in IE 10.\n */\n\n[hidden] {\n display: none;\n}\n","// This file contains styles for managing print media.\n\n////////////////////////////////////////////////////////////////////////////////\n// Hide elements not relevant to print media.\n////////////////////////////////////////////////////////////////////////////////\n@media print\n // Hide icon container.\n .content-icon-container\n display: none !important\n\n // Hide showing header links if hovering over when printing.\n .headerlink\n display: none !important\n\n // Hide mobile header.\n .mobile-header\n display: none !important\n\n // Hide navigation links.\n .related-pages\n display: none !important\n\n////////////////////////////////////////////////////////////////////////////////\n// Tweaks related to decolorization.\n////////////////////////////////////////////////////////////////////////////////\n@media print\n // Apply a border around code which no longer have a color background.\n .highlight\n border: 0.1pt solid var(--color-foreground-border)\n\n////////////////////////////////////////////////////////////////////////////////\n// Avoid page break in some relevant cases.\n////////////////////////////////////////////////////////////////////////////////\n@media print\n ul, ol, dl, a, table, pre, blockquote, p\n page-break-inside: avoid\n\n h1, h2, h3, h4, h5, h6, img, figure, caption\n page-break-inside: avoid\n page-break-after: avoid\n\n ul, ol, dl\n page-break-before: avoid\n",".visually-hidden\n position: absolute !important\n width: 1px !important\n height: 1px !important\n padding: 0 !important\n margin: -1px !important\n overflow: hidden !important\n clip: rect(0,0,0,0) !important\n white-space: nowrap !important\n border: 0 !important\n color: var(--color-foreground-primary)\n background: var(--color-background-primary)\n\n:-moz-focusring\n outline: auto\n","// This file serves as the \"skeleton\" of the theming logic.\n//\n// This contains the bulk of the logic for handling dark mode, color scheme\n// toggling and the handling of color-scheme-specific hiding of elements.\n\nbody\n @include fonts\n @include spacing\n @include icons\n @include admonitions\n @include default-admonition(#651fff, \"abstract\")\n @include default-topic(#14B8A6, \"pencil\")\n\n @include colors\n\n.only-light\n display: block !important\nhtml body .only-dark\n display: none !important\n\n// Ignore dark-mode hints if print media.\n@media not print\n // Enable dark-mode, if requested.\n body[data-theme=\"dark\"]\n @include colors-dark\n\n html & .only-light\n display: none !important\n .only-dark\n display: block !important\n\n // Enable dark mode, unless explicitly told to avoid.\n @media (prefers-color-scheme: dark)\n body:not([data-theme=\"light\"])\n @include colors-dark\n\n html & .only-light\n display: none !important\n .only-dark\n display: block !important\n\n//\n// Theme toggle presentation\n//\nbody[data-theme=\"auto\"]\n .theme-toggle svg.theme-icon-when-auto-light\n display: block\n\n @media (prefers-color-scheme: dark)\n .theme-toggle svg.theme-icon-when-auto-dark\n display: block\n .theme-toggle svg.theme-icon-when-auto-light\n display: none\n\nbody[data-theme=\"dark\"]\n .theme-toggle svg.theme-icon-when-dark\n display: block\n\nbody[data-theme=\"light\"]\n .theme-toggle svg.theme-icon-when-light\n display: block\n","// Fonts used by this theme.\n//\n// There are basically two things here -- using the system font stack and\n// defining sizes for various elements in %ages. We could have also used `em`\n// but %age is easier to reason about for me.\n\n@mixin fonts {\n // These are adapted from https://systemfontstack.com/\n --font-stack: -apple-system, BlinkMacSystemFont, Segoe UI, Helvetica, Arial,\n sans-serif, Apple Color Emoji, Segoe UI Emoji;\n --font-stack--monospace: \"SFMono-Regular\", Menlo, Consolas, Monaco,\n Liberation Mono, Lucida Console, monospace;\n --font-stack--headings: var(--font-stack);\n\n --font-size--normal: 100%;\n --font-size--small: 87.5%;\n --font-size--small--2: 81.25%;\n --font-size--small--3: 75%;\n --font-size--small--4: 62.5%;\n\n // Sidebar\n --sidebar-caption-font-size: var(--font-size--small--2);\n --sidebar-item-font-size: var(--font-size--small);\n --sidebar-search-input-font-size: var(--font-size--small);\n\n // Table of Contents\n --toc-font-size: var(--font-size--small--3);\n --toc-font-size--mobile: var(--font-size--normal);\n --toc-title-font-size: var(--font-size--small--4);\n\n // Admonitions\n //\n // These aren't defined in terms of %ages, since nesting these is permitted.\n --admonition-font-size: 0.8125rem;\n --admonition-title-font-size: 0.8125rem;\n\n // Code\n --code-font-size: var(--font-size--small--2);\n\n // API\n --api-font-size: var(--font-size--small);\n}\n","// Spacing for various elements on the page\n//\n// If the user wants to tweak things in a certain way, they are permitted to.\n// They also have to deal with the consequences though!\n\n@mixin spacing {\n // Header!\n --header-height: calc(\n var(--sidebar-item-line-height) + 4 * #{var(--sidebar-item-spacing-vertical)}\n );\n --header-padding: 0.5rem;\n\n // Sidebar\n --sidebar-tree-space-above: 1.5rem;\n --sidebar-caption-space-above: 1rem;\n\n --sidebar-item-line-height: 1rem;\n --sidebar-item-spacing-vertical: 0.5rem;\n --sidebar-item-spacing-horizontal: 1rem;\n --sidebar-item-height: calc(\n var(--sidebar-item-line-height) + 2 *#{var(--sidebar-item-spacing-vertical)}\n );\n\n --sidebar-expander-width: var(--sidebar-item-height); // be square\n\n --sidebar-search-space-above: 0.5rem;\n --sidebar-search-input-spacing-vertical: 0.5rem;\n --sidebar-search-input-spacing-horizontal: 0.5rem;\n --sidebar-search-input-height: 1rem;\n --sidebar-search-icon-size: var(--sidebar-search-input-height);\n\n // Table of Contents\n --toc-title-padding: 0.25rem 0;\n --toc-spacing-vertical: 1.5rem;\n --toc-spacing-horizontal: 1.5rem;\n --toc-item-spacing-vertical: 0.4rem;\n --toc-item-spacing-horizontal: 1rem;\n}\n","// Expose theme icons as CSS variables.\n\n$icons: (\n // Adapted from tabler-icons\n // url: https://tablericons.com/\n \"search\":\n url('data:image/svg+xml;charset=utf-8,'),\n // Factored out from mkdocs-material on 24-Aug-2020.\n // url: https://squidfunk.github.io/mkdocs-material/reference/admonitions/\n \"pencil\":\n url('data:image/svg+xml;charset=utf-8,'),\n \"abstract\":\n url('data:image/svg+xml;charset=utf-8,'),\n \"info\":\n url('data:image/svg+xml;charset=utf-8,'),\n \"flame\":\n url('data:image/svg+xml;charset=utf-8,'),\n \"question\":\n url('data:image/svg+xml;charset=utf-8,'),\n \"warning\":\n url('data:image/svg+xml;charset=utf-8,'),\n \"failure\":\n url('data:image/svg+xml;charset=utf-8,'),\n \"spark\":\n url('data:image/svg+xml;charset=utf-8,')\n);\n\n@mixin icons {\n @each $name, $glyph in $icons {\n --icon-#{$name}: #{$glyph};\n }\n}\n","// Admonitions\n\n// Structure of these is:\n// admonition-class: color \"icon-name\";\n//\n// The colors are translated into CSS variables below. The icons are\n// used directly in the main declarations to set the `mask-image` in\n// the title.\n\n// prettier-ignore\n$admonitions: (\n // Each of these has an reST directives for it.\n \"caution\": #ff9100 \"spark\",\n \"warning\": #ff9100 \"warning\",\n \"danger\": #ff5252 \"spark\",\n \"attention\": #ff5252 \"warning\",\n \"error\": #ff5252 \"failure\",\n \"hint\": #00c852 \"question\",\n \"tip\": #00c852 \"info\",\n \"important\": #00bfa5 \"flame\",\n \"note\": #00b0ff \"pencil\",\n \"seealso\": #448aff \"info\",\n \"admonition-todo\": #808080 \"pencil\"\n);\n\n@mixin default-admonition($color, $icon-name) {\n --color-admonition-title: #{$color};\n --color-admonition-title-background: #{rgba($color, 0.2)};\n\n --icon-admonition-default: var(--icon-#{$icon-name});\n}\n\n@mixin default-topic($color, $icon-name) {\n --color-topic-title: #{$color};\n --color-topic-title-background: #{rgba($color, 0.2)};\n\n --icon-topic-default: var(--icon-#{$icon-name});\n}\n\n@mixin admonitions {\n @each $name, $values in $admonitions {\n --color-admonition-title--#{$name}: #{nth($values, 1)};\n --color-admonition-title-background--#{$name}: #{rgba(\n nth($values, 1),\n 0.2\n )};\n }\n}\n","// Colors used throughout this theme.\n//\n// The aim is to give the user more control. Thus, instead of hard-coding colors\n// in various parts of the stylesheet, the approach taken is to define all\n// colors as CSS variables and reusing them in all the places.\n//\n// `colors-dark` depends on `colors` being included at a lower specificity.\n\n@mixin colors {\n --color-problematic: #b30000;\n\n // Base Colors\n --color-foreground-primary: black; // for main text and headings\n --color-foreground-secondary: #5a5c63; // for secondary text\n --color-foreground-muted: #6b6f76; // for muted text\n --color-foreground-border: #878787; // for content borders\n\n --color-background-primary: white; // for content\n --color-background-secondary: #f8f9fb; // for navigation + ToC\n --color-background-hover: #efeff4ff; // for navigation-item hover\n --color-background-hover--transparent: #efeff400;\n --color-background-border: #eeebee; // for UI borders\n --color-background-item: #ccc; // for \"background\" items (eg: copybutton)\n\n // Announcements\n --color-announcement-background: #000000dd;\n --color-announcement-text: #eeebee;\n\n // Brand colors\n --color-brand-primary: #0a4bff;\n --color-brand-content: #2757dd;\n --color-brand-visited: #872ee0;\n\n // API documentation\n --color-api-background: var(--color-background-hover--transparent);\n --color-api-background-hover: var(--color-background-hover);\n --color-api-overall: var(--color-foreground-secondary);\n --color-api-name: var(--color-problematic);\n --color-api-pre-name: var(--color-problematic);\n --color-api-paren: var(--color-foreground-secondary);\n --color-api-keyword: var(--color-foreground-primary);\n\n --color-api-added: #21632c;\n --color-api-added-border: #38a84d;\n --color-api-changed: #046172;\n --color-api-changed-border: #06a1bc;\n --color-api-deprecated: #605706;\n --color-api-deprecated-border: #f0d90f;\n --color-api-removed: #b30000;\n --color-api-removed-border: #ff5c5c;\n\n --color-highlight-on-target: #ffffcc;\n\n // Inline code background\n --color-inline-code-background: var(--color-background-secondary);\n\n // Highlighted text (search)\n --color-highlighted-background: #ddeeff;\n --color-highlighted-text: var(--color-foreground-primary);\n\n // GUI Labels\n --color-guilabel-background: #ddeeff80;\n --color-guilabel-border: #bedaf580;\n --color-guilabel-text: var(--color-foreground-primary);\n\n // Admonitions!\n --color-admonition-background: transparent;\n\n //////////////////////////////////////////////////////////////////////////////\n // Everything below this should be one of:\n // - var(...)\n // - *-gradient(...)\n // - special literal values (eg: transparent, none)\n //////////////////////////////////////////////////////////////////////////////\n\n // Tables\n --color-table-header-background: var(--color-background-secondary);\n --color-table-border: var(--color-background-border);\n\n // Cards\n --color-card-border: var(--color-background-secondary);\n --color-card-background: transparent;\n --color-card-marginals-background: var(--color-background-secondary);\n\n // Header\n --color-header-background: var(--color-background-primary);\n --color-header-border: var(--color-background-border);\n --color-header-text: var(--color-foreground-primary);\n\n // Sidebar (left)\n --color-sidebar-background: var(--color-background-secondary);\n --color-sidebar-background-border: var(--color-background-border);\n\n --color-sidebar-brand-text: var(--color-foreground-primary);\n --color-sidebar-caption-text: var(--color-foreground-muted);\n --color-sidebar-link-text: var(--color-foreground-secondary);\n --color-sidebar-link-text--top-level: var(--color-brand-primary);\n\n --color-sidebar-item-background: var(--color-sidebar-background);\n --color-sidebar-item-background--current: var(\n --color-sidebar-item-background\n );\n --color-sidebar-item-background--hover: linear-gradient(\n 90deg,\n var(--color-background-hover--transparent) 0%,\n var(--color-background-hover) var(--sidebar-item-spacing-horizontal),\n var(--color-background-hover) 100%\n );\n\n --color-sidebar-item-expander-background: transparent;\n --color-sidebar-item-expander-background--hover: var(\n --color-background-hover\n );\n\n --color-sidebar-search-text: var(--color-foreground-primary);\n --color-sidebar-search-background: var(--color-background-secondary);\n --color-sidebar-search-background--focus: var(--color-background-primary);\n --color-sidebar-search-border: var(--color-background-border);\n --color-sidebar-search-icon: var(--color-foreground-muted);\n\n // Table of Contents (right)\n --color-toc-background: var(--color-background-primary);\n --color-toc-title-text: var(--color-foreground-muted);\n --color-toc-item-text: var(--color-foreground-secondary);\n --color-toc-item-text--hover: var(--color-foreground-primary);\n --color-toc-item-text--active: var(--color-brand-primary);\n\n // Actual page contents\n --color-content-foreground: var(--color-foreground-primary);\n --color-content-background: transparent;\n\n // Links\n --color-link: var(--color-brand-content);\n --color-link-underline: var(--color-background-border);\n --color-link--hover: var(--color-brand-content);\n --color-link-underline--hover: var(--color-foreground-border);\n\n --color-link--visited: var(--color-brand-visited);\n --color-link-underline--visited: var(--color-background-border);\n --color-link--visited--hover: var(--color-brand-visited);\n --color-link-underline--visited--hover: var(--color-foreground-border);\n}\n\n@mixin colors-dark {\n --color-problematic: #ee5151;\n\n // Base Colors\n --color-foreground-primary: #cfd0d0; // for main text and headings\n --color-foreground-secondary: #9ca0a5; // for secondary text\n --color-foreground-muted: #81868d; // for muted text\n --color-foreground-border: #666666; // for content borders\n\n --color-background-primary: #131416; // for content\n --color-background-secondary: #1a1c1e; // for navigation + ToC\n --color-background-hover: #1e2124ff; // for navigation-item hover\n --color-background-hover--transparent: #1e212400;\n --color-background-border: #303335; // for UI borders\n --color-background-item: #444; // for \"background\" items (eg: copybutton)\n\n // Announcements\n --color-announcement-background: #000000dd;\n --color-announcement-text: #eeebee;\n\n // Brand colors\n --color-brand-primary: #3d94ff;\n --color-brand-content: #5ca5ff;\n --color-brand-visited: #b27aeb;\n\n // Highlighted text (search)\n --color-highlighted-background: #083563;\n\n // GUI Labels\n --color-guilabel-background: #08356380;\n --color-guilabel-border: #13395f80;\n\n // API documentation\n --color-api-keyword: var(--color-foreground-secondary);\n --color-highlight-on-target: #333300;\n\n --color-api-added: #3db854;\n --color-api-added-border: #267334;\n --color-api-changed: #09b0ce;\n --color-api-changed-border: #056d80;\n --color-api-deprecated: #b1a10b;\n --color-api-deprecated-border: #6e6407;\n --color-api-removed: #ff7575;\n --color-api-removed-border: #b03b3b;\n\n // Admonitions\n --color-admonition-background: #18181a;\n\n // Cards\n --color-card-border: var(--color-background-secondary);\n --color-card-background: #18181a;\n --color-card-marginals-background: var(--color-background-hover);\n}\n","// This file contains the styling for making the content throughout the page,\n// including fonts, paragraphs, headings and spacing among these elements.\n\nbody\n font-family: var(--font-stack)\npre,\ncode,\nkbd,\nsamp\n font-family: var(--font-stack--monospace)\n\n// Make fonts look slightly nicer.\nbody\n -webkit-font-smoothing: antialiased\n -moz-osx-font-smoothing: grayscale\n\n// Line height from Bootstrap 4.1\narticle\n line-height: 1.5\n\n//\n// Headings\n//\nh1,\nh2,\nh3,\nh4,\nh5,\nh6\n line-height: 1.25\n font-family: var(--font-stack--headings)\n font-weight: bold\n\n border-radius: 0.5rem\n margin-top: 0.5rem\n margin-bottom: 0.5rem\n margin-left: -0.5rem\n margin-right: -0.5rem\n padding-left: 0.5rem\n padding-right: 0.5rem\n\n + p\n margin-top: 0\n\nh1\n font-size: 2.5em\n margin-top: 1.75rem\n margin-bottom: 1rem\nh2\n font-size: 2em\n margin-top: 1.75rem\nh3\n font-size: 1.5em\nh4\n font-size: 1.25em\nh5\n font-size: 1.125em\nh6\n font-size: 1em\n\nsmall\n opacity: 75%\n font-size: 80%\n\n// Paragraph\np\n margin-top: 0.5rem\n margin-bottom: 0.75rem\n\n// Horizontal rules\nhr.docutils\n height: 1px\n padding: 0\n margin: 2rem 0\n background-color: var(--color-background-border)\n border: 0\n\n.centered\n text-align: center\n\n// Links\na\n text-decoration: underline\n\n color: var(--color-link)\n text-decoration-color: var(--color-link-underline)\n\n &:visited\n color: var(--color-link--visited)\n text-decoration-color: var(--color-link-underline--visited)\n &:hover\n color: var(--color-link--visited--hover)\n text-decoration-color: var(--color-link-underline--visited--hover)\n\n &:hover\n color: var(--color-link--hover)\n text-decoration-color: var(--color-link-underline--hover)\n &.muted-link\n color: inherit\n &:hover\n color: var(--color-link--hover)\n text-decoration-color: var(--color-link-underline--hover)\n &:visited\n color: var(--color-link--visited--hover)\n text-decoration-color: var(--color-link-underline--visited--hover)\n","// This file contains the styles for the overall layouting of the documentation\n// skeleton, including the responsive changes as well as sidebar toggles.\n//\n// This is implemented as a mobile-last design, which isn't ideal, but it is\n// reasonably good-enough and I got pretty tired by the time I'd finished this\n// to move the rules around to fix this. Shouldn't take more than 3-4 hours,\n// if you know what you're doing tho.\n\n// HACK: Not all browsers account for the scrollbar width in media queries.\n// This results in horizontal scrollbars in the breakpoint where we go\n// from displaying everything to hiding the ToC. We accomodate for this by\n// adding a bit of padding to the TOC drawer, disabling the horizontal\n// scrollbar and allowing the scrollbars to cover the padding.\n// https://www.456bereastreet.com/archive/201301/media_query_width_and_vertical_scrollbars/\n\n// HACK: Always having the scrollbar visible, prevents certain browsers from\n// causing the content to stutter horizontally between taller-than-viewport and\n// not-taller-than-viewport pages.\n\nhtml\n overflow-x: hidden\n overflow-y: scroll\n scroll-behavior: smooth\n\n.sidebar-scroll, .toc-scroll, article[role=main] *\n // Override Firefox scrollbar style\n scrollbar-width: thin\n scrollbar-color: var(--color-foreground-border) transparent\n\n // Override Chrome scrollbar styles\n &::-webkit-scrollbar\n width: 0.25rem\n height: 0.25rem\n &::-webkit-scrollbar-thumb\n background-color: var(--color-foreground-border)\n border-radius: 0.125rem\n\n//\n// Overalls\n//\nhtml,\nbody\n height: 100%\n color: var(--color-foreground-primary)\n background: var(--color-background-primary)\n\n.skip-to-content\n position: fixed\n padding: 1rem\n border-radius: 1rem\n left: 0.25rem\n top: 0.25rem\n z-index: 40\n background: var(--color-background-primary)\n color: var(--color-foreground-primary)\n\n transform: translateY(-200%)\n transition: transform 300ms ease-in-out\n\n &:focus-within\n transform: translateY(0%)\n\narticle\n color: var(--color-content-foreground)\n background: var(--color-content-background)\n overflow-wrap: break-word\n\n.page\n display: flex\n // fill the viewport for pages with little content.\n min-height: 100%\n\n.mobile-header\n width: 100%\n height: var(--header-height)\n background-color: var(--color-header-background)\n color: var(--color-header-text)\n border-bottom: 1px solid var(--color-header-border)\n\n // Looks like sub-script/super-script have this, and we need this to\n // be \"on top\" of those.\n z-index: 10\n\n // We don't show the header on large screens.\n display: none\n\n // Add shadow when scrolled\n &.scrolled\n border-bottom: none\n box-shadow: 0 0 0.2rem rgba(0, 0, 0, 0.1), 0 0.2rem 0.4rem rgba(0, 0, 0, 0.2)\n\n .header-center\n a\n color: var(--color-header-text)\n text-decoration: none\n\n.main\n display: flex\n flex: 1\n\n// Sidebar (left) also covers the entire left portion of screen.\n.sidebar-drawer\n box-sizing: border-box\n\n border-right: 1px solid var(--color-sidebar-background-border)\n background: var(--color-sidebar-background)\n\n display: flex\n justify-content: flex-end\n // These next two lines took me two days to figure out.\n width: calc((100% - #{$full-width}) / 2 + #{$sidebar-width})\n min-width: $sidebar-width\n\n// Scroll-along sidebars\n.sidebar-container,\n.toc-drawer\n box-sizing: border-box\n width: $sidebar-width\n\n.toc-drawer\n background: var(--color-toc-background)\n // See HACK described on top of this document\n padding-right: 1rem\n\n.sidebar-sticky,\n.toc-sticky\n position: sticky\n top: 0\n height: min(100%, 100vh)\n height: 100vh\n\n display: flex\n flex-direction: column\n\n.sidebar-scroll,\n.toc-scroll\n flex-grow: 1\n flex-shrink: 1\n\n overflow: auto\n scroll-behavior: smooth\n\n// Central items.\n.content\n padding: 0 $content-padding\n width: $content-width\n\n display: flex\n flex-direction: column\n justify-content: space-between\n\n.icon\n display: inline-block\n height: 1rem\n width: 1rem\n svg\n width: 100%\n height: 100%\n\n//\n// Accommodate announcement banner\n//\n.announcement\n background-color: var(--color-announcement-background)\n color: var(--color-announcement-text)\n\n height: var(--header-height)\n display: flex\n align-items: center\n overflow-x: auto\n & + .page\n min-height: calc(100% - var(--header-height))\n\n.announcement-content\n box-sizing: border-box\n padding: 0.5rem\n min-width: 100%\n white-space: nowrap\n text-align: center\n\n a\n color: var(--color-announcement-text)\n text-decoration-color: var(--color-announcement-text)\n\n &:hover\n color: var(--color-announcement-text)\n text-decoration-color: var(--color-link--hover)\n\n////////////////////////////////////////////////////////////////////////////////\n// Toggles for theme\n////////////////////////////////////////////////////////////////////////////////\n.no-js .theme-toggle-container // don't show theme toggle if there's no JS\n display: none\n\n.theme-toggle-container\n display: flex\n\n.theme-toggle\n display: flex\n cursor: pointer\n border: none\n padding: 0\n background: transparent\n\n.theme-toggle svg\n height: 1.25rem\n width: 1.25rem\n color: var(--color-foreground-primary)\n display: none\n\n.theme-toggle-header\n display: flex\n align-items: center\n justify-content: center\n\n////////////////////////////////////////////////////////////////////////////////\n// Toggles for elements\n////////////////////////////////////////////////////////////////////////////////\n.toc-overlay-icon, .nav-overlay-icon\n display: none\n cursor: pointer\n\n .icon\n color: var(--color-foreground-secondary)\n height: 1.5rem\n width: 1.5rem\n\n.toc-header-icon, .nav-overlay-icon\n // for when we set display: flex\n justify-content: center\n align-items: center\n\n.toc-content-icon\n height: 1.5rem\n width: 1.5rem\n\n.content-icon-container\n float: right\n display: flex\n margin-top: 1.5rem\n margin-left: 1rem\n margin-bottom: 1rem\n gap: 0.5rem\n\n .edit-this-page, .view-this-page\n svg\n color: inherit\n height: 1.25rem\n width: 1.25rem\n\n.sidebar-toggle\n position: absolute\n display: none\n// \n.sidebar-toggle[name=\"__toc\"]\n left: 20px\n.sidebar-toggle:checked\n left: 40px\n// \n\n.overlay\n position: fixed\n top: 0\n width: 0\n height: 0\n\n transition: width 0ms, height 0ms, opacity 250ms ease-out\n\n opacity: 0\n background-color: rgba(0, 0, 0, 0.54)\n.sidebar-overlay\n z-index: 20\n.toc-overlay\n z-index: 40\n\n// Keep things on top and smooth.\n.sidebar-drawer\n z-index: 30\n transition: left 250ms ease-in-out\n.toc-drawer\n z-index: 50\n transition: right 250ms ease-in-out\n\n// Show the Sidebar\n#__navigation:checked\n & ~ .sidebar-overlay\n width: 100%\n height: 100%\n opacity: 1\n & ~ .page\n .sidebar-drawer\n top: 0\n left: 0\n // Show the toc sidebar\n#__toc:checked\n & ~ .toc-overlay\n width: 100%\n height: 100%\n opacity: 1\n & ~ .page\n .toc-drawer\n top: 0\n right: 0\n\n////////////////////////////////////////////////////////////////////////////////\n// Back to top\n////////////////////////////////////////////////////////////////////////////////\n.back-to-top\n text-decoration: none\n\n display: none\n position: fixed\n left: 0\n top: 1rem\n padding: 0.5rem\n padding-right: 0.75rem\n border-radius: 1rem\n font-size: 0.8125rem\n\n background: var(--color-background-primary)\n box-shadow: 0 0.2rem 0.5rem rgba(0, 0, 0, 0.05), #6b728080 0px 0px 1px 0px\n\n z-index: 10\n\n margin-left: 50%\n transform: translateX(-50%)\n svg\n height: 1rem\n width: 1rem\n fill: currentColor\n display: inline-block\n\n span\n margin-left: 0.25rem\n\n .show-back-to-top &\n display: flex\n align-items: center\n\n////////////////////////////////////////////////////////////////////////////////\n// Responsive layouting\n////////////////////////////////////////////////////////////////////////////////\n// Make things a bit bigger on bigger screens.\n@media (min-width: $full-width + $sidebar-width)\n html\n font-size: 110%\n\n@media (max-width: $full-width)\n // Collapse \"toc\" into the icon.\n .toc-content-icon\n display: flex\n .toc-drawer\n position: fixed\n height: 100vh\n top: 0\n right: -$sidebar-width\n border-left: 1px solid var(--color-background-muted)\n .toc-tree\n border-left: none\n font-size: var(--toc-font-size--mobile)\n\n // Accomodate for a changed content width.\n .sidebar-drawer\n width: calc((100% - #{$full-width - $sidebar-width}) / 2 + #{$sidebar-width})\n\n@media (max-width: $content-padded-width + $sidebar-width)\n // Center the page\n .content\n margin-left: auto\n margin-right: auto\n padding: 0 $content-padding--small\n\n@media (max-width: $content-padded-width--small + $sidebar-width)\n // Collapse \"navigation\".\n .nav-overlay-icon\n display: flex\n .sidebar-drawer\n position: fixed\n height: 100vh\n width: $sidebar-width\n\n top: 0\n left: -$sidebar-width\n\n // Swap which icon is visible.\n .toc-header-icon, .theme-toggle-header\n display: flex\n .toc-content-icon, .theme-toggle-content\n display: none\n\n // Show the header.\n .mobile-header\n position: sticky\n top: 0\n display: flex\n justify-content: space-between\n align-items: center\n\n .header-left,\n .header-right\n display: flex\n height: var(--header-height)\n padding: 0 var(--header-padding)\n label\n height: 100%\n width: 100%\n user-select: none\n\n .nav-overlay-icon .icon,\n .theme-toggle svg\n height: 1.5rem\n width: 1.5rem\n\n // Add a scroll margin for the content\n :target\n scroll-margin-top: calc(var(--header-height) + 2.5rem)\n\n // Show back-to-top below the header\n .back-to-top\n top: calc(var(--header-height) + 0.5rem)\n\n // Accommodate for the header.\n .page\n flex-direction: column\n justify-content: center\n\n@media (max-width: $content-width + 2* $content-padding--small)\n // Content should respect window limits.\n .content\n width: 100%\n overflow-x: auto\n\n@media (max-width: $content-width)\n article[role=main] aside.sidebar\n float: none\n width: 100%\n margin: 1rem 0\n","// Overall Layout Variables\n//\n// Because CSS variables can't be used in media queries. The fact that this\n// makes the layout non-user-configurable is a good thing.\n$content-padding: 3em;\n$content-padding--small: 1em;\n$content-width: 46em;\n$sidebar-width: 15em;\n$content-padded-width: $content-width + 2 * $content-padding;\n$content-padded-width--small: $content-width + 2 * $content-padding--small;\n$full-width: $content-padded-width + 2 * $sidebar-width;\n","//\n// The design here is strongly inspired by mkdocs-material.\n.admonition, .topic\n margin: 1rem auto\n padding: 0 0.5rem 0.5rem 0.5rem\n\n background: var(--color-admonition-background)\n\n border-radius: 0.2rem\n box-shadow: 0 0.2rem 0.5rem rgba(0, 0, 0, 0.05), 0 0 0.0625rem rgba(0, 0, 0, 0.1)\n\n font-size: var(--admonition-font-size)\n\n overflow: hidden\n page-break-inside: avoid\n\n // First element should have no margin, since the title has it.\n > :nth-child(2)\n margin-top: 0\n\n // Last item should have no margin, since we'll control that w/ padding\n > :last-child\n margin-bottom: 0\n\n.admonition p.admonition-title,\np.topic-title\n position: relative\n margin: 0 -0.5rem 0.5rem\n padding-left: 2rem\n padding-right: .5rem\n padding-top: .4rem\n padding-bottom: .4rem\n\n font-weight: 500\n font-size: var(--admonition-title-font-size)\n line-height: 1.3\n\n // Our fancy icon\n &::before\n content: \"\"\n position: absolute\n left: 0.5rem\n width: 1rem\n height: 1rem\n\n// Default styles\np.admonition-title\n background-color: var(--color-admonition-title-background)\n &::before\n background-color: var(--color-admonition-title)\n mask-image: var(--icon-admonition-default)\n mask-repeat: no-repeat\n\np.topic-title\n background-color: var(--color-topic-title-background)\n &::before\n background-color: var(--color-topic-title)\n mask-image: var(--icon-topic-default)\n mask-repeat: no-repeat\n\n//\n// Variants\n//\n.admonition\n border-left: 0.2rem solid var(--color-admonition-title)\n\n @each $type, $value in $admonitions\n &.#{$type}\n border-left-color: var(--color-admonition-title--#{$type})\n > .admonition-title\n background-color: var(--color-admonition-title-background--#{$type})\n &::before\n background-color: var(--color-admonition-title--#{$type})\n mask-image: var(--icon-#{nth($value, 2)})\n\n.admonition-todo > .admonition-title\n text-transform: uppercase\n","// This file stylizes the API documentation (stuff generated by autodoc). It's\n// deeply nested due to how autodoc structures the HTML without enough classes\n// to select the relevant items.\n\n// API docs!\ndl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple)\n // Tweak the spacing of all the things!\n dd\n margin-left: 2rem\n > :first-child\n margin-top: 0.125rem\n > :last-child\n margin-bottom: 0.75rem\n\n // This is used for the arguments\n .field-list\n margin-bottom: 0.75rem\n\n // \"Headings\" (like \"Parameters\" and \"Return\")\n > dt\n text-transform: uppercase\n font-size: var(--font-size--small)\n\n dd:empty\n margin-bottom: 0.5rem\n dd > ul\n margin-left: -1.2rem\n > li\n > p:nth-child(2)\n margin-top: 0\n // When the last-empty-paragraph follows a paragraph, it doesn't need\n // to augument the existing spacing.\n > p + p:last-child:empty\n margin-top: 0\n margin-bottom: 0\n\n // Colorize the elements\n > dt\n color: var(--color-api-overall)\n\n.sig:not(.sig-inline)\n font-weight: bold\n\n font-size: var(--api-font-size)\n font-family: var(--font-stack--monospace)\n\n margin-left: -0.25rem\n margin-right: -0.25rem\n padding-top: 0.25rem\n padding-bottom: 0.25rem\n padding-right: 0.5rem\n\n // These are intentionally em, to properly match the font size.\n padding-left: 3em\n text-indent: -2.5em\n\n border-radius: 0.25rem\n\n background: var(--color-api-background)\n transition: background 100ms ease-out\n\n &:hover\n background: var(--color-api-background-hover)\n\n // adjust the size of the [source] link on the right.\n a.reference\n .viewcode-link\n font-weight: normal\n width: 4.25rem\n\nem.property\n font-style: normal\n &:first-child\n color: var(--color-api-keyword)\n.sig-name\n color: var(--color-api-name)\n.sig-prename\n font-weight: normal\n color: var(--color-api-pre-name)\n.sig-paren\n color: var(--color-api-paren)\n.sig-param\n font-style: normal\n\ndiv.versionadded,\ndiv.versionchanged,\ndiv.deprecated,\ndiv.versionremoved\n border-left: 0.1875rem solid\n border-radius: 0.125rem\n\n padding-left: 0.75rem\n\n p\n margin-top: 0.125rem\n margin-bottom: 0.125rem\n\ndiv.versionadded\n border-color: var(--color-api-added-border)\n .versionmodified\n color: var(--color-api-added)\n\ndiv.versionchanged\n border-color: var(--color-api-changed-border)\n .versionmodified\n color: var(--color-api-changed)\n\ndiv.deprecated\n border-color: var(--color-api-deprecated-border)\n .versionmodified\n color: var(--color-api-deprecated)\n\ndiv.versionremoved\n border-color: var(--color-api-removed-border)\n .versionmodified\n color: var(--color-api-removed)\n\n// Align the [docs] and [source] to the right.\n.viewcode-link, .viewcode-back\n float: right\n text-align: right\n",".line-block\n margin-top: 0.5rem\n margin-bottom: 0.75rem\n .line-block\n margin-top: 0rem\n margin-bottom: 0rem\n padding-left: 1rem\n","// Captions\narticle p.caption,\ntable > caption,\n.code-block-caption\n font-size: var(--font-size--small)\n text-align: center\n\n// Caption above a TOCTree\n.toctree-wrapper.compound\n .caption, :not(.caption) > .caption-text\n font-size: var(--font-size--small)\n text-transform: uppercase\n\n text-align: initial\n margin-bottom: 0\n\n > ul\n margin-top: 0\n margin-bottom: 0\n","// Inline code\ncode.literal, .sig-inline\n background: var(--color-inline-code-background)\n border-radius: 0.2em\n // Make the font smaller, and use padding to recover.\n font-size: var(--font-size--small--2)\n padding: 0.1em 0.2em\n\n pre.literal-block &\n font-size: inherit\n padding: 0\n\n p &\n border: 1px solid var(--color-background-border)\n\n.sig-inline\n font-family: var(--font-stack--monospace)\n\n// Code and Literal Blocks\n$code-spacing-vertical: 0.625rem\n$code-spacing-horizontal: 0.875rem\n\n// Wraps every literal block + line numbers.\ndiv[class*=\" highlight-\"],\ndiv[class^=\"highlight-\"]\n margin: 1em 0\n display: flex\n\n .table-wrapper\n margin: 0\n padding: 0\n\npre\n margin: 0\n padding: 0\n overflow: auto\n\n // Needed to have more specificity than pygments' \"pre\" selector. :(\n article[role=\"main\"] .highlight &\n line-height: 1.5\n\n &.literal-block,\n .highlight &\n font-size: var(--code-font-size)\n padding: $code-spacing-vertical $code-spacing-horizontal\n\n // Make it look like all the other blocks.\n &.literal-block\n margin-top: 1rem\n margin-bottom: 1rem\n\n border-radius: 0.2rem\n background-color: var(--color-code-background)\n color: var(--color-code-foreground)\n\n// All code is always contained in this.\n.highlight\n width: 100%\n border-radius: 0.2rem\n\n // Make line numbers and prompts un-selectable.\n .gp, span.linenos\n user-select: none\n pointer-events: none\n\n // Expand the line-highlighting.\n .hll\n display: block\n margin-left: -$code-spacing-horizontal\n margin-right: -$code-spacing-horizontal\n padding-left: $code-spacing-horizontal\n padding-right: $code-spacing-horizontal\n\n/* Make code block captions be nicely integrated */\n.code-block-caption\n display: flex\n padding: $code-spacing-vertical $code-spacing-horizontal\n\n border-radius: 0.25rem\n border-bottom-left-radius: 0\n border-bottom-right-radius: 0\n font-weight: 300\n border-bottom: 1px solid\n\n background-color: var(--color-code-background)\n color: var(--color-code-foreground)\n border-color: var(--color-background-border)\n\n + div[class]\n margin-top: 0\n pre\n border-top-left-radius: 0\n border-top-right-radius: 0\n\n// When `html_codeblock_linenos_style` is table.\n.highlighttable\n width: 100%\n display: block\n tbody\n display: block\n\n tr\n display: flex\n\n // Line numbers\n td.linenos\n background-color: var(--color-code-background)\n color: var(--color-code-foreground)\n padding: $code-spacing-vertical $code-spacing-horizontal\n padding-right: 0\n border-top-left-radius: 0.2rem\n border-bottom-left-radius: 0.2rem\n\n .linenodiv\n padding-right: $code-spacing-horizontal\n font-size: var(--code-font-size)\n box-shadow: -0.0625rem 0 var(--color-foreground-border) inset\n\n // Actual code\n td.code\n padding: 0\n display: block\n flex: 1\n overflow: hidden\n\n .highlight\n border-top-left-radius: 0\n border-bottom-left-radius: 0\n\n// When `html_codeblock_linenos_style` is inline.\n.highlight\n span.linenos\n display: inline-block\n padding-left: 0\n padding-right: $code-spacing-horizontal\n margin-right: $code-spacing-horizontal\n box-shadow: -0.0625rem 0 var(--color-foreground-border) inset\n","// Inline Footnote Reference\n.footnote-reference\n font-size: var(--font-size--small--4)\n vertical-align: super\n\n// Definition list, listing the content of each note.\n// docutils <= 0.17\ndl.footnote.brackets\n font-size: var(--font-size--small)\n color: var(--color-foreground-secondary)\n\n display: grid\n grid-template-columns: max-content auto\n dt\n margin: 0\n > .fn-backref\n margin-left: 0.25rem\n\n &:after\n content: \":\"\n\n .brackets\n &:before\n content: \"[\"\n &:after\n content: \"]\"\n\n dd\n margin: 0\n padding: 0 1rem\n\n// docutils >= 0.18\naside.footnote\n font-size: var(--font-size--small)\n color: var(--color-foreground-secondary)\n\naside.footnote > span,\ndiv.citation > span\n float: left\n font-weight: 500\n padding-right: 0.25rem\n\naside.footnote > *:not(span),\ndiv.citation > p\n margin-left: 2rem\n","//\n// Figures\n//\nimg\n box-sizing: border-box\n max-width: 100%\n height: auto\n\narticle\n figure, .figure\n border-radius: 0.2rem\n\n margin: 0\n :last-child\n margin-bottom: 0\n\n .align-left\n float: left\n clear: left\n margin: 0 1rem 1rem\n\n .align-right\n float: right\n clear: right\n margin: 0 1rem 1rem\n\n .align-default,\n .align-center\n display: block\n text-align: center\n margin-left: auto\n margin-right: auto\n\n // WELL, table needs to be stylised like a table.\n table.align-default\n display: table\n text-align: initial\n",".genindex-jumpbox, .domainindex-jumpbox\n border-top: 1px solid var(--color-background-border)\n border-bottom: 1px solid var(--color-background-border)\n padding: 0.25rem\n\n.genindex-section, .domainindex-section\n h2\n margin-top: 0.75rem\n margin-bottom: 0.5rem\n ul\n margin-top: 0\n margin-bottom: 0\n","ul,\nol\n padding-left: 1.2rem\n\n // Space lists out like paragraphs\n margin-top: 1rem\n margin-bottom: 1rem\n // reduce margins within li.\n li\n > p:first-child\n margin-top: 0.25rem\n margin-bottom: 0.25rem\n\n > p:last-child\n margin-top: 0.25rem\n\n > ul,\n > ol\n margin-top: 0.5rem\n margin-bottom: 0.5rem\n\nol\n &.arabic\n list-style: decimal\n &.loweralpha\n list-style: lower-alpha\n &.upperalpha\n list-style: upper-alpha\n &.lowerroman\n list-style: lower-roman\n &.upperroman\n list-style: upper-roman\n\n// Don't space lists out when they're \"simple\" or in a `.. toctree::`\n.simple,\n.toctree-wrapper\n li\n > ul,\n > ol\n margin-top: 0\n margin-bottom: 0\n\n// Definition Lists\n.field-list,\n.option-list,\ndl:not([class]),\ndl.simple,\ndl.footnote,\ndl.glossary\n dt\n font-weight: 500\n margin-top: 0.25rem\n + dt\n margin-top: 0\n\n .classifier::before\n content: \":\"\n margin-left: 0.2rem\n margin-right: 0.2rem\n\n dd\n > p:first-child,\n ul\n margin-top: 0.125rem\n\n ul\n margin-bottom: 0.125rem\n",".math-wrapper\n width: 100%\n overflow-x: auto\n\ndiv.math\n position: relative\n text-align: center\n\n .headerlink,\n &:focus .headerlink\n display: none\n\n &:hover .headerlink\n display: inline-block\n\n span.eqno\n position: absolute\n right: 0.5rem\n top: 50%\n transform: translate(0, -50%)\n z-index: 1\n","// Abbreviations\nabbr[title]\n cursor: help\n\n// \"Problematic\" content, as identified by Sphinx\n.problematic\n color: var(--color-problematic)\n\n// Keyboard / Mouse \"instructions\"\nkbd:not(.compound)\n margin: 0 0.2rem\n padding: 0 0.2rem\n border-radius: 0.2rem\n border: 1px solid var(--color-foreground-border)\n color: var(--color-foreground-primary)\n vertical-align: text-bottom\n\n font-size: var(--font-size--small--3)\n display: inline-block\n\n box-shadow: 0 0.0625rem 0 rgba(0, 0, 0, 0.2), inset 0 0 0 0.125rem var(--color-background-primary)\n\n background-color: var(--color-background-secondary)\n\n// Blockquote\nblockquote\n border-left: 4px solid var(--color-background-border)\n background: var(--color-background-secondary)\n\n margin-left: 0\n margin-right: 0\n padding: 0.5rem 1rem\n\n .attribution\n font-weight: 600\n text-align: right\n\n &.pull-quote,\n &.highlights\n font-size: 1.25em\n\n &.epigraph,\n &.pull-quote\n border-left-width: 0\n border-radius: 0.5rem\n\n &.highlights\n border-left-width: 0\n background: transparent\n\n// Center align embedded-in-text images\np .reference img\n vertical-align: middle\n","p.rubric\n line-height: 1.25\n font-weight: bold\n font-size: 1.125em\n\n // For Numpy-style documentation that's got rubrics within it.\n // https://github.com/pradyunsg/furo/discussions/505\n dd &\n line-height: inherit\n font-weight: inherit\n\n font-size: var(--font-size--small)\n text-transform: uppercase\n","article .sidebar\n float: right\n clear: right\n width: 30%\n\n margin-left: 1rem\n margin-right: 0\n\n border-radius: 0.2rem\n background-color: var(--color-background-secondary)\n border: var(--color-background-border) 1px solid\n\n > *\n padding-left: 1rem\n padding-right: 1rem\n\n > ul, > ol // lists need additional padding, because bullets.\n padding-left: 2.2rem\n\n .sidebar-title\n margin: 0\n padding: 0.5rem 1rem\n border-bottom: var(--color-background-border) 1px solid\n\n font-weight: 500\n\n// TODO: subtitle\n// TODO: dedicated variables?\n","[role=main] .table-wrapper.container\n width: 100%\n overflow-x: auto\n margin-top: 1rem\n margin-bottom: 0.5rem\n padding: 0.2rem 0.2rem 0.75rem\n\ntable.docutils\n border-radius: 0.2rem\n border-spacing: 0\n border-collapse: collapse\n\n box-shadow: 0 0.2rem 0.5rem rgba(0, 0, 0, 0.05), 0 0 0.0625rem rgba(0, 0, 0, 0.1)\n\n th\n background: var(--color-table-header-background)\n\n td,\n th\n // Space things out properly\n padding: 0 0.25rem\n\n // Get the borders looking just-right.\n border-left: 1px solid var(--color-table-border)\n border-right: 1px solid var(--color-table-border)\n border-bottom: 1px solid var(--color-table-border)\n\n p\n margin: 0.25rem\n\n &:first-child\n border-left: none\n &:last-child\n border-right: none\n\n // MyST-parser tables set these classes for control of column alignment\n &.text-left\n text-align: left\n &.text-right\n text-align: right\n &.text-center\n text-align: center\n",":target\n scroll-margin-top: 2.5rem\n\n@media (max-width: $full-width - $sidebar-width)\n :target\n scroll-margin-top: calc(2.5rem + var(--header-height))\n\n // When a heading is selected\n section > span:target\n scroll-margin-top: calc(2.8rem + var(--header-height))\n\n// Permalinks\n.headerlink\n font-weight: 100\n user-select: none\n\nh1,\nh2,\nh3,\nh4,\nh5,\nh6,\ndl dt,\np.caption,\nfigcaption p,\ntable > caption,\n.code-block-caption\n > .headerlink\n margin-left: 0.5rem\n visibility: hidden\n &:hover > .headerlink\n visibility: visible\n\n // Don't change to link-like, if someone adds the contents directive.\n > .toc-backref\n color: inherit\n text-decoration-line: none\n\n// Figure and table captions are special.\nfigure:hover > figcaption > p > .headerlink,\ntable:hover > caption > .headerlink\n visibility: visible\n\n:target >, // Regular section[id] style anchors\nspan:target ~ // Non-regular span[id] style \"extra\" anchors\n h1,\n h2,\n h3,\n h4,\n h5,\n h6\n &:nth-of-type(1)\n background-color: var(--color-highlight-on-target)\n // .headerlink\n // visibility: visible\n code.literal\n background-color: transparent\n\ntable:target > caption,\nfigure:target\n background-color: var(--color-highlight-on-target)\n\n// Inline page contents\n.this-will-duplicate-information-and-it-is-still-useful-here li :target\n background-color: var(--color-highlight-on-target)\n\n// Code block permalinks\n.literal-block-wrapper:target .code-block-caption\n background-color: var(--color-highlight-on-target)\n\n// When a definition list item is selected\n//\n// There isn't really an alternative to !important here, due to the\n// high-specificity of API documentation's selector.\ndt:target\n background-color: var(--color-highlight-on-target) !important\n\n// When a footnote reference is selected\n.footnote > dt:target + dd,\n.footnote-reference:target\n background-color: var(--color-highlight-on-target)\n",".guilabel\n background-color: var(--color-guilabel-background)\n border: 1px solid var(--color-guilabel-border)\n color: var(--color-guilabel-text)\n\n padding: 0 0.3em\n border-radius: 0.5em\n font-size: 0.9em\n","// This file contains the styles used for stylizing the footer that's shown\n// below the content.\n\nfooter\n font-size: var(--font-size--small)\n display: flex\n flex-direction: column\n\n margin-top: 2rem\n\n// Bottom of page information\n.bottom-of-page\n display: flex\n align-items: center\n justify-content: space-between\n\n margin-top: 1rem\n padding-top: 1rem\n padding-bottom: 1rem\n\n color: var(--color-foreground-secondary)\n border-top: 1px solid var(--color-background-border)\n\n line-height: 1.5\n\n @media (max-width: $content-width)\n text-align: center\n flex-direction: column-reverse\n gap: 0.25rem\n\n .left-details\n font-size: var(--font-size--small)\n\n .right-details\n display: flex\n flex-direction: column\n gap: 0.25rem\n text-align: right\n\n .icons\n display: flex\n justify-content: flex-end\n gap: 0.25rem\n font-size: 1rem\n\n a\n text-decoration: none\n\n svg,\n img\n font-size: 1.125rem\n height: 1em\n width: 1em\n\n// Next/Prev page information\n.related-pages\n a\n display: flex\n align-items: center\n\n text-decoration: none\n &:hover .page-info .title\n text-decoration: underline\n color: var(--color-link)\n text-decoration-color: var(--color-link-underline)\n\n svg.furo-related-icon,\n svg.furo-related-icon > use\n flex-shrink: 0\n\n color: var(--color-foreground-border)\n\n width: 0.75rem\n height: 0.75rem\n margin: 0 0.5rem\n\n &.next-page\n max-width: 50%\n\n float: right\n clear: right\n text-align: right\n\n &.prev-page\n max-width: 50%\n\n float: left\n clear: left\n\n svg\n transform: rotate(180deg)\n\n.page-info\n display: flex\n flex-direction: column\n overflow-wrap: anywhere\n\n .next-page &\n align-items: flex-end\n\n .context\n display: flex\n align-items: center\n\n padding-bottom: 0.1rem\n\n color: var(--color-foreground-muted)\n font-size: var(--font-size--small)\n text-decoration: none\n","// This file contains the styles for the contents of the left sidebar, which\n// contains the navigation tree, logo, search etc.\n\n////////////////////////////////////////////////////////////////////////////////\n// Brand on top of the scrollable tree.\n////////////////////////////////////////////////////////////////////////////////\n.sidebar-brand\n display: flex\n flex-direction: column\n flex-shrink: 0\n\n padding: var(--sidebar-item-spacing-vertical) var(--sidebar-item-spacing-horizontal)\n text-decoration: none\n\n.sidebar-brand-text\n color: var(--color-sidebar-brand-text)\n overflow-wrap: break-word\n margin: var(--sidebar-item-spacing-vertical) 0\n font-size: 1.5rem\n\n.sidebar-logo-container\n margin: var(--sidebar-item-spacing-vertical) 0\n\n.sidebar-logo\n margin: 0 auto\n display: block\n max-width: 100%\n\n////////////////////////////////////////////////////////////////////////////////\n// Search\n////////////////////////////////////////////////////////////////////////////////\n.sidebar-search-container\n display: flex\n align-items: center\n margin-top: var(--sidebar-search-space-above)\n\n position: relative\n\n background: var(--color-sidebar-search-background)\n &:hover,\n &:focus-within\n background: var(--color-sidebar-search-background--focus)\n\n &::before\n content: \"\"\n position: absolute\n left: var(--sidebar-item-spacing-horizontal)\n width: var(--sidebar-search-icon-size)\n height: var(--sidebar-search-icon-size)\n\n background-color: var(--color-sidebar-search-icon)\n mask-image: var(--icon-search)\n\n.sidebar-search\n box-sizing: border-box\n\n border: none\n border-top: 1px solid var(--color-sidebar-search-border)\n border-bottom: 1px solid var(--color-sidebar-search-border)\n\n padding-top: var(--sidebar-search-input-spacing-vertical)\n padding-bottom: var(--sidebar-search-input-spacing-vertical)\n padding-right: var(--sidebar-search-input-spacing-horizontal)\n padding-left: calc(var(--sidebar-item-spacing-horizontal) + var(--sidebar-search-input-spacing-horizontal) + var(--sidebar-search-icon-size))\n\n width: 100%\n\n color: var(--color-sidebar-search-foreground)\n background: transparent\n z-index: 10\n\n &:focus\n outline: none\n\n &::placeholder\n font-size: var(--sidebar-search-input-font-size)\n\n//\n// Hide Search Matches link\n//\n#searchbox .highlight-link\n padding: var(--sidebar-item-spacing-vertical) var(--sidebar-item-spacing-horizontal) 0\n margin: 0\n text-align: center\n\n a\n color: var(--color-sidebar-search-icon)\n font-size: var(--font-size--small--2)\n\n////////////////////////////////////////////////////////////////////////////////\n// Structure/Skeleton of the navigation tree (left)\n////////////////////////////////////////////////////////////////////////////////\n.sidebar-tree\n font-size: var(--sidebar-item-font-size)\n margin-top: var(--sidebar-tree-space-above)\n margin-bottom: var(--sidebar-item-spacing-vertical)\n\n ul\n padding: 0\n margin-top: 0\n margin-bottom: 0\n\n display: flex\n flex-direction: column\n\n list-style: none\n\n li\n position: relative\n margin: 0\n\n > ul\n margin-left: var(--sidebar-item-spacing-horizontal)\n\n .icon\n color: var(--color-sidebar-link-text)\n\n .reference\n box-sizing: border-box\n color: var(--color-sidebar-link-text)\n\n // Fill the parent.\n display: inline-block\n line-height: var(--sidebar-item-line-height)\n text-decoration: none\n\n // Don't allow long words to cause wrapping.\n overflow-wrap: anywhere\n\n height: 100%\n width: 100%\n\n padding: var(--sidebar-item-spacing-vertical) var(--sidebar-item-spacing-horizontal)\n\n &:hover\n color: var(--color-sidebar-link-text)\n background: var(--color-sidebar-item-background--hover)\n\n // Add a nice little \"external-link\" arrow here.\n &.external::after\n content: url('data:image/svg+xml,')\n margin: 0 0.25rem\n vertical-align: middle\n color: var(--color-sidebar-link-text)\n\n // Make the current page reference bold.\n .current-page > .reference\n font-weight: bold\n\n label\n position: absolute\n top: 0\n right: 0\n height: var(--sidebar-item-height)\n width: var(--sidebar-expander-width)\n\n cursor: pointer\n user-select: none\n\n display: flex\n justify-content: center\n align-items: center\n\n .caption, :not(.caption) > .caption-text\n font-size: var(--sidebar-caption-font-size)\n color: var(--color-sidebar-caption-text)\n\n font-weight: bold\n text-transform: uppercase\n\n margin: var(--sidebar-caption-space-above) 0 0 0\n padding: var(--sidebar-item-spacing-vertical) var(--sidebar-item-spacing-horizontal)\n\n // If it has children, add a bit more padding to wrap the content to avoid\n // overlapping with the