diff --git a/.gitattributes b/.gitattributes index c60098ea3d1d2f98734ba9ccb1880e84a428039a..46d10d10c1bd85dc4e5670253178b5a7ac7e7bb1 100644 --- a/.gitattributes +++ b/.gitattributes @@ -544,3 +544,6 @@ mantis_evalkit/lib/python3.10/site-packages/setuptools/_vendor/more_itertools/__ moondream/lib/python3.10/site-packages/pip/_vendor/distlib/t64.exe filter=lfs diff=lfs merge=lfs -text moondream/lib/python3.10/site-packages/pip/_vendor/distlib/w64-arm.exe filter=lfs diff=lfs merge=lfs -text moondream/lib/python3.10/site-packages/pip/_vendor/distlib/w64.exe filter=lfs diff=lfs merge=lfs -text +mantis_evalkit/lib/python3.10/site-packages/pyarrow/libparquet.so.1900 filter=lfs diff=lfs merge=lfs -text +parrot/lib/python3.10/site-packages/torch/lib/libtorch_cuda_linalg.so filter=lfs diff=lfs merge=lfs -text +mantis_evalkit/lib/python3.10/site-packages/nvidia/cublas/lib/libnvblas.so.12 filter=lfs diff=lfs merge=lfs -text diff --git a/mantis_evalkit/lib/python3.10/site-packages/nvidia/cublas/lib/libnvblas.so.12 b/mantis_evalkit/lib/python3.10/site-packages/nvidia/cublas/lib/libnvblas.so.12 new file mode 100644 index 0000000000000000000000000000000000000000..344fa26ac879430c24c368248452794601fbd1ea --- /dev/null +++ b/mantis_evalkit/lib/python3.10/site-packages/nvidia/cublas/lib/libnvblas.so.12 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f85e945ef531cc36603989041594f3bb71a1ae22abd7b258bde0c4813aebc561 +size 737048 diff --git a/mantis_evalkit/lib/python3.10/site-packages/nvidia/curand/__init__.py b/mantis_evalkit/lib/python3.10/site-packages/nvidia/curand/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/mantis_evalkit/lib/python3.10/site-packages/nvidia/cusparse/__init__.py b/mantis_evalkit/lib/python3.10/site-packages/nvidia/cusparse/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/mantis_evalkit/lib/python3.10/site-packages/nvidia/cusparse/__pycache__/__init__.cpython-310.pyc b/mantis_evalkit/lib/python3.10/site-packages/nvidia/cusparse/__pycache__/__init__.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b96b3907bcf5e56bdcc477c683acf76a1a5c7afa Binary files /dev/null and b/mantis_evalkit/lib/python3.10/site-packages/nvidia/cusparse/__pycache__/__init__.cpython-310.pyc differ diff --git a/mantis_evalkit/lib/python3.10/site-packages/nvidia/cusparse/include/__init__.py b/mantis_evalkit/lib/python3.10/site-packages/nvidia/cusparse/include/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/mantis_evalkit/lib/python3.10/site-packages/nvidia/cusparse/include/__pycache__/__init__.cpython-310.pyc b/mantis_evalkit/lib/python3.10/site-packages/nvidia/cusparse/include/__pycache__/__init__.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..25a53858cdf2d11a95bdfcf46531944c450c427d Binary files /dev/null and b/mantis_evalkit/lib/python3.10/site-packages/nvidia/cusparse/include/__pycache__/__init__.cpython-310.pyc differ diff --git a/mantis_evalkit/lib/python3.10/site-packages/nvidia/cusparse/include/cusparse.h b/mantis_evalkit/lib/python3.10/site-packages/nvidia/cusparse/include/cusparse.h new file mode 100644 index 0000000000000000000000000000000000000000..a4df07f130786b46049fd4becc5cde3758e40512 --- /dev/null +++ b/mantis_evalkit/lib/python3.10/site-packages/nvidia/cusparse/include/cusparse.h @@ -0,0 +1,5811 @@ +/* + * Copyright 1993-2023 NVIDIA Corporation. All rights reserved. + * + * NOTICE TO LICENSEE: + * + * This source code and/or documentation ("Licensed Deliverables") are + * subject to NVIDIA intellectual property rights under U.S. and + * international Copyright laws. + * + * These Licensed Deliverables contained herein is PROPRIETARY and + * CONFIDENTIAL to NVIDIA and is being provided under the terms and + * conditions of a form of NVIDIA software license agreement by and + * between NVIDIA and Licensee ("License Agreement") or electronically + * accepted by Licensee. Notwithstanding any terms or conditions to + * the contrary in the License Agreement, reproduction or disclosure + * of the Licensed Deliverables to any third party without the express + * written consent of NVIDIA is prohibited. + * + * NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE + * LICENSE AGREEMENT, NVIDIA MAKES NO REPRESENTATION ABOUT THE + * SUITABILITY OF THESE LICENSED DELIVERABLES FOR ANY PURPOSE. IT IS + * PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY OF ANY KIND. + * NVIDIA DISCLAIMS ALL WARRANTIES WITH REGARD TO THESE LICENSED + * DELIVERABLES, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY, + * NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE. + * NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE + * LICENSE AGREEMENT, IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY + * SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, OR ANY + * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS + * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THESE LICENSED DELIVERABLES. + * + * U.S. Government End Users. These Licensed Deliverables are a + * "commercial item" as that term is defined at 48 C.F.R. 2.101 (OCT + * 1995), consisting of "commercial computer software" and "commercial + * computer software documentation" as such terms are used in 48 + * C.F.R. 12.212 (SEPT 1995) and is provided to the U.S. Government + * only as a commercial end item. Consistent with 48 C.F.R.12.212 and + * 48 C.F.R. 227.7202-1 through 227.7202-4 (JUNE 1995), all + * U.S. Government End Users acquire the Licensed Deliverables with + * only those rights set forth herein. + * + * Any use of the Licensed Deliverables in individual and commercial + * software must include, in the user documentation and internal + * comments to the code, the above Disclaimer and U.S. Government End + * Users Notice. + */ +#if !defined(CUSPARSE_H_) +#define CUSPARSE_H_ + +#include // cuComplex +#include // cudaStream_t +#include // CUDA_R_32F +#include // int64_t +#include // FILE* + +#if defined(__cplusplus) +# include // __half +#endif // defined(__cplusplus) + +//############################################################################## +//# CUSPARSE VERSION INFORMATION +//############################################################################## + +#define CUSPARSE_VER_MAJOR 12 +#define CUSPARSE_VER_MINOR 1 +#define CUSPARSE_VER_PATCH 0 +#define CUSPARSE_VER_BUILD 106 +#define CUSPARSE_VERSION (CUSPARSE_VER_MAJOR * 1000 + \ + CUSPARSE_VER_MINOR * 100 + \ + CUSPARSE_VER_PATCH) + +// ############################################################################# +// # BASIC MACROS +// ############################################################################# + +#if !defined(CUSPARSEAPI) +# if defined(_WIN32) +# define CUSPARSEAPI __stdcall +# else +# define CUSPARSEAPI +# endif +#endif + +//------------------------------------------------------------------------------ + +#if !defined(_MSC_VER) +# define CUSPARSE_CPP_VERSION __cplusplus +#elif _MSC_FULL_VER >= 190024210 // Visual Studio 2015 Update 3 +# define CUSPARSE_CPP_VERSION _MSVC_LANG +#else +# define CUSPARSE_CPP_VERSION 0 +#endif + +// ############################################################################# +// # CUSPARSE_DEPRECATED MACRO +// ############################################################################# + +#if !defined(DISABLE_CUSPARSE_DEPRECATED) + +# if CUSPARSE_CPP_VERSION >= 201402L + +# define CUSPARSE_DEPRECATED(new_func) \ + [[deprecated("please use " #new_func " instead")]] + +# elif defined(_MSC_VER) + +# define CUSPARSE_DEPRECATED(new_func) \ + __declspec(deprecated("please use " #new_func " instead")) + +# elif defined(__INTEL_COMPILER) || defined(__clang__) || \ + (defined(__GNUC__) && \ + (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5))) + +# define CUSPARSE_DEPRECATED(new_func) \ + __attribute__((deprecated("please use " #new_func " instead"))) + +# elif defined(__GNUC__) || defined(__xlc__) + +# define CUSPARSE_DEPRECATED(new_func) \ + __attribute__((deprecated)) + +# else + +# define CUSPARSE_DEPRECATED(new_func) + +# endif // defined(__cplusplus) && __cplusplus >= 201402L +//------------------------------------------------------------------------------ + +# if CUSPARSE_CPP_VERSION >= 201703L + +# define CUSPARSE_DEPRECATED_ENUM(new_enum) \ + [[deprecated("please use " #new_enum " instead")]] + +# elif defined(__clang__) || \ + (defined(__GNUC__) && __GNUC__ >= 6 && !defined(__PGI)) + +# define CUSPARSE_DEPRECATED_ENUM(new_enum) \ + __attribute__((deprecated("please use " #new_enum " instead"))) + +# else + +# define CUSPARSE_DEPRECATED_ENUM(new_enum) + +# endif // defined(__cplusplus) && __cplusplus >= 201402L + +#else // defined(DISABLE_CUSPARSE_DEPRECATED) + +# define CUSPARSE_DEPRECATED(new_func) +# define CUSPARSE_DEPRECATED_ENUM(new_enum) + +#endif // !defined(DISABLE_CUSPARSE_DEPRECATED) + +#undef CUSPARSE_CPP_VERSION + +//------------------------------------------------------------------------------ + +#if defined(__cplusplus) +extern "C" { +#endif // defined(__cplusplus) + +//############################################################################## +//# OPAQUE DATA STRUCTURES +//############################################################################## + +struct cusparseContext; +typedef struct cusparseContext* cusparseHandle_t; + +struct cusparseMatDescr; +typedef struct cusparseMatDescr* cusparseMatDescr_t; + +struct bsrsv2Info; +typedef struct bsrsv2Info* bsrsv2Info_t; + +struct bsrsm2Info; +typedef struct bsrsm2Info* bsrsm2Info_t; + +struct csric02Info; +typedef struct csric02Info* csric02Info_t; + +struct bsric02Info; +typedef struct bsric02Info* bsric02Info_t; + +struct csrilu02Info; +typedef struct csrilu02Info* csrilu02Info_t; + +struct bsrilu02Info; +typedef struct bsrilu02Info* bsrilu02Info_t; + +struct csru2csrInfo; +typedef struct csru2csrInfo* csru2csrInfo_t; + +struct cusparseColorInfo; +typedef struct cusparseColorInfo* cusparseColorInfo_t; + +struct pruneInfo; +typedef struct pruneInfo* pruneInfo_t; + +//############################################################################## +//# ENUMERATORS +//############################################################################## + +typedef enum { + CUSPARSE_STATUS_SUCCESS = 0, + CUSPARSE_STATUS_NOT_INITIALIZED = 1, + CUSPARSE_STATUS_ALLOC_FAILED = 2, + CUSPARSE_STATUS_INVALID_VALUE = 3, + CUSPARSE_STATUS_ARCH_MISMATCH = 4, + CUSPARSE_STATUS_MAPPING_ERROR = 5, + CUSPARSE_STATUS_EXECUTION_FAILED = 6, + CUSPARSE_STATUS_INTERNAL_ERROR = 7, + CUSPARSE_STATUS_MATRIX_TYPE_NOT_SUPPORTED = 8, + CUSPARSE_STATUS_ZERO_PIVOT = 9, + CUSPARSE_STATUS_NOT_SUPPORTED = 10, + CUSPARSE_STATUS_INSUFFICIENT_RESOURCES = 11 +} cusparseStatus_t; + +typedef enum { + CUSPARSE_POINTER_MODE_HOST = 0, + CUSPARSE_POINTER_MODE_DEVICE = 1 +} cusparsePointerMode_t; + +typedef enum { + CUSPARSE_ACTION_SYMBOLIC = 0, + CUSPARSE_ACTION_NUMERIC = 1 +} cusparseAction_t; + +typedef enum { + CUSPARSE_MATRIX_TYPE_GENERAL = 0, + CUSPARSE_MATRIX_TYPE_SYMMETRIC = 1, + CUSPARSE_MATRIX_TYPE_HERMITIAN = 2, + CUSPARSE_MATRIX_TYPE_TRIANGULAR = 3 +} cusparseMatrixType_t; + +typedef enum { + CUSPARSE_FILL_MODE_LOWER = 0, + CUSPARSE_FILL_MODE_UPPER = 1 +} cusparseFillMode_t; + +typedef enum { + CUSPARSE_DIAG_TYPE_NON_UNIT = 0, + CUSPARSE_DIAG_TYPE_UNIT = 1 +} cusparseDiagType_t; + +typedef enum { + CUSPARSE_INDEX_BASE_ZERO = 0, + CUSPARSE_INDEX_BASE_ONE = 1 +} cusparseIndexBase_t; + +typedef enum { + CUSPARSE_OPERATION_NON_TRANSPOSE = 0, + CUSPARSE_OPERATION_TRANSPOSE = 1, + CUSPARSE_OPERATION_CONJUGATE_TRANSPOSE = 2 +} cusparseOperation_t; + +typedef enum { + CUSPARSE_DIRECTION_ROW = 0, + CUSPARSE_DIRECTION_COLUMN = 1 +} cusparseDirection_t; + +typedef enum { + CUSPARSE_SOLVE_POLICY_NO_LEVEL = 0, + CUSPARSE_SOLVE_POLICY_USE_LEVEL = 1 +} cusparseSolvePolicy_t; + +typedef enum { + CUSPARSE_COLOR_ALG0 = 0, // default + CUSPARSE_COLOR_ALG1 = 1 +} cusparseColorAlg_t; + +//############################################################################## +//# INITIALIZATION AND MANAGEMENT ROUTINES +//############################################################################## + +cusparseStatus_t CUSPARSEAPI +cusparseCreate(cusparseHandle_t* handle); + +cusparseStatus_t CUSPARSEAPI +cusparseDestroy(cusparseHandle_t handle); + +cusparseStatus_t CUSPARSEAPI +cusparseGetVersion(cusparseHandle_t handle, + int* version); + +cusparseStatus_t CUSPARSEAPI +cusparseGetProperty(libraryPropertyType type, + int* value); + +const char* CUSPARSEAPI +cusparseGetErrorName(cusparseStatus_t status); + +const char* CUSPARSEAPI +cusparseGetErrorString(cusparseStatus_t status); + +cusparseStatus_t CUSPARSEAPI +cusparseSetStream(cusparseHandle_t handle, + cudaStream_t streamId); + +cusparseStatus_t CUSPARSEAPI +cusparseGetStream(cusparseHandle_t handle, + cudaStream_t* streamId); + +cusparseStatus_t CUSPARSEAPI +cusparseGetPointerMode(cusparseHandle_t handle, + cusparsePointerMode_t* mode); + +cusparseStatus_t CUSPARSEAPI +cusparseSetPointerMode(cusparseHandle_t handle, + cusparsePointerMode_t mode); + +//############################################################################## +//# LOGGING APIs +//############################################################################## + +typedef void (*cusparseLoggerCallback_t)(int logLevel, + const char* functionName, + const char* message); + +cusparseStatus_t CUSPARSEAPI +cusparseLoggerSetCallback(cusparseLoggerCallback_t callback); + +cusparseStatus_t CUSPARSEAPI +cusparseLoggerSetFile(FILE* file); + +cusparseStatus_t CUSPARSEAPI +cusparseLoggerOpenFile(const char* logFile); + +cusparseStatus_t CUSPARSEAPI +cusparseLoggerSetLevel(int level); + +cusparseStatus_t CUSPARSEAPI +cusparseLoggerSetMask(int mask); + +cusparseStatus_t CUSPARSEAPI +cusparseLoggerForceDisable(void); + +//############################################################################## +//# HELPER ROUTINES +//############################################################################## + +cusparseStatus_t CUSPARSEAPI +cusparseCreateMatDescr(cusparseMatDescr_t* descrA); + +cusparseStatus_t CUSPARSEAPI +cusparseDestroyMatDescr(cusparseMatDescr_t descrA); + +//cusparseStatus_t CUSPARSEAPI +//cusparseCopyMatDescr(cusparseMatDescr_t dest, +// const cusparseMatDescr_t src); + +cusparseStatus_t CUSPARSEAPI +cusparseSetMatType(cusparseMatDescr_t descrA, + cusparseMatrixType_t type); + +cusparseMatrixType_t CUSPARSEAPI +cusparseGetMatType(const cusparseMatDescr_t descrA); + +cusparseStatus_t CUSPARSEAPI +cusparseSetMatFillMode(cusparseMatDescr_t descrA, + cusparseFillMode_t fillMode); + +cusparseFillMode_t CUSPARSEAPI +cusparseGetMatFillMode(const cusparseMatDescr_t descrA); + +cusparseStatus_t CUSPARSEAPI +cusparseSetMatDiagType(cusparseMatDescr_t descrA, + cusparseDiagType_t diagType); + +cusparseDiagType_t CUSPARSEAPI +cusparseGetMatDiagType(const cusparseMatDescr_t descrA); + +cusparseStatus_t CUSPARSEAPI +cusparseSetMatIndexBase(cusparseMatDescr_t descrA, + cusparseIndexBase_t base); + +cusparseIndexBase_t CUSPARSEAPI +cusparseGetMatIndexBase(const cusparseMatDescr_t descrA); + +cusparseStatus_t CUSPARSEAPI +cusparseCreateCsric02Info(csric02Info_t* info); + +cusparseStatus_t CUSPARSEAPI +cusparseDestroyCsric02Info(csric02Info_t info); + +cusparseStatus_t CUSPARSEAPI +cusparseCreateBsric02Info(bsric02Info_t* info); + +cusparseStatus_t CUSPARSEAPI +cusparseDestroyBsric02Info(bsric02Info_t info); + +cusparseStatus_t CUSPARSEAPI +cusparseCreateCsrilu02Info(csrilu02Info_t* info); + +cusparseStatus_t CUSPARSEAPI +cusparseDestroyCsrilu02Info(csrilu02Info_t info); + +cusparseStatus_t CUSPARSEAPI +cusparseCreateBsrilu02Info(bsrilu02Info_t* info); + +cusparseStatus_t CUSPARSEAPI +cusparseDestroyBsrilu02Info(bsrilu02Info_t info); + +cusparseStatus_t CUSPARSEAPI +cusparseCreateBsrsv2Info(bsrsv2Info_t* info); + +cusparseStatus_t CUSPARSEAPI +cusparseDestroyBsrsv2Info(bsrsv2Info_t info); + +cusparseStatus_t CUSPARSEAPI +cusparseCreateBsrsm2Info(bsrsm2Info_t* info); + +cusparseStatus_t CUSPARSEAPI +cusparseDestroyBsrsm2Info(bsrsm2Info_t info); + +cusparseStatus_t CUSPARSEAPI +cusparseCreateCsru2csrInfo(csru2csrInfo_t* info); + +cusparseStatus_t CUSPARSEAPI +cusparseDestroyCsru2csrInfo(csru2csrInfo_t info); + +cusparseStatus_t CUSPARSEAPI +cusparseCreateColorInfo(cusparseColorInfo_t* info); + +cusparseStatus_t CUSPARSEAPI +cusparseDestroyColorInfo(cusparseColorInfo_t info); + +cusparseStatus_t CUSPARSEAPI +cusparseCreatePruneInfo(pruneInfo_t* info); + +cusparseStatus_t CUSPARSEAPI +cusparseDestroyPruneInfo(pruneInfo_t info); + +//############################################################################## +//# SPARSE LEVEL 2 ROUTINES +//############################################################################## + +cusparseStatus_t CUSPARSEAPI +cusparseSgemvi(cusparseHandle_t handle, + cusparseOperation_t transA, + int m, + int n, + const float* alpha, + const float* A, + int lda, + int nnz, + const float* xVal, + const int* xInd, + const float* beta, + float* y, + cusparseIndexBase_t idxBase, + void* pBuffer); + +cusparseStatus_t CUSPARSEAPI +cusparseSgemvi_bufferSize(cusparseHandle_t handle, + cusparseOperation_t transA, + int m, + int n, + int nnz, + int* pBufferSize); + +cusparseStatus_t CUSPARSEAPI +cusparseDgemvi(cusparseHandle_t handle, + cusparseOperation_t transA, + int m, + int n, + const double* alpha, + const double* A, + int lda, + int nnz, + const double* xVal, + const int* xInd, + const double* beta, + double* y, + cusparseIndexBase_t idxBase, + void* pBuffer); + +cusparseStatus_t CUSPARSEAPI +cusparseDgemvi_bufferSize(cusparseHandle_t handle, + cusparseOperation_t transA, + int m, + int n, + int nnz, + int* pBufferSize); + +cusparseStatus_t CUSPARSEAPI +cusparseCgemvi(cusparseHandle_t handle, + cusparseOperation_t transA, + int m, + int n, + const cuComplex* alpha, + const cuComplex* A, + int lda, + int nnz, + const cuComplex* xVal, + const int* xInd, + const cuComplex* beta, + cuComplex* y, + cusparseIndexBase_t idxBase, + void* pBuffer); + +cusparseStatus_t CUSPARSEAPI +cusparseCgemvi_bufferSize(cusparseHandle_t handle, + cusparseOperation_t transA, + int m, + int n, + int nnz, + int* pBufferSize); + +cusparseStatus_t CUSPARSEAPI +cusparseZgemvi(cusparseHandle_t handle, + cusparseOperation_t transA, + int m, + int n, + const cuDoubleComplex* alpha, + const cuDoubleComplex* A, + int lda, + int nnz, + const cuDoubleComplex* xVal, + const int* xInd, + const cuDoubleComplex* beta, + cuDoubleComplex* y, + cusparseIndexBase_t idxBase, + void* pBuffer); + +cusparseStatus_t CUSPARSEAPI +cusparseZgemvi_bufferSize(cusparseHandle_t handle, + cusparseOperation_t transA, + int m, + int n, + int nnz, + int* pBufferSize); + +cusparseStatus_t CUSPARSEAPI +cusparseSbsrmv(cusparseHandle_t handle, + cusparseDirection_t dirA, + cusparseOperation_t transA, + int mb, + int nb, + int nnzb, + const float* alpha, + const cusparseMatDescr_t descrA, + const float* bsrSortedValA, + const int* bsrSortedRowPtrA, + const int* bsrSortedColIndA, + int blockDim, + const float* x, + const float* beta, + float* y); + +cusparseStatus_t CUSPARSEAPI +cusparseDbsrmv(cusparseHandle_t handle, + cusparseDirection_t dirA, + cusparseOperation_t transA, + int mb, + int nb, + int nnzb, + const double* alpha, + const cusparseMatDescr_t descrA, + const double* bsrSortedValA, + const int* bsrSortedRowPtrA, + const int* bsrSortedColIndA, + int blockDim, + const double* x, + const double* beta, + double* y); + +cusparseStatus_t CUSPARSEAPI +cusparseCbsrmv(cusparseHandle_t handle, + cusparseDirection_t dirA, + cusparseOperation_t transA, + int mb, + int nb, + int nnzb, + const cuComplex* alpha, + const cusparseMatDescr_t descrA, + const cuComplex* bsrSortedValA, + const int* bsrSortedRowPtrA, + const int* bsrSortedColIndA, + int blockDim, + const cuComplex* x, + const cuComplex* beta, + cuComplex* y); + +cusparseStatus_t CUSPARSEAPI +cusparseZbsrmv(cusparseHandle_t handle, + cusparseDirection_t dirA, + cusparseOperation_t transA, + int mb, + int nb, + int nnzb, + const cuDoubleComplex* alpha, + const cusparseMatDescr_t descrA, + const cuDoubleComplex* bsrSortedValA, + const int* bsrSortedRowPtrA, + const int* bsrSortedColIndA, + int blockDim, + const cuDoubleComplex* x, + const cuDoubleComplex* beta, + cuDoubleComplex* y); + +cusparseStatus_t CUSPARSEAPI +cusparseSbsrxmv(cusparseHandle_t handle, + cusparseDirection_t dirA, + cusparseOperation_t transA, + int sizeOfMask, + int mb, + int nb, + int nnzb, + const float* alpha, + const cusparseMatDescr_t descrA, + const float* bsrSortedValA, + const int* bsrSortedMaskPtrA, + const int* bsrSortedRowPtrA, + const int* bsrSortedEndPtrA, + const int* bsrSortedColIndA, + int blockDim, + const float* x, + const float* beta, + float* y); + +cusparseStatus_t CUSPARSEAPI +cusparseDbsrxmv(cusparseHandle_t handle, + cusparseDirection_t dirA, + cusparseOperation_t transA, + int sizeOfMask, + int mb, + int nb, + int nnzb, + const double* alpha, + const cusparseMatDescr_t descrA, + const double* bsrSortedValA, + const int* bsrSortedMaskPtrA, + const int* bsrSortedRowPtrA, + const int* bsrSortedEndPtrA, + const int* bsrSortedColIndA, + int blockDim, + const double* x, + const double* beta, + double* y); + +cusparseStatus_t CUSPARSEAPI +cusparseCbsrxmv(cusparseHandle_t handle, + cusparseDirection_t dirA, + cusparseOperation_t transA, + int sizeOfMask, + int mb, + int nb, + int nnzb, + const cuComplex* alpha, + const cusparseMatDescr_t descrA, + const cuComplex* bsrSortedValA, + const int* bsrSortedMaskPtrA, + const int* bsrSortedRowPtrA, + const int* bsrSortedEndPtrA, + const int* bsrSortedColIndA, + int blockDim, + const cuComplex* x, + const cuComplex* beta, + cuComplex* y); + +cusparseStatus_t CUSPARSEAPI +cusparseZbsrxmv(cusparseHandle_t handle, + cusparseDirection_t dirA, + cusparseOperation_t transA, + int sizeOfMask, + int mb, + int nb, + int nnzb, + const cuDoubleComplex* alpha, + const cusparseMatDescr_t descrA, + const cuDoubleComplex* bsrSortedValA, + const int* bsrSortedMaskPtrA, + const int* bsrSortedRowPtrA, + const int* bsrSortedEndPtrA, + const int* bsrSortedColIndA, + int blockDim, + const cuDoubleComplex* x, + const cuDoubleComplex* beta, + cuDoubleComplex* y); + +cusparseStatus_t CUSPARSEAPI +cusparseXbsrsv2_zeroPivot(cusparseHandle_t handle, + bsrsv2Info_t info, + int* position); + +cusparseStatus_t CUSPARSEAPI +cusparseSbsrsv2_bufferSize(cusparseHandle_t handle, + cusparseDirection_t dirA, + cusparseOperation_t transA, + int mb, + int nnzb, + const cusparseMatDescr_t descrA, + float* bsrSortedValA, + const int* bsrSortedRowPtrA, + const int* bsrSortedColIndA, + int blockDim, + bsrsv2Info_t info, + int* pBufferSizeInBytes); + +cusparseStatus_t CUSPARSEAPI +cusparseDbsrsv2_bufferSize(cusparseHandle_t handle, + cusparseDirection_t dirA, + cusparseOperation_t transA, + int mb, + int nnzb, + const cusparseMatDescr_t descrA, + double* bsrSortedValA, + const int* bsrSortedRowPtrA, + const int* bsrSortedColIndA, + int blockDim, + bsrsv2Info_t info, + int* pBufferSizeInBytes); + +cusparseStatus_t CUSPARSEAPI +cusparseCbsrsv2_bufferSize(cusparseHandle_t handle, + cusparseDirection_t dirA, + cusparseOperation_t transA, + int mb, + int nnzb, + const cusparseMatDescr_t descrA, + cuComplex* bsrSortedValA, + const int* bsrSortedRowPtrA, + const int* bsrSortedColIndA, + int blockDim, + bsrsv2Info_t info, + int* pBufferSizeInBytes); + +cusparseStatus_t CUSPARSEAPI +cusparseZbsrsv2_bufferSize(cusparseHandle_t handle, + cusparseDirection_t dirA, + cusparseOperation_t transA, + int mb, + int nnzb, + const cusparseMatDescr_t descrA, + cuDoubleComplex* bsrSortedValA, + const int* bsrSortedRowPtrA, + const int* bsrSortedColIndA, + int blockDim, + bsrsv2Info_t info, + int* pBufferSizeInBytes); + +cusparseStatus_t CUSPARSEAPI +cusparseSbsrsv2_bufferSizeExt(cusparseHandle_t handle, + cusparseDirection_t dirA, + cusparseOperation_t transA, + int mb, + int nnzb, + const cusparseMatDescr_t descrA, + float* bsrSortedValA, + const int* bsrSortedRowPtrA, + const int* bsrSortedColIndA, + int blockSize, + bsrsv2Info_t info, + size_t* pBufferSize); + +cusparseStatus_t CUSPARSEAPI +cusparseDbsrsv2_bufferSizeExt(cusparseHandle_t handle, + cusparseDirection_t dirA, + cusparseOperation_t transA, + int mb, + int nnzb, + const cusparseMatDescr_t descrA, + double* bsrSortedValA, + const int* bsrSortedRowPtrA, + const int* bsrSortedColIndA, + int blockSize, + bsrsv2Info_t info, + size_t* pBufferSize); + +cusparseStatus_t CUSPARSEAPI +cusparseCbsrsv2_bufferSizeExt(cusparseHandle_t handle, + cusparseDirection_t dirA, + cusparseOperation_t transA, + int mb, + int nnzb, + const cusparseMatDescr_t descrA, + cuComplex* bsrSortedValA, + const int* bsrSortedRowPtrA, + const int* bsrSortedColIndA, + int blockSize, + bsrsv2Info_t info, + size_t* pBufferSize); + +cusparseStatus_t CUSPARSEAPI +cusparseZbsrsv2_bufferSizeExt(cusparseHandle_t handle, + cusparseDirection_t dirA, + cusparseOperation_t transA, + int mb, + int nnzb, + const cusparseMatDescr_t descrA, + cuDoubleComplex* bsrSortedValA, + const int* bsrSortedRowPtrA, + const int* bsrSortedColIndA, + int blockSize, + bsrsv2Info_t info, + size_t* pBufferSize); + +cusparseStatus_t CUSPARSEAPI +cusparseSbsrsv2_analysis(cusparseHandle_t handle, + cusparseDirection_t dirA, + cusparseOperation_t transA, + int mb, + int nnzb, + const cusparseMatDescr_t descrA, + const float* bsrSortedValA, + const int* bsrSortedRowPtrA, + const int* bsrSortedColIndA, + int blockDim, + bsrsv2Info_t info, + cusparseSolvePolicy_t policy, + void* pBuffer); + +cusparseStatus_t CUSPARSEAPI +cusparseDbsrsv2_analysis(cusparseHandle_t handle, + cusparseDirection_t dirA, + cusparseOperation_t transA, + int mb, + int nnzb, + const cusparseMatDescr_t descrA, + const double* bsrSortedValA, + const int* bsrSortedRowPtrA, + const int* bsrSortedColIndA, + int blockDim, + bsrsv2Info_t info, + cusparseSolvePolicy_t policy, + void* pBuffer); + +cusparseStatus_t CUSPARSEAPI +cusparseCbsrsv2_analysis(cusparseHandle_t handle, + cusparseDirection_t dirA, + cusparseOperation_t transA, + int mb, + int nnzb, + const cusparseMatDescr_t descrA, + const cuComplex* bsrSortedValA, + const int* bsrSortedRowPtrA, + const int* bsrSortedColIndA, + int blockDim, + bsrsv2Info_t info, + cusparseSolvePolicy_t policy, + void* pBuffer); + +cusparseStatus_t CUSPARSEAPI +cusparseZbsrsv2_analysis(cusparseHandle_t handle, + cusparseDirection_t dirA, + cusparseOperation_t transA, + int mb, + int nnzb, + const cusparseMatDescr_t descrA, + const cuDoubleComplex* bsrSortedValA, + const int* bsrSortedRowPtrA, + const int* bsrSortedColIndA, + int blockDim, + bsrsv2Info_t info, + cusparseSolvePolicy_t policy, + void* pBuffer); + +cusparseStatus_t CUSPARSEAPI +cusparseSbsrsv2_solve(cusparseHandle_t handle, + cusparseDirection_t dirA, + cusparseOperation_t transA, + int mb, + int nnzb, + const float* alpha, + const cusparseMatDescr_t descrA, + const float* bsrSortedValA, + const int* bsrSortedRowPtrA, + const int* bsrSortedColIndA, + int blockDim, + bsrsv2Info_t info, + const float* f, + float* x, + cusparseSolvePolicy_t policy, + void* pBuffer); + +cusparseStatus_t CUSPARSEAPI +cusparseDbsrsv2_solve(cusparseHandle_t handle, + cusparseDirection_t dirA, + cusparseOperation_t transA, + int mb, + int nnzb, + const double* alpha, + const cusparseMatDescr_t descrA, + const double* bsrSortedValA, + const int* bsrSortedRowPtrA, + const int* bsrSortedColIndA, + int blockDim, + bsrsv2Info_t info, + const double* f, + double* x, + cusparseSolvePolicy_t policy, + void* pBuffer); + +cusparseStatus_t CUSPARSEAPI +cusparseCbsrsv2_solve(cusparseHandle_t handle, + cusparseDirection_t dirA, + cusparseOperation_t transA, + int mb, + int nnzb, + const cuComplex* alpha, + const cusparseMatDescr_t descrA, + const cuComplex* bsrSortedValA, + const int* bsrSortedRowPtrA, + const int* bsrSortedColIndA, + int blockDim, + bsrsv2Info_t info, + const cuComplex* f, + cuComplex* x, + cusparseSolvePolicy_t policy, + void* pBuffer); + +cusparseStatus_t CUSPARSEAPI +cusparseZbsrsv2_solve(cusparseHandle_t handle, + cusparseDirection_t dirA, + cusparseOperation_t transA, + int mb, + int nnzb, + const cuDoubleComplex* alpha, + const cusparseMatDescr_t descrA, + const cuDoubleComplex* bsrSortedValA, + const int* bsrSortedRowPtrA, + const int* bsrSortedColIndA, + int blockDim, + bsrsv2Info_t info, + const cuDoubleComplex* f, + cuDoubleComplex* x, + cusparseSolvePolicy_t policy, + void* pBuffer); + +//############################################################################## +//# SPARSE LEVEL 3 ROUTINES +//############################################################################## + +cusparseStatus_t CUSPARSEAPI +cusparseSbsrmm(cusparseHandle_t handle, + cusparseDirection_t dirA, + cusparseOperation_t transA, + cusparseOperation_t transB, + int mb, + int n, + int kb, + int nnzb, + const float* alpha, + const cusparseMatDescr_t descrA, + const float* bsrSortedValA, + const int* bsrSortedRowPtrA, + const int* bsrSortedColIndA, + const int blockSize, + const float* B, + const int ldb, + const float* beta, + float* C, + int ldc); + +cusparseStatus_t CUSPARSEAPI +cusparseDbsrmm(cusparseHandle_t handle, + cusparseDirection_t dirA, + cusparseOperation_t transA, + cusparseOperation_t transB, + int mb, + int n, + int kb, + int nnzb, + const double* alpha, + const cusparseMatDescr_t descrA, + const double* bsrSortedValA, + const int* bsrSortedRowPtrA, + const int* bsrSortedColIndA, + const int blockSize, + const double* B, + const int ldb, + const double* beta, + double* C, + int ldc); + +cusparseStatus_t CUSPARSEAPI +cusparseCbsrmm(cusparseHandle_t handle, + cusparseDirection_t dirA, + cusparseOperation_t transA, + cusparseOperation_t transB, + int mb, + int n, + int kb, + int nnzb, + const cuComplex* alpha, + const cusparseMatDescr_t descrA, + const cuComplex* bsrSortedValA, + const int* bsrSortedRowPtrA, + const int* bsrSortedColIndA, + const int blockSize, + const cuComplex* B, + const int ldb, + const cuComplex* beta, + cuComplex* C, + int ldc); + +cusparseStatus_t CUSPARSEAPI + cusparseZbsrmm(cusparseHandle_t handle, + cusparseDirection_t dirA, + cusparseOperation_t transA, + cusparseOperation_t transB, + int mb, + int n, + int kb, + int nnzb, + const cuDoubleComplex* alpha, + const cusparseMatDescr_t descrA, + const cuDoubleComplex* bsrSortedValA, + const int* bsrSortedRowPtrA, + const int* bsrSortedColIndA, + const int blockSize, + const cuDoubleComplex* B, + const int ldb, + const cuDoubleComplex* beta, + cuDoubleComplex* C, + int ldc); + +cusparseStatus_t CUSPARSEAPI +cusparseXbsrsm2_zeroPivot(cusparseHandle_t handle, + bsrsm2Info_t info, + int* position); + +cusparseStatus_t CUSPARSEAPI +cusparseSbsrsm2_bufferSize(cusparseHandle_t handle, + cusparseDirection_t dirA, + cusparseOperation_t transA, + cusparseOperation_t transXY, + int mb, + int n, + int nnzb, + const cusparseMatDescr_t descrA, + float* bsrSortedVal, + const int* bsrSortedRowPtr, + const int* bsrSortedColInd, + int blockSize, + bsrsm2Info_t info, + int* pBufferSizeInBytes); + +cusparseStatus_t CUSPARSEAPI +cusparseDbsrsm2_bufferSize(cusparseHandle_t handle, + cusparseDirection_t dirA, + cusparseOperation_t transA, + cusparseOperation_t transXY, + int mb, + int n, + int nnzb, + const cusparseMatDescr_t descrA, + double* bsrSortedVal, + const int* bsrSortedRowPtr, + const int* bsrSortedColInd, + int blockSize, + bsrsm2Info_t info, + int* pBufferSizeInBytes); + +cusparseStatus_t CUSPARSEAPI +cusparseCbsrsm2_bufferSize(cusparseHandle_t handle, + cusparseDirection_t dirA, + cusparseOperation_t transA, + cusparseOperation_t transXY, + int mb, + int n, + int nnzb, + const cusparseMatDescr_t descrA, + cuComplex* bsrSortedVal, + const int* bsrSortedRowPtr, + const int* bsrSortedColInd, + int blockSize, + bsrsm2Info_t info, + int* pBufferSizeInBytes); + +cusparseStatus_t CUSPARSEAPI +cusparseZbsrsm2_bufferSize(cusparseHandle_t handle, + cusparseDirection_t dirA, + cusparseOperation_t transA, + cusparseOperation_t transXY, + int mb, + int n, + int nnzb, + const cusparseMatDescr_t descrA, + cuDoubleComplex* bsrSortedVal, + const int* bsrSortedRowPtr, + const int* bsrSortedColInd, + int blockSize, + bsrsm2Info_t info, + int* pBufferSizeInBytes); + +cusparseStatus_t CUSPARSEAPI +cusparseSbsrsm2_bufferSizeExt(cusparseHandle_t handle, + cusparseDirection_t dirA, + cusparseOperation_t transA, + cusparseOperation_t transB, + int mb, + int n, + int nnzb, + const cusparseMatDescr_t descrA, + float* bsrSortedVal, + const int* bsrSortedRowPtr, + const int* bsrSortedColInd, + int blockSize, + bsrsm2Info_t info, + size_t* pBufferSize); + +cusparseStatus_t CUSPARSEAPI +cusparseDbsrsm2_bufferSizeExt(cusparseHandle_t handle, + cusparseDirection_t dirA, + cusparseOperation_t transA, + cusparseOperation_t transB, + int mb, + int n, + int nnzb, + const cusparseMatDescr_t descrA, + double* bsrSortedVal, + const int* bsrSortedRowPtr, + const int* bsrSortedColInd, + int blockSize, + bsrsm2Info_t info, + size_t* pBufferSize); + +cusparseStatus_t CUSPARSEAPI +cusparseCbsrsm2_bufferSizeExt(cusparseHandle_t handle, + cusparseDirection_t dirA, + cusparseOperation_t transA, + cusparseOperation_t transB, + int mb, + int n, + int nnzb, + const cusparseMatDescr_t descrA, + cuComplex* bsrSortedVal, + const int* bsrSortedRowPtr, + const int* bsrSortedColInd, + int blockSize, + bsrsm2Info_t info, + size_t* pBufferSize); + +cusparseStatus_t CUSPARSEAPI +cusparseZbsrsm2_bufferSizeExt(cusparseHandle_t handle, + cusparseDirection_t dirA, + cusparseOperation_t transA, + cusparseOperation_t transB, + int mb, + int n, + int nnzb, + const cusparseMatDescr_t descrA, + cuDoubleComplex* bsrSortedVal, + const int* bsrSortedRowPtr, + const int* bsrSortedColInd, + int blockSize, + bsrsm2Info_t info, + size_t* pBufferSize); + +cusparseStatus_t CUSPARSEAPI +cusparseSbsrsm2_analysis(cusparseHandle_t handle, + cusparseDirection_t dirA, + cusparseOperation_t transA, + cusparseOperation_t transXY, + int mb, + int n, + int nnzb, + const cusparseMatDescr_t descrA, + const float* bsrSortedVal, + const int* bsrSortedRowPtr, + const int* bsrSortedColInd, + int blockSize, + bsrsm2Info_t info, + cusparseSolvePolicy_t policy, + void* pBuffer); + +cusparseStatus_t CUSPARSEAPI +cusparseDbsrsm2_analysis(cusparseHandle_t handle, + cusparseDirection_t dirA, + cusparseOperation_t transA, + cusparseOperation_t transXY, + int mb, + int n, + int nnzb, + const cusparseMatDescr_t descrA, + const double* bsrSortedVal, + const int* bsrSortedRowPtr, + const int* bsrSortedColInd, + int blockSize, + bsrsm2Info_t info, + cusparseSolvePolicy_t policy, + void* pBuffer); + +cusparseStatus_t CUSPARSEAPI +cusparseCbsrsm2_analysis(cusparseHandle_t handle, + cusparseDirection_t dirA, + cusparseOperation_t transA, + cusparseOperation_t transXY, + int mb, + int n, + int nnzb, + const cusparseMatDescr_t descrA, + const cuComplex* bsrSortedVal, + const int* bsrSortedRowPtr, + const int* bsrSortedColInd, + int blockSize, + bsrsm2Info_t info, + cusparseSolvePolicy_t policy, + void* pBuffer); + +cusparseStatus_t CUSPARSEAPI +cusparseZbsrsm2_analysis(cusparseHandle_t handle, + cusparseDirection_t dirA, + cusparseOperation_t transA, + cusparseOperation_t transXY, + int mb, + int n, + int nnzb, + const cusparseMatDescr_t descrA, + const cuDoubleComplex* bsrSortedVal, + const int* bsrSortedRowPtr, + const int* bsrSortedColInd, + int blockSize, + bsrsm2Info_t info, + cusparseSolvePolicy_t policy, + void* pBuffer); + +cusparseStatus_t CUSPARSEAPI +cusparseSbsrsm2_solve(cusparseHandle_t handle, + cusparseDirection_t dirA, + cusparseOperation_t transA, + cusparseOperation_t transXY, + int mb, + int n, + int nnzb, + const float* alpha, + const cusparseMatDescr_t descrA, + const float* bsrSortedVal, + const int* bsrSortedRowPtr, + const int* bsrSortedColInd, + int blockSize, + bsrsm2Info_t info, + const float* B, + int ldb, + float* X, + int ldx, + cusparseSolvePolicy_t policy, + void* pBuffer); + +cusparseStatus_t CUSPARSEAPI +cusparseDbsrsm2_solve(cusparseHandle_t handle, + cusparseDirection_t dirA, + cusparseOperation_t transA, + cusparseOperation_t transXY, + int mb, + int n, + int nnzb, + const double* alpha, + const cusparseMatDescr_t descrA, + const double* bsrSortedVal, + const int* bsrSortedRowPtr, + const int* bsrSortedColInd, + int blockSize, + bsrsm2Info_t info, + const double* B, + int ldb, + double* X, + int ldx, + cusparseSolvePolicy_t policy, + void* pBuffer); + +cusparseStatus_t CUSPARSEAPI +cusparseCbsrsm2_solve(cusparseHandle_t handle, + cusparseDirection_t dirA, + cusparseOperation_t transA, + cusparseOperation_t transXY, + int mb, + int n, + int nnzb, + const cuComplex* alpha, + const cusparseMatDescr_t descrA, + const cuComplex* bsrSortedVal, + const int* bsrSortedRowPtr, + const int* bsrSortedColInd, + int blockSize, + bsrsm2Info_t info, + const cuComplex* B, + int ldb, + cuComplex* X, + int ldx, + cusparseSolvePolicy_t policy, + void* pBuffer); + +cusparseStatus_t CUSPARSEAPI +cusparseZbsrsm2_solve(cusparseHandle_t handle, + cusparseDirection_t dirA, + cusparseOperation_t transA, + cusparseOperation_t transXY, + int mb, + int n, + int nnzb, + const cuDoubleComplex* alpha, + const cusparseMatDescr_t descrA, + const cuDoubleComplex* bsrSortedVal, + const int* bsrSortedRowPtr, + const int* bsrSortedColInd, + int blockSize, + bsrsm2Info_t info, + const cuDoubleComplex* B, + int ldb, + cuDoubleComplex* X, + int ldx, + cusparseSolvePolicy_t policy, + void* pBuffer); + +//############################################################################## +//# PRECONDITIONERS +//############################################################################## + +cusparseStatus_t CUSPARSEAPI +cusparseScsrilu02_numericBoost(cusparseHandle_t handle, + csrilu02Info_t info, + int enable_boost, + double* tol, + float* boost_val); + +cusparseStatus_t CUSPARSEAPI +cusparseDcsrilu02_numericBoost(cusparseHandle_t handle, + csrilu02Info_t info, + int enable_boost, + double* tol, + double* boost_val); + +cusparseStatus_t CUSPARSEAPI +cusparseCcsrilu02_numericBoost(cusparseHandle_t handle, + csrilu02Info_t info, + int enable_boost, + double* tol, + cuComplex* boost_val); + +cusparseStatus_t CUSPARSEAPI +cusparseZcsrilu02_numericBoost(cusparseHandle_t handle, + csrilu02Info_t info, + int enable_boost, + double* tol, + cuDoubleComplex* boost_val); + +cusparseStatus_t CUSPARSEAPI +cusparseXcsrilu02_zeroPivot(cusparseHandle_t handle, + csrilu02Info_t info, + int* position); + +cusparseStatus_t CUSPARSEAPI +cusparseScsrilu02_bufferSize(cusparseHandle_t handle, + int m, + int nnz, + const cusparseMatDescr_t descrA, + float* csrSortedValA, + const int* csrSortedRowPtrA, + const int* csrSortedColIndA, + csrilu02Info_t info, + int* pBufferSizeInBytes); + +cusparseStatus_t CUSPARSEAPI +cusparseDcsrilu02_bufferSize(cusparseHandle_t handle, + int m, + int nnz, + const cusparseMatDescr_t descrA, + double* csrSortedValA, + const int* csrSortedRowPtrA, + const int* csrSortedColIndA, + csrilu02Info_t info, + int* pBufferSizeInBytes); + +cusparseStatus_t CUSPARSEAPI +cusparseCcsrilu02_bufferSize(cusparseHandle_t handle, + int m, + int nnz, + const cusparseMatDescr_t descrA, + cuComplex* csrSortedValA, + const int* csrSortedRowPtrA, + const int* csrSortedColIndA, + csrilu02Info_t info, + int* pBufferSizeInBytes); + +cusparseStatus_t CUSPARSEAPI +cusparseZcsrilu02_bufferSize(cusparseHandle_t handle, + int m, + int nnz, + const cusparseMatDescr_t descrA, + cuDoubleComplex* csrSortedValA, + const int* csrSortedRowPtrA, + const int* csrSortedColIndA, + csrilu02Info_t info, + int* pBufferSizeInBytes); + +cusparseStatus_t CUSPARSEAPI +cusparseScsrilu02_bufferSizeExt(cusparseHandle_t handle, + int m, + int nnz, + const cusparseMatDescr_t descrA, + float* csrSortedVal, + const int* csrSortedRowPtr, + const int* csrSortedColInd, + csrilu02Info_t info, + size_t* pBufferSize); + +cusparseStatus_t CUSPARSEAPI +cusparseDcsrilu02_bufferSizeExt(cusparseHandle_t handle, + int m, + int nnz, + const cusparseMatDescr_t descrA, + double* csrSortedVal, + const int* csrSortedRowPtr, + const int* csrSortedColInd, + csrilu02Info_t info, + size_t* pBufferSize); + +cusparseStatus_t CUSPARSEAPI +cusparseCcsrilu02_bufferSizeExt(cusparseHandle_t handle, + int m, + int nnz, + const cusparseMatDescr_t descrA, + cuComplex* csrSortedVal, + const int* csrSortedRowPtr, + const int* csrSortedColInd, + csrilu02Info_t info, + size_t* pBufferSize); + +cusparseStatus_t CUSPARSEAPI +cusparseZcsrilu02_bufferSizeExt(cusparseHandle_t handle, + int m, + int nnz, + const cusparseMatDescr_t descrA, + cuDoubleComplex* csrSortedVal, + const int* csrSortedRowPtr, + const int* csrSortedColInd, + csrilu02Info_t info, + size_t* pBufferSize); + +cusparseStatus_t CUSPARSEAPI +cusparseScsrilu02_analysis(cusparseHandle_t handle, + int m, + int nnz, + const cusparseMatDescr_t descrA, + const float* csrSortedValA, + const int* csrSortedRowPtrA, + const int* csrSortedColIndA, + csrilu02Info_t info, + cusparseSolvePolicy_t policy, + void* pBuffer); + +cusparseStatus_t CUSPARSEAPI +cusparseDcsrilu02_analysis(cusparseHandle_t handle, + int m, + int nnz, + const cusparseMatDescr_t descrA, + const double* csrSortedValA, + const int* csrSortedRowPtrA, + const int* csrSortedColIndA, + csrilu02Info_t info, + cusparseSolvePolicy_t policy, + void* pBuffer); + +cusparseStatus_t CUSPARSEAPI +cusparseCcsrilu02_analysis(cusparseHandle_t handle, + int m, + int nnz, + const cusparseMatDescr_t descrA, + const cuComplex* csrSortedValA, + const int* csrSortedRowPtrA, + const int* csrSortedColIndA, + csrilu02Info_t info, + cusparseSolvePolicy_t policy, + void* pBuffer); + +cusparseStatus_t CUSPARSEAPI +cusparseZcsrilu02_analysis(cusparseHandle_t handle, + int m, + int nnz, + const cusparseMatDescr_t descrA, + const cuDoubleComplex* csrSortedValA, + const int* csrSortedRowPtrA, + const int* csrSortedColIndA, + csrilu02Info_t info, + cusparseSolvePolicy_t policy, + void* pBuffer); + +cusparseStatus_t CUSPARSEAPI +cusparseScsrilu02(cusparseHandle_t handle, + int m, + int nnz, + const cusparseMatDescr_t descrA, + float* csrSortedValA_valM, + const int* csrSortedRowPtrA, + const int* csrSortedColIndA, + csrilu02Info_t info, + cusparseSolvePolicy_t policy, + void* pBuffer); + +cusparseStatus_t CUSPARSEAPI +cusparseDcsrilu02(cusparseHandle_t handle, + int m, + int nnz, + const cusparseMatDescr_t descrA, + double* csrSortedValA_valM, + const int* csrSortedRowPtrA, + const int* csrSortedColIndA, + csrilu02Info_t info, + cusparseSolvePolicy_t policy, + void* pBuffer); + +cusparseStatus_t CUSPARSEAPI +cusparseCcsrilu02(cusparseHandle_t handle, + int m, + int nnz, + const cusparseMatDescr_t descrA, + cuComplex* csrSortedValA_valM, + const int* csrSortedRowPtrA, + const int* csrSortedColIndA, + csrilu02Info_t info, + cusparseSolvePolicy_t policy, + void* pBuffer); + +cusparseStatus_t CUSPARSEAPI +cusparseZcsrilu02(cusparseHandle_t handle, + int m, + int nnz, + const cusparseMatDescr_t descrA, + cuDoubleComplex* csrSortedValA_valM, + const int* csrSortedRowPtrA, + const int* csrSortedColIndA, + csrilu02Info_t info, + cusparseSolvePolicy_t policy, + void* pBuffer); + +cusparseStatus_t CUSPARSEAPI +cusparseSbsrilu02_numericBoost(cusparseHandle_t handle, + bsrilu02Info_t info, + int enable_boost, + double* tol, + float* boost_val); + +cusparseStatus_t CUSPARSEAPI +cusparseDbsrilu02_numericBoost(cusparseHandle_t handle, + bsrilu02Info_t info, + int enable_boost, + double* tol, + double* boost_val); + +cusparseStatus_t CUSPARSEAPI +cusparseCbsrilu02_numericBoost(cusparseHandle_t handle, + bsrilu02Info_t info, + int enable_boost, + double* tol, + cuComplex* boost_val); + +cusparseStatus_t CUSPARSEAPI +cusparseZbsrilu02_numericBoost(cusparseHandle_t handle, + bsrilu02Info_t info, + int enable_boost, + double* tol, + cuDoubleComplex* boost_val); + +cusparseStatus_t CUSPARSEAPI +cusparseXbsrilu02_zeroPivot(cusparseHandle_t handle, + bsrilu02Info_t info, + int* position); + +cusparseStatus_t CUSPARSEAPI +cusparseSbsrilu02_bufferSize(cusparseHandle_t handle, + cusparseDirection_t dirA, + int mb, + int nnzb, + const cusparseMatDescr_t descrA, + float* bsrSortedVal, + const int* bsrSortedRowPtr, + const int* bsrSortedColInd, + int blockDim, + bsrilu02Info_t info, + int* pBufferSizeInBytes); + +cusparseStatus_t CUSPARSEAPI +cusparseDbsrilu02_bufferSize(cusparseHandle_t handle, + cusparseDirection_t dirA, + int mb, + int nnzb, + const cusparseMatDescr_t descrA, + double* bsrSortedVal, + const int* bsrSortedRowPtr, + const int* bsrSortedColInd, + int blockDim, + bsrilu02Info_t info, + int* pBufferSizeInBytes); + +cusparseStatus_t CUSPARSEAPI +cusparseCbsrilu02_bufferSize(cusparseHandle_t handle, + cusparseDirection_t dirA, + int mb, + int nnzb, + const cusparseMatDescr_t descrA, + cuComplex* bsrSortedVal, + const int* bsrSortedRowPtr, + const int* bsrSortedColInd, + int blockDim, + bsrilu02Info_t info, + int* pBufferSizeInBytes); + +cusparseStatus_t CUSPARSEAPI +cusparseZbsrilu02_bufferSize(cusparseHandle_t handle, + cusparseDirection_t dirA, + int mb, + int nnzb, + const cusparseMatDescr_t descrA, + cuDoubleComplex* bsrSortedVal, + const int* bsrSortedRowPtr, + const int* bsrSortedColInd, + int blockDim, + bsrilu02Info_t info, + int* pBufferSizeInBytes); + +cusparseStatus_t CUSPARSEAPI +cusparseSbsrilu02_bufferSizeExt(cusparseHandle_t handle, + cusparseDirection_t dirA, + int mb, + int nnzb, + const cusparseMatDescr_t descrA, + float* bsrSortedVal, + const int* bsrSortedRowPtr, + const int* bsrSortedColInd, + int blockSize, + bsrilu02Info_t info, + size_t* pBufferSize); + +cusparseStatus_t CUSPARSEAPI +cusparseDbsrilu02_bufferSizeExt(cusparseHandle_t handle, + cusparseDirection_t dirA, + int mb, + int nnzb, + const cusparseMatDescr_t descrA, + double* bsrSortedVal, + const int* bsrSortedRowPtr, + const int* bsrSortedColInd, + int blockSize, + bsrilu02Info_t info, + size_t* pBufferSize); + +cusparseStatus_t CUSPARSEAPI +cusparseCbsrilu02_bufferSizeExt(cusparseHandle_t handle, + cusparseDirection_t dirA, + int mb, + int nnzb, + const cusparseMatDescr_t descrA, + cuComplex* bsrSortedVal, + const int* bsrSortedRowPtr, + const int* bsrSortedColInd, + int blockSize, + bsrilu02Info_t info, + size_t* pBufferSize); + +cusparseStatus_t CUSPARSEAPI +cusparseZbsrilu02_bufferSizeExt(cusparseHandle_t handle, + cusparseDirection_t dirA, + int mb, + int nnzb, + const cusparseMatDescr_t descrA, + cuDoubleComplex* bsrSortedVal, + const int* bsrSortedRowPtr, + const int* bsrSortedColInd, + int blockSize, + bsrilu02Info_t info, + size_t* pBufferSize); + +cusparseStatus_t CUSPARSEAPI +cusparseSbsrilu02_analysis(cusparseHandle_t handle, + cusparseDirection_t dirA, + int mb, + int nnzb, + const cusparseMatDescr_t descrA, + float* bsrSortedVal, + const int* bsrSortedRowPtr, + const int* bsrSortedColInd, + int blockDim, + bsrilu02Info_t info, + cusparseSolvePolicy_t policy, + void* pBuffer); + +cusparseStatus_t CUSPARSEAPI +cusparseDbsrilu02_analysis(cusparseHandle_t handle, + cusparseDirection_t dirA, + int mb, + int nnzb, + const cusparseMatDescr_t descrA, + double* bsrSortedVal, + const int* bsrSortedRowPtr, + const int* bsrSortedColInd, + int blockDim, + bsrilu02Info_t info, + cusparseSolvePolicy_t policy, + void* pBuffer); + +cusparseStatus_t CUSPARSEAPI +cusparseCbsrilu02_analysis(cusparseHandle_t handle, + cusparseDirection_t dirA, + int mb, + int nnzb, + const cusparseMatDescr_t descrA, + cuComplex* bsrSortedVal, + const int* bsrSortedRowPtr, + const int* bsrSortedColInd, + int blockDim, + bsrilu02Info_t info, + cusparseSolvePolicy_t policy, + void* pBuffer); + +cusparseStatus_t CUSPARSEAPI +cusparseZbsrilu02_analysis(cusparseHandle_t handle, + cusparseDirection_t dirA, + int mb, + int nnzb, + const cusparseMatDescr_t descrA, + cuDoubleComplex* bsrSortedVal, + const int* bsrSortedRowPtr, + const int* bsrSortedColInd, + int blockDim, + bsrilu02Info_t info, + cusparseSolvePolicy_t policy, + void* pBuffer); + +cusparseStatus_t CUSPARSEAPI +cusparseSbsrilu02(cusparseHandle_t handle, + cusparseDirection_t dirA, + int mb, + int nnzb, + const cusparseMatDescr_t descrA, + float* bsrSortedVal, + const int* bsrSortedRowPtr, + const int* bsrSortedColInd, + int blockDim, + bsrilu02Info_t info, + cusparseSolvePolicy_t policy, + void* pBuffer); + +cusparseStatus_t CUSPARSEAPI +cusparseDbsrilu02(cusparseHandle_t handle, + cusparseDirection_t dirA, + int mb, + int nnzb, + const cusparseMatDescr_t descrA, + double* bsrSortedVal, + const int* bsrSortedRowPtr, + const int* bsrSortedColInd, + int blockDim, + bsrilu02Info_t info, + cusparseSolvePolicy_t policy, + void* pBuffer); + +cusparseStatus_t CUSPARSEAPI +cusparseCbsrilu02(cusparseHandle_t handle, + cusparseDirection_t dirA, + int mb, + int nnzb, + const cusparseMatDescr_t descrA, + cuComplex* bsrSortedVal, + const int* bsrSortedRowPtr, + const int* bsrSortedColInd, + int blockDim, + bsrilu02Info_t info, + cusparseSolvePolicy_t policy, + void* pBuffer); + +cusparseStatus_t CUSPARSEAPI +cusparseZbsrilu02(cusparseHandle_t handle, + cusparseDirection_t dirA, + int mb, + int nnzb, + const cusparseMatDescr_t descrA, + cuDoubleComplex* bsrSortedVal, + const int* bsrSortedRowPtr, + const int* bsrSortedColInd, + int blockDim, + bsrilu02Info_t info, + cusparseSolvePolicy_t policy, + void* pBuffer); + +cusparseStatus_t CUSPARSEAPI +cusparseXcsric02_zeroPivot(cusparseHandle_t handle, + csric02Info_t info, + int* position); + +cusparseStatus_t CUSPARSEAPI +cusparseScsric02_bufferSize(cusparseHandle_t handle, + int m, + int nnz, + const cusparseMatDescr_t descrA, + float* csrSortedValA, + const int* csrSortedRowPtrA, + const int* csrSortedColIndA, + csric02Info_t info, + int* pBufferSizeInBytes); + +cusparseStatus_t CUSPARSEAPI +cusparseDcsric02_bufferSize(cusparseHandle_t handle, + int m, + int nnz, + const cusparseMatDescr_t descrA, + double* csrSortedValA, + const int* csrSortedRowPtrA, + const int* csrSortedColIndA, + csric02Info_t info, + int* pBufferSizeInBytes); + +cusparseStatus_t CUSPARSEAPI +cusparseCcsric02_bufferSize(cusparseHandle_t handle, + int m, + int nnz, + const cusparseMatDescr_t descrA, + cuComplex* csrSortedValA, + const int* csrSortedRowPtrA, + const int* csrSortedColIndA, + csric02Info_t info, + int* pBufferSizeInBytes); + +cusparseStatus_t CUSPARSEAPI +cusparseZcsric02_bufferSize(cusparseHandle_t handle, + int m, + int nnz, + const cusparseMatDescr_t descrA, + cuDoubleComplex* csrSortedValA, + const int* csrSortedRowPtrA, + const int* csrSortedColIndA, + csric02Info_t info, + int* pBufferSizeInBytes); + +cusparseStatus_t CUSPARSEAPI +cusparseScsric02_bufferSizeExt(cusparseHandle_t handle, + int m, + int nnz, + const cusparseMatDescr_t descrA, + float* csrSortedVal, + const int* csrSortedRowPtr, + const int* csrSortedColInd, + csric02Info_t info, + size_t* pBufferSize); + +cusparseStatus_t CUSPARSEAPI +cusparseDcsric02_bufferSizeExt(cusparseHandle_t handle, + int m, + int nnz, + const cusparseMatDescr_t descrA, + double* csrSortedVal, + const int* csrSortedRowPtr, + const int* csrSortedColInd, + csric02Info_t info, + size_t* pBufferSize); + +cusparseStatus_t CUSPARSEAPI +cusparseCcsric02_bufferSizeExt(cusparseHandle_t handle, + int m, + int nnz, + const cusparseMatDescr_t descrA, + cuComplex* csrSortedVal, + const int* csrSortedRowPtr, + const int* csrSortedColInd, + csric02Info_t info, + size_t* pBufferSize); + +cusparseStatus_t CUSPARSEAPI +cusparseZcsric02_bufferSizeExt(cusparseHandle_t handle, + int m, + int nnz, + const cusparseMatDescr_t descrA, + cuDoubleComplex* csrSortedVal, + const int* csrSortedRowPtr, + const int* csrSortedColInd, + csric02Info_t info, + size_t* pBufferSize); + +cusparseStatus_t CUSPARSEAPI +cusparseScsric02_analysis(cusparseHandle_t handle, + int m, + int nnz, + const cusparseMatDescr_t descrA, + const float* csrSortedValA, + const int* csrSortedRowPtrA, + const int* csrSortedColIndA, + csric02Info_t info, + cusparseSolvePolicy_t policy, + void* pBuffer); + +cusparseStatus_t CUSPARSEAPI +cusparseDcsric02_analysis(cusparseHandle_t handle, + int m, + int nnz, + const cusparseMatDescr_t descrA, + const double* csrSortedValA, + const int* csrSortedRowPtrA, + const int* csrSortedColIndA, + csric02Info_t info, + cusparseSolvePolicy_t policy, + void* pBuffer); + +cusparseStatus_t CUSPARSEAPI +cusparseCcsric02_analysis(cusparseHandle_t handle, + int m, + int nnz, + const cusparseMatDescr_t descrA, + const cuComplex* csrSortedValA, + const int* csrSortedRowPtrA, + const int* csrSortedColIndA, + csric02Info_t info, + cusparseSolvePolicy_t policy, + void* pBuffer); + +cusparseStatus_t CUSPARSEAPI +cusparseZcsric02_analysis(cusparseHandle_t handle, + int m, + int nnz, + const cusparseMatDescr_t descrA, + const cuDoubleComplex* csrSortedValA, + const int* csrSortedRowPtrA, + const int* csrSortedColIndA, + csric02Info_t info, + cusparseSolvePolicy_t policy, + void* pBuffer); + +cusparseStatus_t CUSPARSEAPI +cusparseScsric02(cusparseHandle_t handle, + int m, + int nnz, + const cusparseMatDescr_t descrA, + float* csrSortedValA_valM, + const int* csrSortedRowPtrA, + const int* csrSortedColIndA, + csric02Info_t info, + cusparseSolvePolicy_t policy, + void* pBuffer); + +cusparseStatus_t CUSPARSEAPI +cusparseDcsric02(cusparseHandle_t handle, + int m, + int nnz, + const cusparseMatDescr_t descrA, + double* csrSortedValA_valM, + const int* csrSortedRowPtrA, + const int* csrSortedColIndA, + csric02Info_t info, + cusparseSolvePolicy_t policy, + void* pBuffer); + +cusparseStatus_t CUSPARSEAPI +cusparseCcsric02(cusparseHandle_t handle, + int m, + int nnz, + const cusparseMatDescr_t descrA, + cuComplex* csrSortedValA_valM, + const int* csrSortedRowPtrA, + const int* csrSortedColIndA, + csric02Info_t info, + cusparseSolvePolicy_t policy, + void* pBuffer); + +cusparseStatus_t CUSPARSEAPI +cusparseZcsric02(cusparseHandle_t handle, + int m, + int nnz, + const cusparseMatDescr_t descrA, + cuDoubleComplex* csrSortedValA_valM, + const int* csrSortedRowPtrA, + const int* csrSortedColIndA, + csric02Info_t info, + cusparseSolvePolicy_t policy, + void* pBuffer); + +cusparseStatus_t CUSPARSEAPI +cusparseXbsric02_zeroPivot(cusparseHandle_t handle, + bsric02Info_t info, + int* position); + +cusparseStatus_t CUSPARSEAPI +cusparseSbsric02_bufferSize(cusparseHandle_t handle, + cusparseDirection_t dirA, + int mb, + int nnzb, + const cusparseMatDescr_t descrA, + float* bsrSortedVal, + const int* bsrSortedRowPtr, + const int* bsrSortedColInd, + int blockDim, + bsric02Info_t info, + int* pBufferSizeInBytes); + +cusparseStatus_t CUSPARSEAPI +cusparseDbsric02_bufferSize(cusparseHandle_t handle, + cusparseDirection_t dirA, + int mb, + int nnzb, + const cusparseMatDescr_t descrA, + double* bsrSortedVal, + const int* bsrSortedRowPtr, + const int* bsrSortedColInd, + int blockDim, + bsric02Info_t info, + int* pBufferSizeInBytes); + +cusparseStatus_t CUSPARSEAPI +cusparseCbsric02_bufferSize(cusparseHandle_t handle, + cusparseDirection_t dirA, + int mb, + int nnzb, + const cusparseMatDescr_t descrA, + cuComplex* bsrSortedVal, + const int* bsrSortedRowPtr, + const int* bsrSortedColInd, + int blockDim, + bsric02Info_t info, + int* pBufferSizeInBytes); + +cusparseStatus_t CUSPARSEAPI +cusparseZbsric02_bufferSize(cusparseHandle_t handle, + cusparseDirection_t dirA, + int mb, + int nnzb, + const cusparseMatDescr_t descrA, + cuDoubleComplex* bsrSortedVal, + const int* bsrSortedRowPtr, + const int* bsrSortedColInd, + int blockDim, + bsric02Info_t info, + int* pBufferSizeInBytes); + +cusparseStatus_t CUSPARSEAPI +cusparseSbsric02_bufferSizeExt(cusparseHandle_t handle, + cusparseDirection_t dirA, + int mb, + int nnzb, + const cusparseMatDescr_t descrA, + float* bsrSortedVal, + const int* bsrSortedRowPtr, + const int* bsrSortedColInd, + int blockSize, + bsric02Info_t info, + size_t* pBufferSize); + +cusparseStatus_t CUSPARSEAPI +cusparseDbsric02_bufferSizeExt(cusparseHandle_t handle, + cusparseDirection_t dirA, + int mb, + int nnzb, + const cusparseMatDescr_t descrA, + double* bsrSortedVal, + const int* bsrSortedRowPtr, + const int* bsrSortedColInd, + int blockSize, + bsric02Info_t info, + size_t* pBufferSize); + +cusparseStatus_t CUSPARSEAPI +cusparseCbsric02_bufferSizeExt(cusparseHandle_t handle, + cusparseDirection_t dirA, + int mb, + int nnzb, + const cusparseMatDescr_t descrA, + cuComplex* bsrSortedVal, + const int* bsrSortedRowPtr, + const int* bsrSortedColInd, + int blockSize, + bsric02Info_t info, + size_t* pBufferSize); + +cusparseStatus_t CUSPARSEAPI +cusparseZbsric02_bufferSizeExt(cusparseHandle_t handle, + cusparseDirection_t dirA, + int mb, + int nnzb, + const cusparseMatDescr_t descrA, + cuDoubleComplex* bsrSortedVal, + const int* bsrSortedRowPtr, + const int* bsrSortedColInd, + int blockSize, + bsric02Info_t info, + size_t* pBufferSize); + +cusparseStatus_t CUSPARSEAPI +cusparseSbsric02_analysis(cusparseHandle_t handle, + cusparseDirection_t dirA, + int mb, + int nnzb, + const cusparseMatDescr_t descrA, + const float* bsrSortedVal, + const int* bsrSortedRowPtr, + const int* bsrSortedColInd, + int blockDim, + bsric02Info_t info, + cusparseSolvePolicy_t policy, + void* pInputBuffer); + +cusparseStatus_t CUSPARSEAPI +cusparseDbsric02_analysis(cusparseHandle_t handle, + cusparseDirection_t dirA, + int mb, + int nnzb, + const cusparseMatDescr_t descrA, + const double* bsrSortedVal, + const int* bsrSortedRowPtr, + const int* bsrSortedColInd, + int blockDim, + bsric02Info_t info, + cusparseSolvePolicy_t policy, + void* pInputBuffer); + +cusparseStatus_t CUSPARSEAPI +cusparseCbsric02_analysis(cusparseHandle_t handle, + cusparseDirection_t dirA, + int mb, + int nnzb, + const cusparseMatDescr_t descrA, + const cuComplex* bsrSortedVal, + const int* bsrSortedRowPtr, + const int* bsrSortedColInd, + int blockDim, + bsric02Info_t info, + cusparseSolvePolicy_t policy, + void* pInputBuffer); + +cusparseStatus_t CUSPARSEAPI +cusparseZbsric02_analysis(cusparseHandle_t handle, + cusparseDirection_t dirA, + int mb, + int nnzb, + const cusparseMatDescr_t descrA, + const cuDoubleComplex* bsrSortedVal, + const int* bsrSortedRowPtr, + const int* bsrSortedColInd, + int blockDim, + bsric02Info_t info, + cusparseSolvePolicy_t policy, + void* pInputBuffer); + +cusparseStatus_t CUSPARSEAPI +cusparseSbsric02(cusparseHandle_t handle, + cusparseDirection_t dirA, + int mb, + int nnzb, + const cusparseMatDescr_t descrA, + float* bsrSortedVal, + const int* bsrSortedRowPtr, + const int* bsrSortedColInd, + int blockDim, + bsric02Info_t info, + cusparseSolvePolicy_t policy, + void* pBuffer); + +cusparseStatus_t CUSPARSEAPI +cusparseDbsric02(cusparseHandle_t handle, + cusparseDirection_t dirA, + int mb, + int nnzb, + const cusparseMatDescr_t descrA, + double* bsrSortedVal, + const int* bsrSortedRowPtr, + const int* bsrSortedColInd, + int blockDim, + bsric02Info_t info, + cusparseSolvePolicy_t policy, + void* pBuffer); + +cusparseStatus_t CUSPARSEAPI +cusparseCbsric02(cusparseHandle_t handle, + cusparseDirection_t dirA, + int mb, + int nnzb, + const cusparseMatDescr_t descrA, + cuComplex* bsrSortedVal, + const int* bsrSortedRowPtr, + const int* + bsrSortedColInd, + int blockDim, + bsric02Info_t info, + cusparseSolvePolicy_t policy, + void* pBuffer); + +cusparseStatus_t CUSPARSEAPI +cusparseZbsric02(cusparseHandle_t handle, + cusparseDirection_t dirA, + int mb, + int nnzb, + const cusparseMatDescr_t descrA, + cuDoubleComplex* bsrSortedVal, + const int* bsrSortedRowPtr, + const int* bsrSortedColInd, + int blockDim, + bsric02Info_t info, + cusparseSolvePolicy_t policy, + void* pBuffer); + +cusparseStatus_t CUSPARSEAPI +cusparseSgtsv2_bufferSizeExt(cusparseHandle_t handle, + int m, + int n, + const float* dl, + const float* d, + const float* du, + const float* B, + int ldb, + size_t* bufferSizeInBytes); + +cusparseStatus_t CUSPARSEAPI +cusparseDgtsv2_bufferSizeExt(cusparseHandle_t handle, + int m, + int n, + const double* dl, + const double* d, + const double* du, + const double* B, + int ldb, + size_t* bufferSizeInBytes); + +cusparseStatus_t CUSPARSEAPI +cusparseCgtsv2_bufferSizeExt(cusparseHandle_t handle, + int m, + int n, + const cuComplex* dl, + const cuComplex* d, + const cuComplex* du, + const cuComplex* B, + int ldb, + size_t* bufferSizeInBytes); + +cusparseStatus_t CUSPARSEAPI +cusparseZgtsv2_bufferSizeExt(cusparseHandle_t handle, + int m, + int n, + const cuDoubleComplex* dl, + const cuDoubleComplex* d, + const cuDoubleComplex* du, + const cuDoubleComplex* B, + int ldb, + size_t* bufferSizeInBytes); + +cusparseStatus_t CUSPARSEAPI +cusparseSgtsv2(cusparseHandle_t handle, + int m, + int n, + const float* dl, + const float* d, + const float* du, + float* B, + int ldb, + void* pBuffer); + +cusparseStatus_t CUSPARSEAPI +cusparseDgtsv2(cusparseHandle_t handle, + int m, + int n, + const double* dl, + const double* d, + const double* du, + double* B, + int ldb, + void* pBuffer); + +cusparseStatus_t CUSPARSEAPI +cusparseCgtsv2(cusparseHandle_t handle, + int m, + int n, + const cuComplex* dl, + const cuComplex* d, + const cuComplex* du, + cuComplex* B, + int ldb, + void* pBuffer); + +cusparseStatus_t CUSPARSEAPI +cusparseZgtsv2(cusparseHandle_t handle, + int m, + int n, + const cuDoubleComplex* dl, + const cuDoubleComplex* d, + const cuDoubleComplex* du, + cuDoubleComplex* B, + int ldb, + void* pBuffer); + +cusparseStatus_t CUSPARSEAPI +cusparseSgtsv2_nopivot_bufferSizeExt(cusparseHandle_t handle, + int m, + int n, + const float* dl, + const float* d, + const float* du, + const float* B, + int ldb, + size_t* bufferSizeInBytes); + +cusparseStatus_t CUSPARSEAPI +cusparseDgtsv2_nopivot_bufferSizeExt(cusparseHandle_t handle, + int m, + int n, + const double* dl, + const double* d, + const double* du, + const double* B, + int ldb, + size_t* bufferSizeInBytes); + +cusparseStatus_t CUSPARSEAPI +cusparseCgtsv2_nopivot_bufferSizeExt(cusparseHandle_t handle, + int m, + int n, + const cuComplex* dl, + const cuComplex* d, + const cuComplex* du, + const cuComplex* B, + int ldb, + size_t* bufferSizeInBytes); + +cusparseStatus_t CUSPARSEAPI +cusparseZgtsv2_nopivot_bufferSizeExt(cusparseHandle_t handle, + int m, + int n, + const cuDoubleComplex* dl, + const cuDoubleComplex* d, + const cuDoubleComplex* du, + const cuDoubleComplex* B, + int ldb, + size_t* bufferSizeInBytes); + +cusparseStatus_t CUSPARSEAPI +cusparseSgtsv2_nopivot(cusparseHandle_t handle, + int m, + int n, + const float* dl, + const float* d, + const float* du, + float* B, + int ldb, + void* pBuffer); + +cusparseStatus_t CUSPARSEAPI +cusparseDgtsv2_nopivot(cusparseHandle_t handle, + int m, + int n, + const double* dl, + const double* d, + const double* du, + double* B, + int ldb, + void* pBuffer); + +cusparseStatus_t CUSPARSEAPI +cusparseCgtsv2_nopivot(cusparseHandle_t handle, + int m, + int n, + const cuComplex* dl, + const cuComplex* d, + const cuComplex* du, + cuComplex* B, + int ldb, + void* pBuffer); + +cusparseStatus_t CUSPARSEAPI +cusparseZgtsv2_nopivot(cusparseHandle_t handle, + int m, + int n, + const cuDoubleComplex* dl, + const cuDoubleComplex* d, + const cuDoubleComplex* du, + cuDoubleComplex* B, + int ldb, + void* pBuffer); + +cusparseStatus_t CUSPARSEAPI +cusparseSgtsv2StridedBatch_bufferSizeExt(cusparseHandle_t handle, + int m, + const float* dl, + const float* d, + const float* du, + const float* x, + int batchCount, + int batchStride, + size_t* bufferSizeInBytes); + +cusparseStatus_t CUSPARSEAPI +cusparseDgtsv2StridedBatch_bufferSizeExt(cusparseHandle_t handle, + int m, + const double* dl, + const double* d, + const double* du, + const double* x, + int batchCount, + int batchStride, + size_t* bufferSizeInBytes); + +cusparseStatus_t CUSPARSEAPI +cusparseCgtsv2StridedBatch_bufferSizeExt(cusparseHandle_t handle, + int m, + const cuComplex* dl, + const cuComplex* d, + const cuComplex* du, + const cuComplex* x, + int batchCount, + int batchStride, + size_t* bufferSizeInBytes); + +cusparseStatus_t CUSPARSEAPI +cusparseZgtsv2StridedBatch_bufferSizeExt(cusparseHandle_t handle, + int m, + const cuDoubleComplex* dl, + const cuDoubleComplex* d, + const cuDoubleComplex* du, + const cuDoubleComplex* x, + int batchCount, + int batchStride, + size_t* bufferSizeInBytes); + +cusparseStatus_t CUSPARSEAPI +cusparseSgtsv2StridedBatch(cusparseHandle_t handle, + int m, + const float* dl, + const float* d, + const float* du, + float* x, + int batchCount, + int batchStride, + void* pBuffer); + +cusparseStatus_t CUSPARSEAPI +cusparseDgtsv2StridedBatch(cusparseHandle_t handle, + int m, + const double* dl, + const double* d, + const double* du, + double* x, + int batchCount, + int batchStride, + void* pBuffer); + +cusparseStatus_t CUSPARSEAPI +cusparseCgtsv2StridedBatch(cusparseHandle_t handle, + int m, + const cuComplex* dl, + const cuComplex* d, + const cuComplex* du, + cuComplex* x, + int batchCount, + int batchStride, + void* pBuffer); + +cusparseStatus_t CUSPARSEAPI +cusparseZgtsv2StridedBatch(cusparseHandle_t handle, + int m, + const cuDoubleComplex* dl, + const cuDoubleComplex* d, + const cuDoubleComplex* du, + cuDoubleComplex* x, + int batchCount, + int batchStride, + void* pBuffer); + +cusparseStatus_t CUSPARSEAPI +cusparseSgtsvInterleavedBatch_bufferSizeExt(cusparseHandle_t handle, + int algo, + int m, + const float* dl, + const float* d, + const float* du, + const float* x, + int batchCount, + size_t* pBufferSizeInBytes); + +cusparseStatus_t CUSPARSEAPI +cusparseDgtsvInterleavedBatch_bufferSizeExt(cusparseHandle_t handle, + int algo, + int m, + const double* dl, + const double* d, + const double* du, + const double* x, + int batchCount, + size_t* pBufferSizeInBytes); + +cusparseStatus_t CUSPARSEAPI +cusparseCgtsvInterleavedBatch_bufferSizeExt(cusparseHandle_t handle, + int algo, + int m, + const cuComplex* dl, + const cuComplex* d, + const cuComplex* du, + const cuComplex* x, + int batchCount, + size_t* pBufferSizeInBytes); + +cusparseStatus_t CUSPARSEAPI +cusparseZgtsvInterleavedBatch_bufferSizeExt(cusparseHandle_t handle, + int algo, + int m, + const cuDoubleComplex* dl, + const cuDoubleComplex* d, + const cuDoubleComplex* du, + const cuDoubleComplex* x, + int batchCount, + size_t* pBufferSizeInBytes); + +cusparseStatus_t CUSPARSEAPI +cusparseSgtsvInterleavedBatch(cusparseHandle_t handle, + int algo, + int m, + float* dl, + float* d, + float* du, + float* x, + int batchCount, + void* pBuffer); + +cusparseStatus_t CUSPARSEAPI +cusparseDgtsvInterleavedBatch(cusparseHandle_t handle, + int algo, + int m, + double* dl, + double* d, + double* du, + double* x, + int batchCount, + void* pBuffer); + +cusparseStatus_t CUSPARSEAPI +cusparseCgtsvInterleavedBatch(cusparseHandle_t handle, + int algo, + int m, + cuComplex* dl, + cuComplex* d, + cuComplex* du, + cuComplex* x, + int batchCount, + void* pBuffer); + +cusparseStatus_t CUSPARSEAPI +cusparseZgtsvInterleavedBatch(cusparseHandle_t handle, + int algo, + int m, + cuDoubleComplex* dl, + cuDoubleComplex* d, + cuDoubleComplex* du, + cuDoubleComplex* x, + int batchCount, + void* pBuffer); + +cusparseStatus_t CUSPARSEAPI +cusparseSgpsvInterleavedBatch_bufferSizeExt(cusparseHandle_t handle, + int algo, + int m, + const float* ds, + const float* dl, + const float* d, + const float* du, + const float* dw, + const float* x, + int batchCount, + size_t* pBufferSizeInBytes); + +cusparseStatus_t CUSPARSEAPI +cusparseDgpsvInterleavedBatch_bufferSizeExt(cusparseHandle_t handle, + int algo, + int m, + const double* ds, + const double* dl, + const double* d, + const double* du, + const double* dw, + const double* x, + int batchCount, + size_t* pBufferSizeInBytes); + +cusparseStatus_t CUSPARSEAPI +cusparseCgpsvInterleavedBatch_bufferSizeExt(cusparseHandle_t handle, + int algo, + int m, + const cuComplex* ds, + const cuComplex* dl, + const cuComplex* d, + const cuComplex* du, + const cuComplex* dw, + const cuComplex* x, + int batchCount, + size_t* pBufferSizeInBytes); + +cusparseStatus_t CUSPARSEAPI +cusparseZgpsvInterleavedBatch_bufferSizeExt(cusparseHandle_t handle, + int algo, + int m, + const cuDoubleComplex* ds, + const cuDoubleComplex* dl, + const cuDoubleComplex* d, + const cuDoubleComplex* du, + const cuDoubleComplex* dw, + const cuDoubleComplex* x, + int batchCount, + size_t* pBufferSizeInBytes); + +cusparseStatus_t CUSPARSEAPI +cusparseSgpsvInterleavedBatch(cusparseHandle_t handle, + int algo, + int m, + float* ds, + float* dl, + float* d, + float* du, + float* dw, + float* x, + int batchCount, + void* pBuffer); + +cusparseStatus_t CUSPARSEAPI +cusparseDgpsvInterleavedBatch(cusparseHandle_t handle, + int algo, + int m, + double* ds, + double* dl, + double* d, + double* du, + double* dw, + double* x, + int batchCount, + void* pBuffer); + +cusparseStatus_t CUSPARSEAPI +cusparseCgpsvInterleavedBatch(cusparseHandle_t handle, + int algo, + int m, + cuComplex* ds, + cuComplex* dl, + cuComplex* d, + cuComplex* du, + cuComplex* dw, + cuComplex* x, + int batchCount, + void* pBuffer); + +cusparseStatus_t CUSPARSEAPI +cusparseZgpsvInterleavedBatch(cusparseHandle_t handle, + int algo, + int m, + cuDoubleComplex* ds, + cuDoubleComplex* dl, + cuDoubleComplex* d, + cuDoubleComplex* du, + cuDoubleComplex* dw, + cuDoubleComplex* x, + int batchCount, + void* pBuffer); + +//############################################################################## +//# EXTRA ROUTINES +//############################################################################## + +cusparseStatus_t CUSPARSEAPI +cusparseScsrgeam2_bufferSizeExt(cusparseHandle_t handle, + int m, + int n, + const float* alpha, + const cusparseMatDescr_t descrA, + int nnzA, + const float* csrSortedValA, + const int* csrSortedRowPtrA, + const int* csrSortedColIndA, + const float* beta, + const cusparseMatDescr_t descrB, + int nnzB, + const float* csrSortedValB, + const int* csrSortedRowPtrB, + const int* csrSortedColIndB, + const cusparseMatDescr_t descrC, + const float* csrSortedValC, + const int* csrSortedRowPtrC, + const int* csrSortedColIndC, + size_t* pBufferSizeInBytes); + +cusparseStatus_t CUSPARSEAPI +cusparseDcsrgeam2_bufferSizeExt(cusparseHandle_t handle, + int m, + int n, + const double* alpha, + const cusparseMatDescr_t descrA, + int nnzA, + const double* csrSortedValA, + const int* csrSortedRowPtrA, + const int* csrSortedColIndA, + const double* beta, + const cusparseMatDescr_t descrB, + int nnzB, + const double* csrSortedValB, + const int* csrSortedRowPtrB, + const int* csrSortedColIndB, + const cusparseMatDescr_t descrC, + const double* csrSortedValC, + const int* csrSortedRowPtrC, + const int* csrSortedColIndC, + size_t* pBufferSizeInBytes); + +cusparseStatus_t CUSPARSEAPI +cusparseCcsrgeam2_bufferSizeExt(cusparseHandle_t handle, + int m, + int n, + const cuComplex* alpha, + const cusparseMatDescr_t descrA, + int nnzA, + const cuComplex* csrSortedValA, + const int* csrSortedRowPtrA, + const int* csrSortedColIndA, + const cuComplex* beta, + const cusparseMatDescr_t descrB, + int nnzB, + const cuComplex* csrSortedValB, + const int* csrSortedRowPtrB, + const int* csrSortedColIndB, + const cusparseMatDescr_t descrC, + const cuComplex* csrSortedValC, + const int* csrSortedRowPtrC, + const int* csrSortedColIndC, + size_t* pBufferSizeInBytes); + +cusparseStatus_t CUSPARSEAPI +cusparseZcsrgeam2_bufferSizeExt(cusparseHandle_t handle, + int m, + int n, + const cuDoubleComplex* alpha, + const cusparseMatDescr_t descrA, + int nnzA, + const cuDoubleComplex* csrSortedValA, + const int* csrSortedRowPtrA, + const int* csrSortedColIndA, + const cuDoubleComplex* beta, + const cusparseMatDescr_t descrB, + int nnzB, + const cuDoubleComplex* csrSortedValB, + const int* csrSortedRowPtrB, + const int* csrSortedColIndB, + const cusparseMatDescr_t descrC, + const cuDoubleComplex* csrSortedValC, + const int* csrSortedRowPtrC, + const int* csrSortedColIndC, + size_t* pBufferSizeInBytes); + +cusparseStatus_t CUSPARSEAPI +cusparseXcsrgeam2Nnz(cusparseHandle_t handle, + int m, + int n, + const cusparseMatDescr_t descrA, + int nnzA, + const int* csrSortedRowPtrA, + const int* csrSortedColIndA, + const cusparseMatDescr_t descrB, + int nnzB, + const int* csrSortedRowPtrB, + const int* csrSortedColIndB, + const cusparseMatDescr_t descrC, + int* csrSortedRowPtrC, + int* nnzTotalDevHostPtr, + void* workspace); + +cusparseStatus_t CUSPARSEAPI +cusparseScsrgeam2(cusparseHandle_t handle, + int m, + int n, + const float* alpha, + const cusparseMatDescr_t descrA, + int nnzA, + const float* csrSortedValA, + const int* csrSortedRowPtrA, + const int* csrSortedColIndA, + const float* beta, + const cusparseMatDescr_t descrB, + int nnzB, + const float* csrSortedValB, + const int* csrSortedRowPtrB, + const int* csrSortedColIndB, + const cusparseMatDescr_t descrC, + float* csrSortedValC, + int* csrSortedRowPtrC, + int* csrSortedColIndC, + void* pBuffer); + +cusparseStatus_t CUSPARSEAPI +cusparseDcsrgeam2(cusparseHandle_t handle, + int m, + int n, + const double* alpha, + const cusparseMatDescr_t descrA, + int nnzA, + const double* csrSortedValA, + const int* csrSortedRowPtrA, + const int* csrSortedColIndA, + const double* beta, + const cusparseMatDescr_t descrB, + int nnzB, + const double* csrSortedValB, + const int* csrSortedRowPtrB, + const int* csrSortedColIndB, + const cusparseMatDescr_t descrC, + double* csrSortedValC, + int* csrSortedRowPtrC, + int* csrSortedColIndC, + void* pBuffer); + +cusparseStatus_t CUSPARSEAPI +cusparseCcsrgeam2(cusparseHandle_t handle, + int m, + int n, + const cuComplex* alpha, + const cusparseMatDescr_t descrA, + int nnzA, + const cuComplex* csrSortedValA, + const int* csrSortedRowPtrA, + const int* csrSortedColIndA, + const cuComplex* beta, + const cusparseMatDescr_t descrB, + int nnzB, + const cuComplex* csrSortedValB, + const int* csrSortedRowPtrB, + const int* csrSortedColIndB, + const cusparseMatDescr_t descrC, + cuComplex* csrSortedValC, + int* csrSortedRowPtrC, + int* csrSortedColIndC, + void* pBuffer); + +cusparseStatus_t CUSPARSEAPI +cusparseZcsrgeam2(cusparseHandle_t handle, + int m, + int n, + const cuDoubleComplex* alpha, + const cusparseMatDescr_t descrA, + int nnzA, + const cuDoubleComplex* csrSortedValA, + const int* csrSortedRowPtrA, + const int* csrSortedColIndA, + const cuDoubleComplex* beta, + const cusparseMatDescr_t descrB, + int nnzB, + const cuDoubleComplex* csrSortedValB, + const int* csrSortedRowPtrB, + const int* csrSortedColIndB, + const cusparseMatDescr_t descrC, + cuDoubleComplex* csrSortedValC, + int* csrSortedRowPtrC, + int* csrSortedColIndC, + void* pBuffer); + +//############################################################################## +//# SPARSE MATRIX REORDERING +//############################################################################## + +cusparseStatus_t CUSPARSEAPI +cusparseScsrcolor(cusparseHandle_t handle, + int m, + int nnz, + const cusparseMatDescr_t descrA, + const float* csrSortedValA, + const int* csrSortedRowPtrA, + const int* csrSortedColIndA, + const float* fractionToColor, + int* ncolors, + int* coloring, + int* reordering, + const cusparseColorInfo_t info); + +cusparseStatus_t CUSPARSEAPI +cusparseDcsrcolor(cusparseHandle_t handle, + int m, + int nnz, + const cusparseMatDescr_t descrA, + const double* csrSortedValA, + const int* csrSortedRowPtrA, + const int* csrSortedColIndA, + const double* fractionToColor, + int* ncolors, + int* coloring, + int* reordering, + const cusparseColorInfo_t info); + +cusparseStatus_t CUSPARSEAPI +cusparseCcsrcolor(cusparseHandle_t handle, + int m, + int nnz, + const cusparseMatDescr_t descrA, + const cuComplex* csrSortedValA, + const int* csrSortedRowPtrA, + const int* csrSortedColIndA, + const float* fractionToColor, + int* ncolors, + int* coloring, + int* reordering, + const cusparseColorInfo_t info); + +cusparseStatus_t CUSPARSEAPI +cusparseZcsrcolor(cusparseHandle_t handle, + int m, + int nnz, + const cusparseMatDescr_t descrA, + const cuDoubleComplex* csrSortedValA, + const int* csrSortedRowPtrA, + const int* csrSortedColIndA, + const double* fractionToColor, + int* ncolors, + int* coloring, + int* reordering, + const cusparseColorInfo_t info); + +//############################################################################## +//# SPARSE FORMAT CONVERSION +//############################################################################## + +cusparseStatus_t CUSPARSEAPI +cusparseSnnz(cusparseHandle_t handle, + cusparseDirection_t dirA, + int m, + int n, + const cusparseMatDescr_t descrA, + const float* A, + int lda, + int* nnzPerRowCol, + int* nnzTotalDevHostPtr); + +cusparseStatus_t CUSPARSEAPI +cusparseDnnz(cusparseHandle_t handle, + cusparseDirection_t dirA, + int m, + int n, + const cusparseMatDescr_t descrA, + const double* A, + int lda, + int* nnzPerRowCol, + int* nnzTotalDevHostPtr); + +cusparseStatus_t CUSPARSEAPI +cusparseCnnz(cusparseHandle_t handle, + cusparseDirection_t dirA, + int m, + int n, + const cusparseMatDescr_t descrA, + const cuComplex* A, + int lda, + int* nnzPerRowCol, + int* nnzTotalDevHostPtr); + +cusparseStatus_t CUSPARSEAPI +cusparseZnnz(cusparseHandle_t handle, + cusparseDirection_t dirA, + int m, + int n, + const cusparseMatDescr_t descrA, + const cuDoubleComplex* A, + int lda, + int* nnzPerRowCol, + int* nnzTotalDevHostPtr); + +//############################################################################## +//# SPARSE FORMAT CONVERSION +//############################################################################## + +cusparseStatus_t CUSPARSEAPI +cusparseSnnz_compress(cusparseHandle_t handle, + int m, + const cusparseMatDescr_t descr, + const float* csrSortedValA, + const int* csrSortedRowPtrA, + int* nnzPerRow, + int* nnzC, + float tol); + +cusparseStatus_t CUSPARSEAPI +cusparseDnnz_compress(cusparseHandle_t handle, + int m, + const cusparseMatDescr_t descr, + const double* csrSortedValA, + const int* csrSortedRowPtrA, + int* nnzPerRow, + int* nnzC, + double tol); + +cusparseStatus_t CUSPARSEAPI +cusparseCnnz_compress(cusparseHandle_t handle, + int m, + const cusparseMatDescr_t descr, + const cuComplex* csrSortedValA, + const int* csrSortedRowPtrA, + int* nnzPerRow, + int* nnzC, + cuComplex tol); + +cusparseStatus_t CUSPARSEAPI +cusparseZnnz_compress(cusparseHandle_t handle, + int m, + const cusparseMatDescr_t descr, + const cuDoubleComplex* csrSortedValA, + const int* csrSortedRowPtrA, + int* nnzPerRow, + int* nnzC, + cuDoubleComplex tol); + +cusparseStatus_t CUSPARSEAPI +cusparseScsr2csr_compress(cusparseHandle_t handle, + int m, + int n, + const cusparseMatDescr_t descrA, + const float* csrSortedValA, + const int* csrSortedColIndA, + const int* csrSortedRowPtrA, + int nnzA, + const int* nnzPerRow, + float* csrSortedValC, + int* csrSortedColIndC, + int* csrSortedRowPtrC, + float tol); + +cusparseStatus_t CUSPARSEAPI +cusparseDcsr2csr_compress(cusparseHandle_t handle, + int m, + int n, + const cusparseMatDescr_t descrA, + const double* csrSortedValA, + const int* csrSortedColIndA, + const int* csrSortedRowPtrA, + int nnzA, + const int* nnzPerRow, + double* csrSortedValC, + int* csrSortedColIndC, + int* csrSortedRowPtrC, + double tol); + +cusparseStatus_t CUSPARSEAPI +cusparseCcsr2csr_compress(cusparseHandle_t handle, + int m, + int n, + const cusparseMatDescr_t descrA, + const cuComplex* csrSortedValA, + const int* csrSortedColIndA, + const int* csrSortedRowPtrA, + int nnzA, + const int* nnzPerRow, + cuComplex* csrSortedValC, + int* csrSortedColIndC, + int* csrSortedRowPtrC, + cuComplex tol); + +cusparseStatus_t CUSPARSEAPI +cusparseZcsr2csr_compress(cusparseHandle_t handle, + int m, + int n, + const cusparseMatDescr_t descrA, + const cuDoubleComplex* csrSortedValA, + const int* csrSortedColIndA, + const int* csrSortedRowPtrA, + int nnzA, + const int* nnzPerRow, + cuDoubleComplex* csrSortedValC, + int* csrSortedColIndC, + int* csrSortedRowPtrC, + cuDoubleComplex tol); + +cusparseStatus_t CUSPARSEAPI +cusparseXcoo2csr(cusparseHandle_t handle, + const int* cooRowInd, + int nnz, + int m, + int* csrSortedRowPtr, + cusparseIndexBase_t idxBase); + +cusparseStatus_t CUSPARSEAPI +cusparseXcsr2coo(cusparseHandle_t handle, + const int* csrSortedRowPtr, + int nnz, + int m, + int* cooRowInd, + cusparseIndexBase_t idxBase); + +cusparseStatus_t CUSPARSEAPI +cusparseXcsr2bsrNnz(cusparseHandle_t handle, + cusparseDirection_t dirA, + int m, + int n, + const cusparseMatDescr_t descrA, + const int* csrSortedRowPtrA, + const int* csrSortedColIndA, + int blockDim, + const cusparseMatDescr_t descrC, + int* bsrSortedRowPtrC, + int* nnzTotalDevHostPtr); + +cusparseStatus_t CUSPARSEAPI +cusparseScsr2bsr(cusparseHandle_t handle, + cusparseDirection_t dirA, + int m, + int n, + const cusparseMatDescr_t descrA, + const float* csrSortedValA, + const int* csrSortedRowPtrA, + const int* csrSortedColIndA, + int blockDim, + const cusparseMatDescr_t descrC, + float* bsrSortedValC, + int* bsrSortedRowPtrC, + int* bsrSortedColIndC); + +cusparseStatus_t CUSPARSEAPI +cusparseDcsr2bsr(cusparseHandle_t handle, + cusparseDirection_t dirA, + int m, + int n, + const cusparseMatDescr_t descrA, + const double* csrSortedValA, + const int* csrSortedRowPtrA, + const int* csrSortedColIndA, + int blockDim, + const cusparseMatDescr_t descrC, + double* bsrSortedValC, + int* bsrSortedRowPtrC, + int* bsrSortedColIndC); + +cusparseStatus_t CUSPARSEAPI +cusparseCcsr2bsr(cusparseHandle_t handle, + cusparseDirection_t dirA, + int m, + int n, + const cusparseMatDescr_t descrA, + const cuComplex* csrSortedValA, + const int* csrSortedRowPtrA, + const int* csrSortedColIndA, + int blockDim, + const cusparseMatDescr_t descrC, + cuComplex* bsrSortedValC, + int* bsrSortedRowPtrC, + int* bsrSortedColIndC); + +cusparseStatus_t CUSPARSEAPI +cusparseZcsr2bsr(cusparseHandle_t handle, + cusparseDirection_t dirA, + int m, + int n, + const cusparseMatDescr_t descrA, + const cuDoubleComplex* csrSortedValA, + const int* csrSortedRowPtrA, + const int* csrSortedColIndA, + int blockDim, + const cusparseMatDescr_t descrC, + cuDoubleComplex* bsrSortedValC, + int* bsrSortedRowPtrC, + int* bsrSortedColIndC); + +cusparseStatus_t CUSPARSEAPI +cusparseSbsr2csr(cusparseHandle_t handle, + cusparseDirection_t dirA, + int mb, + int nb, + const cusparseMatDescr_t descrA, + const float* bsrSortedValA, + const int* bsrSortedRowPtrA, + const int* bsrSortedColIndA, + int blockDim, + const cusparseMatDescr_t descrC, + float* csrSortedValC, + int* csrSortedRowPtrC, + int* csrSortedColIndC); + +cusparseStatus_t CUSPARSEAPI +cusparseDbsr2csr(cusparseHandle_t handle, + cusparseDirection_t dirA, + int mb, + int nb, + const cusparseMatDescr_t descrA, + const double* bsrSortedValA, + const int* bsrSortedRowPtrA, + const int* bsrSortedColIndA, + int blockDim, + const cusparseMatDescr_t descrC, + double* csrSortedValC, + int* csrSortedRowPtrC, + int* csrSortedColIndC); + +cusparseStatus_t CUSPARSEAPI +cusparseCbsr2csr(cusparseHandle_t handle, + cusparseDirection_t dirA, + int mb, + int nb, + const cusparseMatDescr_t descrA, + const cuComplex* bsrSortedValA, + const int* bsrSortedRowPtrA, + const int* bsrSortedColIndA, + int blockDim, + const cusparseMatDescr_t descrC, + cuComplex* csrSortedValC, + int* csrSortedRowPtrC, + int* csrSortedColIndC); + +cusparseStatus_t CUSPARSEAPI +cusparseZbsr2csr(cusparseHandle_t handle, + cusparseDirection_t dirA, + int mb, + int nb, + const cusparseMatDescr_t descrA, + const cuDoubleComplex* bsrSortedValA, + const int* bsrSortedRowPtrA, + const int* bsrSortedColIndA, + int blockDim, + const cusparseMatDescr_t descrC, + cuDoubleComplex* csrSortedValC, + int* csrSortedRowPtrC, + int* csrSortedColIndC); + +cusparseStatus_t CUSPARSEAPI +cusparseSgebsr2gebsc_bufferSize(cusparseHandle_t handle, + int mb, + int nb, + int nnzb, + const float* bsrSortedVal, + const int* bsrSortedRowPtr, + const int* bsrSortedColInd, + int rowBlockDim, + int colBlockDim, + int* pBufferSizeInBytes); + +cusparseStatus_t CUSPARSEAPI +cusparseDgebsr2gebsc_bufferSize(cusparseHandle_t handle, + int mb, + int nb, + int nnzb, + const double* bsrSortedVal, + const int* bsrSortedRowPtr, + const int* bsrSortedColInd, + int rowBlockDim, + int colBlockDim, + int* pBufferSizeInBytes); + +cusparseStatus_t CUSPARSEAPI +cusparseCgebsr2gebsc_bufferSize(cusparseHandle_t handle, + int mb, + int nb, + int nnzb, + const cuComplex* bsrSortedVal, + const int* bsrSortedRowPtr, + const int* bsrSortedColInd, + int rowBlockDim, + int colBlockDim, + int* pBufferSizeInBytes); + +cusparseStatus_t CUSPARSEAPI +cusparseZgebsr2gebsc_bufferSize(cusparseHandle_t handle, + int mb, + int nb, + int nnzb, + const cuDoubleComplex* bsrSortedVal, + const int* bsrSortedRowPtr, + const int* bsrSortedColInd, + int rowBlockDim, + int colBlockDim, + int* pBufferSizeInBytes); + +cusparseStatus_t CUSPARSEAPI +cusparseSgebsr2gebsc_bufferSizeExt(cusparseHandle_t handle, + int mb, + int nb, + int nnzb, + const float* bsrSortedVal, + const int* bsrSortedRowPtr, + const int* bsrSortedColInd, + int rowBlockDim, + int colBlockDim, + size_t* pBufferSize); + +cusparseStatus_t CUSPARSEAPI +cusparseDgebsr2gebsc_bufferSizeExt(cusparseHandle_t handle, + int mb, + int nb, + int nnzb, + const double* bsrSortedVal, + const int* bsrSortedRowPtr, + const int* bsrSortedColInd, + int rowBlockDim, + int colBlockDim, + size_t* pBufferSize); + +cusparseStatus_t CUSPARSEAPI +cusparseCgebsr2gebsc_bufferSizeExt(cusparseHandle_t handle, + int mb, + int nb, + int nnzb, + const cuComplex* bsrSortedVal, + const int* bsrSortedRowPtr, + const int* bsrSortedColInd, + int rowBlockDim, + int colBlockDim, + size_t* pBufferSize); + +cusparseStatus_t CUSPARSEAPI +cusparseZgebsr2gebsc_bufferSizeExt(cusparseHandle_t handle, + int mb, + int nb, + int nnzb, + const cuDoubleComplex* bsrSortedVal, + const int* bsrSortedRowPtr, + const int* bsrSortedColInd, + int rowBlockDim, + int colBlockDim, + size_t* pBufferSize); + +cusparseStatus_t CUSPARSEAPI +cusparseSgebsr2gebsc(cusparseHandle_t handle, + int mb, + int nb, + int nnzb, + const float* bsrSortedVal, + const int* bsrSortedRowPtr, + const int* bsrSortedColInd, + int rowBlockDim, + int colBlockDim, + float* bscVal, + int* bscRowInd, + int* bscColPtr, + cusparseAction_t copyValues, + cusparseIndexBase_t idxBase, + void* pBuffer); + +cusparseStatus_t CUSPARSEAPI +cusparseDgebsr2gebsc(cusparseHandle_t handle, + int mb, + int nb, + int nnzb, + const double* bsrSortedVal, + const int* bsrSortedRowPtr, + const int* bsrSortedColInd, + int rowBlockDim, + int colBlockDim, + double* bscVal, + int* bscRowInd, + int* bscColPtr, + cusparseAction_t copyValues, + cusparseIndexBase_t idxBase, + void* pBuffer); + +cusparseStatus_t CUSPARSEAPI +cusparseCgebsr2gebsc(cusparseHandle_t handle, + int mb, + int nb, + int nnzb, + const cuComplex* bsrSortedVal, + const int* bsrSortedRowPtr, + const int* bsrSortedColInd, + int rowBlockDim, + int colBlockDim, + cuComplex* bscVal, + int* bscRowInd, + int* bscColPtr, + cusparseAction_t copyValues, + cusparseIndexBase_t idxBase, + void* pBuffer); + +cusparseStatus_t CUSPARSEAPI +cusparseZgebsr2gebsc(cusparseHandle_t handle, + int mb, + int nb, + int nnzb, + const cuDoubleComplex* bsrSortedVal, + const int* bsrSortedRowPtr, + const int* bsrSortedColInd, + int rowBlockDim, + int colBlockDim, + cuDoubleComplex* bscVal, + int* bscRowInd, + int* bscColPtr, + cusparseAction_t copyValues, + cusparseIndexBase_t idxBase, + void* pBuffer); + +cusparseStatus_t CUSPARSEAPI +cusparseXgebsr2csr(cusparseHandle_t handle, + cusparseDirection_t dirA, + int mb, + int nb, + const cusparseMatDescr_t descrA, + const int* bsrSortedRowPtrA, + const int* bsrSortedColIndA, + int rowBlockDim, + int colBlockDim, + const cusparseMatDescr_t descrC, + int* csrSortedRowPtrC, + int* csrSortedColIndC); + +cusparseStatus_t CUSPARSEAPI +cusparseSgebsr2csr(cusparseHandle_t handle, + cusparseDirection_t dirA, + int mb, + int nb, + const cusparseMatDescr_t descrA, + const float* bsrSortedValA, + const int* bsrSortedRowPtrA, + const int* bsrSortedColIndA, + int rowBlockDim, + int colBlockDim, + const cusparseMatDescr_t descrC, + float* csrSortedValC, + int* csrSortedRowPtrC, + int* csrSortedColIndC); + +cusparseStatus_t CUSPARSEAPI +cusparseDgebsr2csr(cusparseHandle_t handle, + cusparseDirection_t dirA, + int mb, + int nb, + const cusparseMatDescr_t descrA, + const double* bsrSortedValA, + const int* bsrSortedRowPtrA, + const int* bsrSortedColIndA, + int rowBlockDim, + int colBlockDim, + const cusparseMatDescr_t descrC, + double* csrSortedValC, + int* csrSortedRowPtrC, + int* csrSortedColIndC); + +cusparseStatus_t CUSPARSEAPI +cusparseCgebsr2csr(cusparseHandle_t handle, + cusparseDirection_t dirA, + int mb, + int nb, + const cusparseMatDescr_t descrA, + const cuComplex* bsrSortedValA, + const int* bsrSortedRowPtrA, + const int* bsrSortedColIndA, + int rowBlockDim, + int colBlockDim, + const cusparseMatDescr_t descrC, + cuComplex* csrSortedValC, + int* csrSortedRowPtrC, + int* csrSortedColIndC); + +cusparseStatus_t CUSPARSEAPI +cusparseZgebsr2csr(cusparseHandle_t handle, + cusparseDirection_t dirA, + int mb, + int nb, + const cusparseMatDescr_t descrA, + const cuDoubleComplex* bsrSortedValA, + const int* bsrSortedRowPtrA, + const int* bsrSortedColIndA, + int rowBlockDim, + int colBlockDim, + const cusparseMatDescr_t descrC, + cuDoubleComplex* csrSortedValC, + int* csrSortedRowPtrC, + int* csrSortedColIndC); + +cusparseStatus_t CUSPARSEAPI +cusparseScsr2gebsr_bufferSize(cusparseHandle_t handle, + cusparseDirection_t dirA, + int m, + int n, + const cusparseMatDescr_t descrA, + const float* csrSortedValA, + const int* csrSortedRowPtrA, + const int* csrSortedColIndA, + int rowBlockDim, + int colBlockDim, + int* pBufferSizeInBytes); + +cusparseStatus_t CUSPARSEAPI +cusparseDcsr2gebsr_bufferSize(cusparseHandle_t handle, + cusparseDirection_t dirA, + int m, + int n, + const cusparseMatDescr_t descrA, + const double* csrSortedValA, + const int* csrSortedRowPtrA, + const int* csrSortedColIndA, + int rowBlockDim, + int colBlockDim, + int* pBufferSizeInBytes); + +cusparseStatus_t CUSPARSEAPI +cusparseCcsr2gebsr_bufferSize(cusparseHandle_t handle, + cusparseDirection_t dirA, + int m, + int n, + const cusparseMatDescr_t descrA, + const cuComplex* csrSortedValA, + const int* csrSortedRowPtrA, + const int* csrSortedColIndA, + int rowBlockDim, + int colBlockDim, + int* pBufferSizeInBytes); + +cusparseStatus_t CUSPARSEAPI +cusparseZcsr2gebsr_bufferSize(cusparseHandle_t handle, + cusparseDirection_t dirA, + int m, + int n, + const cusparseMatDescr_t descrA, + const cuDoubleComplex* csrSortedValA, + const int* csrSortedRowPtrA, + const int* csrSortedColIndA, + int rowBlockDim, + int colBlockDim, + int* pBufferSizeInBytes); + +cusparseStatus_t CUSPARSEAPI +cusparseScsr2gebsr_bufferSizeExt(cusparseHandle_t handle, + cusparseDirection_t dirA, + int m, + int n, + const cusparseMatDescr_t descrA, + const float* csrSortedValA, + const int* csrSortedRowPtrA, + const int* csrSortedColIndA, + int rowBlockDim, + int colBlockDim, + size_t* pBufferSize); + +cusparseStatus_t CUSPARSEAPI +cusparseDcsr2gebsr_bufferSizeExt(cusparseHandle_t handle, + cusparseDirection_t dirA, + int m, + int n, + const cusparseMatDescr_t descrA, + const double* csrSortedValA, + const int* csrSortedRowPtrA, + const int* csrSortedColIndA, + int rowBlockDim, + int colBlockDim, + size_t* pBufferSize); + +cusparseStatus_t CUSPARSEAPI +cusparseCcsr2gebsr_bufferSizeExt(cusparseHandle_t handle, + cusparseDirection_t dirA, + int m, + int n, + const cusparseMatDescr_t descrA, + const cuComplex* csrSortedValA, + const int* csrSortedRowPtrA, + const int* csrSortedColIndA, + int rowBlockDim, + int colBlockDim, + size_t* pBufferSize); + +cusparseStatus_t CUSPARSEAPI +cusparseZcsr2gebsr_bufferSizeExt(cusparseHandle_t handle, + cusparseDirection_t dirA, + int m, + int n, + const cusparseMatDescr_t descrA, + const cuDoubleComplex* csrSortedValA, + const int* csrSortedRowPtrA, + const int* csrSortedColIndA, + int rowBlockDim, + int colBlockDim, + size_t* pBufferSize); + +cusparseStatus_t CUSPARSEAPI +cusparseXcsr2gebsrNnz(cusparseHandle_t handle, + cusparseDirection_t dirA, + int m, + int n, + const cusparseMatDescr_t descrA, + const int* csrSortedRowPtrA, + const int* csrSortedColIndA, + const cusparseMatDescr_t descrC, + int* bsrSortedRowPtrC, + int rowBlockDim, + int colBlockDim, + int* nnzTotalDevHostPtr, + void* pBuffer); + +cusparseStatus_t CUSPARSEAPI +cusparseScsr2gebsr(cusparseHandle_t handle, + cusparseDirection_t dirA, + int m, + int n, + const cusparseMatDescr_t descrA, + const float* csrSortedValA, + const int* csrSortedRowPtrA, + const int* csrSortedColIndA, + const cusparseMatDescr_t descrC, + float* bsrSortedValC, + int* bsrSortedRowPtrC, + int* bsrSortedColIndC, + int rowBlockDim, + int colBlockDim, + void* pBuffer); + +cusparseStatus_t CUSPARSEAPI +cusparseDcsr2gebsr(cusparseHandle_t handle, + cusparseDirection_t dirA, + int m, + int n, + const cusparseMatDescr_t descrA, + const double* csrSortedValA, + const int* csrSortedRowPtrA, + const int* csrSortedColIndA, + const cusparseMatDescr_t descrC, + double* bsrSortedValC, + int* bsrSortedRowPtrC, + int* bsrSortedColIndC, + int rowBlockDim, + int colBlockDim, + void* pBuffer); + +cusparseStatus_t CUSPARSEAPI +cusparseCcsr2gebsr(cusparseHandle_t handle, + cusparseDirection_t dirA, + int m, + int n, + const cusparseMatDescr_t descrA, + const cuComplex* csrSortedValA, + const int* csrSortedRowPtrA, + const int* csrSortedColIndA, + const cusparseMatDescr_t descrC, + cuComplex* bsrSortedValC, + int* bsrSortedRowPtrC, + int* bsrSortedColIndC, + int rowBlockDim, + int colBlockDim, + void* pBuffer); + +cusparseStatus_t CUSPARSEAPI +cusparseZcsr2gebsr(cusparseHandle_t handle, + cusparseDirection_t dirA, + int m, + int n, + const cusparseMatDescr_t descrA, + const cuDoubleComplex* csrSortedValA, + const int* csrSortedRowPtrA, + const int* csrSortedColIndA, + const cusparseMatDescr_t descrC, + cuDoubleComplex* bsrSortedValC, + int* bsrSortedRowPtrC, + int* bsrSortedColIndC, + int rowBlockDim, + int colBlockDim, + void* pBuffer); + +cusparseStatus_t CUSPARSEAPI +cusparseSgebsr2gebsr_bufferSize(cusparseHandle_t handle, + cusparseDirection_t dirA, + int mb, + int nb, + int nnzb, + const cusparseMatDescr_t descrA, + const float* bsrSortedValA, + const int* bsrSortedRowPtrA, + const int* bsrSortedColIndA, + int rowBlockDimA, + int colBlockDimA, + int rowBlockDimC, + int colBlockDimC, + int* pBufferSizeInBytes); + +cusparseStatus_t CUSPARSEAPI +cusparseDgebsr2gebsr_bufferSize(cusparseHandle_t handle, + cusparseDirection_t dirA, + int mb, + int nb, + int nnzb, + const cusparseMatDescr_t descrA, + const double* bsrSortedValA, + const int* bsrSortedRowPtrA, + const int* bsrSortedColIndA, + int rowBlockDimA, + int colBlockDimA, + int rowBlockDimC, + int colBlockDimC, + int* pBufferSizeInBytes); + +cusparseStatus_t CUSPARSEAPI +cusparseCgebsr2gebsr_bufferSize(cusparseHandle_t handle, + cusparseDirection_t dirA, + int mb, + int nb, + int nnzb, + const cusparseMatDescr_t descrA, + const cuComplex* bsrSortedValA, + const int* bsrSortedRowPtrA, + const int* bsrSortedColIndA, + int rowBlockDimA, + int colBlockDimA, + int rowBlockDimC, + int colBlockDimC, + int* pBufferSizeInBytes); + +cusparseStatus_t CUSPARSEAPI +cusparseZgebsr2gebsr_bufferSize(cusparseHandle_t handle, + cusparseDirection_t dirA, + int mb, + int nb, + int nnzb, + const cusparseMatDescr_t descrA, + const cuDoubleComplex* bsrSortedValA, + const int* bsrSortedRowPtrA, + const int* bsrSortedColIndA, + int rowBlockDimA, + int colBlockDimA, + int rowBlockDimC, + int colBlockDimC, + int* pBufferSizeInBytes); + +cusparseStatus_t CUSPARSEAPI +cusparseSgebsr2gebsr_bufferSizeExt(cusparseHandle_t handle, + cusparseDirection_t dirA, + int mb, + int nb, + int nnzb, + const cusparseMatDescr_t descrA, + const float* bsrSortedValA, + const int* bsrSortedRowPtrA, + const int* bsrSortedColIndA, + int rowBlockDimA, + int colBlockDimA, + int rowBlockDimC, + int colBlockDimC, + size_t* pBufferSize); + +cusparseStatus_t CUSPARSEAPI +cusparseDgebsr2gebsr_bufferSizeExt(cusparseHandle_t handle, + cusparseDirection_t dirA, + int mb, + int nb, + int nnzb, + const cusparseMatDescr_t descrA, + const double* bsrSortedValA, + const int* bsrSortedRowPtrA, + const int* bsrSortedColIndA, + int rowBlockDimA, + int colBlockDimA, + int rowBlockDimC, + int colBlockDimC, + size_t* pBufferSize); + +cusparseStatus_t CUSPARSEAPI +cusparseCgebsr2gebsr_bufferSizeExt(cusparseHandle_t handle, + cusparseDirection_t dirA, + int mb, + int nb, + int nnzb, + const cusparseMatDescr_t descrA, + const cuComplex* bsrSortedValA, + const int* bsrSortedRowPtrA, + const int* bsrSortedColIndA, + int rowBlockDimA, + int colBlockDimA, + int rowBlockDimC, + int colBlockDimC, + size_t* pBufferSize); + +cusparseStatus_t CUSPARSEAPI +cusparseZgebsr2gebsr_bufferSizeExt(cusparseHandle_t handle, + cusparseDirection_t dirA, + int mb, + int nb, + int nnzb, + const cusparseMatDescr_t descrA, + const cuDoubleComplex* bsrSortedValA, + const int* bsrSortedRowPtrA, + const int* bsrSortedColIndA, + int rowBlockDimA, + int colBlockDimA, + int rowBlockDimC, + int colBlockDimC, + size_t* pBufferSize); + +cusparseStatus_t CUSPARSEAPI +cusparseXgebsr2gebsrNnz(cusparseHandle_t handle, + cusparseDirection_t dirA, + int mb, + int nb, + int nnzb, + const cusparseMatDescr_t descrA, + const int* bsrSortedRowPtrA, + const int* bsrSortedColIndA, + int rowBlockDimA, + int colBlockDimA, + const cusparseMatDescr_t descrC, + int* bsrSortedRowPtrC, + int rowBlockDimC, + int colBlockDimC, + int* nnzTotalDevHostPtr, + void* pBuffer); + +cusparseStatus_t CUSPARSEAPI +cusparseSgebsr2gebsr(cusparseHandle_t handle, + cusparseDirection_t dirA, + int mb, + int nb, + int nnzb, + const cusparseMatDescr_t descrA, + const float* bsrSortedValA, + const int* bsrSortedRowPtrA, + const int* bsrSortedColIndA, + int rowBlockDimA, + int colBlockDimA, + const cusparseMatDescr_t descrC, + float* bsrSortedValC, + int* bsrSortedRowPtrC, + int* bsrSortedColIndC, + int rowBlockDimC, + int colBlockDimC, + void* pBuffer); + +cusparseStatus_t CUSPARSEAPI +cusparseDgebsr2gebsr(cusparseHandle_t handle, + cusparseDirection_t dirA, + int mb, + int nb, + int nnzb, + const cusparseMatDescr_t descrA, + const double* bsrSortedValA, + const int* bsrSortedRowPtrA, + const int* bsrSortedColIndA, + int rowBlockDimA, + int colBlockDimA, + const cusparseMatDescr_t descrC, + double* bsrSortedValC, + int* bsrSortedRowPtrC, + int* bsrSortedColIndC, + int rowBlockDimC, + int colBlockDimC, + void* pBuffer); + +cusparseStatus_t CUSPARSEAPI +cusparseCgebsr2gebsr(cusparseHandle_t handle, + cusparseDirection_t dirA, + int mb, + int nb, + int nnzb, + const cusparseMatDescr_t descrA, + const cuComplex* bsrSortedValA, + const int* bsrSortedRowPtrA, + const int* bsrSortedColIndA, + int rowBlockDimA, + int colBlockDimA, + const cusparseMatDescr_t descrC, + cuComplex* bsrSortedValC, + int* bsrSortedRowPtrC, + int* bsrSortedColIndC, + int rowBlockDimC, + int colBlockDimC, + void* pBuffer); + +cusparseStatus_t CUSPARSEAPI +cusparseZgebsr2gebsr(cusparseHandle_t handle, + cusparseDirection_t dirA, + int mb, + int nb, + int nnzb, + const cusparseMatDescr_t descrA, + const cuDoubleComplex* bsrSortedValA, + const int* bsrSortedRowPtrA, + const int* bsrSortedColIndA, + int rowBlockDimA, + int colBlockDimA, + const cusparseMatDescr_t descrC, + cuDoubleComplex* bsrSortedValC, + int* bsrSortedRowPtrC, + int* bsrSortedColIndC, + int rowBlockDimC, + int colBlockDimC, + void* pBuffer); + +//############################################################################## +//# SPARSE MATRIX SORTING +//############################################################################## + +cusparseStatus_t CUSPARSEAPI +cusparseCreateIdentityPermutation(cusparseHandle_t handle, + int n, + int* p); + +cusparseStatus_t CUSPARSEAPI +cusparseXcoosort_bufferSizeExt(cusparseHandle_t handle, + int m, + int n, + int nnz, + const int* cooRowsA, + const int* cooColsA, + size_t* pBufferSizeInBytes); + +cusparseStatus_t CUSPARSEAPI +cusparseXcoosortByRow(cusparseHandle_t handle, + int m, + int n, + int nnz, + int* cooRowsA, + int* cooColsA, + int* P, + void* pBuffer); + +cusparseStatus_t CUSPARSEAPI +cusparseXcoosortByColumn(cusparseHandle_t handle, + int m, + int n, + int nnz, + int* cooRowsA, + int* cooColsA, + int* P, + void* pBuffer); + +cusparseStatus_t CUSPARSEAPI +cusparseXcsrsort_bufferSizeExt(cusparseHandle_t handle, + int m, + int n, + int nnz, + const int* csrRowPtrA, + const int* csrColIndA, + size_t* pBufferSizeInBytes); + +cusparseStatus_t CUSPARSEAPI +cusparseXcsrsort(cusparseHandle_t handle, + int m, + int n, + int nnz, + const cusparseMatDescr_t descrA, + const int* csrRowPtrA, + int* csrColIndA, + int* P, + void* pBuffer); + +cusparseStatus_t CUSPARSEAPI +cusparseXcscsort_bufferSizeExt(cusparseHandle_t handle, + int m, + int n, + int nnz, + const int* cscColPtrA, + const int* cscRowIndA, + size_t* pBufferSizeInBytes); + +cusparseStatus_t CUSPARSEAPI +cusparseXcscsort(cusparseHandle_t handle, + int m, + int n, + int nnz, + const cusparseMatDescr_t descrA, + const int* cscColPtrA, + int* cscRowIndA, + int* P, + void* pBuffer); + +cusparseStatus_t CUSPARSEAPI +cusparseScsru2csr_bufferSizeExt(cusparseHandle_t handle, + int m, + int n, + int nnz, + float* csrVal, + const int* csrRowPtr, + int* csrColInd, + csru2csrInfo_t info, + size_t* pBufferSizeInBytes); + +cusparseStatus_t CUSPARSEAPI +cusparseDcsru2csr_bufferSizeExt(cusparseHandle_t handle, + int m, + int n, + int nnz, + double* csrVal, + const int* csrRowPtr, + int* csrColInd, + csru2csrInfo_t info, + size_t* pBufferSizeInBytes); + +cusparseStatus_t CUSPARSEAPI +cusparseCcsru2csr_bufferSizeExt(cusparseHandle_t handle, + int m, + int n, + int nnz, + cuComplex* csrVal, + const int* csrRowPtr, + int* csrColInd, + csru2csrInfo_t info, + size_t* pBufferSizeInBytes); + +cusparseStatus_t CUSPARSEAPI +cusparseZcsru2csr_bufferSizeExt(cusparseHandle_t handle, + int m, + int n, + int nnz, + cuDoubleComplex* csrVal, + const int* csrRowPtr, + int* csrColInd, + csru2csrInfo_t info, + size_t* pBufferSizeInBytes); + +cusparseStatus_t CUSPARSEAPI +cusparseScsru2csr(cusparseHandle_t handle, + int m, + int n, + int nnz, + const cusparseMatDescr_t descrA, + float* csrVal, + const int* csrRowPtr, + int* csrColInd, + csru2csrInfo_t info, + void* pBuffer); + +cusparseStatus_t CUSPARSEAPI +cusparseDcsru2csr(cusparseHandle_t handle, + int m, + int n, + int nnz, + const cusparseMatDescr_t descrA, + double* csrVal, + const int* csrRowPtr, + int* csrColInd, + csru2csrInfo_t info, + void* pBuffer); + +cusparseStatus_t CUSPARSEAPI +cusparseCcsru2csr(cusparseHandle_t handle, + int m, + int n, + int nnz, + const cusparseMatDescr_t descrA, + cuComplex* csrVal, + const int* csrRowPtr, + int* csrColInd, + csru2csrInfo_t info, + void* pBuffer); + +cusparseStatus_t CUSPARSEAPI +cusparseZcsru2csr(cusparseHandle_t handle, + int m, + int n, + int nnz, + const cusparseMatDescr_t descrA, + cuDoubleComplex* csrVal, + const int* csrRowPtr, + int* csrColInd, + csru2csrInfo_t info, + void* pBuffer); + +cusparseStatus_t CUSPARSEAPI +cusparseScsr2csru(cusparseHandle_t handle, + int m, + int n, + int nnz, + const cusparseMatDescr_t descrA, + float* csrVal, + const int* csrRowPtr, + int* csrColInd, + csru2csrInfo_t info, + void* pBuffer); + +cusparseStatus_t CUSPARSEAPI +cusparseDcsr2csru(cusparseHandle_t handle, + int m, + int n, + int nnz, + const cusparseMatDescr_t descrA, + double* csrVal, + const int* csrRowPtr, + int* csrColInd, + csru2csrInfo_t info, + void* pBuffer); + +cusparseStatus_t CUSPARSEAPI +cusparseCcsr2csru(cusparseHandle_t handle, + int m, + int n, + int nnz, + const cusparseMatDescr_t descrA, + cuComplex* csrVal, + const int* csrRowPtr, + int* csrColInd, + csru2csrInfo_t info, + void* pBuffer); + +cusparseStatus_t CUSPARSEAPI +cusparseZcsr2csru(cusparseHandle_t handle, + int m, + int n, + int nnz, + const cusparseMatDescr_t descrA, + cuDoubleComplex* csrVal, + const int* csrRowPtr, + int* csrColInd, + csru2csrInfo_t info, + void* pBuffer); + +#if defined(__cplusplus) +cusparseStatus_t CUSPARSEAPI +cusparseHpruneDense2csr_bufferSizeExt(cusparseHandle_t handle, + int m, + int n, + const __half* A, + int lda, + const __half* threshold, + const cusparseMatDescr_t descrC, + const __half* csrSortedValC, + const int* csrSortedRowPtrC, + const int* csrSortedColIndC, + size_t* pBufferSizeInBytes); +#endif // defined(__cplusplus) + +cusparseStatus_t CUSPARSEAPI +cusparseSpruneDense2csr_bufferSizeExt(cusparseHandle_t handle, + int m, + int n, + const float* A, + int lda, + const float* threshold, + const cusparseMatDescr_t descrC, + const float* csrSortedValC, + const int* csrSortedRowPtrC, + const int* csrSortedColIndC, + size_t* pBufferSizeInBytes); + +cusparseStatus_t CUSPARSEAPI +cusparseDpruneDense2csr_bufferSizeExt(cusparseHandle_t handle, + int m, + int n, + const double* A, + int lda, + const double* threshold, + const cusparseMatDescr_t descrC, + const double* csrSortedValC, + const int* csrSortedRowPtrC, + const int* csrSortedColIndC, + size_t* pBufferSizeInBytes); + +#if defined(__cplusplus) +cusparseStatus_t CUSPARSEAPI +cusparseHpruneDense2csrNnz(cusparseHandle_t handle, + int m, + int n, + const __half* A, + int lda, + const __half* threshold, + const cusparseMatDescr_t descrC, + int* csrRowPtrC, + int* nnzTotalDevHostPtr, + void* pBuffer); +#endif // defined(__cplusplus) + +cusparseStatus_t CUSPARSEAPI +cusparseSpruneDense2csrNnz(cusparseHandle_t handle, + int m, + int n, + const float* A, + int lda, + const float* threshold, + const cusparseMatDescr_t descrC, + int* csrRowPtrC, + int* nnzTotalDevHostPtr, + void* pBuffer); + +cusparseStatus_t CUSPARSEAPI +cusparseDpruneDense2csrNnz(cusparseHandle_t handle, + int m, + int n, + const double* A, + int lda, + const double* threshold, + const cusparseMatDescr_t descrC, + int* csrSortedRowPtrC, + int* nnzTotalDevHostPtr, + void* pBuffer); + +#if defined(__cplusplus) +cusparseStatus_t CUSPARSEAPI +cusparseHpruneDense2csr(cusparseHandle_t handle, + int m, + int n, + const __half* A, + int lda, + const __half* threshold, + const cusparseMatDescr_t descrC, + __half* csrSortedValC, + const int* csrSortedRowPtrC, + int* csrSortedColIndC, + void* pBuffer); +#endif // defined(__cplusplus) + +cusparseStatus_t CUSPARSEAPI +cusparseSpruneDense2csr(cusparseHandle_t handle, + int m, + int n, + const float* A, + int lda, + const float* threshold, + const cusparseMatDescr_t descrC, + float* csrSortedValC, + const int* csrSortedRowPtrC, + int* csrSortedColIndC, + void* pBuffer); + +cusparseStatus_t CUSPARSEAPI +cusparseDpruneDense2csr(cusparseHandle_t handle, + int m, + int n, + const double* A, + int lda, + const double* threshold, + const cusparseMatDescr_t descrC, + double* csrSortedValC, + const int* csrSortedRowPtrC, + int* csrSortedColIndC, + void* pBuffer); + +#if defined(__cplusplus) +cusparseStatus_t CUSPARSEAPI +cusparseHpruneCsr2csr_bufferSizeExt(cusparseHandle_t handle, + int m, + int n, + int nnzA, + const cusparseMatDescr_t descrA, + const __half* csrSortedValA, + const int* csrSortedRowPtrA, + const int* csrSortedColIndA, + const __half* threshold, + const cusparseMatDescr_t descrC, + const __half* csrSortedValC, + const int* csrSortedRowPtrC, + const int* csrSortedColIndC, + size_t* pBufferSizeInBytes); +#endif // defined(__cplusplus) + +cusparseStatus_t CUSPARSEAPI +cusparseSpruneCsr2csr_bufferSizeExt(cusparseHandle_t handle, + int m, + int n, + int nnzA, + const cusparseMatDescr_t descrA, + const float* csrSortedValA, + const int* csrSortedRowPtrA, + const int* csrSortedColIndA, + const float* threshold, + const cusparseMatDescr_t descrC, + const float* csrSortedValC, + const int* csrSortedRowPtrC, + const int* csrSortedColIndC, + size_t* pBufferSizeInBytes); + +cusparseStatus_t CUSPARSEAPI +cusparseDpruneCsr2csr_bufferSizeExt(cusparseHandle_t handle, + int m, + int n, + int nnzA, + const cusparseMatDescr_t descrA, + const double* csrSortedValA, + const int* csrSortedRowPtrA, + const int* csrSortedColIndA, + const double* threshold, + const cusparseMatDescr_t descrC, + const double* csrSortedValC, + const int* csrSortedRowPtrC, + const int* csrSortedColIndC, + size_t* pBufferSizeInBytes); + +#if defined(__cplusplus) +cusparseStatus_t CUSPARSEAPI +cusparseHpruneCsr2csrNnz(cusparseHandle_t handle, + int m, + int n, + int nnzA, + const cusparseMatDescr_t descrA, + const __half* csrSortedValA, + const int* csrSortedRowPtrA, + const int* csrSortedColIndA, + const __half* threshold, + const cusparseMatDescr_t descrC, + int* csrSortedRowPtrC, + int* nnzTotalDevHostPtr, + void* pBuffer); +#endif // defined(__cplusplus) + +cusparseStatus_t CUSPARSEAPI +cusparseSpruneCsr2csrNnz(cusparseHandle_t handle, + int m, + int n, + int nnzA, + const cusparseMatDescr_t descrA, + const float* csrSortedValA, + const int* csrSortedRowPtrA, + const int* csrSortedColIndA, + const float* threshold, + const cusparseMatDescr_t descrC, + int* csrSortedRowPtrC, + int* nnzTotalDevHostPtr, + void* pBuffer); + +cusparseStatus_t CUSPARSEAPI + cusparseDpruneCsr2csrNnz(cusparseHandle_t handle, + int m, + int n, + int nnzA, + const cusparseMatDescr_t descrA, + const double* csrSortedValA, + const int* csrSortedRowPtrA, + const int* csrSortedColIndA, + const double* threshold, + const cusparseMatDescr_t descrC, + int* csrSortedRowPtrC, + int* nnzTotalDevHostPtr, + void* pBuffer); + +#if defined(__cplusplus) +cusparseStatus_t CUSPARSEAPI +cusparseHpruneCsr2csr(cusparseHandle_t handle, + int m, + int n, + int nnzA, + const cusparseMatDescr_t descrA, + const __half* csrSortedValA, + const int* csrSortedRowPtrA, + const int* csrSortedColIndA, + const __half* threshold, + const cusparseMatDescr_t descrC, + __half* csrSortedValC, + const int* csrSortedRowPtrC, + int* csrSortedColIndC, + void* pBuffer); +#endif // defined(__cplusplus) + +cusparseStatus_t CUSPARSEAPI +cusparseSpruneCsr2csr(cusparseHandle_t handle, + int m, + int n, + int nnzA, + const cusparseMatDescr_t descrA, + const float* csrSortedValA, + const int* csrSortedRowPtrA, + const int* csrSortedColIndA, + const float* threshold, + const cusparseMatDescr_t descrC, + float* csrSortedValC, + const int* csrSortedRowPtrC, + int* csrSortedColIndC, + void* pBuffer); + +cusparseStatus_t CUSPARSEAPI +cusparseDpruneCsr2csr(cusparseHandle_t handle, + int m, + int n, + int nnzA, + const cusparseMatDescr_t descrA, + const double* csrSortedValA, + const int* csrSortedRowPtrA, + const int* csrSortedColIndA, + const double* threshold, + const cusparseMatDescr_t descrC, + double* csrSortedValC, + const int* csrSortedRowPtrC, + int* csrSortedColIndC, + void* pBuffer); + +#if defined(__cplusplus) +cusparseStatus_t CUSPARSEAPI +cusparseHpruneDense2csrByPercentage_bufferSizeExt( + cusparseHandle_t handle, + int m, + int n, + const __half* A, + int lda, + float percentage, + const cusparseMatDescr_t descrC, + const __half* csrSortedValC, + const int* csrSortedRowPtrC, + const int* csrSortedColIndC, + pruneInfo_t info, + size_t* pBufferSizeInBytes); +#endif // defined(__cplusplus) + +cusparseStatus_t CUSPARSEAPI +cusparseSpruneDense2csrByPercentage_bufferSizeExt( + cusparseHandle_t handle, + int m, + int n, + const float* A, + int lda, + float percentage, + const cusparseMatDescr_t descrC, + const float* csrSortedValC, + const int* csrSortedRowPtrC, + const int* csrSortedColIndC, + pruneInfo_t info, + size_t* pBufferSizeInBytes); + +cusparseStatus_t CUSPARSEAPI +cusparseDpruneDense2csrByPercentage_bufferSizeExt( + cusparseHandle_t handle, + int m, + int n, + const double* A, + int lda, + float percentage, + const cusparseMatDescr_t descrC, + const double* csrSortedValC, + const int* csrSortedRowPtrC, + const int* csrSortedColIndC, + pruneInfo_t info, + size_t* pBufferSizeInBytes); + +#if defined(__cplusplus) +cusparseStatus_t CUSPARSEAPI +cusparseHpruneDense2csrNnzByPercentage( + cusparseHandle_t handle, + int m, + int n, + const __half* A, + int lda, + float percentage, + const cusparseMatDescr_t descrC, + int* csrRowPtrC, + int* nnzTotalDevHostPtr, + pruneInfo_t info, + void* pBuffer); +#endif // defined(__cplusplus) + +cusparseStatus_t CUSPARSEAPI +cusparseSpruneDense2csrNnzByPercentage( + cusparseHandle_t handle, + int m, + int n, + const float* A, + int lda, + float percentage, + const cusparseMatDescr_t descrC, + int* csrRowPtrC, + int* nnzTotalDevHostPtr, + pruneInfo_t info, + void* pBuffer); + +cusparseStatus_t CUSPARSEAPI +cusparseDpruneDense2csrNnzByPercentage( + cusparseHandle_t handle, + int m, + int n, + const double* A, + int lda, + float percentage, + const cusparseMatDescr_t descrC, + int* csrRowPtrC, + int* nnzTotalDevHostPtr, + pruneInfo_t info, + void* pBuffer); + +#if defined(__cplusplus) +cusparseStatus_t CUSPARSEAPI +cusparseHpruneDense2csrByPercentage(cusparseHandle_t handle, + int m, + int n, + const __half* A, + int lda, + float percentage, + const cusparseMatDescr_t descrC, + __half* csrSortedValC, + const int* csrSortedRowPtrC, + int* csrSortedColIndC, + pruneInfo_t info, + void* pBuffer); +#endif // defined(__cplusplus) + +cusparseStatus_t CUSPARSEAPI +cusparseSpruneDense2csrByPercentage(cusparseHandle_t handle, + int m, + int n, + const float* A, + int lda, + float percentage, + const cusparseMatDescr_t descrC, + float* csrSortedValC, + const int* csrSortedRowPtrC, + int* csrSortedColIndC, + pruneInfo_t info, + void* pBuffer); + +cusparseStatus_t CUSPARSEAPI +cusparseDpruneDense2csrByPercentage(cusparseHandle_t handle, + int m, + int n, + const double* A, + int lda, + float percentage, + const cusparseMatDescr_t descrC, + double* csrSortedValC, + const int* csrSortedRowPtrC, + int* csrSortedColIndC, + pruneInfo_t info, + void* pBuffer); + +#if defined(__cplusplus) + +cusparseStatus_t CUSPARSEAPI +cusparseHpruneCsr2csrByPercentage_bufferSizeExt( + cusparseHandle_t handle, + int m, + int n, + int nnzA, + const cusparseMatDescr_t descrA, + const __half* csrSortedValA, + const int* csrSortedRowPtrA, + const int* csrSortedColIndA, + float percentage, + const cusparseMatDescr_t descrC, + const __half* csrSortedValC, + const int* csrSortedRowPtrC, + const int* csrSortedColIndC, + pruneInfo_t info, + size_t* pBufferSizeInBytes); + +#endif // defined(__cplusplus) + +cusparseStatus_t CUSPARSEAPI +cusparseSpruneCsr2csrByPercentage_bufferSizeExt( + cusparseHandle_t handle, + int m, + int n, + int nnzA, + const cusparseMatDescr_t descrA, + const float* csrSortedValA, + const int* csrSortedRowPtrA, + const int* csrSortedColIndA, + float percentage, + const cusparseMatDescr_t descrC, + const float* csrSortedValC, + const int* csrSortedRowPtrC, + const int* csrSortedColIndC, + pruneInfo_t info, + size_t* pBufferSizeInBytes); + +cusparseStatus_t CUSPARSEAPI +cusparseDpruneCsr2csrByPercentage_bufferSizeExt( + cusparseHandle_t handle, + int m, + int n, + int nnzA, + const cusparseMatDescr_t descrA, + const double* csrSortedValA, + const int* csrSortedRowPtrA, + const int* csrSortedColIndA, + float percentage, + const cusparseMatDescr_t descrC, + const double* csrSortedValC, + const int* csrSortedRowPtrC, + const int* csrSortedColIndC, + pruneInfo_t info, + size_t* pBufferSizeInBytes); + +#if defined(__cplusplus) + +cusparseStatus_t CUSPARSEAPI +cusparseHpruneCsr2csrNnzByPercentage( + cusparseHandle_t handle, + int m, + int n, + int nnzA, + const cusparseMatDescr_t descrA, + const __half* csrSortedValA, + const int* csrSortedRowPtrA, + const int* csrSortedColIndA, + float percentage, + const cusparseMatDescr_t descrC, + int* csrSortedRowPtrC, + int* nnzTotalDevHostPtr, + pruneInfo_t info, + void* pBuffer); + +#endif // defined(__cplusplus) + +cusparseStatus_t CUSPARSEAPI +cusparseSpruneCsr2csrNnzByPercentage( + cusparseHandle_t handle, + int m, + int n, + int nnzA, + const cusparseMatDescr_t descrA, + const float* csrSortedValA, + const int* csrSortedRowPtrA, + const int* csrSortedColIndA, + float percentage, + const cusparseMatDescr_t descrC, + int* csrSortedRowPtrC, + int* nnzTotalDevHostPtr, + pruneInfo_t info, + void* pBuffer); + +cusparseStatus_t CUSPARSEAPI +cusparseDpruneCsr2csrNnzByPercentage( + cusparseHandle_t handle, + int m, + int n, + int nnzA, + const cusparseMatDescr_t descrA, + const double* csrSortedValA, + const int* csrSortedRowPtrA, + const int* csrSortedColIndA, + float percentage, + const cusparseMatDescr_t descrC, + int* csrSortedRowPtrC, + int* nnzTotalDevHostPtr, + pruneInfo_t info, + void* pBuffer); + +#if defined(__cplusplus) +cusparseStatus_t CUSPARSEAPI +cusparseHpruneCsr2csrByPercentage(cusparseHandle_t handle, + int m, + int n, + int nnzA, + const cusparseMatDescr_t descrA, + const __half* csrSortedValA, + const int* csrSortedRowPtrA, + const int* csrSortedColIndA, + float percentage, /* between 0 to 100 */ + const cusparseMatDescr_t descrC, + __half* csrSortedValC, + const int* csrSortedRowPtrC, + int* csrSortedColIndC, + pruneInfo_t info, + void* pBuffer); + +#endif // defined(__cplusplus) + +cusparseStatus_t CUSPARSEAPI +cusparseSpruneCsr2csrByPercentage(cusparseHandle_t handle, + int m, + int n, + int nnzA, + const cusparseMatDescr_t descrA, + const float* csrSortedValA, + const int* csrSortedRowPtrA, + const int* csrSortedColIndA, + float percentage, + const cusparseMatDescr_t descrC, + float* csrSortedValC, + const int* csrSortedRowPtrC, + int* csrSortedColIndC, + pruneInfo_t info, + void* pBuffer); + +cusparseStatus_t CUSPARSEAPI +cusparseDpruneCsr2csrByPercentage(cusparseHandle_t handle, + int m, + int n, + int nnzA, + const cusparseMatDescr_t descrA, + const double* csrSortedValA, + const int* csrSortedRowPtrA, + const int* csrSortedColIndA, + float percentage, + const cusparseMatDescr_t descrC, + double* csrSortedValC, + const int* csrSortedRowPtrC, + int* csrSortedColIndC, + pruneInfo_t info, + void* pBuffer); + +//############################################################################## +//# CSR2CSC +//############################################################################## + +typedef enum { + CUSPARSE_CSR2CSC_ALG_DEFAULT = 1, + CUSPARSE_CSR2CSC_ALG1 = 1 +} cusparseCsr2CscAlg_t; + +cusparseStatus_t CUSPARSEAPI +cusparseCsr2cscEx2(cusparseHandle_t handle, + int m, + int n, + int nnz, + const void* csrVal, + const int* csrRowPtr, + const int* csrColInd, + void* cscVal, + int* cscColPtr, + int* cscRowInd, + cudaDataType valType, + cusparseAction_t copyValues, + cusparseIndexBase_t idxBase, + cusparseCsr2CscAlg_t alg, + void* buffer); + +cusparseStatus_t CUSPARSEAPI +cusparseCsr2cscEx2_bufferSize(cusparseHandle_t handle, + int m, + int n, + int nnz, + const void* csrVal, + const int* csrRowPtr, + const int* csrColInd, + void* cscVal, + int* cscColPtr, + int* cscRowInd, + cudaDataType valType, + cusparseAction_t copyValues, + cusparseIndexBase_t idxBase, + cusparseCsr2CscAlg_t alg, + size_t* bufferSize); + +// ############################################################################# +// # GENERIC APIs - Enumerators and Opaque Data Structures +// ############################################################################# + +typedef enum { + CUSPARSE_FORMAT_CSR = 1, ///< Compressed Sparse Row (CSR) + CUSPARSE_FORMAT_CSC = 2, ///< Compressed Sparse Column (CSC) + CUSPARSE_FORMAT_COO = 3, ///< Coordinate (COO) - Structure of Arrays + CUSPARSE_FORMAT_BLOCKED_ELL = 5, ///< Blocked ELL + CUSPARSE_FORMAT_BSR = 6, ///< Blocked Compressed Sparse Row (BSR) + CUSPARSE_FORMAT_SLICED_ELLPACK = 7 ///< Sliced ELL +} cusparseFormat_t; + +typedef enum { + CUSPARSE_ORDER_COL = 1, ///< Column-Major Order - Matrix memory layout + CUSPARSE_ORDER_ROW = 2 ///< Row-Major Order - Matrix memory layout +} cusparseOrder_t; + +typedef enum { + CUSPARSE_INDEX_16U = 1, ///< 16-bit unsigned integer for matrix/vector + ///< indices + CUSPARSE_INDEX_32I = 2, ///< 32-bit signed integer for matrix/vector indices + CUSPARSE_INDEX_64I = 3 ///< 64-bit signed integer for matrix/vector indices +} cusparseIndexType_t; + +//------------------------------------------------------------------------------ + +struct cusparseSpVecDescr; +struct cusparseDnVecDescr; +struct cusparseSpMatDescr; +struct cusparseDnMatDescr; + +typedef struct cusparseSpVecDescr* cusparseSpVecDescr_t; +typedef struct cusparseDnVecDescr* cusparseDnVecDescr_t; +typedef struct cusparseSpMatDescr* cusparseSpMatDescr_t; +typedef struct cusparseDnMatDescr* cusparseDnMatDescr_t; + +typedef struct cusparseSpVecDescr const* cusparseConstSpVecDescr_t; +typedef struct cusparseDnVecDescr const* cusparseConstDnVecDescr_t; +typedef struct cusparseSpMatDescr const* cusparseConstSpMatDescr_t; +typedef struct cusparseDnMatDescr const* cusparseConstDnMatDescr_t; + +// ############################################################################# +// # SPARSE VECTOR DESCRIPTOR +// ############################################################################# + +cusparseStatus_t CUSPARSEAPI +cusparseCreateSpVec(cusparseSpVecDescr_t* spVecDescr, + int64_t size, + int64_t nnz, + void* indices, + void* values, + cusparseIndexType_t idxType, + cusparseIndexBase_t idxBase, + cudaDataType valueType); + +cusparseStatus_t CUSPARSEAPI +cusparseCreateConstSpVec(cusparseConstSpVecDescr_t* spVecDescr, + int64_t size, + int64_t nnz, + const void* indices, + const void* values, + cusparseIndexType_t idxType, + cusparseIndexBase_t idxBase, + cudaDataType valueType); + +cusparseStatus_t CUSPARSEAPI +cusparseDestroySpVec(cusparseConstSpVecDescr_t spVecDescr); + +cusparseStatus_t CUSPARSEAPI +cusparseSpVecGet(cusparseSpVecDescr_t spVecDescr, + int64_t* size, + int64_t* nnz, + void** indices, + void** values, + cusparseIndexType_t* idxType, + cusparseIndexBase_t* idxBase, + cudaDataType* valueType); + +cusparseStatus_t CUSPARSEAPI +cusparseConstSpVecGet(cusparseConstSpVecDescr_t spVecDescr, + int64_t* size, + int64_t* nnz, + const void** indices, + const void** values, + cusparseIndexType_t* idxType, + cusparseIndexBase_t* idxBase, + cudaDataType* valueType); + +cusparseStatus_t CUSPARSEAPI +cusparseSpVecGetIndexBase(cusparseConstSpVecDescr_t spVecDescr, + cusparseIndexBase_t* idxBase); + +cusparseStatus_t CUSPARSEAPI +cusparseSpVecGetValues(cusparseSpVecDescr_t spVecDescr, + void** values); + +cusparseStatus_t CUSPARSEAPI +cusparseConstSpVecGetValues(cusparseConstSpVecDescr_t spVecDescr, + const void** values); + +cusparseStatus_t CUSPARSEAPI +cusparseSpVecSetValues(cusparseSpVecDescr_t spVecDescr, + void* values); + +// ############################################################################# +// # DENSE VECTOR DESCRIPTOR +// ############################################################################# + +cusparseStatus_t CUSPARSEAPI +cusparseCreateDnVec(cusparseDnVecDescr_t* dnVecDescr, + int64_t size, + void* values, + cudaDataType valueType); + +cusparseStatus_t CUSPARSEAPI +cusparseCreateConstDnVec(cusparseConstDnVecDescr_t* dnVecDescr, + int64_t size, + const void* values, + cudaDataType valueType); + +cusparseStatus_t CUSPARSEAPI +cusparseDestroyDnVec(cusparseConstDnVecDescr_t dnVecDescr); + +cusparseStatus_t CUSPARSEAPI +cusparseDnVecGet(cusparseDnVecDescr_t dnVecDescr, + int64_t* size, + void** values, + cudaDataType* valueType); + +cusparseStatus_t CUSPARSEAPI +cusparseConstDnVecGet(cusparseConstDnVecDescr_t dnVecDescr, + int64_t* size, + const void** values, + cudaDataType* valueType); + +cusparseStatus_t CUSPARSEAPI +cusparseDnVecGetValues(cusparseDnVecDescr_t dnVecDescr, + void** values); + +cusparseStatus_t CUSPARSEAPI +cusparseConstDnVecGetValues(cusparseConstDnVecDescr_t dnVecDescr, + const void** values); + +cusparseStatus_t CUSPARSEAPI +cusparseDnVecSetValues(cusparseDnVecDescr_t dnVecDescr, + void* values); + +// ############################################################################# +// # SPARSE MATRIX DESCRIPTOR +// ############################################################################# + +cusparseStatus_t CUSPARSEAPI +cusparseDestroySpMat(cusparseConstSpMatDescr_t spMatDescr); + + cusparseStatus_t CUSPARSEAPI +cusparseSpMatGetFormat(cusparseConstSpMatDescr_t spMatDescr, + cusparseFormat_t* format); + +cusparseStatus_t CUSPARSEAPI +cusparseSpMatGetIndexBase(cusparseConstSpMatDescr_t spMatDescr, + cusparseIndexBase_t* idxBase); + +cusparseStatus_t CUSPARSEAPI +cusparseSpMatGetValues(cusparseSpMatDescr_t spMatDescr, + void** values); + +cusparseStatus_t CUSPARSEAPI +cusparseConstSpMatGetValues(cusparseConstSpMatDescr_t spMatDescr, + const void** values); + +cusparseStatus_t CUSPARSEAPI +cusparseSpMatSetValues(cusparseSpMatDescr_t spMatDescr, + void* values); + +cusparseStatus_t CUSPARSEAPI +cusparseSpMatGetSize(cusparseConstSpMatDescr_t spMatDescr, + int64_t* rows, + int64_t* cols, + int64_t* nnz); + +cusparseStatus_t CUSPARSEAPI +cusparseSpMatGetStridedBatch(cusparseConstSpMatDescr_t spMatDescr, + int* batchCount); + +cusparseStatus_t CUSPARSEAPI +cusparseCooSetStridedBatch(cusparseSpMatDescr_t spMatDescr, + int batchCount, + int64_t batchStride); + +cusparseStatus_t CUSPARSEAPI +cusparseCsrSetStridedBatch(cusparseSpMatDescr_t spMatDescr, + int batchCount, + int64_t offsetsBatchStride, + int64_t columnsValuesBatchStride); + +cusparseStatus_t CUSPARSEAPI +cusparseBsrSetStridedBatch(cusparseSpMatDescr_t spMatDescr, + int batchCount, + int64_t offsetsBatchStride, + int64_t columnsValuesBatchStride, + int64_t ValuesBatchStride); + +typedef enum { + CUSPARSE_SPMAT_FILL_MODE, + CUSPARSE_SPMAT_DIAG_TYPE +} cusparseSpMatAttribute_t; + +cusparseStatus_t CUSPARSEAPI +cusparseSpMatGetAttribute(cusparseConstSpMatDescr_t spMatDescr, + cusparseSpMatAttribute_t attribute, + void* data, + size_t dataSize); + +cusparseStatus_t CUSPARSEAPI +cusparseSpMatSetAttribute(cusparseSpMatDescr_t spMatDescr, + cusparseSpMatAttribute_t attribute, + void* data, + size_t dataSize); + +//------------------------------------------------------------------------------ +// ### CSR ### + +cusparseStatus_t CUSPARSEAPI +cusparseCreateCsr(cusparseSpMatDescr_t* spMatDescr, + int64_t rows, + int64_t cols, + int64_t nnz, + void* csrRowOffsets, + void* csrColInd, + void* csrValues, + cusparseIndexType_t csrRowOffsetsType, + cusparseIndexType_t csrColIndType, + cusparseIndexBase_t idxBase, + cudaDataType valueType); + +cusparseStatus_t CUSPARSEAPI +cusparseCreateConstCsr(cusparseConstSpMatDescr_t* spMatDescr, + int64_t rows, + int64_t cols, + int64_t nnz, + const void* csrRowOffsets, + const void* csrColInd, + const void* csrValues, + cusparseIndexType_t csrRowOffsetsType, + cusparseIndexType_t csrColIndType, + cusparseIndexBase_t idxBase, + cudaDataType valueType); + +cusparseStatus_t CUSPARSEAPI +cusparseCreateCsc(cusparseSpMatDescr_t* spMatDescr, + int64_t rows, + int64_t cols, + int64_t nnz, + void* cscColOffsets, + void* cscRowInd, + void* cscValues, + cusparseIndexType_t cscColOffsetsType, + cusparseIndexType_t cscRowIndType, + cusparseIndexBase_t idxBase, + cudaDataType valueType); + +cusparseStatus_t CUSPARSEAPI +cusparseCreateConstCsc(cusparseConstSpMatDescr_t* spMatDescr, + int64_t rows, + int64_t cols, + int64_t nnz, + const void* cscColOffsets, + const void* cscRowInd, + const void* cscValues, + cusparseIndexType_t cscColOffsetsType, + cusparseIndexType_t cscRowIndType, + cusparseIndexBase_t idxBase, + cudaDataType valueType); + +cusparseStatus_t CUSPARSEAPI +cusparseCsrGet(cusparseSpMatDescr_t spMatDescr, + int64_t* rows, + int64_t* cols, + int64_t* nnz, + void** csrRowOffsets, + void** csrColInd, + void** csrValues, + cusparseIndexType_t* csrRowOffsetsType, + cusparseIndexType_t* csrColIndType, + cusparseIndexBase_t* idxBase, + cudaDataType* valueType); + +cusparseStatus_t CUSPARSEAPI +cusparseConstCsrGet(cusparseConstSpMatDescr_t spMatDescr, + int64_t* rows, + int64_t* cols, + int64_t* nnz, + const void** csrRowOffsets, + const void** csrColInd, + const void** csrValues, + cusparseIndexType_t* csrRowOffsetsType, + cusparseIndexType_t* csrColIndType, + cusparseIndexBase_t* idxBase, + cudaDataType* valueType); + +cusparseStatus_t CUSPARSEAPI +cusparseCscGet(cusparseSpMatDescr_t spMatDescr, + int64_t* rows, + int64_t* cols, + int64_t* nnz, + void** cscColOffsets, + void** cscRowInd, + void** cscValues, + cusparseIndexType_t* cscColOffsetsType, + cusparseIndexType_t* cscRowIndType, + cusparseIndexBase_t* idxBase, + cudaDataType* valueType); + +cusparseStatus_t CUSPARSEAPI +cusparseConstCscGet(cusparseConstSpMatDescr_t spMatDescr, + int64_t* rows, + int64_t* cols, + int64_t* nnz, + const void** cscColOffsets, + const void** cscRowInd, + const void** cscValues, + cusparseIndexType_t* cscColOffsetsType, + cusparseIndexType_t* cscRowIndType, + cusparseIndexBase_t* idxBase, + cudaDataType* valueType); + +cusparseStatus_t CUSPARSEAPI +cusparseCsrSetPointers(cusparseSpMatDescr_t spMatDescr, + void* csrRowOffsets, + void* csrColInd, + void* csrValues); + +cusparseStatus_t CUSPARSEAPI +cusparseCscSetPointers(cusparseSpMatDescr_t spMatDescr, + void* cscColOffsets, + void* cscRowInd, + void* cscValues); + +//------------------------------------------------------------------------------ +// ### BSR ### + +cusparseStatus_t CUSPARSEAPI +cusparseCreateBsr(cusparseSpMatDescr_t* spMatDescr, + int64_t brows, + int64_t bcols, + int64_t bnnz, + int64_t rowBlockDim, + int64_t colBlockDim, + void* bsrRowOffsets, + void* bsrColInd, + void* bsrValues, + cusparseIndexType_t bsrRowOffsetsType, + cusparseIndexType_t bsrColIndType, + cusparseIndexBase_t idxBase, + cudaDataType valueType, + cusparseOrder_t order); + +cusparseStatus_t CUSPARSEAPI +cusparseCreateConstBsr(cusparseConstSpMatDescr_t* spMatDescr, + int64_t brows, + int64_t bcols, + int64_t bnnz, + int64_t rowBlockDim, + int64_t colBlockDim, + const void* bsrRowOffsets, + const void* bsrColInd, + const void* bsrValues, + cusparseIndexType_t bsrRowOffsetsType, + cusparseIndexType_t bsrColIndType, + cusparseIndexBase_t idxBase, + cudaDataType valueType, + cusparseOrder_t order); + +//------------------------------------------------------------------------------ +// ### COO ### + +cusparseStatus_t CUSPARSEAPI +cusparseCreateCoo(cusparseSpMatDescr_t* spMatDescr, + int64_t rows, + int64_t cols, + int64_t nnz, + void* cooRowInd, + void* cooColInd, + void* cooValues, + cusparseIndexType_t cooIdxType, + cusparseIndexBase_t idxBase, + cudaDataType valueType); + +cusparseStatus_t CUSPARSEAPI +cusparseCreateConstCoo(cusparseConstSpMatDescr_t* spMatDescr, + int64_t rows, + int64_t cols, + int64_t nnz, + const void* cooRowInd, + const void* cooColInd, + const void* cooValues, + cusparseIndexType_t cooIdxType, + cusparseIndexBase_t idxBase, + cudaDataType valueType); + +cusparseStatus_t CUSPARSEAPI +cusparseCooGet(cusparseSpMatDescr_t spMatDescr, + int64_t* rows, + int64_t* cols, + int64_t* nnz, + void** cooRowInd, // COO row indices + void** cooColInd, // COO column indices + void** cooValues, // COO values + cusparseIndexType_t* idxType, + cusparseIndexBase_t* idxBase, + cudaDataType* valueType); + +cusparseStatus_t CUSPARSEAPI +cusparseConstCooGet(cusparseConstSpMatDescr_t spMatDescr, + int64_t* rows, + int64_t* cols, + int64_t* nnz, + const void** cooRowInd, // COO row indices + const void** cooColInd, // COO column indices + const void** cooValues, // COO values + cusparseIndexType_t* idxType, + cusparseIndexBase_t* idxBase, + cudaDataType* valueType); + +cusparseStatus_t CUSPARSEAPI +cusparseCooSetPointers(cusparseSpMatDescr_t spMatDescr, + void* cooRows, + void* cooColumns, + void* cooValues); + +//------------------------------------------------------------------------------ +// ### BLOCKED ELL ### + +cusparseStatus_t CUSPARSEAPI +cusparseCreateBlockedEll(cusparseSpMatDescr_t* spMatDescr, + int64_t rows, + int64_t cols, + int64_t ellBlockSize, + int64_t ellCols, + void* ellColInd, + void* ellValue, + cusparseIndexType_t ellIdxType, + cusparseIndexBase_t idxBase, + cudaDataType valueType); + +cusparseStatus_t CUSPARSEAPI +cusparseCreateConstBlockedEll(cusparseConstSpMatDescr_t* spMatDescr, + int64_t rows, + int64_t cols, + int64_t ellBlockSize, + int64_t ellCols, + const void* ellColInd, + const void* ellValue, + cusparseIndexType_t ellIdxType, + cusparseIndexBase_t idxBase, + cudaDataType valueType); + +cusparseStatus_t CUSPARSEAPI +cusparseBlockedEllGet(cusparseSpMatDescr_t spMatDescr, + int64_t* rows, + int64_t* cols, + int64_t* ellBlockSize, + int64_t* ellCols, + void** ellColInd, + void** ellValue, + cusparseIndexType_t* ellIdxType, + cusparseIndexBase_t* idxBase, + cudaDataType* valueType); + +cusparseStatus_t CUSPARSEAPI +cusparseConstBlockedEllGet(cusparseConstSpMatDescr_t spMatDescr, + int64_t* rows, + int64_t* cols, + int64_t* ellBlockSize, + int64_t* ellCols, + const void** ellColInd, + const void** ellValue, + cusparseIndexType_t* ellIdxType, + cusparseIndexBase_t* idxBase, + cudaDataType* valueType); + +//------------------------------------------------------------------------------ +// ### Sliced ELLPACK ### + +cusparseStatus_t CUSPARSEAPI +cusparseCreateSlicedEll(cusparseSpMatDescr_t* spMatDescr, + int64_t rows, + int64_t cols, + int64_t nnz, + int64_t sellValuesSize, + int64_t sliceSize, + void* sellSliceOffsets, + void* sellColInd, + void* sellValues, + cusparseIndexType_t sellSliceOffsetsType, + cusparseIndexType_t sellColIndType, + cusparseIndexBase_t idxBase, + cudaDataType valueType); + +cusparseStatus_t CUSPARSEAPI +cusparseCreateConstSlicedEll(cusparseConstSpMatDescr_t* spMatDescr, + int64_t rows, + int64_t cols, + int64_t nnz, + int64_t sellValuesSize, + int64_t sliceSize, + const void* sellSliceOffsets, + const void* sellColInd, + const void* sellValues, + cusparseIndexType_t sellSliceOffsetsType, + cusparseIndexType_t sellColIndType, + cusparseIndexBase_t idxBase, + cudaDataType valueType); + +// ############################################################################# +// # DENSE MATRIX DESCRIPTOR +// ############################################################################# + +cusparseStatus_t CUSPARSEAPI +cusparseCreateDnMat(cusparseDnMatDescr_t* dnMatDescr, + int64_t rows, + int64_t cols, + int64_t ld, + void* values, + cudaDataType valueType, + cusparseOrder_t order); + +cusparseStatus_t CUSPARSEAPI +cusparseCreateConstDnMat(cusparseConstDnMatDescr_t* dnMatDescr, + int64_t rows, + int64_t cols, + int64_t ld, + const void* values, + cudaDataType valueType, + cusparseOrder_t order); + +cusparseStatus_t CUSPARSEAPI +cusparseDestroyDnMat(cusparseConstDnMatDescr_t dnMatDescr); + +cusparseStatus_t CUSPARSEAPI +cusparseDnMatGet(cusparseDnMatDescr_t dnMatDescr, + int64_t* rows, + int64_t* cols, + int64_t* ld, + void** values, + cudaDataType* type, + cusparseOrder_t* order); + +cusparseStatus_t CUSPARSEAPI +cusparseConstDnMatGet(cusparseConstDnMatDescr_t dnMatDescr, + int64_t* rows, + int64_t* cols, + int64_t* ld, + const void** values, + cudaDataType* type, + cusparseOrder_t* order); + +cusparseStatus_t CUSPARSEAPI +cusparseDnMatGetValues(cusparseDnMatDescr_t dnMatDescr, + void** values); + +cusparseStatus_t CUSPARSEAPI +cusparseConstDnMatGetValues(cusparseConstDnMatDescr_t dnMatDescr, + const void** values); + +cusparseStatus_t CUSPARSEAPI +cusparseDnMatSetValues(cusparseDnMatDescr_t dnMatDescr, + void* values); + +cusparseStatus_t CUSPARSEAPI +cusparseDnMatSetStridedBatch(cusparseDnMatDescr_t dnMatDescr, + int batchCount, + int64_t batchStride); + +cusparseStatus_t CUSPARSEAPI +cusparseDnMatGetStridedBatch(cusparseConstDnMatDescr_t dnMatDescr, + int* batchCount, + int64_t* batchStride); + +// ############################################################################# +// # VECTOR-VECTOR OPERATIONS +// ############################################################################# + +cusparseStatus_t CUSPARSEAPI +cusparseAxpby(cusparseHandle_t handle, + const void* alpha, + cusparseConstSpVecDescr_t vecX, + const void* beta, + cusparseDnVecDescr_t vecY); + +cusparseStatus_t CUSPARSEAPI +cusparseGather(cusparseHandle_t handle, + cusparseConstDnVecDescr_t vecY, + cusparseSpVecDescr_t vecX); + +cusparseStatus_t CUSPARSEAPI +cusparseScatter(cusparseHandle_t handle, + cusparseConstSpVecDescr_t vecX, + cusparseDnVecDescr_t vecY); + +cusparseStatus_t CUSPARSEAPI +cusparseRot(cusparseHandle_t handle, + const void* c_coeff, + const void* s_coeff, + cusparseSpVecDescr_t vecX, + cusparseDnVecDescr_t vecY); + +cusparseStatus_t CUSPARSEAPI +cusparseSpVV_bufferSize(cusparseHandle_t handle, + cusparseOperation_t opX, + cusparseConstSpVecDescr_t vecX, + cusparseConstDnVecDescr_t vecY, + const void* result, + cudaDataType computeType, + size_t* bufferSize); + +cusparseStatus_t CUSPARSEAPI +cusparseSpVV(cusparseHandle_t handle, + cusparseOperation_t opX, + cusparseConstSpVecDescr_t vecX, + cusparseConstDnVecDescr_t vecY, + void* result, + cudaDataType computeType, + void* externalBuffer); + +// ############################################################################# +// # SPARSE TO DENSE +// ############################################################################# + +typedef enum { + CUSPARSE_SPARSETODENSE_ALG_DEFAULT = 0 +} cusparseSparseToDenseAlg_t; + +cusparseStatus_t CUSPARSEAPI +cusparseSparseToDense_bufferSize(cusparseHandle_t handle, + cusparseConstSpMatDescr_t matA, + cusparseDnMatDescr_t matB, + cusparseSparseToDenseAlg_t alg, + size_t* bufferSize); + +cusparseStatus_t CUSPARSEAPI +cusparseSparseToDense(cusparseHandle_t handle, + cusparseConstSpMatDescr_t matA, + cusparseDnMatDescr_t matB, + cusparseSparseToDenseAlg_t alg, + void* externalBuffer); + +// ############################################################################# +// # DENSE TO SPARSE +// ############################################################################# + +typedef enum { + CUSPARSE_DENSETOSPARSE_ALG_DEFAULT = 0 +} cusparseDenseToSparseAlg_t; + +cusparseStatus_t CUSPARSEAPI +cusparseDenseToSparse_bufferSize(cusparseHandle_t handle, + cusparseConstDnMatDescr_t matA, + cusparseSpMatDescr_t matB, + cusparseDenseToSparseAlg_t alg, + size_t* bufferSize); + +cusparseStatus_t CUSPARSEAPI +cusparseDenseToSparse_analysis(cusparseHandle_t handle, + cusparseConstDnMatDescr_t matA, + cusparseSpMatDescr_t matB, + cusparseDenseToSparseAlg_t alg, + void* externalBuffer); + +cusparseStatus_t CUSPARSEAPI +cusparseDenseToSparse_convert(cusparseHandle_t handle, + cusparseConstDnMatDescr_t matA, + cusparseSpMatDescr_t matB, + cusparseDenseToSparseAlg_t alg, + void* externalBuffer); + +// ############################################################################# +// # SPARSE MATRIX-VECTOR MULTIPLICATION +// ############################################################################# + +typedef enum { + CUSPARSE_SPMV_ALG_DEFAULT = 0, + CUSPARSE_SPMV_CSR_ALG1 = 2, + CUSPARSE_SPMV_CSR_ALG2 = 3, + CUSPARSE_SPMV_COO_ALG1 = 1, + CUSPARSE_SPMV_COO_ALG2 = 4, + CUSPARSE_SPMV_SELL_ALG1 = 5 +} cusparseSpMVAlg_t; + +cusparseStatus_t CUSPARSEAPI +cusparseSpMV(cusparseHandle_t handle, + cusparseOperation_t opA, + const void* alpha, + cusparseConstSpMatDescr_t matA, + cusparseConstDnVecDescr_t vecX, + const void* beta, + cusparseDnVecDescr_t vecY, + cudaDataType computeType, + cusparseSpMVAlg_t alg, + void* externalBuffer); + +cusparseStatus_t CUSPARSEAPI +cusparseSpMV_bufferSize(cusparseHandle_t handle, + cusparseOperation_t opA, + const void* alpha, + cusparseConstSpMatDescr_t matA, + cusparseConstDnVecDescr_t vecX, + const void* beta, + cusparseDnVecDescr_t vecY, + cudaDataType computeType, + cusparseSpMVAlg_t alg, + size_t* bufferSize); + +// ############################################################################# +// # SPARSE TRIANGULAR VECTOR SOLVE +// ############################################################################# + +typedef enum { + CUSPARSE_SPSV_ALG_DEFAULT = 0, +} cusparseSpSVAlg_t; + +typedef enum { + CUSPARSE_SPSV_UPDATE_GENERAL = 0, + CUSPARSE_SPSV_UPDATE_DIAGONAL = 1 +} cusparseSpSVUpdate_t; + +struct cusparseSpSVDescr; +typedef struct cusparseSpSVDescr* cusparseSpSVDescr_t; + +cusparseStatus_t CUSPARSEAPI +cusparseSpSV_createDescr(cusparseSpSVDescr_t* descr); + +cusparseStatus_t CUSPARSEAPI +cusparseSpSV_destroyDescr(cusparseSpSVDescr_t descr); + +cusparseStatus_t CUSPARSEAPI +cusparseSpSV_bufferSize(cusparseHandle_t handle, + cusparseOperation_t opA, + const void* alpha, + cusparseConstSpMatDescr_t matA, + cusparseConstDnVecDescr_t vecX, + cusparseDnVecDescr_t vecY, + cudaDataType computeType, + cusparseSpSVAlg_t alg, + cusparseSpSVDescr_t spsvDescr, + size_t* bufferSize); + +cusparseStatus_t CUSPARSEAPI +cusparseSpSV_analysis(cusparseHandle_t handle, + cusparseOperation_t opA, + const void* alpha, + cusparseConstSpMatDescr_t matA, + cusparseConstDnVecDescr_t vecX, + cusparseDnVecDescr_t vecY, + cudaDataType computeType, + cusparseSpSVAlg_t alg, + cusparseSpSVDescr_t spsvDescr, + void* externalBuffer); + +cusparseStatus_t CUSPARSEAPI +cusparseSpSV_solve(cusparseHandle_t handle, + cusparseOperation_t opA, + const void* alpha, + cusparseConstSpMatDescr_t matA, + cusparseConstDnVecDescr_t vecX, + cusparseDnVecDescr_t vecY, + cudaDataType computeType, + cusparseSpSVAlg_t alg, + cusparseSpSVDescr_t spsvDescr); + +cusparseStatus_t CUSPARSEAPI +cusparseSpSV_updateMatrix(cusparseHandle_t handle, + cusparseSpSVDescr_t spsvDescr, + void* newValues, + cusparseSpSVUpdate_t updatePart); + + + +// ############################################################################# +// # SPARSE TRIANGULAR MATRIX SOLVE +// ############################################################################# + +typedef enum { + CUSPARSE_SPSM_ALG_DEFAULT = 0, +} cusparseSpSMAlg_t; + +struct cusparseSpSMDescr; +typedef struct cusparseSpSMDescr* cusparseSpSMDescr_t; + +cusparseStatus_t CUSPARSEAPI +cusparseSpSM_createDescr(cusparseSpSMDescr_t* descr); + +cusparseStatus_t CUSPARSEAPI +cusparseSpSM_destroyDescr(cusparseSpSMDescr_t descr); + +cusparseStatus_t CUSPARSEAPI +cusparseSpSM_bufferSize(cusparseHandle_t handle, + cusparseOperation_t opA, + cusparseOperation_t opB, + const void* alpha, + cusparseConstSpMatDescr_t matA, + cusparseConstDnMatDescr_t matB, + cusparseDnMatDescr_t matC, + cudaDataType computeType, + cusparseSpSMAlg_t alg, + cusparseSpSMDescr_t spsmDescr, + size_t* bufferSize); + +cusparseStatus_t CUSPARSEAPI +cusparseSpSM_analysis(cusparseHandle_t handle, + cusparseOperation_t opA, + cusparseOperation_t opB, + const void* alpha, + cusparseConstSpMatDescr_t matA, + cusparseConstDnMatDescr_t matB, + cusparseDnMatDescr_t matC, + cudaDataType computeType, + cusparseSpSMAlg_t alg, + cusparseSpSMDescr_t spsmDescr, + void* externalBuffer); + +cusparseStatus_t CUSPARSEAPI +cusparseSpSM_solve(cusparseHandle_t handle, + cusparseOperation_t opA, + cusparseOperation_t opB, + const void* alpha, + cusparseConstSpMatDescr_t matA, + cusparseConstDnMatDescr_t matB, + cusparseDnMatDescr_t matC, + cudaDataType computeType, + cusparseSpSMAlg_t alg, + cusparseSpSMDescr_t spsmDescr); + +// ############################################################################# +// # SPARSE MATRIX-MATRIX MULTIPLICATION +// ############################################################################# + +typedef enum { + CUSPARSE_SPMM_ALG_DEFAULT = 0, + CUSPARSE_SPMM_COO_ALG1 = 1, + CUSPARSE_SPMM_COO_ALG2 = 2, + CUSPARSE_SPMM_COO_ALG3 = 3, + CUSPARSE_SPMM_COO_ALG4 = 5, + CUSPARSE_SPMM_CSR_ALG1 = 4, + CUSPARSE_SPMM_CSR_ALG2 = 6, + CUSPARSE_SPMM_CSR_ALG3 = 12, + CUSPARSE_SPMM_BLOCKED_ELL_ALG1 = 13 +} cusparseSpMMAlg_t; + +cusparseStatus_t CUSPARSEAPI +cusparseSpMM_bufferSize(cusparseHandle_t handle, + cusparseOperation_t opA, + cusparseOperation_t opB, + const void* alpha, + cusparseConstSpMatDescr_t matA, + cusparseConstDnMatDescr_t matB, + const void* beta, + cusparseDnMatDescr_t matC, + cudaDataType computeType, + cusparseSpMMAlg_t alg, + size_t* bufferSize); + +cusparseStatus_t CUSPARSEAPI +cusparseSpMM_preprocess(cusparseHandle_t handle, + cusparseOperation_t opA, + cusparseOperation_t opB, + const void* alpha, + cusparseConstSpMatDescr_t matA, + cusparseConstDnMatDescr_t matB, + const void* beta, + cusparseDnMatDescr_t matC, + cudaDataType computeType, + cusparseSpMMAlg_t alg, + void* externalBuffer); + +cusparseStatus_t CUSPARSEAPI +cusparseSpMM(cusparseHandle_t handle, + cusparseOperation_t opA, + cusparseOperation_t opB, + const void* alpha, + cusparseConstSpMatDescr_t matA, + cusparseConstDnMatDescr_t matB, + const void* beta, + cusparseDnMatDescr_t matC, + cudaDataType computeType, + cusparseSpMMAlg_t alg, + void* externalBuffer); + +// ############################################################################# +// # SPARSE MATRIX - SPARSE MATRIX MULTIPLICATION (SpGEMM) +// ############################################################################# + +typedef enum { + CUSPARSE_SPGEMM_DEFAULT = 0, + CUSPARSE_SPGEMM_CSR_ALG_DETERMINITIC = 1, + CUSPARSE_SPGEMM_CSR_ALG_NONDETERMINITIC = 2, + CUSPARSE_SPGEMM_ALG1 = 3, + CUSPARSE_SPGEMM_ALG2 = 4, + CUSPARSE_SPGEMM_ALG3 = 5 +} cusparseSpGEMMAlg_t; + +struct cusparseSpGEMMDescr; +typedef struct cusparseSpGEMMDescr* cusparseSpGEMMDescr_t; + +cusparseStatus_t CUSPARSEAPI +cusparseSpGEMM_createDescr(cusparseSpGEMMDescr_t* descr); + +cusparseStatus_t CUSPARSEAPI +cusparseSpGEMM_destroyDescr(cusparseSpGEMMDescr_t descr); + +cusparseStatus_t CUSPARSEAPI +cusparseSpGEMM_workEstimation(cusparseHandle_t handle, + cusparseOperation_t opA, + cusparseOperation_t opB, + const void* alpha, + cusparseConstSpMatDescr_t matA, + cusparseConstSpMatDescr_t matB, + const void* beta, + cusparseSpMatDescr_t matC, + cudaDataType computeType, + cusparseSpGEMMAlg_t alg, + cusparseSpGEMMDescr_t spgemmDescr, + size_t* bufferSize1, + void* externalBuffer1); + +cusparseStatus_t CUSPARSEAPI +cusparseSpGEMM_getNumProducts(cusparseSpGEMMDescr_t spgemmDescr, + int64_t* num_prods); + +cusparseStatus_t CUSPARSEAPI +cusparseSpGEMM_estimateMemory(cusparseHandle_t handle, + cusparseOperation_t opA, + cusparseOperation_t opB, + const void* alpha, + cusparseConstSpMatDescr_t matA, + cusparseConstSpMatDescr_t matB, + const void* beta, + cusparseSpMatDescr_t matC, + cudaDataType computeType, + cusparseSpGEMMAlg_t alg, + cusparseSpGEMMDescr_t spgemmDescr, + float chunk_fraction, + size_t* bufferSize3, + void* externalBuffer3, + size_t* bufferSize2); + +cusparseStatus_t CUSPARSEAPI +cusparseSpGEMM_compute(cusparseHandle_t handle, + cusparseOperation_t opA, + cusparseOperation_t opB, + const void* alpha, + cusparseConstSpMatDescr_t matA, + cusparseConstSpMatDescr_t matB, + const void* beta, + cusparseSpMatDescr_t matC, + cudaDataType computeType, + cusparseSpGEMMAlg_t alg, + cusparseSpGEMMDescr_t spgemmDescr, + size_t* bufferSize2, + void* externalBuffer2); + +cusparseStatus_t CUSPARSEAPI +cusparseSpGEMM_copy(cusparseHandle_t handle, + cusparseOperation_t opA, + cusparseOperation_t opB, + const void* alpha, + cusparseConstSpMatDescr_t matA, + cusparseConstSpMatDescr_t matB, + const void* beta, + cusparseSpMatDescr_t matC, + cudaDataType computeType, + cusparseSpGEMMAlg_t alg, + cusparseSpGEMMDescr_t spgemmDescr); + +// ############################################################################# +// # SPARSE MATRIX - SPARSE MATRIX MULTIPLICATION (SpGEMM) STRUCTURE REUSE +// ############################################################################# + +cusparseStatus_t CUSPARSEAPI +cusparseSpGEMMreuse_workEstimation(cusparseHandle_t handle, + cusparseOperation_t opA, + cusparseOperation_t opB, + cusparseConstSpMatDescr_t matA, + cusparseConstSpMatDescr_t matB, + cusparseSpMatDescr_t matC, + cusparseSpGEMMAlg_t alg, + cusparseSpGEMMDescr_t spgemmDescr, + size_t* bufferSize1, + void* externalBuffer1); + +cusparseStatus_t CUSPARSEAPI +cusparseSpGEMMreuse_nnz(cusparseHandle_t handle, + cusparseOperation_t opA, + cusparseOperation_t opB, + cusparseConstSpMatDescr_t matA, + cusparseConstSpMatDescr_t matB, + cusparseSpMatDescr_t matC, + cusparseSpGEMMAlg_t alg, + cusparseSpGEMMDescr_t spgemmDescr, + size_t* bufferSize2, + void* externalBuffer2, + size_t* bufferSize3, + void* externalBuffer3, + size_t* bufferSize4, + void* externalBuffer4); + +cusparseStatus_t CUSPARSEAPI +cusparseSpGEMMreuse_copy(cusparseHandle_t handle, + cusparseOperation_t opA, + cusparseOperation_t opB, + cusparseConstSpMatDescr_t matA, + cusparseConstSpMatDescr_t matB, + cusparseSpMatDescr_t matC, + cusparseSpGEMMAlg_t alg, + cusparseSpGEMMDescr_t spgemmDescr, + size_t* bufferSize5, + void* externalBuffer5); + +cusparseStatus_t CUSPARSEAPI +cusparseSpGEMMreuse_compute(cusparseHandle_t handle, + cusparseOperation_t opA, + cusparseOperation_t opB, + const void* alpha, + cusparseConstSpMatDescr_t matA, + cusparseConstSpMatDescr_t matB, + const void* beta, + cusparseSpMatDescr_t matC, + cudaDataType computeType, + cusparseSpGEMMAlg_t alg, + cusparseSpGEMMDescr_t spgemmDescr); + +// ############################################################################# +// # SAMPLED DENSE-DENSE MATRIX MULTIPLICATION +// ############################################################################# + +typedef enum { + CUSPARSE_SDDMM_ALG_DEFAULT = 0 +} cusparseSDDMMAlg_t; + +cusparseStatus_t CUSPARSEAPI +cusparseSDDMM_bufferSize(cusparseHandle_t handle, + cusparseOperation_t opA, + cusparseOperation_t opB, + const void* alpha, + cusparseConstDnMatDescr_t matA, + cusparseConstDnMatDescr_t matB, + const void* beta, + cusparseSpMatDescr_t matC, + cudaDataType computeType, + cusparseSDDMMAlg_t alg, + size_t* bufferSize); + +cusparseStatus_t CUSPARSEAPI +cusparseSDDMM_preprocess(cusparseHandle_t handle, + cusparseOperation_t opA, + cusparseOperation_t opB, + const void* alpha, + cusparseConstDnMatDescr_t matA, + cusparseConstDnMatDescr_t matB, + const void* beta, + cusparseSpMatDescr_t matC, + cudaDataType computeType, + cusparseSDDMMAlg_t alg, + void* externalBuffer); + +cusparseStatus_t CUSPARSEAPI +cusparseSDDMM(cusparseHandle_t handle, + cusparseOperation_t opA, + cusparseOperation_t opB, + const void* alpha, + cusparseConstDnMatDescr_t matA, + cusparseConstDnMatDescr_t matB, + const void* beta, + cusparseSpMatDescr_t matC, + cudaDataType computeType, + cusparseSDDMMAlg_t alg, + void* externalBuffer); + +// ############################################################################# +// # GENERIC APIs WITH CUSTOM OPERATORS (PREVIEW) +// ############################################################################# + +struct cusparseSpMMOpPlan; +typedef struct cusparseSpMMOpPlan* cusparseSpMMOpPlan_t; + +typedef enum { + CUSPARSE_SPMM_OP_ALG_DEFAULT +} cusparseSpMMOpAlg_t; + +cusparseStatus_t CUSPARSEAPI +cusparseSpMMOp_createPlan(cusparseHandle_t handle, + cusparseSpMMOpPlan_t* plan, + cusparseOperation_t opA, + cusparseOperation_t opB, + cusparseConstSpMatDescr_t matA, + cusparseConstDnMatDescr_t matB, + cusparseDnMatDescr_t matC, + cudaDataType computeType, + cusparseSpMMOpAlg_t alg, + const void* addOperationNvvmBuffer, + size_t addOperationBufferSize, + const void* mulOperationNvvmBuffer, + size_t mulOperationBufferSize, + const void* epilogueNvvmBuffer, + size_t epilogueBufferSize, + size_t* SpMMWorkspaceSize); + +cusparseStatus_t CUSPARSEAPI +cusparseSpMMOp(cusparseSpMMOpPlan_t plan, + void* externalBuffer); + +cusparseStatus_t CUSPARSEAPI +cusparseSpMMOp_destroyPlan(cusparseSpMMOpPlan_t plan); + +//------------------------------------------------------------------------------ + +#if defined(__cplusplus) +} // extern "C" +#endif // defined(__cplusplus) + +#undef CUSPARSE_DEPRECATED + +#endif // !defined(CUSPARSE_H_) diff --git a/mantis_evalkit/lib/python3.10/site-packages/nvidia/cusparse/include/cusparse_v2.h b/mantis_evalkit/lib/python3.10/site-packages/nvidia/cusparse/include/cusparse_v2.h new file mode 100644 index 0000000000000000000000000000000000000000..f889e1f569d46d1116fe6e302429b3855de43c21 --- /dev/null +++ b/mantis_evalkit/lib/python3.10/site-packages/nvidia/cusparse/include/cusparse_v2.h @@ -0,0 +1,54 @@ +/* + * Copyright 1993-2019 NVIDIA Corporation. All rights reserved. + * + * NOTICE TO LICENSEE: + * + * This source code and/or documentation ("Licensed Deliverables") are + * subject to NVIDIA intellectual property rights under U.S. and + * international Copyright laws. + * + * These Licensed Deliverables contained herein is PROPRIETARY and + * CONFIDENTIAL to NVIDIA and is being provided under the terms and + * conditions of a form of NVIDIA software license agreement by and + * between NVIDIA and Licensee ("License Agreement") or electronically + * accepted by Licensee. Notwithstanding any terms or conditions to + * the contrary in the License Agreement, reproduction or disclosure + * of the Licensed Deliverables to any third party without the express + * written consent of NVIDIA is prohibited. + * + * NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE + * LICENSE AGREEMENT, NVIDIA MAKES NO REPRESENTATION ABOUT THE + * SUITABILITY OF THESE LICENSED DELIVERABLES FOR ANY PURPOSE. IT IS + * PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY OF ANY KIND. + * NVIDIA DISCLAIMS ALL WARRANTIES WITH REGARD TO THESE LICENSED + * DELIVERABLES, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY, + * NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE. + * NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE + * LICENSE AGREEMENT, IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY + * SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, OR ANY + * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS + * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THESE LICENSED DELIVERABLES. + * + * U.S. Government End Users. These Licensed Deliverables are a + * "commercial item" as that term is defined at 48 C.F.R. 2.101 (OCT + * 1995), consisting of "commercial computer software" and "commercial + * computer software documentation" as such terms are used in 48 + * C.F.R. 12.212 (SEPT 1995) and is provided to the U.S. Government + * only as a commercial end item. Consistent with 48 C.F.R.12.212 and + * 48 C.F.R. 227.7202-1 through 227.7202-4 (JUNE 1995), all + * U.S. Government End Users acquire the Licensed Deliverables with + * only those rights set forth herein. + * + * Any use of the Licensed Deliverables in individual and commercial + * software must include, in the user documentation and internal + * comments to the code, the above Disclaimer and U.S. Government End + * Users Notice. + */ +#if !defined(CUSPARSE_V2_H_) +#define CUSPARSE_V2_H_ + +#include "cusparse.h" + +#endif diff --git a/mantis_evalkit/lib/python3.10/site-packages/nvidia/cusparse/lib/__init__.py b/mantis_evalkit/lib/python3.10/site-packages/nvidia/cusparse/lib/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/mantis_evalkit/lib/python3.10/site-packages/nvidia/cusparse/lib/__pycache__/__init__.cpython-310.pyc b/mantis_evalkit/lib/python3.10/site-packages/nvidia/cusparse/lib/__pycache__/__init__.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c5f560cf9229e2b8ccaeb13af2bbdb783e230906 Binary files /dev/null and b/mantis_evalkit/lib/python3.10/site-packages/nvidia/cusparse/lib/__pycache__/__init__.cpython-310.pyc differ diff --git a/mantis_evalkit/lib/python3.10/site-packages/pyarrow/libparquet.so.1900 b/mantis_evalkit/lib/python3.10/site-packages/pyarrow/libparquet.so.1900 new file mode 100644 index 0000000000000000000000000000000000000000..aaa6e169412954392e1cfd889ce4fbd7e481b359 --- /dev/null +++ b/mantis_evalkit/lib/python3.10/site-packages/pyarrow/libparquet.so.1900 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:29a91ba2fa32a9aa91c4c71bf78db4eecb7c19487cb2a5af7a027a2ec4b1fc00 +size 11105000 diff --git a/moondream/lib/python3.10/site-packages/gradio/__pycache__/chat_interface.cpython-310.pyc b/moondream/lib/python3.10/site-packages/gradio/__pycache__/chat_interface.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f9fc6cb0f008bc962f68309ab3da222cd9ae8a96 Binary files /dev/null and b/moondream/lib/python3.10/site-packages/gradio/__pycache__/chat_interface.cpython-310.pyc differ diff --git a/moondream/lib/python3.10/site-packages/gradio/__pycache__/component_meta.cpython-310.pyc b/moondream/lib/python3.10/site-packages/gradio/__pycache__/component_meta.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a9593b0a38b7fd5a59098d69f8ca65d0132d2454 Binary files /dev/null and b/moondream/lib/python3.10/site-packages/gradio/__pycache__/component_meta.cpython-310.pyc differ diff --git a/moondream/lib/python3.10/site-packages/gradio/__pycache__/context.cpython-310.pyc b/moondream/lib/python3.10/site-packages/gradio/__pycache__/context.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ca00aae7faff48514bf3abd0fe3646f62d73394f Binary files /dev/null and b/moondream/lib/python3.10/site-packages/gradio/__pycache__/context.cpython-310.pyc differ diff --git a/moondream/lib/python3.10/site-packages/gradio/__pycache__/exceptions.cpython-310.pyc b/moondream/lib/python3.10/site-packages/gradio/__pycache__/exceptions.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..640b7cb0cd5f795378187741c53bf9323c454821 Binary files /dev/null and b/moondream/lib/python3.10/site-packages/gradio/__pycache__/exceptions.cpython-310.pyc differ diff --git a/moondream/lib/python3.10/site-packages/gradio/__pycache__/external.cpython-310.pyc b/moondream/lib/python3.10/site-packages/gradio/__pycache__/external.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f568e2587280b270ec55ee678655e025bbf426df Binary files /dev/null and b/moondream/lib/python3.10/site-packages/gradio/__pycache__/external.cpython-310.pyc differ diff --git a/moondream/lib/python3.10/site-packages/gradio/__pycache__/flagging.cpython-310.pyc b/moondream/lib/python3.10/site-packages/gradio/__pycache__/flagging.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..311d884aecfeaedd0a3fbcd7886d56c14d9bed51 Binary files /dev/null and b/moondream/lib/python3.10/site-packages/gradio/__pycache__/flagging.cpython-310.pyc differ diff --git a/moondream/lib/python3.10/site-packages/gradio/__pycache__/helpers.cpython-310.pyc b/moondream/lib/python3.10/site-packages/gradio/__pycache__/helpers.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..43ec9f64fc213ecbc908402d676e5ce8ef6f5aaa Binary files /dev/null and b/moondream/lib/python3.10/site-packages/gradio/__pycache__/helpers.cpython-310.pyc differ diff --git a/moondream/lib/python3.10/site-packages/gradio/__pycache__/image_utils.cpython-310.pyc b/moondream/lib/python3.10/site-packages/gradio/__pycache__/image_utils.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..23bd5ed28b910d28e6e5f2a82407b10f31799e6d Binary files /dev/null and b/moondream/lib/python3.10/site-packages/gradio/__pycache__/image_utils.cpython-310.pyc differ diff --git a/moondream/lib/python3.10/site-packages/gradio/__pycache__/interface.cpython-310.pyc b/moondream/lib/python3.10/site-packages/gradio/__pycache__/interface.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5831fff08b1d2a98a1b6afb2f705afd873ef655c Binary files /dev/null and b/moondream/lib/python3.10/site-packages/gradio/__pycache__/interface.cpython-310.pyc differ diff --git a/moondream/lib/python3.10/site-packages/gradio/__pycache__/ipython_ext.cpython-310.pyc b/moondream/lib/python3.10/site-packages/gradio/__pycache__/ipython_ext.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5a6c2d3ee318ce544554141aeeb2c3e2e24e3bf7 Binary files /dev/null and b/moondream/lib/python3.10/site-packages/gradio/__pycache__/ipython_ext.cpython-310.pyc differ diff --git a/moondream/lib/python3.10/site-packages/gradio/__pycache__/monitoring_dashboard.cpython-310.pyc b/moondream/lib/python3.10/site-packages/gradio/__pycache__/monitoring_dashboard.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6dc48af1965684e2b2a3ddb70d75a822b2b06e29 Binary files /dev/null and b/moondream/lib/python3.10/site-packages/gradio/__pycache__/monitoring_dashboard.cpython-310.pyc differ diff --git a/moondream/lib/python3.10/site-packages/gradio/__pycache__/networking.cpython-310.pyc b/moondream/lib/python3.10/site-packages/gradio/__pycache__/networking.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6319a6985829ae95cd647db080540f0a906a7b42 Binary files /dev/null and b/moondream/lib/python3.10/site-packages/gradio/__pycache__/networking.cpython-310.pyc differ diff --git a/moondream/lib/python3.10/site-packages/gradio/__pycache__/oauth.cpython-310.pyc b/moondream/lib/python3.10/site-packages/gradio/__pycache__/oauth.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ee6005b0e4ef0be50d95262128b28d84a3e0c6c2 Binary files /dev/null and b/moondream/lib/python3.10/site-packages/gradio/__pycache__/oauth.cpython-310.pyc differ diff --git a/moondream/lib/python3.10/site-packages/gradio/__pycache__/pipelines.cpython-310.pyc b/moondream/lib/python3.10/site-packages/gradio/__pycache__/pipelines.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d89e0ee7d24cb1a24960d1a2f499bb3a787e9483 Binary files /dev/null and b/moondream/lib/python3.10/site-packages/gradio/__pycache__/pipelines.cpython-310.pyc differ diff --git a/moondream/lib/python3.10/site-packages/gradio/__pycache__/pipelines_utils.cpython-310.pyc b/moondream/lib/python3.10/site-packages/gradio/__pycache__/pipelines_utils.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..72c535d5b4e1f6e8ee39efb897f73553f56aa8fd Binary files /dev/null and b/moondream/lib/python3.10/site-packages/gradio/__pycache__/pipelines_utils.cpython-310.pyc differ diff --git a/moondream/lib/python3.10/site-packages/gradio/__pycache__/processing_utils.cpython-310.pyc b/moondream/lib/python3.10/site-packages/gradio/__pycache__/processing_utils.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3482c2e28dab59e1e29554b9843acaf2d24d4f63 Binary files /dev/null and b/moondream/lib/python3.10/site-packages/gradio/__pycache__/processing_utils.cpython-310.pyc differ diff --git a/moondream/lib/python3.10/site-packages/gradio/__pycache__/renderable.cpython-310.pyc b/moondream/lib/python3.10/site-packages/gradio/__pycache__/renderable.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8faaa853aae1afb650fa7c2f11632a21a4be0e47 Binary files /dev/null and b/moondream/lib/python3.10/site-packages/gradio/__pycache__/renderable.cpython-310.pyc differ diff --git a/moondream/lib/python3.10/site-packages/gradio/__pycache__/route_utils.cpython-310.pyc b/moondream/lib/python3.10/site-packages/gradio/__pycache__/route_utils.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..df9df54fe26ffd76740b2835f0d1e0bd7725d39b Binary files /dev/null and b/moondream/lib/python3.10/site-packages/gradio/__pycache__/route_utils.cpython-310.pyc differ diff --git a/moondream/lib/python3.10/site-packages/gradio/__pycache__/strings.cpython-310.pyc b/moondream/lib/python3.10/site-packages/gradio/__pycache__/strings.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..274637a535392c5e377c2915baf09dee2f5a2344 Binary files /dev/null and b/moondream/lib/python3.10/site-packages/gradio/__pycache__/strings.cpython-310.pyc differ diff --git a/moondream/lib/python3.10/site-packages/gradio/__pycache__/templates.cpython-310.pyc b/moondream/lib/python3.10/site-packages/gradio/__pycache__/templates.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..18060e4117c8deb67c960b43dae2acca4b1e89fa Binary files /dev/null and b/moondream/lib/python3.10/site-packages/gradio/__pycache__/templates.cpython-310.pyc differ diff --git a/moondream/lib/python3.10/site-packages/gradio/__pycache__/utils.cpython-310.pyc b/moondream/lib/python3.10/site-packages/gradio/__pycache__/utils.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9202c3400c8bdf4d4fd1fbbb4dd6e2516d048b1e Binary files /dev/null and b/moondream/lib/python3.10/site-packages/gradio/__pycache__/utils.cpython-310.pyc differ diff --git a/moondream/lib/python3.10/site-packages/gradio/__pycache__/wasm_utils.cpython-310.pyc b/moondream/lib/python3.10/site-packages/gradio/__pycache__/wasm_utils.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..61b27d4387f945368c971582293f824e90898d85 Binary files /dev/null and b/moondream/lib/python3.10/site-packages/gradio/__pycache__/wasm_utils.cpython-310.pyc differ diff --git a/moondream/lib/python3.10/site-packages/gradio/layouts/__pycache__/__init__.cpython-310.pyc b/moondream/lib/python3.10/site-packages/gradio/layouts/__pycache__/__init__.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a192319cfefa94e8e1326a45c43fbb08a560ef55 Binary files /dev/null and b/moondream/lib/python3.10/site-packages/gradio/layouts/__pycache__/__init__.cpython-310.pyc differ diff --git a/moondream/lib/python3.10/site-packages/gradio/layouts/__pycache__/column.cpython-310.pyc b/moondream/lib/python3.10/site-packages/gradio/layouts/__pycache__/column.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..fecb4dbe50b4df8c697e18456ee3559bb052fa4a Binary files /dev/null and b/moondream/lib/python3.10/site-packages/gradio/layouts/__pycache__/column.cpython-310.pyc differ diff --git a/moondream/lib/python3.10/site-packages/gradio/layouts/__pycache__/form.cpython-310.pyc b/moondream/lib/python3.10/site-packages/gradio/layouts/__pycache__/form.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f1f66d7f55d308f97a7ab785db97d20f4173071a Binary files /dev/null and b/moondream/lib/python3.10/site-packages/gradio/layouts/__pycache__/form.cpython-310.pyc differ diff --git a/moondream/lib/python3.10/site-packages/gradio/layouts/__pycache__/group.cpython-310.pyc b/moondream/lib/python3.10/site-packages/gradio/layouts/__pycache__/group.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9525ebc0c254feb3e375bd02a2e167dd50b889a5 Binary files /dev/null and b/moondream/lib/python3.10/site-packages/gradio/layouts/__pycache__/group.cpython-310.pyc differ diff --git a/moondream/lib/python3.10/site-packages/gradio/layouts/__pycache__/tabs.cpython-310.pyc b/moondream/lib/python3.10/site-packages/gradio/layouts/__pycache__/tabs.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..86899c187e554725a2d3e72fd1064719857dbf57 Binary files /dev/null and b/moondream/lib/python3.10/site-packages/gradio/layouts/__pycache__/tabs.cpython-310.pyc differ diff --git a/moondream/lib/python3.10/site-packages/gradio/layouts/column.pyi b/moondream/lib/python3.10/site-packages/gradio/layouts/column.pyi new file mode 100644 index 0000000000000000000000000000000000000000..737f5030eaf66f047cdecb38be131d3b0d0b309a --- /dev/null +++ b/moondream/lib/python3.10/site-packages/gradio/layouts/column.pyi @@ -0,0 +1,72 @@ +from __future__ import annotations + +import warnings +from typing import Literal + +from gradio_client.documentation import document + +from gradio.blocks import BlockContext +from gradio.component_meta import ComponentMeta + +from gradio.events import Dependency + +@document() +class Column(BlockContext, metaclass=ComponentMeta): + """ + Column is a layout element within Blocks that renders all children vertically. The widths of columns can be set through the `scale` and `min_width` parameters. + If a certain scale results in a column narrower than min_width, the min_width parameter will win. + Example: + with gr.Blocks() as demo: + with gr.Row(): + with gr.Column(scale=1): + text1 = gr.Textbox() + text2 = gr.Textbox() + with gr.Column(scale=4): + btn1 = gr.Button("Button 1") + btn2 = gr.Button("Button 2") + Guides: controlling-layout + """ + + EVENTS = [] + + def __init__( + self, + *, + scale: int = 1, + min_width: int = 320, + variant: Literal["default", "panel", "compact"] = "default", + visible: bool = True, + elem_id: str | None = None, + elem_classes: list[str] | str | None = None, + render: bool = True, + show_progress: bool = False, + ): + """ + Parameters: + scale: relative width compared to adjacent Columns. For example, if Column A has scale=2, and Column B has scale=1, A will be twice as wide as B. + min_width: minimum pixel width of Column, will wrap if not sufficient screen space to satisfy this value. If a certain scale value results in a column narrower than min_width, the min_width parameter will be respected first. + variant: column type, 'default' (no background), 'panel' (gray background color and rounded corners), or 'compact' (rounded corners and no internal gap). + visible: If False, column will be hidden. + elem_id: An optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles. + elem_classes: An optional string or list of strings that are assigned as the class of this component in the HTML DOM. Can be used for targeting CSS styles. + render: If False, component will not render be rendered in the Blocks context. Should be used if the intention is to assign event listeners now but render the component later. + show_progress: If True, shows progress animation when being updated. + """ + if scale != round(scale): + warnings.warn( + f"'scale' value should be an integer. Using {scale} will cause issues." + ) + + self.scale = scale + self.min_width = min_width + self.variant = variant + if variant == "compact": + self.allow_expected_parents = False + self.show_progress = show_progress + BlockContext.__init__( + self, + visible=visible, + elem_id=elem_id, + elem_classes=elem_classes, + render=render, + ) \ No newline at end of file diff --git a/moondream/lib/python3.10/site-packages/gradio/layouts/form.py b/moondream/lib/python3.10/site-packages/gradio/layouts/form.py new file mode 100644 index 0000000000000000000000000000000000000000..e16283686ff2311c71fa5232d261c3d457a5e3a0 --- /dev/null +++ b/moondream/lib/python3.10/site-packages/gradio/layouts/form.py @@ -0,0 +1,44 @@ +from __future__ import annotations + +from typing import TYPE_CHECKING + +from gradio.blocks import BlockContext, Blocks +from gradio.component_meta import ComponentMeta +from gradio.layouts.row import Row + +if TYPE_CHECKING: + from gradio.blocks import Block + + +class Form(BlockContext, metaclass=ComponentMeta): + EVENTS = [] + + def __init__( + self, + *, + scale: int = 0, + min_width: int = 0, + render: bool = True, + ): + """ + Parameters: + scale: relative width compared to adjacent Columns. For example, if Column A has scale=2, and Column B has scale=1, A will be twice as wide as B. + min_width: minimum pixel width of Column, will wrap if not sufficient screen space to satisfy this value. If a certain scale value results in a column narrower than min_width, the min_width parameter will be respected first. + render: If False, this layout will not be rendered in the Blocks context. Should be used if the intention is to assign event listeners now but render the component later. + """ + self.scale = scale + self.min_width = min_width + BlockContext.__init__( + self, + render=render, + ) + + def add_child(self, child: Block): + if isinstance(self.parent, Row): + scale = getattr(child, "scale", None) + self.scale += 1 if scale is None else scale + self.min_width += getattr(child, "min_width", 0) or 0 + elif isinstance(self.parent, Blocks) and self.parent.fill_height: + scale = getattr(child, "scale", None) + self.scale += 0 if scale is None else scale + BlockContext.add_child(self, child) diff --git a/moondream/lib/python3.10/site-packages/gradio/templates/frontend/assets/Example-CRm1Pmw_.js b/moondream/lib/python3.10/site-packages/gradio/templates/frontend/assets/Example-CRm1Pmw_.js new file mode 100644 index 0000000000000000000000000000000000000000..c98744a05ad7152e2b61f57b90745d8a06b2b26d --- /dev/null +++ b/moondream/lib/python3.10/site-packages/gradio/templates/frontend/assets/Example-CRm1Pmw_.js @@ -0,0 +1,2 @@ +const{SvelteComponent:g,attr:o,detach:_,element:m,flush:c,init:y,insert:v,noop:h,safe_not_equal:b,toggle_class:n}=window.__gradio__svelte__internal;function x(i){let e;return{c(){e=m("div"),e.textContent=`${i[2]}`,o(e,"class","svelte-1ayixqk"),n(e,"table",i[0]==="table"),n(e,"gallery",i[0]==="gallery"),n(e,"selected",i[1])},m(t,s){v(t,e,s)},p(t,[s]){s&1&&n(e,"table",t[0]==="table"),s&1&&n(e,"gallery",t[0]==="gallery"),s&2&&n(e,"selected",t[1])},i:h,o:h,d(t){t&&_(e)}}}function q(i,e,t){let{value:s}=e,{type:u}=e,{selected:f=!1}=e,{choices:a}=e,r=s.map(l=>a.find(d=>d[1]===l)?.[0]).filter(l=>l!==void 0).join(", ");return i.$$set=l=>{"value"in l&&t(3,s=l.value),"type"in l&&t(0,u=l.type),"selected"in l&&t(1,f=l.selected),"choices"in l&&t(4,a=l.choices)},[u,f,r,s,a]}class C extends g{constructor(e){super(),y(this,e,q,x,b,{value:3,type:0,selected:1,choices:4})}get value(){return this.$$.ctx[3]}set value(e){this.$$set({value:e}),c()}get type(){return this.$$.ctx[0]}set type(e){this.$$set({type:e}),c()}get selected(){return this.$$.ctx[1]}set selected(e){this.$$set({selected:e}),c()}get choices(){return this.$$.ctx[4]}set choices(e){this.$$set({choices:e}),c()}}export{C as default}; +//# sourceMappingURL=Example-CRm1Pmw_.js.map diff --git a/moondream/lib/python3.10/site-packages/gradio/templates/frontend/assets/Example-CUwox43B.js b/moondream/lib/python3.10/site-packages/gradio/templates/frontend/assets/Example-CUwox43B.js new file mode 100644 index 0000000000000000000000000000000000000000..1fb28fe2bcf194fbc7c822bdd1394b7e5771dbc6 --- /dev/null +++ b/moondream/lib/python3.10/site-packages/gradio/templates/frontend/assets/Example-CUwox43B.js @@ -0,0 +1,2 @@ +const{SvelteComponent:g,attr:o,detach:y,element:_,flush:n,init:v,insert:m,noop:f,safe_not_equal:b,toggle_class:a}=window.__gradio__svelte__internal;function x(i){let e;return{c(){e=_("div"),e.textContent=`${i[2]}`,o(e,"class","svelte-1ayixqk"),a(e,"table",i[0]==="table"),a(e,"gallery",i[0]==="gallery"),a(e,"selected",i[1])},m(t,l){m(t,e,l)},p(t,[l]){l&1&&a(e,"table",t[0]==="table"),l&1&&a(e,"gallery",t[0]==="gallery"),l&2&&a(e,"selected",t[1])},i:f,o:f,d(t){t&&y(e)}}}function q(i,e,t){let{value:l}=e,{type:r}=e,{selected:u=!1}=e,{choices:c}=e,h=(l?Array.isArray(l)?l:[l]:[]).map(s=>c.find(d=>d[1]===s)?.[0]).filter(s=>s!==void 0).join(", ");return i.$$set=s=>{"value"in s&&t(3,l=s.value),"type"in s&&t(0,r=s.type),"selected"in s&&t(1,u=s.selected),"choices"in s&&t(4,c=s.choices)},[r,u,h,l,c]}class C extends g{constructor(e){super(),v(this,e,q,x,b,{value:3,type:0,selected:1,choices:4})}get value(){return this.$$.ctx[3]}set value(e){this.$$set({value:e}),n()}get type(){return this.$$.ctx[0]}set type(e){this.$$set({type:e}),n()}get selected(){return this.$$.ctx[1]}set selected(e){this.$$set({selected:e}),n()}get choices(){return this.$$.ctx[4]}set choices(e){this.$$set({choices:e}),n()}}export{C as default}; +//# sourceMappingURL=Example-CUwox43B.js.map diff --git a/moondream/lib/python3.10/site-packages/gradio/templates/frontend/assets/Index-BrtrebwU.css b/moondream/lib/python3.10/site-packages/gradio/templates/frontend/assets/Index-BrtrebwU.css new file mode 100644 index 0000000000000000000000000000000000000000..9996e97796dad6ecb67b0c569b1f02443fb83ccd --- /dev/null +++ b/moondream/lib/python3.10/site-packages/gradio/templates/frontend/assets/Index-BrtrebwU.css @@ -0,0 +1 @@ +.wrap.svelte-1sc8eck{display:flex;flex-direction:column;flex-flow:column;margin:0;padding:0;height:100%}.codemirror-wrapper.svelte-1sc8eck{height:100%;overflow:auto}.cm-editor{height:100%}.cm-selectionBackground{background-color:#b9d2ff30!important}.cm-focused{outline:none!important}button.svelte-qi7jcw{position:relative;cursor:pointer;padding:5px;width:22px;height:22px}.check.svelte-qi7jcw{position:absolute;top:0;right:0;z-index:var(--layer-top);background:var(--background-fill-primary);padding:var(--size-1);width:100%;height:100%;color:var(--body-text-color)}.container.svelte-1vwgyfd{position:relative;cursor:pointer;padding:5px;width:22px;height:22px}.check.svelte-1vwgyfd{position:absolute;top:0;right:0;z-index:var(--layer-top);background:var(--background-fill-primary);padding:var(--size-1);width:100%;height:100%;color:var(--body-text-color)}div.svelte-1yin446{display:flex;position:absolute;top:var(--block-label-margin);right:var(--block-label-margin);align-items:center;z-index:var(--layer-2);transition:.15s;box-shadow:var(--shadow-drop);border:1px solid var(--border-color-primary);border-top:none;border-right:none;border-radius:var(--block-label-right-radius);background:var(--block-label-background-fill);overflow:hidden;color:var(--block-label-text-color);font:var(--font);font-size:var(--button-small-text-size)} diff --git a/moondream/lib/python3.10/site-packages/gradio/templates/frontend/assets/Index-Ccnoqff9.css b/moondream/lib/python3.10/site-packages/gradio/templates/frontend/assets/Index-Ccnoqff9.css new file mode 100644 index 0000000000000000000000000000000000000000..008c67e6d34e709264aafa9cbadd452824b76355 --- /dev/null +++ b/moondream/lib/python3.10/site-packages/gradio/templates/frontend/assets/Index-Ccnoqff9.css @@ -0,0 +1 @@ +.gradio-container-4-38-1{display:flex;position:relative;flex-direction:column;padding:0;min-height:1px;overflow:hidden;color:var(--button-secondary-text-color)}.embed-container.svelte-182fdeq.svelte-182fdeq{margin:var(--size-4) 0px;border:1px solid var(--button-secondary-border-color);border-radius:var(--embed-radius)}.with-info.svelte-182fdeq.svelte-182fdeq{padding-bottom:var(--size-7)}.embed-container.svelte-182fdeq>.main.svelte-182fdeq{padding:var(--size-4)}.app.svelte-182fdeq>.main.svelte-182fdeq{display:flex;flex-grow:1;flex-direction:column}.app.svelte-182fdeq.svelte-182fdeq{position:relative;margin:auto;padding:var(--size-4) var(--size-8);width:100%;height:100%}@media (min-width: 640px){.app.svelte-182fdeq.svelte-182fdeq{max-width:640px}}@media (min-width: 768px){.app.svelte-182fdeq.svelte-182fdeq{max-width:768px}}@media (min-width: 1024px){.app.svelte-182fdeq.svelte-182fdeq{max-width:1024px}}@media (min-width: 1280px){.app.svelte-182fdeq.svelte-182fdeq{max-width:1280px}}@media (min-width: 1536px){.app.svelte-182fdeq.svelte-182fdeq{max-width:1536px}}.info.svelte-182fdeq.svelte-182fdeq{display:flex;position:absolute;bottom:0;justify-content:flex-start;border-top:1px solid var(--button-secondary-border-color);padding:var(--size-1) var(--size-5);width:100%;color:var(--body-text-color-subdued);font-size:var(--text-md);white-space:nowrap}.info.svelte-182fdeq>span.svelte-182fdeq{word-wrap:break-word;-break:keep-all;display:block;word-break:keep-all}.info.svelte-182fdeq>span.svelte-182fdeq:nth-child(1){margin-right:4px;min-width:0px;max-width:max-content;overflow:hidden;color:var(--body-text-color);text-overflow:ellipsis;white-space:nowrap}.info.svelte-182fdeq>span.svelte-182fdeq:nth-child(2){margin-right:3px}.info.svelte-182fdeq>span.svelte-182fdeq:nth-child(2),.info.svelte-182fdeq>span.svelte-182fdeq:nth-child(3){width:max-content}.info.svelte-182fdeq>span.svelte-182fdeq:nth-child(3){align-self:flex-end;justify-self:flex-end;margin-left:auto;text-align:right}.info.svelte-182fdeq>span.svelte-182fdeq:nth-child(1){flex-shrink:9}.hidden-title.svelte-182fdeq.svelte-182fdeq{position:absolute;left:var(--size-5);opacity:0;background:var(--button-secondary-background-fill);padding-right:4px}.info.svelte-182fdeq a.svelte-182fdeq{color:var(--body-text-color)}.title.svelte-182fdeq.svelte-182fdeq{font-size:var(--text-sm);font-family:var(--font-mono)}.hf.svelte-182fdeq.svelte-182fdeq{margin-left:5px}.space-logo.svelte-182fdeq img.svelte-182fdeq{display:inline-block;margin-bottom:4px;height:12px}a.svelte-182fdeq.svelte-182fdeq:hover{text-decoration:underline}svg.svelte-zyxd38.svelte-zyxd38{width:var(--size-20);height:var(--size-20)}svg.svelte-zyxd38 path.svelte-zyxd38{fill:var(--loader-color)}div.svelte-zyxd38.svelte-zyxd38{z-index:var(--layer-2)}.margin.svelte-zyxd38.svelte-zyxd38{margin:var(--size-4)}.block.svelte-12cmxck{position:relative;margin:0;box-shadow:var(--block-shadow);border-width:var(--block-border-width);border-color:var(--block-border-color);border-radius:var(--block-radius);background:var(--block-background-fill);width:100%;line-height:var(--line-sm)}.block.border_focus.svelte-12cmxck{border-color:var(--color-accent)}.block.border_contrast.svelte-12cmxck{border-color:var(--body-text-color)}.padded.svelte-12cmxck{padding:var(--block-padding)}.hidden.svelte-12cmxck{display:none}.hide-container.svelte-12cmxck{margin:0;box-shadow:none;--block-border-width:0;background:transparent;padding:0;overflow:visible}div.svelte-e8n7p6{margin-bottom:var(--spacing-lg);color:var(--block-info-text-color);font-weight:var(--block-info-text-weight);font-size:var(--block-info-text-size);line-height:var(--line-sm)}span.has-info.svelte-1gfkn6j{margin-bottom:var(--spacing-xs)}span.svelte-1gfkn6j:not(.has-info){margin-bottom:var(--spacing-lg)}span.svelte-1gfkn6j{display:inline-block;position:relative;z-index:var(--layer-4);border:solid var(--block-title-border-width) var(--block-title-border-color);border-radius:var(--block-title-radius);background:var(--block-title-background-fill);padding:var(--block-title-padding);color:var(--block-title-text-color);font-weight:var(--block-title-text-weight);font-size:var(--block-title-text-size);line-height:var(--line-sm)}.hide.svelte-1gfkn6j{margin:0;height:0}label.svelte-1b6s6s{display:inline-flex;align-items:center;z-index:var(--layer-2);box-shadow:var(--block-label-shadow);border:var(--block-label-border-width) solid var(--border-color-primary);border-top:none;border-left:none;border-radius:var(--block-label-radius);background:var(--block-label-background-fill);padding:var(--block-label-padding);pointer-events:none;color:var(--block-label-text-color);font-weight:var(--block-label-text-weight);font-size:var(--block-label-text-size);line-height:var(--line-sm)}.gr-group label.svelte-1b6s6s{border-top-left-radius:0}label.float.svelte-1b6s6s{position:absolute;top:var(--block-label-margin);left:var(--block-label-margin)}label.svelte-1b6s6s:not(.float){position:static;margin-top:var(--block-label-margin);margin-left:var(--block-label-margin)}.hide.svelte-1b6s6s{height:0}span.svelte-1b6s6s{opacity:.8;margin-right:var(--size-2);width:calc(var(--block-label-text-size) - 1px);height:calc(var(--block-label-text-size) - 1px)}.hide-label.svelte-1b6s6s{box-shadow:none;border-width:0;background:transparent;overflow:visible}button.svelte-rk35yg{display:flex;justify-content:center;align-items:center;gap:1px;z-index:var(--layer-2);border-radius:var(--radius-sm);color:var(--block-label-text-color);border:1px solid transparent}button[disabled].svelte-rk35yg{opacity:.5;box-shadow:none}button[disabled].svelte-rk35yg:hover{cursor:not-allowed}.padded.svelte-rk35yg{padding:2px;background:var(--bg-color);box-shadow:var(--shadow-drop);border:1px solid var(--button-secondary-border-color)}button.svelte-rk35yg:hover,button.highlight.svelte-rk35yg{cursor:pointer;color:var(--color-accent)}.padded.svelte-rk35yg:hover{border:2px solid var(--button-secondary-border-color-hover);padding:1px;color:var(--block-label-text-color)}span.svelte-rk35yg{padding:0 1px;font-size:10px}div.svelte-rk35yg{padding:2px;display:flex;align-items:flex-end}.small.svelte-rk35yg{width:14px;height:14px}.medium.svelte-rk35yg{width:20px;height:20px}.large.svelte-rk35yg{width:22px;height:22px}.pending.svelte-rk35yg{animation:svelte-rk35yg-flash .5s infinite}@keyframes svelte-rk35yg-flash{0%{opacity:.5}50%{opacity:1}to{opacity:.5}}.transparent.svelte-rk35yg{background:transparent;border:none;box-shadow:none}.empty.svelte-1oiin9d{display:flex;justify-content:center;align-items:center;margin-top:calc(0px - var(--size-6));height:var(--size-full)}.icon.svelte-1oiin9d{opacity:.5;height:var(--size-5);color:var(--body-text-color)}.small.svelte-1oiin9d{min-height:calc(var(--size-32) - 20px)}.large.svelte-1oiin9d{min-height:calc(var(--size-64) - 20px)}.unpadded_box.svelte-1oiin9d{margin-top:0}.small_parent.svelte-1oiin9d{min-height:100%!important}.dropdown-arrow.svelte-xjn76a{fill:currentColor}.wrap.svelte-b0hvie{display:flex;flex-direction:column;justify-content:center;align-items:center;min-height:var(--size-60);color:var(--block-label-text-color);line-height:var(--line-md);height:100%;padding-top:var(--size-3)}.or.svelte-b0hvie{color:var(--body-text-color-subdued);display:flex}.icon-wrap.svelte-b0hvie{width:30px;margin-bottom:var(--spacing-lg)}@media (min-width: 768px){.wrap.svelte-b0hvie{font-size:var(--text-lg)}}.hovered.svelte-b0hvie{color:var(--color-accent)}div.svelte-1ua59x3{border-top:1px solid transparent;display:flex;max-height:100%;justify-content:center;align-items:center;gap:var(--spacing-sm);height:auto;align-items:flex-end;color:var(--block-label-text-color);flex-shrink:0}.show_border.svelte-1ua59x3{border-top:1px solid var(--block-border-color);margin-top:var(--spacing-xxl);box-shadow:var(--shadow-drop)}.source-selection.svelte-1ebruwp{display:flex;align-items:center;justify-content:center;border-top:1px solid var(--border-color-primary);width:95%;bottom:0;left:0;right:0;margin-left:auto;margin-right:auto}.icon.svelte-1ebruwp{width:22px;height:22px;margin:var(--spacing-lg) var(--spacing-xs);padding:var(--spacing-xs);color:var(--neutral-400);border-radius:var(--radius-md)}.selected.svelte-1ebruwp{color:var(--color-accent)}.icon.svelte-1ebruwp:hover,.icon.svelte-1ebruwp:focus{color:var(--color-accent)}.wrap.svelte-au1olv.svelte-au1olv{display:flex;flex-direction:column;justify-content:center;align-items:center;z-index:var(--layer-2);transition:opacity .1s ease-in-out;border-radius:var(--block-radius);background:var(--block-background-fill);padding:0 var(--size-6);max-height:var(--size-screen-h);overflow:hidden}.wrap.center.svelte-au1olv.svelte-au1olv{top:0;right:0;left:0}.wrap.default.svelte-au1olv.svelte-au1olv{inset:0}.hide.svelte-au1olv.svelte-au1olv{opacity:0;pointer-events:none}.generating.svelte-au1olv.svelte-au1olv{animation:svelte-au1olv-pulseStart 1s cubic-bezier(.4,0,.6,1),svelte-au1olv-pulse 2s cubic-bezier(.4,0,.6,1) 1s infinite;border:2px solid var(--color-accent);background:transparent;z-index:var(--layer-1);pointer-events:none}.translucent.svelte-au1olv.svelte-au1olv{background:none}@keyframes svelte-au1olv-pulseStart{0%{opacity:0}to{opacity:1}}@keyframes svelte-au1olv-pulse{0%,to{opacity:1}50%{opacity:.5}}.loading.svelte-au1olv.svelte-au1olv{z-index:var(--layer-2);color:var(--body-text-color)}.eta-bar.svelte-au1olv.svelte-au1olv{position:absolute;inset:0;transform-origin:left;opacity:.8;z-index:var(--layer-1);transition:10ms;background:var(--background-fill-secondary)}.progress-bar-wrap.svelte-au1olv.svelte-au1olv{border:1px solid var(--border-color-primary);background:var(--background-fill-primary);width:55.5%;height:var(--size-4)}.progress-bar.svelte-au1olv.svelte-au1olv{transform-origin:left;background-color:var(--loader-color);width:var(--size-full);height:var(--size-full)}.progress-level.svelte-au1olv.svelte-au1olv{display:flex;flex-direction:column;align-items:center;gap:1;z-index:var(--layer-2);width:var(--size-full)}.progress-level-inner.svelte-au1olv.svelte-au1olv{margin:var(--size-2) auto;color:var(--body-text-color);font-size:var(--text-sm);font-family:var(--font-mono)}.meta-text.svelte-au1olv.svelte-au1olv{position:absolute;top:0;right:0;z-index:var(--layer-2);padding:var(--size-1) var(--size-2);font-size:var(--text-sm);font-family:var(--font-mono)}.meta-text-center.svelte-au1olv.svelte-au1olv{display:flex;position:absolute;top:0;right:0;justify-content:center;align-items:center;transform:translateY(var(--size-6));z-index:var(--layer-2);padding:var(--size-1) var(--size-2);font-size:var(--text-sm);font-family:var(--font-mono);text-align:center}.error.svelte-au1olv.svelte-au1olv{box-shadow:var(--shadow-drop);border:solid 1px var(--error-border-color);border-radius:var(--radius-full);background:var(--error-background-fill);padding-right:var(--size-4);padding-left:var(--size-4);color:var(--error-text-color);font-weight:var(--weight-semibold);font-size:var(--text-lg);line-height:var(--line-lg);font-family:var(--font)}.minimal.svelte-au1olv.svelte-au1olv{pointer-events:none}.minimal.svelte-au1olv .progress-text.svelte-au1olv{background:var(--block-background-fill)}.border.svelte-au1olv.svelte-au1olv{border:1px solid var(--border-color-primary)}.clear-status.svelte-au1olv.svelte-au1olv{position:absolute;display:flex;top:var(--size-2);right:var(--size-2);justify-content:flex-end;gap:var(--spacing-sm);z-index:var(--layer-1)}.toast-body.svelte-1qox6b6{display:flex;position:relative;right:0;left:0;align-items:center;margin:var(--size-6) var(--size-4);margin:auto;border-radius:var(--container-radius);overflow:hidden;pointer-events:auto}.toast-body.error.svelte-1qox6b6{border:1px solid var(--color-red-700);background:var(--color-red-50)}.dark .toast-body.error.svelte-1qox6b6{border:1px solid var(--color-red-500);background-color:var(--color-grey-950)}.toast-body.warning.svelte-1qox6b6{border:1px solid var(--color-yellow-700);background:var(--color-yellow-50)}.dark .toast-body.warning.svelte-1qox6b6{border:1px solid var(--color-yellow-500);background-color:var(--color-grey-950)}.toast-body.info.svelte-1qox6b6{border:1px solid var(--color-grey-700);background:var(--color-grey-50)}.dark .toast-body.info.svelte-1qox6b6{border:1px solid var(--color-grey-500);background-color:var(--color-grey-950)}.toast-title.svelte-1qox6b6{display:flex;align-items:center;font-weight:var(--weight-bold);font-size:var(--text-lg);line-height:var(--line-sm);text-transform:capitalize}.toast-title.error.svelte-1qox6b6{color:var(--color-red-700)}.dark .toast-title.error.svelte-1qox6b6{color:var(--color-red-50)}.toast-title.warning.svelte-1qox6b6{color:var(--color-yellow-700)}.dark .toast-title.warning.svelte-1qox6b6{color:var(--color-yellow-50)}.toast-title.info.svelte-1qox6b6{color:var(--color-grey-700)}.dark .toast-title.info.svelte-1qox6b6{color:var(--color-grey-50)}.toast-close.svelte-1qox6b6{margin:0 var(--size-3);border-radius:var(--size-3);padding:0px var(--size-1-5);font-size:var(--size-5);line-height:var(--size-5)}.toast-close.error.svelte-1qox6b6{color:var(--color-red-700)}.dark .toast-close.error.svelte-1qox6b6{color:var(--color-red-500)}.toast-close.warning.svelte-1qox6b6{color:var(--color-yellow-700)}.dark .toast-close.warning.svelte-1qox6b6{color:var(--color-yellow-500)}.toast-close.info.svelte-1qox6b6{color:var(--color-grey-700)}.dark .toast-close.info.svelte-1qox6b6{color:var(--color-grey-500)}.toast-text.svelte-1qox6b6{font-size:var(--text-lg)}.toast-text.error.svelte-1qox6b6{color:var(--color-red-700)}.dark .toast-text.error.svelte-1qox6b6{color:var(--color-red-50)}.toast-text.warning.svelte-1qox6b6{color:var(--color-yellow-700)}.dark .toast-text.warning.svelte-1qox6b6{color:var(--color-yellow-50)}.toast-text.info.svelte-1qox6b6{color:var(--color-grey-700)}.dark .toast-text.info.svelte-1qox6b6{color:var(--color-grey-50)}.toast-details.svelte-1qox6b6{margin:var(--size-3) var(--size-3) var(--size-3) 0;width:100%}.toast-icon.svelte-1qox6b6{display:flex;position:absolute;position:relative;flex-shrink:0;justify-content:center;align-items:center;margin:var(--size-2);border-radius:var(--radius-full);padding:var(--size-1);padding-left:calc(var(--size-1) - 1px);width:35px;height:35px}.toast-icon.error.svelte-1qox6b6{color:var(--color-red-700)}.dark .toast-icon.error.svelte-1qox6b6{color:var(--color-red-500)}.toast-icon.warning.svelte-1qox6b6{color:var(--color-yellow-700)}.dark .toast-icon.warning.svelte-1qox6b6{color:var(--color-yellow-500)}.toast-icon.info.svelte-1qox6b6{color:var(--color-grey-700)}.dark .toast-icon.info.svelte-1qox6b6{color:var(--color-grey-500)}@keyframes svelte-1qox6b6-countdown{0%{transform:scaleX(1)}to{transform:scaleX(0)}}.timer.svelte-1qox6b6{position:absolute;bottom:0;left:0;transform-origin:0 0;animation:svelte-1qox6b6-countdown 10s linear forwards;width:100%;height:var(--size-1)}.timer.error.svelte-1qox6b6{background:var(--color-red-700)}.dark .timer.error.svelte-1qox6b6{background:var(--color-red-500)}.timer.warning.svelte-1qox6b6{background:var(--color-yellow-700)}.dark .timer.warning.svelte-1qox6b6{background:var(--color-yellow-500)}.timer.info.svelte-1qox6b6{background:var(--color-grey-700)}.dark .timer.info.svelte-1qox6b6{background:var(--color-grey-500)}.hidden.svelte-1qox6b6{display:none}.toast-wrap.svelte-pu0yf1{display:flex;position:fixed;top:var(--size-4);right:var(--size-4);flex-direction:column;align-items:end;gap:var(--size-2);z-index:var(--layer-top);width:calc(100% - var(--size-8))}@media (min-width: 640px){.toast-wrap.svelte-pu0yf1{width:calc(var(--size-96) + var(--size-10))}}.error.svelte-y6l4b.svelte-y6l4b{position:relative;padding:var(--size-4);color:var(--body-text-color);text-align:center}.error.svelte-y6l4b>.svelte-y6l4b{margin-top:var(--size-4)}a.svelte-y6l4b.svelte-y6l4b{color:var(--link-text-color)}a.svelte-y6l4b.svelte-y6l4b:hover{color:var(--link-text-color-hover);text-decoration:underline}a.svelte-y6l4b.svelte-y6l4b:visited{color:var(--link-text-color-visited)}a.svelte-y6l4b.svelte-y6l4b:active{color:var(--link-text-color-active)} diff --git a/moondream/lib/python3.10/site-packages/gradio/templates/frontend/assets/Index-DAXYa8US.js b/moondream/lib/python3.10/site-packages/gradio/templates/frontend/assets/Index-DAXYa8US.js new file mode 100644 index 0000000000000000000000000000000000000000..50335845c8d5b16d16ea0b933028711a7ada960e --- /dev/null +++ b/moondream/lib/python3.10/site-packages/gradio/templates/frontend/assets/Index-DAXYa8US.js @@ -0,0 +1,9 @@ +import{C as Mn,S as Bn}from"./Index-HnsngA2K.js";import{u as kt,c as Nn}from"./Blocks-BW0LI6Mk.js";import{d as Zn}from"./index-CnqicUFC.js";import{S as Tn}from"./ShareButton-D7_uro_U.js";import{I as Dn}from"./Image-CI3yPJk1.js";import"./index-DfiasXCI.js";/* empty css */import"./Index.svelte_svelte_type_style_lang-B9OGLCwM.js";import{M as bt}from"./Example.svelte_svelte_type_style_lang-BBW3qUnm.js";import{C as En}from"./Check-Ck0iADAu.js";import{C as Pn}from"./Copy-ZPOKSMtK.js";import{D as Un}from"./DownloadLink-CVlM3uy0.js";import{B as In}from"./Button-DHuQQqcr.js";import{B as Fn}from"./BlockLabel-du95yTCe.js";import"./file-url-YFl-0Cl9.js";import"./svelte/svelte.js";import"./prism-python-CimghR9h.js";const{SvelteComponent:Rn,append:$t,attr:E,detach:Gn,init:On,insert:Yn,noop:lt,safe_not_equal:Jn,svg_element:it}=window.__gradio__svelte__internal;function Kn(l){let e,t,n;return{c(){e=it("svg"),t=it("path"),n=it("path"),E(t,"fill","currentColor"),E(t,"d","M17.74 30L16 29l4-7h6a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h9v2H6a4 4 0 0 1-4-4V8a4 4 0 0 1 4-4h20a4 4 0 0 1 4 4v12a4 4 0 0 1-4 4h-4.84Z"),E(n,"fill","currentColor"),E(n,"d","M8 10h16v2H8zm0 6h10v2H8z"),E(e,"xmlns","http://www.w3.org/2000/svg"),E(e,"xmlns:xlink","http://www.w3.org/1999/xlink"),E(e,"aria-hidden","true"),E(e,"role","img"),E(e,"class","iconify iconify--carbon"),E(e,"width","100%"),E(e,"height","100%"),E(e,"preserveAspectRatio","xMidYMid meet"),E(e,"viewBox","0 0 32 32")},m(i,s){Yn(i,e,s),$t(e,t),$t(e,n)},p:lt,i:lt,o:lt,d(i){i&&Gn(e)}}}class Qn extends Rn{constructor(e){super(),On(this,e,null,Kn,Jn,{})}}const Wn=async l=>(await Promise.all(l.map(async t=>await Promise.all(t.map(async(n,i)=>{if(n===null)return"";let s=i===0?"😃":"🤖",o="";if(typeof n=="string"){const r={audio:/|!\[.*?\]\((\/file=.*?)\)/g};o=n;for(let[a,f]of Object.entries(r)){let u;for(;(u=f.exec(n))!==null;){const _=u[1]||u[2],b=await kt(_);o=o.replace(_,b)}}}else{if(!n?.url)return"";const r=await kt(n.url);n.mime_type?.includes("audio")?o=``:n.mime_type?.includes("video")?o=r:n.mime_type?.includes("image")&&(o=``)}return`${s}: ${o}`}))))).map(t=>t.join(t[0]!==""&&t[1]!==""?` +`:"")).join(` +`),dn=(l,e)=>l.replace('src="/file',`src="${e}file`);function Xn(l){return l?l.includes("audio")?"audio":l.includes("video")?"video":l.includes("image")?"image":"file":"file"}function gn(l){const e=Array.isArray(l.file)?l.file[0]:l.file;return{component:Xn(e?.mime_type),value:l.file,alt_text:l.alt_text,constructor_args:{},props:{}}}function xn(l,e){return l===null?l:l.map((t,n)=>typeof t.content=="string"?{role:t.role,metadata:t.metadata,content:dn(t.content,e),type:"text",index:n}:"file"in t.content?{content:gn(t.content),metadata:t.metadata,role:t.role,type:"component",index:n}:{type:"component",...t})}function el(l,e){return l===null?l:l.flatMap((n,i)=>n.map((s,o)=>{if(s==null)return null;const r=o==0?"user":"assistant";return typeof s=="string"?{role:r,type:"text",content:dn(s,e),metadata:{title:null},index:[i,o]}:"file"in s?{content:gn(s),role:r,type:"component",index:[i,o]}:{role:r,content:s,type:"component",index:[i,o]}})).filter(n=>n!=null)}function we(l){return l.type==="component"}const{SvelteComponent:tl,attr:Ue,detach:nl,element:ll,flush:il,init:ol,insert:sl,noop:Ct,safe_not_equal:al,set_style:yt}=window.__gradio__svelte__internal;function rl(l){let e;return{c(){e=ll("div"),e.innerHTML=`Loading content
+   +
+   +
`,Ue(e,"class","message pending svelte-1gpwetz"),Ue(e,"role","status"),Ue(e,"aria-label","Loading response"),Ue(e,"aria-live","polite"),yt(e,"border-radius",l[0]==="bubble"?"var(--radius-xxl)":"none")},m(t,n){sl(t,e,n)},p(t,[n]){n&1&&yt(e,"border-radius",t[0]==="bubble"?"var(--radius-xxl)":"none")},i:Ct,o:Ct,d(t){t&&nl(e)}}}function ul(l,e,t){let{layout:n="bubble"}=e;return l.$$set=i=>{"layout"in i&&t(0,n=i.layout)},[n]}class fl extends tl{constructor(e){super(),ol(this,e,ul,rl,al,{layout:0})}get layout(){return this.$$.ctx[0]}set layout(e){this.$$set({layout:e}),il()}}const{SvelteComponent:_l,append:Se,attr:Ne,check_outros:cl,create_slot:ml,detach:bn,element:Ze,flush:hl,get_all_dirty_from_scope:dl,get_slot_changes:gl,group_outros:bl,init:pl,insert:pn,listen:wl,safe_not_equal:vl,set_data:kl,set_style:Ht,space:St,text:$l,transition_in:Fe,transition_out:ht,update_slot_base:Cl}=window.__gradio__svelte__internal;function Vt(l){let e,t;const n=l[4].default,i=ml(n,l,l[3],null);return{c(){e=Ze("div"),i&&i.c(),Ne(e,"class","content svelte-1e60bn1")},m(s,o){pn(s,e,o),i&&i.m(e,null),t=!0},p(s,o){i&&i.p&&(!t||o&8)&&Cl(i,n,s,s[3],t?gl(n,s[3],o,null):dl(s[3]),null)},i(s){t||(Fe(i,s),t=!0)},o(s){ht(i,s),t=!1},d(s){s&&bn(e),i&&i.d(s)}}}function yl(l){let e,t,n,i,s,o,r,a,f,u,_=l[1]&&Vt(l);return{c(){e=Ze("button"),t=Ze("div"),n=Ze("span"),i=$l(l[0]),s=St(),o=Ze("span"),o.textContent="â–¼",r=St(),_&&_.c(),Ne(n,"class","title-text svelte-1e60bn1"),Ne(o,"class","arrow svelte-1e60bn1"),Ht(o,"transform",l[1]?"rotate(0)":"rotate(90deg)"),Ne(t,"class","title svelte-1e60bn1"),Ne(e,"class","box svelte-1e60bn1")},m(b,g){pn(b,e,g),Se(e,t),Se(t,n),Se(n,i),Se(t,s),Se(t,o),Se(e,r),_&&_.m(e,null),a=!0,f||(u=wl(e,"click",l[2]),f=!0)},p(b,[g]){(!a||g&1)&&kl(i,b[0]),g&2&&Ht(o,"transform",b[1]?"rotate(0)":"rotate(90deg)"),b[1]?_?(_.p(b,g),g&2&&Fe(_,1)):(_=Vt(b),_.c(),Fe(_,1),_.m(e,null)):_&&(bl(),ht(_,1,1,()=>{_=null}),cl())},i(b){a||(Fe(_),a=!0)},o(b){ht(_),a=!1},d(b){b&&bn(e),_&&_.d(),f=!1,u()}}}function Hl(l,e,t){let{$$slots:n={},$$scope:i}=e,s=!1,{title:o}=e;function r(){t(1,s=!s)}return l.$$set=a=>{"title"in a&&t(0,o=a.title),"$$scope"in a&&t(3,i=a.$$scope)},[o,s,r,i,n]}class Sl extends _l{constructor(e){super(),pl(this,e,Hl,yl,vl,{title:0})}get title(){return this.$$.ctx[0]}set title(e){this.$$set({title:e}),hl()}}const{SvelteComponent:Vl,attr:ql,bubble:Ve,check_outros:ke,construct_svelte_component:I,create_component:F,destroy_component:R,detach:_e,element:zl,empty:$e,flush:ee,group_outros:Ce,init:jl,insert:ce,mount_component:G,noop:Ll,safe_not_equal:Al,transition_in:Z,transition_out:T}=window.__gradio__svelte__internal;function Ml(l){let e,t,n;var i=l[1][l[0]];function s(o,r){return{props:{value:o[2],show_label:!1,label:"chatbot-image",show_share_button:!0,i18n:o[6],gradio:{dispatch:Ul}}}}return i&&(e=I(i,s(l)),e.$on("load",l[14])),{c(){e&&F(e.$$.fragment),t=$e()},m(o,r){e&&G(e,o,r),ce(o,t,r),n=!0},p(o,r){if(r&3&&i!==(i=o[1][o[0]])){if(e){Ce();const a=e;T(a.$$.fragment,1,0,()=>{R(a,1)}),ke()}i?(e=I(i,s(o)),e.$on("load",o[14]),F(e.$$.fragment),Z(e.$$.fragment,1),G(e,t.parentNode,t)):e=null}else if(i){const a={};r&4&&(a.value=o[2]),r&64&&(a.i18n=o[6]),e.$set(a)}},i(o){n||(e&&Z(e.$$.fragment,o),n=!0)},o(o){e&&T(e.$$.fragment,o),n=!1},d(o){o&&_e(t),e&&R(e,o)}}}function Bl(l){let e,t,n;var i=l[1][l[0]];function s(o,r){return{props:{value:o[2],show_label:!1,label:"chatbot-image",show_download_button:!1,i18n:o[6]}}}return i&&(e=I(i,s(l)),e.$on("load",l[13])),{c(){e&&F(e.$$.fragment),t=$e()},m(o,r){e&&G(e,o,r),ce(o,t,r),n=!0},p(o,r){if(r&3&&i!==(i=o[1][o[0]])){if(e){Ce();const a=e;T(a.$$.fragment,1,0,()=>{R(a,1)}),ke()}i?(e=I(i,s(o)),e.$on("load",o[13]),F(e.$$.fragment),Z(e.$$.fragment,1),G(e,t.parentNode,t)):e=null}else if(i){const a={};r&4&&(a.value=o[2]),r&64&&(a.i18n=o[6]),e.$set(a)}},i(o){n||(e&&Z(e.$$.fragment,o),n=!0)},o(o){e&&T(e.$$.fragment,o),n=!1},d(o){o&&_e(t),e&&R(e,o)}}}function Nl(l){let e,t,n;var i=l[1][l[0]];function s(o,r){return{props:{autoplay:!0,value:o[2].video||o[2],show_label:!1,show_share_button:!0,i18n:o[6],upload:o[7],show_download_button:!1,$$slots:{default:[El]},$$scope:{ctx:o}}}}return i&&(e=I(i,s(l)),e.$on("load",l[12])),{c(){e&&F(e.$$.fragment),t=$e()},m(o,r){e&&G(e,o,r),ce(o,t,r),n=!0},p(o,r){if(r&3&&i!==(i=o[1][o[0]])){if(e){Ce();const a=e;T(a.$$.fragment,1,0,()=>{R(a,1)}),ke()}i?(e=I(i,s(o)),e.$on("load",o[12]),F(e.$$.fragment),Z(e.$$.fragment,1),G(e,t.parentNode,t)):e=null}else if(i){const a={};r&4&&(a.value=o[2].video||o[2]),r&64&&(a.i18n=o[6]),r&128&&(a.upload=o[7]),r&32768&&(a.$$scope={dirty:r,ctx:o}),e.$set(a)}},i(o){n||(e&&Z(e.$$.fragment,o),n=!0)},o(o){e&&T(e.$$.fragment,o),n=!1},d(o){o&&_e(t),e&&R(e,o)}}}function Zl(l){let e,t,n;var i=l[1][l[0]];function s(o,r){return{props:{value:o[2],show_label:!1,show_share_button:!0,i18n:o[6],label:"",waveform_settings:{},waveform_options:{},show_download_button:!1}}}return i&&(e=I(i,s(l)),e.$on("load",l[11])),{c(){e&&F(e.$$.fragment),t=$e()},m(o,r){e&&G(e,o,r),ce(o,t,r),n=!0},p(o,r){if(r&3&&i!==(i=o[1][o[0]])){if(e){Ce();const a=e;T(a.$$.fragment,1,0,()=>{R(a,1)}),ke()}i?(e=I(i,s(o)),e.$on("load",o[11]),F(e.$$.fragment),Z(e.$$.fragment,1),G(e,t.parentNode,t)):e=null}else if(i){const a={};r&4&&(a.value=o[2]),r&64&&(a.i18n=o[6]),e.$set(a)}},i(o){n||(e&&Z(e.$$.fragment,o),n=!0)},o(o){e&&T(e.$$.fragment,o),n=!1},d(o){o&&_e(t),e&&R(e,o)}}}function Tl(l){let e,t,n;var i=l[1][l[0]];function s(o,r){return{props:{value:o[2],target:o[3],theme_mode:o[4],bokeh_version:o[5].bokeh_version,caption:"",show_actions_button:!0}}}return i&&(e=I(i,s(l)),e.$on("load",l[10])),{c(){e&&F(e.$$.fragment),t=$e()},m(o,r){e&&G(e,o,r),ce(o,t,r),n=!0},p(o,r){if(r&3&&i!==(i=o[1][o[0]])){if(e){Ce();const a=e;T(a.$$.fragment,1,0,()=>{R(a,1)}),ke()}i?(e=I(i,s(o)),e.$on("load",o[10]),F(e.$$.fragment),Z(e.$$.fragment,1),G(e,t.parentNode,t)):e=null}else if(i){const a={};r&4&&(a.value=o[2]),r&8&&(a.target=o[3]),r&16&&(a.theme_mode=o[4]),r&32&&(a.bokeh_version=o[5].bokeh_version),e.$set(a)}},i(o){n||(e&&Z(e.$$.fragment,o),n=!0)},o(o){e&&T(e.$$.fragment,o),n=!1},d(o){o&&_e(t),e&&R(e,o)}}}function Dl(l){let e,t,n;var i=l[1][l[0]];function s(o,r){return{props:{value:o[2],show_label:!1,i18n:o[6],label:"",_fetch:o[8],allow_preview:!1,interactive:!1,mode:"minimal",fixed_height:1}}}return i&&(e=I(i,s(l)),e.$on("load",l[9])),{c(){e&&F(e.$$.fragment),t=$e()},m(o,r){e&&G(e,o,r),ce(o,t,r),n=!0},p(o,r){if(r&3&&i!==(i=o[1][o[0]])){if(e){Ce();const a=e;T(a.$$.fragment,1,0,()=>{R(a,1)}),ke()}i?(e=I(i,s(o)),e.$on("load",o[9]),F(e.$$.fragment),Z(e.$$.fragment,1),G(e,t.parentNode,t)):e=null}else if(i){const a={};r&4&&(a.value=o[2]),r&64&&(a.i18n=o[6]),r&256&&(a._fetch=o[8]),e.$set(a)}},i(o){n||(e&&Z(e.$$.fragment,o),n=!0)},o(o){e&&T(e.$$.fragment,o),n=!1},d(o){o&&_e(t),e&&R(e,o)}}}function El(l){let e;return{c(){e=zl("track"),ql(e,"kind","captions")},m(t,n){ce(t,e,n)},p:Ll,d(t){t&&_e(e)}}}function Pl(l){let e,t,n,i;const s=[Dl,Tl,Zl,Nl,Bl,Ml],o=[];function r(a,f){return a[0]==="gallery"?0:a[0]==="plot"?1:a[0]==="audio"?2:a[0]==="video"?3:a[0]==="image"?4:a[0]==="html"?5:-1}return~(e=r(l))&&(t=o[e]=s[e](l)),{c(){t&&t.c(),n=$e()},m(a,f){~e&&o[e].m(a,f),ce(a,n,f),i=!0},p(a,[f]){let u=e;e=r(a),e===u?~e&&o[e].p(a,f):(t&&(Ce(),T(o[u],1,1,()=>{o[u]=null}),ke()),~e?(t=o[e],t?t.p(a,f):(t=o[e]=s[e](a),t.c()),Z(t,1),t.m(n.parentNode,n)):t=null)},i(a){i||(Z(t),i=!0)},o(a){T(t),i=!1},d(a){a&&_e(n),~e&&o[e].d(a)}}}const Ul=()=>{};function Il(l,e,t){let{type:n}=e,{components:i}=e,{value:s}=e,{target:o}=e,{theme_mode:r}=e,{props:a}=e,{i18n:f}=e,{upload:u}=e,{_fetch:_}=e;function b(c){Ve.call(this,l,c)}function g(c){Ve.call(this,l,c)}function h(c){Ve.call(this,l,c)}function y(c){Ve.call(this,l,c)}function p(c){Ve.call(this,l,c)}function w(c){Ve.call(this,l,c)}return l.$$set=c=>{"type"in c&&t(0,n=c.type),"components"in c&&t(1,i=c.components),"value"in c&&t(2,s=c.value),"target"in c&&t(3,o=c.target),"theme_mode"in c&&t(4,r=c.theme_mode),"props"in c&&t(5,a=c.props),"i18n"in c&&t(6,f=c.i18n),"upload"in c&&t(7,u=c.upload),"_fetch"in c&&t(8,_=c._fetch)},[n,i,s,o,r,a,f,u,_,b,g,h,y,p,w]}class Fl extends Vl{constructor(e){super(),jl(this,e,Il,Pl,Al,{type:0,components:1,value:2,target:3,theme_mode:4,props:5,i18n:6,upload:7,_fetch:8})}get type(){return this.$$.ctx[0]}set type(e){this.$$set({type:e}),ee()}get components(){return this.$$.ctx[1]}set components(e){this.$$set({components:e}),ee()}get value(){return this.$$.ctx[2]}set value(e){this.$$set({value:e}),ee()}get target(){return this.$$.ctx[3]}set target(e){this.$$set({target:e}),ee()}get theme_mode(){return this.$$.ctx[4]}set theme_mode(e){this.$$set({theme_mode:e}),ee()}get props(){return this.$$.ctx[5]}set props(e){this.$$set({props:e}),ee()}get i18n(){return this.$$.ctx[6]}set i18n(e){this.$$set({i18n:e}),ee()}get upload(){return this.$$.ctx[7]}set upload(e){this.$$set({upload:e}),ee()}get _fetch(){return this.$$.ctx[8]}set _fetch(e){this.$$set({_fetch:e}),ee()}}const{SvelteComponent:Rl,append:Gl,attr:he,detach:Ol,init:Yl,insert:Jl,noop:ot,safe_not_equal:Kl,svg_element:qt}=window.__gradio__svelte__internal;function Ql(l){let e,t;return{c(){e=qt("svg"),t=qt("path"),he(t,"d","M11.25 6.61523H9.375V1.36523H11.25V6.61523ZM3.375 1.36523H8.625V6.91636L7.48425 8.62748L7.16737 10.8464C7.14108 11.0248 7.05166 11.1879 6.91535 11.3061C6.77904 11.4242 6.60488 11.4896 6.4245 11.4902H6.375C6.07672 11.4899 5.79075 11.3713 5.57983 11.1604C5.36892 10.9495 5.2503 10.6635 5.25 10.3652V8.11523H2.25C1.85233 8.11474 1.47109 7.95654 1.18989 7.67535C0.908691 7.39415 0.750496 7.01291 0.75 6.61523V3.99023C0.750992 3.29435 1.02787 2.62724 1.51994 2.13517C2.01201 1.64311 2.67911 1.36623 3.375 1.36523Z"),he(t,"fill","currentColor"),he(e,"width","16"),he(e,"height","16"),he(e,"viewBox","0 0 12 12"),he(e,"fill","none"),he(e,"xmlns","http://www.w3.org/2000/svg")},m(n,i){Jl(n,e,i),Gl(e,t)},p:ot,i:ot,o:ot,d(n){n&&Ol(e)}}}class Wl extends Rl{constructor(e){super(),Yl(this,e,null,Ql,Kl,{})}}const{SvelteComponent:Xl,append:xl,attr:de,detach:ei,init:ti,insert:ni,noop:st,safe_not_equal:li,svg_element:zt}=window.__gradio__svelte__internal;function ii(l){let e,t;return{c(){e=zt("svg"),t=zt("path"),de(t,"d","M2.25 8.11523H4.5V10.3652C4.5003 10.6635 4.61892 10.9495 4.82983 11.1604C5.04075 11.3713 5.32672 11.4899 5.625 11.4902H6.42488C6.60519 11.4895 6.77926 11.4241 6.91549 11.3059C7.05172 11.1878 7.14109 11.0248 7.16737 10.8464L7.48425 8.62748L8.82562 6.61523H11.25V1.36523H3.375C2.67911 1.36623 2.01201 1.64311 1.51994 2.13517C1.02787 2.62724 0.750992 3.29435 0.75 3.99023V6.61523C0.750496 7.01291 0.908691 7.39415 1.18989 7.67535C1.47109 7.95654 1.85233 8.11474 2.25 8.11523ZM9 2.11523H10.5V5.86523H9V2.11523ZM1.5 3.99023C1.5006 3.49314 1.69833 3.01657 2.04983 2.66507C2.40133 2.31356 2.8779 2.11583 3.375 2.11523H8.25V6.12661L6.76575 8.35298L6.4245 10.7402H5.625C5.52554 10.7402 5.43016 10.7007 5.35983 10.6304C5.28951 10.5601 5.25 10.4647 5.25 10.3652V7.36523H2.25C2.05118 7.36494 1.86059 7.28582 1.72 7.14524C1.57941 7.00465 1.5003 6.81406 1.5 6.61523V3.99023Z"),de(t,"fill","currentColor"),de(e,"width","16"),de(e,"height","16"),de(e,"viewBox","0 0 12 12"),de(e,"fill","none"),de(e,"xmlns","http://www.w3.org/2000/svg")},m(n,i){ni(n,e,i),xl(e,t)},p:st,i:st,o:st,d(n){n&&ei(e)}}}class oi extends Xl{constructor(e){super(),ti(this,e,null,ii,li,{})}}const{SvelteComponent:si,append:ai,attr:ge,detach:ri,init:ui,insert:fi,noop:at,safe_not_equal:_i,svg_element:jt}=window.__gradio__svelte__internal;function ci(l){let e,t;return{c(){e=jt("svg"),t=jt("path"),ge(t,"d","M0.75 6.24023H2.625V11.4902H0.75V6.24023ZM8.625 11.4902H3.375V5.93911L4.51575 4.22798L4.83263 2.00911C4.85892 1.83065 4.94834 1.66754 5.08465 1.5494C5.22096 1.43125 5.39512 1.36591 5.5755 1.36523H5.625C5.92328 1.36553 6.20925 1.48415 6.42017 1.69507C6.63108 1.90598 6.7497 2.19196 6.75 2.49023V4.74023H9.75C10.1477 4.74073 10.5289 4.89893 10.8101 5.18012C11.0913 5.46132 11.2495 5.84256 11.25 6.24023V8.86523C11.249 9.56112 10.9721 10.2282 10.4801 10.7203C9.98799 11.2124 9.32089 11.4892 8.625 11.4902Z"),ge(t,"fill","currentColor"),ge(e,"width","16"),ge(e,"height","16"),ge(e,"viewBox","0 0 12 12"),ge(e,"fill","none"),ge(e,"xmlns","http://www.w3.org/2000/svg")},m(n,i){fi(n,e,i),ai(e,t)},p:at,i:at,o:at,d(n){n&&ri(e)}}}class mi extends si{constructor(e){super(),ui(this,e,null,ci,_i,{})}}const{SvelteComponent:hi,append:di,attr:be,detach:gi,init:bi,insert:pi,noop:rt,safe_not_equal:wi,svg_element:Lt}=window.__gradio__svelte__internal;function vi(l){let e,t;return{c(){e=Lt("svg"),t=Lt("path"),be(t,"d","M9.75 4.74023H7.5V2.49023C7.4997 2.19196 7.38108 1.90598 7.17017 1.69507C6.95925 1.48415 6.67328 1.36553 6.375 1.36523H5.57512C5.39481 1.366 5.22074 1.43138 5.08451 1.54952C4.94828 1.66766 4.85891 1.83072 4.83262 2.00911L4.51575 4.22798L3.17438 6.24023H0.75V11.4902H8.625C9.32089 11.4892 9.98799 11.2124 10.4801 10.7203C10.9721 10.2282 11.249 9.56112 11.25 8.86523V6.24023C11.2495 5.84256 11.0913 5.46132 10.8101 5.18012C10.5289 4.89893 10.1477 4.74073 9.75 4.74023ZM3 10.7402H1.5V6.99023H3V10.7402ZM10.5 8.86523C10.4994 9.36233 10.3017 9.8389 9.95017 10.1904C9.59867 10.5419 9.1221 10.7396 8.625 10.7402H3.75V6.72886L5.23425 4.50248L5.5755 2.11523H6.375C6.47446 2.11523 6.56984 2.15474 6.64017 2.22507C6.71049 2.2954 6.75 2.39078 6.75 2.49023V5.49023H9.75C9.94882 5.49053 10.1394 5.56965 10.28 5.71023C10.4206 5.85082 10.4997 6.04141 10.5 6.24023V8.86523Z"),be(t,"fill","currentColor"),be(e,"width","16"),be(e,"height","16"),be(e,"viewBox","0 0 12 12"),be(e,"fill","none"),be(e,"xmlns","http://www.w3.org/2000/svg")},m(n,i){pi(n,e,i),di(e,t)},p:rt,i:rt,o:rt,d(n){n&&gi(e)}}}class ki extends hi{constructor(e){super(),bi(this,e,null,vi,wi,{})}}const{SvelteComponent:$i,attr:pe,check_outros:At,create_component:Ye,destroy_component:Je,detach:ut,element:Mt,flush:ft,group_outros:Bt,init:Ci,insert:_t,listen:Nt,mount_component:Ke,run_all:yi,safe_not_equal:Hi,space:Si,toggle_class:oe,transition_in:ue,transition_out:fe}=window.__gradio__svelte__internal;function Vi(l){let e,t;return e=new oi({}),{c(){Ye(e.$$.fragment)},m(n,i){Ke(e,n,i),t=!0},i(n){t||(ue(e.$$.fragment,n),t=!0)},o(n){fe(e.$$.fragment,n),t=!1},d(n){Je(e,n)}}}function qi(l){let e,t;return e=new Wl({}),{c(){Ye(e.$$.fragment)},m(n,i){Ke(e,n,i),t=!0},i(n){t||(ue(e.$$.fragment,n),t=!0)},o(n){fe(e.$$.fragment,n),t=!1},d(n){Je(e,n)}}}function zi(l){let e,t;return e=new ki({}),{c(){Ye(e.$$.fragment)},m(n,i){Ke(e,n,i),t=!0},i(n){t||(ue(e.$$.fragment,n),t=!0)},o(n){fe(e.$$.fragment,n),t=!1},d(n){Je(e,n)}}}function ji(l){let e,t;return e=new mi({}),{c(){Ye(e.$$.fragment)},m(n,i){Ke(e,n,i),t=!0},i(n){t||(ue(e.$$.fragment,n),t=!0)},o(n){fe(e.$$.fragment,n),t=!1},d(n){Je(e,n)}}}function Li(l){let e,t,n,i,s,o,r,a,f,u,_,b,g;const h=[qi,Vi],y=[];function p(k,L){return k[3]==="dislike"?0:1}t=p(l),n=y[t]=h[t](l);const w=[ji,zi],c=[];function v(k,L){return k[3]==="like"?0:1}return a=v(l),f=c[a]=w[a](l),{c(){e=Mt("button"),n.c(),o=Si(),r=Mt("button"),f.c(),pe(e,"aria-label",i=l[3]==="dislike"?"clicked dislike":"dislike"),pe(e,"class",s="dislike-button "+l[2]+" svelte-21g1vy"),oe(e,"padded",l[1]),oe(e,"selected",l[3]==="dislike"),pe(r,"class","like-button svelte-21g1vy"),pe(r,"aria-label",u=l[3]==="like"?"clicked like":"like"),oe(r,"padded",l[1]),oe(r,"selected",l[3]==="like")},m(k,L){_t(k,e,L),y[t].m(e,null),_t(k,o,L),_t(k,r,L),c[a].m(r,null),_=!0,b||(g=[Nt(e,"click",l[4]),Nt(r,"click",l[5])],b=!0)},p(k,[L]){let W=t;t=p(k),t!==W&&(Bt(),fe(y[W],1,1,()=>{y[W]=null}),At(),n=y[t],n||(n=y[t]=h[t](k),n.c()),ue(n,1),n.m(e,null)),(!_||L&8&&i!==(i=k[3]==="dislike"?"clicked dislike":"dislike"))&&pe(e,"aria-label",i),(!_||L&4&&s!==(s="dislike-button "+k[2]+" svelte-21g1vy"))&&pe(e,"class",s),(!_||L&6)&&oe(e,"padded",k[1]),(!_||L&12)&&oe(e,"selected",k[3]==="dislike");let X=a;a=v(k),a!==X&&(Bt(),fe(c[X],1,1,()=>{c[X]=null}),At(),f=c[a],f||(f=c[a]=w[a](k),f.c()),ue(f,1),f.m(r,null)),(!_||L&8&&u!==(u=k[3]==="like"?"clicked like":"like"))&&pe(r,"aria-label",u),(!_||L&2)&&oe(r,"padded",k[1]),(!_||L&8)&&oe(r,"selected",k[3]==="like")},i(k){_||(ue(n),ue(f),_=!0)},o(k){fe(n),fe(f),_=!1},d(k){k&&(ut(e),ut(o),ut(r)),y[t].d(),c[a].d(),b=!1,yi(g)}}}function Ai(l,e,t){let{handle_action:n}=e,{padded:i=!1}=e,{position:s="left"}=e,o=null;const r=()=>{t(3,o="dislike"),n(o)},a=()=>{t(3,o="like"),n(o)};return l.$$set=f=>{"handle_action"in f&&t(0,n=f.handle_action),"padded"in f&&t(1,i=f.padded),"position"in f&&t(2,s=f.position)},[n,i,s,o,r,a]}class Mi extends $i{constructor(e){super(),Ci(this,e,Ai,Li,Hi,{handle_action:0,padded:1,position:2})}get handle_action(){return this.$$.ctx[0]}set handle_action(e){this.$$set({handle_action:e}),ft()}get padded(){return this.$$.ctx[1]}set padded(e){this.$$set({padded:e}),ft()}get position(){return this.$$.ctx[2]}set position(e){this.$$set({position:e}),ft()}}const{SvelteComponent:Bi,append:Ni,attr:Ie,check_outros:Zt,create_component:wn,destroy_component:vn,detach:Zi,element:Ti,flush:Di,group_outros:Tt,init:Ei,insert:Pi,listen:Ui,mount_component:kn,safe_not_equal:Ii,space:Fi,transition_in:ae,transition_out:qe}=window.__gradio__svelte__internal,{onDestroy:Ri}=window.__gradio__svelte__internal;function Dt(l){let e,t;return e=new Pn({}),{c(){wn(e.$$.fragment)},m(n,i){kn(e,n,i),t=!0},i(n){t||(ae(e.$$.fragment,n),t=!0)},o(n){qe(e.$$.fragment,n),t=!1},d(n){vn(e,n)}}}function Et(l){let e,t;return e=new En({}),{c(){wn(e.$$.fragment)},m(n,i){kn(e,n,i),t=!0},i(n){t||(ae(e.$$.fragment,n),t=!0)},o(n){qe(e.$$.fragment,n),t=!1},d(n){vn(e,n)}}}function Gi(l){let e,t,n,i,s,o,r=!l[0]&&Dt(),a=l[0]&&Et();return{c(){e=Ti("button"),r&&r.c(),t=Fi(),a&&a.c(),Ie(e,"class","action svelte-6u540h"),Ie(e,"title","copy"),Ie(e,"aria-label",n=l[0]?"Copied message":"Copy message")},m(f,u){Pi(f,e,u),r&&r.m(e,null),Ni(e,t),a&&a.m(e,null),i=!0,s||(o=Ui(e,"click",l[1]),s=!0)},p(f,[u]){f[0]?r&&(Tt(),qe(r,1,1,()=>{r=null}),Zt()):r?u&1&&ae(r,1):(r=Dt(),r.c(),ae(r,1),r.m(e,t)),f[0]?a?u&1&&ae(a,1):(a=Et(),a.c(),ae(a,1),a.m(e,null)):a&&(Tt(),qe(a,1,1,()=>{a=null}),Zt()),(!i||u&1&&n!==(n=f[0]?"Copied message":"Copy message"))&&Ie(e,"aria-label",n)},i(f){i||(ae(r),ae(a),i=!0)},o(f){qe(r),qe(a),i=!1},d(f){f&&Zi(e),r&&r.d(),a&&a.d(),s=!1,o()}}}function Oi(l,e,t){let n=!1,{value:i}=e,s;function o(){t(0,n=!0),s&&clearTimeout(s),s=setTimeout(()=>{t(0,n=!1)},2e3)}async function r(){if("clipboard"in navigator)await navigator.clipboard.writeText(i),o();else{const a=document.createElement("textarea");a.value=i,a.style.position="absolute",a.style.left="-999999px",document.body.prepend(a),a.select();try{document.execCommand("copy"),o()}catch(f){console.error(f)}finally{a.remove()}}}return Ri(()=>{s&&clearTimeout(s)}),l.$$set=a=>{"value"in a&&t(2,i=a.value)},[n,r,i]}class Yi extends Bi{constructor(e){super(),Ei(this,e,Oi,Gi,Ii,{value:2})}get value(){return this.$$.ctx[2]}set value(e){this.$$set({value:e}),Di()}}const{SvelteComponent:Ji,append:Pt,attr:te,detach:Ki,init:Qi,insert:Wi,noop:ct,safe_not_equal:Xi,svg_element:mt}=window.__gradio__svelte__internal;function xi(l){let e,t,n;return{c(){e=mt("svg"),t=mt("path"),n=mt("path"),te(t,"d","M6.27701 8.253C6.24187 8.29143 6.19912 8.32212 6.15147 8.34311C6.10383 8.36411 6.05233 8.37495 6.00026 8.37495C5.94819 8.37495 5.89669 8.36411 5.84905 8.34311C5.8014 8.32212 5.75865 8.29143 5.72351 8.253L3.72351 6.0655C3.65798 5.99185 3.62408 5.89536 3.62916 5.79691C3.63424 5.69846 3.67788 5.60596 3.75064 5.53945C3.8234 5.47293 3.91943 5.43774 4.01794 5.44149C4.11645 5.44525 4.20952 5.48764 4.27701 5.5595L5.62501 7.0345V1.5C5.62501 1.40054 5.66452 1.30516 5.73485 1.23483C5.80517 1.16451 5.90055 1.125 6.00001 1.125C6.09947 1.125 6.19485 1.16451 6.26517 1.23483C6.3355 1.30516 6.37501 1.40054 6.37501 1.5V7.034L7.72351 5.559C7.79068 5.4856 7.88425 5.44189 7.98364 5.43748C8.08304 5.43308 8.18011 5.46833 8.25351 5.5355C8.32691 5.60267 8.37062 5.69624 8.37503 5.79563C8.37943 5.89503 8.34418 5.9921 8.27701 6.0655L6.27701 8.253Z"),te(t,"fill","currentColor"),te(n,"d","M1.875 7.39258C1.875 7.29312 1.83549 7.19774 1.76517 7.12741C1.69484 7.05709 1.59946 7.01758 1.5 7.01758C1.40054 7.01758 1.30516 7.05709 1.23483 7.12741C1.16451 7.19774 1.125 7.29312 1.125 7.39258V7.42008C1.125 8.10358 1.125 8.65508 1.1835 9.08858C1.2435 9.53858 1.3735 9.91758 1.674 10.2186C1.975 10.5196 2.354 10.6486 2.804 10.7096C3.2375 10.7676 3.789 10.7676 4.4725 10.7676H7.5275C8.211 10.7676 8.7625 10.7676 9.196 10.7096C9.646 10.6486 10.025 10.5196 10.326 10.2186C10.627 9.91758 10.756 9.53858 10.817 9.08858C10.875 8.65508 10.875 8.10358 10.875 7.42008V7.39258C10.875 7.29312 10.8355 7.19774 10.7652 7.12741C10.6948 7.05709 10.5995 7.01758 10.5 7.01758C10.4005 7.01758 10.3052 7.05709 10.2348 7.12741C10.1645 7.19774 10.125 7.29312 10.125 7.39258C10.125 8.11008 10.124 8.61058 10.0735 8.98858C10.024 9.35558 9.9335 9.54958 9.7955 9.68808C9.657 9.82658 9.463 9.91658 9.0955 9.96608C8.718 10.0166 8.2175 10.0176 7.5 10.0176H4.5C3.7825 10.0176 3.2815 10.0166 2.904 9.96608C2.537 9.91658 2.343 9.82608 2.2045 9.68808C2.066 9.54958 1.976 9.35558 1.9265 8.98808C1.876 8.61058 1.875 8.11008 1.875 7.39258Z"),te(n,"fill","currentColor"),te(e,"width","16"),te(e,"height","16"),te(e,"viewBox","0 0 12 12"),te(e,"fill","none"),te(e,"xmlns","http://www.w3.org/2000/svg")},m(i,s){Wi(i,e,s),Pt(e,t),Pt(e,n)},p:ct,i:ct,o:ct,d(i){i&&Ki(e)}}}class eo extends Ji{constructor(e){super(),Qi(this,e,null,xi,Xi,{})}}const{SvelteComponent:to,append:Ut,attr:dt,check_outros:Re,create_component:Qe,destroy_component:We,detach:pt,element:$n,empty:no,flush:se,group_outros:Ge,init:lo,insert:wt,mount_component:Xe,noop:io,safe_not_equal:oo,space:It,transition_in:A,transition_out:U}=window.__gradio__svelte__internal;function Ft(l){let e,t,n=l[7]&&!Array.isArray(l[2])&&we(l[2]),i,s,o,r=l[8]&&Rt(l),a=n&&Gt(l),f=l[0]&&Ot(l);return{c(){e=$n("div"),r&&r.c(),t=It(),a&&a.c(),i=It(),f&&f.c(),dt(e,"class",s="message-buttons-"+l[3]+" "+l[6]+" message-buttons "+(l[4]!==null&&"with-avatar")+" svelte-hs6bgi")},m(u,_){wt(u,e,_),r&&r.m(e,null),Ut(e,t),a&&a.m(e,null),Ut(e,i),f&&f.m(e,null),o=!0},p(u,_){u[8]?r?(r.p(u,_),_&256&&A(r,1)):(r=Rt(u),r.c(),A(r,1),r.m(e,t)):r&&(Ge(),U(r,1,1,()=>{r=null}),Re()),_&132&&(n=u[7]&&!Array.isArray(u[2])&&we(u[2])),n?a?(a.p(u,_),_&132&&A(a,1)):(a=Gt(u),a.c(),A(a,1),a.m(e,i)):a&&(Ge(),U(a,1,1,()=>{a=null}),Re()),u[0]?f?(f.p(u,_),_&1&&A(f,1)):(f=Ot(u),f.c(),A(f,1),f.m(e,null)):f&&(Ge(),U(f,1,1,()=>{f=null}),Re()),(!o||_&88&&s!==(s="message-buttons-"+u[3]+" "+u[6]+" message-buttons "+(u[4]!==null&&"with-avatar")+" svelte-hs6bgi"))&&dt(e,"class",s)},i(u){o||(A(r),A(a),A(f),o=!0)},o(u){U(r),U(a),U(f),o=!1},d(u){u&&pt(e),r&&r.d(),a&&a.d(),f&&f.d()}}}function Rt(l){let e,t;return e=new Yi({props:{value:l[9]}}),{c(){Qe(e.$$.fragment)},m(n,i){Xe(e,n,i),t=!0},p(n,i){const s={};i&512&&(s.value=n[9]),e.$set(s)},i(n){t||(A(e.$$.fragment,n),t=!0)},o(n){U(e.$$.fragment,n),t=!1},d(n){We(e,n)}}}function Gt(l){let e,t;return e=new Un({props:{href:l[2]?.content?.value.url,download:l[2].content.value.orig_name||"image",$$slots:{default:[so]},$$scope:{ctx:l}}}),{c(){Qe(e.$$.fragment)},m(n,i){Xe(e,n,i),t=!0},p(n,i){const s={};i&4&&(s.href=n[2]?.content?.value.url),i&4&&(s.download=n[2].content.value.orig_name||"image"),i&2048&&(s.$$scope={dirty:i,ctx:n}),e.$set(s)},i(n){t||(A(e.$$.fragment,n),t=!0)},o(n){U(e.$$.fragment,n),t=!1},d(n){We(e,n)}}}function so(l){let e,t,n;return t=new eo({}),{c(){e=$n("span"),Qe(t.$$.fragment),dt(e,"class","icon-wrap svelte-hs6bgi")},m(i,s){wt(i,e,s),Xe(t,e,null),n=!0},p:io,i(i){n||(A(t.$$.fragment,i),n=!0)},o(i){U(t.$$.fragment,i),n=!1},d(i){i&&pt(e),We(t)}}}function Ot(l){let e,t;return e=new Mi({props:{handle_action:l[5],padded:l[8]||l[7]}}),{c(){Qe(e.$$.fragment)},m(n,i){Xe(e,n,i),t=!0},p(n,i){const s={};i&32&&(s.handle_action=n[5]),i&384&&(s.padded=n[8]||n[7]),e.$set(s)},i(n){t||(A(e.$$.fragment,n),t=!0)},o(n){U(e.$$.fragment,n),t=!1},d(n){We(e,n)}}}function ao(l){let e,t,n=l[1]&&Ft(l);return{c(){n&&n.c(),e=no()},m(i,s){n&&n.m(i,s),wt(i,e,s),t=!0},p(i,[s]){i[1]?n?(n.p(i,s),s&2&&A(n,1)):(n=Ft(i),n.c(),A(n,1),n.m(e.parentNode,e)):n&&(Ge(),U(n,1,1,()=>{n=null}),Re())},i(i){t||(A(n),t=!0)},o(i){U(n),t=!1},d(i){i&&pt(e),n&&n.d(i)}}}function Yt(l){return Array.isArray(l)&&l.every(e=>typeof e.content=="string")||!Array.isArray(l)&&typeof l.content=="string"}function ro(l){return Array.isArray(l)?l.map(e=>e.content).join(` +`):l.content}function uo(l,e,t){let n,i,s,{likeable:o}=e,{show_copy_button:r}=e,{show:a}=e,{message:f}=e,{position:u}=e,{avatar:_}=e,{handle_action:b}=e,{layout:g}=e;return l.$$set=h=>{"likeable"in h&&t(0,o=h.likeable),"show_copy_button"in h&&t(10,r=h.show_copy_button),"show"in h&&t(1,a=h.show),"message"in h&&t(2,f=h.message),"position"in h&&t(3,u=h.position),"avatar"in h&&t(4,_=h.avatar),"handle_action"in h&&t(5,b=h.handle_action),"layout"in h&&t(6,g=h.layout)},l.$$.update=()=>{l.$$.dirty&4&&t(9,n=Yt(f)?ro(f):""),l.$$.dirty&1028&&t(8,i=r&&f&&Yt(f)),l.$$.dirty&4&&t(7,s=!Array.isArray(f)&&we(f)&&f.content.value.url)},[o,a,f,u,_,b,g,s,i,n,r]}class fo extends to{constructor(e){super(),lo(this,e,uo,ao,oo,{likeable:0,show_copy_button:10,show:1,message:2,position:3,avatar:4,handle_action:5,layout:6})}get likeable(){return this.$$.ctx[0]}set likeable(e){this.$$set({likeable:e}),se()}get show_copy_button(){return this.$$.ctx[10]}set show_copy_button(e){this.$$set({show_copy_button:e}),se()}get show(){return this.$$.ctx[1]}set show(e){this.$$set({show:e}),se()}get message(){return this.$$.ctx[2]}set message(e){this.$$set({message:e}),se()}get position(){return this.$$.ctx[3]}set position(e){this.$$set({position:e}),se()}get avatar(){return this.$$.ctx[4]}set avatar(e){this.$$set({avatar:e}),se()}get handle_action(){return this.$$.ctx[5]}set handle_action(e){this.$$set({handle_action:e}),se()}get layout(){return this.$$.ctx[6]}set layout(e){this.$$set({layout:e}),se()}}const{SvelteComponent:_o,action_destroyer:co,append:ne,attr:$,binding_callbacks:mo,bubble:Jt,check_outros:le,create_component:J,destroy_component:K,destroy_each:Cn,detach:B,element:P,empty:yn,ensure_array_like:Oe,flush:j,group_outros:ie,init:ho,insert:N,listen:gt,mount_component:Q,noop:Kt,null_to_empty:Qt,run_all:go,safe_not_equal:bo,set_data:po,set_style:Be,space:ve,src_url_equal:Wt,text:wo,toggle_class:q,transition_in:C,transition_out:H}=window.__gradio__svelte__internal,{beforeUpdate:vo,afterUpdate:ko,createEventDispatcher:$o,tick:Co}=window.__gradio__svelte__internal;function Xt(l,e,t){const n=l.slice();n[44]=e[t],n[49]=t;const i=n[44][0].role==="user"?"user":"bot";n[45]=i;const s=n[9][n[45]==="user"?0:1];n[46]=s;const o=n[9][n[45]==="user"?0:1];return n[47]=o,n}function xt(l,e,t){const n=l.slice();n[50]=e[t],n[53]=t;const i=n[44][0].type;return n[51]=i,n}function en(l){let e,t,n;return t=new Tn({props:{i18n:l[15],formatter:Wn,value:l[0]}}),t.$on("error",l[33]),t.$on("share",l[34]),{c(){e=P("div"),J(t.$$.fragment),$(e,"class","share-button svelte-1ggj411")},m(i,s){N(i,e,s),Q(t,e,null),n=!0},p(i,s){const o={};s[0]&32768&&(o.i18n=i[15]),s[0]&1&&(o.value=i[0]),t.$set(o)},i(i){n||(C(t.$$.fragment,i),n=!0)},o(i){H(t.$$.fragment,i),n=!1},d(i){i&&B(e),K(t)}}}function yo(l){let e,t,n;return t=new bt({props:{message:l[17],latex_delimiters:l[2]}}),{c(){e=P("center"),J(t.$$.fragment),$(e,"class","svelte-1ggj411")},m(i,s){N(i,e,s),Q(t,e,null),n=!0},p(i,s){const o={};s[0]&131072&&(o.message=i[17]),s[0]&4&&(o.latex_delimiters=i[2]),t.$set(o)},i(i){n||(C(t.$$.fragment,i),n=!0)},o(i){H(t.$$.fragment,i),n=!1},d(i){i&&B(e),K(t)}}}function Ho(l){let e,t,n,i=Oe(l[25]),s=[];for(let a=0;aH(s[a],1,1,()=>{s[a]=null});let r=l[3]&&sn(l);return{c(){for(let a=0;a{r=null}),le())},i(a){if(!n){for(let f=0;f{o[u]=null}),le(),t=o[e],t?t.p(a,f):(t=o[e]=s[e](a),t.c()),C(t,1),t.m(n.parentNode,n))},i(a){i||(C(t),i=!0)},o(a){H(t),i=!1},d(a){a&&B(n),o[e].d(a)}}}function zo(l){let e,t;return e=new bt({props:{message:l[50].content,latex_delimiters:l[2],sanitize_html:l[10],render_markdown:l[12],line_breaks:l[13]}}),e.$on("load",l[27]),{c(){J(e.$$.fragment)},m(n,i){Q(e,n,i),t=!0},p(n,i){const s={};i[0]&33554432&&(s.message=n[50].content),i[0]&4&&(s.latex_delimiters=n[2]),i[0]&1024&&(s.sanitize_html=n[10]),i[0]&4096&&(s.render_markdown=n[12]),i[0]&8192&&(s.line_breaks=n[13]),e.$set(s)},i(n){t||(C(e.$$.fragment,n),t=!0)},o(n){H(e.$$.fragment,n),t=!1},d(n){K(e,n)}}}function jo(l){let e,t;return e=new Sl({props:{title:l[50].metadata.title,$$slots:{default:[Lo]},$$scope:{ctx:l}}}),{c(){J(e.$$.fragment)},m(n,i){Q(e,n,i),t=!0},p(n,i){const s={};i[0]&33554432&&(s.title=n[50].metadata.title),i[0]&33567748|i[1]&8388608&&(s.$$scope={dirty:i,ctx:n}),e.$set(s)},i(n){t||(C(e.$$.fragment,n),t=!0)},o(n){H(e.$$.fragment,n),t=!1},d(n){K(e,n)}}}function Lo(l){let e,t;return e=new bt({props:{message:l[50].content,latex_delimiters:l[2],sanitize_html:l[10],render_markdown:l[12],line_breaks:l[13]}}),e.$on("load",l[27]),{c(){J(e.$$.fragment)},m(n,i){Q(e,n,i),t=!0},p(n,i){const s={};i[0]&33554432&&(s.message=n[50].content),i[0]&4&&(s.latex_delimiters=n[2]),i[0]&1024&&(s.sanitize_html=n[10]),i[0]&4096&&(s.render_markdown=n[12]),i[0]&8192&&(s.line_breaks=n[13]),e.$set(s)},i(n){t||(C(e.$$.fragment,n),t=!0)},o(n){H(e.$$.fragment,n),t=!1},d(n){K(e,n)}}}function ln(l){let e,t,n,i,s,o,r,a,f,u,_,b;const g=[qo,Vo,So],h=[];function y(c,v){return c[50].type==="text"?0:c[50].type==="component"&&c[50].content.component in c[20]?1:c[50].type==="component"&&c[50].content.component==="file"?2:-1}~(n=y(l))&&(i=h[n]=g[n](l));function p(){return l[36](l[49],l[50])}function w(...c){return l[37](l[49],l[50],...c)}return{c(){e=P("div"),t=P("button"),i&&i.c(),a=ve(),$(t,"data-testid",s=l[45]),$(t,"dir",o=l[7]?"rtl":"ltr"),$(t,"aria-label",r=l[45]+"'s message: "+an(l[50])),$(t,"class","svelte-1ggj411"),q(t,"latest",l[49]===l[0].length-1),q(t,"message-markdown-disabled",!l[12]),q(t,"selectable",l[4]),Be(t,"user-select","text"),Be(t,"text-align",l[7]?"right":"left"),$(e,"class",f="message "+l[45]+" "+(we(l[50])?l[50]?.content.component:"")+" svelte-1ggj411"),q(e,"message-fit",!l[11]),q(e,"panel-full-width",!0),q(e,"message-markdown-disabled",!l[12]),q(e,"component",l[51]==="component"),q(e,"html",we(l[50])&&l[50].content.component==="html"),q(e,"thought",l[53]>0),Be(e,"text-align",l[7]&&l[45]==="user"?"left":"right")},m(c,v){N(c,e,v),ne(e,t),~n&&h[n].m(t,null),ne(e,a),u=!0,_||(b=[gt(t,"click",p),gt(t,"keydown",w)],_=!0)},p(c,v){l=c;let k=n;n=y(l),n===k?~n&&h[n].p(l,v):(i&&(ie(),H(h[k],1,1,()=>{h[k]=null}),le()),~n?(i=h[n],i?i.p(l,v):(i=h[n]=g[n](l),i.c()),C(i,1),i.m(t,null)):i=null),(!u||v[0]&33554432&&s!==(s=l[45]))&&$(t,"data-testid",s),(!u||v[0]&128&&o!==(o=l[7]?"rtl":"ltr"))&&$(t,"dir",o),(!u||v[0]&33554432&&r!==(r=l[45]+"'s message: "+an(l[50])))&&$(t,"aria-label",r),(!u||v[0]&1)&&q(t,"latest",l[49]===l[0].length-1),(!u||v[0]&4096)&&q(t,"message-markdown-disabled",!l[12]),(!u||v[0]&16)&&q(t,"selectable",l[4]),v[0]&128&&Be(t,"text-align",l[7]?"right":"left"),(!u||v[0]&33554432&&f!==(f="message "+l[45]+" "+(we(l[50])?l[50]?.content.component:"")+" svelte-1ggj411"))&&$(e,"class",f),(!u||v[0]&33556480)&&q(e,"message-fit",!l[11]),(!u||v[0]&33554432)&&q(e,"panel-full-width",!0),(!u||v[0]&33558528)&&q(e,"message-markdown-disabled",!l[12]),(!u||v[0]&33554432)&&q(e,"component",l[51]==="component"),(!u||v[0]&33554432)&&q(e,"html",we(l[50])&&l[50].content.component==="html"),(!u||v[0]&33554432)&&q(e,"thought",l[53]>0),v[0]&33554560&&Be(e,"text-align",l[7]&&l[45]==="user"?"left":"right")},i(c){u||(C(i),u=!0)},o(c){H(i),u=!1},d(c){c&&B(e),~n&&h[n].d(),_=!1,go(b)}}}function on(l){let e,t,n,i,s,o,r,a,f,u=l[24]&&tn(l),_=l[46]!==null&&nn(l),b=Oe(l[44]),g=[];for(let p=0;pH(g[p],1,1,()=>{g[p]=null});function y(...p){return l[38](l[49],l[44],...p)}return a=new fo({props:{show:l[5]||l[8],handle_action:y,likeable:l[5],show_copy_button:l[8],message:l[19]==="tuples"?l[44][0]:l[44],position:l[45]==="user"?"right":"left",avatar:l[46],layout:l[16]}}),{c(){u&&u.c(),e=ve(),t=P("div"),_&&_.c(),n=ve(),i=P("div");for(let p=0;p{u=null}),le()),l[46]!==null?_?(_.p(l,w),w[0]&33554944&&C(_,1)):(_=nn(l),_.c(),C(_,1),_.m(t,n)):_&&(ie(),H(_,1,1,()=>{_=null}),le()),w[0]&504691863){b=Oe(l[44]);let v;for(v=0;v0&&en(l);const _=[Ho,yo],b=[];function g(h,y){return h[0]!==null&&h[0].length>0&&h[25]!==null?0:h[17]!==null?1:-1}return~(i=g(l))&&(s=b[i]=_[i](l)),{c(){u&&u.c(),e=ve(),t=P("div"),n=P("div"),s&&s.c(),$(n,"class","message-wrap svelte-1ggj411"),$(t,"class",o=Qt(l[16]==="bubble"?"bubble-wrap":"panel-wrap")+" svelte-1ggj411"),$(t,"role","log"),$(t,"aria-label","chatbot conversation"),$(t,"aria-live","polite"),q(t,"placeholder-container",l[0]===null||l[0].length===0)},m(h,y){u&&u.m(h,y),N(h,e,y),N(h,t,y),ne(t,n),~i&&b[i].m(n,null),l[39](t),r=!0,a||(f=co(Nn.call(null,n)),a=!0)},p(h,y){h[6]&&h[0]!==null&&h[0].length>0?u?(u.p(h,y),y[0]&65&&C(u,1)):(u=en(h),u.c(),C(u,1),u.m(e.parentNode,e)):u&&(ie(),H(u,1,1,()=>{u=null}),le());let p=i;i=g(h),i===p?~i&&b[i].p(h,y):(s&&(ie(),H(b[p],1,1,()=>{b[p]=null}),le()),~i?(s=b[i],s?s.p(h,y):(s=b[i]=_[i](h),s.c()),C(s,1),s.m(n,null)):s=null),(!r||y[0]&65536&&o!==(o=Qt(h[16]==="bubble"?"bubble-wrap":"panel-wrap")+" svelte-1ggj411"))&&$(t,"class",o),(!r||y[0]&65537)&&q(t,"placeholder-container",h[0]===null||h[0].length===0)},i(h){r||(C(u),C(s),r=!0)},o(h){H(u),H(s),r=!1},d(h){h&&(B(e),B(t)),u&&u.d(h),~i&&b[i].d(),l[39](null),a=!1,f()}}}function Mo(l){if(!l)return[];let e=new Set;return l.forEach(t=>{t.type==="component"&&e.add(t.content.component)}),Array.from(e)}function an(l){return l.type==="text"?l.content:l.type==="component"&&l.content.component==="file"?Array.isArray(l.content.value)?`file of extension type: ${l.content.value[0].orig_name?.split(".").pop()}`:`file of extension type: ${l.content.value?.orig_name?.split(".").pop()}`+(l.content.value?.orig_name??""):`a component of type ${l.content.component??"unknown"}`}function Bo(l,e,t){let n,i,{value:s=[]}=e,o=null,{_fetch:r}=e,{load_component:a}=e,f={};async function u(d){let z=[],V=[];d.forEach(M=>{if(f[M]||M==="file")return;const{name:Me,component:nt}=a(M,"base");z.push(Me),V.push(nt)}),(await Promise.all(V)).forEach((M,Me)=>{t(20,f[z[Me]]=M.default,f)})}let{latex_delimiters:_}=e,{pending_message:b=!1}=e,{selectable:g=!1}=e,{likeable:h=!1}=e,{show_share_button:y=!1}=e,{rtl:p=!1}=e,{show_copy_button:w=!1}=e,{avatar_images:c=[null,null]}=e,{sanitize_html:v=!0}=e,{bubble_full_width:k=!0}=e,{render_markdown:L=!0}=e,{line_breaks:W=!0}=e,{theme_mode:X}=e,{i18n:O}=e,{layout:ze="bubble"}=e,{placeholder:je=null}=e,{upload:ye}=e,{msg_format:me="tuples"}=e,Te=document.querySelector("div.gradio-container"),D,Le;const He=$o();vo(()=>{Le=D&&D.offsetHeight+D.scrollTop>D.scrollHeight-100});async function De(){await Co(),requestAnimationFrame(()=>{Le&&D?.scrollTo(0,D.scrollHeight)})}let Ee,Pe,Ae=!1;ko(()=>{(Le||f)&&De(),D.querySelectorAll("img").forEach(d=>{d.addEventListener("click",z=>{const V=z.target;V&&(t(22,Ee=V.src),t(23,Pe=V.alt),t(24,Ae=!0))})})});function m(d,z){He("select",{index:z.index,value:z.content})}function vt(d,z,V){if(me==="tuples")He("like",{index:z.index,value:z.content,liked:V==="like"});else{if(!i)return;const x=i[d],[M,Me]=[x[0],x[x.length-1]];He("like",{index:[M.index,Me.index],value:x.map(nt=>nt.content),liked:V==="like"})}}function Hn(d){const z=[];let V=[],x=null;for(const M of d)me==="tuples"&&(x=null),(M.role==="assistant"||M.role==="user")&&(M.role===x?V.push(M):(V.length>0&&z.push(V),V=[M],x=M.role));return V.length>0&&z.push(V),z}function Sn(d){Jt.call(this,l,d)}function Vn(d){Jt.call(this,l,d)}const qn=()=>{t(24,Ae=!1)},zn=(d,z)=>m(d,z),jn=(d,z,V)=>{V.key==="Enter"&&m(d,z)},Ln=(d,z,V)=>vt(d,z[0],V);function An(d){mo[d?"unshift":"push"](()=>{D=d,t(21,D)})}return l.$$set=d=>{"value"in d&&t(0,s=d.value),"_fetch"in d&&t(1,r=d._fetch),"load_component"in d&&t(30,a=d.load_component),"latex_delimiters"in d&&t(2,_=d.latex_delimiters),"pending_message"in d&&t(3,b=d.pending_message),"selectable"in d&&t(4,g=d.selectable),"likeable"in d&&t(5,h=d.likeable),"show_share_button"in d&&t(6,y=d.show_share_button),"rtl"in d&&t(7,p=d.rtl),"show_copy_button"in d&&t(8,w=d.show_copy_button),"avatar_images"in d&&t(9,c=d.avatar_images),"sanitize_html"in d&&t(10,v=d.sanitize_html),"bubble_full_width"in d&&t(11,k=d.bubble_full_width),"render_markdown"in d&&t(12,L=d.render_markdown),"line_breaks"in d&&t(13,W=d.line_breaks),"theme_mode"in d&&t(14,X=d.theme_mode),"i18n"in d&&t(15,O=d.i18n),"layout"in d&&t(16,ze=d.layout),"placeholder"in d&&t(17,je=d.placeholder),"upload"in d&&t(18,ye=d.upload),"msg_format"in d&&t(19,me=d.msg_format)},l.$$.update=()=>{l.$$.dirty[0]&1&&u(Mo(s)),l.$$.dirty[1]&2&&n(),l.$$.dirty[0]&1|l.$$.dirty[1]&1&&(Zn(s,o)||(t(31,o=s),He("change"))),l.$$.dirty[0]&1&&t(25,i=s&&Hn(s))},t(32,n=()=>{let z=getComputedStyle(document.body).getPropertyValue("--body-text-size"),V;switch(z){case"13px":V=14;break;case"14px":V=16;break;case"16px":V=20;break;default:V=14;break}document.body.style.setProperty("--chatbot-body-text-size",V+"px")}),[s,r,_,b,g,h,y,p,w,c,v,k,L,W,X,O,ze,je,ye,me,f,D,Ee,Pe,Ae,i,Te,De,m,vt,a,o,n,Sn,Vn,qn,zn,jn,Ln,An]}class No extends _o{constructor(e){super(),ho(this,e,Bo,Ao,bo,{value:0,_fetch:1,load_component:30,latex_delimiters:2,pending_message:3,selectable:4,likeable:5,show_share_button:6,rtl:7,show_copy_button:8,avatar_images:9,sanitize_html:10,bubble_full_width:11,render_markdown:12,line_breaks:13,theme_mode:14,i18n:15,layout:16,placeholder:17,upload:18,msg_format:19},null,[-1,-1])}get value(){return this.$$.ctx[0]}set value(e){this.$$set({value:e}),j()}get _fetch(){return this.$$.ctx[1]}set _fetch(e){this.$$set({_fetch:e}),j()}get load_component(){return this.$$.ctx[30]}set load_component(e){this.$$set({load_component:e}),j()}get latex_delimiters(){return this.$$.ctx[2]}set latex_delimiters(e){this.$$set({latex_delimiters:e}),j()}get pending_message(){return this.$$.ctx[3]}set pending_message(e){this.$$set({pending_message:e}),j()}get selectable(){return this.$$.ctx[4]}set selectable(e){this.$$set({selectable:e}),j()}get likeable(){return this.$$.ctx[5]}set likeable(e){this.$$set({likeable:e}),j()}get show_share_button(){return this.$$.ctx[6]}set show_share_button(e){this.$$set({show_share_button:e}),j()}get rtl(){return this.$$.ctx[7]}set rtl(e){this.$$set({rtl:e}),j()}get show_copy_button(){return this.$$.ctx[8]}set show_copy_button(e){this.$$set({show_copy_button:e}),j()}get avatar_images(){return this.$$.ctx[9]}set avatar_images(e){this.$$set({avatar_images:e}),j()}get sanitize_html(){return this.$$.ctx[10]}set sanitize_html(e){this.$$set({sanitize_html:e}),j()}get bubble_full_width(){return this.$$.ctx[11]}set bubble_full_width(e){this.$$set({bubble_full_width:e}),j()}get render_markdown(){return this.$$.ctx[12]}set render_markdown(e){this.$$set({render_markdown:e}),j()}get line_breaks(){return this.$$.ctx[13]}set line_breaks(e){this.$$set({line_breaks:e}),j()}get theme_mode(){return this.$$.ctx[14]}set theme_mode(e){this.$$set({theme_mode:e}),j()}get i18n(){return this.$$.ctx[15]}set i18n(e){this.$$set({i18n:e}),j()}get layout(){return this.$$.ctx[16]}set layout(e){this.$$set({layout:e}),j()}get placeholder(){return this.$$.ctx[17]}set placeholder(e){this.$$set({placeholder:e}),j()}get upload(){return this.$$.ctx[18]}set upload(e){this.$$set({upload:e}),j()}get msg_format(){return this.$$.ctx[19]}set msg_format(e){this.$$set({msg_format:e}),j()}}const Zo=No,{SvelteComponent:To,append:Do,assign:Eo,attr:Po,check_outros:rn,create_component:xe,destroy_component:et,detach:un,element:Uo,flush:S,get_spread_object:Io,get_spread_update:Fo,group_outros:fn,init:Ro,insert:_n,mount_component:tt,safe_not_equal:Go,space:cn,transition_in:Y,transition_out:re}=window.__gradio__svelte__internal;function mn(l){let e,t;const n=[{autoscroll:l[20].autoscroll},{i18n:l[20].i18n},l[22],{show_progress:l[22].show_progress==="hidden"?"hidden":"minimal"}];let i={};for(let s=0;s{o=null}),rn()),a[7]?r?(r.p(a,f),f[0]&128&&Y(r,1)):(r=hn(a),r.c(),Y(r,1),r.m(t,n)):r&&(fn(),re(r,1,1,()=>{r=null}),rn());const u={};f[0]&1048576&&(u.i18n=a[20].i18n),f[0]&256&&(u.selectable=a[8]),f[0]&512&&(u.likeable=a[9]),f[0]&1024&&(u.show_share_button=a[10]),f[0]&67108864&&(u.value=a[26]),f[0]&524288&&(u.latex_delimiters=a[19]),f[0]&131072&&(u.render_markdown=a[17]),f[0]&33554432&&(u.theme_mode=a[25]),f[0]&4194304&&(u.pending_message=a[22]?.status==="pending"),f[0]&2048&&(u.rtl=a[11]),f[0]&4096&&(u.show_copy_button=a[12]),f[0]&2097152&&(u.avatar_images=a[21]),f[0]&8192&&(u.sanitize_html=a[13]),f[0]&16384&&(u.bubble_full_width=a[14]),f[0]&262144&&(u.line_breaks=a[18]),f[0]&32768&&(u.layout=a[15]),f[0]&16777216&&(u.placeholder=a[24]),f[0]&1048576&&(u.upload=a[20].client.upload),f[0]&1048576&&(u._fetch=a[20].client.fetch),f[0]&1048576&&(u.load_component=a[20].load_component),f[0]&65536&&(u.msg_format=a[16]),i.$set(u)},i(a){s||(Y(o),Y(r),Y(i.$$.fragment,a),s=!0)},o(a){re(o),re(r),re(i.$$.fragment,a),s=!1},d(a){a&&(un(e),un(t)),o&&o.d(a),r&&r.d(),et(i)}}}function Yo(l){let e,t;return e=new In({props:{elem_id:l[0],elem_classes:l[1],visible:l[2],padding:!1,scale:l[4],min_width:l[5],height:l[23],allow_overflow:!1,$$slots:{default:[Oo]},$$scope:{ctx:l}}}),{c(){xe(e.$$.fragment)},m(n,i){tt(e,n,i),t=!0},p(n,i){const s={};i[0]&1&&(s.elem_id=n[0]),i[0]&2&&(s.elem_classes=n[1]),i[0]&4&&(s.visible=n[2]),i[0]&16&&(s.scale=n[4]),i[0]&32&&(s.min_width=n[5]),i[0]&8388608&&(s.height=n[23]),i[0]&125829064|i[1]&8&&(s.$$scope={dirty:i,ctx:n}),e.$set(s)},i(n){t||(Y(e.$$.fragment,n),t=!0)},o(n){re(e.$$.fragment,n),t=!1},d(n){et(e,n)}}}function Jo(l,e,t){let{elem_id:n=""}=e,{elem_classes:i=[]}=e,{visible:s=!0}=e,{value:o=[]}=e,{scale:r=null}=e,{min_width:a=void 0}=e,{label:f}=e,{show_label:u=!0}=e,{root:_}=e,{_selectable:b=!1}=e,{likeable:g=!1}=e,{show_share_button:h=!1}=e,{rtl:y=!1}=e,{show_copy_button:p=!0}=e,{sanitize_html:w=!0}=e,{bubble_full_width:c=!0}=e,{layout:v="bubble"}=e,{type:k="tuples"}=e,{render_markdown:L=!0}=e,{line_breaks:W=!0}=e,{latex_delimiters:X}=e,{gradio:O}=e,{avatar_images:ze=[null,null]}=e,je=[],{loading_status:ye=void 0}=e,{height:me=400}=e,{placeholder:Te=null}=e,{theme_mode:D}=e;const Le=()=>O.dispatch("clear_status",ye),He=()=>O.dispatch("change",o),De=m=>O.dispatch("select",m.detail),Ee=m=>O.dispatch("like",m.detail),Pe=m=>O.dispatch("share",m.detail),Ae=m=>O.dispatch("error",m.detail);return l.$$set=m=>{"elem_id"in m&&t(0,n=m.elem_id),"elem_classes"in m&&t(1,i=m.elem_classes),"visible"in m&&t(2,s=m.visible),"value"in m&&t(3,o=m.value),"scale"in m&&t(4,r=m.scale),"min_width"in m&&t(5,a=m.min_width),"label"in m&&t(6,f=m.label),"show_label"in m&&t(7,u=m.show_label),"root"in m&&t(27,_=m.root),"_selectable"in m&&t(8,b=m._selectable),"likeable"in m&&t(9,g=m.likeable),"show_share_button"in m&&t(10,h=m.show_share_button),"rtl"in m&&t(11,y=m.rtl),"show_copy_button"in m&&t(12,p=m.show_copy_button),"sanitize_html"in m&&t(13,w=m.sanitize_html),"bubble_full_width"in m&&t(14,c=m.bubble_full_width),"layout"in m&&t(15,v=m.layout),"type"in m&&t(16,k=m.type),"render_markdown"in m&&t(17,L=m.render_markdown),"line_breaks"in m&&t(18,W=m.line_breaks),"latex_delimiters"in m&&t(19,X=m.latex_delimiters),"gradio"in m&&t(20,O=m.gradio),"avatar_images"in m&&t(21,ze=m.avatar_images),"loading_status"in m&&t(22,ye=m.loading_status),"height"in m&&t(23,me=m.height),"placeholder"in m&&t(24,Te=m.placeholder),"theme_mode"in m&&t(25,D=m.theme_mode)},l.$$.update=()=>{l.$$.dirty[0]&134283272&&t(26,je=k==="tuples"?el(o,_):xn(o,_))},[n,i,s,o,r,a,f,u,b,g,h,y,p,w,c,v,k,L,W,X,O,ze,ye,me,Te,D,je,_,Le,He,De,Ee,Pe,Ae]}class cs extends To{constructor(e){super(),Ro(this,e,Jo,Yo,Go,{elem_id:0,elem_classes:1,visible:2,value:3,scale:4,min_width:5,label:6,show_label:7,root:27,_selectable:8,likeable:9,show_share_button:10,rtl:11,show_copy_button:12,sanitize_html:13,bubble_full_width:14,layout:15,type:16,render_markdown:17,line_breaks:18,latex_delimiters:19,gradio:20,avatar_images:21,loading_status:22,height:23,placeholder:24,theme_mode:25},null,[-1,-1])}get elem_id(){return this.$$.ctx[0]}set elem_id(e){this.$$set({elem_id:e}),S()}get elem_classes(){return this.$$.ctx[1]}set elem_classes(e){this.$$set({elem_classes:e}),S()}get visible(){return this.$$.ctx[2]}set visible(e){this.$$set({visible:e}),S()}get value(){return this.$$.ctx[3]}set value(e){this.$$set({value:e}),S()}get scale(){return this.$$.ctx[4]}set scale(e){this.$$set({scale:e}),S()}get min_width(){return this.$$.ctx[5]}set min_width(e){this.$$set({min_width:e}),S()}get label(){return this.$$.ctx[6]}set label(e){this.$$set({label:e}),S()}get show_label(){return this.$$.ctx[7]}set show_label(e){this.$$set({show_label:e}),S()}get root(){return this.$$.ctx[27]}set root(e){this.$$set({root:e}),S()}get _selectable(){return this.$$.ctx[8]}set _selectable(e){this.$$set({_selectable:e}),S()}get likeable(){return this.$$.ctx[9]}set likeable(e){this.$$set({likeable:e}),S()}get show_share_button(){return this.$$.ctx[10]}set show_share_button(e){this.$$set({show_share_button:e}),S()}get rtl(){return this.$$.ctx[11]}set rtl(e){this.$$set({rtl:e}),S()}get show_copy_button(){return this.$$.ctx[12]}set show_copy_button(e){this.$$set({show_copy_button:e}),S()}get sanitize_html(){return this.$$.ctx[13]}set sanitize_html(e){this.$$set({sanitize_html:e}),S()}get bubble_full_width(){return this.$$.ctx[14]}set bubble_full_width(e){this.$$set({bubble_full_width:e}),S()}get layout(){return this.$$.ctx[15]}set layout(e){this.$$set({layout:e}),S()}get type(){return this.$$.ctx[16]}set type(e){this.$$set({type:e}),S()}get render_markdown(){return this.$$.ctx[17]}set render_markdown(e){this.$$set({render_markdown:e}),S()}get line_breaks(){return this.$$.ctx[18]}set line_breaks(e){this.$$set({line_breaks:e}),S()}get latex_delimiters(){return this.$$.ctx[19]}set latex_delimiters(e){this.$$set({latex_delimiters:e}),S()}get gradio(){return this.$$.ctx[20]}set gradio(e){this.$$set({gradio:e}),S()}get avatar_images(){return this.$$.ctx[21]}set avatar_images(e){this.$$set({avatar_images:e}),S()}get loading_status(){return this.$$.ctx[22]}set loading_status(e){this.$$set({loading_status:e}),S()}get height(){return this.$$.ctx[23]}set height(e){this.$$set({height:e}),S()}get placeholder(){return this.$$.ctx[24]}set placeholder(e){this.$$set({placeholder:e}),S()}get theme_mode(){return this.$$.ctx[25]}set theme_mode(e){this.$$set({theme_mode:e}),S()}}export{Zo as BaseChatBot,cs as default}; +//# sourceMappingURL=Index-DAXYa8US.js.map diff --git a/moondream/lib/python3.10/site-packages/gradio/templates/frontend/assets/KaTeX_Caligraphic-Regular-wX97UBjC.ttf b/moondream/lib/python3.10/site-packages/gradio/templates/frontend/assets/KaTeX_Caligraphic-Regular-wX97UBjC.ttf new file mode 100644 index 0000000000000000000000000000000000000000..f522294ff0f3f8c52dfdaef7ebfaa06ebfcfaabf Binary files /dev/null and b/moondream/lib/python3.10/site-packages/gradio/templates/frontend/assets/KaTeX_Caligraphic-Regular-wX97UBjC.ttf differ diff --git a/moondream/lib/python3.10/site-packages/gradio/templates/frontend/assets/KaTeX_Fraktur-Regular-Dxdc4cR9.woff b/moondream/lib/python3.10/site-packages/gradio/templates/frontend/assets/KaTeX_Fraktur-Regular-Dxdc4cR9.woff new file mode 100644 index 0000000000000000000000000000000000000000..acab069f90b6fe6301a004e6f8beaf6a0db48bce Binary files /dev/null and b/moondream/lib/python3.10/site-packages/gradio/templates/frontend/assets/KaTeX_Fraktur-Regular-Dxdc4cR9.woff differ diff --git a/moondream/lib/python3.10/site-packages/gradio/templates/frontend/assets/KaTeX_Main-BoldItalic-SpSLRI95.woff b/moondream/lib/python3.10/site-packages/gradio/templates/frontend/assets/KaTeX_Main-BoldItalic-SpSLRI95.woff new file mode 100644 index 0000000000000000000000000000000000000000..67807b0bd4f867853271f5917fb3adf377f93f53 Binary files /dev/null and b/moondream/lib/python3.10/site-packages/gradio/templates/frontend/assets/KaTeX_Main-BoldItalic-SpSLRI95.woff differ diff --git a/moondream/lib/python3.10/site-packages/gradio/templates/frontend/assets/KaTeX_Script-Regular-D5yQViql.woff b/moondream/lib/python3.10/site-packages/gradio/templates/frontend/assets/KaTeX_Script-Regular-D5yQViql.woff new file mode 100644 index 0000000000000000000000000000000000000000..0e7da821eee0dd05a0a6f0b16c2c1345dc573a84 Binary files /dev/null and b/moondream/lib/python3.10/site-packages/gradio/templates/frontend/assets/KaTeX_Script-Regular-D5yQViql.woff differ diff --git a/moondream/lib/python3.10/site-packages/gradio/templates/frontend/assets/KaTeX_Size2-Regular-B7gKUWhC.ttf b/moondream/lib/python3.10/site-packages/gradio/templates/frontend/assets/KaTeX_Size2-Regular-B7gKUWhC.ttf new file mode 100644 index 0000000000000000000000000000000000000000..7a212caf91c0007e826fee2d622bf48acbd30dde Binary files /dev/null and b/moondream/lib/python3.10/site-packages/gradio/templates/frontend/assets/KaTeX_Size2-Regular-B7gKUWhC.ttf differ diff --git a/moondream/lib/python3.10/site-packages/gradio/templates/frontend/assets/StaticAudio-D7N_h2hQ.js b/moondream/lib/python3.10/site-packages/gradio/templates/frontend/assets/StaticAudio-D7N_h2hQ.js new file mode 100644 index 0000000000000000000000000000000000000000..92e292442c1b15f5de421ce3b0dc3a6b4aa043b9 --- /dev/null +++ b/moondream/lib/python3.10/site-packages/gradio/templates/frontend/assets/StaticAudio-D7N_h2hQ.js @@ -0,0 +1,104 @@ +import{I as jt}from"./Index-HnsngA2K.js";import{f as He,u as qt}from"./Blocks-BW0LI6Mk.js";import{B as Bt}from"./BlockLabel-du95yTCe.js";import{E as zt}from"./Empty-B-q4dRI6.js";import{S as It}from"./ShareButton-D7_uro_U.js";import{D as Ut}from"./Download-DVtk-Jv3.js";import{M as nt}from"./Music-CDm0RGMk.js";import{a as xt,P as Ft,T as Xt}from"./Trim-UKwaW4UI.js";import{U as Gt}from"./Undo-CpmTQw3B.js";import{r as ht}from"./file-url-YFl-0Cl9.js";import{D as Zt}from"./DownloadLink-CVlM3uy0.js";const{SvelteComponent:Yt,append:Jt,attr:F,detach:Kt,init:Qt,insert:ei,noop:Ue,safe_not_equal:ti,svg_element:ft}=window.__gradio__svelte__internal;function ii(s){let e,t;return{c(){e=ft("svg"),t=ft("path"),F(t,"stroke","currentColor"),F(t,"stroke-width","1.5"),F(t,"stroke-linecap","round"),F(t,"stroke-linejoin","round"),F(t,"d","M21.044 5.704a.6.6 0 0 1 .956.483v11.626a.6.6 0 0 1-.956.483l-7.889-5.813a.6.6 0 0 1 0-.966l7.89-5.813ZM10.044 5.704a.6.6 0 0 1 .956.483v11.626a.6.6 0 0 1-.956.483l-7.888-5.813a.6.6 0 0 1 0-.966l7.888-5.813Z"),F(e,"xmlns","http://www.w3.org/2000/svg"),F(e,"width","24px"),F(e,"height","24px"),F(e,"fill","currentColor"),F(e,"stroke-width","1.5"),F(e,"viewBox","0 0 24 24"),F(e,"color","currentColor")},m(i,n){ei(i,e,n),Jt(e,t)},p:Ue,i:Ue,o:Ue,d(i){i&&Kt(e)}}}class ni extends Yt{constructor(e){super(),Qt(this,e,null,ii,ti,{})}}const{SvelteComponent:si,append:ri,attr:X,detach:oi,init:li,insert:ai,noop:xe,safe_not_equal:ui,svg_element:mt}=window.__gradio__svelte__internal;function di(s){let e,t;return{c(){e=mt("svg"),t=mt("path"),X(t,"stroke","currentColor"),X(t,"stroke-width","1.5"),X(t,"stroke-linecap","round"),X(t,"stroke-linejoin","round"),X(t,"d","M2.956 5.704A.6.6 0 0 0 2 6.187v11.626a.6.6 0 0 0 .956.483l7.889-5.813a.6.6 0 0 0 0-.966l-7.89-5.813ZM13.956 5.704a.6.6 0 0 0-.956.483v11.626a.6.6 0 0 0 .956.483l7.889-5.813a.6.6 0 0 0 0-.966l-7.89-5.813Z"),X(e,"xmlns","http://www.w3.org/2000/svg"),X(e,"width","24px"),X(e,"height","24px"),X(e,"fill","currentColor"),X(e,"stroke-width","1.5"),X(e,"viewBox","0 0 24 24"),X(e,"color","currentColor")},m(i,n){ai(i,e,n),ri(e,t)},p:xe,i:xe,o:xe,d(i){i&&oi(e)}}}class ci extends si{constructor(e){super(),li(this,e,null,di,ui,{})}}const{SvelteComponent:hi,append:Ae,attr:q,detach:fi,init:mi,insert:_i,noop:Fe,safe_not_equal:pi,svg_element:We,text:gi}=window.__gradio__svelte__internal;function vi(s){let e,t,i,n,r;return{c(){e=We("svg"),t=We("title"),i=gi("Low volume"),n=We("path"),r=We("path"),q(n,"d","M19.5 7.5C19.5 7.5 21 9 21 11.5C21 14 19.5 15.5 19.5 15.5"),q(n,"stroke-width","1.5"),q(n,"stroke-linecap","round"),q(n,"stroke-linejoin","round"),q(r,"d","M2 13.8571V10.1429C2 9.03829 2.89543 8.14286 4 8.14286H6.9C7.09569 8.14286 7.28708 8.08544 7.45046 7.97772L13.4495 4.02228C14.1144 3.5839 15 4.06075 15 4.85714V19.1429C15 19.9392 14.1144 20.4161 13.4495 19.9777L7.45046 16.0223C7.28708 15.9146 7.09569 15.8571 6.9 15.8571H4C2.89543 15.8571 2 14.9617 2 13.8571Z"),q(r,"stroke-width","1.5"),q(e,"width","100%"),q(e,"height","100%"),q(e,"viewBox","0 0 24 24"),q(e,"stroke-width","1.5"),q(e,"fill","none"),q(e,"xmlns","http://www.w3.org/2000/svg"),q(e,"stroke","currentColor"),q(e,"color","currentColor")},m(o,u){_i(o,e,u),Ae(e,t),Ae(t,i),Ae(e,n),Ae(e,r)},p:Fe,i:Fe,o:Fe,d(o){o&&fi(e)}}}class bi extends hi{constructor(e){super(),mi(this,e,null,vi,pi,{})}}const{SvelteComponent:wi,append:$e,attr:A,detach:yi,init:ki,insert:Ci,noop:Xe,safe_not_equal:Ei,svg_element:Se,text:$i}=window.__gradio__svelte__internal;function Si(s){let e,t,i,n,r,o;return{c(){e=Se("svg"),t=Se("title"),i=$i("High volume"),n=Se("path"),r=Se("path"),o=Se("path"),A(n,"d","M1 13.8571V10.1429C1 9.03829 1.89543 8.14286 3 8.14286H5.9C6.09569 8.14286 6.28708 8.08544 6.45046 7.97772L12.4495 4.02228C13.1144 3.5839 14 4.06075 14 4.85714V19.1429C14 19.9392 13.1144 20.4161 12.4495 19.9777L6.45046 16.0223C6.28708 15.9146 6.09569 15.8571 5.9 15.8571H3C1.89543 15.8571 1 14.9617 1 13.8571Z"),A(n,"stroke-width","1.5"),A(r,"d","M17.5 7.5C17.5 7.5 19 9 19 11.5C19 14 17.5 15.5 17.5 15.5"),A(r,"stroke-width","1.5"),A(r,"stroke-linecap","round"),A(r,"stroke-linejoin","round"),A(o,"d","M20.5 4.5C20.5 4.5 23 7 23 11.5C23 16 20.5 18.5 20.5 18.5"),A(o,"stroke-width","1.5"),A(o,"stroke-linecap","round"),A(o,"stroke-linejoin","round"),A(e,"width","100%"),A(e,"height","100%"),A(e,"viewBox","0 0 24 24"),A(e,"stroke-width","1.5"),A(e,"fill","none"),A(e,"stroke","currentColor"),A(e,"xmlns","http://www.w3.org/2000/svg"),A(e,"color","currentColor")},m(u,a){Ci(u,e,a),$e(e,t),$e(t,i),$e(e,n),$e(e,r),$e(e,o)},p:Xe,i:Xe,o:Xe,d(u){u&&yi(e)}}}class Li extends wi{constructor(e){super(),ki(this,e,null,Si,Ei,{})}}const{SvelteComponent:Mi,append:te,attr:T,detach:Di,init:Ri,insert:Pi,noop:Ge,safe_not_equal:Ti,svg_element:ie,text:Ai}=window.__gradio__svelte__internal;function Wi(s){let e,t,i,n,r,o,u,a,d;return{c(){e=ie("svg"),t=ie("title"),i=Ai("Muted volume"),n=ie("g"),r=ie("path"),o=ie("path"),u=ie("defs"),a=ie("clipPath"),d=ie("rect"),T(r,"d","M18 14L20.0005 12M22 10L20.0005 12M20.0005 12L18 10M20.0005 12L22 14"),T(r,"stroke-width","1.5"),T(r,"stroke-linecap","round"),T(r,"stroke-linejoin","round"),T(o,"d","M2 13.8571V10.1429C2 9.03829 2.89543 8.14286 4 8.14286H6.9C7.09569 8.14286 7.28708 8.08544 7.45046 7.97772L13.4495 4.02228C14.1144 3.5839 15 4.06075 15 4.85714V19.1429C15 19.9392 14.1144 20.4161 13.4495 19.9777L7.45046 16.0223C7.28708 15.9146 7.09569 15.8571 6.9 15.8571H4C2.89543 15.8571 2 14.9617 2 13.8571Z"),T(o,"stroke-width","1.5"),T(n,"clip-path","url(#clip0_3173_16686)"),T(d,"width","24"),T(d,"height","24"),T(d,"fill","white"),T(a,"id","clip0_3173_16686"),T(e,"width","100%"),T(e,"height","100%"),T(e,"viewBox","0 0 24 24"),T(e,"stroke-width","1.5"),T(e,"fill","none"),T(e,"xmlns","http://www.w3.org/2000/svg"),T(e,"stroke","currentColor"),T(e,"color","currentColor")},m(l,c){Pi(l,e,c),te(e,t),te(t,i),te(e,n),te(n,r),te(n,o),te(e,u),te(u,a),te(a,d)},p:Ge,i:Ge,o:Ge,d(l){l&&Di(e)}}}class zi extends Mi{constructor(e){super(),Ri(this,e,null,Wi,Ti,{})}}var Oi=function(s,e,t,i){function n(r){return r instanceof t?r:new t(function(o){o(r)})}return new(t||(t=Promise))(function(r,o){function u(l){try{d(i.next(l))}catch(c){o(c)}}function a(l){try{d(i.throw(l))}catch(c){o(c)}}function d(l){l.done?r(l.value):n(l.value).then(u,a)}d((i=i.apply(s,e||[])).next())})};function Hi(s,e){return Oi(this,void 0,void 0,function*(){const t=new AudioContext({sampleRate:e});return t.decodeAudioData(s).finally(()=>t.close())})}function Vi(s){const e=s[0];if(e.some(t=>t>1||t<-1)){const t=e.length;let i=0;for(let n=0;ni&&(i=r)}for(const n of s)for(let r=0;rs?.[t],copyFromChannel:AudioBuffer.prototype.copyFromChannel,copyToChannel:AudioBuffer.prototype.copyToChannel}}const Ze={decode:Hi,createBuffer:Ni};var _t=function(s,e,t,i){function n(r){return r instanceof t?r:new t(function(o){o(r)})}return new(t||(t=Promise))(function(r,o){function u(l){try{d(i.next(l))}catch(c){o(c)}}function a(l){try{d(i.throw(l))}catch(c){o(c)}}function d(l){l.done?r(l.value):n(l.value).then(u,a)}d((i=i.apply(s,e||[])).next())})};function ji(s,e,t){var i,n;return _t(this,void 0,void 0,function*(){const r=yield fetch(s,t);{const o=(i=r.clone().body)===null||i===void 0?void 0:i.getReader(),u=Number((n=r.headers)===null||n===void 0?void 0:n.get("Content-Length"));let a=0;const d=(l,c)=>_t(this,void 0,void 0,function*(){if(l)return;a+=c?.length||0;const h=Math.round(a/u*100);return e(h),o?.read().then(({done:m,value:f})=>d(m,f))});o?.read().then(({done:l,value:c})=>d(l,c))}return r.blob()})}const qi={fetchBlob:ji};class je{constructor(){this.listeners={},this.on=this.addEventListener,this.un=this.removeEventListener}addEventListener(e,t,i){if(this.listeners[e]||(this.listeners[e]=new Set),this.listeners[e].add(t),i?.once){const n=()=>{this.removeEventListener(e,n),this.removeEventListener(e,t)};return this.addEventListener(e,n),n}return()=>this.removeEventListener(e,t)}removeEventListener(e,t){var i;(i=this.listeners[e])===null||i===void 0||i.delete(t)}once(e,t){return this.on(e,t,{once:!0})}unAll(){this.listeners={}}emit(e,...t){this.listeners[e]&&this.listeners[e].forEach(i=>i(...t))}}class Bi extends je{constructor(e){super(),this.isExternalMedia=!1,e.media?(this.media=e.media,this.isExternalMedia=!0):this.media=document.createElement("audio"),e.mediaControls&&(this.media.controls=!0),e.autoplay&&(this.media.autoplay=!0),e.playbackRate!=null&&this.onceMediaEvent("canplay",()=>{e.playbackRate!=null&&(this.media.playbackRate=e.playbackRate)})}onMediaEvent(e,t,i){return this.media.addEventListener(e,t,i),()=>this.media.removeEventListener(e,t)}onceMediaEvent(e,t){return this.onMediaEvent(e,t,{once:!0})}getSrc(){return this.media.currentSrc||this.media.src||""}revokeSrc(){const e=this.getSrc();e.startsWith("blob:")&&URL.revokeObjectURL(e)}setSrc(e,t){if(this.getSrc()===e)return;this.revokeSrc();const n=t instanceof Blob?URL.createObjectURL(t):e;this.media.src=n,this.media.load()}destroy(){this.media.pause(),!this.isExternalMedia&&(this.media.remove(),this.revokeSrc(),this.media.src="",this.media.load())}setMediaElement(e){this.media=e}play(){return this.media.play()}pause(){this.media.pause()}isPlaying(){return!this.media.paused&&!this.media.ended}setTime(e){this.media.currentTime=e}getDuration(){return this.media.duration}getCurrentTime(){return this.media.currentTime}getVolume(){return this.media.volume}setVolume(e){this.media.volume=e}getMuted(){return this.media.muted}setMuted(e){this.media.muted=e}getPlaybackRate(){return this.media.playbackRate}setPlaybackRate(e,t){t!=null&&(this.media.preservesPitch=t),this.media.playbackRate=e}getMediaElement(){return this.media}setSinkId(e){return this.media.setSinkId(e)}}function Ii(s,e,t,i,n=5){let r=()=>{};if(!s)return r;const o=u=>{if(u.button===2)return;u.preventDefault(),u.stopPropagation(),s.style.touchAction="none";let a=u.clientX,d=u.clientY,l=!1;const c=f=>{f.preventDefault(),f.stopPropagation();const g=f.clientX,p=f.clientY;if(l||Math.abs(g-a)>=n||Math.abs(p-d)>=n){const{left:C,top:k}=s.getBoundingClientRect();l||(l=!0,t?.(a-C,d-k)),e(g-a,p-d,g-C,p-k),a=g,d=p}},h=f=>{l&&(f.preventDefault(),f.stopPropagation())},m=()=>{s.style.touchAction="",l&&i?.(),r()};document.addEventListener("pointermove",c),document.addEventListener("pointerup",m),document.addEventListener("pointerleave",m),document.addEventListener("click",h,!0),r=()=>{document.removeEventListener("pointermove",c),document.removeEventListener("pointerup",m),document.removeEventListener("pointerleave",m),setTimeout(()=>{document.removeEventListener("click",h,!0)},10)}};return s.addEventListener("pointerdown",o),()=>{r(),s.removeEventListener("pointerdown",o)}}class qe extends je{constructor(e,t){super(),this.timeouts=[],this.isScrolling=!1,this.audioData=null,this.resizeObserver=null,this.isDragging=!1,this.options=e;const i=this.parentFromOptionsContainer(e.container);this.parent=i;const[n,r]=this.initHtml();i.appendChild(n),this.container=n,this.scrollContainer=r.querySelector(".scroll"),this.wrapper=r.querySelector(".wrapper"),this.canvasWrapper=r.querySelector(".canvases"),this.progressWrapper=r.querySelector(".progress"),this.cursor=r.querySelector(".cursor"),t&&r.appendChild(t),this.initEvents()}parentFromOptionsContainer(e){let t;if(typeof e=="string"?t=document.querySelector(e):e instanceof HTMLElement&&(t=e),!t)throw new Error("Container not found");return t}initEvents(){const e=i=>{const n=this.wrapper.getBoundingClientRect(),r=i.clientX-n.left,o=i.clientX-n.left,u=r/n.width,a=o/n.height;return[u,a]};this.wrapper.addEventListener("click",i=>{const[n,r]=e(i);this.emit("click",n,r)}),this.wrapper.addEventListener("dblclick",i=>{const[n,r]=e(i);this.emit("dblclick",n,r)}),this.options.dragToSeek&&this.initDrag(),this.scrollContainer.addEventListener("scroll",()=>{const{scrollLeft:i,scrollWidth:n,clientWidth:r}=this.scrollContainer,o=i/n,u=(i+r)/n;this.emit("scroll",o,u)});const t=this.createDelay(100);this.resizeObserver=new ResizeObserver(()=>{t(()=>this.reRender())}),this.resizeObserver.observe(this.scrollContainer)}initDrag(){Ii(this.wrapper,(e,t,i)=>{this.emit("drag",Math.max(0,Math.min(1,i/this.wrapper.getBoundingClientRect().width)))},()=>this.isDragging=!0,()=>this.isDragging=!1)}getHeight(){return this.options.height==null?128:isNaN(Number(this.options.height))?this.options.height==="auto"&&this.parent.clientHeight||128:Number(this.options.height)}initHtml(){const e=document.createElement("div"),t=e.attachShadow({mode:"open"});return t.innerHTML=` + + +
+
+
+
+
+
+
+ `,[e,t]}setOptions(e){if(this.options.container!==e.container){const t=this.parentFromOptionsContainer(e.container);t.appendChild(this.container),this.parent=t}e.dragToSeek&&!this.options.dragToSeek&&this.initDrag(),this.options=e,this.reRender()}getWrapper(){return this.wrapper}getScroll(){return this.scrollContainer.scrollLeft}destroy(){var e;this.container.remove(),(e=this.resizeObserver)===null||e===void 0||e.disconnect()}createDelay(e=10){const t={};return this.timeouts.push(t),i=>{t.timeout&&clearTimeout(t.timeout),t.timeout=setTimeout(i,e)}}convertColorValues(e){if(!Array.isArray(e))return e||"";if(e.length<2)return e[0]||"";const t=document.createElement("canvas"),n=t.getContext("2d").createLinearGradient(0,0,0,t.height),r=1/(e.length-1);return e.forEach((o,u)=>{const a=u*r;n.addColorStop(a,o)}),n}renderBarWaveform(e,t,i,n){const r=e[0],o=e[1]||e[0],u=r.length,{width:a,height:d}=i.canvas,l=d/2,c=window.devicePixelRatio||1,h=t.barWidth?t.barWidth*c:1,m=t.barGap?t.barGap*c:t.barWidth?h/2:0,f=t.barRadius||0,g=a/(h+m)/u,p=f&&"roundRect"in i?"roundRect":"rect";i.beginPath();let C=0,k=0,E=0;for(let _=0;_<=u;_++){const w=Math.round(_*g);if(w>C){const z=Math.round(k*l*n),x=Math.round(E*l*n),J=z+x||1;let I=l-z;t.barAlign==="top"?I=0:t.barAlign==="bottom"&&(I=d-J),i[p](C*(h+m),I,h,J,f),C=w,k=0,E=0}const $=Math.abs(r[_]||0),S=Math.abs(o[_]||0);$>k&&(k=$),S>E&&(E=S)}i.fill(),i.closePath()}renderLineWaveform(e,t,i,n){const r=o=>{const u=e[o]||e[0],a=u.length,{height:d}=i.canvas,l=d/2,c=i.canvas.width/a;i.moveTo(0,l);let h=0,m=0;for(let f=0;f<=a;f++){const g=Math.round(f*c);if(g>h){const C=Math.round(m*l*n)||1,k=l+C*(o===0?-1:1);i.lineTo(h,k),h=g,m=0}const p=Math.abs(u[f]||0);p>m&&(m=p)}i.lineTo(h,l)};i.beginPath(),r(0),r(1),i.fill(),i.closePath()}renderWaveform(e,t,i){if(i.fillStyle=this.convertColorValues(t.waveColor),t.renderFunction){t.renderFunction(e,i);return}let n=t.barHeight||1;if(t.normalize){const r=Array.from(e[0]).reduce((o,u)=>Math.max(o,Math.abs(u)),0);n=r?1/r:1}if(t.barWidth||t.barGap||t.barAlign){this.renderBarWaveform(e,t,i,n);return}this.renderLineWaveform(e,t,i,n)}renderSingleCanvas(e,t,i,n,r,o,u,a){const d=window.devicePixelRatio||1,l=document.createElement("canvas"),c=e[0].length;l.width=Math.round(i*(o-r)/c),l.height=n*d,l.style.width=`${Math.floor(l.width/d)}px`,l.style.height=`${n}px`,l.style.left=`${Math.floor(r*i/d/c)}px`,u.appendChild(l);const h=l.getContext("2d");if(this.renderWaveform(e.map(m=>m.slice(r,o)),t,h),l.width>0&&l.height>0){const m=l.cloneNode(),f=m.getContext("2d");f.drawImage(l,0,0),f.globalCompositeOperation="source-in",f.fillStyle=this.convertColorValues(t.progressColor),f.fillRect(0,0,l.width,l.height),a.appendChild(m)}}renderChannel(e,t,i){const n=document.createElement("div"),r=this.getHeight();n.style.height=`${r}px`,this.canvasWrapper.style.minHeight=`${r}px`,this.canvasWrapper.appendChild(n);const o=n.cloneNode();this.progressWrapper.appendChild(o);const{scrollLeft:u,scrollWidth:a,clientWidth:d}=this.scrollContainer,l=e[0].length,c=l/a;let h=Math.min(qe.MAX_CANVAS_WIDTH,d);if(t.barWidth||t.barGap){const w=t.barWidth||.5,$=t.barGap||w/2,S=w+$;h%S!==0&&(h=Math.floor(h/S)*S)}const m=Math.floor(Math.abs(u)*c),f=Math.floor(m+h*c),g=f-m,p=(w,$)=>{this.renderSingleCanvas(e,t,i,r,Math.max(0,w),Math.min($,l),n,o)},C=this.createDelay(),k=this.createDelay(),E=(w,$)=>{p(w,$),w>0&&C(()=>{E(w-g,$-g)})},_=(w,$)=>{p(w,$),${_(w+g,$+g)})};E(m,f),fu.timeout&&clearTimeout(u.timeout)),this.timeouts=[],this.canvasWrapper.innerHTML="",this.progressWrapper.innerHTML="",this.wrapper.style.width="",this.options.width!=null&&(this.scrollContainer.style.width=typeof this.options.width=="number"?`${this.options.width}px`:this.options.width);const t=window.devicePixelRatio||1,i=this.scrollContainer.clientWidth,n=Math.ceil(e.duration*(this.options.minPxPerSec||0));this.isScrolling=n>i;const r=this.options.fillParent&&!this.isScrolling,o=(r?i:n)*t;if(this.wrapper.style.width=r?"100%":`${n}px`,this.scrollContainer.style.overflowX=this.isScrolling?"auto":"hidden",this.scrollContainer.classList.toggle("noScrollbar",!!this.options.hideScrollbar),this.cursor.style.backgroundColor=`${this.options.cursorColor||this.options.progressColor}`,this.cursor.style.width=`${this.options.cursorWidth}px`,this.options.splitChannels)for(let u=0;u1&&u.push(e.getChannelData(1)),this.renderChannel(u,this.options,o)}this.audioData=e,this.emit("render")}reRender(){if(!this.audioData)return;const e=this.progressWrapper.clientWidth;this.render(this.audioData);const t=this.progressWrapper.clientWidth;this.scrollContainer.scrollLeft+=t-e}zoom(e){this.options.minPxPerSec=e,this.reRender()}scrollIntoView(e,t=!1){const{clientWidth:i,scrollLeft:n,scrollWidth:r}=this.scrollContainer,o=r*e,u=i/2,a=t&&this.options.autoCenter&&!this.isDragging?u:i;if(o>n+a||o=d&&o{}}start(){this.unsubscribe=this.on("tick",()=>{requestAnimationFrame(()=>{this.emit("tick")})}),this.emit("tick")}stop(){this.unsubscribe()}destroy(){this.unsubscribe()}}var Ye=function(s,e,t,i){function n(r){return r instanceof t?r:new t(function(o){o(r)})}return new(t||(t=Promise))(function(r,o){function u(l){try{d(i.next(l))}catch(c){o(c)}}function a(l){try{d(i.throw(l))}catch(c){o(c)}}function d(l){l.done?r(l.value):n(l.value).then(u,a)}d((i=i.apply(s,e||[])).next())})};class xi extends je{constructor(e=new AudioContext){super(),this.bufferNode=null,this.autoplay=!1,this.playStartTime=0,this.playedDuration=0,this._muted=!1,this.buffer=null,this.currentSrc="",this.paused=!0,this.crossOrigin=null,this.audioContext=e,this.gainNode=this.audioContext.createGain(),this.gainNode.connect(this.audioContext.destination)}load(){return Ye(this,void 0,void 0,function*(){})}get src(){return this.currentSrc}set src(e){this.currentSrc=e,fetch(e).then(t=>t.arrayBuffer()).then(t=>this.audioContext.decodeAudioData(t)).then(t=>{this.buffer=t,this.emit("loadedmetadata"),this.emit("canplay"),this.autoplay&&this.play()})}_play(){var e;this.paused&&(this.paused=!1,(e=this.bufferNode)===null||e===void 0||e.disconnect(),this.bufferNode=this.audioContext.createBufferSource(),this.bufferNode.buffer=this.buffer,this.bufferNode.connect(this.gainNode),this.playedDuration>=this.duration&&(this.playedDuration=0),this.bufferNode.start(this.audioContext.currentTime,this.playedDuration),this.playStartTime=this.audioContext.currentTime,this.bufferNode.onended=()=>{this.currentTime>=this.duration&&(this.pause(),this.emit("ended"))})}_pause(){var e;this.paused||(this.paused=!0,(e=this.bufferNode)===null||e===void 0||e.stop(),this.playedDuration+=this.audioContext.currentTime-this.playStartTime)}play(){return Ye(this,void 0,void 0,function*(){this._play(),this.emit("play")})}pause(){this._pause(),this.emit("pause")}setSinkId(e){return Ye(this,void 0,void 0,function*(){return this.audioContext.setSinkId(e)})}get playbackRate(){var e,t;return(t=(e=this.bufferNode)===null||e===void 0?void 0:e.playbackRate.value)!==null&&t!==void 0?t:1}set playbackRate(e){this.bufferNode&&(this.bufferNode.playbackRate.value=e)}get currentTime(){return this.paused?this.playedDuration:this.playedDuration+this.audioContext.currentTime-this.playStartTime}set currentTime(e){this.emit("seeking"),this.paused?this.playedDuration=e:(this._pause(),this.playedDuration=e,this._play()),this.emit("timeupdate")}get duration(){var e;return((e=this.buffer)===null||e===void 0?void 0:e.duration)||0}get volume(){return this.gainNode.gain.value}set volume(e){this.gainNode.gain.value=e,this.emit("volumechange")}get muted(){return this._muted}set muted(e){this._muted!==e&&(this._muted=e,this._muted?this.gainNode.disconnect():this.gainNode.connect(this.audioContext.destination))}getGainNode(){return this.gainNode}}var ve=function(s,e,t,i){function n(r){return r instanceof t?r:new t(function(o){o(r)})}return new(t||(t=Promise))(function(r,o){function u(l){try{d(i.next(l))}catch(c){o(c)}}function a(l){try{d(i.throw(l))}catch(c){o(c)}}function d(l){l.done?r(l.value):n(l.value).then(u,a)}d((i=i.apply(s,e||[])).next())})};const Fi={waveColor:"#999",progressColor:"#555",cursorWidth:1,minPxPerSec:0,fillParent:!0,interact:!0,dragToSeek:!1,autoScroll:!0,autoCenter:!0,sampleRate:8e3};class st extends Bi{static create(e){return new st(e)}constructor(e){const t=e.media||(e.backend==="WebAudio"?new xi:void 0);super({media:t,mediaControls:e.mediaControls,autoplay:e.autoplay,playbackRate:e.audioRate}),this.plugins=[],this.decodedData=null,this.subscriptions=[],this.mediaSubscriptions=[],this.options=Object.assign({},Fi,e),this.timer=new Ui;const i=t?void 0:this.getMediaElement();this.renderer=new qe(this.options,i),this.initPlayerEvents(),this.initRendererEvents(),this.initTimerEvents(),this.initPlugins();const n=this.options.url||this.getSrc();n?this.load(n,this.options.peaks,this.options.duration):this.options.peaks&&this.options.duration&&this.loadPredecoded()}initTimerEvents(){this.subscriptions.push(this.timer.on("tick",()=>{const e=this.getCurrentTime();this.renderer.renderProgress(e/this.getDuration(),!0),this.emit("timeupdate",e),this.emit("audioprocess",e)}))}initPlayerEvents(){this.mediaSubscriptions.push(this.onMediaEvent("timeupdate",()=>{const e=this.getCurrentTime();this.renderer.renderProgress(e/this.getDuration(),this.isPlaying()),this.emit("timeupdate",e)}),this.onMediaEvent("play",()=>{this.emit("play"),this.timer.start()}),this.onMediaEvent("pause",()=>{this.emit("pause"),this.timer.stop()}),this.onMediaEvent("emptied",()=>{this.timer.stop()}),this.onMediaEvent("ended",()=>{this.emit("finish")}),this.onMediaEvent("seeking",()=>{this.emit("seeking",this.getCurrentTime())}))}initRendererEvents(){this.subscriptions.push(this.renderer.on("click",(e,t)=>{this.options.interact&&(this.seekTo(e),this.emit("interaction",e*this.getDuration()),this.emit("click",e,t))}),this.renderer.on("dblclick",(e,t)=>{this.emit("dblclick",e,t)}),this.renderer.on("scroll",(e,t)=>{const i=this.getDuration();this.emit("scroll",e*i,t*i)}),this.renderer.on("render",()=>{this.emit("redraw")}));{let e;this.subscriptions.push(this.renderer.on("drag",t=>{this.options.interact&&(this.renderer.renderProgress(t),clearTimeout(e),e=setTimeout(()=>{this.seekTo(t)},this.isPlaying()?0:200),this.emit("interaction",t*this.getDuration()),this.emit("drag",t))}))}}initPlugins(){var e;!((e=this.options.plugins)===null||e===void 0)&&e.length&&this.options.plugins.forEach(t=>{this.registerPlugin(t)})}unsubscribePlayerEvents(){this.mediaSubscriptions.forEach(e=>e()),this.mediaSubscriptions=[]}setOptions(e){this.options=Object.assign({},this.options,e),this.renderer.setOptions(this.options),e.audioRate&&this.setPlaybackRate(e.audioRate),e.mediaControls!=null&&(this.getMediaElement().controls=e.mediaControls)}registerPlugin(e){return e.init(this),this.plugins.push(e),this.subscriptions.push(e.once("destroy",()=>{this.plugins=this.plugins.filter(t=>t!==e)})),e}getWrapper(){return this.renderer.getWrapper()}getScroll(){return this.renderer.getScroll()}getActivePlugins(){return this.plugins}loadPredecoded(){return ve(this,void 0,void 0,function*(){this.options.peaks&&this.options.duration&&(this.decodedData=Ze.createBuffer(this.options.peaks,this.options.duration),yield Promise.resolve(),this.renderDecoded())})}renderDecoded(){return ve(this,void 0,void 0,function*(){this.decodedData&&(this.emit("decode",this.getDuration()),this.renderer.render(this.decodedData))})}loadAudio(e,t,i,n){return ve(this,void 0,void 0,function*(){if(this.emit("load",e),!this.options.media&&this.isPlaying()&&this.pause(),this.decodedData=null,!t&&!i){const r=o=>this.emit("loading",o);t=yield qi.fetchBlob(e,r,this.options.fetchParams)}if(this.setSrc(e,t),n=(yield Promise.resolve(n||this.getDuration()))||(yield new Promise(r=>{this.onceMediaEvent("loadedmetadata",()=>r(this.getDuration()))}))||(yield Promise.resolve(0)),i)this.decodedData=Ze.createBuffer(i,n);else if(t){const r=yield t.arrayBuffer();this.decodedData=yield Ze.decode(r,this.options.sampleRate)}this.renderDecoded(),this.emit("ready",this.getDuration())})}load(e,t,i){return ve(this,void 0,void 0,function*(){yield this.loadAudio(e,void 0,t,i)})}loadBlob(e,t,i){return ve(this,void 0,void 0,function*(){yield this.loadAudio("blob",e,t,i)})}zoom(e){if(!this.decodedData)throw new Error("No audio loaded");this.renderer.zoom(e),this.emit("zoom",e)}getDecodedData(){return this.decodedData}exportPeaks({channels:e=2,maxLength:t=8e3,precision:i=1e4}={}){if(!this.decodedData)throw new Error("The audio has not been decoded yet");const n=Math.min(e,this.decodedData.numberOfChannels),r=[];for(let o=0;oe.destroy()),this.subscriptions.forEach(e=>e()),this.unsubscribePlayerEvents(),this.timer.destroy(),this.renderer.destroy(),super.destroy()}}function Xi(s){const e=s.numberOfChannels,t=s.length*e*2+44,i=new ArrayBuffer(t),n=new DataView(i);let r=0;const o=function(u,a,d){for(let l=0;l{const n=new AudioContext({sampleRate:i||s.sampleRate}),r=s.numberOfChannels,o=i||s.sampleRate;let u=s.length,a=0;e&&t&&(a=Math.round(e*o),u=Math.round(t*o)-a);const d=n.createBuffer(r,u,o);for(let l=0;l{s&&s.skip(e)},ye=(s,e)=>(e||(e=5),s/100*e||5);class Ot{constructor(){this.listeners={},this.on=this.addEventListener,this.un=this.removeEventListener}addEventListener(e,t,i){if(this.listeners[e]||(this.listeners[e]=new Set),this.listeners[e].add(t),i?.once){const n=()=>{this.removeEventListener(e,n),this.removeEventListener(e,t)};return this.addEventListener(e,n),n}return()=>this.removeEventListener(e,t)}removeEventListener(e,t){var i;(i=this.listeners[e])===null||i===void 0||i.delete(t)}once(e,t){return this.on(e,t,{once:!0})}unAll(){this.listeners={}}emit(e,...t){this.listeners[e]&&this.listeners[e].forEach(i=>i(...t))}}class Zi extends Ot{constructor(e){super(),this.subscriptions=[],this.options=e}onInit(){}init(e){this.wavesurfer=e,this.onInit()}destroy(){this.emit("destroy"),this.subscriptions.forEach(e=>e())}}function Oe(s,e,t,i,n=5){let r=()=>{};if(!s)return r;const o=u=>{if(u.button===2)return;u.preventDefault(),u.stopPropagation(),s.style.touchAction="none";let a=u.clientX,d=u.clientY,l=!1;const c=f=>{f.preventDefault(),f.stopPropagation();const g=f.clientX,p=f.clientY;if(l||Math.abs(g-a)>=n||Math.abs(p-d)>=n){const{left:C,top:k}=s.getBoundingClientRect();l||(l=!0,t?.(a-C,d-k)),e(g-a,p-d,g-C,p-k),a=g,d=p}},h=f=>{l&&(f.preventDefault(),f.stopPropagation())},m=()=>{s.style.touchAction="",l&&i?.(),r()};document.addEventListener("pointermove",c),document.addEventListener("pointerup",m),document.addEventListener("pointerleave",m),document.addEventListener("click",h,!0),r=()=>{document.removeEventListener("pointermove",c),document.removeEventListener("pointerup",m),document.removeEventListener("pointerleave",m),setTimeout(()=>{document.removeEventListener("click",h,!0)},10)}};return s.addEventListener("pointerdown",o),()=>{r(),s.removeEventListener("pointerdown",o)}}class gt extends Ot{constructor(e,t,i=0){var n,r,o,u,a,d,l;super(),this.totalDuration=t,this.numberOfChannels=i,this.minLength=0,this.maxLength=1/0,this.id=e.id||`region-${Math.random().toString(32).slice(2)}`,this.start=this.clampPosition(e.start),this.end=this.clampPosition((n=e.end)!==null&&n!==void 0?n:e.start),this.drag=(r=e.drag)===null||r===void 0||r,this.resize=(o=e.resize)===null||o===void 0||o,this.color=(u=e.color)!==null&&u!==void 0?u:"rgba(0, 0, 0, 0.1)",this.minLength=(a=e.minLength)!==null&&a!==void 0?a:this.minLength,this.maxLength=(d=e.maxLength)!==null&&d!==void 0?d:this.maxLength,this.channelIdx=(l=e.channelIdx)!==null&&l!==void 0?l:-1,this.element=this.initElement(),this.setContent(e.content),this.setPart(),this.renderPosition(),this.initMouseEvents()}clampPosition(e){return Math.max(0,Math.min(this.totalDuration,e))}setPart(){const e=this.start===this.end;this.element.setAttribute("part",`${e?"marker":"region"} ${this.id}`)}addResizeHandles(e){const t=document.createElement("div");t.setAttribute("data-resize","left"),t.setAttribute("style",` + position: absolute; + z-index: 2; + width: 6px; + height: 100%; + top: 0; + left: 0; + border-left: 2px solid rgba(0, 0, 0, 0.5); + border-radius: 2px 0 0 2px; + cursor: ew-resize; + word-break: keep-all; + `),t.setAttribute("part","region-handle region-handle-left");const i=t.cloneNode();i.setAttribute("data-resize","right"),i.style.left="",i.style.right="0",i.style.borderRight=i.style.borderLeft,i.style.borderLeft="",i.style.borderRadius="0 2px 2px 0",i.setAttribute("part","region-handle region-handle-right"),e.appendChild(t),e.appendChild(i),Oe(t,n=>this.onResize(n,"start"),()=>null,()=>this.onEndResizing(),1),Oe(i,n=>this.onResize(n,"end"),()=>null,()=>this.onEndResizing(),1)}removeResizeHandles(e){const t=e.querySelector('[data-resize="left"]'),i=e.querySelector('[data-resize="right"]');t&&e.removeChild(t),i&&e.removeChild(i)}initElement(){const e=document.createElement("div"),t=this.start===this.end;let i=0,n=100;return this.channelIdx>=0&&this.channelIdxthis.emit("click",t)),e.addEventListener("mouseenter",t=>this.emit("over",t)),e.addEventListener("mouseleave",t=>this.emit("leave",t)),e.addEventListener("dblclick",t=>this.emit("dblclick",t)),Oe(e,t=>this.onMove(t),()=>this.onStartMoving(),()=>this.onEndMoving()))}onStartMoving(){this.drag&&(this.element.style.cursor="grabbing")}onEndMoving(){this.drag&&(this.element.style.cursor="grab",this.emit("update-end"))}_onUpdate(e,t){if(!this.element.parentElement)return;const i=e/this.element.parentElement.clientWidth*this.totalDuration,n=t&&t!=="start"?this.start:this.start+i,r=t&&t!=="end"?this.end:this.end+i,o=r-n;n>=0&&r<=this.totalDuration&&n<=r&&o>=this.minLength&&o<=this.maxLength&&(this.start=n,this.end=r,this.renderPosition(),this.emit("update"))}onMove(e){this.drag&&this._onUpdate(e)}onResize(e,t){this.resize&&this._onUpdate(e,t)}onEndResizing(){this.resize&&this.emit("update-end")}_setTotalDuration(e){this.totalDuration=e,this.renderPosition()}play(){this.emit("play")}setContent(e){var t;if((t=this.content)===null||t===void 0||t.remove(),e){if(typeof e=="string"){this.content=document.createElement("div");const i=this.start===this.end;this.content.style.padding=`0.2em ${i?.2:.4}em`,this.content.textContent=e}else this.content=e;this.content.setAttribute("part","region-content"),this.element.appendChild(this.content)}else this.content=void 0}setOptions(e){var t,i;if(e.color&&(this.color=e.color,this.element.style.backgroundColor=this.color),e.drag!==void 0&&(this.drag=e.drag,this.element.style.cursor=this.drag?"grab":"default"),e.start!==void 0||e.end!==void 0){const n=this.start===this.end;this.start=this.clampPosition((t=e.start)!==null&&t!==void 0?t:this.start),this.end=this.clampPosition((i=e.end)!==null&&i!==void 0?i:n?this.start:this.end),this.renderPosition(),this.setPart()}if(e.content&&this.setContent(e.content),e.id&&(this.id=e.id,this.setPart()),e.resize!==void 0&&e.resize!==this.resize){const n=this.start===this.end;this.resize=e.resize,this.resize&&!n?this.addResizeHandles(this.element):this.removeResizeHandles(this.element)}}remove(){this.emit("remove"),this.element.remove(),this.element=null}}class rt extends Zi{constructor(e){super(e),this.regions=[],this.regionsContainer=this.initRegionsContainer()}static create(e){return new rt(e)}onInit(){if(!this.wavesurfer)throw Error("WaveSurfer is not initialized");this.wavesurfer.getWrapper().appendChild(this.regionsContainer);let e=[];this.subscriptions.push(this.wavesurfer.on("timeupdate",t=>{const i=this.regions.filter(n=>n.start<=t&&n.end>=t);i.forEach(n=>{e.includes(n)||this.emit("region-in",n)}),e.forEach(n=>{i.includes(n)||this.emit("region-out",n)}),e=i}))}initRegionsContainer(){const e=document.createElement("div");return e.setAttribute("style",` + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + z-index: 3; + pointer-events: none; + `),e}getRegions(){return this.regions}avoidOverlapping(e){if(!e.content)return;const t=e.content,i=t.getBoundingClientRect().left,n=e.element.scrollWidth,r=this.regions.filter(o=>{if(o===e||!o.content)return!1;const u=o.content.getBoundingClientRect().left,a=o.element.scrollWidth;return i{var u;return((u=o.content)===null||u===void 0?void 0:u.getBoundingClientRect().height)||0}).reduce((o,u)=>o+u,0);t.style.marginTop=`${r}px`}saveRegion(e){this.regionsContainer.appendChild(e.element),this.avoidOverlapping(e),this.regions.push(e);const t=[e.on("update-end",()=>{this.avoidOverlapping(e),this.emit("region-updated",e)}),e.on("play",()=>{var i,n;(i=this.wavesurfer)===null||i===void 0||i.play(),(n=this.wavesurfer)===null||n===void 0||n.setTime(e.start)}),e.on("click",i=>{this.emit("region-clicked",e,i)}),e.on("dblclick",i=>{this.emit("region-double-clicked",e,i)}),e.once("remove",()=>{t.forEach(i=>i()),this.regions=this.regions.filter(i=>i!==e)})];this.subscriptions.push(...t),this.emit("region-created",e)}addRegion(e){var t,i;if(!this.wavesurfer)throw Error("WaveSurfer is not initialized");const n=this.wavesurfer.getDuration(),r=(i=(t=this.wavesurfer)===null||t===void 0?void 0:t.getDecodedData())===null||i===void 0?void 0:i.numberOfChannels,o=new gt(e,n,r);return n?this.saveRegion(o):this.subscriptions.push(this.wavesurfer.once("ready",u=>{o._setTotalDuration(u),this.saveRegion(o)})),o}enableDragSelection(e){var t,i;const n=(i=(t=this.wavesurfer)===null||t===void 0?void 0:t.getWrapper())===null||i===void 0?void 0:i.querySelector("div");if(!n)return()=>{};let r=null,o=0;return Oe(n,(u,a,d)=>{r&&r._onUpdate(u,d>o?"end":"start")},u=>{var a,d;if(o=u,!this.wavesurfer)return;const l=this.wavesurfer.getDuration(),c=(d=(a=this.wavesurfer)===null||a===void 0?void 0:a.getDecodedData())===null||d===void 0?void 0:d.numberOfChannels,h=this.wavesurfer.getWrapper().clientWidth,m=u/h*l,f=(u+5)/h*l;r=new gt(Object.assign(Object.assign({},e),{start:m,end:f}),l,c),this.regionsContainer.appendChild(r.element)},()=>{r&&(this.saveRegion(r),r=null)})}clearRegions(){this.regions.forEach(e=>e.remove())}destroy(){this.clearRegions(),super.destroy()}}const{SvelteComponent:Yi,check_outros:Ji,create_component:ot,destroy_component:lt,detach:Ki,empty:Qi,flush:en,group_outros:tn,init:nn,insert:sn,mount_component:at,safe_not_equal:rn,transition_in:Re,transition_out:Pe}=window.__gradio__svelte__internal;function on(s){let e,t;return e=new Li({}),{c(){ot(e.$$.fragment)},m(i,n){at(e,i,n),t=!0},i(i){t||(Re(e.$$.fragment,i),t=!0)},o(i){Pe(e.$$.fragment,i),t=!1},d(i){lt(e,i)}}}function ln(s){let e,t;return e=new bi({}),{c(){ot(e.$$.fragment)},m(i,n){at(e,i,n),t=!0},i(i){t||(Re(e.$$.fragment,i),t=!0)},o(i){Pe(e.$$.fragment,i),t=!1},d(i){lt(e,i)}}}function an(s){let e,t;return e=new zi({}),{c(){ot(e.$$.fragment)},m(i,n){at(e,i,n),t=!0},i(i){t||(Re(e.$$.fragment,i),t=!0)},o(i){Pe(e.$$.fragment,i),t=!1},d(i){lt(e,i)}}}function un(s){let e,t,i,n;const r=[an,ln,on],o=[];function u(a,d){return a[0]==0?0:a[0]<.5?1:a[0]>=.5?2:-1}return~(e=u(s))&&(t=o[e]=r[e](s)),{c(){t&&t.c(),i=Qi()},m(a,d){~e&&o[e].m(a,d),sn(a,i,d),n=!0},p(a,[d]){let l=e;e=u(a),e!==l&&(t&&(tn(),Pe(o[l],1,1,()=>{o[l]=null}),Ji()),~e?(t=o[e],t||(t=o[e]=r[e](a),t.c()),Re(t,1),t.m(i.parentNode,i)):t=null)},i(a){n||(Re(t),n=!0)},o(a){Pe(t),n=!1},d(a){a&&Ki(i),~e&&o[e].d(a)}}}function dn(s,e,t){let{currentVolume:i}=e;return s.$$set=n=>{"currentVolume"in n&&t(0,i=n.currentVolume)},[i]}class cn extends Yi{constructor(e){super(),nn(this,e,dn,un,rn,{currentVolume:0})}get currentVolume(){return this.$$.ctx[0]}set currentVolume(e){this.$$set({currentVolume:e}),en()}}const{SvelteComponent:hn,attr:be,binding_callbacks:fn,detach:mn,element:_n,flush:Je,init:pn,insert:gn,listen:vt,noop:bt,run_all:vn,safe_not_equal:bn}=window.__gradio__svelte__internal,{onMount:wn}=window.__gradio__svelte__internal;function yn(s){let e,t,i;return{c(){e=_n("input"),be(e,"id","volume"),be(e,"class","volume-slider svelte-wuo8j5"),be(e,"type","range"),be(e,"min","0"),be(e,"max","1"),be(e,"step","0.01"),e.value=s[0]},m(n,r){gn(n,e,r),s[4](e),t||(i=[vt(e,"focusout",s[5]),vt(e,"input",s[6])],t=!0)},p(n,[r]){r&1&&(e.value=n[0])},i:bt,o:bt,d(n){n&&mn(e),s[4](null),t=!1,vn(i)}}}function kn(s,e,t){let{currentVolume:i=1}=e,{show_volume_slider:n=!1}=e,{waveform:r}=e,o;wn(()=>{u()});const u=()=>{let c=o;c&&(c.style.background=`linear-gradient(to right, var(--color-accent) ${i*100}%, var(--neutral-400) ${i*100}%)`)};function a(c){fn[c?"unshift":"push"](()=>{o=c,t(3,o)})}const d=()=>t(1,n=!1),l=c=>{c.target instanceof HTMLInputElement&&(t(0,i=parseFloat(c.target.value)),r.setVolume(i))};return s.$$set=c=>{"currentVolume"in c&&t(0,i=c.currentVolume),"show_volume_slider"in c&&t(1,n=c.show_volume_slider),"waveform"in c&&t(2,r=c.waveform)},s.$$.update=()=>{s.$$.dirty&1&&u()},[i,n,r,o,a,d,l]}class Cn extends hn{constructor(e){super(),pn(this,e,kn,yn,bn,{currentVolume:0,show_volume_slider:1,waveform:2})}get currentVolume(){return this.$$.ctx[0]}set currentVolume(e){this.$$set({currentVolume:e}),Je()}get show_volume_slider(){return this.$$.ctx[1]}set show_volume_slider(e){this.$$set({show_volume_slider:e}),Je()}get waveform(){return this.$$.ctx[2]}set waveform(e){this.$$set({waveform:e}),Je()}}const{SvelteComponent:En,add_flush_callback:wt,append:O,attr:M,bind:yt,binding_callbacks:kt,check_outros:Le,create_component:se,destroy_component:re,detach:oe,element:B,empty:$n,flush:N,group_outros:Me,init:Sn,insert:le,listen:ee,mount_component:ae,noop:De,run_all:Ht,safe_not_equal:Ln,set_data:Mn,set_style:Ct,space:ne,text:Et,toggle_class:$t,transition_in:R,transition_out:W}=window.__gradio__svelte__internal;function St(s){let e,t,i,n;function r(a){s[27](a)}function o(a){s[28](a)}let u={waveform:s[2]};return s[12]!==void 0&&(u.currentVolume=s[12]),s[1]!==void 0&&(u.show_volume_slider=s[1]),e=new Cn({props:u}),kt.push(()=>yt(e,"currentVolume",r)),kt.push(()=>yt(e,"show_volume_slider",o)),{c(){se(e.$$.fragment)},m(a,d){ae(e,a,d),n=!0},p(a,d){const l={};d[0]&4&&(l.waveform=a[2]),!t&&d[0]&4096&&(t=!0,l.currentVolume=a[12],wt(()=>t=!1)),!i&&d[0]&2&&(i=!0,l.show_volume_slider=a[1],wt(()=>i=!1)),e.$set(l)},i(a){n||(R(e.$$.fragment,a),n=!0)},o(a){W(e.$$.fragment,a),n=!1},d(a){re(e,a)}}}function Dn(s){let e,t;return e=new xt({}),{c(){se(e.$$.fragment)},m(i,n){ae(e,i,n),t=!0},i(i){t||(R(e.$$.fragment,i),t=!0)},o(i){W(e.$$.fragment,i),t=!1},d(i){re(e,i)}}}function Rn(s){let e,t;return e=new Ft({}),{c(){se(e.$$.fragment)},m(i,n){ae(e,i,n),t=!0},i(i){t||(R(e.$$.fragment,i),t=!0)},o(i){W(e.$$.fragment,i),t=!1},d(i){re(e,i)}}}function Lt(s){let e,t,i,n,r,o=s[6]&&s[0]===""&&Mt(s);const u=[Tn,Pn],a=[];function d(l,c){return l[0]===""?0:1}return t=d(s),i=a[t]=u[t](s),{c(){o&&o.c(),e=ne(),i.c(),n=$n()},m(l,c){o&&o.m(l,c),le(l,e,c),a[t].m(l,c),le(l,n,c),r=!0},p(l,c){l[6]&&l[0]===""?o?(o.p(l,c),c[0]&65&&R(o,1)):(o=Mt(l),o.c(),R(o,1),o.m(e.parentNode,e)):o&&(Me(),W(o,1,1,()=>{o=null}),Le());let h=t;t=d(l),t===h?a[t].p(l,c):(Me(),W(a[h],1,1,()=>{a[h]=null}),Le(),i=a[t],i?i.p(l,c):(i=a[t]=u[t](l),i.c()),R(i,1),i.m(n.parentNode,n))},i(l){r||(R(o),R(i),r=!0)},o(l){W(o),W(i),r=!1},d(l){l&&(oe(e),oe(n)),o&&o.d(l),a[t].d(l)}}}function Mt(s){let e,t,i,n,r;return t=new Gt({}),{c(){e=B("button"),se(t.$$.fragment),M(e,"class","action icon svelte-ije4bl"),M(e,"aria-label","Reset audio")},m(o,u){le(o,e,u),ae(t,e,null),i=!0,n||(r=ee(e,"click",s[33]),n=!0)},p:De,i(o){i||(R(t.$$.fragment,o),i=!0)},o(o){W(t.$$.fragment,o),i=!1},d(o){o&&oe(e),re(t),n=!1,r()}}}function Pn(s){let e,t,i,n,r;return{c(){e=B("button"),e.textContent="Trim",t=ne(),i=B("button"),i.textContent="Cancel",M(e,"class","text-button svelte-ije4bl"),M(i,"class","text-button svelte-ije4bl")},m(o,u){le(o,e,u),le(o,t,u),le(o,i,u),n||(r=[ee(e,"click",s[14]),ee(i,"click",s[16])],n=!0)},p:De,i:De,o:De,d(o){o&&(oe(e),oe(t),oe(i)),n=!1,Ht(r)}}}function Tn(s){let e,t,i,n,r;return t=new Xt({}),{c(){e=B("button"),se(t.$$.fragment),M(e,"class","action icon svelte-ije4bl"),M(e,"aria-label","Trim audio to selection")},m(o,u){le(o,e,u),ae(t,e,null),i=!0,n||(r=ee(e,"click",s[16]),n=!0)},p:De,i(o){i||(R(t.$$.fragment,o),i=!0)},o(o){W(t.$$.fragment,o),i=!1},d(o){o&&oe(e),re(t),n=!1,r()}}}function An(s){let e,t,i,n,r,o,u,a,d,l,c,h,m,f,g,p,C,k,E,_,w,$,S,z,x,J,I,H,de,ce;n=new cn({props:{currentVolume:s[12]}});let D=s[1]&&St(s);g=new ni({});const pe=[Rn,Dn],G=[];function v(y,P){return y[5]?0:1}E=v(s),_=G[E]=pe[E](s),z=new ci({});let L=s[10]&&s[7]&&Lt(s);return{c(){e=B("div"),t=B("div"),i=B("button"),se(n.$$.fragment),r=ne(),D&&D.c(),o=ne(),u=B("button"),a=B("span"),d=Et(s[11]),l=Et("x"),h=ne(),m=B("div"),f=B("button"),se(g.$$.fragment),C=ne(),k=B("button"),_.c(),$=ne(),S=B("button"),se(z.$$.fragment),J=ne(),I=B("div"),L&&L.c(),M(i,"class","action icon volume svelte-ije4bl"),M(i,"aria-label","Adjust volume"),Ct(i,"color",s[1]?"var(--color-accent)":"var(--neutral-400)"),M(u,"class","playback icon svelte-ije4bl"),M(u,"aria-label",c=`Adjust playback speed to ${s[13][(s[13].indexOf(s[11])+1)%s[13].length]}x`),$t(u,"hidden",s[1]),M(t,"class","control-wrapper svelte-ije4bl"),M(f,"class","rewind icon svelte-ije4bl"),M(f,"aria-label",p=`Skip backwards by ${ye(s[3],s[9].skip_length)} seconds`),M(k,"class","play-pause-button icon svelte-ije4bl"),M(k,"aria-label",w=s[5]?s[4]("audio.pause"):s[4]("audio.play")),M(S,"class","skip icon svelte-ije4bl"),M(S,"aria-label",x="Skip forward by "+ye(s[3],s[9].skip_length)+" seconds"),M(m,"class","play-pause-wrapper svelte-ije4bl"),M(I,"class","settings-wrapper svelte-ije4bl"),M(e,"class","controls svelte-ije4bl"),M(e,"data-testid","waveform-controls")},m(y,P){le(y,e,P),O(e,t),O(t,i),ae(n,i,null),O(t,r),D&&D.m(t,null),O(t,o),O(t,u),O(u,a),O(a,d),O(a,l),O(e,h),O(e,m),O(m,f),ae(g,f,null),O(m,C),O(m,k),G[E].m(k,null),O(m,$),O(m,S),ae(z,S,null),O(e,J),O(e,I),L&&L.m(I,null),H=!0,de||(ce=[ee(i,"click",s[26]),ee(u,"click",s[29]),ee(f,"click",s[30]),ee(k,"click",s[31]),ee(S,"click",s[32])],de=!0)},p(y,P){const Te={};P[0]&4096&&(Te.currentVolume=y[12]),n.$set(Te),P[0]&2&&Ct(i,"color",y[1]?"var(--color-accent)":"var(--neutral-400)"),y[1]?D?(D.p(y,P),P[0]&2&&R(D,1)):(D=St(y),D.c(),R(D,1),D.m(t,o)):D&&(Me(),W(D,1,1,()=>{D=null}),Le()),(!H||P[0]&2048)&&Mn(d,y[11]),(!H||P[0]&2048&&c!==(c=`Adjust playback speed to ${y[13][(y[13].indexOf(y[11])+1)%y[13].length]}x`))&&M(u,"aria-label",c),(!H||P[0]&2)&&$t(u,"hidden",y[1]),(!H||P[0]&520&&p!==(p=`Skip backwards by ${ye(y[3],y[9].skip_length)} seconds`))&&M(f,"aria-label",p);let b=E;E=v(y),E!==b&&(Me(),W(G[b],1,1,()=>{G[b]=null}),Le(),_=G[E],_||(_=G[E]=pe[E](y),_.c()),R(_,1),_.m(k,null)),(!H||P[0]&48&&w!==(w=y[5]?y[4]("audio.pause"):y[4]("audio.play")))&&M(k,"aria-label",w),(!H||P[0]&520&&x!==(x="Skip forward by "+ye(y[3],y[9].skip_length)+" seconds"))&&M(S,"aria-label",x),y[10]&&y[7]?L?(L.p(y,P),P[0]&1152&&R(L,1)):(L=Lt(y),L.c(),R(L,1),L.m(I,null)):L&&(Me(),W(L,1,1,()=>{L=null}),Le())},i(y){H||(R(n.$$.fragment,y),R(D),R(g.$$.fragment,y),R(_),R(z.$$.fragment,y),R(L),H=!0)},o(y){W(n.$$.fragment,y),W(D),W(g.$$.fragment,y),W(_),W(z.$$.fragment,y),W(L),H=!1},d(y){y&&oe(e),re(n),D&&D.d(),re(g),G[E].d(),re(z),L&&L.d(),de=!1,Ht(ce)}}}function Wn(s,e,t){let{waveform:i}=e,{audio_duration:n}=e,{i18n:r}=e,{playing:o}=e,{show_redo:u=!1}=e,{interactive:a=!1}=e,{handle_trim_audio:d}=e,{mode:l=""}=e,{container:c}=e,{handle_reset_value:h}=e,{waveform_options:m={}}=e,{trim_region_settings:f={}}=e,{show_volume_slider:g=!1}=e,{editable:p=!0}=e,{trimDuration:C=0}=e,k=[.5,1,1.5,2],E=k[1],_,w=null,$,S,z="",x=1;const J=()=>{t(22,w=_.addRegion({start:n/4,end:n/2,...f})),t(17,C=w.end-w.start)},I=()=>{if(i&&_&&w){const b=w.start,ge=w.end;d(b,ge),t(0,l=""),t(22,w=null)}},H=()=>{_?.getRegions().forEach(b=>{b.remove()}),_?.clearRegions()},de=()=>{H(),l==="edit"?t(0,l=""):(t(0,l="edit"),J())},ce=(b,ge)=>{let Ce,Ee;w&&(b==="left"?ge==="ArrowLeft"?(Ce=w.start-.05,Ee=w.end):(Ce=w.start+.05,Ee=w.end):ge==="ArrowLeft"?(Ce=w.start,Ee=w.end-.05):(Ce=w.start,Ee=w.end+.05),w.setOptions({start:Ce,end:Ee}),t(17,C=w.end-w.start))},D=()=>t(1,g=!g);function pe(b){x=b,t(12,x)}function G(b){g=b,t(1,g)}const v=()=>{t(11,E=k[(k.indexOf(E)+1)%k.length]),i.setPlaybackRate(E)},L=()=>i.skip(ye(n,m.skip_length)*-1),y=()=>i.playPause(),P=()=>i.skip(ye(n,m.skip_length)),Te=()=>{h(),H(),t(0,l="")};return s.$$set=b=>{"waveform"in b&&t(2,i=b.waveform),"audio_duration"in b&&t(3,n=b.audio_duration),"i18n"in b&&t(4,r=b.i18n),"playing"in b&&t(5,o=b.playing),"show_redo"in b&&t(6,u=b.show_redo),"interactive"in b&&t(7,a=b.interactive),"handle_trim_audio"in b&&t(18,d=b.handle_trim_audio),"mode"in b&&t(0,l=b.mode),"container"in b&&t(19,c=b.container),"handle_reset_value"in b&&t(8,h=b.handle_reset_value),"waveform_options"in b&&t(9,m=b.waveform_options),"trim_region_settings"in b&&t(20,f=b.trim_region_settings),"show_volume_slider"in b&&t(1,g=b.show_volume_slider),"editable"in b&&t(10,p=b.editable),"trimDuration"in b&&t(17,C=b.trimDuration)},s.$$.update=()=>{if(s.$$.dirty[0]&4&&t(21,_=i.registerPlugin(rt.create())),s.$$.dirty[0]&2097152&&_?.on("region-out",b=>{b.play()}),s.$$.dirty[0]&2097152&&_?.on("region-updated",b=>{t(17,C=b.end-b.start)}),s.$$.dirty[0]&2097152&&_?.on("region-clicked",(b,ge)=>{ge.stopPropagation(),t(22,w=b),b.play()}),s.$$.dirty[0]&31981568&&w){const b=c.children[0].shadowRoot;t(24,S=b.querySelector('[data-resize="right"]')),t(23,$=b.querySelector('[data-resize="left"]')),$&&S&&($.setAttribute("role","button"),S.setAttribute("role","button"),$?.setAttribute("aria-label","Drag to adjust start time"),S?.setAttribute("aria-label","Drag to adjust end time"),$?.setAttribute("tabindex","0"),S?.setAttribute("tabindex","0"),$.addEventListener("focus",()=>{_&&t(25,z="left")}),S.addEventListener("focus",()=>{_&&t(25,z="right")}))}s.$$.dirty[0]&35651584&&_&&window.addEventListener("keydown",b=>{b.key==="ArrowLeft"?ce(z,"ArrowLeft"):b.key==="ArrowRight"&&ce(z,"ArrowRight")})},[l,g,i,n,r,o,u,a,h,m,p,E,x,k,I,H,de,C,d,c,f,_,w,$,S,z,D,pe,G,v,L,y,P,Te]}class zn extends En{constructor(e){super(),Sn(this,e,Wn,An,Ln,{waveform:2,audio_duration:3,i18n:4,playing:5,show_redo:6,interactive:7,handle_trim_audio:18,mode:0,container:19,handle_reset_value:8,waveform_options:9,trim_region_settings:20,show_volume_slider:1,editable:10,trimDuration:17},null,[-1,-1])}get waveform(){return this.$$.ctx[2]}set waveform(e){this.$$set({waveform:e}),N()}get audio_duration(){return this.$$.ctx[3]}set audio_duration(e){this.$$set({audio_duration:e}),N()}get i18n(){return this.$$.ctx[4]}set i18n(e){this.$$set({i18n:e}),N()}get playing(){return this.$$.ctx[5]}set playing(e){this.$$set({playing:e}),N()}get show_redo(){return this.$$.ctx[6]}set show_redo(e){this.$$set({show_redo:e}),N()}get interactive(){return this.$$.ctx[7]}set interactive(e){this.$$set({interactive:e}),N()}get handle_trim_audio(){return this.$$.ctx[18]}set handle_trim_audio(e){this.$$set({handle_trim_audio:e}),N()}get mode(){return this.$$.ctx[0]}set mode(e){this.$$set({mode:e}),N()}get container(){return this.$$.ctx[19]}set container(e){this.$$set({container:e}),N()}get handle_reset_value(){return this.$$.ctx[8]}set handle_reset_value(e){this.$$set({handle_reset_value:e}),N()}get waveform_options(){return this.$$.ctx[9]}set waveform_options(e){this.$$set({waveform_options:e}),N()}get trim_region_settings(){return this.$$.ctx[20]}set trim_region_settings(e){this.$$set({trim_region_settings:e}),N()}get show_volume_slider(){return this.$$.ctx[1]}set show_volume_slider(e){this.$$set({show_volume_slider:e}),N()}get editable(){return this.$$.ctx[10]}set editable(e){this.$$set({editable:e}),N()}get trimDuration(){return this.$$.ctx[17]}set trimDuration(e){this.$$set({trimDuration:e}),N()}}const{SvelteComponent:On,add_flush_callback:Ke,append:Y,attr:V,bind:Qe,binding_callbacks:ke,bubble:Hn,check_outros:Vt,create_component:ut,destroy_component:dt,detach:Be,element:Q,empty:Vn,flush:Z,group_outros:Nt,init:Nn,insert:Ie,listen:jn,mount_component:ct,noop:Dt,safe_not_equal:qn,set_data:Bn,space:ze,src_url_equal:Rt,text:In,transition_in:ue,transition_out:he}=window.__gradio__svelte__internal,{onMount:Un}=window.__gradio__svelte__internal,{createEventDispatcher:xn}=window.__gradio__svelte__internal;function Fn(s){let e,t,i,n,r,o,u,a,d,l,c,h,m,f=s[0]==="edit"&&s[16]>0&&Pt(s),g=s[11]&&Tt(s);return{c(){e=Q("div"),t=Q("div"),i=Q("div"),n=ze(),r=Q("div"),o=Q("time"),o.textContent="0:00",u=ze(),a=Q("div"),f&&f.c(),d=ze(),l=Q("time"),l.textContent="0:00",c=ze(),g&&g.c(),V(i,"id","waveform"),V(i,"class","svelte-1ark3ru"),V(t,"class","waveform-container svelte-1ark3ru"),V(o,"id","time"),V(o,"class","svelte-1ark3ru"),V(l,"id","duration"),V(l,"class","svelte-1ark3ru"),V(r,"class","timestamps svelte-1ark3ru"),V(e,"class","component-wrapper svelte-1ark3ru"),V(e,"data-testid",h=s[2]?"waveform-"+s[2]:"unlabelled-audio")},m(p,C){Ie(p,e,C),Y(e,t),Y(t,i),s[22](i),Y(e,n),Y(e,r),Y(r,o),s[23](o),Y(r,u),Y(r,a),f&&f.m(a,null),Y(a,d),Y(a,l),s[24](l),Y(e,c),g&&g.m(e,null),m=!0},p(p,C){p[0]==="edit"&&p[16]>0?f?f.p(p,C):(f=Pt(p),f.c(),f.m(a,d)):f&&(f.d(1),f=null),p[11]?g?(g.p(p,C),C[0]&2048&&ue(g,1)):(g=Tt(p),g.c(),ue(g,1),g.m(e,null)):g&&(Nt(),he(g,1,1,()=>{g=null}),Vt()),(!m||C[0]&4&&h!==(h=p[2]?"waveform-"+p[2]:"unlabelled-audio"))&&V(e,"data-testid",h)},i(p){m||(ue(g),m=!0)},o(p){he(g),m=!1},d(p){p&&Be(e),s[22](null),s[23](null),f&&f.d(),s[24](null),g&&g.d()}}}function Xn(s){let e,t,i,n,r;return{c(){e=Q("audio"),V(e,"class","standard-player svelte-1ark3ru"),Rt(e.src,t=s[1].url)||V(e,"src",t),e.controls=!0,e.autoplay=i=s[7].autoplay},m(o,u){Ie(o,e,u),n||(r=jn(e,"load",s[21]),n=!0)},p(o,u){u[0]&2&&!Rt(e.src,t=o[1].url)&&V(e,"src",t),u[0]&128&&i!==(i=o[7].autoplay)&&(e.autoplay=i)},i:Dt,o:Dt,d(o){o&&Be(e),n=!1,r()}}}function Gn(s){let e,t;return e=new zt({props:{size:"small",$$slots:{default:[Zn]},$$scope:{ctx:s}}}),{c(){ut(e.$$.fragment)},m(i,n){ct(e,i,n),t=!0},p(i,n){const r={};n[1]&1&&(r.$$scope={dirty:n,ctx:i}),e.$set(r)},i(i){t||(ue(e.$$.fragment,i),t=!0)},o(i){he(e.$$.fragment,i),t=!1},d(i){dt(e,i)}}}function Pt(s){let e,t=He(s[16])+"",i;return{c(){e=Q("time"),i=In(t),V(e,"id","trim-duration"),V(e,"class","svelte-1ark3ru")},m(n,r){Ie(n,e,r),Y(e,i)},p(n,r){r[0]&65536&&t!==(t=He(n[16])+"")&&Bn(i,t)},d(n){n&&Be(e)}}}function Tt(s){let e,t,i,n,r;function o(l){s[25](l)}function u(l){s[26](l)}function a(l){s[27](l)}let d={container:s[10],waveform:s[11],playing:s[14],audio_duration:s[15],i18n:s[3],interactive:s[4],handle_trim_audio:s[18],show_redo:s[4],handle_reset_value:s[9],waveform_options:s[8],trim_region_settings:s[6],editable:s[5]};return s[0]!==void 0&&(d.mode=s[0]),s[16]!==void 0&&(d.trimDuration=s[16]),s[17]!==void 0&&(d.show_volume_slider=s[17]),e=new zn({props:d}),ke.push(()=>Qe(e,"mode",o)),ke.push(()=>Qe(e,"trimDuration",u)),ke.push(()=>Qe(e,"show_volume_slider",a)),{c(){ut(e.$$.fragment)},m(l,c){ct(e,l,c),r=!0},p(l,c){const h={};c[0]&1024&&(h.container=l[10]),c[0]&2048&&(h.waveform=l[11]),c[0]&16384&&(h.playing=l[14]),c[0]&32768&&(h.audio_duration=l[15]),c[0]&8&&(h.i18n=l[3]),c[0]&16&&(h.interactive=l[4]),c[0]&16&&(h.show_redo=l[4]),c[0]&512&&(h.handle_reset_value=l[9]),c[0]&256&&(h.waveform_options=l[8]),c[0]&64&&(h.trim_region_settings=l[6]),c[0]&32&&(h.editable=l[5]),!t&&c[0]&1&&(t=!0,h.mode=l[0],Ke(()=>t=!1)),!i&&c[0]&65536&&(i=!0,h.trimDuration=l[16],Ke(()=>i=!1)),!n&&c[0]&131072&&(n=!0,h.show_volume_slider=l[17],Ke(()=>n=!1)),e.$set(h)},i(l){r||(ue(e.$$.fragment,l),r=!0)},o(l){he(e.$$.fragment,l),r=!1},d(l){dt(e,l)}}}function Zn(s){let e,t;return e=new nt({}),{c(){ut(e.$$.fragment)},m(i,n){ct(e,i,n),t=!0},i(i){t||(ue(e.$$.fragment,i),t=!0)},o(i){he(e.$$.fragment,i),t=!1},d(i){dt(e,i)}}}function Yn(s){let e,t,i,n;const r=[Gn,Xn,Fn],o=[];function u(a,d){return a[1]===null?0:a[1].is_stream?1:2}return e=u(s),t=o[e]=r[e](s),{c(){t.c(),i=Vn()},m(a,d){o[e].m(a,d),Ie(a,i,d),n=!0},p(a,d){let l=e;e=u(a),e===l?o[e].p(a,d):(Nt(),he(o[l],1,1,()=>{o[l]=null}),Vt(),t=o[e],t?t.p(a,d):(t=o[e]=r[e](a),t.c()),ue(t,1),t.m(i.parentNode,i))},i(a){n||(ue(t),n=!0)},o(a){he(t),n=!1},d(a){a&&Be(i),o[e].d(a)}}}function Jn(s,e,t){let i,{value:n=null}=e,{label:r}=e,{i18n:o}=e,{dispatch_blob:u=()=>Promise.resolve()}=e,{interactive:a=!1}=e,{editable:d=!0}=e,{trim_region_settings:l={}}=e,{waveform_settings:c}=e,{waveform_options:h}=e,{mode:m=""}=e,{handle_reset_value:f=()=>{}}=e,g,p,C=!1,k,E,_,w=0,$=!1;const S=xn(),z=()=>{t(11,p=st.create({container:g,...c})),ht(n?.url).then(v=>{if(v&&p)return p.load(v)})},x=async(v,L)=>{t(0,m="");const y=p?.getDecodedData();y&&await Gi(y,v,L,c.sampleRate).then(async P=>{await u([P],"change"),p?.destroy(),t(10,g.innerHTML="",g)}),S("edit")};async function J(v){await ht(v).then(L=>{if(!(!L||n?.is_stream))return p?.load(L)})}Un(()=>{window.addEventListener("keydown",v=>{!p||$||(v.key==="ArrowRight"&&m!=="edit"?pt(p,.1):v.key==="ArrowLeft"&&m!=="edit"&&pt(p,-.1))})});function I(v){Hn.call(this,s,v)}function H(v){ke[v?"unshift":"push"](()=>{g=v,t(10,g),t(11,p)})}function de(v){ke[v?"unshift":"push"](()=>{k=v,t(12,k),t(11,p)})}function ce(v){ke[v?"unshift":"push"](()=>{E=v,t(13,E),t(11,p)})}function D(v){m=v,t(0,m)}function pe(v){w=v,t(16,w)}function G(v){$=v,t(17,$)}return s.$$set=v=>{"value"in v&&t(1,n=v.value),"label"in v&&t(2,r=v.label),"i18n"in v&&t(3,o=v.i18n),"dispatch_blob"in v&&t(19,u=v.dispatch_blob),"interactive"in v&&t(4,a=v.interactive),"editable"in v&&t(5,d=v.editable),"trim_region_settings"in v&&t(6,l=v.trim_region_settings),"waveform_settings"in v&&t(7,c=v.waveform_settings),"waveform_options"in v&&t(8,h=v.waveform_options),"mode"in v&&t(0,m=v.mode),"handle_reset_value"in v&&t(9,f=v.handle_reset_value)},s.$$.update=()=>{s.$$.dirty[0]&2&&t(20,i=n?.url),s.$$.dirty[0]&3072&&g!==void 0&&(p!==void 0&&p.destroy(),t(10,g.innerHTML="",g),z(),t(14,C=!1)),s.$$.dirty[0]&10240&&p?.on("decode",v=>{t(15,_=v),E&&t(13,E.textContent=He(v),E)}),s.$$.dirty[0]&6144&&p?.on("timeupdate",v=>k&&t(12,k.textContent=He(v),k)),s.$$.dirty[0]&2176&&p?.on("ready",()=>{c.autoplay?p?.play():p?.stop()}),s.$$.dirty[0]&2048&&p?.on("finish",()=>{t(14,C=!1),S("stop")}),s.$$.dirty[0]&2048&&p?.on("pause",()=>{t(14,C=!1),S("pause")}),s.$$.dirty[0]&2048&&p?.on("play",()=>{t(14,C=!0),S("play")}),s.$$.dirty[0]&2048&&p?.on("load",()=>{S("load")}),s.$$.dirty[0]&1048576&&i&&J(i)},[m,n,r,o,a,d,l,c,h,f,g,p,k,E,C,_,w,$,x,u,i,I,H,de,ce,D,pe,G]}class Kn extends On{constructor(e){super(),Nn(this,e,Jn,Yn,qn,{value:1,label:2,i18n:3,dispatch_blob:19,interactive:4,editable:5,trim_region_settings:6,waveform_settings:7,waveform_options:8,mode:0,handle_reset_value:9},null,[-1,-1])}get value(){return this.$$.ctx[1]}set value(e){this.$$set({value:e}),Z()}get label(){return this.$$.ctx[2]}set label(e){this.$$set({label:e}),Z()}get i18n(){return this.$$.ctx[3]}set i18n(e){this.$$set({i18n:e}),Z()}get dispatch_blob(){return this.$$.ctx[19]}set dispatch_blob(e){this.$$set({dispatch_blob:e}),Z()}get interactive(){return this.$$.ctx[4]}set interactive(e){this.$$set({interactive:e}),Z()}get editable(){return this.$$.ctx[5]}set editable(e){this.$$set({editable:e}),Z()}get trim_region_settings(){return this.$$.ctx[6]}set trim_region_settings(e){this.$$set({trim_region_settings:e}),Z()}get waveform_settings(){return this.$$.ctx[7]}set waveform_settings(e){this.$$set({waveform_settings:e}),Z()}get waveform_options(){return this.$$.ctx[8]}set waveform_options(e){this.$$set({waveform_options:e}),Z()}get mode(){return this.$$.ctx[0]}set mode(e){this.$$set({mode:e}),Z()}get handle_reset_value(){return this.$$.ctx[9]}set handle_reset_value(e){this.$$set({handle_reset_value:e}),Z()}}const Qn=Kn,{SvelteComponent:es,append:ts,attr:is,bubble:we,check_outros:et,create_component:fe,destroy_component:me,detach:Ve,element:ns,empty:ss,flush:K,group_outros:tt,init:rs,insert:Ne,mount_component:_e,safe_not_equal:os,space:it,transition_in:j,transition_out:U}=window.__gradio__svelte__internal,{createEventDispatcher:ls}=window.__gradio__svelte__internal;function as(s){let e,t;return e=new zt({props:{size:"small",$$slots:{default:[ds]},$$scope:{ctx:s}}}),{c(){fe(e.$$.fragment)},m(i,n){_e(e,i,n),t=!0},p(i,n){const r={};n&131072&&(r.$$scope={dirty:n,ctx:i}),e.$set(r)},i(i){t||(j(e.$$.fragment,i),t=!0)},o(i){U(e.$$.fragment,i),t=!1},d(i){me(e,i)}}}function us(s){let e,t,i,n,r,o=s[3]&&At(s),u=s[4]&&Wt(s);return n=new Qn({props:{value:s[0],label:s[1],i18n:s[5],waveform_settings:s[6],waveform_options:s[7],editable:s[8]}}),n.$on("pause",s[12]),n.$on("play",s[13]),n.$on("stop",s[14]),n.$on("load",s[15]),{c(){e=ns("div"),o&&o.c(),t=it(),u&&u.c(),i=it(),fe(n.$$.fragment),is(e,"class","icon-buttons svelte-rvdo70")},m(a,d){Ne(a,e,d),o&&o.m(e,null),ts(e,t),u&&u.m(e,null),Ne(a,i,d),_e(n,a,d),r=!0},p(a,d){a[3]?o?(o.p(a,d),d&8&&j(o,1)):(o=At(a),o.c(),j(o,1),o.m(e,t)):o&&(tt(),U(o,1,1,()=>{o=null}),et()),a[4]?u?(u.p(a,d),d&16&&j(u,1)):(u=Wt(a),u.c(),j(u,1),u.m(e,null)):u&&(tt(),U(u,1,1,()=>{u=null}),et());const l={};d&1&&(l.value=a[0]),d&2&&(l.label=a[1]),d&32&&(l.i18n=a[5]),d&64&&(l.waveform_settings=a[6]),d&128&&(l.waveform_options=a[7]),d&256&&(l.editable=a[8]),n.$set(l)},i(a){r||(j(o),j(u),j(n.$$.fragment,a),r=!0)},o(a){U(o),U(u),U(n.$$.fragment,a),r=!1},d(a){a&&(Ve(e),Ve(i)),o&&o.d(),u&&u.d(),me(n,a)}}}function ds(s){let e,t;return e=new nt({}),{c(){fe(e.$$.fragment)},m(i,n){_e(e,i,n),t=!0},i(i){t||(j(e.$$.fragment,i),t=!0)},o(i){U(e.$$.fragment,i),t=!1},d(i){me(e,i)}}}function At(s){let e,t;return e=new Zt({props:{href:s[0].url,download:s[0].orig_name||s[0].path,$$slots:{default:[cs]},$$scope:{ctx:s}}}),{c(){fe(e.$$.fragment)},m(i,n){_e(e,i,n),t=!0},p(i,n){const r={};n&1&&(r.href=i[0].url),n&1&&(r.download=i[0].orig_name||i[0].path),n&131104&&(r.$$scope={dirty:n,ctx:i}),e.$set(r)},i(i){t||(j(e.$$.fragment,i),t=!0)},o(i){U(e.$$.fragment,i),t=!1},d(i){me(e,i)}}}function cs(s){let e,t;return e=new jt({props:{Icon:Ut,label:s[5]("common.download")}}),{c(){fe(e.$$.fragment)},m(i,n){_e(e,i,n),t=!0},p(i,n){const r={};n&32&&(r.label=i[5]("common.download")),e.$set(r)},i(i){t||(j(e.$$.fragment,i),t=!0)},o(i){U(e.$$.fragment,i),t=!1},d(i){me(e,i)}}}function Wt(s){let e,t;return e=new It({props:{i18n:s[5],formatter:s[9],value:s[0]}}),e.$on("error",s[10]),e.$on("share",s[11]),{c(){fe(e.$$.fragment)},m(i,n){_e(e,i,n),t=!0},p(i,n){const r={};n&32&&(r.i18n=i[5]),n&1&&(r.value=i[0]),e.$set(r)},i(i){t||(j(e.$$.fragment,i),t=!0)},o(i){U(e.$$.fragment,i),t=!1},d(i){me(e,i)}}}function hs(s){let e,t,i,n,r,o;e=new Bt({props:{show_label:s[2],Icon:nt,float:!1,label:s[1]||s[5]("audio.audio")}});const u=[us,as],a=[];function d(l,c){return l[0]!==null?0:1}return i=d(s),n=a[i]=u[i](s),{c(){fe(e.$$.fragment),t=it(),n.c(),r=ss()},m(l,c){_e(e,l,c),Ne(l,t,c),a[i].m(l,c),Ne(l,r,c),o=!0},p(l,[c]){const h={};c&4&&(h.show_label=l[2]),c&34&&(h.label=l[1]||l[5]("audio.audio")),e.$set(h);let m=i;i=d(l),i===m?a[i].p(l,c):(tt(),U(a[m],1,1,()=>{a[m]=null}),et(),n=a[i],n?n.p(l,c):(n=a[i]=u[i](l),n.c()),j(n,1),n.m(r.parentNode,r))},i(l){o||(j(e.$$.fragment,l),j(n),o=!0)},o(l){U(e.$$.fragment,l),U(n),o=!1},d(l){l&&(Ve(t),Ve(r)),me(e,l),a[i].d(l)}}}function fs(s,e,t){let{value:i=null}=e,{label:n}=e,{show_label:r=!0}=e,{show_download_button:o=!0}=e,{show_share_button:u=!1}=e,{i18n:a}=e,{waveform_settings:d}=e,{waveform_options:l}=e,{editable:c=!0}=e;const h=ls(),m=async _=>_?``:"";function f(_){we.call(this,s,_)}function g(_){we.call(this,s,_)}function p(_){we.call(this,s,_)}function C(_){we.call(this,s,_)}function k(_){we.call(this,s,_)}function E(_){we.call(this,s,_)}return s.$$set=_=>{"value"in _&&t(0,i=_.value),"label"in _&&t(1,n=_.label),"show_label"in _&&t(2,r=_.show_label),"show_download_button"in _&&t(3,o=_.show_download_button),"show_share_button"in _&&t(4,u=_.show_share_button),"i18n"in _&&t(5,a=_.i18n),"waveform_settings"in _&&t(6,d=_.waveform_settings),"waveform_options"in _&&t(7,l=_.waveform_options),"editable"in _&&t(8,c=_.editable)},s.$$.update=()=>{s.$$.dirty&1&&i&&h("change",i)},[i,n,r,o,u,a,d,l,c,m,f,g,p,C,k,E]}class ms extends es{constructor(e){super(),rs(this,e,fs,hs,os,{value:0,label:1,show_label:2,show_download_button:3,show_share_button:4,i18n:5,waveform_settings:6,waveform_options:7,editable:8})}get value(){return this.$$.ctx[0]}set value(e){this.$$set({value:e}),K()}get label(){return this.$$.ctx[1]}set label(e){this.$$set({label:e}),K()}get show_label(){return this.$$.ctx[2]}set show_label(e){this.$$set({show_label:e}),K()}get show_download_button(){return this.$$.ctx[3]}set show_download_button(e){this.$$set({show_download_button:e}),K()}get show_share_button(){return this.$$.ctx[4]}set show_share_button(e){this.$$set({show_share_button:e}),K()}get i18n(){return this.$$.ctx[5]}set i18n(e){this.$$set({i18n:e}),K()}get waveform_settings(){return this.$$.ctx[6]}set waveform_settings(e){this.$$set({waveform_settings:e}),K()}get waveform_options(){return this.$$.ctx[7]}set waveform_options(e){this.$$set({waveform_options:e}),K()}get editable(){return this.$$.ctx[8]}set editable(e){this.$$set({editable:e}),K()}}const Ss=Object.freeze(Object.defineProperty({__proto__:null,default:ms},Symbol.toStringTag,{value:"Module"}));export{Qn as A,ms as S,zn as W,st as a,Ss as b,Gi as p,pt as s}; +//# sourceMappingURL=StaticAudio-D7N_h2hQ.js.map diff --git a/moondream/lib/python3.10/site-packages/gradio/templates/frontend/assets/index-BIVDP9Vj.css b/moondream/lib/python3.10/site-packages/gradio/templates/frontend/assets/index-BIVDP9Vj.css new file mode 100644 index 0000000000000000000000000000000000000000..3cf524f797df4f8f47093941bdb5651a53ee6913 --- /dev/null +++ b/moondream/lib/python3.10/site-packages/gradio/templates/frontend/assets/index-BIVDP9Vj.css @@ -0,0 +1 @@ +.file-name.svelte-1cs6pot{padding:var(--size-6);font-size:var(--text-xxl);word-break:break-all}.file-size.svelte-1cs6pot{padding:var(--size-2);font-size:var(--text-xl)}.upload-container.svelte-1cs6pot{height:100%}.video-container.svelte-1cs6pot{display:flex;height:100%;flex-direction:column;justify-content:center;align-items:center} diff --git a/moondream/lib/python3.10/site-packages/gradio/templates/frontend/assets/shell-bahM2fKw.js.map b/moondream/lib/python3.10/site-packages/gradio/templates/frontend/assets/shell-bahM2fKw.js.map new file mode 100644 index 0000000000000000000000000000000000000000..469a6c4421ea483310ef2fdaef4447c388eaa501 --- /dev/null +++ b/moondream/lib/python3.10/site-packages/gradio/templates/frontend/assets/shell-bahM2fKw.js.map @@ -0,0 +1 @@ +{"version":3,"file":"shell-bahM2fKw.js","sources":["../../../../node_modules/.pnpm/@codemirror+legacy-modes@6.3.1/node_modules/@codemirror/legacy-modes/mode/shell.js"],"sourcesContent":["var words = {};\nfunction define(style, dict) {\n for(var i = 0; i < dict.length; i++) {\n words[dict[i]] = style;\n }\n};\n\nvar commonAtoms = [\"true\", \"false\"];\nvar commonKeywords = [\"if\", \"then\", \"do\", \"else\", \"elif\", \"while\", \"until\", \"for\", \"in\", \"esac\", \"fi\",\n \"fin\", \"fil\", \"done\", \"exit\", \"set\", \"unset\", \"export\", \"function\"];\nvar commonCommands = [\"ab\", \"awk\", \"bash\", \"beep\", \"cat\", \"cc\", \"cd\", \"chown\", \"chmod\", \"chroot\", \"clear\",\n \"cp\", \"curl\", \"cut\", \"diff\", \"echo\", \"find\", \"gawk\", \"gcc\", \"get\", \"git\", \"grep\", \"hg\", \"kill\", \"killall\",\n \"ln\", \"ls\", \"make\", \"mkdir\", \"openssl\", \"mv\", \"nc\", \"nl\", \"node\", \"npm\", \"ping\", \"ps\", \"restart\", \"rm\",\n \"rmdir\", \"sed\", \"service\", \"sh\", \"shopt\", \"shred\", \"source\", \"sort\", \"sleep\", \"ssh\", \"start\", \"stop\",\n \"su\", \"sudo\", \"svn\", \"tee\", \"telnet\", \"top\", \"touch\", \"vi\", \"vim\", \"wall\", \"wc\", \"wget\", \"who\", \"write\",\n \"yes\", \"zsh\"];\n\ndefine('atom', commonAtoms);\ndefine('keyword', commonKeywords);\ndefine('builtin', commonCommands);\n\nfunction tokenBase(stream, state) {\n if (stream.eatSpace()) return null;\n\n var sol = stream.sol();\n var ch = stream.next();\n\n if (ch === '\\\\') {\n stream.next();\n return null;\n }\n if (ch === '\\'' || ch === '\"' || ch === '`') {\n state.tokens.unshift(tokenString(ch, ch === \"`\" ? \"quote\" : \"string\"));\n return tokenize(stream, state);\n }\n if (ch === '#') {\n if (sol && stream.eat('!')) {\n stream.skipToEnd();\n return 'meta'; // 'comment'?\n }\n stream.skipToEnd();\n return 'comment';\n }\n if (ch === '$') {\n state.tokens.unshift(tokenDollar);\n return tokenize(stream, state);\n }\n if (ch === '+' || ch === '=') {\n return 'operator';\n }\n if (ch === '-') {\n stream.eat('-');\n stream.eatWhile(/\\w/);\n return 'attribute';\n }\n if (ch == \"<\") {\n if (stream.match(\"<<\")) return \"operator\"\n var heredoc = stream.match(/^<-?\\s*['\"]?([^'\"]*)['\"]?/)\n if (heredoc) {\n state.tokens.unshift(tokenHeredoc(heredoc[1]))\n return 'string.special'\n }\n }\n if (/\\d/.test(ch)) {\n stream.eatWhile(/\\d/);\n if(stream.eol() || !/\\w/.test(stream.peek())) {\n return 'number';\n }\n }\n stream.eatWhile(/[\\w-]/);\n var cur = stream.current();\n if (stream.peek() === '=' && /\\w+/.test(cur)) return 'def';\n return words.hasOwnProperty(cur) ? words[cur] : null;\n}\n\nfunction tokenString(quote, style) {\n var close = quote == \"(\" ? \")\" : quote == \"{\" ? \"}\" : quote\n return function(stream, state) {\n var next, escaped = false;\n while ((next = stream.next()) != null) {\n if (next === close && !escaped) {\n state.tokens.shift();\n break;\n } else if (next === '$' && !escaped && quote !== \"'\" && stream.peek() != close) {\n escaped = true;\n stream.backUp(1);\n state.tokens.unshift(tokenDollar);\n break;\n } else if (!escaped && quote !== close && next === quote) {\n state.tokens.unshift(tokenString(quote, style))\n return tokenize(stream, state)\n } else if (!escaped && /['\"]/.test(next) && !/['\"]/.test(quote)) {\n state.tokens.unshift(tokenStringStart(next, \"string\"));\n stream.backUp(1);\n break;\n }\n escaped = !escaped && next === '\\\\';\n }\n return style;\n };\n};\n\nfunction tokenStringStart(quote, style) {\n return function(stream, state) {\n state.tokens[0] = tokenString(quote, style)\n stream.next()\n return tokenize(stream, state)\n }\n}\n\nvar tokenDollar = function(stream, state) {\n if (state.tokens.length > 1) stream.eat('$');\n var ch = stream.next()\n if (/['\"({]/.test(ch)) {\n state.tokens[0] = tokenString(ch, ch == \"(\" ? \"quote\" : ch == \"{\" ? \"def\" : \"string\");\n return tokenize(stream, state);\n }\n if (!/\\d/.test(ch)) stream.eatWhile(/\\w/);\n state.tokens.shift();\n return 'def';\n};\n\nfunction tokenHeredoc(delim) {\n return function(stream, state) {\n if (stream.sol() && stream.string == delim) state.tokens.shift()\n stream.skipToEnd()\n return \"string.special\"\n }\n}\n\nfunction tokenize(stream, state) {\n return (state.tokens[0] || tokenBase) (stream, state);\n};\n\nexport const shell = {\n name: \"shell\",\n startState: function() {return {tokens:[]};},\n token: function(stream, state) {\n return tokenize(stream, state);\n },\n languageData: {\n autocomplete: commonAtoms.concat(commonKeywords, commonCommands),\n closeBrackets: {brackets: [\"(\", \"[\", \"{\", \"'\", '\"', \"`\"]},\n commentTokens: {line: \"#\"}\n }\n};\n"],"names":["words","define","style","dict","i","commonAtoms","commonKeywords","commonCommands","tokenBase","stream","state","sol","ch","tokenString","tokenize","tokenDollar","heredoc","tokenHeredoc","cur","quote","close","next","escaped","tokenStringStart","delim","shell"],"mappings":"AAAA,IAAIA,EAAQ,CAAA,EACZ,SAASC,EAAOC,EAAOC,EAAM,CAC3B,QAAQC,EAAI,EAAGA,EAAID,EAAK,OAAQC,IAC9BJ,EAAMG,EAAKC,CAAC,CAAC,EAAIF,CAErB,CAEA,IAAIG,EAAc,CAAC,OAAQ,OAAO,EAC9BC,EAAiB,CAAC,KAAM,OAAQ,KAAM,OAAQ,OAAQ,QAAS,QAAS,MAAO,KAAM,OAAQ,KAC3E,MAAO,MAAO,OAAQ,OAAQ,MAAO,QAAS,SAAU,UAAU,EACpFC,EAAiB,CAAC,KAAM,MAAO,OAAQ,OAAQ,MAAO,KAAM,KAAM,QAAS,QAAS,SAAU,QAC5E,KAAM,OAAQ,MAAO,OAAQ,OAAQ,OAAQ,OAAQ,MAAO,MAAO,MAAO,OAAQ,KAAM,OAAQ,UAChG,KAAM,KAAM,OAAQ,QAAS,UAAW,KAAM,KAAM,KAAM,OAAQ,MAAO,OAAQ,KAAM,UAAW,KAClG,QAAS,MAAO,UAAW,KAAM,QAAS,QAAS,SAAU,OAAQ,QAAS,MAAO,QAAS,OAC9F,KAAM,OAAQ,MAAO,MAAO,SAAU,MAAO,QAAS,KAAM,MAAO,OAAQ,KAAM,OAAQ,MAAO,QAChG,MAAO,KAAK,EAElCN,EAAO,OAAQI,CAAW,EAC1BJ,EAAO,UAAWK,CAAc,EAChCL,EAAO,UAAWM,CAAc,EAEhC,SAASC,EAAUC,EAAQC,EAAO,CAChC,GAAID,EAAO,WAAY,OAAO,KAE9B,IAAIE,EAAMF,EAAO,MACbG,EAAKH,EAAO,OAEhB,GAAIG,IAAO,KACT,OAAAH,EAAO,KAAI,EACJ,KAET,GAAIG,IAAO,KAAQA,IAAO,KAAOA,IAAO,IACtC,OAAAF,EAAM,OAAO,QAAQG,EAAYD,EAAIA,IAAO,IAAM,QAAU,QAAQ,CAAC,EAC9DE,EAASL,EAAQC,CAAK,EAE/B,GAAIE,IAAO,IACT,OAAID,GAAOF,EAAO,IAAI,GAAG,GACvBA,EAAO,UAAS,EACT,SAETA,EAAO,UAAS,EACT,WAET,GAAIG,IAAO,IACT,OAAAF,EAAM,OAAO,QAAQK,CAAW,EACzBD,EAASL,EAAQC,CAAK,EAE/B,GAAIE,IAAO,KAAOA,IAAO,IACvB,MAAO,WAET,GAAIA,IAAO,IACT,OAAAH,EAAO,IAAI,GAAG,EACdA,EAAO,SAAS,IAAI,EACb,YAET,GAAIG,GAAM,IAAK,CACb,GAAIH,EAAO,MAAM,IAAI,EAAG,MAAO,WAC/B,IAAIO,EAAUP,EAAO,MAAM,2BAA2B,EACtD,GAAIO,EACF,OAAAN,EAAM,OAAO,QAAQO,EAAaD,EAAQ,CAAC,CAAC,CAAC,EACtC,gBAEV,CACD,GAAI,KAAK,KAAKJ,CAAE,IACdH,EAAO,SAAS,IAAI,EACjBA,EAAO,IAAG,GAAM,CAAC,KAAK,KAAKA,EAAO,KAAI,CAAE,GACzC,MAAO,SAGXA,EAAO,SAAS,OAAO,EACvB,IAAIS,EAAMT,EAAO,UACjB,OAAIA,EAAO,KAAI,IAAO,KAAO,MAAM,KAAKS,CAAG,EAAU,MAC9ClB,EAAM,eAAekB,CAAG,EAAIlB,EAAMkB,CAAG,EAAI,IAClD,CAEA,SAASL,EAAYM,EAAOjB,EAAO,CACjC,IAAIkB,EAAQD,GAAS,IAAM,IAAMA,GAAS,IAAM,IAAMA,EACtD,OAAO,SAASV,EAAQC,EAAO,CAE7B,QADIW,EAAMC,EAAU,IACZD,EAAOZ,EAAO,KAAI,IAAO,MAAM,CACrC,GAAIY,IAASD,GAAS,CAACE,EAAS,CAC9BZ,EAAM,OAAO,QACb,KACR,SAAiBW,IAAS,KAAO,CAACC,GAAWH,IAAU,KAAOV,EAAO,KAAM,GAAIW,EAAO,CAC9EE,EAAU,GACVb,EAAO,OAAO,CAAC,EACfC,EAAM,OAAO,QAAQK,CAAW,EAChC,KACR,KAAa,IAAI,CAACO,GAAWH,IAAUC,GAASC,IAASF,EACjD,OAAAT,EAAM,OAAO,QAAQG,EAAYM,EAAOjB,CAAK,CAAC,EACvCY,EAASL,EAAQC,CAAK,EACxB,GAAI,CAACY,GAAW,OAAO,KAAKD,CAAI,GAAK,CAAC,OAAO,KAAKF,CAAK,EAAG,CAC/DT,EAAM,OAAO,QAAQa,EAAiBF,EAAM,QAAQ,CAAC,EACrDZ,EAAO,OAAO,CAAC,EACf,KACD,EACDa,EAAU,CAACA,GAAWD,IAAS,IAChC,CACD,OAAOnB,CACX,CACA,CAEA,SAASqB,EAAiBJ,EAAOjB,EAAO,CACtC,OAAO,SAASO,EAAQC,EAAO,CAC7B,OAAAA,EAAM,OAAO,CAAC,EAAIG,EAAYM,EAAOjB,CAAK,EAC1CO,EAAO,KAAM,EACNK,EAASL,EAAQC,CAAK,CAC9B,CACH,CAEA,IAAIK,EAAc,SAASN,EAAQC,EAAO,CACpCA,EAAM,OAAO,OAAS,GAAGD,EAAO,IAAI,GAAG,EAC3C,IAAIG,EAAKH,EAAO,KAAM,EACtB,MAAI,SAAS,KAAKG,CAAE,GAClBF,EAAM,OAAO,CAAC,EAAIG,EAAYD,EAAIA,GAAM,IAAM,QAAUA,GAAM,IAAM,MAAQ,QAAQ,EAC7EE,EAASL,EAAQC,CAAK,IAE1B,KAAK,KAAKE,CAAE,GAAGH,EAAO,SAAS,IAAI,EACxCC,EAAM,OAAO,QACN,MACT,EAEA,SAASO,EAAaO,EAAO,CAC3B,OAAO,SAASf,EAAQC,EAAO,CAC7B,OAAID,EAAO,IAAG,GAAMA,EAAO,QAAUe,GAAOd,EAAM,OAAO,MAAO,EAChED,EAAO,UAAW,EACX,gBACR,CACH,CAEA,SAASK,EAASL,EAAQC,EAAO,CAC/B,OAAQA,EAAM,OAAO,CAAC,GAAKF,GAAYC,EAAQC,CAAK,CACtD,CAEY,MAACe,EAAQ,CACnB,KAAM,QACN,WAAY,UAAW,CAAC,MAAO,CAAC,OAAO,CAAA,CAAE,CAAE,EAC3C,MAAO,SAAShB,EAAQC,EAAO,CAC7B,OAAOI,EAASL,EAAQC,CAAK,CAC9B,EACD,aAAc,CACZ,aAAcL,EAAY,OAAOC,EAAgBC,CAAc,EAC/D,cAAe,CAAC,SAAU,CAAC,IAAK,IAAK,IAAK,IAAK,IAAK,GAAG,CAAC,EACxD,cAAe,CAAC,KAAM,GAAG,CAC1B,CACH","x_google_ignoreList":[0]} \ No newline at end of file diff --git a/moondream/lib/python3.10/site-packages/gradio/templates/frontend/assets/svelte/svelte-submodules.js b/moondream/lib/python3.10/site-packages/gradio/templates/frontend/assets/svelte/svelte-submodules.js new file mode 100644 index 0000000000000000000000000000000000000000..4f252d1a7ee6f313c35d8e56a3ab76777aeb7730 --- /dev/null +++ b/moondream/lib/python3.10/site-packages/gradio/templates/frontend/assets/svelte/svelte-submodules.js @@ -0,0 +1,1153 @@ +/** @returns {void} */ +function noop() {} + +const identity = (x) => x; + +/** + * @template T + * @template S + * @param {T} tar + * @param {S} src + * @returns {T & S} + */ +function assign(tar, src) { + // @ts-ignore + for (const k in src) tar[k] = src[k]; + return /** @type {T & S} */ (tar); +} + +function run(fn) { + return fn(); +} + +/** + * @param {Function[]} fns + * @returns {void} + */ +function run_all(fns) { + fns.forEach(run); +} + +/** + * @param {any} thing + * @returns {thing is Function} + */ +function is_function(thing) { + return typeof thing === 'function'; +} + +/** @returns {boolean} */ +function safe_not_equal(a, b) { + return a != a ? b == b : a !== b || (a && typeof a === 'object') || typeof a === 'function'; +} + +function subscribe(store, ...callbacks) { + if (store == null) { + for (const callback of callbacks) { + callback(undefined); + } + return noop; + } + const unsub = store.subscribe(...callbacks); + return unsub.unsubscribe ? () => unsub.unsubscribe() : unsub; +} + +/** + * Get the current value from a store by subscribing and immediately unsubscribing. + * + * https://svelte.dev/docs/svelte-store#get + * @template T + * @param {import('../store/public.js').Readable} store + * @returns {T} + */ +function get_store_value(store) { + let value; + subscribe(store, (_) => (value = _))(); + return value; +} + +/** @param {number | string} value + * @returns {[number, string]} + */ +function split_css_unit(value) { + const split = typeof value === 'string' && value.match(/^\s*(-?[\d.]+)([^\s]*)\s*$/); + return split ? [parseFloat(split[1]), split[2] || 'px'] : [/** @type {number} */ (value), 'px']; +} + +const is_client = typeof window !== 'undefined'; + +/** @type {() => number} */ +let now = is_client ? () => window.performance.now() : () => Date.now(); + +let raf = is_client ? (cb) => requestAnimationFrame(cb) : noop; + +const tasks = new Set(); + +/** + * @param {number} now + * @returns {void} + */ +function run_tasks(now) { + tasks.forEach((task) => { + if (!task.c(now)) { + tasks.delete(task); + task.f(); + } + }); + if (tasks.size !== 0) raf(run_tasks); +} + +/** + * Creates a new task that runs on each raf frame + * until it returns a falsy value or is aborted + * @param {import('./private.js').TaskCallback} callback + * @returns {import('./private.js').Task} + */ +function loop(callback) { + /** @type {import('./private.js').TaskEntry} */ + let task; + if (tasks.size === 0) raf(run_tasks); + return { + promise: new Promise((fulfill) => { + tasks.add((task = { c: callback, f: fulfill })); + }), + abort() { + tasks.delete(task); + } + }; +} + +/* +Adapted from https://github.com/mattdesl +Distributed under MIT License https://github.com/mattdesl/eases/blob/master/LICENSE.md +*/ + +/** + * https://svelte.dev/docs/svelte-easing + * @param {number} t + * @returns {number} + */ +function backInOut(t) { + const s = 1.70158 * 1.525; + if ((t *= 2) < 1) return 0.5 * (t * t * ((s + 1) * t - s)); + return 0.5 * ((t -= 2) * t * ((s + 1) * t + s) + 2); +} + +/** + * https://svelte.dev/docs/svelte-easing + * @param {number} t + * @returns {number} + */ +function backIn(t) { + const s = 1.70158; + return t * t * ((s + 1) * t - s); +} + +/** + * https://svelte.dev/docs/svelte-easing + * @param {number} t + * @returns {number} + */ +function backOut(t) { + const s = 1.70158; + return --t * t * ((s + 1) * t + s) + 1; +} + +/** + * https://svelte.dev/docs/svelte-easing + * @param {number} t + * @returns {number} + */ +function bounceOut(t) { + const a = 4.0 / 11.0; + const b = 8.0 / 11.0; + const c = 9.0 / 10.0; + const ca = 4356.0 / 361.0; + const cb = 35442.0 / 1805.0; + const cc = 16061.0 / 1805.0; + const t2 = t * t; + return t < a + ? 7.5625 * t2 + : t < b + ? 9.075 * t2 - 9.9 * t + 3.4 + : t < c + ? ca * t2 - cb * t + cc + : 10.8 * t * t - 20.52 * t + 10.72; +} + +/** + * https://svelte.dev/docs/svelte-easing + * @param {number} t + * @returns {number} + */ +function bounceInOut(t) { + return t < 0.5 ? 0.5 * (1.0 - bounceOut(1.0 - t * 2.0)) : 0.5 * bounceOut(t * 2.0 - 1.0) + 0.5; +} + +/** + * https://svelte.dev/docs/svelte-easing + * @param {number} t + * @returns {number} + */ +function bounceIn(t) { + return 1.0 - bounceOut(1.0 - t); +} + +/** + * https://svelte.dev/docs/svelte-easing + * @param {number} t + * @returns {number} + */ +function circInOut(t) { + if ((t *= 2) < 1) return -0.5 * (Math.sqrt(1 - t * t) - 1); + return 0.5 * (Math.sqrt(1 - (t -= 2) * t) + 1); +} + +/** + * https://svelte.dev/docs/svelte-easing + * @param {number} t + * @returns {number} + */ +function circIn(t) { + return 1.0 - Math.sqrt(1.0 - t * t); +} + +/** + * https://svelte.dev/docs/svelte-easing + * @param {number} t + * @returns {number} + */ +function circOut(t) { + return Math.sqrt(1 - --t * t); +} + +/** + * https://svelte.dev/docs/svelte-easing + * @param {number} t + * @returns {number} + */ +function cubicInOut(t) { + return t < 0.5 ? 4.0 * t * t * t : 0.5 * Math.pow(2.0 * t - 2.0, 3.0) + 1.0; +} + +/** + * https://svelte.dev/docs/svelte-easing + * @param {number} t + * @returns {number} + */ +function cubicIn(t) { + return t * t * t; +} + +/** + * https://svelte.dev/docs/svelte-easing + * @param {number} t + * @returns {number} + */ +function cubicOut(t) { + const f = t - 1.0; + return f * f * f + 1.0; +} + +/** + * https://svelte.dev/docs/svelte-easing + * @param {number} t + * @returns {number} + */ +function elasticInOut(t) { + return t < 0.5 + ? 0.5 * Math.sin(((+13.0 * Math.PI) / 2) * 2.0 * t) * Math.pow(2.0, 10.0 * (2.0 * t - 1.0)) + : 0.5 * + Math.sin(((-13.0 * Math.PI) / 2) * (2.0 * t - 1.0 + 1.0)) * + Math.pow(2.0, -10.0 * (2.0 * t - 1.0)) + + 1.0; +} + +/** + * https://svelte.dev/docs/svelte-easing + * @param {number} t + * @returns {number} + */ +function elasticIn(t) { + return Math.sin((13.0 * t * Math.PI) / 2) * Math.pow(2.0, 10.0 * (t - 1.0)); +} + +/** + * https://svelte.dev/docs/svelte-easing + * @param {number} t + * @returns {number} + */ +function elasticOut(t) { + return Math.sin((-13.0 * (t + 1.0) * Math.PI) / 2) * Math.pow(2.0, -10.0 * t) + 1.0; +} + +/** + * https://svelte.dev/docs/svelte-easing + * @param {number} t + * @returns {number} + */ +function expoInOut(t) { + return t === 0.0 || t === 1.0 + ? t + : t < 0.5 + ? +0.5 * Math.pow(2.0, 20.0 * t - 10.0) + : -0.5 * Math.pow(2.0, 10.0 - t * 20.0) + 1.0; +} + +/** + * https://svelte.dev/docs/svelte-easing + * @param {number} t + * @returns {number} + */ +function expoIn(t) { + return t === 0.0 ? t : Math.pow(2.0, 10.0 * (t - 1.0)); +} + +/** + * https://svelte.dev/docs/svelte-easing + * @param {number} t + * @returns {number} + */ +function expoOut(t) { + return t === 1.0 ? t : 1.0 - Math.pow(2.0, -10.0 * t); +} + +/** + * https://svelte.dev/docs/svelte-easing + * @param {number} t + * @returns {number} + */ +function quadInOut(t) { + t /= 0.5; + if (t < 1) return 0.5 * t * t; + t--; + return -0.5 * (t * (t - 2) - 1); +} + +/** + * https://svelte.dev/docs/svelte-easing + * @param {number} t + * @returns {number} + */ +function quadIn(t) { + return t * t; +} + +/** + * https://svelte.dev/docs/svelte-easing + * @param {number} t + * @returns {number} + */ +function quadOut(t) { + return -t * (t - 2.0); +} + +/** + * https://svelte.dev/docs/svelte-easing + * @param {number} t + * @returns {number} + */ +function quartInOut(t) { + return t < 0.5 ? +8.0 * Math.pow(t, 4.0) : -8.0 * Math.pow(t - 1.0, 4.0) + 1.0; +} + +/** + * https://svelte.dev/docs/svelte-easing + * @param {number} t + * @returns {number} + */ +function quartIn(t) { + return Math.pow(t, 4.0); +} + +/** + * https://svelte.dev/docs/svelte-easing + * @param {number} t + * @returns {number} + */ +function quartOut(t) { + return Math.pow(t - 1.0, 3.0) * (1.0 - t) + 1.0; +} + +/** + * https://svelte.dev/docs/svelte-easing + * @param {number} t + * @returns {number} + */ +function quintInOut(t) { + if ((t *= 2) < 1) return 0.5 * t * t * t * t * t; + return 0.5 * ((t -= 2) * t * t * t * t + 2); +} + +/** + * https://svelte.dev/docs/svelte-easing + * @param {number} t + * @returns {number} + */ +function quintIn(t) { + return t * t * t * t * t; +} + +/** + * https://svelte.dev/docs/svelte-easing + * @param {number} t + * @returns {number} + */ +function quintOut(t) { + return --t * t * t * t * t + 1; +} + +/** + * https://svelte.dev/docs/svelte-easing + * @param {number} t + * @returns {number} + */ +function sineInOut(t) { + return -0.5 * (Math.cos(Math.PI * t) - 1); +} + +/** + * https://svelte.dev/docs/svelte-easing + * @param {number} t + * @returns {number} + */ +function sineIn(t) { + const v = Math.cos(t * Math.PI * 0.5); + if (Math.abs(v) < 1e-14) return 1; + else return 1 - v; +} + +/** + * https://svelte.dev/docs/svelte-easing + * @param {number} t + * @returns {number} + */ +function sineOut(t) { + return Math.sin((t * Math.PI) / 2); +} + +/** + * Animates a `blur` filter alongside an element's opacity. + * + * https://svelte.dev/docs/svelte-transition#blur + * @param {Element} node + * @param {import('./public').BlurParams} [params] + * @returns {import('./public').TransitionConfig} + */ +function blur( + node, + { delay = 0, duration = 400, easing = cubicInOut, amount = 5, opacity = 0 } = {} +) { + const style = getComputedStyle(node); + const target_opacity = +style.opacity; + const f = style.filter === 'none' ? '' : style.filter; + const od = target_opacity * (1 - opacity); + const [value, unit] = split_css_unit(amount); + return { + delay, + duration, + easing, + css: (_t, u) => `opacity: ${target_opacity - od * u}; filter: ${f} blur(${u * value}${unit});` + }; +} + +/** + * Animates the opacity of an element from 0 to the current opacity for `in` transitions and from the current opacity to 0 for `out` transitions. + * + * https://svelte.dev/docs/svelte-transition#fade + * @param {Element} node + * @param {import('./public').FadeParams} [params] + * @returns {import('./public').TransitionConfig} + */ +function fade(node, { delay = 0, duration = 400, easing = identity } = {}) { + const o = +getComputedStyle(node).opacity; + return { + delay, + duration, + easing, + css: (t) => `opacity: ${t * o}` + }; +} + +/** + * Animates the x and y positions and the opacity of an element. `in` transitions animate from the provided values, passed as parameters to the element's default values. `out` transitions animate from the element's default values to the provided values. + * + * https://svelte.dev/docs/svelte-transition#fly + * @param {Element} node + * @param {import('./public').FlyParams} [params] + * @returns {import('./public').TransitionConfig} + */ +function fly( + node, + { delay = 0, duration = 400, easing = cubicOut, x = 0, y = 0, opacity = 0 } = {} +) { + const style = getComputedStyle(node); + const target_opacity = +style.opacity; + const transform = style.transform === 'none' ? '' : style.transform; + const od = target_opacity * (1 - opacity); + const [xValue, xUnit] = split_css_unit(x); + const [yValue, yUnit] = split_css_unit(y); + return { + delay, + duration, + easing, + css: (t, u) => ` + transform: ${transform} translate(${(1 - t) * xValue}${xUnit}, ${(1 - t) * yValue}${yUnit}); + opacity: ${target_opacity - od * u}` + }; +} + +/** + * Slides an element in and out. + * + * https://svelte.dev/docs/svelte-transition#slide + * @param {Element} node + * @param {import('./public').SlideParams} [params] + * @returns {import('./public').TransitionConfig} + */ +function slide(node, { delay = 0, duration = 400, easing = cubicOut, axis = 'y' } = {}) { + const style = getComputedStyle(node); + const opacity = +style.opacity; + const primary_property = axis === 'y' ? 'height' : 'width'; + const primary_property_value = parseFloat(style[primary_property]); + const secondary_properties = axis === 'y' ? ['top', 'bottom'] : ['left', 'right']; + const capitalized_secondary_properties = secondary_properties.map( + (e) => `${e[0].toUpperCase()}${e.slice(1)}` + ); + const padding_start_value = parseFloat(style[`padding${capitalized_secondary_properties[0]}`]); + const padding_end_value = parseFloat(style[`padding${capitalized_secondary_properties[1]}`]); + const margin_start_value = parseFloat(style[`margin${capitalized_secondary_properties[0]}`]); + const margin_end_value = parseFloat(style[`margin${capitalized_secondary_properties[1]}`]); + const border_width_start_value = parseFloat( + style[`border${capitalized_secondary_properties[0]}Width`] + ); + const border_width_end_value = parseFloat( + style[`border${capitalized_secondary_properties[1]}Width`] + ); + return { + delay, + duration, + easing, + css: (t) => + 'overflow: hidden;' + + `opacity: ${Math.min(t * 20, 1) * opacity};` + + `${primary_property}: ${t * primary_property_value}px;` + + `padding-${secondary_properties[0]}: ${t * padding_start_value}px;` + + `padding-${secondary_properties[1]}: ${t * padding_end_value}px;` + + `margin-${secondary_properties[0]}: ${t * margin_start_value}px;` + + `margin-${secondary_properties[1]}: ${t * margin_end_value}px;` + + `border-${secondary_properties[0]}-width: ${t * border_width_start_value}px;` + + `border-${secondary_properties[1]}-width: ${t * border_width_end_value}px;` + }; +} + +/** + * Animates the opacity and scale of an element. `in` transitions animate from an element's current (default) values to the provided values, passed as parameters. `out` transitions animate from the provided values to an element's default values. + * + * https://svelte.dev/docs/svelte-transition#scale + * @param {Element} node + * @param {import('./public').ScaleParams} [params] + * @returns {import('./public').TransitionConfig} + */ +function scale( + node, + { delay = 0, duration = 400, easing = cubicOut, start = 0, opacity = 0 } = {} +) { + const style = getComputedStyle(node); + const target_opacity = +style.opacity; + const transform = style.transform === 'none' ? '' : style.transform; + const sd = 1 - start; + const od = target_opacity * (1 - opacity); + return { + delay, + duration, + easing, + css: (_t, u) => ` + transform: ${transform} scale(${1 - sd * u}); + opacity: ${target_opacity - od * u} + ` + }; +} + +/** + * Animates the stroke of an SVG element, like a snake in a tube. `in` transitions begin with the path invisible and draw the path to the screen over time. `out` transitions start in a visible state and gradually erase the path. `draw` only works with elements that have a `getTotalLength` method, like `` and ``. + * + * https://svelte.dev/docs/svelte-transition#draw + * @param {SVGElement & { getTotalLength(): number }} node + * @param {import('./public').DrawParams} [params] + * @returns {import('./public').TransitionConfig} + */ +function draw(node, { delay = 0, speed, duration, easing = cubicInOut } = {}) { + let len = node.getTotalLength(); + const style = getComputedStyle(node); + if (style.strokeLinecap !== 'butt') { + len += parseInt(style.strokeWidth); + } + if (duration === undefined) { + if (speed === undefined) { + duration = 800; + } else { + duration = len / speed; + } + } else if (typeof duration === 'function') { + duration = duration(len); + } + return { + delay, + duration, + easing, + css: (_, u) => ` + stroke-dasharray: ${len}; + stroke-dashoffset: ${u * len}; + ` + }; +} + +/** + * The `crossfade` function creates a pair of [transitions](https://svelte.dev/docs#template-syntax-element-directives-transition-fn) called `send` and `receive`. When an element is 'sent', it looks for a corresponding element being 'received', and generates a transition that transforms the element to its counterpart's position and fades it out. When an element is 'received', the reverse happens. If there is no counterpart, the `fallback` transition is used. + * + * https://svelte.dev/docs/svelte-transition#crossfade + * @param {import('./public').CrossfadeParams & { + * fallback?: (node: Element, params: import('./public').CrossfadeParams, intro: boolean) => import('./public').TransitionConfig; + * }} params + * @returns {[(node: any, params: import('./public').CrossfadeParams & { key: any; }) => () => import('./public').TransitionConfig, (node: any, params: import('./public').CrossfadeParams & { key: any; }) => () => import('./public').TransitionConfig]} + */ +function crossfade({ fallback, ...defaults }) { + /** @type {Map} */ + const to_receive = new Map(); + /** @type {Map} */ + const to_send = new Map(); + /** + * @param {Element} from_node + * @param {Element} node + * @param {import('./public').CrossfadeParams} params + * @returns {import('./public').TransitionConfig} + */ + function crossfade(from_node, node, params) { + const { + delay = 0, + duration = (d) => Math.sqrt(d) * 30, + easing = cubicOut + } = assign(assign({}, defaults), params); + const from = from_node.getBoundingClientRect(); + const to = node.getBoundingClientRect(); + const dx = from.left - to.left; + const dy = from.top - to.top; + const dw = from.width / to.width; + const dh = from.height / to.height; + const d = Math.sqrt(dx * dx + dy * dy); + const style = getComputedStyle(node); + const transform = style.transform === 'none' ? '' : style.transform; + const opacity = +style.opacity; + return { + delay, + duration: is_function(duration) ? duration(d) : duration, + easing, + css: (t, u) => ` + opacity: ${t * opacity}; + transform-origin: top left; + transform: ${transform} translate(${u * dx}px,${u * dy}px) scale(${t + (1 - t) * dw}, ${ + t + (1 - t) * dh + }); + ` + }; + } + + /** + * @param {Map} items + * @param {Map} counterparts + * @param {boolean} intro + * @returns {(node: any, params: import('./public').CrossfadeParams & { key: any; }) => () => import('./public').TransitionConfig} + */ + function transition(items, counterparts, intro) { + return (node, params) => { + items.set(params.key, node); + return () => { + if (counterparts.has(params.key)) { + const other_node = counterparts.get(params.key); + counterparts.delete(params.key); + return crossfade(other_node, node, params); + } + // if the node is disappearing altogether + // (i.e. wasn't claimed by the other list) + // then we need to supply an outro + items.delete(params.key); + return fallback && fallback(node, params, intro); + }; + }; + } + return [transition(to_send, to_receive, false), transition(to_receive, to_send, true)]; +} + +const subscriber_queue = []; + +/** + * Creates a `Readable` store that allows reading by subscription. + * + * https://svelte.dev/docs/svelte-store#readable + * @template T + * @param {T} [value] initial value + * @param {import('./public.js').StartStopNotifier} [start] + * @returns {import('./public.js').Readable} + */ +function readable(value, start) { + return { + subscribe: writable(value, start).subscribe + }; +} + +/** + * Create a `Writable` store that allows both updating and reading by subscription. + * + * https://svelte.dev/docs/svelte-store#writable + * @template T + * @param {T} [value] initial value + * @param {import('./public.js').StartStopNotifier} [start] + * @returns {import('./public.js').Writable} + */ +function writable(value, start = noop) { + /** @type {import('./public.js').Unsubscriber} */ + let stop; + /** @type {Set>} */ + const subscribers = new Set(); + /** @param {T} new_value + * @returns {void} + */ + function set(new_value) { + if (safe_not_equal(value, new_value)) { + value = new_value; + if (stop) { + // store is ready + const run_queue = !subscriber_queue.length; + for (const subscriber of subscribers) { + subscriber[1](); + subscriber_queue.push(subscriber, value); + } + if (run_queue) { + for (let i = 0; i < subscriber_queue.length; i += 2) { + subscriber_queue[i][0](subscriber_queue[i + 1]); + } + subscriber_queue.length = 0; + } + } + } + } + + /** + * @param {import('./public.js').Updater} fn + * @returns {void} + */ + function update(fn) { + set(fn(value)); + } + + /** + * @param {import('./public.js').Subscriber} run + * @param {import('./private.js').Invalidator} [invalidate] + * @returns {import('./public.js').Unsubscriber} + */ + function subscribe(run, invalidate = noop) { + /** @type {import('./private.js').SubscribeInvalidateTuple} */ + const subscriber = [run, invalidate]; + subscribers.add(subscriber); + if (subscribers.size === 1) { + stop = start(set, update) || noop; + } + run(value); + return () => { + subscribers.delete(subscriber); + if (subscribers.size === 0 && stop) { + stop(); + stop = null; + } + }; + } + return { set, update, subscribe }; +} + +/** + * Derived value store by synchronizing one or more readable stores and + * applying an aggregation function over its input values. + * + * https://svelte.dev/docs/svelte-store#derived + * @template {import('./private.js').Stores} S + * @template T + * @overload + * @param {S} stores - input stores + * @param {(values: import('./private.js').StoresValues, set: (value: T) => void, update: (fn: import('./public.js').Updater) => void) => import('./public.js').Unsubscriber | void} fn - function callback that aggregates the values + * @param {T} [initial_value] - initial value + * @returns {import('./public.js').Readable} + */ + +/** + * Derived value store by synchronizing one or more readable stores and + * applying an aggregation function over its input values. + * + * https://svelte.dev/docs/svelte-store#derived + * @template {import('./private.js').Stores} S + * @template T + * @overload + * @param {S} stores - input stores + * @param {(values: import('./private.js').StoresValues) => T} fn - function callback that aggregates the values + * @param {T} [initial_value] - initial value + * @returns {import('./public.js').Readable} + */ + +/** + * @template {import('./private.js').Stores} S + * @template T + * @param {S} stores + * @param {Function} fn + * @param {T} [initial_value] + * @returns {import('./public.js').Readable} + */ +function derived(stores, fn, initial_value) { + const single = !Array.isArray(stores); + /** @type {Array>} */ + const stores_array = single ? [stores] : stores; + if (!stores_array.every(Boolean)) { + throw new Error('derived() expects stores as input, got a falsy value'); + } + const auto = fn.length < 2; + return readable(initial_value, (set, update) => { + let started = false; + const values = []; + let pending = 0; + let cleanup = noop; + const sync = () => { + if (pending) { + return; + } + cleanup(); + const result = fn(single ? values[0] : values, set, update); + if (auto) { + set(result); + } else { + cleanup = is_function(result) ? result : noop; + } + }; + const unsubscribers = stores_array.map((store, i) => + subscribe( + store, + (value) => { + values[i] = value; + pending &= ~(1 << i); + if (started) { + sync(); + } + }, + () => { + pending |= 1 << i; + } + ) + ); + started = true; + sync(); + return function stop() { + run_all(unsubscribers); + cleanup(); + // We need to set this to false because callbacks can still happen despite having unsubscribed: + // Callbacks might already be placed in the queue which doesn't know it should no longer + // invoke this derived store. + started = false; + }; + }); +} + +/** + * Takes a store and returns a new one derived from the old one that is readable. + * + * https://svelte.dev/docs/svelte-store#readonly + * @template T + * @param {import('./public.js').Readable} store - store to make readonly + * @returns {import('./public.js').Readable} + */ +function readonly(store) { + return { + subscribe: store.subscribe.bind(store) + }; +} + +/** + * @param {any} obj + * @returns {boolean} + */ +function is_date(obj) { + return Object.prototype.toString.call(obj) === '[object Date]'; +} + +/** + * @template T + * @param {import('./private.js').TickContext} ctx + * @param {T} last_value + * @param {T} current_value + * @param {T} target_value + * @returns {T} + */ +function tick_spring(ctx, last_value, current_value, target_value) { + if (typeof current_value === 'number' || is_date(current_value)) { + // @ts-ignore + const delta = target_value - current_value; + // @ts-ignore + const velocity = (current_value - last_value) / (ctx.dt || 1 / 60); // guard div by 0 + const spring = ctx.opts.stiffness * delta; + const damper = ctx.opts.damping * velocity; + const acceleration = (spring - damper) * ctx.inv_mass; + const d = (velocity + acceleration) * ctx.dt; + if (Math.abs(d) < ctx.opts.precision && Math.abs(delta) < ctx.opts.precision) { + return target_value; // settled + } else { + ctx.settled = false; // signal loop to keep ticking + // @ts-ignore + return is_date(current_value) ? new Date(current_value.getTime() + d) : current_value + d; + } + } else if (Array.isArray(current_value)) { + // @ts-ignore + return current_value.map((_, i) => + tick_spring(ctx, last_value[i], current_value[i], target_value[i]) + ); + } else if (typeof current_value === 'object') { + const next_value = {}; + for (const k in current_value) { + // @ts-ignore + next_value[k] = tick_spring(ctx, last_value[k], current_value[k], target_value[k]); + } + // @ts-ignore + return next_value; + } else { + throw new Error(`Cannot spring ${typeof current_value} values`); + } +} + +/** + * The spring function in Svelte creates a store whose value is animated, with a motion that simulates the behavior of a spring. This means when the value changes, instead of transitioning at a steady rate, it "bounces" like a spring would, depending on the physics parameters provided. This adds a level of realism to the transitions and can enhance the user experience. + * + * https://svelte.dev/docs/svelte-motion#spring + * @template [T=any] + * @param {T} [value] + * @param {import('./private.js').SpringOpts} [opts] + * @returns {import('./public.js').Spring} + */ +function spring(value, opts = {}) { + const store = writable(value); + const { stiffness = 0.15, damping = 0.8, precision = 0.01 } = opts; + /** @type {number} */ + let last_time; + /** @type {import('../internal/private.js').Task} */ + let task; + /** @type {object} */ + let current_token; + /** @type {T} */ + let last_value = value; + /** @type {T} */ + let target_value = value; + let inv_mass = 1; + let inv_mass_recovery_rate = 0; + let cancel_task = false; + /** + * @param {T} new_value + * @param {import('./private.js').SpringUpdateOpts} opts + * @returns {Promise} + */ + function set(new_value, opts = {}) { + target_value = new_value; + const token = (current_token = {}); + if (value == null || opts.hard || (spring.stiffness >= 1 && spring.damping >= 1)) { + cancel_task = true; // cancel any running animation + last_time = now(); + last_value = new_value; + store.set((value = target_value)); + return Promise.resolve(); + } else if (opts.soft) { + const rate = opts.soft === true ? 0.5 : +opts.soft; + inv_mass_recovery_rate = 1 / (rate * 60); + inv_mass = 0; // infinite mass, unaffected by spring forces + } + if (!task) { + last_time = now(); + cancel_task = false; + task = loop((now) => { + if (cancel_task) { + cancel_task = false; + task = null; + return false; + } + inv_mass = Math.min(inv_mass + inv_mass_recovery_rate, 1); + const ctx = { + inv_mass, + opts: spring, + settled: true, + dt: ((now - last_time) * 60) / 1000 + }; + const next_value = tick_spring(ctx, last_value, value, target_value); + last_time = now; + last_value = value; + store.set((value = next_value)); + if (ctx.settled) { + task = null; + } + return !ctx.settled; + }); + } + return new Promise((fulfil) => { + task.promise.then(() => { + if (token === current_token) fulfil(); + }); + }); + } + /** @type {import('./public.js').Spring} */ + const spring = { + set, + update: (fn, opts) => set(fn(target_value, value), opts), + subscribe: store.subscribe, + stiffness, + damping, + precision + }; + return spring; +} + +/** @returns {(t: any) => any} */ +function get_interpolator(a, b) { + if (a === b || a !== a) return () => a; + const type = typeof a; + if (type !== typeof b || Array.isArray(a) !== Array.isArray(b)) { + throw new Error('Cannot interpolate values of different type'); + } + if (Array.isArray(a)) { + const arr = b.map((bi, i) => { + return get_interpolator(a[i], bi); + }); + return (t) => arr.map((fn) => fn(t)); + } + if (type === 'object') { + if (!a || !b) throw new Error('Object cannot be null'); + if (is_date(a) && is_date(b)) { + a = a.getTime(); + b = b.getTime(); + const delta = b - a; + return (t) => new Date(a + t * delta); + } + const keys = Object.keys(b); + const interpolators = {}; + keys.forEach((key) => { + interpolators[key] = get_interpolator(a[key], b[key]); + }); + return (t) => { + const result = {}; + keys.forEach((key) => { + result[key] = interpolators[key](t); + }); + return result; + }; + } + if (type === 'number') { + const delta = b - a; + return (t) => a + t * delta; + } + throw new Error(`Cannot interpolate ${type} values`); +} + +/** + * A tweened store in Svelte is a special type of store that provides smooth transitions between state values over time. + * + * https://svelte.dev/docs/svelte-motion#tweened + * @template T + * @param {T} [value] + * @param {import('./private.js').TweenedOptions} [defaults] + * @returns {import('./public.js').Tweened} + */ +function tweened(value, defaults = {}) { + const store = writable(value); + /** @type {import('../internal/private.js').Task} */ + let task; + let target_value = value; + /** + * @param {T} new_value + * @param {import('./private.js').TweenedOptions} [opts] + */ + function set(new_value, opts) { + if (value == null) { + store.set((value = new_value)); + return Promise.resolve(); + } + target_value = new_value; + let previous_task = task; + let started = false; + let { + delay = 0, + duration = 400, + easing = identity, + interpolate = get_interpolator + } = assign(assign({}, defaults), opts); + if (duration === 0) { + if (previous_task) { + previous_task.abort(); + previous_task = null; + } + store.set((value = target_value)); + return Promise.resolve(); + } + const start = now() + delay; + let fn; + task = loop((now) => { + if (now < start) return true; + if (!started) { + fn = interpolate(value, new_value); + if (typeof duration === 'function') duration = duration(value, new_value); + started = true; + } + if (previous_task) { + previous_task.abort(); + previous_task = null; + } + const elapsed = now - start; + if (elapsed > /** @type {number} */ (duration)) { + store.set((value = new_value)); + return false; + } + // @ts-ignore + store.set((value = fn(easing(elapsed / duration)))); + return true; + }); + return task.promise; + } + return { + set, + update: (fn, opts) => set(fn(target_value, value), opts), + subscribe: store.subscribe + }; +} + +/** + * The flip function calculates the start and end position of an element and animates between them, translating the x and y values. + * `flip` stands for [First, Last, Invert, Play](https://aerotwist.com/blog/flip-your-animations/). + * + * https://svelte.dev/docs/svelte-animate#flip + * @param {Element} node + * @param {{ from: DOMRect; to: DOMRect }} fromTo + * @param {import('./public.js').FlipParams} params + * @returns {import('./public.js').AnimationConfig} + */ +function flip(node, { from, to }, params = {}) { + const style = getComputedStyle(node); + const transform = style.transform === 'none' ? '' : style.transform; + const [ox, oy] = style.transformOrigin.split(' ').map(parseFloat); + const dx = from.left + (from.width * ox) / to.width - (to.left + ox); + const dy = from.top + (from.height * oy) / to.height - (to.top + oy); + const { delay = 0, duration = (d) => Math.sqrt(d) * 120, easing = cubicOut } = params; + return { + delay, + duration: is_function(duration) ? duration(Math.sqrt(dx * dx + dy * dy)) : duration, + easing, + css: (t, u) => { + const x = u * dx; + const y = u * dy; + const sx = t + (u * from.width) / to.width; + const sy = t + (u * from.height) / to.height; + return `transform: ${transform} translate(${x}px, ${y}px) scale(${sx}, ${sy});`; + } + }; +} + +export { backIn, backInOut, backOut, blur, bounceIn, bounceInOut, bounceOut, circIn, circInOut, circOut, crossfade, cubicIn, cubicInOut, cubicOut, derived, draw, elasticIn, elasticInOut, elasticOut, expoIn, expoInOut, expoOut, fade, flip, fly, get_store_value as get, identity as linear, quadIn, quadInOut, quadOut, quartIn, quartInOut, quartOut, quintIn, quintInOut, quintOut, readable, readonly, scale, sineIn, sineInOut, sineOut, slide, spring, tweened, writable }; diff --git a/moondream/lib/python3.10/site-packages/gradio/templates/frontend/assets/svelte/svelte.js b/moondream/lib/python3.10/site-packages/gradio/templates/frontend/assets/svelte/svelte.js new file mode 100644 index 0000000000000000000000000000000000000000..d2cbd0022ea1ab3974ad2113230572cd01cb703d --- /dev/null +++ b/moondream/lib/python3.10/site-packages/gradio/templates/frontend/assets/svelte/svelte.js @@ -0,0 +1,4015 @@ +/** @returns {void} */ +function noop() {} + +const identity = (x) => x; + +/** + * @template T + * @template S + * @param {T} tar + * @param {S} src + * @returns {T & S} + */ +function assign(tar, src) { + // @ts-ignore + for (const k in src) tar[k] = src[k]; + return /** @type {T & S} */ (tar); +} + +// Adapted from https://github.com/then/is-promise/blob/master/index.js +// Distributed under MIT License https://github.com/then/is-promise/blob/master/LICENSE +/** + * @param {any} value + * @returns {value is PromiseLike} + */ +function is_promise(value) { + return ( + !!value && + (typeof value === 'object' || typeof value === 'function') && + typeof (/** @type {any} */ (value).then) === 'function' + ); +} + +/** @returns {void} */ +function add_location(element, file, line, column, char) { + element.__svelte_meta = { + loc: { file, line, column, char } + }; +} + +function run(fn) { + return fn(); +} + +function blank_object() { + return Object.create(null); +} + +/** + * @param {Function[]} fns + * @returns {void} + */ +function run_all(fns) { + fns.forEach(run); +} + +/** + * @param {any} thing + * @returns {thing is Function} + */ +function is_function(thing) { + return typeof thing === 'function'; +} + +/** @returns {boolean} */ +function safe_not_equal(a, b) { + return a != a ? b == b : a !== b || (a && typeof a === 'object') || typeof a === 'function'; +} + +let src_url_equal_anchor; + +/** + * @param {string} element_src + * @param {string} url + * @returns {boolean} + */ +function src_url_equal(element_src, url) { + if (element_src === url) return true; + if (!src_url_equal_anchor) { + src_url_equal_anchor = document.createElement('a'); + } + // This is actually faster than doing URL(..).href + src_url_equal_anchor.href = url; + return element_src === src_url_equal_anchor.href; +} + +/** @param {string} srcset */ +function split_srcset(srcset) { + return srcset.split(',').map((src) => src.trim().split(' ').filter(Boolean)); +} + +/** + * @param {HTMLSourceElement | HTMLImageElement} element_srcset + * @param {string | undefined | null} srcset + * @returns {boolean} + */ +function srcset_url_equal(element_srcset, srcset) { + const element_urls = split_srcset(element_srcset.srcset); + const urls = split_srcset(srcset || ''); + + return ( + urls.length === element_urls.length && + urls.every( + ([url, width], i) => + width === element_urls[i][1] && + // We need to test both ways because Vite will create an a full URL with + // `new URL(asset, import.meta.url).href` for the client when `base: './'`, and the + // relative URLs inside srcset are not automatically resolved to absolute URLs by + // browsers (in contrast to img.src). This means both SSR and DOM code could + // contain relative or absolute URLs. + (src_url_equal(element_urls[i][0], url) || src_url_equal(url, element_urls[i][0])) + ) + ); +} + +/** @returns {boolean} */ +function not_equal(a, b) { + return a != a ? b == b : a !== b; +} + +/** @returns {boolean} */ +function is_empty(obj) { + return Object.keys(obj).length === 0; +} + +/** @returns {void} */ +function validate_store(store, name) { + if (store != null && typeof store.subscribe !== 'function') { + throw new Error(`'${name}' is not a store with a 'subscribe' method`); + } +} + +function subscribe(store, ...callbacks) { + if (store == null) { + for (const callback of callbacks) { + callback(undefined); + } + return noop; + } + const unsub = store.subscribe(...callbacks); + return unsub.unsubscribe ? () => unsub.unsubscribe() : unsub; +} + +/** + * Get the current value from a store by subscribing and immediately unsubscribing. + * + * https://svelte.dev/docs/svelte-store#get + * @template T + * @param {import('../store/public.js').Readable} store + * @returns {T} + */ +function get_store_value(store) { + let value; + subscribe(store, (_) => (value = _))(); + return value; +} + +/** @returns {void} */ +function component_subscribe(component, store, callback) { + component.$$.on_destroy.push(subscribe(store, callback)); +} + +function create_slot(definition, ctx, $$scope, fn) { + if (definition) { + const slot_ctx = get_slot_context(definition, ctx, $$scope, fn); + return definition[0](slot_ctx); + } +} + +function get_slot_context(definition, ctx, $$scope, fn) { + return definition[1] && fn ? assign($$scope.ctx.slice(), definition[1](fn(ctx))) : $$scope.ctx; +} + +function get_slot_changes(definition, $$scope, dirty, fn) { + if (definition[2] && fn) { + const lets = definition[2](fn(dirty)); + if ($$scope.dirty === undefined) { + return lets; + } + if (typeof lets === 'object') { + const merged = []; + const len = Math.max($$scope.dirty.length, lets.length); + for (let i = 0; i < len; i += 1) { + merged[i] = $$scope.dirty[i] | lets[i]; + } + return merged; + } + return $$scope.dirty | lets; + } + return $$scope.dirty; +} + +/** @returns {void} */ +function update_slot_base( + slot, + slot_definition, + ctx, + $$scope, + slot_changes, + get_slot_context_fn +) { + if (slot_changes) { + const slot_context = get_slot_context(slot_definition, ctx, $$scope, get_slot_context_fn); + slot.p(slot_context, slot_changes); + } +} + +/** @returns {void} */ +function update_slot( + slot, + slot_definition, + ctx, + $$scope, + dirty, + get_slot_changes_fn, + get_slot_context_fn +) { + const slot_changes = get_slot_changes(slot_definition, $$scope, dirty, get_slot_changes_fn); + update_slot_base(slot, slot_definition, ctx, $$scope, slot_changes, get_slot_context_fn); +} + +/** @returns {any[] | -1} */ +function get_all_dirty_from_scope($$scope) { + if ($$scope.ctx.length > 32) { + const dirty = []; + const length = $$scope.ctx.length / 32; + for (let i = 0; i < length; i++) { + dirty[i] = -1; + } + return dirty; + } + return -1; +} + +/** @returns {{}} */ +function exclude_internal_props(props) { + const result = {}; + for (const k in props) if (k[0] !== '$') result[k] = props[k]; + return result; +} + +/** @returns {{}} */ +function compute_rest_props(props, keys) { + const rest = {}; + keys = new Set(keys); + for (const k in props) if (!keys.has(k) && k[0] !== '$') rest[k] = props[k]; + return rest; +} + +/** @returns {{}} */ +function compute_slots(slots) { + const result = {}; + for (const key in slots) { + result[key] = true; + } + return result; +} + +/** @returns {(this: any, ...args: any[]) => void} */ +function once(fn) { + let ran = false; + return function (...args) { + if (ran) return; + ran = true; + fn.call(this, ...args); + }; +} + +function null_to_empty(value) { + return value == null ? '' : value; +} + +function set_store_value(store, ret, value) { + store.set(value); + return ret; +} + +const has_prop = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop); + +function action_destroyer(action_result) { + return action_result && is_function(action_result.destroy) ? action_result.destroy : noop; +} + +/** @param {number | string} value + * @returns {[number, string]} + */ +function split_css_unit(value) { + const split = typeof value === 'string' && value.match(/^\s*(-?[\d.]+)([^\s]*)\s*$/); + return split ? [parseFloat(split[1]), split[2] || 'px'] : [/** @type {number} */ (value), 'px']; +} + +const contenteditable_truthy_values = ['', true, 1, 'true', 'contenteditable']; + +const is_client = typeof window !== 'undefined'; + +/** @type {() => number} */ +let now = is_client ? () => window.performance.now() : () => Date.now(); + +let raf = is_client ? (cb) => requestAnimationFrame(cb) : noop; + +// used internally for testing +/** @returns {void} */ +function set_now(fn) { + now = fn; +} + +/** @returns {void} */ +function set_raf(fn) { + raf = fn; +} + +const tasks = new Set(); + +/** + * @param {number} now + * @returns {void} + */ +function run_tasks(now) { + tasks.forEach((task) => { + if (!task.c(now)) { + tasks.delete(task); + task.f(); + } + }); + if (tasks.size !== 0) raf(run_tasks); +} + +/** + * For testing purposes only! + * @returns {void} + */ +function clear_loops() { + tasks.clear(); +} + +/** + * Creates a new task that runs on each raf frame + * until it returns a falsy value or is aborted + * @param {import('./private.js').TaskCallback} callback + * @returns {import('./private.js').Task} + */ +function loop(callback) { + /** @type {import('./private.js').TaskEntry} */ + let task; + if (tasks.size === 0) raf(run_tasks); + return { + promise: new Promise((fulfill) => { + tasks.add((task = { c: callback, f: fulfill })); + }), + abort() { + tasks.delete(task); + } + }; +} + +/** @type {typeof globalThis} */ +const globals = + typeof window !== 'undefined' + ? window + : typeof globalThis !== 'undefined' + ? globalThis + : // @ts-ignore Node typings have this + global; + +/** + * Resize observer singleton. + * One listener per element only! + * https://groups.google.com/a/chromium.org/g/blink-dev/c/z6ienONUb5A/m/F5-VcUZtBAAJ + */ +class ResizeObserverSingleton { + /** + * @private + * @readonly + * @type {WeakMap} + */ + _listeners = 'WeakMap' in globals ? new WeakMap() : undefined; + + /** + * @private + * @type {ResizeObserver} + */ + _observer = undefined; + + /** @type {ResizeObserverOptions} */ + options; + + /** @param {ResizeObserverOptions} options */ + constructor(options) { + this.options = options; + } + + /** + * @param {Element} element + * @param {import('./private.js').Listener} listener + * @returns {() => void} + */ + observe(element, listener) { + this._listeners.set(element, listener); + this._getObserver().observe(element, this.options); + return () => { + this._listeners.delete(element); + this._observer.unobserve(element); // this line can probably be removed + }; + } + + /** + * @private + */ + _getObserver() { + return ( + this._observer ?? + (this._observer = new ResizeObserver((entries) => { + for (const entry of entries) { + ResizeObserverSingleton.entries.set(entry.target, entry); + this._listeners.get(entry.target)?.(entry); + } + })) + ); + } +} + +// Needs to be written like this to pass the tree-shake-test +ResizeObserverSingleton.entries = 'WeakMap' in globals ? new WeakMap() : undefined; + +// Track which nodes are claimed during hydration. Unclaimed nodes can then be removed from the DOM +// at the end of hydration without touching the remaining nodes. +let is_hydrating = false; + +/** + * @returns {void} + */ +function start_hydrating() { + is_hydrating = true; +} + +/** + * @returns {void} + */ +function end_hydrating() { + is_hydrating = false; +} + +/** + * @param {number} low + * @param {number} high + * @param {(index: number) => number} key + * @param {number} value + * @returns {number} + */ +function upper_bound(low, high, key, value) { + // Return first index of value larger than input value in the range [low, high) + while (low < high) { + const mid = low + ((high - low) >> 1); + if (key(mid) <= value) { + low = mid + 1; + } else { + high = mid; + } + } + return low; +} + +/** + * @param {NodeEx} target + * @returns {void} + */ +function init_hydrate(target) { + if (target.hydrate_init) return; + target.hydrate_init = true; + // We know that all children have claim_order values since the unclaimed have been detached if target is not + + let children = /** @type {ArrayLike} */ (target.childNodes); + // If target is , there may be children without claim_order + if (target.nodeName === 'HEAD') { + const my_children = []; + for (let i = 0; i < children.length; i++) { + const node = children[i]; + if (node.claim_order !== undefined) { + my_children.push(node); + } + } + children = my_children; + } + /* + * Reorder claimed children optimally. + * We can reorder claimed children optimally by finding the longest subsequence of + * nodes that are already claimed in order and only moving the rest. The longest + * subsequence of nodes that are claimed in order can be found by + * computing the longest increasing subsequence of .claim_order values. + * + * This algorithm is optimal in generating the least amount of reorder operations + * possible. + * + * Proof: + * We know that, given a set of reordering operations, the nodes that do not move + * always form an increasing subsequence, since they do not move among each other + * meaning that they must be already ordered among each other. Thus, the maximal + * set of nodes that do not move form a longest increasing subsequence. + */ + // Compute longest increasing subsequence + // m: subsequence length j => index k of smallest value that ends an increasing subsequence of length j + const m = new Int32Array(children.length + 1); + // Predecessor indices + 1 + const p = new Int32Array(children.length); + m[0] = -1; + let longest = 0; + for (let i = 0; i < children.length; i++) { + const current = children[i].claim_order; + // Find the largest subsequence length such that it ends in a value less than our current value + // upper_bound returns first greater value, so we subtract one + // with fast path for when we are on the current longest subsequence + const seq_len = + (longest > 0 && children[m[longest]].claim_order <= current + ? longest + 1 + : upper_bound(1, longest, (idx) => children[m[idx]].claim_order, current)) - 1; + p[i] = m[seq_len] + 1; + const new_len = seq_len + 1; + // We can guarantee that current is the smallest value. Otherwise, we would have generated a longer sequence. + m[new_len] = i; + longest = Math.max(new_len, longest); + } + // The longest increasing subsequence of nodes (initially reversed) + + /** + * @type {NodeEx2[]} + */ + const lis = []; + // The rest of the nodes, nodes that will be moved + + /** + * @type {NodeEx2[]} + */ + const to_move = []; + let last = children.length - 1; + for (let cur = m[longest] + 1; cur != 0; cur = p[cur - 1]) { + lis.push(children[cur - 1]); + for (; last >= cur; last--) { + to_move.push(children[last]); + } + last--; + } + for (; last >= 0; last--) { + to_move.push(children[last]); + } + lis.reverse(); + // We sort the nodes being moved to guarantee that their insertion order matches the claim order + to_move.sort((a, b) => a.claim_order - b.claim_order); + // Finally, we move the nodes + for (let i = 0, j = 0; i < to_move.length; i++) { + while (j < lis.length && to_move[i].claim_order >= lis[j].claim_order) { + j++; + } + const anchor = j < lis.length ? lis[j] : null; + target.insertBefore(to_move[i], anchor); + } +} + +/** + * @param {Node} target + * @param {Node} node + * @returns {void} + */ +function append(target, node) { + target.appendChild(node); +} + +/** + * @param {Node} target + * @param {string} style_sheet_id + * @param {string} styles + * @returns {void} + */ +function append_styles(target, style_sheet_id, styles) { + const append_styles_to = get_root_for_style(target); + if (!append_styles_to.getElementById(style_sheet_id)) { + const style = element('style'); + style.id = style_sheet_id; + style.textContent = styles; + append_stylesheet(append_styles_to, style); + } +} + +/** + * @param {Node} node + * @returns {ShadowRoot | Document} + */ +function get_root_for_style(node) { + if (!node) return document; + const root = node.getRootNode ? node.getRootNode() : node.ownerDocument; + if (root && /** @type {ShadowRoot} */ (root).host) { + return /** @type {ShadowRoot} */ (root); + } + return node.ownerDocument; +} + +/** + * @param {Node} node + * @returns {CSSStyleSheet} + */ +function append_empty_stylesheet(node) { + const style_element = element('style'); + // For transitions to work without 'style-src: unsafe-inline' Content Security Policy, + // these empty tags need to be allowed with a hash as a workaround until we move to the Web Animations API. + // Using the hash for the empty string (for an empty tag) works in all browsers except Safari. + // So as a workaround for the workaround, when we append empty style tags we set their content to /* empty */. + // The hash 'sha256-9OlNO0DNEeaVzHL4RZwCLsBHA8WBQ8toBp/4F5XV2nc=' will then work even in Safari. + style_element.textContent = '/* empty */'; + append_stylesheet(get_root_for_style(node), style_element); + return style_element.sheet; +} + +/** + * @param {ShadowRoot | Document} node + * @param {HTMLStyleElement} style + * @returns {CSSStyleSheet} + */ +function append_stylesheet(node, style) { + append(/** @type {Document} */ (node).head || node, style); + return style.sheet; +} + +/** + * @param {NodeEx} target + * @param {NodeEx} node + * @returns {void} + */ +function append_hydration(target, node) { + if (is_hydrating) { + init_hydrate(target); + if ( + target.actual_end_child === undefined || + (target.actual_end_child !== null && target.actual_end_child.parentNode !== target) + ) { + target.actual_end_child = target.firstChild; + } + // Skip nodes of undefined ordering + while (target.actual_end_child !== null && target.actual_end_child.claim_order === undefined) { + target.actual_end_child = target.actual_end_child.nextSibling; + } + if (node !== target.actual_end_child) { + // We only insert if the ordering of this node should be modified or the parent node is not target + if (node.claim_order !== undefined || node.parentNode !== target) { + target.insertBefore(node, target.actual_end_child); + } + } else { + target.actual_end_child = node.nextSibling; + } + } else if (node.parentNode !== target || node.nextSibling !== null) { + target.appendChild(node); + } +} + +/** + * @param {Node} target + * @param {Node} node + * @param {Node} [anchor] + * @returns {void} + */ +function insert(target, node, anchor) { + target.insertBefore(node, anchor || null); +} + +/** + * @param {NodeEx} target + * @param {NodeEx} node + * @param {NodeEx} [anchor] + * @returns {void} + */ +function insert_hydration(target, node, anchor) { + if (is_hydrating && !anchor) { + append_hydration(target, node); + } else if (node.parentNode !== target || node.nextSibling != anchor) { + target.insertBefore(node, anchor || null); + } +} + +/** + * @param {Node} node + * @returns {void} + */ +function detach(node) { + if (node.parentNode) { + node.parentNode.removeChild(node); + } +} + +/** + * @returns {void} */ +function destroy_each(iterations, detaching) { + for (let i = 0; i < iterations.length; i += 1) { + if (iterations[i]) iterations[i].d(detaching); + } +} + +/** + * @template {keyof HTMLElementTagNameMap} K + * @param {K} name + * @returns {HTMLElementTagNameMap[K]} + */ +function element(name) { + return document.createElement(name); +} + +/** + * @template {keyof HTMLElementTagNameMap} K + * @param {K} name + * @param {string} is + * @returns {HTMLElementTagNameMap[K]} + */ +function element_is(name, is) { + return document.createElement(name, { is }); +} + +/** + * @template T + * @template {keyof T} K + * @param {T} obj + * @param {K[]} exclude + * @returns {Pick>} + */ +function object_without_properties(obj, exclude) { + const target = /** @type {Pick>} */ ({}); + for (const k in obj) { + if ( + has_prop(obj, k) && + // @ts-ignore + exclude.indexOf(k) === -1 + ) { + // @ts-ignore + target[k] = obj[k]; + } + } + return target; +} + +/** + * @template {keyof SVGElementTagNameMap} K + * @param {K} name + * @returns {SVGElement} + */ +function svg_element(name) { + return document.createElementNS('http://www.w3.org/2000/svg', name); +} + +/** + * @param {string} data + * @returns {Text} + */ +function text(data) { + return document.createTextNode(data); +} + +/** + * @returns {Text} */ +function space() { + return text(' '); +} + +/** + * @returns {Text} */ +function empty() { + return text(''); +} + +/** + * @param {string} content + * @returns {Comment} + */ +function comment(content) { + return document.createComment(content); +} + +/** + * @param {EventTarget} node + * @param {string} event + * @param {EventListenerOrEventListenerObject} handler + * @param {boolean | AddEventListenerOptions | EventListenerOptions} [options] + * @returns {() => void} + */ +function listen(node, event, handler, options) { + node.addEventListener(event, handler, options); + return () => node.removeEventListener(event, handler, options); +} + +/** + * @returns {(event: any) => any} */ +function prevent_default(fn) { + return function (event) { + event.preventDefault(); + // @ts-ignore + return fn.call(this, event); + }; +} + +/** + * @returns {(event: any) => any} */ +function stop_propagation(fn) { + return function (event) { + event.stopPropagation(); + // @ts-ignore + return fn.call(this, event); + }; +} + +/** + * @returns {(event: any) => any} */ +function stop_immediate_propagation(fn) { + return function (event) { + event.stopImmediatePropagation(); + // @ts-ignore + return fn.call(this, event); + }; +} + +/** + * @returns {(event: any) => void} */ +function self(fn) { + return function (event) { + // @ts-ignore + if (event.target === this) fn.call(this, event); + }; +} + +/** + * @returns {(event: any) => void} */ +function trusted(fn) { + return function (event) { + // @ts-ignore + if (event.isTrusted) fn.call(this, event); + }; +} + +/** + * @param {Element} node + * @param {string} attribute + * @param {string} [value] + * @returns {void} + */ +function attr(node, attribute, value) { + if (value == null) node.removeAttribute(attribute); + else if (node.getAttribute(attribute) !== value) node.setAttribute(attribute, value); +} +/** + * List of attributes that should always be set through the attr method, + * because updating them through the property setter doesn't work reliably. + * In the example of `width`/`height`, the problem is that the setter only + * accepts numeric values, but the attribute can also be set to a string like `50%`. + * If this list becomes too big, rethink this approach. + */ +const always_set_through_set_attribute = ['width', 'height']; + +/** + * @param {Element & ElementCSSInlineStyle} node + * @param {{ [x: string]: string }} attributes + * @returns {void} + */ +function set_attributes(node, attributes) { + // @ts-ignore + const descriptors = Object.getOwnPropertyDescriptors(node.__proto__); + for (const key in attributes) { + if (attributes[key] == null) { + node.removeAttribute(key); + } else if (key === 'style') { + node.style.cssText = attributes[key]; + } else if (key === '__value') { + /** @type {any} */ (node).value = node[key] = attributes[key]; + } else if ( + descriptors[key] && + descriptors[key].set && + always_set_through_set_attribute.indexOf(key) === -1 + ) { + node[key] = attributes[key]; + } else { + attr(node, key, attributes[key]); + } + } +} + +/** + * @param {Element & ElementCSSInlineStyle} node + * @param {{ [x: string]: string }} attributes + * @returns {void} + */ +function set_svg_attributes(node, attributes) { + for (const key in attributes) { + attr(node, key, attributes[key]); + } +} + +/** + * @param {Record} data_map + * @returns {void} + */ +function set_custom_element_data_map(node, data_map) { + Object.keys(data_map).forEach((key) => { + set_custom_element_data(node, key, data_map[key]); + }); +} + +/** + * @returns {void} */ +function set_custom_element_data(node, prop, value) { + const lower = prop.toLowerCase(); // for backwards compatibility with existing behavior we do lowercase first + if (lower in node) { + node[lower] = typeof node[lower] === 'boolean' && value === '' ? true : value; + } else if (prop in node) { + node[prop] = typeof node[prop] === 'boolean' && value === '' ? true : value; + } else { + attr(node, prop, value); + } +} + +/** + * @param {string} tag + */ +function set_dynamic_element_data(tag) { + return /-/.test(tag) ? set_custom_element_data_map : set_attributes; +} + +/** + * @returns {void} + */ +function xlink_attr(node, attribute, value) { + node.setAttributeNS('http://www.w3.org/1999/xlink', attribute, value); +} + +/** + * @param {HTMLElement} node + * @returns {string} + */ +function get_svelte_dataset(node) { + return node.dataset.svelteH; +} + +/** + * @returns {unknown[]} */ +function get_binding_group_value(group, __value, checked) { + const value = new Set(); + for (let i = 0; i < group.length; i += 1) { + if (group[i].checked) value.add(group[i].__value); + } + if (!checked) { + value.delete(__value); + } + return Array.from(value); +} + +/** + * @param {HTMLInputElement[]} group + * @returns {{ p(...inputs: HTMLInputElement[]): void; r(): void; }} + */ +function init_binding_group(group) { + /** + * @type {HTMLInputElement[]} */ + let _inputs; + return { + /* push */ p(...inputs) { + _inputs = inputs; + _inputs.forEach((input) => group.push(input)); + }, + /* remove */ r() { + _inputs.forEach((input) => group.splice(group.indexOf(input), 1)); + } + }; +} + +/** + * @param {number[]} indexes + * @returns {{ u(new_indexes: number[]): void; p(...inputs: HTMLInputElement[]): void; r: () => void; }} + */ +function init_binding_group_dynamic(group, indexes) { + /** + * @type {HTMLInputElement[]} */ + let _group = get_binding_group(group); + + /** + * @type {HTMLInputElement[]} */ + let _inputs; + + function get_binding_group(group) { + for (let i = 0; i < indexes.length; i++) { + group = group[indexes[i]] = group[indexes[i]] || []; + } + return group; + } + + /** + * @returns {void} */ + function push() { + _inputs.forEach((input) => _group.push(input)); + } + + /** + * @returns {void} */ + function remove() { + _inputs.forEach((input) => _group.splice(_group.indexOf(input), 1)); + } + return { + /* update */ u(new_indexes) { + indexes = new_indexes; + const new_group = get_binding_group(group); + if (new_group !== _group) { + remove(); + _group = new_group; + push(); + } + }, + /* push */ p(...inputs) { + _inputs = inputs; + push(); + }, + /* remove */ r: remove + }; +} + +/** @returns {number} */ +function to_number(value) { + return value === '' ? null : +value; +} + +/** @returns {any[]} */ +function time_ranges_to_array(ranges) { + const array = []; + for (let i = 0; i < ranges.length; i += 1) { + array.push({ start: ranges.start(i), end: ranges.end(i) }); + } + return array; +} + +/** + * @param {Element} element + * @returns {ChildNode[]} + */ +function children(element) { + return Array.from(element.childNodes); +} + +/** + * @param {ChildNodeArray} nodes + * @returns {void} + */ +function init_claim_info(nodes) { + if (nodes.claim_info === undefined) { + nodes.claim_info = { last_index: 0, total_claimed: 0 }; + } +} + +/** + * @template {ChildNodeEx} R + * @param {ChildNodeArray} nodes + * @param {(node: ChildNodeEx) => node is R} predicate + * @param {(node: ChildNodeEx) => ChildNodeEx | undefined} process_node + * @param {() => R} create_node + * @param {boolean} dont_update_last_index + * @returns {R} + */ +function claim_node(nodes, predicate, process_node, create_node, dont_update_last_index = false) { + // Try to find nodes in an order such that we lengthen the longest increasing subsequence + init_claim_info(nodes); + const result_node = (() => { + // We first try to find an element after the previous one + for (let i = nodes.claim_info.last_index; i < nodes.length; i++) { + const node = nodes[i]; + if (predicate(node)) { + const replacement = process_node(node); + if (replacement === undefined) { + nodes.splice(i, 1); + } else { + nodes[i] = replacement; + } + if (!dont_update_last_index) { + nodes.claim_info.last_index = i; + } + return node; + } + } + // Otherwise, we try to find one before + // We iterate in reverse so that we don't go too far back + for (let i = nodes.claim_info.last_index - 1; i >= 0; i--) { + const node = nodes[i]; + if (predicate(node)) { + const replacement = process_node(node); + if (replacement === undefined) { + nodes.splice(i, 1); + } else { + nodes[i] = replacement; + } + if (!dont_update_last_index) { + nodes.claim_info.last_index = i; + } else if (replacement === undefined) { + // Since we spliced before the last_index, we decrease it + nodes.claim_info.last_index--; + } + return node; + } + } + // If we can't find any matching node, we create a new one + return create_node(); + })(); + result_node.claim_order = nodes.claim_info.total_claimed; + nodes.claim_info.total_claimed += 1; + return result_node; +} + +/** + * @param {ChildNodeArray} nodes + * @param {string} name + * @param {{ [key: string]: boolean }} attributes + * @param {(name: string) => Element | SVGElement} create_element + * @returns {Element | SVGElement} + */ +function claim_element_base(nodes, name, attributes, create_element) { + return claim_node( + nodes, + /** @returns {node is Element | SVGElement} */ + (node) => node.nodeName === name, + /** @param {Element} node */ + (node) => { + const remove = []; + for (let j = 0; j < node.attributes.length; j++) { + const attribute = node.attributes[j]; + if (!attributes[attribute.name]) { + remove.push(attribute.name); + } + } + remove.forEach((v) => node.removeAttribute(v)); + return undefined; + }, + () => create_element(name) + ); +} + +/** + * @param {ChildNodeArray} nodes + * @param {string} name + * @param {{ [key: string]: boolean }} attributes + * @returns {Element | SVGElement} + */ +function claim_element(nodes, name, attributes) { + return claim_element_base(nodes, name, attributes, element); +} + +/** + * @param {ChildNodeArray} nodes + * @param {string} name + * @param {{ [key: string]: boolean }} attributes + * @returns {Element | SVGElement} + */ +function claim_svg_element(nodes, name, attributes) { + return claim_element_base(nodes, name, attributes, svg_element); +} + +/** + * @param {ChildNodeArray} nodes + * @returns {Text} + */ +function claim_text(nodes, data) { + return claim_node( + nodes, + /** @returns {node is Text} */ + (node) => node.nodeType === 3, + /** @param {Text} node */ + (node) => { + const data_str = '' + data; + if (node.data.startsWith(data_str)) { + if (node.data.length !== data_str.length) { + return node.splitText(data_str.length); + } + } else { + node.data = data_str; + } + }, + () => text(data), + true // Text nodes should not update last index since it is likely not worth it to eliminate an increasing subsequence of actual elements + ); +} + +/** + * @returns {Text} */ +function claim_space(nodes) { + return claim_text(nodes, ' '); +} + +/** + * @param {ChildNodeArray} nodes + * @returns {Comment} + */ +function claim_comment(nodes, data) { + return claim_node( + nodes, + /** @returns {node is Comment} */ + (node) => node.nodeType === 8, + /** @param {Comment} node */ + (node) => { + node.data = '' + data; + return undefined; + }, + () => comment(data), + true + ); +} + +function get_comment_idx(nodes, text, start) { + for (let i = start; i < nodes.length; i += 1) { + const node = nodes[i]; + if (node.nodeType === 8 /* comment node */ && node.textContent.trim() === text) { + return i; + } + } + return -1; +} + +/** + * @param {boolean} is_svg + * @returns {HtmlTagHydration} + */ +function claim_html_tag(nodes, is_svg) { + // find html opening tag + const start_index = get_comment_idx(nodes, 'HTML_TAG_START', 0); + const end_index = get_comment_idx(nodes, 'HTML_TAG_END', start_index + 1); + if (start_index === -1 || end_index === -1) { + return new HtmlTagHydration(is_svg); + } + + init_claim_info(nodes); + const html_tag_nodes = nodes.splice(start_index, end_index - start_index + 1); + detach(html_tag_nodes[0]); + detach(html_tag_nodes[html_tag_nodes.length - 1]); + const claimed_nodes = html_tag_nodes.slice(1, html_tag_nodes.length - 1); + if (claimed_nodes.length === 0) { + return new HtmlTagHydration(is_svg); + } + for (const n of claimed_nodes) { + n.claim_order = nodes.claim_info.total_claimed; + nodes.claim_info.total_claimed += 1; + } + return new HtmlTagHydration(is_svg, claimed_nodes); +} + +/** + * @param {Text} text + * @param {unknown} data + * @returns {void} + */ +function set_data(text, data) { + data = '' + data; + if (text.data === data) return; + text.data = /** @type {string} */ (data); +} + +/** + * @param {Text} text + * @param {unknown} data + * @returns {void} + */ +function set_data_contenteditable(text, data) { + data = '' + data; + if (text.wholeText === data) return; + text.data = /** @type {string} */ (data); +} + +/** + * @param {Text} text + * @param {unknown} data + * @param {string} attr_value + * @returns {void} + */ +function set_data_maybe_contenteditable(text, data, attr_value) { + if (~contenteditable_truthy_values.indexOf(attr_value)) { + set_data_contenteditable(text, data); + } else { + set_data(text, data); + } +} + +/** + * @returns {void} */ +function set_input_value(input, value) { + input.value = value == null ? '' : value; +} + +/** + * @returns {void} */ +function set_input_type(input, type) { + try { + input.type = type; + } catch (e) { + // do nothing + } +} + +/** + * @returns {void} */ +function set_style(node, key, value, important) { + if (value == null) { + node.style.removeProperty(key); + } else { + node.style.setProperty(key, value, important ? 'important' : ''); + } +} + +/** + * @returns {void} */ +function select_option(select, value, mounting) { + for (let i = 0; i < select.options.length; i += 1) { + const option = select.options[i]; + if (option.__value === value) { + option.selected = true; + return; + } + } + if (!mounting || value !== undefined) { + select.selectedIndex = -1; // no option should be selected + } +} + +/** + * @returns {void} */ +function select_options(select, value) { + for (let i = 0; i < select.options.length; i += 1) { + const option = select.options[i]; + option.selected = ~value.indexOf(option.__value); + } +} + +function select_value(select) { + const selected_option = select.querySelector(':checked'); + return selected_option && selected_option.__value; +} + +function select_multiple_value(select) { + return [].map.call(select.querySelectorAll(':checked'), (option) => option.__value); +} +// unfortunately this can't be a constant as that wouldn't be tree-shakeable +// so we cache the result instead + +/** + * @type {boolean} */ +let crossorigin; + +/** + * @returns {boolean} */ +function is_crossorigin() { + if (crossorigin === undefined) { + crossorigin = false; + try { + if (typeof window !== 'undefined' && window.parent) { + void window.parent.document; + } + } catch (error) { + crossorigin = true; + } + } + return crossorigin; +} + +/** + * @param {HTMLElement} node + * @param {() => void} fn + * @returns {() => void} + */ +function add_iframe_resize_listener(node, fn) { + const computed_style = getComputedStyle(node); + if (computed_style.position === 'static') { + node.style.position = 'relative'; + } + const iframe = element('iframe'); + iframe.setAttribute( + 'style', + 'display: block; position: absolute; top: 0; left: 0; width: 100%; height: 100%; ' + + 'overflow: hidden; border: 0; opacity: 0; pointer-events: none; z-index: -1;' + ); + iframe.setAttribute('aria-hidden', 'true'); + iframe.tabIndex = -1; + const crossorigin = is_crossorigin(); + + /** + * @type {() => void} + */ + let unsubscribe; + if (crossorigin) { + iframe.src = "data:text/html,"; + unsubscribe = listen( + window, + 'message', + /** @param {MessageEvent} event */ (event) => { + if (event.source === iframe.contentWindow) fn(); + } + ); + } else { + iframe.src = 'about:blank'; + iframe.onload = () => { + unsubscribe = listen(iframe.contentWindow, 'resize', fn); + // make sure an initial resize event is fired _after_ the iframe is loaded (which is asynchronous) + // see https://github.com/sveltejs/svelte/issues/4233 + fn(); + }; + } + append(node, iframe); + return () => { + if (crossorigin) { + unsubscribe(); + } else if (unsubscribe && iframe.contentWindow) { + unsubscribe(); + } + detach(iframe); + }; +} +const resize_observer_content_box = /* @__PURE__ */ new ResizeObserverSingleton({ + box: 'content-box' +}); +const resize_observer_border_box = /* @__PURE__ */ new ResizeObserverSingleton({ + box: 'border-box' +}); +const resize_observer_device_pixel_content_box = /* @__PURE__ */ new ResizeObserverSingleton( + { box: 'device-pixel-content-box' } +); + +/** + * @returns {void} */ +function toggle_class(element, name, toggle) { + // The `!!` is required because an `undefined` flag means flipping the current state. + element.classList.toggle(name, !!toggle); +} + +/** + * @template T + * @param {string} type + * @param {T} [detail] + * @param {{ bubbles?: boolean, cancelable?: boolean }} [options] + * @returns {CustomEvent} + */ +function custom_event(type, detail, { bubbles = false, cancelable = false } = {}) { + return new CustomEvent(type, { detail, bubbles, cancelable }); +} + +/** + * @param {string} selector + * @param {HTMLElement} parent + * @returns {ChildNodeArray} + */ +function query_selector_all(selector, parent = document.body) { + return Array.from(parent.querySelectorAll(selector)); +} + +/** + * @param {string} nodeId + * @param {HTMLElement} head + * @returns {any[]} + */ +function head_selector(nodeId, head) { + const result = []; + let started = 0; + for (const node of head.childNodes) { + if (node.nodeType === 8 /* comment node */) { + const comment = node.textContent.trim(); + if (comment === `HEAD_${nodeId}_END`) { + started -= 1; + result.push(node); + } else if (comment === `HEAD_${nodeId}_START`) { + started += 1; + result.push(node); + } + } else if (started > 0) { + result.push(node); + } + } + return result; +} +/** */ +class HtmlTag { + /** + * @private + * @default false + */ + is_svg = false; + /** parent for creating node */ + e = undefined; + /** html tag nodes */ + n = undefined; + /** target */ + t = undefined; + /** anchor */ + a = undefined; + constructor(is_svg = false) { + this.is_svg = is_svg; + this.e = this.n = null; + } + + /** + * @param {string} html + * @returns {void} + */ + c(html) { + this.h(html); + } + + /** + * @param {string} html + * @param {HTMLElement | SVGElement} target + * @param {HTMLElement | SVGElement} anchor + * @returns {void} + */ + m(html, target, anchor = null) { + if (!this.e) { + if (this.is_svg) + this.e = svg_element(/** @type {keyof SVGElementTagNameMap} */ (target.nodeName)); + /** #7364 target for