From 10d7be1a04e12d764e5284a334cdd65c6bb94f52 Mon Sep 17 00:00:00 2001
From: claus75a
Date: Fri, 14 Jun 2024 08:29:05 +0200
Subject: [PATCH] update files inside importify folder
---
.../importify/get_columnlist_from_csv.php | 5 +-
public/userarea/index.php | 2 +-
public/userarea/products/products.php | 227 +
public/userarea/reports/reports-dashboard.php | 222 +
public/userarea/reports/reports.php | 227 +
public/userarea/statkpi/statkpi.php | 227 +
public/vendor/autoload.php | 25 +
public/vendor/composer/ClassLoader.php | 579 ++
public/vendor/composer/InstalledVersions.php | 359 +
public/vendor/composer/LICENSE | 21 +
public/vendor/composer/autoload_classmap.php | 10 +
.../vendor/composer/autoload_namespaces.php | 9 +
public/vendor/composer/autoload_psr4.php | 16 +
public/vendor/composer/autoload_real.php | 38 +
public/vendor/composer/autoload_static.php | 76 +
public/vendor/composer/installed.json | 533 ++
public/vendor/composer/installed.php | 95 +
public/vendor/composer/platform_check.php | 30 +
.../maennchen/zipstream-php/.editorconfig | 22 +
.../maennchen/zipstream-php/.phive/phars.xml | 4 +
.../zipstream-php/.php-cs-fixer.dist.php | 71 +
.../.phpdoc/template/base.html.twig | 15 +
.../maennchen/zipstream-php/.tool-versions | 1 +
public/vendor/maennchen/zipstream-php/LICENSE | 24 +
.../vendor/maennchen/zipstream-php/README.md | 183 +
.../maennchen/zipstream-php/composer.json | 88 +
.../zipstream-php/guides/ContentLength.rst | 47 +
.../zipstream-php/guides/FlySystem.rst | 34 +
.../maennchen/zipstream-php/guides/Nginx.rst | 16 +
.../zipstream-php/guides/Options.rst | 66 +
.../zipstream-php/guides/PSR7Streams.rst | 21 +
.../zipstream-php/guides/StreamOutput.rst | 39 +
.../zipstream-php/guides/Symfony.rst | 130 +
.../zipstream-php/guides/Varnish.rst | 22 +
.../maennchen/zipstream-php/guides/index.rst | 126 +
.../maennchen/zipstream-php/phpdoc.dist.xml | 39 +
.../maennchen/zipstream-php/phpunit.xml.dist | 15 +
.../vendor/maennchen/zipstream-php/psalm.xml | 23 +
.../src/CentralDirectoryFileHeader.php | 52 +
.../zipstream-php/src/CompressionMethod.php | 106 +
.../zipstream-php/src/DataDescriptor.php | 26 +
.../src/EndOfCentralDirectory.php | 35 +
.../maennchen/zipstream-php/src/Exception.php | 9 +
.../Exception/DosTimeOverflowException.php | 23 +
.../src/Exception/FileNotFoundException.php | 22 +
.../Exception/FileNotReadableException.php | 22 +
.../Exception/FileSizeIncorrectException.php | 23 +
.../src/Exception/OverflowException.php | 21 +
.../src/Exception/ResourceActionException.php | 29 +
.../SimulationFileUnknownException.php | 19 +
.../Exception/StreamNotReadableException.php | 21 +
.../Exception/StreamNotSeekableException.php | 22 +
.../maennchen/zipstream-php/src/File.php | 420 +
.../src/GeneralPurposeBitFlag.php | 89 +
.../zipstream-php/src/LocalFileHeader.php | 40 +
.../zipstream-php/src/OperationMode.php | 35 +
.../maennchen/zipstream-php/src/PackField.php | 57 +
.../maennchen/zipstream-php/src/Time.php | 45 +
.../maennchen/zipstream-php/src/Version.php | 12 +
.../src/Zip64/DataDescriptor.php | 28 +
.../src/Zip64/EndOfCentralDirectory.php | 43 +
.../Zip64/EndOfCentralDirectoryLocator.php | 29 +
.../Zip64/ExtendedInformationExtraField.php | 46 +
.../maennchen/zipstream-php/src/ZipStream.php | 864 ++
.../src/Zs/ExtendedInformationExtraField.php | 23 +
.../zipstream-php/test/Assertions.php | 49 +
.../test/CentralDirectoryFileHeaderTest.php | 60 +
.../zipstream-php/test/DataDescriptorTest.php | 26 +
.../test/EndOfCentralDirectoryTest.php | 35 +
.../zipstream-php/test/EndlessCycleStream.php | 106 +
.../test/FaultInjectionResource.php | 141 +
.../test/LocalFileHeaderTest.php | 47 +
.../zipstream-php/test/PackFieldTest.php | 42 +
.../zipstream-php/test/ResourceStream.php | 160 +
.../maennchen/zipstream-php/test/TimeTest.php | 35 +
.../maennchen/zipstream-php/test/Util.php | 135 +
.../test/Zip64/DataDescriptorTest.php | 28 +
.../EndOfCentralDirectoryLocatorTest.php | 28 +
.../test/Zip64/EndOfCentralDirectoryTest.php | 41 +
.../ExtendedInformationExtraFieldTest.php | 42 +
.../zipstream-php/test/ZipStreamTest.php | 1284 +++
.../Zs/ExtendedInformationExtraFieldTest.php | 22 +
.../zipstream-php/test/bootstrap.php | 7 +
.../complex/.github/workflows/main.yml | 153 +
public/vendor/markbaker/complex/README.md | 173 +
.../markbaker/complex/classes/src/Complex.php | 388 +
.../complex/classes/src/Exception.php | 13 +
.../complex/classes/src/Functions.php | 823 ++
.../complex/classes/src/Operations.php | 210 +
public/vendor/markbaker/complex/composer.json | 40 +
.../complex/examples/complexTest.php | 154 +
.../complex/examples/testFunctions.php | 52 +
.../complex/examples/testOperations.php | 35 +
public/vendor/markbaker/complex/license.md | 25 +
.../matrix/.github/workflows/main.yaml | 124 +
public/vendor/markbaker/matrix/README.md | 215 +
public/vendor/markbaker/matrix/buildPhar.php | 62 +
.../markbaker/matrix/classes/src/Builder.php | 70 +
.../src/Decomposition/Decomposition.php | 27 +
.../matrix/classes/src/Decomposition/LU.php | 260 +
.../matrix/classes/src/Decomposition/QR.php | 191 +
.../matrix/classes/src/Div0Exception.php | 13 +
.../matrix/classes/src/Exception.php | 13 +
.../matrix/classes/src/Functions.php | 376 +
.../markbaker/matrix/classes/src/Matrix.php | 423 +
.../matrix/classes/src/Operations.php | 157 +
.../matrix/classes/src/Operators/Addition.php | 68 +
.../classes/src/Operators/DirectSum.php | 64 +
.../matrix/classes/src/Operators/Division.php | 35 +
.../classes/src/Operators/Multiplication.php | 86 +
.../matrix/classes/src/Operators/Operator.php | 78 +
.../classes/src/Operators/Subtraction.php | 68 +
public/vendor/markbaker/matrix/composer.json | 52 +
.../vendor/markbaker/matrix/examples/test.php | 33 +
.../markbaker/matrix/infection.json.dist | 17 +
public/vendor/markbaker/matrix/license.md | 25 +
public/vendor/markbaker/matrix/phpstan.neon | 6 +
.../phpspreadsheet/.php-cs-fixer.dist.php | 251 +
.../phpoffice/phpspreadsheet/.phpcs.xml.dist | 26 +
.../phpspreadsheet/.readthedocs.yaml | 12 +
.../phpoffice/phpspreadsheet/CHANGELOG.md | 1534 ++++
.../phpoffice/phpspreadsheet/CONTRIBUTING.md | 45 +
.../vendor/phpoffice/phpspreadsheet/LICENSE | 21 +
.../vendor/phpoffice/phpspreadsheet/README.md | 141 +
.../phpoffice/phpspreadsheet/composer.json | 120 +
.../phpspreadsheet/phpstan-baseline.neon | 2 +
.../phpspreadsheet/phpstan.neon.dist | 30 +
.../Calculation/ArrayEnabled.php | 122 +
.../Calculation/BinaryComparison.php | 136 +
.../Calculation/Calculation.php | 5665 +++++++++++++
.../PhpSpreadsheet/Calculation/Category.php | 21 +
.../Calculation/Database/DAverage.php | 44 +
.../Calculation/Database/DCount.php | 45 +
.../Calculation/Database/DCountA.php | 44 +
.../Calculation/Database/DGet.php | 49 +
.../Calculation/Database/DMax.php | 45 +
.../Calculation/Database/DMin.php | 45 +
.../Calculation/Database/DProduct.php | 44 +
.../Calculation/Database/DStDev.php | 45 +
.../Calculation/Database/DStDevP.php | 45 +
.../Calculation/Database/DSum.php | 44 +
.../Calculation/Database/DVar.php | 47 +
.../Calculation/Database/DVarP.php | 47 +
.../Calculation/Database/DatabaseAbstract.php | 177 +
.../Calculation/DateTimeExcel/Constants.php | 38 +
.../Calculation/DateTimeExcel/Current.php | 60 +
.../Calculation/DateTimeExcel/Date.php | 167 +
.../Calculation/DateTimeExcel/DateParts.php | 154 +
.../Calculation/DateTimeExcel/DateValue.php | 163 +
.../Calculation/DateTimeExcel/Days.php | 62 +
.../Calculation/DateTimeExcel/Days360.php | 118 +
.../Calculation/DateTimeExcel/Difference.php | 153 +
.../Calculation/DateTimeExcel/Helpers.php | 285 +
.../Calculation/DateTimeExcel/Month.php | 104 +
.../Calculation/DateTimeExcel/NetworkDays.php | 119 +
.../Calculation/DateTimeExcel/Time.php | 130 +
.../Calculation/DateTimeExcel/TimeParts.php | 135 +
.../Calculation/DateTimeExcel/TimeValue.php | 80 +
.../Calculation/DateTimeExcel/Week.php | 274 +
.../Calculation/DateTimeExcel/WorkDay.php | 198 +
.../Calculation/DateTimeExcel/YearFrac.php | 124 +
.../Engine/ArrayArgumentHelper.php | 190 +
.../Engine/ArrayArgumentProcessor.php | 159 +
.../Calculation/Engine/BranchPruner.php | 201 +
.../Engine/CyclicReferenceStack.php | 65 +
.../Calculation/Engine/FormattedNumber.php | 147 +
.../Calculation/Engine/Logger.php | 126 +
.../Calculation/Engine/Operands/Operand.php | 10 +
.../Engine/Operands/StructuredReference.php | 355 +
.../Calculation/Engineering/BesselI.php | 141 +
.../Calculation/Engineering/BesselJ.php | 176 +
.../Calculation/Engineering/BesselK.php | 130 +
.../Calculation/Engineering/BesselY.php | 137 +
.../Calculation/Engineering/BitWise.php | 247 +
.../Calculation/Engineering/Compare.php | 82 +
.../Calculation/Engineering/Complex.php | 120 +
.../Engineering/ComplexFunctions.php | 592 ++
.../Engineering/ComplexOperations.php | 128 +
.../Calculation/Engineering/Constants.php | 11 +
.../Calculation/Engineering/ConvertBase.php | 69 +
.../Calculation/Engineering/ConvertBinary.php | 163 +
.../Engineering/ConvertDecimal.php | 213 +
.../Calculation/Engineering/ConvertHex.php | 175 +
.../Calculation/Engineering/ConvertOctal.php | 174 +
.../Calculation/Engineering/ConvertUOM.php | 679 ++
.../Engineering/EngineeringValidations.php | 27 +
.../Calculation/Engineering/Erf.php | 109 +
.../Calculation/Engineering/ErfC.php | 77 +
.../PhpSpreadsheet/Calculation/Exception.php | 22 +
.../Calculation/ExceptionHandler.php | 24 +
.../Calculation/Financial/Amortization.php | 215 +
.../CashFlow/CashFlowValidations.php | 41 +
.../Financial/CashFlow/Constant/Periodic.php | 195 +
.../CashFlow/Constant/Periodic/Cumulative.php | 138 +
.../CashFlow/Constant/Periodic/Interest.php | 213 +
.../Periodic/InterestAndPrincipal.php | 44 +
.../CashFlow/Constant/Periodic/Payments.php | 116 +
.../Calculation/Financial/CashFlow/Single.php | 107 +
.../CashFlow/Variable/NonPeriodic.php | 301 +
.../Financial/CashFlow/Variable/Periodic.php | 157 +
.../Calculation/Financial/Constants.php | 19 +
.../Calculation/Financial/Coupons.php | 407 +
.../Calculation/Financial/Depreciation.php | 265 +
.../Calculation/Financial/Dollar.php | 127 +
.../Financial/FinancialValidations.php | 122 +
.../Calculation/Financial/Helpers.php | 58 +
.../Calculation/Financial/InterestRate.php | 71 +
.../Financial/Securities/AccruedInterest.php | 151 +
.../Financial/Securities/Price.php | 283 +
.../Financial/Securities/Rates.php | 134 +
.../Securities/SecurityValidations.php | 32 +
.../Financial/Securities/Yields.php | 153 +
.../Calculation/Financial/TreasuryBill.php | 146 +
.../Calculation/FormulaParser.php | 616 ++
.../Calculation/FormulaToken.php | 131 +
.../PhpSpreadsheet/Calculation/Functions.php | 322 +
.../Calculation/Information/ErrorValue.php | 68 +
.../Calculation/Information/ExcelError.php | 155 +
.../Calculation/Information/Value.php | 317 +
.../Calculation/Internal/MakeMatrix.php | 12 +
.../Calculation/Internal/WildcardMatch.php | 39 +
.../Calculation/Logical/Boolean.php | 36 +
.../Calculation/Logical/Conditional.php | 211 +
.../Calculation/Logical/Operations.php | 163 +
.../Calculation/LookupRef/Address.php | 123 +
.../Calculation/LookupRef/ExcelMatch.php | 249 +
.../Calculation/LookupRef/Filter.php | 72 +
.../Calculation/LookupRef/Formula.php | 41 +
.../Calculation/LookupRef/HLookup.php | 121 +
.../Calculation/LookupRef/Helpers.php | 74 +
.../Calculation/LookupRef/Hyperlink.php | 41 +
.../Calculation/LookupRef/Indirect.php | 128 +
.../Calculation/LookupRef/Lookup.php | 105 +
.../Calculation/LookupRef/LookupBase.php | 64 +
.../LookupRef/LookupRefValidations.php | 34 +
.../Calculation/LookupRef/Matrix.php | 138 +
.../Calculation/LookupRef/Offset.php | 148 +
.../LookupRef/RowColumnInformation.php | 210 +
.../Calculation/LookupRef/Selection.php | 51 +
.../Calculation/LookupRef/Sort.php | 309 +
.../Calculation/LookupRef/Unique.php | 131 +
.../Calculation/LookupRef/VLookup.php | 117 +
.../Calculation/MathTrig/Absolute.php | 37 +
.../Calculation/MathTrig/Angle.php | 63 +
.../Calculation/MathTrig/Arabic.php | 92 +
.../Calculation/MathTrig/Base.php | 65 +
.../Calculation/MathTrig/Ceiling.php | 165 +
.../Calculation/MathTrig/Combinations.php | 103 +
.../Calculation/MathTrig/Exp.php | 37 +
.../Calculation/MathTrig/Factorial.php | 126 +
.../Calculation/MathTrig/Floor.php | 191 +
.../Calculation/MathTrig/Gcd.php | 65 +
.../Calculation/MathTrig/Helpers.php | 111 +
.../Calculation/MathTrig/IntClass.php | 40 +
.../Calculation/MathTrig/Lcm.php | 111 +
.../Calculation/MathTrig/Logarithms.php | 102 +
.../Calculation/MathTrig/MatrixFunctions.php | 179 +
.../Calculation/MathTrig/Operations.php | 155 +
.../Calculation/MathTrig/Random.php | 99 +
.../Calculation/MathTrig/Roman.php | 846 ++
.../Calculation/MathTrig/Round.php | 220 +
.../Calculation/MathTrig/SeriesSum.php | 53 +
.../Calculation/MathTrig/Sign.php | 38 +
.../Calculation/MathTrig/Sqrt.php | 64 +
.../Calculation/MathTrig/Subtotal.php | 127 +
.../Calculation/MathTrig/Sum.php | 110 +
.../Calculation/MathTrig/SumSquares.php | 133 +
.../Calculation/MathTrig/Trig/Cosecant.php | 64 +
.../Calculation/MathTrig/Trig/Cosine.php | 116 +
.../Calculation/MathTrig/Trig/Cotangent.php | 118 +
.../Calculation/MathTrig/Trig/Secant.php | 64 +
.../Calculation/MathTrig/Trig/Sine.php | 116 +
.../Calculation/MathTrig/Trig/Tangent.php | 160 +
.../Calculation/MathTrig/Trunc.php | 48 +
.../Calculation/Statistical/AggregateBase.php | 59 +
.../Calculation/Statistical/Averages.php | 259 +
.../Calculation/Statistical/Averages/Mean.php | 126 +
.../Calculation/Statistical/Conditional.php | 293 +
.../Calculation/Statistical/Confidence.php | 51 +
.../Calculation/Statistical/Counts.php | 96 +
.../Calculation/Statistical/Deviations.php | 138 +
.../Statistical/Distributions/Beta.php | 279 +
.../Statistical/Distributions/Binomial.php | 231 +
.../Statistical/Distributions/ChiSquared.php | 331 +
.../Distributions/DistributionValidations.php | 21 +
.../Statistical/Distributions/Exponential.php | 54 +
.../Statistical/Distributions/F.php | 63 +
.../Statistical/Distributions/Fisher.php | 72 +
.../Statistical/Distributions/Gamma.php | 148 +
.../Statistical/Distributions/GammaBase.php | 388 +
.../Distributions/HyperGeometric.php | 75 +
.../Statistical/Distributions/LogNormal.php | 139 +
.../Distributions/NewtonRaphson.php | 64 +
.../Statistical/Distributions/Normal.php | 180 +
.../Statistical/Distributions/Poisson.php | 66 +
.../Distributions/StandardNormal.php | 158 +
.../Statistical/Distributions/StudentT.php | 132 +
.../Statistical/Distributions/Weibull.php | 57 +
.../Calculation/Statistical/MaxMinBase.php | 17 +
.../Calculation/Statistical/Maximum.php | 85 +
.../Calculation/Statistical/Minimum.php | 85 +
.../Calculation/Statistical/Percentiles.php | 202 +
.../Calculation/Statistical/Permutations.php | 100 +
.../Calculation/Statistical/Size.php | 97 +
.../Statistical/StandardDeviations.php | 89 +
.../Calculation/Statistical/Standardize.php | 49 +
.../Statistical/StatisticalValidations.php | 36 +
.../Calculation/Statistical/Trends.php | 425 +
.../Calculation/Statistical/VarianceBase.php | 28 +
.../Calculation/Statistical/Variances.php | 186 +
.../Calculation/TextData/CaseConvert.php | 77 +
.../Calculation/TextData/CharacterConvert.php | 81 +
.../Calculation/TextData/Concatenate.php | 137 +
.../Calculation/TextData/Extract.php | 270 +
.../Calculation/TextData/Format.php | 313 +
.../Calculation/TextData/Helpers.php | 82 +
.../Calculation/TextData/Replace.php | 116 +
.../Calculation/TextData/Search.php | 97 +
.../Calculation/TextData/Text.php | 233 +
.../Calculation/TextData/Trim.php | 50 +
.../Calculation/Token/Stack.php | 119 +
.../Calculation/Web/Service.php | 73 +
.../Calculation/locale/Translations.xlsx | Bin 0 -> 140431 bytes
.../Calculation/locale/bg/config | 24 +
.../Calculation/locale/bg/functions | 409 +
.../Calculation/locale/cs/config | 20 +
.../Calculation/locale/cs/functions | 520 ++
.../Calculation/locale/da/config | 20 +
.../Calculation/locale/da/functions | 538 ++
.../Calculation/locale/de/config | 20 +
.../Calculation/locale/de/functions | 534 ++
.../Calculation/locale/en/uk/config | 24 +
.../Calculation/locale/es/config | 20 +
.../Calculation/locale/es/functions | 538 ++
.../Calculation/locale/fi/config | 20 +
.../Calculation/locale/fi/functions | 538 ++
.../Calculation/locale/fr/config | 20 +
.../Calculation/locale/fr/functions | 525 ++
.../Calculation/locale/hu/config | 20 +
.../Calculation/locale/hu/functions | 538 ++
.../Calculation/locale/it/config | 20 +
.../Calculation/locale/it/functions | 537 ++
.../Calculation/locale/nb/config | 20 +
.../Calculation/locale/nb/functions | 539 ++
.../Calculation/locale/nl/config | 20 +
.../Calculation/locale/nl/functions | 537 ++
.../Calculation/locale/pl/config | 20 +
.../Calculation/locale/pl/functions | 536 ++
.../Calculation/locale/pt/br/config | 20 +
.../Calculation/locale/pt/br/functions | 528 ++
.../Calculation/locale/pt/config | 20 +
.../Calculation/locale/pt/functions | 538 ++
.../Calculation/locale/ru/config | 20 +
.../Calculation/locale/ru/functions | 555 ++
.../Calculation/locale/sv/config | 20 +
.../Calculation/locale/sv/functions | 533 ++
.../Calculation/locale/tr/config | 20 +
.../Calculation/locale/tr/functions | 537 ++
.../src/PhpSpreadsheet/Cell/AddressHelper.php | 177 +
.../src/PhpSpreadsheet/Cell/AddressRange.php | 27 +
.../Cell/AdvancedValueBinder.php | 211 +
.../src/PhpSpreadsheet/Cell/Cell.php | 825 ++
.../src/PhpSpreadsheet/Cell/CellAddress.php | 148 +
.../src/PhpSpreadsheet/Cell/CellRange.php | 134 +
.../src/PhpSpreadsheet/Cell/ColumnRange.php | 125 +
.../src/PhpSpreadsheet/Cell/Coordinate.php | 678 ++
.../src/PhpSpreadsheet/Cell/DataType.php | 89 +
.../PhpSpreadsheet/Cell/DataValidation.php | 421 +
.../src/PhpSpreadsheet/Cell/DataValidator.php | 117 +
.../Cell/DefaultValueBinder.php | 79 +
.../src/PhpSpreadsheet/Cell/Hyperlink.php | 96 +
.../src/PhpSpreadsheet/Cell/IValueBinder.php | 14 +
.../src/PhpSpreadsheet/Cell/IgnoredErrors.php | 62 +
.../src/PhpSpreadsheet/Cell/RowRange.php | 93 +
.../PhpSpreadsheet/Cell/StringValueBinder.php | 118 +
.../PhpSpreadsheet/CellReferenceHelper.php | 119 +
.../src/PhpSpreadsheet/Chart/Axis.php | 344 +
.../src/PhpSpreadsheet/Chart/AxisText.php | 63 +
.../src/PhpSpreadsheet/Chart/Chart.php | 770 ++
.../src/PhpSpreadsheet/Chart/ChartColor.php | 160 +
.../src/PhpSpreadsheet/Chart/DataSeries.php | 412 +
.../PhpSpreadsheet/Chart/DataSeriesValues.php | 569 ++
.../src/PhpSpreadsheet/Chart/Exception.php | 9 +
.../src/PhpSpreadsheet/Chart/GridLines.php | 13 +
.../src/PhpSpreadsheet/Chart/Layout.php | 524 ++
.../src/PhpSpreadsheet/Chart/Legend.php | 174 +
.../src/PhpSpreadsheet/Chart/PlotArea.php | 207 +
.../src/PhpSpreadsheet/Chart/Properties.php | 884 ++
.../Chart/Renderer/IRenderer.php | 22 +
.../PhpSpreadsheet/Chart/Renderer/JpGraph.php | 40 +
.../Chart/Renderer/JpGraphRendererBase.php | 882 ++
.../Chart/Renderer/MtJpGraphRenderer.php | 38 +
.../Chart/Renderer/PHP Charting Libraries.txt | 23 +
.../src/PhpSpreadsheet/Chart/Title.php | 171 +
.../src/PhpSpreadsheet/Chart/TrendLine.php | 217 +
.../src/PhpSpreadsheet/Collection/Cells.php | 469 +
.../Collection/CellsFactory.php | 20 +
.../Collection/Memory/SimpleCache1.php | 82 +
.../Collection/Memory/SimpleCache3.php | 80 +
.../src/PhpSpreadsheet/Comment.php | 343 +
.../src/PhpSpreadsheet/DefinedName.php | 269 +
.../PhpSpreadsheet/Document/Properties.php | 509 ++
.../src/PhpSpreadsheet/Document/Security.php | 140 +
.../src/PhpSpreadsheet/Exception.php | 9 +
.../src/PhpSpreadsheet/HashTable.php | 175 +
.../src/PhpSpreadsheet/Helper/Dimension.php | 110 +
.../src/PhpSpreadsheet/Helper/Downloader.php | 101 +
.../src/PhpSpreadsheet/Helper/Handler.php | 45 +
.../src/PhpSpreadsheet/Helper/Html.php | 860 ++
.../src/PhpSpreadsheet/Helper/Sample.php | 299 +
.../src/PhpSpreadsheet/Helper/Size.php | 45 +
.../src/PhpSpreadsheet/Helper/TextGrid.php | 124 +
.../src/PhpSpreadsheet/IComparable.php | 13 +
.../src/PhpSpreadsheet/IOFactory.php | 236 +
.../src/PhpSpreadsheet/NamedFormula.php | 45 +
.../src/PhpSpreadsheet/NamedRange.php | 55 +
.../src/PhpSpreadsheet/Reader/BaseReader.php | 223 +
.../src/PhpSpreadsheet/Reader/Csv.php | 651 ++
.../PhpSpreadsheet/Reader/Csv/Delimiter.php | 145 +
.../Reader/DefaultReadFilter.php | 18 +
.../src/PhpSpreadsheet/Reader/Exception.php | 9 +
.../src/PhpSpreadsheet/Reader/Gnumeric.php | 585 ++
.../Reader/Gnumeric/PageSetup.php | 147 +
.../Reader/Gnumeric/Properties.php | 161 +
.../PhpSpreadsheet/Reader/Gnumeric/Styles.php | 273 +
.../src/PhpSpreadsheet/Reader/Html.php | 1139 +++
.../src/PhpSpreadsheet/Reader/IReadFilter.php | 15 +
.../src/PhpSpreadsheet/Reader/IReader.php | 124 +
.../src/PhpSpreadsheet/Reader/Ods.php | 806 ++
.../PhpSpreadsheet/Reader/Ods/AutoFilter.php | 45 +
.../PhpSpreadsheet/Reader/Ods/BaseLoader.php | 21 +
.../Reader/Ods/DefinedNames.php | 70 +
.../Reader/Ods/FormulaTranslator.php | 97 +
.../Reader/Ods/PageSettings.php | 171 +
.../PhpSpreadsheet/Reader/Ods/Properties.php | 136 +
.../Reader/Security/XmlScanner.php | 87 +
.../src/PhpSpreadsheet/Reader/Slk.php | 564 ++
.../src/PhpSpreadsheet/Reader/Xls.php | 7550 +++++++++++++++++
.../src/PhpSpreadsheet/Reader/Xls/Color.php | 35 +
.../PhpSpreadsheet/Reader/Xls/Color/BIFF5.php | 73 +
.../PhpSpreadsheet/Reader/Xls/Color/BIFF8.php | 73 +
.../Reader/Xls/Color/BuiltIn.php | 29 +
.../Reader/Xls/ConditionalFormatting.php | 49 +
.../Reader/Xls/DataValidationHelper.php | 72 +
.../PhpSpreadsheet/Reader/Xls/ErrorCode.php | 24 +
.../src/PhpSpreadsheet/Reader/Xls/Escher.php | 607 ++
.../src/PhpSpreadsheet/Reader/Xls/MD5.php | 193 +
.../src/PhpSpreadsheet/Reader/Xls/RC4.php | 59 +
.../Reader/Xls/Style/Border.php | 37 +
.../Reader/Xls/Style/CellAlignment.php | 50 +
.../Reader/Xls/Style/CellFont.php | 39 +
.../Reader/Xls/Style/FillPattern.php | 46 +
.../src/PhpSpreadsheet/Reader/Xlsx.php | 2344 +++++
.../PhpSpreadsheet/Reader/Xlsx/AutoFilter.php | 161 +
.../Reader/Xlsx/BaseParserClass.php | 21 +
.../src/PhpSpreadsheet/Reader/Xlsx/Chart.php | 1572 ++++
.../Reader/Xlsx/ColumnAndRowAttributes.php | 219 +
.../Reader/Xlsx/ConditionalStyles.php | 331 +
.../Reader/Xlsx/DataValidations.php | 65 +
.../PhpSpreadsheet/Reader/Xlsx/Hyperlinks.php | 64 +
.../PhpSpreadsheet/Reader/Xlsx/Namespaces.php | 118 +
.../PhpSpreadsheet/Reader/Xlsx/PageSetup.php | 170 +
.../PhpSpreadsheet/Reader/Xlsx/Properties.php | 98 +
.../Reader/Xlsx/SharedFormula.php | 26 +
.../Reader/Xlsx/SheetViewOptions.php | 138 +
.../PhpSpreadsheet/Reader/Xlsx/SheetViews.php | 199 +
.../src/PhpSpreadsheet/Reader/Xlsx/Styles.php | 436 +
.../Reader/Xlsx/TableReader.php | 116 +
.../src/PhpSpreadsheet/Reader/Xlsx/Theme.php | 64 +
.../Reader/Xlsx/WorkbookView.php | 141 +
.../src/PhpSpreadsheet/Reader/Xml.php | 728 ++
.../Reader/Xml/DataValidations.php | 177 +
.../Reader/Xml/PageSettings.php | 130 +
.../PhpSpreadsheet/Reader/Xml/Properties.php | 155 +
.../src/PhpSpreadsheet/Reader/Xml/Style.php | 107 +
.../Reader/Xml/Style/Alignment.php | 58 +
.../Reader/Xml/Style/Border.php | 110 +
.../PhpSpreadsheet/Reader/Xml/Style/Fill.php | 63 +
.../PhpSpreadsheet/Reader/Xml/Style/Font.php | 79 +
.../Reader/Xml/Style/NumberFormat.php | 33 +
.../Reader/Xml/Style/StyleBase.php | 30 +
.../src/PhpSpreadsheet/ReferenceHelper.php | 1235 +++
.../PhpSpreadsheet/RichText/ITextElement.php | 34 +
.../src/PhpSpreadsheet/RichText/RichText.php | 164 +
.../src/PhpSpreadsheet/RichText/Run.php | 73 +
.../PhpSpreadsheet/RichText/TextElement.php | 69 +
.../src/PhpSpreadsheet/Settings.php | 191 +
.../src/PhpSpreadsheet/Shared/CodePage.php | 113 +
.../src/PhpSpreadsheet/Shared/Date.php | 548 ++
.../src/PhpSpreadsheet/Shared/Drawing.php | 152 +
.../src/PhpSpreadsheet/Shared/Escher.php | 52 +
.../Shared/Escher/DgContainer.php | 60 +
.../Escher/DgContainer/SpgrContainer.php | 69 +
.../DgContainer/SpgrContainer/SpContainer.php | 300 +
.../Shared/Escher/DggContainer.php | 142 +
.../Escher/DggContainer/BstoreContainer.php | 32 +
.../DggContainer/BstoreContainer/BSE.php | 83 +
.../DggContainer/BstoreContainer/BSE/Blip.php | 50 +
.../src/PhpSpreadsheet/Shared/File.php | 195 +
.../src/PhpSpreadsheet/Shared/Font.php | 718 ++
.../src/PhpSpreadsheet/Shared/IntOrFloat.php | 17 +
.../src/PhpSpreadsheet/Shared/OLE.php | 552 ++
.../Shared/OLE/ChainedBlockStream.php | 187 +
.../src/PhpSpreadsheet/Shared/OLE/PPS.php | 207 +
.../PhpSpreadsheet/Shared/OLE/PPS/File.php | 62 +
.../PhpSpreadsheet/Shared/OLE/PPS/Root.php | 406 +
.../src/PhpSpreadsheet/Shared/OLERead.php | 307 +
.../PhpSpreadsheet/Shared/PasswordHasher.php | 106 +
.../PhpSpreadsheet/Shared/StringHelper.php | 650 ++
.../src/PhpSpreadsheet/Shared/TimeZone.php | 75 +
.../PhpSpreadsheet/Shared/Trend/BestFit.php | 425 +
.../Shared/Trend/ExponentialBestFit.php | 108 +
.../Shared/Trend/LinearBestFit.php | 75 +
.../Shared/Trend/LogarithmicBestFit.php | 80 +
.../Shared/Trend/PolynomialBestFit.php | 203 +
.../Shared/Trend/PowerBestFit.php | 98 +
.../src/PhpSpreadsheet/Shared/Trend/Trend.php | 122 +
.../src/PhpSpreadsheet/Shared/XMLWriter.php | 96 +
.../src/PhpSpreadsheet/Shared/Xls.php | 273 +
.../src/PhpSpreadsheet/Spreadsheet.php | 1556 ++++
.../src/PhpSpreadsheet/Style/Alignment.php | 501 ++
.../src/PhpSpreadsheet/Style/Border.php | 221 +
.../src/PhpSpreadsheet/Style/Borders.php | 374 +
.../src/PhpSpreadsheet/Style/Color.php | 418 +
.../src/PhpSpreadsheet/Style/Conditional.php | 337 +
.../ConditionalFormatting/CellMatcher.php | 271 +
.../CellStyleAssessor.php | 38 +
.../ConditionalColorScale.php | 92 +
.../ConditionalDataBar.php | 76 +
.../ConditionalDataBarExtension.php | 235 +
.../ConditionalFormatValueObject.php | 55 +
.../ConditionalFormattingRuleExtension.php | 212 +
.../ConditionalFormatting/StyleMerger.php | 115 +
.../Style/ConditionalFormatting/Wizard.php | 66 +
.../ConditionalFormatting/Wizard/Blanks.php | 95 +
.../Wizard/CellValue.php | 183 +
.../Wizard/DateValue.php | 109 +
.../Wizard/Duplicates.php | 74 +
.../ConditionalFormatting/Wizard/Errors.php | 91 +
.../Wizard/Expression.php | 69 +
.../Wizard/TextValue.php | 158 +
.../Wizard/WizardAbstract.php | 179 +
.../Wizard/WizardInterface.php | 25 +
.../src/PhpSpreadsheet/Style/Fill.php | 317 +
.../src/PhpSpreadsheet/Style/Font.php | 835 ++
.../src/PhpSpreadsheet/Style/NumberFormat.php | 517 ++
.../Style/NumberFormat/BaseFormatter.php | 25 +
.../Style/NumberFormat/DateFormatter.php | 211 +
.../Style/NumberFormat/Formatter.php | 189 +
.../Style/NumberFormat/FractionFormatter.php | 70 +
.../Style/NumberFormat/NumberFormatter.php | 315 +
.../NumberFormat/PercentageFormatter.php | 48 +
.../Style/NumberFormat/Wizard/Accounting.php | 102 +
.../Style/NumberFormat/Wizard/Currency.php | 125 +
.../Style/NumberFormat/Wizard/Date.php | 125 +
.../Style/NumberFormat/Wizard/DateTime.php | 47 +
.../NumberFormat/Wizard/DateTimeWizard.php | 46 +
.../Style/NumberFormat/Wizard/Duration.php | 153 +
.../Style/NumberFormat/Wizard/Locale.php | 39 +
.../Style/NumberFormat/Wizard/Number.php | 57 +
.../Style/NumberFormat/Wizard/NumberBase.php | 81 +
.../Style/NumberFormat/Wizard/Percentage.php | 40 +
.../Style/NumberFormat/Wizard/Scientific.php | 33 +
.../Style/NumberFormat/Wizard/Time.php | 105 +
.../Style/NumberFormat/Wizard/Wizard.php | 8 +
.../src/PhpSpreadsheet/Style/Protection.php | 184 +
.../src/PhpSpreadsheet/Style/RgbTint.php | 172 +
.../src/PhpSpreadsheet/Style/Style.php | 705 ++
.../src/PhpSpreadsheet/Style/Supervisor.php | 156 +
.../src/PhpSpreadsheet/Theme.php | 259 +
.../PhpSpreadsheet/Worksheet/AutoFilter.php | 1084 +++
.../Worksheet/AutoFilter/Column.php | 380 +
.../Worksheet/AutoFilter/Column/Rule.php | 406 +
.../src/PhpSpreadsheet/Worksheet/AutoFit.php | 51 +
.../PhpSpreadsheet/Worksheet/BaseDrawing.php | 549 ++
.../PhpSpreadsheet/Worksheet/CellIterator.php | 85 +
.../src/PhpSpreadsheet/Worksheet/Column.php | 110 +
.../Worksheet/ColumnCellIterator.php | 198 +
.../Worksheet/ColumnDimension.php | 131 +
.../Worksheet/ColumnIterator.php | 165 +
.../PhpSpreadsheet/Worksheet/Dimension.php | 124 +
.../src/PhpSpreadsheet/Worksheet/Drawing.php | 202 +
.../Worksheet/Drawing/Shadow.php | 247 +
.../PhpSpreadsheet/Worksheet/HeaderFooter.php | 426 +
.../Worksheet/HeaderFooterDrawing.php | 24 +
.../src/PhpSpreadsheet/Worksheet/Iterator.php | 70 +
.../Worksheet/MemoryDrawing.php | 335 +
.../PhpSpreadsheet/Worksheet/PageBreak.php | 57 +
.../PhpSpreadsheet/Worksheet/PageMargins.php | 193 +
.../PhpSpreadsheet/Worksheet/PageSetup.php | 824 ++
.../src/PhpSpreadsheet/Worksheet/Pane.php | 48 +
.../Worksheet/ProtectedRange.php | 45 +
.../PhpSpreadsheet/Worksheet/Protection.php | 474 ++
.../src/PhpSpreadsheet/Worksheet/Row.php | 110 +
.../Worksheet/RowCellIterator.php | 188 +
.../PhpSpreadsheet/Worksheet/RowDimension.php | 110 +
.../PhpSpreadsheet/Worksheet/RowIterator.php | 155 +
.../PhpSpreadsheet/Worksheet/SheetView.php | 199 +
.../src/PhpSpreadsheet/Worksheet/Table.php | 578 ++
.../PhpSpreadsheet/Worksheet/Table/Column.php | 240 +
.../Worksheet/Table/TableStyle.php | 218 +
.../PhpSpreadsheet/Worksheet/Validations.php | 118 +
.../PhpSpreadsheet/Worksheet/Worksheet.php | 3666 ++++++++
.../src/PhpSpreadsheet/Writer/BaseWriter.php | 137 +
.../src/PhpSpreadsheet/Writer/Csv.php | 306 +
.../src/PhpSpreadsheet/Writer/Exception.php | 9 +
.../src/PhpSpreadsheet/Writer/Html.php | 1838 ++++
.../src/PhpSpreadsheet/Writer/IWriter.php | 87 +
.../src/PhpSpreadsheet/Writer/Ods.php | 159 +
.../PhpSpreadsheet/Writer/Ods/AutoFilters.php | 57 +
.../Writer/Ods/Cell/Comment.php | 30 +
.../PhpSpreadsheet/Writer/Ods/Cell/Style.php | 320 +
.../src/PhpSpreadsheet/Writer/Ods/Content.php | 356 +
.../src/PhpSpreadsheet/Writer/Ods/Formula.php | 119 +
.../src/PhpSpreadsheet/Writer/Ods/Meta.php | 122 +
.../src/PhpSpreadsheet/Writer/Ods/MetaInf.php | 60 +
.../PhpSpreadsheet/Writer/Ods/Mimetype.php | 16 +
.../Writer/Ods/NamedExpressions.php | 137 +
.../PhpSpreadsheet/Writer/Ods/Settings.php | 152 +
.../src/PhpSpreadsheet/Writer/Ods/Styles.php | 65 +
.../PhpSpreadsheet/Writer/Ods/Thumbnails.php | 16 +
.../PhpSpreadsheet/Writer/Ods/WriterPart.php | 31 +
.../src/PhpSpreadsheet/Writer/Pdf.php | 227 +
.../src/PhpSpreadsheet/Writer/Pdf/Dompdf.php | 58 +
.../src/PhpSpreadsheet/Writer/Pdf/Mpdf.php | 101 +
.../src/PhpSpreadsheet/Writer/Pdf/Tcpdf.php | 84 +
.../src/PhpSpreadsheet/Writer/Xls.php | 892 ++
.../PhpSpreadsheet/Writer/Xls/BIFFwriter.php | 212 +
.../Writer/Xls/CellDataValidation.php | 78 +
.../Writer/Xls/ConditionalHelper.php | 59 +
.../PhpSpreadsheet/Writer/Xls/ErrorCode.php | 28 +
.../src/PhpSpreadsheet/Writer/Xls/Escher.php | 497 ++
.../src/PhpSpreadsheet/Writer/Xls/Font.php | 133 +
.../src/PhpSpreadsheet/Writer/Xls/Parser.php | 1506 ++++
.../Writer/Xls/Style/CellAlignment.php | 59 +
.../Writer/Xls/Style/CellBorder.php | 40 +
.../Writer/Xls/Style/CellFill.php | 46 +
.../Writer/Xls/Style/ColorMap.php | 90 +
.../PhpSpreadsheet/Writer/Xls/Workbook.php | 1135 +++
.../PhpSpreadsheet/Writer/Xls/Worksheet.php | 3145 +++++++
.../src/PhpSpreadsheet/Writer/Xls/Xf.php | 374 +
.../src/PhpSpreadsheet/Writer/Xlsx.php | 714 ++
.../PhpSpreadsheet/Writer/Xlsx/AutoFilter.php | 125 +
.../src/PhpSpreadsheet/Writer/Xlsx/Chart.php | 1935 +++++
.../PhpSpreadsheet/Writer/Xlsx/Comments.php | 251 +
.../Writer/Xlsx/ContentTypes.php | 275 +
.../Writer/Xlsx/DefinedNames.php | 242 +
.../PhpSpreadsheet/Writer/Xlsx/DocProps.php | 250 +
.../PhpSpreadsheet/Writer/Xlsx/Drawing.php | 583 ++
.../Writer/Xlsx/FunctionPrefix.php | 193 +
.../src/PhpSpreadsheet/Writer/Xlsx/Rels.php | 511 ++
.../PhpSpreadsheet/Writer/Xlsx/RelsRibbon.php | 46 +
.../PhpSpreadsheet/Writer/Xlsx/RelsVBA.php | 40 +
.../Writer/Xlsx/StringTable.php | 344 +
.../src/PhpSpreadsheet/Writer/Xlsx/Style.php | 726 ++
.../src/PhpSpreadsheet/Writer/Xlsx/Table.php | 115 +
.../src/PhpSpreadsheet/Writer/Xlsx/Theme.php | 744 ++
.../PhpSpreadsheet/Writer/Xlsx/Workbook.php | 214 +
.../PhpSpreadsheet/Writer/Xlsx/Worksheet.php | 1599 ++++
.../PhpSpreadsheet/Writer/Xlsx/WriterPart.php | 29 +
.../src/PhpSpreadsheet/Writer/ZipStream0.php | 17 +
.../src/PhpSpreadsheet/Writer/ZipStream2.php | 21 +
.../src/PhpSpreadsheet/Writer/ZipStream3.php | 22 +
public/vendor/psr/http-client/CHANGELOG.md | 31 +
public/vendor/psr/http-client/LICENSE | 19 +
public/vendor/psr/http-client/README.md | 12 +
public/vendor/psr/http-client/composer.json | 30 +
.../src/ClientExceptionInterface.php | 10 +
.../psr/http-client/src/ClientInterface.php | 20 +
.../src/NetworkExceptionInterface.php | 24 +
.../src/RequestExceptionInterface.php | 24 +
public/vendor/psr/http-factory/LICENSE | 21 +
public/vendor/psr/http-factory/README.md | 12 +
public/vendor/psr/http-factory/composer.json | 38 +
.../src/RequestFactoryInterface.php | 18 +
.../src/ResponseFactoryInterface.php | 18 +
.../src/ServerRequestFactoryInterface.php | 24 +
.../src/StreamFactoryInterface.php | 45 +
.../src/UploadedFileFactoryInterface.php | 34 +
.../http-factory/src/UriFactoryInterface.php | 17 +
public/vendor/psr/http-message/CHANGELOG.md | 36 +
public/vendor/psr/http-message/LICENSE | 19 +
public/vendor/psr/http-message/README.md | 16 +
public/vendor/psr/http-message/composer.json | 26 +
.../psr/http-message/docs/PSR7-Interfaces.md | 130 +
.../psr/http-message/docs/PSR7-Usage.md | 159 +
.../psr/http-message/src/MessageInterface.php | 187 +
.../psr/http-message/src/RequestInterface.php | 130 +
.../http-message/src/ResponseInterface.php | 68 +
.../src/ServerRequestInterface.php | 261 +
.../psr/http-message/src/StreamInterface.php | 158 +
.../src/UploadedFileInterface.php | 123 +
.../psr/http-message/src/UriInterface.php | 324 +
public/vendor/psr/simple-cache/.editorconfig | 12 +
public/vendor/psr/simple-cache/LICENSE.md | 21 +
public/vendor/psr/simple-cache/README.md | 8 +
public/vendor/psr/simple-cache/composer.json | 25 +
.../psr/simple-cache/src/CacheException.php | 10 +
.../psr/simple-cache/src/CacheInterface.php | 114 +
.../src/InvalidArgumentException.php | 13 +
700 files changed, 146363 insertions(+), 3 deletions(-)
create mode 100644 public/userarea/products/products.php
create mode 100644 public/userarea/reports/reports-dashboard.php
create mode 100644 public/userarea/reports/reports.php
create mode 100644 public/userarea/statkpi/statkpi.php
create mode 100644 public/vendor/autoload.php
create mode 100644 public/vendor/composer/ClassLoader.php
create mode 100644 public/vendor/composer/InstalledVersions.php
create mode 100644 public/vendor/composer/LICENSE
create mode 100644 public/vendor/composer/autoload_classmap.php
create mode 100644 public/vendor/composer/autoload_namespaces.php
create mode 100644 public/vendor/composer/autoload_psr4.php
create mode 100644 public/vendor/composer/autoload_real.php
create mode 100644 public/vendor/composer/autoload_static.php
create mode 100644 public/vendor/composer/installed.json
create mode 100644 public/vendor/composer/installed.php
create mode 100644 public/vendor/composer/platform_check.php
create mode 100644 public/vendor/maennchen/zipstream-php/.editorconfig
create mode 100644 public/vendor/maennchen/zipstream-php/.phive/phars.xml
create mode 100644 public/vendor/maennchen/zipstream-php/.php-cs-fixer.dist.php
create mode 100644 public/vendor/maennchen/zipstream-php/.phpdoc/template/base.html.twig
create mode 100644 public/vendor/maennchen/zipstream-php/.tool-versions
create mode 100644 public/vendor/maennchen/zipstream-php/LICENSE
create mode 100644 public/vendor/maennchen/zipstream-php/README.md
create mode 100644 public/vendor/maennchen/zipstream-php/composer.json
create mode 100644 public/vendor/maennchen/zipstream-php/guides/ContentLength.rst
create mode 100644 public/vendor/maennchen/zipstream-php/guides/FlySystem.rst
create mode 100644 public/vendor/maennchen/zipstream-php/guides/Nginx.rst
create mode 100644 public/vendor/maennchen/zipstream-php/guides/Options.rst
create mode 100644 public/vendor/maennchen/zipstream-php/guides/PSR7Streams.rst
create mode 100644 public/vendor/maennchen/zipstream-php/guides/StreamOutput.rst
create mode 100644 public/vendor/maennchen/zipstream-php/guides/Symfony.rst
create mode 100644 public/vendor/maennchen/zipstream-php/guides/Varnish.rst
create mode 100644 public/vendor/maennchen/zipstream-php/guides/index.rst
create mode 100644 public/vendor/maennchen/zipstream-php/phpdoc.dist.xml
create mode 100644 public/vendor/maennchen/zipstream-php/phpunit.xml.dist
create mode 100644 public/vendor/maennchen/zipstream-php/psalm.xml
create mode 100644 public/vendor/maennchen/zipstream-php/src/CentralDirectoryFileHeader.php
create mode 100644 public/vendor/maennchen/zipstream-php/src/CompressionMethod.php
create mode 100644 public/vendor/maennchen/zipstream-php/src/DataDescriptor.php
create mode 100644 public/vendor/maennchen/zipstream-php/src/EndOfCentralDirectory.php
create mode 100644 public/vendor/maennchen/zipstream-php/src/Exception.php
create mode 100644 public/vendor/maennchen/zipstream-php/src/Exception/DosTimeOverflowException.php
create mode 100644 public/vendor/maennchen/zipstream-php/src/Exception/FileNotFoundException.php
create mode 100644 public/vendor/maennchen/zipstream-php/src/Exception/FileNotReadableException.php
create mode 100644 public/vendor/maennchen/zipstream-php/src/Exception/FileSizeIncorrectException.php
create mode 100644 public/vendor/maennchen/zipstream-php/src/Exception/OverflowException.php
create mode 100644 public/vendor/maennchen/zipstream-php/src/Exception/ResourceActionException.php
create mode 100644 public/vendor/maennchen/zipstream-php/src/Exception/SimulationFileUnknownException.php
create mode 100644 public/vendor/maennchen/zipstream-php/src/Exception/StreamNotReadableException.php
create mode 100644 public/vendor/maennchen/zipstream-php/src/Exception/StreamNotSeekableException.php
create mode 100644 public/vendor/maennchen/zipstream-php/src/File.php
create mode 100644 public/vendor/maennchen/zipstream-php/src/GeneralPurposeBitFlag.php
create mode 100644 public/vendor/maennchen/zipstream-php/src/LocalFileHeader.php
create mode 100644 public/vendor/maennchen/zipstream-php/src/OperationMode.php
create mode 100644 public/vendor/maennchen/zipstream-php/src/PackField.php
create mode 100644 public/vendor/maennchen/zipstream-php/src/Time.php
create mode 100644 public/vendor/maennchen/zipstream-php/src/Version.php
create mode 100644 public/vendor/maennchen/zipstream-php/src/Zip64/DataDescriptor.php
create mode 100644 public/vendor/maennchen/zipstream-php/src/Zip64/EndOfCentralDirectory.php
create mode 100644 public/vendor/maennchen/zipstream-php/src/Zip64/EndOfCentralDirectoryLocator.php
create mode 100644 public/vendor/maennchen/zipstream-php/src/Zip64/ExtendedInformationExtraField.php
create mode 100644 public/vendor/maennchen/zipstream-php/src/ZipStream.php
create mode 100644 public/vendor/maennchen/zipstream-php/src/Zs/ExtendedInformationExtraField.php
create mode 100644 public/vendor/maennchen/zipstream-php/test/Assertions.php
create mode 100644 public/vendor/maennchen/zipstream-php/test/CentralDirectoryFileHeaderTest.php
create mode 100644 public/vendor/maennchen/zipstream-php/test/DataDescriptorTest.php
create mode 100644 public/vendor/maennchen/zipstream-php/test/EndOfCentralDirectoryTest.php
create mode 100644 public/vendor/maennchen/zipstream-php/test/EndlessCycleStream.php
create mode 100644 public/vendor/maennchen/zipstream-php/test/FaultInjectionResource.php
create mode 100644 public/vendor/maennchen/zipstream-php/test/LocalFileHeaderTest.php
create mode 100644 public/vendor/maennchen/zipstream-php/test/PackFieldTest.php
create mode 100644 public/vendor/maennchen/zipstream-php/test/ResourceStream.php
create mode 100644 public/vendor/maennchen/zipstream-php/test/TimeTest.php
create mode 100644 public/vendor/maennchen/zipstream-php/test/Util.php
create mode 100644 public/vendor/maennchen/zipstream-php/test/Zip64/DataDescriptorTest.php
create mode 100644 public/vendor/maennchen/zipstream-php/test/Zip64/EndOfCentralDirectoryLocatorTest.php
create mode 100644 public/vendor/maennchen/zipstream-php/test/Zip64/EndOfCentralDirectoryTest.php
create mode 100644 public/vendor/maennchen/zipstream-php/test/Zip64/ExtendedInformationExtraFieldTest.php
create mode 100644 public/vendor/maennchen/zipstream-php/test/ZipStreamTest.php
create mode 100644 public/vendor/maennchen/zipstream-php/test/Zs/ExtendedInformationExtraFieldTest.php
create mode 100644 public/vendor/maennchen/zipstream-php/test/bootstrap.php
create mode 100644 public/vendor/markbaker/complex/.github/workflows/main.yml
create mode 100644 public/vendor/markbaker/complex/README.md
create mode 100644 public/vendor/markbaker/complex/classes/src/Complex.php
create mode 100644 public/vendor/markbaker/complex/classes/src/Exception.php
create mode 100644 public/vendor/markbaker/complex/classes/src/Functions.php
create mode 100644 public/vendor/markbaker/complex/classes/src/Operations.php
create mode 100644 public/vendor/markbaker/complex/composer.json
create mode 100644 public/vendor/markbaker/complex/examples/complexTest.php
create mode 100644 public/vendor/markbaker/complex/examples/testFunctions.php
create mode 100644 public/vendor/markbaker/complex/examples/testOperations.php
create mode 100644 public/vendor/markbaker/complex/license.md
create mode 100644 public/vendor/markbaker/matrix/.github/workflows/main.yaml
create mode 100644 public/vendor/markbaker/matrix/README.md
create mode 100644 public/vendor/markbaker/matrix/buildPhar.php
create mode 100644 public/vendor/markbaker/matrix/classes/src/Builder.php
create mode 100644 public/vendor/markbaker/matrix/classes/src/Decomposition/Decomposition.php
create mode 100644 public/vendor/markbaker/matrix/classes/src/Decomposition/LU.php
create mode 100644 public/vendor/markbaker/matrix/classes/src/Decomposition/QR.php
create mode 100644 public/vendor/markbaker/matrix/classes/src/Div0Exception.php
create mode 100644 public/vendor/markbaker/matrix/classes/src/Exception.php
create mode 100644 public/vendor/markbaker/matrix/classes/src/Functions.php
create mode 100644 public/vendor/markbaker/matrix/classes/src/Matrix.php
create mode 100644 public/vendor/markbaker/matrix/classes/src/Operations.php
create mode 100644 public/vendor/markbaker/matrix/classes/src/Operators/Addition.php
create mode 100644 public/vendor/markbaker/matrix/classes/src/Operators/DirectSum.php
create mode 100644 public/vendor/markbaker/matrix/classes/src/Operators/Division.php
create mode 100644 public/vendor/markbaker/matrix/classes/src/Operators/Multiplication.php
create mode 100644 public/vendor/markbaker/matrix/classes/src/Operators/Operator.php
create mode 100644 public/vendor/markbaker/matrix/classes/src/Operators/Subtraction.php
create mode 100644 public/vendor/markbaker/matrix/composer.json
create mode 100644 public/vendor/markbaker/matrix/examples/test.php
create mode 100644 public/vendor/markbaker/matrix/infection.json.dist
create mode 100644 public/vendor/markbaker/matrix/license.md
create mode 100644 public/vendor/markbaker/matrix/phpstan.neon
create mode 100644 public/vendor/phpoffice/phpspreadsheet/.php-cs-fixer.dist.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/.phpcs.xml.dist
create mode 100644 public/vendor/phpoffice/phpspreadsheet/.readthedocs.yaml
create mode 100644 public/vendor/phpoffice/phpspreadsheet/CHANGELOG.md
create mode 100644 public/vendor/phpoffice/phpspreadsheet/CONTRIBUTING.md
create mode 100644 public/vendor/phpoffice/phpspreadsheet/LICENSE
create mode 100644 public/vendor/phpoffice/phpspreadsheet/README.md
create mode 100644 public/vendor/phpoffice/phpspreadsheet/composer.json
create mode 100644 public/vendor/phpoffice/phpspreadsheet/phpstan-baseline.neon
create mode 100644 public/vendor/phpoffice/phpspreadsheet/phpstan.neon.dist
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/ArrayEnabled.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/BinaryComparison.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Calculation.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Category.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Database/DAverage.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Database/DCount.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Database/DCountA.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Database/DGet.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Database/DMax.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Database/DMin.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Database/DProduct.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Database/DStDev.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Database/DStDevP.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Database/DSum.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Database/DVar.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Database/DVarP.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Database/DatabaseAbstract.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/Constants.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/Current.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/Date.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/DateParts.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/DateValue.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/Days.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/Days360.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/Difference.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/Helpers.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/Month.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/NetworkDays.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/Time.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/TimeParts.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/TimeValue.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/Week.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/WorkDay.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/YearFrac.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engine/ArrayArgumentHelper.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engine/ArrayArgumentProcessor.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engine/BranchPruner.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engine/CyclicReferenceStack.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engine/FormattedNumber.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engine/Logger.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engine/Operands/Operand.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engine/Operands/StructuredReference.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/BesselI.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/BesselJ.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/BesselK.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/BesselY.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/BitWise.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/Compare.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/Complex.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/ComplexFunctions.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/ComplexOperations.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/Constants.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/ConvertBase.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/ConvertBinary.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/ConvertDecimal.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/ConvertHex.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/ConvertOctal.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/ConvertUOM.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/EngineeringValidations.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/Erf.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/ErfC.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Exception.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/ExceptionHandler.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/Amortization.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/CashFlow/CashFlowValidations.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/CashFlow/Constant/Periodic.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/CashFlow/Constant/Periodic/Cumulative.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/CashFlow/Constant/Periodic/Interest.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/CashFlow/Constant/Periodic/InterestAndPrincipal.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/CashFlow/Constant/Periodic/Payments.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/CashFlow/Single.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/CashFlow/Variable/NonPeriodic.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/CashFlow/Variable/Periodic.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/Constants.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/Coupons.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/Depreciation.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/Dollar.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/FinancialValidations.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/Helpers.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/InterestRate.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/Securities/AccruedInterest.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/Securities/Price.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/Securities/Rates.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/Securities/SecurityValidations.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/Securities/Yields.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/TreasuryBill.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/FormulaParser.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/FormulaToken.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Functions.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Information/ErrorValue.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Information/ExcelError.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Information/Value.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Internal/MakeMatrix.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Internal/WildcardMatch.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Logical/Boolean.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Logical/Conditional.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Logical/Operations.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/Address.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/ExcelMatch.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/Filter.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/Formula.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/HLookup.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/Helpers.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/Hyperlink.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/Indirect.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/Lookup.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/LookupBase.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/LookupRefValidations.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/Matrix.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/Offset.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/RowColumnInformation.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/Selection.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/Sort.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/Unique.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/VLookup.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Absolute.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Angle.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Arabic.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Base.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Ceiling.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Combinations.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Exp.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Factorial.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Floor.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Gcd.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Helpers.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/IntClass.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Lcm.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Logarithms.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/MatrixFunctions.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Operations.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Random.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Roman.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Round.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/SeriesSum.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Sign.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Sqrt.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Subtotal.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Sum.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/SumSquares.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Trig/Cosecant.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Trig/Cosine.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Trig/Cotangent.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Trig/Secant.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Trig/Sine.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Trig/Tangent.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Trunc.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/AggregateBase.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Averages.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Averages/Mean.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Conditional.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Confidence.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Counts.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Deviations.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Distributions/Beta.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Distributions/Binomial.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Distributions/ChiSquared.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Distributions/DistributionValidations.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Distributions/Exponential.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Distributions/F.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Distributions/Fisher.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Distributions/Gamma.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Distributions/GammaBase.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Distributions/HyperGeometric.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Distributions/LogNormal.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Distributions/NewtonRaphson.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Distributions/Normal.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Distributions/Poisson.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Distributions/StandardNormal.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Distributions/StudentT.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Distributions/Weibull.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/MaxMinBase.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Maximum.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Minimum.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Percentiles.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Permutations.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Size.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/StandardDeviations.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Standardize.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/StatisticalValidations.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Trends.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/VarianceBase.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Variances.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/TextData/CaseConvert.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/TextData/CharacterConvert.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/TextData/Concatenate.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/TextData/Extract.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/TextData/Format.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/TextData/Helpers.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/TextData/Replace.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/TextData/Search.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/TextData/Text.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/TextData/Trim.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Token/Stack.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Web/Service.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/Translations.xlsx
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/bg/config
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/bg/functions
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/cs/config
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/cs/functions
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/da/config
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/da/functions
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/de/config
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/de/functions
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/en/uk/config
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/es/config
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/es/functions
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/fi/config
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/fi/functions
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/fr/config
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/fr/functions
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/hu/config
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/hu/functions
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/it/config
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/it/functions
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/nb/config
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/nb/functions
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/nl/config
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/nl/functions
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/pl/config
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/pl/functions
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/pt/br/config
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/pt/br/functions
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/pt/config
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/pt/functions
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/ru/config
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/ru/functions
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/sv/config
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/sv/functions
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/tr/config
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/tr/functions
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Cell/AddressHelper.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Cell/AddressRange.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Cell/AdvancedValueBinder.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Cell/Cell.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Cell/CellAddress.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Cell/CellRange.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Cell/ColumnRange.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Cell/Coordinate.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Cell/DataType.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Cell/DataValidation.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Cell/DataValidator.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Cell/DefaultValueBinder.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Cell/Hyperlink.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Cell/IValueBinder.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Cell/IgnoredErrors.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Cell/RowRange.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Cell/StringValueBinder.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/CellReferenceHelper.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/Axis.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/AxisText.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/Chart.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/ChartColor.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/DataSeries.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/DataSeriesValues.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/Exception.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/GridLines.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/Layout.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/Legend.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/PlotArea.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/Properties.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/Renderer/IRenderer.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/Renderer/JpGraph.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/Renderer/JpGraphRendererBase.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/Renderer/MtJpGraphRenderer.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/Renderer/PHP Charting Libraries.txt
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/Title.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/TrendLine.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Collection/Cells.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Collection/CellsFactory.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Collection/Memory/SimpleCache1.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Collection/Memory/SimpleCache3.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Comment.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/DefinedName.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Document/Properties.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Document/Security.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Exception.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/HashTable.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Helper/Dimension.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Helper/Downloader.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Helper/Handler.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Helper/Html.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Helper/Sample.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Helper/Size.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Helper/TextGrid.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/IComparable.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/IOFactory.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/NamedFormula.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/NamedRange.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/BaseReader.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Csv.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Csv/Delimiter.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/DefaultReadFilter.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Exception.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Gnumeric.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Gnumeric/PageSetup.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Gnumeric/Properties.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Gnumeric/Styles.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Html.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/IReadFilter.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/IReader.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Ods.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Ods/AutoFilter.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Ods/BaseLoader.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Ods/DefinedNames.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Ods/FormulaTranslator.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Ods/PageSettings.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Ods/Properties.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Security/XmlScanner.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Slk.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xls.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xls/Color.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xls/Color/BIFF5.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xls/Color/BIFF8.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xls/Color/BuiltIn.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xls/ConditionalFormatting.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xls/DataValidationHelper.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xls/ErrorCode.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xls/Escher.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xls/MD5.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xls/RC4.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xls/Style/Border.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xls/Style/CellAlignment.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xls/Style/CellFont.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xls/Style/FillPattern.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx/AutoFilter.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx/BaseParserClass.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx/Chart.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx/ColumnAndRowAttributes.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx/ConditionalStyles.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx/DataValidations.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx/Hyperlinks.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx/Namespaces.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx/PageSetup.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx/Properties.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx/SharedFormula.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx/SheetViewOptions.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx/SheetViews.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx/Styles.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx/TableReader.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx/Theme.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx/WorkbookView.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xml.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xml/DataValidations.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xml/PageSettings.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xml/Properties.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xml/Style.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xml/Style/Alignment.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xml/Style/Border.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xml/Style/Fill.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xml/Style/Font.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xml/Style/NumberFormat.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xml/Style/StyleBase.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/ReferenceHelper.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/RichText/ITextElement.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/RichText/RichText.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/RichText/Run.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/RichText/TextElement.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Settings.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/CodePage.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Date.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Drawing.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Escher.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Escher/DgContainer.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Escher/DgContainer/SpgrContainer.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Escher/DgContainer/SpgrContainer/SpContainer.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Escher/DggContainer.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Escher/DggContainer/BstoreContainer.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Escher/DggContainer/BstoreContainer/BSE.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Escher/DggContainer/BstoreContainer/BSE/Blip.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/File.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Font.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/IntOrFloat.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/OLE.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/OLE/ChainedBlockStream.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/OLE/PPS.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/OLE/PPS/File.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/OLE/PPS/Root.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/OLERead.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/PasswordHasher.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/StringHelper.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/TimeZone.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Trend/BestFit.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Trend/ExponentialBestFit.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Trend/LinearBestFit.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Trend/LogarithmicBestFit.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Trend/PolynomialBestFit.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Trend/PowerBestFit.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Trend/Trend.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/XMLWriter.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Xls.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Spreadsheet.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/Alignment.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/Border.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/Borders.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/Color.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/Conditional.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/ConditionalFormatting/CellMatcher.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/ConditionalFormatting/CellStyleAssessor.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/ConditionalFormatting/ConditionalColorScale.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/ConditionalFormatting/ConditionalDataBar.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/ConditionalFormatting/ConditionalDataBarExtension.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/ConditionalFormatting/ConditionalFormatValueObject.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/ConditionalFormatting/ConditionalFormattingRuleExtension.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/ConditionalFormatting/StyleMerger.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/ConditionalFormatting/Wizard.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/ConditionalFormatting/Wizard/Blanks.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/ConditionalFormatting/Wizard/CellValue.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/ConditionalFormatting/Wizard/DateValue.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/ConditionalFormatting/Wizard/Duplicates.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/ConditionalFormatting/Wizard/Errors.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/ConditionalFormatting/Wizard/Expression.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/ConditionalFormatting/Wizard/TextValue.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/ConditionalFormatting/Wizard/WizardAbstract.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/ConditionalFormatting/Wizard/WizardInterface.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/Fill.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/Font.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/NumberFormat.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/NumberFormat/BaseFormatter.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/NumberFormat/DateFormatter.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/NumberFormat/Formatter.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/NumberFormat/FractionFormatter.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/NumberFormat/NumberFormatter.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/NumberFormat/PercentageFormatter.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/NumberFormat/Wizard/Accounting.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/NumberFormat/Wizard/Currency.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/NumberFormat/Wizard/Date.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/NumberFormat/Wizard/DateTime.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/NumberFormat/Wizard/DateTimeWizard.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/NumberFormat/Wizard/Duration.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/NumberFormat/Wizard/Locale.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/NumberFormat/Wizard/Number.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/NumberFormat/Wizard/NumberBase.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/NumberFormat/Wizard/Percentage.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/NumberFormat/Wizard/Scientific.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/NumberFormat/Wizard/Time.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/NumberFormat/Wizard/Wizard.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/Protection.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/RgbTint.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/Style.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/Supervisor.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Theme.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/AutoFilter.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/AutoFilter/Column.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/AutoFilter/Column/Rule.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/AutoFit.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/BaseDrawing.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/CellIterator.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/Column.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/ColumnCellIterator.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/ColumnDimension.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/ColumnIterator.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/Dimension.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/Drawing.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/Drawing/Shadow.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/HeaderFooter.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/HeaderFooterDrawing.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/Iterator.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/MemoryDrawing.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/PageBreak.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/PageMargins.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/PageSetup.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/Pane.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/ProtectedRange.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/Protection.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/Row.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/RowCellIterator.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/RowDimension.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/RowIterator.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/SheetView.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/Table.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/Table/Column.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/Table/TableStyle.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/Validations.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/Worksheet.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/BaseWriter.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Csv.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Exception.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Html.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/IWriter.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Ods.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Ods/AutoFilters.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Ods/Cell/Comment.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Ods/Cell/Style.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Ods/Content.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Ods/Formula.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Ods/Meta.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Ods/MetaInf.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Ods/Mimetype.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Ods/NamedExpressions.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Ods/Settings.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Ods/Styles.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Ods/Thumbnails.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Ods/WriterPart.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Pdf.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Pdf/Dompdf.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Pdf/Mpdf.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Pdf/Tcpdf.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xls.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xls/BIFFwriter.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xls/CellDataValidation.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xls/ConditionalHelper.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xls/ErrorCode.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xls/Escher.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xls/Font.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xls/Parser.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xls/Style/CellAlignment.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xls/Style/CellBorder.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xls/Style/CellFill.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xls/Style/ColorMap.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xls/Workbook.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xls/Worksheet.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xls/Xf.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx/AutoFilter.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx/Chart.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx/Comments.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx/ContentTypes.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx/DefinedNames.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx/DocProps.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx/Drawing.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx/FunctionPrefix.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx/Rels.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx/RelsRibbon.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx/RelsVBA.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx/StringTable.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx/Style.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx/Table.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx/Theme.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx/Workbook.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx/Worksheet.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx/WriterPart.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/ZipStream0.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/ZipStream2.php
create mode 100644 public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/ZipStream3.php
create mode 100644 public/vendor/psr/http-client/CHANGELOG.md
create mode 100644 public/vendor/psr/http-client/LICENSE
create mode 100644 public/vendor/psr/http-client/README.md
create mode 100644 public/vendor/psr/http-client/composer.json
create mode 100644 public/vendor/psr/http-client/src/ClientExceptionInterface.php
create mode 100644 public/vendor/psr/http-client/src/ClientInterface.php
create mode 100644 public/vendor/psr/http-client/src/NetworkExceptionInterface.php
create mode 100644 public/vendor/psr/http-client/src/RequestExceptionInterface.php
create mode 100644 public/vendor/psr/http-factory/LICENSE
create mode 100644 public/vendor/psr/http-factory/README.md
create mode 100644 public/vendor/psr/http-factory/composer.json
create mode 100644 public/vendor/psr/http-factory/src/RequestFactoryInterface.php
create mode 100644 public/vendor/psr/http-factory/src/ResponseFactoryInterface.php
create mode 100644 public/vendor/psr/http-factory/src/ServerRequestFactoryInterface.php
create mode 100644 public/vendor/psr/http-factory/src/StreamFactoryInterface.php
create mode 100644 public/vendor/psr/http-factory/src/UploadedFileFactoryInterface.php
create mode 100644 public/vendor/psr/http-factory/src/UriFactoryInterface.php
create mode 100644 public/vendor/psr/http-message/CHANGELOG.md
create mode 100644 public/vendor/psr/http-message/LICENSE
create mode 100644 public/vendor/psr/http-message/README.md
create mode 100644 public/vendor/psr/http-message/composer.json
create mode 100644 public/vendor/psr/http-message/docs/PSR7-Interfaces.md
create mode 100644 public/vendor/psr/http-message/docs/PSR7-Usage.md
create mode 100644 public/vendor/psr/http-message/src/MessageInterface.php
create mode 100644 public/vendor/psr/http-message/src/RequestInterface.php
create mode 100644 public/vendor/psr/http-message/src/ResponseInterface.php
create mode 100644 public/vendor/psr/http-message/src/ServerRequestInterface.php
create mode 100644 public/vendor/psr/http-message/src/StreamInterface.php
create mode 100644 public/vendor/psr/http-message/src/UploadedFileInterface.php
create mode 100644 public/vendor/psr/http-message/src/UriInterface.php
create mode 100644 public/vendor/psr/simple-cache/.editorconfig
create mode 100644 public/vendor/psr/simple-cache/LICENSE.md
create mode 100644 public/vendor/psr/simple-cache/README.md
create mode 100644 public/vendor/psr/simple-cache/composer.json
create mode 100644 public/vendor/psr/simple-cache/src/CacheException.php
create mode 100644 public/vendor/psr/simple-cache/src/CacheInterface.php
create mode 100644 public/vendor/psr/simple-cache/src/InvalidArgumentException.php
diff --git a/public/userarea/importify/get_columnlist_from_csv.php b/public/userarea/importify/get_columnlist_from_csv.php
index f5b90d8..b2d19bc 100644
--- a/public/userarea/importify/get_columnlist_from_csv.php
+++ b/public/userarea/importify/get_columnlist_from_csv.php
@@ -2,12 +2,13 @@
require '../../vendor/autoload.php';
use PhpOffice\PhpSpreadsheet\IOFactory;
-if(isset($_FILES['f_csv'])) {
+
+if (isset($_FILES['f_csv'])) {
$file = $_FILES['f_csv']['tmp_name'];
$spreadsheet = IOFactory::load($file);
$worksheet = $spreadsheet->getActiveSheet();
$arr_info = $worksheet->toArray();
- if(count($arr_info) > 0) {
+ if (count($arr_info) > 0) {
die(json_encode($arr_info[0]));
} else {
die(json_encode(array()));
diff --git a/public/userarea/index.php b/public/userarea/index.php
index 482359a..24e5161 100644
--- a/public/userarea/index.php
+++ b/public/userarea/index.php
@@ -157,7 +157,7 @@
diff --git a/public/userarea/products/products.php b/public/userarea/products/products.php
new file mode 100644
index 0000000..32c341b
--- /dev/null
+++ b/public/userarea/products/products.php
@@ -0,0 +1,227 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Products
+
Dahboard
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Ref. Number
+ Description
+ Ref. Number
+ Description
+ Test Out
+ Rating
+ Action
+
+
+
+
+
+
+
+
+ setQuery("SELECT * FROM products");
+ $productslist->execute();
+
+ $wa_startindex = 0;
+ while (!$productslist->atEnd()) {
+ $wa_startindex = $productslist->Index;
+ ?>
+ getColumnVal("products_refnumber")); ?>
+ getColumnVal("products_description")); ?>
+ getColumnVal("products_refnumber")); ?>
+ getColumnVal("products_description")); ?>
+ getColumnVal("reportsDateOut")); ?>
+ getColumnVal("reportsRating")); ?>
+
+
+
+
+
+ " role="button" data-toggle="tooltip" title="Go">
+ " role="button" data-toggle="tooltip" title="Expand">
+
+
+
+
+ moveNext();
+ }
+ $productslist->moveFirst(); //return RS to first record
+ unset($wa_startindex);
+ unset($wa_repeatcount);
+
+ ?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/public/userarea/reports/reports-dashboard.php b/public/userarea/reports/reports-dashboard.php
new file mode 100644
index 0000000..b6625bb
--- /dev/null
+++ b/public/userarea/reports/reports-dashboard.php
@@ -0,0 +1,222 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Insert new template
+
Import File
+
Hystory Import
+
Dasboard
+
+
+
+
+
+
+
+
+ Template Name
+ Description
+ File Source
+ Lab Name
+ Action
+
+
+
+
+
+
+
+
+ setQuery("SELECT * FROM template_importify");
+ $templateimportify->execute();
+
+ $wa_startindex = 0;
+ while (!$templateimportify->atEnd()) {
+ $wa_startindex = $templateimportify->Index;
+ ?>
+ getColumnVal("templatename")); ?>
+ getColumnVal("templatedescription")); ?>
+ getColumnVal("fileextension")); ?>
+ getColumnVal("labname")); ?>
+
+
+
+
+
+ ">
+ " role="button" data-toggle="tooltip" title="Go">
+
+ " role="button" data-toggle="tooltip" title="Delete">
+
+
+
+
+ moveNext();
+ }
+ $templateimportify->moveFirst(); //return RS to first record
+ unset($wa_startindex);
+ unset($wa_repeatcount);
+
+ ?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/public/userarea/reports/reports.php b/public/userarea/reports/reports.php
new file mode 100644
index 0000000..06aa7f4
--- /dev/null
+++ b/public/userarea/reports/reports.php
@@ -0,0 +1,227 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Reports Dahboard
+
Dahboard
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Report N.
+ Lab
+ Ref. Number
+ Description
+ Test Out
+ Rating
+ Action
+
+
+
+
+
+
+
+
+ setQuery("SELECT * FROM reports LEFT JOIN products ON reports.idproducts=products.idproducts ORDER BY reports.reportsDateOut ");
+ $reportslist->execute();
+
+ $wa_startindex = 0;
+ while (!$reportslist->atEnd()) {
+ $wa_startindex = $reportslist->Index;
+ ?>
+ getColumnVal("reportsNumberLab")); ?>
+ getColumnVal("lab")); ?>
+ getColumnVal("products_refnumber")); ?>
+ getColumnVal("products_description")); ?>
+ getColumnVal("reportsDateOut")); ?>
+ getColumnVal("reportsRating")); ?>
+
+
+
+
+
+ " role="button" data-toggle="tooltip" title="Go">
+ " role="button" data-toggle="tooltip" title="Expand">
+
+
+
+
+ moveNext();
+ }
+ $reportslist->moveFirst(); //return RS to first record
+ unset($wa_startindex);
+ unset($wa_repeatcount);
+
+ ?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/public/userarea/statkpi/statkpi.php b/public/userarea/statkpi/statkpi.php
new file mode 100644
index 0000000..b9fffa9
--- /dev/null
+++ b/public/userarea/statkpi/statkpi.php
@@ -0,0 +1,227 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Products
+
Dahboard
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Ref. Number
+ Description
+ Ref. Number
+ Description
+ Test Out
+ Rating
+ Action
+
+
+
+
+
+
+
+
+ setQuery("SELECT * FROM products");
+ $productslist->execute();
+
+ $wa_startindex = 0;
+ while (!$productslist->atEnd()) {
+ $wa_startindex = $productslist->Index;
+ ?>
+ getColumnVal("products_refnumber")); ?>
+ getColumnVal("products_description")); ?>
+ getColumnVal("products_refnumber")); ?>
+ getColumnVal("products_description")); ?>
+ getColumnVal("reportsDateOut")); ?>
+ getColumnVal("reportsRating")); ?>
+
+
+
+
+
+ " role="button" data-toggle="tooltip" title="Go">
+ " role="button" data-toggle="tooltip" title="Expand">
+
+
+
+
+ moveNext();
+ }
+ $productslist->moveFirst(); //return RS to first record
+ unset($wa_startindex);
+ unset($wa_repeatcount);
+
+ ?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/public/vendor/autoload.php b/public/vendor/autoload.php
new file mode 100644
index 0000000..27f19bc
--- /dev/null
+++ b/public/vendor/autoload.php
@@ -0,0 +1,25 @@
+
+ * Jordi Boggiano
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Composer\Autoload;
+
+/**
+ * ClassLoader implements a PSR-0, PSR-4 and classmap class loader.
+ *
+ * $loader = new \Composer\Autoload\ClassLoader();
+ *
+ * // register classes with namespaces
+ * $loader->add('Symfony\Component', __DIR__.'/component');
+ * $loader->add('Symfony', __DIR__.'/framework');
+ *
+ * // activate the autoloader
+ * $loader->register();
+ *
+ * // to enable searching the include path (eg. for PEAR packages)
+ * $loader->setUseIncludePath(true);
+ *
+ * In this example, if you try to use a class in the Symfony\Component
+ * namespace or one of its children (Symfony\Component\Console for instance),
+ * the autoloader will first look for the class under the component/
+ * directory, and it will then fallback to the framework/ directory if not
+ * found before giving up.
+ *
+ * This class is loosely based on the Symfony UniversalClassLoader.
+ *
+ * @author Fabien Potencier
+ * @author Jordi Boggiano
+ * @see https://www.php-fig.org/psr/psr-0/
+ * @see https://www.php-fig.org/psr/psr-4/
+ */
+class ClassLoader
+{
+ /** @var \Closure(string):void */
+ private static $includeFile;
+
+ /** @var string|null */
+ private $vendorDir;
+
+ // PSR-4
+ /**
+ * @var array>
+ */
+ private $prefixLengthsPsr4 = array();
+ /**
+ * @var array>
+ */
+ private $prefixDirsPsr4 = array();
+ /**
+ * @var list
+ */
+ private $fallbackDirsPsr4 = array();
+
+ // PSR-0
+ /**
+ * List of PSR-0 prefixes
+ *
+ * Structured as array('F (first letter)' => array('Foo\Bar (full prefix)' => array('path', 'path2')))
+ *
+ * @var array>>
+ */
+ private $prefixesPsr0 = array();
+ /**
+ * @var list
+ */
+ private $fallbackDirsPsr0 = array();
+
+ /** @var bool */
+ private $useIncludePath = false;
+
+ /**
+ * @var array
+ */
+ private $classMap = array();
+
+ /** @var bool */
+ private $classMapAuthoritative = false;
+
+ /**
+ * @var array
+ */
+ private $missingClasses = array();
+
+ /** @var string|null */
+ private $apcuPrefix;
+
+ /**
+ * @var array
+ */
+ private static $registeredLoaders = array();
+
+ /**
+ * @param string|null $vendorDir
+ */
+ public function __construct($vendorDir = null)
+ {
+ $this->vendorDir = $vendorDir;
+ self::initializeIncludeClosure();
+ }
+
+ /**
+ * @return array>
+ */
+ public function getPrefixes()
+ {
+ if (!empty($this->prefixesPsr0)) {
+ return call_user_func_array('array_merge', array_values($this->prefixesPsr0));
+ }
+
+ return array();
+ }
+
+ /**
+ * @return array>
+ */
+ public function getPrefixesPsr4()
+ {
+ return $this->prefixDirsPsr4;
+ }
+
+ /**
+ * @return list
+ */
+ public function getFallbackDirs()
+ {
+ return $this->fallbackDirsPsr0;
+ }
+
+ /**
+ * @return list
+ */
+ public function getFallbackDirsPsr4()
+ {
+ return $this->fallbackDirsPsr4;
+ }
+
+ /**
+ * @return array Array of classname => path
+ */
+ public function getClassMap()
+ {
+ return $this->classMap;
+ }
+
+ /**
+ * @param array $classMap Class to filename map
+ *
+ * @return void
+ */
+ public function addClassMap(array $classMap)
+ {
+ if ($this->classMap) {
+ $this->classMap = array_merge($this->classMap, $classMap);
+ } else {
+ $this->classMap = $classMap;
+ }
+ }
+
+ /**
+ * Registers a set of PSR-0 directories for a given prefix, either
+ * appending or prepending to the ones previously set for this prefix.
+ *
+ * @param string $prefix The prefix
+ * @param list|string $paths The PSR-0 root directories
+ * @param bool $prepend Whether to prepend the directories
+ *
+ * @return void
+ */
+ public function add($prefix, $paths, $prepend = false)
+ {
+ $paths = (array) $paths;
+ if (!$prefix) {
+ if ($prepend) {
+ $this->fallbackDirsPsr0 = array_merge(
+ $paths,
+ $this->fallbackDirsPsr0
+ );
+ } else {
+ $this->fallbackDirsPsr0 = array_merge(
+ $this->fallbackDirsPsr0,
+ $paths
+ );
+ }
+
+ return;
+ }
+
+ $first = $prefix[0];
+ if (!isset($this->prefixesPsr0[$first][$prefix])) {
+ $this->prefixesPsr0[$first][$prefix] = $paths;
+
+ return;
+ }
+ if ($prepend) {
+ $this->prefixesPsr0[$first][$prefix] = array_merge(
+ $paths,
+ $this->prefixesPsr0[$first][$prefix]
+ );
+ } else {
+ $this->prefixesPsr0[$first][$prefix] = array_merge(
+ $this->prefixesPsr0[$first][$prefix],
+ $paths
+ );
+ }
+ }
+
+ /**
+ * Registers a set of PSR-4 directories for a given namespace, either
+ * appending or prepending to the ones previously set for this namespace.
+ *
+ * @param string $prefix The prefix/namespace, with trailing '\\'
+ * @param list|string $paths The PSR-4 base directories
+ * @param bool $prepend Whether to prepend the directories
+ *
+ * @throws \InvalidArgumentException
+ *
+ * @return void
+ */
+ public function addPsr4($prefix, $paths, $prepend = false)
+ {
+ $paths = (array) $paths;
+ if (!$prefix) {
+ // Register directories for the root namespace.
+ if ($prepend) {
+ $this->fallbackDirsPsr4 = array_merge(
+ $paths,
+ $this->fallbackDirsPsr4
+ );
+ } else {
+ $this->fallbackDirsPsr4 = array_merge(
+ $this->fallbackDirsPsr4,
+ $paths
+ );
+ }
+ } elseif (!isset($this->prefixDirsPsr4[$prefix])) {
+ // Register directories for a new namespace.
+ $length = strlen($prefix);
+ if ('\\' !== $prefix[$length - 1]) {
+ throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
+ }
+ $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
+ $this->prefixDirsPsr4[$prefix] = $paths;
+ } elseif ($prepend) {
+ // Prepend directories for an already registered namespace.
+ $this->prefixDirsPsr4[$prefix] = array_merge(
+ $paths,
+ $this->prefixDirsPsr4[$prefix]
+ );
+ } else {
+ // Append directories for an already registered namespace.
+ $this->prefixDirsPsr4[$prefix] = array_merge(
+ $this->prefixDirsPsr4[$prefix],
+ $paths
+ );
+ }
+ }
+
+ /**
+ * Registers a set of PSR-0 directories for a given prefix,
+ * replacing any others previously set for this prefix.
+ *
+ * @param string $prefix The prefix
+ * @param list|string $paths The PSR-0 base directories
+ *
+ * @return void
+ */
+ public function set($prefix, $paths)
+ {
+ if (!$prefix) {
+ $this->fallbackDirsPsr0 = (array) $paths;
+ } else {
+ $this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths;
+ }
+ }
+
+ /**
+ * Registers a set of PSR-4 directories for a given namespace,
+ * replacing any others previously set for this namespace.
+ *
+ * @param string $prefix The prefix/namespace, with trailing '\\'
+ * @param list|string $paths The PSR-4 base directories
+ *
+ * @throws \InvalidArgumentException
+ *
+ * @return void
+ */
+ public function setPsr4($prefix, $paths)
+ {
+ if (!$prefix) {
+ $this->fallbackDirsPsr4 = (array) $paths;
+ } else {
+ $length = strlen($prefix);
+ if ('\\' !== $prefix[$length - 1]) {
+ throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
+ }
+ $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
+ $this->prefixDirsPsr4[$prefix] = (array) $paths;
+ }
+ }
+
+ /**
+ * Turns on searching the include path for class files.
+ *
+ * @param bool $useIncludePath
+ *
+ * @return void
+ */
+ public function setUseIncludePath($useIncludePath)
+ {
+ $this->useIncludePath = $useIncludePath;
+ }
+
+ /**
+ * Can be used to check if the autoloader uses the include path to check
+ * for classes.
+ *
+ * @return bool
+ */
+ public function getUseIncludePath()
+ {
+ return $this->useIncludePath;
+ }
+
+ /**
+ * Turns off searching the prefix and fallback directories for classes
+ * that have not been registered with the class map.
+ *
+ * @param bool $classMapAuthoritative
+ *
+ * @return void
+ */
+ public function setClassMapAuthoritative($classMapAuthoritative)
+ {
+ $this->classMapAuthoritative = $classMapAuthoritative;
+ }
+
+ /**
+ * Should class lookup fail if not found in the current class map?
+ *
+ * @return bool
+ */
+ public function isClassMapAuthoritative()
+ {
+ return $this->classMapAuthoritative;
+ }
+
+ /**
+ * APCu prefix to use to cache found/not-found classes, if the extension is enabled.
+ *
+ * @param string|null $apcuPrefix
+ *
+ * @return void
+ */
+ public function setApcuPrefix($apcuPrefix)
+ {
+ $this->apcuPrefix = function_exists('apcu_fetch') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) ? $apcuPrefix : null;
+ }
+
+ /**
+ * The APCu prefix in use, or null if APCu caching is not enabled.
+ *
+ * @return string|null
+ */
+ public function getApcuPrefix()
+ {
+ return $this->apcuPrefix;
+ }
+
+ /**
+ * Registers this instance as an autoloader.
+ *
+ * @param bool $prepend Whether to prepend the autoloader or not
+ *
+ * @return void
+ */
+ public function register($prepend = false)
+ {
+ spl_autoload_register(array($this, 'loadClass'), true, $prepend);
+
+ if (null === $this->vendorDir) {
+ return;
+ }
+
+ if ($prepend) {
+ self::$registeredLoaders = array($this->vendorDir => $this) + self::$registeredLoaders;
+ } else {
+ unset(self::$registeredLoaders[$this->vendorDir]);
+ self::$registeredLoaders[$this->vendorDir] = $this;
+ }
+ }
+
+ /**
+ * Unregisters this instance as an autoloader.
+ *
+ * @return void
+ */
+ public function unregister()
+ {
+ spl_autoload_unregister(array($this, 'loadClass'));
+
+ if (null !== $this->vendorDir) {
+ unset(self::$registeredLoaders[$this->vendorDir]);
+ }
+ }
+
+ /**
+ * Loads the given class or interface.
+ *
+ * @param string $class The name of the class
+ * @return true|null True if loaded, null otherwise
+ */
+ public function loadClass($class)
+ {
+ if ($file = $this->findFile($class)) {
+ $includeFile = self::$includeFile;
+ $includeFile($file);
+
+ return true;
+ }
+
+ return null;
+ }
+
+ /**
+ * Finds the path to the file where the class is defined.
+ *
+ * @param string $class The name of the class
+ *
+ * @return string|false The path if found, false otherwise
+ */
+ public function findFile($class)
+ {
+ // class map lookup
+ if (isset($this->classMap[$class])) {
+ return $this->classMap[$class];
+ }
+ if ($this->classMapAuthoritative || isset($this->missingClasses[$class])) {
+ return false;
+ }
+ if (null !== $this->apcuPrefix) {
+ $file = apcu_fetch($this->apcuPrefix.$class, $hit);
+ if ($hit) {
+ return $file;
+ }
+ }
+
+ $file = $this->findFileWithExtension($class, '.php');
+
+ // Search for Hack files if we are running on HHVM
+ if (false === $file && defined('HHVM_VERSION')) {
+ $file = $this->findFileWithExtension($class, '.hh');
+ }
+
+ if (null !== $this->apcuPrefix) {
+ apcu_add($this->apcuPrefix.$class, $file);
+ }
+
+ if (false === $file) {
+ // Remember that this class does not exist.
+ $this->missingClasses[$class] = true;
+ }
+
+ return $file;
+ }
+
+ /**
+ * Returns the currently registered loaders keyed by their corresponding vendor directories.
+ *
+ * @return array
+ */
+ public static function getRegisteredLoaders()
+ {
+ return self::$registeredLoaders;
+ }
+
+ /**
+ * @param string $class
+ * @param string $ext
+ * @return string|false
+ */
+ private function findFileWithExtension($class, $ext)
+ {
+ // PSR-4 lookup
+ $logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext;
+
+ $first = $class[0];
+ if (isset($this->prefixLengthsPsr4[$first])) {
+ $subPath = $class;
+ while (false !== $lastPos = strrpos($subPath, '\\')) {
+ $subPath = substr($subPath, 0, $lastPos);
+ $search = $subPath . '\\';
+ if (isset($this->prefixDirsPsr4[$search])) {
+ $pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1);
+ foreach ($this->prefixDirsPsr4[$search] as $dir) {
+ if (file_exists($file = $dir . $pathEnd)) {
+ return $file;
+ }
+ }
+ }
+ }
+ }
+
+ // PSR-4 fallback dirs
+ foreach ($this->fallbackDirsPsr4 as $dir) {
+ if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) {
+ return $file;
+ }
+ }
+
+ // PSR-0 lookup
+ if (false !== $pos = strrpos($class, '\\')) {
+ // namespaced class name
+ $logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1)
+ . strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR);
+ } else {
+ // PEAR-like class name
+ $logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext;
+ }
+
+ if (isset($this->prefixesPsr0[$first])) {
+ foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) {
+ if (0 === strpos($class, $prefix)) {
+ foreach ($dirs as $dir) {
+ if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
+ return $file;
+ }
+ }
+ }
+ }
+ }
+
+ // PSR-0 fallback dirs
+ foreach ($this->fallbackDirsPsr0 as $dir) {
+ if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
+ return $file;
+ }
+ }
+
+ // PSR-0 include paths.
+ if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) {
+ return $file;
+ }
+
+ return false;
+ }
+
+ /**
+ * @return void
+ */
+ private static function initializeIncludeClosure()
+ {
+ if (self::$includeFile !== null) {
+ return;
+ }
+
+ /**
+ * Scope isolated include.
+ *
+ * Prevents access to $this/self from included files.
+ *
+ * @param string $file
+ * @return void
+ */
+ self::$includeFile = \Closure::bind(static function($file) {
+ include $file;
+ }, null, null);
+ }
+}
diff --git a/public/vendor/composer/InstalledVersions.php b/public/vendor/composer/InstalledVersions.php
new file mode 100644
index 0000000..51e734a
--- /dev/null
+++ b/public/vendor/composer/InstalledVersions.php
@@ -0,0 +1,359 @@
+
+ * Jordi Boggiano
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Composer;
+
+use Composer\Autoload\ClassLoader;
+use Composer\Semver\VersionParser;
+
+/**
+ * This class is copied in every Composer installed project and available to all
+ *
+ * See also https://getcomposer.org/doc/07-runtime.md#installed-versions
+ *
+ * To require its presence, you can require `composer-runtime-api ^2.0`
+ *
+ * @final
+ */
+class InstalledVersions
+{
+ /**
+ * @var mixed[]|null
+ * @psalm-var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array}|array{}|null
+ */
+ private static $installed;
+
+ /**
+ * @var bool|null
+ */
+ private static $canGetVendors;
+
+ /**
+ * @var array[]
+ * @psalm-var array}>
+ */
+ private static $installedByVendor = array();
+
+ /**
+ * Returns a list of all package names which are present, either by being installed, replaced or provided
+ *
+ * @return string[]
+ * @psalm-return list
+ */
+ public static function getInstalledPackages()
+ {
+ $packages = array();
+ foreach (self::getInstalled() as $installed) {
+ $packages[] = array_keys($installed['versions']);
+ }
+
+ if (1 === \count($packages)) {
+ return $packages[0];
+ }
+
+ return array_keys(array_flip(\call_user_func_array('array_merge', $packages)));
+ }
+
+ /**
+ * Returns a list of all package names with a specific type e.g. 'library'
+ *
+ * @param string $type
+ * @return string[]
+ * @psalm-return list
+ */
+ public static function getInstalledPackagesByType($type)
+ {
+ $packagesByType = array();
+
+ foreach (self::getInstalled() as $installed) {
+ foreach ($installed['versions'] as $name => $package) {
+ if (isset($package['type']) && $package['type'] === $type) {
+ $packagesByType[] = $name;
+ }
+ }
+ }
+
+ return $packagesByType;
+ }
+
+ /**
+ * Checks whether the given package is installed
+ *
+ * This also returns true if the package name is provided or replaced by another package
+ *
+ * @param string $packageName
+ * @param bool $includeDevRequirements
+ * @return bool
+ */
+ public static function isInstalled($packageName, $includeDevRequirements = true)
+ {
+ foreach (self::getInstalled() as $installed) {
+ if (isset($installed['versions'][$packageName])) {
+ return $includeDevRequirements || !isset($installed['versions'][$packageName]['dev_requirement']) || $installed['versions'][$packageName]['dev_requirement'] === false;
+ }
+ }
+
+ return false;
+ }
+
+ /**
+ * Checks whether the given package satisfies a version constraint
+ *
+ * e.g. If you want to know whether version 2.3+ of package foo/bar is installed, you would call:
+ *
+ * Composer\InstalledVersions::satisfies(new VersionParser, 'foo/bar', '^2.3')
+ *
+ * @param VersionParser $parser Install composer/semver to have access to this class and functionality
+ * @param string $packageName
+ * @param string|null $constraint A version constraint to check for, if you pass one you have to make sure composer/semver is required by your package
+ * @return bool
+ */
+ public static function satisfies(VersionParser $parser, $packageName, $constraint)
+ {
+ $constraint = $parser->parseConstraints((string) $constraint);
+ $provided = $parser->parseConstraints(self::getVersionRanges($packageName));
+
+ return $provided->matches($constraint);
+ }
+
+ /**
+ * Returns a version constraint representing all the range(s) which are installed for a given package
+ *
+ * It is easier to use this via isInstalled() with the $constraint argument if you need to check
+ * whether a given version of a package is installed, and not just whether it exists
+ *
+ * @param string $packageName
+ * @return string Version constraint usable with composer/semver
+ */
+ public static function getVersionRanges($packageName)
+ {
+ foreach (self::getInstalled() as $installed) {
+ if (!isset($installed['versions'][$packageName])) {
+ continue;
+ }
+
+ $ranges = array();
+ if (isset($installed['versions'][$packageName]['pretty_version'])) {
+ $ranges[] = $installed['versions'][$packageName]['pretty_version'];
+ }
+ if (array_key_exists('aliases', $installed['versions'][$packageName])) {
+ $ranges = array_merge($ranges, $installed['versions'][$packageName]['aliases']);
+ }
+ if (array_key_exists('replaced', $installed['versions'][$packageName])) {
+ $ranges = array_merge($ranges, $installed['versions'][$packageName]['replaced']);
+ }
+ if (array_key_exists('provided', $installed['versions'][$packageName])) {
+ $ranges = array_merge($ranges, $installed['versions'][$packageName]['provided']);
+ }
+
+ return implode(' || ', $ranges);
+ }
+
+ throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
+ }
+
+ /**
+ * @param string $packageName
+ * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present
+ */
+ public static function getVersion($packageName)
+ {
+ foreach (self::getInstalled() as $installed) {
+ if (!isset($installed['versions'][$packageName])) {
+ continue;
+ }
+
+ if (!isset($installed['versions'][$packageName]['version'])) {
+ return null;
+ }
+
+ return $installed['versions'][$packageName]['version'];
+ }
+
+ throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
+ }
+
+ /**
+ * @param string $packageName
+ * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present
+ */
+ public static function getPrettyVersion($packageName)
+ {
+ foreach (self::getInstalled() as $installed) {
+ if (!isset($installed['versions'][$packageName])) {
+ continue;
+ }
+
+ if (!isset($installed['versions'][$packageName]['pretty_version'])) {
+ return null;
+ }
+
+ return $installed['versions'][$packageName]['pretty_version'];
+ }
+
+ throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
+ }
+
+ /**
+ * @param string $packageName
+ * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as reference
+ */
+ public static function getReference($packageName)
+ {
+ foreach (self::getInstalled() as $installed) {
+ if (!isset($installed['versions'][$packageName])) {
+ continue;
+ }
+
+ if (!isset($installed['versions'][$packageName]['reference'])) {
+ return null;
+ }
+
+ return $installed['versions'][$packageName]['reference'];
+ }
+
+ throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
+ }
+
+ /**
+ * @param string $packageName
+ * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as install path. Packages of type metapackages also have a null install path.
+ */
+ public static function getInstallPath($packageName)
+ {
+ foreach (self::getInstalled() as $installed) {
+ if (!isset($installed['versions'][$packageName])) {
+ continue;
+ }
+
+ return isset($installed['versions'][$packageName]['install_path']) ? $installed['versions'][$packageName]['install_path'] : null;
+ }
+
+ throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
+ }
+
+ /**
+ * @return array
+ * @psalm-return array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}
+ */
+ public static function getRootPackage()
+ {
+ $installed = self::getInstalled();
+
+ return $installed[0]['root'];
+ }
+
+ /**
+ * Returns the raw installed.php data for custom implementations
+ *
+ * @deprecated Use getAllRawData() instead which returns all datasets for all autoloaders present in the process. getRawData only returns the first dataset loaded, which may not be what you expect.
+ * @return array[]
+ * @psalm-return array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array}
+ */
+ public static function getRawData()
+ {
+ @trigger_error('getRawData only returns the first dataset loaded, which may not be what you expect. Use getAllRawData() instead which returns all datasets for all autoloaders present in the process.', E_USER_DEPRECATED);
+
+ if (null === self::$installed) {
+ // only require the installed.php file if this file is loaded from its dumped location,
+ // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937
+ if (substr(__DIR__, -8, 1) !== 'C') {
+ self::$installed = include __DIR__ . '/installed.php';
+ } else {
+ self::$installed = array();
+ }
+ }
+
+ return self::$installed;
+ }
+
+ /**
+ * Returns the raw data of all installed.php which are currently loaded for custom implementations
+ *
+ * @return array[]
+ * @psalm-return list}>
+ */
+ public static function getAllRawData()
+ {
+ return self::getInstalled();
+ }
+
+ /**
+ * Lets you reload the static array from another file
+ *
+ * This is only useful for complex integrations in which a project needs to use
+ * this class but then also needs to execute another project's autoloader in process,
+ * and wants to ensure both projects have access to their version of installed.php.
+ *
+ * A typical case would be PHPUnit, where it would need to make sure it reads all
+ * the data it needs from this class, then call reload() with
+ * `require $CWD/vendor/composer/installed.php` (or similar) as input to make sure
+ * the project in which it runs can then also use this class safely, without
+ * interference between PHPUnit's dependencies and the project's dependencies.
+ *
+ * @param array[] $data A vendor/composer/installed.php data set
+ * @return void
+ *
+ * @psalm-param array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array} $data
+ */
+ public static function reload($data)
+ {
+ self::$installed = $data;
+ self::$installedByVendor = array();
+ }
+
+ /**
+ * @return array[]
+ * @psalm-return list}>
+ */
+ private static function getInstalled()
+ {
+ if (null === self::$canGetVendors) {
+ self::$canGetVendors = method_exists('Composer\Autoload\ClassLoader', 'getRegisteredLoaders');
+ }
+
+ $installed = array();
+
+ if (self::$canGetVendors) {
+ foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) {
+ if (isset(self::$installedByVendor[$vendorDir])) {
+ $installed[] = self::$installedByVendor[$vendorDir];
+ } elseif (is_file($vendorDir.'/composer/installed.php')) {
+ /** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array} $required */
+ $required = require $vendorDir.'/composer/installed.php';
+ $installed[] = self::$installedByVendor[$vendorDir] = $required;
+ if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) {
+ self::$installed = $installed[count($installed) - 1];
+ }
+ }
+ }
+ }
+
+ if (null === self::$installed) {
+ // only require the installed.php file if this file is loaded from its dumped location,
+ // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937
+ if (substr(__DIR__, -8, 1) !== 'C') {
+ /** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array} $required */
+ $required = require __DIR__ . '/installed.php';
+ self::$installed = $required;
+ } else {
+ self::$installed = array();
+ }
+ }
+
+ if (self::$installed !== array()) {
+ $installed[] = self::$installed;
+ }
+
+ return $installed;
+ }
+}
diff --git a/public/vendor/composer/LICENSE b/public/vendor/composer/LICENSE
new file mode 100644
index 0000000..f27399a
--- /dev/null
+++ b/public/vendor/composer/LICENSE
@@ -0,0 +1,21 @@
+
+Copyright (c) Nils Adermann, Jordi Boggiano
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is furnished
+to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
+
diff --git a/public/vendor/composer/autoload_classmap.php b/public/vendor/composer/autoload_classmap.php
new file mode 100644
index 0000000..0fb0a2c
--- /dev/null
+++ b/public/vendor/composer/autoload_classmap.php
@@ -0,0 +1,10 @@
+ $vendorDir . '/composer/InstalledVersions.php',
+);
diff --git a/public/vendor/composer/autoload_namespaces.php b/public/vendor/composer/autoload_namespaces.php
new file mode 100644
index 0000000..15a2ff3
--- /dev/null
+++ b/public/vendor/composer/autoload_namespaces.php
@@ -0,0 +1,9 @@
+ array($vendorDir . '/maennchen/zipstream-php/src'),
+ 'Psr\\SimpleCache\\' => array($vendorDir . '/psr/simple-cache/src'),
+ 'Psr\\Http\\Message\\' => array($vendorDir . '/psr/http-message/src', $vendorDir . '/psr/http-factory/src'),
+ 'Psr\\Http\\Client\\' => array($vendorDir . '/psr/http-client/src'),
+ 'PhpOffice\\PhpSpreadsheet\\' => array($vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet'),
+ 'Matrix\\' => array($vendorDir . '/markbaker/matrix/classes/src'),
+ 'Complex\\' => array($vendorDir . '/markbaker/complex/classes/src'),
+);
diff --git a/public/vendor/composer/autoload_real.php b/public/vendor/composer/autoload_real.php
new file mode 100644
index 0000000..62db36e
--- /dev/null
+++ b/public/vendor/composer/autoload_real.php
@@ -0,0 +1,38 @@
+register(true);
+
+ return $loader;
+ }
+}
diff --git a/public/vendor/composer/autoload_static.php b/public/vendor/composer/autoload_static.php
new file mode 100644
index 0000000..9b7574d
--- /dev/null
+++ b/public/vendor/composer/autoload_static.php
@@ -0,0 +1,76 @@
+
+ array (
+ 'ZipStream\\' => 10,
+ ),
+ 'P' =>
+ array (
+ 'Psr\\SimpleCache\\' => 16,
+ 'Psr\\Http\\Message\\' => 17,
+ 'Psr\\Http\\Client\\' => 16,
+ 'PhpOffice\\PhpSpreadsheet\\' => 25,
+ ),
+ 'M' =>
+ array (
+ 'Matrix\\' => 7,
+ ),
+ 'C' =>
+ array (
+ 'Complex\\' => 8,
+ ),
+ );
+
+ public static $prefixDirsPsr4 = array (
+ 'ZipStream\\' =>
+ array (
+ 0 => __DIR__ . '/..' . '/maennchen/zipstream-php/src',
+ ),
+ 'Psr\\SimpleCache\\' =>
+ array (
+ 0 => __DIR__ . '/..' . '/psr/simple-cache/src',
+ ),
+ 'Psr\\Http\\Message\\' =>
+ array (
+ 0 => __DIR__ . '/..' . '/psr/http-message/src',
+ 1 => __DIR__ . '/..' . '/psr/http-factory/src',
+ ),
+ 'Psr\\Http\\Client\\' =>
+ array (
+ 0 => __DIR__ . '/..' . '/psr/http-client/src',
+ ),
+ 'PhpOffice\\PhpSpreadsheet\\' =>
+ array (
+ 0 => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet',
+ ),
+ 'Matrix\\' =>
+ array (
+ 0 => __DIR__ . '/..' . '/markbaker/matrix/classes/src',
+ ),
+ 'Complex\\' =>
+ array (
+ 0 => __DIR__ . '/..' . '/markbaker/complex/classes/src',
+ ),
+ );
+
+ public static $classMap = array (
+ 'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php',
+ );
+
+ public static function getInitializer(ClassLoader $loader)
+ {
+ return \Closure::bind(function () use ($loader) {
+ $loader->prefixLengthsPsr4 = ComposerStaticInitb8fc76d4d2fd9a7199969838cb86a710::$prefixLengthsPsr4;
+ $loader->prefixDirsPsr4 = ComposerStaticInitb8fc76d4d2fd9a7199969838cb86a710::$prefixDirsPsr4;
+ $loader->classMap = ComposerStaticInitb8fc76d4d2fd9a7199969838cb86a710::$classMap;
+
+ }, null, ClassLoader::class);
+ }
+}
diff --git a/public/vendor/composer/installed.json b/public/vendor/composer/installed.json
new file mode 100644
index 0000000..08605e0
--- /dev/null
+++ b/public/vendor/composer/installed.json
@@ -0,0 +1,533 @@
+{
+ "packages": [
+ {
+ "name": "maennchen/zipstream-php",
+ "version": "3.1.0",
+ "version_normalized": "3.1.0.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/maennchen/ZipStream-PHP.git",
+ "reference": "b8174494eda667f7d13876b4a7bfef0f62a7c0d1"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/maennchen/ZipStream-PHP/zipball/b8174494eda667f7d13876b4a7bfef0f62a7c0d1",
+ "reference": "b8174494eda667f7d13876b4a7bfef0f62a7c0d1",
+ "shasum": ""
+ },
+ "require": {
+ "ext-mbstring": "*",
+ "ext-zlib": "*",
+ "php-64bit": "^8.1"
+ },
+ "require-dev": {
+ "ext-zip": "*",
+ "friendsofphp/php-cs-fixer": "^3.16",
+ "guzzlehttp/guzzle": "^7.5",
+ "mikey179/vfsstream": "^1.6",
+ "php-coveralls/php-coveralls": "^2.5",
+ "phpunit/phpunit": "^10.0",
+ "vimeo/psalm": "^5.0"
+ },
+ "suggest": {
+ "guzzlehttp/psr7": "^2.4",
+ "psr/http-message": "^2.0"
+ },
+ "time": "2023-06-21T14:59:35+00:00",
+ "type": "library",
+ "installation-source": "dist",
+ "autoload": {
+ "psr-4": {
+ "ZipStream\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Paul Duncan",
+ "email": "pabs@pablotron.org"
+ },
+ {
+ "name": "Jonatan Männchen",
+ "email": "jonatan@maennchen.ch"
+ },
+ {
+ "name": "Jesse Donat",
+ "email": "donatj@gmail.com"
+ },
+ {
+ "name": "András Kolesár",
+ "email": "kolesar@kolesar.hu"
+ }
+ ],
+ "description": "ZipStream is a library for dynamically streaming dynamic zip files from PHP without writing to the disk at all on the server.",
+ "keywords": [
+ "stream",
+ "zip"
+ ],
+ "support": {
+ "issues": "https://github.com/maennchen/ZipStream-PHP/issues",
+ "source": "https://github.com/maennchen/ZipStream-PHP/tree/3.1.0"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/maennchen",
+ "type": "github"
+ },
+ {
+ "url": "https://opencollective.com/zipstream",
+ "type": "open_collective"
+ }
+ ],
+ "install-path": "../maennchen/zipstream-php"
+ },
+ {
+ "name": "markbaker/complex",
+ "version": "3.0.2",
+ "version_normalized": "3.0.2.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/MarkBaker/PHPComplex.git",
+ "reference": "95c56caa1cf5c766ad6d65b6344b807c1e8405b9"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/MarkBaker/PHPComplex/zipball/95c56caa1cf5c766ad6d65b6344b807c1e8405b9",
+ "reference": "95c56caa1cf5c766ad6d65b6344b807c1e8405b9",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^7.2 || ^8.0"
+ },
+ "require-dev": {
+ "dealerdirect/phpcodesniffer-composer-installer": "dev-master",
+ "phpcompatibility/php-compatibility": "^9.3",
+ "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0",
+ "squizlabs/php_codesniffer": "^3.7"
+ },
+ "time": "2022-12-06T16:21:08+00:00",
+ "type": "library",
+ "installation-source": "dist",
+ "autoload": {
+ "psr-4": {
+ "Complex\\": "classes/src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Mark Baker",
+ "email": "mark@lange.demon.co.uk"
+ }
+ ],
+ "description": "PHP Class for working with complex numbers",
+ "homepage": "https://github.com/MarkBaker/PHPComplex",
+ "keywords": [
+ "complex",
+ "mathematics"
+ ],
+ "support": {
+ "issues": "https://github.com/MarkBaker/PHPComplex/issues",
+ "source": "https://github.com/MarkBaker/PHPComplex/tree/3.0.2"
+ },
+ "install-path": "../markbaker/complex"
+ },
+ {
+ "name": "markbaker/matrix",
+ "version": "3.0.1",
+ "version_normalized": "3.0.1.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/MarkBaker/PHPMatrix.git",
+ "reference": "728434227fe21be27ff6d86621a1b13107a2562c"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/MarkBaker/PHPMatrix/zipball/728434227fe21be27ff6d86621a1b13107a2562c",
+ "reference": "728434227fe21be27ff6d86621a1b13107a2562c",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^7.1 || ^8.0"
+ },
+ "require-dev": {
+ "dealerdirect/phpcodesniffer-composer-installer": "dev-master",
+ "phpcompatibility/php-compatibility": "^9.3",
+ "phpdocumentor/phpdocumentor": "2.*",
+ "phploc/phploc": "^4.0",
+ "phpmd/phpmd": "2.*",
+ "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0",
+ "sebastian/phpcpd": "^4.0",
+ "squizlabs/php_codesniffer": "^3.7"
+ },
+ "time": "2022-12-02T22:17:43+00:00",
+ "type": "library",
+ "installation-source": "dist",
+ "autoload": {
+ "psr-4": {
+ "Matrix\\": "classes/src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Mark Baker",
+ "email": "mark@demon-angel.eu"
+ }
+ ],
+ "description": "PHP Class for working with matrices",
+ "homepage": "https://github.com/MarkBaker/PHPMatrix",
+ "keywords": [
+ "mathematics",
+ "matrix",
+ "vector"
+ ],
+ "support": {
+ "issues": "https://github.com/MarkBaker/PHPMatrix/issues",
+ "source": "https://github.com/MarkBaker/PHPMatrix/tree/3.0.1"
+ },
+ "install-path": "../markbaker/matrix"
+ },
+ {
+ "name": "phpoffice/phpspreadsheet",
+ "version": "2.1.0",
+ "version_normalized": "2.1.0.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/PHPOffice/PhpSpreadsheet.git",
+ "reference": "dbed77bd3a0f68f96c0dd68ad4499d5674fecc3e"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/PHPOffice/PhpSpreadsheet/zipball/dbed77bd3a0f68f96c0dd68ad4499d5674fecc3e",
+ "reference": "dbed77bd3a0f68f96c0dd68ad4499d5674fecc3e",
+ "shasum": ""
+ },
+ "require": {
+ "ext-ctype": "*",
+ "ext-dom": "*",
+ "ext-fileinfo": "*",
+ "ext-gd": "*",
+ "ext-iconv": "*",
+ "ext-libxml": "*",
+ "ext-mbstring": "*",
+ "ext-simplexml": "*",
+ "ext-xml": "*",
+ "ext-xmlreader": "*",
+ "ext-xmlwriter": "*",
+ "ext-zip": "*",
+ "ext-zlib": "*",
+ "maennchen/zipstream-php": "^2.1 || ^3.0",
+ "markbaker/complex": "^3.0",
+ "markbaker/matrix": "^3.0",
+ "php": "^8.0",
+ "psr/http-client": "^1.0",
+ "psr/http-factory": "^1.0",
+ "psr/simple-cache": "^1.0 || ^2.0 || ^3.0"
+ },
+ "require-dev": {
+ "dealerdirect/phpcodesniffer-composer-installer": "dev-main",
+ "dompdf/dompdf": "^2.0",
+ "friendsofphp/php-cs-fixer": "^3.2",
+ "mitoteam/jpgraph": "^10.3",
+ "mpdf/mpdf": "^8.1.1",
+ "phpcompatibility/php-compatibility": "^9.3",
+ "phpstan/phpstan": "^1.1",
+ "phpstan/phpstan-phpunit": "^1.0",
+ "phpunit/phpunit": "^9.6",
+ "squizlabs/php_codesniffer": "^3.7",
+ "tecnickcom/tcpdf": "^6.5"
+ },
+ "suggest": {
+ "dompdf/dompdf": "Option for rendering PDF with PDF Writer",
+ "ext-intl": "PHP Internationalization Functions",
+ "mitoteam/jpgraph": "Option for rendering charts, or including charts with PDF or HTML Writers",
+ "mpdf/mpdf": "Option for rendering PDF with PDF Writer",
+ "tecnickcom/tcpdf": "Option for rendering PDF with PDF Writer"
+ },
+ "time": "2024-05-11T04:17:56+00:00",
+ "type": "library",
+ "installation-source": "dist",
+ "autoload": {
+ "psr-4": {
+ "PhpOffice\\PhpSpreadsheet\\": "src/PhpSpreadsheet"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Maarten Balliauw",
+ "homepage": "https://blog.maartenballiauw.be"
+ },
+ {
+ "name": "Mark Baker",
+ "homepage": "https://markbakeruk.net"
+ },
+ {
+ "name": "Franck Lefevre",
+ "homepage": "https://rootslabs.net"
+ },
+ {
+ "name": "Erik Tilt"
+ },
+ {
+ "name": "Adrien Crivelli"
+ }
+ ],
+ "description": "PHPSpreadsheet - Read, Create and Write Spreadsheet documents in PHP - Spreadsheet engine",
+ "homepage": "https://github.com/PHPOffice/PhpSpreadsheet",
+ "keywords": [
+ "OpenXML",
+ "excel",
+ "gnumeric",
+ "ods",
+ "php",
+ "spreadsheet",
+ "xls",
+ "xlsx"
+ ],
+ "support": {
+ "issues": "https://github.com/PHPOffice/PhpSpreadsheet/issues",
+ "source": "https://github.com/PHPOffice/PhpSpreadsheet/tree/2.1.0"
+ },
+ "install-path": "../phpoffice/phpspreadsheet"
+ },
+ {
+ "name": "psr/http-client",
+ "version": "1.0.3",
+ "version_normalized": "1.0.3.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/php-fig/http-client.git",
+ "reference": "bb5906edc1c324c9a05aa0873d40117941e5fa90"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/php-fig/http-client/zipball/bb5906edc1c324c9a05aa0873d40117941e5fa90",
+ "reference": "bb5906edc1c324c9a05aa0873d40117941e5fa90",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^7.0 || ^8.0",
+ "psr/http-message": "^1.0 || ^2.0"
+ },
+ "time": "2023-09-23T14:17:50+00:00",
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.0.x-dev"
+ }
+ },
+ "installation-source": "dist",
+ "autoload": {
+ "psr-4": {
+ "Psr\\Http\\Client\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "PHP-FIG",
+ "homepage": "https://www.php-fig.org/"
+ }
+ ],
+ "description": "Common interface for HTTP clients",
+ "homepage": "https://github.com/php-fig/http-client",
+ "keywords": [
+ "http",
+ "http-client",
+ "psr",
+ "psr-18"
+ ],
+ "support": {
+ "source": "https://github.com/php-fig/http-client"
+ },
+ "install-path": "../psr/http-client"
+ },
+ {
+ "name": "psr/http-factory",
+ "version": "1.1.0",
+ "version_normalized": "1.1.0.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/php-fig/http-factory.git",
+ "reference": "2b4765fddfe3b508ac62f829e852b1501d3f6e8a"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/php-fig/http-factory/zipball/2b4765fddfe3b508ac62f829e852b1501d3f6e8a",
+ "reference": "2b4765fddfe3b508ac62f829e852b1501d3f6e8a",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.1",
+ "psr/http-message": "^1.0 || ^2.0"
+ },
+ "time": "2024-04-15T12:06:14+00:00",
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.0.x-dev"
+ }
+ },
+ "installation-source": "dist",
+ "autoload": {
+ "psr-4": {
+ "Psr\\Http\\Message\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "PHP-FIG",
+ "homepage": "https://www.php-fig.org/"
+ }
+ ],
+ "description": "PSR-17: Common interfaces for PSR-7 HTTP message factories",
+ "keywords": [
+ "factory",
+ "http",
+ "message",
+ "psr",
+ "psr-17",
+ "psr-7",
+ "request",
+ "response"
+ ],
+ "support": {
+ "source": "https://github.com/php-fig/http-factory"
+ },
+ "install-path": "../psr/http-factory"
+ },
+ {
+ "name": "psr/http-message",
+ "version": "2.0",
+ "version_normalized": "2.0.0.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/php-fig/http-message.git",
+ "reference": "402d35bcb92c70c026d1a6a9883f06b2ead23d71"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/php-fig/http-message/zipball/402d35bcb92c70c026d1a6a9883f06b2ead23d71",
+ "reference": "402d35bcb92c70c026d1a6a9883f06b2ead23d71",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^7.2 || ^8.0"
+ },
+ "time": "2023-04-04T09:54:51+00:00",
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "2.0.x-dev"
+ }
+ },
+ "installation-source": "dist",
+ "autoload": {
+ "psr-4": {
+ "Psr\\Http\\Message\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "PHP-FIG",
+ "homepage": "https://www.php-fig.org/"
+ }
+ ],
+ "description": "Common interface for HTTP messages",
+ "homepage": "https://github.com/php-fig/http-message",
+ "keywords": [
+ "http",
+ "http-message",
+ "psr",
+ "psr-7",
+ "request",
+ "response"
+ ],
+ "support": {
+ "source": "https://github.com/php-fig/http-message/tree/2.0"
+ },
+ "install-path": "../psr/http-message"
+ },
+ {
+ "name": "psr/simple-cache",
+ "version": "3.0.0",
+ "version_normalized": "3.0.0.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/php-fig/simple-cache.git",
+ "reference": "764e0b3939f5ca87cb904f570ef9be2d78a07865"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/php-fig/simple-cache/zipball/764e0b3939f5ca87cb904f570ef9be2d78a07865",
+ "reference": "764e0b3939f5ca87cb904f570ef9be2d78a07865",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=8.0.0"
+ },
+ "time": "2021-10-29T13:26:27+00:00",
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "3.0.x-dev"
+ }
+ },
+ "installation-source": "dist",
+ "autoload": {
+ "psr-4": {
+ "Psr\\SimpleCache\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "PHP-FIG",
+ "homepage": "https://www.php-fig.org/"
+ }
+ ],
+ "description": "Common interfaces for simple caching",
+ "keywords": [
+ "cache",
+ "caching",
+ "psr",
+ "psr-16",
+ "simple-cache"
+ ],
+ "support": {
+ "source": "https://github.com/php-fig/simple-cache/tree/3.0.0"
+ },
+ "install-path": "../psr/simple-cache"
+ }
+ ],
+ "dev": true,
+ "dev-package-names": []
+}
diff --git a/public/vendor/composer/installed.php b/public/vendor/composer/installed.php
new file mode 100644
index 0000000..9adb0b4
--- /dev/null
+++ b/public/vendor/composer/installed.php
@@ -0,0 +1,95 @@
+ array(
+ 'name' => '__root__',
+ 'pretty_version' => 'dev-main',
+ 'version' => 'dev-main',
+ 'reference' => '73f1fddbb4fab2fdc2e4e60ff6255da7c25c94ba',
+ 'type' => 'library',
+ 'install_path' => __DIR__ . '/../../',
+ 'aliases' => array(),
+ 'dev' => true,
+ ),
+ 'versions' => array(
+ '__root__' => array(
+ 'pretty_version' => 'dev-main',
+ 'version' => 'dev-main',
+ 'reference' => '73f1fddbb4fab2fdc2e4e60ff6255da7c25c94ba',
+ 'type' => 'library',
+ 'install_path' => __DIR__ . '/../../',
+ 'aliases' => array(),
+ 'dev_requirement' => false,
+ ),
+ 'maennchen/zipstream-php' => array(
+ 'pretty_version' => '3.1.0',
+ 'version' => '3.1.0.0',
+ 'reference' => 'b8174494eda667f7d13876b4a7bfef0f62a7c0d1',
+ 'type' => 'library',
+ 'install_path' => __DIR__ . '/../maennchen/zipstream-php',
+ 'aliases' => array(),
+ 'dev_requirement' => false,
+ ),
+ 'markbaker/complex' => array(
+ 'pretty_version' => '3.0.2',
+ 'version' => '3.0.2.0',
+ 'reference' => '95c56caa1cf5c766ad6d65b6344b807c1e8405b9',
+ 'type' => 'library',
+ 'install_path' => __DIR__ . '/../markbaker/complex',
+ 'aliases' => array(),
+ 'dev_requirement' => false,
+ ),
+ 'markbaker/matrix' => array(
+ 'pretty_version' => '3.0.1',
+ 'version' => '3.0.1.0',
+ 'reference' => '728434227fe21be27ff6d86621a1b13107a2562c',
+ 'type' => 'library',
+ 'install_path' => __DIR__ . '/../markbaker/matrix',
+ 'aliases' => array(),
+ 'dev_requirement' => false,
+ ),
+ 'phpoffice/phpspreadsheet' => array(
+ 'pretty_version' => '2.1.0',
+ 'version' => '2.1.0.0',
+ 'reference' => 'dbed77bd3a0f68f96c0dd68ad4499d5674fecc3e',
+ 'type' => 'library',
+ 'install_path' => __DIR__ . '/../phpoffice/phpspreadsheet',
+ 'aliases' => array(),
+ 'dev_requirement' => false,
+ ),
+ 'psr/http-client' => array(
+ 'pretty_version' => '1.0.3',
+ 'version' => '1.0.3.0',
+ 'reference' => 'bb5906edc1c324c9a05aa0873d40117941e5fa90',
+ 'type' => 'library',
+ 'install_path' => __DIR__ . '/../psr/http-client',
+ 'aliases' => array(),
+ 'dev_requirement' => false,
+ ),
+ 'psr/http-factory' => array(
+ 'pretty_version' => '1.1.0',
+ 'version' => '1.1.0.0',
+ 'reference' => '2b4765fddfe3b508ac62f829e852b1501d3f6e8a',
+ 'type' => 'library',
+ 'install_path' => __DIR__ . '/../psr/http-factory',
+ 'aliases' => array(),
+ 'dev_requirement' => false,
+ ),
+ 'psr/http-message' => array(
+ 'pretty_version' => '2.0',
+ 'version' => '2.0.0.0',
+ 'reference' => '402d35bcb92c70c026d1a6a9883f06b2ead23d71',
+ 'type' => 'library',
+ 'install_path' => __DIR__ . '/../psr/http-message',
+ 'aliases' => array(),
+ 'dev_requirement' => false,
+ ),
+ 'psr/simple-cache' => array(
+ 'pretty_version' => '3.0.0',
+ 'version' => '3.0.0.0',
+ 'reference' => '764e0b3939f5ca87cb904f570ef9be2d78a07865',
+ 'type' => 'library',
+ 'install_path' => __DIR__ . '/../psr/simple-cache',
+ 'aliases' => array(),
+ 'dev_requirement' => false,
+ ),
+ ),
+);
diff --git a/public/vendor/composer/platform_check.php b/public/vendor/composer/platform_check.php
new file mode 100644
index 0000000..f71b2f8
--- /dev/null
+++ b/public/vendor/composer/platform_check.php
@@ -0,0 +1,30 @@
+= 80100)) {
+ $issues[] = 'Your Composer dependencies require a PHP version ">= 8.1.0". You are running ' . PHP_VERSION . '.';
+}
+
+if (PHP_INT_SIZE !== 8) {
+ $issues[] = 'Your Composer dependencies require a 64-bit build of PHP.';
+}
+
+if ($issues) {
+ if (!headers_sent()) {
+ header('HTTP/1.1 500 Internal Server Error');
+ }
+ if (!ini_get('display_errors')) {
+ if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') {
+ fwrite(STDERR, 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . implode(PHP_EOL, $issues) . PHP_EOL.PHP_EOL);
+ } elseif (!headers_sent()) {
+ echo 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . str_replace('You are running '.PHP_VERSION.'.', '', implode(PHP_EOL, $issues)) . PHP_EOL.PHP_EOL;
+ }
+ }
+ trigger_error(
+ 'Composer detected issues in your platform: ' . implode(' ', $issues),
+ E_USER_ERROR
+ );
+}
diff --git a/public/vendor/maennchen/zipstream-php/.editorconfig b/public/vendor/maennchen/zipstream-php/.editorconfig
new file mode 100644
index 0000000..f7cd914
--- /dev/null
+++ b/public/vendor/maennchen/zipstream-php/.editorconfig
@@ -0,0 +1,22 @@
+root = true
+
+[*]
+end_of_line = lf
+insert_final_newline = true
+charset = utf-8
+
+[*.{yml,md,xml}]
+indent_style = space
+indent_size = 2
+
+[*.{rst,php}]
+indent_style = space
+indent_size = 4
+
+[composer.json]
+indent_style = space
+indent_size = 2
+
+[composer.lock]
+indent_style = space
+indent_size = 4
diff --git a/public/vendor/maennchen/zipstream-php/.phive/phars.xml b/public/vendor/maennchen/zipstream-php/.phive/phars.xml
new file mode 100644
index 0000000..569106a
--- /dev/null
+++ b/public/vendor/maennchen/zipstream-php/.phive/phars.xml
@@ -0,0 +1,4 @@
+
+
+
+
diff --git a/public/vendor/maennchen/zipstream-php/.php-cs-fixer.dist.php b/public/vendor/maennchen/zipstream-php/.php-cs-fixer.dist.php
new file mode 100644
index 0000000..b978f06
--- /dev/null
+++ b/public/vendor/maennchen/zipstream-php/.php-cs-fixer.dist.php
@@ -0,0 +1,71 @@
+
+ * @copyright 2022 Nicolas CARPi
+ * @see https://github.com/maennchen/ZipStream-PHP
+ * @license MIT
+ * @package maennchen/ZipStream-PHP
+ */
+
+use PhpCsFixer\Config;
+use PhpCsFixer\Finder;
+
+$finder = Finder::create()
+ ->exclude('.github')
+ ->exclude('.phpdoc')
+ ->exclude('docs')
+ ->exclude('tools')
+ ->exclude('vendor')
+ ->in(__DIR__);
+
+$config = new Config();
+return $config->setRules([
+ '@PER' => true,
+ '@PER:risky' => true,
+ '@PHP82Migration' => true,
+ '@PHPUnit84Migration:risky' => true,
+ 'array_syntax' => ['syntax' => 'short'],
+ 'class_attributes_separation' => true,
+ 'declare_strict_types' => true,
+ 'dir_constant' => true,
+ 'is_null' => true,
+ 'no_homoglyph_names' => true,
+ 'no_null_property_initialization' => true,
+ 'no_php4_constructor' => true,
+ 'no_unused_imports' => true,
+ 'no_useless_else' => true,
+ 'non_printable_character' => true,
+ 'ordered_imports' => true,
+ 'ordered_class_elements' => true,
+ 'php_unit_construct' => true,
+ 'pow_to_exponentiation' => true,
+ 'psr_autoloading' => true,
+ 'random_api_migration' => true,
+ 'return_assignment' => true,
+ 'self_accessor' => true,
+ 'semicolon_after_instruction' => true,
+ 'short_scalar_cast' => true,
+ 'simplified_null_return' => true,
+ 'single_blank_line_before_namespace' => true,
+ 'single_class_element_per_statement' => true,
+ 'single_line_comment_style' => true,
+ 'single_quote' => true,
+ 'space_after_semicolon' => true,
+ 'standardize_not_equals' => true,
+ 'strict_param' => true,
+ 'ternary_operator_spaces' => true,
+ 'trailing_comma_in_multiline' => true,
+ 'trim_array_spaces' => true,
+ 'unary_operator_spaces' => true,
+ 'global_namespace_import' => [
+ 'import_classes' => true,
+ 'import_functions' => true,
+ 'import_constants' => true,
+ ],
+ ])
+ ->setFinder($finder)
+ ->setRiskyAllowed(true);
diff --git a/public/vendor/maennchen/zipstream-php/.phpdoc/template/base.html.twig b/public/vendor/maennchen/zipstream-php/.phpdoc/template/base.html.twig
new file mode 100644
index 0000000..b7507fb
--- /dev/null
+++ b/public/vendor/maennchen/zipstream-php/.phpdoc/template/base.html.twig
@@ -0,0 +1,15 @@
+{% extends 'layout.html.twig' %}
+
+{% set topMenu = {
+ "menu": [
+ { "name": "Guides", "url": "https://maennchen.dev/ZipStream-PHP/guide/index.html"},
+ { "name": "API", "url": "https://maennchen.dev/ZipStream-PHP/classes/ZipStream-ZipStream.html"},
+ { "name": "Issues", "url": "https://github.com/maennchen/ZipStream-PHP/issues"},
+ ],
+ "social": [
+ { "iconClass": "fab fa-github", "url": "https://github.com/maennchen/ZipStream-PHP"},
+ { "iconClass": "fas fa-envelope-open-text", "url": "https://github.com/maennchen/ZipStream-PHP/discussions"},
+ { "iconClass": "fas fa-money-bill", "url": "https://opencollective.com/zipstream"},
+ ]
+}
+%}
\ No newline at end of file
diff --git a/public/vendor/maennchen/zipstream-php/.tool-versions b/public/vendor/maennchen/zipstream-php/.tool-versions
new file mode 100644
index 0000000..2618178
--- /dev/null
+++ b/public/vendor/maennchen/zipstream-php/.tool-versions
@@ -0,0 +1 @@
+php 8.2.5
diff --git a/public/vendor/maennchen/zipstream-php/LICENSE b/public/vendor/maennchen/zipstream-php/LICENSE
new file mode 100644
index 0000000..ebe7fe2
--- /dev/null
+++ b/public/vendor/maennchen/zipstream-php/LICENSE
@@ -0,0 +1,24 @@
+MIT License
+
+Copyright (C) 2007-2009 Paul Duncan
+Copyright (C) 2014 Jonatan Männchen
+Copyright (C) 2014 Jesse G. Donat
+Copyright (C) 2018 Nicolas CARPi
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/public/vendor/maennchen/zipstream-php/README.md b/public/vendor/maennchen/zipstream-php/README.md
new file mode 100644
index 0000000..8ebb2c3
--- /dev/null
+++ b/public/vendor/maennchen/zipstream-php/README.md
@@ -0,0 +1,183 @@
+# ZipStream-PHP
+
+[](https://github.com/maennchen/ZipStream-PHP/actions/workflows/branch_main.yml)
+[](https://coveralls.io/github/maennchen/ZipStream-PHP?branch=main)
+[](https://packagist.org/packages/maennchen/zipstream-php)
+[](https://packagist.org/packages/maennchen/zipstream-php)
+[](https://opencollective.com/zipstream) [](LICENSE)
+
+## Unstable Branch
+
+The `main` branch is not stable. Please see the
+[releases](https://github.com/maennchen/ZipStream-PHP/releases) for a stable
+version.
+
+## Overview
+
+A fast and simple streaming zip file downloader for PHP. Using this library will
+save you from having to write the Zip to disk. You can directly send it to the
+user, which is much faster. It can work with S3 buckets or any PSR7 Stream.
+
+Please see the [LICENSE](LICENSE) file for licensing and warranty information.
+
+## Installation
+
+Simply add a dependency on maennchen/zipstream-php to your project's
+`composer.json` file if you use Composer to manage the dependencies of your
+project. Use following command to add the package to your project's dependencies:
+
+```bash
+composer require maennchen/zipstream-php
+```
+
+## Usage
+
+For detailed instructions, please check the
+[Documentation](https://maennchen.github.io/ZipStream-PHP/).
+
+```php
+// Autoload the dependencies
+require 'vendor/autoload.php';
+
+// create a new zipstream object
+$zip = new ZipStream\ZipStream(
+ outputName: 'example.zip',
+
+ // enable output of HTTP headers
+ sendHttpHeaders: true,
+);
+
+// create a file named 'hello.txt'
+$zip->addFile(
+ fileName: 'hello.txt',
+ data: 'This is the contents of hello.txt',
+);
+
+// add a file named 'some_image.jpg' from a local file 'path/to/image.jpg'
+$zip->addFileFromPath(
+ fileName: 'some_image.jpg',
+ path: 'path/to/image.jpg',
+);
+
+// finish the zip stream
+$zip->finish();
+```
+
+## Upgrade to version 3.0.0
+
+### General
+
+- Minimum PHP Version: `8.1`
+- Only 64bit Architecture is supported.
+- The class `ZipStream\Option\Method` has been replaced with the enum
+ `ZipStream\CompressionMethod`.
+- Most clases have been flagged as `@internal` and should not be used from the
+ outside.
+ If you're using internal resources to extend this library, please open an
+ issue so that a clean interface can be added & published.
+ The externally available classes & enums are:
+ - `ZipStream\CompressionMethod`
+ - `ZipStream\Exception*`
+ - `ZipStream\ZipStream`
+
+### Archive Options
+
+- The class `ZipStream\Option\Archive` has been replaced in favor of named
+ arguments in the `ZipStream\ZipStream` constuctor.
+- The archive options `largeFileSize` & `largeFileMethod` has been removed. If
+ you want different `compressionMethods` based on the file size, you'll have to
+ implement this yourself.
+- The archive option `httpHeaderCallback` changed the type from `callable` to
+ `Closure`.
+- The archive option `zeroHeader` has been replaced with the option
+ `defaultEnableZeroHeader` and can be overridden for every file. Its default
+ value changed from `false` to `true`.
+- The archive option `statFiles` was removed since the library no longer checks
+ filesizes this way.
+- The archive option `deflateLevel` has been replaced with the option
+ `defaultDeflateLevel` and can be overridden for every file.
+- The first argument (`name`) of the `ZipStream\ZipStream` constuctor has been
+ replaced with the named argument `outputName`.
+- Headers are now also sent if the `outputName` is empty. If you do not want to
+ automatically send http headers, set `sendHttpHeaders` to `false`.
+
+### File Options
+
+- The class `ZipStream\Option\File` has been replaced in favor of named
+ arguments in the `ZipStream\ZipStream->addFile*` functions.
+- The file option `method` has been renamed to `compressionMethod`.
+- The file option `time` has been renamed to `lastModificationDateTime`.
+- The file option `size` has been renamed to `maxSize`.
+
+## Upgrade to version 2.0.0
+
+https://github.com/maennchen/ZipStream-PHP/tree/2.0.0#upgrade-to-version-200
+
+## Upgrade to version 1.0.0
+
+https://github.com/maennchen/ZipStream-PHP/tree/2.0.0#upgrade-to-version-100
+
+## Contributing
+
+ZipStream-PHP is a collaborative project. Please take a look at the
+[.github/CONTRIBUTING.md](.github/CONTRIBUTING.md) file.
+
+## Version Support
+
+Versions are supported according to the table below.
+
+Please do not open any pull requests contradicting the current version support
+status.
+
+Careful: Always check the `README` on `main` for up-to-date information.
+
+| Version | New Features | Bugfixes | Security |
+|---------|--------------|----------|----------|
+| *3* | ✓ | ✓ | ✓ |
+| *2* | ✗ | ✓ | ✓ |
+| *1* | ✗ | ✗ | ✓ |
+| *0* | ✗ | ✗ | ✗ |
+
+This library aligns itself with the PHP core support. New features and bugfixes
+will only target PHP versions according to their current status.
+
+See: https://www.php.net/supported-versions.php
+
+## About the Authors
+
+- Paul Duncan - https://pablotron.org/
+- Jonatan Männchen - https://maennchen.dev
+- Jesse G. Donat - https://donatstudios.com
+- Nicolas CARPi - https://www.deltablot.com
+- Nik Barham - https://www.brokencube.co.uk
+
+## Contributors
+
+### Code Contributors
+
+This project exists thanks to all the people who contribute.
+[[Contribute](.github/CONTRIBUTING.md)].
+
+
+### Financial Contributors
+
+Become a financial contributor and help us sustain our community. [[Contribute](https://opencollective.com/zipstream/contribute)]
+
+#### Individuals
+
+
+
+#### Organizations
+
+Support this project with your organization. Your logo will show up here with a link to your website. [[Contribute](https://opencollective.com/zipstream/contribute)]
+
+
+
+
+
+
+
+
+
+
+
diff --git a/public/vendor/maennchen/zipstream-php/composer.json b/public/vendor/maennchen/zipstream-php/composer.json
new file mode 100644
index 0000000..98c536a
--- /dev/null
+++ b/public/vendor/maennchen/zipstream-php/composer.json
@@ -0,0 +1,88 @@
+{
+ "name": "maennchen/zipstream-php",
+ "description": "ZipStream is a library for dynamically streaming dynamic zip files from PHP without writing to the disk at all on the server.",
+ "keywords": ["zip", "stream"],
+ "type": "library",
+ "license": "MIT",
+ "authors": [{
+ "name": "Paul Duncan",
+ "email": "pabs@pablotron.org"
+ },
+ {
+ "name": "Jonatan Männchen",
+ "email": "jonatan@maennchen.ch"
+ },
+ {
+ "name": "Jesse Donat",
+ "email": "donatj@gmail.com"
+ },
+ {
+ "name": "András Kolesár",
+ "email": "kolesar@kolesar.hu"
+ }
+ ],
+ "require": {
+ "php-64bit": "^8.1",
+ "ext-mbstring": "*",
+ "ext-zlib": "*"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^10.0",
+ "guzzlehttp/guzzle": "^7.5",
+ "ext-zip": "*",
+ "mikey179/vfsstream": "^1.6",
+ "php-coveralls/php-coveralls": "^2.5",
+ "friendsofphp/php-cs-fixer": "^3.16",
+ "vimeo/psalm": "^5.0"
+ },
+ "suggest": {
+ "psr/http-message": "^2.0",
+ "guzzlehttp/psr7": "^2.4"
+ },
+ "scripts": {
+ "format": "php-cs-fixer fix",
+ "test": [
+ "@test:unit",
+ "@test:formatted",
+ "@test:lint"
+ ],
+ "test:unit": "phpunit --coverage-clover=coverage.clover.xml --coverage-html cov",
+ "test:unit:slow": "@test:unit --group slow",
+ "test:unit:fast": "@test:unit --exclude-group slow",
+ "test:formatted": "@format --dry-run --stop-on-violation --using-cache=no",
+ "test:lint": "psalm --stats --show-info=true --find-unused-psalm-suppress",
+ "coverage:report": "php-coveralls --coverage_clover=coverage.clover.xml --json_path=coveralls-upload.json --insecure",
+ "install:tools": "phive install --trust-gpg-keys 0x67F861C3D889C656",
+ "docs:generate": "tools/phpdocumentor --sourcecode"
+ },
+ "autoload": {
+ "psr-4": {
+ "ZipStream\\": "src/"
+ }
+ },
+ "autoload-dev": {
+ "psr-4": { "ZipStream\\Test\\": "test/" }
+ },
+ "archive": {
+ "exclude": [
+ "/composer.lock",
+ "/docs",
+ "/.gitattributes",
+ "/.github",
+ "/.gitignore",
+ "/guides",
+ "/.phive",
+ "/.php-cs-fixer.cache",
+ "/.php-cs-fixer.dist.php",
+ "/.phpdoc",
+ "/phpdoc.dist.xml",
+ "/.phpunit.result.cache",
+ "/phpunit.xml.dist",
+ "/psalm.xml",
+ "/test",
+ "/tools",
+ "/.tool-versions",
+ "/vendor"
+ ]
+ }
+}
diff --git a/public/vendor/maennchen/zipstream-php/guides/ContentLength.rst b/public/vendor/maennchen/zipstream-php/guides/ContentLength.rst
new file mode 100644
index 0000000..21fea34
--- /dev/null
+++ b/public/vendor/maennchen/zipstream-php/guides/ContentLength.rst
@@ -0,0 +1,47 @@
+Adding Content-Length header
+=============
+
+Adding a ``Content-Length`` header for ``ZipStream`` can be achieved by
+using the options ``SIMULATION_STRICT`` or ``SIMULATION_LAX`` in the
+``operationMode`` parameter.
+
+In the ``SIMULATION_STRICT`` mode, ``ZipStream`` will not allow to calculate the
+size based on reading the whole file. ``SIMULATION_LAX`` will read the whole
+file if neccessary.
+
+``SIMULATION_STRICT`` is therefore useful to make sure that the size can be
+calculated efficiently.
+
+.. code-block:: php
+ use ZipStream\OperationMode;
+ use ZipStream\ZipStream;
+
+ $zip = new ZipStream(
+ operationMode: OperationMode::SIMULATE_STRICT, // or SIMULATE_LAX
+ defaultEnableZeroHeader: false,
+ sendHttpHeaders: true,
+ outputStream: $stream,
+ );
+
+ // Normally add files
+ $zip->addFile('sample.txt', 'Sample String Data');
+
+ // Use addFileFromCallback and exactSize if you want to defer opening of
+ // the file resource
+ $zip->addFileFromCallback(
+ 'sample.txt',
+ exactSize: 18,
+ callback: function () {
+ return fopen('...');
+ }
+ );
+
+ // Read resulting file size
+ $size = $zip->finish();
+
+ // Tell it to the browser
+ header('Content-Length: '. $size);
+
+ // Execute the Simulation and stream the actual zip to the client
+ $zip->executeSimulation();
+
diff --git a/public/vendor/maennchen/zipstream-php/guides/FlySystem.rst b/public/vendor/maennchen/zipstream-php/guides/FlySystem.rst
new file mode 100644
index 0000000..4e6c6fb
--- /dev/null
+++ b/public/vendor/maennchen/zipstream-php/guides/FlySystem.rst
@@ -0,0 +1,34 @@
+Usage with FlySystem
+===============
+
+For saving or uploading the generated zip, you can use the
+`Flysystem `_ package, and its many
+adapters.
+
+For that you will need to provide another stream than the ``php://output``
+default one, and pass it to Flysystem ``putStream`` method.
+
+.. code-block:: php
+
+ // Open Stream only once for read and write since it's a memory stream and
+ // the content is lost when closing the stream / opening another one
+ $tempStream = fopen('php://memory', 'w+');
+
+ // Create Zip Archive
+ $zipStream = new ZipStream(
+ outputStream: $tempStream,
+ outputName: 'test.zip',
+ );
+ $zipStream->addFile('test.txt', 'text');
+ $zipStream->finish();
+
+ // Store File
+ // (see Flysystem documentation, and all its framework integration)
+ // Can be any adapter (AWS, Google, Ftp, etc.)
+ $adapter = new Local(__DIR__.'/path/to/folder');
+ $filesystem = new Filesystem($adapter);
+
+ $filesystem->writeStream('test.zip', $tempStream)
+
+ // Close Stream
+ fclose($tempStream);
diff --git a/public/vendor/maennchen/zipstream-php/guides/Nginx.rst b/public/vendor/maennchen/zipstream-php/guides/Nginx.rst
new file mode 100644
index 0000000..c53d300
--- /dev/null
+++ b/public/vendor/maennchen/zipstream-php/guides/Nginx.rst
@@ -0,0 +1,16 @@
+Usage with nginx
+=============
+
+If you are using nginx as a webserver, it will try to buffer the response.
+So you'll want to disable this with a custom header:
+
+.. code-block:: php
+ header('X-Accel-Buffering: no');
+ # or with the Response class from Symfony
+ $response->headers->set('X-Accel-Buffering', 'no');
+
+Alternatively, you can tweak the
+`fastcgi cache parameters `_
+within nginx config.
+
+See `original issue `_.
\ No newline at end of file
diff --git a/public/vendor/maennchen/zipstream-php/guides/Options.rst b/public/vendor/maennchen/zipstream-php/guides/Options.rst
new file mode 100644
index 0000000..5e92e94
--- /dev/null
+++ b/public/vendor/maennchen/zipstream-php/guides/Options.rst
@@ -0,0 +1,66 @@
+Available options
+===============
+
+Here is the full list of options available to you. You can also have a look at
+``src/ZipStream.php`` file.
+
+.. code-block:: php
+
+ use ZipStream\ZipStream;
+
+ require_once 'vendor/autoload.php';
+
+ $zip = new ZipStream(
+ // Define output stream
+ // (argument is eiter a resource or implementing
+ // `Psr\Http\Message\StreamInterface`)
+ //
+ // Setup with `psr/http-message` & `guzzlehttp/psr7` dependencies
+ // required when using `Psr\Http\Message\StreamInterface`.
+ outputStream: $filePointer,
+
+ // Set the deflate level (default is 6; use -1 to disable it)
+ defaultDeflateLevel: 6,
+
+ // Add a comment to the zip file
+ comment: 'This is a comment.',
+
+ // Send http headers (default is true)
+ sendHttpHeaders: false,
+
+ // HTTP Content-Disposition.
+ // Defaults to 'attachment', where FILENAME is the specified filename.
+ // Note that this does nothing if you are not sending HTTP headers.
+ contentDisposition: 'attachment',
+
+ // Output Name for HTTP Content-Disposition
+ // Defaults to no name
+ outputName: "example.zip",
+
+ // HTTP Content-Type.
+ // Defaults to 'application/x-zip'.
+ // Note that this does nothing if you are not sending HTTP headers.
+ contentType: 'application/x-zip',
+
+ // Set the function called for setting headers.
+ // Default is the `header()` of PHP
+ httpHeaderCallback: header(...),
+
+ // Enable streaming files with single read where general purpose bit 3
+ // indicates local file header contain zero values in crc and size
+ // fields, these appear only after file contents in data descriptor
+ // block.
+ // Set to true if your input stream is remote
+ // (used with addFileFromStream()).
+ // Default is false.
+ defaultEnableZeroHeader: false,
+
+ // Enable zip64 extension, allowing very large archives
+ // (> 4Gb or file count > 64k)
+ // Default is true
+ enableZip64: true,
+
+ // Flush output buffer after every write
+ // Default is false
+ flushOutput: true,
+ );
diff --git a/public/vendor/maennchen/zipstream-php/guides/PSR7Streams.rst b/public/vendor/maennchen/zipstream-php/guides/PSR7Streams.rst
new file mode 100644
index 0000000..22af71d
--- /dev/null
+++ b/public/vendor/maennchen/zipstream-php/guides/PSR7Streams.rst
@@ -0,0 +1,21 @@
+Usage with PSR 7 Streams
+===============
+
+PSR-7 streams are `standardized streams `_.
+
+ZipStream-PHP supports working with these streams with the function
+``addFileFromPsr7Stream``.
+
+For all parameters of the function see the API documentation.
+
+Example
+---------------
+
+.. code-block:: php
+
+ $stream = $response->getBody();
+ // add a file named 'streamfile.txt' from the content of the stream
+ $zip->addFileFromPsr7Stream(
+ fileName: 'streamfile.txt',
+ stream: $stream,
+ );
diff --git a/public/vendor/maennchen/zipstream-php/guides/StreamOutput.rst b/public/vendor/maennchen/zipstream-php/guides/StreamOutput.rst
new file mode 100644
index 0000000..9f3165b
--- /dev/null
+++ b/public/vendor/maennchen/zipstream-php/guides/StreamOutput.rst
@@ -0,0 +1,39 @@
+Stream Output
+===============
+
+Stream to S3 Bucket
+---------------
+
+.. code-block:: php
+
+ use Aws\S3\S3Client;
+ use Aws\Credentials\CredentialProvider;
+ use ZipStream\ZipStream;
+
+ $bucket = 'your bucket name';
+ $client = new S3Client([
+ 'region' => 'your region',
+ 'version' => 'latest',
+ 'bucketName' => $bucket,
+ 'credentials' => CredentialProvider::defaultProvider(),
+ ]);
+ $client->registerStreamWrapper();
+
+ $zipFile = fopen("s3://$bucket/example.zip", 'w');
+
+ $zip = new ZipStream(
+ enableZip64: false,
+ outputStream: $zipFile,
+ );
+
+ $zip->addFile(
+ fileName: 'file1.txt',
+ data: 'File1 data',
+ );
+ $zip->addFile(
+ fileName: 'file2.txt',
+ data: 'File2 data',
+ );
+ $zip->finish();
+
+ fclose($zipFile);
diff --git a/public/vendor/maennchen/zipstream-php/guides/Symfony.rst b/public/vendor/maennchen/zipstream-php/guides/Symfony.rst
new file mode 100644
index 0000000..902552c
--- /dev/null
+++ b/public/vendor/maennchen/zipstream-php/guides/Symfony.rst
@@ -0,0 +1,130 @@
+Usage with Symfony
+===============
+
+Overview for using ZipStream in Symfony
+--------
+
+Using ZipStream in Symfony requires use of Symfony's ``StreamedResponse`` when
+used in controller actions.
+
+Wrap your call to the relevant ``ZipStream`` stream method (i.e. ``addFile``,
+``addFileFromPath``, ``addFileFromStream``) in Symfony's ``StreamedResponse``
+function passing in any required arguments for your use case.
+
+Using Symfony's ``StreamedResponse`` will allow Symfony to stream output from
+ZipStream correctly to users' browsers and avoid a corrupted final zip landing
+on the users' end.
+
+Example for using ``ZipStream`` in a controller action to zip stream files
+stored in an AWS S3 bucket by key:
+
+.. code-block:: php
+
+ use Symfony\Component\HttpFoundation\StreamedResponse;
+ use Aws\S3\S3Client;
+ use ZipStream;
+
+ //...
+
+ /**
+ * @Route("/zipstream", name="zipstream")
+ */
+ public function zipStreamAction()
+ {
+ // sample test file on s3
+ $s3keys = array(
+ "ziptestfolder/file1.txt"
+ );
+
+ $s3Client = $this->get('app.amazon.s3'); //s3client service
+ $s3Client->registerStreamWrapper(); //required
+
+ // using StreamedResponse to wrap ZipStream functionality
+ // for files on AWS s3.
+ $response = new StreamedResponse(function() use($s3keys, $s3Client)
+ {
+ // Define suitable options for ZipStream Archive.
+ // this is needed to prevent issues with truncated zip files
+ //initialise zipstream with output zip filename and options.
+ $zip = new ZipStream\ZipStream(
+ outputName: 'test.zip',
+ defaultEnableZeroHeader: true,
+ contentType: 'application/octet-stream',
+ );
+
+ //loop keys - useful for multiple files
+ foreach ($s3keys as $key) {
+ // Get the file name in S3 key so we can save it to the zip
+ //file using the same name.
+ $fileName = basename($key);
+
+ // concatenate s3path.
+ // replace with your bucket name or get from parameters file.
+ $bucket = 'bucketname';
+ $s3path = "s3://" . $bucket . "/" . $key;
+
+ //addFileFromStream
+ if ($streamRead = fopen($s3path, 'r')) {
+ $zip->addFileFromStream(
+ fileName: $fileName,
+ stream: $streamRead,
+ );
+ } else {
+ die('Could not open stream for reading');
+ }
+ }
+
+ $zip->finish();
+
+ });
+
+ return $response;
+ }
+
+In the above example, files on AWS S3 are being streamed from S3 to the Symfon
+application via ``fopen`` call when the s3Client has ``registerStreamWrapper``
+applied. This stream is then passed to ``ZipStream`` via the
+``addFileFromStream`` function, which ZipStream then streams as a zip to the
+client browser via Symfony's ``StreamedResponse``. No Zip is created server
+side, which makes this approach a more efficient solution for streaming zips to
+the client browser especially for larger files.
+
+For the above use case you will need to have installed
+`aws/aws-sdk-php-symfony `_ to
+support accessing S3 objects in your Symfony web application. This is not
+required for locally stored files on you server you intend to stream via
+``ZipStream``.
+
+See official Symfony documentation for details on
+`Symfony's StreamedResponse `_
+``Symfony\Component\HttpFoundation\StreamedResponse``.
+
+Note from `S3 documentation `_:
+
+ Streams opened in "r" mode only allow data to be read from the stream, and
+ are not seekable by default. This is so that data can be downloaded from
+ Amazon S3 in a truly streaming manner, where previously read bytes do not
+ need to be buffered into memory. If you need a stream to be seekable, you
+ can pass seekable into the stream context options of a function.
+
+Make sure to configure your S3 context correctly!
+
+Uploading a file
+--------
+
+You need to add correct permissions
+(see `#120 `_)
+
+**example code**
+
+
+.. code-block:: php
+
+ $path = "s3://{$adapter->getBucket()}/{$this->getArchivePath()}";
+
+ // the important bit
+ $outputContext = stream_context_create([
+ 's3' => ['ACL' => 'public-read'],
+ ]);
+
+ fopen($path, 'w', null, $outputContext);
diff --git a/public/vendor/maennchen/zipstream-php/guides/Varnish.rst b/public/vendor/maennchen/zipstream-php/guides/Varnish.rst
new file mode 100644
index 0000000..952d287
--- /dev/null
+++ b/public/vendor/maennchen/zipstream-php/guides/Varnish.rst
@@ -0,0 +1,22 @@
+Usage with Varnish
+=============
+
+Serving a big zip with varnish in between can cause random stream close.
+This can be solved by adding attached code to the vcl file.
+
+To avoid the problem, add the following to your varnish config file:
+
+.. code-block::
+ sub vcl_recv {
+ # Varnish can’t intercept the discussion anymore
+ # helps for streaming big zips
+ if (req.url ~ "\.(tar|gz|zip|7z|exe)$") {
+ return (pipe);
+ }
+ }
+ # Varnish can’t intercept the discussion anymore
+ # helps for streaming big zips
+ sub vcl_pipe {
+ set bereq.http.connection = "close";
+ return (pipe);
+ }
diff --git a/public/vendor/maennchen/zipstream-php/guides/index.rst b/public/vendor/maennchen/zipstream-php/guides/index.rst
new file mode 100644
index 0000000..4583ca5
--- /dev/null
+++ b/public/vendor/maennchen/zipstream-php/guides/index.rst
@@ -0,0 +1,126 @@
+ZipStream PHP
+=============
+
+A fast and simple streaming zip file downloader for PHP. Using this library will
+save you from having to write the Zip to disk. You can directly send it to the
+user, which is much faster. It can work with S3 buckets or any PSR7 Stream.
+
+.. toctree::
+
+ index
+ Symfony
+ Options
+ StreamOutput
+ FlySystem
+ PSR7Streams
+ Nginx
+ Varnish
+ ContentLength
+
+Installation
+---------------
+
+Simply add a dependency on ``maennchen/zipstream-php`` to your project's
+``composer.json`` file if you use Composer to manage the dependencies of your
+project. Use following command to add the package to your project's
+dependencies:
+
+.. code-block:: sh
+ composer require maennchen/zipstream-php
+
+If you want to use``addFileFromPsr7Stream```
+(``Psr\Http\Message\StreamInterface``) or use a stream instead of a
+``resource`` as ``outputStream``, the following dependencies must be installed
+as well:
+
+.. code-block:: sh
+ composer require psr/http-message guzzlehttp/psr7
+
+If ``composer install`` yields the following error, your installation is missing
+the `mbstring extension `_,
+either `install it `_
+or run the follwoing command:
+
+.. code-block::
+ Your requirements could not be resolved to an installable set of packages.
+
+ Problem 1
+ - Root composer.json requires PHP extension ext-mbstring * but it is
+ missing from your system. Install or enable PHP's mbstrings extension.
+
+.. code-block:: sh
+ composer require symfony/polyfill-mbstring
+
+Usage Intro
+---------------
+
+Here's a simple example:
+
+.. code-block:: php
+
+ // Autoload the dependencies
+ require 'vendor/autoload.php';
+
+ // create a new zipstream object
+ $zip = new ZipStream\ZipStream(
+ outputName: 'example.zip',
+
+ // enable output of HTTP headers
+ sendHttpHeaders: true,
+ );
+
+ // create a file named 'hello.txt'
+ $zip->addFile(
+ fileName: 'hello.txt',
+ data: 'This is the contents of hello.txt',
+ );
+
+ // add a file named 'some_image.jpg' from a local file 'path/to/image.jpg'
+ $zip->addFileFromPath(
+ fileName: 'some_image.jpg',
+ path: 'path/to/image.jpg',
+ );
+
+ // add a file named 'goodbye.txt' from an open stream resource
+ $filePointer = tmpfile();
+ fwrite($filePointer, 'The quick brown fox jumped over the lazy dog.');
+ rewind($filePointer);
+ $zip->addFileFromStream(
+ fileName: 'goodbye.txt',
+ stream: $filePointer,
+ );
+ fclose($filePointer);
+
+ // add a file named 'streamfile.txt' from the body of a `guzzle` response
+ // Setup with `psr/http-message` & `guzzlehttp/psr7` dependencies required.
+ $zip->addFileFromPsr7Stream(
+ fileName: 'streamfile.txt',
+ stream: $response->getBody(),
+ );
+
+ // finish the zip stream
+ $zip->finish();
+
+You can also add comments, modify file timestamps, and customize (or
+disable) the HTTP headers. It is also possible to specify the storage method
+when adding files, the current default storage method is ``DEFLATE``
+i.e files are stored with Compression mode 0x08.
+
+Known Issues
+---------------
+
+The native Mac OS archive extraction tool prior to macOS 10.15 might not open
+archives in some conditions. A workaround is to disable the Zip64 feature with
+the option ``enableZip64: false``. This limits the archive to 4 Gb and 64k files
+but will allow users on macOS 10.14 and below to open them without issue.
+See `#116 `_.
+
+The linux ``unzip`` utility might not handle properly unicode characters.
+It is recommended to extract with another tool like
+`7-zip `_.
+See `#146 `_.
+
+It is the responsability of the client code to make sure that files are not
+saved with the same path, as it is not possible for the library to figure it out
+while streaming a zip.
+See `#154 `_.
diff --git a/public/vendor/maennchen/zipstream-php/phpdoc.dist.xml b/public/vendor/maennchen/zipstream-php/phpdoc.dist.xml
new file mode 100644
index 0000000..b98fe1c
--- /dev/null
+++ b/public/vendor/maennchen/zipstream-php/phpdoc.dist.xml
@@ -0,0 +1,39 @@
+
+
+ 💾 ZipStream-PHP
+
+ docs
+
+
+ latest
+
+
+ src
+
+ api
+
+ tests/**/*
+ vendor/**/*
+
+
+ php
+
+ public
+ ZipStream
+ true
+
+
+
+ guides
+
+ guide
+
+
+
+
+
\ No newline at end of file
diff --git a/public/vendor/maennchen/zipstream-php/phpunit.xml.dist b/public/vendor/maennchen/zipstream-php/phpunit.xml.dist
new file mode 100644
index 0000000..1b02a3a
--- /dev/null
+++ b/public/vendor/maennchen/zipstream-php/phpunit.xml.dist
@@ -0,0 +1,15 @@
+
+
+
+
+
+ test
+
+
+
+
+
+ src
+
+
+
diff --git a/public/vendor/maennchen/zipstream-php/psalm.xml b/public/vendor/maennchen/zipstream-php/psalm.xml
new file mode 100644
index 0000000..5d050d1
--- /dev/null
+++ b/public/vendor/maennchen/zipstream-php/psalm.xml
@@ -0,0 +1,23 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/public/vendor/maennchen/zipstream-php/src/CentralDirectoryFileHeader.php b/public/vendor/maennchen/zipstream-php/src/CentralDirectoryFileHeader.php
new file mode 100644
index 0000000..ffcfc6e
--- /dev/null
+++ b/public/vendor/maennchen/zipstream-php/src/CentralDirectoryFileHeader.php
@@ -0,0 +1,52 @@
+value),
+ new PackField(format: 'V', value: Time::dateTimeToDosTime($lastModificationDateTime)),
+ new PackField(format: 'V', value: $crc32),
+ new PackField(format: 'V', value: $compressedSize),
+ new PackField(format: 'V', value: $uncompressedSize),
+ new PackField(format: 'v', value: strlen($fileName)),
+ new PackField(format: 'v', value: strlen($extraField)),
+ new PackField(format: 'v', value: strlen($fileComment)),
+ new PackField(format: 'v', value: $diskNumberStart),
+ new PackField(format: 'v', value: $internalFileAttributes),
+ new PackField(format: 'V', value: $externalFileAttributes),
+ new PackField(format: 'V', value: $relativeOffsetOfLocalHeader),
+ ) . $fileName . $extraField . $fileComment;
+ }
+}
diff --git a/public/vendor/maennchen/zipstream-php/src/CompressionMethod.php b/public/vendor/maennchen/zipstream-php/src/CompressionMethod.php
new file mode 100644
index 0000000..51e4363
--- /dev/null
+++ b/public/vendor/maennchen/zipstream-php/src/CompressionMethod.php
@@ -0,0 +1,106 @@
+format(DateTimeInterface::ATOM) . " can't be represented as DOS time / date.");
+ }
+}
diff --git a/public/vendor/maennchen/zipstream-php/src/Exception/FileNotFoundException.php b/public/vendor/maennchen/zipstream-php/src/Exception/FileNotFoundException.php
new file mode 100644
index 0000000..350a7bf
--- /dev/null
+++ b/public/vendor/maennchen/zipstream-php/src/Exception/FileNotFoundException.php
@@ -0,0 +1,22 @@
+resource = $resource;
+ parent::__construct('Function ' . $function . 'failed on resource.');
+ }
+}
diff --git a/public/vendor/maennchen/zipstream-php/src/Exception/SimulationFileUnknownException.php b/public/vendor/maennchen/zipstream-php/src/Exception/SimulationFileUnknownException.php
new file mode 100644
index 0000000..717c1aa
--- /dev/null
+++ b/public/vendor/maennchen/zipstream-php/src/Exception/SimulationFileUnknownException.php
@@ -0,0 +1,19 @@
+fileName = self::filterFilename($fileName);
+ $this->checkEncoding();
+
+ if ($this->enableZeroHeader) {
+ $this->generalPurposeBitFlag |= GeneralPurposeBitFlag::ZERO_HEADER;
+ }
+
+ $this->version = $this->compressionMethod === CompressionMethod::DEFLATE ? Version::DEFLATE : Version::STORE;
+ }
+
+ public function cloneSimulationExecution(): self
+ {
+ return new self(
+ $this->fileName,
+ $this->dataCallback,
+ OperationMode::NORMAL,
+ $this->startOffset,
+ $this->compressionMethod,
+ $this->comment,
+ $this->lastModificationDateTime,
+ $this->deflateLevel,
+ $this->maxSize,
+ $this->exactSize,
+ $this->enableZip64,
+ $this->enableZeroHeader,
+ $this->send,
+ $this->recordSentBytes,
+ );
+ }
+
+ public function process(): string
+ {
+ $forecastSize = $this->forecastSize();
+
+ if ($this->enableZeroHeader) {
+ // No calculation required
+ } elseif ($this->isSimulation() && $forecastSize) {
+ $this->uncompressedSize = $forecastSize;
+ $this->compressedSize = $forecastSize;
+ } else {
+ $this->readStream(send: false);
+ if (rewind($this->unpackStream()) === false) {
+ throw new ResourceActionException('rewind', $this->unpackStream());
+ }
+ }
+
+ $this->addFileHeader();
+
+ $detectedSize = $forecastSize ?? $this->compressedSize;
+
+ if (
+ $this->isSimulation() &&
+ $detectedSize > 0
+ ) {
+ ($this->recordSentBytes)($detectedSize);
+ } else {
+ $this->readStream(send: true);
+ }
+
+ $this->addFileFooter();
+ return $this->getCdrFile();
+ }
+
+ /**
+ * @return resource
+ */
+ private function unpackStream()
+ {
+ if ($this->stream) {
+ return $this->stream;
+ }
+
+ if ($this->operationMode === OperationMode::SIMULATE_STRICT) {
+ throw new SimulationFileUnknownException();
+ }
+
+ $this->stream = ($this->dataCallback)();
+
+ if (!$this->enableZeroHeader && !stream_get_meta_data($this->stream)['seekable']) {
+ throw new StreamNotSeekableException();
+ }
+ if (!(
+ str_contains(stream_get_meta_data($this->stream)['mode'], 'r')
+ || str_contains(stream_get_meta_data($this->stream)['mode'], 'w+')
+ || str_contains(stream_get_meta_data($this->stream)['mode'], 'a+')
+ || str_contains(stream_get_meta_data($this->stream)['mode'], 'x+')
+ || str_contains(stream_get_meta_data($this->stream)['mode'], 'c+')
+ )) {
+ throw new StreamNotReadableException();
+ }
+
+ return $this->stream;
+ }
+
+ private function forecastSize(): ?int
+ {
+ if ($this->compressionMethod !== CompressionMethod::STORE) {
+ return null;
+ }
+ if ($this->exactSize) {
+ return $this->exactSize;
+ }
+ $fstat = fstat($this->unpackStream());
+ if (!$fstat || !array_key_exists('size', $fstat) || $fstat['size'] < 1) {
+ return null;
+ }
+
+ if ($this->maxSize !== null && $this->maxSize < $fstat['size']) {
+ return $this->maxSize;
+ }
+
+ return $fstat['size'];
+ }
+
+ /**
+ * Create and send zip header for this file.
+ */
+ private function addFileHeader(): void
+ {
+ $forceEnableZip64 = $this->enableZeroHeader && $this->enableZip64;
+
+ $footer = $this->buildZip64ExtraBlock($forceEnableZip64);
+
+ $zip64Enabled = $footer !== '';
+
+ if($zip64Enabled) {
+ $this->version = Version::ZIP64;
+ }
+
+ if ($this->generalPurposeBitFlag & GeneralPurposeBitFlag::EFS) {
+ // Put the tricky entry to
+ // force Linux unzip to lookup EFS flag.
+ $footer .= Zs\ExtendedInformationExtraField::generate();
+ }
+
+ $data = LocalFileHeader::generate(
+ versionNeededToExtract: $this->version->value,
+ generalPurposeBitFlag: $this->generalPurposeBitFlag,
+ compressionMethod: $this->compressionMethod,
+ lastModificationDateTime: $this->lastModificationDateTime,
+ crc32UncompressedData: $this->crc,
+ compressedSize: $zip64Enabled
+ ? 0xFFFFFFFF
+ : $this->compressedSize,
+ uncompressedSize: $zip64Enabled
+ ? 0xFFFFFFFF
+ : $this->uncompressedSize,
+ fileName: $this->fileName,
+ extraField: $footer,
+ );
+
+
+ ($this->send)($data);
+ }
+
+ /**
+ * Strip characters that are not legal in Windows filenames
+ * to prevent compatibility issues
+ */
+ private static function filterFilename(
+ /**
+ * Unprocessed filename
+ */
+ string $fileName
+ ): string {
+ // strip leading slashes from file name
+ // (fixes bug in windows archive viewer)
+ $fileName = ltrim($fileName, '/');
+
+ return str_replace(['\\', ':', '*', '?', '"', '<', '>', '|'], '_', $fileName);
+ }
+
+ private function checkEncoding(): void
+ {
+ // Sets Bit 11: Language encoding flag (EFS). If this bit is set,
+ // the filename and comment fields for this file
+ // MUST be encoded using UTF-8. (see APPENDIX D)
+ if (mb_check_encoding($this->fileName, 'UTF-8') &&
+ mb_check_encoding($this->comment, 'UTF-8')) {
+ $this->generalPurposeBitFlag |= GeneralPurposeBitFlag::EFS;
+ }
+ }
+
+ private function buildZip64ExtraBlock(bool $force = false): string
+ {
+ $outputZip64ExtraBlock = false;
+
+ $originalSize = null;
+ if ($force || $this->uncompressedSize > 0xFFFFFFFF) {
+ $outputZip64ExtraBlock = true;
+ $originalSize = $this->uncompressedSize;
+ }
+
+ $compressedSize = null;
+ if ($force || $this->compressedSize > 0xFFFFFFFF) {
+ $outputZip64ExtraBlock = true;
+ $compressedSize = $this->compressedSize;
+ }
+
+ // If this file will start over 4GB limit in ZIP file,
+ // CDR record will have to use Zip64 extension to describe offset
+ // to keep consistency we use the same value here
+ $relativeHeaderOffset = null;
+ if ($this->startOffset > 0xFFFFFFFF) {
+ $outputZip64ExtraBlock = true;
+ $relativeHeaderOffset = $this->startOffset;
+ }
+
+ if (!$outputZip64ExtraBlock) {
+ return '';
+ }
+
+ if (!$this->enableZip64) {
+ throw new OverflowException();
+ }
+
+ return Zip64\ExtendedInformationExtraField::generate(
+ originalSize: $originalSize,
+ compressedSize: $compressedSize,
+ relativeHeaderOffset: $relativeHeaderOffset,
+ diskStartNumber: null,
+ );
+ }
+
+ private function addFileFooter(): void
+ {
+ if (($this->compressedSize > 0xFFFFFFFF || $this->uncompressedSize > 0xFFFFFFFF) && $this->version !== Version::ZIP64) {
+ throw new OverflowException();
+ }
+
+ if (!$this->enableZeroHeader) {
+ return;
+ }
+
+ if ($this->version === Version::ZIP64) {
+ $footer = Zip64\DataDescriptor::generate(
+ crc32UncompressedData: $this->crc,
+ compressedSize: $this->compressedSize,
+ uncompressedSize: $this->uncompressedSize,
+ );
+ } else {
+ $footer = DataDescriptor::generate(
+ crc32UncompressedData: $this->crc,
+ compressedSize: $this->compressedSize,
+ uncompressedSize: $this->uncompressedSize,
+ );
+ }
+
+ ($this->send)($footer);
+ }
+
+ private function readStream(bool $send): void
+ {
+ $this->compressedSize = 0;
+ $this->uncompressedSize = 0;
+ $hash = hash_init('crc32b');
+
+ $deflate = $this->compressionInit();
+
+ while (
+ !feof($this->unpackStream()) &&
+ ($this->maxSize === null || $this->uncompressedSize < $this->maxSize) &&
+ ($this->exactSize === null || $this->uncompressedSize < $this->exactSize)
+ ) {
+ $readLength = min(
+ ($this->maxSize ?? PHP_INT_MAX) - $this->uncompressedSize,
+ ($this->exactSize ?? PHP_INT_MAX) - $this->uncompressedSize,
+ self::CHUNKED_READ_BLOCK_SIZE
+ );
+
+ $data = fread($this->unpackStream(), $readLength);
+
+ hash_update($hash, $data);
+
+ $this->uncompressedSize += strlen($data);
+
+ if ($deflate) {
+ $data = deflate_add(
+ $deflate,
+ $data,
+ feof($this->unpackStream()) ? ZLIB_FINISH : ZLIB_NO_FLUSH
+ );
+ }
+
+ $this->compressedSize += strlen($data);
+
+ if ($send) {
+ ($this->send)($data);
+ }
+ }
+
+ if ($this->exactSize && $this->uncompressedSize !== $this->exactSize) {
+ throw new FileSizeIncorrectException(expectedSize: $this->exactSize, actualSize: $this->uncompressedSize);
+ }
+
+ $this->crc = hexdec(hash_final($hash));
+ }
+
+ private function compressionInit(): ?DeflateContext
+ {
+ switch($this->compressionMethod) {
+ case CompressionMethod::STORE:
+ // Noting to do
+ return null;
+ case CompressionMethod::DEFLATE:
+ $deflateContext = deflate_init(
+ ZLIB_ENCODING_RAW,
+ ['level' => $this->deflateLevel]
+ );
+
+ if (!$deflateContext) {
+ // @codeCoverageIgnoreStart
+ throw new RuntimeException("Can't initialize deflate context.");
+ // @codeCoverageIgnoreEnd
+ }
+
+ // False positive, resource is no longer returned from this function
+ return $deflateContext;
+ default:
+ // @codeCoverageIgnoreStart
+ throw new RuntimeException('Unsupported Compression Method ' . print_r($this->compressionMethod, true));
+ // @codeCoverageIgnoreEnd
+ }
+ }
+
+ private function getCdrFile(): string
+ {
+ $footer = $this->buildZip64ExtraBlock();
+
+ return CentralDirectoryFileHeader::generate(
+ versionMadeBy: ZipStream::ZIP_VERSION_MADE_BY,
+ versionNeededToExtract:$this->version->value,
+ generalPurposeBitFlag: $this->generalPurposeBitFlag,
+ compressionMethod: $this->compressionMethod,
+ lastModificationDateTime: $this->lastModificationDateTime,
+ crc32: $this->crc,
+ compressedSize: $this->compressedSize > 0xFFFFFFFF
+ ? 0xFFFFFFFF
+ : $this->compressedSize,
+ uncompressedSize: $this->uncompressedSize > 0xFFFFFFFF
+ ? 0xFFFFFFFF
+ : $this->uncompressedSize,
+ fileName: $this->fileName,
+ extraField: $footer,
+ fileComment: $this->comment,
+ diskNumberStart: 0,
+ internalFileAttributes: 0,
+ externalFileAttributes: 32,
+ relativeOffsetOfLocalHeader: $this->startOffset > 0xFFFFFFFF
+ ? 0xFFFFFFFF
+ : $this->startOffset,
+ );
+ }
+
+ private function isSimulation(): bool
+ {
+ return $this->operationMode === OperationMode::SIMULATE_LAX || $this->operationMode === OperationMode::SIMULATE_STRICT;
+ }
+}
diff --git a/public/vendor/maennchen/zipstream-php/src/GeneralPurposeBitFlag.php b/public/vendor/maennchen/zipstream-php/src/GeneralPurposeBitFlag.php
new file mode 100644
index 0000000..23a66d8
--- /dev/null
+++ b/public/vendor/maennchen/zipstream-php/src/GeneralPurposeBitFlag.php
@@ -0,0 +1,89 @@
+value),
+ new PackField(format: 'V', value: Time::dateTimeToDosTime($lastModificationDateTime)),
+ new PackField(format: 'V', value: $crc32UncompressedData),
+ new PackField(format: 'V', value: $compressedSize),
+ new PackField(format: 'V', value: $uncompressedSize),
+ new PackField(format: 'v', value: strlen($fileName)),
+ new PackField(format: 'v', value: strlen($extraField)),
+ ) . $fileName . $extraField;
+ }
+}
diff --git a/public/vendor/maennchen/zipstream-php/src/OperationMode.php b/public/vendor/maennchen/zipstream-php/src/OperationMode.php
new file mode 100644
index 0000000..dd650f0
--- /dev/null
+++ b/public/vendor/maennchen/zipstream-php/src/OperationMode.php
@@ -0,0 +1,35 @@
+format;
+ }, '');
+
+ $args = array_map(function (self $field) {
+ switch($field->format) {
+ case 'V':
+ if ($field->value > self::MAX_V) {
+ throw new RuntimeException(print_r($field->value, true) . ' is larger than 32 bits');
+ }
+ break;
+ case 'v':
+ if ($field->value > self::MAX_v) {
+ throw new RuntimeException(print_r($field->value, true) . ' is larger than 16 bits');
+ }
+ break;
+ case 'P': break;
+ default:
+ break;
+ }
+
+ return $field->value;
+ }, $fields);
+
+ return pack($fmt, ...$args);
+ }
+}
diff --git a/public/vendor/maennchen/zipstream-php/src/Time.php b/public/vendor/maennchen/zipstream-php/src/Time.php
new file mode 100644
index 0000000..4bfba3c
--- /dev/null
+++ b/public/vendor/maennchen/zipstream-php/src/Time.php
@@ -0,0 +1,45 @@
+getTimestamp() < $dosMinimumDate->getTimestamp()) {
+ throw new DosTimeOverflowException(dateTime: $dateTime);
+ }
+
+ $dateTime = DateTimeImmutable::createFromInterface($dateTime)->sub(new DateInterval('P1980Y'));
+
+ ['year' => $year,
+ 'mon' => $month,
+ 'mday' => $day,
+ 'hours' => $hour,
+ 'minutes' => $minute,
+ 'seconds' => $second
+ ] = getdate($dateTime->getTimestamp());
+
+ return
+ ($year << 25) |
+ ($month << 21) |
+ ($day << 16) |
+ ($hour << 11) |
+ ($minute << 5) |
+ ($second >> 1);
+ }
+}
diff --git a/public/vendor/maennchen/zipstream-php/src/Version.php b/public/vendor/maennchen/zipstream-php/src/Version.php
new file mode 100644
index 0000000..c014f8a
--- /dev/null
+++ b/public/vendor/maennchen/zipstream-php/src/Version.php
@@ -0,0 +1,12 @@
+addFile(fileName: 'world.txt', data: 'Hello World');
+ *
+ * // add second file
+ * $zip->addFile(fileName: 'moon.txt', data: 'Hello Moon');
+ * ```
+ *
+ * 3. Finish the zip stream:
+ *
+ * ```php
+ * $zip->finish();
+ * ```
+ *
+ * You can also add an archive comment, add comments to individual files,
+ * and adjust the timestamp of files. See the API documentation for each
+ * method below for additional information.
+ *
+ * ## Example
+ *
+ * ```php
+ * // create a new zip stream object
+ * $zip = new ZipStream(outputName: 'some_files.zip');
+ *
+ * // list of local files
+ * $files = array('foo.txt', 'bar.jpg');
+ *
+ * // read and add each file to the archive
+ * foreach ($files as $path)
+ * $zip->addFileFormPath(fileName: $path, $path);
+ *
+ * // write archive footer to stream
+ * $zip->finish();
+ * ```
+ */
+class ZipStream
+{
+ /**
+ * This number corresponds to the ZIP version/OS used (2 bytes)
+ * From: https://www.iana.org/assignments/media-types/application/zip
+ * The upper byte (leftmost one) indicates the host system (OS) for the
+ * file. Software can use this information to determine
+ * the line record format for text files etc. The current
+ * mappings are:
+ *
+ * 0 - MS-DOS and OS/2 (F.A.T. file systems)
+ * 1 - Amiga 2 - VAX/VMS
+ * 3 - *nix 4 - VM/CMS
+ * 5 - Atari ST 6 - OS/2 H.P.F.S.
+ * 7 - Macintosh 8 - Z-System
+ * 9 - CP/M 10 thru 255 - unused
+ *
+ * The lower byte (rightmost one) indicates the version number of the
+ * software used to encode the file. The value/10
+ * indicates the major version number, and the value
+ * mod 10 is the minor version number.
+ * Here we are using 6 for the OS, indicating OS/2 H.P.F.S.
+ * to prevent file permissions issues upon extract (see #84)
+ * 0x603 is 00000110 00000011 in binary, so 6 and 3
+ *
+ * @internal
+ */
+ public const ZIP_VERSION_MADE_BY = 0x603;
+
+ private bool $ready = true;
+
+ private int $offset = 0;
+
+ /**
+ * @var string[]
+ */
+ private array $centralDirectoryRecords = [];
+
+ /**
+ * @var resource
+ */
+ private $outputStream;
+
+ private readonly Closure $httpHeaderCallback;
+
+ /**
+ * @var File[]
+ */
+ private array $recordedSimulation = [];
+
+ /**
+ * Create a new ZipStream object.
+ *
+ * ##### Examples
+ *
+ * ```php
+ * // create a new zip file named 'foo.zip'
+ * $zip = new ZipStream(outputName: 'foo.zip');
+ *
+ * // create a new zip file named 'bar.zip' with a comment
+ * $zip = new ZipStream(
+ * outputName: 'bar.zip',
+ * comment: 'this is a comment for the zip file.',
+ * );
+ * ```
+ *
+ * @param OperationMode $operationMode
+ * The mode can be used to switch between `NORMAL` and `SIMULATION_*` modes.
+ * For details see the `OperationMode` documentation.
+ *
+ * Default to `NORMAL`.
+ *
+ * @param string $comment
+ * Archive Level Comment
+ *
+ * @param StreamInterface|resource|null $outputStream
+ * Override the output of the archive to a different target.
+ *
+ * By default the archive is sent to `STDOUT`.
+ *
+ * @param CompressionMethod $defaultCompressionMethod
+ * How to handle file compression. Legal values are
+ * `CompressionMethod::DEFLATE` (the default), or
+ * `CompressionMethod::STORE`. `STORE` sends the file raw and is
+ * significantly faster, while `DEFLATE` compresses the file and
+ * is much, much slower.
+ *
+ * @param int $defaultDeflateLevel
+ * Default deflation level. Only relevant if `compressionMethod`
+ * is `DEFLATE`.
+ *
+ * See details of [`deflate_init`](https://www.php.net/manual/en/function.deflate-init.php#refsect1-function.deflate-init-parameters)
+ *
+ * @param bool $enableZip64
+ * Enable Zip64 extension, supporting very large
+ * archives (any size > 4 GB or file count > 64k)
+ *
+ * @param bool $defaultEnableZeroHeader
+ * Enable streaming files with single read.
+ *
+ * When the zero header is set, the file is streamed into the output
+ * and the size & checksum are added at the end of the file. This is the
+ * fastest method and uses the least memory. Unfortunately not all
+ * ZIP clients fully support this and can lead to clients reporting
+ * the generated ZIP files as corrupted in combination with other
+ * circumstances. (Zip64 enabled, using UTF8 in comments / names etc.)
+ *
+ * When the zero header is not set, the length & checksum need to be
+ * defined before the file is actually added. To prevent loading all
+ * the data into memory, the data has to be read twice. If the data
+ * which is added is not seekable, this call will fail.
+ *
+ * @param bool $sendHttpHeaders
+ * Boolean indicating whether or not to send
+ * the HTTP headers for this file.
+ *
+ * @param ?Closure $httpHeaderCallback
+ * The method called to send HTTP headers
+ *
+ * @param string|null $outputName
+ * The name of the created archive.
+ *
+ * Only relevant if `$sendHttpHeaders = true`.
+ *
+ * @param string $contentDisposition
+ * HTTP Content-Disposition
+ *
+ * Only relevant if `sendHttpHeaders = true`.
+ *
+ * @param string $contentType
+ * HTTP Content Type
+ *
+ * Only relevant if `sendHttpHeaders = true`.
+ *
+ * @param bool $flushOutput
+ * Enable flush after every write to output stream.
+ *
+ * @return self
+ */
+ public function __construct(
+ private OperationMode $operationMode = OperationMode::NORMAL,
+ private readonly string $comment = '',
+ $outputStream = null,
+ private readonly CompressionMethod $defaultCompressionMethod = CompressionMethod::DEFLATE,
+ private readonly int $defaultDeflateLevel = 6,
+ private readonly bool $enableZip64 = true,
+ private readonly bool $defaultEnableZeroHeader = true,
+ private bool $sendHttpHeaders = true,
+ ?Closure $httpHeaderCallback = null,
+ private readonly ?string $outputName = null,
+ private readonly string $contentDisposition = 'attachment',
+ private readonly string $contentType = 'application/x-zip',
+ private bool $flushOutput = false,
+ ) {
+ $this->outputStream = self::normalizeStream($outputStream);
+ $this->httpHeaderCallback = $httpHeaderCallback ?? header(...);
+ }
+
+ /**
+ * Add a file to the archive.
+ *
+ * ##### File Options
+ *
+ * See {@see addFileFromPsr7Stream()}
+ *
+ * ##### Examples
+ *
+ * ```php
+ * // add a file named 'world.txt'
+ * $zip->addFile(fileName: 'world.txt', data: 'Hello World!');
+ *
+ * // add a file named 'bar.jpg' with a comment and a last-modified
+ * // time of two hours ago
+ * $zip->addFile(
+ * fileName: 'bar.jpg',
+ * data: $data,
+ * comment: 'this is a comment about bar.jpg',
+ * lastModificationDateTime: new DateTime('2 hours ago'),
+ * );
+ * ```
+ *
+ * @param string $data
+ *
+ * contents of file
+ */
+ public function addFile(
+ string $fileName,
+ string $data,
+ string $comment = '',
+ ?CompressionMethod $compressionMethod = null,
+ ?int $deflateLevel = null,
+ ?DateTimeInterface $lastModificationDateTime = null,
+ ?int $maxSize = null,
+ ?int $exactSize = null,
+ ?bool $enableZeroHeader = null,
+ ): void {
+ $this->addFileFromCallback(
+ fileName: $fileName,
+ callback: fn () => $data,
+ comment: $comment,
+ compressionMethod: $compressionMethod,
+ deflateLevel: $deflateLevel,
+ lastModificationDateTime: $lastModificationDateTime,
+ maxSize: $maxSize,
+ exactSize: $exactSize,
+ enableZeroHeader: $enableZeroHeader,
+ );
+ }
+
+ /**
+ * Add a file at path to the archive.
+ *
+ * ##### File Options
+ *
+ * See {@see addFileFromPsr7Stream()}
+ *
+ * ###### Examples
+ *
+ * ```php
+ * // add a file named 'foo.txt' from the local file '/tmp/foo.txt'
+ * $zip->addFileFromPath(
+ * fileName: 'foo.txt',
+ * path: '/tmp/foo.txt',
+ * );
+ *
+ * // add a file named 'bigfile.rar' from the local file
+ * // '/usr/share/bigfile.rar' with a comment and a last-modified
+ * // time of two hours ago
+ * $zip->addFile(
+ * fileName: 'bigfile.rar',
+ * path: '/usr/share/bigfile.rar',
+ * comment: 'this is a comment about bigfile.rar',
+ * lastModificationDateTime: new DateTime('2 hours ago'),
+ * );
+ * ```
+ *
+ * @throws \ZipStream\Exception\FileNotFoundException
+ * @throws \ZipStream\Exception\FileNotReadableException
+ */
+ public function addFileFromPath(
+ /**
+ * name of file in archive (including directory path).
+ */
+ string $fileName,
+
+ /**
+ * path to file on disk (note: paths should be encoded using
+ * UNIX-style forward slashes -- e.g '/path/to/some/file').
+ */
+ string $path,
+ string $comment = '',
+ ?CompressionMethod $compressionMethod = null,
+ ?int $deflateLevel = null,
+ ?DateTimeInterface $lastModificationDateTime = null,
+ ?int $maxSize = null,
+ ?int $exactSize = null,
+ ?bool $enableZeroHeader = null,
+ ): void {
+ if (!is_readable($path)) {
+ if (!file_exists($path)) {
+ throw new FileNotFoundException($path);
+ }
+ throw new FileNotReadableException($path);
+ }
+
+ if ($fileTime = filemtime($path)) {
+ $lastModificationDateTime ??= (new DateTimeImmutable())->setTimestamp($fileTime);
+ }
+
+ $this->addFileFromCallback(
+ fileName: $fileName,
+ callback: function () use ($path) {
+
+ $stream = fopen($path, 'rb');
+
+ if (!$stream) {
+ // @codeCoverageIgnoreStart
+ throw new ResourceActionException('fopen');
+ // @codeCoverageIgnoreEnd
+ }
+
+ return $stream;
+ },
+ comment: $comment,
+ compressionMethod: $compressionMethod,
+ deflateLevel: $deflateLevel,
+ lastModificationDateTime: $lastModificationDateTime,
+ maxSize: $maxSize,
+ exactSize: $exactSize,
+ enableZeroHeader: $enableZeroHeader,
+ );
+ }
+
+ /**
+ * Add an open stream (resource) to the archive.
+ *
+ * ##### File Options
+ *
+ * See {@see addFileFromPsr7Stream()}
+ *
+ * ##### Examples
+ *
+ * ```php
+ * // create a temporary file stream and write text to it
+ * $filePointer = tmpfile();
+ * fwrite($filePointer, 'The quick brown fox jumped over the lazy dog.');
+ *
+ * // add a file named 'streamfile.txt' from the content of the stream
+ * $archive->addFileFromStream(
+ * fileName: 'streamfile.txt',
+ * stream: $filePointer,
+ * );
+ * ```
+ *
+ * @param resource $stream contents of file as a stream resource
+ */
+ public function addFileFromStream(
+ string $fileName,
+ $stream,
+ string $comment = '',
+ ?CompressionMethod $compressionMethod = null,
+ ?int $deflateLevel = null,
+ ?DateTimeInterface $lastModificationDateTime = null,
+ ?int $maxSize = null,
+ ?int $exactSize = null,
+ ?bool $enableZeroHeader = null,
+ ): void {
+ $this->addFileFromCallback(
+ fileName: $fileName,
+ callback: fn () => $stream,
+ comment: $comment,
+ compressionMethod: $compressionMethod,
+ deflateLevel: $deflateLevel,
+ lastModificationDateTime: $lastModificationDateTime,
+ maxSize: $maxSize,
+ exactSize: $exactSize,
+ enableZeroHeader: $enableZeroHeader,
+ );
+ }
+
+ /**
+ * Add an open stream to the archive.
+ *
+ * ##### Examples
+ *
+ * ```php
+ * $stream = $response->getBody();
+ * // add a file named 'streamfile.txt' from the content of the stream
+ * $archive->addFileFromPsr7Stream(
+ * fileName: 'streamfile.txt',
+ * stream: $stream,
+ * );
+ * ```
+ *
+ * @param string $fileName
+ * path of file in archive (including directory)
+ *
+ * @param StreamInterface $stream
+ * contents of file as a stream resource
+ *
+ * @param string $comment
+ * ZIP comment for this file
+ *
+ * @param ?CompressionMethod $compressionMethod
+ * Override `defaultCompressionMethod`
+ *
+ * See {@see __construct()}
+ *
+ * @param ?int $deflateLevel
+ * Override `defaultDeflateLevel`
+ *
+ * See {@see __construct()}
+ *
+ * @param ?DateTimeInterface $lastModificationDateTime
+ * Set last modification time of file.
+ *
+ * Default: `now`
+ *
+ * @param ?int $maxSize
+ * Only read `maxSize` bytes from file.
+ *
+ * The file is considered done when either reaching `EOF`
+ * or the `maxSize`.
+ *
+ * @param ?int $exactSize
+ * Read exactly `exactSize` bytes from file.
+ * If `EOF` is reached before reading `exactSize` bytes, an error will be
+ * thrown. The parameter allows for faster size calculations if the `stream`
+ * does not support `fstat` size or is slow and otherwise known beforehand.
+ *
+ * @param ?bool $enableZeroHeader
+ * Override `defaultEnableZeroHeader`
+ *
+ * See {@see __construct()}
+ */
+ public function addFileFromPsr7Stream(
+ string $fileName,
+ StreamInterface $stream,
+ string $comment = '',
+ ?CompressionMethod $compressionMethod = null,
+ ?int $deflateLevel = null,
+ ?DateTimeInterface $lastModificationDateTime = null,
+ ?int $maxSize = null,
+ ?int $exactSize = null,
+ ?bool $enableZeroHeader = null,
+ ): void {
+ $this->addFileFromCallback(
+ fileName: $fileName,
+ callback: fn () => $stream,
+ comment: $comment,
+ compressionMethod: $compressionMethod,
+ deflateLevel: $deflateLevel,
+ lastModificationDateTime: $lastModificationDateTime,
+ maxSize: $maxSize,
+ exactSize: $exactSize,
+ enableZeroHeader: $enableZeroHeader,
+ );
+ }
+
+ /**
+ * Add a file based on a callback.
+ *
+ * This is useful when you want to simulate a lot of files without keeping
+ * all of the file handles open at the same time.
+ *
+ * ##### Examples
+ *
+ * ```php
+ * foreach($files as $name => $size) {
+ * $archive->addFileFromPsr7Stream(
+ * fileName: 'streamfile.txt',
+ * exactSize: $size,
+ * callback: function() use($name): Psr\Http\Message\StreamInterface {
+ * $response = download($name);
+ * return $response->getBody();
+ * }
+ * );
+ * }
+ * ```
+ *
+ * @param string $fileName
+ * path of file in archive (including directory)
+ *
+ * @param Closure $callback
+ * @psalm-param Closure(): (resource|StreamInterface|string) $callback
+ * A callback to get the file contents in the shape of a PHP stream,
+ * a Psr StreamInterface implementation, or a string.
+ *
+ * @param string $comment
+ * ZIP comment for this file
+ *
+ * @param ?CompressionMethod $compressionMethod
+ * Override `defaultCompressionMethod`
+ *
+ * See {@see __construct()}
+ *
+ * @param ?int $deflateLevel
+ * Override `defaultDeflateLevel`
+ *
+ * See {@see __construct()}
+ *
+ * @param ?DateTimeInterface $lastModificationDateTime
+ * Set last modification time of file.
+ *
+ * Default: `now`
+ *
+ * @param ?int $maxSize
+ * Only read `maxSize` bytes from file.
+ *
+ * The file is considered done when either reaching `EOF`
+ * or the `maxSize`.
+ *
+ * @param ?int $exactSize
+ * Read exactly `exactSize` bytes from file.
+ * If `EOF` is reached before reading `exactSize` bytes, an error will be
+ * thrown. The parameter allows for faster size calculations if the `stream`
+ * does not support `fstat` size or is slow and otherwise known beforehand.
+ *
+ * @param ?bool $enableZeroHeader
+ * Override `defaultEnableZeroHeader`
+ *
+ * See {@see __construct()}
+ */
+ public function addFileFromCallback(
+ string $fileName,
+ Closure $callback,
+ string $comment = '',
+ ?CompressionMethod $compressionMethod = null,
+ ?int $deflateLevel = null,
+ ?DateTimeInterface $lastModificationDateTime = null,
+ ?int $maxSize = null,
+ ?int $exactSize = null,
+ ?bool $enableZeroHeader = null,
+ ): void {
+ $file = new File(
+ dataCallback: function () use ($callback, $maxSize) {
+ $data = $callback();
+
+ if(is_resource($data)) {
+ return $data;
+ }
+
+ if($data instanceof StreamInterface) {
+ return StreamWrapper::getResource($data);
+ }
+
+
+ $stream = fopen('php://memory', 'rw+');
+ if ($stream === false) {
+ // @codeCoverageIgnoreStart
+ throw new ResourceActionException('fopen');
+ // @codeCoverageIgnoreEnd
+ }
+ if ($maxSize !== null && fwrite($stream, $data, $maxSize) === false) {
+ // @codeCoverageIgnoreStart
+ throw new ResourceActionException('fwrite', $stream);
+ // @codeCoverageIgnoreEnd
+ } elseif (fwrite($stream, $data) === false) {
+ // @codeCoverageIgnoreStart
+ throw new ResourceActionException('fwrite', $stream);
+ // @codeCoverageIgnoreEnd
+ }
+ if (rewind($stream) === false) {
+ // @codeCoverageIgnoreStart
+ throw new ResourceActionException('rewind', $stream);
+ // @codeCoverageIgnoreEnd
+ }
+
+ return $stream;
+
+ },
+ send: $this->send(...),
+ recordSentBytes: $this->recordSentBytes(...),
+ operationMode: $this->operationMode,
+ fileName: $fileName,
+ startOffset: $this->offset,
+ compressionMethod: $compressionMethod ?? $this->defaultCompressionMethod,
+ comment: $comment,
+ deflateLevel: $deflateLevel ?? $this->defaultDeflateLevel,
+ lastModificationDateTime: $lastModificationDateTime ?? new DateTimeImmutable(),
+ maxSize: $maxSize,
+ exactSize: $exactSize,
+ enableZip64: $this->enableZip64,
+ enableZeroHeader: $enableZeroHeader ?? $this->defaultEnableZeroHeader,
+ );
+
+ if($this->operationMode !== OperationMode::NORMAL) {
+ $this->recordedSimulation[] = $file;
+ }
+
+ $this->centralDirectoryRecords[] = $file->process();
+ }
+
+ /**
+ * Add a directory to the archive.
+ *
+ * ##### File Options
+ *
+ * See {@see addFileFromPsr7Stream()}
+ *
+ * ##### Examples
+ *
+ * ```php
+ * // add a directory named 'world/'
+ * $zip->addFile(fileName: 'world/');
+ * ```
+ */
+ public function addDirectory(
+ string $fileName,
+ string $comment = '',
+ ?DateTimeInterface $lastModificationDateTime = null,
+ ): void {
+ if (!str_ends_with($fileName, '/')) {
+ $fileName .= '/';
+ }
+
+ $this->addFile(
+ fileName: $fileName,
+ data: '',
+ comment: $comment,
+ compressionMethod: CompressionMethod::STORE,
+ deflateLevel: null,
+ lastModificationDateTime: $lastModificationDateTime,
+ maxSize: 0,
+ exactSize: 0,
+ enableZeroHeader: false,
+ );
+ }
+
+ /**
+ * Executes a previously calculated simulation.
+ *
+ * ##### Example
+ *
+ * ```php
+ * $zip = new ZipStream(
+ * outputName: 'foo.zip',
+ * operationMode: OperationMode::SIMULATE_STRICT,
+ * );
+ *
+ * $zip->addFile('test.txt', 'Hello World');
+ *
+ * $size = $zip->finish();
+ *
+ * header('Content-Length: '. $size);
+ *
+ * $zip->executeSimulation();
+ * ```
+ */
+ public function executeSimulation(): void
+ {
+ if($this->operationMode !== OperationMode::NORMAL) {
+ throw new RuntimeException('Zip simulation is not finished.');
+ }
+
+ foreach($this->recordedSimulation as $file) {
+ $this->centralDirectoryRecords[] = $file->cloneSimulationExecution()->process();
+ }
+
+ $this->finish();
+ }
+
+ /**
+ * Write zip footer to stream.
+ *
+ * The clase is left in an unusable state after `finish`.
+ *
+ * ##### Example
+ *
+ * ```php
+ * // write footer to stream
+ * $zip->finish();
+ * ```
+ */
+ public function finish(): int
+ {
+ $centralDirectoryStartOffsetOnDisk = $this->offset;
+ $sizeOfCentralDirectory = 0;
+
+ // add trailing cdr file records
+ foreach ($this->centralDirectoryRecords as $centralDirectoryRecord) {
+ $this->send($centralDirectoryRecord);
+ $sizeOfCentralDirectory += strlen($centralDirectoryRecord);
+ }
+
+ // Add 64bit headers (if applicable)
+ if (count($this->centralDirectoryRecords) >= 0xFFFF ||
+ $centralDirectoryStartOffsetOnDisk > 0xFFFFFFFF ||
+ $sizeOfCentralDirectory > 0xFFFFFFFF) {
+ if (!$this->enableZip64) {
+ throw new OverflowException();
+ }
+
+ $this->send(Zip64\EndOfCentralDirectory::generate(
+ versionMadeBy: self::ZIP_VERSION_MADE_BY,
+ versionNeededToExtract: Version::ZIP64->value,
+ numberOfThisDisk: 0,
+ numberOfTheDiskWithCentralDirectoryStart: 0,
+ numberOfCentralDirectoryEntriesOnThisDisk: count($this->centralDirectoryRecords),
+ numberOfCentralDirectoryEntries: count($this->centralDirectoryRecords),
+ sizeOfCentralDirectory: $sizeOfCentralDirectory,
+ centralDirectoryStartOffsetOnDisk: $centralDirectoryStartOffsetOnDisk,
+ extensibleDataSector: '',
+ ));
+
+ $this->send(Zip64\EndOfCentralDirectoryLocator::generate(
+ numberOfTheDiskWithZip64CentralDirectoryStart: 0x00,
+ zip64centralDirectoryStartOffsetOnDisk: $centralDirectoryStartOffsetOnDisk + $sizeOfCentralDirectory,
+ totalNumberOfDisks: 1,
+ ));
+ }
+
+ // add trailing cdr eof record
+ $numberOfCentralDirectoryEntries = min(count($this->centralDirectoryRecords), 0xFFFF);
+ $this->send(EndOfCentralDirectory::generate(
+ numberOfThisDisk: 0x00,
+ numberOfTheDiskWithCentralDirectoryStart: 0x00,
+ numberOfCentralDirectoryEntriesOnThisDisk: $numberOfCentralDirectoryEntries,
+ numberOfCentralDirectoryEntries: $numberOfCentralDirectoryEntries,
+ sizeOfCentralDirectory: min($sizeOfCentralDirectory, 0xFFFFFFFF),
+ centralDirectoryStartOffsetOnDisk: min($centralDirectoryStartOffsetOnDisk, 0xFFFFFFFF),
+ zipFileComment: $this->comment,
+ ));
+
+ $size = $this->offset;
+
+ // The End
+ $this->clear();
+
+ return $size;
+ }
+
+ /**
+ * @param StreamInterface|resource|null $outputStream
+ * @return resource
+ */
+ private static function normalizeStream($outputStream)
+ {
+ if ($outputStream instanceof StreamInterface) {
+ return StreamWrapper::getResource($outputStream);
+ }
+ if (is_resource($outputStream)) {
+ return $outputStream;
+ }
+ return fopen('php://output', 'wb');
+ }
+
+ /**
+ * Record sent bytes
+ */
+ private function recordSentBytes(int $sentBytes): void
+ {
+ $this->offset += $sentBytes;
+ }
+
+ /**
+ * Send string, sending HTTP headers if necessary.
+ * Flush output after write if configure option is set.
+ */
+ private function send(string $data): void
+ {
+ if (!$this->ready) {
+ throw new RuntimeException('Archive is already finished');
+ }
+
+ if ($this->operationMode === OperationMode::NORMAL && $this->sendHttpHeaders) {
+ $this->sendHttpHeaders();
+ $this->sendHttpHeaders = false;
+ }
+
+ $this->recordSentBytes(strlen($data));
+
+ if ($this->operationMode === OperationMode::NORMAL) {
+ if (fwrite($this->outputStream, $data) === false) {
+ throw new ResourceActionException('fwrite', $this->outputStream);
+ }
+
+ if ($this->flushOutput) {
+ // flush output buffer if it is on and flushable
+ $status = ob_get_status();
+ if (isset($status['flags']) && is_int($status['flags']) && ($status['flags'] & PHP_OUTPUT_HANDLER_FLUSHABLE)) {
+ ob_flush();
+ }
+
+ // Flush system buffers after flushing userspace output buffer
+ flush();
+ }
+ }
+ }
+
+ /**
+ * Send HTTP headers for this stream.
+ */
+ private function sendHttpHeaders(): void
+ {
+ // grab content disposition
+ $disposition = $this->contentDisposition;
+
+ if ($this->outputName) {
+ // Various different browsers dislike various characters here. Strip them all for safety.
+ $safeOutput = trim(str_replace(['"', "'", '\\', ';', "\n", "\r"], '', $this->outputName));
+
+ // Check if we need to UTF-8 encode the filename
+ $urlencoded = rawurlencode($safeOutput);
+ $disposition .= "; filename*=UTF-8''{$urlencoded}";
+ }
+
+ $headers = [
+ 'Content-Type' => $this->contentType,
+ 'Content-Disposition' => $disposition,
+ 'Pragma' => 'public',
+ 'Cache-Control' => 'public, must-revalidate',
+ 'Content-Transfer-Encoding' => 'binary',
+ ];
+
+ foreach ($headers as $key => $val) {
+ ($this->httpHeaderCallback)("$key: $val");
+ }
+ }
+
+ /**
+ * Clear all internal variables. Note that the stream object is not
+ * usable after this.
+ */
+ private function clear(): void
+ {
+ $this->centralDirectoryRecords = [];
+ $this->offset = 0;
+
+ if($this->operationMode === OperationMode::NORMAL) {
+ $this->ready = false;
+ $this->recordedSimulation = [];
+ } else {
+ $this->operationMode = OperationMode::NORMAL;
+ }
+ }
+}
diff --git a/public/vendor/maennchen/zipstream-php/src/Zs/ExtendedInformationExtraField.php b/public/vendor/maennchen/zipstream-php/src/Zs/ExtendedInformationExtraField.php
new file mode 100644
index 0000000..bf621bc
--- /dev/null
+++ b/public/vendor/maennchen/zipstream-php/src/Zs/ExtendedInformationExtraField.php
@@ -0,0 +1,23 @@
+fail("File {$filePath} must contain {$needle}");
+ }
+
+ protected function assertFileDoesNotContain(string $filePath, string $needle): void
+ {
+ $last = '';
+
+ $handle = fopen($filePath, 'r');
+ while (!feof($handle)) {
+ $line = fgets($handle, 1024);
+
+ if(str_contains($last . $line, $needle)) {
+ fclose($handle);
+
+ $this->fail("File {$filePath} must not contain {$needle}");
+ }
+
+ $last = $line;
+ }
+
+ fclose($handle);
+ }
+}
diff --git a/public/vendor/maennchen/zipstream-php/test/CentralDirectoryFileHeaderTest.php b/public/vendor/maennchen/zipstream-php/test/CentralDirectoryFileHeaderTest.php
new file mode 100644
index 0000000..5457b4f
--- /dev/null
+++ b/public/vendor/maennchen/zipstream-php/test/CentralDirectoryFileHeaderTest.php
@@ -0,0 +1,60 @@
+assertSame(
+ bin2hex($header),
+ '504b0102' . // 4 bytes; central file header signature
+ '0306' . // 2 bytes; version made by
+ '2d00' . // 2 bytes; version needed to extract
+ '2222' . // 2 bytes; general purpose bit flag
+ '0800' . // 2 bytes; compression method
+ '2008' . // 2 bytes; last mod file time
+ '2154' . // 2 bytes; last mod file date
+ '11111111' . // 4 bytes; crc-32
+ '77777777' . // 4 bytes; compressed size
+ '99999999' . // 4 bytes; uncompressed size
+ '0800' . // 2 bytes; file name length (n)
+ '0c00' . // 2 bytes; extra field length (m)
+ '0c00' . // 2 bytes; file comment length (o)
+ '0000' . // 2 bytes; disk number start
+ '0000' . // 2 bytes; internal file attributes
+ '20000000' . // 4 bytes; external file attributes
+ '34120000' . // 4 bytes; relative offset of local header
+ '746573742e706e67' . // n bytes; file name
+ '736f6d6520636f6e74656e74' . // m bytes; extra field
+ '736f6d6520636f6d6d656e74' // o bytes; file comment
+ );
+ }
+}
diff --git a/public/vendor/maennchen/zipstream-php/test/DataDescriptorTest.php b/public/vendor/maennchen/zipstream-php/test/DataDescriptorTest.php
new file mode 100644
index 0000000..cc886c7
--- /dev/null
+++ b/public/vendor/maennchen/zipstream-php/test/DataDescriptorTest.php
@@ -0,0 +1,26 @@
+assertSame(
+ bin2hex(DataDescriptor::generate(
+ crc32UncompressedData: 0x11111111,
+ compressedSize: 0x77777777,
+ uncompressedSize: 0x99999999,
+ )),
+ '504b0708' . // 4 bytes; Optional data descriptor signature = 0x08074b50
+ '11111111' . // 4 bytes; CRC-32 of uncompressed data
+ '77777777' . // 4 bytes; Compressed size
+ '99999999' // 4 bytes; Uncompressed size
+ );
+ }
+}
diff --git a/public/vendor/maennchen/zipstream-php/test/EndOfCentralDirectoryTest.php b/public/vendor/maennchen/zipstream-php/test/EndOfCentralDirectoryTest.php
new file mode 100644
index 0000000..be0a907
--- /dev/null
+++ b/public/vendor/maennchen/zipstream-php/test/EndOfCentralDirectoryTest.php
@@ -0,0 +1,35 @@
+assertSame(
+ bin2hex(EndOfCentralDirectory::generate(
+ numberOfThisDisk: 0x00,
+ numberOfTheDiskWithCentralDirectoryStart: 0x00,
+ numberOfCentralDirectoryEntriesOnThisDisk: 0x10,
+ numberOfCentralDirectoryEntries: 0x10,
+ sizeOfCentralDirectory: 0x22,
+ centralDirectoryStartOffsetOnDisk: 0x33,
+ zipFileComment: 'foo',
+ )),
+ '504b0506' . // 4 bytes; end of central dir signature 0x06054b50
+ '0000' . // 2 bytes; number of this disk
+ '0000' . // 2 bytes; number of the disk with the start of the central directory
+ '1000' . // 2 bytes; total number of entries in the central directory on this disk
+ '1000' . // 2 bytes; total number of entries in the central directory
+ '22000000' . // 4 bytes; size of the central directory
+ '33000000' . // 4 bytes; offset of start of central directory with respect to the starting disk number
+ '0300' . // 2 bytes; .ZIP file comment length
+ bin2hex('foo')
+ );
+ }
+}
diff --git a/public/vendor/maennchen/zipstream-php/test/EndlessCycleStream.php b/public/vendor/maennchen/zipstream-php/test/EndlessCycleStream.php
new file mode 100644
index 0000000..4f1cf5c
--- /dev/null
+++ b/public/vendor/maennchen/zipstream-php/test/EndlessCycleStream.php
@@ -0,0 +1,106 @@
+detach();
+ }
+
+ /**
+ * @return null
+ */
+ public function detach()
+ {
+ return;
+ }
+
+ public function getSize(): ?int
+ {
+ return null;
+ }
+
+ public function tell(): int
+ {
+ return $this->offset;
+ }
+
+ public function eof(): bool
+ {
+ return false;
+ }
+
+ public function isSeekable(): bool
+ {
+ return true;
+ }
+
+ public function seek(int $offset, int $whence = SEEK_SET): void
+ {
+ switch($whence) {
+ case SEEK_SET:
+ $this->offset = $offset;
+ break;
+ case SEEK_CUR:
+ $this->offset += $offset;
+ break;
+ case SEEK_END:
+ throw new RuntimeException('Infinite Stream!');
+ break;
+ }
+ }
+
+ public function rewind(): void
+ {
+ $this->seek(0);
+ }
+
+ public function isWritable(): bool
+ {
+ return false;
+ }
+
+ public function write(string $string): int
+ {
+ throw new RuntimeException('Not writeable');
+ }
+
+ public function isReadable(): bool
+ {
+ return true;
+ }
+
+ public function read(int $length): string
+ {
+ $this->offset += $length;
+ return substr(str_repeat($this->toRepeat, (int) ceil($length / strlen($this->toRepeat))), 0, $length);
+ }
+
+ public function getContents(): string
+ {
+ throw new RuntimeException('Infinite Stream!');
+ }
+
+ public function getMetadata(?string $key = null): array|null
+ {
+ return $key !== null ? null : [];
+ }
+}
diff --git a/public/vendor/maennchen/zipstream-php/test/FaultInjectionResource.php b/public/vendor/maennchen/zipstream-php/test/FaultInjectionResource.php
new file mode 100644
index 0000000..3d4440e
--- /dev/null
+++ b/public/vendor/maennchen/zipstream-php/test/FaultInjectionResource.php
@@ -0,0 +1,141 @@
+context);
+
+ if (!isset($options[self::NAME]['injectFaults'])) {
+ return false;
+ }
+
+ $this->mode = $mode;
+ $this->injectFaults = $options[self::NAME]['injectFaults'];
+
+ if ($this->shouldFail(__FUNCTION__)) {
+ return false;
+ }
+
+ return true;
+ }
+
+ public function stream_write(string $data)
+ {
+ if ($this->shouldFail(__FUNCTION__)) {
+ return false;
+ }
+ return true;
+ }
+
+ public function stream_eof()
+ {
+ return true;
+ }
+
+ public function stream_seek(int $offset, int $whence): bool
+ {
+ if ($this->shouldFail(__FUNCTION__)) {
+ return false;
+ }
+
+ return true;
+ }
+
+ public function stream_tell(): int
+ {
+ if ($this->shouldFail(__FUNCTION__)) {
+ return false;
+ }
+
+ return 0;
+ }
+
+ public static function register(): void
+ {
+ if (!in_array(self::NAME, stream_get_wrappers(), true)) {
+ stream_wrapper_register(self::NAME, __CLASS__);
+ }
+ }
+
+ public function stream_stat(): array
+ {
+ static $modeMap = [
+ 'r' => 33060,
+ 'rb' => 33060,
+ 'r+' => 33206,
+ 'w' => 33188,
+ 'wb' => 33188,
+ ];
+
+ return [
+ 'dev' => 0,
+ 'ino' => 0,
+ 'mode' => $modeMap[$this->mode],
+ 'nlink' => 0,
+ 'uid' => 0,
+ 'gid' => 0,
+ 'rdev' => 0,
+ 'size' => 0,
+ 'atime' => 0,
+ 'mtime' => 0,
+ 'ctime' => 0,
+ 'blksize' => 0,
+ 'blocks' => 0,
+ ];
+ }
+
+ public function url_stat(string $path, int $flags): array
+ {
+ return [
+ 'dev' => 0,
+ 'ino' => 0,
+ 'mode' => 0,
+ 'nlink' => 0,
+ 'uid' => 0,
+ 'gid' => 0,
+ 'rdev' => 0,
+ 'size' => 0,
+ 'atime' => 0,
+ 'mtime' => 0,
+ 'ctime' => 0,
+ 'blksize' => 0,
+ 'blocks' => 0,
+ ];
+ }
+
+ private static function createStreamContext(array $injectFaults)
+ {
+ return stream_context_create([
+ self::NAME => ['injectFaults' => $injectFaults],
+ ]);
+ }
+
+ private function shouldFail(string $function): bool
+ {
+ return in_array($function, $this->injectFaults, true);
+ }
+}
diff --git a/public/vendor/maennchen/zipstream-php/test/LocalFileHeaderTest.php b/public/vendor/maennchen/zipstream-php/test/LocalFileHeaderTest.php
new file mode 100644
index 0000000..196dd0f
--- /dev/null
+++ b/public/vendor/maennchen/zipstream-php/test/LocalFileHeaderTest.php
@@ -0,0 +1,47 @@
+assertSame(
+ bin2hex((string) $header),
+ '504b0304' . // 4 bytes; Local file header signature
+ '2d00' . // 2 bytes; Version needed to extract (minimum)
+ '2222' . // 2 bytes; General purpose bit flag
+ '0800' . // 2 bytes; Compression method; e.g. none = 0, DEFLATE = 8
+ '2008' . // 2 bytes; File last modification time
+ '2154' . // 2 bytes; File last modification date
+ '11111111' . // 4 bytes; CRC-32 of uncompressed data
+ '77777777' . // 4 bytes; Compressed size (or 0xffffffff for ZIP64)
+ '99999999' . // 4 bytes; Uncompressed size (or 0xffffffff for ZIP64)
+ '0800' . // 2 bytes; File name length (n)
+ '0c00' . // 2 bytes; Extra field length (m)
+ '746573742e706e67' . // n bytes; File name
+ '736f6d6520636f6e74656e74' // m bytes; Extra field
+ );
+ }
+}
diff --git a/public/vendor/maennchen/zipstream-php/test/PackFieldTest.php b/public/vendor/maennchen/zipstream-php/test/PackFieldTest.php
new file mode 100644
index 0000000..ecd66ba
--- /dev/null
+++ b/public/vendor/maennchen/zipstream-php/test/PackFieldTest.php
@@ -0,0 +1,42 @@
+assertSame(
+ bin2hex(PackField::pack(new PackField(format: 'v', value: 0x1122))),
+ '2211',
+ );
+ }
+
+ public function testOverflow2(): void
+ {
+ $this->expectException(RuntimeException::class);
+
+ PackField::pack(new PackField(format: 'v', value: 0xFFFFF));
+ }
+
+ public function testOverflow4(): void
+ {
+ $this->expectException(RuntimeException::class);
+
+ PackField::pack(new PackField(format: 'V', value: 0xFFFFFFFFF));
+ }
+
+ public function testUnknownOperator(): void
+ {
+ $this->assertSame(
+ bin2hex(PackField::pack(new PackField(format: 'a', value: 0x1122))),
+ '34',
+ );
+ }
+}
diff --git a/public/vendor/maennchen/zipstream-php/test/ResourceStream.php b/public/vendor/maennchen/zipstream-php/test/ResourceStream.php
new file mode 100644
index 0000000..8a41471
--- /dev/null
+++ b/public/vendor/maennchen/zipstream-php/test/ResourceStream.php
@@ -0,0 +1,160 @@
+isSeekable()) {
+ $this->seek(0);
+ }
+ return (string) stream_get_contents($this->stream);
+ }
+
+ public function close(): void
+ {
+ $stream = $this->detach();
+ if ($stream) {
+ fclose($stream);
+ }
+ }
+
+ public function detach()
+ {
+ $result = $this->stream;
+ // According to the interface, the stream is left in an unusable state;
+ /** @psalm-suppress PossiblyNullPropertyAssignmentValue */
+ $this->stream = null;
+ return $result;
+ }
+
+ public function seek(int $offset, int $whence = SEEK_SET): void
+ {
+ if (!$this->isSeekable()) {
+ throw new RuntimeException();
+ }
+ if (fseek($this->stream, $offset, $whence) !== 0) {
+ // @codeCoverageIgnoreStart
+ throw new RuntimeException();
+ // @codeCoverageIgnoreEnd
+ }
+ }
+
+ public function isSeekable(): bool
+ {
+ return (bool)$this->getMetadata('seekable');
+ }
+
+ public function getMetadata(?string $key = null)
+ {
+ $metadata = stream_get_meta_data($this->stream);
+ return $key !== null ? @$metadata[$key] : $metadata;
+ }
+
+ public function getSize(): ?int
+ {
+ $stats = fstat($this->stream);
+ return $stats['size'];
+ }
+
+ public function tell(): int
+ {
+ $position = ftell($this->stream);
+ if ($position === false) {
+ // @codeCoverageIgnoreStart
+ throw new RuntimeException();
+ // @codeCoverageIgnoreEnd
+ }
+ return $position;
+ }
+
+ public function eof(): bool
+ {
+ return feof($this->stream);
+ }
+
+ public function rewind(): void
+ {
+ $this->seek(0);
+ }
+
+ public function write(string $string): int
+ {
+ if (!$this->isWritable()) {
+ throw new RuntimeException();
+ }
+ if (fwrite($this->stream, $string) === false) {
+ // @codeCoverageIgnoreStart
+ throw new RuntimeException();
+ // @codeCoverageIgnoreEnd
+ }
+ return strlen($string);
+ }
+
+ public function isWritable(): bool
+ {
+ $mode = $this->getMetadata('mode');
+ if (!is_string($mode)) {
+ // @codeCoverageIgnoreStart
+ throw new RuntimeException('Could not get stream mode from metadata!');
+ // @codeCoverageIgnoreEnd
+ }
+ return preg_match('/[waxc+]/', $mode) === 1;
+ }
+
+ public function read(int $length): string
+ {
+ if (!$this->isReadable()) {
+ throw new RuntimeException();
+ }
+ $result = fread($this->stream, $length);
+ if ($result === false) {
+ // @codeCoverageIgnoreStart
+ throw new RuntimeException();
+ // @codeCoverageIgnoreEnd
+ }
+ return $result;
+ }
+
+ public function isReadable(): bool
+ {
+ $mode = $this->getMetadata('mode');
+ if (!is_string($mode)) {
+ // @codeCoverageIgnoreStart
+ throw new RuntimeException('Could not get stream mode from metadata!');
+ // @codeCoverageIgnoreEnd
+ }
+ return preg_match('/[r+]/', $mode) === 1;
+ }
+
+ public function getContents(): string
+ {
+ if (!$this->isReadable()) {
+ throw new RuntimeException();
+ }
+ $result = stream_get_contents($this->stream);
+ if ($result === false) {
+ // @codeCoverageIgnoreStart
+ throw new RuntimeException();
+ // @codeCoverageIgnoreEnd
+ }
+ return $result;
+ }
+}
diff --git a/public/vendor/maennchen/zipstream-php/test/TimeTest.php b/public/vendor/maennchen/zipstream-php/test/TimeTest.php
new file mode 100644
index 0000000..25aed27
--- /dev/null
+++ b/public/vendor/maennchen/zipstream-php/test/TimeTest.php
@@ -0,0 +1,35 @@
+assertSame(
+ Time::dateTimeToDosTime(new DateTimeImmutable('2014-11-17T17:46:08Z')),
+ 1165069764
+ );
+
+ // January 1 1980 - DOS Epoch.
+ $this->assertSame(
+ Time::dateTimeToDosTime(new DateTimeImmutable('1980-01-01T00:00:00+00:00')),
+ 2162688
+ );
+ }
+
+ public function testTooEarlyDateToDosTime(): void
+ {
+ $this->expectException(DosTimeOverflowException::class);
+
+ // January 1 1980 is the minimum DOS Epoch.
+ Time::dateTimeToDosTime(new DateTimeImmutable('1970-01-01T00:00:00+00:00'));
+ }
+}
diff --git a/public/vendor/maennchen/zipstream-php/test/Util.php b/public/vendor/maennchen/zipstream-php/test/Util.php
new file mode 100644
index 0000000..4ec743e
--- /dev/null
+++ b/public/vendor/maennchen/zipstream-php/test/Util.php
@@ -0,0 +1,135 @@
+cmdExists('hexdump')) {
+ return '';
+ }
+
+ $output = [];
+
+ if (!exec("hexdump -C \"$path\" | head -n 50", $output)) {
+ return '';
+ }
+
+ return "\nHexdump:\n" . implode("\n", $output);
+ }
+
+ protected function validateAndExtractZip(string $zipPath): string
+ {
+ $tmpDir = $this->getTmpDir();
+
+ $zipArchive = new ZipArchive();
+ $result = $zipArchive->open($zipPath);
+
+ if ($result !== true) {
+ $codeName = $this->zipArchiveOpenErrorCodeName($result);
+ $debugInformation = $this->dumpZipContents($zipPath);
+
+ $this->fail("Failed to open {$zipPath}. Code: $result ($codeName)$debugInformation");
+
+ return $tmpDir;
+ }
+
+ $this->assertSame(0, $zipArchive->status);
+ $this->assertSame(0, $zipArchive->statusSys);
+
+ $zipArchive->extractTo($tmpDir);
+ $zipArchive->close();
+
+ return $tmpDir;
+ }
+
+ protected function zipArchiveOpenErrorCodeName(int $code): string
+ {
+ switch($code) {
+ case ZipArchive::ER_EXISTS: return 'ER_EXISTS';
+ case ZipArchive::ER_INCONS: return 'ER_INCONS';
+ case ZipArchive::ER_INVAL: return 'ER_INVAL';
+ case ZipArchive::ER_MEMORY: return 'ER_MEMORY';
+ case ZipArchive::ER_NOENT: return 'ER_NOENT';
+ case ZipArchive::ER_NOZIP: return 'ER_NOZIP';
+ case ZipArchive::ER_OPEN: return 'ER_OPEN';
+ case ZipArchive::ER_READ: return 'ER_READ';
+ case ZipArchive::ER_SEEK: return 'ER_SEEK';
+ default: return 'unknown';
+ }
+ }
+
+ protected function getTmpDir(): string
+ {
+ $tmp = tempnam(sys_get_temp_dir(), 'zipstreamtest');
+ unlink($tmp);
+ mkdir($tmp) or $this->fail('Failed to make directory');
+
+ return $tmp;
+ }
+
+ /**
+ * @return string[]
+ */
+ protected function getRecursiveFileList(string $path, bool $includeDirectories = false): array
+ {
+ $data = [];
+ $path = (string)realpath($path);
+ $files = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($path));
+
+ $pathLen = strlen($path);
+ foreach ($files as $file) {
+ $filePath = $file->getRealPath();
+
+ if (is_dir($filePath) && !$includeDirectories) {
+ continue;
+ }
+
+ $data[] = substr($filePath, $pathLen + 1);
+ }
+
+ sort($data);
+
+ return $data;
+ }
+}
diff --git a/public/vendor/maennchen/zipstream-php/test/Zip64/DataDescriptorTest.php b/public/vendor/maennchen/zipstream-php/test/Zip64/DataDescriptorTest.php
new file mode 100644
index 0000000..49fb2cc
--- /dev/null
+++ b/public/vendor/maennchen/zipstream-php/test/Zip64/DataDescriptorTest.php
@@ -0,0 +1,28 @@
+assertSame(
+ bin2hex($descriptor),
+ '504b0708' . // 4 bytes; Optional data descriptor signature = 0x08074b50
+ '11111111' . // 4 bytes; CRC-32 of uncompressed data
+ '6666666677777777' . // 8 bytes; Compressed size
+ '8888888899999999' // 8 bytes; Uncompressed size
+ );
+ }
+}
diff --git a/public/vendor/maennchen/zipstream-php/test/Zip64/EndOfCentralDirectoryLocatorTest.php b/public/vendor/maennchen/zipstream-php/test/Zip64/EndOfCentralDirectoryLocatorTest.php
new file mode 100644
index 0000000..271a298
--- /dev/null
+++ b/public/vendor/maennchen/zipstream-php/test/Zip64/EndOfCentralDirectoryLocatorTest.php
@@ -0,0 +1,28 @@
+assertSame(
+ bin2hex($descriptor),
+ '504b0607' . // 4 bytes; zip64 end of central dir locator signature - 0x07064b50
+ '11111111' . // 4 bytes; number of the disk with the start of the zip64 end of central directory
+ '3333333322222222' . // 28 bytes; relative offset of the zip64 end of central directory record
+ '44444444' // 4 bytes;total number of disks
+ );
+ }
+}
diff --git a/public/vendor/maennchen/zipstream-php/test/Zip64/EndOfCentralDirectoryTest.php b/public/vendor/maennchen/zipstream-php/test/Zip64/EndOfCentralDirectoryTest.php
new file mode 100644
index 0000000..b86fb17
--- /dev/null
+++ b/public/vendor/maennchen/zipstream-php/test/Zip64/EndOfCentralDirectoryTest.php
@@ -0,0 +1,41 @@
+assertSame(
+ bin2hex($descriptor),
+ '504b0606' . // 4 bytes;zip64 end of central dir signature - 0x06064b50
+ '2f00000000000000' . // 8 bytes; size of zip64 end of central directory record
+ '3333' . // 2 bytes; version made by
+ '4444' . // 2 bytes; version needed to extract
+ '55555555' . // 4 bytes; number of this disk
+ '66666666' . // 4 bytes; number of the disk with the start of the central directory
+ '8888888877777777' . // 8 bytes; total number of entries in the central directory on this disk
+ 'aaaaaaaa99999999' . // 8 bytes; total number of entries in the central directory
+ 'ccccccccbbbbbbbb' . // 8 bytes; size of the central directory
+ 'eeeeeeeedddddddd' . // 8 bytes; offset of start of central directory with respect to the starting disk number
+ bin2hex('foo')
+ );
+ }
+}
diff --git a/public/vendor/maennchen/zipstream-php/test/Zip64/ExtendedInformationExtraFieldTest.php b/public/vendor/maennchen/zipstream-php/test/Zip64/ExtendedInformationExtraFieldTest.php
new file mode 100644
index 0000000..904783d
--- /dev/null
+++ b/public/vendor/maennchen/zipstream-php/test/Zip64/ExtendedInformationExtraFieldTest.php
@@ -0,0 +1,42 @@
+assertSame(
+ bin2hex($extraField),
+ '0100' . // 2 bytes; Tag for this "extra" block type
+ '1c00' . // 2 bytes; Size of this "extra" block
+ '6666666677777777' . // 8 bytes; Original uncompressed file size
+ '8888888899999999' . // 8 bytes; Size of compressed data
+ '1111111122222222' . // 8 bytes; Offset of local header record
+ '33333333' // 4 bytes; Number of the disk on which this file starts
+ );
+ }
+
+ public function testSerializesEmptyCorrectly(): void
+ {
+ $extraField = ExtendedInformationExtraField::generate();
+
+ $this->assertSame(
+ bin2hex($extraField),
+ '0100' . // 2 bytes; Tag for this "extra" block type
+ '0000' // 2 bytes; Size of this "extra" block
+ );
+ }
+}
diff --git a/public/vendor/maennchen/zipstream-php/test/ZipStreamTest.php b/public/vendor/maennchen/zipstream-php/test/ZipStreamTest.php
new file mode 100644
index 0000000..6e69020
--- /dev/null
+++ b/public/vendor/maennchen/zipstream-php/test/ZipStreamTest.php
@@ -0,0 +1,1284 @@
+getTmpFileStream();
+
+ $zip = new ZipStream(
+ outputStream: $stream,
+ sendHttpHeaders: false,
+ );
+
+ $zip->addFile('sample.txt', 'Sample String Data');
+ $zip->addFile('test/sample.txt', 'More Simple Sample Data');
+
+ $zip->finish();
+ fclose($stream);
+
+ $tmpDir = $this->validateAndExtractZip($tmp);
+
+ $files = $this->getRecursiveFileList($tmpDir);
+ $this->assertSame(['sample.txt', 'test' . DIRECTORY_SEPARATOR . 'sample.txt'], $files);
+
+ $this->assertStringEqualsFile($tmpDir . '/sample.txt', 'Sample String Data');
+ $this->assertStringEqualsFile($tmpDir . '/test/sample.txt', 'More Simple Sample Data');
+ }
+
+ public function testAddFileUtf8NameComment(): void
+ {
+ [$tmp, $stream] = $this->getTmpFileStream();
+
+ $zip = new ZipStream(
+ outputStream: $stream,
+ sendHttpHeaders: false,
+ );
+
+ $name = 'árvíztűrő tükörfúrógép.txt';
+ $content = 'Sample String Data';
+ $comment =
+ 'Filename has every special characters ' .
+ 'from Hungarian language in lowercase. ' .
+ 'In uppercase: ÁÍŰŐÜÖÚÓÉ';
+
+ $zip->addFile(fileName: $name, data: $content, comment: $comment);
+ $zip->finish();
+ fclose($stream);
+
+ $tmpDir = $this->validateAndExtractZip($tmp);
+
+ $files = $this->getRecursiveFileList($tmpDir);
+ $this->assertSame([$name], $files);
+ $this->assertStringEqualsFile($tmpDir . '/' . $name, $content);
+
+ $zipArchive = new ZipArchive();
+ $zipArchive->open($tmp);
+ $this->assertSame($comment, $zipArchive->getCommentName($name));
+ }
+
+ public function testAddFileUtf8NameNonUtfComment(): void
+ {
+ [$tmp, $stream] = $this->getTmpFileStream();
+
+ $zip = new ZipStream(
+ outputStream: $stream,
+ sendHttpHeaders: false,
+ );
+
+ $name = 'á.txt';
+ $content = 'any';
+ $comment = mb_convert_encoding('á', 'ISO-8859-2', 'UTF-8');
+
+ // @see https://libzip.org/documentation/zip_file_get_comment.html
+ //
+ // mb_convert_encoding hasn't CP437.
+ // nearly CP850 (DOS-Latin-1)
+ $guessComment = mb_convert_encoding($comment, 'UTF-8', 'CP850');
+
+ $zip->addFile(fileName: $name, data: $content, comment: $comment);
+
+ $zip->finish();
+ fclose($stream);
+
+ $zipArch = new ZipArchive();
+ $zipArch->open($tmp);
+ $this->assertSame($guessComment, $zipArch->getCommentName($name));
+ $this->assertSame($comment, $zipArch->getCommentName($name, ZipArchive::FL_ENC_RAW));
+ }
+
+ public function testAddFileWithStorageMethod(): void
+ {
+ [$tmp, $stream] = $this->getTmpFileStream();
+
+ $zip = new ZipStream(
+ outputStream: $stream,
+ sendHttpHeaders: false,
+ );
+
+ $zip->addFile(fileName: 'sample.txt', data: 'Sample String Data', compressionMethod: CompressionMethod::STORE);
+ $zip->addFile(fileName: 'test/sample.txt', data: 'More Simple Sample Data');
+ $zip->finish();
+ fclose($stream);
+
+ $zipArchive = new ZipArchive();
+ $zipArchive->open($tmp);
+
+ $sample1 = $zipArchive->statName('sample.txt');
+ $sample12 = $zipArchive->statName('test/sample.txt');
+ $this->assertSame($sample1['comp_method'], CompressionMethod::STORE->value);
+ $this->assertSame($sample12['comp_method'], CompressionMethod::DEFLATE->value);
+
+ $zipArchive->close();
+ }
+
+ public function testAddFileFromPath(): void
+ {
+ [$tmp, $stream] = $this->getTmpFileStream();
+
+ $zip = new ZipStream(
+ outputStream: $stream,
+ sendHttpHeaders: false,
+ );
+
+ [$tmpExample, $streamExample] = $this->getTmpFileStream();
+ fwrite($streamExample, 'Sample String Data');
+ fclose($streamExample);
+ $zip->addFileFromPath(fileName: 'sample.txt', path: $tmpExample);
+
+ [$tmpExample, $streamExample] = $this->getTmpFileStream();
+ fwrite($streamExample, 'More Simple Sample Data');
+ fclose($streamExample);
+ $zip->addFileFromPath(fileName: 'test/sample.txt', path: $tmpExample);
+
+ $zip->finish();
+ fclose($stream);
+
+ $tmpDir = $this->validateAndExtractZip($tmp);
+
+ $files = $this->getRecursiveFileList($tmpDir);
+ $this->assertSame(['sample.txt', 'test' . DIRECTORY_SEPARATOR . 'sample.txt'], $files);
+
+ $this->assertStringEqualsFile($tmpDir . '/sample.txt', 'Sample String Data');
+ $this->assertStringEqualsFile($tmpDir . '/test/sample.txt', 'More Simple Sample Data');
+ }
+
+ public function testAddFileFromPathFileNotFoundException(): void
+ {
+ $this->expectException(FileNotFoundException::class);
+
+ [, $stream] = $this->getTmpFileStream();
+
+ // Get ZipStream Object
+ $zip = new ZipStream(
+ outputStream: $stream,
+ sendHttpHeaders: false,
+ );
+
+ // Trigger error by adding a file which doesn't exist
+ $zip->addFileFromPath(fileName: 'foobar.php', path: '/foo/bar/foobar.php');
+ }
+
+ public function testAddFileFromPathFileNotReadableException(): void
+ {
+ $this->expectException(FileNotReadableException::class);
+
+
+ [, $stream] = $this->getTmpFileStream();
+
+
+ // create new virtual filesystem
+ $root = vfsStream::setup('vfs');
+ // create a virtual file with no permissions
+ $file = vfsStream::newFile('foo.txt', 0)->at($root)->setContent('bar');
+
+ // Get ZipStream Object
+ $zip = new ZipStream(
+ outputStream: $stream,
+ sendHttpHeaders: false,
+ );
+
+ $zip->addFileFromPath('foo.txt', $file->url());
+ }
+
+ public function testAddFileFromPathWithStorageMethod(): void
+ {
+ [$tmp, $stream] = $this->getTmpFileStream();
+
+ $zip = new ZipStream(
+ outputStream: $stream,
+ sendHttpHeaders: false,
+ );
+
+ [$tmpExample, $streamExample] = $this->getTmpFileStream();
+ fwrite($streamExample, 'Sample String Data');
+ fclose($streamExample);
+ $zip->addFileFromPath(fileName: 'sample.txt', path: $tmpExample, compressionMethod: CompressionMethod::STORE);
+
+ [$tmpExample, $streamExample] = $this->getTmpFileStream();
+ fwrite($streamExample, 'More Simple Sample Data');
+ fclose($streamExample);
+ $zip->addFileFromPath('test/sample.txt', $tmpExample);
+
+ $zip->finish();
+ fclose($stream);
+
+ $zipArchive = new ZipArchive();
+ $zipArchive->open($tmp);
+
+ $sample1 = $zipArchive->statName('sample.txt');
+ $this->assertSame(CompressionMethod::STORE->value, $sample1['comp_method']);
+
+ $sample2 = $zipArchive->statName('test/sample.txt');
+ $this->assertSame(CompressionMethod::DEFLATE->value, $sample2['comp_method']);
+
+ $zipArchive->close();
+ }
+
+ public function testAddLargeFileFromPath(): void
+ {
+ foreach ([CompressionMethod::DEFLATE, CompressionMethod::STORE] as $compressionMethod) {
+ foreach ([false, true] as $zeroHeader) {
+ foreach ([false, true] as $zip64) {
+ if ($zeroHeader && $compressionMethod === CompressionMethod::DEFLATE) {
+ continue;
+ }
+ $this->addLargeFileFileFromPath(
+ compressionMethod: $compressionMethod,
+ zeroHeader: $zeroHeader,
+ zip64: $zip64
+ );
+ }
+ }
+ }
+ }
+
+ public function testAddFileFromStream(): void
+ {
+ [$tmp, $stream] = $this->getTmpFileStream();
+
+ $zip = new ZipStream(
+ outputStream: $stream,
+ sendHttpHeaders: false,
+ );
+
+ // In this test we can't use temporary stream to feed data
+ // because zlib.deflate filter gives empty string before PHP 7
+ // it works fine with file stream
+ $streamExample = fopen(__FILE__, 'rb');
+ $zip->addFileFromStream('sample.txt', $streamExample);
+ fclose($streamExample);
+
+ $streamExample2 = fopen('php://temp', 'wb+');
+ fwrite($streamExample2, 'More Simple Sample Data');
+ rewind($streamExample2); // move the pointer back to the beginning of file.
+ $zip->addFileFromStream('test/sample.txt', $streamExample2); //, $fileOptions);
+ fclose($streamExample2);
+
+ $zip->finish();
+ fclose($stream);
+
+ $tmpDir = $this->validateAndExtractZip($tmp);
+
+ $files = $this->getRecursiveFileList($tmpDir);
+ $this->assertSame(['sample.txt', 'test' . DIRECTORY_SEPARATOR . 'sample.txt'], $files);
+
+ $this->assertStringEqualsFile(__FILE__, file_get_contents($tmpDir . '/sample.txt'));
+ $this->assertStringEqualsFile($tmpDir . '/test/sample.txt', 'More Simple Sample Data');
+ }
+
+ public function testAddFileFromStreamUnreadableInput(): void
+ {
+ $this->expectException(StreamNotReadableException::class);
+
+ [, $stream] = $this->getTmpFileStream();
+ [$tmpInput] = $this->getTmpFileStream();
+
+ $zip = new ZipStream(
+ outputStream: $stream,
+ sendHttpHeaders: false,
+ );
+
+ $streamUnreadable = fopen($tmpInput, 'w');
+
+ $zip->addFileFromStream('sample.json', $streamUnreadable);
+ }
+
+ public function testAddFileFromStreamBrokenOutputWrite(): void
+ {
+ $this->expectException(ResourceActionException::class);
+
+ $outputStream = FaultInjectionResource::getResource(['stream_write']);
+
+ $zip = new ZipStream(
+ outputStream: $outputStream,
+ sendHttpHeaders: false,
+ );
+
+ $zip->addFile('sample.txt', 'foobar');
+ }
+
+ public function testAddFileFromStreamBrokenInputRewind(): void
+ {
+ $this->expectException(ResourceActionException::class);
+
+ [,$stream] = $this->getTmpFileStream();
+
+ $zip = new ZipStream(
+ outputStream: $stream,
+ sendHttpHeaders: false,
+ defaultEnableZeroHeader: false,
+ );
+
+ $fileStream = FaultInjectionResource::getResource(['stream_seek']);
+
+ $zip->addFileFromStream('sample.txt', $fileStream, maxSize: 0);
+ }
+
+ public function testAddFileFromStreamUnseekableInputWithoutZeroHeader(): void
+ {
+ $this->expectException(StreamNotSeekableException::class);
+
+ [, $stream] = $this->getTmpFileStream();
+
+ $zip = new ZipStream(
+ outputStream: $stream,
+ sendHttpHeaders: false,
+ defaultEnableZeroHeader: false,
+ );
+
+ if (file_exists('/dev/null')) {
+ $streamUnseekable = fopen('/dev/null', 'w+');
+ } elseif (file_exists('NUL')) {
+ $streamUnseekable = fopen('NUL', 'w+');
+ } else {
+ $this->markTestSkipped('Needs file /dev/null');
+ }
+
+ $zip->addFileFromStream('sample.txt', $streamUnseekable, maxSize: 2);
+ }
+
+ public function testAddFileFromStreamUnseekableInputWithZeroHeader(): void
+ {
+ [$tmp, $stream] = $this->getTmpFileStream();
+
+ $zip = new ZipStream(
+ outputStream: $stream,
+ sendHttpHeaders: false,
+ defaultEnableZeroHeader: true,
+ defaultCompressionMethod: CompressionMethod::STORE,
+ );
+
+ $streamUnseekable = StreamWrapper::getResource(new class ('test') extends EndlessCycleStream {
+ public function isSeekable(): bool
+ {
+ return false;
+ }
+
+ public function seek(int $offset, int $whence = SEEK_SET): void
+ {
+ throw new RuntimeException('Not seekable');
+ }
+ });
+
+ $zip->addFileFromStream('sample.txt', $streamUnseekable, maxSize: 7);
+
+ $zip->finish();
+ fclose($stream);
+
+ $tmpDir = $this->validateAndExtractZip($tmp);
+
+ $files = $this->getRecursiveFileList($tmpDir);
+ $this->assertSame(['sample.txt'], $files);
+
+ $this->assertSame(filesize($tmpDir . '/sample.txt'), 7);
+ }
+
+ public function testAddFileFromStreamWithStorageMethod(): void
+ {
+ [$tmp, $stream] = $this->getTmpFileStream();
+
+ $zip = new ZipStream(
+ outputStream: $stream,
+ sendHttpHeaders: false,
+ );
+
+ $streamExample = fopen('php://temp', 'wb+');
+ fwrite($streamExample, 'Sample String Data');
+ rewind($streamExample); // move the pointer back to the beginning of file.
+ $zip->addFileFromStream('sample.txt', $streamExample, compressionMethod: CompressionMethod::STORE);
+ fclose($streamExample);
+
+ $streamExample2 = fopen('php://temp', 'bw+');
+ fwrite($streamExample2, 'More Simple Sample Data');
+ rewind($streamExample2); // move the pointer back to the beginning of file.
+ $zip->addFileFromStream('test/sample.txt', $streamExample2, compressionMethod: CompressionMethod::DEFLATE);
+ fclose($streamExample2);
+
+ $zip->finish();
+ fclose($stream);
+
+ $zipArchive = new ZipArchive();
+ $zipArchive->open($tmp);
+
+ $sample1 = $zipArchive->statName('sample.txt');
+ $this->assertSame(CompressionMethod::STORE->value, $sample1['comp_method']);
+
+ $sample2 = $zipArchive->statName('test/sample.txt');
+ $this->assertSame(CompressionMethod::DEFLATE->value, $sample2['comp_method']);
+
+ $zipArchive->close();
+ }
+
+ public function testAddFileFromPsr7Stream(): void
+ {
+ [$tmp, $stream] = $this->getTmpFileStream();
+
+ $zip = new ZipStream(
+ outputStream: $stream,
+ sendHttpHeaders: false,
+ );
+
+ $body = 'Sample String Data';
+ $response = new Response(200, [], $body);
+
+ $zip->addFileFromPsr7Stream('sample.json', $response->getBody());
+ $zip->finish();
+ fclose($stream);
+
+ $tmpDir = $this->validateAndExtractZip($tmp);
+
+ $files = $this->getRecursiveFileList($tmpDir);
+ $this->assertSame(['sample.json'], $files);
+ $this->assertStringEqualsFile($tmpDir . '/sample.json', $body);
+ }
+
+ /**
+ * @group slow
+ */
+ public function testAddLargeFileFromPsr7Stream(): void
+ {
+ [$tmp, $stream] = $this->getTmpFileStream();
+
+ $zip = new ZipStream(
+ outputStream: $stream,
+ sendHttpHeaders: false,
+ enableZip64: true,
+ );
+
+ $zip->addFileFromPsr7Stream(
+ fileName: 'sample.json',
+ stream: new EndlessCycleStream('0'),
+ maxSize: 0x100000000,
+ compressionMethod: CompressionMethod::STORE,
+ lastModificationDateTime: new DateTimeImmutable('2022-01-01 01:01:01Z'),
+ );
+ $zip->finish();
+ fclose($stream);
+
+ $tmpDir = $this->validateAndExtractZip($tmp);
+
+ $files = $this->getRecursiveFileList($tmpDir);
+ $this->assertSame(['sample.json'], $files);
+ $this->assertFileIsReadable($tmpDir . '/sample.json');
+ $this->assertStringStartsWith('000000', file_get_contents(filename: $tmpDir . '/sample.json', length: 20));
+ }
+
+ public function testContinueFinishedZip(): void
+ {
+ $this->expectException(RuntimeException::class);
+
+ [, $stream] = $this->getTmpFileStream();
+
+ $zip = new ZipStream(
+ outputStream: $stream,
+ sendHttpHeaders: false,
+ );
+ $zip->finish();
+
+ $zip->addFile('sample.txt', '1234');
+ }
+
+ /**
+ * @group slow
+ */
+ public function testManyFilesWithoutZip64(): void
+ {
+ $this->expectException(OverflowException::class);
+
+ [, $stream] = $this->getTmpFileStream();
+
+ $zip = new ZipStream(
+ outputStream: $stream,
+ sendHttpHeaders: false,
+ enableZip64: false,
+ );
+
+ for ($i = 0; $i <= 0xFFFF; $i++) {
+ $zip->addFile('sample' . $i, '');
+ }
+
+ $zip->finish();
+ }
+
+ /**
+ * @group slow
+ */
+ public function testManyFilesWithZip64(): void
+ {
+ [$tmp, $stream] = $this->getTmpFileStream();
+
+ $zip = new ZipStream(
+ outputStream: $stream,
+ sendHttpHeaders: false,
+ enableZip64: true,
+ );
+
+ for ($i = 0; $i <= 0xFFFF; $i++) {
+ $zip->addFile('sample' . $i, '');
+ }
+
+ $zip->finish();
+
+ $tmpDir = $this->validateAndExtractZip($tmp);
+
+ $files = $this->getRecursiveFileList($tmpDir);
+
+ $this->assertSame(count($files), 0x10000);
+ }
+
+ /**
+ * @group slow
+ */
+ public function testLongZipWithout64(): void
+ {
+ $this->expectException(OverflowException::class);
+
+ [, $stream] = $this->getTmpFileStream();
+
+ $zip = new ZipStream(
+ outputStream: $stream,
+ sendHttpHeaders: false,
+ enableZip64: false,
+ defaultCompressionMethod: CompressionMethod::STORE,
+ );
+
+ for ($i = 0; $i < 4; $i++) {
+ $zip->addFileFromPsr7Stream(
+ fileName: 'sample' . $i,
+ stream: new EndlessCycleStream('0'),
+ maxSize: 0xFFFFFFFF,
+ compressionMethod: CompressionMethod::STORE,
+ lastModificationDateTime: new DateTimeImmutable('2022-01-01 01:01:01Z'),
+ );
+ }
+ }
+
+ /**
+ * @group slow
+ */
+ public function testLongZipWith64(): void
+ {
+ [$tmp, $stream] = $this->getTmpFileStream();
+
+ $zip = new ZipStream(
+ outputStream: $stream,
+ sendHttpHeaders: false,
+ enableZip64: true,
+ defaultCompressionMethod: CompressionMethod::STORE,
+ );
+
+ for ($i = 0; $i < 4; $i++) {
+ $zip->addFileFromPsr7Stream(
+ fileName: 'sample' . $i,
+ stream: new EndlessCycleStream('0'),
+ maxSize: 0x5FFFFFFF,
+ compressionMethod: CompressionMethod::STORE,
+ lastModificationDateTime: new DateTimeImmutable('2022-01-01 01:01:01Z'),
+ );
+ }
+
+ $zip->finish();
+ fclose($stream);
+
+ $tmpDir = $this->validateAndExtractZip($tmp);
+
+ $files = $this->getRecursiveFileList($tmpDir);
+ $this->assertSame(['sample0', 'sample1', 'sample2', 'sample3'], $files);
+ }
+
+ /**
+ * @group slow
+ */
+ public function testAddLargeFileWithoutZip64WithZeroHeader(): void
+ {
+ $this->expectException(OverflowException::class);
+
+ [, $stream] = $this->getTmpFileStream();
+
+ $zip = new ZipStream(
+ outputStream: $stream,
+ sendHttpHeaders: false,
+ enableZip64: false,
+ defaultEnableZeroHeader: true,
+ );
+
+ $zip->addFileFromPsr7Stream(
+ fileName: 'sample.json',
+ stream: new EndlessCycleStream('0'),
+ maxSize: 0x100000000,
+ compressionMethod: CompressionMethod::STORE,
+ lastModificationDateTime: new DateTimeImmutable('2022-01-01 01:01:01Z'),
+ );
+ }
+
+ /**
+ * @group slow
+ */
+ public function testAddsZip64HeaderWhenNeeded(): void
+ {
+ [$tmp, $stream] = $this->getTmpFileStream();
+
+ $zip = new ZipStream(
+ outputStream: $stream,
+ sendHttpHeaders: false,
+ enableZip64: true,
+ defaultEnableZeroHeader: false,
+ );
+
+ $zip->addFileFromPsr7Stream(
+ fileName: 'sample.json',
+ stream: new EndlessCycleStream('0'),
+ maxSize: 0x100000000,
+ compressionMethod: CompressionMethod::STORE,
+ lastModificationDateTime: new DateTimeImmutable('2022-01-01 01:01:01Z'),
+ );
+
+ $zip->finish();
+
+ $tmpDir = $this->validateAndExtractZip($tmp);
+ $files = $this->getRecursiveFileList($tmpDir);
+
+ $this->assertSame(['sample.json'], $files);
+ $this->assertFileContains($tmp, PackField::pack(
+ new PackField(format: 'V', value: 0x06064b50)
+ ));
+ }
+
+ /**
+ * @group slow
+ */
+ public function testDoesNotAddZip64HeaderWhenNotNeeded(): void
+ {
+ [$tmp, $stream] = $this->getTmpFileStream();
+
+ $zip = new ZipStream(
+ outputStream: $stream,
+ sendHttpHeaders: false,
+ enableZip64: true,
+ defaultEnableZeroHeader: false,
+ );
+
+ $zip->addFileFromPsr7Stream(
+ fileName: 'sample.json',
+ stream: new EndlessCycleStream('0'),
+ maxSize: 0x10,
+ compressionMethod: CompressionMethod::STORE,
+ lastModificationDateTime: new DateTimeImmutable('2022-01-01 01:01:01Z'),
+ );
+
+ $zip->finish();
+
+ $tmpDir = $this->validateAndExtractZip($tmp);
+ $files = $this->getRecursiveFileList($tmpDir);
+
+ $this->assertSame(['sample.json'], $files);
+ $this->assertFileDoesNotContain($tmp, PackField::pack(
+ new PackField(format: 'V', value: 0x06064b50)
+ ));
+ }
+
+ /**
+ * @group slow
+ */
+ public function testAddLargeFileWithoutZip64WithoutZeroHeader(): void
+ {
+ $this->expectException(OverflowException::class);
+
+ [, $stream] = $this->getTmpFileStream();
+
+ $zip = new ZipStream(
+ outputStream: $stream,
+ sendHttpHeaders: false,
+ enableZip64: false,
+ defaultEnableZeroHeader: false,
+ );
+
+ $zip->addFileFromPsr7Stream(
+ fileName: 'sample.json',
+ stream: new EndlessCycleStream('0'),
+ maxSize: 0x100000000,
+ compressionMethod: CompressionMethod::STORE,
+ lastModificationDateTime: new DateTimeImmutable('2022-01-01 01:01:01Z'),
+ );
+ }
+
+ public function testAddFileFromPsr7StreamWithOutputToPsr7Stream(): void
+ {
+ [$tmp, $resource] = $this->getTmpFileStream();
+ $psr7OutputStream = new ResourceStream($resource);
+
+
+ $zip = new ZipStream(
+ outputStream: $psr7OutputStream,
+ sendHttpHeaders: false,
+ );
+
+ $body = 'Sample String Data';
+ $response = new Response(200, [], $body);
+
+ $zip->addFileFromPsr7Stream(
+ fileName: 'sample.json',
+ stream: $response->getBody(),
+ compressionMethod: CompressionMethod::STORE,
+ );
+ $zip->finish();
+ $psr7OutputStream->close();
+
+ $tmpDir = $this->validateAndExtractZip($tmp);
+ $files = $this->getRecursiveFileList($tmpDir);
+
+ $this->assertSame(['sample.json'], $files);
+ $this->assertStringEqualsFile($tmpDir . '/sample.json', $body);
+ }
+
+ public function testAddFileFromPsr7StreamWithFileSizeSet(): void
+ {
+ [$tmp, $stream] = $this->getTmpFileStream();
+
+ $zip = new ZipStream(
+ outputStream: $stream,
+ sendHttpHeaders: false,
+ );
+
+ $body = 'Sample String Data';
+ $fileSize = strlen($body);
+ // Add fake padding
+ $fakePadding = "\0\0\0\0\0\0";
+ $response = new Response(200, [], $body . $fakePadding);
+
+ $zip->addFileFromPsr7Stream(
+ fileName: 'sample.json',
+ stream: $response->getBody(),
+ compressionMethod: CompressionMethod::STORE,
+ maxSize: $fileSize
+ );
+ $zip->finish();
+ fclose($stream);
+
+ $tmpDir = $this->validateAndExtractZip($tmp);
+
+ $files = $this->getRecursiveFileList($tmpDir);
+ $this->assertSame(['sample.json'], $files);
+ $this->assertStringEqualsFile($tmpDir . '/sample.json', $body);
+ }
+
+ public function testCreateArchiveHeaders(): void
+ {
+ [, $stream] = $this->getTmpFileStream();
+
+ $headers = [];
+
+ $httpHeaderCallback = function (string $header) use (&$headers) {
+ $headers[] = $header;
+ };
+
+ $zip = new ZipStream(
+ outputStream: $stream,
+ sendHttpHeaders: true,
+ outputName: 'example.zip',
+ httpHeaderCallback: $httpHeaderCallback,
+ );
+
+ $zip->addFile(
+ fileName: 'sample.json',
+ data: 'foo',
+ );
+ $zip->finish();
+ fclose($stream);
+
+ $this->assertContains('Content-Type: application/x-zip', $headers);
+ $this->assertContains("Content-Disposition: attachment; filename*=UTF-8''example.zip", $headers);
+ $this->assertContains('Pragma: public', $headers);
+ $this->assertContains('Cache-Control: public, must-revalidate', $headers);
+ $this->assertContains('Content-Transfer-Encoding: binary', $headers);
+ }
+
+ public function testCreateArchiveWithFlushOptionSet(): void
+ {
+ [$tmp, $stream] = $this->getTmpFileStream();
+
+ $zip = new ZipStream(
+ outputStream: $stream,
+ flushOutput: true,
+ sendHttpHeaders: false,
+ );
+
+ $zip->addFile('sample.txt', 'Sample String Data');
+ $zip->addFile('test/sample.txt', 'More Simple Sample Data');
+
+ $zip->finish();
+ fclose($stream);
+
+ $tmpDir = $this->validateAndExtractZip($tmp);
+
+ $files = $this->getRecursiveFileList($tmpDir);
+ $this->assertSame(['sample.txt', 'test' . DIRECTORY_SEPARATOR . 'sample.txt'], $files);
+
+ $this->assertStringEqualsFile($tmpDir . '/sample.txt', 'Sample String Data');
+ $this->assertStringEqualsFile($tmpDir . '/test/sample.txt', 'More Simple Sample Data');
+ }
+
+ public function testCreateArchiveWithOutputBufferingOffAndFlushOptionSet(): void
+ {
+ // WORKAROUND (1/2): remove phpunit's output buffer in order to run test without any buffering
+ ob_end_flush();
+ $this->assertSame(0, ob_get_level());
+
+ [$tmp, $stream] = $this->getTmpFileStream();
+
+ $zip = new ZipStream(
+ outputStream: $stream,
+ flushOutput: true,
+ sendHttpHeaders: false,
+ );
+
+ $zip->addFile('sample.txt', 'Sample String Data');
+
+ $zip->finish();
+ fclose($stream);
+
+ $tmpDir = $this->validateAndExtractZip($tmp);
+ $this->assertStringEqualsFile($tmpDir . '/sample.txt', 'Sample String Data');
+
+ // WORKAROUND (2/2): add back output buffering so that PHPUnit doesn't complain that it is missing
+ ob_start();
+ }
+
+ public function testAddEmptyDirectory(): void
+ {
+ [$tmp, $stream] = $this->getTmpFileStream();
+
+ $zip = new ZipStream(
+ outputStream: $stream,
+ sendHttpHeaders: false,
+ );
+
+ $zip->addDirectory('foo');
+
+ $zip->finish();
+ fclose($stream);
+
+ $tmpDir = $this->validateAndExtractZip($tmp);
+
+ $files = $this->getRecursiveFileList($tmpDir, includeDirectories: true);
+
+ $this->assertContains('foo', $files);
+
+ $this->assertFileExists($tmpDir . DIRECTORY_SEPARATOR . 'foo');
+ $this->assertDirectoryExists($tmpDir . DIRECTORY_SEPARATOR . 'foo');
+ }
+
+ public function testAddFileSimulate(): void
+ {
+ [, $stream] = $this->getTmpFileStream();
+
+ $create = function (OperationMode $operationMode) use ($stream): int {
+ $zip = new ZipStream(
+ sendHttpHeaders: false,
+ operationMode: $operationMode,
+ defaultEnableZeroHeader: true,
+ outputStream: $stream,
+ );
+
+ $zip->addFile('sample.txt', 'Sample String Data');
+ $zip->addFile('test/sample.txt', 'More Simple Sample Data');
+
+ return $zip->finish();
+ };
+
+
+ $sizeExpected = $create(OperationMode::NORMAL);
+ $sizeActual = $create(OperationMode::SIMULATE_LAX);
+
+ $this->assertEquals($sizeExpected, $sizeActual);
+ }
+
+ public function testAddFileSimulateWithMaxSize(): void
+ {
+ [, $stream] = $this->getTmpFileStream();
+
+ $create = function (OperationMode $operationMode) use ($stream): int {
+ $zip = new ZipStream(
+ sendHttpHeaders: false,
+ operationMode: $operationMode,
+ defaultCompressionMethod: CompressionMethod::STORE,
+ defaultEnableZeroHeader: true,
+ outputStream: $stream,
+ );
+
+ $zip->addFile('sample.txt', 'Sample String Data', maxSize: 0);
+
+ return $zip->finish();
+ };
+
+
+ $sizeExpected = $create(OperationMode::NORMAL);
+ $sizeActual = $create(OperationMode::SIMULATE_LAX);
+
+ $this->assertEquals($sizeExpected, $sizeActual);
+ }
+
+ public function testAddFileSimulateWithFstat(): void
+ {
+ [, $stream] = $this->getTmpFileStream();
+
+ $create = function (OperationMode $operationMode) use ($stream): int {
+ $zip = new ZipStream(
+ sendHttpHeaders: false,
+ operationMode: $operationMode,
+ defaultCompressionMethod: CompressionMethod::STORE,
+ defaultEnableZeroHeader: true,
+ outputStream: $stream,
+ );
+
+ $zip->addFile('sample.txt', 'Sample String Data');
+ $zip->addFile('test/sample.txt', 'More Simple Sample Data');
+
+ return $zip->finish();
+ };
+
+
+ $sizeExpected = $create(OperationMode::NORMAL);
+ $sizeActual = $create(OperationMode::SIMULATE_LAX);
+
+ $this->assertEquals($sizeExpected, $sizeActual);
+ }
+
+ public function testAddFileSimulateWithExactSizeZero(): void
+ {
+ [, $stream] = $this->getTmpFileStream();
+
+ $create = function (OperationMode $operationMode) use ($stream): int {
+ $zip = new ZipStream(
+ sendHttpHeaders: false,
+ operationMode: $operationMode,
+ defaultCompressionMethod: CompressionMethod::STORE,
+ defaultEnableZeroHeader: true,
+ outputStream: $stream,
+ );
+
+ $zip->addFile('sample.txt', 'Sample String Data', exactSize: 18);
+
+ return $zip->finish();
+ };
+
+
+ $sizeExpected = $create(OperationMode::NORMAL);
+ $sizeActual = $create(OperationMode::SIMULATE_LAX);
+
+ $this->assertEquals($sizeExpected, $sizeActual);
+ }
+
+ public function testAddFileSimulateWithExactSizeInitial(): void
+ {
+ [, $stream] = $this->getTmpFileStream();
+
+ $create = function (OperationMode $operationMode) use ($stream): int {
+ $zip = new ZipStream(
+ sendHttpHeaders: false,
+ operationMode: $operationMode,
+ defaultCompressionMethod: CompressionMethod::STORE,
+ defaultEnableZeroHeader: false,
+ outputStream: $stream,
+ );
+
+ $zip->addFile('sample.txt', 'Sample String Data', exactSize: 18);
+
+ return $zip->finish();
+ };
+
+ $sizeExpected = $create(OperationMode::NORMAL);
+ $sizeActual = $create(OperationMode::SIMULATE_LAX);
+
+ $this->assertEquals($sizeExpected, $sizeActual);
+ }
+
+ public function testAddFileSimulateWithZeroSizeInFstat(): void
+ {
+ [, $stream] = $this->getTmpFileStream();
+
+ $create = function (OperationMode $operationMode) use ($stream): int {
+ $zip = new ZipStream(
+ sendHttpHeaders: false,
+ operationMode: $operationMode,
+ defaultCompressionMethod: CompressionMethod::STORE,
+ defaultEnableZeroHeader: false,
+ outputStream: $stream,
+ );
+
+ $zip->addFileFromPsr7Stream('sample.txt', new class () implements StreamInterface {
+ public $pos = 0;
+
+ public function __toString(): string
+ {
+ return 'test';
+ }
+
+ public function close(): void
+ {
+ }
+
+ public function detach()
+ {
+ }
+
+ public function getSize(): ?int
+ {
+ return null;
+ }
+
+ public function tell(): int
+ {
+ return $this->pos;
+ }
+
+ public function eof(): bool
+ {
+ return $this->pos >= 4;
+ }
+
+ public function isSeekable(): bool
+ {
+ return true;
+ }
+
+ public function seek(int $offset, int $whence = SEEK_SET): void
+ {
+ $this->pos = $offset;
+ }
+
+ public function rewind(): void
+ {
+ $this->pos = 0;
+ }
+
+ public function isWritable(): bool
+ {
+ return false;
+ }
+
+ public function write(string $string): int
+ {
+ return 0;
+ }
+
+ public function isReadable(): bool
+ {
+ return true;
+ }
+
+ public function read(int $length): string
+ {
+ $data = substr('test', $this->pos, $length);
+ $this->pos += strlen($data);
+ return $data;
+ }
+
+ public function getContents(): string
+ {
+ return $this->read(4);
+ }
+
+ public function getMetadata(?string $key = null)
+ {
+ return $key !== null ? null : [];
+ }
+ });
+
+ return $zip->finish();
+ };
+
+ $sizeExpected = $create(OperationMode::NORMAL);
+ $sizeActual = $create(OperationMode::SIMULATE_LAX);
+
+
+ $this->assertEquals($sizeExpected, $sizeActual);
+ }
+
+ public function testAddFileSimulateWithWrongExactSize(): void
+ {
+ $this->expectException(FileSizeIncorrectException::class);
+
+ $zip = new ZipStream(
+ sendHttpHeaders: false,
+ operationMode: OperationMode::SIMULATE_LAX,
+ );
+
+ $zip->addFile('sample.txt', 'Sample String Data', exactSize: 1000);
+ }
+
+ public function testAddFileSimulateStrictZero(): void
+ {
+ $this->expectException(SimulationFileUnknownException::class);
+
+ $zip = new ZipStream(
+ sendHttpHeaders: false,
+ operationMode: OperationMode::SIMULATE_STRICT,
+ defaultEnableZeroHeader: true
+ );
+
+ $zip->addFile('sample.txt', 'Sample String Data');
+ }
+
+ public function testAddFileSimulateStrictInitial(): void
+ {
+ $this->expectException(SimulationFileUnknownException::class);
+
+ $zip = new ZipStream(
+ sendHttpHeaders: false,
+ operationMode: OperationMode::SIMULATE_STRICT,
+ defaultEnableZeroHeader: false
+ );
+
+ $zip->addFile('sample.txt', 'Sample String Data');
+ }
+
+ public function testAddFileCallbackStrict(): void
+ {
+ $this->expectException(SimulationFileUnknownException::class);
+
+ $zip = new ZipStream(
+ sendHttpHeaders: false,
+ operationMode: OperationMode::SIMULATE_STRICT,
+ defaultEnableZeroHeader: false
+ );
+
+ $zip->addFileFromCallback('sample.txt', callback: function () {
+ return '';
+ });
+ }
+
+ public function testAddFileCallbackLax(): void
+ {
+
+ $zip = new ZipStream(
+ operationMode: OperationMode::SIMULATE_LAX,
+ defaultEnableZeroHeader: false,
+ sendHttpHeaders: false,
+ );
+
+ $zip->addFileFromCallback('sample.txt', callback: function () {
+ return 'Sample String Data';
+ });
+
+ $size = $zip->finish();
+
+ $this->assertEquals($size, 142);
+ }
+
+ public function testExecuteSimulation(): void
+ {
+ [$tmp, $stream] = $this->getTmpFileStream();
+
+ $zip = new ZipStream(
+ operationMode: OperationMode::SIMULATE_LAX,
+ defaultEnableZeroHeader: false,
+ sendHttpHeaders: false,
+ outputStream: $stream,
+ );
+
+ $zip->addFileFromCallback(
+ 'sample.txt',
+ exactSize: 18,
+ callback: function () {
+ return 'Sample String Data';
+ }
+ );
+
+ $size = $zip->finish();
+
+ $this->assertEquals(filesize($tmp), 0);
+
+ $zip->executeSimulation();
+ fclose($stream);
+
+ clearstatcache();
+
+ $this->assertEquals(filesize($tmp), $size);
+
+ $tmpDir = $this->validateAndExtractZip($tmp);
+
+ $files = $this->getRecursiveFileList($tmpDir);
+ $this->assertSame(['sample.txt'], $files);
+ }
+
+ public function testExecuteSimulationBeforeFinish(): void
+ {
+ $this->expectException(RuntimeException::class);
+
+
+ [, $stream] = $this->getTmpFileStream();
+
+ $zip = new ZipStream(
+ operationMode: OperationMode::SIMULATE_LAX,
+ defaultEnableZeroHeader: false,
+ sendHttpHeaders: false,
+ outputStream: $stream,
+ );
+
+ $zip->executeSimulation();
+ }
+
+ private function addLargeFileFileFromPath(CompressionMethod $compressionMethod, $zeroHeader, $zip64): void
+ {
+ [$tmp, $stream] = $this->getTmpFileStream();
+
+ $zip = new ZipStream(
+ outputStream: $stream,
+ sendHttpHeaders: false,
+ defaultEnableZeroHeader: $zeroHeader,
+ enableZip64: $zip64,
+ );
+
+ [$tmpExample, $streamExample] = $this->getTmpFileStream();
+ for ($i = 0; $i <= 10000; $i++) {
+ fwrite($streamExample, sha1((string)$i));
+ if ($i % 100 === 0) {
+ fwrite($streamExample, "\n");
+ }
+ }
+ fclose($streamExample);
+ $shaExample = sha1_file($tmpExample);
+ $zip->addFileFromPath('sample.txt', $tmpExample);
+ unlink($tmpExample);
+
+ $zip->finish();
+ fclose($stream);
+
+ $tmpDir = $this->validateAndExtractZip($tmp);
+
+ $files = $this->getRecursiveFileList($tmpDir);
+ $this->assertSame(['sample.txt'], $files);
+
+ $this->assertSame(sha1_file($tmpDir . '/sample.txt'), $shaExample, "SHA-1 Mismatch Method: {$compressionMethod->value}");
+ }
+}
diff --git a/public/vendor/maennchen/zipstream-php/test/Zs/ExtendedInformationExtraFieldTest.php b/public/vendor/maennchen/zipstream-php/test/Zs/ExtendedInformationExtraFieldTest.php
new file mode 100644
index 0000000..2b8dbed
--- /dev/null
+++ b/public/vendor/maennchen/zipstream-php/test/Zs/ExtendedInformationExtraFieldTest.php
@@ -0,0 +1,22 @@
+assertSame(
+ bin2hex((string) $extraField),
+ '5356' . // 2 bytes; Tag for this "extra" block type
+ '0000' // 2 bytes; TODO: Document
+ );
+ }
+}
diff --git a/public/vendor/maennchen/zipstream-php/test/bootstrap.php b/public/vendor/maennchen/zipstream-php/test/bootstrap.php
new file mode 100644
index 0000000..13c7a0e
--- /dev/null
+++ b/public/vendor/maennchen/zipstream-php/test/bootstrap.php
@@ -0,0 +1,7 @@
+add($complexString2);
+```
+
+or use the static Operation methods
+```php
+$complexString1 = '1.23-4.56i';
+$complexString2 = '2.34+5.67i';
+
+echo Complex\Operations::add($complexString1, $complexString2);
+```
+If you want to perform the same operation against multiple values (e.g. to add three or more complex numbers), then you can pass multiple arguments to any of the operations.
+
+You can pass these arguments as Complex objects, or as an array, or string that will parse to a complex object.
+
+## Using functions
+
+When calling any of the available functions for a complex value, you can either call the relevant method for the Complex object
+```php
+$complexString = '1.23-4.56i';
+
+$complexObject = new Complex\Complex($complexString);
+echo $complexObject->sinh();
+```
+
+or use the static Functions methods
+```php
+$complexString = '1.23-4.56i';
+
+echo Complex\Functions::sinh($complexString);
+```
+As with operations, you can pass these arguments as Complex objects, or as an array or string that will parse to a complex object.
+
+
+In the case of the `pow()` function (the only implemented function that requires an additional argument) you need to pass both arguments when calling the function
+
+```php
+$complexString = '1.23-4.56i';
+
+$complexObject = new Complex\Complex($complexString);
+echo Complex\Functions::pow($complexObject, 2);
+```
+or pass the additional argument when calling the method
+```php
+$complexString = '1.23-4.56i';
+
+$complexObject = new Complex\Complex($complexString);
+echo $complexObject->pow(2);
+```
diff --git a/public/vendor/markbaker/complex/classes/src/Complex.php b/public/vendor/markbaker/complex/classes/src/Complex.php
new file mode 100644
index 0000000..25414ee
--- /dev/null
+++ b/public/vendor/markbaker/complex/classes/src/Complex.php
@@ -0,0 +1,388 @@
+realPart = (float) $realPart;
+ $this->imaginaryPart = (float) $imaginaryPart;
+ $this->suffix = strtolower($suffix ?? '');
+ }
+
+ /**
+ * Gets the real part of this complex number
+ *
+ * @return Float
+ */
+ public function getReal(): float
+ {
+ return $this->realPart;
+ }
+
+ /**
+ * Gets the imaginary part of this complex number
+ *
+ * @return Float
+ */
+ public function getImaginary(): float
+ {
+ return $this->imaginaryPart;
+ }
+
+ /**
+ * Gets the suffix of this complex number
+ *
+ * @return String
+ */
+ public function getSuffix(): string
+ {
+ return $this->suffix;
+ }
+
+ /**
+ * Returns true if this is a real value, false if a complex value
+ *
+ * @return Bool
+ */
+ public function isReal(): bool
+ {
+ return $this->imaginaryPart == 0.0;
+ }
+
+ /**
+ * Returns true if this is a complex value, false if a real value
+ *
+ * @return Bool
+ */
+ public function isComplex(): bool
+ {
+ return !$this->isReal();
+ }
+
+ public function format(): string
+ {
+ $str = "";
+ if ($this->imaginaryPart != 0.0) {
+ if (\abs($this->imaginaryPart) != 1.0) {
+ $str .= $this->imaginaryPart . $this->suffix;
+ } else {
+ $str .= (($this->imaginaryPart < 0.0) ? '-' : '') . $this->suffix;
+ }
+ }
+ if ($this->realPart != 0.0) {
+ if (($str) && ($this->imaginaryPart > 0.0)) {
+ $str = "+" . $str;
+ }
+ $str = $this->realPart . $str;
+ }
+ if (!$str) {
+ $str = "0.0";
+ }
+
+ return $str;
+ }
+
+ public function __toString(): string
+ {
+ return $this->format();
+ }
+
+ /**
+ * Validates whether the argument is a valid complex number, converting scalar or array values if possible
+ *
+ * @param mixed $complex The value to validate
+ * @return Complex
+ * @throws Exception If the argument isn't a Complex number or cannot be converted to one
+ */
+ public static function validateComplexArgument($complex): Complex
+ {
+ if (is_scalar($complex) || is_array($complex)) {
+ $complex = new Complex($complex);
+ } elseif (!is_object($complex) || !($complex instanceof Complex)) {
+ throw new Exception('Value is not a valid complex number');
+ }
+
+ return $complex;
+ }
+
+ /**
+ * Returns the reverse of this complex number
+ *
+ * @return Complex
+ */
+ public function reverse(): Complex
+ {
+ return new Complex(
+ $this->imaginaryPart,
+ $this->realPart,
+ ($this->realPart == 0.0) ? null : $this->suffix
+ );
+ }
+
+ public function invertImaginary(): Complex
+ {
+ return new Complex(
+ $this->realPart,
+ $this->imaginaryPart * -1,
+ ($this->imaginaryPart == 0.0) ? null : $this->suffix
+ );
+ }
+
+ public function invertReal(): Complex
+ {
+ return new Complex(
+ $this->realPart * -1,
+ $this->imaginaryPart,
+ ($this->imaginaryPart == 0.0) ? null : $this->suffix
+ );
+ }
+
+ protected static $functions = [
+ 'abs',
+ 'acos',
+ 'acosh',
+ 'acot',
+ 'acoth',
+ 'acsc',
+ 'acsch',
+ 'argument',
+ 'asec',
+ 'asech',
+ 'asin',
+ 'asinh',
+ 'atan',
+ 'atanh',
+ 'conjugate',
+ 'cos',
+ 'cosh',
+ 'cot',
+ 'coth',
+ 'csc',
+ 'csch',
+ 'exp',
+ 'inverse',
+ 'ln',
+ 'log2',
+ 'log10',
+ 'negative',
+ 'pow',
+ 'rho',
+ 'sec',
+ 'sech',
+ 'sin',
+ 'sinh',
+ 'sqrt',
+ 'tan',
+ 'tanh',
+ 'theta',
+ ];
+
+ protected static $operations = [
+ 'add',
+ 'subtract',
+ 'multiply',
+ 'divideby',
+ 'divideinto',
+ ];
+
+ /**
+ * Returns the result of the function call or operation
+ *
+ * @return Complex|float
+ * @throws Exception|\InvalidArgumentException
+ */
+ public function __call($functionName, $arguments)
+ {
+ $functionName = strtolower(str_replace('_', '', $functionName));
+
+ // Test for function calls
+ if (in_array($functionName, self::$functions, true)) {
+ return Functions::$functionName($this, ...$arguments);
+ }
+ // Test for operation calls
+ if (in_array($functionName, self::$operations, true)) {
+ return Operations::$functionName($this, ...$arguments);
+ }
+ throw new Exception('Complex Function or Operation does not exist');
+ }
+}
diff --git a/public/vendor/markbaker/complex/classes/src/Exception.php b/public/vendor/markbaker/complex/classes/src/Exception.php
new file mode 100644
index 0000000..a2beb73
--- /dev/null
+++ b/public/vendor/markbaker/complex/classes/src/Exception.php
@@ -0,0 +1,13 @@
+getReal() - $invsqrt->getImaginary(),
+ $complex->getImaginary() + $invsqrt->getReal()
+ );
+ $log = self::ln($adjust);
+
+ return new Complex(
+ $log->getImaginary(),
+ -1 * $log->getReal()
+ );
+ }
+
+ /**
+ * Returns the inverse hyperbolic cosine of a complex number.
+ *
+ * Formula from Wolfram Alpha:
+ * cosh^(-1)z = ln(z + sqrt(z + 1) sqrt(z - 1)).
+ *
+ * @param Complex|mixed $complex Complex number or a numeric value.
+ * @return Complex The inverse hyperbolic cosine of the complex argument.
+ * @throws Exception If argument isn't a valid real or complex number.
+ */
+ public static function acosh($complex): Complex
+ {
+ $complex = Complex::validateComplexArgument($complex);
+
+ if ($complex->isReal() && ($complex->getReal() > 1)) {
+ return new Complex(\acosh($complex->getReal()));
+ }
+
+ $acosh = self::ln(
+ Operations::add(
+ $complex,
+ Operations::multiply(
+ self::sqrt(Operations::add($complex, 1)),
+ self::sqrt(Operations::subtract($complex, 1))
+ )
+ )
+ );
+
+ return $acosh;
+ }
+
+ /**
+ * Returns the inverse cotangent of a complex number.
+ *
+ * @param Complex|mixed $complex Complex number or a numeric value.
+ * @return Complex The inverse cotangent of the complex argument.
+ * @throws Exception If argument isn't a valid real or complex number.
+ * @throws \InvalidArgumentException If function would result in a division by zero
+ */
+ public static function acot($complex): Complex
+ {
+ $complex = Complex::validateComplexArgument($complex);
+
+ return self::atan(self::inverse($complex));
+ }
+
+ /**
+ * Returns the inverse hyperbolic cotangent of a complex number.
+ *
+ * @param Complex|mixed $complex Complex number or a numeric value.
+ * @return Complex The inverse hyperbolic cotangent of the complex argument.
+ * @throws Exception If argument isn't a valid real or complex number.
+ * @throws \InvalidArgumentException If function would result in a division by zero
+ */
+ public static function acoth($complex): Complex
+ {
+ $complex = Complex::validateComplexArgument($complex);
+
+ return self::atanh(self::inverse($complex));
+ }
+
+ /**
+ * Returns the inverse cosecant of a complex number.
+ *
+ * @param Complex|mixed $complex Complex number or a numeric value.
+ * @return Complex The inverse cosecant of the complex argument.
+ * @throws Exception If argument isn't a valid real or complex number.
+ * @throws \InvalidArgumentException If function would result in a division by zero
+ */
+ public static function acsc($complex): Complex
+ {
+ $complex = Complex::validateComplexArgument($complex);
+
+ if ($complex->getReal() == 0.0 && $complex->getImaginary() == 0.0) {
+ return new Complex(INF);
+ }
+
+ return self::asin(self::inverse($complex));
+ }
+
+ /**
+ * Returns the inverse hyperbolic cosecant of a complex number.
+ *
+ * @param Complex|mixed $complex Complex number or a numeric value.
+ * @return Complex The inverse hyperbolic cosecant of the complex argument.
+ * @throws Exception If argument isn't a valid real or complex number.
+ * @throws \InvalidArgumentException If function would result in a division by zero
+ */
+ public static function acsch($complex): Complex
+ {
+ $complex = Complex::validateComplexArgument($complex);
+
+ if ($complex->getReal() == 0.0 && $complex->getImaginary() == 0.0) {
+ return new Complex(INF);
+ }
+
+ return self::asinh(self::inverse($complex));
+ }
+
+ /**
+ * Returns the argument of a complex number.
+ * Also known as the theta of the complex number, i.e. the angle in radians
+ * from the real axis to the representation of the number in polar coordinates.
+ *
+ * This function is a synonym for theta()
+ *
+ * @param Complex|mixed $complex Complex number or a numeric value.
+ * @return float The argument (or theta) value of the complex argument.
+ * @throws Exception If argument isn't a valid real or complex number.
+ *
+ * @see theta
+ */
+ public static function argument($complex): float
+ {
+ return self::theta($complex);
+ }
+
+ /**
+ * Returns the inverse secant of a complex number.
+ *
+ * @param Complex|mixed $complex Complex number or a numeric value.
+ * @return Complex The inverse secant of the complex argument.
+ * @throws Exception If argument isn't a valid real or complex number.
+ * @throws \InvalidArgumentException If function would result in a division by zero
+ */
+ public static function asec($complex): Complex
+ {
+ $complex = Complex::validateComplexArgument($complex);
+
+ if ($complex->getReal() == 0.0 && $complex->getImaginary() == 0.0) {
+ return new Complex(INF);
+ }
+
+ return self::acos(self::inverse($complex));
+ }
+
+ /**
+ * Returns the inverse hyperbolic secant of a complex number.
+ *
+ * @param Complex|mixed $complex Complex number or a numeric value.
+ * @return Complex The inverse hyperbolic secant of the complex argument.
+ * @throws Exception If argument isn't a valid real or complex number.
+ * @throws \InvalidArgumentException If function would result in a division by zero
+ */
+ public static function asech($complex): Complex
+ {
+ $complex = Complex::validateComplexArgument($complex);
+
+ if ($complex->getReal() == 0.0 && $complex->getImaginary() == 0.0) {
+ return new Complex(INF);
+ }
+
+ return self::acosh(self::inverse($complex));
+ }
+
+ /**
+ * Returns the inverse sine of a complex number.
+ *
+ * @param Complex|mixed $complex Complex number or a numeric value.
+ * @return Complex The inverse sine of the complex argument.
+ * @throws Exception If argument isn't a valid real or complex number.
+ */
+ public static function asin($complex): Complex
+ {
+ $complex = Complex::validateComplexArgument($complex);
+
+ $invsqrt = self::sqrt(Operations::subtract(1, Operations::multiply($complex, $complex)));
+ $adjust = new Complex(
+ $invsqrt->getReal() - $complex->getImaginary(),
+ $invsqrt->getImaginary() + $complex->getReal()
+ );
+ $log = self::ln($adjust);
+
+ return new Complex(
+ $log->getImaginary(),
+ -1 * $log->getReal()
+ );
+ }
+
+ /**
+ * Returns the inverse hyperbolic sine of a complex number.
+ *
+ * @param Complex|mixed $complex Complex number or a numeric value.
+ * @return Complex The inverse hyperbolic sine of the complex argument.
+ * @throws Exception If argument isn't a valid real or complex number.
+ */
+ public static function asinh($complex): Complex
+ {
+ $complex = Complex::validateComplexArgument($complex);
+
+ if ($complex->isReal() && ($complex->getReal() > 1)) {
+ return new Complex(\asinh($complex->getReal()));
+ }
+
+ $asinh = clone $complex;
+ $asinh = $asinh->reverse()
+ ->invertReal();
+ $asinh = self::asin($asinh);
+
+ return $asinh->reverse()
+ ->invertImaginary();
+ }
+
+ /**
+ * Returns the inverse tangent of a complex number.
+ *
+ * @param Complex|mixed $complex Complex number or a numeric value.
+ * @return Complex The inverse tangent of the complex argument.
+ * @throws Exception If argument isn't a valid real or complex number.
+ * @throws \InvalidArgumentException If function would result in a division by zero
+ */
+ public static function atan($complex): Complex
+ {
+ $complex = Complex::validateComplexArgument($complex);
+
+ if ($complex->isReal()) {
+ return new Complex(\atan($complex->getReal()));
+ }
+
+ $t1Value = new Complex(-1 * $complex->getImaginary(), $complex->getReal());
+ $uValue = new Complex(1, 0);
+
+ $d1Value = clone $uValue;
+ $d1Value = Operations::subtract($d1Value, $t1Value);
+ $d2Value = Operations::add($t1Value, $uValue);
+ $uResult = $d1Value->divideBy($d2Value);
+ $uResult = self::ln($uResult);
+
+ $realMultiplier = -0.5;
+ $imaginaryMultiplier = 0.5;
+
+ if (abs($uResult->getImaginary()) === M_PI) {
+ // If we have an imaginary value at the max or min (PI or -PI), then we need to ensure
+ // that the primary is assigned for the correct quadrant.
+ $realMultiplier = (
+ ($uResult->getImaginary() === M_PI && $uResult->getReal() > 0.0) ||
+ ($uResult->getImaginary() === -M_PI && $uResult->getReal() < 0.0)
+ ) ? 0.5 : -0.5;
+ }
+
+ return new Complex(
+ $uResult->getImaginary() * $realMultiplier,
+ $uResult->getReal() * $imaginaryMultiplier,
+ $complex->getSuffix()
+ );
+ }
+
+ /**
+ * Returns the inverse hyperbolic tangent of a complex number.
+ *
+ * Formula from Wolfram Alpha:
+ * tanh^(-1)z = 1/2 [ln(1 + z) - ln(1 - z)].
+ *
+ * @param Complex|mixed $complex Complex number or a numeric value.
+ * @return Complex The inverse hyperbolic tangent of the complex argument.
+ * @throws Exception If argument isn't a valid real or complex number.
+ */
+ public static function atanh($complex): Complex
+ {
+ $complex = Complex::validateComplexArgument($complex);
+
+ if ($complex->isReal()) {
+ $real = $complex->getReal();
+ if ($real >= -1.0 && $real <= 1.0) {
+ return new Complex(\atanh($real));
+ } else {
+ return new Complex(\atanh(1 / $real), (($real < 0.0) ? M_PI_2 : -1 * M_PI_2));
+ }
+ }
+
+ $atanh = Operations::multiply(
+ Operations::subtract(
+ self::ln(Operations::add(1.0, $complex)),
+ self::ln(Operations::subtract(1.0, $complex))
+ ),
+ 0.5
+ );
+
+ return $atanh;
+ }
+
+ /**
+ * Returns the complex conjugate of a complex number
+ *
+ * @param Complex|mixed $complex Complex number or a numeric value.
+ * @return Complex The conjugate of the complex argument.
+ * @throws Exception If argument isn't a valid real or complex number.
+ */
+ public static function conjugate($complex): Complex
+ {
+ $complex = Complex::validateComplexArgument($complex);
+
+ return new Complex(
+ $complex->getReal(),
+ -1 * $complex->getImaginary(),
+ $complex->getSuffix()
+ );
+ }
+
+ /**
+ * Returns the cosine of a complex number.
+ *
+ * @param Complex|mixed $complex Complex number or a numeric value.
+ * @return Complex The cosine of the complex argument.
+ * @throws Exception If argument isn't a valid real or complex number.
+ */
+ public static function cos($complex): Complex
+ {
+ $complex = Complex::validateComplexArgument($complex);
+
+ if ($complex->isReal()) {
+ return new Complex(\cos($complex->getReal()));
+ }
+
+ return self::conjugate(
+ new Complex(
+ \cos($complex->getReal()) * \cosh($complex->getImaginary()),
+ \sin($complex->getReal()) * \sinh($complex->getImaginary()),
+ $complex->getSuffix()
+ )
+ );
+ }
+
+ /**
+ * Returns the hyperbolic cosine of a complex number.
+ *
+ * @param Complex|mixed $complex Complex number or a numeric value.
+ * @return Complex The hyperbolic cosine of the complex argument.
+ * @throws Exception If argument isn't a valid real or complex number.
+ */
+ public static function cosh($complex): Complex
+ {
+ $complex = Complex::validateComplexArgument($complex);
+
+ if ($complex->isReal()) {
+ return new Complex(\cosh($complex->getReal()));
+ }
+
+ return new Complex(
+ \cosh($complex->getReal()) * \cos($complex->getImaginary()),
+ \sinh($complex->getReal()) * \sin($complex->getImaginary()),
+ $complex->getSuffix()
+ );
+ }
+
+ /**
+ * Returns the cotangent of a complex number.
+ *
+ * @param Complex|mixed $complex Complex number or a numeric value.
+ * @return Complex The cotangent of the complex argument.
+ * @throws Exception If argument isn't a valid real or complex number.
+ * @throws \InvalidArgumentException If function would result in a division by zero
+ */
+ public static function cot($complex): Complex
+ {
+ $complex = Complex::validateComplexArgument($complex);
+
+ if ($complex->getReal() == 0.0 && $complex->getImaginary() == 0.0) {
+ return new Complex(INF);
+ }
+
+ return self::inverse(self::tan($complex));
+ }
+
+ /**
+ * Returns the hyperbolic cotangent of a complex number.
+ *
+ * @param Complex|mixed $complex Complex number or a numeric value.
+ * @return Complex The hyperbolic cotangent of the complex argument.
+ * @throws Exception If argument isn't a valid real or complex number.
+ * @throws \InvalidArgumentException If function would result in a division by zero
+ */
+ public static function coth($complex): Complex
+ {
+ $complex = Complex::validateComplexArgument($complex);
+
+ return self::inverse(self::tanh($complex));
+ }
+
+ /**
+ * Returns the cosecant of a complex number.
+ *
+ * @param Complex|mixed $complex Complex number or a numeric value.
+ * @return Complex The cosecant of the complex argument.
+ * @throws Exception If argument isn't a valid real or complex number.
+ * @throws \InvalidArgumentException If function would result in a division by zero
+ */
+ public static function csc($complex): Complex
+ {
+ $complex = Complex::validateComplexArgument($complex);
+
+ if ($complex->getReal() == 0.0 && $complex->getImaginary() == 0.0) {
+ return new Complex(INF);
+ }
+
+ return self::inverse(self::sin($complex));
+ }
+
+ /**
+ * Returns the hyperbolic cosecant of a complex number.
+ *
+ * @param Complex|mixed $complex Complex number or a numeric value.
+ * @return Complex The hyperbolic cosecant of the complex argument.
+ * @throws Exception If argument isn't a valid real or complex number.
+ * @throws \InvalidArgumentException If function would result in a division by zero
+ */
+ public static function csch($complex): Complex
+ {
+ $complex = Complex::validateComplexArgument($complex);
+
+ if ($complex->getReal() == 0.0 && $complex->getImaginary() == 0.0) {
+ return new Complex(INF);
+ }
+
+ return self::inverse(self::sinh($complex));
+ }
+
+ /**
+ * Returns the exponential of a complex number.
+ *
+ * @param Complex|mixed $complex Complex number or a numeric value.
+ * @return Complex The exponential of the complex argument.
+ * @throws Exception If argument isn't a valid real or complex number.
+ */
+ public static function exp($complex): Complex
+ {
+ $complex = Complex::validateComplexArgument($complex);
+
+ if (($complex->getReal() == 0.0) && (\abs($complex->getImaginary()) == M_PI)) {
+ return new Complex(-1.0, 0.0);
+ }
+
+ $rho = \exp($complex->getReal());
+
+ return new Complex(
+ $rho * \cos($complex->getImaginary()),
+ $rho * \sin($complex->getImaginary()),
+ $complex->getSuffix()
+ );
+ }
+
+ /**
+ * Returns the inverse of a complex number.
+ *
+ * @param Complex|mixed $complex Complex number or a numeric value.
+ * @return Complex The inverse of the complex argument.
+ * @throws Exception If argument isn't a valid real or complex number.
+ * @throws InvalidArgumentException If function would result in a division by zero
+ */
+ public static function inverse($complex): Complex
+ {
+ $complex = clone Complex::validateComplexArgument($complex);
+
+ if ($complex->getReal() == 0.0 && $complex->getImaginary() == 0.0) {
+ throw new InvalidArgumentException('Division by zero');
+ }
+
+ return $complex->divideInto(1.0);
+ }
+
+ /**
+ * Returns the natural logarithm of a complex number.
+ *
+ * @param Complex|mixed $complex Complex number or a numeric value.
+ * @return Complex The natural logarithm of the complex argument.
+ * @throws Exception If argument isn't a valid real or complex number.
+ * @throws InvalidArgumentException If the real and the imaginary parts are both zero
+ */
+ public static function ln($complex): Complex
+ {
+ $complex = Complex::validateComplexArgument($complex);
+
+ if (($complex->getReal() == 0.0) && ($complex->getImaginary() == 0.0)) {
+ throw new InvalidArgumentException();
+ }
+
+ return new Complex(
+ \log(self::rho($complex)),
+ self::theta($complex),
+ $complex->getSuffix()
+ );
+ }
+
+ /**
+ * Returns the base-2 logarithm of a complex number.
+ *
+ * @param Complex|mixed $complex Complex number or a numeric value.
+ * @return Complex The base-2 logarithm of the complex argument.
+ * @throws Exception If argument isn't a valid real or complex number.
+ * @throws InvalidArgumentException If the real and the imaginary parts are both zero
+ */
+ public static function log2($complex): Complex
+ {
+ $complex = Complex::validateComplexArgument($complex);
+
+ if (($complex->getReal() == 0.0) && ($complex->getImaginary() == 0.0)) {
+ throw new InvalidArgumentException();
+ } elseif (($complex->getReal() > 0.0) && ($complex->getImaginary() == 0.0)) {
+ return new Complex(\log($complex->getReal(), 2), 0.0, $complex->getSuffix());
+ }
+
+ return self::ln($complex)
+ ->multiply(\log(Complex::EULER, 2));
+ }
+
+ /**
+ * Returns the common logarithm (base 10) of a complex number.
+ *
+ * @param Complex|mixed $complex Complex number or a numeric value.
+ * @return Complex The common logarithm (base 10) of the complex argument.
+ * @throws Exception If argument isn't a valid real or complex number.
+ * @throws InvalidArgumentException If the real and the imaginary parts are both zero
+ */
+ public static function log10($complex): Complex
+ {
+ $complex = Complex::validateComplexArgument($complex);
+
+ if (($complex->getReal() == 0.0) && ($complex->getImaginary() == 0.0)) {
+ throw new InvalidArgumentException();
+ } elseif (($complex->getReal() > 0.0) && ($complex->getImaginary() == 0.0)) {
+ return new Complex(\log10($complex->getReal()), 0.0, $complex->getSuffix());
+ }
+
+ return self::ln($complex)
+ ->multiply(\log10(Complex::EULER));
+ }
+
+ /**
+ * Returns the negative of a complex number.
+ *
+ * @param Complex|mixed $complex Complex number or a numeric value.
+ * @return Complex The negative value of the complex argument.
+ * @throws Exception If argument isn't a valid real or complex number.
+ *
+ * @see rho
+ *
+ */
+ public static function negative($complex): Complex
+ {
+ $complex = Complex::validateComplexArgument($complex);
+
+ return new Complex(
+ -1 * $complex->getReal(),
+ -1 * $complex->getImaginary(),
+ $complex->getSuffix()
+ );
+ }
+
+ /**
+ * Returns a complex number raised to a power.
+ *
+ * @param Complex|mixed $complex Complex number or a numeric value.
+ * @param float|integer $power The power to raise this value to
+ * @return Complex The complex argument raised to the real power.
+ * @throws Exception If the power argument isn't a valid real
+ */
+ public static function pow($complex, $power): Complex
+ {
+ $complex = Complex::validateComplexArgument($complex);
+
+ if (!is_numeric($power)) {
+ throw new Exception('Power argument must be a real number');
+ }
+
+ if ($complex->getImaginary() == 0.0 && $complex->getReal() >= 0.0) {
+ return new Complex(\pow($complex->getReal(), $power));
+ }
+
+ $rValue = \sqrt(($complex->getReal() * $complex->getReal()) + ($complex->getImaginary() * $complex->getImaginary()));
+ $rPower = \pow($rValue, $power);
+ $theta = $complex->argument() * $power;
+ if ($theta == 0) {
+ return new Complex(1);
+ }
+
+ return new Complex($rPower * \cos($theta), $rPower * \sin($theta), $complex->getSuffix());
+ }
+
+ /**
+ * Returns the rho of a complex number.
+ * This is the distance/radius from the centrepoint to the representation of the number in polar coordinates.
+ *
+ * @param Complex|mixed $complex Complex number or a numeric value.
+ * @return float The rho value of the complex argument.
+ * @throws Exception If argument isn't a valid real or complex number.
+ */
+ public static function rho($complex): float
+ {
+ $complex = Complex::validateComplexArgument($complex);
+
+ return \sqrt(
+ ($complex->getReal() * $complex->getReal()) +
+ ($complex->getImaginary() * $complex->getImaginary())
+ );
+ }
+
+ /**
+ * Returns the secant of a complex number.
+ *
+ * @param Complex|mixed $complex Complex number or a numeric value.
+ * @return Complex The secant of the complex argument.
+ * @throws Exception If argument isn't a valid real or complex number.
+ * @throws \InvalidArgumentException If function would result in a division by zero
+ */
+ public static function sec($complex): Complex
+ {
+ $complex = Complex::validateComplexArgument($complex);
+
+ return self::inverse(self::cos($complex));
+ }
+
+ /**
+ * Returns the hyperbolic secant of a complex number.
+ *
+ * @param Complex|mixed $complex Complex number or a numeric value.
+ * @return Complex The hyperbolic secant of the complex argument.
+ * @throws Exception If argument isn't a valid real or complex number.
+ * @throws \InvalidArgumentException If function would result in a division by zero
+ */
+ public static function sech($complex): Complex
+ {
+ $complex = Complex::validateComplexArgument($complex);
+
+ return self::inverse(self::cosh($complex));
+ }
+
+ /**
+ * Returns the sine of a complex number.
+ *
+ * @param Complex|mixed $complex Complex number or a numeric value.
+ * @return Complex The sine of the complex argument.
+ * @throws Exception If argument isn't a valid real or complex number.
+ */
+ public static function sin($complex): Complex
+ {
+ $complex = Complex::validateComplexArgument($complex);
+
+ if ($complex->isReal()) {
+ return new Complex(\sin($complex->getReal()));
+ }
+
+ return new Complex(
+ \sin($complex->getReal()) * \cosh($complex->getImaginary()),
+ \cos($complex->getReal()) * \sinh($complex->getImaginary()),
+ $complex->getSuffix()
+ );
+ }
+
+ /**
+ * Returns the hyperbolic sine of a complex number.
+ *
+ * @param Complex|mixed $complex Complex number or a numeric value.
+ * @return Complex The hyperbolic sine of the complex argument.
+ * @throws Exception If argument isn't a valid real or complex number.
+ */
+ public static function sinh($complex): Complex
+ {
+ $complex = Complex::validateComplexArgument($complex);
+
+ if ($complex->isReal()) {
+ return new Complex(\sinh($complex->getReal()));
+ }
+
+ return new Complex(
+ \sinh($complex->getReal()) * \cos($complex->getImaginary()),
+ \cosh($complex->getReal()) * \sin($complex->getImaginary()),
+ $complex->getSuffix()
+ );
+ }
+
+ /**
+ * Returns the square root of a complex number.
+ *
+ * @param Complex|mixed $complex Complex number or a numeric value.
+ * @return Complex The Square root of the complex argument.
+ * @throws Exception If argument isn't a valid real or complex number.
+ */
+ public static function sqrt($complex): Complex
+ {
+ $complex = Complex::validateComplexArgument($complex);
+
+ $theta = self::theta($complex);
+ $delta1 = \cos($theta / 2);
+ $delta2 = \sin($theta / 2);
+ $rho = \sqrt(self::rho($complex));
+
+ return new Complex($delta1 * $rho, $delta2 * $rho, $complex->getSuffix());
+ }
+
+ /**
+ * Returns the tangent of a complex number.
+ *
+ * @param Complex|mixed $complex Complex number or a numeric value.
+ * @return Complex The tangent of the complex argument.
+ * @throws Exception If argument isn't a valid real or complex number.
+ * @throws InvalidArgumentException If function would result in a division by zero
+ */
+ public static function tan($complex): Complex
+ {
+ $complex = Complex::validateComplexArgument($complex);
+
+ if ($complex->isReal()) {
+ return new Complex(\tan($complex->getReal()));
+ }
+
+ $real = $complex->getReal();
+ $imaginary = $complex->getImaginary();
+ $divisor = 1 + \pow(\tan($real), 2) * \pow(\tanh($imaginary), 2);
+ if ($divisor == 0.0) {
+ throw new InvalidArgumentException('Division by zero');
+ }
+
+ return new Complex(
+ \pow(self::sech($imaginary)->getReal(), 2) * \tan($real) / $divisor,
+ \pow(self::sec($real)->getReal(), 2) * \tanh($imaginary) / $divisor,
+ $complex->getSuffix()
+ );
+ }
+
+ /**
+ * Returns the hyperbolic tangent of a complex number.
+ *
+ * @param Complex|mixed $complex Complex number or a numeric value.
+ * @return Complex The hyperbolic tangent of the complex argument.
+ * @throws Exception If argument isn't a valid real or complex number.
+ * @throws \InvalidArgumentException If function would result in a division by zero
+ */
+ public static function tanh($complex): Complex
+ {
+ $complex = Complex::validateComplexArgument($complex);
+ $real = $complex->getReal();
+ $imaginary = $complex->getImaginary();
+ $divisor = \cos($imaginary) * \cos($imaginary) + \sinh($real) * \sinh($real);
+ if ($divisor == 0.0) {
+ throw new InvalidArgumentException('Division by zero');
+ }
+
+ return new Complex(
+ \sinh($real) * \cosh($real) / $divisor,
+ 0.5 * \sin(2 * $imaginary) / $divisor,
+ $complex->getSuffix()
+ );
+ }
+
+ /**
+ * Returns the theta of a complex number.
+ * This is the angle in radians from the real axis to the representation of the number in polar coordinates.
+ *
+ * @param Complex|mixed $complex Complex number or a numeric value.
+ * @return float The theta value of the complex argument.
+ * @throws Exception If argument isn't a valid real or complex number.
+ */
+ public static function theta($complex): float
+ {
+ $complex = Complex::validateComplexArgument($complex);
+
+ if ($complex->getReal() == 0.0) {
+ if ($complex->isReal()) {
+ return 0.0;
+ } elseif ($complex->getImaginary() < 0.0) {
+ return M_PI / -2;
+ }
+ return M_PI / 2;
+ } elseif ($complex->getReal() > 0.0) {
+ return \atan($complex->getImaginary() / $complex->getReal());
+ } elseif ($complex->getImaginary() < 0.0) {
+ return -(M_PI - \atan(\abs($complex->getImaginary()) / \abs($complex->getReal())));
+ }
+
+ return M_PI - \atan($complex->getImaginary() / \abs($complex->getReal()));
+ }
+}
diff --git a/public/vendor/markbaker/complex/classes/src/Operations.php b/public/vendor/markbaker/complex/classes/src/Operations.php
new file mode 100644
index 0000000..b13a873
--- /dev/null
+++ b/public/vendor/markbaker/complex/classes/src/Operations.php
@@ -0,0 +1,210 @@
+isComplex() && $complex->isComplex() &&
+ $result->getSuffix() !== $complex->getSuffix()) {
+ throw new Exception('Suffix Mismatch');
+ }
+
+ $real = $result->getReal() + $complex->getReal();
+ $imaginary = $result->getImaginary() + $complex->getImaginary();
+
+ $result = new Complex(
+ $real,
+ $imaginary,
+ ($imaginary == 0.0) ? null : max($result->getSuffix(), $complex->getSuffix())
+ );
+ }
+
+ return $result;
+ }
+
+ /**
+ * Divides two or more complex numbers
+ *
+ * @param array of string|integer|float|Complex $complexValues The numbers to divide
+ * @return Complex
+ */
+ public static function divideby(...$complexValues): Complex
+ {
+ if (count($complexValues) < 2) {
+ throw new \Exception('This function requires at least 2 arguments');
+ }
+
+ $base = array_shift($complexValues);
+ $result = clone Complex::validateComplexArgument($base);
+
+ foreach ($complexValues as $complex) {
+ $complex = Complex::validateComplexArgument($complex);
+
+ if ($result->isComplex() && $complex->isComplex() &&
+ $result->getSuffix() !== $complex->getSuffix()) {
+ throw new Exception('Suffix Mismatch');
+ }
+ if ($complex->getReal() == 0.0 && $complex->getImaginary() == 0.0) {
+ throw new InvalidArgumentException('Division by zero');
+ }
+
+ $delta1 = ($result->getReal() * $complex->getReal()) +
+ ($result->getImaginary() * $complex->getImaginary());
+ $delta2 = ($result->getImaginary() * $complex->getReal()) -
+ ($result->getReal() * $complex->getImaginary());
+ $delta3 = ($complex->getReal() * $complex->getReal()) +
+ ($complex->getImaginary() * $complex->getImaginary());
+
+ $real = $delta1 / $delta3;
+ $imaginary = $delta2 / $delta3;
+
+ $result = new Complex(
+ $real,
+ $imaginary,
+ ($imaginary == 0.0) ? null : max($result->getSuffix(), $complex->getSuffix())
+ );
+ }
+
+ return $result;
+ }
+
+ /**
+ * Divides two or more complex numbers
+ *
+ * @param array of string|integer|float|Complex $complexValues The numbers to divide
+ * @return Complex
+ */
+ public static function divideinto(...$complexValues): Complex
+ {
+ if (count($complexValues) < 2) {
+ throw new \Exception('This function requires at least 2 arguments');
+ }
+
+ $base = array_shift($complexValues);
+ $result = clone Complex::validateComplexArgument($base);
+
+ foreach ($complexValues as $complex) {
+ $complex = Complex::validateComplexArgument($complex);
+
+ if ($result->isComplex() && $complex->isComplex() &&
+ $result->getSuffix() !== $complex->getSuffix()) {
+ throw new Exception('Suffix Mismatch');
+ }
+ if ($result->getReal() == 0.0 && $result->getImaginary() == 0.0) {
+ throw new InvalidArgumentException('Division by zero');
+ }
+
+ $delta1 = ($complex->getReal() * $result->getReal()) +
+ ($complex->getImaginary() * $result->getImaginary());
+ $delta2 = ($complex->getImaginary() * $result->getReal()) -
+ ($complex->getReal() * $result->getImaginary());
+ $delta3 = ($result->getReal() * $result->getReal()) +
+ ($result->getImaginary() * $result->getImaginary());
+
+ $real = $delta1 / $delta3;
+ $imaginary = $delta2 / $delta3;
+
+ $result = new Complex(
+ $real,
+ $imaginary,
+ ($imaginary == 0.0) ? null : max($result->getSuffix(), $complex->getSuffix())
+ );
+ }
+
+ return $result;
+ }
+
+ /**
+ * Multiplies two or more complex numbers
+ *
+ * @param array of string|integer|float|Complex $complexValues The numbers to multiply
+ * @return Complex
+ */
+ public static function multiply(...$complexValues): Complex
+ {
+ if (count($complexValues) < 2) {
+ throw new \Exception('This function requires at least 2 arguments');
+ }
+
+ $base = array_shift($complexValues);
+ $result = clone Complex::validateComplexArgument($base);
+
+ foreach ($complexValues as $complex) {
+ $complex = Complex::validateComplexArgument($complex);
+
+ if ($result->isComplex() && $complex->isComplex() &&
+ $result->getSuffix() !== $complex->getSuffix()) {
+ throw new Exception('Suffix Mismatch');
+ }
+
+ $real = ($result->getReal() * $complex->getReal()) -
+ ($result->getImaginary() * $complex->getImaginary());
+ $imaginary = ($result->getReal() * $complex->getImaginary()) +
+ ($result->getImaginary() * $complex->getReal());
+
+ $result = new Complex(
+ $real,
+ $imaginary,
+ ($imaginary == 0.0) ? null : max($result->getSuffix(), $complex->getSuffix())
+ );
+ }
+
+ return $result;
+ }
+
+ /**
+ * Subtracts two or more complex numbers
+ *
+ * @param array of string|integer|float|Complex $complexValues The numbers to subtract
+ * @return Complex
+ */
+ public static function subtract(...$complexValues): Complex
+ {
+ if (count($complexValues) < 2) {
+ throw new \Exception('This function requires at least 2 arguments');
+ }
+
+ $base = array_shift($complexValues);
+ $result = clone Complex::validateComplexArgument($base);
+
+ foreach ($complexValues as $complex) {
+ $complex = Complex::validateComplexArgument($complex);
+
+ if ($result->isComplex() && $complex->isComplex() &&
+ $result->getSuffix() !== $complex->getSuffix()) {
+ throw new Exception('Suffix Mismatch');
+ }
+
+ $real = $result->getReal() - $complex->getReal();
+ $imaginary = $result->getImaginary() - $complex->getImaginary();
+
+ $result = new Complex(
+ $real,
+ $imaginary,
+ ($imaginary == 0.0) ? null : max($result->getSuffix(), $complex->getSuffix())
+ );
+ }
+
+ return $result;
+ }
+}
diff --git a/public/vendor/markbaker/complex/composer.json b/public/vendor/markbaker/complex/composer.json
new file mode 100644
index 0000000..246683c
--- /dev/null
+++ b/public/vendor/markbaker/complex/composer.json
@@ -0,0 +1,40 @@
+{
+ "name": "markbaker/complex",
+ "type": "library",
+ "description": "PHP Class for working with complex numbers",
+ "keywords": ["complex", "mathematics"],
+ "homepage": "https://github.com/MarkBaker/PHPComplex",
+ "license": "MIT",
+ "authors": [
+ {
+ "name": "Mark Baker",
+ "email": "mark@lange.demon.co.uk"
+ }
+ ],
+ "config": {
+ "sort-packages": true,
+ "allow-plugins": {
+ "dealerdirect/phpcodesniffer-composer-installer": true,
+ "markbaker/ukraine": true
+ }
+ },
+ "require": {
+ "php": "^7.2 || ^8.0"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0",
+ "squizlabs/php_codesniffer": "^3.7",
+ "phpcompatibility/php-compatibility": "^9.3",
+ "dealerdirect/phpcodesniffer-composer-installer": "dev-master"
+ },
+ "autoload": {
+ "psr-4": {
+ "Complex\\": "classes/src/"
+ }
+ },
+ "scripts": {
+ "style": "phpcs --report-width=200 --standard=PSR2 --report=summary,full classes/src/ unitTests/classes/src -n",
+ "versions": "phpcs --report-width=200 --standard=PHPCompatibility --report=summary,full classes/src/ --runtime-set testVersion 7.2- -n"
+ },
+ "minimum-stability": "dev"
+}
diff --git a/public/vendor/markbaker/complex/examples/complexTest.php b/public/vendor/markbaker/complex/examples/complexTest.php
new file mode 100644
index 0000000..9a5e123
--- /dev/null
+++ b/public/vendor/markbaker/complex/examples/complexTest.php
@@ -0,0 +1,154 @@
+add(456);
+echo $x, PHP_EOL;
+
+$x = new Complex(123.456);
+$x->add(789.012);
+echo $x, PHP_EOL;
+
+$x = new Complex(123.456, 78.90);
+$x->add(new Complex(-987.654, -32.1));
+echo $x, PHP_EOL;
+
+$x = new Complex(123.456, 78.90);
+$x->add(-987.654);
+echo $x, PHP_EOL;
+
+$x = new Complex(-987.654, -32.1);
+$x->add(new Complex(0, 1));
+echo $x, PHP_EOL;
+
+$x = new Complex(-987.654, -32.1);
+$x->add(new Complex(0, -1));
+echo $x, PHP_EOL;
+
+
+echo PHP_EOL, 'Subtract', PHP_EOL;
+
+$x = new Complex(123);
+$x->subtract(456);
+echo $x, PHP_EOL;
+
+$x = new Complex(123.456);
+$x->subtract(789.012);
+echo $x, PHP_EOL;
+
+$x = new Complex(123.456, 78.90);
+$x->subtract(new Complex(-987.654, -32.1));
+echo $x, PHP_EOL;
+
+$x = new Complex(123.456, 78.90);
+$x->subtract(-987.654);
+echo $x, PHP_EOL;
+
+$x = new Complex(-987.654, -32.1);
+$x->subtract(new Complex(0, 1));
+echo $x, PHP_EOL;
+
+$x = new Complex(-987.654, -32.1);
+$x->subtract(new Complex(0, -1));
+echo $x, PHP_EOL;
+
+
+echo PHP_EOL, 'Multiply', PHP_EOL;
+
+$x = new Complex(123);
+$x->multiply(456);
+echo $x, PHP_EOL;
+
+$x = new Complex(123.456);
+$x->multiply(789.012);
+echo $x, PHP_EOL;
+
+$x = new Complex(123.456, 78.90);
+$x->multiply(new Complex(-987.654, -32.1));
+echo $x, PHP_EOL;
+
+$x = new Complex(123.456, 78.90);
+$x->multiply(-987.654);
+echo $x, PHP_EOL;
+
+$x = new Complex(-987.654, -32.1);
+$x->multiply(new Complex(0, 1));
+echo $x, PHP_EOL;
+
+$x = new Complex(-987.654, -32.1);
+$x->multiply(new Complex(0, -1));
+echo $x, PHP_EOL;
+
+
+echo PHP_EOL, 'Divide By', PHP_EOL;
+
+$x = new Complex(123);
+$x->divideBy(456);
+echo $x, PHP_EOL;
+
+$x = new Complex(123.456);
+$x->divideBy(789.012);
+echo $x, PHP_EOL;
+
+$x = new Complex(123.456, 78.90);
+$x->divideBy(new Complex(-987.654, -32.1));
+echo $x, PHP_EOL;
+
+$x = new Complex(123.456, 78.90);
+$x->divideBy(-987.654);
+echo $x, PHP_EOL;
+
+$x = new Complex(-987.654, -32.1);
+$x->divideBy(new Complex(0, 1));
+echo $x, PHP_EOL;
+
+$x = new Complex(-987.654, -32.1);
+$x->divideBy(new Complex(0, -1));
+echo $x, PHP_EOL;
+
+
+echo PHP_EOL, 'Divide Into', PHP_EOL;
+
+$x = new Complex(123);
+$x->divideInto(456);
+echo $x, PHP_EOL;
+
+$x = new Complex(123.456);
+$x->divideInto(789.012);
+echo $x, PHP_EOL;
+
+$x = new Complex(123.456, 78.90);
+$x->divideInto(new Complex(-987.654, -32.1));
+echo $x, PHP_EOL;
+
+$x = new Complex(123.456, 78.90);
+$x->divideInto(-987.654);
+echo $x, PHP_EOL;
+
+$x = new Complex(-987.654, -32.1);
+$x->divideInto(new Complex(0, 1));
+echo $x, PHP_EOL;
+
+$x = new Complex(-987.654, -32.1);
+$x->divideInto(new Complex(0, -1));
+echo $x, PHP_EOL;
diff --git a/public/vendor/markbaker/complex/examples/testFunctions.php b/public/vendor/markbaker/complex/examples/testFunctions.php
new file mode 100644
index 0000000..bad1c03
--- /dev/null
+++ b/public/vendor/markbaker/complex/examples/testFunctions.php
@@ -0,0 +1,52 @@
+getMessage(), PHP_EOL;
+ }
+ }
+ echo PHP_EOL;
+ }
+}
diff --git a/public/vendor/markbaker/complex/examples/testOperations.php b/public/vendor/markbaker/complex/examples/testOperations.php
new file mode 100644
index 0000000..2b7e0ba
--- /dev/null
+++ b/public/vendor/markbaker/complex/examples/testOperations.php
@@ -0,0 +1,35 @@
+ ', $result, PHP_EOL;
+
+echo PHP_EOL;
+
+echo 'Subtraction', PHP_EOL;
+
+$result = Operations::subtract(...$values);
+echo '=> ', $result, PHP_EOL;
+
+echo PHP_EOL;
+
+echo 'Multiplication', PHP_EOL;
+
+$result = Operations::multiply(...$values);
+echo '=> ', $result, PHP_EOL;
diff --git a/public/vendor/markbaker/complex/license.md b/public/vendor/markbaker/complex/license.md
new file mode 100644
index 0000000..5b4b156
--- /dev/null
+++ b/public/vendor/markbaker/complex/license.md
@@ -0,0 +1,25 @@
+The MIT License (MIT)
+=====================
+
+Copyright © `2017` `Mark Baker`
+
+Permission is hereby granted, free of charge, to any person
+obtaining a copy of this software and associated documentation
+files (the “Software”), to deal in the Software without
+restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
\ No newline at end of file
diff --git a/public/vendor/markbaker/matrix/.github/workflows/main.yaml b/public/vendor/markbaker/matrix/.github/workflows/main.yaml
new file mode 100644
index 0000000..5fa1bdb
--- /dev/null
+++ b/public/vendor/markbaker/matrix/.github/workflows/main.yaml
@@ -0,0 +1,124 @@
+name: main
+on: [ push, pull_request ]
+jobs:
+ test:
+ runs-on: ubuntu-latest
+ strategy:
+ matrix:
+ php-version:
+ - '7.1'
+ - '7.2'
+ - '7.3'
+ - '7.4'
+ - '8.0'
+ - '8.1'
+ - '8.2'
+
+ include:
+ - php-version: 'nightly'
+ experimental: true
+
+ name: PHP ${{ matrix.php-version }}
+
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v3
+
+ - name: Setup PHP, with composer and extensions
+ uses: shivammathur/setup-php@v2
+ with:
+ php-version: ${{ matrix.php-version }}
+ extensions: ctype, dom, gd, iconv, fileinfo, libxml, mbstring, simplexml, xml, xmlreader, xmlwriter, zip, zlib
+ coverage: none
+
+ - name: Get composer cache directory
+ id: composer-cache
+ run: echo "::set-output name=dir::$(composer config cache-files-dir)"
+
+ - name: Cache composer dependencies
+ uses: actions/cache@v3
+ with:
+ path: ${{ steps.composer-cache.outputs.dir }}
+ key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
+ restore-keys: ${{ runner.os }}-composer-
+
+ - name: Delete composer lock file
+ id: composer-lock
+ if: ${{ matrix.php-version == '8.0' || matrix.php-version == '8.1' || matrix.php-version == '8.2' || matrix.php-version == 'nightly' }}
+ run: |
+ rm composer.lock
+ echo "::set-output name=flags::--ignore-platform-reqs"
+
+ - name: Install dependencies
+ run: composer update --no-progress --prefer-dist --optimize-autoloader ${{ steps.composer-lock.outputs.flags }}
+
+ - name: Setup problem matchers for PHP
+ run: echo "::add-matcher::${{ runner.tool_cache }}/php.json"
+
+ - name: Setup problem matchers for PHPUnit
+ run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
+
+ - name: Test with PHPUnit
+ run: ./vendor/bin/phpunit
+
+ phpcs:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v3
+
+ - name: Setup PHP, with composer and extensions
+ uses: shivammathur/setup-php@v2
+ with:
+ php-version: 7.4
+ extensions: ctype, dom, gd, iconv, fileinfo, libxml, mbstring, simplexml, xml, xmlreader, xmlwriter, zip, zlib
+ coverage: none
+ tools: cs2pr
+
+ - name: Get composer cache directory
+ id: composer-cache
+ run: echo "::set-output name=dir::$(composer config cache-files-dir)"
+
+ - name: Cache composer dependencies
+ uses: actions/cache@v3
+ with:
+ path: ${{ steps.composer-cache.outputs.dir }}
+ key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
+ restore-keys: ${{ runner.os }}-composer-
+
+ - name: Install dependencies
+ run: composer install --no-progress --prefer-dist --optimize-autoloader
+
+ - name: Code style with PHP_CodeSniffer
+ run: ./vendor/bin/phpcs -q --report=checkstyle | cs2pr --graceful-warnings --colorize
+
+ coverage:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v3
+
+ - name: Setup PHP, with composer and extensions
+ uses: shivammathur/setup-php@v2
+ with:
+ php-version: 7.4
+ extensions: ctype, dom, gd, iconv, fileinfo, libxml, mbstring, simplexml, xml, xmlreader, xmlwriter, zip, zlib
+ coverage: pcov
+
+ - name: Get composer cache directory
+ id: composer-cache
+ run: echo "::set-output name=dir::$(composer config cache-files-dir)"
+
+ - name: Cache composer dependencies
+ uses: actions/cache@v3
+ with:
+ path: ${{ steps.composer-cache.outputs.dir }}
+ key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
+ restore-keys: ${{ runner.os }}-composer-
+
+ - name: Install dependencies
+ run: composer install --no-progress --prefer-dist --optimize-autoloader
+
+ - name: Coverage
+ run: |
+ ./vendor/bin/phpunit --coverage-text
diff --git a/public/vendor/markbaker/matrix/README.md b/public/vendor/markbaker/matrix/README.md
new file mode 100644
index 0000000..d0dc914
--- /dev/null
+++ b/public/vendor/markbaker/matrix/README.md
@@ -0,0 +1,215 @@
+PHPMatrix
+==========
+
+---
+
+PHP Class for handling Matrices
+
+[](https://github.com/MarkBaker/PHPMatrix/actions)
+[](https://packagist.org/packages/markbaker/matrix)
+[](https://packagist.org/packages/markbaker/matrix)
+[](https://packagist.org/packages/markbaker/matrix)
+
+
+[](https://xkcd.com/184/)
+
+Matrix Transform
+
+---
+
+This library currently provides the following operations:
+
+ - addition
+ - direct sum
+ - subtraction
+ - multiplication
+ - division (using [A].[B]-1 )
+ - division by
+ - division into
+
+together with functions for
+
+ - adjoint
+ - antidiagonal
+ - cofactors
+ - determinant
+ - diagonal
+ - identity
+ - inverse
+ - minors
+ - trace
+ - transpose
+ - solve
+
+ Given Matrices A and B, calculate X for A.X = B
+
+and classes for
+
+ - Decomposition
+ - LU Decomposition with partial row pivoting,
+
+ such that [P].[A] = [L].[U] and [A] = [P]| .[L].[U]
+ - QR Decomposition
+
+ such that [A] = [Q].[R]
+
+## TO DO
+
+ - power() function
+ - Decomposition
+ - Cholesky Decomposition
+ - EigenValue Decomposition
+ - EigenValues
+ - EigenVectors
+
+---
+
+# Installation
+
+```shell
+composer require markbaker/matrix:^3.0
+```
+
+# Important BC Note
+
+If you've previously been using procedural calls to functions and operations using this library, then from version 3.0 you should use [MarkBaker/PHPMatrixFunctions](https://github.com/MarkBaker/PHPMatrixFunctions) instead (available on packagist as [markbaker/matrix-functions](https://packagist.org/packages/markbaker/matrix-functions)).
+
+You'll need to replace `markbaker/matrix`in your `composer.json` file with the new library, but otherwise there should be no difference in the namespacing, or in the way that you have called the Matrix functions in the past, so no actual code changes are required.
+
+```shell
+composer require markbaker/matrix-functions:^1.0
+```
+
+You should not reference this library (`markbaker/matrix`) in your `composer.json`, composer wil take care of that for you.
+
+# Usage
+
+To create a new Matrix object, provide an array as the constructor argument
+
+```php
+$grid = [
+ [16, 3, 2, 13],
+ [ 5, 10, 11, 8],
+ [ 9, 6, 7, 12],
+ [ 4, 15, 14, 1],
+];
+
+$matrix = new Matrix\Matrix($grid);
+```
+The `Builder` class provides helper methods for creating specific matrices, specifically an identity matrix of a specified size; or a matrix of a specified dimensions, with every cell containing a set value.
+```php
+$matrix = Matrix\Builder::createFilledMatrix(1, 5, 3);
+```
+Will create a matrix of 5 rows and 3 columns, filled with a `1` in every cell; while
+```php
+$matrix = Matrix\Builder::createIdentityMatrix(3);
+```
+will create a 3x3 identity matrix.
+
+
+Matrix objects are immutable: whenever you call a method or pass a grid to a function that returns a matrix value, a new Matrix object will be returned, and the original will remain unchanged. This also allows you to chain multiple methods as you would for a fluent interface (as long as they are methods that will return a Matrix result).
+
+## Performing Mathematical Operations
+
+To perform mathematical operations with Matrices, you can call the appropriate method against a matrix value, passing other values as arguments
+
+```php
+$matrix1 = new Matrix\Matrix([
+ [2, 7, 6],
+ [9, 5, 1],
+ [4, 3, 8],
+]);
+$matrix2 = new Matrix\Matrix([
+ [1, 2, 3],
+ [4, 5, 6],
+ [7, 8, 9],
+]);
+
+var_dump($matrix1->multiply($matrix2)->toArray());
+```
+or pass all values to the appropriate static method
+```php
+$matrix1 = new Matrix\Matrix([
+ [2, 7, 6],
+ [9, 5, 1],
+ [4, 3, 8],
+]);
+$matrix2 = new Matrix\Matrix([
+ [1, 2, 3],
+ [4, 5, 6],
+ [7, 8, 9],
+]);
+
+var_dump(Matrix\Operations::multiply($matrix1, $matrix2)->toArray());
+```
+You can pass in the arguments as Matrix objects, or as arrays.
+
+If you want to perform the same operation against multiple values (e.g. to add three or more matrices), then you can pass multiple arguments to any of the operations.
+
+## Using functions
+
+When calling any of the available functions for a matrix value, you can either call the relevant method for the Matrix object
+```php
+$grid = [
+ [16, 3, 2, 13],
+ [ 5, 10, 11, 8],
+ [ 9, 6, 7, 12],
+ [ 4, 15, 14, 1],
+];
+
+$matrix = new Matrix\Matrix($grid);
+
+echo $matrix->trace();
+```
+or you can call the static method, passing the Matrix object or array as an argument
+```php
+$grid = [
+ [16, 3, 2, 13],
+ [ 5, 10, 11, 8],
+ [ 9, 6, 7, 12],
+ [ 4, 15, 14, 1],
+];
+
+$matrix = new Matrix\Matrix($grid);
+echo Matrix\Functions::trace($matrix);
+```
+```php
+$grid = [
+ [16, 3, 2, 13],
+ [ 5, 10, 11, 8],
+ [ 9, 6, 7, 12],
+ [ 4, 15, 14, 1],
+];
+
+echo Matrix\Functions::trace($grid);
+```
+
+## Decomposition
+
+The library also provides classes for matrix decomposition. You can access these using
+```php
+$grid = [
+ [1, 2],
+ [3, 4],
+];
+
+$matrix = new Matrix\Matrix($grid);
+
+$decomposition = new Matrix\Decomposition\QR($matrix);
+$Q = $decomposition->getQ();
+$R = $decomposition->getR();
+```
+
+or alternatively us the `Decomposition` factory, identifying which form of decomposition you want to use
+```php
+$grid = [
+ [1, 2],
+ [3, 4],
+];
+
+$matrix = new Matrix\Matrix($grid);
+
+$decomposition = Matrix\Decomposition\Decomposition::decomposition(Matrix\Decomposition\Decomposition::QR, $matrix);
+$Q = $decomposition->getQ();
+$R = $decomposition->getR();
+```
diff --git a/public/vendor/markbaker/matrix/buildPhar.php b/public/vendor/markbaker/matrix/buildPhar.php
new file mode 100644
index 0000000..e1b8f96
--- /dev/null
+++ b/public/vendor/markbaker/matrix/buildPhar.php
@@ -0,0 +1,62 @@
+ 'Mark Baker ',
+ 'Description' => 'PHP Class for working with Matrix numbers',
+ 'Copyright' => 'Mark Baker (c) 2013-' . date('Y'),
+ 'Timestamp' => time(),
+ 'Version' => '0.1.0',
+ 'Date' => date('Y-m-d')
+);
+
+// cleanup
+if (file_exists($pharName)) {
+ echo "Removed: {$pharName}\n";
+ unlink($pharName);
+}
+
+echo "Building phar file...\n";
+
+// the phar object
+$phar = new Phar($pharName, null, 'Matrix');
+$phar->buildFromDirectory($sourceDir);
+$phar->setStub(
+<<<'EOT'
+getMessage());
+ exit(1);
+ }
+
+ include 'phar://functions/sqrt.php';
+
+ __HALT_COMPILER();
+EOT
+);
+$phar->setMetadata($metaData);
+$phar->compressFiles(Phar::GZ);
+
+echo "Complete.\n";
+
+exit();
diff --git a/public/vendor/markbaker/matrix/classes/src/Builder.php b/public/vendor/markbaker/matrix/classes/src/Builder.php
new file mode 100644
index 0000000..161bb68
--- /dev/null
+++ b/public/vendor/markbaker/matrix/classes/src/Builder.php
@@ -0,0 +1,70 @@
+toArray();
+
+ for ($x = 0; $x < $dimensions; ++$x) {
+ $grid[$x][$x] = 1;
+ }
+
+ return new Matrix($grid);
+ }
+}
diff --git a/public/vendor/markbaker/matrix/classes/src/Decomposition/Decomposition.php b/public/vendor/markbaker/matrix/classes/src/Decomposition/Decomposition.php
new file mode 100644
index 0000000..f014448
--- /dev/null
+++ b/public/vendor/markbaker/matrix/classes/src/Decomposition/Decomposition.php
@@ -0,0 +1,27 @@
+luMatrix = $matrix->toArray();
+ $this->rows = $matrix->rows;
+ $this->columns = $matrix->columns;
+
+ $this->buildPivot();
+ }
+
+ /**
+ * Get lower triangular factor.
+ *
+ * @return Matrix Lower triangular factor
+ */
+ public function getL(): Matrix
+ {
+ $lower = [];
+
+ $columns = min($this->rows, $this->columns);
+ for ($row = 0; $row < $this->rows; ++$row) {
+ for ($column = 0; $column < $columns; ++$column) {
+ if ($row > $column) {
+ $lower[$row][$column] = $this->luMatrix[$row][$column];
+ } elseif ($row === $column) {
+ $lower[$row][$column] = 1.0;
+ } else {
+ $lower[$row][$column] = 0.0;
+ }
+ }
+ }
+
+ return new Matrix($lower);
+ }
+
+ /**
+ * Get upper triangular factor.
+ *
+ * @return Matrix Upper triangular factor
+ */
+ public function getU(): Matrix
+ {
+ $upper = [];
+
+ $rows = min($this->rows, $this->columns);
+ for ($row = 0; $row < $rows; ++$row) {
+ for ($column = 0; $column < $this->columns; ++$column) {
+ if ($row <= $column) {
+ $upper[$row][$column] = $this->luMatrix[$row][$column];
+ } else {
+ $upper[$row][$column] = 0.0;
+ }
+ }
+ }
+
+ return new Matrix($upper);
+ }
+
+ /**
+ * Return pivot permutation vector.
+ *
+ * @return Matrix Pivot matrix
+ */
+ public function getP(): Matrix
+ {
+ $pMatrix = [];
+
+ $pivots = $this->pivot;
+ $pivotCount = count($pivots);
+ foreach ($pivots as $row => $pivot) {
+ $pMatrix[$row] = array_fill(0, $pivotCount, 0);
+ $pMatrix[$row][$pivot] = 1;
+ }
+
+ return new Matrix($pMatrix);
+ }
+
+ /**
+ * Return pivot permutation vector.
+ *
+ * @return array Pivot vector
+ */
+ public function getPivot(): array
+ {
+ return $this->pivot;
+ }
+
+ /**
+ * Is the matrix nonsingular?
+ *
+ * @return bool true if U, and hence A, is nonsingular
+ */
+ public function isNonsingular(): bool
+ {
+ for ($diagonal = 0; $diagonal < $this->columns; ++$diagonal) {
+ if ($this->luMatrix[$diagonal][$diagonal] === 0.0) {
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ private function buildPivot(): void
+ {
+ for ($row = 0; $row < $this->rows; ++$row) {
+ $this->pivot[$row] = $row;
+ }
+
+ for ($column = 0; $column < $this->columns; ++$column) {
+ $luColumn = $this->localisedReferenceColumn($column);
+
+ $this->applyTransformations($column, $luColumn);
+
+ $pivot = $this->findPivot($column, $luColumn);
+ if ($pivot !== $column) {
+ $this->pivotExchange($pivot, $column);
+ }
+
+ $this->computeMultipliers($column);
+
+ unset($luColumn);
+ }
+ }
+
+ private function localisedReferenceColumn($column): array
+ {
+ $luColumn = [];
+
+ for ($row = 0; $row < $this->rows; ++$row) {
+ $luColumn[$row] = &$this->luMatrix[$row][$column];
+ }
+
+ return $luColumn;
+ }
+
+ private function applyTransformations($column, array $luColumn): void
+ {
+ for ($row = 0; $row < $this->rows; ++$row) {
+ $luRow = $this->luMatrix[$row];
+ // Most of the time is spent in the following dot product.
+ $kmax = min($row, $column);
+ $sValue = 0.0;
+ for ($kValue = 0; $kValue < $kmax; ++$kValue) {
+ $sValue += $luRow[$kValue] * $luColumn[$kValue];
+ }
+ $luRow[$column] = $luColumn[$row] -= $sValue;
+ }
+ }
+
+ private function findPivot($column, array $luColumn): int
+ {
+ $pivot = $column;
+ for ($row = $column + 1; $row < $this->rows; ++$row) {
+ if (abs($luColumn[$row]) > abs($luColumn[$pivot])) {
+ $pivot = $row;
+ }
+ }
+
+ return $pivot;
+ }
+
+ private function pivotExchange($pivot, $column): void
+ {
+ for ($kValue = 0; $kValue < $this->columns; ++$kValue) {
+ $tValue = $this->luMatrix[$pivot][$kValue];
+ $this->luMatrix[$pivot][$kValue] = $this->luMatrix[$column][$kValue];
+ $this->luMatrix[$column][$kValue] = $tValue;
+ }
+
+ $lValue = $this->pivot[$pivot];
+ $this->pivot[$pivot] = $this->pivot[$column];
+ $this->pivot[$column] = $lValue;
+ }
+
+ private function computeMultipliers($diagonal): void
+ {
+ if (($diagonal < $this->rows) && ($this->luMatrix[$diagonal][$diagonal] != 0.0)) {
+ for ($row = $diagonal + 1; $row < $this->rows; ++$row) {
+ $this->luMatrix[$row][$diagonal] /= $this->luMatrix[$diagonal][$diagonal];
+ }
+ }
+ }
+
+ private function pivotB(Matrix $B): array
+ {
+ $X = [];
+ foreach ($this->pivot as $rowId) {
+ $row = $B->getRows($rowId + 1)->toArray();
+ $X[] = array_pop($row);
+ }
+
+ return $X;
+ }
+
+ /**
+ * Solve A*X = B.
+ *
+ * @param Matrix $B a Matrix with as many rows as A and any number of columns
+ *
+ * @throws Exception
+ *
+ * @return Matrix X so that L*U*X = B(piv,:)
+ */
+ public function solve(Matrix $B): Matrix
+ {
+ if ($B->rows !== $this->rows) {
+ throw new Exception('Matrix row dimensions are not equal');
+ }
+
+ if ($this->rows !== $this->columns) {
+ throw new Exception('LU solve() only works on square matrices');
+ }
+
+ if (!$this->isNonsingular()) {
+ throw new Exception('Can only perform operation on singular matrix');
+ }
+
+ // Copy right hand side with pivoting
+ $nx = $B->columns;
+ $X = $this->pivotB($B);
+
+ // Solve L*Y = B(piv,:)
+ for ($k = 0; $k < $this->columns; ++$k) {
+ for ($i = $k + 1; $i < $this->columns; ++$i) {
+ for ($j = 0; $j < $nx; ++$j) {
+ $X[$i][$j] -= $X[$k][$j] * $this->luMatrix[$i][$k];
+ }
+ }
+ }
+
+ // Solve U*X = Y;
+ for ($k = $this->columns - 1; $k >= 0; --$k) {
+ for ($j = 0; $j < $nx; ++$j) {
+ $X[$k][$j] /= $this->luMatrix[$k][$k];
+ }
+ for ($i = 0; $i < $k; ++$i) {
+ for ($j = 0; $j < $nx; ++$j) {
+ $X[$i][$j] -= $X[$k][$j] * $this->luMatrix[$i][$k];
+ }
+ }
+ }
+
+ return new Matrix($X);
+ }
+}
diff --git a/public/vendor/markbaker/matrix/classes/src/Decomposition/QR.php b/public/vendor/markbaker/matrix/classes/src/Decomposition/QR.php
new file mode 100644
index 0000000..4b6106f
--- /dev/null
+++ b/public/vendor/markbaker/matrix/classes/src/Decomposition/QR.php
@@ -0,0 +1,191 @@
+qrMatrix = $matrix->toArray();
+ $this->rows = $matrix->rows;
+ $this->columns = $matrix->columns;
+
+ $this->decompose();
+ }
+
+ public function getHouseholdVectors(): Matrix
+ {
+ $householdVectors = [];
+ for ($row = 0; $row < $this->rows; ++$row) {
+ for ($column = 0; $column < $this->columns; ++$column) {
+ if ($row >= $column) {
+ $householdVectors[$row][$column] = $this->qrMatrix[$row][$column];
+ } else {
+ $householdVectors[$row][$column] = 0.0;
+ }
+ }
+ }
+
+ return new Matrix($householdVectors);
+ }
+
+ public function getQ(): Matrix
+ {
+ $qGrid = [];
+
+ $rowCount = $this->rows;
+ for ($k = $this->columns - 1; $k >= 0; --$k) {
+ for ($i = 0; $i < $this->rows; ++$i) {
+ $qGrid[$i][$k] = 0.0;
+ }
+ $qGrid[$k][$k] = 1.0;
+ if ($this->columns > $this->rows) {
+ $qGrid = array_slice($qGrid, 0, $this->rows);
+ }
+
+ for ($j = $k; $j < $this->columns; ++$j) {
+ if (isset($this->qrMatrix[$k], $this->qrMatrix[$k][$k]) && $this->qrMatrix[$k][$k] != 0.0) {
+ $s = 0.0;
+ for ($i = $k; $i < $this->rows; ++$i) {
+ $s += $this->qrMatrix[$i][$k] * $qGrid[$i][$j];
+ }
+ $s = -$s / $this->qrMatrix[$k][$k];
+ for ($i = $k; $i < $this->rows; ++$i) {
+ $qGrid[$i][$j] += $s * $this->qrMatrix[$i][$k];
+ }
+ }
+ }
+ }
+
+ array_walk(
+ $qGrid,
+ function (&$row) use ($rowCount) {
+ $row = array_reverse($row);
+ $row = array_slice($row, 0, $rowCount);
+ }
+ );
+
+ return new Matrix($qGrid);
+ }
+
+ public function getR(): Matrix
+ {
+ $rGrid = [];
+
+ for ($row = 0; $row < $this->columns; ++$row) {
+ for ($column = 0; $column < $this->columns; ++$column) {
+ if ($row < $column) {
+ $rGrid[$row][$column] = $this->qrMatrix[$row][$column] ?? 0.0;
+ } elseif ($row === $column) {
+ $rGrid[$row][$column] = $this->rDiagonal[$row] ?? 0.0;
+ } else {
+ $rGrid[$row][$column] = 0.0;
+ }
+ }
+ }
+
+ if ($this->columns > $this->rows) {
+ $rGrid = array_slice($rGrid, 0, $this->rows);
+ }
+
+ return new Matrix($rGrid);
+ }
+
+ private function hypo($a, $b): float
+ {
+ if (abs($a) > abs($b)) {
+ $r = $b / $a;
+ $r = abs($a) * sqrt(1 + $r * $r);
+ } elseif ($b != 0.0) {
+ $r = $a / $b;
+ $r = abs($b) * sqrt(1 + $r * $r);
+ } else {
+ $r = 0.0;
+ }
+
+ return $r;
+ }
+
+ /**
+ * QR Decomposition computed by Householder reflections.
+ */
+ private function decompose(): void
+ {
+ for ($k = 0; $k < $this->columns; ++$k) {
+ // Compute 2-norm of k-th column without under/overflow.
+ $norm = 0.0;
+ for ($i = $k; $i < $this->rows; ++$i) {
+ $norm = $this->hypo($norm, $this->qrMatrix[$i][$k]);
+ }
+ if ($norm != 0.0) {
+ // Form k-th Householder vector.
+ if ($this->qrMatrix[$k][$k] < 0.0) {
+ $norm = -$norm;
+ }
+ for ($i = $k; $i < $this->rows; ++$i) {
+ $this->qrMatrix[$i][$k] /= $norm;
+ }
+ $this->qrMatrix[$k][$k] += 1.0;
+ // Apply transformation to remaining columns.
+ for ($j = $k + 1; $j < $this->columns; ++$j) {
+ $s = 0.0;
+ for ($i = $k; $i < $this->rows; ++$i) {
+ $s += $this->qrMatrix[$i][$k] * $this->qrMatrix[$i][$j];
+ }
+ $s = -$s / $this->qrMatrix[$k][$k];
+ for ($i = $k; $i < $this->rows; ++$i) {
+ $this->qrMatrix[$i][$j] += $s * $this->qrMatrix[$i][$k];
+ }
+ }
+ }
+ $this->rDiagonal[$k] = -$norm;
+ }
+ }
+
+ public function isFullRank(): bool
+ {
+ for ($j = 0; $j < $this->columns; ++$j) {
+ if ($this->rDiagonal[$j] == 0.0) {
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ /**
+ * Least squares solution of A*X = B.
+ *
+ * @param Matrix $B a Matrix with as many rows as A and any number of columns
+ *
+ * @throws Exception
+ *
+ * @return Matrix matrix that minimizes the two norm of Q*R*X-B
+ */
+ public function solve(Matrix $B): Matrix
+ {
+ if ($B->rows !== $this->rows) {
+ throw new Exception('Matrix row dimensions are not equal');
+ }
+
+ if (!$this->isFullRank()) {
+ throw new Exception('Can only perform this operation on a full-rank matrix');
+ }
+
+ // Compute Y = transpose(Q)*B
+ $Y = $this->getQ()->transpose()
+ ->multiply($B);
+ // Solve R*X = Y;
+ return $this->getR()->inverse()
+ ->multiply($Y);
+ }
+}
diff --git a/public/vendor/markbaker/matrix/classes/src/Div0Exception.php b/public/vendor/markbaker/matrix/classes/src/Div0Exception.php
new file mode 100644
index 0000000..eba28f8
--- /dev/null
+++ b/public/vendor/markbaker/matrix/classes/src/Div0Exception.php
@@ -0,0 +1,13 @@
+isSquare()) {
+ throw new Exception('Adjoint can only be calculated for a square matrix');
+ }
+
+ return self::getAdjoint($matrix);
+ }
+
+ /**
+ * Calculate the cofactors of the matrix
+ *
+ * @param Matrix $matrix The matrix whose cofactors we wish to calculate
+ * @return Matrix
+ *
+ * @throws Exception
+ */
+ private static function getCofactors(Matrix $matrix)
+ {
+ $cofactors = self::getMinors($matrix);
+ $dimensions = $matrix->rows;
+
+ $cof = 1;
+ for ($i = 0; $i < $dimensions; ++$i) {
+ $cofs = $cof;
+ for ($j = 0; $j < $dimensions; ++$j) {
+ $cofactors[$i][$j] *= $cofs;
+ $cofs = -$cofs;
+ }
+ $cof = -$cof;
+ }
+
+ return new Matrix($cofactors);
+ }
+
+ /**
+ * Return the cofactors of this matrix
+ *
+ * @param Matrix|array $matrix The matrix whose cofactors we wish to calculate
+ * @return Matrix
+ *
+ * @throws Exception
+ */
+ public static function cofactors($matrix)
+ {
+ $matrix = self::validateMatrix($matrix);
+
+ if (!$matrix->isSquare()) {
+ throw new Exception('Cofactors can only be calculated for a square matrix');
+ }
+
+ return self::getCofactors($matrix);
+ }
+
+ /**
+ * @param Matrix $matrix
+ * @param int $row
+ * @param int $column
+ * @return float
+ * @throws Exception
+ */
+ private static function getDeterminantSegment(Matrix $matrix, $row, $column)
+ {
+ $tmpMatrix = $matrix->toArray();
+ unset($tmpMatrix[$row]);
+ array_walk(
+ $tmpMatrix,
+ function (&$row) use ($column) {
+ unset($row[$column]);
+ }
+ );
+
+ return self::getDeterminant(new Matrix($tmpMatrix));
+ }
+
+ /**
+ * Calculate the determinant of the matrix
+ *
+ * @param Matrix $matrix The matrix whose determinant we wish to calculate
+ * @return float
+ *
+ * @throws Exception
+ */
+ private static function getDeterminant(Matrix $matrix)
+ {
+ $dimensions = $matrix->rows;
+ $determinant = 0;
+
+ switch ($dimensions) {
+ case 1:
+ $determinant = $matrix->getValue(1, 1);
+ break;
+ case 2:
+ $determinant = $matrix->getValue(1, 1) * $matrix->getValue(2, 2) -
+ $matrix->getValue(1, 2) * $matrix->getValue(2, 1);
+ break;
+ default:
+ for ($i = 1; $i <= $dimensions; ++$i) {
+ $det = $matrix->getValue(1, $i) * self::getDeterminantSegment($matrix, 0, $i - 1);
+ if (($i % 2) == 0) {
+ $determinant -= $det;
+ } else {
+ $determinant += $det;
+ }
+ }
+ break;
+ }
+
+ return $determinant;
+ }
+
+ /**
+ * Return the determinant of this matrix
+ *
+ * @param Matrix|array $matrix The matrix whose determinant we wish to calculate
+ * @return float
+ * @throws Exception
+ **/
+ public static function determinant($matrix)
+ {
+ $matrix = self::validateMatrix($matrix);
+
+ if (!$matrix->isSquare()) {
+ throw new Exception('Determinant can only be calculated for a square matrix');
+ }
+
+ return self::getDeterminant($matrix);
+ }
+
+ /**
+ * Return the diagonal of this matrix
+ *
+ * @param Matrix|array $matrix The matrix whose diagonal we wish to calculate
+ * @return Matrix
+ * @throws Exception
+ **/
+ public static function diagonal($matrix)
+ {
+ $matrix = self::validateMatrix($matrix);
+
+ if (!$matrix->isSquare()) {
+ throw new Exception('Diagonal can only be extracted from a square matrix');
+ }
+
+ $dimensions = $matrix->rows;
+ $grid = Builder::createFilledMatrix(0, $dimensions, $dimensions)
+ ->toArray();
+
+ for ($i = 0; $i < $dimensions; ++$i) {
+ $grid[$i][$i] = $matrix->getValue($i + 1, $i + 1);
+ }
+
+ return new Matrix($grid);
+ }
+
+ /**
+ * Return the antidiagonal of this matrix
+ *
+ * @param Matrix|array $matrix The matrix whose antidiagonal we wish to calculate
+ * @return Matrix
+ * @throws Exception
+ **/
+ public static function antidiagonal($matrix)
+ {
+ $matrix = self::validateMatrix($matrix);
+
+ if (!$matrix->isSquare()) {
+ throw new Exception('Anti-Diagonal can only be extracted from a square matrix');
+ }
+
+ $dimensions = $matrix->rows;
+ $grid = Builder::createFilledMatrix(0, $dimensions, $dimensions)
+ ->toArray();
+
+ for ($i = 0; $i < $dimensions; ++$i) {
+ $grid[$i][$dimensions - $i - 1] = $matrix->getValue($i + 1, $dimensions - $i);
+ }
+
+ return new Matrix($grid);
+ }
+
+ /**
+ * Return the identity matrix
+ * The identity matrix, or sometimes ambiguously called a unit matrix, of size n is the n × n square matrix
+ * with ones on the main diagonal and zeros elsewhere
+ *
+ * @param Matrix|array $matrix The matrix whose identity we wish to calculate
+ * @return Matrix
+ * @throws Exception
+ **/
+ public static function identity($matrix)
+ {
+ $matrix = self::validateMatrix($matrix);
+
+ if (!$matrix->isSquare()) {
+ throw new Exception('Identity can only be created for a square matrix');
+ }
+
+ $dimensions = $matrix->rows;
+
+ return Builder::createIdentityMatrix($dimensions);
+ }
+
+ /**
+ * Return the inverse of this matrix
+ *
+ * @param Matrix|array $matrix The matrix whose inverse we wish to calculate
+ * @return Matrix
+ * @throws Exception
+ **/
+ public static function inverse($matrix, string $type = 'inverse')
+ {
+ $matrix = self::validateMatrix($matrix);
+
+ if (!$matrix->isSquare()) {
+ throw new Exception(ucfirst($type) . ' can only be calculated for a square matrix');
+ }
+
+ $determinant = self::getDeterminant($matrix);
+ if ($determinant == 0.0) {
+ throw new Div0Exception(ucfirst($type) . ' can only be calculated for a matrix with a non-zero determinant');
+ }
+
+ if ($matrix->rows == 1) {
+ return new Matrix([[1 / $matrix->getValue(1, 1)]]);
+ }
+
+ return self::getAdjoint($matrix)
+ ->multiply(1 / $determinant);
+ }
+
+ /**
+ * Calculate the minors of the matrix
+ *
+ * @param Matrix $matrix The matrix whose minors we wish to calculate
+ * @return array[]
+ *
+ * @throws Exception
+ */
+ protected static function getMinors(Matrix $matrix)
+ {
+ $minors = $matrix->toArray();
+ $dimensions = $matrix->rows;
+ if ($dimensions == 1) {
+ return $minors;
+ }
+
+ for ($i = 0; $i < $dimensions; ++$i) {
+ for ($j = 0; $j < $dimensions; ++$j) {
+ $minors[$i][$j] = self::getDeterminantSegment($matrix, $i, $j);
+ }
+ }
+
+ return $minors;
+ }
+
+ /**
+ * Return the minors of the matrix
+ * The minor of a matrix A is the determinant of some smaller square matrix, cut down from A by removing one or
+ * more of its rows or columns.
+ * Minors obtained by removing just one row and one column from square matrices (first minors) are required for
+ * calculating matrix cofactors, which in turn are useful for computing both the determinant and inverse of
+ * square matrices.
+ *
+ * @param Matrix|array $matrix The matrix whose minors we wish to calculate
+ * @return Matrix
+ * @throws Exception
+ **/
+ public static function minors($matrix)
+ {
+ $matrix = self::validateMatrix($matrix);
+
+ if (!$matrix->isSquare()) {
+ throw new Exception('Minors can only be calculated for a square matrix');
+ }
+
+ return new Matrix(self::getMinors($matrix));
+ }
+
+ /**
+ * Return the trace of this matrix
+ * The trace is defined as the sum of the elements on the main diagonal (the diagonal from the upper left to the lower right)
+ * of the matrix
+ *
+ * @param Matrix|array $matrix The matrix whose trace we wish to calculate
+ * @return float
+ * @throws Exception
+ **/
+ public static function trace($matrix)
+ {
+ $matrix = self::validateMatrix($matrix);
+
+ if (!$matrix->isSquare()) {
+ throw new Exception('Trace can only be extracted from a square matrix');
+ }
+
+ $dimensions = $matrix->rows;
+ $result = 0;
+ for ($i = 1; $i <= $dimensions; ++$i) {
+ $result += $matrix->getValue($i, $i);
+ }
+
+ return $result;
+ }
+
+ /**
+ * Return the transpose of this matrix
+ *
+ * @param Matrix|\a $matrix The matrix whose transpose we wish to calculate
+ * @return Matrix
+ **/
+ public static function transpose($matrix)
+ {
+ $matrix = self::validateMatrix($matrix);
+
+ $array = array_values(array_merge([null], $matrix->toArray()));
+ $grid = call_user_func_array(
+ 'array_map',
+ $array
+ );
+
+ return new Matrix($grid);
+ }
+}
diff --git a/public/vendor/markbaker/matrix/classes/src/Matrix.php b/public/vendor/markbaker/matrix/classes/src/Matrix.php
new file mode 100644
index 0000000..95f55e7
--- /dev/null
+++ b/public/vendor/markbaker/matrix/classes/src/Matrix.php
@@ -0,0 +1,423 @@
+buildFromArray(array_values($grid));
+ }
+
+ /*
+ * Create a new Matrix object from an array of values
+ *
+ * @param array $grid
+ */
+ protected function buildFromArray(array $grid): void
+ {
+ $this->rows = count($grid);
+ $columns = array_reduce(
+ $grid,
+ function ($carry, $value) {
+ return max($carry, is_array($value) ? count($value) : 1);
+ }
+ );
+ $this->columns = $columns;
+
+ array_walk(
+ $grid,
+ function (&$value) use ($columns) {
+ if (!is_array($value)) {
+ $value = [$value];
+ }
+ $value = array_pad(array_values($value), $columns, null);
+ }
+ );
+
+ $this->grid = $grid;
+ }
+
+ /**
+ * Validate that a row number is a positive integer
+ *
+ * @param int $row
+ * @return int
+ * @throws Exception
+ */
+ public static function validateRow(int $row): int
+ {
+ if ((!is_numeric($row)) || (intval($row) < 1)) {
+ throw new Exception('Invalid Row');
+ }
+
+ return (int)$row;
+ }
+
+ /**
+ * Validate that a column number is a positive integer
+ *
+ * @param int $column
+ * @return int
+ * @throws Exception
+ */
+ public static function validateColumn(int $column): int
+ {
+ if ((!is_numeric($column)) || (intval($column) < 1)) {
+ throw new Exception('Invalid Column');
+ }
+
+ return (int)$column;
+ }
+
+ /**
+ * Validate that a row number falls within the set of rows for this matrix
+ *
+ * @param int $row
+ * @return int
+ * @throws Exception
+ */
+ protected function validateRowInRange(int $row): int
+ {
+ $row = static::validateRow($row);
+ if ($row > $this->rows) {
+ throw new Exception('Requested Row exceeds matrix size');
+ }
+
+ return $row;
+ }
+
+ /**
+ * Validate that a column number falls within the set of columns for this matrix
+ *
+ * @param int $column
+ * @return int
+ * @throws Exception
+ */
+ protected function validateColumnInRange(int $column): int
+ {
+ $column = static::validateColumn($column);
+ if ($column > $this->columns) {
+ throw new Exception('Requested Column exceeds matrix size');
+ }
+
+ return $column;
+ }
+
+ /**
+ * Return a new matrix as a subset of rows from this matrix, starting at row number $row, and $rowCount rows
+ * A $rowCount value of 0 will return all rows of the matrix from $row
+ * A negative $rowCount value will return rows until that many rows from the end of the matrix
+ *
+ * Note that row numbers start from 1, not from 0
+ *
+ * @param int $row
+ * @param int $rowCount
+ * @return static
+ * @throws Exception
+ */
+ public function getRows(int $row, int $rowCount = 1): Matrix
+ {
+ $row = $this->validateRowInRange($row);
+ if ($rowCount === 0) {
+ $rowCount = $this->rows - $row + 1;
+ }
+
+ return new static(array_slice($this->grid, $row - 1, (int)$rowCount));
+ }
+
+ /**
+ * Return a new matrix as a subset of columns from this matrix, starting at column number $column, and $columnCount columns
+ * A $columnCount value of 0 will return all columns of the matrix from $column
+ * A negative $columnCount value will return columns until that many columns from the end of the matrix
+ *
+ * Note that column numbers start from 1, not from 0
+ *
+ * @param int $column
+ * @param int $columnCount
+ * @return Matrix
+ * @throws Exception
+ */
+ public function getColumns(int $column, int $columnCount = 1): Matrix
+ {
+ $column = $this->validateColumnInRange($column);
+ if ($columnCount < 1) {
+ $columnCount = $this->columns + $columnCount - $column + 1;
+ }
+
+ $grid = [];
+ for ($i = $column - 1; $i < $column + $columnCount - 1; ++$i) {
+ $grid[] = array_column($this->grid, $i);
+ }
+
+ return (new static($grid))->transpose();
+ }
+
+ /**
+ * Return a new matrix as a subset of rows from this matrix, dropping rows starting at row number $row,
+ * and $rowCount rows
+ * A negative $rowCount value will drop rows until that many rows from the end of the matrix
+ * A $rowCount value of 0 will remove all rows of the matrix from $row
+ *
+ * Note that row numbers start from 1, not from 0
+ *
+ * @param int $row
+ * @param int $rowCount
+ * @return static
+ * @throws Exception
+ */
+ public function dropRows(int $row, int $rowCount = 1): Matrix
+ {
+ $this->validateRowInRange($row);
+ if ($rowCount === 0) {
+ $rowCount = $this->rows - $row + 1;
+ }
+
+ $grid = $this->grid;
+ array_splice($grid, $row - 1, (int)$rowCount);
+
+ return new static($grid);
+ }
+
+ /**
+ * Return a new matrix as a subset of columns from this matrix, dropping columns starting at column number $column,
+ * and $columnCount columns
+ * A negative $columnCount value will drop columns until that many columns from the end of the matrix
+ * A $columnCount value of 0 will remove all columns of the matrix from $column
+ *
+ * Note that column numbers start from 1, not from 0
+ *
+ * @param int $column
+ * @param int $columnCount
+ * @return static
+ * @throws Exception
+ */
+ public function dropColumns(int $column, int $columnCount = 1): Matrix
+ {
+ $this->validateColumnInRange($column);
+ if ($columnCount < 1) {
+ $columnCount = $this->columns + $columnCount - $column + 1;
+ }
+
+ $grid = $this->grid;
+ array_walk(
+ $grid,
+ function (&$row) use ($column, $columnCount) {
+ array_splice($row, $column - 1, (int)$columnCount);
+ }
+ );
+
+ return new static($grid);
+ }
+
+ /**
+ * Return a value from this matrix, from the "cell" identified by the row and column numbers
+ * Note that row and column numbers start from 1, not from 0
+ *
+ * @param int $row
+ * @param int $column
+ * @return mixed
+ * @throws Exception
+ */
+ public function getValue(int $row, int $column)
+ {
+ $row = $this->validateRowInRange($row);
+ $column = $this->validateColumnInRange($column);
+
+ return $this->grid[$row - 1][$column - 1];
+ }
+
+ /**
+ * Returns a Generator that will yield each row of the matrix in turn as a vector matrix
+ * or the value of each cell if the matrix is a column vector
+ *
+ * @return Generator|Matrix[]|mixed[]
+ */
+ public function rows(): Generator
+ {
+ foreach ($this->grid as $i => $row) {
+ yield $i + 1 => ($this->columns == 1)
+ ? $row[0]
+ : new static([$row]);
+ }
+ }
+
+ /**
+ * Returns a Generator that will yield each column of the matrix in turn as a vector matrix
+ * or the value of each cell if the matrix is a row vector
+ *
+ * @return Generator|Matrix[]|mixed[]
+ */
+ public function columns(): Generator
+ {
+ for ($i = 0; $i < $this->columns; ++$i) {
+ yield $i + 1 => ($this->rows == 1)
+ ? $this->grid[0][$i]
+ : new static(array_column($this->grid, $i));
+ }
+ }
+
+ /**
+ * Identify if the row and column dimensions of this matrix are equal,
+ * i.e. if it is a "square" matrix
+ *
+ * @return bool
+ */
+ public function isSquare(): bool
+ {
+ return $this->rows === $this->columns;
+ }
+
+ /**
+ * Identify if this matrix is a vector
+ * i.e. if it comprises only a single row or a single column
+ *
+ * @return bool
+ */
+ public function isVector(): bool
+ {
+ return $this->rows === 1 || $this->columns === 1;
+ }
+
+ /**
+ * Return the matrix as a 2-dimensional array
+ *
+ * @return array
+ */
+ public function toArray(): array
+ {
+ return $this->grid;
+ }
+
+ /**
+ * Solve A*X = B.
+ *
+ * @param Matrix $B Right hand side
+ *
+ * @throws Exception
+ *
+ * @return Matrix ... Solution if A is square, least squares solution otherwise
+ */
+ public function solve(Matrix $B): Matrix
+ {
+ if ($this->columns === $this->rows) {
+ return (new LU($this))->solve($B);
+ }
+
+ return (new QR($this))->solve($B);
+ }
+
+ protected static $getters = [
+ 'rows',
+ 'columns',
+ ];
+
+ /**
+ * Access specific properties as read-only (no setters)
+ *
+ * @param string $propertyName
+ * @return mixed
+ * @throws Exception
+ */
+ public function __get(string $propertyName)
+ {
+ $propertyName = strtolower($propertyName);
+
+ // Test for function calls
+ if (in_array($propertyName, self::$getters)) {
+ return $this->$propertyName;
+ }
+
+ throw new Exception('Property does not exist');
+ }
+
+ protected static $functions = [
+ 'adjoint',
+ 'antidiagonal',
+ 'cofactors',
+ 'determinant',
+ 'diagonal',
+ 'identity',
+ 'inverse',
+ 'minors',
+ 'trace',
+ 'transpose',
+ ];
+
+ protected static $operations = [
+ 'add',
+ 'subtract',
+ 'multiply',
+ 'divideby',
+ 'divideinto',
+ 'directsum',
+ ];
+
+ /**
+ * Returns the result of the function call or operation
+ *
+ * @param string $functionName
+ * @param mixed[] $arguments
+ * @return Matrix|float
+ * @throws Exception
+ */
+ public function __call(string $functionName, $arguments)
+ {
+ $functionName = strtolower(str_replace('_', '', $functionName));
+
+ // Test for function calls
+ if (in_array($functionName, self::$functions, true)) {
+ return Functions::$functionName($this, ...$arguments);
+ }
+ // Test for operation calls
+ if (in_array($functionName, self::$operations, true)) {
+ return Operations::$functionName($this, ...$arguments);
+ }
+ throw new Exception('Function or Operation does not exist');
+ }
+}
diff --git a/public/vendor/markbaker/matrix/classes/src/Operations.php b/public/vendor/markbaker/matrix/classes/src/Operations.php
new file mode 100644
index 0000000..e3d88d6
--- /dev/null
+++ b/public/vendor/markbaker/matrix/classes/src/Operations.php
@@ -0,0 +1,157 @@
+execute($matrix);
+ }
+
+ return $result->result();
+ }
+
+ public static function directsum(...$matrixValues): Matrix
+ {
+ if (count($matrixValues) < 2) {
+ throw new Exception('DirectSum operation requires at least 2 arguments');
+ }
+
+ $matrix = array_shift($matrixValues);
+
+ if (is_array($matrix)) {
+ $matrix = new Matrix($matrix);
+ }
+ if (!$matrix instanceof Matrix) {
+ throw new Exception('DirectSum arguments must be Matrix or array');
+ }
+
+ $result = new DirectSum($matrix);
+
+ foreach ($matrixValues as $matrix) {
+ $result->execute($matrix);
+ }
+
+ return $result->result();
+ }
+
+ public static function divideby(...$matrixValues): Matrix
+ {
+ if (count($matrixValues) < 2) {
+ throw new Exception('Division operation requires at least 2 arguments');
+ }
+
+ $matrix = array_shift($matrixValues);
+
+ if (is_array($matrix)) {
+ $matrix = new Matrix($matrix);
+ }
+ if (!$matrix instanceof Matrix) {
+ throw new Exception('Division arguments must be Matrix or array');
+ }
+
+ $result = new Division($matrix);
+
+ foreach ($matrixValues as $matrix) {
+ $result->execute($matrix);
+ }
+
+ return $result->result();
+ }
+
+ public static function divideinto(...$matrixValues): Matrix
+ {
+ if (count($matrixValues) < 2) {
+ throw new Exception('Division operation requires at least 2 arguments');
+ }
+
+ $matrix = array_pop($matrixValues);
+ $matrixValues = array_reverse($matrixValues);
+
+ if (is_array($matrix)) {
+ $matrix = new Matrix($matrix);
+ }
+ if (!$matrix instanceof Matrix) {
+ throw new Exception('Division arguments must be Matrix or array');
+ }
+
+ $result = new Division($matrix);
+
+ foreach ($matrixValues as $matrix) {
+ $result->execute($matrix);
+ }
+
+ return $result->result();
+ }
+
+ public static function multiply(...$matrixValues): Matrix
+ {
+ if (count($matrixValues) < 2) {
+ throw new Exception('Multiplication operation requires at least 2 arguments');
+ }
+
+ $matrix = array_shift($matrixValues);
+
+ if (is_array($matrix)) {
+ $matrix = new Matrix($matrix);
+ }
+ if (!$matrix instanceof Matrix) {
+ throw new Exception('Multiplication arguments must be Matrix or array');
+ }
+
+ $result = new Multiplication($matrix);
+
+ foreach ($matrixValues as $matrix) {
+ $result->execute($matrix);
+ }
+
+ return $result->result();
+ }
+
+ public static function subtract(...$matrixValues): Matrix
+ {
+ if (count($matrixValues) < 2) {
+ throw new Exception('Subtraction operation requires at least 2 arguments');
+ }
+
+ $matrix = array_shift($matrixValues);
+
+ if (is_array($matrix)) {
+ $matrix = new Matrix($matrix);
+ }
+ if (!$matrix instanceof Matrix) {
+ throw new Exception('Subtraction arguments must be Matrix or array');
+ }
+
+ $result = new Subtraction($matrix);
+
+ foreach ($matrixValues as $matrix) {
+ $result->execute($matrix);
+ }
+
+ return $result->result();
+ }
+}
diff --git a/public/vendor/markbaker/matrix/classes/src/Operators/Addition.php b/public/vendor/markbaker/matrix/classes/src/Operators/Addition.php
new file mode 100644
index 0000000..543f56e
--- /dev/null
+++ b/public/vendor/markbaker/matrix/classes/src/Operators/Addition.php
@@ -0,0 +1,68 @@
+addMatrix($value);
+ } elseif (is_numeric($value)) {
+ return $this->addScalar($value);
+ }
+
+ throw new Exception('Invalid argument for addition');
+ }
+
+ /**
+ * Execute the addition for a scalar
+ *
+ * @param mixed $value The numeric value to add to the current base value
+ * @return $this The operation object, allowing multiple additions to be chained
+ **/
+ protected function addScalar($value): Operator
+ {
+ for ($row = 0; $row < $this->rows; ++$row) {
+ for ($column = 0; $column < $this->columns; ++$column) {
+ $this->matrix[$row][$column] += $value;
+ }
+ }
+
+ return $this;
+ }
+
+ /**
+ * Execute the addition for a matrix
+ *
+ * @param Matrix $value The numeric value to add to the current base value
+ * @return $this The operation object, allowing multiple additions to be chained
+ * @throws Exception If the provided argument is not appropriate for the operation
+ **/
+ protected function addMatrix(Matrix $value): Operator
+ {
+ $this->validateMatchingDimensions($value);
+
+ for ($row = 0; $row < $this->rows; ++$row) {
+ for ($column = 0; $column < $this->columns; ++$column) {
+ $this->matrix[$row][$column] += $value->getValue($row + 1, $column + 1);
+ }
+ }
+
+ return $this;
+ }
+}
diff --git a/public/vendor/markbaker/matrix/classes/src/Operators/DirectSum.php b/public/vendor/markbaker/matrix/classes/src/Operators/DirectSum.php
new file mode 100644
index 0000000..cc51ef9
--- /dev/null
+++ b/public/vendor/markbaker/matrix/classes/src/Operators/DirectSum.php
@@ -0,0 +1,64 @@
+directSumMatrix($value);
+ }
+
+ throw new Exception('Invalid argument for addition');
+ }
+
+ /**
+ * Execute the direct sum for a matrix
+ *
+ * @param Matrix $value The numeric value to concatenate/direct sum with the current base value
+ * @return $this The operation object, allowing multiple additions to be chained
+ **/
+ private function directSumMatrix($value): Operator
+ {
+ $originalColumnCount = count($this->matrix[0]);
+ $originalRowCount = count($this->matrix);
+ $valColumnCount = $value->columns;
+ $valRowCount = $value->rows;
+ $value = $value->toArray();
+
+ for ($row = 0; $row < $this->rows; ++$row) {
+ $this->matrix[$row] = array_merge($this->matrix[$row], array_fill(0, $valColumnCount, 0));
+ }
+
+ $this->matrix = array_merge(
+ $this->matrix,
+ array_fill(0, $valRowCount, array_fill(0, $originalColumnCount, 0))
+ );
+
+ for ($row = $originalRowCount; $row < $originalRowCount + $valRowCount; ++$row) {
+ array_splice(
+ $this->matrix[$row],
+ $originalColumnCount,
+ $valColumnCount,
+ $value[$row - $originalRowCount]
+ );
+ }
+
+ return $this;
+ }
+}
diff --git a/public/vendor/markbaker/matrix/classes/src/Operators/Division.php b/public/vendor/markbaker/matrix/classes/src/Operators/Division.php
new file mode 100644
index 0000000..dbfec9d
--- /dev/null
+++ b/public/vendor/markbaker/matrix/classes/src/Operators/Division.php
@@ -0,0 +1,35 @@
+multiplyMatrix($value, $type);
+ } elseif (is_numeric($value)) {
+ return $this->multiplyScalar(1 / $value, $type);
+ }
+
+ throw new Exception('Invalid argument for division');
+ }
+}
diff --git a/public/vendor/markbaker/matrix/classes/src/Operators/Multiplication.php b/public/vendor/markbaker/matrix/classes/src/Operators/Multiplication.php
new file mode 100644
index 0000000..0761e46
--- /dev/null
+++ b/public/vendor/markbaker/matrix/classes/src/Operators/Multiplication.php
@@ -0,0 +1,86 @@
+multiplyMatrix($value, $type);
+ } elseif (is_numeric($value)) {
+ return $this->multiplyScalar($value, $type);
+ }
+
+ throw new Exception("Invalid argument for $type");
+ }
+
+ /**
+ * Execute the multiplication for a scalar
+ *
+ * @param mixed $value The numeric value to multiply with the current base value
+ * @return $this The operation object, allowing multiple mutiplications to be chained
+ **/
+ protected function multiplyScalar($value, string $type = 'multiplication'): Operator
+ {
+ try {
+ for ($row = 0; $row < $this->rows; ++$row) {
+ for ($column = 0; $column < $this->columns; ++$column) {
+ $this->matrix[$row][$column] *= $value;
+ }
+ }
+ } catch (Throwable $e) {
+ throw new Exception("Invalid argument for $type");
+ }
+
+ return $this;
+ }
+
+ /**
+ * Execute the multiplication for a matrix
+ *
+ * @param Matrix $value The numeric value to multiply with the current base value
+ * @return $this The operation object, allowing multiple mutiplications to be chained
+ * @throws Exception If the provided argument is not appropriate for the operation
+ **/
+ protected function multiplyMatrix(Matrix $value, string $type = 'multiplication'): Operator
+ {
+ $this->validateReflectingDimensions($value);
+
+ $newRows = $this->rows;
+ $newColumns = $value->columns;
+ $matrix = Builder::createFilledMatrix(0, $newRows, $newColumns)
+ ->toArray();
+ try {
+ for ($row = 0; $row < $newRows; ++$row) {
+ for ($column = 0; $column < $newColumns; ++$column) {
+ $columnData = $value->getColumns($column + 1)->toArray();
+ foreach ($this->matrix[$row] as $key => $valueData) {
+ $matrix[$row][$column] += $valueData * $columnData[$key][0];
+ }
+ }
+ }
+ } catch (Throwable $e) {
+ throw new Exception("Invalid argument for $type");
+ }
+ $this->matrix = $matrix;
+
+ return $this;
+ }
+}
diff --git a/public/vendor/markbaker/matrix/classes/src/Operators/Operator.php b/public/vendor/markbaker/matrix/classes/src/Operators/Operator.php
new file mode 100644
index 0000000..39e36c6
--- /dev/null
+++ b/public/vendor/markbaker/matrix/classes/src/Operators/Operator.php
@@ -0,0 +1,78 @@
+rows = $matrix->rows;
+ $this->columns = $matrix->columns;
+ $this->matrix = $matrix->toArray();
+ }
+
+ /**
+ * Compare the dimensions of the matrices being operated on to see if they are valid for addition/subtraction
+ *
+ * @param Matrix $matrix The second Matrix object on which the operation will be performed
+ * @throws Exception
+ */
+ protected function validateMatchingDimensions(Matrix $matrix): void
+ {
+ if (($this->rows != $matrix->rows) || ($this->columns != $matrix->columns)) {
+ throw new Exception('Matrices have mismatched dimensions');
+ }
+ }
+
+ /**
+ * Compare the dimensions of the matrices being operated on to see if they are valid for multiplication/division
+ *
+ * @param Matrix $matrix The second Matrix object on which the operation will be performed
+ * @throws Exception
+ */
+ protected function validateReflectingDimensions(Matrix $matrix): void
+ {
+ if ($this->columns != $matrix->rows) {
+ throw new Exception('Matrices have mismatched dimensions');
+ }
+ }
+
+ /**
+ * Return the result of the operation
+ *
+ * @return Matrix
+ */
+ public function result(): Matrix
+ {
+ return new Matrix($this->matrix);
+ }
+}
diff --git a/public/vendor/markbaker/matrix/classes/src/Operators/Subtraction.php b/public/vendor/markbaker/matrix/classes/src/Operators/Subtraction.php
new file mode 100644
index 0000000..b7e14fa
--- /dev/null
+++ b/public/vendor/markbaker/matrix/classes/src/Operators/Subtraction.php
@@ -0,0 +1,68 @@
+subtractMatrix($value);
+ } elseif (is_numeric($value)) {
+ return $this->subtractScalar($value);
+ }
+
+ throw new Exception('Invalid argument for subtraction');
+ }
+
+ /**
+ * Execute the subtraction for a scalar
+ *
+ * @param mixed $value The numeric value to subtracted from the current base value
+ * @return $this The operation object, allowing multiple additions to be chained
+ **/
+ protected function subtractScalar($value): Operator
+ {
+ for ($row = 0; $row < $this->rows; ++$row) {
+ for ($column = 0; $column < $this->columns; ++$column) {
+ $this->matrix[$row][$column] -= $value;
+ }
+ }
+
+ return $this;
+ }
+
+ /**
+ * Execute the subtraction for a matrix
+ *
+ * @param Matrix $value The numeric value to subtract from the current base value
+ * @return $this The operation object, allowing multiple subtractions to be chained
+ * @throws Exception If the provided argument is not appropriate for the operation
+ **/
+ protected function subtractMatrix(Matrix $value): Operator
+ {
+ $this->validateMatchingDimensions($value);
+
+ for ($row = 0; $row < $this->rows; ++$row) {
+ for ($column = 0; $column < $this->columns; ++$column) {
+ $this->matrix[$row][$column] -= $value->getValue($row + 1, $column + 1);
+ }
+ }
+
+ return $this;
+ }
+}
diff --git a/public/vendor/markbaker/matrix/composer.json b/public/vendor/markbaker/matrix/composer.json
new file mode 100644
index 0000000..e86a1e0
--- /dev/null
+++ b/public/vendor/markbaker/matrix/composer.json
@@ -0,0 +1,52 @@
+{
+ "name": "markbaker/matrix",
+ "type": "library",
+ "description": "PHP Class for working with matrices",
+ "keywords": ["matrix", "vector", "mathematics"],
+ "homepage": "https://github.com/MarkBaker/PHPMatrix",
+ "license": "MIT",
+ "authors": [
+ {
+ "name": "Mark Baker",
+ "email": "mark@demon-angel.eu"
+ }
+ ],
+ "require": {
+ "php": "^7.1 || ^8.0"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0",
+ "phpdocumentor/phpdocumentor": "2.*",
+ "phpmd/phpmd": "2.*",
+ "sebastian/phpcpd": "^4.0",
+ "phploc/phploc": "^4.0",
+ "squizlabs/php_codesniffer": "^3.7",
+ "phpcompatibility/php-compatibility": "^9.3",
+ "dealerdirect/phpcodesniffer-composer-installer": "dev-master"
+ },
+ "autoload": {
+ "psr-4": {
+ "Matrix\\": "classes/src/"
+ }
+ },
+ "autoload-dev": {
+ "psr-4": {
+ "MatrixTest\\": "unitTests/classes/src/"
+ }
+ },
+ "scripts": {
+ "style": "phpcs --report-width=200 --standard=PSR2 --report=summary,full classes/src/ unitTests/classes/src -n",
+ "test": "phpunit -c phpunit.xml.dist",
+ "mess": "phpmd classes/src/ xml codesize,unusedcode,design,naming -n",
+ "lines": "phploc classes/src/ -n",
+ "cpd": "phpcpd classes/src/ -n",
+ "versions": "phpcs --report-width=200 --standard=PHPCompatibility --report=summary,full classes/src/ --runtime-set testVersion 7.2- -n",
+ "coverage": "phpunit -c phpunit.xml.dist --coverage-text --coverage-html ./build/coverage"
+ },
+ "minimum-stability": "dev",
+ "config": {
+ "allow-plugins": {
+ "dealerdirect/phpcodesniffer-composer-installer": true
+ }
+ }
+}
diff --git a/public/vendor/markbaker/matrix/examples/test.php b/public/vendor/markbaker/matrix/examples/test.php
new file mode 100644
index 0000000..071dae9
--- /dev/null
+++ b/public/vendor/markbaker/matrix/examples/test.php
@@ -0,0 +1,33 @@
+solve($target);
+
+echo 'X', PHP_EOL;
+var_export($X->toArray());
+echo PHP_EOL;
+
+$resolve = $matrix->multiply($X);
+
+echo 'Resolve', PHP_EOL;
+var_export($resolve->toArray());
+echo PHP_EOL;
diff --git a/public/vendor/markbaker/matrix/infection.json.dist b/public/vendor/markbaker/matrix/infection.json.dist
new file mode 100644
index 0000000..eddaa70
--- /dev/null
+++ b/public/vendor/markbaker/matrix/infection.json.dist
@@ -0,0 +1,17 @@
+{
+ "timeout": 1,
+ "source": {
+ "directories": [
+ "classes\/src"
+ ]
+ },
+ "logs": {
+ "text": "build/infection/text.log",
+ "summary": "build/infection/summary.log",
+ "debug": "build/infection/debug.log",
+ "perMutator": "build/infection/perMutator.md"
+ },
+ "mutators": {
+ "@default": true
+ }
+}
diff --git a/public/vendor/markbaker/matrix/license.md b/public/vendor/markbaker/matrix/license.md
new file mode 100644
index 0000000..7329058
--- /dev/null
+++ b/public/vendor/markbaker/matrix/license.md
@@ -0,0 +1,25 @@
+The MIT License (MIT)
+=====================
+
+Copyright © `2018` `Mark Baker`
+
+Permission is hereby granted, free of charge, to any person
+obtaining a copy of this software and associated documentation
+files (the “Software”), to deal in the Software without
+restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
\ No newline at end of file
diff --git a/public/vendor/markbaker/matrix/phpstan.neon b/public/vendor/markbaker/matrix/phpstan.neon
new file mode 100644
index 0000000..3d90d49
--- /dev/null
+++ b/public/vendor/markbaker/matrix/phpstan.neon
@@ -0,0 +1,6 @@
+parameters:
+ ignoreErrors:
+ - '#Property [A-Za-z\\]+::\$[A-Za-z]+ has no typehint specified#'
+ - '#Method [A-Za-z\\]+::[A-Za-z]+\(\) has no return typehint specified#'
+ - '#Method [A-Za-z\\]+::[A-Za-z]+\(\) has parameter \$[A-Za-z0-9]+ with no typehint specified#'
+ checkMissingIterableValueType: false
diff --git a/public/vendor/phpoffice/phpspreadsheet/.php-cs-fixer.dist.php b/public/vendor/phpoffice/phpspreadsheet/.php-cs-fixer.dist.php
new file mode 100644
index 0000000..3450555
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/.php-cs-fixer.dist.php
@@ -0,0 +1,251 @@
+exclude('vendor')
+ ->notPath('src/PhpSpreadsheet/Writer/ZipStream3.php')
+ ->name('/(\.php|^generate-document|^generate-locales|^check-phpdoc-types)$/')
+ ->in(__DIR__);
+
+$config = new PhpCsFixer\Config();
+$config
+ ->setRiskyAllowed(true)
+ ->setFinder($finder)
+ ->setCacheFile(sys_get_temp_dir() . '/php-cs-fixer' . preg_replace('~\W~', '-', __DIR__))
+ ->setRules([
+ 'align_multiline_comment' => true,
+ 'array_indentation' => true,
+ 'array_syntax' => ['syntax' => 'short'],
+ 'backtick_to_shell_exec' => true,
+ 'binary_operator_spaces' => true,
+ 'blank_line_after_namespace' => true,
+ 'blank_line_after_opening_tag' => true,
+ 'blank_line_before_statement' => true,
+ 'braces' => true,
+ 'cast_spaces' => true,
+ 'class_attributes_separation' => ['elements' => ['method' => 'one', 'property' => 'one']], // const are often grouped with other related const
+ 'class_definition' => false, // phpcs disagree
+ 'class_keyword_remove' => false, // Deprecated, and ::class keyword gives us better support in IDE
+ 'combine_consecutive_issets' => true,
+ 'combine_consecutive_unsets' => true,
+ 'combine_nested_dirname' => true,
+ 'comment_to_phpdoc' => false, // interferes with annotations
+ 'compact_nullable_typehint' => true,
+ 'concat_space' => ['spacing' => 'one'],
+ 'constant_case' => true,
+ 'date_time_immutable' => false, // Break our unit tests
+ 'declare_equal_normalize' => true,
+ 'declare_strict_types' => false, // Too early to adopt strict types
+ 'dir_constant' => true,
+ 'doctrine_annotation_array_assignment' => true,
+ 'doctrine_annotation_braces' => true,
+ 'doctrine_annotation_indentation' => true,
+ 'doctrine_annotation_spaces' => true,
+ 'elseif' => true,
+ 'empty_loop_body' => true,
+ 'empty_loop_condition' => true,
+ 'encoding' => true,
+ 'ereg_to_preg' => true,
+ 'error_suppression' => false, // it breaks \PhpOffice\PhpSpreadsheet\Helper\Handler
+ 'escape_implicit_backslashes' => true,
+ 'explicit_indirect_variable' => false, // I feel it makes the code actually harder to read
+ 'explicit_string_variable' => false, // I feel it makes the code actually harder to read
+ 'final_class' => false, // We need non-final classes
+ 'final_internal_class' => true,
+ 'final_public_method_for_abstract_class' => false, // We need non-final methods
+ 'fopen_flag_order' => true,
+ 'fopen_flags' => true,
+ 'full_opening_tag' => true,
+ 'fully_qualified_strict_types' => true,
+ 'function_declaration' => true,
+ 'function_to_constant' => true,
+ 'function_typehint_space' => true,
+ 'general_phpdoc_annotation_remove' => ['annotations' => ['access', 'category', 'copyright']],
+ 'general_phpdoc_tag_rename' => true,
+ 'global_namespace_import' => true,
+ 'group_import' => false, // I feel it makes the code actually harder to read
+ 'header_comment' => false, // We don't use common header in all our files
+ 'heredoc_indentation' => true,
+ 'heredoc_to_nowdoc' => false, // Not sure about this one
+ 'implode_call' => true,
+ 'include' => true,
+ 'increment_style' => true,
+ 'indentation_type' => true,
+ 'integer_literal_case' => true,
+ 'is_null' => true,
+ 'lambda_not_used_import' => true,
+ 'line_ending' => true,
+ 'linebreak_after_opening_tag' => true,
+ 'list_syntax' => ['syntax' => 'short'],
+ 'logical_operators' => true,
+ 'lowercase_cast' => true,
+ 'lowercase_keywords' => true,
+ 'lowercase_static_reference' => true,
+ 'magic_constant_casing' => true,
+ 'magic_method_casing' => true,
+ 'mb_str_functions' => false, // No, too dangerous to change that
+ 'method_argument_space' => true,
+ 'method_chaining_indentation' => true,
+ 'modernize_strpos' => true,
+ 'modernize_types_casting' => true,
+ 'multiline_comment_opening_closing' => true,
+ 'multiline_whitespace_before_semicolons' => true,
+ 'native_constant_invocation' => false, // Micro optimization that look messy
+ 'native_function_casing' => true,
+ 'native_function_invocation' => false, // I suppose this would be best, but I am still unconvinced about the visual aspect of it
+ 'native_function_type_declaration_casing' => true,
+ 'new_with_braces' => true,
+ 'no_alias_functions' => true,
+ 'no_alias_language_construct_call' => true,
+ 'no_alternative_syntax' => true,
+ 'no_binary_string' => true,
+ 'no_blank_lines_after_class_opening' => true,
+ 'no_blank_lines_after_phpdoc' => true,
+ 'no_blank_lines_before_namespace' => false, // we want 1 blank line before namespace
+ 'no_break_comment' => true,
+ 'no_closing_tag' => true,
+ 'no_empty_comment' => true,
+ 'no_empty_phpdoc' => true,
+ 'no_empty_statement' => true,
+ 'no_extra_blank_lines' => true,
+ 'no_homoglyph_names' => true,
+ 'no_leading_import_slash' => true,
+ 'no_leading_namespace_whitespace' => true,
+ 'no_mixed_echo_print' => true,
+ 'no_multiline_whitespace_around_double_arrow' => true,
+ 'no_null_property_initialization' => true,
+ 'no_php4_constructor' => true,
+ 'no_short_bool_cast' => true,
+ 'echo_tag_syntax' => ['format' => 'long'],
+ 'no_singleline_whitespace_before_semicolons' => true,
+ 'no_space_around_double_colon' => true,
+ 'no_spaces_after_function_name' => true,
+ 'no_spaces_around_offset' => true,
+ 'no_spaces_inside_parenthesis' => true,
+ 'no_superfluous_elseif' => false, // Might be risky on a huge code base
+ 'no_superfluous_phpdoc_tags' => ['allow_mixed' => true],
+ 'no_trailing_comma_in_list_call' => true,
+ 'no_trailing_comma_in_singleline_array' => true,
+ 'no_trailing_whitespace' => true,
+ 'no_trailing_whitespace_in_comment' => true,
+ 'no_trailing_whitespace_in_string' => false, // Too dangerous
+ 'no_unneeded_control_parentheses' => true,
+ 'no_unneeded_curly_braces' => true,
+ 'no_unneeded_final_method' => true,
+ 'no_unreachable_default_argument_value' => true,
+ 'no_unset_cast' => true,
+ 'no_unset_on_property' => false,
+ 'no_unused_imports' => true,
+ 'no_useless_else' => true,
+ 'no_useless_return' => true,
+ 'no_useless_sprintf' => true,
+ 'no_whitespace_before_comma_in_array' => true,
+ 'no_whitespace_in_blank_line' => true,
+ 'non_printable_character' => true,
+ 'normalize_index_brace' => true,
+ 'not_operator_with_space' => false, // No we prefer to keep '!' without spaces
+ 'not_operator_with_successor_space' => false, // idem
+ 'nullable_type_declaration_for_default_null_value' => true,
+ 'object_operator_without_whitespace' => true,
+ 'octal_notation' => true,
+ 'operator_linebreak' => true,
+ 'ordered_class_elements' => false, // We prefer to keep some freedom
+ 'ordered_imports' => true,
+ 'ordered_interfaces' => true,
+ 'ordered_traits' => true,
+ 'php_unit_construct' => true,
+ 'php_unit_dedicate_assert' => true,
+ 'php_unit_dedicate_assert_internal_type' => true,
+ 'php_unit_expectation' => true,
+ 'php_unit_fqcn_annotation' => true,
+ 'php_unit_internal_class' => false, // Because tests are excluded from package
+ 'php_unit_method_casing' => true,
+ 'php_unit_mock' => true,
+ 'php_unit_mock_short_will_return' => true,
+ 'php_unit_namespaced' => true,
+ 'php_unit_no_expectation_annotation' => true,
+ 'phpdoc_order_by_value' => ['annotations' => ['covers']],
+ 'php_unit_set_up_tear_down_visibility' => true,
+ 'php_unit_size_class' => false, // That seems extra work to maintain for little benefits
+ 'php_unit_strict' => false, // We sometime actually need assertEquals
+ 'php_unit_test_annotation' => true,
+ 'php_unit_test_case_static_method_calls' => ['call_type' => 'self'],
+ 'php_unit_test_class_requires_covers' => false, // We don't care as much as we should about coverage
+ 'phpdoc_add_missing_param_annotation' => false, // Don't add things that bring no value
+ 'phpdoc_align' => false, // Waste of time
+ 'phpdoc_annotation_without_dot' => true,
+ 'phpdoc_indent' => true,
+ //'phpdoc_inline_tag' => true,
+ 'phpdoc_line_span' => false, // Unfortunately our old comments turn even uglier with this
+ 'phpdoc_no_access' => true,
+ 'phpdoc_no_alias_tag' => true,
+ 'phpdoc_no_empty_return' => true,
+ 'phpdoc_no_package' => true,
+ 'phpdoc_no_useless_inheritdoc' => true,
+ 'phpdoc_order' => true,
+ 'phpdoc_return_self_reference' => true,
+ 'phpdoc_scalar' => true,
+ 'phpdoc_separation' => true,
+ 'phpdoc_single_line_var_spacing' => true,
+ 'phpdoc_summary' => true,
+ 'phpdoc_tag_casing' => true,
+ 'phpdoc_tag_type' => true,
+ 'phpdoc_to_comment' => false, // interferes with annotations
+ 'phpdoc_to_param_type' => false, // Because experimental, but interesting for one shot use
+ 'phpdoc_to_property_type' => false, // Because experimental, but interesting for one shot use
+ 'phpdoc_to_return_type' => false, // Because experimental, but interesting for one shot use
+ 'phpdoc_trim' => true,
+ 'phpdoc_trim_consecutive_blank_line_separation' => true,
+ 'phpdoc_types' => true,
+ 'phpdoc_types_order' => true,
+ 'phpdoc_var_annotation_correct_order' => true,
+ 'phpdoc_var_without_name' => true,
+ 'pow_to_exponentiation' => true,
+ 'protected_to_private' => true,
+ 'psr_autoloading' => true,
+ 'random_api_migration' => true,
+ 'return_assignment' => false, // Sometimes useful for clarity or debug
+ 'return_type_declaration' => true,
+ 'self_accessor' => true,
+ 'self_static_accessor' => true,
+ 'semicolon_after_instruction' => false, // Buggy in `samples/index.php`
+ 'set_type_to_cast' => true,
+ 'short_scalar_cast' => true,
+ 'simple_to_complex_string_variable' => false, // Would differ from TypeScript without obvious advantages
+ 'simplified_if_return' => false, // Even if technically correct we prefer to be explicit
+ 'simplified_null_return' => false, // Even if technically correct we prefer to be explicit
+ 'single_blank_line_at_eof' => true,
+ 'single_blank_line_before_namespace' => true,
+ 'single_class_element_per_statement' => true,
+ 'single_import_per_statement' => true,
+ 'single_line_after_imports' => true,
+ 'single_line_comment_style' => true,
+ 'single_line_throw' => false, // I don't see any reason for having a special case for Exception
+ 'single_quote' => true,
+ 'single_space_after_construct' => true,
+ 'single_trait_insert_per_statement' => true,
+ 'space_after_semicolon' => true,
+ 'standardize_increment' => true,
+ 'standardize_not_equals' => true,
+ 'static_lambda' => false, // Risky if we can't guarantee nobody use `bindTo()`
+ 'strict_comparison' => false, // No, too dangerous to change that
+ 'strict_param' => false, // No, too dangerous to change that
+ 'string_length_to_empty' => true,
+ 'string_line_ending' => true,
+ 'switch_case_semicolon_to_colon' => true,
+ 'switch_case_space' => true,
+ 'switch_continue_to_break' => true,
+ 'ternary_operator_spaces' => true,
+ 'ternary_to_elvis_operator' => true,
+ 'ternary_to_null_coalescing' => true,
+ 'trailing_comma_in_multiline' => true,
+ 'trim_array_spaces' => true,
+ 'types_spaces' => true,
+ 'unary_operator_spaces' => true,
+ 'use_arrow_functions' => true,
+ 'visibility_required' => ['elements' => ['property', 'method']], // not const
+ 'void_return' => true,
+ 'whitespace_after_comma_in_array' => true,
+ 'yoda_style' => false,
+ ]);
+
+return $config;
diff --git a/public/vendor/phpoffice/phpspreadsheet/.phpcs.xml.dist b/public/vendor/phpoffice/phpspreadsheet/.phpcs.xml.dist
new file mode 100644
index 0000000..ccaa25f
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/.phpcs.xml.dist
@@ -0,0 +1,26 @@
+
+
+
+ samples
+ src
+ tests
+ infra
+ bin/generate-document
+ bin/generate-locales
+ bin/check-phpdoc-types
+
+ samples/Header.php
+ */tests/Core/*/*Test\.(inc|css|js)$
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/public/vendor/phpoffice/phpspreadsheet/.readthedocs.yaml b/public/vendor/phpoffice/phpspreadsheet/.readthedocs.yaml
new file mode 100644
index 0000000..c671015
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/.readthedocs.yaml
@@ -0,0 +1,12 @@
+# Read the Docs configuration file for MkDocs projects
+# See https://docs.readthedocs.io/en/stable/config-file/v2.html
+
+version: 2
+
+build:
+ os: ubuntu-22.04
+ tools:
+ python: "3"
+
+mkdocs:
+ configuration: mkdocs.yml
diff --git a/public/vendor/phpoffice/phpspreadsheet/CHANGELOG.md b/public/vendor/phpoffice/phpspreadsheet/CHANGELOG.md
new file mode 100644
index 0000000..d031bc1
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/CHANGELOG.md
@@ -0,0 +1,1534 @@
+# Changelog
+
+All notable changes to this project will be documented in this file.
+
+The format is based on [Keep a Changelog](https://keepachangelog.com)
+and this project adheres to [Semantic Versioning](https://semver.org).
+
+## 2024-05-11 - 2.1.0
+
+### MINOR BREAKING CHANGE
+
+- Writing of cell comments to Html will now sanitize all Html tags within the comment, so the tags will be rendered as plaintext and have no other effects when rendered. Styling can be achieved by using the Font property of of the TextRuns which make up the comment, as is already the cases for Xlsx. [PR #3957](https://github.com/PHPOffice/PhpSpreadsheet/pull/3957)
+
+### Added
+
+- Default Style Alignment Property (workaround for bug in non-Excel spreadsheet apps) [Issue #3918](https://github.com/PHPOffice/PhpSpreadsheet/issues/3918) [PR #3924](https://github.com/PHPOffice/PhpSpreadsheet/pull/3924)
+- Additional Support for Date/Time Styles [PR #3939](https://github.com/PHPOffice/PhpSpreadsheet/pull/3939)
+
+### Changed
+
+- Nothing
+
+### Deprecated
+
+- Reader/Xml trySimpleXMLLoadString should not have had public visibility, and will be removed.
+
+### Removed
+
+- Nothing
+
+### Fixed
+
+- IF Empty Arguments. [Issue #3875](https://github.com/PHPOffice/PhpSpreadsheet/issues/3875) [Issue #2146](https://github.com/PHPOffice/PhpSpreadsheet/issues/2146) [PR #3879](https://github.com/PHPOffice/PhpSpreadsheet/pull/3879)
+- Changes to floating point in Php8.4. [Issue #3896](https://github.com/PHPOffice/PhpSpreadsheet/issues/3896) [PR #3897](https://github.com/PHPOffice/PhpSpreadsheet/pull/3897)
+- Handling User-supplied Decimal and Thousands Separators. [Issue #3900](https://github.com/PHPOffice/PhpSpreadsheet/issues/3900) [PR #3903](https://github.com/PHPOffice/PhpSpreadsheet/pull/3903)
+- Improve Performance of CSV Writer. [Issue #3904](https://github.com/PHPOffice/PhpSpreadsheet/issues/3904) [PR #3906](https://github.com/PHPOffice/PhpSpreadsheet/pull/3906)
+- Fix issue with prepending zero in percentage [Issue #3920](https://github.com/PHPOffice/PhpSpreadsheet/issues/3920) [PR #3921](https://github.com/PHPOffice/PhpSpreadsheet/pull/3921)
+- Incorrect SUMPRODUCT Calculation [Issue #3909](https://github.com/PHPOffice/PhpSpreadsheet/issues/3909) [PR #3916](https://github.com/PHPOffice/PhpSpreadsheet/pull/3916)
+- Formula Misidentifying Text as Cell After Insertion/Deletion [Issue #3907](https://github.com/PHPOffice/PhpSpreadsheet/issues/3907) [PR #3915](https://github.com/PHPOffice/PhpSpreadsheet/pull/3915)
+- Unexpected Absolute Address in Xlsx Rels [Issue #3730](https://github.com/PHPOffice/PhpSpreadsheet/issues/3730) [PR #3923](https://github.com/PHPOffice/PhpSpreadsheet/pull/3923)
+- Unallocated Cells Affected by Column/Row Insert/Delete [Issue #3933](https://github.com/PHPOffice/PhpSpreadsheet/issues/3933) [PR #3940](https://github.com/PHPOffice/PhpSpreadsheet/pull/3940)
+- Invalid Builtin Defined Name in Xls Reader [Issue #3935](https://github.com/PHPOffice/PhpSpreadsheet/issues/3935) [PR #3942](https://github.com/PHPOffice/PhpSpreadsheet/pull/3942)
+- Hidden Rows and Columns Tcpdf/Mpdf [PR #3945](https://github.com/PHPOffice/PhpSpreadsheet/pull/3945)
+- RTL Text Alignment in Xlsx Comments [Issue #4004](https://github.com/PHPOffice/PhpSpreadsheet/issues/4004) [PR #4006](https://github.com/PHPOffice/PhpSpreadsheet/pull/4006)
+- Protect Sheet But Allow Sort [Issue #3951](https://github.com/PHPOffice/PhpSpreadsheet/issues/3951) [PR #3956](https://github.com/PHPOffice/PhpSpreadsheet/pull/3956)
+- Default Value for Conditional::$text [PR #3946](https://github.com/PHPOffice/PhpSpreadsheet/pull/3946)
+- Table Filter Buttons [Issue #3988](https://github.com/PHPOffice/PhpSpreadsheet/issues/3988) [PR #3992](https://github.com/PHPOffice/PhpSpreadsheet/pull/3992)
+- Improvements to Xml Reader [Issue #3999](https://github.com/PHPOffice/PhpSpreadsheet/issues/3999) [Issue #4000](https://github.com/PHPOffice/PhpSpreadsheet/issues/4000) [Issue #4001](https://github.com/PHPOffice/PhpSpreadsheet/issues/4001) [Issue #4002](https://github.com/PHPOffice/PhpSpreadsheet/issues/4002) [PR #4003](https://github.com/PHPOffice/PhpSpreadsheet/pull/4003) [PR #4007](https://github.com/PHPOffice/PhpSpreadsheet/pull/4007)
+- Html Reader non-UTF8 [Issue #3995](https://github.com/PHPOffice/PhpSpreadsheet/issues/3995) [Issue #866](https://github.com/PHPOffice/PhpSpreadsheet/issues/866) [Issue #1681](https://github.com/PHPOffice/PhpSpreadsheet/issues/1681) [PR #4019](https://github.com/PHPOffice/PhpSpreadsheet/pull/4019)
+
+## 2.0.0 - 2024-01-04
+
+### BREAKING CHANGE
+
+- Typing was strengthened by leveraging native typing. This should not change any behavior. However, if you implement
+ any interfaces or inherit from any classes, you will need to adapt your typing accordingly. If you use static analysis
+ tools such as PHPStan or Psalm, new errors might be found. If you find actual bugs because of the new typing, please
+ open a PR that fixes it with a **detailed** explanation of the reason. We'll try to merge and release typing-related
+ fixes quickly in the coming days. [PR #3718](https://github.com/PHPOffice/PhpSpreadsheet/pull/3718)
+- All deprecated things have been removed, for details, see [816b91d0b4](https://github.com/PHPOffice/PhpSpreadsheet/commit/816b91d0b4a0c7285a9e3fc88c58f7730d922044)
+
+### Added
+
+- Split screens (Xlsx and Xml only, not 100% complete). [Issue #3601](https://github.com/PHPOffice/PhpSpreadsheet/issues/3601) [PR #3622](https://github.com/PHPOffice/PhpSpreadsheet/pull/3622)
+- Permit Meta Viewport in Html. [Issue #3565](https://github.com/PHPOffice/PhpSpreadsheet/issues/3565) [PR #3623](https://github.com/PHPOffice/PhpSpreadsheet/pull/3623)
+- Hyperlink support for Ods. [Issue #3660](https://github.com/PHPOffice/PhpSpreadsheet/issues/3660) [PR #3669](https://github.com/PHPOffice/PhpSpreadsheet/pull/3669)
+- ListWorksheetInfo/Names for Html/Csv/Slk. [Issue #3706](https://github.com/PHPOffice/PhpSpreadsheet/issues/3706) [PR #3709](https://github.com/PHPOffice/PhpSpreadsheet/pull/3709)
+- Methods to determine if cell is actually locked, or hidden on formula bar. [PR #3722](https://github.com/PHPOffice/PhpSpreadsheet/pull/3722)
+- Add iterateOnlyExistingCells to Constructors. [Issue #3721](https://github.com/PHPOffice/PhpSpreadsheet/issues/3721) [PR #3727](https://github.com/PHPOffice/PhpSpreadsheet/pull/3727)
+- Support for Conditional Formatting Color Scale. [PR #3738](https://github.com/PHPOffice/PhpSpreadsheet/pull/3738)
+- Support Additional Tags in Helper/Html. [Issue #3751](https://github.com/PHPOffice/PhpSpreadsheet/issues/3751) [PR #3752](https://github.com/PHPOffice/PhpSpreadsheet/pull/3752)
+- Writer ODS : Write Border Style for cells [Issue #3690](https://github.com/PHPOffice/PhpSpreadsheet/issues/3690) [PR #3693](https://github.com/PHPOffice/PhpSpreadsheet/pull/3693)
+- Sheet Background Images [Issue #1649](https://github.com/PHPOffice/PhpSpreadsheet/issues/1649) [PR #3795](https://github.com/PHPOffice/PhpSpreadsheet/pull/3795)
+- Check if Coordinate is Inside Range [PR #3779](https://github.com/PHPOffice/PhpSpreadsheet/pull/3779)
+- Flipping Images [Issue #731](https://github.com/PHPOffice/PhpSpreadsheet/issues/731) [PR #3801](https://github.com/PHPOffice/PhpSpreadsheet/pull/3801)
+- Chart Dynamic Title and Font Properties [Issue #3797](https://github.com/PHPOffice/PhpSpreadsheet/issues/3797) [PR #3800](https://github.com/PHPOffice/PhpSpreadsheet/pull/3800)
+- Chart Axis Display Units and Logarithmic Scale. [Issue #3833](https://github.com/PHPOffice/PhpSpreadsheet/issues/3833) [PR #3836](https://github.com/PHPOffice/PhpSpreadsheet/pull/3836)
+- Partial Support of Fill Handles. [Discussion #3847](https://github.com/PHPOffice/PhpSpreadsheet/discussions/3847) [PR #3855](https://github.com/PHPOffice/PhpSpreadsheet/pull/3855)
+
+### Changed
+
+- **Drop support for PHP 7.4**, according to https://phpspreadsheet.readthedocs.io/en/latest/#php-version-support [PR #3713](https://github.com/PHPOffice/PhpSpreadsheet/pull/3713)
+- RLM Added to NumberFormatter Currency. This happens depending on release of ICU which Php is using (it does not yet happen with any official release). PhpSpreadsheet will continue to use the value returned by Php, but a method is added to keep the result unchanged from release to release. [Issue #3571](https://github.com/PHPOffice/PhpSpreadsheet/issues/3571) [PR #3640](https://github.com/PHPOffice/PhpSpreadsheet/pull/3640)
+- `toFormattedString` will now always return a string. This was introduced with 1.28.0, but was not properly documented at the time. This can affect the results of `toArray`, `namedRangeToArray`, and `rangeToArray`. [PR #3304](https://github.com/PHPOffice/PhpSpreadsheet/pull/3304)
+- Value of constants FORMAT_CURRENCY_EUR and FORMAT_CURRENCY_USD was changed in 1.28.0, but was not properly documented at the time. [Issue #3577](https://github.com/PHPOffice/PhpSpreadsheet/issues/3577)
+- Html Writer will attempt to use Chart coordinates to determine image size. [Issue #3783](https://github.com/PHPOffice/PhpSpreadsheet/issues/3783) [PR #3787](https://github.com/PHPOffice/PhpSpreadsheet/pull/3787)
+
+### Deprecated
+
+- Functions `_translateFormulaToLocale` and `_translateFormulaEnglish` are replaced by versions without leading underscore. [PR #3828](https://github.com/PHPOffice/PhpSpreadsheet/pull/3828)
+
+### Removed
+
+- Nothing
+
+### Fixed
+
+- Take advantage of mitoteam/jpgraph Extended mode to enable rendering of more graphs. [PR #3603](https://github.com/PHPOffice/PhpSpreadsheet/pull/3603)
+- Column widths, especially for ODS. [Issue #3609](https://github.com/PHPOffice/PhpSpreadsheet/issues/3609) [PR #3610](https://github.com/PHPOffice/PhpSpreadsheet/pull/3610)
+- Avoid NULL in String Function call (partial solution). [Issue #3613](https://github.com/PHPOffice/PhpSpreadsheet/issues/3613) [PR #3617](https://github.com/PHPOffice/PhpSpreadsheet/pull/3617)
+- Preserve transparency in Memory Drawing. [Issue #3624](https://github.com/PHPOffice/PhpSpreadsheet/issues/3624) [PR #3627](https://github.com/PHPOffice/PhpSpreadsheet/pull/3627)
+- Customizable padding for Exact Column Width. [Issue #3626](https://github.com/PHPOffice/PhpSpreadsheet/issues/3626) [PR #3628](https://github.com/PHPOffice/PhpSpreadsheet/pull/3628)
+- Ensure ROW function returns int (problem exposed in unreleased Php). [PR #3641](https://github.com/PHPOffice/PhpSpreadsheet/pull/3641)
+- Minor changes to Mpdf and Html Writers. [PR #3645](https://github.com/PHPOffice/PhpSpreadsheet/pull/3645)
+- Xlsx Reader Namespacing for Tables, Autofilters. [Issue #3665](https://github.com/PHPOffice/PhpSpreadsheet/issues/3665) [PR #3668](https://github.com/PHPOffice/PhpSpreadsheet/pull/3668)
+- Read Code Page for Xls ListWorksheetInfo/Names BIFF5. [Issue #3671](https://github.com/PHPOffice/PhpSpreadsheet/issues/3671) [PR #3672](https://github.com/PHPOffice/PhpSpreadsheet/pull/3672)
+- Read Data from Table on Different Sheet. [Issue #3635](https://github.com/PHPOffice/PhpSpreadsheet/issues/3635) [PR #3659](https://github.com/PHPOffice/PhpSpreadsheet/pull/3659)
+- Html Writer Styles Using Inline Css. [Issue #3678](https://github.com/PHPOffice/PhpSpreadsheet/issues/3678) [PR #3680](https://github.com/PHPOffice/PhpSpreadsheet/pull/3680)
+- Xlsx Read Ignoring Some Comments. [Issue #3654](https://github.com/PHPOffice/PhpSpreadsheet/issues/3654) [PR #3655](https://github.com/PHPOffice/PhpSpreadsheet/pull/3655)
+- Fractional Seconds in Date/Time Values. [PR #3677](https://github.com/PHPOffice/PhpSpreadsheet/pull/3677)
+- SetCalculatedValue Avoid Casting String to Numeric. [Issue #3658](https://github.com/PHPOffice/PhpSpreadsheet/issues/3658) [PR #3685](https://github.com/PHPOffice/PhpSpreadsheet/pull/3685)
+- Several Problems in a Very Complicated Spreadsheet. [Issue #3679](https://github.com/PHPOffice/PhpSpreadsheet/issues/3679) [PR #3681](https://github.com/PHPOffice/PhpSpreadsheet/pull/3681)
+- Inconsistent String Handling for Sum Functions. [Issue #3652](https://github.com/PHPOffice/PhpSpreadsheet/issues/3652) [PR #3653](https://github.com/PHPOffice/PhpSpreadsheet/pull/3653)
+- Recomputation of Relative Addresses in Defined Names. [Issue #3661](https://github.com/PHPOffice/PhpSpreadsheet/issues/3661) [PR #3673](https://github.com/PHPOffice/PhpSpreadsheet/pull/3673)
+- Writer Xls Characters Outside BMP (emojis). [Issue #642](https://github.com/PHPOffice/PhpSpreadsheet/issues/642) [PR #3696](https://github.com/PHPOffice/PhpSpreadsheet/pull/3696)
+- Xlsx Reader Improve Handling of Row and Column Styles. [Issue #3533](https://github.com/PHPOffice/PhpSpreadsheet/issues/3533) [Issue #3534](https://github.com/PHPOffice/PhpSpreadsheet/issues/3534) [PR #3688](https://github.com/PHPOffice/PhpSpreadsheet/pull/3688)
+- Avoid Allocating RowDimension Unneccesarily. [PR #3686](https://github.com/PHPOffice/PhpSpreadsheet/pull/3686)
+- Use Column Style when Row Dimension Exists Without Style. [Issue #3534](https://github.com/PHPOffice/PhpSpreadsheet/issues/3534) [PR #3688](https://github.com/PHPOffice/PhpSpreadsheet/pull/3688)
+- Inconsistency Between Cell Data and Explicitly Declared Type. [Issue #3711](https://github.com/PHPOffice/PhpSpreadsheet/issues/3711) [PR #3715](https://github.com/PHPOffice/PhpSpreadsheet/pull/3715)
+- Unexpected Namespacing in rels File. [Issue #3720](https://github.com/PHPOffice/PhpSpreadsheet/issues/3720) [PR #3722](https://github.com/PHPOffice/PhpSpreadsheet/pull/3722)
+- Break Some Circular References. [PR #3716](https://github.com/PHPOffice/PhpSpreadsheet/pull/3716) [PR #3707](https://github.com/PHPOffice/PhpSpreadsheet/pull/3707)
+- Missing Font Index in Some Xls. [PR #3734](https://github.com/PHPOffice/PhpSpreadsheet/pull/3734)
+- Load Tables even with READ_DATA_ONLY. [PR #3726](https://github.com/PHPOffice/PhpSpreadsheet/pull/3726)
+- Theme File Missing but Referenced in Spreadsheet. [Issue #3770](https://github.com/PHPOffice/PhpSpreadsheet/issues/3770) [PR #3772](https://github.com/PHPOffice/PhpSpreadsheet/pull/3772)
+- Slk Shared Formulas. [Issue #2267](https://github.com/PHPOffice/PhpSpreadsheet/issues/2267) [PR #3776](https://github.com/PHPOffice/PhpSpreadsheet/pull/3776)
+- Html omitting some charts. [Issue #3767](https://github.com/PHPOffice/PhpSpreadsheet/issues/3767) [PR #3771](https://github.com/PHPOffice/PhpSpreadsheet/pull/3771)
+- Case Insensitive Comparison for Sheet Names [PR #3791](https://github.com/PHPOffice/PhpSpreadsheet/pull/3791)
+- Performance improvement for Xlsx Reader. [Issue #3683](https://github.com/PHPOffice/PhpSpreadsheet/issues/3683) [PR #3810](https://github.com/PHPOffice/PhpSpreadsheet/pull/3810)
+- Prevent loop in Shared/File. [Issue #3807](https://github.com/PHPOffice/PhpSpreadsheet/issues/3807) [PR #3809](https://github.com/PHPOffice/PhpSpreadsheet/pull/3809)
+- Consistent handling of decimal/thousands separators between StringHelper and Php setlocale. [Issue #3811](https://github.com/PHPOffice/PhpSpreadsheet/issues/3811) [PR #3815](https://github.com/PHPOffice/PhpSpreadsheet/pull/3815)
+- Clone worksheet with tables or charts. [Issue #3820](https://github.com/PHPOffice/PhpSpreadsheet/issues/3820) [PR #3821](https://github.com/PHPOffice/PhpSpreadsheet/pull/3821)
+- COUNTIFS Does Not Require xlfn. [Issue #3819](https://github.com/PHPOffice/PhpSpreadsheet/issues/3819) [PR #3827](https://github.com/PHPOffice/PhpSpreadsheet/pull/3827)
+- Strip `xlfn.` and `xlws.` from Formula Translations. [Issue #3819](https://github.com/PHPOffice/PhpSpreadsheet/issues/3819) [PR #3828](https://github.com/PHPOffice/PhpSpreadsheet/pull/3828)
+- Recurse directories searching for font file. [Issue #2809](https://github.com/PHPOffice/PhpSpreadsheet/issues/2809) [PR #3830](https://github.com/PHPOffice/PhpSpreadsheet/pull/3830)
+- Reduce memory consumption of Worksheet::rangeToArray() when many empty rows are read. [Issue #3814](https://github.com/PHPOffice/PhpSpreadsheet/issues/3814) [PR #3834](https://github.com/PHPOffice/PhpSpreadsheet/pull/3834)
+- Reduce time used by Worksheet::rangeToArray() when many empty rows are read. [PR #3839](https://github.com/PHPOffice/PhpSpreadsheet/pull/3839)
+- Html Reader Tolerate Invalid Sheet Title. [PR #3845](https://github.com/PHPOffice/PhpSpreadsheet/pull/3845)
+- Do not include unparsed drawings when new drawing added. [Issue #3843](https://github.com/PHPOffice/PhpSpreadsheet/issues/3843) [PR #3846](https://github.com/PHPOffice/PhpSpreadsheet/pull/3846)
+- Do not include unparsed drawings when new drawing added. [Issue #3861](https://github.com/PHPOffice/PhpSpreadsheet/issues/3861) [PR #3862](https://github.com/PHPOffice/PhpSpreadsheet/pull/3862)
+- Excel omits `between` operator for data validation. [Issue #3863](https://github.com/PHPOffice/PhpSpreadsheet/issues/3863) [PR #3865](https://github.com/PHPOffice/PhpSpreadsheet/pull/3865)
+- Use less space when inserting rows and columns. [Issue #3687](https://github.com/PHPOffice/PhpSpreadsheet/issues/3687) [PR #3856](https://github.com/PHPOffice/PhpSpreadsheet/pull/3856)
+- Excel inconsistent handling of MIN/MAX/MINA/MAXA. [Issue #3866](https://github.com/PHPOffice/PhpSpreadsheet/issues/3866) [PR #3868](https://github.com/PHPOffice/PhpSpreadsheet/pull/3868)
+
+## 1.29.0 - 2023-06-15
+
+### Added
+
+- Wizards for defining Number Format masks for Dates and Times, including Durations/Intervals. [PR #3458](https://github.com/PHPOffice/PhpSpreadsheet/pull/3458)
+- Specify data type in html tags. [Issue #3444](https://github.com/PHPOffice/PhpSpreadsheet/issues/3444) [PR #3445](https://github.com/PHPOffice/PhpSpreadsheet/pull/3445)
+- Provide option to ignore hidden rows/columns in `toArray()` methods. [PR #3494](https://github.com/PHPOffice/PhpSpreadsheet/pull/3494)
+- Font/Effects/Theme support for Chart Data Labels and Axis. [PR #3476](https://github.com/PHPOffice/PhpSpreadsheet/pull/3476)
+- Font Themes support. [PR #3486](https://github.com/PHPOffice/PhpSpreadsheet/pull/3486)
+- Ability to Ignore Cell Errors in Excel. [Issue #1141](https://github.com/PHPOffice/PhpSpreadsheet/issues/1141) [PR #3508](https://github.com/PHPOffice/PhpSpreadsheet/pull/3508)
+- Unzipped Gnumeric file [PR #3591](https://github.com/PHPOffice/PhpSpreadsheet/pull/3591)
+
+### Changed
+
+- Xlsx Color schemes read in will be written out (previously Excel 2007-2010 Color scheme was always written); manipulation of those schemes before write, including restoring prior behavior, is provided [PR #3476](https://github.com/PHPOffice/PhpSpreadsheet/pull/3476)
+- Memory and speed optimisations for Read Filters with Xlsx Files and Shared Formulae. [PR #3474](https://github.com/PHPOffice/PhpSpreadsheet/pull/3474)
+- Allow `CellRange` and `CellAddress` objects for the `range` argument in the `rangeToArray()` method. [PR #3494](https://github.com/PHPOffice/PhpSpreadsheet/pull/3494)
+- Stock charts will now read and reproduce `upDownBars` and subsidiary tags; these were previously ignored on read and hard-coded on write. [PR #3515](https://github.com/PHPOffice/PhpSpreadsheet/pull/3515)
+
+### Deprecated
+
+- Nothing
+
+### Removed
+
+- Nothing
+
+### Fixed
+
+- Updates Cell formula absolute ranges/references, and Defined Name absolute ranges/references when inserting/deleting rows/columns. [Issue #3368](https://github.com/PHPOffice/PhpSpreadsheet/issues/3368) [PR #3402](https://github.com/PHPOffice/PhpSpreadsheet/pull/3402)
+- EOMONTH() and EDATE() Functions should round date value before evaluation. [Issue #3436](https://github.com/PHPOffice/PhpSpreadsheet/issues/3436) [PR #3437](https://github.com/PHPOffice/PhpSpreadsheet/pull/3437)
+- NETWORKDAYS function erroneously being converted to NETWORK_xlfn.DAYS in Xlsx Writer. [Issue #3461](https://github.com/PHPOffice/PhpSpreadsheet/issues/3461) [PR #3463](https://github.com/PHPOffice/PhpSpreadsheet/pull/3463)
+- Getting a style for a CellAddress instance fails if the worksheet is set in the CellAddress instance. [Issue #3439](https://github.com/PHPOffice/PhpSpreadsheet/issues/3439) [PR #3469](https://github.com/PHPOffice/PhpSpreadsheet/pull/3469)
+- Shared Formulae outside the filter range when reading with a filter are not always being identified. [Issue #3473](https://github.com/PHPOffice/PhpSpreadsheet/issues/3473) [PR #3474](https://github.com/PHPOffice/PhpSpreadsheet/pull/3474)
+- Xls Reader Conditional Styles. [PR #3400](https://github.com/PHPOffice/PhpSpreadsheet/pull/3400)
+- Allow use of # and 0 digit placeholders in fraction masks. [PR #3401](https://github.com/PHPOffice/PhpSpreadsheet/pull/3401)
+- Modify Date/Time check in the NumberFormatter for decimal/fractional times. [PR #3413](https://github.com/PHPOffice/PhpSpreadsheet/pull/3413)
+- Misplaced Xml Writing Chart Label FillColor. [Issue #3397](https://github.com/PHPOffice/PhpSpreadsheet/issues/3397) [PR #3404](https://github.com/PHPOffice/PhpSpreadsheet/pull/3404)
+- TEXT function ignores Time in DateTimeStamp. [Issue #3409](https://github.com/PHPOffice/PhpSpreadsheet/issues/3409) [PR #3411](https://github.com/PHPOffice/PhpSpreadsheet/pull/3411)
+- Xlsx Column Autosize Approximate for CJK. [Issue #3405](https://github.com/PHPOffice/PhpSpreadsheet/issues/3405) [PR #3416](https://github.com/PHPOffice/PhpSpreadsheet/pull/3416)
+- Correct Xlsx Parsing of quotePrefix="0". [Issue #3435](https://github.com/PHPOffice/PhpSpreadsheet/issues/3435) [PR #3438](https://github.com/PHPOffice/PhpSpreadsheet/pull/3438)
+- More Display Options for Chart Axis and Legend. [Issue #3414](https://github.com/PHPOffice/PhpSpreadsheet/issues/3414) [PR #3434](https://github.com/PHPOffice/PhpSpreadsheet/pull/3434)
+- Apply strict type checking to Complex suffix. [PR #3452](https://github.com/PHPOffice/PhpSpreadsheet/pull/3452)
+- Incorrect Font Color Read Xlsx Rich Text Indexed Color Custom Palette. [Issue #3464](https://github.com/PHPOffice/PhpSpreadsheet/issues/3464) [PR #3465](https://github.com/PHPOffice/PhpSpreadsheet/pull/3465)
+- Xlsx Writer Honor Alignment in Default Font. [Issue #3443](https://github.com/PHPOffice/PhpSpreadsheet/issues/3443) [PR #3459](https://github.com/PHPOffice/PhpSpreadsheet/pull/3459)
+- Support Border for Charts. [PR #3462](https://github.com/PHPOffice/PhpSpreadsheet/pull/3462)
+- Error in "this row" structured reference calculation (cached result from first row when using a range) [Issue #3504](https://github.com/PHPOffice/PhpSpreadsheet/issues/3504) [PR #3505](https://github.com/PHPOffice/PhpSpreadsheet/pull/3505)
+- Allow colour palette index references in Number Format masks [Issue #3511](https://github.com/PHPOffice/PhpSpreadsheet/issues/3511) [PR #3512](https://github.com/PHPOffice/PhpSpreadsheet/pull/3512)
+- Xlsx Reader formula with quotePrefix [Issue #3495](https://github.com/PHPOffice/PhpSpreadsheet/issues/3495) [PR #3497](https://github.com/PHPOffice/PhpSpreadsheet/pull/3497)
+- Handle REF error as part of range [Issue #3453](https://github.com/PHPOffice/PhpSpreadsheet/issues/3453) [PR #3467](https://github.com/PHPOffice/PhpSpreadsheet/pull/3467)
+- Handle Absolute Pathnames in Rels File [Issue #3553](https://github.com/PHPOffice/PhpSpreadsheet/issues/3553) [PR #3554](https://github.com/PHPOffice/PhpSpreadsheet/pull/3554)
+- Return Page Breaks in Order [Issue #3552](https://github.com/PHPOffice/PhpSpreadsheet/issues/3552) [PR #3555](https://github.com/PHPOffice/PhpSpreadsheet/pull/3555)
+- Add position attribute for MemoryDrawing in Html [Issue #3529](https://github.com/PHPOffice/PhpSpreadsheet/issues/3529 [PR #3535](https://github.com/PHPOffice/PhpSpreadsheet/pull/3535)
+- Allow Index_number as Array for VLOOKUP/HLOOKUP [Issue #3561](https://github.com/PHPOffice/PhpSpreadsheet/issues/3561 [PR #3570](https://github.com/PHPOffice/PhpSpreadsheet/pull/3570)
+- Add Unsupported Options in Xml Spreadsheet [Issue #3566](https://github.com/PHPOffice/PhpSpreadsheet/issues/3566 [Issue #3568](https://github.com/PHPOffice/PhpSpreadsheet/issues/3568 [Issue #3569](https://github.com/PHPOffice/PhpSpreadsheet/issues/3569 [PR #3567](https://github.com/PHPOffice/PhpSpreadsheet/pull/3567)
+- Changes to NUMBERVALUE, VALUE, DATEVALUE, TIMEVALUE [Issue #3574](https://github.com/PHPOffice/PhpSpreadsheet/issues/3574 [PR #3575](https://github.com/PHPOffice/PhpSpreadsheet/pull/3575)
+- Redo calculation of color tinting [Issue #3550](https://github.com/PHPOffice/PhpSpreadsheet/issues/3550) [PR #3580](https://github.com/PHPOffice/PhpSpreadsheet/pull/3580)
+- Accommodate Slash with preg_quote [PR #3582](https://github.com/PHPOffice/PhpSpreadsheet/pull/3582) [PR #3583](https://github.com/PHPOffice/PhpSpreadsheet/pull/3583) [PR #3584](https://github.com/PHPOffice/PhpSpreadsheet/pull/3584)
+- HyperlinkBase Property and Html Handling of Properties [Issue #3573](https://github.com/PHPOffice/PhpSpreadsheet/issues/3573) [PR #3589](https://github.com/PHPOffice/PhpSpreadsheet/pull/3589)
+- Improvements for Data Validation [Issue #3592](https://github.com/PHPOffice/PhpSpreadsheet/issues/3592) [Issue #3594](https://github.com/PHPOffice/PhpSpreadsheet/issues/3594) [PR #3605](https://github.com/PHPOffice/PhpSpreadsheet/pull/3605)
+
+## 1.28.0 - 2023-02-25
+
+### Added
+
+- Support for configuring a Chart Title's overlay [PR #3325](https://github.com/PHPOffice/PhpSpreadsheet/pull/3325)
+- Wizards for defining Number Format masks for Numbers, Percentages, Scientific, Currency and Accounting [PR #3334](https://github.com/PHPOffice/PhpSpreadsheet/pull/3334)
+- Support for fixed value divisor in fractional Number Format Masks [PR #3339](https://github.com/PHPOffice/PhpSpreadsheet/pull/3339)
+- Allow More Fonts/Fontnames for Exact Width Calculation [PR #3326](https://github.com/PHPOffice/PhpSpreadsheet/pull/3326) [Issue #3190](https://github.com/PHPOffice/PhpSpreadsheet/issues/3190)
+- Allow override of the Value Binder when setting a Cell value [PR #3361](https://github.com/PHPOffice/PhpSpreadsheet/pull/3361)
+
+### Changed
+
+- Improved handling for @ placeholder in Number Format Masks [PR #3344](https://github.com/PHPOffice/PhpSpreadsheet/pull/3344)
+- Improved handling for ? placeholder in Number Format Masks [PR #3394](https://github.com/PHPOffice/PhpSpreadsheet/pull/3394)
+- Improved support for locale settings and currency codes when matching formatted strings to numerics in the Calculation Engine [PR #3373](https://github.com/PHPOffice/PhpSpreadsheet/pull/3373) and [PR #3374](https://github.com/PHPOffice/PhpSpreadsheet/pull/3374)
+- Improved support for locale settings and matching in the Advanced Value Binder [PR #3376](https://github.com/PHPOffice/PhpSpreadsheet/pull/3376)
+- `toFormattedString` will now always return a string. This can affect the results of `toArray`, `namedRangeToArray`, and `rangeToArray`. [PR #3304](https://github.com/PHPOffice/PhpSpreadsheet/pull/3304)
+- Value of constants FORMAT_CURRENCY_EUR and FORMAT_CURRENCY_USD is changed. [Issue #3577](https://github.com/PHPOffice/PhpSpreadsheet/issues/3577) [PR #3377](https://github.com/PHPOffice/PhpSpreadsheet/pull/3377)
+
+### Deprecated
+
+- Rationalisation of Pre-defined Currency Format Masks [PR #3377](https://github.com/PHPOffice/PhpSpreadsheet/pull/3377)
+
+### Removed
+
+- Nothing
+
+### Fixed
+
+- Calculation Engine doesn't evaluate Defined Name when default cell A1 is quote-prefixed [Issue #3335](https://github.com/PHPOffice/PhpSpreadsheet/issues/3335) [PR #3336](https://github.com/PHPOffice/PhpSpreadsheet/pull/3336)
+- XLSX Writer - Array Formulas do not include function prefix [Issue #3337](https://github.com/PHPOffice/PhpSpreadsheet/issues/3337) [PR #3338](https://github.com/PHPOffice/PhpSpreadsheet/pull/3338)
+- Permit Max Column for Row Breaks [Issue #3143](https://github.com/PHPOffice/PhpSpreadsheet/issues/3143) [PR #3345](https://github.com/PHPOffice/PhpSpreadsheet/pull/3345)
+- AutoSize Columns should allow for dropdown icon when AutoFilter is for a Table [Issue #3356](https://github.com/PHPOffice/PhpSpreadsheet/issues/3356) [PR #3358](https://github.com/PHPOffice/PhpSpreadsheet/pull/3358) and for Center Alignment of Headers [Issue #3395](https://github.com/PHPOffice/PhpSpreadsheet/issues/3395) [PR #3399](https://github.com/PHPOffice/PhpSpreadsheet/pull/3399)
+- Decimal Precision for Scientific Number Format Mask [Issue #3381](https://github.com/PHPOffice/PhpSpreadsheet/issues/3381) [PR #3382](https://github.com/PHPOffice/PhpSpreadsheet/pull/3382)
+- Xls Writer Parser Handle Boolean Literals as Function Arguments [Issue #3369](https://github.com/PHPOffice/PhpSpreadsheet/issues/3369) [PR #3391](https://github.com/PHPOffice/PhpSpreadsheet/pull/3391)
+- Conditional Formatting Improvements for Xlsx [Issue #3370](https://github.com/PHPOffice/PhpSpreadsheet/issues/3370) [Issue #3202](https://github.com/PHPOffice/PhpSpreadsheet/issues/3302) [PR #3372](https://github.com/PHPOffice/PhpSpreadsheet/pull/3372)
+- Coerce Bool to Int for Mathematical Operations on Arrays [Issue #3389](https://github.com/PHPOffice/PhpSpreadsheet/issues/3389) [Issue #3396](https://github.com/PHPOffice/PhpSpreadsheet/issues/3396) [PR #3392](https://github.com/PHPOffice/PhpSpreadsheet/pull/3392)
+
+## 1.27.1 - 2023-02-08
+
+### Added
+
+- Nothing
+
+### Changed
+
+- Nothing
+
+### Deprecated
+
+- Nothing
+
+### Removed
+
+- Nothing
+
+### Fixed
+
+- Fix Composer --dev dependency issue with dealerdirect/phpcodesniffer-composer-installer renaming their `master` branch to `main`
+
+
+## 1.27.0 - 2023-01-24
+
+### Added
+
+- Option to specify a range of columns/rows for the Row/Column `isEmpty()` methods [PR #3315](https://github.com/PHPOffice/PhpSpreadsheet/pull/3315)
+- Option for Cell Iterator to return a null value or create and return a new cell when accessing a cell that doesn't exist [PR #3314](https://github.com/PHPOffice/PhpSpreadsheet/pull/3314)
+- Support for Structured References in the Calculation Engine [PR #3261](https://github.com/PHPOffice/PhpSpreadsheet/pull/3261)
+- Limited Support for Form Controls [PR #3130](https://github.com/PHPOffice/PhpSpreadsheet/pull/3130) [Issue #2396](https://github.com/PHPOffice/PhpSpreadsheet/issues/2396) [Issue #1770](https://github.com/PHPOffice/PhpSpreadsheet/issues/1770) [Issue #2388](https://github.com/PHPOffice/PhpSpreadsheet/issues/2388) [Issue #2904](https://github.com/PHPOffice/PhpSpreadsheet/issues/2904) [Issue #2661](https://github.com/PHPOffice/PhpSpreadsheet/issues/2661)
+
+### Changed
+
+- Nothing
+
+### Deprecated
+
+- Nothing
+
+### Removed
+
+- Shared/JAMA is removed. [PR #3260](https://github.com/PHPOffice/PhpSpreadsheet/pull/3260)
+
+### Fixed
+
+- Namespace-Aware Code for SheetViewOptions, SheetProtection [PR #3230](https://github.com/PHPOffice/PhpSpreadsheet/pull/3230)
+- Additional Method for XIRR if Newton-Raphson Doesn't Converge [Issue #689](https://github.com/PHPOffice/PhpSpreadsheet/issues/689) [PR #3262](https://github.com/PHPOffice/PhpSpreadsheet/pull/3262)
+- Better Handling of Composite Charts [Issue #2333](https://github.com/PHPOffice/PhpSpreadsheet/issues/2333) [PR #3265](https://github.com/PHPOffice/PhpSpreadsheet/pull/3265)
+- Update Column Reference for Columns Beginning with Y and Z [Issue #3263](https://github.com/PHPOffice/PhpSpreadsheet/issues/3263) [PR #3264](https://github.com/PHPOffice/PhpSpreadsheet/pull/3264)
+- Honor Fit to 1-Page Height Html/Pdf [Issue #3266](https://github.com/PHPOffice/PhpSpreadsheet/issues/3266) [PR #3279](https://github.com/PHPOffice/PhpSpreadsheet/pull/3279)
+- AND/OR/XOR Handling of Literal Strings [PR #3287](https://github.com/PHPOffice/PhpSpreadsheet/pull/3287)
+- Xls Reader Vertical Break and Writer Page Order [Issue #3305](https://github.com/PHPOffice/PhpSpreadsheet/issues/3305) [PR #3306](https://github.com/PHPOffice/PhpSpreadsheet/pull/3306)
+
+
+## 1.26.0 - 2022-12-21
+
+### Added
+
+- Extended flag options for the Reader `load()` and Writer `save()` methods
+- Apply Row/Column limits (1048576 and XFD) in ReferenceHelper [PR #3213](https://github.com/PHPOffice/PhpSpreadsheet/pull/3213)
+- Allow the creation of In-Memory Drawings from a string of binary image data, or from a stream. [PR #3157](https://github.com/PHPOffice/PhpSpreadsheet/pull/3157)
+- Xlsx Reader support for Pivot Tables [PR #2829](https://github.com/PHPOffice/PhpSpreadsheet/pull/2829)
+- Permit Date/Time Entered on Spreadsheet to be calculated as Float [Issue #1416](https://github.com/PHPOffice/PhpSpreadsheet/issues/1416) [PR #3121](https://github.com/PHPOffice/PhpSpreadsheet/pull/3121)
+
+### Changed
+
+- Nothing
+
+### Deprecated
+
+- Direct update of Calculation::suppressFormulaErrors is replaced with setter.
+- Font public static variable defaultColumnWidths replaced with constant DEFAULT_COLUMN_WIDTHS.
+- ExcelError public static variable errorCodes replaced with constant ERROR_CODES.
+- NumberFormat constant FORMAT_DATE_YYYYMMDD2 replaced with existing identical FORMAT_DATE_YYYYMMDD.
+
+### Removed
+
+- Nothing
+
+### Fixed
+
+- Fixed handling for `_xlws` prefixed functions from Office365 [Issue #3245](https://github.com/PHPOffice/PhpSpreadsheet/issues/3245) [PR #3247](https://github.com/PHPOffice/PhpSpreadsheet/pull/3247)
+- Conditionals formatting rules applied to rows/columns are removed [Issue #3184](https://github.com/PHPOffice/PhpSpreadsheet/issues/3184) [PR #3213](https://github.com/PHPOffice/PhpSpreadsheet/pull/3213)
+- Treat strings containing currency or accounting values as floats in Calculation Engine operations [Issue #3165](https://github.com/PHPOffice/PhpSpreadsheet/issues/3165) [PR #3189](https://github.com/PHPOffice/PhpSpreadsheet/pull/3189)
+- Treat strings containing percentage values as floats in Calculation Engine operations [Issue #3155](https://github.com/PHPOffice/PhpSpreadsheet/issues/3155) [PR #3156](https://github.com/PHPOffice/PhpSpreadsheet/pull/3156) and [PR #3164](https://github.com/PHPOffice/PhpSpreadsheet/pull/3164)
+- Xlsx Reader Accept Palette of Fewer than 64 Colors [Issue #3093](https://github.com/PHPOffice/PhpSpreadsheet/issues/3093) [PR #3096](https://github.com/PHPOffice/PhpSpreadsheet/pull/3096)
+- Use Locale-Independent Float Conversion for Xlsx Writer Custom Property [Issue #3095](https://github.com/PHPOffice/PhpSpreadsheet/issues/3095) [PR #3099](https://github.com/PHPOffice/PhpSpreadsheet/pull/3099)
+- Allow setting AutoFilter range on a single cell or row [Issue #3102](https://github.com/PHPOffice/PhpSpreadsheet/issues/3102) [PR #3111](https://github.com/PHPOffice/PhpSpreadsheet/pull/3111)
+- Xlsx Reader External Data Validations Flag Missing [Issue #2677](https://github.com/PHPOffice/PhpSpreadsheet/issues/2677) [PR #3078](https://github.com/PHPOffice/PhpSpreadsheet/pull/3078)
+- Reduces extra memory usage on `__destruct()` calls [PR #3092](https://github.com/PHPOffice/PhpSpreadsheet/pull/3092)
+- Additional properties for Trendlines [Issue #3011](https://github.com/PHPOffice/PhpSpreadsheet/issues/3011) [PR #3028](https://github.com/PHPOffice/PhpSpreadsheet/pull/3028)
+- Calculation suppressFormulaErrors fix [Issue #1531](https://github.com/PHPOffice/PhpSpreadsheet/issues/1531) [PR #3092](https://github.com/PHPOffice/PhpSpreadsheet/pull/3092)
+- Permit Date/Time Entered on Spreadsheet to be Calculated as Float [Issue #1416](https://github.com/PHPOffice/PhpSpreadsheet/issues/1416) [PR #3121](https://github.com/PHPOffice/PhpSpreadsheet/pull/3121)
+- Incorrect Handling of Data Validation Formula Containing Ampersand [Issue #3145](https://github.com/PHPOffice/PhpSpreadsheet/issues/3145) [PR #3146](https://github.com/PHPOffice/PhpSpreadsheet/pull/3146)
+- Xlsx Namespace Handling of Drawings, RowAndColumnAttributes, MergeCells [Issue #3138](https://github.com/PHPOffice/PhpSpreadsheet/issues/3138) [PR #3136](https://github.com/PHPOffice/PhpSpreadsheet/pull/3137)
+- Generation3 Copy With Image in Footer [Issue #3126](https://github.com/PHPOffice/PhpSpreadsheet/issues/3126) [PR #3140](https://github.com/PHPOffice/PhpSpreadsheet/pull/3140)
+- MATCH Function Problems with Int/Float Compare and Wildcards [Issue #3141](https://github.com/PHPOffice/PhpSpreadsheet/issues/3141) [PR #3142](https://github.com/PHPOffice/PhpSpreadsheet/pull/3142)
+- Fix ODS Read Filter on number-columns-repeated cell [Issue #3148](https://github.com/PHPOffice/PhpSpreadsheet/issues/3148) [PR #3149](https://github.com/PHPOffice/PhpSpreadsheet/pull/3149)
+- Problems Formatting Very Small and Very Large Numbers [Issue #3128](https://github.com/PHPOffice/PhpSpreadsheet/issues/3128) [PR #3152](https://github.com/PHPOffice/PhpSpreadsheet/pull/3152)
+- XlsxWrite preserve line styles for y-axis, not just x-axis [PR #3163](https://github.com/PHPOffice/PhpSpreadsheet/pull/3163)
+- Xlsx Namespace Handling of Drawings, RowAndColumnAttributes, MergeCells [Issue #3138](https://github.com/PHPOffice/PhpSpreadsheet/issues/3138) [PR #3137](https://github.com/PHPOffice/PhpSpreadsheet/pull/3137)
+- More Detail for Cyclic Error Messages [Issue #3169](https://github.com/PHPOffice/PhpSpreadsheet/issues/3169) [PR #3170](https://github.com/PHPOffice/PhpSpreadsheet/pull/3170)
+- Improved Documentation for Deprecations - many PRs [Issue #3162](https://github.com/PHPOffice/PhpSpreadsheet/issues/3162)
+
+
+## 1.25.2 - 2022-09-25
+
+### Added
+
+- Nothing
+
+### Changed
+
+- Nothing
+
+### Deprecated
+
+- Nothing
+
+### Removed
+
+- Nothing
+
+### Fixed
+
+- Composer dependency clash with ezyang/htmlpurifier
+
+
+## 1.25.0 - 2022-09-25
+
+### Added
+
+- Implementation of the new `TEXTBEFORE()`, `TEXTAFTER()` and `TEXTSPLIT()` Excel Functions
+- Implementation of the `ARRAYTOTEXT()` and `VALUETOTEXT()` Excel Functions
+- Support for [mitoteam/jpgraph](https://packagist.org/packages/mitoteam/jpgraph) implementation of
+ JpGraph library to render charts added.
+- Charts: Add Gradients, Transparency, Hidden Axes, Rounded Corners, Trendlines, Date Axes.
+
+### Changed
+
+- Allow variant behaviour when merging cells [Issue #3065](https://github.com/PHPOffice/PhpSpreadsheet/issues/3065)
+ - Merge methods now allow an additional `$behaviour` argument. Permitted values are:
+ - Worksheet::MERGE_CELL_CONTENT_EMPTY - Empty the content of the hidden cells (the default behaviour)
+ - Worksheet::MERGE_CELL_CONTENT_HIDE - Keep the content of the hidden cells
+ - Worksheet::MERGE_CELL_CONTENT_MERGE - Move the content of the hidden cells into the first cell
+
+### Deprecated
+
+- Axis getLineProperty deprecated in favor of getLineColorProperty.
+- Moved majorGridlines and minorGridlines from Chart to Axis. Setting either in Chart constructor or through Chart methods, or getting either using Chart methods is deprecated.
+- Chart::EXCEL_COLOR_TYPE_* copied from Properties to ChartColor; use in Properties is deprecated.
+- ChartColor::EXCEL_COLOR_TYPE_ARGB deprecated in favor of EXCEL_COLOR_TYPE_RGB ("A" component was never allowed).
+- Misspelled Properties::LINE_STYLE_DASH_SQUERE_DOT deprecated in favor of LINE_STYLE_DASH_SQUARE_DOT.
+- Clone not permitted for Spreadsheet. Spreadsheet->copy() can be used instead.
+
+### Removed
+
+- Nothing
+
+### Fixed
+
+- Fix update to defined names when inserting/deleting rows/columns [Issue #3076](https://github.com/PHPOffice/PhpSpreadsheet/issues/3076) [PR #3077](https://github.com/PHPOffice/PhpSpreadsheet/pull/3077)
+- Fix DataValidation sqRef when inserting/deleting rows/columns [Issue #3056](https://github.com/PHPOffice/PhpSpreadsheet/issues/3056) [PR #3074](https://github.com/PHPOffice/PhpSpreadsheet/pull/3074)
+- Named ranges not usable as anchors in OFFSET function [Issue #3013](https://github.com/PHPOffice/PhpSpreadsheet/issues/3013)
+- Fully flatten an array [Issue #2955](https://github.com/PHPOffice/PhpSpreadsheet/issues/2955) [PR #2956](https://github.com/PHPOffice/PhpSpreadsheet/pull/2956)
+- cellExists() and getCell() methods should support UTF-8 named cells [Issue #2987](https://github.com/PHPOffice/PhpSpreadsheet/issues/2987) [PR #2988](https://github.com/PHPOffice/PhpSpreadsheet/pull/2988)
+- Spreadsheet copy fixed, clone disabled. [PR #2951](https://github.com/PHPOffice/PhpSpreadsheet/pull/2951)
+- Fix PDF problems with text rotation and paper size. [Issue #1747](https://github.com/PHPOffice/PhpSpreadsheet/issues/1747) [Issue #1713](https://github.com/PHPOffice/PhpSpreadsheet/issues/1713) [PR #2960](https://github.com/PHPOffice/PhpSpreadsheet/pull/2960)
+- Limited support for chart titles as formulas [Issue #2965](https://github.com/PHPOffice/PhpSpreadsheet/issues/2965) [Issue #749](https://github.com/PHPOffice/PhpSpreadsheet/issues/749) [PR #2971](https://github.com/PHPOffice/PhpSpreadsheet/pull/2971)
+- Add Gradients, Transparency, and Hidden Axes to Chart [Issue #2257](https://github.com/PHPOffice/PhpSpreadsheet/issues/2257) [Issue #2229](https://github.com/PHPOffice/PhpSpreadsheet/issues/2929) [Issue #2935](https://github.com/PHPOffice/PhpSpreadsheet/issues/2935) [PR #2950](https://github.com/PHPOffice/PhpSpreadsheet/pull/2950)
+- Chart Support for Rounded Corners and Trendlines [Issue #2968](https://github.com/PHPOffice/PhpSpreadsheet/issues/2968) [Issue #2815](https://github.com/PHPOffice/PhpSpreadsheet/issues/2815) [PR #2976](https://github.com/PHPOffice/PhpSpreadsheet/pull/2976)
+- Add setName Method for Chart [Issue #2991](https://github.com/PHPOffice/PhpSpreadsheet/issues/2991) [PR #3001](https://github.com/PHPOffice/PhpSpreadsheet/pull/3001)
+- Eliminate partial dependency on php-intl in StringHelper [Issue #2982](https://github.com/PHPOffice/PhpSpreadsheet/issues/2982) [PR #2994](https://github.com/PHPOffice/PhpSpreadsheet/pull/2994)
+- Minor changes for Pdf [Issue #2999](https://github.com/PHPOffice/PhpSpreadsheet/issues/2999) [PR #3002](https://github.com/PHPOffice/PhpSpreadsheet/pull/3002) [PR #3006](https://github.com/PHPOffice/PhpSpreadsheet/pull/3006)
+- Html/Pdf Do net set background color for cells using (default) nofill [PR #3016](https://github.com/PHPOffice/PhpSpreadsheet/pull/3016)
+- Add support for Date Axis to Chart [Issue #2967](https://github.com/PHPOffice/PhpSpreadsheet/issues/2967) [PR #3018](https://github.com/PHPOffice/PhpSpreadsheet/pull/3018)
+- Reconcile Differences Between Css and Excel for Cell Alignment [PR #3048](https://github.com/PHPOffice/PhpSpreadsheet/pull/3048)
+- R1C1 Format Internationalization and Better Support for Relative Offsets [Issue #1704](https://github.com/PHPOffice/PhpSpreadsheet/issues/1704) [PR #3052](https://github.com/PHPOffice/PhpSpreadsheet/pull/3052)
+- Minor Fix for Percentage Formatting [Issue #1929](https://github.com/PHPOffice/PhpSpreadsheet/issues/1929) [PR #3053](https://github.com/PHPOffice/PhpSpreadsheet/pull/3053)
+
+## 1.24.1 - 2022-07-18
+
+### Added
+
+- Support for SimpleCache Interface versions 1.0, 2.0 and 3.0
+- Add Chart Axis Option textRotation [Issue #2705](https://github.com/PHPOffice/PhpSpreadsheet/issues/2705) [PR #2940](https://github.com/PHPOffice/PhpSpreadsheet/pull/2940)
+
+### Changed
+
+- Nothing
+
+### Deprecated
+
+- Nothing
+
+### Removed
+
+- Nothing
+
+### Fixed
+
+- Fix Encoding issue with Html reader (PHP 8.2 deprecation for mb_convert_encoding) [Issue #2942](https://github.com/PHPOffice/PhpSpreadsheet/issues/2942) [PR #2943](https://github.com/PHPOffice/PhpSpreadsheet/pull/2943)
+- Additional Chart fixes
+ - Pie chart with part separated unwantedly [Issue #2506](https://github.com/PHPOffice/PhpSpreadsheet/issues/2506) [PR #2928](https://github.com/PHPOffice/PhpSpreadsheet/pull/2928)
+ - Chart styling is lost on simple load / save process [Issue #1797](https://github.com/PHPOffice/PhpSpreadsheet/issues/1797) [Issue #2077](https://github.com/PHPOffice/PhpSpreadsheet/issues/2077) [PR #2930](https://github.com/PHPOffice/PhpSpreadsheet/pull/2930)
+ - Can't create contour chart (surface 2d) [Issue #2931](https://github.com/PHPOffice/PhpSpreadsheet/issues/2931) [PR #2933](https://github.com/PHPOffice/PhpSpreadsheet/pull/2933)
+- VLOOKUP Breaks When Array Contains Null Cells [Issue #2934](https://github.com/PHPOffice/PhpSpreadsheet/issues/2934) [PR #2939](https://github.com/PHPOffice/PhpSpreadsheet/pull/2939)
+
+## 1.24.0 - 2022-07-09
+
+Note that this will be the last 1.x branch release before the 2.x release. We will maintain both branches in parallel for a time; but users are requested to update to version 2.0 once that is fully available.
+
+### Added
+
+- Added `removeComment()` method for Worksheet [PR #2875](https://github.com/PHPOffice/PhpSpreadsheet/pull/2875/files)
+- Add point size option for scatter charts [Issue #2298](https://github.com/PHPOffice/PhpSpreadsheet/issues/2298) [PR #2801](https://github.com/PHPOffice/PhpSpreadsheet/pull/2801)
+- Basic support for Xlsx reading/writing Chart Sheets [PR #2830](https://github.com/PHPOffice/PhpSpreadsheet/pull/2830)
+
+ Note that a ChartSheet is still only written as a normal Worksheet containing a single chart, not as an actual ChartSheet.
+
+- Added Worksheet visibility in Ods Reader [PR #2851](https://github.com/PHPOffice/PhpSpreadsheet/pull/2851) and Gnumeric Reader [PR #2853](https://github.com/PHPOffice/PhpSpreadsheet/pull/2853)
+- Added Worksheet visibility in Ods Writer [PR #2850](https://github.com/PHPOffice/PhpSpreadsheet/pull/2850)
+- Allow Csv Reader to treat string as contents of file [Issue #1285](https://github.com/PHPOffice/PhpSpreadsheet/issues/1285) [PR #2792](https://github.com/PHPOffice/PhpSpreadsheet/pull/2792)
+- Allow Csv Reader to store null string rather than leave cell empty [Issue #2840](https://github.com/PHPOffice/PhpSpreadsheet/issues/2840) [PR #2842](https://github.com/PHPOffice/PhpSpreadsheet/pull/2842)
+- Provide new Worksheet methods to identify if a row or column is "empty", making allowance for different definitions of "empty":
+ - Treat rows/columns containing no cell records as empty (default)
+ - Treat cells containing a null value as empty
+ - Treat cells containing an empty string as empty
+
+### Changed
+
+- Modify `rangeBoundaries()`, `rangeDimension()` and `getRangeBoundaries()` Coordinate methods to work with row/column ranges as well as with cell ranges and cells [PR #2926](https://github.com/PHPOffice/PhpSpreadsheet/pull/2926)
+- Better enforcement of value modification to match specified datatype when using `setValueExplicit()`
+- Relax validation of merge cells to allow merge for a single cell reference [Issue #2776](https://github.com/PHPOffice/PhpSpreadsheet/issues/2776)
+- Memory and speed improvements, particularly for the Cell Collection, and the Writers.
+
+ See [the Discussion section on github](https://github.com/PHPOffice/PhpSpreadsheet/discussions/2821) for details of performance across versions
+- Improved performance for removing rows/columns from a worksheet
+
+### Deprecated
+
+- Nothing
+
+### Removed
+
+- Nothing
+
+### Fixed
+
+- Xls Reader resolving absolute named ranges to relative ranges [Issue #2826](https://github.com/PHPOffice/PhpSpreadsheet/issues/2826) [PR #2827](https://github.com/PHPOffice/PhpSpreadsheet/pull/2827)
+- Null value handling in the Excel Math/Trig PRODUCT() function [Issue #2833](https://github.com/PHPOffice/PhpSpreadsheet/issues/2833) [PR #2834](https://github.com/PHPOffice/PhpSpreadsheet/pull/2834)
+- Invalid Print Area defined in Xlsx corrupts internal storage of print area [Issue #2848](https://github.com/PHPOffice/PhpSpreadsheet/issues/2848) [PR #2849](https://github.com/PHPOffice/PhpSpreadsheet/pull/2849)
+- Time interval formatting [Issue #2768](https://github.com/PHPOffice/PhpSpreadsheet/issues/2768) [PR #2772](https://github.com/PHPOffice/PhpSpreadsheet/pull/2772)
+- Copy from Xls(x) to Html/Pdf loses drawings [PR #2788](https://github.com/PHPOffice/PhpSpreadsheet/pull/2788)
+- Html Reader converting cell containing 0 to null string [Issue #2810](https://github.com/PHPOffice/PhpSpreadsheet/issues/2810) [PR #2813](https://github.com/PHPOffice/PhpSpreadsheet/pull/2813)
+- Many fixes for Charts, especially, but not limited to, Scatter, Bubble, and Surface charts. [Issue #2762](https://github.com/PHPOffice/PhpSpreadsheet/issues/2762) [Issue #2299](https://github.com/PHPOffice/PhpSpreadsheet/issues/2299) [Issue #2700](https://github.com/PHPOffice/PhpSpreadsheet/issues/2700) [Issue #2817](https://github.com/PHPOffice/PhpSpreadsheet/issues/2817) [Issue #2763](https://github.com/PHPOffice/PhpSpreadsheet/issues/2763) [Issue #2219](https://github.com/PHPOffice/PhpSpreadsheet/issues/2219) [Issue #2863](https://github.com/PHPOffice/PhpSpreadsheet/issues/2863) [PR #2828](https://github.com/PHPOffice/PhpSpreadsheet/pull/2828) [PR #2841](https://github.com/PHPOffice/PhpSpreadsheet/pull/2841) [PR #2846](https://github.com/PHPOffice/PhpSpreadsheet/pull/2846) [PR #2852](https://github.com/PHPOffice/PhpSpreadsheet/pull/2852) [PR #2856](https://github.com/PHPOffice/PhpSpreadsheet/pull/2856) [PR #2865](https://github.com/PHPOffice/PhpSpreadsheet/pull/2865) [PR #2872](https://github.com/PHPOffice/PhpSpreadsheet/pull/2872) [PR #2879](https://github.com/PHPOffice/PhpSpreadsheet/pull/2879) [PR #2898](https://github.com/PHPOffice/PhpSpreadsheet/pull/2898) [PR #2906](https://github.com/PHPOffice/PhpSpreadsheet/pull/2906) [PR #2922](https://github.com/PHPOffice/PhpSpreadsheet/pull/2922) [PR #2923](https://github.com/PHPOffice/PhpSpreadsheet/pull/2923)
+- Adjust both coordinates for two-cell anchors when rows/columns are added/deleted. [Issue #2908](https://github.com/PHPOffice/PhpSpreadsheet/issues/2908) [PR #2909](https://github.com/PHPOffice/PhpSpreadsheet/pull/2909)
+- Keep calculated string results below 32K. [PR #2921](https://github.com/PHPOffice/PhpSpreadsheet/pull/2921)
+- Filter out illegal Unicode char values FFFE/FFFF. [Issue #2897](https://github.com/PHPOffice/PhpSpreadsheet/issues/2897) [PR #2910](https://github.com/PHPOffice/PhpSpreadsheet/pull/2910)
+- Better handling of REF errors and propagation of all errors in Calculation engine. [PR #2902](https://github.com/PHPOffice/PhpSpreadsheet/pull/2902)
+- Calculating Engine regexp for Column/Row references when there are multiple quoted worksheet references in the formula [Issue #2874](https://github.com/PHPOffice/PhpSpreadsheet/issues/2874) [PR #2899](https://github.com/PHPOffice/PhpSpreadsheet/pull/2899)
+
+## 1.23.0 - 2022-04-24
+
+### Added
+
+- Ods Writer support for Freeze Pane [Issue #2013](https://github.com/PHPOffice/PhpSpreadsheet/issues/2013) [PR #2755](https://github.com/PHPOffice/PhpSpreadsheet/pull/2755)
+- Ods Writer support for setting column width/row height (including the use of AutoSize) [Issue #2346](https://github.com/PHPOffice/PhpSpreadsheet/issues/2346) [PR #2753](https://github.com/PHPOffice/PhpSpreadsheet/pull/2753)
+- Introduced CellAddress, CellRange, RowRange and ColumnRange value objects that can be used as an alternative to a string value (e.g. `'C5'`, `'B2:D4'`, `'2:2'` or `'B:C'`) in appropriate contexts.
+- Implementation of the FILTER(), SORT(), SORTBY() and UNIQUE() Lookup/Reference (array) functions.
+- Implementation of the ISREF() Information function.
+- Added support for reading "formatted" numeric values from Csv files; although default behaviour of reading these values as strings is preserved.
+
+ (i.e a value of "12,345.67" can be read as numeric `12345.67`, not simply as a string `"12,345.67"`, if the `castFormattedNumberToNumeric()` setting is enabled.
+
+ This functionality is locale-aware, using the server's locale settings to identify the thousands and decimal separators.
+
+- Support for two cell anchor drawing of images. [#2532](https://github.com/PHPOffice/PhpSpreadsheet/pull/2532) [#2674](https://github.com/PHPOffice/PhpSpreadsheet/pull/2674)
+- Limited support for Xls Reader to handle Conditional Formatting:
+
+ Ranges and Rules are read, but style is currently limited to font size, weight and color; and to fill style and color.
+
+- Add ability to suppress Mac line ending check for CSV [#2623](https://github.com/PHPOffice/PhpSpreadsheet/pull/2623)
+- Initial support for creating and writing Tables (Xlsx Writer only) [PR #2671](https://github.com/PHPOffice/PhpSpreadsheet/pull/2671)
+
+ See `/samples/Table` for examples of use.
+
+ Note that PreCalculateFormulas needs to be disabled when saving spreadsheets containing tables with formulae (totals or column formulae).
+
+### Changed
+
+- Gnumeric Reader now loads number formatting for cells.
+- Gnumeric Reader now correctly identifies selected worksheet and selected cells in a worksheet.
+- Some Refactoring of the Ods Reader, moving all formula and address translation from Ods to Excel into a separate class to eliminate code duplication and ensure consistency.
+- Make Boolean Conversion in Csv Reader locale-aware when using the String Value Binder.
+
+ This is determined by the Calculation Engine locale setting.
+
+ (i.e. `"Vrai"` wil be converted to a boolean `true` if the Locale is set to `fr`.)
+- Allow `psr/simple-cache` 2.x
+
+### Deprecated
+
+- All Excel Function implementations in `Calculation\Functions` (including the Error functions) have been moved to dedicated classes for groups of related functions. See the docblocks against all the deprecated methods for details of the new methods to call instead. At some point, these old classes will be deleted.
+- Worksheet methods that reference cells "byColumnandRow". All such methods have an equivalent that references the cell by its address (e.g. '`E3'` rather than `5, 3`).
+
+ These functions now accept either a cell address string (`'E3')` or an array with columnId and rowId (`[5, 3]`) or a new `CellAddress` object as their `cellAddress`/`coordinate` argument.
+ This includes the methods:
+ - `setCellValueByColumnAndRow()` use the equivalent `setCellValue()`
+ - `setCellValueExplicitByColumnAndRow()` use the equivalent `setCellValueExplicit()`
+ - `getCellByColumnAndRow()` use the equivalent `getCell()`
+ - `cellExistsByColumnAndRow()` use the equivalent `cellExists()`
+ - `getStyleByColumnAndRow()` use the equivalent `getStyle()`
+ - `setBreakByColumnAndRow()` use the equivalent `setBreak()`
+ - `mergeCellsByColumnAndRow()` use the equivalent `mergeCells()`
+ - `unmergeCellsByColumnAndRow()` use the equivalent `unmergeCells()`
+ - `protectCellsByColumnAndRow()` use the equivalent `protectCells()`
+ - `unprotectCellsByColumnAndRow()` use the equivalent `unprotectCells()`
+ - `setAutoFilterByColumnAndRow()` use the equivalent `setAutoFilter()`
+ - `freezePaneByColumnAndRow()` use the equivalent `freezePane()`
+ - `getCommentByColumnAndRow()` use the equivalent `getComment()`
+ - `setSelectedCellByColumnAndRow()` use the equivalent `setSelectedCells()`
+
+ This change provides more consistency in the methods (not every "by cell address" method has an equivalent "byColumnAndRow" method);
+ and the "by cell address" methods often provide more flexibility, such as allowing a range of cells, or referencing them by passing the defined name of a named range as the argument.
+
+### Removed
+
+- Nothing
+
+### Fixed
+
+- Make allowance for the AutoFilter dropdown icon in the first row of an Autofilter range when using Autosize columns. [Issue #2413](https://github.com/PHPOffice/PhpSpreadsheet/issues/2413) [PR #2754](https://github.com/PHPOffice/PhpSpreadsheet/pull/2754)
+- Support for "chained" ranges (e.g. `A5:C10:C20:F1`) in the Calculation Engine; and also support for using named ranges with the Range operator (e.g. `NamedRange1:NamedRange2`) [Issue #2730](https://github.com/PHPOffice/PhpSpreadsheet/issues/2730) [PR #2746](https://github.com/PHPOffice/PhpSpreadsheet/pull/2746)
+- Update Conditional Formatting ranges and rule conditions when inserting/deleting rows/columns [Issue #2678](https://github.com/PHPOffice/PhpSpreadsheet/issues/2678) [PR #2689](https://github.com/PHPOffice/PhpSpreadsheet/pull/2689)
+- Allow `INDIRECT()` to accept row/column ranges as well as cell ranges [PR #2687](https://github.com/PHPOffice/PhpSpreadsheet/pull/2687)
+- Fix bug when deleting cells with hyperlinks, where the hyperlink was then being "inherited" by whatever cell moved to that cell address.
+- Fix bug in Conditional Formatting in the Xls Writer that resulted in a broken file when there were multiple conditional ranges in a worksheet.
+- Fix Conditional Formatting in the Xls Writer to work with rules that contain string literals, cell references and formulae.
+- Fix for setting Active Sheet to the first loaded worksheet when bookViews element isn't defined [Issue #2666](https://github.com/PHPOffice/PhpSpreadsheet/issues/2666) [PR #2669](https://github.com/PHPOffice/PhpSpreadsheet/pull/2669)
+- Fixed behaviour of XLSX font style vertical align settings [PR #2619](https://github.com/PHPOffice/PhpSpreadsheet/pull/2619)
+- Resolved formula translations to handle separators (row and column) for array functions as well as for function argument separators; and cleanly handle nesting levels.
+
+ Note that this method is used when translating Excel functions between `en_us` and other locale languages, as well as when converting formulae between different spreadsheet formats (e.g. Ods to Excel).
+
+ Nor is this a perfect solution, as there may still be issues when function calls have array arguments that themselves contain function calls; but it's still better than the current logic.
+- Fix for escaping double quotes within a formula [Issue #1971](https://github.com/PHPOffice/PhpSpreadsheet/issues/1971) [PR #2651](https://github.com/PHPOffice/PhpSpreadsheet/pull/2651)
+- Change open mode for output from `wb+` to `wb` [Issue #2372](https://github.com/PHPOffice/PhpSpreadsheet/issues/2372) [PR #2657](https://github.com/PHPOffice/PhpSpreadsheet/pull/2657)
+- Use color palette if supplied [Issue #2499](https://github.com/PHPOffice/PhpSpreadsheet/issues/2499) [PR #2595](https://github.com/PHPOffice/PhpSpreadsheet/pull/2595)
+- Xls reader treat drawing offsets as int rather than float [PR #2648](https://github.com/PHPOffice/PhpSpreadsheet/pull/2648)
+- Handle booleans in conditional styles properly [PR #2654](https://github.com/PHPOffice/PhpSpreadsheet/pull/2654)
+- Fix for reading files in the root directory of a ZipFile, which should not be prefixed by relative paths ("./") as dirname($filename) does by default.
+- Fix invalid style of cells in empty columns with columnDimensions and rows with rowDimensions in added external sheet. [PR #2739](https://github.com/PHPOffice/PhpSpreadsheet/pull/2739)
+- Time Interval Formatting [Issue #2768](https://github.com/PHPOffice/PhpSpreadsheet/issues/2768) [PR #2772](https://github.com/PHPOffice/PhpSpreadsheet/pull/2772)
+
+## 1.22.0 - 2022-02-18
+
+### Added
+
+- Namespacing phase 2 - styles.
+[PR #2471](https://github.com/PHPOffice/PhpSpreadsheet/pull/2471)
+
+- Improved support for passing of array arguments to Excel function implementations to return array results (where appropriate). [Issue #2551](https://github.com/PHPOffice/PhpSpreadsheet/issues/2551)
+
+ This is the first stage in an ongoing process of adding array support to all appropriate function implementations,
+- Support for the Excel365 Math/Trig SEQUENCE() function [PR #2536](https://github.com/PHPOffice/PhpSpreadsheet/pull/2536)
+- Support for the Excel365 Math/Trig RANDARRAY() function [PR #2540](https://github.com/PHPOffice/PhpSpreadsheet/pull/2540)
+
+ Note that the Spill Operator is not yet supported in the Calculation Engine; but this can still be useful for defining array constants.
+- Improved support for Conditional Formatting Rules [PR #2491](https://github.com/PHPOffice/PhpSpreadsheet/pull/2491)
+ - Provide support for a wider range of Conditional Formatting Rules for Xlsx Reader/Writer:
+ - Cells Containing (cellIs)
+ - Specific Text (containing, notContaining, beginsWith, endsWith)
+ - Dates Occurring (all supported timePeriods)
+ - Blanks/NoBlanks
+ - Errors/NoErrors
+ - Duplicates/Unique
+ - Expression
+ - Provision of CF Wizards (for all the above listed rule types) to help create/modify CF Rules without having to manage all the combinations of types/operators, and the complexities of formula expressions, or the text/timePeriod attributes.
+
+ See [documentation](https://phpspreadsheet.readthedocs.io/en/latest/topics/conditional-formatting/) for details
+
+ - Full support of the above CF Rules for the Xlsx Reader and Writer; even when the file being loaded has CF rules listed in the `` element for the worksheet rather than the `` element.
+ - Provision of a CellMatcher to identify if rules are matched for a cell, and which matching style will be applied.
+ - Improved documentation and examples, covering all supported CF rule types.
+ - Add support for one digit decimals (FORMAT_NUMBER_0, FORMAT_PERCENTAGE_0). [PR #2525](https://github.com/PHPOffice/PhpSpreadsheet/pull/2525)
+ - Initial work enabling Excel function implementations for handling arrays as arguments when used in "array formulae" [#2562](https://github.com/PHPOffice/PhpSpreadsheet/issues/2562)
+ - Enable most of the Date/Time functions to accept array arguments [#2573](https://github.com/PHPOffice/PhpSpreadsheet/issues/2573)
+ - Array ready functions - Text, Math/Trig, Statistical, Engineering and Logical [#2580](https://github.com/PHPOffice/PhpSpreadsheet/issues/2580)
+
+### Changed
+
+- Additional Russian translations for Excel Functions (courtesy of aleks-samurai).
+- Improved code coverage for NumberFormat. [PR #2556](https://github.com/PHPOffice/PhpSpreadsheet/pull/2556)
+- Extract some methods from the Calculation Engine into dedicated classes [#2537](https://github.com/PHPOffice/PhpSpreadsheet/issues/2537)
+- Eliminate calls to `flattenSingleValue()` that are no longer required when we're checking for array values as arguments [#2590](https://github.com/PHPOffice/PhpSpreadsheet/issues/2590)
+
+### Deprecated
+
+- Nothing
+
+### Removed
+
+- Nothing
+
+### Fixed
+
+- Fixed `ReferenceHelper@insertNewBefore` behavior when removing column before last column with null value [PR #2541](https://github.com/PHPOffice/PhpSpreadsheet/pull/2541)
+- Fix bug with `DOLLARDE()` and `DOLLARFR()` functions when the dollar value is negative [Issue #2578](https://github.com/PHPOffice/PhpSpreadsheet/issues/2578) [PR #2579](https://github.com/PHPOffice/PhpSpreadsheet/pull/2579)
+- Fix partial function name matching when translating formulae from Russian to English [Issue #2533](https://github.com/PHPOffice/PhpSpreadsheet/issues/2533) [PR #2534](https://github.com/PHPOffice/PhpSpreadsheet/pull/2534)
+- Various bugs related to Conditional Formatting Rules, and errors in the Xlsx Writer for Conditional Formatting [PR #2491](https://github.com/PHPOffice/PhpSpreadsheet/pull/2491)
+- Xlsx Reader merge range fixes. [Issue #2501](https://github.com/PHPOffice/PhpSpreadsheet/issues/2501) [PR #2504](https://github.com/PHPOffice/PhpSpreadsheet/pull/2504)
+- Handle explicit "date" type for Cell in Xlsx Reader. [Issue #2373](https://github.com/PHPOffice/PhpSpreadsheet/issues/2373) [PR #2485](https://github.com/PHPOffice/PhpSpreadsheet/pull/2485)
+- Recalibrate Row/Column Dimensions after removeRow/Column. [Issue #2442](https://github.com/PHPOffice/PhpSpreadsheet/issues/2442) [PR #2486](https://github.com/PHPOffice/PhpSpreadsheet/pull/2486)
+- Refinement for XIRR. [Issue #2469](https://github.com/PHPOffice/PhpSpreadsheet/issues/2469) [PR #2487](https://github.com/PHPOffice/PhpSpreadsheet/pull/2487)
+- Xlsx Reader handle cell with non-null explicit type but null value. [Issue #2488](https://github.com/PHPOffice/PhpSpreadsheet/issues/2488) [PR #2489](https://github.com/PHPOffice/PhpSpreadsheet/pull/2489)
+- Xlsx Reader fix height and width for oneCellAnchorDrawings. [PR #2492](https://github.com/PHPOffice/PhpSpreadsheet/pull/2492)
+- Fix rounding error in NumberFormat::NUMBER_PERCENTAGE, NumberFormat::NUMBER_PERCENTAGE_00. [PR #2555](https://github.com/PHPOffice/PhpSpreadsheet/pull/2555)
+- Don't treat thumbnail file as xml. [Issue #2516](https://github.com/PHPOffice/PhpSpreadsheet/issues/2516) [PR #2517](https://github.com/PHPOffice/PhpSpreadsheet/pull/2517)
+- Eliminating Xlsx Reader warning when no sz tag for RichText. [Issue #2542](https://github.com/PHPOffice/PhpSpreadsheet/issues/2542) [PR #2550](https://github.com/PHPOffice/PhpSpreadsheet/pull/2550)
+- Fix Xlsx/Xls Writer handling of inline strings. [Issue #353](https://github.com/PHPOffice/PhpSpreadsheet/issues/353) [PR #2569](https://github.com/PHPOffice/PhpSpreadsheet/pull/2569)
+- Richtext colors were not being read correctly after namespace change [#2458](https://github.com/PHPOffice/PhpSpreadsheet/issues/2458)
+- Fix discrepancy between the way markdown tables are rendered in ReadTheDocs and in PHPStorm [#2520](https://github.com/PHPOffice/PhpSpreadsheet/issues/2520)
+- Update Russian Functions Text File [#2557](https://github.com/PHPOffice/PhpSpreadsheet/issues/2557)
+- Fix documentation, instantiation example [#2564](https://github.com/PHPOffice/PhpSpreadsheet/issues/2564)
+
+
+## 1.21.0 - 2022-01-06
+
+### Added
+
+- Ability to add a picture to the background of the comment. Supports four image formats: png, jpeg, gif, bmp. New `Comment::setSizeAsBackgroundImage()` to change the size of a comment to the size of a background image. [Issue #1547](https://github.com/PHPOffice/PhpSpreadsheet/issues/1547) [PR #2422](https://github.com/PHPOffice/PhpSpreadsheet/pull/2422)
+- Ability to set default paper size and orientation [PR #2410](https://github.com/PHPOffice/PhpSpreadsheet/pull/2410)
+- Ability to extend AutoFilter to Maximum Row [PR #2414](https://github.com/PHPOffice/PhpSpreadsheet/pull/2414)
+
+### Changed
+
+- Xlsx Writer will evaluate AutoFilter only if it is as yet unevaluated, or has changed since it was last evaluated [PR #2414](https://github.com/PHPOffice/PhpSpreadsheet/pull/2414)
+
+### Deprecated
+
+- Nothing
+
+### Removed
+
+- Nothing
+
+### Fixed
+
+- Rounding in `NumberFormatter` [Issue #2385](https://github.com/PHPOffice/PhpSpreadsheet/issues/2385) [PR #2399](https://github.com/PHPOffice/PhpSpreadsheet/pull/2399)
+- Support for themes [Issue #2075](https://github.com/PHPOffice/PhpSpreadsheet/issues/2075) [Issue #2387](https://github.com/PHPOffice/PhpSpreadsheet/issues/2387) [PR #2403](https://github.com/PHPOffice/PhpSpreadsheet/pull/2403)
+- Read spreadsheet with `#` in name [Issue #2405](https://github.com/PHPOffice/PhpSpreadsheet/issues/2405) [PR #2409](https://github.com/PHPOffice/PhpSpreadsheet/pull/2409)
+- Improve PDF support for page size and orientation [Issue #1691](https://github.com/PHPOffice/PhpSpreadsheet/issues/1691) [PR #2410](https://github.com/PHPOffice/PhpSpreadsheet/pull/2410)
+- Wildcard handling issues in text match [Issue #2430](https://github.com/PHPOffice/PhpSpreadsheet/issues/2430) [PR #2431](https://github.com/PHPOffice/PhpSpreadsheet/pull/2431)
+- Respect DataType in `insertNewBefore` [PR #2433](https://github.com/PHPOffice/PhpSpreadsheet/pull/2433)
+- Handle rows explicitly hidden after AutoFilter [Issue #1641](https://github.com/PHPOffice/PhpSpreadsheet/issues/1641) [PR #2414](https://github.com/PHPOffice/PhpSpreadsheet/pull/2414)
+- Special characters in image file name [Issue #1470](https://github.com/PHPOffice/PhpSpreadsheet/issues/1470) [Issue #2415](https://github.com/PHPOffice/PhpSpreadsheet/issues/2415) [PR #2416](https://github.com/PHPOffice/PhpSpreadsheet/pull/2416)
+- Mpdf with very many styles [Issue #2432](https://github.com/PHPOffice/PhpSpreadsheet/issues/2432) [PR #2434](https://github.com/PHPOffice/PhpSpreadsheet/pull/2434)
+- Name clashes between parsed and unparsed drawings [Issue #1767](https://github.com/PHPOffice/PhpSpreadsheet/issues/1767) [Issue #2396](https://github.com/PHPOffice/PhpSpreadsheet/issues/2396) [PR #2423](https://github.com/PHPOffice/PhpSpreadsheet/pull/2423)
+- Fill pattern start and end colors [Issue #2441](https://github.com/PHPOffice/PhpSpreadsheet/issues/2441) [PR #2444](https://github.com/PHPOffice/PhpSpreadsheet/pull/2444)
+- General style specified in wrong case [Issue #2450](https://github.com/PHPOffice/PhpSpreadsheet/issues/2450) [PR #2451](https://github.com/PHPOffice/PhpSpreadsheet/pull/2451)
+- Null passed to `AutoFilter::setRange()` [Issue #2281](https://github.com/PHPOffice/PhpSpreadsheet/issues/2281) [PR #2454](https://github.com/PHPOffice/PhpSpreadsheet/pull/2454)
+- Another undefined index in Xls reader (#2470) [Issue #2463](https://github.com/PHPOffice/PhpSpreadsheet/issues/2463) [PR #2470](https://github.com/PHPOffice/PhpSpreadsheet/pull/2470)
+- Allow single-cell checks on conditional styles, even when the style is configured for a range of cells (#) [PR #2483](https://github.com/PHPOffice/PhpSpreadsheet/pull/2483)
+
+## 1.20.0 - 2021-11-23
+
+### Added
+
+- Xlsx Writer Support for WMF Files [#2339](https://github.com/PHPOffice/PhpSpreadsheet/issues/2339)
+- Use standard temporary file for internal use of HTMLPurifier [#2383](https://github.com/PHPOffice/PhpSpreadsheet/issues/2383)
+
+### Changed
+
+- Drop support for PHP 7.2, according to https://phpspreadsheet.readthedocs.io/en/latest/#php-version-support
+- Use native typing for objects that were already documented as such
+
+### Deprecated
+
+- Nothing
+
+### Removed
+
+- Nothing
+
+### Fixed
+
+- Fixed null conversation for strToUpper [#2292](https://github.com/PHPOffice/PhpSpreadsheet/issues/2292)
+- Fixed Trying to access array offset on value of type null (Xls Reader) [#2315](https://github.com/PHPOffice/PhpSpreadsheet/issues/2315)
+- Don't corrupt XLSX files containing data validation [#2377](https://github.com/PHPOffice/PhpSpreadsheet/issues/2377)
+- Non-fixed cells were not updated if shared formula has a fixed cell [#2354](https://github.com/PHPOffice/PhpSpreadsheet/issues/2354)
+- Declare key of generic ArrayObject
+- CSV reader better support for boolean values [#2374](https://github.com/PHPOffice/PhpSpreadsheet/pull/2374)
+- Some ZIP file could not be read [#2376](https://github.com/PHPOffice/PhpSpreadsheet/pull/2376)
+- Fix regression were hyperlinks could not be read [#2391](https://github.com/PHPOffice/PhpSpreadsheet/pull/2391)
+- AutoFilter Improvements [#2393](https://github.com/PHPOffice/PhpSpreadsheet/pull/2393)
+- Don't corrupt file when using chart with fill color [#589](https://github.com/PHPOffice/PhpSpreadsheet/pull/589)
+- Restore imperfect array formula values in xlsx writer [#2343](https://github.com/PHPOffice/PhpSpreadsheet/pull/2343)
+- Restore explicit list of changes to PHPExcel migration document [#1546](https://github.com/PHPOffice/PhpSpreadsheet/issues/1546)
+
+## 1.19.0 - 2021-10-31
+
+### Added
+
+- Ability to set style on named range, and validate input to setSelectedCells [Issue #2279](https://github.com/PHPOffice/PhpSpreadsheet/issues/2279) [PR #2280](https://github.com/PHPOffice/PhpSpreadsheet/pull/2280)
+- Process comments in Sylk file [Issue #2276](https://github.com/PHPOffice/PhpSpreadsheet/issues/2276) [PR #2277](https://github.com/PHPOffice/PhpSpreadsheet/pull/2277)
+- Addition of Custom Properties to Ods Writer, and 32-bit-safe timestamps for Document Properties [PR #2113](https://github.com/PHPOffice/PhpSpreadsheet/pull/2113)
+- Added callback to CSV reader to set user-specified defaults for various properties (especially for escape which has a poor PHP-inherited default of backslash which does not correspond with Excel) [PR #2103](https://github.com/PHPOffice/PhpSpreadsheet/pull/2103)
+- Phase 1 of better namespace handling for Xlsx, resolving many open issues [PR #2173](https://github.com/PHPOffice/PhpSpreadsheet/pull/2173) [PR #2204](https://github.com/PHPOffice/PhpSpreadsheet/pull/2204) [PR #2303](https://github.com/PHPOffice/PhpSpreadsheet/pull/2303)
+- Add ability to extract images if source is a URL [Issue #1997](https://github.com/PHPOffice/PhpSpreadsheet/issues/1997) [PR #2072](https://github.com/PHPOffice/PhpSpreadsheet/pull/2072)
+- Support for passing flags in the Reader `load()` and Writer `save()`methods, and through the IOFactory, to set behaviours [PR #2136](https://github.com/PHPOffice/PhpSpreadsheet/pull/2136)
+ - See [documentation](https://phpspreadsheet.readthedocs.io/en/latest/topics/reading-and-writing-to-file/#readerwriter-flags) for details
+- More flexibility in the StringValueBinder to determine what datatypes should be treated as strings [PR #2138](https://github.com/PHPOffice/PhpSpreadsheet/pull/2138)
+- Helper class for conversion between css size Units of measure (`px`, `pt`, `pc`, `in`, `cm`, `mm`) [PR #2152](https://github.com/PHPOffice/PhpSpreadsheet/issues/2145)
+- Allow Row height and Column Width to be set using different units of measure (`px`, `pt`, `pc`, `in`, `cm`, `mm`), rather than only in points or MS Excel column width units [PR #2152](https://github.com/PHPOffice/PhpSpreadsheet/issues/2145)
+- Ability to stream to an Amazon S3 bucket [Issue #2249](https://github.com/PHPOffice/PhpSpreadsheet/issues/2249)
+- Provided a Size Helper class to validate size values (pt, px, em) [PR #1694](https://github.com/PHPOffice/PhpSpreadsheet/pull/1694)
+
+### Changed
+
+- Nothing.
+
+### Deprecated
+
+- PHP 8.1 will deprecate auto_detect_line_endings. As a result of this change, Csv Reader using some release after PHP8.1 will no longer be able to handle a Csv with Mac line endings.
+
+### Removed
+
+- Nothing.
+
+### Fixed
+
+- Unexpected format in Xlsx Timestamp [Issue #2331](https://github.com/PHPOffice/PhpSpreadsheet/issues/2331) [PR #2332](https://github.com/PHPOffice/PhpSpreadsheet/pull/2332)
+- Corrections for HLOOKUP [Issue #2123](https://github.com/PHPOffice/PhpSpreadsheet/issues/2123) [PR #2330](https://github.com/PHPOffice/PhpSpreadsheet/pull/2330)
+- Corrections for Xlsx Read Comments [Issue #2316](https://github.com/PHPOffice/PhpSpreadsheet/issues/2316) [PR #2329](https://github.com/PHPOffice/PhpSpreadsheet/pull/2329)
+- Lowercase Calibri font names [Issue #2273](https://github.com/PHPOffice/PhpSpreadsheet/issues/2273) [PR #2325](https://github.com/PHPOffice/PhpSpreadsheet/pull/2325)
+- isFormula Referencing Sheet with Space in Title [Issue #2304](https://github.com/PHPOffice/PhpSpreadsheet/issues/2304) [PR #2306](https://github.com/PHPOffice/PhpSpreadsheet/pull/2306)
+- Xls Reader Fatal Error due to Undefined Offset [Issue #1114](https://github.com/PHPOffice/PhpSpreadsheet/issues/1114) [PR #2308](https://github.com/PHPOffice/PhpSpreadsheet/pull/2308)
+- Permit Csv Reader delimiter to be set to null [Issue #2287](https://github.com/PHPOffice/PhpSpreadsheet/issues/2287) [PR #2288](https://github.com/PHPOffice/PhpSpreadsheet/pull/2288)
+- Csv Reader did not handle booleans correctly [PR #2232](https://github.com/PHPOffice/PhpSpreadsheet/pull/2232)
+- Problems when deleting sheet with local defined name [Issue #2266](https://github.com/PHPOffice/PhpSpreadsheet/issues/2266) [PR #2284](https://github.com/PHPOffice/PhpSpreadsheet/pull/2284)
+- Worksheet passwords were not always handled correctly [Issue #1897](https://github.com/PHPOffice/PhpSpreadsheet/issues/1897) [PR #2197](https://github.com/PHPOffice/PhpSpreadsheet/pull/2197)
+- Gnumeric Reader will now distinguish between Created and Modified timestamp [PR #2133](https://github.com/PHPOffice/PhpSpreadsheet/pull/2133)
+- Xls Reader will now handle MACCENTRALEUROPE with or without hyphen [Issue #549](https://github.com/PHPOffice/PhpSpreadsheet/issues/549) [PR #2213](https://github.com/PHPOffice/PhpSpreadsheet/pull/2213)
+- Tweaks to input file validation [Issue #1718](https://github.com/PHPOffice/PhpSpreadsheet/issues/1718) [PR #2217](https://github.com/PHPOffice/PhpSpreadsheet/pull/2217)
+- Html Reader did not handle comments correctly [Issue #2234](https://github.com/PHPOffice/PhpSpreadsheet/issues/2234) [PR #2235](https://github.com/PHPOffice/PhpSpreadsheet/pull/2235)
+- Apache OpenOffice Uses Unexpected Case for General format [Issue #2239](https://github.com/PHPOffice/PhpSpreadsheet/issues/2239) [PR #2242](https://github.com/PHPOffice/PhpSpreadsheet/pull/2242)
+- Problems with fraction formatting [Issue #2253](https://github.com/PHPOffice/PhpSpreadsheet/issues/2253) [PR #2254](https://github.com/PHPOffice/PhpSpreadsheet/pull/2254)
+- Xlsx Reader had problems reading file with no styles.xml or empty styles.xml [Issue #2246](https://github.com/PHPOffice/PhpSpreadsheet/issues/2246) [PR #2247](https://github.com/PHPOffice/PhpSpreadsheet/pull/2247)
+- Xlsx Reader did not read Data Validation flags correctly [Issue #2224](https://github.com/PHPOffice/PhpSpreadsheet/issues/2224) [PR #2225](https://github.com/PHPOffice/PhpSpreadsheet/pull/2225)
+- Better handling of empty arguments in Calculation engine [PR #2143](https://github.com/PHPOffice/PhpSpreadsheet/pull/2143)
+- Many fixes for Autofilter [Issue #2216](https://github.com/PHPOffice/PhpSpreadsheet/issues/2216) [PR #2141](https://github.com/PHPOffice/PhpSpreadsheet/pull/2141) [PR #2162](https://github.com/PHPOffice/PhpSpreadsheet/pull/2162) [PR #2218](https://github.com/PHPOffice/PhpSpreadsheet/pull/2218)
+- Locale generator will now use Unix line endings even on Windows [Issue #2172](https://github.com/PHPOffice/PhpSpreadsheet/issues/2172) [PR #2174](https://github.com/PHPOffice/PhpSpreadsheet/pull/2174)
+- Support differences in implementation of Text functions between Excel/Ods/Gnumeric [PR #2151](https://github.com/PHPOffice/PhpSpreadsheet/pull/2151)
+- Fixes to places where PHP8.1 enforces new or previously unenforced restrictions [PR #2137](https://github.com/PHPOffice/PhpSpreadsheet/pull/2137) [PR #2191](https://github.com/PHPOffice/PhpSpreadsheet/pull/2191) [PR #2231](https://github.com/PHPOffice/PhpSpreadsheet/pull/2231)
+- Clone for HashTable was incorrect [PR #2130](https://github.com/PHPOffice/PhpSpreadsheet/pull/2130)
+- Xlsx Reader was not evaluating Document Security Lock correctly [PR #2128](https://github.com/PHPOffice/PhpSpreadsheet/pull/2128)
+- Error in COUPNCD handling end of month [Issue #2116](https://github.com/PHPOffice/PhpSpreadsheet/issues/2116) [PR #2119](https://github.com/PHPOffice/PhpSpreadsheet/pull/2119)
+- Xls Writer Parser did not handle concatenation operator correctly [PR #2080](https://github.com/PHPOffice/PhpSpreadsheet/pull/2080)
+- Xlsx Writer did not handle boolean false correctly [Issue #2082](https://github.com/PHPOffice/PhpSpreadsheet/issues/2082) [PR #2087](https://github.com/PHPOffice/PhpSpreadsheet/pull/2087)
+- SUM needs to treat invalid strings differently depending on whether they come from a cell or are used as literals [Issue #2042](https://github.com/PHPOffice/PhpSpreadsheet/issues/2042) [PR #2045](https://github.com/PHPOffice/PhpSpreadsheet/pull/2045)
+- Html reader could have set illegal coordinates when dealing with embedded tables [Issue #2029](https://github.com/PHPOffice/PhpSpreadsheet/issues/2029) [PR #2032](https://github.com/PHPOffice/PhpSpreadsheet/pull/2032)
+- Documentation for printing gridlines was wrong [PR #2188](https://github.com/PHPOffice/PhpSpreadsheet/pull/2188)
+- Return Value Error - DatabaseAbstruct::buildQuery() return null but must be string [Issue #2158](https://github.com/PHPOffice/PhpSpreadsheet/issues/2158) [PR #2160](https://github.com/PHPOffice/PhpSpreadsheet/pull/2160)
+- Xlsx reader not recognize data validations that references another sheet [Issue #1432](https://github.com/PHPOffice/PhpSpreadsheet/issues/1432) [Issue #2149](https://github.com/PHPOffice/PhpSpreadsheet/issues/2149) [PR #2150](https://github.com/PHPOffice/PhpSpreadsheet/pull/2150) [PR #2265](https://github.com/PHPOffice/PhpSpreadsheet/pull/2265)
+- Don't calculate cell width for autosize columns if a cell contains a null or empty string value [Issue #2165](https://github.com/PHPOffice/PhpSpreadsheet/issues/2165) [PR #2167](https://github.com/PHPOffice/PhpSpreadsheet/pull/2167)
+- Allow negative interest rate values in a number of the Financial functions (`PPMT()`, `PMT()`, `FV()`, `PV()`, `NPER()`, etc) [Issue #2163](https://github.com/PHPOffice/PhpSpreadsheet/issues/2163) [PR #2164](https://github.com/PHPOffice/PhpSpreadsheet/pull/2164)
+- Xls Reader changing grey background to black in Excel template [Issue #2147](https://github.com/PHPOffice/PhpSpreadsheet/issues/2147) [PR #2156](https://github.com/PHPOffice/PhpSpreadsheet/pull/2156)
+- Column width and Row height styles in the Html Reader when the value includes a unit of measure [Issue #2145](https://github.com/PHPOffice/PhpSpreadsheet/issues/2145).
+- Data Validation flags not set correctly when reading XLSX files [Issue #2224](https://github.com/PHPOffice/PhpSpreadsheet/issues/2224) [PR #2225](https://github.com/PHPOffice/PhpSpreadsheet/pull/2225)
+- Reading XLSX files without styles.xml throws an exception [Issue #2246](https://github.com/PHPOffice/PhpSpreadsheet/issues/2246)
+- Improved performance of `Style::applyFromArray()` when applied to several cells [PR #1785](https://github.com/PHPOffice/PhpSpreadsheet/issues/1785).
+- Improve XLSX parsing speed if no readFilter is applied (again) - [#772](https://github.com/PHPOffice/PhpSpreadsheet/issues/772)
+
+## 1.18.0 - 2021-05-31
+
+### Added
+
+- Enhancements to CSV Reader, allowing options to be set when using `IOFactory::load()` with a callback to set delimiter, enclosure, charset etc [PR #2103](https://github.com/PHPOffice/PhpSpreadsheet/pull/2103) - See [documentation](https://github.com/PHPOffice/PhpSpreadsheet/blob/master/docs/topics/reading-and-writing-to-file.md#csv-comma-separated-values) for details.
+- Implemented basic AutoFiltering for Ods Reader and Writer [PR #2053](https://github.com/PHPOffice/PhpSpreadsheet/pull/2053)
+- Implemented basic AutoFiltering for Gnumeric Reader [PR #2055](https://github.com/PHPOffice/PhpSpreadsheet/pull/2055)
+- Improved support for Row and Column ranges in formulae [Issue #1755](https://github.com/PHPOffice/PhpSpreadsheet/issues/1755) [PR #2028](https://github.com/PHPOffice/PhpSpreadsheet/pull/2028)
+- Implemented URLENCODE() Web Function
+- Implemented the CHITEST(), CHISQ.DIST() and CHISQ.INV() and equivalent Statistical functions, for both left- and right-tailed distributions.
+- Support for ActiveSheet and SelectedCells in the ODS Reader and Writer [PR #1908](https://github.com/PHPOffice/PhpSpreadsheet/pull/1908)
+- Support for notContainsText Conditional Style in xlsx [Issue #984](https://github.com/PHPOffice/PhpSpreadsheet/issues/984)
+
+### Changed
+
+- Use of `nb` rather than `no` as the locale code for Norsk Bokmål.
+
+### Deprecated
+
+- All Excel Function implementations in `Calculation\Database`, `Calculation\DateTime`, `Calculation\Engineering`, `Calculation\Financial`, `Calculation\Logical`, `Calculation\LookupRef`, `Calculation\MathTrig`, `Calculation\Statistical`, `Calculation\TextData` and `Calculation\Web` have been moved to dedicated classes for individual functions or groups of related functions. See the docblocks against all the deprecated methods for details of the new methods to call instead. At some point, these old classes will be deleted.
+
+### Removed
+
+- Use of `nb` rather than `no` as the locale language code for Norsk Bokmål.
+
+### Fixed
+
+- Fixed error in COUPNCD() calculation for end of month [Issue #2116](https://github.com/PHPOffice/PhpSpreadsheet/issues/2116) - [PR #2119](https://github.com/PHPOffice/PhpSpreadsheet/pull/2119)
+- Resolve default values when a null argument is passed for HLOOKUP(), VLOOKUP() and ADDRESS() functions [Issue #2120](https://github.com/PHPOffice/PhpSpreadsheet/issues/2120) - [PR #2121](https://github.com/PHPOffice/PhpSpreadsheet/pull/2121)
+- Fixed incorrect R1C1 to A1 subtraction formula conversion (`R[-2]C-R[2]C`) [Issue #2076](https://github.com/PHPOffice/PhpSpreadsheet/pull/2076) [PR #2086](https://github.com/PHPOffice/PhpSpreadsheet/pull/2086)
+- Correctly handle absolute A1 references when converting to R1C1 format [PR #2060](https://github.com/PHPOffice/PhpSpreadsheet/pull/2060)
+- Correct default fill style for conditional without a pattern defined [Issue #2035](https://github.com/PHPOffice/PhpSpreadsheet/issues/2035) [PR #2050](https://github.com/PHPOffice/PhpSpreadsheet/pull/2050)
+- Fixed issue where array key check for existince before accessing arrays in Xlsx.php [PR #1970](https://github.com/PHPOffice/PhpSpreadsheet/pull/1970)
+- Fixed issue with quoted strings in number format mask rendered with toFormattedString() [Issue 1972#](https://github.com/PHPOffice/PhpSpreadsheet/issues/1972) [PR #1978](https://github.com/PHPOffice/PhpSpreadsheet/pull/1978)
+- Fixed issue with percentage formats in number format mask rendered with toFormattedString() [Issue 1929#](https://github.com/PHPOffice/PhpSpreadsheet/issues/1929) [PR #1928](https://github.com/PHPOffice/PhpSpreadsheet/pull/1928)
+- Fixed issue with _ spacing character in number format mask corrupting output from toFormattedString() [Issue 1924#](https://github.com/PHPOffice/PhpSpreadsheet/issues/1924) [PR #1927](https://github.com/PHPOffice/PhpSpreadsheet/pull/1927)
+- Fix for [Issue #1887](https://github.com/PHPOffice/PhpSpreadsheet/issues/1887) - Lose Track of Selected Cells After Save
+- Fixed issue with Xlsx@listWorksheetInfo not returning any data
+- Fixed invalid arguments triggering mb_substr() error in LEFT(), MID() and RIGHT() text functions [Issue #640](https://github.com/PHPOffice/PhpSpreadsheet/issues/640)
+- Fix for [Issue #1916](https://github.com/PHPOffice/PhpSpreadsheet/issues/1916) - Invalid signature check for XML files
+- Fix change in `Font::setSize()` behavior for PHP8 [PR #2100](https://github.com/PHPOffice/PhpSpreadsheet/pull/2100)
+
+## 1.17.1 - 2021-03-01
+
+### Added
+
+- Implementation of the Excel `AVERAGEIFS()` functions as part of a restructuring of Database functions and Conditional Statistical functions.
+- Support for date values and percentages in query parameters for Database functions, and the IF expressions in functions like COUNTIF() and AVERAGEIF(). [#1875](https://github.com/PHPOffice/PhpSpreadsheet/pull/1875)
+- Support for booleans, and for wildcard text search in query parameters for Database functions, and the IF expressions in functions like COUNTIF() and AVERAGEIF(). [#1876](https://github.com/PHPOffice/PhpSpreadsheet/pull/1876)
+- Implemented DataBar for conditional formatting in Xlsx, providing read/write and creation of (type, value, direction, fills, border, axis position, color settings) as DataBar options in Excel. [#1754](https://github.com/PHPOffice/PhpSpreadsheet/pull/1754)
+- Alignment for ODS Writer [#1796](https://github.com/PHPOffice/PhpSpreadsheet/issues/1796)
+- Basic implementation of the PERMUTATIONA() Statistical Function
+
+### Changed
+
+- Formula functions that previously called PHP functions directly are now processed through the Excel Functions classes; resolving issues with PHP8 stricter typing. [#1789](https://github.com/PHPOffice/PhpSpreadsheet/issues/1789)
+
+ The following MathTrig functions are affected:
+ `ABS()`, `ACOS()`, `ACOSH()`, `ASIN()`, `ASINH()`, `ATAN()`, `ATANH()`,
+ `COS()`, `COSH()`, `DEGREES()` (rad2deg), `EXP()`, `LN()` (log), `LOG10()`,
+ `RADIANS()` (deg2rad), `SIN()`, `SINH()`, `SQRT()`, `TAN()`, `TANH()`.
+
+ One TextData function is also affected: `REPT()` (str_repeat).
+- `formatAsDate` correctly matches language metadata, reverting c55272e
+- Formulae that previously crashed on sub function call returning excel error value now return said value.
+ The following functions are affected `CUMPRINC()`, `CUMIPMT()`, `AMORLINC()`,
+ `AMORDEGRC()`.
+- Adapt some function error return value to match excel's error.
+ The following functions are affected `PPMT()`, `IPMT()`.
+
+### Deprecated
+
+- Calling many of the Excel formula functions directly rather than through the Calculation Engine.
+
+ The logic for these Functions is now being moved out of the categorised `Database`, `DateTime`, `Engineering`, `Financial`, `Logical`, `LookupRef`, `MathTrig`, `Statistical`, `TextData` and `Web` classes into small, dedicated classes for individual functions or related groups of functions.
+
+ This makes the logic in these classes easier to maintain; and will reduce the memory footprint required to execute formulae when calling these functions.
+
+### Removed
+
+- Nothing.
+
+### Fixed
+
+- Avoid Duplicate Titles When Reading Multiple HTML Files.[Issue #1823](https://github.com/PHPOffice/PhpSpreadsheet/issues/1823) [PR #1829](https://github.com/PHPOffice/PhpSpreadsheet/pull/1829)
+- Fixed issue with Worksheet's `getCell()` method when trying to get a cell by defined name. [#1858](https://github.com/PHPOffice/PhpSpreadsheet/issues/1858)
+- Fix possible endless loop in NumberFormat Masks [#1792](https://github.com/PHPOffice/PhpSpreadsheet/issues/1792)
+- Fix problem resulting from literal dot inside quotes in number format masks [PR #1830](https://github.com/PHPOffice/PhpSpreadsheet/pull/1830)
+- Resolve Google Sheets Xlsx charts issue. Google Sheets uses oneCellAnchor positioning and does not include *Cache values in the exported Xlsx [PR #1761](https://github.com/PHPOffice/PhpSpreadsheet/pull/1761)
+- Fix for Xlsx Chart axis titles mapping to correct X or Y axis label when only one is present [PR #1760](https://github.com/PHPOffice/PhpSpreadsheet/pull/1760)
+- Fix For Null Exception on ODS Read of Page Settings. [#1772](https://github.com/PHPOffice/PhpSpreadsheet/issues/1772)
+- Fix Xlsx reader overriding manually set number format with builtin number format [PR #1805](https://github.com/PHPOffice/PhpSpreadsheet/pull/1805)
+- Fix Xlsx reader cell alignment [PR #1710](https://github.com/PHPOffice/PhpSpreadsheet/pull/1710)
+- Fix for not yet implemented data-types in Open Document writer [Issue #1674](https://github.com/PHPOffice/PhpSpreadsheet/issues/1674)
+- Fix XLSX reader when having a corrupt numeric cell data type [PR #1664](https://github.com/phpoffice/phpspreadsheet/pull/1664)
+- Fix on `CUMPRINC()`, `CUMIPMT()`, `AMORLINC()`, `AMORDEGRC()` usage. When those functions called one of `YEARFRAC()`, `PPMT()`, `IPMT()` and they would get back an error value (represented as a string), trying to use numeral operands (`+`, `/`, `-`, `*`) on said return value and a number (`float or `int`) would fail.
+
+## 1.16.0 - 2020-12-31
+
+### Added
+
+- CSV Reader - Best Guess for Encoding, and Handle Null-string Escape [#1647](https://github.com/PHPOffice/PhpSpreadsheet/issues/1647)
+
+### Changed
+
+- Updated the CONVERT() function to support all current MS Excel categories and Units of Measure.
+
+### Deprecated
+
+- All Excel Function implementations in `Calculation\Database`, `Calculation\DateTime`, `Calculation\Engineering`, `Calculation\Financial`, `Calculation\Logical`, `Calculation\LookupRef`, `Calculation\MathTrig`, `Calculation\Statistical`, `Calculation\TextData` and `Calculation\Web` have been moved to dedicated classes for individual functions or groups of related functions. See the docblocks against all the deprecated methods for details of the new methods to call instead. At some point, these old classes will be deleted.
+
+### Removed
+
+- Nothing.
+
+### Fixed
+
+- Fixed issue with absolute path in worksheets' Target [PR #1769](https://github.com/PHPOffice/PhpSpreadsheet/pull/1769)
+- Fix for Xls Reader when SST has a bad length [#1592](https://github.com/PHPOffice/PhpSpreadsheet/issues/1592)
+- Resolve Xlsx loader issue whe hyperlinks don't have a destination
+- Resolve issues when printer settings resources IDs clash with drawing IDs
+- Resolve issue with SLK long filenames [#1612](https://github.com/PHPOffice/PhpSpreadsheet/issues/1612)
+- ROUNDUP and ROUNDDOWN return incorrect results for values of 0 [#1627](https://github.com/phpoffice/phpspreadsheet/pull/1627)
+- Apply Column and Row Styles to Existing Cells [#1712](https://github.com/PHPOffice/PhpSpreadsheet/issues/1712) [PR #1721](https://github.com/PHPOffice/PhpSpreadsheet/pull/1721)
+- Resolve issues with defined names where worksheet doesn't exist (#1686)[https://github.com/PHPOffice/PhpSpreadsheet/issues/1686] and [#1723](https://github.com/PHPOffice/PhpSpreadsheet/issues/1723) - [PR #1742](https://github.com/PHPOffice/PhpSpreadsheet/pull/1742)
+- Fix for issue [#1735](https://github.com/PHPOffice/PhpSpreadsheet/issues/1735) Incorrect activeSheetIndex after RemoveSheetByIndex - [PR #1743](https://github.com/PHPOffice/PhpSpreadsheet/pull/1743)
+- Ensure that the list of shared formulae is maintained when an xlsx file is chunked with readFilter[Issue #169](https://github.com/PHPOffice/PhpSpreadsheet/issues/1669).
+- Fix for notice during accessing "cached magnification factor" offset [#1354](https://github.com/PHPOffice/PhpSpreadsheet/pull/1354)
+- Fix compatibility with ext-gd on php 8
+
+### Security Fix (CVE-2020-7776)
+
+- Prevent XSS through cell comments in the HTML Writer.
+
+## 1.15.0 - 2020-10-11
+
+### Added
+
+- Implemented Page Order for Xlsx and Xls Readers, and provided Page Settings (Orientation, Scale, Horizontal/Vertical Centering, Page Order, Margins) support for Ods, Gnumeric and Xls Readers [#1559](https://github.com/PHPOffice/PhpSpreadsheet/pull/1559)
+- Implementation of the Excel `LOGNORM.DIST()`, `NORM.S.DIST()`, `GAMMA()` and `GAUSS()` functions. [#1588](https://github.com/PHPOffice/PhpSpreadsheet/pull/1588)
+- Named formula implementation, and improved handling of Defined Names generally [#1535](https://github.com/PHPOffice/PhpSpreadsheet/pull/1535)
+ - Defined Names are now case-insensitive
+ - Distinction between named ranges and named formulae
+ - Correct handling of union and intersection operators in named ranges
+ - Correct evaluation of named range operators in calculations
+ - fix resolution of relative named range values in the calculation engine; previously all named range values had been treated as absolute.
+ - Calculation support for named formulae
+ - Support for nested ranges and formulae (named ranges and formulae that reference other named ranges/formulae) in calculations
+ - Introduction of a helper to convert address formats between R1C1 and A1 (and the reverse)
+ - Proper support for both named ranges and named formulae in all appropriate Readers
+ - **Xlsx** (Previously only simple named ranges were supported)
+ - **Xls** (Previously only simple named ranges were supported)
+ - **Gnumeric** (Previously neither named ranges nor formulae were supported)
+ - **Ods** (Previously neither named ranges nor formulae were supported)
+ - **Xml** (Previously neither named ranges nor formulae were supported)
+ - Proper support for named ranges and named formulae in all appropriate Writers
+ - **Xlsx** (Previously only simple named ranges were supported)
+ - **Xls** (Previously neither named ranges nor formulae were supported) - Still not supported, but some parser issues resolved that previously failed to differentiate between a defined name and a function name
+ - **Ods** (Previously neither named ranges nor formulae were supported)
+- Support for PHP 8.0
+
+### Changed
+
+- Improve Coverage for ODS Reader [#1545](https://github.com/phpoffice/phpspreadsheet/pull/1545)
+- Named formula implementation, and improved handling of Defined Names generally [#1535](https://github.com/PHPOffice/PhpSpreadsheet/pull/1535)
+- fix resolution of relative named range values in the calculation engine; previously all named range values had been treated as absolute.
+- Drop $this->spreadSheet null check from Xlsx Writer [#1646](https://github.com/phpoffice/phpspreadsheet/pull/1646)
+- Improving Coverage for Excel2003 XML Reader [#1557](https://github.com/phpoffice/phpspreadsheet/pull/1557)
+
+### Deprecated
+
+- **IMPORTANT NOTE:** This Introduces a **BC break** in the handling of named ranges. Previously, a named range cell reference of `B2` would be treated identically to a named range cell reference of `$B2` or `B$2` or `$B$2` because the calculation engine treated then all as absolute references. These changes "fix" that, so the calculation engine now handles relative references in named ranges correctly.
+ This change that resolves previously incorrect behaviour in the calculation may affect users who have dynamically defined named ranges using relative references when they should have used absolute references.
+
+### Removed
+
+- Nothing.
+
+### Fixed
+
+- PrintArea causes exception [#1544](https://github.com/phpoffice/phpspreadsheet/pull/1544)
+- Calculation/DateTime Failure With PHP8 [#1661](https://github.com/phpoffice/phpspreadsheet/pull/1661)
+- Reader/Gnumeric Failure with PHP8 [#1662](https://github.com/phpoffice/phpspreadsheet/pull/1662)
+- ReverseSort bug, exposed but not caused by PHP8 [#1660](https://github.com/phpoffice/phpspreadsheet/pull/1660)
+- Bug setting Superscript/Subscript to false [#1567](https://github.com/phpoffice/phpspreadsheet/pull/1567)
+
+## 1.14.1 - 2020-07-19
+
+### Added
+
+- nothing
+
+### Fixed
+
+- WEBSERVICE is HTTP client agnostic and must be configured via `Settings::setHttpClient()` [#1562](https://github.com/PHPOffice/PhpSpreadsheet/issues/1562)
+- Borders were not complete on rowspanned columns using HTML reader [#1473](https://github.com/PHPOffice/PhpSpreadsheet/pull/1473)
+
+### Changed
+
+## 1.14.0 - 2020-06-29
+
+### Added
+
+- Add support for IFS() logical function [#1442](https://github.com/PHPOffice/PhpSpreadsheet/pull/1442)
+- Add Cell Address Helper to provide conversions between the R1C1 and A1 address formats [#1558](https://github.com/PHPOffice/PhpSpreadsheet/pull/1558)
+- Add ability to edit Html/Pdf before saving [#1499](https://github.com/PHPOffice/PhpSpreadsheet/pull/1499)
+- Add ability to set codepage explicitly for BIFF5 [#1018](https://github.com/PHPOffice/PhpSpreadsheet/issues/1018)
+- Added support for the WEBSERVICE function [#1409](https://github.com/PHPOffice/PhpSpreadsheet/pull/1409)
+
+### Fixed
+
+- Resolve evaluation of utf-8 named ranges in calculation engine [#1522](https://github.com/PHPOffice/PhpSpreadsheet/pull/1522)
+- Fix HLOOKUP on single row [#1512](https://github.com/PHPOffice/PhpSpreadsheet/pull/1512)
+- Fix MATCH when comparing different numeric types [#1521](https://github.com/PHPOffice/PhpSpreadsheet/pull/1521)
+- Fix exact MATCH on ranges with empty cells [#1520](https://github.com/PHPOffice/PhpSpreadsheet/pull/1520)
+- Fix for Issue [#1516](https://github.com/PHPOffice/PhpSpreadsheet/issues/1516) (Cloning worksheet makes corrupted Xlsx) [#1530](https://github.com/PHPOffice/PhpSpreadsheet/pull/1530)
+- Fix For Issue [#1509](https://github.com/PHPOffice/PhpSpreadsheet/issues/1509) (Can not set empty enclosure for CSV) [#1518](https://github.com/PHPOffice/PhpSpreadsheet/pull/1518)
+- Fix for Issue [#1505](https://github.com/PHPOffice/PhpSpreadsheet/issues/1505) (TypeError : Argument 4 passed to PhpOffice\PhpSpreadsheet\Writer\Xlsx\Worksheet::writeAttributeIf() must be of the type string) [#1525](https://github.com/PHPOffice/PhpSpreadsheet/pull/1525)
+- Fix for Issue [#1495](https://github.com/PHPOffice/PhpSpreadsheet/issues/1495) (Sheet index being changed when multiple sheets are used in formula) [#1500]((https://github.com/PHPOffice/PhpSpreadsheet/pull/1500))
+- Fix for Issue [#1533](https://github.com/PHPOffice/PhpSpreadsheet/issues/1533) (A reference to a cell containing a string starting with "#" leads to errors in the generated xlsx.) [#1534](https://github.com/PHPOffice/PhpSpreadsheet/pull/1534)
+- Xls Writer - Correct Timestamp Bug [#1493](https://github.com/PHPOffice/PhpSpreadsheet/pull/1493)
+- Don't ouput row and columns without any cells in HTML writer [#1235](https://github.com/PHPOffice/PhpSpreadsheet/issues/1235)
+
+## 1.13.0 - 2020-05-31
+
+### Added
+
+- Support writing to streams in all writers [#1292](https://github.com/PHPOffice/PhpSpreadsheet/issues/1292)
+- Support CSV files with data wrapping a lot of lines [#1468](https://github.com/PHPOffice/PhpSpreadsheet/pull/1468)
+- Support protection of worksheet by a specific hash algorithm [#1485](https://github.com/PHPOffice/PhpSpreadsheet/pull/1485)
+
+### Fixed
+
+- Fix Chart samples by updating chart parameter from 0 to DataSeries::EMPTY_AS_GAP [#1448](https://github.com/PHPOffice/PhpSpreadsheet/pull/1448)
+- Fix return type in docblock for the Cells::get() [#1398](https://github.com/PHPOffice/PhpSpreadsheet/pull/1398)
+- Fix RATE, PRICE, XIRR, and XNPV Functions [#1456](https://github.com/PHPOffice/PhpSpreadsheet/pull/1456)
+- Save Excel 2010+ functions properly in XLSX [#1461](https://github.com/PHPOffice/PhpSpreadsheet/pull/1461)
+- Several improvements in HTML writer [#1464](https://github.com/PHPOffice/PhpSpreadsheet/pull/1464)
+- Fix incorrect behaviour when saving XLSX file with drawings [#1462](https://github.com/PHPOffice/PhpSpreadsheet/pull/1462),
+- Fix Crash while trying setting a cell the value "123456\n" [#1476](https://github.com/PHPOffice/PhpSpreadsheet/pull/1481)
+- Improved DATEDIF() function and reduced errors for Y and YM units [#1466](https://github.com/PHPOffice/PhpSpreadsheet/pull/1466)
+- Stricter typing for mergeCells [#1494](https://github.com/PHPOffice/PhpSpreadsheet/pull/1494)
+
+### Changed
+
+- Drop support for PHP 7.1, according to https://phpspreadsheet.readthedocs.io/en/latest/#php-version-support
+- Drop partial migration tool in favor of complete migration via RectorPHP [#1445](https://github.com/PHPOffice/PhpSpreadsheet/issues/1445)
+- Limit composer package to `src/` [#1424](https://github.com/PHPOffice/PhpSpreadsheet/pull/1424)
+
+## 1.12.0 - 2020-04-27
+
+### Added
+
+- Improved the ARABIC function to also handle short-hand roman numerals
+- Added support for the FLOOR.MATH and FLOOR.PRECISE functions [#1351](https://github.com/PHPOffice/PhpSpreadsheet/pull/1351)
+
+### Fixed
+
+- Fix ROUNDUP and ROUNDDOWN for floating-point rounding error [#1404](https://github.com/PHPOffice/PhpSpreadsheet/pull/1404)
+- Fix ROUNDUP and ROUNDDOWN for negative number [#1417](https://github.com/PHPOffice/PhpSpreadsheet/pull/1417)
+- Fix loading styles from vmlDrawings when containing whitespace [#1347](https://github.com/PHPOffice/PhpSpreadsheet/issues/1347)
+- Fix incorrect behavior when removing last row [#1365](https://github.com/PHPOffice/PhpSpreadsheet/pull/1365)
+- MATCH with a static array should return the position of the found value based on the values submitted [#1332](https://github.com/PHPOffice/PhpSpreadsheet/pull/1332)
+- Fix Xlsx Reader's handling of undefined fill color [#1353](https://github.com/PHPOffice/PhpSpreadsheet/pull/1353)
+
+## 1.11.0 - 2020-03-02
+
+### Added
+
+- Added support for the BASE function
+- Added support for the ARABIC function
+- Conditionals - Extend Support for (NOT)CONTAINSBLANKS [#1278](https://github.com/PHPOffice/PhpSpreadsheet/pull/1278)
+
+### Fixed
+
+- Handle Error in Formula Processing Better for Xls [#1267](https://github.com/PHPOffice/PhpSpreadsheet/pull/1267)
+- Handle ConditionalStyle NumberFormat When Reading Xlsx File [#1296](https://github.com/PHPOffice/PhpSpreadsheet/pull/1296)
+- Fix Xlsx Writer's handling of decimal commas [#1282](https://github.com/PHPOffice/PhpSpreadsheet/pull/1282)
+- Fix for issue by removing test code mistakenly left in [#1328](https://github.com/PHPOffice/PhpSpreadsheet/pull/1328)
+- Fix for Xls writer wrong selected cells and active sheet [#1256](https://github.com/PHPOffice/PhpSpreadsheet/pull/1256)
+- Fix active cell when freeze pane is used [#1323](https://github.com/PHPOffice/PhpSpreadsheet/pull/1323)
+- Fix XLSX file loading with autofilter containing '$' [#1326](https://github.com/PHPOffice/PhpSpreadsheet/pull/1326)
+- PHPDoc - Use `@return $this` for fluent methods [#1362](https://github.com/PHPOffice/PhpSpreadsheet/pull/1362)
+
+## 1.10.1 - 2019-12-02
+
+### Changed
+
+- PHP 7.4 compatibility
+
+### Fixed
+
+- FLOOR() function accept negative number and negative significance [#1245](https://github.com/PHPOffice/PhpSpreadsheet/pull/1245)
+- Correct column style even when using rowspan [#1249](https://github.com/PHPOffice/PhpSpreadsheet/pull/1249)
+- Do not confuse defined names and cell refs [#1263](https://github.com/PHPOffice/PhpSpreadsheet/pull/1263)
+- XLSX reader/writer keep decimal for floats with a zero decimal part [#1262](https://github.com/PHPOffice/PhpSpreadsheet/pull/1262)
+- ODS writer prevent invalid numeric value if locale decimal separator is comma [#1268](https://github.com/PHPOffice/PhpSpreadsheet/pull/1268)
+- Xlsx writer actually writes plotVisOnly and dispBlanksAs from chart properties [#1266](https://github.com/PHPOffice/PhpSpreadsheet/pull/1266)
+
+## 1.10.0 - 2019-11-18
+
+### Changed
+
+- Change license from LGPL 2.1 to MIT [#140](https://github.com/PHPOffice/PhpSpreadsheet/issues/140)
+
+### Added
+
+- Implementation of IFNA() logical function
+- Support "showZeros" worksheet option to change how Excel shows and handles "null" values returned from a calculation
+- Allow HTML Reader to accept HTML as a string into an existing spreadsheet [#1212](https://github.com/PHPOffice/PhpSpreadsheet/pull/1212)
+
+### Fixed
+
+- IF implementation properly handles the value `#N/A` [#1165](https://github.com/PHPOffice/PhpSpreadsheet/pull/1165)
+- Formula Parser: Wrong line count for stuff like "MyOtherSheet!A:D" [#1215](https://github.com/PHPOffice/PhpSpreadsheet/issues/1215)
+- Call garbage collector after removing a column to prevent stale cached values
+- Trying to remove a column that doesn't exist deletes the latest column
+- Keep big integer as integer instead of lossely casting to float [#874](https://github.com/PHPOffice/PhpSpreadsheet/pull/874)
+- Fix branch pruning handling of non boolean conditions [#1167](https://github.com/PHPOffice/PhpSpreadsheet/pull/1167)
+- Fix ODS Reader when no DC namespace are defined [#1182](https://github.com/PHPOffice/PhpSpreadsheet/pull/1182)
+- Fixed Functions->ifCondition for allowing <> and empty condition [#1206](https://github.com/PHPOffice/PhpSpreadsheet/pull/1206)
+- Validate XIRR inputs and return correct error values [#1120](https://github.com/PHPOffice/PhpSpreadsheet/issues/1120)
+- Allow to read xlsx files with exotic workbook names like "workbook2.xml" [#1183](https://github.com/PHPOffice/PhpSpreadsheet/pull/1183)
+
+## 1.9.0 - 2019-08-17
+
+### Changed
+
+- Drop support for PHP 5.6 and 7.0, according to https://phpspreadsheet.readthedocs.io/en/latest/#php-version-support
+
+### Added
+
+- When <br> appears in a table cell, set the cell to wrap [#1071](https://github.com/PHPOffice/PhpSpreadsheet/issues/1071) and [#1070](https://github.com/PHPOffice/PhpSpreadsheet/pull/1070)
+- Add MAXIFS, MINIFS, COUNTIFS and Remove MINIF, MAXIF [#1056](https://github.com/PHPOffice/PhpSpreadsheet/issues/1056)
+- HLookup needs an ordered list even if range_lookup is set to false [#1055](https://github.com/PHPOffice/PhpSpreadsheet/issues/1055) and [#1076](https://github.com/PHPOffice/PhpSpreadsheet/pull/1076)
+- Improve performance of IF function calls via ranch pruning to avoid resolution of every branches [#844](https://github.com/PHPOffice/PhpSpreadsheet/pull/844)
+- MATCH function supports `*?~` Excel functionality, when match_type=0 [#1116](https://github.com/PHPOffice/PhpSpreadsheet/issues/1116)
+- Allow HTML Reader to accept HTML as a string [#1136](https://github.com/PHPOffice/PhpSpreadsheet/pull/1136)
+
+### Fixed
+
+- Fix to AVERAGEIF() function when called with a third argument
+- Eliminate duplicate fill none style entries [#1066](https://github.com/PHPOffice/PhpSpreadsheet/issues/1066)
+- Fix number format masks containing literal (non-decimal point) dots [#1079](https://github.com/PHPOffice/PhpSpreadsheet/issues/1079)
+- Fix number format masks containing named colours that were being misinterpreted as date formats; and add support for masks that fully replace the value with a full text string [#1009](https://github.com/PHPOffice/PhpSpreadsheet/issues/1009)
+- Stricter-typed comparison testing in COUNTIF() and COUNTIFS() evaluation [#1046](https://github.com/PHPOffice/PhpSpreadsheet/issues/1046)
+- COUPNUM should not return zero when settlement is in the last period [#1020](https://github.com/PHPOffice/PhpSpreadsheet/issues/1020) and [#1021](https://github.com/PHPOffice/PhpSpreadsheet/pull/1021)
+- Fix handling of named ranges referencing sheets with spaces or "!" in their title
+- Cover `getSheetByName()` with tests for name with quote and spaces [#739](https://github.com/PHPOffice/PhpSpreadsheet/issues/739)
+- Best effort to support invalid colspan values in HTML reader - [#878](https://github.com/PHPOffice/PhpSpreadsheet/pull/878)
+- Fixes incorrect rows deletion [#868](https://github.com/PHPOffice/PhpSpreadsheet/issues/868)
+- MATCH function fix (value search by type, stop search when match_type=-1 and unordered element encountered) [#1116](https://github.com/PHPOffice/PhpSpreadsheet/issues/1116)
+- Fix `getCalculatedValue()` error with more than two INDIRECT [#1115](https://github.com/PHPOffice/PhpSpreadsheet/pull/1115)
+- Writer\Html did not hide columns [#985](https://github.com/PHPOffice/PhpSpreadsheet/pull/985)
+
+## 1.8.2 - 2019-07-08
+
+### Fixed
+
+- Uncaught error when opening ods file and properties aren't defined [#1047](https://github.com/PHPOffice/PhpSpreadsheet/issues/1047)
+- Xlsx Reader Cell datavalidations bug [#1052](https://github.com/PHPOffice/PhpSpreadsheet/pull/1052)
+
+## 1.8.1 - 2019-07-02
+
+### Fixed
+
+- Allow nullable theme for Xlsx Style Reader class [#1043](https://github.com/PHPOffice/PhpSpreadsheet/issues/1043)
+
+## 1.8.0 - 2019-07-01
+
+### Security Fix (CVE-2019-12331)
+
+- Detect double-encoded xml in the Security scanner, and reject as suspicious.
+- This change also broadens the scope of the `libxml_disable_entity_loader` setting when reading XML-based formats, so that it is enabled while the xml is being parsed and not simply while it is loaded.
+ On some versions of PHP, this can cause problems because it is not thread-safe, and can affect other PHP scripts running on the same server. This flag is set to true when instantiating a loader, and back to its original setting when the Reader is no longer in scope, or manually unset.
+- Provide a check to identify whether libxml_disable_entity_loader is thread-safe or not.
+
+ `XmlScanner::threadSafeLibxmlDisableEntityLoaderAvailability()`
+- Provide an option to disable the libxml_disable_entity_loader call through settings. This is not recommended as it reduces the security of the XML-based readers, and should only be used if you understand the consequences and have no other choice.
+
+### Added
+
+- Added support for the SWITCH function [#963](https://github.com/PHPOffice/PhpSpreadsheet/issues/963) and [#983](https://github.com/PHPOffice/PhpSpreadsheet/pull/983)
+- Add accounting number format style [#974](https://github.com/PHPOffice/PhpSpreadsheet/pull/974)
+
+### Fixed
+
+- Whitelist `tsv` extension when opening CSV files [#429](https://github.com/PHPOffice/PhpSpreadsheet/issues/429)
+- Fix a SUMIF warning with some versions of PHP when having different length of arrays provided as input [#873](https://github.com/PHPOffice/PhpSpreadsheet/pull/873)
+- Fix incorrectly handled backslash-escaped space characters in number format
+
+## 1.7.0 - 2019-05-26
+
+- Added support for inline styles in Html reader (borders, alignment, width, height)
+- QuotedText cells no longer treated as formulae if the content begins with a `=`
+- Clean handling for DDE in formulae
+
+### Fixed
+
+- Fix handling for escaped enclosures and new lines in CSV Separator Inference
+- Fix MATCH an error was appearing when comparing strings against 0 (always true)
+- Fix wrong calculation of highest column with specified row [#700](https://github.com/PHPOffice/PhpSpreadsheet/issues/700)
+- Fix VLOOKUP
+- Fix return type hint
+
+## 1.6.0 - 2019-01-02
+
+### Added
+
+- Refactored Matrix Functions to use external Matrix library
+- Possibility to specify custom colors of values for pie and donut charts [#768](https://github.com/PHPOffice/PhpSpreadsheet/pull/768)
+
+### Fixed
+
+- Improve XLSX parsing speed if no readFilter is applied [#772](https://github.com/PHPOffice/PhpSpreadsheet/issues/772)
+- Fix column names if read filter calls in XLSX reader skip columns [#777](https://github.com/PHPOffice/PhpSpreadsheet/pull/777)
+- XLSX reader can now ignore blank cells, using the setReadEmptyCells(false) method. [#810](https://github.com/PHPOffice/PhpSpreadsheet/issues/810)
+- Fix LOOKUP function which was breaking on edge cases [#796](https://github.com/PHPOffice/PhpSpreadsheet/issues/796)
+- Fix VLOOKUP with exact matches [#809](https://github.com/PHPOffice/PhpSpreadsheet/pull/809)
+- Support COUNTIFS multiple arguments [#830](https://github.com/PHPOffice/PhpSpreadsheet/pull/830)
+- Change `libxml_disable_entity_loader()` as shortly as possible [#819](https://github.com/PHPOffice/PhpSpreadsheet/pull/819)
+- Improved memory usage and performance when loading large spreadsheets [#822](https://github.com/PHPOffice/PhpSpreadsheet/pull/822)
+- Improved performance when loading large spreadsheets [#825](https://github.com/PHPOffice/PhpSpreadsheet/pull/825)
+- Improved performance when loading large spreadsheets [#824](https://github.com/PHPOffice/PhpSpreadsheet/pull/824)
+- Fix color from CSS when reading from HTML [#831](https://github.com/PHPOffice/PhpSpreadsheet/pull/831)
+- Fix infinite loop when reading invalid ODS files [#832](https://github.com/PHPOffice/PhpSpreadsheet/pull/832)
+- Fix time format for duration is incorrect [#666](https://github.com/PHPOffice/PhpSpreadsheet/pull/666)
+- Fix iconv unsupported `//IGNORE//TRANSLIT` on IBM i [#791](https://github.com/PHPOffice/PhpSpreadsheet/issues/791)
+
+### Changed
+
+- `master` is the new default branch, `develop` does not exist anymore
+
+## 1.5.2 - 2018-11-25
+
+### Security
+
+- Improvements to the design of the XML Security Scanner [#771](https://github.com/PHPOffice/PhpSpreadsheet/issues/771)
+
+## 1.5.1 - 2018-11-20
+
+### Security
+
+- Fix and improve XXE security scanning for XML-based and HTML Readers [#771](https://github.com/PHPOffice/PhpSpreadsheet/issues/771)
+
+### Added
+
+- Support page margin in mPDF [#750](https://github.com/PHPOffice/PhpSpreadsheet/issues/750)
+
+### Fixed
+
+- Support numeric condition in SUMIF, SUMIFS, AVERAGEIF, COUNTIF, MAXIF and MINIF [#683](https://github.com/PHPOffice/PhpSpreadsheet/issues/683)
+- SUMIFS containing multiple conditions [#704](https://github.com/PHPOffice/PhpSpreadsheet/issues/704)
+- Csv reader avoid notice when the file is empty [#743](https://github.com/PHPOffice/PhpSpreadsheet/pull/743)
+- Fix print area parser for XLSX reader [#734](https://github.com/PHPOffice/PhpSpreadsheet/pull/734)
+- Support overriding `DefaultValueBinder::dataTypeForValue()` without overriding `DefaultValueBinder::bindValue()` [#735](https://github.com/PHPOffice/PhpSpreadsheet/pull/735)
+- Mpdf export can exceed pcre.backtrack_limit [#637](https://github.com/PHPOffice/PhpSpreadsheet/issues/637)
+- Fix index overflow on data values array [#748](https://github.com/PHPOffice/PhpSpreadsheet/pull/748)
+
+## 1.5.0 - 2018-10-21
+
+### Added
+
+- PHP 7.3 support
+- Add the DAYS() function [#594](https://github.com/PHPOffice/PhpSpreadsheet/pull/594)
+
+### Fixed
+
+- Sheet title can contain exclamation mark [#325](https://github.com/PHPOffice/PhpSpreadsheet/issues/325)
+- Xls file cause the exception during open by Xls reader [#402](https://github.com/PHPOffice/PhpSpreadsheet/issues/402)
+- Skip non numeric value in SUMIF [#618](https://github.com/PHPOffice/PhpSpreadsheet/pull/618)
+- OFFSET should allow omitted height and width [#561](https://github.com/PHPOffice/PhpSpreadsheet/issues/561)
+- Correctly determine delimiter when CSV contains line breaks inside enclosures [#716](https://github.com/PHPOffice/PhpSpreadsheet/issues/716)
+
+## 1.4.1 - 2018-09-30
+
+### Fixed
+
+- Remove locale from formatting string [#644](https://github.com/PHPOffice/PhpSpreadsheet/pull/644)
+- Allow iterators to go out of bounds with prev [#587](https://github.com/PHPOffice/PhpSpreadsheet/issues/587)
+- Fix warning when reading xlsx without styles [#631](https://github.com/PHPOffice/PhpSpreadsheet/pull/631)
+- Fix broken sample links on windows due to $baseDir having backslash [#653](https://github.com/PHPOffice/PhpSpreadsheet/pull/653)
+
+## 1.4.0 - 2018-08-06
+
+### Added
+
+- Add excel function EXACT(value1, value2) support [#595](https://github.com/PHPOffice/PhpSpreadsheet/pull/595)
+- Support workbook view attributes for Xlsx format [#523](https://github.com/PHPOffice/PhpSpreadsheet/issues/523)
+- Read and write hyperlink for drawing image [#490](https://github.com/PHPOffice/PhpSpreadsheet/pull/490)
+- Added calculation engine support for the new bitwise functions that were added in MS Excel 2013
+ - BITAND() Returns a Bitwise 'And' of two numbers
+ - BITOR() Returns a Bitwise 'Or' of two number
+ - BITXOR() Returns a Bitwise 'Exclusive Or' of two numbers
+ - BITLSHIFT() Returns a number shifted left by a specified number of bits
+ - BITRSHIFT() Returns a number shifted right by a specified number of bits
+- Added calculation engine support for other new functions that were added in MS Excel 2013 and MS Excel 2016
+ - Text Functions
+ - CONCAT() Synonym for CONCATENATE()
+ - NUMBERVALUE() Converts text to a number, in a locale-independent way
+ - UNICHAR() Synonym for CHAR() in PHPSpreadsheet, which has always used UTF-8 internally
+ - UNIORD() Synonym for ORD() in PHPSpreadsheet, which has always used UTF-8 internally
+ - TEXTJOIN() Joins together two or more text strings, separated by a delimiter
+ - Logical Functions
+ - XOR() Returns a logical Exclusive Or of all arguments
+ - Date/Time Functions
+ - ISOWEEKNUM() Returns the ISO 8601 week number of the year for a given date
+ - Lookup and Reference Functions
+ - FORMULATEXT() Returns a formula as a string
+ - Financial Functions
+ - PDURATION() Calculates the number of periods required for an investment to reach a specified value
+ - RRI() Calculates the interest rate required for an investment to grow to a specified future value
+ - Engineering Functions
+ - ERF.PRECISE() Returns the error function integrated between 0 and a supplied limit
+ - ERFC.PRECISE() Synonym for ERFC
+ - Math and Trig Functions
+ - SEC() Returns the secant of an angle
+ - SECH() Returns the hyperbolic secant of an angle
+ - CSC() Returns the cosecant of an angle
+ - CSCH() Returns the hyperbolic cosecant of an angle
+ - COT() Returns the cotangent of an angle
+ - COTH() Returns the hyperbolic cotangent of an angle
+ - ACOT() Returns the cotangent of an angle
+ - ACOTH() Returns the hyperbolic cotangent of an angle
+- Refactored Complex Engineering Functions to use external complex number library
+- Added calculation engine support for the new complex number functions that were added in MS Excel 2013
+ - IMCOSH() Returns the hyperbolic cosine of a complex number
+ - IMCOT() Returns the cotangent of a complex number
+ - IMCSC() Returns the cosecant of a complex number
+ - IMCSCH() Returns the hyperbolic cosecant of a complex number
+ - IMSEC() Returns the secant of a complex number
+ - IMSECH() Returns the hyperbolic secant of a complex number
+ - IMSINH() Returns the hyperbolic sine of a complex number
+ - IMTAN() Returns the tangent of a complex number
+
+### Fixed
+
+- Fix ISFORMULA() function to work with a cell reference to another worksheet
+- Xlsx reader crashed when reading a file with workbook protection [#553](https://github.com/PHPOffice/PhpSpreadsheet/pull/553)
+- Cell formats with escaped spaces were causing incorrect date formatting [#557](https://github.com/PHPOffice/PhpSpreadsheet/issues/557)
+- Could not open CSV file containing HTML fragment [#564](https://github.com/PHPOffice/PhpSpreadsheet/issues/564)
+- Exclude the vendor folder in migration [#481](https://github.com/PHPOffice/PhpSpreadsheet/issues/481)
+- Chained operations on cell ranges involving borders operated on last cell only [#428](https://github.com/PHPOffice/PhpSpreadsheet/issues/428)
+- Avoid memory exhaustion when cloning worksheet with a drawing [#437](https://github.com/PHPOffice/PhpSpreadsheet/issues/437)
+- Migration tool keep variables containing $PHPExcel untouched [#598](https://github.com/PHPOffice/PhpSpreadsheet/issues/598)
+- Rowspans/colspans were incorrect when adding worksheet using loadIntoExisting [#619](https://github.com/PHPOffice/PhpSpreadsheet/issues/619)
+
+## 1.3.1 - 2018-06-12
+
+### Fixed
+
+- Ranges across Z and AA columns incorrectly threw an exception [#545](https://github.com/PHPOffice/PhpSpreadsheet/issues/545)
+
+## 1.3.0 - 2018-06-10
+
+### Added
+
+- Support to read Xlsm templates with form elements, macros, printer settings, protected elements and back compatibility drawing, and save result without losing important elements of document [#435](https://github.com/PHPOffice/PhpSpreadsheet/issues/435)
+- Expose sheet title maximum length as `Worksheet::SHEET_TITLE_MAXIMUM_LENGTH` [#482](https://github.com/PHPOffice/PhpSpreadsheet/issues/482)
+- Allow escape character to be set in CSV reader [#492](https://github.com/PHPOffice/PhpSpreadsheet/issues/492)
+
+### Fixed
+
+- Subtotal 9 in a group that has other subtotals 9 exclude the totals of the other subtotals in the range [#332](https://github.com/PHPOffice/PhpSpreadsheet/issues/332)
+- `Helper\Html` support UTF-8 HTML input [#444](https://github.com/PHPOffice/PhpSpreadsheet/issues/444)
+- Xlsx loaded an extra empty comment for each real comment [#375](https://github.com/PHPOffice/PhpSpreadsheet/issues/375)
+- Xlsx reader do not read rows and columns filtered out in readFilter at all [#370](https://github.com/PHPOffice/PhpSpreadsheet/issues/370)
+- Make newer Excel versions properly recalculate formulas on document open [#456](https://github.com/PHPOffice/PhpSpreadsheet/issues/456)
+- `Coordinate::extractAllCellReferencesInRange()` throws an exception for an invalid range [#519](https://github.com/PHPOffice/PhpSpreadsheet/issues/519)
+- Fixed parsing of conditionals in COUNTIF functions [#526](https://github.com/PHPOffice/PhpSpreadsheet/issues/526)
+- Corruption errors for saved Xlsx docs with frozen panes [#532](https://github.com/PHPOffice/PhpSpreadsheet/issues/532)
+
+## 1.2.1 - 2018-04-10
+
+### Fixed
+
+- Plain text and richtext mixed in same cell can be read [#442](https://github.com/PHPOffice/PhpSpreadsheet/issues/442)
+
+## 1.2.0 - 2018-03-04
+
+### Added
+
+- HTML writer creates a generator meta tag [#312](https://github.com/PHPOffice/PhpSpreadsheet/issues/312)
+- Support invalid zoom value in XLSX format [#350](https://github.com/PHPOffice/PhpSpreadsheet/pull/350)
+- Support for `_xlfn.` prefixed functions and `ISFORMULA`, `MODE.SNGL`, `STDEV.S`, `STDEV.P` [#390](https://github.com/PHPOffice/PhpSpreadsheet/pull/390)
+
+### Fixed
+
+- Avoid potentially unsupported PSR-16 cache keys [#354](https://github.com/PHPOffice/PhpSpreadsheet/issues/354)
+- Check for MIME type to know if CSV reader can read a file [#167](https://github.com/PHPOffice/PhpSpreadsheet/issues/167)
+- Use proper € symbol for currency format [#379](https://github.com/PHPOffice/PhpSpreadsheet/pull/379)
+- Read printing area correctly when skipping some sheets [#371](https://github.com/PHPOffice/PhpSpreadsheet/issues/371)
+- Avoid incorrectly overwriting calculated value type [#394](https://github.com/PHPOffice/PhpSpreadsheet/issues/394)
+- Select correct cell when calling freezePane [#389](https://github.com/PHPOffice/PhpSpreadsheet/issues/389)
+- `setStrikethrough()` did not set the font [#403](https://github.com/PHPOffice/PhpSpreadsheet/issues/403)
+
+## 1.1.0 - 2018-01-28
+
+### Added
+
+- Support for PHP 7.2
+- Support cell comments in HTML writer and reader [#308](https://github.com/PHPOffice/PhpSpreadsheet/issues/308)
+- Option to stop at a conditional styling, if it matches (only XLSX format) [#292](https://github.com/PHPOffice/PhpSpreadsheet/pull/292)
+- Support for line width for data series when rendering Xlsx [#329](https://github.com/PHPOffice/PhpSpreadsheet/pull/329)
+
+### Fixed
+
+- Better auto-detection of CSV separators [#305](https://github.com/PHPOffice/PhpSpreadsheet/issues/305)
+- Support for shape style ending with `;` [#304](https://github.com/PHPOffice/PhpSpreadsheet/issues/304)
+- Freeze Panes takes wrong coordinates for XLSX [#322](https://github.com/PHPOffice/PhpSpreadsheet/issues/322)
+- `COLUMNS` and `ROWS` functions crashed in some cases [#336](https://github.com/PHPOffice/PhpSpreadsheet/issues/336)
+- Support XML file without styles [#331](https://github.com/PHPOffice/PhpSpreadsheet/pull/331)
+- Cell coordinates which are already a range cause an exception [#319](https://github.com/PHPOffice/PhpSpreadsheet/issues/319)
+
+## 1.0.0 - 2017-12-25
+
+### Added
+
+- Support to write merged cells in ODS format [#287](https://github.com/PHPOffice/PhpSpreadsheet/issues/287)
+- Able to set the `topLeftCell` in freeze panes [#261](https://github.com/PHPOffice/PhpSpreadsheet/pull/261)
+- Support `DateTimeImmutable` as cell value
+- Support migration of prefixed classes
+
+### Fixed
+
+- Can read very small HTML files [#194](https://github.com/PHPOffice/PhpSpreadsheet/issues/194)
+- Written DataValidation was corrupted [#290](https://github.com/PHPOffice/PhpSpreadsheet/issues/290)
+- Date format compatible with both LibreOffice and Excel [#298](https://github.com/PHPOffice/PhpSpreadsheet/issues/298)
+
+### BREAKING CHANGE
+
+- Constant `TYPE_DOUGHTNUTCHART` is now `TYPE_DOUGHNUTCHART`.
+
+## 1.0.0-beta2 - 2017-11-26
+
+### Added
+
+- Support for chart fill color - @CrazyBite [#158](https://github.com/PHPOffice/PhpSpreadsheet/pull/158)
+- Support for read Hyperlink for xml - @GreatHumorist [#223](https://github.com/PHPOffice/PhpSpreadsheet/pull/223)
+- Support for cell value validation according to data validation rules - @SailorMax [#257](https://github.com/PHPOffice/PhpSpreadsheet/pull/257)
+- Support for custom implementation, or configuration, of PDF libraries - @SailorMax [#266](https://github.com/PHPOffice/PhpSpreadsheet/pull/266)
+
+### Changed
+
+- Merge data-validations to reduce written worksheet size - @billblume [#131](https://github.com/PHPOffice/PhpSpreadSheet/issues/131)
+- Throws exception if a XML file is invalid - @GreatHumorist [#222](https://github.com/PHPOffice/PhpSpreadsheet/pull/222)
+- Upgrade to mPDF 7.0+ [#144](https://github.com/PHPOffice/PhpSpreadsheet/issues/144)
+
+### Fixed
+
+- Control characters in cell values are automatically escaped [#212](https://github.com/PHPOffice/PhpSpreadsheet/issues/212)
+- Prevent color changing when copy/pasting xls files written by PhpSpreadsheet to another file - @al-lala [#218](https://github.com/PHPOffice/PhpSpreadsheet/issues/218)
+- Add cell reference automatic when there is no cell reference('r' attribute) in Xlsx file. - @GreatHumorist [#225](https://github.com/PHPOffice/PhpSpreadsheet/pull/225) Refer to [#201](https://github.com/PHPOffice/PhpSpreadsheet/issues/201)
+- `Reader\Xlsx::getFromZipArchive()` function return false if the zip entry could not be located. - @anton-harvey [#268](https://github.com/PHPOffice/PhpSpreadsheet/pull/268)
+
+### BREAKING CHANGE
+
+- Extracted coordinate method to dedicate class [migration guide](./docs/topics/migration-from-PHPExcel.md).
+- Column indexes are based on 1, see the [migration guide](./docs/topics/migration-from-PHPExcel.md).
+- Standardization of array keys used for style, see the [migration guide](./docs/topics/migration-from-PHPExcel.md).
+- Easier usage of PDF writers, and other custom readers and writers, see the [migration guide](./docs/topics/migration-from-PHPExcel.md).
+- Easier usage of chart renderers, see the [migration guide](./docs/topics/migration-from-PHPExcel.md).
+- Rename a few more classes to keep them in their related namespaces:
+ - `CalcEngine` => `Calculation\Engine`
+ - `PhpSpreadsheet\Calculation` => `PhpSpreadsheet\Calculation\Calculation`
+ - `PhpSpreadsheet\Cell` => `PhpSpreadsheet\Cell\Cell`
+ - `PhpSpreadsheet\Chart` => `PhpSpreadsheet\Chart\Chart`
+ - `PhpSpreadsheet\RichText` => `PhpSpreadsheet\RichText\RichText`
+ - `PhpSpreadsheet\Style` => `PhpSpreadsheet\Style\Style`
+ - `PhpSpreadsheet\Worksheet` => `PhpSpreadsheet\Worksheet\Worksheet`
+
+## 1.0.0-beta - 2017-08-17
+
+### Added
+
+- Initial implementation of SUMIFS() function
+- Additional codepages
+- MemoryDrawing not working in HTML writer [#808](https://github.com/PHPOffice/PHPExcel/issues/808)
+- CSV Reader can auto-detect the separator used in file [#141](https://github.com/PHPOffice/PhpSpreadsheet/pull/141)
+- HTML Reader supports some basic inline styles [#180](https://github.com/PHPOffice/PhpSpreadsheet/pull/180)
+
+### Changed
+
+- Start following [SemVer](https://semver.org) properly.
+
+### Fixed
+
+- Fix to getCell() method when cell reference includes a worksheet reference - @MarkBaker
+- Ignore inlineStr type if formula element exists - @ncrypthic [#570](https://github.com/PHPOffice/PHPExcel/issues/570)
+- Excel 2007 Reader freezes because of conditional formatting - @rentalhost [#575](https://github.com/PHPOffice/PHPExcel/issues/575)
+- Readers will now parse files containing worksheet titles over 31 characters [#176](https://github.com/PHPOffice/PhpSpreadsheet/pull/176)
+- Fixed PHP8 deprecation warning for libxml_disable_entity_loader() [#1625](https://github.com/phpoffice/phpspreadsheet/pull/1625)
+
+### General
+
+- Whitespace after toRichTextObject() - @MarkBaker [#554](https://github.com/PHPOffice/PHPExcel/issues/554)
+- Optimize vlookup() sort - @umpirsky [#548](https://github.com/PHPOffice/PHPExcel/issues/548)
+- c:max and c:min elements shall NOT be inside c:orientation elements - @vitalyrepin [#869](https://github.com/PHPOffice/PHPExcel/pull/869)
+- Implement actual timezone adjustment into PHPExcel_Shared_Date::PHPToExcel - @sim642 [#489](https://github.com/PHPOffice/PHPExcel/pull/489)
+
+### BREAKING CHANGE
+
+- Introduction of namespaces for all classes, eg: `PHPExcel_Calculation_Functions` becomes `PhpOffice\PhpSpreadsheet\Calculation\Functions`
+- Some classes were renamed for clarity and/or consistency:
+
+For a comprehensive list of all class changes, and a semi-automated migration path, read the [migration guide](./docs/topics/migration-from-PHPExcel.md).
+
+- Dropped `PHPExcel_Calculation_Functions::VERSION()`. Composer or git should be used to know the version.
+- Dropped `PHPExcel_Settings::setPdfRenderer()` and `PHPExcel_Settings::setPdfRenderer()`. Composer should be used to autoload PDF libs.
+- Dropped support for HHVM
+
+## Previous versions of PHPExcel
+
+The changelog for the project when it was called PHPExcel is [still available](./CHANGELOG.PHPExcel.md).
+
+### Changed
+- Replace ezyang/htmlpurifier (LGPL2.1) with voku/anti-xss (MIT)
diff --git a/public/vendor/phpoffice/phpspreadsheet/CONTRIBUTING.md b/public/vendor/phpoffice/phpspreadsheet/CONTRIBUTING.md
new file mode 100644
index 0000000..e89e99e
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/CONTRIBUTING.md
@@ -0,0 +1,45 @@
+# Want to contribute?
+
+If you would like to contribute, here are some notes and guidelines:
+
+ - All new development should be on feature/fix branches, which are then merged to the `master` branch once stable and approved; so the `master` branch is always the most up-to-date, working code
+ - If you are going to submit a pull request, please fork from `master`, and submit your pull request back as a fix/feature branch referencing the GitHub issue number
+ - The code must work with all PHP versions that we support.
+ - You can call `composer versions` to test version compatibility.
+ - Code style should be maintained.
+ - `composer style` will identify any issues with Coding Style`.
+ - `composer fix` will fix most issues with Coding Style.
+ - All code changes must be validated by `composer check`.
+ - Please include Unit Tests to verify that a bug exists, and that this PR fixes it.
+ - Please include Unit Tests to show that a new Feature works as expected.
+ - Please don't "bundle" several changes into a single PR; submit a PR for each discrete change/fix.
+ - Remember to update documentation if necessary.
+
+ - [Helpful article about forking](https://help.github.com/articles/fork-a-repo/ "Forking a GitHub repository")
+ - [Helpful article about pull requests](https://help.github.com/articles/using-pull-requests/ "Pull Requests")
+
+## Unit Tests
+
+When writing Unit Tests, please
+ - Always try to write Unit Tests for both the happy and unhappy paths.
+ - Put all assertions in the Test itself, not in an abstract class that the Test extends (even if this means code duplication between tests).
+ - Include any necessary `setup()` and `tearDown()` in the Test itself.
+ - If you change any global settings (such as system locale, or Compatibility Mode for Excel Function tests), make sure that you reset to the default in the `tearDown()`.
+ - Use the `ExcelError` functions in assertions for Excel Error values in Excel Function implementations.
+ Not only does it reduce the risk of typos; but at some point in the future, ExcelError values will be an object rather than a string, and we won't then need to update all the tests.
+ - Don't over-complicate test code by testing happy and unhappy paths in the same test.
+
+This makes it easier to see exactly what is being tested when reviewing the PR. I want to be able to see it in the PR, not have to hunt in other unchanged classes to see what the test is doing.
+
+## How to release
+
+1. Complete CHANGELOG.md and commit
+2. Create an annotated tag
+ 1. `git tag -a 1.2.3`
+ 2. Tag subject must be the version number, eg: `1.2.3`
+ 3. Tag body must be a copy-paste of the changelog entries.
+3. Push the tag with `git push --tags`, GitHub Actions will create a GitHub release automatically, and the release details will automatically be sent to packagist.
+4. Github seems to remove markdown headings in the Release Notes, so you should edit to restore these.
+
+> **Note:** Tagged releases are made from the `master` branch. Only in an emergency should a tagged release be made from the `release` branch. (i.e. cherry-picked hot-fixes.)
+
diff --git a/public/vendor/phpoffice/phpspreadsheet/LICENSE b/public/vendor/phpoffice/phpspreadsheet/LICENSE
new file mode 100644
index 0000000..3ec5723
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2019 PhpSpreadsheet Authors
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/public/vendor/phpoffice/phpspreadsheet/README.md b/public/vendor/phpoffice/phpspreadsheet/README.md
new file mode 100644
index 0000000..bc12671
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/README.md
@@ -0,0 +1,141 @@
+# PhpSpreadsheet
+
+[](https://github.com/PHPOffice/PhpSpreadsheet/actions)
+[](https://scrutinizer-ci.com/g/PHPOffice/PhpSpreadsheet/?branch=master)
+[](https://scrutinizer-ci.com/g/PHPOffice/PhpSpreadsheet/?branch=master)
+[](https://packagist.org/packages/phpoffice/phpspreadsheet)
+[](https://packagist.org/packages/phpoffice/phpspreadsheet)
+[](https://packagist.org/packages/phpoffice/phpspreadsheet)
+[](https://gitter.im/PHPOffice/PhpSpreadsheet)
+
+PhpSpreadsheet is a library written in pure PHP and offers a set of classes that
+allow you to read and write various spreadsheet file formats such as Excel and LibreOffice Calc.
+
+## PHP Version Support
+
+LTS: Support for PHP versions will only be maintained for a period of six months beyond the
+[end of life](https://www.php.net/supported-versions) of that PHP version.
+
+Currently the required PHP minimum version is PHP __8.0__, and we [will support that version](https://www.php.net/eol.php) until May 2024.
+
+See the `composer.json` for other requirements.
+
+## Installation
+
+Use [composer](https://getcomposer.org) to install PhpSpreadsheet into your project:
+
+```sh
+composer require phpoffice/phpspreadsheet
+```
+
+If you are building your installation on a development machine that is on a different PHP version to the server where it will be deployed, or if your PHP CLI version is not the same as your run-time such as `php-fpm` or Apache's `mod_php`, then you might want to add the following to your `composer.json` before installing:
+```json
+{
+ "config": {
+ "platform": {
+ "php": "8.0"
+ }
+ }
+}
+```
+and then run
+```sh
+composer install
+```
+to ensure that the correct dependencies are retrieved to match your deployment environment.
+
+See [CLI vs Application run-time](https://php.watch/articles/composer-platform-check) for more details.
+
+### Additional Installation Options
+
+If you want to write to PDF, or to include Charts when you write to HTML or PDF, then you will need to install additional libraries:
+
+#### PDF
+
+For PDF Generation, you can install any of the following, and then configure PhpSpreadsheet to indicate which library you are going to use:
+ - mpdf/mpdf
+ - dompdf/dompdf
+ - tecnickcom/tcpdf
+
+and configure PhpSpreadsheet using:
+
+```php
+// Dompdf, Mpdf or Tcpdf (as appropriate)
+$className = \PhpOffice\PhpSpreadsheet\Writer\Pdf\Dompdf::class;
+IOFactory::registerWriter('Pdf', $className);
+```
+or the appropriate PDF Writer wrapper for the library that you have chosen to install.
+
+#### Chart Export
+
+For Chart export, we support following packages, which you will also need to install yourself using `composer require`
+ - [jpgraph/jpgraph](https://packagist.org/packages/jpgraph/jpgraph) (this package was abandoned at version 4.0.
+ You can manually download the latest version that supports PHP 8 and above from [jpgraph.net](https://jpgraph.net/))
+ - [mitoteam/jpgraph](https://packagist.org/packages/mitoteam/jpgraph) - up to date fork with modern PHP versions support and some bugs fixed.
+
+and then configure PhpSpreadsheet using:
+```php
+// to use jpgraph/jpgraph
+Settings::setChartRenderer(\PhpOffice\PhpSpreadsheet\Chart\Renderer\JpGraph::class);
+//or
+// to use mitoteam/jpgraph
+Settings::setChartRenderer(\PhpOffice\PhpSpreadsheet\Chart\Renderer\MtJpGraphRenderer::class);
+```
+
+One or the other of these libraries is necessary if you want to generate HTML or PDF files that include charts; or to render a Chart to an Image format from within your code.
+They are not necessary to define charts for writing to `Xlsx` files.
+Other file formats don't support writing Charts.
+
+## Documentation
+
+Read more about it, including install instructions, in the [official documentation](https://phpspreadsheet.readthedocs.io). Or check out the [API documentation](https://phpoffice.github.io/PhpSpreadsheet).
+
+Please ask your support questions on [StackOverflow](https://stackoverflow.com/questions/tagged/phpspreadsheet), or have a quick chat on [Gitter](https://gitter.im/PHPOffice/PhpSpreadsheet).
+
+## Patreon
+
+I am now running a [Patreon](https://www.patreon.com/MarkBaker) to support the work that I do on PhpSpreadsheet.
+
+Supporters will receive access to articles about working with PhpSpreadsheet, and how to use some of its more advanced features.
+
+Posts already available to Patreon supporters:
+ - The Dating Game
+ - A look at how MS Excel (and PhpSpreadsheet) handle date and time values.
+- Looping the Loop
+ - Advice on Iterating through the rows and cells in a worksheet.
+
+And for Patrons at levels actively using PhpSpreadsheet:
+ - Behind the Mask
+ - A look at Number Format Masks.
+
+The Next Article (currently Work in Progress):
+ - Formula for Success
+ - How to debug formulae that don't produce the expected result.
+
+
+My aim is to post at least one article each month, taking a detailed look at some feature of MS Excel and how to use that feature in PhpSpreadsheet, or on how to perform different activities in PhpSpreadsheet.
+
+Planned posts for the future include topics like:
+ - Tables
+ - Structured References
+ - AutoFiltering
+ - Array Formulae
+ - Conditional Formatting
+ - Data Validation
+ - Value Binders
+ - Images
+ - Charts
+
+After a period of six months exclusive to Patreon supporters, articles will be incorporated into the public documentation for the library.
+
+## PHPExcel vs PhpSpreadsheet ?
+
+PhpSpreadsheet is the next version of PHPExcel. It breaks compatibility to dramatically improve the code base quality (namespaces, PSR compliance, use of latest PHP language features, etc.).
+
+Because all efforts have shifted to PhpSpreadsheet, PHPExcel will no longer be maintained. All contributions for PHPExcel, patches and new features, should target PhpSpreadsheet `master` branch.
+
+Do you need to migrate? There is [an automated tool](/docs/topics/migration-from-PHPExcel.md) for that.
+
+## License
+
+PhpSpreadsheet is licensed under [MIT](https://github.com/PHPOffice/PhpSpreadsheet/blob/master/LICENSE).
diff --git a/public/vendor/phpoffice/phpspreadsheet/composer.json b/public/vendor/phpoffice/phpspreadsheet/composer.json
new file mode 100644
index 0000000..2365bbe
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/composer.json
@@ -0,0 +1,120 @@
+{
+ "name": "phpoffice/phpspreadsheet",
+ "description": "PHPSpreadsheet - Read, Create and Write Spreadsheet documents in PHP - Spreadsheet engine",
+ "keywords": [
+ "PHP",
+ "OpenXML",
+ "Excel",
+ "xlsx",
+ "xls",
+ "ods",
+ "gnumeric",
+ "spreadsheet"
+ ],
+ "config": {
+ "platform": {
+ "php" : "8.0.99"
+ },
+ "sort-packages": true,
+ "allow-plugins": {
+ "dealerdirect/phpcodesniffer-composer-installer": true
+ }
+ },
+ "homepage": "https://github.com/PHPOffice/PhpSpreadsheet",
+ "type": "library",
+ "license": "MIT",
+ "authors": [
+ {
+ "name": "Maarten Balliauw",
+ "homepage": "https://blog.maartenballiauw.be"
+ },
+ {
+ "name": "Mark Baker",
+ "homepage": "https://markbakeruk.net"
+ },
+ {
+ "name": "Franck Lefevre",
+ "homepage": "https://rootslabs.net"
+ },
+ {
+ "name": "Erik Tilt"
+ },
+ {
+ "name": "Adrien Crivelli"
+ }
+ ],
+ "scripts": {
+ "check": [
+ "./bin/check-phpdoc-types",
+ "phpcs samples/ src/ tests/ --report=checkstyle",
+ "phpcs samples/ src/ tests/ --standard=PHPCompatibility --runtime-set testVersion 8.0- -n",
+ "php-cs-fixer fix --ansi --dry-run --diff",
+ "phpunit --color=always",
+ "phpstan analyse --ansi --memory-limit=2048M"
+ ],
+ "style": [
+ "phpcs samples/ src/ tests/ --report=checkstyle",
+ "php-cs-fixer fix --ansi --dry-run --diff"
+ ],
+ "fix": [
+ "phpcbf samples/ src/ tests/ --report=checkstyle",
+ "php-cs-fixer fix"
+ ],
+ "versions": [
+ "phpcs samples/ src/ tests/ --standard=PHPCompatibility --runtime-set testVersion 8.0- -n"
+ ]
+ },
+ "require": {
+ "php": "^8.0",
+ "ext-ctype": "*",
+ "ext-dom": "*",
+ "ext-fileinfo": "*",
+ "ext-gd": "*",
+ "ext-iconv": "*",
+ "ext-libxml": "*",
+ "ext-mbstring": "*",
+ "ext-simplexml": "*",
+ "ext-xml": "*",
+ "ext-xmlreader": "*",
+ "ext-xmlwriter": "*",
+ "ext-zip": "*",
+ "ext-zlib": "*",
+ "maennchen/zipstream-php": "^2.1 || ^3.0",
+ "markbaker/complex": "^3.0",
+ "markbaker/matrix": "^3.0",
+ "psr/http-client": "^1.0",
+ "psr/http-factory": "^1.0",
+ "psr/simple-cache": "^1.0 || ^2.0 || ^3.0"
+ },
+ "require-dev": {
+ "dealerdirect/phpcodesniffer-composer-installer": "dev-main",
+ "dompdf/dompdf": "^2.0",
+ "friendsofphp/php-cs-fixer": "^3.2",
+ "mitoteam/jpgraph": "^10.3",
+ "mpdf/mpdf": "^8.1.1",
+ "phpcompatibility/php-compatibility": "^9.3",
+ "phpstan/phpstan": "^1.1",
+ "phpstan/phpstan-phpunit": "^1.0",
+ "phpunit/phpunit": "^9.6",
+ "squizlabs/php_codesniffer": "^3.7",
+ "tecnickcom/tcpdf": "^6.5"
+ },
+ "suggest": {
+ "ext-intl": "PHP Internationalization Functions",
+ "mpdf/mpdf": "Option for rendering PDF with PDF Writer",
+ "dompdf/dompdf": "Option for rendering PDF with PDF Writer",
+ "tecnickcom/tcpdf": "Option for rendering PDF with PDF Writer",
+ "mitoteam/jpgraph": "Option for rendering charts, or including charts with PDF or HTML Writers"
+ },
+ "autoload": {
+ "psr-4": {
+ "PhpOffice\\PhpSpreadsheet\\": "src/PhpSpreadsheet"
+ }
+ },
+ "autoload-dev": {
+ "psr-4": {
+ "PhpOffice\\PhpSpreadsheetTests\\": "tests/PhpSpreadsheetTests",
+ "PhpOffice\\PhpSpreadsheetInfra\\": "infra"
+ }
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/phpstan-baseline.neon b/public/vendor/phpoffice/phpspreadsheet/phpstan-baseline.neon
new file mode 100644
index 0000000..364905f
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/phpstan-baseline.neon
@@ -0,0 +1,2 @@
+parameters:
+ ignoreErrors:
diff --git a/public/vendor/phpoffice/phpspreadsheet/phpstan.neon.dist b/public/vendor/phpoffice/phpspreadsheet/phpstan.neon.dist
new file mode 100644
index 0000000..e6d7d0d
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/phpstan.neon.dist
@@ -0,0 +1,30 @@
+includes:
+ - phpstan-baseline.neon
+ - vendor/phpstan/phpstan-phpunit/extension.neon
+ - vendor/phpstan/phpstan-phpunit/rules.neon
+
+parameters:
+ level: 8
+ paths:
+ - samples/
+ - src/
+ - tests/
+ - infra/
+ - bin/generate-document
+ - bin/generate-locales
+ - bin/check-phpdoc-types
+ excludePaths:
+ - src/PhpSpreadsheet/Chart/Renderer/JpGraph.php
+ - src/PhpSpreadsheet/Chart/Renderer/JpGraphRendererBase.php
+ - src/PhpSpreadsheet/Collection/Memory/SimpleCache1.php
+ - src/PhpSpreadsheet/Collection/Memory/SimpleCache3.php
+ - src/PhpSpreadsheet/Writer/ZipStream2.php
+ - src/PhpSpreadsheet/Writer/ZipStream3.php
+ parallel:
+ processTimeout: 300.0
+ checkMissingIterableValueType: false
+ checkGenericClassInNonGenericObjectType: false
+ ignoreErrors:
+ # Accept a bit anything for assert methods
+ - '~^Parameter \#2 .* of static method PHPUnit\\Framework\\Assert\:\:assert\w+\(\) expects .*, .* given\.$~'
+ - '~^Variable \$helper might not be defined\.$~'
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/ArrayEnabled.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/ArrayEnabled.php
new file mode 100644
index 0000000..7b78b6f
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/ArrayEnabled.php
@@ -0,0 +1,122 @@
+initialise(($arguments === false) ? [] : $arguments);
+ }
+
+ /**
+ * Handles array argument processing when the function accepts a single argument that can be an array argument.
+ * Example use for:
+ * DAYOFMONTH() or FACT().
+ */
+ protected static function evaluateSingleArgumentArray(callable $method, array $values): array
+ {
+ $result = [];
+ foreach ($values as $value) {
+ $result[] = $method($value);
+ }
+
+ return $result;
+ }
+
+ /**
+ * Handles array argument processing when the function accepts multiple arguments,
+ * and any of them can be an array argument.
+ * Example use for:
+ * ROUND() or DATE().
+ */
+ protected static function evaluateArrayArguments(callable $method, mixed ...$arguments): array
+ {
+ self::initialiseHelper($arguments);
+ $arguments = self::$arrayArgumentHelper->arguments();
+
+ return ArrayArgumentProcessor::processArguments(self::$arrayArgumentHelper, $method, ...$arguments);
+ }
+
+ /**
+ * Handles array argument processing when the function accepts multiple arguments,
+ * but only the first few (up to limit) can be an array arguments.
+ * Example use for:
+ * NETWORKDAYS() or CONCATENATE(), where the last argument is a matrix (or a series of values) that need
+ * to be treated as a such rather than as an array arguments.
+ */
+ protected static function evaluateArrayArgumentsSubset(callable $method, int $limit, mixed ...$arguments): array
+ {
+ self::initialiseHelper(array_slice($arguments, 0, $limit));
+ $trailingArguments = array_slice($arguments, $limit);
+ $arguments = self::$arrayArgumentHelper->arguments();
+ $arguments = array_merge($arguments, $trailingArguments);
+
+ return ArrayArgumentProcessor::processArguments(self::$arrayArgumentHelper, $method, ...$arguments);
+ }
+
+ private static function testFalse(mixed $value): bool
+ {
+ return $value === false;
+ }
+
+ /**
+ * Handles array argument processing when the function accepts multiple arguments,
+ * but only the last few (from start) can be an array arguments.
+ * Example use for:
+ * Z.TEST() or INDEX(), where the first argument 1 is a matrix that needs to be treated as a dataset
+ * rather than as an array argument.
+ */
+ protected static function evaluateArrayArgumentsSubsetFrom(callable $method, int $start, mixed ...$arguments): array
+ {
+ $arrayArgumentsSubset = array_combine(
+ range($start, count($arguments) - $start),
+ array_slice($arguments, $start)
+ );
+ if (self::testFalse($arrayArgumentsSubset)) {
+ return ['#VALUE!'];
+ }
+
+ self::initialiseHelper($arrayArgumentsSubset);
+ $leadingArguments = array_slice($arguments, 0, $start);
+ $arguments = self::$arrayArgumentHelper->arguments();
+ $arguments = array_merge($leadingArguments, $arguments);
+
+ return ArrayArgumentProcessor::processArguments(self::$arrayArgumentHelper, $method, ...$arguments);
+ }
+
+ /**
+ * Handles array argument processing when the function accepts multiple arguments,
+ * and any of them can be an array argument except for the one specified by ignore.
+ * Example use for:
+ * HLOOKUP() and VLOOKUP(), where argument 1 is a matrix that needs to be treated as a database
+ * rather than as an array argument.
+ */
+ protected static function evaluateArrayArgumentsIgnore(callable $method, int $ignore, mixed ...$arguments): array
+ {
+ $leadingArguments = array_slice($arguments, 0, $ignore);
+ $ignoreArgument = array_slice($arguments, $ignore, 1);
+ $trailingArguments = array_slice($arguments, $ignore + 1);
+
+ self::initialiseHelper(array_merge($leadingArguments, [[null]], $trailingArguments));
+ $arguments = self::$arrayArgumentHelper->arguments();
+
+ array_splice($arguments, $ignore, 1, $ignoreArgument);
+
+ return ArrayArgumentProcessor::processArguments(self::$arrayArgumentHelper, $method, ...$arguments);
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/BinaryComparison.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/BinaryComparison.php
new file mode 100644
index 0000000..e4bc156
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/BinaryComparison.php
@@ -0,0 +1,136 @@
+ '' && $operand1[0] == Calculation::FORMULA_STRING_QUOTE) {
+ $operand1 = Calculation::unwrapResult($operand1);
+ }
+ if (is_string($operand2) && $operand2 > '' && $operand2[0] == Calculation::FORMULA_STRING_QUOTE) {
+ $operand2 = Calculation::unwrapResult($operand2);
+ }
+
+ // Use case insensitive comparaison if not OpenOffice mode
+ if (Functions::getCompatibilityMode() != Functions::COMPATIBILITY_OPENOFFICE) {
+ if (is_string($operand1)) {
+ $operand1 = StringHelper::strToUpper($operand1);
+ }
+ if (is_string($operand2)) {
+ $operand2 = StringHelper::strToUpper($operand2);
+ }
+ }
+
+ $useLowercaseFirstComparison = is_string($operand1)
+ && is_string($operand2)
+ && Functions::getCompatibilityMode() === Functions::COMPATIBILITY_OPENOFFICE;
+
+ return self::evaluateComparison($operand1, $operand2, $operator, $useLowercaseFirstComparison);
+ }
+
+ private static function evaluateComparison(mixed $operand1, mixed $operand2, string $operator, bool $useLowercaseFirstComparison): bool
+ {
+ return match ($operator) {
+ '=' => self::equal($operand1, $operand2),
+ '>' => self::greaterThan($operand1, $operand2, $useLowercaseFirstComparison),
+ '<' => self::lessThan($operand1, $operand2, $useLowercaseFirstComparison),
+ '>=' => self::greaterThanOrEqual($operand1, $operand2, $useLowercaseFirstComparison),
+ '<=' => self::lessThanOrEqual($operand1, $operand2, $useLowercaseFirstComparison),
+ '<>' => self::notEqual($operand1, $operand2),
+ default => throw new Exception('Unsupported binary comparison operator'),
+ };
+ }
+
+ private static function equal(mixed $operand1, mixed $operand2): bool
+ {
+ if (is_numeric($operand1) && is_numeric($operand2)) {
+ $result = (abs($operand1 - $operand2) < self::DELTA);
+ } elseif (($operand1 === null && is_numeric($operand2)) || ($operand2 === null && is_numeric($operand1))) {
+ $result = $operand1 == $operand2;
+ } else {
+ $result = self::strcmpAllowNull($operand1, $operand2) == 0;
+ }
+
+ return $result;
+ }
+
+ private static function greaterThanOrEqual(mixed $operand1, mixed $operand2, bool $useLowercaseFirstComparison): bool
+ {
+ if (is_numeric($operand1) && is_numeric($operand2)) {
+ $result = ((abs($operand1 - $operand2) < self::DELTA) || ($operand1 > $operand2));
+ } elseif (($operand1 === null && is_numeric($operand2)) || ($operand2 === null && is_numeric($operand1))) {
+ $result = $operand1 >= $operand2;
+ } elseif ($useLowercaseFirstComparison) {
+ $result = self::strcmpLowercaseFirst($operand1, $operand2) >= 0;
+ } else {
+ $result = self::strcmpAllowNull($operand1, $operand2) >= 0;
+ }
+
+ return $result;
+ }
+
+ private static function lessThanOrEqual(mixed $operand1, mixed $operand2, bool $useLowercaseFirstComparison): bool
+ {
+ if (is_numeric($operand1) && is_numeric($operand2)) {
+ $result = ((abs($operand1 - $operand2) < self::DELTA) || ($operand1 < $operand2));
+ } elseif (($operand1 === null && is_numeric($operand2)) || ($operand2 === null && is_numeric($operand1))) {
+ $result = $operand1 <= $operand2;
+ } elseif ($useLowercaseFirstComparison) {
+ $result = self::strcmpLowercaseFirst($operand1, $operand2) <= 0;
+ } else {
+ $result = self::strcmpAllowNull($operand1, $operand2) <= 0;
+ }
+
+ return $result;
+ }
+
+ private static function greaterThan(mixed $operand1, mixed $operand2, bool $useLowercaseFirstComparison): bool
+ {
+ return self::lessThanOrEqual($operand1, $operand2, $useLowercaseFirstComparison) !== true;
+ }
+
+ private static function lessThan(mixed $operand1, mixed $operand2, bool $useLowercaseFirstComparison): bool
+ {
+ return self::greaterThanOrEqual($operand1, $operand2, $useLowercaseFirstComparison) !== true;
+ }
+
+ private static function notEqual(mixed $operand1, mixed $operand2): bool
+ {
+ return self::equal($operand1, $operand2) !== true;
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Calculation.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Calculation.php
new file mode 100644
index 0000000..6028a9d
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Calculation.php
@@ -0,0 +1,5665 @@
+=:`-]*)|(\'(?:[^\']|\'[^!])+?\')|(\"(?:[^\"]|\"[^!])+?\"))!)?\$?\b([a-z]{1,3})\$?(\d{1,7})(?![\w.])';
+ // Cell reference (with or without a sheet reference) ensuring absolute/relative
+ const CALCULATION_REGEXP_CELLREF_RELATIVE = '((([^\s\(,!&%^\/\*\+<>=:`-]*)|(\'(?:[^\']|\'[^!])+?\')|(\"(?:[^\"]|\"[^!])+?\"))!)?(\$?\b[a-z]{1,3})(\$?\d{1,7})(?![\w.])';
+ const CALCULATION_REGEXP_COLUMN_RANGE = '(((([^\s\(,!&%^\/\*\+<>=:`-]*)|(\'(?:[^\']|\'[^!])+?\')|(\".(?:[^\"]|\"[^!])?\"))!)?(\$?[a-z]{1,3})):(?![.*])';
+ const CALCULATION_REGEXP_ROW_RANGE = '(((([^\s\(,!&%^\/\*\+<>=:`-]*)|(\'(?:[^\']|\'[^!])+?\')|(\"(?:[^\"]|\"[^!])+?\"))!)?(\$?[1-9][0-9]{0,6})):(?![.*])';
+ // Cell reference (with or without a sheet reference) ensuring absolute/relative
+ // Cell ranges ensuring absolute/relative
+ const CALCULATION_REGEXP_COLUMNRANGE_RELATIVE = '(\$?[a-z]{1,3}):(\$?[a-z]{1,3})';
+ const CALCULATION_REGEXP_ROWRANGE_RELATIVE = '(\$?\d{1,7}):(\$?\d{1,7})';
+ // Defined Names: Named Range of cells, or Named Formulae
+ const CALCULATION_REGEXP_DEFINEDNAME = '((([^\s,!&%^\/\*\+<>=-]*)|(\'(?:[^\']|\'[^!])+?\')|(\"(?:[^\"]|\"[^!])+?\"))!)?([_\p{L}][_\p{L}\p{N}\.]*)';
+ // Structured Reference (Fully Qualified and Unqualified)
+ const CALCULATION_REGEXP_STRUCTURED_REFERENCE = '([\p{L}_\\\\][\p{L}\p{N}\._]+)?(\[(?:[^\d\]+-])?)';
+ // Error
+ const CALCULATION_REGEXP_ERROR = '\#[A-Z][A-Z0_\/]*[!\?]?';
+
+ /** constants */
+ const RETURN_ARRAY_AS_ERROR = 'error';
+ const RETURN_ARRAY_AS_VALUE = 'value';
+ const RETURN_ARRAY_AS_ARRAY = 'array';
+
+ const FORMULA_OPEN_FUNCTION_BRACE = '(';
+ const FORMULA_CLOSE_FUNCTION_BRACE = ')';
+ const FORMULA_OPEN_MATRIX_BRACE = '{';
+ const FORMULA_CLOSE_MATRIX_BRACE = '}';
+ const FORMULA_STRING_QUOTE = '"';
+
+ private static string $returnArrayAsType = self::RETURN_ARRAY_AS_VALUE;
+
+ /**
+ * Instance of this class.
+ *
+ * @var ?Calculation
+ */
+ private static ?Calculation $instance = null;
+
+ /**
+ * Instance of the spreadsheet this Calculation Engine is using.
+ */
+ private ?Spreadsheet $spreadsheet;
+
+ /**
+ * Calculation cache.
+ */
+ private array $calculationCache = [];
+
+ /**
+ * Calculation cache enabled.
+ */
+ private bool $calculationCacheEnabled = true;
+
+ private BranchPruner $branchPruner;
+
+ private bool $branchPruningEnabled = true;
+
+ /**
+ * List of operators that can be used within formulae
+ * The true/false value indicates whether it is a binary operator or a unary operator.
+ */
+ private const CALCULATION_OPERATORS = [
+ '+' => true, '-' => true, '*' => true, '/' => true,
+ '^' => true, '&' => true, '%' => false, '~' => false,
+ '>' => true, '<' => true, '=' => true, '>=' => true,
+ '<=' => true, '<>' => true, '∩' => true, '∪' => true,
+ ':' => true,
+ ];
+
+ /**
+ * List of binary operators (those that expect two operands).
+ */
+ private const BINARY_OPERATORS = [
+ '+' => true, '-' => true, '*' => true, '/' => true,
+ '^' => true, '&' => true, '>' => true, '<' => true,
+ '=' => true, '>=' => true, '<=' => true, '<>' => true,
+ '∩' => true, '∪' => true, ':' => true,
+ ];
+
+ /**
+ * The debug log generated by the calculation engine.
+ */
+ private Logger $debugLog;
+
+ private bool $suppressFormulaErrorsNew = false;
+
+ /**
+ * Error message for any error that was raised/thrown by the calculation engine.
+ */
+ public ?string $formulaError = null;
+
+ /**
+ * Reference Helper.
+ */
+ private static ReferenceHelper $referenceHelper;
+
+ /**
+ * An array of the nested cell references accessed by the calculation engine, used for the debug log.
+ */
+ private CyclicReferenceStack $cyclicReferenceStack;
+
+ private array $cellStack = [];
+
+ /**
+ * Current iteration counter for cyclic formulae
+ * If the value is 0 (or less) then cyclic formulae will throw an exception,
+ * otherwise they will iterate to the limit defined here before returning a result.
+ */
+ private int $cyclicFormulaCounter = 1;
+
+ private string $cyclicFormulaCell = '';
+
+ /**
+ * Number of iterations for cyclic formulae.
+ */
+ public int $cyclicFormulaCount = 1;
+
+ /**
+ * The current locale setting.
+ */
+ private static string $localeLanguage = 'en_us'; // US English (default locale)
+
+ /**
+ * List of available locale settings
+ * Note that this is read for the locale subdirectory only when requested.
+ *
+ * @var string[]
+ */
+ private static array $validLocaleLanguages = [
+ 'en', // English (default language)
+ ];
+
+ /**
+ * Locale-specific argument separator for function arguments.
+ */
+ private static string $localeArgumentSeparator = ',';
+
+ private static array $localeFunctions = [];
+
+ /**
+ * Locale-specific translations for Excel constants (True, False and Null).
+ *
+ * @var array
+ */
+ private static array $localeBoolean = [
+ 'TRUE' => 'TRUE',
+ 'FALSE' => 'FALSE',
+ 'NULL' => 'NULL',
+ ];
+
+ public static function getLocaleBoolean(string $index): string
+ {
+ return self::$localeBoolean[$index];
+ }
+
+ /**
+ * Excel constant string translations to their PHP equivalents
+ * Constant conversion from text name/value to actual (datatyped) value.
+ *
+ * @var array
+ */
+ private static array $excelConstants = [
+ 'TRUE' => true,
+ 'FALSE' => false,
+ 'NULL' => null,
+ ];
+
+ public static function keyInExcelConstants(string $key): bool
+ {
+ return array_key_exists($key, self::$excelConstants);
+ }
+
+ public static function getExcelConstants(string $key): bool|null
+ {
+ return self::$excelConstants[$key];
+ }
+
+ /**
+ * Array of functions usable on Spreadsheet.
+ * In theory, this could be const rather than static;
+ * however, Phpstan breaks trying to analyze it when attempted.
+ */
+ private static array $phpSpreadsheetFunctions = [
+ 'ABS' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => [MathTrig\Absolute::class, 'evaluate'],
+ 'argumentCount' => '1',
+ ],
+ 'ACCRINT' => [
+ 'category' => Category::CATEGORY_FINANCIAL,
+ 'functionCall' => [Financial\Securities\AccruedInterest::class, 'periodic'],
+ 'argumentCount' => '4-8',
+ ],
+ 'ACCRINTM' => [
+ 'category' => Category::CATEGORY_FINANCIAL,
+ 'functionCall' => [Financial\Securities\AccruedInterest::class, 'atMaturity'],
+ 'argumentCount' => '3-5',
+ ],
+ 'ACOS' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => [MathTrig\Trig\Cosine::class, 'acos'],
+ 'argumentCount' => '1',
+ ],
+ 'ACOSH' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => [MathTrig\Trig\Cosine::class, 'acosh'],
+ 'argumentCount' => '1',
+ ],
+ 'ACOT' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => [MathTrig\Trig\Cotangent::class, 'acot'],
+ 'argumentCount' => '1',
+ ],
+ 'ACOTH' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => [MathTrig\Trig\Cotangent::class, 'acoth'],
+ 'argumentCount' => '1',
+ ],
+ 'ADDRESS' => [
+ 'category' => Category::CATEGORY_LOOKUP_AND_REFERENCE,
+ 'functionCall' => [LookupRef\Address::class, 'cell'],
+ 'argumentCount' => '2-5',
+ ],
+ 'AGGREGATE' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => [Functions::class, 'DUMMY'],
+ 'argumentCount' => '3+',
+ ],
+ 'AMORDEGRC' => [
+ 'category' => Category::CATEGORY_FINANCIAL,
+ 'functionCall' => [Financial\Amortization::class, 'AMORDEGRC'],
+ 'argumentCount' => '6,7',
+ ],
+ 'AMORLINC' => [
+ 'category' => Category::CATEGORY_FINANCIAL,
+ 'functionCall' => [Financial\Amortization::class, 'AMORLINC'],
+ 'argumentCount' => '6,7',
+ ],
+ 'ANCHORARRAY' => [
+ 'category' => Category::CATEGORY_UNCATEGORISED,
+ 'functionCall' => [Functions::class, 'DUMMY'],
+ 'argumentCount' => '*',
+ ],
+ 'AND' => [
+ 'category' => Category::CATEGORY_LOGICAL,
+ 'functionCall' => [Logical\Operations::class, 'logicalAnd'],
+ 'argumentCount' => '1+',
+ ],
+ 'ARABIC' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => [MathTrig\Arabic::class, 'evaluate'],
+ 'argumentCount' => '1',
+ ],
+ 'AREAS' => [
+ 'category' => Category::CATEGORY_LOOKUP_AND_REFERENCE,
+ 'functionCall' => [Functions::class, 'DUMMY'],
+ 'argumentCount' => '1',
+ ],
+ 'ARRAYTOTEXT' => [
+ 'category' => Category::CATEGORY_TEXT_AND_DATA,
+ 'functionCall' => [TextData\Text::class, 'fromArray'],
+ 'argumentCount' => '1,2',
+ ],
+ 'ASC' => [
+ 'category' => Category::CATEGORY_TEXT_AND_DATA,
+ 'functionCall' => [Functions::class, 'DUMMY'],
+ 'argumentCount' => '1',
+ ],
+ 'ASIN' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => [MathTrig\Trig\Sine::class, 'asin'],
+ 'argumentCount' => '1',
+ ],
+ 'ASINH' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => [MathTrig\Trig\Sine::class, 'asinh'],
+ 'argumentCount' => '1',
+ ],
+ 'ATAN' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => [MathTrig\Trig\Tangent::class, 'atan'],
+ 'argumentCount' => '1',
+ ],
+ 'ATAN2' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => [MathTrig\Trig\Tangent::class, 'atan2'],
+ 'argumentCount' => '2',
+ ],
+ 'ATANH' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => [MathTrig\Trig\Tangent::class, 'atanh'],
+ 'argumentCount' => '1',
+ ],
+ 'AVEDEV' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical\Averages::class, 'averageDeviations'],
+ 'argumentCount' => '1+',
+ ],
+ 'AVERAGE' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical\Averages::class, 'average'],
+ 'argumentCount' => '1+',
+ ],
+ 'AVERAGEA' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical\Averages::class, 'averageA'],
+ 'argumentCount' => '1+',
+ ],
+ 'AVERAGEIF' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical\Conditional::class, 'AVERAGEIF'],
+ 'argumentCount' => '2,3',
+ ],
+ 'AVERAGEIFS' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical\Conditional::class, 'AVERAGEIFS'],
+ 'argumentCount' => '3+',
+ ],
+ 'BAHTTEXT' => [
+ 'category' => Category::CATEGORY_TEXT_AND_DATA,
+ 'functionCall' => [Functions::class, 'DUMMY'],
+ 'argumentCount' => '1',
+ ],
+ 'BASE' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => [MathTrig\Base::class, 'evaluate'],
+ 'argumentCount' => '2,3',
+ ],
+ 'BESSELI' => [
+ 'category' => Category::CATEGORY_ENGINEERING,
+ 'functionCall' => [Engineering\BesselI::class, 'BESSELI'],
+ 'argumentCount' => '2',
+ ],
+ 'BESSELJ' => [
+ 'category' => Category::CATEGORY_ENGINEERING,
+ 'functionCall' => [Engineering\BesselJ::class, 'BESSELJ'],
+ 'argumentCount' => '2',
+ ],
+ 'BESSELK' => [
+ 'category' => Category::CATEGORY_ENGINEERING,
+ 'functionCall' => [Engineering\BesselK::class, 'BESSELK'],
+ 'argumentCount' => '2',
+ ],
+ 'BESSELY' => [
+ 'category' => Category::CATEGORY_ENGINEERING,
+ 'functionCall' => [Engineering\BesselY::class, 'BESSELY'],
+ 'argumentCount' => '2',
+ ],
+ 'BETADIST' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical\Distributions\Beta::class, 'distribution'],
+ 'argumentCount' => '3-5',
+ ],
+ 'BETA.DIST' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Functions::class, 'DUMMY'],
+ 'argumentCount' => '4-6',
+ ],
+ 'BETAINV' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical\Distributions\Beta::class, 'inverse'],
+ 'argumentCount' => '3-5',
+ ],
+ 'BETA.INV' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical\Distributions\Beta::class, 'inverse'],
+ 'argumentCount' => '3-5',
+ ],
+ 'BIN2DEC' => [
+ 'category' => Category::CATEGORY_ENGINEERING,
+ 'functionCall' => [Engineering\ConvertBinary::class, 'toDecimal'],
+ 'argumentCount' => '1',
+ ],
+ 'BIN2HEX' => [
+ 'category' => Category::CATEGORY_ENGINEERING,
+ 'functionCall' => [Engineering\ConvertBinary::class, 'toHex'],
+ 'argumentCount' => '1,2',
+ ],
+ 'BIN2OCT' => [
+ 'category' => Category::CATEGORY_ENGINEERING,
+ 'functionCall' => [Engineering\ConvertBinary::class, 'toOctal'],
+ 'argumentCount' => '1,2',
+ ],
+ 'BINOMDIST' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical\Distributions\Binomial::class, 'distribution'],
+ 'argumentCount' => '4',
+ ],
+ 'BINOM.DIST' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical\Distributions\Binomial::class, 'distribution'],
+ 'argumentCount' => '4',
+ ],
+ 'BINOM.DIST.RANGE' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical\Distributions\Binomial::class, 'range'],
+ 'argumentCount' => '3,4',
+ ],
+ 'BINOM.INV' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical\Distributions\Binomial::class, 'inverse'],
+ 'argumentCount' => '3',
+ ],
+ 'BITAND' => [
+ 'category' => Category::CATEGORY_ENGINEERING,
+ 'functionCall' => [Engineering\BitWise::class, 'BITAND'],
+ 'argumentCount' => '2',
+ ],
+ 'BITOR' => [
+ 'category' => Category::CATEGORY_ENGINEERING,
+ 'functionCall' => [Engineering\BitWise::class, 'BITOR'],
+ 'argumentCount' => '2',
+ ],
+ 'BITXOR' => [
+ 'category' => Category::CATEGORY_ENGINEERING,
+ 'functionCall' => [Engineering\BitWise::class, 'BITXOR'],
+ 'argumentCount' => '2',
+ ],
+ 'BITLSHIFT' => [
+ 'category' => Category::CATEGORY_ENGINEERING,
+ 'functionCall' => [Engineering\BitWise::class, 'BITLSHIFT'],
+ 'argumentCount' => '2',
+ ],
+ 'BITRSHIFT' => [
+ 'category' => Category::CATEGORY_ENGINEERING,
+ 'functionCall' => [Engineering\BitWise::class, 'BITRSHIFT'],
+ 'argumentCount' => '2',
+ ],
+ 'BYCOL' => [
+ 'category' => Category::CATEGORY_LOGICAL,
+ 'functionCall' => [Functions::class, 'DUMMY'],
+ 'argumentCount' => '*',
+ ],
+ 'BYROW' => [
+ 'category' => Category::CATEGORY_LOGICAL,
+ 'functionCall' => [Functions::class, 'DUMMY'],
+ 'argumentCount' => '*',
+ ],
+ 'CEILING' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => [MathTrig\Ceiling::class, 'ceiling'],
+ 'argumentCount' => '1-2', // 2 for Excel, 1-2 for Ods/Gnumeric
+ ],
+ 'CEILING.MATH' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => [MathTrig\Ceiling::class, 'math'],
+ 'argumentCount' => '1-3',
+ ],
+ 'CEILING.PRECISE' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => [MathTrig\Ceiling::class, 'precise'],
+ 'argumentCount' => '1,2',
+ ],
+ 'CELL' => [
+ 'category' => Category::CATEGORY_INFORMATION,
+ 'functionCall' => [Functions::class, 'DUMMY'],
+ 'argumentCount' => '1,2',
+ ],
+ 'CHAR' => [
+ 'category' => Category::CATEGORY_TEXT_AND_DATA,
+ 'functionCall' => [TextData\CharacterConvert::class, 'character'],
+ 'argumentCount' => '1',
+ ],
+ 'CHIDIST' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical\Distributions\ChiSquared::class, 'distributionRightTail'],
+ 'argumentCount' => '2',
+ ],
+ 'CHISQ.DIST' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical\Distributions\ChiSquared::class, 'distributionLeftTail'],
+ 'argumentCount' => '3',
+ ],
+ 'CHISQ.DIST.RT' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical\Distributions\ChiSquared::class, 'distributionRightTail'],
+ 'argumentCount' => '2',
+ ],
+ 'CHIINV' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical\Distributions\ChiSquared::class, 'inverseRightTail'],
+ 'argumentCount' => '2',
+ ],
+ 'CHISQ.INV' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical\Distributions\ChiSquared::class, 'inverseLeftTail'],
+ 'argumentCount' => '2',
+ ],
+ 'CHISQ.INV.RT' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical\Distributions\ChiSquared::class, 'inverseRightTail'],
+ 'argumentCount' => '2',
+ ],
+ 'CHITEST' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical\Distributions\ChiSquared::class, 'test'],
+ 'argumentCount' => '2',
+ ],
+ 'CHISQ.TEST' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical\Distributions\ChiSquared::class, 'test'],
+ 'argumentCount' => '2',
+ ],
+ 'CHOOSE' => [
+ 'category' => Category::CATEGORY_LOOKUP_AND_REFERENCE,
+ 'functionCall' => [LookupRef\Selection::class, 'CHOOSE'],
+ 'argumentCount' => '2+',
+ ],
+ 'CHOOSECOLS' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => [Functions::class, 'DUMMY'],
+ 'argumentCount' => '2+',
+ ],
+ 'CHOOSEROWS' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => [Functions::class, 'DUMMY'],
+ 'argumentCount' => '2+',
+ ],
+ 'CLEAN' => [
+ 'category' => Category::CATEGORY_TEXT_AND_DATA,
+ 'functionCall' => [TextData\Trim::class, 'nonPrintable'],
+ 'argumentCount' => '1',
+ ],
+ 'CODE' => [
+ 'category' => Category::CATEGORY_TEXT_AND_DATA,
+ 'functionCall' => [TextData\CharacterConvert::class, 'code'],
+ 'argumentCount' => '1',
+ ],
+ 'COLUMN' => [
+ 'category' => Category::CATEGORY_LOOKUP_AND_REFERENCE,
+ 'functionCall' => [LookupRef\RowColumnInformation::class, 'COLUMN'],
+ 'argumentCount' => '-1',
+ 'passCellReference' => true,
+ 'passByReference' => [true],
+ ],
+ 'COLUMNS' => [
+ 'category' => Category::CATEGORY_LOOKUP_AND_REFERENCE,
+ 'functionCall' => [LookupRef\RowColumnInformation::class, 'COLUMNS'],
+ 'argumentCount' => '1',
+ ],
+ 'COMBIN' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => [MathTrig\Combinations::class, 'withoutRepetition'],
+ 'argumentCount' => '2',
+ ],
+ 'COMBINA' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => [MathTrig\Combinations::class, 'withRepetition'],
+ 'argumentCount' => '2',
+ ],
+ 'COMPLEX' => [
+ 'category' => Category::CATEGORY_ENGINEERING,
+ 'functionCall' => [Engineering\Complex::class, 'COMPLEX'],
+ 'argumentCount' => '2,3',
+ ],
+ 'CONCAT' => [
+ 'category' => Category::CATEGORY_TEXT_AND_DATA,
+ 'functionCall' => [TextData\Concatenate::class, 'CONCATENATE'],
+ 'argumentCount' => '1+',
+ ],
+ 'CONCATENATE' => [
+ 'category' => Category::CATEGORY_TEXT_AND_DATA,
+ 'functionCall' => [TextData\Concatenate::class, 'CONCATENATE'],
+ 'argumentCount' => '1+',
+ ],
+ 'CONFIDENCE' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical\Confidence::class, 'CONFIDENCE'],
+ 'argumentCount' => '3',
+ ],
+ 'CONFIDENCE.NORM' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical\Confidence::class, 'CONFIDENCE'],
+ 'argumentCount' => '3',
+ ],
+ 'CONFIDENCE.T' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Functions::class, 'DUMMY'],
+ 'argumentCount' => '3',
+ ],
+ 'CONVERT' => [
+ 'category' => Category::CATEGORY_ENGINEERING,
+ 'functionCall' => [Engineering\ConvertUOM::class, 'CONVERT'],
+ 'argumentCount' => '3',
+ ],
+ 'CORREL' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical\Trends::class, 'CORREL'],
+ 'argumentCount' => '2',
+ ],
+ 'COS' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => [MathTrig\Trig\Cosine::class, 'cos'],
+ 'argumentCount' => '1',
+ ],
+ 'COSH' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => [MathTrig\Trig\Cosine::class, 'cosh'],
+ 'argumentCount' => '1',
+ ],
+ 'COT' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => [MathTrig\Trig\Cotangent::class, 'cot'],
+ 'argumentCount' => '1',
+ ],
+ 'COTH' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => [MathTrig\Trig\Cotangent::class, 'coth'],
+ 'argumentCount' => '1',
+ ],
+ 'COUNT' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical\Counts::class, 'COUNT'],
+ 'argumentCount' => '1+',
+ ],
+ 'COUNTA' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical\Counts::class, 'COUNTA'],
+ 'argumentCount' => '1+',
+ ],
+ 'COUNTBLANK' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical\Counts::class, 'COUNTBLANK'],
+ 'argumentCount' => '1',
+ ],
+ 'COUNTIF' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical\Conditional::class, 'COUNTIF'],
+ 'argumentCount' => '2',
+ ],
+ 'COUNTIFS' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical\Conditional::class, 'COUNTIFS'],
+ 'argumentCount' => '2+',
+ ],
+ 'COUPDAYBS' => [
+ 'category' => Category::CATEGORY_FINANCIAL,
+ 'functionCall' => [Financial\Coupons::class, 'COUPDAYBS'],
+ 'argumentCount' => '3,4',
+ ],
+ 'COUPDAYS' => [
+ 'category' => Category::CATEGORY_FINANCIAL,
+ 'functionCall' => [Financial\Coupons::class, 'COUPDAYS'],
+ 'argumentCount' => '3,4',
+ ],
+ 'COUPDAYSNC' => [
+ 'category' => Category::CATEGORY_FINANCIAL,
+ 'functionCall' => [Financial\Coupons::class, 'COUPDAYSNC'],
+ 'argumentCount' => '3,4',
+ ],
+ 'COUPNCD' => [
+ 'category' => Category::CATEGORY_FINANCIAL,
+ 'functionCall' => [Financial\Coupons::class, 'COUPNCD'],
+ 'argumentCount' => '3,4',
+ ],
+ 'COUPNUM' => [
+ 'category' => Category::CATEGORY_FINANCIAL,
+ 'functionCall' => [Financial\Coupons::class, 'COUPNUM'],
+ 'argumentCount' => '3,4',
+ ],
+ 'COUPPCD' => [
+ 'category' => Category::CATEGORY_FINANCIAL,
+ 'functionCall' => [Financial\Coupons::class, 'COUPPCD'],
+ 'argumentCount' => '3,4',
+ ],
+ 'COVAR' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical\Trends::class, 'COVAR'],
+ 'argumentCount' => '2',
+ ],
+ 'COVARIANCE.P' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical\Trends::class, 'COVAR'],
+ 'argumentCount' => '2',
+ ],
+ 'COVARIANCE.S' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Functions::class, 'DUMMY'],
+ 'argumentCount' => '2',
+ ],
+ 'CRITBINOM' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical\Distributions\Binomial::class, 'inverse'],
+ 'argumentCount' => '3',
+ ],
+ 'CSC' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => [MathTrig\Trig\Cosecant::class, 'csc'],
+ 'argumentCount' => '1',
+ ],
+ 'CSCH' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => [MathTrig\Trig\Cosecant::class, 'csch'],
+ 'argumentCount' => '1',
+ ],
+ 'CUBEKPIMEMBER' => [
+ 'category' => Category::CATEGORY_CUBE,
+ 'functionCall' => [Functions::class, 'DUMMY'],
+ 'argumentCount' => '?',
+ ],
+ 'CUBEMEMBER' => [
+ 'category' => Category::CATEGORY_CUBE,
+ 'functionCall' => [Functions::class, 'DUMMY'],
+ 'argumentCount' => '?',
+ ],
+ 'CUBEMEMBERPROPERTY' => [
+ 'category' => Category::CATEGORY_CUBE,
+ 'functionCall' => [Functions::class, 'DUMMY'],
+ 'argumentCount' => '?',
+ ],
+ 'CUBERANKEDMEMBER' => [
+ 'category' => Category::CATEGORY_CUBE,
+ 'functionCall' => [Functions::class, 'DUMMY'],
+ 'argumentCount' => '?',
+ ],
+ 'CUBESET' => [
+ 'category' => Category::CATEGORY_CUBE,
+ 'functionCall' => [Functions::class, 'DUMMY'],
+ 'argumentCount' => '?',
+ ],
+ 'CUBESETCOUNT' => [
+ 'category' => Category::CATEGORY_CUBE,
+ 'functionCall' => [Functions::class, 'DUMMY'],
+ 'argumentCount' => '?',
+ ],
+ 'CUBEVALUE' => [
+ 'category' => Category::CATEGORY_CUBE,
+ 'functionCall' => [Functions::class, 'DUMMY'],
+ 'argumentCount' => '?',
+ ],
+ 'CUMIPMT' => [
+ 'category' => Category::CATEGORY_FINANCIAL,
+ 'functionCall' => [Financial\CashFlow\Constant\Periodic\Cumulative::class, 'interest'],
+ 'argumentCount' => '6',
+ ],
+ 'CUMPRINC' => [
+ 'category' => Category::CATEGORY_FINANCIAL,
+ 'functionCall' => [Financial\CashFlow\Constant\Periodic\Cumulative::class, 'principal'],
+ 'argumentCount' => '6',
+ ],
+ 'DATE' => [
+ 'category' => Category::CATEGORY_DATE_AND_TIME,
+ 'functionCall' => [DateTimeExcel\Date::class, 'fromYMD'],
+ 'argumentCount' => '3',
+ ],
+ 'DATEDIF' => [
+ 'category' => Category::CATEGORY_DATE_AND_TIME,
+ 'functionCall' => [DateTimeExcel\Difference::class, 'interval'],
+ 'argumentCount' => '2,3',
+ ],
+ 'DATESTRING' => [
+ 'category' => Category::CATEGORY_DATE_AND_TIME,
+ 'functionCall' => [Functions::class, 'DUMMY'],
+ 'argumentCount' => '?',
+ ],
+ 'DATEVALUE' => [
+ 'category' => Category::CATEGORY_DATE_AND_TIME,
+ 'functionCall' => [DateTimeExcel\DateValue::class, 'fromString'],
+ 'argumentCount' => '1',
+ ],
+ 'DAVERAGE' => [
+ 'category' => Category::CATEGORY_DATABASE,
+ 'functionCall' => [Database\DAverage::class, 'evaluate'],
+ 'argumentCount' => '3',
+ ],
+ 'DAY' => [
+ 'category' => Category::CATEGORY_DATE_AND_TIME,
+ 'functionCall' => [DateTimeExcel\DateParts::class, 'day'],
+ 'argumentCount' => '1',
+ ],
+ 'DAYS' => [
+ 'category' => Category::CATEGORY_DATE_AND_TIME,
+ 'functionCall' => [DateTimeExcel\Days::class, 'between'],
+ 'argumentCount' => '2',
+ ],
+ 'DAYS360' => [
+ 'category' => Category::CATEGORY_DATE_AND_TIME,
+ 'functionCall' => [DateTimeExcel\Days360::class, 'between'],
+ 'argumentCount' => '2,3',
+ ],
+ 'DB' => [
+ 'category' => Category::CATEGORY_FINANCIAL,
+ 'functionCall' => [Financial\Depreciation::class, 'DB'],
+ 'argumentCount' => '4,5',
+ ],
+ 'DBCS' => [
+ 'category' => Category::CATEGORY_TEXT_AND_DATA,
+ 'functionCall' => [Functions::class, 'DUMMY'],
+ 'argumentCount' => '1',
+ ],
+ 'DCOUNT' => [
+ 'category' => Category::CATEGORY_DATABASE,
+ 'functionCall' => [Database\DCount::class, 'evaluate'],
+ 'argumentCount' => '3',
+ ],
+ 'DCOUNTA' => [
+ 'category' => Category::CATEGORY_DATABASE,
+ 'functionCall' => [Database\DCountA::class, 'evaluate'],
+ 'argumentCount' => '3',
+ ],
+ 'DDB' => [
+ 'category' => Category::CATEGORY_FINANCIAL,
+ 'functionCall' => [Financial\Depreciation::class, 'DDB'],
+ 'argumentCount' => '4,5',
+ ],
+ 'DEC2BIN' => [
+ 'category' => Category::CATEGORY_ENGINEERING,
+ 'functionCall' => [Engineering\ConvertDecimal::class, 'toBinary'],
+ 'argumentCount' => '1,2',
+ ],
+ 'DEC2HEX' => [
+ 'category' => Category::CATEGORY_ENGINEERING,
+ 'functionCall' => [Engineering\ConvertDecimal::class, 'toHex'],
+ 'argumentCount' => '1,2',
+ ],
+ 'DEC2OCT' => [
+ 'category' => Category::CATEGORY_ENGINEERING,
+ 'functionCall' => [Engineering\ConvertDecimal::class, 'toOctal'],
+ 'argumentCount' => '1,2',
+ ],
+ 'DECIMAL' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => [Functions::class, 'DUMMY'],
+ 'argumentCount' => '2',
+ ],
+ 'DEGREES' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => [MathTrig\Angle::class, 'toDegrees'],
+ 'argumentCount' => '1',
+ ],
+ 'DELTA' => [
+ 'category' => Category::CATEGORY_ENGINEERING,
+ 'functionCall' => [Engineering\Compare::class, 'DELTA'],
+ 'argumentCount' => '1,2',
+ ],
+ 'DEVSQ' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical\Deviations::class, 'sumSquares'],
+ 'argumentCount' => '1+',
+ ],
+ 'DGET' => [
+ 'category' => Category::CATEGORY_DATABASE,
+ 'functionCall' => [Database\DGet::class, 'evaluate'],
+ 'argumentCount' => '3',
+ ],
+ 'DISC' => [
+ 'category' => Category::CATEGORY_FINANCIAL,
+ 'functionCall' => [Financial\Securities\Rates::class, 'discount'],
+ 'argumentCount' => '4,5',
+ ],
+ 'DMAX' => [
+ 'category' => Category::CATEGORY_DATABASE,
+ 'functionCall' => [Database\DMax::class, 'evaluate'],
+ 'argumentCount' => '3',
+ ],
+ 'DMIN' => [
+ 'category' => Category::CATEGORY_DATABASE,
+ 'functionCall' => [Database\DMin::class, 'evaluate'],
+ 'argumentCount' => '3',
+ ],
+ 'DOLLAR' => [
+ 'category' => Category::CATEGORY_TEXT_AND_DATA,
+ 'functionCall' => [TextData\Format::class, 'DOLLAR'],
+ 'argumentCount' => '1,2',
+ ],
+ 'DOLLARDE' => [
+ 'category' => Category::CATEGORY_FINANCIAL,
+ 'functionCall' => [Financial\Dollar::class, 'decimal'],
+ 'argumentCount' => '2',
+ ],
+ 'DOLLARFR' => [
+ 'category' => Category::CATEGORY_FINANCIAL,
+ 'functionCall' => [Financial\Dollar::class, 'fractional'],
+ 'argumentCount' => '2',
+ ],
+ 'DPRODUCT' => [
+ 'category' => Category::CATEGORY_DATABASE,
+ 'functionCall' => [Database\DProduct::class, 'evaluate'],
+ 'argumentCount' => '3',
+ ],
+ 'DROP' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => [Functions::class, 'DUMMY'],
+ 'argumentCount' => '2-3',
+ ],
+ 'DSTDEV' => [
+ 'category' => Category::CATEGORY_DATABASE,
+ 'functionCall' => [Database\DStDev::class, 'evaluate'],
+ 'argumentCount' => '3',
+ ],
+ 'DSTDEVP' => [
+ 'category' => Category::CATEGORY_DATABASE,
+ 'functionCall' => [Database\DStDevP::class, 'evaluate'],
+ 'argumentCount' => '3',
+ ],
+ 'DSUM' => [
+ 'category' => Category::CATEGORY_DATABASE,
+ 'functionCall' => [Database\DSum::class, 'evaluate'],
+ 'argumentCount' => '3',
+ ],
+ 'DURATION' => [
+ 'category' => Category::CATEGORY_FINANCIAL,
+ 'functionCall' => [Functions::class, 'DUMMY'],
+ 'argumentCount' => '5,6',
+ ],
+ 'DVAR' => [
+ 'category' => Category::CATEGORY_DATABASE,
+ 'functionCall' => [Database\DVar::class, 'evaluate'],
+ 'argumentCount' => '3',
+ ],
+ 'DVARP' => [
+ 'category' => Category::CATEGORY_DATABASE,
+ 'functionCall' => [Database\DVarP::class, 'evaluate'],
+ 'argumentCount' => '3',
+ ],
+ 'ECMA.CEILING' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => [Functions::class, 'DUMMY'],
+ 'argumentCount' => '1,2',
+ ],
+ 'EDATE' => [
+ 'category' => Category::CATEGORY_DATE_AND_TIME,
+ 'functionCall' => [DateTimeExcel\Month::class, 'adjust'],
+ 'argumentCount' => '2',
+ ],
+ 'EFFECT' => [
+ 'category' => Category::CATEGORY_FINANCIAL,
+ 'functionCall' => [Financial\InterestRate::class, 'effective'],
+ 'argumentCount' => '2',
+ ],
+ 'ENCODEURL' => [
+ 'category' => Category::CATEGORY_WEB,
+ 'functionCall' => [Web\Service::class, 'urlEncode'],
+ 'argumentCount' => '1',
+ ],
+ 'EOMONTH' => [
+ 'category' => Category::CATEGORY_DATE_AND_TIME,
+ 'functionCall' => [DateTimeExcel\Month::class, 'lastDay'],
+ 'argumentCount' => '2',
+ ],
+ 'ERF' => [
+ 'category' => Category::CATEGORY_ENGINEERING,
+ 'functionCall' => [Engineering\Erf::class, 'ERF'],
+ 'argumentCount' => '1,2',
+ ],
+ 'ERF.PRECISE' => [
+ 'category' => Category::CATEGORY_ENGINEERING,
+ 'functionCall' => [Engineering\Erf::class, 'ERFPRECISE'],
+ 'argumentCount' => '1',
+ ],
+ 'ERFC' => [
+ 'category' => Category::CATEGORY_ENGINEERING,
+ 'functionCall' => [Engineering\ErfC::class, 'ERFC'],
+ 'argumentCount' => '1',
+ ],
+ 'ERFC.PRECISE' => [
+ 'category' => Category::CATEGORY_ENGINEERING,
+ 'functionCall' => [Engineering\ErfC::class, 'ERFC'],
+ 'argumentCount' => '1',
+ ],
+ 'ERROR.TYPE' => [
+ 'category' => Category::CATEGORY_INFORMATION,
+ 'functionCall' => [ExcelError::class, 'type'],
+ 'argumentCount' => '1',
+ ],
+ 'EVEN' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => [MathTrig\Round::class, 'even'],
+ 'argumentCount' => '1',
+ ],
+ 'EXACT' => [
+ 'category' => Category::CATEGORY_TEXT_AND_DATA,
+ 'functionCall' => [TextData\Text::class, 'exact'],
+ 'argumentCount' => '2',
+ ],
+ 'EXP' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => [MathTrig\Exp::class, 'evaluate'],
+ 'argumentCount' => '1',
+ ],
+ 'EXPAND' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => [Functions::class, 'DUMMY'],
+ 'argumentCount' => '2-4',
+ ],
+ 'EXPONDIST' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical\Distributions\Exponential::class, 'distribution'],
+ 'argumentCount' => '3',
+ ],
+ 'EXPON.DIST' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical\Distributions\Exponential::class, 'distribution'],
+ 'argumentCount' => '3',
+ ],
+ 'FACT' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => [MathTrig\Factorial::class, 'fact'],
+ 'argumentCount' => '1',
+ ],
+ 'FACTDOUBLE' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => [MathTrig\Factorial::class, 'factDouble'],
+ 'argumentCount' => '1',
+ ],
+ 'FALSE' => [
+ 'category' => Category::CATEGORY_LOGICAL,
+ 'functionCall' => [Logical\Boolean::class, 'FALSE'],
+ 'argumentCount' => '0',
+ ],
+ 'FDIST' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Functions::class, 'DUMMY'],
+ 'argumentCount' => '3',
+ ],
+ 'F.DIST' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical\Distributions\F::class, 'distribution'],
+ 'argumentCount' => '4',
+ ],
+ 'F.DIST.RT' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Functions::class, 'DUMMY'],
+ 'argumentCount' => '3',
+ ],
+ 'FILTER' => [
+ 'category' => Category::CATEGORY_LOOKUP_AND_REFERENCE,
+ 'functionCall' => [LookupRef\Filter::class, 'filter'],
+ 'argumentCount' => '2-3',
+ ],
+ 'FILTERXML' => [
+ 'category' => Category::CATEGORY_WEB,
+ 'functionCall' => [Functions::class, 'DUMMY'],
+ 'argumentCount' => '2',
+ ],
+ 'FIND' => [
+ 'category' => Category::CATEGORY_TEXT_AND_DATA,
+ 'functionCall' => [TextData\Search::class, 'sensitive'],
+ 'argumentCount' => '2,3',
+ ],
+ 'FINDB' => [
+ 'category' => Category::CATEGORY_TEXT_AND_DATA,
+ 'functionCall' => [TextData\Search::class, 'sensitive'],
+ 'argumentCount' => '2,3',
+ ],
+ 'FINV' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Functions::class, 'DUMMY'],
+ 'argumentCount' => '3',
+ ],
+ 'F.INV' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Functions::class, 'DUMMY'],
+ 'argumentCount' => '3',
+ ],
+ 'F.INV.RT' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Functions::class, 'DUMMY'],
+ 'argumentCount' => '3',
+ ],
+ 'FISHER' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical\Distributions\Fisher::class, 'distribution'],
+ 'argumentCount' => '1',
+ ],
+ 'FISHERINV' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical\Distributions\Fisher::class, 'inverse'],
+ 'argumentCount' => '1',
+ ],
+ 'FIXED' => [
+ 'category' => Category::CATEGORY_TEXT_AND_DATA,
+ 'functionCall' => [TextData\Format::class, 'FIXEDFORMAT'],
+ 'argumentCount' => '1-3',
+ ],
+ 'FLOOR' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => [MathTrig\Floor::class, 'floor'],
+ 'argumentCount' => '1-2', // Excel requries 2, Ods/Gnumeric 1-2
+ ],
+ 'FLOOR.MATH' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => [MathTrig\Floor::class, 'math'],
+ 'argumentCount' => '1-3',
+ ],
+ 'FLOOR.PRECISE' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => [MathTrig\Floor::class, 'precise'],
+ 'argumentCount' => '1-2',
+ ],
+ 'FORECAST' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical\Trends::class, 'FORECAST'],
+ 'argumentCount' => '3',
+ ],
+ 'FORECAST.ETS' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Functions::class, 'DUMMY'],
+ 'argumentCount' => '3-6',
+ ],
+ 'FORECAST.ETS.CONFINT' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Functions::class, 'DUMMY'],
+ 'argumentCount' => '3-6',
+ ],
+ 'FORECAST.ETS.SEASONALITY' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Functions::class, 'DUMMY'],
+ 'argumentCount' => '2-4',
+ ],
+ 'FORECAST.ETS.STAT' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Functions::class, 'DUMMY'],
+ 'argumentCount' => '3-6',
+ ],
+ 'FORECAST.LINEAR' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical\Trends::class, 'FORECAST'],
+ 'argumentCount' => '3',
+ ],
+ 'FORMULATEXT' => [
+ 'category' => Category::CATEGORY_LOOKUP_AND_REFERENCE,
+ 'functionCall' => [LookupRef\Formula::class, 'text'],
+ 'argumentCount' => '1',
+ 'passCellReference' => true,
+ 'passByReference' => [true],
+ ],
+ 'FREQUENCY' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Functions::class, 'DUMMY'],
+ 'argumentCount' => '2',
+ ],
+ 'FTEST' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Functions::class, 'DUMMY'],
+ 'argumentCount' => '2',
+ ],
+ 'F.TEST' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Functions::class, 'DUMMY'],
+ 'argumentCount' => '2',
+ ],
+ 'FV' => [
+ 'category' => Category::CATEGORY_FINANCIAL,
+ 'functionCall' => [Financial\CashFlow\Constant\Periodic::class, 'futureValue'],
+ 'argumentCount' => '3-5',
+ ],
+ 'FVSCHEDULE' => [
+ 'category' => Category::CATEGORY_FINANCIAL,
+ 'functionCall' => [Financial\CashFlow\Single::class, 'futureValue'],
+ 'argumentCount' => '2',
+ ],
+ 'GAMMA' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical\Distributions\Gamma::class, 'gamma'],
+ 'argumentCount' => '1',
+ ],
+ 'GAMMADIST' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical\Distributions\Gamma::class, 'distribution'],
+ 'argumentCount' => '4',
+ ],
+ 'GAMMA.DIST' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical\Distributions\Gamma::class, 'distribution'],
+ 'argumentCount' => '4',
+ ],
+ 'GAMMAINV' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical\Distributions\Gamma::class, 'inverse'],
+ 'argumentCount' => '3',
+ ],
+ 'GAMMA.INV' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical\Distributions\Gamma::class, 'inverse'],
+ 'argumentCount' => '3',
+ ],
+ 'GAMMALN' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical\Distributions\Gamma::class, 'ln'],
+ 'argumentCount' => '1',
+ ],
+ 'GAMMALN.PRECISE' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical\Distributions\Gamma::class, 'ln'],
+ 'argumentCount' => '1',
+ ],
+ 'GAUSS' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical\Distributions\StandardNormal::class, 'gauss'],
+ 'argumentCount' => '1',
+ ],
+ 'GCD' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => [MathTrig\Gcd::class, 'evaluate'],
+ 'argumentCount' => '1+',
+ ],
+ 'GEOMEAN' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical\Averages\Mean::class, 'geometric'],
+ 'argumentCount' => '1+',
+ ],
+ 'GESTEP' => [
+ 'category' => Category::CATEGORY_ENGINEERING,
+ 'functionCall' => [Engineering\Compare::class, 'GESTEP'],
+ 'argumentCount' => '1,2',
+ ],
+ 'GETPIVOTDATA' => [
+ 'category' => Category::CATEGORY_LOOKUP_AND_REFERENCE,
+ 'functionCall' => [Functions::class, 'DUMMY'],
+ 'argumentCount' => '2+',
+ ],
+ 'GROWTH' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical\Trends::class, 'GROWTH'],
+ 'argumentCount' => '1-4',
+ ],
+ 'HARMEAN' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical\Averages\Mean::class, 'harmonic'],
+ 'argumentCount' => '1+',
+ ],
+ 'HEX2BIN' => [
+ 'category' => Category::CATEGORY_ENGINEERING,
+ 'functionCall' => [Engineering\ConvertHex::class, 'toBinary'],
+ 'argumentCount' => '1,2',
+ ],
+ 'HEX2DEC' => [
+ 'category' => Category::CATEGORY_ENGINEERING,
+ 'functionCall' => [Engineering\ConvertHex::class, 'toDecimal'],
+ 'argumentCount' => '1',
+ ],
+ 'HEX2OCT' => [
+ 'category' => Category::CATEGORY_ENGINEERING,
+ 'functionCall' => [Engineering\ConvertHex::class, 'toOctal'],
+ 'argumentCount' => '1,2',
+ ],
+ 'HLOOKUP' => [
+ 'category' => Category::CATEGORY_LOOKUP_AND_REFERENCE,
+ 'functionCall' => [LookupRef\HLookup::class, 'lookup'],
+ 'argumentCount' => '3,4',
+ ],
+ 'HOUR' => [
+ 'category' => Category::CATEGORY_DATE_AND_TIME,
+ 'functionCall' => [DateTimeExcel\TimeParts::class, 'hour'],
+ 'argumentCount' => '1',
+ ],
+ 'HSTACK' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => [Functions::class, 'DUMMY'],
+ 'argumentCount' => '1+',
+ ],
+ 'HYPERLINK' => [
+ 'category' => Category::CATEGORY_LOOKUP_AND_REFERENCE,
+ 'functionCall' => [LookupRef\Hyperlink::class, 'set'],
+ 'argumentCount' => '1,2',
+ 'passCellReference' => true,
+ ],
+ 'HYPGEOMDIST' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical\Distributions\HyperGeometric::class, 'distribution'],
+ 'argumentCount' => '4',
+ ],
+ 'HYPGEOM.DIST' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Functions::class, 'DUMMY'],
+ 'argumentCount' => '5',
+ ],
+ 'IF' => [
+ 'category' => Category::CATEGORY_LOGICAL,
+ 'functionCall' => [Logical\Conditional::class, 'statementIf'],
+ 'argumentCount' => '2-3',
+ ],
+ 'IFERROR' => [
+ 'category' => Category::CATEGORY_LOGICAL,
+ 'functionCall' => [Logical\Conditional::class, 'IFERROR'],
+ 'argumentCount' => '2',
+ ],
+ 'IFNA' => [
+ 'category' => Category::CATEGORY_LOGICAL,
+ 'functionCall' => [Logical\Conditional::class, 'IFNA'],
+ 'argumentCount' => '2',
+ ],
+ 'IFS' => [
+ 'category' => Category::CATEGORY_LOGICAL,
+ 'functionCall' => [Logical\Conditional::class, 'IFS'],
+ 'argumentCount' => '2+',
+ ],
+ 'IMABS' => [
+ 'category' => Category::CATEGORY_ENGINEERING,
+ 'functionCall' => [Engineering\ComplexFunctions::class, 'IMABS'],
+ 'argumentCount' => '1',
+ ],
+ 'IMAGINARY' => [
+ 'category' => Category::CATEGORY_ENGINEERING,
+ 'functionCall' => [Engineering\Complex::class, 'IMAGINARY'],
+ 'argumentCount' => '1',
+ ],
+ 'IMARGUMENT' => [
+ 'category' => Category::CATEGORY_ENGINEERING,
+ 'functionCall' => [Engineering\ComplexFunctions::class, 'IMARGUMENT'],
+ 'argumentCount' => '1',
+ ],
+ 'IMCONJUGATE' => [
+ 'category' => Category::CATEGORY_ENGINEERING,
+ 'functionCall' => [Engineering\ComplexFunctions::class, 'IMCONJUGATE'],
+ 'argumentCount' => '1',
+ ],
+ 'IMCOS' => [
+ 'category' => Category::CATEGORY_ENGINEERING,
+ 'functionCall' => [Engineering\ComplexFunctions::class, 'IMCOS'],
+ 'argumentCount' => '1',
+ ],
+ 'IMCOSH' => [
+ 'category' => Category::CATEGORY_ENGINEERING,
+ 'functionCall' => [Engineering\ComplexFunctions::class, 'IMCOSH'],
+ 'argumentCount' => '1',
+ ],
+ 'IMCOT' => [
+ 'category' => Category::CATEGORY_ENGINEERING,
+ 'functionCall' => [Engineering\ComplexFunctions::class, 'IMCOT'],
+ 'argumentCount' => '1',
+ ],
+ 'IMCSC' => [
+ 'category' => Category::CATEGORY_ENGINEERING,
+ 'functionCall' => [Engineering\ComplexFunctions::class, 'IMCSC'],
+ 'argumentCount' => '1',
+ ],
+ 'IMCSCH' => [
+ 'category' => Category::CATEGORY_ENGINEERING,
+ 'functionCall' => [Engineering\ComplexFunctions::class, 'IMCSCH'],
+ 'argumentCount' => '1',
+ ],
+ 'IMDIV' => [
+ 'category' => Category::CATEGORY_ENGINEERING,
+ 'functionCall' => [Engineering\ComplexOperations::class, 'IMDIV'],
+ 'argumentCount' => '2',
+ ],
+ 'IMEXP' => [
+ 'category' => Category::CATEGORY_ENGINEERING,
+ 'functionCall' => [Engineering\ComplexFunctions::class, 'IMEXP'],
+ 'argumentCount' => '1',
+ ],
+ 'IMLN' => [
+ 'category' => Category::CATEGORY_ENGINEERING,
+ 'functionCall' => [Engineering\ComplexFunctions::class, 'IMLN'],
+ 'argumentCount' => '1',
+ ],
+ 'IMLOG10' => [
+ 'category' => Category::CATEGORY_ENGINEERING,
+ 'functionCall' => [Engineering\ComplexFunctions::class, 'IMLOG10'],
+ 'argumentCount' => '1',
+ ],
+ 'IMLOG2' => [
+ 'category' => Category::CATEGORY_ENGINEERING,
+ 'functionCall' => [Engineering\ComplexFunctions::class, 'IMLOG2'],
+ 'argumentCount' => '1',
+ ],
+ 'IMPOWER' => [
+ 'category' => Category::CATEGORY_ENGINEERING,
+ 'functionCall' => [Engineering\ComplexFunctions::class, 'IMPOWER'],
+ 'argumentCount' => '2',
+ ],
+ 'IMPRODUCT' => [
+ 'category' => Category::CATEGORY_ENGINEERING,
+ 'functionCall' => [Engineering\ComplexOperations::class, 'IMPRODUCT'],
+ 'argumentCount' => '1+',
+ ],
+ 'IMREAL' => [
+ 'category' => Category::CATEGORY_ENGINEERING,
+ 'functionCall' => [Engineering\Complex::class, 'IMREAL'],
+ 'argumentCount' => '1',
+ ],
+ 'IMSEC' => [
+ 'category' => Category::CATEGORY_ENGINEERING,
+ 'functionCall' => [Engineering\ComplexFunctions::class, 'IMSEC'],
+ 'argumentCount' => '1',
+ ],
+ 'IMSECH' => [
+ 'category' => Category::CATEGORY_ENGINEERING,
+ 'functionCall' => [Engineering\ComplexFunctions::class, 'IMSECH'],
+ 'argumentCount' => '1',
+ ],
+ 'IMSIN' => [
+ 'category' => Category::CATEGORY_ENGINEERING,
+ 'functionCall' => [Engineering\ComplexFunctions::class, 'IMSIN'],
+ 'argumentCount' => '1',
+ ],
+ 'IMSINH' => [
+ 'category' => Category::CATEGORY_ENGINEERING,
+ 'functionCall' => [Engineering\ComplexFunctions::class, 'IMSINH'],
+ 'argumentCount' => '1',
+ ],
+ 'IMSQRT' => [
+ 'category' => Category::CATEGORY_ENGINEERING,
+ 'functionCall' => [Engineering\ComplexFunctions::class, 'IMSQRT'],
+ 'argumentCount' => '1',
+ ],
+ 'IMSUB' => [
+ 'category' => Category::CATEGORY_ENGINEERING,
+ 'functionCall' => [Engineering\ComplexOperations::class, 'IMSUB'],
+ 'argumentCount' => '2',
+ ],
+ 'IMSUM' => [
+ 'category' => Category::CATEGORY_ENGINEERING,
+ 'functionCall' => [Engineering\ComplexOperations::class, 'IMSUM'],
+ 'argumentCount' => '1+',
+ ],
+ 'IMTAN' => [
+ 'category' => Category::CATEGORY_ENGINEERING,
+ 'functionCall' => [Engineering\ComplexFunctions::class, 'IMTAN'],
+ 'argumentCount' => '1',
+ ],
+ 'INDEX' => [
+ 'category' => Category::CATEGORY_LOOKUP_AND_REFERENCE,
+ 'functionCall' => [LookupRef\Matrix::class, 'index'],
+ 'argumentCount' => '2-4',
+ ],
+ 'INDIRECT' => [
+ 'category' => Category::CATEGORY_LOOKUP_AND_REFERENCE,
+ 'functionCall' => [LookupRef\Indirect::class, 'INDIRECT'],
+ 'argumentCount' => '1,2',
+ 'passCellReference' => true,
+ ],
+ 'INFO' => [
+ 'category' => Category::CATEGORY_INFORMATION,
+ 'functionCall' => [Functions::class, 'DUMMY'],
+ 'argumentCount' => '1',
+ ],
+ 'INT' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => [MathTrig\IntClass::class, 'evaluate'],
+ 'argumentCount' => '1',
+ ],
+ 'INTERCEPT' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical\Trends::class, 'INTERCEPT'],
+ 'argumentCount' => '2',
+ ],
+ 'INTRATE' => [
+ 'category' => Category::CATEGORY_FINANCIAL,
+ 'functionCall' => [Financial\Securities\Rates::class, 'interest'],
+ 'argumentCount' => '4,5',
+ ],
+ 'IPMT' => [
+ 'category' => Category::CATEGORY_FINANCIAL,
+ 'functionCall' => [Financial\CashFlow\Constant\Periodic\Interest::class, 'payment'],
+ 'argumentCount' => '4-6',
+ ],
+ 'IRR' => [
+ 'category' => Category::CATEGORY_FINANCIAL,
+ 'functionCall' => [Financial\CashFlow\Variable\Periodic::class, 'rate'],
+ 'argumentCount' => '1,2',
+ ],
+ 'ISBLANK' => [
+ 'category' => Category::CATEGORY_INFORMATION,
+ 'functionCall' => [Information\Value::class, 'isBlank'],
+ 'argumentCount' => '1',
+ ],
+ 'ISERR' => [
+ 'category' => Category::CATEGORY_INFORMATION,
+ 'functionCall' => [Information\ErrorValue::class, 'isErr'],
+ 'argumentCount' => '1',
+ ],
+ 'ISERROR' => [
+ 'category' => Category::CATEGORY_INFORMATION,
+ 'functionCall' => [Information\ErrorValue::class, 'isError'],
+ 'argumentCount' => '1',
+ ],
+ 'ISEVEN' => [
+ 'category' => Category::CATEGORY_INFORMATION,
+ 'functionCall' => [Information\Value::class, 'isEven'],
+ 'argumentCount' => '1',
+ ],
+ 'ISFORMULA' => [
+ 'category' => Category::CATEGORY_INFORMATION,
+ 'functionCall' => [Information\Value::class, 'isFormula'],
+ 'argumentCount' => '1',
+ 'passCellReference' => true,
+ 'passByReference' => [true],
+ ],
+ 'ISLOGICAL' => [
+ 'category' => Category::CATEGORY_INFORMATION,
+ 'functionCall' => [Information\Value::class, 'isLogical'],
+ 'argumentCount' => '1',
+ ],
+ 'ISNA' => [
+ 'category' => Category::CATEGORY_INFORMATION,
+ 'functionCall' => [Information\ErrorValue::class, 'isNa'],
+ 'argumentCount' => '1',
+ ],
+ 'ISNONTEXT' => [
+ 'category' => Category::CATEGORY_INFORMATION,
+ 'functionCall' => [Information\Value::class, 'isNonText'],
+ 'argumentCount' => '1',
+ ],
+ 'ISNUMBER' => [
+ 'category' => Category::CATEGORY_INFORMATION,
+ 'functionCall' => [Information\Value::class, 'isNumber'],
+ 'argumentCount' => '1',
+ ],
+ 'ISO.CEILING' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => [Functions::class, 'DUMMY'],
+ 'argumentCount' => '1,2',
+ ],
+ 'ISODD' => [
+ 'category' => Category::CATEGORY_INFORMATION,
+ 'functionCall' => [Information\Value::class, 'isOdd'],
+ 'argumentCount' => '1',
+ ],
+ 'ISOMITTED' => [
+ 'category' => Category::CATEGORY_INFORMATION,
+ 'functionCall' => [Functions::class, 'DUMMY'],
+ 'argumentCount' => '*',
+ ],
+ 'ISOWEEKNUM' => [
+ 'category' => Category::CATEGORY_DATE_AND_TIME,
+ 'functionCall' => [DateTimeExcel\Week::class, 'isoWeekNumber'],
+ 'argumentCount' => '1',
+ ],
+ 'ISPMT' => [
+ 'category' => Category::CATEGORY_FINANCIAL,
+ 'functionCall' => [Financial\CashFlow\Constant\Periodic\Interest::class, 'schedulePayment'],
+ 'argumentCount' => '4',
+ ],
+ 'ISREF' => [
+ 'category' => Category::CATEGORY_INFORMATION,
+ 'functionCall' => [Information\Value::class, 'isRef'],
+ 'argumentCount' => '1',
+ 'passCellReference' => true,
+ 'passByReference' => [true],
+ ],
+ 'ISTEXT' => [
+ 'category' => Category::CATEGORY_INFORMATION,
+ 'functionCall' => [Information\Value::class, 'isText'],
+ 'argumentCount' => '1',
+ ],
+ 'ISTHAIDIGIT' => [
+ 'category' => Category::CATEGORY_TEXT_AND_DATA,
+ 'functionCall' => [Functions::class, 'DUMMY'],
+ 'argumentCount' => '?',
+ ],
+ 'JIS' => [
+ 'category' => Category::CATEGORY_TEXT_AND_DATA,
+ 'functionCall' => [Functions::class, 'DUMMY'],
+ 'argumentCount' => '1',
+ ],
+ 'KURT' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical\Deviations::class, 'kurtosis'],
+ 'argumentCount' => '1+',
+ ],
+ 'LAMBDA' => [
+ 'category' => Category::CATEGORY_LOGICAL,
+ 'functionCall' => [Functions::class, 'DUMMY'],
+ 'argumentCount' => '*',
+ ],
+ 'LARGE' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical\Size::class, 'large'],
+ 'argumentCount' => '2',
+ ],
+ 'LCM' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => [MathTrig\Lcm::class, 'evaluate'],
+ 'argumentCount' => '1+',
+ ],
+ 'LEFT' => [
+ 'category' => Category::CATEGORY_TEXT_AND_DATA,
+ 'functionCall' => [TextData\Extract::class, 'left'],
+ 'argumentCount' => '1,2',
+ ],
+ 'LEFTB' => [
+ 'category' => Category::CATEGORY_TEXT_AND_DATA,
+ 'functionCall' => [TextData\Extract::class, 'left'],
+ 'argumentCount' => '1,2',
+ ],
+ 'LEN' => [
+ 'category' => Category::CATEGORY_TEXT_AND_DATA,
+ 'functionCall' => [TextData\Text::class, 'length'],
+ 'argumentCount' => '1',
+ ],
+ 'LENB' => [
+ 'category' => Category::CATEGORY_TEXT_AND_DATA,
+ 'functionCall' => [TextData\Text::class, 'length'],
+ 'argumentCount' => '1',
+ ],
+ 'LET' => [
+ 'category' => Category::CATEGORY_LOGICAL,
+ 'functionCall' => [Functions::class, 'DUMMY'],
+ 'argumentCount' => '*',
+ ],
+ 'LINEST' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical\Trends::class, 'LINEST'],
+ 'argumentCount' => '1-4',
+ ],
+ 'LN' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => [MathTrig\Logarithms::class, 'natural'],
+ 'argumentCount' => '1',
+ ],
+ 'LOG' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => [MathTrig\Logarithms::class, 'withBase'],
+ 'argumentCount' => '1,2',
+ ],
+ 'LOG10' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => [MathTrig\Logarithms::class, 'base10'],
+ 'argumentCount' => '1',
+ ],
+ 'LOGEST' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical\Trends::class, 'LOGEST'],
+ 'argumentCount' => '1-4',
+ ],
+ 'LOGINV' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical\Distributions\LogNormal::class, 'inverse'],
+ 'argumentCount' => '3',
+ ],
+ 'LOGNORMDIST' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical\Distributions\LogNormal::class, 'cumulative'],
+ 'argumentCount' => '3',
+ ],
+ 'LOGNORM.DIST' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical\Distributions\LogNormal::class, 'distribution'],
+ 'argumentCount' => '4',
+ ],
+ 'LOGNORM.INV' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical\Distributions\LogNormal::class, 'inverse'],
+ 'argumentCount' => '3',
+ ],
+ 'LOOKUP' => [
+ 'category' => Category::CATEGORY_LOOKUP_AND_REFERENCE,
+ 'functionCall' => [LookupRef\Lookup::class, 'lookup'],
+ 'argumentCount' => '2,3',
+ ],
+ 'LOWER' => [
+ 'category' => Category::CATEGORY_TEXT_AND_DATA,
+ 'functionCall' => [TextData\CaseConvert::class, 'lower'],
+ 'argumentCount' => '1',
+ ],
+ 'MAKEARRAY' => [
+ 'category' => Category::CATEGORY_LOGICAL,
+ 'functionCall' => [Functions::class, 'DUMMY'],
+ 'argumentCount' => '*',
+ ],
+ 'MAP' => [
+ 'category' => Category::CATEGORY_LOGICAL,
+ 'functionCall' => [Functions::class, 'DUMMY'],
+ 'argumentCount' => '*',
+ ],
+ 'MATCH' => [
+ 'category' => Category::CATEGORY_LOOKUP_AND_REFERENCE,
+ 'functionCall' => [LookupRef\ExcelMatch::class, 'MATCH'],
+ 'argumentCount' => '2,3',
+ ],
+ 'MAX' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical\Maximum::class, 'max'],
+ 'argumentCount' => '1+',
+ ],
+ 'MAXA' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical\Maximum::class, 'maxA'],
+ 'argumentCount' => '1+',
+ ],
+ 'MAXIFS' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical\Conditional::class, 'MAXIFS'],
+ 'argumentCount' => '3+',
+ ],
+ 'MDETERM' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => [MathTrig\MatrixFunctions::class, 'determinant'],
+ 'argumentCount' => '1',
+ ],
+ 'MDURATION' => [
+ 'category' => Category::CATEGORY_FINANCIAL,
+ 'functionCall' => [Functions::class, 'DUMMY'],
+ 'argumentCount' => '5,6',
+ ],
+ 'MEDIAN' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical\Averages::class, 'median'],
+ 'argumentCount' => '1+',
+ ],
+ 'MEDIANIF' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Functions::class, 'DUMMY'],
+ 'argumentCount' => '2+',
+ ],
+ 'MID' => [
+ 'category' => Category::CATEGORY_TEXT_AND_DATA,
+ 'functionCall' => [TextData\Extract::class, 'mid'],
+ 'argumentCount' => '3',
+ ],
+ 'MIDB' => [
+ 'category' => Category::CATEGORY_TEXT_AND_DATA,
+ 'functionCall' => [TextData\Extract::class, 'mid'],
+ 'argumentCount' => '3',
+ ],
+ 'MIN' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical\Minimum::class, 'min'],
+ 'argumentCount' => '1+',
+ ],
+ 'MINA' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical\Minimum::class, 'minA'],
+ 'argumentCount' => '1+',
+ ],
+ 'MINIFS' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical\Conditional::class, 'MINIFS'],
+ 'argumentCount' => '3+',
+ ],
+ 'MINUTE' => [
+ 'category' => Category::CATEGORY_DATE_AND_TIME,
+ 'functionCall' => [DateTimeExcel\TimeParts::class, 'minute'],
+ 'argumentCount' => '1',
+ ],
+ 'MINVERSE' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => [MathTrig\MatrixFunctions::class, 'inverse'],
+ 'argumentCount' => '1',
+ ],
+ 'MIRR' => [
+ 'category' => Category::CATEGORY_FINANCIAL,
+ 'functionCall' => [Financial\CashFlow\Variable\Periodic::class, 'modifiedRate'],
+ 'argumentCount' => '3',
+ ],
+ 'MMULT' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => [MathTrig\MatrixFunctions::class, 'multiply'],
+ 'argumentCount' => '2',
+ ],
+ 'MOD' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => [MathTrig\Operations::class, 'mod'],
+ 'argumentCount' => '2',
+ ],
+ 'MODE' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical\Averages::class, 'mode'],
+ 'argumentCount' => '1+',
+ ],
+ 'MODE.MULT' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Functions::class, 'DUMMY'],
+ 'argumentCount' => '1+',
+ ],
+ 'MODE.SNGL' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical\Averages::class, 'mode'],
+ 'argumentCount' => '1+',
+ ],
+ 'MONTH' => [
+ 'category' => Category::CATEGORY_DATE_AND_TIME,
+ 'functionCall' => [DateTimeExcel\DateParts::class, 'month'],
+ 'argumentCount' => '1',
+ ],
+ 'MROUND' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => [MathTrig\Round::class, 'multiple'],
+ 'argumentCount' => '2',
+ ],
+ 'MULTINOMIAL' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => [MathTrig\Factorial::class, 'multinomial'],
+ 'argumentCount' => '1+',
+ ],
+ 'MUNIT' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => [MathTrig\MatrixFunctions::class, 'identity'],
+ 'argumentCount' => '1',
+ ],
+ 'N' => [
+ 'category' => Category::CATEGORY_INFORMATION,
+ 'functionCall' => [Information\Value::class, 'asNumber'],
+ 'argumentCount' => '1',
+ ],
+ 'NA' => [
+ 'category' => Category::CATEGORY_INFORMATION,
+ 'functionCall' => [ExcelError::class, 'NA'],
+ 'argumentCount' => '0',
+ ],
+ 'NEGBINOMDIST' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical\Distributions\Binomial::class, 'negative'],
+ 'argumentCount' => '3',
+ ],
+ 'NEGBINOM.DIST' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Functions::class, 'DUMMY'],
+ 'argumentCount' => '4',
+ ],
+ 'NETWORKDAYS' => [
+ 'category' => Category::CATEGORY_DATE_AND_TIME,
+ 'functionCall' => [DateTimeExcel\NetworkDays::class, 'count'],
+ 'argumentCount' => '2-3',
+ ],
+ 'NETWORKDAYS.INTL' => [
+ 'category' => Category::CATEGORY_DATE_AND_TIME,
+ 'functionCall' => [Functions::class, 'DUMMY'],
+ 'argumentCount' => '2-4',
+ ],
+ 'NOMINAL' => [
+ 'category' => Category::CATEGORY_FINANCIAL,
+ 'functionCall' => [Financial\InterestRate::class, 'nominal'],
+ 'argumentCount' => '2',
+ ],
+ 'NORMDIST' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical\Distributions\Normal::class, 'distribution'],
+ 'argumentCount' => '4',
+ ],
+ 'NORM.DIST' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical\Distributions\Normal::class, 'distribution'],
+ 'argumentCount' => '4',
+ ],
+ 'NORMINV' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical\Distributions\Normal::class, 'inverse'],
+ 'argumentCount' => '3',
+ ],
+ 'NORM.INV' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical\Distributions\Normal::class, 'inverse'],
+ 'argumentCount' => '3',
+ ],
+ 'NORMSDIST' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical\Distributions\StandardNormal::class, 'cumulative'],
+ 'argumentCount' => '1',
+ ],
+ 'NORM.S.DIST' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical\Distributions\StandardNormal::class, 'distribution'],
+ 'argumentCount' => '1,2',
+ ],
+ 'NORMSINV' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical\Distributions\StandardNormal::class, 'inverse'],
+ 'argumentCount' => '1',
+ ],
+ 'NORM.S.INV' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical\Distributions\StandardNormal::class, 'inverse'],
+ 'argumentCount' => '1',
+ ],
+ 'NOT' => [
+ 'category' => Category::CATEGORY_LOGICAL,
+ 'functionCall' => [Logical\Operations::class, 'NOT'],
+ 'argumentCount' => '1',
+ ],
+ 'NOW' => [
+ 'category' => Category::CATEGORY_DATE_AND_TIME,
+ 'functionCall' => [DateTimeExcel\Current::class, 'now'],
+ 'argumentCount' => '0',
+ ],
+ 'NPER' => [
+ 'category' => Category::CATEGORY_FINANCIAL,
+ 'functionCall' => [Financial\CashFlow\Constant\Periodic::class, 'periods'],
+ 'argumentCount' => '3-5',
+ ],
+ 'NPV' => [
+ 'category' => Category::CATEGORY_FINANCIAL,
+ 'functionCall' => [Financial\CashFlow\Variable\Periodic::class, 'presentValue'],
+ 'argumentCount' => '2+',
+ ],
+ 'NUMBERSTRING' => [
+ 'category' => Category::CATEGORY_TEXT_AND_DATA,
+ 'functionCall' => [Functions::class, 'DUMMY'],
+ 'argumentCount' => '?',
+ ],
+ 'NUMBERVALUE' => [
+ 'category' => Category::CATEGORY_TEXT_AND_DATA,
+ 'functionCall' => [TextData\Format::class, 'NUMBERVALUE'],
+ 'argumentCount' => '1+',
+ ],
+ 'OCT2BIN' => [
+ 'category' => Category::CATEGORY_ENGINEERING,
+ 'functionCall' => [Engineering\ConvertOctal::class, 'toBinary'],
+ 'argumentCount' => '1,2',
+ ],
+ 'OCT2DEC' => [
+ 'category' => Category::CATEGORY_ENGINEERING,
+ 'functionCall' => [Engineering\ConvertOctal::class, 'toDecimal'],
+ 'argumentCount' => '1',
+ ],
+ 'OCT2HEX' => [
+ 'category' => Category::CATEGORY_ENGINEERING,
+ 'functionCall' => [Engineering\ConvertOctal::class, 'toHex'],
+ 'argumentCount' => '1,2',
+ ],
+ 'ODD' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => [MathTrig\Round::class, 'odd'],
+ 'argumentCount' => '1',
+ ],
+ 'ODDFPRICE' => [
+ 'category' => Category::CATEGORY_FINANCIAL,
+ 'functionCall' => [Functions::class, 'DUMMY'],
+ 'argumentCount' => '8,9',
+ ],
+ 'ODDFYIELD' => [
+ 'category' => Category::CATEGORY_FINANCIAL,
+ 'functionCall' => [Functions::class, 'DUMMY'],
+ 'argumentCount' => '8,9',
+ ],
+ 'ODDLPRICE' => [
+ 'category' => Category::CATEGORY_FINANCIAL,
+ 'functionCall' => [Functions::class, 'DUMMY'],
+ 'argumentCount' => '7,8',
+ ],
+ 'ODDLYIELD' => [
+ 'category' => Category::CATEGORY_FINANCIAL,
+ 'functionCall' => [Functions::class, 'DUMMY'],
+ 'argumentCount' => '7,8',
+ ],
+ 'OFFSET' => [
+ 'category' => Category::CATEGORY_LOOKUP_AND_REFERENCE,
+ 'functionCall' => [LookupRef\Offset::class, 'OFFSET'],
+ 'argumentCount' => '3-5',
+ 'passCellReference' => true,
+ 'passByReference' => [true],
+ ],
+ 'OR' => [
+ 'category' => Category::CATEGORY_LOGICAL,
+ 'functionCall' => [Logical\Operations::class, 'logicalOr'],
+ 'argumentCount' => '1+',
+ ],
+ 'PDURATION' => [
+ 'category' => Category::CATEGORY_FINANCIAL,
+ 'functionCall' => [Financial\CashFlow\Single::class, 'periods'],
+ 'argumentCount' => '3',
+ ],
+ 'PEARSON' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical\Trends::class, 'CORREL'],
+ 'argumentCount' => '2',
+ ],
+ 'PERCENTILE' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical\Percentiles::class, 'PERCENTILE'],
+ 'argumentCount' => '2',
+ ],
+ 'PERCENTILE.EXC' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Functions::class, 'DUMMY'],
+ 'argumentCount' => '2',
+ ],
+ 'PERCENTILE.INC' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical\Percentiles::class, 'PERCENTILE'],
+ 'argumentCount' => '2',
+ ],
+ 'PERCENTRANK' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical\Percentiles::class, 'PERCENTRANK'],
+ 'argumentCount' => '2,3',
+ ],
+ 'PERCENTRANK.EXC' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Functions::class, 'DUMMY'],
+ 'argumentCount' => '2,3',
+ ],
+ 'PERCENTRANK.INC' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical\Percentiles::class, 'PERCENTRANK'],
+ 'argumentCount' => '2,3',
+ ],
+ 'PERMUT' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical\Permutations::class, 'PERMUT'],
+ 'argumentCount' => '2',
+ ],
+ 'PERMUTATIONA' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical\Permutations::class, 'PERMUTATIONA'],
+ 'argumentCount' => '2',
+ ],
+ 'PHONETIC' => [
+ 'category' => Category::CATEGORY_TEXT_AND_DATA,
+ 'functionCall' => [Functions::class, 'DUMMY'],
+ 'argumentCount' => '1',
+ ],
+ 'PHI' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Functions::class, 'DUMMY'],
+ 'argumentCount' => '1',
+ ],
+ 'PI' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => 'pi',
+ 'argumentCount' => '0',
+ ],
+ 'PMT' => [
+ 'category' => Category::CATEGORY_FINANCIAL,
+ 'functionCall' => [Financial\CashFlow\Constant\Periodic\Payments::class, 'annuity'],
+ 'argumentCount' => '3-5',
+ ],
+ 'POISSON' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical\Distributions\Poisson::class, 'distribution'],
+ 'argumentCount' => '3',
+ ],
+ 'POISSON.DIST' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical\Distributions\Poisson::class, 'distribution'],
+ 'argumentCount' => '3',
+ ],
+ 'POWER' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => [MathTrig\Operations::class, 'power'],
+ 'argumentCount' => '2',
+ ],
+ 'PPMT' => [
+ 'category' => Category::CATEGORY_FINANCIAL,
+ 'functionCall' => [Financial\CashFlow\Constant\Periodic\Payments::class, 'interestPayment'],
+ 'argumentCount' => '4-6',
+ ],
+ 'PRICE' => [
+ 'category' => Category::CATEGORY_FINANCIAL,
+ 'functionCall' => [Financial\Securities\Price::class, 'price'],
+ 'argumentCount' => '6,7',
+ ],
+ 'PRICEDISC' => [
+ 'category' => Category::CATEGORY_FINANCIAL,
+ 'functionCall' => [Financial\Securities\Price::class, 'priceDiscounted'],
+ 'argumentCount' => '4,5',
+ ],
+ 'PRICEMAT' => [
+ 'category' => Category::CATEGORY_FINANCIAL,
+ 'functionCall' => [Financial\Securities\Price::class, 'priceAtMaturity'],
+ 'argumentCount' => '5,6',
+ ],
+ 'PROB' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Functions::class, 'DUMMY'],
+ 'argumentCount' => '3,4',
+ ],
+ 'PRODUCT' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => [MathTrig\Operations::class, 'product'],
+ 'argumentCount' => '1+',
+ ],
+ 'PROPER' => [
+ 'category' => Category::CATEGORY_TEXT_AND_DATA,
+ 'functionCall' => [TextData\CaseConvert::class, 'proper'],
+ 'argumentCount' => '1',
+ ],
+ 'PV' => [
+ 'category' => Category::CATEGORY_FINANCIAL,
+ 'functionCall' => [Financial\CashFlow\Constant\Periodic::class, 'presentValue'],
+ 'argumentCount' => '3-5',
+ ],
+ 'QUARTILE' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical\Percentiles::class, 'QUARTILE'],
+ 'argumentCount' => '2',
+ ],
+ 'QUARTILE.EXC' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Functions::class, 'DUMMY'],
+ 'argumentCount' => '2',
+ ],
+ 'QUARTILE.INC' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical\Percentiles::class, 'QUARTILE'],
+ 'argumentCount' => '2',
+ ],
+ 'QUOTIENT' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => [MathTrig\Operations::class, 'quotient'],
+ 'argumentCount' => '2',
+ ],
+ 'RADIANS' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => [MathTrig\Angle::class, 'toRadians'],
+ 'argumentCount' => '1',
+ ],
+ 'RAND' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => [MathTrig\Random::class, 'rand'],
+ 'argumentCount' => '0',
+ ],
+ 'RANDARRAY' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => [MathTrig\Random::class, 'randArray'],
+ 'argumentCount' => '0-5',
+ ],
+ 'RANDBETWEEN' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => [MathTrig\Random::class, 'randBetween'],
+ 'argumentCount' => '2',
+ ],
+ 'RANK' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical\Percentiles::class, 'RANK'],
+ 'argumentCount' => '2,3',
+ ],
+ 'RANK.AVG' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Functions::class, 'DUMMY'],
+ 'argumentCount' => '2,3',
+ ],
+ 'RANK.EQ' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical\Percentiles::class, 'RANK'],
+ 'argumentCount' => '2,3',
+ ],
+ 'RATE' => [
+ 'category' => Category::CATEGORY_FINANCIAL,
+ 'functionCall' => [Financial\CashFlow\Constant\Periodic\Interest::class, 'rate'],
+ 'argumentCount' => '3-6',
+ ],
+ 'RECEIVED' => [
+ 'category' => Category::CATEGORY_FINANCIAL,
+ 'functionCall' => [Financial\Securities\Price::class, 'received'],
+ 'argumentCount' => '4-5',
+ ],
+ 'REDUCE' => [
+ 'category' => Category::CATEGORY_LOGICAL,
+ 'functionCall' => [Functions::class, 'DUMMY'],
+ 'argumentCount' => '*',
+ ],
+ 'REPLACE' => [
+ 'category' => Category::CATEGORY_TEXT_AND_DATA,
+ 'functionCall' => [TextData\Replace::class, 'replace'],
+ 'argumentCount' => '4',
+ ],
+ 'REPLACEB' => [
+ 'category' => Category::CATEGORY_TEXT_AND_DATA,
+ 'functionCall' => [TextData\Replace::class, 'replace'],
+ 'argumentCount' => '4',
+ ],
+ 'REPT' => [
+ 'category' => Category::CATEGORY_TEXT_AND_DATA,
+ 'functionCall' => [TextData\Concatenate::class, 'builtinREPT'],
+ 'argumentCount' => '2',
+ ],
+ 'RIGHT' => [
+ 'category' => Category::CATEGORY_TEXT_AND_DATA,
+ 'functionCall' => [TextData\Extract::class, 'right'],
+ 'argumentCount' => '1,2',
+ ],
+ 'RIGHTB' => [
+ 'category' => Category::CATEGORY_TEXT_AND_DATA,
+ 'functionCall' => [TextData\Extract::class, 'right'],
+ 'argumentCount' => '1,2',
+ ],
+ 'ROMAN' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => [MathTrig\Roman::class, 'evaluate'],
+ 'argumentCount' => '1,2',
+ ],
+ 'ROUND' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => [MathTrig\Round::class, 'round'],
+ 'argumentCount' => '2',
+ ],
+ 'ROUNDBAHTDOWN' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => [Functions::class, 'DUMMY'],
+ 'argumentCount' => '?',
+ ],
+ 'ROUNDBAHTUP' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => [Functions::class, 'DUMMY'],
+ 'argumentCount' => '?',
+ ],
+ 'ROUNDDOWN' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => [MathTrig\Round::class, 'down'],
+ 'argumentCount' => '2',
+ ],
+ 'ROUNDUP' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => [MathTrig\Round::class, 'up'],
+ 'argumentCount' => '2',
+ ],
+ 'ROW' => [
+ 'category' => Category::CATEGORY_LOOKUP_AND_REFERENCE,
+ 'functionCall' => [LookupRef\RowColumnInformation::class, 'ROW'],
+ 'argumentCount' => '-1',
+ 'passCellReference' => true,
+ 'passByReference' => [true],
+ ],
+ 'ROWS' => [
+ 'category' => Category::CATEGORY_LOOKUP_AND_REFERENCE,
+ 'functionCall' => [LookupRef\RowColumnInformation::class, 'ROWS'],
+ 'argumentCount' => '1',
+ ],
+ 'RRI' => [
+ 'category' => Category::CATEGORY_FINANCIAL,
+ 'functionCall' => [Financial\CashFlow\Single::class, 'interestRate'],
+ 'argumentCount' => '3',
+ ],
+ 'RSQ' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical\Trends::class, 'RSQ'],
+ 'argumentCount' => '2',
+ ],
+ 'RTD' => [
+ 'category' => Category::CATEGORY_LOOKUP_AND_REFERENCE,
+ 'functionCall' => [Functions::class, 'DUMMY'],
+ 'argumentCount' => '1+',
+ ],
+ 'SEARCH' => [
+ 'category' => Category::CATEGORY_TEXT_AND_DATA,
+ 'functionCall' => [TextData\Search::class, 'insensitive'],
+ 'argumentCount' => '2,3',
+ ],
+ 'SCAN' => [
+ 'category' => Category::CATEGORY_LOGICAL,
+ 'functionCall' => [Functions::class, 'DUMMY'],
+ 'argumentCount' => '*',
+ ],
+ 'SEARCHB' => [
+ 'category' => Category::CATEGORY_TEXT_AND_DATA,
+ 'functionCall' => [TextData\Search::class, 'insensitive'],
+ 'argumentCount' => '2,3',
+ ],
+ 'SEC' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => [MathTrig\Trig\Secant::class, 'sec'],
+ 'argumentCount' => '1',
+ ],
+ 'SECH' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => [MathTrig\Trig\Secant::class, 'sech'],
+ 'argumentCount' => '1',
+ ],
+ 'SECOND' => [
+ 'category' => Category::CATEGORY_DATE_AND_TIME,
+ 'functionCall' => [DateTimeExcel\TimeParts::class, 'second'],
+ 'argumentCount' => '1',
+ ],
+ 'SEQUENCE' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => [MathTrig\MatrixFunctions::class, 'sequence'],
+ 'argumentCount' => '1-4',
+ ],
+ 'SERIESSUM' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => [MathTrig\SeriesSum::class, 'evaluate'],
+ 'argumentCount' => '4',
+ ],
+ 'SHEET' => [
+ 'category' => Category::CATEGORY_INFORMATION,
+ 'functionCall' => [Functions::class, 'DUMMY'],
+ 'argumentCount' => '0,1',
+ ],
+ 'SHEETS' => [
+ 'category' => Category::CATEGORY_INFORMATION,
+ 'functionCall' => [Functions::class, 'DUMMY'],
+ 'argumentCount' => '0,1',
+ ],
+ 'SIGN' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => [MathTrig\Sign::class, 'evaluate'],
+ 'argumentCount' => '1',
+ ],
+ 'SIN' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => [MathTrig\Trig\Sine::class, 'sin'],
+ 'argumentCount' => '1',
+ ],
+ 'SINGLE' => [
+ 'category' => Category::CATEGORY_UNCATEGORISED,
+ 'functionCall' => [Functions::class, 'DUMMY'],
+ 'argumentCount' => '*',
+ ],
+ 'SINH' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => [MathTrig\Trig\Sine::class, 'sinh'],
+ 'argumentCount' => '1',
+ ],
+ 'SKEW' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical\Deviations::class, 'skew'],
+ 'argumentCount' => '1+',
+ ],
+ 'SKEW.P' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Functions::class, 'DUMMY'],
+ 'argumentCount' => '1+',
+ ],
+ 'SLN' => [
+ 'category' => Category::CATEGORY_FINANCIAL,
+ 'functionCall' => [Financial\Depreciation::class, 'SLN'],
+ 'argumentCount' => '3',
+ ],
+ 'SLOPE' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical\Trends::class, 'SLOPE'],
+ 'argumentCount' => '2',
+ ],
+ 'SMALL' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical\Size::class, 'small'],
+ 'argumentCount' => '2',
+ ],
+ 'SORT' => [
+ 'category' => Category::CATEGORY_LOOKUP_AND_REFERENCE,
+ 'functionCall' => [LookupRef\Sort::class, 'sort'],
+ 'argumentCount' => '1-4',
+ ],
+ 'SORTBY' => [
+ 'category' => Category::CATEGORY_LOOKUP_AND_REFERENCE,
+ 'functionCall' => [LookupRef\Sort::class, 'sortBy'],
+ 'argumentCount' => '2+',
+ ],
+ 'SQRT' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => [MathTrig\Sqrt::class, 'sqrt'],
+ 'argumentCount' => '1',
+ ],
+ 'SQRTPI' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => [MathTrig\Sqrt::class, 'pi'],
+ 'argumentCount' => '1',
+ ],
+ 'STANDARDIZE' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical\Standardize::class, 'execute'],
+ 'argumentCount' => '3',
+ ],
+ 'STDEV' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical\StandardDeviations::class, 'STDEV'],
+ 'argumentCount' => '1+',
+ ],
+ 'STDEV.S' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical\StandardDeviations::class, 'STDEV'],
+ 'argumentCount' => '1+',
+ ],
+ 'STDEV.P' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical\StandardDeviations::class, 'STDEVP'],
+ 'argumentCount' => '1+',
+ ],
+ 'STDEVA' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical\StandardDeviations::class, 'STDEVA'],
+ 'argumentCount' => '1+',
+ ],
+ 'STDEVP' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical\StandardDeviations::class, 'STDEVP'],
+ 'argumentCount' => '1+',
+ ],
+ 'STDEVPA' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical\StandardDeviations::class, 'STDEVPA'],
+ 'argumentCount' => '1+',
+ ],
+ 'STEYX' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical\Trends::class, 'STEYX'],
+ 'argumentCount' => '2',
+ ],
+ 'SUBSTITUTE' => [
+ 'category' => Category::CATEGORY_TEXT_AND_DATA,
+ 'functionCall' => [TextData\Replace::class, 'substitute'],
+ 'argumentCount' => '3,4',
+ ],
+ 'SUBTOTAL' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => [MathTrig\Subtotal::class, 'evaluate'],
+ 'argumentCount' => '2+',
+ 'passCellReference' => true,
+ ],
+ 'SUM' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => [MathTrig\Sum::class, 'sumErroringStrings'],
+ 'argumentCount' => '1+',
+ ],
+ 'SUMIF' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => [Statistical\Conditional::class, 'SUMIF'],
+ 'argumentCount' => '2,3',
+ ],
+ 'SUMIFS' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => [Statistical\Conditional::class, 'SUMIFS'],
+ 'argumentCount' => '3+',
+ ],
+ 'SUMPRODUCT' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => [MathTrig\Sum::class, 'product'],
+ 'argumentCount' => '1+',
+ ],
+ 'SUMSQ' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => [MathTrig\SumSquares::class, 'sumSquare'],
+ 'argumentCount' => '1+',
+ ],
+ 'SUMX2MY2' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => [MathTrig\SumSquares::class, 'sumXSquaredMinusYSquared'],
+ 'argumentCount' => '2',
+ ],
+ 'SUMX2PY2' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => [MathTrig\SumSquares::class, 'sumXSquaredPlusYSquared'],
+ 'argumentCount' => '2',
+ ],
+ 'SUMXMY2' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => [MathTrig\SumSquares::class, 'sumXMinusYSquared'],
+ 'argumentCount' => '2',
+ ],
+ 'SWITCH' => [
+ 'category' => Category::CATEGORY_LOGICAL,
+ 'functionCall' => [Logical\Conditional::class, 'statementSwitch'],
+ 'argumentCount' => '3+',
+ ],
+ 'SYD' => [
+ 'category' => Category::CATEGORY_FINANCIAL,
+ 'functionCall' => [Financial\Depreciation::class, 'SYD'],
+ 'argumentCount' => '4',
+ ],
+ 'T' => [
+ 'category' => Category::CATEGORY_TEXT_AND_DATA,
+ 'functionCall' => [TextData\Text::class, 'test'],
+ 'argumentCount' => '1',
+ ],
+ 'TAKE' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => [Functions::class, 'DUMMY'],
+ 'argumentCount' => '2-3',
+ ],
+ 'TAN' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => [MathTrig\Trig\Tangent::class, 'tan'],
+ 'argumentCount' => '1',
+ ],
+ 'TANH' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => [MathTrig\Trig\Tangent::class, 'tanh'],
+ 'argumentCount' => '1',
+ ],
+ 'TBILLEQ' => [
+ 'category' => Category::CATEGORY_FINANCIAL,
+ 'functionCall' => [Financial\TreasuryBill::class, 'bondEquivalentYield'],
+ 'argumentCount' => '3',
+ ],
+ 'TBILLPRICE' => [
+ 'category' => Category::CATEGORY_FINANCIAL,
+ 'functionCall' => [Financial\TreasuryBill::class, 'price'],
+ 'argumentCount' => '3',
+ ],
+ 'TBILLYIELD' => [
+ 'category' => Category::CATEGORY_FINANCIAL,
+ 'functionCall' => [Financial\TreasuryBill::class, 'yield'],
+ 'argumentCount' => '3',
+ ],
+ 'TDIST' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical\Distributions\StudentT::class, 'distribution'],
+ 'argumentCount' => '3',
+ ],
+ 'T.DIST' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Functions::class, 'DUMMY'],
+ 'argumentCount' => '3',
+ ],
+ 'T.DIST.2T' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Functions::class, 'DUMMY'],
+ 'argumentCount' => '2',
+ ],
+ 'T.DIST.RT' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Functions::class, 'DUMMY'],
+ 'argumentCount' => '2',
+ ],
+ 'TEXT' => [
+ 'category' => Category::CATEGORY_TEXT_AND_DATA,
+ 'functionCall' => [TextData\Format::class, 'TEXTFORMAT'],
+ 'argumentCount' => '2',
+ ],
+ 'TEXTAFTER' => [
+ 'category' => Category::CATEGORY_TEXT_AND_DATA,
+ 'functionCall' => [TextData\Extract::class, 'after'],
+ 'argumentCount' => '2-6',
+ ],
+ 'TEXTBEFORE' => [
+ 'category' => Category::CATEGORY_TEXT_AND_DATA,
+ 'functionCall' => [TextData\Extract::class, 'before'],
+ 'argumentCount' => '2-6',
+ ],
+ 'TEXTJOIN' => [
+ 'category' => Category::CATEGORY_TEXT_AND_DATA,
+ 'functionCall' => [TextData\Concatenate::class, 'TEXTJOIN'],
+ 'argumentCount' => '3+',
+ ],
+ 'TEXTSPLIT' => [
+ 'category' => Category::CATEGORY_TEXT_AND_DATA,
+ 'functionCall' => [TextData\Text::class, 'split'],
+ 'argumentCount' => '2-6',
+ ],
+ 'THAIDAYOFWEEK' => [
+ 'category' => Category::CATEGORY_DATE_AND_TIME,
+ 'functionCall' => [Functions::class, 'DUMMY'],
+ 'argumentCount' => '?',
+ ],
+ 'THAIDIGIT' => [
+ 'category' => Category::CATEGORY_TEXT_AND_DATA,
+ 'functionCall' => [Functions::class, 'DUMMY'],
+ 'argumentCount' => '?',
+ ],
+ 'THAIMONTHOFYEAR' => [
+ 'category' => Category::CATEGORY_DATE_AND_TIME,
+ 'functionCall' => [Functions::class, 'DUMMY'],
+ 'argumentCount' => '?',
+ ],
+ 'THAINUMSOUND' => [
+ 'category' => Category::CATEGORY_TEXT_AND_DATA,
+ 'functionCall' => [Functions::class, 'DUMMY'],
+ 'argumentCount' => '?',
+ ],
+ 'THAINUMSTRING' => [
+ 'category' => Category::CATEGORY_TEXT_AND_DATA,
+ 'functionCall' => [Functions::class, 'DUMMY'],
+ 'argumentCount' => '?',
+ ],
+ 'THAISTRINGLENGTH' => [
+ 'category' => Category::CATEGORY_TEXT_AND_DATA,
+ 'functionCall' => [Functions::class, 'DUMMY'],
+ 'argumentCount' => '?',
+ ],
+ 'THAIYEAR' => [
+ 'category' => Category::CATEGORY_DATE_AND_TIME,
+ 'functionCall' => [Functions::class, 'DUMMY'],
+ 'argumentCount' => '?',
+ ],
+ 'TIME' => [
+ 'category' => Category::CATEGORY_DATE_AND_TIME,
+ 'functionCall' => [DateTimeExcel\Time::class, 'fromHMS'],
+ 'argumentCount' => '3',
+ ],
+ 'TIMEVALUE' => [
+ 'category' => Category::CATEGORY_DATE_AND_TIME,
+ 'functionCall' => [DateTimeExcel\TimeValue::class, 'fromString'],
+ 'argumentCount' => '1',
+ ],
+ 'TINV' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical\Distributions\StudentT::class, 'inverse'],
+ 'argumentCount' => '2',
+ ],
+ 'T.INV' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical\Distributions\StudentT::class, 'inverse'],
+ 'argumentCount' => '2',
+ ],
+ 'T.INV.2T' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Functions::class, 'DUMMY'],
+ 'argumentCount' => '2',
+ ],
+ 'TODAY' => [
+ 'category' => Category::CATEGORY_DATE_AND_TIME,
+ 'functionCall' => [DateTimeExcel\Current::class, 'today'],
+ 'argumentCount' => '0',
+ ],
+ 'TOCOL' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => [Functions::class, 'DUMMY'],
+ 'argumentCount' => '1-3',
+ ],
+ 'TOROW' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => [Functions::class, 'DUMMY'],
+ 'argumentCount' => '1-3',
+ ],
+ 'TRANSPOSE' => [
+ 'category' => Category::CATEGORY_LOOKUP_AND_REFERENCE,
+ 'functionCall' => [LookupRef\Matrix::class, 'transpose'],
+ 'argumentCount' => '1',
+ ],
+ 'TREND' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical\Trends::class, 'TREND'],
+ 'argumentCount' => '1-4',
+ ],
+ 'TRIM' => [
+ 'category' => Category::CATEGORY_TEXT_AND_DATA,
+ 'functionCall' => [TextData\Trim::class, 'spaces'],
+ 'argumentCount' => '1',
+ ],
+ 'TRIMMEAN' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical\Averages\Mean::class, 'trim'],
+ 'argumentCount' => '2',
+ ],
+ 'TRUE' => [
+ 'category' => Category::CATEGORY_LOGICAL,
+ 'functionCall' => [Logical\Boolean::class, 'TRUE'],
+ 'argumentCount' => '0',
+ ],
+ 'TRUNC' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => [MathTrig\Trunc::class, 'evaluate'],
+ 'argumentCount' => '1,2',
+ ],
+ 'TTEST' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Functions::class, 'DUMMY'],
+ 'argumentCount' => '4',
+ ],
+ 'T.TEST' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Functions::class, 'DUMMY'],
+ 'argumentCount' => '4',
+ ],
+ 'TYPE' => [
+ 'category' => Category::CATEGORY_INFORMATION,
+ 'functionCall' => [Information\Value::class, 'type'],
+ 'argumentCount' => '1',
+ ],
+ 'UNICHAR' => [
+ 'category' => Category::CATEGORY_TEXT_AND_DATA,
+ 'functionCall' => [TextData\CharacterConvert::class, 'character'],
+ 'argumentCount' => '1',
+ ],
+ 'UNICODE' => [
+ 'category' => Category::CATEGORY_TEXT_AND_DATA,
+ 'functionCall' => [TextData\CharacterConvert::class, 'code'],
+ 'argumentCount' => '1',
+ ],
+ 'UNIQUE' => [
+ 'category' => Category::CATEGORY_LOOKUP_AND_REFERENCE,
+ 'functionCall' => [LookupRef\Unique::class, 'unique'],
+ 'argumentCount' => '1+',
+ ],
+ 'UPPER' => [
+ 'category' => Category::CATEGORY_TEXT_AND_DATA,
+ 'functionCall' => [TextData\CaseConvert::class, 'upper'],
+ 'argumentCount' => '1',
+ ],
+ 'USDOLLAR' => [
+ 'category' => Category::CATEGORY_FINANCIAL,
+ 'functionCall' => [Financial\Dollar::class, 'format'],
+ 'argumentCount' => '2',
+ ],
+ 'VALUE' => [
+ 'category' => Category::CATEGORY_TEXT_AND_DATA,
+ 'functionCall' => [TextData\Format::class, 'VALUE'],
+ 'argumentCount' => '1',
+ ],
+ 'VALUETOTEXT' => [
+ 'category' => Category::CATEGORY_TEXT_AND_DATA,
+ 'functionCall' => [TextData\Format::class, 'valueToText'],
+ 'argumentCount' => '1,2',
+ ],
+ 'VAR' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical\Variances::class, 'VAR'],
+ 'argumentCount' => '1+',
+ ],
+ 'VAR.P' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical\Variances::class, 'VARP'],
+ 'argumentCount' => '1+',
+ ],
+ 'VAR.S' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical\Variances::class, 'VAR'],
+ 'argumentCount' => '1+',
+ ],
+ 'VARA' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical\Variances::class, 'VARA'],
+ 'argumentCount' => '1+',
+ ],
+ 'VARP' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical\Variances::class, 'VARP'],
+ 'argumentCount' => '1+',
+ ],
+ 'VARPA' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical\Variances::class, 'VARPA'],
+ 'argumentCount' => '1+',
+ ],
+ 'VDB' => [
+ 'category' => Category::CATEGORY_FINANCIAL,
+ 'functionCall' => [Functions::class, 'DUMMY'],
+ 'argumentCount' => '5-7',
+ ],
+ 'VLOOKUP' => [
+ 'category' => Category::CATEGORY_LOOKUP_AND_REFERENCE,
+ 'functionCall' => [LookupRef\VLookup::class, 'lookup'],
+ 'argumentCount' => '3,4',
+ ],
+ 'VSTACK' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => [Functions::class, 'DUMMY'],
+ 'argumentCount' => '1+',
+ ],
+ 'WEBSERVICE' => [
+ 'category' => Category::CATEGORY_WEB,
+ 'functionCall' => [Web\Service::class, 'webService'],
+ 'argumentCount' => '1',
+ ],
+ 'WEEKDAY' => [
+ 'category' => Category::CATEGORY_DATE_AND_TIME,
+ 'functionCall' => [DateTimeExcel\Week::class, 'day'],
+ 'argumentCount' => '1,2',
+ ],
+ 'WEEKNUM' => [
+ 'category' => Category::CATEGORY_DATE_AND_TIME,
+ 'functionCall' => [DateTimeExcel\Week::class, 'number'],
+ 'argumentCount' => '1,2',
+ ],
+ 'WEIBULL' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical\Distributions\Weibull::class, 'distribution'],
+ 'argumentCount' => '4',
+ ],
+ 'WEIBULL.DIST' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical\Distributions\Weibull::class, 'distribution'],
+ 'argumentCount' => '4',
+ ],
+ 'WORKDAY' => [
+ 'category' => Category::CATEGORY_DATE_AND_TIME,
+ 'functionCall' => [DateTimeExcel\WorkDay::class, 'date'],
+ 'argumentCount' => '2-3',
+ ],
+ 'WORKDAY.INTL' => [
+ 'category' => Category::CATEGORY_DATE_AND_TIME,
+ 'functionCall' => [Functions::class, 'DUMMY'],
+ 'argumentCount' => '2-4',
+ ],
+ 'WRAPCOLS' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => [Functions::class, 'DUMMY'],
+ 'argumentCount' => '2-3',
+ ],
+ 'WRAPROWS' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => [Functions::class, 'DUMMY'],
+ 'argumentCount' => '2-3',
+ ],
+ 'XIRR' => [
+ 'category' => Category::CATEGORY_FINANCIAL,
+ 'functionCall' => [Financial\CashFlow\Variable\NonPeriodic::class, 'rate'],
+ 'argumentCount' => '2,3',
+ ],
+ 'XLOOKUP' => [
+ 'category' => Category::CATEGORY_LOOKUP_AND_REFERENCE,
+ 'functionCall' => [Functions::class, 'DUMMY'],
+ 'argumentCount' => '3-6',
+ ],
+ 'XNPV' => [
+ 'category' => Category::CATEGORY_FINANCIAL,
+ 'functionCall' => [Financial\CashFlow\Variable\NonPeriodic::class, 'presentValue'],
+ 'argumentCount' => '3',
+ ],
+ 'XMATCH' => [
+ 'category' => Category::CATEGORY_LOOKUP_AND_REFERENCE,
+ 'functionCall' => [Functions::class, 'DUMMY'],
+ 'argumentCount' => '2,3',
+ ],
+ 'XOR' => [
+ 'category' => Category::CATEGORY_LOGICAL,
+ 'functionCall' => [Logical\Operations::class, 'logicalXor'],
+ 'argumentCount' => '1+',
+ ],
+ 'YEAR' => [
+ 'category' => Category::CATEGORY_DATE_AND_TIME,
+ 'functionCall' => [DateTimeExcel\DateParts::class, 'year'],
+ 'argumentCount' => '1',
+ ],
+ 'YEARFRAC' => [
+ 'category' => Category::CATEGORY_DATE_AND_TIME,
+ 'functionCall' => [DateTimeExcel\YearFrac::class, 'fraction'],
+ 'argumentCount' => '2,3',
+ ],
+ 'YIELD' => [
+ 'category' => Category::CATEGORY_FINANCIAL,
+ 'functionCall' => [Functions::class, 'DUMMY'],
+ 'argumentCount' => '6,7',
+ ],
+ 'YIELDDISC' => [
+ 'category' => Category::CATEGORY_FINANCIAL,
+ 'functionCall' => [Financial\Securities\Yields::class, 'yieldDiscounted'],
+ 'argumentCount' => '4,5',
+ ],
+ 'YIELDMAT' => [
+ 'category' => Category::CATEGORY_FINANCIAL,
+ 'functionCall' => [Financial\Securities\Yields::class, 'yieldAtMaturity'],
+ 'argumentCount' => '5,6',
+ ],
+ 'ZTEST' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical\Distributions\StandardNormal::class, 'zTest'],
+ 'argumentCount' => '2-3',
+ ],
+ 'Z.TEST' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical\Distributions\StandardNormal::class, 'zTest'],
+ 'argumentCount' => '2-3',
+ ],
+ ];
+
+ /**
+ * Internal functions used for special control purposes.
+ */
+ private static array $controlFunctions = [
+ 'MKMATRIX' => [
+ 'argumentCount' => '*',
+ 'functionCall' => [Internal\MakeMatrix::class, 'make'],
+ ],
+ 'NAME.ERROR' => [
+ 'argumentCount' => '*',
+ 'functionCall' => [ExcelError::class, 'NAME'],
+ ],
+ 'WILDCARDMATCH' => [
+ 'argumentCount' => '2',
+ 'functionCall' => [Internal\WildcardMatch::class, 'compare'],
+ ],
+ ];
+
+ public function __construct(?Spreadsheet $spreadsheet = null)
+ {
+ $this->spreadsheet = $spreadsheet;
+ $this->cyclicReferenceStack = new CyclicReferenceStack();
+ $this->debugLog = new Logger($this->cyclicReferenceStack);
+ $this->branchPruner = new BranchPruner($this->branchPruningEnabled);
+ self::$referenceHelper = ReferenceHelper::getInstance();
+ }
+
+ private static function loadLocales(): void
+ {
+ $localeFileDirectory = __DIR__ . '/locale/';
+ $localeFileNames = glob($localeFileDirectory . '*', GLOB_ONLYDIR) ?: [];
+ foreach ($localeFileNames as $filename) {
+ $filename = substr($filename, strlen($localeFileDirectory));
+ if ($filename != 'en') {
+ self::$validLocaleLanguages[] = $filename;
+ }
+ }
+ }
+
+ /**
+ * Get an instance of this class.
+ *
+ * @param ?Spreadsheet $spreadsheet Injected spreadsheet for working with a PhpSpreadsheet Spreadsheet object,
+ * or NULL to create a standalone calculation engine
+ */
+ public static function getInstance(?Spreadsheet $spreadsheet = null): self
+ {
+ if ($spreadsheet !== null) {
+ $instance = $spreadsheet->getCalculationEngine();
+ if (isset($instance)) {
+ return $instance;
+ }
+ }
+
+ if (!self::$instance) {
+ self::$instance = new self();
+ }
+
+ return self::$instance;
+ }
+
+ /**
+ * Flush the calculation cache for any existing instance of this class
+ * but only if a Calculation instance exists.
+ */
+ public function flushInstance(): void
+ {
+ $this->clearCalculationCache();
+ $this->branchPruner->clearBranchStore();
+ }
+
+ /**
+ * Get the Logger for this calculation engine instance.
+ */
+ public function getDebugLog(): Logger
+ {
+ return $this->debugLog;
+ }
+
+ /**
+ * __clone implementation. Cloning should not be allowed in a Singleton!
+ */
+ final public function __clone()
+ {
+ throw new Exception('Cloning the calculation engine is not allowed!');
+ }
+
+ /**
+ * Return the locale-specific translation of TRUE.
+ *
+ * @return string locale-specific translation of TRUE
+ */
+ public static function getTRUE(): string
+ {
+ return self::$localeBoolean['TRUE'];
+ }
+
+ /**
+ * Return the locale-specific translation of FALSE.
+ *
+ * @return string locale-specific translation of FALSE
+ */
+ public static function getFALSE(): string
+ {
+ return self::$localeBoolean['FALSE'];
+ }
+
+ /**
+ * Set the Array Return Type (Array or Value of first element in the array).
+ *
+ * @param string $returnType Array return type
+ *
+ * @return bool Success or failure
+ */
+ public static function setArrayReturnType(string $returnType): bool
+ {
+ if (
+ ($returnType == self::RETURN_ARRAY_AS_VALUE)
+ || ($returnType == self::RETURN_ARRAY_AS_ERROR)
+ || ($returnType == self::RETURN_ARRAY_AS_ARRAY)
+ ) {
+ self::$returnArrayAsType = $returnType;
+
+ return true;
+ }
+
+ return false;
+ }
+
+ /**
+ * Return the Array Return Type (Array or Value of first element in the array).
+ *
+ * @return string $returnType Array return type
+ */
+ public static function getArrayReturnType(): string
+ {
+ return self::$returnArrayAsType;
+ }
+
+ /**
+ * Is calculation caching enabled?
+ */
+ public function getCalculationCacheEnabled(): bool
+ {
+ return $this->calculationCacheEnabled;
+ }
+
+ /**
+ * Enable/disable calculation cache.
+ */
+ public function setCalculationCacheEnabled(bool $calculationCacheEnabled): void
+ {
+ $this->calculationCacheEnabled = $calculationCacheEnabled;
+ $this->clearCalculationCache();
+ }
+
+ /**
+ * Enable calculation cache.
+ */
+ public function enableCalculationCache(): void
+ {
+ $this->setCalculationCacheEnabled(true);
+ }
+
+ /**
+ * Disable calculation cache.
+ */
+ public function disableCalculationCache(): void
+ {
+ $this->setCalculationCacheEnabled(false);
+ }
+
+ /**
+ * Clear calculation cache.
+ */
+ public function clearCalculationCache(): void
+ {
+ $this->calculationCache = [];
+ }
+
+ /**
+ * Clear calculation cache for a specified worksheet.
+ */
+ public function clearCalculationCacheForWorksheet(string $worksheetName): void
+ {
+ if (isset($this->calculationCache[$worksheetName])) {
+ unset($this->calculationCache[$worksheetName]);
+ }
+ }
+
+ /**
+ * Rename calculation cache for a specified worksheet.
+ */
+ public function renameCalculationCacheForWorksheet(string $fromWorksheetName, string $toWorksheetName): void
+ {
+ if (isset($this->calculationCache[$fromWorksheetName])) {
+ $this->calculationCache[$toWorksheetName] = &$this->calculationCache[$fromWorksheetName];
+ unset($this->calculationCache[$fromWorksheetName]);
+ }
+ }
+
+ /**
+ * Enable/disable calculation cache.
+ */
+ public function setBranchPruningEnabled(mixed $enabled): void
+ {
+ $this->branchPruningEnabled = $enabled;
+ $this->branchPruner = new BranchPruner($this->branchPruningEnabled);
+ }
+
+ public function enableBranchPruning(): void
+ {
+ $this->setBranchPruningEnabled(true);
+ }
+
+ public function disableBranchPruning(): void
+ {
+ $this->setBranchPruningEnabled(false);
+ }
+
+ /**
+ * Get the currently defined locale code.
+ */
+ public function getLocale(): string
+ {
+ return self::$localeLanguage;
+ }
+
+ private function getLocaleFile(string $localeDir, string $locale, string $language, string $file): string
+ {
+ $localeFileName = $localeDir . str_replace('_', DIRECTORY_SEPARATOR, $locale)
+ . DIRECTORY_SEPARATOR . $file;
+ if (!file_exists($localeFileName)) {
+ // If there isn't a locale specific file, look for a language specific file
+ $localeFileName = $localeDir . $language . DIRECTORY_SEPARATOR . $file;
+ if (!file_exists($localeFileName)) {
+ throw new Exception('Locale file not found');
+ }
+ }
+
+ return $localeFileName;
+ }
+
+ /**
+ * Set the locale code.
+ *
+ * @param string $locale The locale to use for formula translation, eg: 'en_us'
+ */
+ public function setLocale(string $locale): bool
+ {
+ // Identify our locale and language
+ $language = $locale = strtolower($locale);
+ if (str_contains($locale, '_')) {
+ [$language] = explode('_', $locale);
+ }
+ if (count(self::$validLocaleLanguages) == 1) {
+ self::loadLocales();
+ }
+
+ // Test whether we have any language data for this language (any locale)
+ if (in_array($language, self::$validLocaleLanguages, true)) {
+ // initialise language/locale settings
+ self::$localeFunctions = [];
+ self::$localeArgumentSeparator = ',';
+ self::$localeBoolean = ['TRUE' => 'TRUE', 'FALSE' => 'FALSE', 'NULL' => 'NULL'];
+
+ // Default is US English, if user isn't requesting US english, then read the necessary data from the locale files
+ if ($locale !== 'en_us') {
+ $localeDir = implode(DIRECTORY_SEPARATOR, [__DIR__, 'locale', null]);
+
+ // Search for a file with a list of function names for locale
+ try {
+ $functionNamesFile = $this->getLocaleFile($localeDir, $locale, $language, 'functions');
+ } catch (Exception $e) {
+ return false;
+ }
+
+ // Retrieve the list of locale or language specific function names
+ $localeFunctions = file($functionNamesFile, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES) ?: [];
+ foreach ($localeFunctions as $localeFunction) {
+ [$localeFunction] = explode('##', $localeFunction); // Strip out comments
+ if (str_contains($localeFunction, '=')) {
+ [$fName, $lfName] = array_map('trim', explode('=', $localeFunction));
+ if ((str_starts_with($fName, '*') || isset(self::$phpSpreadsheetFunctions[$fName])) && ($lfName != '') && ($fName != $lfName)) {
+ self::$localeFunctions[$fName] = $lfName;
+ }
+ }
+ }
+ // Default the TRUE and FALSE constants to the locale names of the TRUE() and FALSE() functions
+ if (isset(self::$localeFunctions['TRUE'])) {
+ self::$localeBoolean['TRUE'] = self::$localeFunctions['TRUE'];
+ }
+ if (isset(self::$localeFunctions['FALSE'])) {
+ self::$localeBoolean['FALSE'] = self::$localeFunctions['FALSE'];
+ }
+
+ try {
+ $configFile = $this->getLocaleFile($localeDir, $locale, $language, 'config');
+ } catch (Exception) {
+ return false;
+ }
+
+ $localeSettings = file($configFile, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES) ?: [];
+ foreach ($localeSettings as $localeSetting) {
+ [$localeSetting] = explode('##', $localeSetting); // Strip out comments
+ if (str_contains($localeSetting, '=')) {
+ [$settingName, $settingValue] = array_map('trim', explode('=', $localeSetting));
+ $settingName = strtoupper($settingName);
+ if ($settingValue !== '') {
+ switch ($settingName) {
+ case 'ARGUMENTSEPARATOR':
+ self::$localeArgumentSeparator = $settingValue;
+
+ break;
+ }
+ }
+ }
+ }
+ }
+
+ self::$functionReplaceFromExcel = self::$functionReplaceToExcel
+ = self::$functionReplaceFromLocale = self::$functionReplaceToLocale = null;
+ self::$localeLanguage = $locale;
+
+ return true;
+ }
+
+ return false;
+ }
+
+ public static function translateSeparator(
+ string $fromSeparator,
+ string $toSeparator,
+ string $formula,
+ int &$inBracesLevel,
+ string $openBrace = self::FORMULA_OPEN_FUNCTION_BRACE,
+ string $closeBrace = self::FORMULA_CLOSE_FUNCTION_BRACE
+ ): string {
+ $strlen = mb_strlen($formula);
+ for ($i = 0; $i < $strlen; ++$i) {
+ $chr = mb_substr($formula, $i, 1);
+ switch ($chr) {
+ case $openBrace:
+ ++$inBracesLevel;
+
+ break;
+ case $closeBrace:
+ --$inBracesLevel;
+
+ break;
+ case $fromSeparator:
+ if ($inBracesLevel > 0) {
+ $formula = mb_substr($formula, 0, $i) . $toSeparator . mb_substr($formula, $i + 1);
+ }
+ }
+ }
+
+ return $formula;
+ }
+
+ private static function translateFormulaBlock(
+ array $from,
+ array $to,
+ string $formula,
+ int &$inFunctionBracesLevel,
+ int &$inMatrixBracesLevel,
+ string $fromSeparator,
+ string $toSeparator
+ ): string {
+ // Function Names
+ $formula = (string) preg_replace($from, $to, $formula);
+
+ // Temporarily adjust matrix separators so that they won't be confused with function arguments
+ $formula = self::translateSeparator(';', '|', $formula, $inMatrixBracesLevel, self::FORMULA_OPEN_MATRIX_BRACE, self::FORMULA_CLOSE_MATRIX_BRACE);
+ $formula = self::translateSeparator(',', '!', $formula, $inMatrixBracesLevel, self::FORMULA_OPEN_MATRIX_BRACE, self::FORMULA_CLOSE_MATRIX_BRACE);
+ // Function Argument Separators
+ $formula = self::translateSeparator($fromSeparator, $toSeparator, $formula, $inFunctionBracesLevel);
+ // Restore matrix separators
+ $formula = self::translateSeparator('|', ';', $formula, $inMatrixBracesLevel, self::FORMULA_OPEN_MATRIX_BRACE, self::FORMULA_CLOSE_MATRIX_BRACE);
+ $formula = self::translateSeparator('!', ',', $formula, $inMatrixBracesLevel, self::FORMULA_OPEN_MATRIX_BRACE, self::FORMULA_CLOSE_MATRIX_BRACE);
+
+ return $formula;
+ }
+
+ private static function translateFormula(array $from, array $to, string $formula, string $fromSeparator, string $toSeparator): string
+ {
+ // Convert any Excel function names and constant names to the required language;
+ // and adjust function argument separators
+ if (self::$localeLanguage !== 'en_us') {
+ $inFunctionBracesLevel = 0;
+ $inMatrixBracesLevel = 0;
+ // If there is the possibility of separators within a quoted string, then we treat them as literals
+ if (str_contains($formula, self::FORMULA_STRING_QUOTE)) {
+ // So instead we skip replacing in any quoted strings by only replacing in every other array element
+ // after we've exploded the formula
+ $temp = explode(self::FORMULA_STRING_QUOTE, $formula);
+ $notWithinQuotes = false;
+ foreach ($temp as &$value) {
+ // Only adjust in alternating array entries
+ $notWithinQuotes = $notWithinQuotes === false;
+ if ($notWithinQuotes === true) {
+ $value = self::translateFormulaBlock($from, $to, $value, $inFunctionBracesLevel, $inMatrixBracesLevel, $fromSeparator, $toSeparator);
+ }
+ }
+ unset($value);
+ // Then rebuild the formula string
+ $formula = implode(self::FORMULA_STRING_QUOTE, $temp);
+ } else {
+ // If there's no quoted strings, then we do a simple count/replace
+ $formula = self::translateFormulaBlock($from, $to, $formula, $inFunctionBracesLevel, $inMatrixBracesLevel, $fromSeparator, $toSeparator);
+ }
+ }
+
+ return $formula;
+ }
+
+ /** @var ?array */
+ private static ?array $functionReplaceFromExcel;
+
+ /** @var ?array */
+ private static ?array $functionReplaceToLocale;
+
+ /**
+ * @deprecated 1.30.0 use translateFormulaToLocale() instead
+ *
+ * @codeCoverageIgnore
+ */
+ public function _translateFormulaToLocale(string $formula): string
+ {
+ return $this->translateFormulaToLocale($formula);
+ }
+
+ public function translateFormulaToLocale(string $formula): string
+ {
+ $formula = preg_replace(self::CALCULATION_REGEXP_STRIP_XLFN_XLWS, '', $formula) ?? '';
+ // Build list of function names and constants for translation
+ if (self::$functionReplaceFromExcel === null) {
+ self::$functionReplaceFromExcel = [];
+ foreach (array_keys(self::$localeFunctions) as $excelFunctionName) {
+ self::$functionReplaceFromExcel[] = '/(@?[^\w\.])' . preg_quote($excelFunctionName, '/') . '([\s]*\()/ui';
+ }
+ foreach (array_keys(self::$localeBoolean) as $excelBoolean) {
+ self::$functionReplaceFromExcel[] = '/(@?[^\w\.])' . preg_quote($excelBoolean, '/') . '([^\w\.])/ui';
+ }
+ }
+
+ if (self::$functionReplaceToLocale === null) {
+ self::$functionReplaceToLocale = [];
+ foreach (self::$localeFunctions as $localeFunctionName) {
+ self::$functionReplaceToLocale[] = '$1' . trim($localeFunctionName) . '$2';
+ }
+ foreach (self::$localeBoolean as $localeBoolean) {
+ self::$functionReplaceToLocale[] = '$1' . trim($localeBoolean) . '$2';
+ }
+ }
+
+ return self::translateFormula(
+ self::$functionReplaceFromExcel,
+ self::$functionReplaceToLocale,
+ $formula,
+ ',',
+ self::$localeArgumentSeparator
+ );
+ }
+
+ /** @var ?array */
+ private static ?array $functionReplaceFromLocale;
+
+ /** @var ?array */
+ private static ?array $functionReplaceToExcel;
+
+ /**
+ * @deprecated 1.30.0 use translateFormulaToEnglish() instead
+ *
+ * @codeCoverageIgnore
+ */
+ public function _translateFormulaToEnglish(string $formula): string
+ {
+ return $this->translateFormulaToEnglish($formula);
+ }
+
+ public function translateFormulaToEnglish(string $formula): string
+ {
+ if (self::$functionReplaceFromLocale === null) {
+ self::$functionReplaceFromLocale = [];
+ foreach (self::$localeFunctions as $localeFunctionName) {
+ self::$functionReplaceFromLocale[] = '/(@?[^\w\.])' . preg_quote($localeFunctionName, '/') . '([\s]*\()/ui';
+ }
+ foreach (self::$localeBoolean as $excelBoolean) {
+ self::$functionReplaceFromLocale[] = '/(@?[^\w\.])' . preg_quote($excelBoolean, '/') . '([^\w\.])/ui';
+ }
+ }
+
+ if (self::$functionReplaceToExcel === null) {
+ self::$functionReplaceToExcel = [];
+ foreach (array_keys(self::$localeFunctions) as $excelFunctionName) {
+ self::$functionReplaceToExcel[] = '$1' . trim($excelFunctionName) . '$2';
+ }
+ foreach (array_keys(self::$localeBoolean) as $excelBoolean) {
+ self::$functionReplaceToExcel[] = '$1' . trim($excelBoolean) . '$2';
+ }
+ }
+
+ return self::translateFormula(self::$functionReplaceFromLocale, self::$functionReplaceToExcel, $formula, self::$localeArgumentSeparator, ',');
+ }
+
+ public static function localeFunc(string $function): string
+ {
+ if (self::$localeLanguage !== 'en_us') {
+ $functionName = trim($function, '(');
+ if (isset(self::$localeFunctions[$functionName])) {
+ $brace = ($functionName != $function);
+ $function = self::$localeFunctions[$functionName];
+ if ($brace) {
+ $function .= '(';
+ }
+ }
+ }
+
+ return $function;
+ }
+
+ /**
+ * Wrap string values in quotes.
+ */
+ public static function wrapResult(mixed $value): mixed
+ {
+ if (is_string($value)) {
+ // Error values cannot be "wrapped"
+ if (preg_match('/^' . self::CALCULATION_REGEXP_ERROR . '$/i', $value, $match)) {
+ // Return Excel errors "as is"
+ return $value;
+ }
+
+ // Return strings wrapped in quotes
+ return self::FORMULA_STRING_QUOTE . $value . self::FORMULA_STRING_QUOTE;
+ } elseif ((is_float($value)) && ((is_nan($value)) || (is_infinite($value)))) {
+ // Convert numeric errors to NaN error
+ return ExcelError::NAN();
+ }
+
+ return $value;
+ }
+
+ /**
+ * Remove quotes used as a wrapper to identify string values.
+ */
+ public static function unwrapResult(mixed $value): mixed
+ {
+ if (is_string($value)) {
+ if ((isset($value[0])) && ($value[0] == self::FORMULA_STRING_QUOTE) && (substr($value, -1) == self::FORMULA_STRING_QUOTE)) {
+ return substr($value, 1, -1);
+ }
+ // Convert numeric errors to NAN error
+ } elseif ((is_float($value)) && ((is_nan($value)) || (is_infinite($value)))) {
+ return ExcelError::NAN();
+ }
+
+ return $value;
+ }
+
+ /**
+ * Calculate cell value (using formula from a cell ID)
+ * Retained for backward compatibility.
+ *
+ * @param ?Cell $cell Cell to calculate
+ */
+ public function calculate(?Cell $cell = null): mixed
+ {
+ try {
+ return $this->calculateCellValue($cell);
+ } catch (\Exception $e) {
+ throw new Exception($e->getMessage());
+ }
+ }
+
+ /**
+ * Calculate the value of a cell formula.
+ *
+ * @param ?Cell $cell Cell to calculate
+ * @param bool $resetLog Flag indicating whether the debug log should be reset or not
+ */
+ public function calculateCellValue(?Cell $cell = null, bool $resetLog = true): mixed
+ {
+ if ($cell === null) {
+ return null;
+ }
+
+ $returnArrayAsType = self::$returnArrayAsType;
+ if ($resetLog) {
+ // Initialise the logging settings if requested
+ $this->formulaError = null;
+ $this->debugLog->clearLog();
+ $this->cyclicReferenceStack->clear();
+ $this->cyclicFormulaCounter = 1;
+
+ self::$returnArrayAsType = self::RETURN_ARRAY_AS_ARRAY;
+ }
+
+ // Execute the calculation for the cell formula
+ $this->cellStack[] = [
+ 'sheet' => $cell->getWorksheet()->getTitle(),
+ 'cell' => $cell->getCoordinate(),
+ ];
+
+ $cellAddressAttempted = false;
+ $cellAddress = null;
+
+ try {
+ $result = self::unwrapResult($this->_calculateFormulaValue($cell->getValue(), $cell->getCoordinate(), $cell));
+ if ($this->spreadsheet === null) {
+ throw new Exception('null spreadsheet in calculateCellValue');
+ }
+ $cellAddressAttempted = true;
+ $cellAddress = array_pop($this->cellStack);
+ if ($cellAddress === null) {
+ throw new Exception('null cellAddress in calculateCellValue');
+ }
+ $testSheet = $this->spreadsheet->getSheetByName($cellAddress['sheet']);
+ if ($testSheet === null) {
+ throw new Exception('worksheet not found in calculateCellValue');
+ }
+ $testSheet->getCell($cellAddress['cell']);
+ } catch (\Exception $e) {
+ if (!$cellAddressAttempted) {
+ $cellAddress = array_pop($this->cellStack);
+ }
+ if ($this->spreadsheet !== null && is_array($cellAddress) && array_key_exists('sheet', $cellAddress)) {
+ $testSheet = $this->spreadsheet->getSheetByName($cellAddress['sheet']);
+ if ($testSheet !== null && array_key_exists('cell', $cellAddress)) {
+ $testSheet->getCell($cellAddress['cell']);
+ }
+ }
+
+ throw new Exception($e->getMessage(), $e->getCode(), $e);
+ }
+
+ if ((is_array($result)) && (self::$returnArrayAsType != self::RETURN_ARRAY_AS_ARRAY)) {
+ self::$returnArrayAsType = $returnArrayAsType;
+ $testResult = Functions::flattenArray($result);
+ if (self::$returnArrayAsType == self::RETURN_ARRAY_AS_ERROR) {
+ return ExcelError::VALUE();
+ }
+ // If there's only a single cell in the array, then we allow it
+ if (count($testResult) != 1) {
+ // If keys are numeric, then it's a matrix result rather than a cell range result, so we permit it
+ $r = array_keys($result);
+ $r = array_shift($r);
+ if (!is_numeric($r)) {
+ return ExcelError::VALUE();
+ }
+ if (is_array($result[$r])) {
+ $c = array_keys($result[$r]);
+ $c = array_shift($c);
+ if (!is_numeric($c)) {
+ return ExcelError::VALUE();
+ }
+ }
+ }
+ $result = array_shift($testResult);
+ }
+ self::$returnArrayAsType = $returnArrayAsType;
+
+ if ($result === null && $cell->getWorksheet()->getSheetView()->getShowZeros()) {
+ return 0;
+ } elseif ((is_float($result)) && ((is_nan($result)) || (is_infinite($result)))) {
+ return ExcelError::NAN();
+ }
+
+ return $result;
+ }
+
+ /**
+ * Validate and parse a formula string.
+ *
+ * @param string $formula Formula to parse
+ */
+ public function parseFormula(string $formula): array|bool
+ {
+ // Basic validation that this is indeed a formula
+ // We return an empty array if not
+ $formula = trim($formula);
+ if ((!isset($formula[0])) || ($formula[0] != '=')) {
+ return [];
+ }
+ $formula = ltrim(substr($formula, 1));
+ if (!isset($formula[0])) {
+ return [];
+ }
+
+ // Parse the formula and return the token stack
+ return $this->internalParseFormula($formula);
+ }
+
+ /**
+ * Calculate the value of a formula.
+ *
+ * @param string $formula Formula to parse
+ * @param ?string $cellID Address of the cell to calculate
+ * @param ?Cell $cell Cell to calculate
+ */
+ public function calculateFormula(string $formula, ?string $cellID = null, ?Cell $cell = null): mixed
+ {
+ // Initialise the logging settings
+ $this->formulaError = null;
+ $this->debugLog->clearLog();
+ $this->cyclicReferenceStack->clear();
+
+ $resetCache = $this->getCalculationCacheEnabled();
+ if ($this->spreadsheet !== null && $cellID === null && $cell === null) {
+ $cellID = 'A1';
+ $cell = $this->spreadsheet->getActiveSheet()->getCell($cellID);
+ } else {
+ // Disable calculation cacheing because it only applies to cell calculations, not straight formulae
+ // But don't actually flush any cache
+ $this->calculationCacheEnabled = false;
+ }
+
+ // Execute the calculation
+ try {
+ $result = self::unwrapResult($this->_calculateFormulaValue($formula, $cellID, $cell));
+ } catch (\Exception $e) {
+ throw new Exception($e->getMessage());
+ }
+
+ if ($this->spreadsheet === null) {
+ // Reset calculation cacheing to its previous state
+ $this->calculationCacheEnabled = $resetCache;
+ }
+
+ return $result;
+ }
+
+ public function getValueFromCache(string $cellReference, mixed &$cellValue): bool
+ {
+ $this->debugLog->writeDebugLog('Testing cache value for cell %s', $cellReference);
+ // Is calculation cacheing enabled?
+ // If so, is the required value present in calculation cache?
+ if (($this->calculationCacheEnabled) && (isset($this->calculationCache[$cellReference]))) {
+ $this->debugLog->writeDebugLog('Retrieving value for cell %s from cache', $cellReference);
+ // Return the cached result
+
+ $cellValue = $this->calculationCache[$cellReference];
+
+ return true;
+ }
+
+ return false;
+ }
+
+ public function saveValueToCache(string $cellReference, mixed $cellValue): void
+ {
+ if ($this->calculationCacheEnabled) {
+ $this->calculationCache[$cellReference] = $cellValue;
+ }
+ }
+
+ /**
+ * Parse a cell formula and calculate its value.
+ *
+ * @param string $formula The formula to parse and calculate
+ * @param ?string $cellID The ID (e.g. A3) of the cell that we are calculating
+ * @param ?Cell $cell Cell to calculate
+ * @param bool $ignoreQuotePrefix If set to true, evaluate the formyla even if the referenced cell is quote prefixed
+ */
+ public function _calculateFormulaValue(string $formula, ?string $cellID = null, ?Cell $cell = null, bool $ignoreQuotePrefix = false): mixed
+ {
+ $cellValue = null;
+
+ // Quote-Prefixed cell values cannot be formulae, but are treated as strings
+ if ($cell !== null && $ignoreQuotePrefix === false && $cell->getStyle()->getQuotePrefix() === true) {
+ return self::wrapResult((string) $formula);
+ }
+
+ if (preg_match('/^=\s*cmd\s*\|/miu', $formula) !== 0) {
+ return self::wrapResult($formula);
+ }
+
+ // Basic validation that this is indeed a formula
+ // We simply return the cell value if not
+ $formula = trim($formula);
+ if ($formula[0] != '=') {
+ return self::wrapResult($formula);
+ }
+ $formula = ltrim(substr($formula, 1));
+ if (!isset($formula[0])) {
+ return self::wrapResult($formula);
+ }
+
+ $pCellParent = ($cell !== null) ? $cell->getWorksheet() : null;
+ $wsTitle = ($pCellParent !== null) ? $pCellParent->getTitle() : "\x00Wrk";
+ $wsCellReference = $wsTitle . '!' . $cellID;
+
+ if (($cellID !== null) && ($this->getValueFromCache($wsCellReference, $cellValue))) {
+ return $cellValue;
+ }
+ $this->debugLog->writeDebugLog('Evaluating formula for cell %s', $wsCellReference);
+
+ if (($wsTitle[0] !== "\x00") && ($this->cyclicReferenceStack->onStack($wsCellReference))) {
+ if ($this->cyclicFormulaCount <= 0) {
+ $this->cyclicFormulaCell = '';
+
+ return $this->raiseFormulaError('Cyclic Reference in Formula');
+ } elseif ($this->cyclicFormulaCell === $wsCellReference) {
+ ++$this->cyclicFormulaCounter;
+ if ($this->cyclicFormulaCounter >= $this->cyclicFormulaCount) {
+ $this->cyclicFormulaCell = '';
+
+ return $cellValue;
+ }
+ } elseif ($this->cyclicFormulaCell == '') {
+ if ($this->cyclicFormulaCounter >= $this->cyclicFormulaCount) {
+ return $cellValue;
+ }
+ $this->cyclicFormulaCell = $wsCellReference;
+ }
+ }
+
+ $this->debugLog->writeDebugLog('Formula for cell %s is %s', $wsCellReference, $formula);
+ // Parse the formula onto the token stack and calculate the value
+ $this->cyclicReferenceStack->push($wsCellReference);
+
+ $cellValue = $this->processTokenStack($this->internalParseFormula($formula, $cell), $cellID, $cell);
+ $this->cyclicReferenceStack->pop();
+
+ // Save to calculation cache
+ if ($cellID !== null) {
+ $this->saveValueToCache($wsCellReference, $cellValue);
+ }
+
+ // Return the calculated value
+ return $cellValue;
+ }
+
+ /**
+ * Ensure that paired matrix operands are both matrices and of the same size.
+ *
+ * @param mixed $operand1 First matrix operand
+ * @param mixed $operand2 Second matrix operand
+ * @param int $resize Flag indicating whether the matrices should be resized to match
+ * and (if so), whether the smaller dimension should grow or the
+ * larger should shrink.
+ * 0 = no resize
+ * 1 = shrink to fit
+ * 2 = extend to fit
+ */
+ private static function checkMatrixOperands(mixed &$operand1, mixed &$operand2, int $resize = 1): array
+ {
+ // Examine each of the two operands, and turn them into an array if they aren't one already
+ // Note that this function should only be called if one or both of the operand is already an array
+ if (!is_array($operand1)) {
+ [$matrixRows, $matrixColumns] = self::getMatrixDimensions($operand2);
+ $operand1 = array_fill(0, $matrixRows, array_fill(0, $matrixColumns, $operand1));
+ $resize = 0;
+ } elseif (!is_array($operand2)) {
+ [$matrixRows, $matrixColumns] = self::getMatrixDimensions($operand1);
+ $operand2 = array_fill(0, $matrixRows, array_fill(0, $matrixColumns, $operand2));
+ $resize = 0;
+ }
+
+ [$matrix1Rows, $matrix1Columns] = self::getMatrixDimensions($operand1);
+ [$matrix2Rows, $matrix2Columns] = self::getMatrixDimensions($operand2);
+ if (($matrix1Rows == $matrix2Columns) && ($matrix2Rows == $matrix1Columns)) {
+ $resize = 1;
+ }
+
+ if ($resize == 2) {
+ // Given two matrices of (potentially) unequal size, convert the smaller in each dimension to match the larger
+ self::resizeMatricesExtend($operand1, $operand2, $matrix1Rows, $matrix1Columns, $matrix2Rows, $matrix2Columns);
+ } elseif ($resize == 1) {
+ // Given two matrices of (potentially) unequal size, convert the larger in each dimension to match the smaller
+ self::resizeMatricesShrink($operand1, $operand2, $matrix1Rows, $matrix1Columns, $matrix2Rows, $matrix2Columns);
+ }
+ [$matrix1Rows, $matrix1Columns] = self::getMatrixDimensions($operand1);
+ [$matrix2Rows, $matrix2Columns] = self::getMatrixDimensions($operand2);
+
+ return [$matrix1Rows, $matrix1Columns, $matrix2Rows, $matrix2Columns];
+ }
+
+ /**
+ * Read the dimensions of a matrix, and re-index it with straight numeric keys starting from row 0, column 0.
+ *
+ * @param array $matrix matrix operand
+ *
+ * @return int[] An array comprising the number of rows, and number of columns
+ */
+ public static function getMatrixDimensions(array &$matrix): array
+ {
+ $matrixRows = count($matrix);
+ $matrixColumns = 0;
+ foreach ($matrix as $rowKey => $rowValue) {
+ if (!is_array($rowValue)) {
+ $matrix[$rowKey] = [$rowValue];
+ $matrixColumns = max(1, $matrixColumns);
+ } else {
+ $matrix[$rowKey] = array_values($rowValue);
+ $matrixColumns = max(count($rowValue), $matrixColumns);
+ }
+ }
+ $matrix = array_values($matrix);
+
+ return [$matrixRows, $matrixColumns];
+ }
+
+ /**
+ * Ensure that paired matrix operands are both matrices of the same size.
+ *
+ * @param array $matrix1 First matrix operand
+ * @param array $matrix2 Second matrix operand
+ * @param int $matrix1Rows Row size of first matrix operand
+ * @param int $matrix1Columns Column size of first matrix operand
+ * @param int $matrix2Rows Row size of second matrix operand
+ * @param int $matrix2Columns Column size of second matrix operand
+ */
+ private static function resizeMatricesShrink(array &$matrix1, array &$matrix2, int $matrix1Rows, int $matrix1Columns, int $matrix2Rows, int $matrix2Columns): void
+ {
+ if (($matrix2Columns < $matrix1Columns) || ($matrix2Rows < $matrix1Rows)) {
+ if ($matrix2Rows < $matrix1Rows) {
+ for ($i = $matrix2Rows; $i < $matrix1Rows; ++$i) {
+ unset($matrix1[$i]);
+ }
+ }
+ if ($matrix2Columns < $matrix1Columns) {
+ for ($i = 0; $i < $matrix1Rows; ++$i) {
+ for ($j = $matrix2Columns; $j < $matrix1Columns; ++$j) {
+ unset($matrix1[$i][$j]);
+ }
+ }
+ }
+ }
+
+ if (($matrix1Columns < $matrix2Columns) || ($matrix1Rows < $matrix2Rows)) {
+ if ($matrix1Rows < $matrix2Rows) {
+ for ($i = $matrix1Rows; $i < $matrix2Rows; ++$i) {
+ unset($matrix2[$i]);
+ }
+ }
+ if ($matrix1Columns < $matrix2Columns) {
+ for ($i = 0; $i < $matrix2Rows; ++$i) {
+ for ($j = $matrix1Columns; $j < $matrix2Columns; ++$j) {
+ unset($matrix2[$i][$j]);
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ * Ensure that paired matrix operands are both matrices of the same size.
+ *
+ * @param array $matrix1 First matrix operand
+ * @param array $matrix2 Second matrix operand
+ * @param int $matrix1Rows Row size of first matrix operand
+ * @param int $matrix1Columns Column size of first matrix operand
+ * @param int $matrix2Rows Row size of second matrix operand
+ * @param int $matrix2Columns Column size of second matrix operand
+ */
+ private static function resizeMatricesExtend(array &$matrix1, array &$matrix2, int $matrix1Rows, int $matrix1Columns, int $matrix2Rows, int $matrix2Columns): void
+ {
+ if (($matrix2Columns < $matrix1Columns) || ($matrix2Rows < $matrix1Rows)) {
+ if ($matrix2Columns < $matrix1Columns) {
+ for ($i = 0; $i < $matrix2Rows; ++$i) {
+ $x = $matrix2[$i][$matrix2Columns - 1];
+ for ($j = $matrix2Columns; $j < $matrix1Columns; ++$j) {
+ $matrix2[$i][$j] = $x;
+ }
+ }
+ }
+ if ($matrix2Rows < $matrix1Rows) {
+ $x = $matrix2[$matrix2Rows - 1];
+ for ($i = 0; $i < $matrix1Rows; ++$i) {
+ $matrix2[$i] = $x;
+ }
+ }
+ }
+
+ if (($matrix1Columns < $matrix2Columns) || ($matrix1Rows < $matrix2Rows)) {
+ if ($matrix1Columns < $matrix2Columns) {
+ for ($i = 0; $i < $matrix1Rows; ++$i) {
+ $x = $matrix1[$i][$matrix1Columns - 1];
+ for ($j = $matrix1Columns; $j < $matrix2Columns; ++$j) {
+ $matrix1[$i][$j] = $x;
+ }
+ }
+ }
+ if ($matrix1Rows < $matrix2Rows) {
+ $x = $matrix1[$matrix1Rows - 1];
+ for ($i = 0; $i < $matrix2Rows; ++$i) {
+ $matrix1[$i] = $x;
+ }
+ }
+ }
+ }
+
+ /**
+ * Format details of an operand for display in the log (based on operand type).
+ *
+ * @param mixed $value First matrix operand
+ */
+ private function showValue(mixed $value): mixed
+ {
+ if ($this->debugLog->getWriteDebugLog()) {
+ $testArray = Functions::flattenArray($value);
+ if (count($testArray) == 1) {
+ $value = array_pop($testArray);
+ }
+
+ if (is_array($value)) {
+ $returnMatrix = [];
+ $pad = $rpad = ', ';
+ foreach ($value as $row) {
+ if (is_array($row)) {
+ $returnMatrix[] = implode($pad, array_map([$this, 'showValue'], $row));
+ $rpad = '; ';
+ } else {
+ $returnMatrix[] = $this->showValue($row);
+ }
+ }
+
+ return '{ ' . implode($rpad, $returnMatrix) . ' }';
+ } elseif (is_string($value) && (trim($value, self::FORMULA_STRING_QUOTE) == $value)) {
+ return self::FORMULA_STRING_QUOTE . $value . self::FORMULA_STRING_QUOTE;
+ } elseif (is_bool($value)) {
+ return ($value) ? self::$localeBoolean['TRUE'] : self::$localeBoolean['FALSE'];
+ } elseif ($value === null) {
+ return self::$localeBoolean['NULL'];
+ }
+ }
+
+ return Functions::flattenSingleValue($value);
+ }
+
+ /**
+ * Format type and details of an operand for display in the log (based on operand type).
+ *
+ * @param mixed $value First matrix operand
+ */
+ private function showTypeDetails(mixed $value): ?string
+ {
+ if ($this->debugLog->getWriteDebugLog()) {
+ $testArray = Functions::flattenArray($value);
+ if (count($testArray) == 1) {
+ $value = array_pop($testArray);
+ }
+
+ if ($value === null) {
+ return 'a NULL value';
+ } elseif (is_float($value)) {
+ $typeString = 'a floating point number';
+ } elseif (is_int($value)) {
+ $typeString = 'an integer number';
+ } elseif (is_bool($value)) {
+ $typeString = 'a boolean';
+ } elseif (is_array($value)) {
+ $typeString = 'a matrix';
+ } else {
+ if ($value == '') {
+ return 'an empty string';
+ } elseif ($value[0] == '#') {
+ return 'a ' . $value . ' error';
+ }
+ $typeString = 'a string';
+ }
+
+ return $typeString . ' with a value of ' . $this->showValue($value);
+ }
+
+ return null;
+ }
+
+ /**
+ * @return false|string False indicates an error
+ */
+ private function convertMatrixReferences(string $formula): false|string
+ {
+ static $matrixReplaceFrom = [self::FORMULA_OPEN_MATRIX_BRACE, ';', self::FORMULA_CLOSE_MATRIX_BRACE];
+ static $matrixReplaceTo = ['MKMATRIX(MKMATRIX(', '),MKMATRIX(', '))'];
+
+ // Convert any Excel matrix references to the MKMATRIX() function
+ if (str_contains($formula, self::FORMULA_OPEN_MATRIX_BRACE)) {
+ // If there is the possibility of braces within a quoted string, then we don't treat those as matrix indicators
+ if (str_contains($formula, self::FORMULA_STRING_QUOTE)) {
+ // So instead we skip replacing in any quoted strings by only replacing in every other array element after we've exploded
+ // the formula
+ $temp = explode(self::FORMULA_STRING_QUOTE, $formula);
+ // Open and Closed counts used for trapping mismatched braces in the formula
+ $openCount = $closeCount = 0;
+ $notWithinQuotes = false;
+ foreach ($temp as &$value) {
+ // Only count/replace in alternating array entries
+ $notWithinQuotes = $notWithinQuotes === false;
+ if ($notWithinQuotes === true) {
+ $openCount += substr_count($value, self::FORMULA_OPEN_MATRIX_BRACE);
+ $closeCount += substr_count($value, self::FORMULA_CLOSE_MATRIX_BRACE);
+ $value = str_replace($matrixReplaceFrom, $matrixReplaceTo, $value);
+ }
+ }
+ unset($value);
+ // Then rebuild the formula string
+ $formula = implode(self::FORMULA_STRING_QUOTE, $temp);
+ } else {
+ // If there's no quoted strings, then we do a simple count/replace
+ $openCount = substr_count($formula, self::FORMULA_OPEN_MATRIX_BRACE);
+ $closeCount = substr_count($formula, self::FORMULA_CLOSE_MATRIX_BRACE);
+ $formula = str_replace($matrixReplaceFrom, $matrixReplaceTo, $formula);
+ }
+ // Trap for mismatched braces and trigger an appropriate error
+ if ($openCount < $closeCount) {
+ if ($openCount > 0) {
+ return $this->raiseFormulaError("Formula Error: Mismatched matrix braces '}'");
+ }
+
+ return $this->raiseFormulaError("Formula Error: Unexpected '}' encountered");
+ } elseif ($openCount > $closeCount) {
+ if ($closeCount > 0) {
+ return $this->raiseFormulaError("Formula Error: Mismatched matrix braces '{'");
+ }
+
+ return $this->raiseFormulaError("Formula Error: Unexpected '{' encountered");
+ }
+ }
+
+ return $formula;
+ }
+
+ /**
+ * Binary Operators.
+ * These operators always work on two values.
+ * Array key is the operator, the value indicates whether this is a left or right associative operator.
+ */
+ private static array $operatorAssociativity = [
+ '^' => 0, // Exponentiation
+ '*' => 0, '/' => 0, // Multiplication and Division
+ '+' => 0, '-' => 0, // Addition and Subtraction
+ '&' => 0, // Concatenation
+ '∪' => 0, '∩' => 0, ':' => 0, // Union, Intersect and Range
+ '>' => 0, '<' => 0, '=' => 0, '>=' => 0, '<=' => 0, '<>' => 0, // Comparison
+ ];
+
+ /**
+ * Comparison (Boolean) Operators.
+ * These operators work on two values, but always return a boolean result.
+ */
+ private static array $comparisonOperators = ['>' => true, '<' => true, '=' => true, '>=' => true, '<=' => true, '<>' => true];
+
+ /**
+ * Operator Precedence.
+ * This list includes all valid operators, whether binary (including boolean) or unary (such as %).
+ * Array key is the operator, the value is its precedence.
+ */
+ private static array $operatorPrecedence = [
+ ':' => 9, // Range
+ '∩' => 8, // Intersect
+ '∪' => 7, // Union
+ '~' => 6, // Negation
+ '%' => 5, // Percentage
+ '^' => 4, // Exponentiation
+ '*' => 3, '/' => 3, // Multiplication and Division
+ '+' => 2, '-' => 2, // Addition and Subtraction
+ '&' => 1, // Concatenation
+ '>' => 0, '<' => 0, '=' => 0, '>=' => 0, '<=' => 0, '<>' => 0, // Comparison
+ ];
+
+ // Convert infix to postfix notation
+
+ /**
+ * @return array|false
+ */
+ private function internalParseFormula(string $formula, ?Cell $cell = null): bool|array
+ {
+ if (($formula = $this->convertMatrixReferences(trim($formula))) === false) {
+ return false;
+ }
+
+ // If we're using cell caching, then $pCell may well be flushed back to the cache (which detaches the parent worksheet),
+ // so we store the parent worksheet so that we can re-attach it when necessary
+ $pCellParent = ($cell !== null) ? $cell->getWorksheet() : null;
+
+ $regexpMatchString = '/^((?' . self::CALCULATION_REGEXP_STRING
+ . ')|(?' . self::CALCULATION_REGEXP_FUNCTION
+ . ')|(?' . self::CALCULATION_REGEXP_CELLREF
+ . ')|(?' . self::CALCULATION_REGEXP_COLUMN_RANGE
+ . ')|(?' . self::CALCULATION_REGEXP_ROW_RANGE
+ . ')|(?' . self::CALCULATION_REGEXP_NUMBER
+ . ')|(?' . self::CALCULATION_REGEXP_OPENBRACE
+ . ')|(?' . self::CALCULATION_REGEXP_STRUCTURED_REFERENCE
+ . ')|(?' . self::CALCULATION_REGEXP_DEFINEDNAME
+ . ')|(?' . self::CALCULATION_REGEXP_ERROR
+ . '))/sui';
+
+ // Start with initialisation
+ $index = 0;
+ $stack = new Stack($this->branchPruner);
+ $output = [];
+ $expectingOperator = false; // We use this test in syntax-checking the expression to determine when a
+ // - is a negation or + is a positive operator rather than an operation
+ $expectingOperand = false; // We use this test in syntax-checking the expression to determine whether an operand
+ // should be null in a function call
+
+ // The guts of the lexical parser
+ // Loop through the formula extracting each operator and operand in turn
+ while (true) {
+ // Branch pruning: we adapt the output item to the context (it will
+ // be used to limit its computation)
+ $this->branchPruner->initialiseForLoop();
+
+ $opCharacter = $formula[$index]; // Get the first character of the value at the current index position
+
+ // Check for two-character operators (e.g. >=, <=, <>)
+ if ((isset(self::$comparisonOperators[$opCharacter])) && (strlen($formula) > $index) && (isset(self::$comparisonOperators[$formula[$index + 1]]))) {
+ $opCharacter .= $formula[++$index];
+ }
+ // Find out if we're currently at the beginning of a number, variable, cell/row/column reference,
+ // function, defined name, structured reference, parenthesis, error or operand
+ $isOperandOrFunction = (bool) preg_match($regexpMatchString, substr($formula, $index), $match);
+
+ $expectingOperatorCopy = $expectingOperator;
+ if ($opCharacter === '-' && !$expectingOperator) { // Is it a negation instead of a minus?
+ // Put a negation on the stack
+ $stack->push('Unary Operator', '~');
+ ++$index; // and drop the negation symbol
+ } elseif ($opCharacter === '%' && $expectingOperator) {
+ // Put a percentage on the stack
+ $stack->push('Unary Operator', '%');
+ ++$index;
+ } elseif ($opCharacter === '+' && !$expectingOperator) { // Positive (unary plus rather than binary operator plus) can be discarded?
+ ++$index; // Drop the redundant plus symbol
+ } elseif ((($opCharacter === '~') || ($opCharacter === '∩') || ($opCharacter === '∪')) && (!$isOperandOrFunction)) {
+ // We have to explicitly deny a tilde, union or intersect because they are legal
+ return $this->raiseFormulaError("Formula Error: Illegal character '~'"); // on the stack but not in the input expression
+ } elseif ((isset(self::CALCULATION_OPERATORS[$opCharacter]) || $isOperandOrFunction) && $expectingOperator) { // Are we putting an operator on the stack?
+ while (
+ $stack->count() > 0
+ && ($o2 = $stack->last())
+ && isset(self::CALCULATION_OPERATORS[$o2['value']])
+ && @(self::$operatorAssociativity[$opCharacter] ? self::$operatorPrecedence[$opCharacter] < self::$operatorPrecedence[$o2['value']] : self::$operatorPrecedence[$opCharacter] <= self::$operatorPrecedence[$o2['value']])
+ ) {
+ $output[] = $stack->pop(); // Swap operands and higher precedence operators from the stack to the output
+ }
+
+ // Finally put our current operator onto the stack
+ $stack->push('Binary Operator', $opCharacter);
+
+ ++$index;
+ $expectingOperator = false;
+ } elseif ($opCharacter === ')' && $expectingOperator) { // Are we expecting to close a parenthesis?
+ $expectingOperand = false;
+ while (($o2 = $stack->pop()) && $o2['value'] !== '(') { // Pop off the stack back to the last (
+ $output[] = $o2;
+ }
+ $d = $stack->last(2);
+
+ // Branch pruning we decrease the depth whether is it a function
+ // call or a parenthesis
+ $this->branchPruner->decrementDepth();
+
+ if (is_array($d) && preg_match('/^' . self::CALCULATION_REGEXP_FUNCTION . '$/miu', $d['value'], $matches)) {
+ // Did this parenthesis just close a function?
+ try {
+ $this->branchPruner->closingBrace($d['value']);
+ } catch (Exception $e) {
+ return $this->raiseFormulaError($e->getMessage(), $e->getCode(), $e);
+ }
+
+ $functionName = $matches[1]; // Get the function name
+ $d = $stack->pop();
+ $argumentCount = $d['value'] ?? 0; // See how many arguments there were (argument count is the next value stored on the stack)
+ $output[] = $d; // Dump the argument count on the output
+ $output[] = $stack->pop(); // Pop the function and push onto the output
+ if (isset(self::$controlFunctions[$functionName])) {
+ $expectedArgumentCount = self::$controlFunctions[$functionName]['argumentCount'];
+ } elseif (isset(self::$phpSpreadsheetFunctions[$functionName])) {
+ $expectedArgumentCount = self::$phpSpreadsheetFunctions[$functionName]['argumentCount'];
+ } else { // did we somehow push a non-function on the stack? this should never happen
+ return $this->raiseFormulaError('Formula Error: Internal error, non-function on stack');
+ }
+ // Check the argument count
+ $argumentCountError = false;
+ $expectedArgumentCountString = null;
+ if (is_numeric($expectedArgumentCount)) {
+ if ($expectedArgumentCount < 0) {
+ if ($argumentCount > abs($expectedArgumentCount)) {
+ $argumentCountError = true;
+ $expectedArgumentCountString = 'no more than ' . abs($expectedArgumentCount);
+ }
+ } else {
+ if ($argumentCount != $expectedArgumentCount) {
+ $argumentCountError = true;
+ $expectedArgumentCountString = $expectedArgumentCount;
+ }
+ }
+ } elseif ($expectedArgumentCount != '*') {
+ preg_match('/(\d*)([-+,])(\d*)/', $expectedArgumentCount, $argMatch);
+ switch ($argMatch[2] ?? '') {
+ case '+':
+ if ($argumentCount < $argMatch[1]) {
+ $argumentCountError = true;
+ $expectedArgumentCountString = $argMatch[1] . ' or more ';
+ }
+
+ break;
+ case '-':
+ if (($argumentCount < $argMatch[1]) || ($argumentCount > $argMatch[3])) {
+ $argumentCountError = true;
+ $expectedArgumentCountString = 'between ' . $argMatch[1] . ' and ' . $argMatch[3];
+ }
+
+ break;
+ case ',':
+ if (($argumentCount != $argMatch[1]) && ($argumentCount != $argMatch[3])) {
+ $argumentCountError = true;
+ $expectedArgumentCountString = 'either ' . $argMatch[1] . ' or ' . $argMatch[3];
+ }
+
+ break;
+ }
+ }
+ if ($argumentCountError) {
+ return $this->raiseFormulaError("Formula Error: Wrong number of arguments for $functionName() function: $argumentCount given, " . $expectedArgumentCountString . ' expected');
+ }
+ }
+ ++$index;
+ } elseif ($opCharacter === ',') { // Is this the separator for function arguments?
+ try {
+ $this->branchPruner->argumentSeparator();
+ } catch (Exception $e) {
+ return $this->raiseFormulaError($e->getMessage(), $e->getCode(), $e);
+ }
+
+ while (($o2 = $stack->pop()) && $o2['value'] !== '(') { // Pop off the stack back to the last (
+ $output[] = $o2; // pop the argument expression stuff and push onto the output
+ }
+ // If we've a comma when we're expecting an operand, then what we actually have is a null operand;
+ // so push a null onto the stack
+ if (($expectingOperand) || (!$expectingOperator)) {
+ $output[] = $stack->getStackItem('Empty Argument', null, 'NULL');
+ }
+ // make sure there was a function
+ $d = $stack->last(2);
+ if (!preg_match('/^' . self::CALCULATION_REGEXP_FUNCTION . '$/miu', $d['value'] ?? '', $matches)) {
+ // Can we inject a dummy function at this point so that the braces at least have some context
+ // because at least the braces are paired up (at this stage in the formula)
+ // MS Excel allows this if the content is cell references; but doesn't allow actual values,
+ // but at this point, we can't differentiate (so allow both)
+ return $this->raiseFormulaError('Formula Error: Unexpected ,');
+ }
+
+ /** @var array $d */
+ $d = $stack->pop();
+ ++$d['value']; // increment the argument count
+
+ $stack->pushStackItem($d);
+ $stack->push('Brace', '('); // put the ( back on, we'll need to pop back to it again
+
+ $expectingOperator = false;
+ $expectingOperand = true;
+ ++$index;
+ } elseif ($opCharacter === '(' && !$expectingOperator) {
+ // Branch pruning: we go deeper
+ $this->branchPruner->incrementDepth();
+ $stack->push('Brace', '(', null);
+ ++$index;
+ } elseif ($isOperandOrFunction && !$expectingOperatorCopy) {
+ // do we now have a function/variable/number?
+ $expectingOperator = true;
+ $expectingOperand = false;
+ $val = $match[1];
+ $length = strlen($val);
+
+ if (preg_match('/^' . self::CALCULATION_REGEXP_FUNCTION . '$/miu', $val, $matches)) {
+ $val = (string) preg_replace('/\s/u', '', $val);
+ if (isset(self::$phpSpreadsheetFunctions[strtoupper($matches[1])]) || isset(self::$controlFunctions[strtoupper($matches[1])])) { // it's a function
+ $valToUpper = strtoupper($val);
+ } else {
+ $valToUpper = 'NAME.ERROR(';
+ }
+ // here $matches[1] will contain values like "IF"
+ // and $val "IF("
+
+ $this->branchPruner->functionCall($valToUpper);
+
+ $stack->push('Function', $valToUpper);
+ // tests if the function is closed right after opening
+ $ax = preg_match('/^\s*\)/u', substr($formula, $index + $length));
+ if ($ax) {
+ $stack->push('Operand Count for Function ' . $valToUpper . ')', 0);
+ $expectingOperator = true;
+ } else {
+ $stack->push('Operand Count for Function ' . $valToUpper . ')', 1);
+ $expectingOperator = false;
+ }
+ $stack->push('Brace', '(');
+ } elseif (preg_match('/^' . self::CALCULATION_REGEXP_CELLREF . '$/miu', $val, $matches)) {
+ // Watch for this case-change when modifying to allow cell references in different worksheets...
+ // Should only be applied to the actual cell column, not the worksheet name
+ // If the last entry on the stack was a : operator, then we have a cell range reference
+ $testPrevOp = $stack->last(1);
+ if ($testPrevOp !== null && $testPrevOp['value'] === ':') {
+ // If we have a worksheet reference, then we're playing with a 3D reference
+ if ($matches[2] === '') {
+ // Otherwise, we 'inherit' the worksheet reference from the start cell reference
+ // The start of the cell range reference should be the last entry in $output
+ $rangeStartCellRef = $output[count($output) - 1]['value'] ?? '';
+ if ($rangeStartCellRef === ':') {
+ // Do we have chained range operators?
+ $rangeStartCellRef = $output[count($output) - 2]['value'] ?? '';
+ }
+ preg_match('/^' . self::CALCULATION_REGEXP_CELLREF . '$/miu', $rangeStartCellRef, $rangeStartMatches);
+ if (array_key_exists(2, $rangeStartMatches)) {
+ if ($rangeStartMatches[2] > '') {
+ $val = $rangeStartMatches[2] . '!' . $val;
+ }
+ } else {
+ $val = ExcelError::REF();
+ }
+ } else {
+ $rangeStartCellRef = $output[count($output) - 1]['value'] ?? '';
+ if ($rangeStartCellRef === ':') {
+ // Do we have chained range operators?
+ $rangeStartCellRef = $output[count($output) - 2]['value'] ?? '';
+ }
+ preg_match('/^' . self::CALCULATION_REGEXP_CELLREF . '$/miu', $rangeStartCellRef, $rangeStartMatches);
+ if ($rangeStartMatches[2] !== $matches[2]) {
+ return $this->raiseFormulaError('3D Range references are not yet supported');
+ }
+ }
+ } elseif (!str_contains($val, '!') && $pCellParent !== null) {
+ $worksheet = $pCellParent->getTitle();
+ $val = "'{$worksheet}'!{$val}";
+ }
+ // unescape any apostrophes or double quotes in worksheet name
+ $val = str_replace(["''", '""'], ["'", '"'], $val);
+ $outputItem = $stack->getStackItem('Cell Reference', $val, $val);
+
+ $output[] = $outputItem;
+ } elseif (preg_match('/^' . self::CALCULATION_REGEXP_STRUCTURED_REFERENCE . '$/miu', $val, $matches)) {
+ try {
+ $structuredReference = Operands\StructuredReference::fromParser($formula, $index, $matches);
+ } catch (Exception $e) {
+ return $this->raiseFormulaError($e->getMessage(), $e->getCode(), $e);
+ }
+
+ $val = $structuredReference->value();
+ $length = strlen($val);
+ $outputItem = $stack->getStackItem(Operands\StructuredReference::NAME, $structuredReference, null);
+
+ $output[] = $outputItem;
+ $expectingOperator = true;
+ } else {
+ // it's a variable, constant, string, number or boolean
+ $localeConstant = false;
+ $stackItemType = 'Value';
+ $stackItemReference = null;
+
+ // If the last entry on the stack was a : operator, then we may have a row or column range reference
+ $testPrevOp = $stack->last(1);
+ if ($testPrevOp !== null && $testPrevOp['value'] === ':') {
+ $stackItemType = 'Cell Reference';
+
+ if (
+ !is_numeric($val)
+ && ((ctype_alpha($val) === false || strlen($val) > 3))
+ && (preg_match('/^' . self::CALCULATION_REGEXP_DEFINEDNAME . '$/mui', $val) !== false)
+ && ($this->spreadsheet === null || $this->spreadsheet->getNamedRange($val) !== null)
+ ) {
+ $namedRange = ($this->spreadsheet === null) ? null : $this->spreadsheet->getNamedRange($val);
+ if ($namedRange !== null) {
+ $stackItemType = 'Defined Name';
+ $address = str_replace('$', '', $namedRange->getValue());
+ $stackItemReference = $val;
+ if (str_contains($address, ':')) {
+ // We'll need to manipulate the stack for an actual named range rather than a named cell
+ $fromTo = explode(':', $address);
+ $to = array_pop($fromTo);
+ foreach ($fromTo as $from) {
+ $output[] = $stack->getStackItem($stackItemType, $from, $stackItemReference);
+ $output[] = $stack->getStackItem('Binary Operator', ':');
+ }
+ $address = $to;
+ }
+ $val = $address;
+ }
+ } elseif ($val === ExcelError::REF()) {
+ $stackItemReference = $val;
+ } else {
+ /** @var non-empty-string $startRowColRef */
+ $startRowColRef = $output[count($output) - 1]['value'] ?? '';
+ [$rangeWS1, $startRowColRef] = Worksheet::extractSheetTitle($startRowColRef, true);
+ $rangeSheetRef = $rangeWS1;
+ if ($rangeWS1 !== '') {
+ $rangeWS1 .= '!';
+ }
+ $rangeSheetRef = trim($rangeSheetRef, "'");
+ [$rangeWS2, $val] = Worksheet::extractSheetTitle($val, true);
+ if ($rangeWS2 !== '') {
+ $rangeWS2 .= '!';
+ } else {
+ $rangeWS2 = $rangeWS1;
+ }
+
+ $refSheet = $pCellParent;
+ if ($pCellParent !== null && $rangeSheetRef !== '' && $rangeSheetRef !== $pCellParent->getTitle()) {
+ $refSheet = $pCellParent->getParentOrThrow()->getSheetByName($rangeSheetRef);
+ }
+
+ if (ctype_digit($val) && $val <= 1048576) {
+ // Row range
+ $stackItemType = 'Row Reference';
+ /** @var int $valx */
+ $valx = $val;
+ $endRowColRef = ($refSheet !== null) ? $refSheet->getHighestDataColumn($valx) : AddressRange::MAX_COLUMN; // Max 16,384 columns for Excel2007
+ $val = "{$rangeWS2}{$endRowColRef}{$val}";
+ } elseif (ctype_alpha($val) && strlen($val ?? '') <= 3) {
+ // Column range
+ $stackItemType = 'Column Reference';
+ $endRowColRef = ($refSheet !== null) ? $refSheet->getHighestDataRow($val) : AddressRange::MAX_ROW; // Max 1,048,576 rows for Excel2007
+ $val = "{$rangeWS2}{$val}{$endRowColRef}";
+ }
+ $stackItemReference = $val;
+ }
+ } elseif ($opCharacter === self::FORMULA_STRING_QUOTE) {
+ // UnEscape any quotes within the string
+ $val = self::wrapResult(str_replace('""', self::FORMULA_STRING_QUOTE, self::unwrapResult($val)));
+ } elseif (isset(self::$excelConstants[trim(strtoupper($val))])) {
+ $stackItemType = 'Constant';
+ $excelConstant = trim(strtoupper($val));
+ $val = self::$excelConstants[$excelConstant];
+ $stackItemReference = $excelConstant;
+ } elseif (($localeConstant = array_search(trim(strtoupper($val)), self::$localeBoolean)) !== false) {
+ $stackItemType = 'Constant';
+ $val = self::$excelConstants[$localeConstant];
+ $stackItemReference = $localeConstant;
+ } elseif (
+ preg_match('/^' . self::CALCULATION_REGEXP_ROW_RANGE . '/miu', substr($formula, $index), $rowRangeReference)
+ ) {
+ $val = $rowRangeReference[1];
+ $length = strlen($rowRangeReference[1]);
+ $stackItemType = 'Row Reference';
+ // unescape any apostrophes or double quotes in worksheet name
+ $val = str_replace(["''", '""'], ["'", '"'], $val);
+ $column = 'A';
+ if (($testPrevOp !== null && $testPrevOp['value'] === ':') && $pCellParent !== null) {
+ $column = $pCellParent->getHighestDataColumn($val);
+ }
+ $val = "{$rowRangeReference[2]}{$column}{$rowRangeReference[7]}";
+ $stackItemReference = $val;
+ } elseif (
+ preg_match('/^' . self::CALCULATION_REGEXP_COLUMN_RANGE . '/miu', substr($formula, $index), $columnRangeReference)
+ ) {
+ $val = $columnRangeReference[1];
+ $length = strlen($val);
+ $stackItemType = 'Column Reference';
+ // unescape any apostrophes or double quotes in worksheet name
+ $val = str_replace(["''", '""'], ["'", '"'], $val);
+ $row = '1';
+ if (($testPrevOp !== null && $testPrevOp['value'] === ':') && $pCellParent !== null) {
+ $row = $pCellParent->getHighestDataRow($val);
+ }
+ $val = "{$val}{$row}";
+ $stackItemReference = $val;
+ } elseif (preg_match('/^' . self::CALCULATION_REGEXP_DEFINEDNAME . '.*/miu', $val, $match)) {
+ $stackItemType = 'Defined Name';
+ $stackItemReference = $val;
+ } elseif (is_numeric($val)) {
+ if ((str_contains((string) $val, '.')) || (stripos((string) $val, 'e') !== false) || ($val > PHP_INT_MAX) || ($val < -PHP_INT_MAX)) {
+ $val = (float) $val;
+ } else {
+ $val = (int) $val;
+ }
+ }
+
+ $details = $stack->getStackItem($stackItemType, $val, $stackItemReference);
+ if ($localeConstant) {
+ $details['localeValue'] = $localeConstant;
+ }
+ $output[] = $details;
+ }
+ $index += $length;
+ } elseif ($opCharacter === '$') { // absolute row or column range
+ ++$index;
+ } elseif ($opCharacter === ')') { // miscellaneous error checking
+ if ($expectingOperand) {
+ $output[] = $stack->getStackItem('Empty Argument', null, 'NULL');
+ $expectingOperand = false;
+ $expectingOperator = true;
+ } else {
+ return $this->raiseFormulaError("Formula Error: Unexpected ')'");
+ }
+ } elseif (isset(self::CALCULATION_OPERATORS[$opCharacter]) && !$expectingOperator) {
+ return $this->raiseFormulaError("Formula Error: Unexpected operator '$opCharacter'");
+ } else { // I don't even want to know what you did to get here
+ return $this->raiseFormulaError('Formula Error: An unexpected error occurred');
+ }
+ // Test for end of formula string
+ if ($index == strlen($formula)) {
+ // Did we end with an operator?.
+ // Only valid for the % unary operator
+ if ((isset(self::CALCULATION_OPERATORS[$opCharacter])) && ($opCharacter != '%')) {
+ return $this->raiseFormulaError("Formula Error: Operator '$opCharacter' has no operands");
+ }
+
+ break;
+ }
+ // Ignore white space
+ while (($formula[$index] === "\n") || ($formula[$index] === "\r")) {
+ ++$index;
+ }
+
+ if ($formula[$index] === ' ') {
+ while ($formula[$index] === ' ') {
+ ++$index;
+ }
+
+ // If we're expecting an operator, but only have a space between the previous and next operands (and both are
+ // Cell References, Defined Names or Structured References) then we have an INTERSECTION operator
+ $countOutputMinus1 = count($output) - 1;
+ if (
+ ($expectingOperator)
+ && array_key_exists($countOutputMinus1, $output)
+ && is_array($output[$countOutputMinus1])
+ && array_key_exists('type', $output[$countOutputMinus1])
+ && (
+ (preg_match('/^' . self::CALCULATION_REGEXP_CELLREF . '.*/miu', substr($formula, $index), $match))
+ && ($output[$countOutputMinus1]['type'] === 'Cell Reference')
+ || (preg_match('/^' . self::CALCULATION_REGEXP_DEFINEDNAME . '.*/miu', substr($formula, $index), $match))
+ && ($output[$countOutputMinus1]['type'] === 'Defined Name' || $output[$countOutputMinus1]['type'] === 'Value')
+ || (preg_match('/^' . self::CALCULATION_REGEXP_STRUCTURED_REFERENCE . '.*/miu', substr($formula, $index), $match))
+ && ($output[$countOutputMinus1]['type'] === Operands\StructuredReference::NAME || $output[$countOutputMinus1]['type'] === 'Value')
+ )
+ ) {
+ while (
+ $stack->count() > 0
+ && ($o2 = $stack->last())
+ && isset(self::CALCULATION_OPERATORS[$o2['value']])
+ && @(self::$operatorAssociativity[$opCharacter] ? self::$operatorPrecedence[$opCharacter] < self::$operatorPrecedence[$o2['value']] : self::$operatorPrecedence[$opCharacter] <= self::$operatorPrecedence[$o2['value']])
+ ) {
+ $output[] = $stack->pop(); // Swap operands and higher precedence operators from the stack to the output
+ }
+ $stack->push('Binary Operator', '∩'); // Put an Intersect Operator on the stack
+ $expectingOperator = false;
+ }
+ }
+ }
+
+ while (($op = $stack->pop()) !== null) {
+ // pop everything off the stack and push onto output
+ if ((is_array($op) && $op['value'] == '(')) {
+ return $this->raiseFormulaError("Formula Error: Expecting ')'"); // if there are any opening braces on the stack, then braces were unbalanced
+ }
+ $output[] = $op;
+ }
+
+ return $output;
+ }
+
+ private static function dataTestReference(array &$operandData): mixed
+ {
+ $operand = $operandData['value'];
+ if (($operandData['reference'] === null) && (is_array($operand))) {
+ $rKeys = array_keys($operand);
+ $rowKey = array_shift($rKeys);
+ if (is_array($operand[$rowKey]) === false) {
+ $operandData['value'] = $operand[$rowKey];
+
+ return $operand[$rowKey];
+ }
+
+ $cKeys = array_keys(array_keys($operand[$rowKey]));
+ $colKey = array_shift($cKeys);
+ if (ctype_upper("$colKey")) {
+ $operandData['reference'] = $colKey . $rowKey;
+ }
+ }
+
+ return $operand;
+ }
+
+ /**
+ * @return array|false
+ */
+ private function processTokenStack(mixed $tokens, ?string $cellID = null, ?Cell $cell = null)
+ {
+ if ($tokens === false) {
+ return false;
+ }
+
+ // If we're using cell caching, then $pCell may well be flushed back to the cache (which detaches the parent cell collection),
+ // so we store the parent cell collection so that we can re-attach it when necessary
+ $pCellWorksheet = ($cell !== null) ? $cell->getWorksheet() : null;
+ $pCellParent = ($cell !== null) ? $cell->getParent() : null;
+ $stack = new Stack($this->branchPruner);
+
+ // Stores branches that have been pruned
+ $fakedForBranchPruning = [];
+ // help us to know when pruning ['branchTestId' => true/false]
+ $branchStore = [];
+ // Loop through each token in turn
+ foreach ($tokens as $tokenData) {
+ $token = $tokenData['value'];
+ // Branch pruning: skip useless resolutions
+ $storeKey = $tokenData['storeKey'] ?? null;
+ if ($this->branchPruningEnabled && isset($tokenData['onlyIf'])) {
+ $onlyIfStoreKey = $tokenData['onlyIf'];
+ $storeValue = $branchStore[$onlyIfStoreKey] ?? null;
+ $storeValueAsBool = ($storeValue === null)
+ ? true : (bool) Functions::flattenSingleValue($storeValue);
+ if (is_array($storeValue)) {
+ $wrappedItem = end($storeValue);
+ $storeValue = is_array($wrappedItem) ? end($wrappedItem) : $wrappedItem;
+ }
+
+ if (
+ (isset($storeValue) || $tokenData['reference'] === 'NULL')
+ && (!$storeValueAsBool || Information\ErrorValue::isError($storeValue) || ($storeValue === 'Pruned branch'))
+ ) {
+ // If branching value is not true, we don't need to compute
+ if (!isset($fakedForBranchPruning['onlyIf-' . $onlyIfStoreKey])) {
+ $stack->push('Value', 'Pruned branch (only if ' . $onlyIfStoreKey . ') ' . $token);
+ $fakedForBranchPruning['onlyIf-' . $onlyIfStoreKey] = true;
+ }
+
+ if (isset($storeKey)) {
+ // We are processing an if condition
+ // We cascade the pruning to the depending branches
+ $branchStore[$storeKey] = 'Pruned branch';
+ $fakedForBranchPruning['onlyIfNot-' . $storeKey] = true;
+ $fakedForBranchPruning['onlyIf-' . $storeKey] = true;
+ }
+
+ continue;
+ }
+ }
+
+ if ($this->branchPruningEnabled && isset($tokenData['onlyIfNot'])) {
+ $onlyIfNotStoreKey = $tokenData['onlyIfNot'];
+ $storeValue = $branchStore[$onlyIfNotStoreKey] ?? null;
+ $storeValueAsBool = ($storeValue === null)
+ ? true : (bool) Functions::flattenSingleValue($storeValue);
+ if (is_array($storeValue)) {
+ $wrappedItem = end($storeValue);
+ $storeValue = is_array($wrappedItem) ? end($wrappedItem) : $wrappedItem;
+ }
+
+ if (
+ (isset($storeValue) || $tokenData['reference'] === 'NULL')
+ && ($storeValueAsBool || Information\ErrorValue::isError($storeValue) || ($storeValue === 'Pruned branch'))
+ ) {
+ // If branching value is true, we don't need to compute
+ if (!isset($fakedForBranchPruning['onlyIfNot-' . $onlyIfNotStoreKey])) {
+ $stack->push('Value', 'Pruned branch (only if not ' . $onlyIfNotStoreKey . ') ' . $token);
+ $fakedForBranchPruning['onlyIfNot-' . $onlyIfNotStoreKey] = true;
+ }
+
+ if (isset($storeKey)) {
+ // We are processing an if condition
+ // We cascade the pruning to the depending branches
+ $branchStore[$storeKey] = 'Pruned branch';
+ $fakedForBranchPruning['onlyIfNot-' . $storeKey] = true;
+ $fakedForBranchPruning['onlyIf-' . $storeKey] = true;
+ }
+
+ continue;
+ }
+ }
+
+ if ($token instanceof Operands\StructuredReference) {
+ if ($cell === null) {
+ return $this->raiseFormulaError('Structured References must exist in a Cell context');
+ }
+
+ try {
+ $cellRange = $token->parse($cell);
+ if (str_contains($cellRange, ':')) {
+ $this->debugLog->writeDebugLog('Evaluating Structured Reference %s as Cell Range %s', $token->value(), $cellRange);
+ $rangeValue = self::getInstance($cell->getWorksheet()->getParent())->_calculateFormulaValue("={$cellRange}", $cellRange, $cell);
+ $stack->push('Value', $rangeValue);
+ $this->debugLog->writeDebugLog('Evaluated Structured Reference %s as value %s', $token->value(), $this->showValue($rangeValue));
+ } else {
+ $this->debugLog->writeDebugLog('Evaluating Structured Reference %s as Cell %s', $token->value(), $cellRange);
+ $cellValue = $cell->getWorksheet()->getCell($cellRange)->getCalculatedValue(false);
+ $stack->push('Cell Reference', $cellValue, $cellRange);
+ $this->debugLog->writeDebugLog('Evaluated Structured Reference %s as value %s', $token->value(), $this->showValue($cellValue));
+ }
+ } catch (Exception $e) {
+ if ($e->getCode() === Exception::CALCULATION_ENGINE_PUSH_TO_STACK) {
+ $stack->push('Error', ExcelError::REF(), null);
+ $this->debugLog->writeDebugLog('Evaluated Structured Reference %s as error value %s', $token->value(), ExcelError::REF());
+ } else {
+ return $this->raiseFormulaError($e->getMessage(), $e->getCode(), $e);
+ }
+ }
+ } elseif (!is_numeric($token) && !is_object($token) && isset(self::BINARY_OPERATORS[$token])) {
+ // if the token is a binary operator, pop the top two values off the stack, do the operation, and push the result back on the stack
+ // We must have two operands, error if we don't
+ $operand2Data = $stack->pop();
+ if ($operand2Data === null) {
+ return $this->raiseFormulaError('Internal error - Operand value missing from stack');
+ }
+ $operand1Data = $stack->pop();
+ if ($operand1Data === null) {
+ return $this->raiseFormulaError('Internal error - Operand value missing from stack');
+ }
+
+ $operand1 = self::dataTestReference($operand1Data);
+ $operand2 = self::dataTestReference($operand2Data);
+
+ // Log what we're doing
+ if ($token == ':') {
+ $this->debugLog->writeDebugLog('Evaluating Range %s %s %s', $this->showValue($operand1Data['reference']), $token, $this->showValue($operand2Data['reference']));
+ } else {
+ $this->debugLog->writeDebugLog('Evaluating %s %s %s', $this->showValue($operand1), $token, $this->showValue($operand2));
+ }
+
+ // Process the operation in the appropriate manner
+ switch ($token) {
+ // Comparison (Boolean) Operators
+ case '>': // Greater than
+ case '<': // Less than
+ case '>=': // Greater than or Equal to
+ case '<=': // Less than or Equal to
+ case '=': // Equality
+ case '<>': // Inequality
+ $result = $this->executeBinaryComparisonOperation($operand1, $operand2, (string) $token, $stack);
+ if (isset($storeKey)) {
+ $branchStore[$storeKey] = $result;
+ }
+
+ break;
+ // Binary Operators
+ case ':': // Range
+ if ($operand1Data['type'] === 'Defined Name') {
+ if (preg_match('/$' . self::CALCULATION_REGEXP_DEFINEDNAME . '^/mui', $operand1Data['reference']) !== false && $this->spreadsheet !== null) {
+ $definedName = $this->spreadsheet->getNamedRange($operand1Data['reference']);
+ if ($definedName !== null) {
+ $operand1Data['reference'] = $operand1Data['value'] = str_replace('$', '', $definedName->getValue());
+ }
+ }
+ }
+ if (str_contains($operand1Data['reference'] ?? '', '!')) {
+ [$sheet1, $operand1Data['reference']] = Worksheet::extractSheetTitle($operand1Data['reference'], true);
+ } else {
+ $sheet1 = ($pCellWorksheet !== null) ? $pCellWorksheet->getTitle() : '';
+ }
+ $sheet1 ??= '';
+
+ [$sheet2, $operand2Data['reference']] = Worksheet::extractSheetTitle($operand2Data['reference'], true);
+ if (empty($sheet2)) {
+ $sheet2 = $sheet1;
+ }
+
+ if (trim($sheet1, "'") === trim($sheet2, "'")) {
+ if ($operand1Data['reference'] === null && $cell !== null) {
+ if (is_array($operand1Data['value'])) {
+ $operand1Data['reference'] = $cell->getCoordinate();
+ } elseif ((trim($operand1Data['value']) != '') && (is_numeric($operand1Data['value']))) {
+ $operand1Data['reference'] = $cell->getColumn() . $operand1Data['value'];
+ } elseif (trim($operand1Data['value']) == '') {
+ $operand1Data['reference'] = $cell->getCoordinate();
+ } else {
+ $operand1Data['reference'] = $operand1Data['value'] . $cell->getRow();
+ }
+ }
+ if ($operand2Data['reference'] === null && $cell !== null) {
+ if (is_array($operand2Data['value'])) {
+ $operand2Data['reference'] = $cell->getCoordinate();
+ } elseif ((trim($operand2Data['value']) != '') && (is_numeric($operand2Data['value']))) {
+ $operand2Data['reference'] = $cell->getColumn() . $operand2Data['value'];
+ } elseif (trim($operand2Data['value']) == '') {
+ $operand2Data['reference'] = $cell->getCoordinate();
+ } else {
+ $operand2Data['reference'] = $operand2Data['value'] . $cell->getRow();
+ }
+ }
+
+ $oData = array_merge(explode(':', $operand1Data['reference'] ?? ''), explode(':', $operand2Data['reference'] ?? ''));
+ $oCol = $oRow = [];
+ $breakNeeded = false;
+ foreach ($oData as $oDatum) {
+ try {
+ $oCR = Coordinate::coordinateFromString($oDatum);
+ $oCol[] = Coordinate::columnIndexFromString($oCR[0]) - 1;
+ $oRow[] = $oCR[1];
+ } catch (\Exception) {
+ $stack->push('Error', ExcelError::REF(), null);
+ $breakNeeded = true;
+
+ break;
+ }
+ }
+ if ($breakNeeded) {
+ break;
+ }
+ $cellRef = Coordinate::stringFromColumnIndex(min($oCol) + 1) . min($oRow) . ':' . Coordinate::stringFromColumnIndex(max($oCol) + 1) . max($oRow);
+ if ($pCellParent !== null && $this->spreadsheet !== null) {
+ $cellValue = $this->extractCellRange($cellRef, $this->spreadsheet->getSheetByName($sheet1), false);
+ } else {
+ return $this->raiseFormulaError('Unable to access Cell Reference');
+ }
+
+ $this->debugLog->writeDebugLog('Evaluation Result is %s', $this->showTypeDetails($cellValue));
+ $stack->push('Cell Reference', $cellValue, $cellRef);
+ } else {
+ $this->debugLog->writeDebugLog('Evaluation Result is a #REF! Error');
+ $stack->push('Error', ExcelError::REF(), null);
+ }
+
+ break;
+ case '+': // Addition
+ case '-': // Subtraction
+ case '*': // Multiplication
+ case '/': // Division
+ case '^': // Exponential
+ $result = $this->executeNumericBinaryOperation($operand1, $operand2, $token, $stack);
+ if (isset($storeKey)) {
+ $branchStore[$storeKey] = $result;
+ }
+
+ break;
+ case '&': // Concatenation
+ // If either of the operands is a matrix, we need to treat them both as matrices
+ // (converting the other operand to a matrix if need be); then perform the required
+ // matrix operation
+ $operand1 = self::boolToString($operand1);
+ $operand2 = self::boolToString($operand2);
+ if (is_array($operand1) || is_array($operand2)) {
+ if (is_string($operand1)) {
+ $operand1 = self::unwrapResult($operand1);
+ }
+ if (is_string($operand2)) {
+ $operand2 = self::unwrapResult($operand2);
+ }
+ // Ensure that both operands are arrays/matrices
+ [$rows, $columns] = self::checkMatrixOperands($operand1, $operand2, 2);
+
+ for ($row = 0; $row < $rows; ++$row) {
+ for ($column = 0; $column < $columns; ++$column) {
+ $operand1[$row][$column]
+ = Shared\StringHelper::substring(
+ self::boolToString($operand1[$row][$column])
+ . self::boolToString($operand2[$row][$column]),
+ 0,
+ DataType::MAX_STRING_LENGTH
+ );
+ }
+ }
+ $result = $operand1;
+ } else {
+ // In theory, we should truncate here.
+ // But I can't figure out a formula
+ // using the concatenation operator
+ // with literals that fits in 32K,
+ // so I don't think we can overflow here.
+ $result = self::FORMULA_STRING_QUOTE . str_replace('""', self::FORMULA_STRING_QUOTE, self::unwrapResult($operand1) . self::unwrapResult($operand2)) . self::FORMULA_STRING_QUOTE;
+ }
+ $this->debugLog->writeDebugLog('Evaluation Result is %s', $this->showTypeDetails($result));
+ $stack->push('Value', $result);
+
+ if (isset($storeKey)) {
+ $branchStore[$storeKey] = $result;
+ }
+
+ break;
+ case '∩': // Intersect
+ $rowIntersect = array_intersect_key($operand1, $operand2);
+ $cellIntersect = $oCol = $oRow = [];
+ foreach (array_keys($rowIntersect) as $row) {
+ $oRow[] = $row;
+ foreach ($rowIntersect[$row] as $col => $data) {
+ $oCol[] = Coordinate::columnIndexFromString($col) - 1;
+ $cellIntersect[$row] = array_intersect_key($operand1[$row], $operand2[$row]);
+ }
+ }
+ if (count(Functions::flattenArray($cellIntersect)) === 0) {
+ $this->debugLog->writeDebugLog('Evaluation Result is %s', $this->showTypeDetails($cellIntersect));
+ $stack->push('Error', ExcelError::null(), null);
+ } else {
+ $cellRef = Coordinate::stringFromColumnIndex(min($oCol) + 1) . min($oRow) . ':'
+ . Coordinate::stringFromColumnIndex(max($oCol) + 1) . max($oRow);
+ $this->debugLog->writeDebugLog('Evaluation Result is %s', $this->showTypeDetails($cellIntersect));
+ $stack->push('Value', $cellIntersect, $cellRef);
+ }
+
+ break;
+ }
+ } elseif (($token === '~') || ($token === '%')) {
+ // if the token is a unary operator, pop one value off the stack, do the operation, and push it back on
+ if (($arg = $stack->pop()) === null) {
+ return $this->raiseFormulaError('Internal error - Operand value missing from stack');
+ }
+ $arg = $arg['value'];
+ if ($token === '~') {
+ $this->debugLog->writeDebugLog('Evaluating Negation of %s', $this->showValue($arg));
+ $multiplier = -1;
+ } else {
+ $this->debugLog->writeDebugLog('Evaluating Percentile of %s', $this->showValue($arg));
+ $multiplier = 0.01;
+ }
+ if (is_array($arg)) {
+ $operand2 = $multiplier;
+ $result = $arg;
+ [$rows, $columns] = self::checkMatrixOperands($result, $operand2, 0);
+ for ($row = 0; $row < $rows; ++$row) {
+ for ($column = 0; $column < $columns; ++$column) {
+ if (self::isNumericOrBool($result[$row][$column])) {
+ $result[$row][$column] *= $multiplier;
+ } else {
+ $result[$row][$column] = self::makeError($result[$row][$column]);
+ }
+ }
+ }
+
+ $this->debugLog->writeDebugLog('Evaluation Result is %s', $this->showTypeDetails($result));
+ $stack->push('Value', $result);
+ if (isset($storeKey)) {
+ $branchStore[$storeKey] = $result;
+ }
+ } else {
+ $this->executeNumericBinaryOperation($multiplier, $arg, '*', $stack);
+ }
+ } elseif (preg_match('/^' . self::CALCULATION_REGEXP_CELLREF . '$/i', $token ?? '', $matches)) {
+ $cellRef = null;
+
+ if (isset($matches[8])) {
+ if ($cell === null) {
+ // We can't access the range, so return a REF error
+ $cellValue = ExcelError::REF();
+ } else {
+ $cellRef = $matches[6] . $matches[7] . ':' . $matches[9] . $matches[10];
+ if ($matches[2] > '') {
+ $matches[2] = trim($matches[2], "\"'");
+ if ((str_contains($matches[2], '[')) || (str_contains($matches[2], ']'))) {
+ // It's a Reference to an external spreadsheet (not currently supported)
+ return $this->raiseFormulaError('Unable to access External Workbook');
+ }
+ $matches[2] = trim($matches[2], "\"'");
+ $this->debugLog->writeDebugLog('Evaluating Cell Range %s in worksheet %s', $cellRef, $matches[2]);
+ if ($pCellParent !== null && $this->spreadsheet !== null) {
+ $cellValue = $this->extractCellRange($cellRef, $this->spreadsheet->getSheetByName($matches[2]), false);
+ } else {
+ return $this->raiseFormulaError('Unable to access Cell Reference');
+ }
+ $this->debugLog->writeDebugLog('Evaluation Result for cells %s in worksheet %s is %s', $cellRef, $matches[2], $this->showTypeDetails($cellValue));
+ } else {
+ $this->debugLog->writeDebugLog('Evaluating Cell Range %s in current worksheet', $cellRef);
+ if ($pCellParent !== null) {
+ $cellValue = $this->extractCellRange($cellRef, $pCellWorksheet, false);
+ } else {
+ return $this->raiseFormulaError('Unable to access Cell Reference');
+ }
+ $this->debugLog->writeDebugLog('Evaluation Result for cells %s is %s', $cellRef, $this->showTypeDetails($cellValue));
+ }
+ }
+ } else {
+ if ($cell === null) {
+ // We can't access the cell, so return a REF error
+ $cellValue = ExcelError::REF();
+ } else {
+ $cellRef = $matches[6] . $matches[7];
+ if ($matches[2] > '') {
+ $matches[2] = trim($matches[2], "\"'");
+ if ((str_contains($matches[2], '[')) || (str_contains($matches[2], ']'))) {
+ // It's a Reference to an external spreadsheet (not currently supported)
+ return $this->raiseFormulaError('Unable to access External Workbook');
+ }
+ $this->debugLog->writeDebugLog('Evaluating Cell %s in worksheet %s', $cellRef, $matches[2]);
+ if ($pCellParent !== null && $this->spreadsheet !== null) {
+ $cellSheet = $this->spreadsheet->getSheetByName($matches[2]);
+ if ($cellSheet && $cellSheet->cellExists($cellRef)) {
+ $cellValue = $this->extractCellRange($cellRef, $this->spreadsheet->getSheetByName($matches[2]), false);
+ $cell->attach($pCellParent);
+ } else {
+ $cellRef = ($cellSheet !== null) ? "'{$matches[2]}'!{$cellRef}" : $cellRef;
+ $cellValue = ($cellSheet !== null) ? null : ExcelError::REF();
+ }
+ } else {
+ return $this->raiseFormulaError('Unable to access Cell Reference');
+ }
+ $this->debugLog->writeDebugLog('Evaluation Result for cell %s in worksheet %s is %s', $cellRef, $matches[2], $this->showTypeDetails($cellValue));
+ } else {
+ $this->debugLog->writeDebugLog('Evaluating Cell %s in current worksheet', $cellRef);
+ if ($pCellParent !== null && $pCellParent->has($cellRef)) {
+ $cellValue = $this->extractCellRange($cellRef, $pCellWorksheet, false);
+ $cell->attach($pCellParent);
+ } else {
+ $cellValue = null;
+ }
+ $this->debugLog->writeDebugLog('Evaluation Result for cell %s is %s', $cellRef, $this->showTypeDetails($cellValue));
+ }
+ }
+ }
+
+ $stack->push('Cell Value', $cellValue, $cellRef);
+ if (isset($storeKey)) {
+ $branchStore[$storeKey] = $cellValue;
+ }
+ } elseif (preg_match('/^' . self::CALCULATION_REGEXP_FUNCTION . '$/miu', $token ?? '', $matches)) {
+ // if the token is a function, pop arguments off the stack, hand them to the function, and push the result back on
+ if ($cell !== null && $pCellParent !== null) {
+ $cell->attach($pCellParent);
+ }
+
+ $functionName = $matches[1];
+ $argCount = $stack->pop();
+ $argCount = $argCount['value'];
+ if ($functionName !== 'MKMATRIX') {
+ $this->debugLog->writeDebugLog('Evaluating Function %s() with %s argument%s', self::localeFunc($functionName), (($argCount == 0) ? 'no' : $argCount), (($argCount == 1) ? '' : 's'));
+ }
+ if ((isset(self::$phpSpreadsheetFunctions[$functionName])) || (isset(self::$controlFunctions[$functionName]))) { // function
+ $passByReference = false;
+ $passCellReference = false;
+ $functionCall = null;
+ if (isset(self::$phpSpreadsheetFunctions[$functionName])) {
+ $functionCall = self::$phpSpreadsheetFunctions[$functionName]['functionCall'];
+ $passByReference = isset(self::$phpSpreadsheetFunctions[$functionName]['passByReference']);
+ $passCellReference = isset(self::$phpSpreadsheetFunctions[$functionName]['passCellReference']);
+ } elseif (isset(self::$controlFunctions[$functionName])) {
+ $functionCall = self::$controlFunctions[$functionName]['functionCall'];
+ $passByReference = isset(self::$controlFunctions[$functionName]['passByReference']);
+ $passCellReference = isset(self::$controlFunctions[$functionName]['passCellReference']);
+ }
+
+ // get the arguments for this function
+ $args = $argArrayVals = [];
+ $emptyArguments = [];
+ for ($i = 0; $i < $argCount; ++$i) {
+ $arg = $stack->pop();
+ $a = $argCount - $i - 1;
+ if (
+ ($passByReference)
+ && (isset(self::$phpSpreadsheetFunctions[$functionName]['passByReference'][$a]))
+ && (self::$phpSpreadsheetFunctions[$functionName]['passByReference'][$a])
+ ) {
+ if ($arg['reference'] === null) {
+ $args[] = $cellID;
+ if ($functionName !== 'MKMATRIX') {
+ $argArrayVals[] = $this->showValue($cellID);
+ }
+ } else {
+ $args[] = $arg['reference'];
+ if ($functionName !== 'MKMATRIX') {
+ $argArrayVals[] = $this->showValue($arg['reference']);
+ }
+ }
+ } else {
+ if ($arg['type'] === 'Empty Argument' && in_array($functionName, ['MIN', 'MINA', 'MAX', 'MAXA', 'IF'], true)) {
+ $emptyArguments[] = false;
+ $args[] = $arg['value'] = 0;
+ $this->debugLog->writeDebugLog('Empty Argument reevaluated as 0');
+ } else {
+ $emptyArguments[] = $arg['type'] === 'Empty Argument';
+ $args[] = self::unwrapResult($arg['value']);
+ }
+ if ($functionName !== 'MKMATRIX') {
+ $argArrayVals[] = $this->showValue($arg['value']);
+ }
+ }
+ }
+
+ // Reverse the order of the arguments
+ krsort($args);
+ krsort($emptyArguments);
+
+ if ($argCount > 0 && is_array($functionCall)) {
+ $args = $this->addDefaultArgumentValues($functionCall, $args, $emptyArguments);
+ }
+
+ if (($passByReference) && ($argCount == 0)) {
+ $args[] = $cellID;
+ $argArrayVals[] = $this->showValue($cellID);
+ }
+
+ if ($functionName !== 'MKMATRIX') {
+ if ($this->debugLog->getWriteDebugLog()) {
+ krsort($argArrayVals);
+ $this->debugLog->writeDebugLog('Evaluating %s ( %s )', self::localeFunc($functionName), implode(self::$localeArgumentSeparator . ' ', Functions::flattenArray($argArrayVals)));
+ }
+ }
+
+ // Process the argument with the appropriate function call
+ $args = $this->addCellReference($args, $passCellReference, $functionCall, $cell);
+
+ if (!is_array($functionCall)) {
+ foreach ($args as &$arg) {
+ $arg = Functions::flattenSingleValue($arg);
+ }
+ unset($arg);
+ }
+
+ $result = call_user_func_array($functionCall, $args);
+
+ if ($functionName !== 'MKMATRIX') {
+ $this->debugLog->writeDebugLog('Evaluation Result for %s() function call is %s', self::localeFunc($functionName), $this->showTypeDetails($result));
+ }
+ $stack->push('Value', self::wrapResult($result));
+ if (isset($storeKey)) {
+ $branchStore[$storeKey] = $result;
+ }
+ }
+ } else {
+ // if the token is a number, boolean, string or an Excel error, push it onto the stack
+ if (isset(self::$excelConstants[strtoupper($token ?? '')])) {
+ $excelConstant = strtoupper($token);
+ $stack->push('Constant Value', self::$excelConstants[$excelConstant]);
+ if (isset($storeKey)) {
+ $branchStore[$storeKey] = self::$excelConstants[$excelConstant];
+ }
+ $this->debugLog->writeDebugLog('Evaluating Constant %s as %s', $excelConstant, $this->showTypeDetails(self::$excelConstants[$excelConstant]));
+ } elseif ((is_numeric($token)) || ($token === null) || (is_bool($token)) || ($token == '') || ($token[0] == self::FORMULA_STRING_QUOTE) || ($token[0] == '#')) {
+ $stack->push($tokenData['type'], $token, $tokenData['reference']);
+ if (isset($storeKey)) {
+ $branchStore[$storeKey] = $token;
+ }
+ } elseif (preg_match('/^' . self::CALCULATION_REGEXP_DEFINEDNAME . '$/miu', $token, $matches)) {
+ // if the token is a named range or formula, evaluate it and push the result onto the stack
+ $definedName = $matches[6];
+ if ($cell === null || $pCellWorksheet === null) {
+ return $this->raiseFormulaError("undefined name '$token'");
+ }
+
+ $this->debugLog->writeDebugLog('Evaluating Defined Name %s', $definedName);
+ $namedRange = DefinedName::resolveName($definedName, $pCellWorksheet);
+ // If not Defined Name, try as Table.
+ if ($namedRange === null && $this->spreadsheet !== null) {
+ $table = $this->spreadsheet->getTableByName($definedName);
+ if ($table !== null) {
+ $tableRange = Coordinate::getRangeBoundaries($table->getRange());
+ if ($table->getShowHeaderRow()) {
+ ++$tableRange[0][1];
+ }
+ if ($table->getShowTotalsRow()) {
+ --$tableRange[1][1];
+ }
+ $tableRangeString
+ = '$' . $tableRange[0][0]
+ . '$' . $tableRange[0][1]
+ . ':'
+ . '$' . $tableRange[1][0]
+ . '$' . $tableRange[1][1];
+ $namedRange = new NamedRange($definedName, $table->getWorksheet(), $tableRangeString);
+ }
+ }
+ if ($namedRange === null) {
+ return $this->raiseFormulaError("undefined name '$definedName'");
+ }
+
+ $result = $this->evaluateDefinedName($cell, $namedRange, $pCellWorksheet, $stack);
+ if (isset($storeKey)) {
+ $branchStore[$storeKey] = $result;
+ }
+ } else {
+ return $this->raiseFormulaError("undefined name '$token'");
+ }
+ }
+ }
+ // when we're out of tokens, the stack should have a single element, the final result
+ if ($stack->count() != 1) {
+ return $this->raiseFormulaError('internal error');
+ }
+ $output = $stack->pop();
+ $output = $output['value'];
+
+ return $output;
+ }
+
+ private function validateBinaryOperand(mixed &$operand, mixed &$stack): bool
+ {
+ if (is_array($operand)) {
+ if ((count($operand, COUNT_RECURSIVE) - count($operand)) == 1) {
+ do {
+ $operand = array_pop($operand);
+ } while (is_array($operand));
+ }
+ }
+ // Numbers, matrices and booleans can pass straight through, as they're already valid
+ if (is_string($operand)) {
+ // We only need special validations for the operand if it is a string
+ // Start by stripping off the quotation marks we use to identify true excel string values internally
+ if ($operand > '' && $operand[0] == self::FORMULA_STRING_QUOTE) {
+ $operand = self::unwrapResult($operand);
+ }
+ // If the string is a numeric value, we treat it as a numeric, so no further testing
+ if (!is_numeric($operand)) {
+ // If not a numeric, test to see if the value is an Excel error, and so can't be used in normal binary operations
+ if ($operand > '' && $operand[0] == '#') {
+ $stack->push('Value', $operand);
+ $this->debugLog->writeDebugLog('Evaluation Result is %s', $this->showTypeDetails($operand));
+
+ return false;
+ } elseif (Engine\FormattedNumber::convertToNumberIfFormatted($operand) === false) {
+ // If not a numeric, a fraction or a percentage, then it's a text string, and so can't be used in mathematical binary operations
+ $stack->push('Error', '#VALUE!');
+ $this->debugLog->writeDebugLog('Evaluation Result is a %s', $this->showTypeDetails('#VALUE!'));
+
+ return false;
+ }
+ }
+ }
+
+ // return a true if the value of the operand is one that we can use in normal binary mathematical operations
+ return true;
+ }
+
+ private function executeArrayComparison(mixed $operand1, mixed $operand2, string $operation, Stack &$stack, bool $recursingArrays): array
+ {
+ $result = [];
+ if (!is_array($operand2)) {
+ // Operand 1 is an array, Operand 2 is a scalar
+ foreach ($operand1 as $x => $operandData) {
+ $this->debugLog->writeDebugLog('Evaluating Comparison %s %s %s', $this->showValue($operandData), $operation, $this->showValue($operand2));
+ $this->executeBinaryComparisonOperation($operandData, $operand2, $operation, $stack);
+ $r = $stack->pop();
+ $result[$x] = $r['value'];
+ }
+ } elseif (!is_array($operand1)) {
+ // Operand 1 is a scalar, Operand 2 is an array
+ foreach ($operand2 as $x => $operandData) {
+ $this->debugLog->writeDebugLog('Evaluating Comparison %s %s %s', $this->showValue($operand1), $operation, $this->showValue($operandData));
+ $this->executeBinaryComparisonOperation($operand1, $operandData, $operation, $stack);
+ $r = $stack->pop();
+ $result[$x] = $r['value'];
+ }
+ } else {
+ // Operand 1 and Operand 2 are both arrays
+ if (!$recursingArrays) {
+ self::checkMatrixOperands($operand1, $operand2, 2);
+ }
+ foreach ($operand1 as $x => $operandData) {
+ $this->debugLog->writeDebugLog('Evaluating Comparison %s %s %s', $this->showValue($operandData), $operation, $this->showValue($operand2[$x]));
+ $this->executeBinaryComparisonOperation($operandData, $operand2[$x], $operation, $stack, true);
+ $r = $stack->pop();
+ $result[$x] = $r['value'];
+ }
+ }
+ // Log the result details
+ $this->debugLog->writeDebugLog('Comparison Evaluation Result is %s', $this->showTypeDetails($result));
+ // And push the result onto the stack
+ $stack->push('Array', $result);
+
+ return $result;
+ }
+
+ private function executeBinaryComparisonOperation(mixed $operand1, mixed $operand2, string $operation, Stack &$stack, bool $recursingArrays = false): array|bool
+ {
+ // If we're dealing with matrix operations, we want a matrix result
+ if ((is_array($operand1)) || (is_array($operand2))) {
+ return $this->executeArrayComparison($operand1, $operand2, $operation, $stack, $recursingArrays);
+ }
+
+ $result = BinaryComparison::compare($operand1, $operand2, $operation);
+
+ // Log the result details
+ $this->debugLog->writeDebugLog('Evaluation Result is %s', $this->showTypeDetails($result));
+ // And push the result onto the stack
+ $stack->push('Value', $result);
+
+ return $result;
+ }
+
+ private function executeNumericBinaryOperation(mixed $operand1, mixed $operand2, string $operation, Stack &$stack): mixed
+ {
+ // Validate the two operands
+ if (
+ ($this->validateBinaryOperand($operand1, $stack) === false)
+ || ($this->validateBinaryOperand($operand2, $stack) === false)
+ ) {
+ return false;
+ }
+
+ if (
+ (Functions::getCompatibilityMode() != Functions::COMPATIBILITY_OPENOFFICE)
+ && ((is_string($operand1) && !is_numeric($operand1) && $operand1 !== '')
+ || (is_string($operand2) && !is_numeric($operand2) && $operand2 !== ''))
+ ) {
+ $result = ExcelError::VALUE();
+ } elseif (is_array($operand1) || is_array($operand2)) {
+ // Ensure that both operands are arrays/matrices
+ if (is_array($operand1)) {
+ foreach ($operand1 as $key => $value) {
+ $operand1[$key] = Functions::flattenArray($value);
+ }
+ }
+ if (is_array($operand2)) {
+ foreach ($operand2 as $key => $value) {
+ $operand2[$key] = Functions::flattenArray($value);
+ }
+ }
+ [$rows, $columns] = self::checkMatrixOperands($operand1, $operand2, 2);
+
+ for ($row = 0; $row < $rows; ++$row) {
+ for ($column = 0; $column < $columns; ++$column) {
+ if ($operand1[$row][$column] === null) {
+ $operand1[$row][$column] = 0;
+ } elseif (!self::isNumericOrBool($operand1[$row][$column])) {
+ $operand1[$row][$column] = self::makeError($operand1[$row][$column]);
+
+ continue;
+ }
+ if ($operand2[$row][$column] === null) {
+ $operand2[$row][$column] = 0;
+ } elseif (!self::isNumericOrBool($operand2[$row][$column])) {
+ $operand1[$row][$column] = self::makeError($operand2[$row][$column]);
+
+ continue;
+ }
+ switch ($operation) {
+ case '+':
+ $operand1[$row][$column] += $operand2[$row][$column];
+
+ break;
+ case '-':
+ $operand1[$row][$column] -= $operand2[$row][$column];
+
+ break;
+ case '*':
+ $operand1[$row][$column] *= $operand2[$row][$column];
+
+ break;
+ case '/':
+ if ($operand2[$row][$column] == 0) {
+ $operand1[$row][$column] = ExcelError::DIV0();
+ } else {
+ $operand1[$row][$column] /= $operand2[$row][$column];
+ }
+
+ break;
+ case '^':
+ $operand1[$row][$column] = $operand1[$row][$column] ** $operand2[$row][$column];
+
+ break;
+
+ default:
+ throw new Exception('Unsupported numeric binary operation');
+ }
+ }
+ }
+ $result = $operand1;
+ } else {
+ // If we're dealing with non-matrix operations, execute the necessary operation
+ switch ($operation) {
+ // Addition
+ case '+':
+ $result = $operand1 + $operand2;
+
+ break;
+ // Subtraction
+ case '-':
+ $result = $operand1 - $operand2;
+
+ break;
+ // Multiplication
+ case '*':
+ $result = $operand1 * $operand2;
+
+ break;
+ // Division
+ case '/':
+ if ($operand2 == 0) {
+ // Trap for Divide by Zero error
+ $stack->push('Error', ExcelError::DIV0());
+ $this->debugLog->writeDebugLog('Evaluation Result is %s', $this->showTypeDetails(ExcelError::DIV0()));
+
+ return false;
+ }
+ $result = $operand1 / $operand2;
+
+ break;
+ // Power
+ case '^':
+ $result = $operand1 ** $operand2;
+
+ break;
+
+ default:
+ throw new Exception('Unsupported numeric binary operation');
+ }
+ }
+
+ // Log the result details
+ $this->debugLog->writeDebugLog('Evaluation Result is %s', $this->showTypeDetails($result));
+ // And push the result onto the stack
+ $stack->push('Value', $result);
+
+ return $result;
+ }
+
+ /**
+ * Trigger an error, but nicely, if need be.
+ *
+ * @return false
+ */
+ protected function raiseFormulaError(string $errorMessage, int $code = 0, ?Throwable $exception = null): bool
+ {
+ $this->formulaError = $errorMessage;
+ $this->cyclicReferenceStack->clear();
+ $suppress = $this->suppressFormulaErrors ?? $this->suppressFormulaErrorsNew;
+ if (!$suppress) {
+ throw new Exception($errorMessage, $code, $exception);
+ }
+
+ return false;
+ }
+
+ /**
+ * Extract range values.
+ *
+ * @param string $range String based range representation
+ * @param ?Worksheet $worksheet Worksheet
+ * @param bool $resetLog Flag indicating whether calculation log should be reset or not
+ *
+ * @return array Array of values in range if range contains more than one element. Otherwise, a single value is returned.
+ */
+ public function extractCellRange(string &$range = 'A1', ?Worksheet $worksheet = null, bool $resetLog = true): array
+ {
+ // Return value
+ $returnValue = [];
+
+ if ($worksheet !== null) {
+ $worksheetName = $worksheet->getTitle();
+
+ if (str_contains($range, '!')) {
+ [$worksheetName, $range] = Worksheet::extractSheetTitle($range, true);
+ $worksheet = ($this->spreadsheet === null) ? null : $this->spreadsheet->getSheetByName($worksheetName);
+ }
+
+ // Extract range
+ $aReferences = Coordinate::extractAllCellReferencesInRange($range);
+ $range = "'" . $worksheetName . "'" . '!' . $range;
+ $currentCol = '';
+ $currentRow = 0;
+ if (!isset($aReferences[1])) {
+ // Single cell in range
+ sscanf($aReferences[0], '%[A-Z]%d', $currentCol, $currentRow);
+ if ($worksheet !== null && $worksheet->cellExists($aReferences[0])) {
+ $returnValue[$currentRow][$currentCol] = $worksheet->getCell($aReferences[0])->getCalculatedValue($resetLog);
+ } else {
+ $returnValue[$currentRow][$currentCol] = null;
+ }
+ } else {
+ // Extract cell data for all cells in the range
+ foreach ($aReferences as $reference) {
+ // Extract range
+ sscanf($reference, '%[A-Z]%d', $currentCol, $currentRow);
+ if ($worksheet !== null && $worksheet->cellExists($reference)) {
+ $returnValue[$currentRow][$currentCol] = $worksheet->getCell($reference)->getCalculatedValue($resetLog);
+ } else {
+ $returnValue[$currentRow][$currentCol] = null;
+ }
+ }
+ }
+ }
+
+ return $returnValue;
+ }
+
+ /**
+ * Extract range values.
+ *
+ * @param string $range String based range representation
+ * @param null|Worksheet $worksheet Worksheet
+ * @param bool $resetLog Flag indicating whether calculation log should be reset or not
+ *
+ * @return array|string Array of values in range if range contains more than one element. Otherwise, a single value is returned.
+ */
+ public function extractNamedRange(string &$range = 'A1', ?Worksheet $worksheet = null, bool $resetLog = true): string|array
+ {
+ // Return value
+ $returnValue = [];
+
+ if ($worksheet !== null) {
+ if (str_contains($range, '!')) {
+ [$worksheetName, $range] = Worksheet::extractSheetTitle($range, true);
+ $worksheet = ($this->spreadsheet === null) ? null : $this->spreadsheet->getSheetByName($worksheetName);
+ }
+
+ // Named range?
+ $namedRange = ($worksheet === null) ? null : DefinedName::resolveName($range, $worksheet);
+ if ($namedRange === null) {
+ return ExcelError::REF();
+ }
+
+ $worksheet = $namedRange->getWorksheet();
+ $range = $namedRange->getValue();
+ $splitRange = Coordinate::splitRange($range);
+ // Convert row and column references
+ if ($worksheet !== null && ctype_alpha($splitRange[0][0])) {
+ $range = $splitRange[0][0] . '1:' . $splitRange[0][1] . $worksheet->getHighestRow();
+ } elseif ($worksheet !== null && ctype_digit($splitRange[0][0])) {
+ $range = 'A' . $splitRange[0][0] . ':' . $worksheet->getHighestColumn() . $splitRange[0][1];
+ }
+
+ // Extract range
+ $aReferences = Coordinate::extractAllCellReferencesInRange($range);
+ if (!isset($aReferences[1])) {
+ // Single cell (or single column or row) in range
+ [$currentCol, $currentRow] = Coordinate::coordinateFromString($aReferences[0]);
+ if ($worksheet !== null && $worksheet->cellExists($aReferences[0])) {
+ $returnValue[$currentRow][$currentCol] = $worksheet->getCell($aReferences[0])->getCalculatedValue($resetLog);
+ } else {
+ $returnValue[$currentRow][$currentCol] = null;
+ }
+ } else {
+ // Extract cell data for all cells in the range
+ foreach ($aReferences as $reference) {
+ // Extract range
+ [$currentCol, $currentRow] = Coordinate::coordinateFromString($reference);
+ if ($worksheet !== null && $worksheet->cellExists($reference)) {
+ $returnValue[$currentRow][$currentCol] = $worksheet->getCell($reference)->getCalculatedValue($resetLog);
+ } else {
+ $returnValue[$currentRow][$currentCol] = null;
+ }
+ }
+ }
+ }
+
+ return $returnValue;
+ }
+
+ /**
+ * Is a specific function implemented?
+ *
+ * @param string $function Function Name
+ */
+ public function isImplemented(string $function): bool
+ {
+ $function = strtoupper($function);
+ $notImplemented = !isset(self::$phpSpreadsheetFunctions[$function]) || (is_array(self::$phpSpreadsheetFunctions[$function]['functionCall']) && self::$phpSpreadsheetFunctions[$function]['functionCall'][1] === 'DUMMY');
+
+ return !$notImplemented;
+ }
+
+ /**
+ * Get a list of all implemented functions as an array of function objects.
+ */
+ public static function getFunctions(): array
+ {
+ return self::$phpSpreadsheetFunctions;
+ }
+
+ /**
+ * Get a list of implemented Excel function names.
+ */
+ public function getImplementedFunctionNames(): array
+ {
+ $returnValue = [];
+ foreach (self::$phpSpreadsheetFunctions as $functionName => $function) {
+ if ($this->isImplemented($functionName)) {
+ $returnValue[] = $functionName;
+ }
+ }
+
+ return $returnValue;
+ }
+
+ private function addDefaultArgumentValues(array $functionCall, array $args, array $emptyArguments): array
+ {
+ $reflector = new ReflectionMethod($functionCall[0], $functionCall[1]);
+ $methodArguments = $reflector->getParameters();
+
+ if (count($methodArguments) > 0) {
+ // Apply any defaults for empty argument values
+ foreach ($emptyArguments as $argumentId => $isArgumentEmpty) {
+ if ($isArgumentEmpty === true) {
+ $reflectedArgumentId = count($args) - (int) $argumentId - 1;
+ if (
+ !array_key_exists($reflectedArgumentId, $methodArguments)
+ || $methodArguments[$reflectedArgumentId]->isVariadic()
+ ) {
+ break;
+ }
+
+ $args[$argumentId] = $this->getArgumentDefaultValue($methodArguments[$reflectedArgumentId]);
+ }
+ }
+ }
+
+ return $args;
+ }
+
+ private function getArgumentDefaultValue(ReflectionParameter $methodArgument): mixed
+ {
+ $defaultValue = null;
+
+ if ($methodArgument->isDefaultValueAvailable()) {
+ $defaultValue = $methodArgument->getDefaultValue();
+ if ($methodArgument->isDefaultValueConstant()) {
+ $constantName = $methodArgument->getDefaultValueConstantName() ?? '';
+ // read constant value
+ if (str_contains($constantName, '::')) {
+ [$className, $constantName] = explode('::', $constantName);
+ $constantReflector = new ReflectionClassConstant($className, $constantName);
+
+ return $constantReflector->getValue();
+ }
+
+ return constant($constantName);
+ }
+ }
+
+ return $defaultValue;
+ }
+
+ /**
+ * Add cell reference if needed while making sure that it is the last argument.
+ */
+ private function addCellReference(array $args, bool $passCellReference, array|string $functionCall, ?Cell $cell = null): array
+ {
+ if ($passCellReference) {
+ if (is_array($functionCall)) {
+ $className = $functionCall[0];
+ $methodName = $functionCall[1];
+
+ $reflectionMethod = new ReflectionMethod($className, $methodName);
+ $argumentCount = count($reflectionMethod->getParameters());
+ while (count($args) < $argumentCount - 1) {
+ $args[] = null;
+ }
+ }
+
+ $args[] = $cell;
+ }
+
+ return $args;
+ }
+
+ private function evaluateDefinedName(Cell $cell, DefinedName $namedRange, Worksheet $cellWorksheet, Stack $stack): mixed
+ {
+ $definedNameScope = $namedRange->getScope();
+ if ($definedNameScope !== null && $definedNameScope !== $cellWorksheet) {
+ // The defined name isn't in our current scope, so #REF
+ $result = ExcelError::REF();
+ $stack->push('Error', $result, $namedRange->getName());
+
+ return $result;
+ }
+
+ $definedNameValue = $namedRange->getValue();
+ $definedNameType = $namedRange->isFormula() ? 'Formula' : 'Range';
+ $definedNameWorksheet = $namedRange->getWorksheet();
+
+ if ($definedNameValue[0] !== '=') {
+ $definedNameValue = '=' . $definedNameValue;
+ }
+
+ $this->debugLog->writeDebugLog('Defined Name is a %s with a value of %s', $definedNameType, $definedNameValue);
+
+ $originalCoordinate = $cell->getCoordinate();
+ $recursiveCalculationCell = ($definedNameType !== 'Formula' && $definedNameWorksheet !== null && $definedNameWorksheet !== $cellWorksheet)
+ ? $definedNameWorksheet->getCell('A1')
+ : $cell;
+ $recursiveCalculationCellAddress = $recursiveCalculationCell->getCoordinate();
+
+ // Adjust relative references in ranges and formulae so that we execute the calculation for the correct rows and columns
+ $definedNameValue = self::$referenceHelper->updateFormulaReferencesAnyWorksheet(
+ $definedNameValue,
+ Coordinate::columnIndexFromString($cell->getColumn()) - 1,
+ $cell->getRow() - 1
+ );
+
+ $this->debugLog->writeDebugLog('Value adjusted for relative references is %s', $definedNameValue);
+
+ $recursiveCalculator = new self($this->spreadsheet);
+ $recursiveCalculator->getDebugLog()->setWriteDebugLog($this->getDebugLog()->getWriteDebugLog());
+ $recursiveCalculator->getDebugLog()->setEchoDebugLog($this->getDebugLog()->getEchoDebugLog());
+ $result = $recursiveCalculator->_calculateFormulaValue($definedNameValue, $recursiveCalculationCellAddress, $recursiveCalculationCell, true);
+ $cellWorksheet->getCell($originalCoordinate);
+
+ if ($this->getDebugLog()->getWriteDebugLog()) {
+ $this->debugLog->mergeDebugLog(array_slice($recursiveCalculator->getDebugLog()->getLog(), 3));
+ $this->debugLog->writeDebugLog('Evaluation Result for Named %s %s is %s', $definedNameType, $namedRange->getName(), $this->showTypeDetails($result));
+ }
+
+ $stack->push('Defined Name', $result, $namedRange->getName());
+
+ return $result;
+ }
+
+ public function setSuppressFormulaErrors(bool $suppressFormulaErrors): void
+ {
+ $this->suppressFormulaErrorsNew = $suppressFormulaErrors;
+ }
+
+ public function getSuppressFormulaErrors(): bool
+ {
+ return $this->suppressFormulaErrorsNew;
+ }
+
+ private static function boolToString(mixed $operand1): mixed
+ {
+ if (is_bool($operand1)) {
+ $operand1 = ($operand1) ? self::$localeBoolean['TRUE'] : self::$localeBoolean['FALSE'];
+ } elseif ($operand1 === null) {
+ $operand1 = '';
+ }
+
+ return $operand1;
+ }
+
+ private static function isNumericOrBool(mixed $operand): bool
+ {
+ return is_numeric($operand) || is_bool($operand);
+ }
+
+ private static function makeError(mixed $operand = ''): string
+ {
+ return Information\ErrorValue::isError($operand) ? $operand : ExcelError::VALUE();
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Category.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Category.php
new file mode 100644
index 0000000..b661faf
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Category.php
@@ -0,0 +1,21 @@
+ 1) {
+ return ExcelError::NAN();
+ }
+
+ $row = array_pop($columnData);
+
+ return array_pop($row);
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Database/DMax.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Database/DMax.php
new file mode 100644
index 0000000..23b95a7
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Database/DMax.php
@@ -0,0 +1,45 @@
+= count($fieldNames)) {
+ return null;
+ }
+
+ return $field;
+ }
+ $key = array_search($field, array_values($fieldNames), true);
+
+ return ($key !== false) ? (int) $key : null;
+ }
+
+ /**
+ * filter.
+ *
+ * Parses the selection criteria, extracts the database rows that match those criteria, and
+ * returns that subset of rows.
+ *
+ * @param mixed[] $database The range of cells that makes up the list or database.
+ * A database is a list of related data in which rows of related
+ * information are records, and columns of data are fields. The
+ * first row of the list contains labels for each column.
+ * @param mixed[] $criteria The range of cells that contains the conditions you specify.
+ * You can use any range for the criteria argument, as long as it
+ * includes at least one column label and at least one cell below
+ * the column label in which you specify a condition for the
+ * column.
+ *
+ * @return mixed[]
+ */
+ protected static function filter(array $database, array $criteria): array
+ {
+ $fieldNames = array_shift($database);
+ $criteriaNames = array_shift($criteria);
+
+ // Convert the criteria into a set of AND/OR conditions with [:placeholders]
+ $query = self::buildQuery($criteriaNames, $criteria);
+
+ // Loop through each row of the database
+ return self::executeQuery($database, $query, $criteriaNames, $fieldNames);
+ }
+
+ protected static function getFilteredColumn(array $database, ?int $field, array $criteria): array
+ {
+ // reduce the database to a set of rows that match all the criteria
+ $database = self::filter($database, $criteria);
+ $defaultReturnColumnValue = ($field === null) ? 1 : null;
+
+ // extract an array of values for the requested column
+ $columnData = [];
+ foreach ($database as $rowKey => $row) {
+ $keys = array_keys($row);
+ $key = $keys[$field] ?? null;
+ $columnKey = $key ?? 'A';
+ $columnData[$rowKey][$columnKey] = $row[$key] ?? $defaultReturnColumnValue;
+ }
+
+ return $columnData;
+ }
+
+ private static function buildQuery(array $criteriaNames, array $criteria): string
+ {
+ $baseQuery = [];
+ foreach ($criteria as $key => $criterion) {
+ foreach ($criterion as $field => $value) {
+ $criterionName = $criteriaNames[$field];
+ if ($value !== null) {
+ $condition = self::buildCondition($value, $criterionName);
+ $baseQuery[$key][] = $condition;
+ }
+ }
+ }
+
+ $rowQuery = array_map(
+ fn ($rowValue): string => (count($rowValue) > 1) ? 'AND(' . implode(',', $rowValue) . ')' : ($rowValue[0] ?? ''),
+ $baseQuery
+ );
+
+ return (count($rowQuery) > 1) ? 'OR(' . implode(',', $rowQuery) . ')' : ($rowQuery[0] ?? '');
+ }
+
+ private static function buildCondition(mixed $criterion, string $criterionName): string
+ {
+ $ifCondition = Functions::ifCondition($criterion);
+
+ // Check for wildcard characters used in the condition
+ $result = preg_match('/(?[^"]*)(?".*[*?].*")/ui', $ifCondition, $matches);
+ if ($result !== 1) {
+ return "[:{$criterionName}]{$ifCondition}";
+ }
+
+ $trueFalse = ($matches['operator'] !== '<>');
+ $wildcard = WildcardMatch::wildcard($matches['operand']);
+ $condition = "WILDCARDMATCH([:{$criterionName}],{$wildcard})";
+ if ($trueFalse === false) {
+ $condition = "NOT({$condition})";
+ }
+
+ return $condition;
+ }
+
+ private static function executeQuery(array $database, string $query, array $criteria, array $fields): array
+ {
+ foreach ($database as $dataRow => $dataValues) {
+ // Substitute actual values from the database row for our [:placeholders]
+ $conditions = $query;
+ foreach ($criteria as $criterion) {
+ $conditions = self::processCondition($criterion, $fields, $dataValues, $conditions);
+ }
+
+ // evaluate the criteria against the row data
+ $result = Calculation::getInstance()->_calculateFormulaValue('=' . $conditions);
+
+ // If the row failed to meet the criteria, remove it from the database
+ if ($result !== true) {
+ unset($database[$dataRow]);
+ }
+ }
+
+ return $database;
+ }
+
+ private static function processCondition(string $criterion, array $fields, array $dataValues, string $conditions): string
+ {
+ $key = array_search($criterion, $fields, true);
+
+ $dataValue = 'NULL';
+ if (is_bool($dataValues[$key])) {
+ $dataValue = ($dataValues[$key]) ? 'TRUE' : 'FALSE';
+ } elseif ($dataValues[$key] !== null) {
+ $dataValue = $dataValues[$key];
+ // escape quotes if we have a string containing quotes
+ if (is_string($dataValue) && str_contains($dataValue, '"')) {
+ $dataValue = str_replace('"', '""', $dataValue);
+ }
+ $dataValue = (is_string($dataValue)) ? Calculation::wrapResult(strtoupper($dataValue)) : $dataValue;
+ }
+
+ return str_replace('[:' . $criterion . ']', $dataValue, $conditions);
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/Constants.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/Constants.php
new file mode 100644
index 0000000..1165eb1
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/Constants.php
@@ -0,0 +1,38 @@
+ self::DOW_SUNDAY,
+ self::DOW_MONDAY,
+ self::STARTWEEK_MONDAY_ALT => self::DOW_MONDAY,
+ self::DOW_TUESDAY,
+ self::DOW_WEDNESDAY,
+ self::DOW_THURSDAY,
+ self::DOW_FRIDAY,
+ self::DOW_SATURDAY,
+ self::DOW_SUNDAY,
+ self::STARTWEEK_MONDAY_ISO => self::STARTWEEK_MONDAY_ISO,
+ ];
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/Current.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/Current.php
new file mode 100644
index 0000000..088e379
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/Current.php
@@ -0,0 +1,60 @@
+format('c'));
+
+ return Helpers::dateParseSucceeded($dateArray) ? Helpers::returnIn3FormatsArray($dateArray, true) : ExcelError::VALUE();
+ }
+
+ /**
+ * DATETIMENOW.
+ *
+ * Returns the current date and time.
+ * The NOW function is useful when you need to display the current date and time on a worksheet or
+ * calculate a value based on the current date and time, and have that value updated each time you
+ * open the worksheet.
+ *
+ * NOTE: When used in a Cell Formula, MS Excel changes the cell format so that it matches the date
+ * and time format of your regional settings. PhpSpreadsheet does not change cell formatting in this way.
+ *
+ * Excel Function:
+ * NOW()
+ *
+ * @return DateTime|float|int|string Excel date/time serial value, PHP date/time serial value or PHP date/time object,
+ * depending on the value of the ReturnDateType flag
+ */
+ public static function now(): DateTime|float|int|string
+ {
+ $dti = new DateTimeImmutable();
+ $dateArray = Helpers::dateParse($dti->format('c'));
+
+ return Helpers::dateParseSucceeded($dateArray) ? Helpers::returnIn3FormatsArray($dateArray) : ExcelError::VALUE();
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/Date.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/Date.php
new file mode 100644
index 0000000..e0e4b25
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/Date.php
@@ -0,0 +1,167 @@
+getMessage();
+ }
+
+ // Execute function
+ $excelDateValue = SharedDateHelper::formattedPHPToExcel($year, $month, $day);
+
+ return Helpers::returnIn3FormatsFloat($excelDateValue);
+ }
+
+ /**
+ * Convert year from multiple formats to int.
+ */
+ private static function getYear(mixed $year, int $baseYear): int
+ {
+ $year = ($year !== null) ? StringHelper::testStringAsNumeric((string) $year) : 0;
+ if (!is_numeric($year)) {
+ throw new Exception(ExcelError::VALUE());
+ }
+ $year = (int) $year;
+
+ if ($year < ($baseYear - 1900)) {
+ throw new Exception(ExcelError::NAN());
+ }
+ if ((($baseYear - 1900) !== 0) && ($year < $baseYear) && ($year >= 1900)) {
+ throw new Exception(ExcelError::NAN());
+ }
+
+ if (($year < $baseYear) && ($year >= ($baseYear - 1900))) {
+ $year += 1900;
+ }
+
+ return (int) $year;
+ }
+
+ /**
+ * Convert month from multiple formats to int.
+ */
+ private static function getMonth(mixed $month): int
+ {
+ if (($month !== null) && (!is_numeric($month))) {
+ $month = SharedDateHelper::monthStringToNumber($month);
+ }
+
+ $month = ($month !== null) ? StringHelper::testStringAsNumeric((string) $month) : 0;
+ if (!is_numeric($month)) {
+ throw new Exception(ExcelError::VALUE());
+ }
+
+ return (int) $month;
+ }
+
+ /**
+ * Convert day from multiple formats to int.
+ */
+ private static function getDay(mixed $day): int
+ {
+ if (($day !== null) && (!is_numeric($day))) {
+ $day = SharedDateHelper::dayStringToNumber($day);
+ }
+
+ $day = ($day !== null) ? StringHelper::testStringAsNumeric((string) $day) : 0;
+ if (!is_numeric($day)) {
+ throw new Exception(ExcelError::VALUE());
+ }
+
+ return (int) $day;
+ }
+
+ private static function adjustYearMonth(int &$year, int &$month, int $baseYear): void
+ {
+ if ($month < 1) {
+ // Handle year/month adjustment if month < 1
+ --$month;
+ $year += ceil($month / 12) - 1;
+ $month = 13 - abs($month % 12);
+ } elseif ($month > 12) {
+ // Handle year/month adjustment if month > 12
+ $year += floor($month / 12);
+ $month = ($month % 12);
+ }
+
+ // Re-validate the year parameter after adjustments
+ if (($year < $baseYear) || ($year >= 10000)) {
+ throw new Exception(ExcelError::NAN());
+ }
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/DateParts.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/DateParts.php
new file mode 100644
index 0000000..60e4de1
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/DateParts.php
@@ -0,0 +1,154 @@
+= 0) {
+ return $weirdResult;
+ }
+
+ try {
+ $dateValue = Helpers::getDateValue($dateValue);
+ } catch (Exception $e) {
+ return $e->getMessage();
+ }
+
+ // Execute function
+ $PHPDateObject = SharedDateHelper::excelToDateTimeObject($dateValue);
+ SharedDateHelper::roundMicroseconds($PHPDateObject);
+
+ return (int) $PHPDateObject->format('j');
+ }
+
+ /**
+ * MONTHOFYEAR.
+ *
+ * Returns the month of a date represented by a serial number.
+ * The month is given as an integer, ranging from 1 (January) to 12 (December).
+ *
+ * Excel Function:
+ * MONTH(dateValue)
+ *
+ * @param mixed $dateValue Excel date serial value (float), PHP date timestamp (integer),
+ * PHP DateTime object, or a standard date string
+ * Or can be an array of date values
+ *
+ * @return array|int|string Month of the year
+ * If an array of numbers is passed as the argument, then the returned result will also be an array
+ * with the same dimensions
+ */
+ public static function month(mixed $dateValue): array|string|int
+ {
+ if (is_array($dateValue)) {
+ return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $dateValue);
+ }
+
+ try {
+ $dateValue = Helpers::getDateValue($dateValue);
+ } catch (Exception $e) {
+ return $e->getMessage();
+ }
+ if ($dateValue < 1 && SharedDateHelper::getExcelCalendar() === SharedDateHelper::CALENDAR_WINDOWS_1900) {
+ return 1;
+ }
+
+ // Execute function
+ $PHPDateObject = SharedDateHelper::excelToDateTimeObject($dateValue);
+ SharedDateHelper::roundMicroseconds($PHPDateObject);
+
+ return (int) $PHPDateObject->format('n');
+ }
+
+ /**
+ * YEAR.
+ *
+ * Returns the year corresponding to a date.
+ * The year is returned as an integer in the range 1900-9999.
+ *
+ * Excel Function:
+ * YEAR(dateValue)
+ *
+ * @param mixed $dateValue Excel date serial value (float), PHP date timestamp (integer),
+ * PHP DateTime object, or a standard date string
+ * Or can be an array of date values
+ *
+ * @return array|int|string Year
+ * If an array of numbers is passed as the argument, then the returned result will also be an array
+ * with the same dimensions
+ */
+ public static function year(mixed $dateValue): array|string|int
+ {
+ if (is_array($dateValue)) {
+ return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $dateValue);
+ }
+
+ try {
+ $dateValue = Helpers::getDateValue($dateValue);
+ } catch (Exception $e) {
+ return $e->getMessage();
+ }
+
+ if ($dateValue < 1 && SharedDateHelper::getExcelCalendar() === SharedDateHelper::CALENDAR_WINDOWS_1900) {
+ return 1900;
+ }
+ // Execute function
+ $PHPDateObject = SharedDateHelper::excelToDateTimeObject($dateValue);
+ SharedDateHelper::roundMicroseconds($PHPDateObject);
+
+ return (int) $PHPDateObject->format('Y');
+ }
+
+ /**
+ * @param mixed $dateValue Excel date serial value (float), PHP date timestamp (integer),
+ * PHP DateTime object, or a standard date string
+ */
+ private static function weirdCondition(mixed $dateValue): int
+ {
+ // Excel does not treat 0 consistently for DAY vs. (MONTH or YEAR)
+ if (SharedDateHelper::getExcelCalendar() === SharedDateHelper::CALENDAR_WINDOWS_1900 && Functions::getCompatibilityMode() == Functions::COMPATIBILITY_EXCEL) {
+ if (is_bool($dateValue)) {
+ return (int) $dateValue;
+ }
+ if ($dateValue === null) {
+ return 0;
+ }
+ if (is_numeric($dateValue) && $dateValue < 1 && $dateValue >= 0) {
+ return 0;
+ }
+ }
+
+ return -1;
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/DateValue.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/DateValue.php
new file mode 100644
index 0000000..8c5fa71
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/DateValue.php
@@ -0,0 +1,163 @@
+ 31)) {
+ if ($yearFound) {
+ return ExcelError::VALUE();
+ }
+ if ($t < 100) {
+ $t += 1900;
+ }
+ $yearFound = true;
+ }
+ }
+ if (count($t1) === 1) {
+ // We've been fed a time value without any date
+ return ((!str_contains((string) $t, ':'))) ? ExcelError::Value() : 0.0;
+ }
+ unset($t);
+
+ $dateValue = self::t1ToString($t1, $dti, $yearFound);
+
+ $PHPDateArray = self::setUpArray($dateValue, $dti);
+
+ return self::finalResults($PHPDateArray, $dti, $baseYear);
+ }
+
+ private static function t1ToString(array $t1, DateTimeImmutable $dti, bool $yearFound): string
+ {
+ if (count($t1) == 2) {
+ // We only have two parts of the date: either day/month or month/year
+ if ($yearFound) {
+ array_unshift($t1, 1);
+ } else {
+ if (is_numeric($t1[1]) && $t1[1] > 29) {
+ $t1[1] += 1900;
+ array_unshift($t1, 1);
+ } else {
+ $t1[] = $dti->format('Y');
+ }
+ }
+ }
+ $dateValue = implode(' ', $t1);
+
+ return $dateValue;
+ }
+
+ /**
+ * Parse date.
+ */
+ private static function setUpArray(string $dateValue, DateTimeImmutable $dti): array
+ {
+ $PHPDateArray = Helpers::dateParse($dateValue);
+ if (!Helpers::dateParseSucceeded($PHPDateArray)) {
+ // If original count was 1, we've already returned.
+ // If it was 2, we added another.
+ // Therefore, neither of the first 2 stroks below can fail.
+ $testVal1 = strtok($dateValue, '- ');
+ $testVal2 = strtok('- ');
+ $testVal3 = strtok('- ') ?: $dti->format('Y');
+ Helpers::adjustYear((string) $testVal1, (string) $testVal2, $testVal3);
+ $PHPDateArray = Helpers::dateParse($testVal1 . '-' . $testVal2 . '-' . $testVal3);
+ if (!Helpers::dateParseSucceeded($PHPDateArray)) {
+ $PHPDateArray = Helpers::dateParse($testVal2 . '-' . $testVal1 . '-' . $testVal3);
+ }
+ }
+
+ return $PHPDateArray;
+ }
+
+ /**
+ * Final results.
+ *
+ * @return DateTime|float|int|string Excel date/time serial value, PHP date/time serial value or PHP date/time object,
+ * depending on the value of the ReturnDateType flag
+ */
+ private static function finalResults(array $PHPDateArray, DateTimeImmutable $dti, int $baseYear): string|float|int|DateTime
+ {
+ $retValue = ExcelError::Value();
+ if (Helpers::dateParseSucceeded($PHPDateArray)) {
+ // Execute function
+ Helpers::replaceIfEmpty($PHPDateArray['year'], $dti->format('Y'));
+ if ($PHPDateArray['year'] < $baseYear) {
+ return ExcelError::VALUE();
+ }
+ Helpers::replaceIfEmpty($PHPDateArray['month'], $dti->format('m'));
+ Helpers::replaceIfEmpty($PHPDateArray['day'], $dti->format('d'));
+ $PHPDateArray['hour'] = 0;
+ $PHPDateArray['minute'] = 0;
+ $PHPDateArray['second'] = 0;
+ $month = (int) $PHPDateArray['month'];
+ $day = (int) $PHPDateArray['day'];
+ $year = (int) $PHPDateArray['year'];
+ if (!checkdate($month, $day, $year)) {
+ return ($year === 1900 && $month === 2 && $day === 29) ? Helpers::returnIn3FormatsFloat(60.0) : ExcelError::VALUE();
+ }
+ $retValue = Helpers::returnIn3FormatsArray($PHPDateArray, true);
+ }
+
+ return $retValue;
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/Days.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/Days.php
new file mode 100644
index 0000000..6c6fd3d
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/Days.php
@@ -0,0 +1,62 @@
+getMessage();
+ }
+
+ // Execute function
+ $PHPStartDateObject = SharedDateHelper::excelToDateTimeObject($startDate);
+ $PHPEndDateObject = SharedDateHelper::excelToDateTimeObject($endDate);
+
+ $days = ExcelError::VALUE();
+ $diff = $PHPStartDateObject->diff($PHPEndDateObject);
+ if ($diff !== false && !is_bool($diff->days)) {
+ $days = $diff->days;
+ if ($diff->invert) {
+ $days = -$days;
+ }
+ }
+
+ return $days;
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/Days360.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/Days360.php
new file mode 100644
index 0000000..c7e03fc
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/Days360.php
@@ -0,0 +1,118 @@
+getMessage();
+ }
+
+ if (!is_bool($method)) {
+ return ExcelError::VALUE();
+ }
+
+ // Execute function
+ $PHPStartDateObject = SharedDateHelper::excelToDateTimeObject($startDate);
+ $startDay = $PHPStartDateObject->format('j');
+ $startMonth = $PHPStartDateObject->format('n');
+ $startYear = $PHPStartDateObject->format('Y');
+
+ $PHPEndDateObject = SharedDateHelper::excelToDateTimeObject($endDate);
+ $endDay = $PHPEndDateObject->format('j');
+ $endMonth = $PHPEndDateObject->format('n');
+ $endYear = $PHPEndDateObject->format('Y');
+
+ return self::dateDiff360((int) $startDay, (int) $startMonth, (int) $startYear, (int) $endDay, (int) $endMonth, (int) $endYear, !$method);
+ }
+
+ /**
+ * Return the number of days between two dates based on a 360 day calendar.
+ */
+ private static function dateDiff360(int $startDay, int $startMonth, int $startYear, int $endDay, int $endMonth, int $endYear, bool $methodUS): int
+ {
+ $startDay = self::getStartDay($startDay, $startMonth, $startYear, $methodUS);
+ $endDay = self::getEndDay($endDay, $endMonth, $endYear, $startDay, $methodUS);
+
+ return $endDay + $endMonth * 30 + $endYear * 360 - $startDay - $startMonth * 30 - $startYear * 360;
+ }
+
+ private static function getStartDay(int $startDay, int $startMonth, int $startYear, bool $methodUS): int
+ {
+ if ($startDay == 31) {
+ --$startDay;
+ } elseif ($methodUS && ($startMonth == 2 && ($startDay == 29 || ($startDay == 28 && !Helpers::isLeapYear($startYear))))) {
+ $startDay = 30;
+ }
+
+ return $startDay;
+ }
+
+ private static function getEndDay(int $endDay, int &$endMonth, int &$endYear, int $startDay, bool $methodUS): int
+ {
+ if ($endDay == 31) {
+ if ($methodUS && $startDay != 30) {
+ $endDay = 1;
+ if ($endMonth == 12) {
+ ++$endYear;
+ $endMonth = 1;
+ } else {
+ ++$endMonth;
+ }
+ } else {
+ $endDay = 30;
+ }
+ }
+
+ return $endDay;
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/Difference.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/Difference.php
new file mode 100644
index 0000000..199d5d8
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/Difference.php
@@ -0,0 +1,153 @@
+getMessage();
+ }
+
+ // Execute function
+ $PHPStartDateObject = SharedDateHelper::excelToDateTimeObject($startDate);
+ $startDays = (int) $PHPStartDateObject->format('j');
+ //$startMonths = (int) $PHPStartDateObject->format('n');
+ $startYears = (int) $PHPStartDateObject->format('Y');
+
+ $PHPEndDateObject = SharedDateHelper::excelToDateTimeObject($endDate);
+ $endDays = (int) $PHPEndDateObject->format('j');
+ //$endMonths = (int) $PHPEndDateObject->format('n');
+ $endYears = (int) $PHPEndDateObject->format('Y');
+
+ $PHPDiffDateObject = $PHPEndDateObject->diff($PHPStartDateObject);
+
+ $retVal = false;
+ $retVal = self::replaceRetValue($retVal, $unit, 'D') ?? self::datedifD($difference);
+ $retVal = self::replaceRetValue($retVal, $unit, 'M') ?? self::datedifM($PHPDiffDateObject);
+ $retVal = self::replaceRetValue($retVal, $unit, 'MD') ?? self::datedifMD($startDays, $endDays, $PHPEndDateObject, $PHPDiffDateObject);
+ $retVal = self::replaceRetValue($retVal, $unit, 'Y') ?? self::datedifY($PHPDiffDateObject);
+ $retVal = self::replaceRetValue($retVal, $unit, 'YD') ?? self::datedifYD($difference, $startYears, $endYears, $PHPStartDateObject, $PHPEndDateObject);
+ $retVal = self::replaceRetValue($retVal, $unit, 'YM') ?? self::datedifYM($PHPDiffDateObject);
+
+ return is_bool($retVal) ? ExcelError::VALUE() : $retVal;
+ }
+
+ private static function initialDiff(float $startDate, float $endDate): float
+ {
+ // Validate parameters
+ if ($startDate > $endDate) {
+ throw new Exception(ExcelError::NAN());
+ }
+
+ return $endDate - $startDate;
+ }
+
+ /**
+ * Decide whether it's time to set retVal.
+ */
+ private static function replaceRetValue(bool|int $retVal, string $unit, string $compare): null|bool|int
+ {
+ if ($retVal !== false || $unit !== $compare) {
+ return $retVal;
+ }
+
+ return null;
+ }
+
+ private static function datedifD(float $difference): int
+ {
+ return (int) $difference;
+ }
+
+ private static function datedifM(DateInterval $PHPDiffDateObject): int
+ {
+ return 12 * (int) $PHPDiffDateObject->format('%y') + (int) $PHPDiffDateObject->format('%m');
+ }
+
+ private static function datedifMD(int $startDays, int $endDays, DateTime $PHPEndDateObject, DateInterval $PHPDiffDateObject): int
+ {
+ if ($endDays < $startDays) {
+ $retVal = $endDays;
+ $PHPEndDateObject->modify('-' . $endDays . ' days');
+ $adjustDays = (int) $PHPEndDateObject->format('j');
+ $retVal += ($adjustDays - $startDays);
+ } else {
+ $retVal = (int) $PHPDiffDateObject->format('%d');
+ }
+
+ return $retVal;
+ }
+
+ private static function datedifY(DateInterval $PHPDiffDateObject): int
+ {
+ return (int) $PHPDiffDateObject->format('%y');
+ }
+
+ private static function datedifYD(float $difference, int $startYears, int $endYears, DateTime $PHPStartDateObject, DateTime $PHPEndDateObject): int
+ {
+ $retVal = (int) $difference;
+ if ($endYears > $startYears) {
+ $isLeapStartYear = $PHPStartDateObject->format('L');
+ $wasLeapEndYear = $PHPEndDateObject->format('L');
+
+ // Adjust end year to be as close as possible as start year
+ while ($PHPEndDateObject >= $PHPStartDateObject) {
+ $PHPEndDateObject->modify('-1 year');
+ //$endYears = $PHPEndDateObject->format('Y');
+ }
+ $PHPEndDateObject->modify('+1 year');
+
+ // Get the result
+ $retVal = (int) $PHPEndDateObject->diff($PHPStartDateObject)->days;
+
+ // Adjust for leap years cases
+ $isLeapEndYear = $PHPEndDateObject->format('L');
+ $limit = new DateTime($PHPEndDateObject->format('Y-02-29'));
+ if (!$isLeapStartYear && !$wasLeapEndYear && $isLeapEndYear && $PHPEndDateObject >= $limit) {
+ --$retVal;
+ }
+ }
+
+ return (int) $retVal;
+ }
+
+ private static function datedifYM(DateInterval $PHPDiffDateObject): int
+ {
+ return (int) $PHPDiffDateObject->format('%m');
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/Helpers.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/Helpers.php
new file mode 100644
index 0000000..94ffa4c
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/Helpers.php
@@ -0,0 +1,285 @@
+format('m');
+ $oYear = (int) $PHPDateObject->format('Y');
+
+ $adjustmentMonthsString = (string) $adjustmentMonths;
+ if ($adjustmentMonths > 0) {
+ $adjustmentMonthsString = '+' . $adjustmentMonths;
+ }
+ if ($adjustmentMonths != 0) {
+ $PHPDateObject->modify($adjustmentMonthsString . ' months');
+ }
+ $nMonth = (int) $PHPDateObject->format('m');
+ $nYear = (int) $PHPDateObject->format('Y');
+
+ $monthDiff = ($nMonth - $oMonth) + (($nYear - $oYear) * 12);
+ if ($monthDiff != $adjustmentMonths) {
+ $adjustDays = (int) $PHPDateObject->format('d');
+ $adjustDaysString = '-' . $adjustDays . ' days';
+ $PHPDateObject->modify($adjustDaysString);
+ }
+
+ return $PHPDateObject;
+ }
+
+ /**
+ * Help reduce perceived complexity of some tests.
+ */
+ public static function replaceIfEmpty(mixed &$value, mixed $altValue): void
+ {
+ $value = $value ?: $altValue;
+ }
+
+ /**
+ * Adjust year in ambiguous situations.
+ */
+ public static function adjustYear(string $testVal1, string $testVal2, string &$testVal3): void
+ {
+ if (!is_numeric($testVal1) || $testVal1 < 31) {
+ if (!is_numeric($testVal2) || $testVal2 < 12) {
+ if (is_numeric($testVal3) && $testVal3 < 12) {
+ $testVal3 += 2000;
+ }
+ }
+ }
+ }
+
+ /**
+ * Return result in one of three formats.
+ */
+ public static function returnIn3FormatsArray(array $dateArray, bool $noFrac = false): DateTime|float|int
+ {
+ $retType = Functions::getReturnDateType();
+ if ($retType === Functions::RETURNDATE_PHP_DATETIME_OBJECT) {
+ return new DateTime(
+ $dateArray['year']
+ . '-' . $dateArray['month']
+ . '-' . $dateArray['day']
+ . ' ' . $dateArray['hour']
+ . ':' . $dateArray['minute']
+ . ':' . $dateArray['second']
+ );
+ }
+ $excelDateValue
+ = SharedDateHelper::formattedPHPToExcel(
+ $dateArray['year'],
+ $dateArray['month'],
+ $dateArray['day'],
+ $dateArray['hour'],
+ $dateArray['minute'],
+ $dateArray['second']
+ );
+ if ($retType === Functions::RETURNDATE_EXCEL) {
+ return $noFrac ? floor($excelDateValue) : $excelDateValue;
+ }
+ // RETURNDATE_UNIX_TIMESTAMP)
+
+ return SharedDateHelper::excelToTimestamp($excelDateValue);
+ }
+
+ /**
+ * Return result in one of three formats.
+ */
+ public static function returnIn3FormatsFloat(float $excelDateValue): float|int|DateTime
+ {
+ $retType = Functions::getReturnDateType();
+ if ($retType === Functions::RETURNDATE_EXCEL) {
+ return $excelDateValue;
+ }
+ if ($retType === Functions::RETURNDATE_UNIX_TIMESTAMP) {
+ return SharedDateHelper::excelToTimestamp($excelDateValue);
+ }
+ // RETURNDATE_PHP_DATETIME_OBJECT
+
+ return SharedDateHelper::excelToDateTimeObject($excelDateValue);
+ }
+
+ /**
+ * Return result in one of three formats.
+ */
+ public static function returnIn3FormatsObject(DateTime $PHPDateObject): DateTime|float|int
+ {
+ $retType = Functions::getReturnDateType();
+ if ($retType === Functions::RETURNDATE_PHP_DATETIME_OBJECT) {
+ return $PHPDateObject;
+ }
+ if ($retType === Functions::RETURNDATE_EXCEL) {
+ return (float) SharedDateHelper::PHPToExcel($PHPDateObject);
+ }
+ // RETURNDATE_UNIX_TIMESTAMP
+ $stamp = SharedDateHelper::PHPToExcel($PHPDateObject);
+ $stamp = is_bool($stamp) ? ((int) $stamp) : $stamp;
+
+ return SharedDateHelper::excelToTimestamp($stamp);
+ }
+
+ private static function baseDate(): int
+ {
+ if (Functions::getCompatibilityMode() === Functions::COMPATIBILITY_OPENOFFICE) {
+ return 0;
+ }
+ if (SharedDateHelper::getExcelCalendar() === SharedDateHelper::CALENDAR_MAC_1904) {
+ return 0;
+ }
+
+ return 1;
+ }
+
+ /**
+ * Many functions accept null/false/true argument treated as 0/0/1.
+ */
+ public static function nullFalseTrueToNumber(mixed &$number, bool $allowBool = true): void
+ {
+ $number = Functions::flattenSingleValue($number);
+ $nullVal = self::baseDate();
+ if ($number === null) {
+ $number = $nullVal;
+ } elseif ($allowBool && is_bool($number)) {
+ $number = $nullVal + (int) $number;
+ }
+ }
+
+ /**
+ * Many functions accept null argument treated as 0.
+ */
+ public static function validateNumericNull(mixed $number): int|float
+ {
+ $number = Functions::flattenSingleValue($number);
+ if ($number === null) {
+ return 0;
+ }
+ if (is_int($number)) {
+ return $number;
+ }
+ if (is_numeric($number)) {
+ return (float) $number;
+ }
+
+ throw new Exception(ExcelError::VALUE());
+ }
+
+ /**
+ * Many functions accept null/false/true argument treated as 0/0/1.
+ *
+ * @phpstan-assert float $number
+ */
+ public static function validateNotNegative(mixed $number): float
+ {
+ if (!is_numeric($number)) {
+ throw new Exception(ExcelError::VALUE());
+ }
+ if ($number >= 0) {
+ return (float) $number;
+ }
+
+ throw new Exception(ExcelError::NAN());
+ }
+
+ public static function silly1900(DateTime $PHPDateObject, string $mod = '-1 day'): void
+ {
+ $isoDate = $PHPDateObject->format('c');
+ if ($isoDate < '1900-03-01') {
+ $PHPDateObject->modify($mod);
+ }
+ }
+
+ public static function dateParse(string $string): array
+ {
+ return self::forceArray(date_parse($string));
+ }
+
+ public static function dateParseSucceeded(array $dateArray): bool
+ {
+ return $dateArray['error_count'] === 0;
+ }
+
+ /**
+ * Despite documentation, date_parse probably never returns false.
+ * Just in case, this routine helps guarantee it.
+ *
+ * @param array|false $dateArray
+ */
+ private static function forceArray(array|bool $dateArray): array
+ {
+ return is_array($dateArray) ? $dateArray : ['error_count' => 1];
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/Month.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/Month.php
new file mode 100644
index 0000000..a90c051
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/Month.php
@@ -0,0 +1,104 @@
+getMessage();
+ }
+ $dateValue = floor($dateValue);
+ $adjustmentMonths = floor($adjustmentMonths);
+
+ // Execute function
+ $PHPDateObject = Helpers::adjustDateByMonths($dateValue, $adjustmentMonths);
+
+ return Helpers::returnIn3FormatsObject($PHPDateObject);
+ }
+
+ /**
+ * EOMONTH.
+ *
+ * Returns the date value for the last day of the month that is the indicated number of months
+ * before or after start_date.
+ * Use EOMONTH to calculate maturity dates or due dates that fall on the last day of the month.
+ *
+ * Excel Function:
+ * EOMONTH(dateValue,adjustmentMonths)
+ *
+ * @param mixed $dateValue Excel date serial value (float), PHP date timestamp (integer),
+ * PHP DateTime object, or a standard date string
+ * Or can be an array of date values
+ * @param array|int $adjustmentMonths The number of months before or after start_date.
+ * A positive value for months yields a future date;
+ * a negative value yields a past date.
+ * Or can be an array of adjustment values
+ *
+ * @return array|DateTime|float|int|string Excel date/time serial value, PHP date/time serial value or PHP date/time object,
+ * depending on the value of the ReturnDateType flag
+ * If an array of values is passed as the argument, then the returned result will also be an array
+ * with the same dimensions
+ */
+ public static function lastDay(mixed $dateValue, array|float|int|bool|string $adjustmentMonths): array|string|DateTime|float|int
+ {
+ if (is_array($dateValue) || is_array($adjustmentMonths)) {
+ return self::evaluateArrayArguments([self::class, __FUNCTION__], $dateValue, $adjustmentMonths);
+ }
+
+ try {
+ $dateValue = Helpers::getDateValue($dateValue, false);
+ $adjustmentMonths = Helpers::validateNumericNull($adjustmentMonths);
+ } catch (Exception $e) {
+ return $e->getMessage();
+ }
+ $dateValue = floor($dateValue);
+ $adjustmentMonths = floor($adjustmentMonths);
+
+ // Execute function
+ $PHPDateObject = Helpers::adjustDateByMonths($dateValue, $adjustmentMonths + 1);
+ $adjustDays = (int) $PHPDateObject->format('d');
+ $adjustDaysString = '-' . $adjustDays . ' days';
+ $PHPDateObject->modify($adjustDaysString);
+
+ return Helpers::returnIn3FormatsObject($PHPDateObject);
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/NetworkDays.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/NetworkDays.php
new file mode 100644
index 0000000..503e30e
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/NetworkDays.php
@@ -0,0 +1,119 @@
+getMessage();
+ }
+
+ // Execute function
+ $startDow = self::calcStartDow($startDate);
+ $endDow = self::calcEndDow($endDate);
+ $wholeWeekDays = (int) floor(($endDate - $startDate) / 7) * 5;
+ $partWeekDays = self::calcPartWeekDays($startDow, $endDow);
+
+ // Test any extra holiday parameters
+ $holidayCountedArray = [];
+ foreach ($holidayArray as $holidayDate) {
+ if (($holidayDate >= $startDate) && ($holidayDate <= $endDate)) {
+ if ((Week::day($holidayDate, 2) < 6) && (!in_array($holidayDate, $holidayCountedArray))) {
+ --$partWeekDays;
+ $holidayCountedArray[] = $holidayDate;
+ }
+ }
+ }
+
+ return self::applySign($wholeWeekDays + $partWeekDays, $sDate, $eDate);
+ }
+
+ private static function calcStartDow(float $startDate): int
+ {
+ $startDow = 6 - (int) Week::day($startDate, 2);
+ if ($startDow < 0) {
+ $startDow = 5;
+ }
+
+ return $startDow;
+ }
+
+ private static function calcEndDow(float $endDate): int
+ {
+ $endDow = (int) Week::day($endDate, 2);
+ if ($endDow >= 6) {
+ $endDow = 0;
+ }
+
+ return $endDow;
+ }
+
+ private static function calcPartWeekDays(int $startDow, int $endDow): int
+ {
+ $partWeekDays = $endDow + $startDow;
+ if ($partWeekDays > 5) {
+ $partWeekDays -= 5;
+ }
+
+ return $partWeekDays;
+ }
+
+ private static function applySign(int $result, float $sDate, float $eDate): int
+ {
+ return ($sDate > $eDate) ? -$result : $result;
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/Time.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/Time.php
new file mode 100644
index 0000000..3f8f324
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/Time.php
@@ -0,0 +1,130 @@
+getMessage();
+ }
+
+ self::adjustSecond($second, $minute);
+ self::adjustMinute($minute, $hour);
+
+ if ($hour > 23) {
+ $hour = $hour % 24;
+ } elseif ($hour < 0) {
+ return ExcelError::NAN();
+ }
+
+ // Execute function
+ $retType = Functions::getReturnDateType();
+ if ($retType === Functions::RETURNDATE_EXCEL) {
+ $calendar = SharedDateHelper::getExcelCalendar();
+ $date = (int) ($calendar !== SharedDateHelper::CALENDAR_WINDOWS_1900);
+
+ return (float) SharedDateHelper::formattedPHPToExcel($calendar, 1, $date, $hour, $minute, $second);
+ }
+ if ($retType === Functions::RETURNDATE_UNIX_TIMESTAMP) {
+ return (int) SharedDateHelper::excelToTimestamp(SharedDateHelper::formattedPHPToExcel(1970, 1, 1, $hour, $minute, $second)); // -2147468400; // -2147472000 + 3600
+ }
+ // RETURNDATE_PHP_DATETIME_OBJECT
+ // Hour has already been normalized (0-23) above
+ $phpDateObject = new DateTime('1900-01-01 ' . $hour . ':' . $minute . ':' . $second);
+
+ return $phpDateObject;
+ }
+
+ private static function adjustSecond(int &$second, int &$minute): void
+ {
+ if ($second < 0) {
+ $minute += floor($second / 60);
+ $second = 60 - abs($second % 60);
+ if ($second == 60) {
+ $second = 0;
+ }
+ } elseif ($second >= 60) {
+ $minute += floor($second / 60);
+ $second = $second % 60;
+ }
+ }
+
+ private static function adjustMinute(int &$minute, int &$hour): void
+ {
+ if ($minute < 0) {
+ $hour += floor($minute / 60);
+ $minute = 60 - abs($minute % 60);
+ if ($minute == 60) {
+ $minute = 0;
+ }
+ } elseif ($minute >= 60) {
+ $hour += floor($minute / 60);
+ $minute = $minute % 60;
+ }
+ }
+
+ /**
+ * @param mixed $value expect int
+ */
+ private static function toIntWithNullBool(mixed $value): int
+ {
+ $value = $value ?? 0;
+ if (is_bool($value)) {
+ $value = (int) $value;
+ }
+ if (!is_numeric($value)) {
+ throw new Exception(ExcelError::VALUE());
+ }
+
+ return (int) $value;
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/TimeParts.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/TimeParts.php
new file mode 100644
index 0000000..de52269
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/TimeParts.php
@@ -0,0 +1,135 @@
+getMessage();
+ }
+
+ // Execute function
+ $timeValue = fmod($timeValue, 1);
+ $timeValue = SharedDateHelper::excelToDateTimeObject($timeValue);
+ SharedDateHelper::roundMicroseconds($timeValue);
+
+ return (int) $timeValue->format('H');
+ }
+
+ /**
+ * MINUTE.
+ *
+ * Returns the minutes of a time value.
+ * The minute is given as an integer, ranging from 0 to 59.
+ *
+ * Excel Function:
+ * MINUTE(timeValue)
+ *
+ * @param mixed $timeValue Excel date serial value (float), PHP date timestamp (integer),
+ * PHP DateTime object, or a standard time string
+ * Or can be an array of date/time values
+ *
+ * @return array|int|string Minute
+ * If an array of numbers is passed as the argument, then the returned result will also be an array
+ * with the same dimensions
+ */
+ public static function minute(mixed $timeValue): array|string|int
+ {
+ if (is_array($timeValue)) {
+ return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $timeValue);
+ }
+
+ try {
+ Helpers::nullFalseTrueToNumber($timeValue);
+ if (!is_numeric($timeValue)) {
+ $timeValue = Helpers::getTimeValue($timeValue);
+ }
+ Helpers::validateNotNegative($timeValue);
+ } catch (Exception $e) {
+ return $e->getMessage();
+ }
+
+ // Execute function
+ $timeValue = fmod($timeValue, 1);
+ $timeValue = SharedDateHelper::excelToDateTimeObject($timeValue);
+ SharedDateHelper::roundMicroseconds($timeValue);
+
+ return (int) $timeValue->format('i');
+ }
+
+ /**
+ * SECOND.
+ *
+ * Returns the seconds of a time value.
+ * The minute is given as an integer, ranging from 0 to 59.
+ *
+ * Excel Function:
+ * SECOND(timeValue)
+ *
+ * @param mixed $timeValue Excel date serial value (float), PHP date timestamp (integer),
+ * PHP DateTime object, or a standard time string
+ * Or can be an array of date/time values
+ *
+ * @return array|int|string Second
+ * If an array of numbers is passed as the argument, then the returned result will also be an array
+ * with the same dimensions
+ */
+ public static function second(mixed $timeValue): array|string|int
+ {
+ if (is_array($timeValue)) {
+ return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $timeValue);
+ }
+
+ try {
+ Helpers::nullFalseTrueToNumber($timeValue);
+ if (!is_numeric($timeValue)) {
+ $timeValue = Helpers::getTimeValue($timeValue);
+ }
+ Helpers::validateNotNegative($timeValue);
+ } catch (Exception $e) {
+ return $e->getMessage();
+ }
+
+ // Execute function
+ $timeValue = fmod($timeValue, 1);
+ $timeValue = SharedDateHelper::excelToDateTimeObject($timeValue);
+ SharedDateHelper::roundMicroseconds($timeValue);
+
+ return (int) $timeValue->format('s');
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/TimeValue.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/TimeValue.php
new file mode 100644
index 0000000..0af4211
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/TimeValue.php
@@ -0,0 +1,80 @@
+ 24) {
+ $arraySplit[0] = ($arraySplit[0] % 24);
+ $timeValue = implode(':', $arraySplit);
+ }
+
+ $PHPDateArray = Helpers::dateParse($timeValue);
+ $retValue = ExcelError::VALUE();
+ if (Helpers::dateParseSucceeded($PHPDateArray)) {
+ $hour = $PHPDateArray['hour'];
+ $minute = $PHPDateArray['minute'];
+ $second = $PHPDateArray['second'];
+ // OpenOffice-specific code removed - it works just like Excel
+ $excelDateValue = SharedDateHelper::formattedPHPToExcel(1900, 1, 1, $hour, $minute, $second) - 1;
+
+ $retType = Functions::getReturnDateType();
+ if ($retType === Functions::RETURNDATE_EXCEL) {
+ $retValue = (float) $excelDateValue;
+ } elseif ($retType === Functions::RETURNDATE_UNIX_TIMESTAMP) {
+ $retValue = (int) SharedDateHelper::excelToTimestamp($excelDateValue + 25569) - 3600;
+ } else {
+ $retValue = new Datetime('1900-01-01 ' . $PHPDateArray['hour'] . ':' . $PHPDateArray['minute'] . ':' . $PHPDateArray['second']);
+ }
+ }
+
+ return $retValue;
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/Week.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/Week.php
new file mode 100644
index 0000000..e620b4c
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/Week.php
@@ -0,0 +1,274 @@
+getMessage();
+ }
+
+ // Execute function
+ $PHPDateObject = SharedDateHelper::excelToDateTimeObject($dateValue);
+ if ($method == Constants::STARTWEEK_MONDAY_ISO) {
+ Helpers::silly1900($PHPDateObject);
+
+ return (int) $PHPDateObject->format('W');
+ }
+ if (self::buggyWeekNum1904($method, $origDateValueNull, $PHPDateObject)) {
+ return 0;
+ }
+ Helpers::silly1900($PHPDateObject, '+ 5 years'); // 1905 calendar matches
+ $dayOfYear = (int) $PHPDateObject->format('z');
+ $PHPDateObject->modify('-' . $dayOfYear . ' days');
+ $firstDayOfFirstWeek = (int) $PHPDateObject->format('w');
+ $daysInFirstWeek = (6 - $firstDayOfFirstWeek + $method) % 7;
+ $daysInFirstWeek += 7 * !$daysInFirstWeek;
+ $endFirstWeek = $daysInFirstWeek - 1;
+ $weekOfYear = floor(($dayOfYear - $endFirstWeek + 13) / 7);
+
+ return (int) $weekOfYear;
+ }
+
+ /**
+ * ISOWEEKNUM.
+ *
+ * Returns the ISO 8601 week number of the year for a specified date.
+ *
+ * Excel Function:
+ * ISOWEEKNUM(dateValue)
+ *
+ * @param mixed $dateValue Excel date serial value (float), PHP date timestamp (integer),
+ * PHP DateTime object, or a standard date string
+ * Or can be an array of date values
+ *
+ * @return array|int|string Week Number
+ * If an array of numbers is passed as the argument, then the returned result will also be an array
+ * with the same dimensions
+ */
+ public static function isoWeekNumber(mixed $dateValue): array|int|string
+ {
+ if (is_array($dateValue)) {
+ return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $dateValue);
+ }
+
+ if (self::apparentBug($dateValue)) {
+ return 52;
+ }
+
+ try {
+ $dateValue = Helpers::getDateValue($dateValue);
+ } catch (Exception $e) {
+ return $e->getMessage();
+ }
+
+ // Execute function
+ $PHPDateObject = SharedDateHelper::excelToDateTimeObject($dateValue);
+ Helpers::silly1900($PHPDateObject);
+
+ return (int) $PHPDateObject->format('W');
+ }
+
+ /**
+ * WEEKDAY.
+ *
+ * Returns the day of the week for a specified date. The day is given as an integer
+ * ranging from 0 to 7 (dependent on the requested style).
+ *
+ * Excel Function:
+ * WEEKDAY(dateValue[,style])
+ *
+ * @param null|array|bool|float|int|string $dateValue Excel date serial value (float), PHP date timestamp (integer),
+ * PHP DateTime object, or a standard date string
+ * Or can be an array of date values
+ * @param mixed $style A number that determines the type of return value
+ * 1 or omitted Numbers 1 (Sunday) through 7 (Saturday).
+ * 2 Numbers 1 (Monday) through 7 (Sunday).
+ * 3 Numbers 0 (Monday) through 6 (Sunday).
+ * Or can be an array of styles
+ *
+ * @return array|int|string Day of the week value
+ * If an array of values is passed as the argument, then the returned result will also be an array
+ * with the same dimensions
+ */
+ public static function day(null|array|float|int|string|bool $dateValue, mixed $style = 1): array|string|int
+ {
+ if (is_array($dateValue) || is_array($style)) {
+ return self::evaluateArrayArguments([self::class, __FUNCTION__], $dateValue, $style);
+ }
+
+ try {
+ $dateValue = Helpers::getDateValue($dateValue);
+ $style = self::validateStyle($style);
+ } catch (Exception $e) {
+ return $e->getMessage();
+ }
+
+ // Execute function
+ $PHPDateObject = SharedDateHelper::excelToDateTimeObject($dateValue);
+ Helpers::silly1900($PHPDateObject);
+ $DoW = (int) $PHPDateObject->format('w');
+
+ switch ($style) {
+ case 1:
+ ++$DoW;
+
+ break;
+ case 2:
+ $DoW = self::dow0Becomes7($DoW);
+
+ break;
+ case 3:
+ $DoW = self::dow0Becomes7($DoW) - 1;
+
+ break;
+ }
+
+ return $DoW;
+ }
+
+ /**
+ * @param mixed $style expect int
+ */
+ private static function validateStyle(mixed $style): int
+ {
+ if (!is_numeric($style)) {
+ throw new Exception(ExcelError::VALUE());
+ }
+ $style = (int) $style;
+ if (($style < 1) || ($style > 3)) {
+ throw new Exception(ExcelError::NAN());
+ }
+
+ return $style;
+ }
+
+ private static function dow0Becomes7(int $DoW): int
+ {
+ return ($DoW === 0) ? 7 : $DoW;
+ }
+
+ /**
+ * @param mixed $dateValue Excel date serial value (float), PHP date timestamp (integer),
+ * PHP DateTime object, or a standard date string
+ */
+ private static function apparentBug(mixed $dateValue): bool
+ {
+ if (SharedDateHelper::getExcelCalendar() !== SharedDateHelper::CALENDAR_MAC_1904) {
+ if (is_bool($dateValue)) {
+ return true;
+ }
+ if (is_numeric($dateValue) && !((int) $dateValue)) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ /**
+ * Validate dateValue parameter.
+ */
+ private static function validateDateValue(mixed $dateValue): float
+ {
+ if (is_bool($dateValue)) {
+ throw new Exception(ExcelError::VALUE());
+ }
+
+ return Helpers::getDateValue($dateValue);
+ }
+
+ /**
+ * Validate method parameter.
+ */
+ private static function validateMethod(mixed $method): int
+ {
+ if ($method === null) {
+ $method = Constants::STARTWEEK_SUNDAY;
+ }
+
+ if (!is_numeric($method)) {
+ throw new Exception(ExcelError::VALUE());
+ }
+
+ $method = (int) $method;
+ if (!array_key_exists($method, Constants::METHODARR)) {
+ throw new Exception(ExcelError::NAN());
+ }
+ $method = Constants::METHODARR[$method];
+
+ return $method;
+ }
+
+ private static function buggyWeekNum1900(int $method): bool
+ {
+ return $method === Constants::DOW_SUNDAY && SharedDateHelper::getExcelCalendar() === SharedDateHelper::CALENDAR_WINDOWS_1900;
+ }
+
+ private static function buggyWeekNum1904(int $method, bool $origNull, DateTime $dateObject): bool
+ {
+ // This appears to be another Excel bug.
+
+ return $method === Constants::DOW_SUNDAY && SharedDateHelper::getExcelCalendar() === SharedDateHelper::CALENDAR_MAC_1904
+ && !$origNull && $dateObject->format('Y-m-d') === '1904-01-01';
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/WorkDay.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/WorkDay.php
new file mode 100644
index 0000000..4e4ed3c
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/WorkDay.php
@@ -0,0 +1,198 @@
+getMessage();
+ }
+
+ $startDate = (float) floor($startDate);
+ $endDays = (int) floor($endDays);
+ // If endDays is 0, we always return startDate
+ if ($endDays == 0) {
+ return $startDate;
+ }
+ if ($endDays < 0) {
+ return self::decrementing($startDate, $endDays, $holidayArray);
+ }
+
+ return self::incrementing($startDate, $endDays, $holidayArray);
+ }
+
+ /**
+ * Use incrementing logic to determine Workday.
+ */
+ private static function incrementing(float $startDate, int $endDays, array $holidayArray): float|int|DateTime
+ {
+ // Adjust the start date if it falls over a weekend
+ $startDoW = self::getWeekDay($startDate, 3);
+ if ($startDoW >= 5) {
+ $startDate += 7 - $startDoW;
+ --$endDays;
+ }
+
+ // Add endDays
+ $endDate = (float) $startDate + ((int) ($endDays / 5) * 7);
+ $endDays = $endDays % 5;
+ while ($endDays > 0) {
+ ++$endDate;
+ // Adjust the calculated end date if it falls over a weekend
+ $endDow = self::getWeekDay($endDate, 3);
+ if ($endDow >= 5) {
+ $endDate += 7 - $endDow;
+ }
+ --$endDays;
+ }
+
+ // Test any extra holiday parameters
+ if (!empty($holidayArray)) {
+ $endDate = self::incrementingArray($startDate, $endDate, $holidayArray);
+ }
+
+ return Helpers::returnIn3FormatsFloat($endDate);
+ }
+
+ private static function incrementingArray(float $startDate, float $endDate, array $holidayArray): float
+ {
+ $holidayCountedArray = $holidayDates = [];
+ foreach ($holidayArray as $holidayDate) {
+ if (self::getWeekDay($holidayDate, 3) < 5) {
+ $holidayDates[] = $holidayDate;
+ }
+ }
+ sort($holidayDates, SORT_NUMERIC);
+ foreach ($holidayDates as $holidayDate) {
+ if (($holidayDate >= $startDate) && ($holidayDate <= $endDate)) {
+ if (!in_array($holidayDate, $holidayCountedArray)) {
+ ++$endDate;
+ $holidayCountedArray[] = $holidayDate;
+ }
+ }
+ // Adjust the calculated end date if it falls over a weekend
+ $endDoW = self::getWeekDay($endDate, 3);
+ if ($endDoW >= 5) {
+ $endDate += 7 - $endDoW;
+ }
+ }
+
+ return $endDate;
+ }
+
+ /**
+ * Use decrementing logic to determine Workday.
+ */
+ private static function decrementing(float $startDate, int $endDays, array $holidayArray): float|int|DateTime
+ {
+ // Adjust the start date if it falls over a weekend
+ $startDoW = self::getWeekDay($startDate, 3);
+ if ($startDoW >= 5) {
+ $startDate += -$startDoW + 4;
+ ++$endDays;
+ }
+
+ // Add endDays
+ $endDate = (float) $startDate + ((int) ($endDays / 5) * 7);
+ $endDays = $endDays % 5;
+ while ($endDays < 0) {
+ --$endDate;
+ // Adjust the calculated end date if it falls over a weekend
+ $endDow = self::getWeekDay($endDate, 3);
+ if ($endDow >= 5) {
+ $endDate += 4 - $endDow;
+ }
+ ++$endDays;
+ }
+
+ // Test any extra holiday parameters
+ if (!empty($holidayArray)) {
+ $endDate = self::decrementingArray($startDate, $endDate, $holidayArray);
+ }
+
+ return Helpers::returnIn3FormatsFloat($endDate);
+ }
+
+ private static function decrementingArray(float $startDate, float $endDate, array $holidayArray): float
+ {
+ $holidayCountedArray = $holidayDates = [];
+ foreach ($holidayArray as $holidayDate) {
+ if (self::getWeekDay($holidayDate, 3) < 5) {
+ $holidayDates[] = $holidayDate;
+ }
+ }
+ rsort($holidayDates, SORT_NUMERIC);
+ foreach ($holidayDates as $holidayDate) {
+ if (($holidayDate <= $startDate) && ($holidayDate >= $endDate)) {
+ if (!in_array($holidayDate, $holidayCountedArray)) {
+ --$endDate;
+ $holidayCountedArray[] = $holidayDate;
+ }
+ }
+ // Adjust the calculated end date if it falls over a weekend
+ $endDoW = self::getWeekDay($endDate, 3);
+ /** int $endDoW */
+ if ($endDoW >= 5) {
+ $endDate += -$endDoW + 4;
+ }
+ }
+
+ return $endDate;
+ }
+
+ private static function getWeekDay(float $date, int $wd): int
+ {
+ $result = Functions::scalar(Week::day($date, $wd));
+
+ return is_int($result) ? $result : -1;
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/YearFrac.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/YearFrac.php
new file mode 100644
index 0000000..2713754
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTimeExcel/YearFrac.php
@@ -0,0 +1,124 @@
+getMessage();
+ }
+
+ return match ($method) {
+ 0 => Functions::scalar(Days360::between($startDate, $endDate)) / 360,
+ 1 => self::method1($startDate, $endDate),
+ 2 => Functions::scalar(Difference::interval($startDate, $endDate)) / 360,
+ 3 => Functions::scalar(Difference::interval($startDate, $endDate)) / 365,
+ 4 => Functions::scalar(Days360::between($startDate, $endDate, true)) / 360,
+ default => ExcelError::NAN(),
+ };
+ }
+
+ /**
+ * Excel 1900 calendar treats date argument of null as 1900-01-00. Really.
+ */
+ private static function excelBug(float $sDate, mixed $startDate, mixed $endDate, int $method): float
+ {
+ if (Functions::getCompatibilityMode() !== Functions::COMPATIBILITY_OPENOFFICE && SharedDateHelper::getExcelCalendar() !== SharedDateHelper::CALENDAR_MAC_1904) {
+ if ($endDate === null && $startDate !== null) {
+ if (DateParts::month($sDate) == 12 && DateParts::day($sDate) === 31 && $method === 0) {
+ $sDate += 2;
+ } else {
+ ++$sDate;
+ }
+ }
+ }
+
+ return $sDate;
+ }
+
+ private static function method1(float $startDate, float $endDate): float
+ {
+ $days = Functions::scalar(Difference::interval($startDate, $endDate));
+ $startYear = (int) DateParts::year($startDate);
+ $endYear = (int) DateParts::year($endDate);
+ $years = $endYear - $startYear + 1;
+ $startMonth = (int) DateParts::month($startDate);
+ $startDay = (int) DateParts::day($startDate);
+ $endMonth = (int) DateParts::month($endDate);
+ $endDay = (int) DateParts::day($endDate);
+ $startMonthDay = 100 * $startMonth + $startDay;
+ $endMonthDay = 100 * $endMonth + $endDay;
+ if ($years == 1) {
+ $tmpCalcAnnualBasis = 365 + (int) Helpers::isLeapYear($endYear);
+ } elseif ($years == 2 && $startMonthDay >= $endMonthDay) {
+ if (Helpers::isLeapYear($startYear)) {
+ $tmpCalcAnnualBasis = 365 + (int) ($startMonthDay <= 229);
+ } elseif (Helpers::isLeapYear($endYear)) {
+ $tmpCalcAnnualBasis = 365 + (int) ($endMonthDay >= 229);
+ } else {
+ $tmpCalcAnnualBasis = 365;
+ }
+ } else {
+ $tmpCalcAnnualBasis = 0;
+ for ($year = $startYear; $year <= $endYear; ++$year) {
+ $tmpCalcAnnualBasis += 365 + (int) Helpers::isLeapYear($year);
+ }
+ $tmpCalcAnnualBasis /= $years;
+ }
+
+ return $days / $tmpCalcAnnualBasis;
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engine/ArrayArgumentHelper.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engine/ArrayArgumentHelper.php
new file mode 100644
index 0000000..0107f40
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engine/ArrayArgumentHelper.php
@@ -0,0 +1,190 @@
+indexStart = (int) array_shift($keys);
+ $this->rows = $this->rows($arguments);
+ $this->columns = $this->columns($arguments);
+
+ $this->argumentCount = count($arguments);
+ $this->arguments = $this->flattenSingleCellArrays($arguments, $this->rows, $this->columns);
+
+ $this->rows = $this->rows($arguments);
+ $this->columns = $this->columns($arguments);
+
+ if ($this->arrayArguments() > 2) {
+ throw new Exception('Formulae with more than two array arguments are not supported');
+ }
+ }
+
+ public function arguments(): array
+ {
+ return $this->arguments;
+ }
+
+ public function hasArrayArgument(): bool
+ {
+ return $this->arrayArguments() > 0;
+ }
+
+ public function getFirstArrayArgumentNumber(): int
+ {
+ $rowArrays = $this->filterArray($this->rows);
+ $columnArrays = $this->filterArray($this->columns);
+
+ for ($index = $this->indexStart; $index < $this->argumentCount; ++$index) {
+ if (isset($rowArrays[$index]) || isset($columnArrays[$index])) {
+ return ++$index;
+ }
+ }
+
+ return 0;
+ }
+
+ public function getSingleRowVector(): ?int
+ {
+ $rowVectors = $this->getRowVectors();
+
+ return count($rowVectors) === 1 ? array_pop($rowVectors) : null;
+ }
+
+ private function getRowVectors(): array
+ {
+ $rowVectors = [];
+ for ($index = $this->indexStart; $index < ($this->indexStart + $this->argumentCount); ++$index) {
+ if ($this->rows[$index] === 1 && $this->columns[$index] > 1) {
+ $rowVectors[] = $index;
+ }
+ }
+
+ return $rowVectors;
+ }
+
+ public function getSingleColumnVector(): ?int
+ {
+ $columnVectors = $this->getColumnVectors();
+
+ return count($columnVectors) === 1 ? array_pop($columnVectors) : null;
+ }
+
+ private function getColumnVectors(): array
+ {
+ $columnVectors = [];
+ for ($index = $this->indexStart; $index < ($this->indexStart + $this->argumentCount); ++$index) {
+ if ($this->rows[$index] > 1 && $this->columns[$index] === 1) {
+ $columnVectors[] = $index;
+ }
+ }
+
+ return $columnVectors;
+ }
+
+ public function getMatrixPair(): array
+ {
+ for ($i = $this->indexStart; $i < ($this->indexStart + $this->argumentCount - 1); ++$i) {
+ for ($j = $i + 1; $j < $this->argumentCount; ++$j) {
+ if (isset($this->rows[$i], $this->rows[$j])) {
+ return [$i, $j];
+ }
+ }
+ }
+
+ return [];
+ }
+
+ public function isVector(int $argument): bool
+ {
+ return $this->rows[$argument] === 1 || $this->columns[$argument] === 1;
+ }
+
+ public function isRowVector(int $argument): bool
+ {
+ return $this->rows[$argument] === 1;
+ }
+
+ public function isColumnVector(int $argument): bool
+ {
+ return $this->columns[$argument] === 1;
+ }
+
+ public function rowCount(int $argument): int
+ {
+ return $this->rows[$argument];
+ }
+
+ public function columnCount(int $argument): int
+ {
+ return $this->columns[$argument];
+ }
+
+ private function rows(array $arguments): array
+ {
+ return array_map(
+ fn ($argument): int => is_countable($argument) ? count($argument) : 1,
+ $arguments
+ );
+ }
+
+ private function columns(array $arguments): array
+ {
+ return array_map(
+ function (mixed $argument): int {
+ return is_array($argument) && is_array($argument[array_keys($argument)[0]])
+ ? count($argument[array_keys($argument)[0]])
+ : 1;
+ },
+ $arguments
+ );
+ }
+
+ public function arrayArguments(): int
+ {
+ $count = 0;
+ foreach (array_keys($this->arguments) as $argument) {
+ if ($this->rows[$argument] > 1 || $this->columns[$argument] > 1) {
+ ++$count;
+ }
+ }
+
+ return $count;
+ }
+
+ private function flattenSingleCellArrays(array $arguments, array $rows, array $columns): array
+ {
+ foreach ($arguments as $index => $argument) {
+ if ($rows[$index] === 1 && $columns[$index] === 1) {
+ while (is_array($argument)) {
+ $argument = array_pop($argument);
+ }
+ $arguments[$index] = $argument;
+ }
+ }
+
+ return $arguments;
+ }
+
+ private function filterArray(array $array): array
+ {
+ return array_filter(
+ $array,
+ fn ($value): bool => $value > 1
+ );
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engine/ArrayArgumentProcessor.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engine/ArrayArgumentProcessor.php
new file mode 100644
index 0000000..fb2c853
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engine/ArrayArgumentProcessor.php
@@ -0,0 +1,159 @@
+hasArrayArgument() === false) {
+ return [$method(...$arguments)];
+ }
+
+ if (self::$arrayArgumentHelper->arrayArguments() === 1) {
+ $nthArgument = self::$arrayArgumentHelper->getFirstArrayArgumentNumber();
+
+ return self::evaluateNthArgumentAsArray($method, $nthArgument, ...$arguments);
+ }
+
+ $singleRowVectorIndex = self::$arrayArgumentHelper->getSingleRowVector();
+ $singleColumnVectorIndex = self::$arrayArgumentHelper->getSingleColumnVector();
+
+ if ($singleRowVectorIndex !== null && $singleColumnVectorIndex !== null) {
+ // Basic logic for a single row vector and a single column vector
+ return self::evaluateVectorPair($method, $singleRowVectorIndex, $singleColumnVectorIndex, ...$arguments);
+ }
+
+ $matrixPair = self::$arrayArgumentHelper->getMatrixPair();
+ if ($matrixPair !== []) {
+ if (
+ (self::$arrayArgumentHelper->isVector($matrixPair[0]) === true
+ && self::$arrayArgumentHelper->isVector($matrixPair[1]) === false)
+ || (self::$arrayArgumentHelper->isVector($matrixPair[0]) === false
+ && self::$arrayArgumentHelper->isVector($matrixPair[1]) === true)
+ ) {
+ // Logic for a matrix and a vector (row or column)
+ return self::evaluateVectorMatrixPair($method, $matrixPair, ...$arguments);
+ }
+
+ // Logic for matrix/matrix, column vector/column vector or row vector/row vector
+ return self::evaluateMatrixPair($method, $matrixPair, ...$arguments);
+ }
+
+ // Still need to work out the logic for more than two array arguments,
+ // For the moment, we're throwing an Exception when we initialise the ArrayArgumentHelper
+ return ['#VALUE!'];
+ }
+
+ private static function evaluateVectorMatrixPair(callable $method, array $matrixIndexes, mixed ...$arguments): array
+ {
+ $matrix2 = array_pop($matrixIndexes);
+ /** @var array $matrixValues2 */
+ $matrixValues2 = $arguments[$matrix2];
+ $matrix1 = array_pop($matrixIndexes);
+ /** @var array $matrixValues1 */
+ $matrixValues1 = $arguments[$matrix1];
+
+ $rows = min(array_map([self::$arrayArgumentHelper, 'rowCount'], [$matrix1, $matrix2]));
+ $columns = min(array_map([self::$arrayArgumentHelper, 'columnCount'], [$matrix1, $matrix2]));
+
+ if ($rows === 1) {
+ $rows = max(array_map([self::$arrayArgumentHelper, 'rowCount'], [$matrix1, $matrix2]));
+ }
+ if ($columns === 1) {
+ $columns = max(array_map([self::$arrayArgumentHelper, 'columnCount'], [$matrix1, $matrix2]));
+ }
+
+ $result = [];
+ for ($rowIndex = 0; $rowIndex < $rows; ++$rowIndex) {
+ for ($columnIndex = 0; $columnIndex < $columns; ++$columnIndex) {
+ $rowIndex1 = self::$arrayArgumentHelper->isRowVector($matrix1) ? 0 : $rowIndex;
+ $columnIndex1 = self::$arrayArgumentHelper->isColumnVector($matrix1) ? 0 : $columnIndex;
+ $value1 = $matrixValues1[$rowIndex1][$columnIndex1];
+ $rowIndex2 = self::$arrayArgumentHelper->isRowVector($matrix2) ? 0 : $rowIndex;
+ $columnIndex2 = self::$arrayArgumentHelper->isColumnVector($matrix2) ? 0 : $columnIndex;
+ $value2 = $matrixValues2[$rowIndex2][$columnIndex2];
+ $arguments[$matrix1] = $value1;
+ $arguments[$matrix2] = $value2;
+
+ $result[$rowIndex][$columnIndex] = $method(...$arguments);
+ }
+ }
+
+ return $result;
+ }
+
+ private static function evaluateMatrixPair(callable $method, array $matrixIndexes, mixed ...$arguments): array
+ {
+ $matrix2 = array_pop($matrixIndexes);
+ /** @var array $matrixValues2 */
+ $matrixValues2 = $arguments[$matrix2];
+ $matrix1 = array_pop($matrixIndexes);
+ /** @var array $matrixValues1 */
+ $matrixValues1 = $arguments[$matrix1];
+
+ $result = [];
+ foreach ($matrixValues1 as $rowIndex => $row) {
+ foreach ($row as $columnIndex => $value1) {
+ if (isset($matrixValues2[$rowIndex][$columnIndex]) === false) {
+ continue;
+ }
+
+ $value2 = $matrixValues2[$rowIndex][$columnIndex];
+ $arguments[$matrix1] = $value1;
+ $arguments[$matrix2] = $value2;
+
+ $result[$rowIndex][$columnIndex] = $method(...$arguments);
+ }
+ }
+
+ return $result;
+ }
+
+ private static function evaluateVectorPair(callable $method, int $rowIndex, int $columnIndex, mixed ...$arguments): array
+ {
+ $rowVector = Functions::flattenArray($arguments[$rowIndex]);
+ $columnVector = Functions::flattenArray($arguments[$columnIndex]);
+
+ $result = [];
+ foreach ($columnVector as $column) {
+ $rowResults = [];
+ foreach ($rowVector as $row) {
+ $arguments[$rowIndex] = $row;
+ $arguments[$columnIndex] = $column;
+
+ $rowResults[] = $method(...$arguments);
+ }
+ $result[] = $rowResults;
+ }
+
+ return $result;
+ }
+
+ /**
+ * Note, offset is from 1 (for the first argument) rather than from 0.
+ */
+ private static function evaluateNthArgumentAsArray(callable $method, int $nthArgument, mixed ...$arguments): array
+ {
+ $values = array_slice($arguments, $nthArgument - 1, 1);
+ /** @var array $values */
+ $values = array_pop($values);
+
+ $result = [];
+ foreach ($values as $value) {
+ $arguments[$nthArgument - 1] = $value;
+ $result[] = $method(...$arguments);
+ }
+
+ return $result;
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engine/BranchPruner.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engine/BranchPruner.php
new file mode 100644
index 0000000..e6dbbcb
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engine/BranchPruner.php
@@ -0,0 +1,201 @@
+branchPruningEnabled = $branchPruningEnabled;
+ }
+
+ public function clearBranchStore(): void
+ {
+ $this->branchStoreKeyCounter = 0;
+ }
+
+ public function initialiseForLoop(): void
+ {
+ $this->currentCondition = null;
+ $this->currentOnlyIf = null;
+ $this->currentOnlyIfNot = null;
+ $this->previousStoreKey = null;
+ $this->pendingStoreKey = empty($this->storeKeysStack) ? null : end($this->storeKeysStack);
+
+ if ($this->branchPruningEnabled) {
+ $this->initialiseCondition();
+ $this->initialiseThen();
+ $this->initialiseElse();
+ }
+ }
+
+ private function initialiseCondition(): void
+ {
+ if (isset($this->conditionMap[$this->pendingStoreKey]) && $this->conditionMap[$this->pendingStoreKey]) {
+ $this->currentCondition = $this->pendingStoreKey;
+ $stackDepth = count($this->storeKeysStack);
+ if ($stackDepth > 1) {
+ // nested if
+ $this->previousStoreKey = $this->storeKeysStack[$stackDepth - 2];
+ }
+ }
+ }
+
+ private function initialiseThen(): void
+ {
+ if (isset($this->thenMap[$this->pendingStoreKey]) && $this->thenMap[$this->pendingStoreKey]) {
+ $this->currentOnlyIf = $this->pendingStoreKey;
+ } elseif (
+ isset($this->previousStoreKey, $this->thenMap[$this->previousStoreKey])
+ && $this->thenMap[$this->previousStoreKey]
+ ) {
+ $this->currentOnlyIf = $this->previousStoreKey;
+ }
+ }
+
+ private function initialiseElse(): void
+ {
+ if (isset($this->elseMap[$this->pendingStoreKey]) && $this->elseMap[$this->pendingStoreKey]) {
+ $this->currentOnlyIfNot = $this->pendingStoreKey;
+ } elseif (
+ isset($this->previousStoreKey, $this->elseMap[$this->previousStoreKey])
+ && $this->elseMap[$this->previousStoreKey]
+ ) {
+ $this->currentOnlyIfNot = $this->previousStoreKey;
+ }
+ }
+
+ public function decrementDepth(): void
+ {
+ if (!empty($this->pendingStoreKey)) {
+ --$this->braceDepthMap[$this->pendingStoreKey];
+ }
+ }
+
+ public function incrementDepth(): void
+ {
+ if (!empty($this->pendingStoreKey)) {
+ ++$this->braceDepthMap[$this->pendingStoreKey];
+ }
+ }
+
+ public function functionCall(string $functionName): void
+ {
+ if ($this->branchPruningEnabled && ($functionName === 'IF(')) {
+ // we handle a new if
+ $this->pendingStoreKey = $this->getUnusedBranchStoreKey();
+ $this->storeKeysStack[] = $this->pendingStoreKey;
+ $this->conditionMap[$this->pendingStoreKey] = true;
+ $this->braceDepthMap[$this->pendingStoreKey] = 0;
+ } elseif (!empty($this->pendingStoreKey) && array_key_exists($this->pendingStoreKey, $this->braceDepthMap)) {
+ // this is not an if but we go deeper
+ ++$this->braceDepthMap[$this->pendingStoreKey];
+ }
+ }
+
+ public function argumentSeparator(): void
+ {
+ if (!empty($this->pendingStoreKey) && $this->braceDepthMap[$this->pendingStoreKey] === 0) {
+ // We must go to the IF next argument
+ if ($this->conditionMap[$this->pendingStoreKey]) {
+ $this->conditionMap[$this->pendingStoreKey] = false;
+ $this->thenMap[$this->pendingStoreKey] = true;
+ } elseif ($this->thenMap[$this->pendingStoreKey]) {
+ $this->thenMap[$this->pendingStoreKey] = false;
+ $this->elseMap[$this->pendingStoreKey] = true;
+ } elseif ($this->elseMap[$this->pendingStoreKey]) {
+ throw new Exception('Reaching fourth argument of an IF');
+ }
+ }
+ }
+
+ public function closingBrace(mixed $value): void
+ {
+ if (!empty($this->pendingStoreKey) && $this->braceDepthMap[$this->pendingStoreKey] === -1) {
+ // we are closing an IF(
+ if ($value !== 'IF(') {
+ throw new Exception('Parser bug we should be in an "IF("');
+ }
+
+ if ($this->conditionMap[$this->pendingStoreKey]) {
+ throw new Exception('We should not be expecting a condition');
+ }
+
+ $this->thenMap[$this->pendingStoreKey] = false;
+ $this->elseMap[$this->pendingStoreKey] = false;
+ --$this->braceDepthMap[$this->pendingStoreKey];
+ array_pop($this->storeKeysStack);
+ $this->pendingStoreKey = null;
+ }
+ }
+
+ public function currentCondition(): ?string
+ {
+ return $this->currentCondition;
+ }
+
+ public function currentOnlyIf(): ?string
+ {
+ return $this->currentOnlyIf;
+ }
+
+ public function currentOnlyIfNot(): ?string
+ {
+ return $this->currentOnlyIfNot;
+ }
+
+ private function getUnusedBranchStoreKey(): string
+ {
+ $storeKeyValue = 'storeKey-' . $this->branchStoreKeyCounter;
+ ++$this->branchStoreKeyCounter;
+
+ return $storeKeyValue;
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engine/CyclicReferenceStack.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engine/CyclicReferenceStack.php
new file mode 100644
index 0000000..f4806b4
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engine/CyclicReferenceStack.php
@@ -0,0 +1,65 @@
+stack);
+ }
+
+ /**
+ * Push a new entry onto the stack.
+ */
+ public function push(mixed $value): void
+ {
+ $this->stack[$value] = $value;
+ }
+
+ /**
+ * Pop the last entry from the stack.
+ */
+ public function pop(): mixed
+ {
+ return array_pop($this->stack);
+ }
+
+ /**
+ * Test to see if a specified entry exists on the stack.
+ *
+ * @param mixed $value The value to test
+ */
+ public function onStack(mixed $value): bool
+ {
+ return isset($this->stack[$value]);
+ }
+
+ /**
+ * Clear the stack.
+ */
+ public function clear(): void
+ {
+ $this->stack = [];
+ }
+
+ /**
+ * Return an array of all entries on the stack.
+ *
+ * @return mixed[]
+ */
+ public function showStack(): array
+ {
+ return $this->stack;
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engine/FormattedNumber.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engine/FormattedNumber.php
new file mode 100644
index 0000000..331fa44
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engine/FormattedNumber.php
@@ -0,0 +1,147 @@
+[-+])? *\% *(?[-+])? *(?[0-9]+\.?[0-9*]*(?:E[-+]?[0-9]*)?) *)|(?: *(?[-+])? *(?[0-9]+\.?[0-9]*(?:E[-+]?[0-9]*)?) *\% *))$~i';
+
+ // preg_quoted string for major currency symbols, with a %s for locale currency
+ private const CURRENCY_CONVERSION_LIST = '\$€£¥%s';
+
+ private const STRING_CONVERSION_LIST = [
+ [self::class, 'convertToNumberIfNumeric'],
+ [self::class, 'convertToNumberIfFraction'],
+ [self::class, 'convertToNumberIfPercent'],
+ [self::class, 'convertToNumberIfCurrency'],
+ ];
+
+ /**
+ * Identify whether a string contains a formatted numeric value,
+ * and convert it to a numeric if it is.
+ *
+ * @param string $operand string value to test
+ */
+ public static function convertToNumberIfFormatted(string &$operand): bool
+ {
+ foreach (self::STRING_CONVERSION_LIST as $conversionMethod) {
+ if ($conversionMethod($operand) === true) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ /**
+ * Identify whether a string contains a numeric value,
+ * and convert it to a numeric if it is.
+ *
+ * @param string $operand string value to test
+ */
+ public static function convertToNumberIfNumeric(string &$operand): bool
+ {
+ $thousandsSeparator = preg_quote(StringHelper::getThousandsSeparator(), '/');
+ $value = preg_replace(['/(\d)' . $thousandsSeparator . '(\d)/u', '/([+-])\s+(\d)/u'], ['$1$2', '$1$2'], trim($operand));
+ $decimalSeparator = preg_quote(StringHelper::getDecimalSeparator(), '/');
+ $value = preg_replace(['/(\d)' . $decimalSeparator . '(\d)/u', '/([+-])\s+(\d)/u'], ['$1.$2', '$1$2'], $value ?? '');
+
+ if (is_numeric($value)) {
+ $operand = (float) $value;
+
+ return true;
+ }
+
+ return false;
+ }
+
+ /**
+ * Identify whether a string contains a fractional numeric value,
+ * and convert it to a numeric if it is.
+ *
+ * @param string $operand string value to test
+ */
+ public static function convertToNumberIfFraction(string &$operand): bool
+ {
+ if (preg_match(self::STRING_REGEXP_FRACTION, $operand, $match)) {
+ $sign = ($match[1] === '-') ? '-' : '+';
+ $wholePart = ($match[3] === '') ? '' : ($sign . $match[3]);
+ $fractionFormula = '=' . $wholePart . $sign . $match[4];
+ $operand = Calculation::getInstance()->_calculateFormulaValue($fractionFormula);
+
+ return true;
+ }
+
+ return false;
+ }
+
+ /**
+ * Identify whether a string contains a percentage, and if so,
+ * convert it to a numeric.
+ *
+ * @param string $operand string value to test
+ */
+ public static function convertToNumberIfPercent(string &$operand): bool
+ {
+ $thousandsSeparator = preg_quote(StringHelper::getThousandsSeparator(), '/');
+ $value = preg_replace('/(\d)' . $thousandsSeparator . '(\d)/u', '$1$2', trim($operand));
+ $decimalSeparator = preg_quote(StringHelper::getDecimalSeparator(), '/');
+ $value = preg_replace(['/(\d)' . $decimalSeparator . '(\d)/u', '/([+-])\s+(\d)/u'], ['$1.$2', '$1$2'], $value ?? '');
+
+ $match = [];
+ if ($value !== null && preg_match(self::STRING_REGEXP_PERCENT, $value, $match, PREG_UNMATCHED_AS_NULL)) {
+ //Calculate the percentage
+ $sign = ($match['PrefixedSign'] ?? $match['PrefixedSign2'] ?? $match['PostfixedSign']) ?? '';
+ $operand = (float) ($sign . ($match['PostfixedValue'] ?? $match['PrefixedValue'])) / 100;
+
+ return true;
+ }
+
+ return false;
+ }
+
+ /**
+ * Identify whether a string contains a currency value, and if so,
+ * convert it to a numeric.
+ *
+ * @param string $operand string value to test
+ */
+ public static function convertToNumberIfCurrency(string &$operand): bool
+ {
+ $currencyRegexp = self::currencyMatcherRegexp();
+ $thousandsSeparator = preg_quote(StringHelper::getThousandsSeparator(), '/');
+ $value = preg_replace('/(\d)' . $thousandsSeparator . '(\d)/u', '$1$2', $operand);
+
+ $match = [];
+ if ($value !== null && preg_match($currencyRegexp, $value, $match, PREG_UNMATCHED_AS_NULL)) {
+ //Determine the sign
+ $sign = ($match['PrefixedSign'] ?? $match['PrefixedSign2'] ?? $match['PostfixedSign']) ?? '';
+ $decimalSeparator = StringHelper::getDecimalSeparator();
+ //Cast to a float
+ $intermediate = (string) ($match['PostfixedValue'] ?? $match['PrefixedValue']);
+ $intermediate = str_replace($decimalSeparator, '.', $intermediate);
+ if (is_numeric($intermediate)) {
+ $operand = (float) ($sign . str_replace($decimalSeparator, '.', $intermediate));
+
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ public static function currencyMatcherRegexp(): string
+ {
+ $currencyCodes = sprintf(self::CURRENCY_CONVERSION_LIST, preg_quote(StringHelper::getCurrencyCode(), '/'));
+ $decimalSeparator = preg_quote(StringHelper::getDecimalSeparator(), '/');
+
+ return '~^(?:(?: *(?[-+])? *(?[' . $currencyCodes . ']) *(?[-+])? *(?[0-9]+[' . $decimalSeparator . ']?[0-9*]*(?:E[-+]?[0-9]*)?) *)|(?: *(?[-+])? *(?[0-9]+' . $decimalSeparator . '?[0-9]*(?:E[-+]?[0-9]*)?) *(?[' . $currencyCodes . ']) *))$~ui';
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engine/Logger.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engine/Logger.php
new file mode 100644
index 0000000..9adcd55
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engine/Logger.php
@@ -0,0 +1,126 @@
+cellStack = $stack;
+ }
+
+ /**
+ * Enable/Disable Calculation engine logging.
+ */
+ public function setWriteDebugLog(bool $writeDebugLog): void
+ {
+ $this->writeDebugLog = $writeDebugLog;
+ }
+
+ /**
+ * Return whether calculation engine logging is enabled or disabled.
+ */
+ public function getWriteDebugLog(): bool
+ {
+ return $this->writeDebugLog;
+ }
+
+ /**
+ * Enable/Disable echoing of debug log information.
+ */
+ public function setEchoDebugLog(bool $echoDebugLog): void
+ {
+ $this->echoDebugLog = $echoDebugLog;
+ }
+
+ /**
+ * Return whether echoing of debug log information is enabled or disabled.
+ */
+ public function getEchoDebugLog(): bool
+ {
+ return $this->echoDebugLog;
+ }
+
+ /**
+ * Write an entry to the calculation engine debug log.
+ */
+ public function writeDebugLog(string $message, mixed ...$args): void
+ {
+ // Only write the debug log if logging is enabled
+ if ($this->writeDebugLog) {
+ $message = sprintf($message, ...$args);
+ $cellReference = implode(' -> ', $this->cellStack->showStack());
+ if ($this->echoDebugLog) {
+ echo $cellReference,
+ ($this->cellStack->count() > 0 ? ' => ' : ''),
+ $message,
+ PHP_EOL;
+ }
+ $this->debugLog[] = $cellReference
+ . ($this->cellStack->count() > 0 ? ' => ' : '')
+ . $message;
+ }
+ }
+
+ /**
+ * Write a series of entries to the calculation engine debug log.
+ *
+ * @param string[] $args
+ */
+ public function mergeDebugLog(array $args): void
+ {
+ if ($this->writeDebugLog) {
+ foreach ($args as $entry) {
+ $this->writeDebugLog($entry);
+ }
+ }
+ }
+
+ /**
+ * Clear the calculation engine debug log.
+ */
+ public function clearLog(): void
+ {
+ $this->debugLog = [];
+ }
+
+ /**
+ * Return the calculation engine debug log.
+ *
+ * @return string[]
+ */
+ public function getLog(): array
+ {
+ return $this->debugLog;
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engine/Operands/Operand.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engine/Operands/Operand.php
new file mode 100644
index 0000000..05264c3
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engine/Operands/Operand.php
@@ -0,0 +1,10 @@
+value = $structuredReference;
+ }
+
+ public static function fromParser(string $formula, int $index, array $matches): self
+ {
+ $val = $matches[0];
+
+ $srCount = substr_count($val, self::OPEN_BRACE)
+ - substr_count($val, self::CLOSE_BRACE);
+ while ($srCount > 0) {
+ $srIndex = strlen($val);
+ $srStringRemainder = substr($formula, $index + $srIndex);
+ $closingPos = strpos($srStringRemainder, self::CLOSE_BRACE);
+ if ($closingPos === false) {
+ throw new Exception("Formula Error: No closing ']' to match opening '['");
+ }
+ $srStringRemainder = substr($srStringRemainder, 0, $closingPos + 1);
+ --$srCount;
+ if (str_contains($srStringRemainder, self::OPEN_BRACE)) {
+ ++$srCount;
+ }
+ $val .= $srStringRemainder;
+ }
+
+ return new self($val);
+ }
+
+ /**
+ * @throws Exception
+ * @throws \PhpOffice\PhpSpreadsheet\Exception
+ */
+ public function parse(Cell $cell): string
+ {
+ $this->getTableStructure($cell);
+ $cellRange = ($this->isRowReference()) ? $this->getRowReference($cell) : $this->getColumnReference();
+ $sheetName = '';
+ $worksheet = $this->table->getWorksheet();
+ if ($worksheet !== null && $worksheet !== $cell->getWorksheet()) {
+ $sheetName = "'" . $worksheet->getTitle() . "'!";
+ }
+
+ return $sheetName . $cellRange;
+ }
+
+ private function isRowReference(): bool
+ {
+ return str_contains($this->value, '[@')
+ || str_contains($this->value, '[' . self::ITEM_SPECIFIER_THIS_ROW . ']');
+ }
+
+ /**
+ * @throws Exception
+ * @throws \PhpOffice\PhpSpreadsheet\Exception
+ */
+ private function getTableStructure(Cell $cell): void
+ {
+ preg_match(self::TABLE_REFERENCE, $this->value, $matches);
+
+ $this->tableName = $matches[1];
+ $this->table = ($this->tableName === '')
+ ? $this->getTableForCell($cell)
+ : $this->getTableByName($cell);
+ $this->reference = $matches[2];
+ $tableRange = Coordinate::getRangeBoundaries($this->table->getRange());
+
+ $this->headersRow = ($this->table->getShowHeaderRow()) ? (int) $tableRange[0][1] : null;
+ $this->firstDataRow = ($this->table->getShowHeaderRow()) ? (int) $tableRange[0][1] + 1 : $tableRange[0][1];
+ $this->totalsRow = ($this->table->getShowTotalsRow()) ? (int) $tableRange[1][1] : null;
+ $this->lastDataRow = ($this->table->getShowTotalsRow()) ? (int) $tableRange[1][1] - 1 : $tableRange[1][1];
+
+ $cellParam = $cell;
+ $worksheet = $this->table->getWorksheet();
+ if ($worksheet !== null && $worksheet !== $cell->getWorksheet()) {
+ $cellParam = $worksheet->getCell('A1');
+ }
+ $this->columns = $this->getColumns($cellParam, $tableRange);
+ }
+
+ /**
+ * @throws Exception
+ * @throws \PhpOffice\PhpSpreadsheet\Exception
+ */
+ private function getTableForCell(Cell $cell): Table
+ {
+ $tables = $cell->getWorksheet()->getTableCollection();
+ foreach ($tables as $table) {
+ /** @var Table $table */
+ $range = $table->getRange();
+ if ($cell->isInRange($range) === true) {
+ $this->tableName = $table->getName();
+
+ return $table;
+ }
+ }
+
+ throw new Exception('Table for Structured Reference cannot be identified');
+ }
+
+ /**
+ * @throws Exception
+ * @throws \PhpOffice\PhpSpreadsheet\Exception
+ */
+ private function getTableByName(Cell $cell): Table
+ {
+ $table = $cell->getWorksheet()->getTableByName($this->tableName);
+
+ if ($table === null) {
+ $spreadsheet = $cell->getWorksheet()->getParent();
+ if ($spreadsheet !== null) {
+ $table = $spreadsheet->getTableByName($this->tableName);
+ }
+ }
+
+ if ($table === null) {
+ throw new Exception("Table {$this->tableName} for Structured Reference cannot be located");
+ }
+
+ return $table;
+ }
+
+ private function getColumns(Cell $cell, array $tableRange): array
+ {
+ $worksheet = $cell->getWorksheet();
+ $cellReference = $cell->getCoordinate();
+
+ $columns = [];
+ $lastColumn = ++$tableRange[1][0];
+ for ($column = $tableRange[0][0]; $column !== $lastColumn; ++$column) {
+ $columns[$column] = $worksheet
+ ->getCell($column . ($this->headersRow ?? ($this->firstDataRow - 1)))
+ ->getCalculatedValue();
+ }
+
+ $worksheet->getCell($cellReference);
+
+ return $columns;
+ }
+
+ private function getRowReference(Cell $cell): string
+ {
+ $reference = str_replace("\u{a0}", ' ', $this->reference);
+ /** @var string $reference */
+ $reference = str_replace('[' . self::ITEM_SPECIFIER_THIS_ROW . '],', '', $reference);
+
+ foreach ($this->columns as $columnId => $columnName) {
+ $columnName = str_replace("\u{a0}", ' ', $columnName);
+ $reference = $this->adjustRowReference($columnName, $reference, $cell, $columnId);
+ }
+
+ return $this->validateParsedReference(trim($reference, '[]@, '));
+ }
+
+ private function adjustRowReference(string $columnName, string $reference, Cell $cell, string $columnId): string
+ {
+ if ($columnName !== '') {
+ $cellReference = $columnId . $cell->getRow();
+ $pattern1 = '/\[' . preg_quote($columnName, '/') . '\]/miu';
+ $pattern2 = '/@' . preg_quote($columnName, '/') . '/miu';
+ if (preg_match($pattern1, $reference) === 1) {
+ $reference = preg_replace($pattern1, $cellReference, $reference);
+ } elseif (preg_match($pattern2, $reference) === 1) {
+ $reference = preg_replace($pattern2, $cellReference, $reference);
+ }
+ /** @var string $reference */
+ }
+
+ return $reference;
+ }
+
+ /**
+ * @throws Exception
+ * @throws \PhpOffice\PhpSpreadsheet\Exception
+ */
+ private function getColumnReference(): string
+ {
+ $reference = str_replace("\u{a0}", ' ', $this->reference);
+ $startRow = ($this->totalsRow === null) ? $this->lastDataRow : $this->totalsRow;
+ $endRow = ($this->headersRow === null) ? $this->firstDataRow : $this->headersRow;
+
+ [$startRow, $endRow] = $this->getRowsForColumnReference($reference, $startRow, $endRow);
+ $reference = $this->getColumnsForColumnReference($reference, $startRow, $endRow);
+
+ $reference = trim($reference, '[]@, ');
+ if (substr_count($reference, ':') > 1) {
+ $cells = explode(':', $reference);
+ $firstCell = array_shift($cells);
+ $lastCell = array_pop($cells);
+ $reference = "{$firstCell}:{$lastCell}";
+ }
+
+ return $this->validateParsedReference($reference);
+ }
+
+ /**
+ * @throws Exception
+ * @throws \PhpOffice\PhpSpreadsheet\Exception
+ */
+ private function validateParsedReference(string $reference): string
+ {
+ if (preg_match('/^' . Calculation::CALCULATION_REGEXP_CELLREF . ':' . Calculation::CALCULATION_REGEXP_CELLREF . '$/miu', $reference) !== 1) {
+ if (preg_match('/^' . Calculation::CALCULATION_REGEXP_CELLREF . '$/miu', $reference) !== 1) {
+ throw new Exception(
+ "Invalid Structured Reference {$this->reference} {$reference}",
+ Exception::CALCULATION_ENGINE_PUSH_TO_STACK
+ );
+ }
+ }
+
+ return $reference;
+ }
+
+ private function fullData(int $startRow, int $endRow): string
+ {
+ $columns = array_keys($this->columns);
+ $firstColumn = array_shift($columns);
+ $lastColumn = (empty($columns)) ? $firstColumn : array_pop($columns);
+
+ return "{$firstColumn}{$startRow}:{$lastColumn}{$endRow}";
+ }
+
+ private function getMinimumRow(string $reference): int
+ {
+ return match ($reference) {
+ self::ITEM_SPECIFIER_ALL, self::ITEM_SPECIFIER_HEADERS => $this->headersRow ?? $this->firstDataRow,
+ self::ITEM_SPECIFIER_DATA => $this->firstDataRow,
+ self::ITEM_SPECIFIER_TOTALS => $this->totalsRow ?? $this->lastDataRow,
+ default => $this->headersRow ?? $this->firstDataRow,
+ };
+ }
+
+ private function getMaximumRow(string $reference): int
+ {
+ return match ($reference) {
+ self::ITEM_SPECIFIER_HEADERS => $this->headersRow ?? $this->firstDataRow,
+ self::ITEM_SPECIFIER_DATA => $this->lastDataRow,
+ self::ITEM_SPECIFIER_ALL, self::ITEM_SPECIFIER_TOTALS => $this->totalsRow ?? $this->lastDataRow,
+ default => $this->totalsRow ?? $this->lastDataRow,
+ };
+ }
+
+ public function value(): string
+ {
+ return $this->value;
+ }
+
+ /**
+ * @return array
+ */
+ private function getRowsForColumnReference(string &$reference, int $startRow, int $endRow): array
+ {
+ $rowsSelected = false;
+ foreach (self::ITEM_SPECIFIER_ROWS_SET as $rowReference) {
+ $pattern = '/\[' . $rowReference . '\]/mui';
+ if (preg_match($pattern, $reference) === 1) {
+ if (($rowReference === self::ITEM_SPECIFIER_HEADERS) && ($this->table->getShowHeaderRow() === false)) {
+ throw new Exception(
+ 'Table Headers are Hidden, and should not be Referenced',
+ Exception::CALCULATION_ENGINE_PUSH_TO_STACK
+ );
+ }
+ $rowsSelected = true;
+ $startRow = min($startRow, $this->getMinimumRow($rowReference));
+ $endRow = max($endRow, $this->getMaximumRow($rowReference));
+ $reference = preg_replace($pattern, '', $reference) ?? '';
+ }
+ }
+ if ($rowsSelected === false) {
+ // If there isn't any Special Item Identifier specified, then the selection defaults to data rows only.
+ $startRow = $this->firstDataRow;
+ $endRow = $this->lastDataRow;
+ }
+
+ return [$startRow, $endRow];
+ }
+
+ private function getColumnsForColumnReference(string $reference, int $startRow, int $endRow): string
+ {
+ $columnsSelected = false;
+ foreach ($this->columns as $columnId => $columnName) {
+ $columnName = str_replace("\u{a0}", ' ', $columnName ?? '');
+ $cellFrom = "{$columnId}{$startRow}";
+ $cellTo = "{$columnId}{$endRow}";
+ $cellReference = ($cellFrom === $cellTo) ? $cellFrom : "{$cellFrom}:{$cellTo}";
+ $pattern = '/\[' . preg_quote($columnName, '/') . '\]/mui';
+ if (preg_match($pattern, $reference) === 1) {
+ $columnsSelected = true;
+ $reference = preg_replace($pattern, $cellReference, $reference);
+ }
+ /** @var string $reference */
+ }
+ if ($columnsSelected === false) {
+ return $this->fullData($startRow, $endRow);
+ }
+
+ return $reference;
+ }
+
+ public function __toString(): string
+ {
+ return $this->value;
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/BesselI.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/BesselI.php
new file mode 100644
index 0000000..5d564a0
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/BesselI.php
@@ -0,0 +1,141 @@
+getMessage();
+ }
+
+ if ($ord < 0) {
+ return ExcelError::NAN();
+ }
+
+ $fResult = self::calculate($x, $ord);
+
+ return (is_nan($fResult)) ? ExcelError::NAN() : $fResult;
+ }
+
+ private static function calculate(float $x, int $ord): float
+ {
+ return match ($ord) {
+ 0 => self::besselI0($x),
+ 1 => self::besselI1($x),
+ default => self::besselI2($x, $ord),
+ };
+ }
+
+ private static function besselI0(float $x): float
+ {
+ $ax = abs($x);
+
+ if ($ax < 3.75) {
+ $y = $x / 3.75;
+ $y = $y * $y;
+
+ return 1.0 + $y * (3.5156229 + $y * (3.0899424 + $y * (1.2067492
+ + $y * (0.2659732 + $y * (0.360768e-1 + $y * 0.45813e-2)))));
+ }
+
+ $y = 3.75 / $ax;
+
+ return (exp($ax) / sqrt($ax)) * (0.39894228 + $y * (0.1328592e-1 + $y * (0.225319e-2 + $y * (-0.157565e-2
+ + $y * (0.916281e-2 + $y * (-0.2057706e-1 + $y * (0.2635537e-1
+ + $y * (-0.1647633e-1 + $y * 0.392377e-2))))))));
+ }
+
+ private static function besselI1(float $x): float
+ {
+ $ax = abs($x);
+
+ if ($ax < 3.75) {
+ $y = $x / 3.75;
+ $y = $y * $y;
+ $ans = $ax * (0.5 + $y * (0.87890594 + $y * (0.51498869 + $y * (0.15084934 + $y * (0.2658733e-1
+ + $y * (0.301532e-2 + $y * 0.32411e-3))))));
+
+ return ($x < 0.0) ? -$ans : $ans;
+ }
+
+ $y = 3.75 / $ax;
+ $ans = 0.2282967e-1 + $y * (-0.2895312e-1 + $y * (0.1787654e-1 - $y * 0.420059e-2));
+ $ans = 0.39894228 + $y * (-0.3988024e-1 + $y * (-0.362018e-2 + $y * (0.163801e-2
+ + $y * (-0.1031555e-1 + $y * $ans))));
+ $ans *= exp($ax) / sqrt($ax);
+
+ return ($x < 0.0) ? -$ans : $ans;
+ }
+
+ private static function besselI2(float $x, int $ord): float
+ {
+ if ($x === 0.0) {
+ return 0.0;
+ }
+
+ $tox = 2.0 / abs($x);
+ $bip = 0;
+ $ans = 0.0;
+ $bi = 1.0;
+
+ for ($j = 2 * ($ord + (int) sqrt(40.0 * $ord)); $j > 0; --$j) {
+ $bim = $bip + $j * $tox * $bi;
+ $bip = $bi;
+ $bi = $bim;
+
+ if (abs($bi) > 1.0e+12) {
+ $ans *= 1.0e-12;
+ $bi *= 1.0e-12;
+ $bip *= 1.0e-12;
+ }
+
+ if ($j === $ord) {
+ $ans = $bip;
+ }
+ }
+
+ $ans *= self::besselI0($x) / $bi;
+
+ return ($x < 0.0 && (($ord % 2) === 1)) ? -$ans : $ans;
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/BesselJ.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/BesselJ.php
new file mode 100644
index 0000000..4a9d9ff
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/BesselJ.php
@@ -0,0 +1,176 @@
+ 8. This code provides a more accurate calculation
+ *
+ * @param mixed $x A float value at which to evaluate the function.
+ * If x is nonnumeric, BESSELJ returns the #VALUE! error value.
+ * Or can be an array of values
+ * @param mixed $ord The integer order of the Bessel function.
+ * If ord is not an integer, it is truncated.
+ * If $ord is nonnumeric, BESSELJ returns the #VALUE! error value.
+ * If $ord < 0, BESSELJ returns the #NUM! error value.
+ * Or can be an array of values
+ *
+ * @return array|float|string Result, or a string containing an error
+ * If an array of numbers is passed as an argument, then the returned result will also be an array
+ * with the same dimensions
+ */
+ public static function BESSELJ(mixed $x, mixed $ord): array|string|float
+ {
+ if (is_array($x) || is_array($ord)) {
+ return self::evaluateArrayArguments([self::class, __FUNCTION__], $x, $ord);
+ }
+
+ try {
+ $x = EngineeringValidations::validateFloat($x);
+ $ord = EngineeringValidations::validateInt($ord);
+ } catch (Exception $e) {
+ return $e->getMessage();
+ }
+
+ if ($ord < 0) {
+ return ExcelError::NAN();
+ }
+
+ $fResult = self::calculate($x, $ord);
+
+ return (is_nan($fResult)) ? ExcelError::NAN() : $fResult;
+ }
+
+ private static function calculate(float $x, int $ord): float
+ {
+ return match ($ord) {
+ 0 => self::besselJ0($x),
+ 1 => self::besselJ1($x),
+ default => self::besselJ2($x, $ord),
+ };
+ }
+
+ private static function besselJ0(float $x): float
+ {
+ $ax = abs($x);
+
+ if ($ax < 8.0) {
+ $y = $x * $x;
+ $ans1 = 57568490574.0 + $y * (-13362590354.0 + $y * (651619640.7 + $y * (-11214424.18 + $y
+ * (77392.33017 + $y * (-184.9052456)))));
+ $ans2 = 57568490411.0 + $y * (1029532985.0 + $y * (9494680.718 + $y * (59272.64853 + $y
+ * (267.8532712 + $y * 1.0))));
+
+ return $ans1 / $ans2;
+ }
+
+ $z = 8.0 / $ax;
+ $y = $z * $z;
+ $xx = $ax - 0.785398164;
+ $ans1 = 1.0 + $y * (-0.1098628627e-2 + $y * (0.2734510407e-4 + $y * (-0.2073370639e-5 + $y * 0.2093887211e-6)));
+ $ans2 = -0.1562499995e-1 + $y * (0.1430488765e-3 + $y * (-0.6911147651e-5 + $y
+ * (0.7621095161e-6 - $y * 0.934935152e-7)));
+
+ return sqrt(0.636619772 / $ax) * (cos($xx) * $ans1 - $z * sin($xx) * $ans2);
+ }
+
+ private static function besselJ1(float $x): float
+ {
+ $ax = abs($x);
+
+ if ($ax < 8.0) {
+ $y = $x * $x;
+ $ans1 = $x * (72362614232.0 + $y * (-7895059235.0 + $y * (242396853.1 + $y
+ * (-2972611.439 + $y * (15704.48260 + $y * (-30.16036606))))));
+ $ans2 = 144725228442.0 + $y * (2300535178.0 + $y * (18583304.74 + $y * (99447.43394 + $y
+ * (376.9991397 + $y * 1.0))));
+
+ return $ans1 / $ans2;
+ }
+
+ $z = 8.0 / $ax;
+ $y = $z * $z;
+ $xx = $ax - 2.356194491;
+
+ $ans1 = 1.0 + $y * (0.183105e-2 + $y * (-0.3516396496e-4 + $y * (0.2457520174e-5 + $y * (-0.240337019e-6))));
+ $ans2 = 0.04687499995 + $y * (-0.2002690873e-3 + $y * (0.8449199096e-5 + $y
+ * (-0.88228987e-6 + $y * 0.105787412e-6)));
+ $ans = sqrt(0.636619772 / $ax) * (cos($xx) * $ans1 - $z * sin($xx) * $ans2);
+
+ return ($x < 0.0) ? -$ans : $ans;
+ }
+
+ private static function besselJ2(float $x, int $ord): float
+ {
+ $ax = abs($x);
+ if ($ax === 0.0) {
+ return 0.0;
+ }
+
+ if ($ax > $ord) {
+ return self::besselj2a($ax, $ord, $x);
+ }
+
+ return self::besselj2b($ax, $ord, $x);
+ }
+
+ private static function besselj2a(float $ax, int $ord, float $x): float
+ {
+ $tox = 2.0 / $ax;
+ $bjm = self::besselJ0($ax);
+ $bj = self::besselJ1($ax);
+ for ($j = 1; $j < $ord; ++$j) {
+ $bjp = $j * $tox * $bj - $bjm;
+ $bjm = $bj;
+ $bj = $bjp;
+ }
+ $ans = $bj;
+
+ return ($x < 0.0 && ($ord % 2) == 1) ? -$ans : $ans;
+ }
+
+ private static function besselj2b(float $ax, int $ord, float $x): float
+ {
+ $tox = 2.0 / $ax;
+ $jsum = false;
+ $bjp = $ans = $sum = 0.0;
+ $bj = 1.0;
+ for ($j = 2 * ($ord + (int) sqrt(40.0 * $ord)); $j > 0; --$j) {
+ $bjm = $j * $tox * $bj - $bjp;
+ $bjp = $bj;
+ $bj = $bjm;
+ if (abs($bj) > 1.0e+10) {
+ $bj *= 1.0e-10;
+ $bjp *= 1.0e-10;
+ $ans *= 1.0e-10;
+ $sum *= 1.0e-10;
+ }
+ if ($jsum === true) {
+ $sum += $bj;
+ }
+ $jsum = $jsum === false;
+ if ($j === $ord) {
+ $ans = $bjp;
+ }
+ }
+ $sum = 2.0 * $sum - $bj;
+ $ans /= $sum;
+
+ return ($x < 0.0 && ($ord % 2) === 1) ? -$ans : $ans;
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/BesselK.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/BesselK.php
new file mode 100644
index 0000000..5a9bd54
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/BesselK.php
@@ -0,0 +1,130 @@
+getMessage();
+ }
+
+ if (($ord < 0) || ($x <= 0.0)) {
+ return ExcelError::NAN();
+ }
+
+ $fBk = self::calculate($x, $ord);
+
+ return (is_nan($fBk)) ? ExcelError::NAN() : $fBk;
+ }
+
+ private static function calculate(float $x, int $ord): float
+ {
+ return match ($ord) {
+ 0 => self::besselK0($x),
+ 1 => self::besselK1($x),
+ default => self::besselK2($x, $ord),
+ };
+ }
+
+ /**
+ * Mollify Phpstan.
+ *
+ * @codeCoverageIgnore
+ */
+ private static function callBesselI(float $x, int $ord): float
+ {
+ $rslt = BesselI::BESSELI($x, $ord);
+ if (!is_float($rslt)) {
+ throw new Exception('Unexpected array or string');
+ }
+
+ return $rslt;
+ }
+
+ private static function besselK0(float $x): float
+ {
+ if ($x <= 2) {
+ $fNum2 = $x * 0.5;
+ $y = ($fNum2 * $fNum2);
+
+ return -log($fNum2) * self::callBesselI($x, 0)
+ + (-0.57721566 + $y * (0.42278420 + $y * (0.23069756 + $y * (0.3488590e-1 + $y * (0.262698e-2 + $y
+ * (0.10750e-3 + $y * 0.74e-5))))));
+ }
+
+ $y = 2 / $x;
+
+ return exp(-$x) / sqrt($x)
+ * (1.25331414 + $y * (-0.7832358e-1 + $y * (0.2189568e-1 + $y * (-0.1062446e-1 + $y
+ * (0.587872e-2 + $y * (-0.251540e-2 + $y * 0.53208e-3))))));
+ }
+
+ private static function besselK1(float $x): float
+ {
+ if ($x <= 2) {
+ $fNum2 = $x * 0.5;
+ $y = ($fNum2 * $fNum2);
+
+ return log($fNum2) * self::callBesselI($x, 1)
+ + (1 + $y * (0.15443144 + $y * (-0.67278579 + $y * (-0.18156897 + $y * (-0.1919402e-1 + $y
+ * (-0.110404e-2 + $y * (-0.4686e-4))))))) / $x;
+ }
+
+ $y = 2 / $x;
+
+ return exp(-$x) / sqrt($x)
+ * (1.25331414 + $y * (0.23498619 + $y * (-0.3655620e-1 + $y * (0.1504268e-1 + $y * (-0.780353e-2 + $y
+ * (0.325614e-2 + $y * (-0.68245e-3)))))));
+ }
+
+ private static function besselK2(float $x, int $ord): float
+ {
+ $fTox = 2 / $x;
+ $fBkm = self::besselK0($x);
+ $fBk = self::besselK1($x);
+ for ($n = 1; $n < $ord; ++$n) {
+ $fBkp = $fBkm + $n * $fTox * $fBk;
+ $fBkm = $fBk;
+ $fBk = $fBkp;
+ }
+
+ return $fBk;
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/BesselY.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/BesselY.php
new file mode 100644
index 0000000..5d99638
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/BesselY.php
@@ -0,0 +1,137 @@
+getMessage();
+ }
+
+ if (($ord < 0) || ($x <= 0.0)) {
+ return ExcelError::NAN();
+ }
+
+ $fBy = self::calculate($x, $ord);
+
+ return (is_nan($fBy)) ? ExcelError::NAN() : $fBy;
+ }
+
+ private static function calculate(float $x, int $ord): float
+ {
+ return match ($ord) {
+ 0 => self::besselY0($x),
+ 1 => self::besselY1($x),
+ default => self::besselY2($x, $ord),
+ };
+ }
+
+ /**
+ * Mollify Phpstan.
+ *
+ * @codeCoverageIgnore
+ */
+ private static function callBesselJ(float $x, int $ord): float
+ {
+ $rslt = BesselJ::BESSELJ($x, $ord);
+ if (!is_float($rslt)) {
+ throw new Exception('Unexpected array or string');
+ }
+
+ return $rslt;
+ }
+
+ private static function besselY0(float $x): float
+ {
+ if ($x < 8.0) {
+ $y = ($x * $x);
+ $ans1 = -2957821389.0 + $y * (7062834065.0 + $y * (-512359803.6 + $y * (10879881.29 + $y
+ * (-86327.92757 + $y * 228.4622733))));
+ $ans2 = 40076544269.0 + $y * (745249964.8 + $y * (7189466.438 + $y
+ * (47447.26470 + $y * (226.1030244 + $y))));
+
+ return $ans1 / $ans2 + 0.636619772 * self::callBesselJ($x, 0) * log($x);
+ }
+
+ $z = 8.0 / $x;
+ $y = ($z * $z);
+ $xx = $x - 0.785398164;
+ $ans1 = 1 + $y * (-0.1098628627e-2 + $y * (0.2734510407e-4 + $y * (-0.2073370639e-5 + $y * 0.2093887211e-6)));
+ $ans2 = -0.1562499995e-1 + $y * (0.1430488765e-3 + $y * (-0.6911147651e-5 + $y * (0.7621095161e-6 + $y
+ * (-0.934945152e-7))));
+
+ return sqrt(0.636619772 / $x) * (sin($xx) * $ans1 + $z * cos($xx) * $ans2);
+ }
+
+ private static function besselY1(float $x): float
+ {
+ if ($x < 8.0) {
+ $y = ($x * $x);
+ $ans1 = $x * (-0.4900604943e13 + $y * (0.1275274390e13 + $y * (-0.5153438139e11 + $y
+ * (0.7349264551e9 + $y * (-0.4237922726e7 + $y * 0.8511937935e4)))));
+ $ans2 = 0.2499580570e14 + $y * (0.4244419664e12 + $y * (0.3733650367e10 + $y * (0.2245904002e8 + $y
+ * (0.1020426050e6 + $y * (0.3549632885e3 + $y)))));
+
+ return ($ans1 / $ans2) + 0.636619772 * (self::callBesselJ($x, 1) * log($x) - 1 / $x);
+ }
+
+ $z = 8.0 / $x;
+ $y = $z * $z;
+ $xx = $x - 2.356194491;
+ $ans1 = 1.0 + $y * (0.183105e-2 + $y * (-0.3516396496e-4 + $y * (0.2457520174e-5 + $y * (-0.240337019e-6))));
+ $ans2 = 0.04687499995 + $y * (-0.2002690873e-3 + $y * (0.8449199096e-5 + $y
+ * (-0.88228987e-6 + $y * 0.105787412e-6)));
+
+ return sqrt(0.636619772 / $x) * (sin($xx) * $ans1 + $z * cos($xx) * $ans2);
+ }
+
+ private static function besselY2(float $x, int $ord): float
+ {
+ $fTox = 2.0 / $x;
+ $fBym = self::besselY0($x);
+ $fBy = self::besselY1($x);
+ for ($n = 1; $n < $ord; ++$n) {
+ $fByp = $n * $fTox * $fBy - $fBym;
+ $fBym = $fBy;
+ $fBy = $fByp;
+ }
+
+ return $fBy;
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/BitWise.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/BitWise.php
new file mode 100644
index 0000000..c861c21
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/BitWise.php
@@ -0,0 +1,247 @@
+getMessage();
+ }
+ $split1 = self::splitNumber($number1);
+ $split2 = self::splitNumber($number2);
+
+ return self::SPLIT_DIVISOR * ($split1[0] & $split2[0]) + ($split1[1] & $split2[1]);
+ }
+
+ /**
+ * BITOR.
+ *
+ * Returns the bitwise OR of two integer values.
+ *
+ * Excel Function:
+ * BITOR(number1, number2)
+ *
+ * @param null|array|bool|float|int|string $number1 Or can be an array of values
+ * @param null|array|bool|float|int|string $number2 Or can be an array of values
+ *
+ * @return array|int|string If an array of numbers is passed as an argument, then the returned result will also be an array
+ * with the same dimensions
+ */
+ public static function BITOR(null|array|bool|float|int|string $number1, null|array|bool|float|int|string $number2): array|string|int|float
+ {
+ if (is_array($number1) || is_array($number2)) {
+ return self::evaluateArrayArguments([self::class, __FUNCTION__], $number1, $number2);
+ }
+
+ try {
+ $number1 = self::validateBitwiseArgument($number1);
+ $number2 = self::validateBitwiseArgument($number2);
+ } catch (Exception $e) {
+ return $e->getMessage();
+ }
+
+ $split1 = self::splitNumber($number1);
+ $split2 = self::splitNumber($number2);
+
+ return self::SPLIT_DIVISOR * ($split1[0] | $split2[0]) + ($split1[1] | $split2[1]);
+ }
+
+ /**
+ * BITXOR.
+ *
+ * Returns the bitwise XOR of two integer values.
+ *
+ * Excel Function:
+ * BITXOR(number1, number2)
+ *
+ * @param null|array|bool|float|int|string $number1 Or can be an array of values
+ * @param null|array|bool|float|int|string $number2 Or can be an array of values
+ *
+ * @return array|int|string If an array of numbers is passed as an argument, then the returned result will also be an array
+ * with the same dimensions
+ */
+ public static function BITXOR(null|array|bool|float|int|string $number1, null|array|bool|float|int|string $number2): array|string|int|float
+ {
+ if (is_array($number1) || is_array($number2)) {
+ return self::evaluateArrayArguments([self::class, __FUNCTION__], $number1, $number2);
+ }
+
+ try {
+ $number1 = self::validateBitwiseArgument($number1);
+ $number2 = self::validateBitwiseArgument($number2);
+ } catch (Exception $e) {
+ return $e->getMessage();
+ }
+
+ $split1 = self::splitNumber($number1);
+ $split2 = self::splitNumber($number2);
+
+ return self::SPLIT_DIVISOR * ($split1[0] ^ $split2[0]) + ($split1[1] ^ $split2[1]);
+ }
+
+ /**
+ * BITLSHIFT.
+ *
+ * Returns the number value shifted left by shift_amount bits.
+ *
+ * Excel Function:
+ * BITLSHIFT(number, shift_amount)
+ *
+ * @param null|array|bool|float|int|string $number Or can be an array of values
+ * @param null|array|bool|float|int|string $shiftAmount Or can be an array of values
+ *
+ * @return array|float|string If an array of numbers is passed as an argument, then the returned result will also be an array
+ * with the same dimensions
+ */
+ public static function BITLSHIFT(null|array|bool|float|int|string $number, null|array|bool|float|int|string $shiftAmount): array|string|float
+ {
+ if (is_array($number) || is_array($shiftAmount)) {
+ return self::evaluateArrayArguments([self::class, __FUNCTION__], $number, $shiftAmount);
+ }
+
+ try {
+ $number = self::validateBitwiseArgument($number);
+ $shiftAmount = self::validateShiftAmount($shiftAmount);
+ } catch (Exception $e) {
+ return $e->getMessage();
+ }
+
+ $result = floor($number * (2 ** $shiftAmount));
+ if ($result > 2 ** 48 - 1) {
+ return ExcelError::NAN();
+ }
+
+ return $result;
+ }
+
+ /**
+ * BITRSHIFT.
+ *
+ * Returns the number value shifted right by shift_amount bits.
+ *
+ * Excel Function:
+ * BITRSHIFT(number, shift_amount)
+ *
+ * @param null|array|bool|float|int|string $number Or can be an array of values
+ * @param null|array|bool|float|int|string $shiftAmount Or can be an array of values
+ *
+ * @return array|float|string If an array of numbers is passed as an argument, then the returned result will also be an array
+ * with the same dimensions
+ */
+ public static function BITRSHIFT(null|array|bool|float|int|string $number, null|array|bool|float|int|string $shiftAmount): array|string|float
+ {
+ if (is_array($number) || is_array($shiftAmount)) {
+ return self::evaluateArrayArguments([self::class, __FUNCTION__], $number, $shiftAmount);
+ }
+
+ try {
+ $number = self::validateBitwiseArgument($number);
+ $shiftAmount = self::validateShiftAmount($shiftAmount);
+ } catch (Exception $e) {
+ return $e->getMessage();
+ }
+
+ $result = floor($number / (2 ** $shiftAmount));
+ if ($result > 2 ** 48 - 1) { // possible because shiftAmount can be negative
+ return ExcelError::NAN();
+ }
+
+ return $result;
+ }
+
+ /**
+ * Validate arguments passed to the bitwise functions.
+ */
+ private static function validateBitwiseArgument(mixed $value): float
+ {
+ $value = self::nullFalseTrueToNumber($value);
+
+ if (is_numeric($value)) {
+ $value = (float) $value;
+ if ($value == floor($value)) {
+ if (($value > 2 ** 48 - 1) || ($value < 0)) {
+ throw new Exception(ExcelError::NAN());
+ }
+
+ return floor($value);
+ }
+
+ throw new Exception(ExcelError::NAN());
+ }
+
+ throw new Exception(ExcelError::VALUE());
+ }
+
+ /**
+ * Validate arguments passed to the bitwise functions.
+ */
+ private static function validateShiftAmount(mixed $value): int
+ {
+ $value = self::nullFalseTrueToNumber($value);
+
+ if (is_numeric($value)) {
+ if (abs($value) > 53) {
+ throw new Exception(ExcelError::NAN());
+ }
+
+ return (int) $value;
+ }
+
+ throw new Exception(ExcelError::VALUE());
+ }
+
+ /**
+ * Many functions accept null/false/true argument treated as 0/0/1.
+ */
+ private static function nullFalseTrueToNumber(mixed &$number): mixed
+ {
+ if ($number === null) {
+ $number = 0;
+ } elseif (is_bool($number)) {
+ $number = (int) $number;
+ }
+
+ return $number;
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/Compare.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/Compare.php
new file mode 100644
index 0000000..9e3275f
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/Compare.php
@@ -0,0 +1,82 @@
+getMessage();
+ }
+
+ return (int) (abs($a - $b) < 1.0e-15);
+ }
+
+ /**
+ * GESTEP.
+ *
+ * Excel Function:
+ * GESTEP(number[,step])
+ *
+ * Returns 1 if number >= step; returns 0 (zero) otherwise
+ * Use this function to filter a set of values. For example, by summing several GESTEP
+ * functions you calculate the count of values that exceed a threshold.
+ *
+ * @param array|bool|float|int|string $number the value to test against step
+ * Or can be an array of values
+ * @param null|array|bool|float|int|string $step The threshold value. If you omit a value for step, GESTEP uses zero.
+ * Or can be an array of values
+ *
+ * @return array|int|string (string in the event of an error)
+ * If an array of numbers is passed as an argument, then the returned result will also be an array
+ * with the same dimensions
+ */
+ public static function GESTEP(array|float|bool|string|int $number, $step = 0.0): array|string|int
+ {
+ if (is_array($number) || is_array($step)) {
+ return self::evaluateArrayArguments([self::class, __FUNCTION__], $number, $step);
+ }
+
+ try {
+ $number = EngineeringValidations::validateFloat($number);
+ $step = EngineeringValidations::validateFloat($step ?? 0.0);
+ } catch (Exception $e) {
+ return $e->getMessage();
+ }
+
+ return (int) ($number >= $step);
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/Complex.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/Complex.php
new file mode 100644
index 0000000..3e41371
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/Complex.php
@@ -0,0 +1,120 @@
+getMessage();
+ }
+
+ if (($suffix === 'i') || ($suffix === 'j') || ($suffix === '')) {
+ $complex = new ComplexObject($realNumber, $imaginary, $suffix);
+
+ return (string) $complex;
+ }
+
+ return ExcelError::VALUE();
+ }
+
+ /**
+ * IMAGINARY.
+ *
+ * Returns the imaginary coefficient of a complex number in x + yi or x + yj text format.
+ *
+ * Excel Function:
+ * IMAGINARY(complexNumber)
+ *
+ * @param array|string $complexNumber the complex number for which you want the imaginary
+ * coefficient
+ * Or can be an array of values
+ *
+ * @return array|float|string (string if an error)
+ * If an array of numbers is passed as an argument, then the returned result will also be an array
+ * with the same dimensions
+ */
+ public static function IMAGINARY($complexNumber): array|string|float
+ {
+ if (is_array($complexNumber)) {
+ return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $complexNumber);
+ }
+
+ try {
+ $complex = new ComplexObject($complexNumber);
+ } catch (ComplexException) {
+ return ExcelError::NAN();
+ }
+
+ return $complex->getImaginary();
+ }
+
+ /**
+ * IMREAL.
+ *
+ * Returns the real coefficient of a complex number in x + yi or x + yj text format.
+ *
+ * Excel Function:
+ * IMREAL(complexNumber)
+ *
+ * @param array|string $complexNumber the complex number for which you want the real coefficient
+ * Or can be an array of values
+ *
+ * @return array|float|string (string if an error)
+ * If an array of numbers is passed as an argument, then the returned result will also be an array
+ * with the same dimensions
+ */
+ public static function IMREAL($complexNumber): array|string|float
+ {
+ if (is_array($complexNumber)) {
+ return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $complexNumber);
+ }
+
+ try {
+ $complex = new ComplexObject($complexNumber);
+ } catch (ComplexException) {
+ return ExcelError::NAN();
+ }
+
+ return $complex->getReal();
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/ComplexFunctions.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/ComplexFunctions.php
new file mode 100644
index 0000000..d1b7764
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/ComplexFunctions.php
@@ -0,0 +1,592 @@
+abs();
+ }
+
+ /**
+ * IMARGUMENT.
+ *
+ * Returns the argument theta of a complex number, i.e. the angle in radians from the real
+ * axis to the representation of the number in polar coordinates.
+ *
+ * Excel Function:
+ * IMARGUMENT(complexNumber)
+ *
+ * @param array|string $complexNumber the complex number for which you want the argument theta
+ * Or can be an array of values
+ *
+ * @return array|float|string If an array of numbers is passed as an argument, then the returned result will also be an array
+ * with the same dimensions
+ */
+ public static function IMARGUMENT(array|string $complexNumber): array|float|string
+ {
+ if (is_array($complexNumber)) {
+ return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $complexNumber);
+ }
+
+ try {
+ $complex = new ComplexObject($complexNumber);
+ } catch (ComplexException) {
+ return ExcelError::NAN();
+ }
+
+ if ($complex->getReal() == 0.0 && $complex->getImaginary() == 0.0) {
+ return ExcelError::DIV0();
+ }
+
+ return $complex->argument();
+ }
+
+ /**
+ * IMCONJUGATE.
+ *
+ * Returns the complex conjugate of a complex number in x + yi or x + yj text format.
+ *
+ * Excel Function:
+ * IMCONJUGATE(complexNumber)
+ *
+ * @param array|string $complexNumber the complex number for which you want the conjugate
+ * Or can be an array of values
+ *
+ * @return array|string If an array of numbers is passed as an argument, then the returned result will also be an array
+ * with the same dimensions
+ */
+ public static function IMCONJUGATE(array|string $complexNumber): array|string
+ {
+ if (is_array($complexNumber)) {
+ return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $complexNumber);
+ }
+
+ try {
+ $complex = new ComplexObject($complexNumber);
+ } catch (ComplexException) {
+ return ExcelError::NAN();
+ }
+
+ return (string) $complex->conjugate();
+ }
+
+ /**
+ * IMCOS.
+ *
+ * Returns the cosine of a complex number in x + yi or x + yj text format.
+ *
+ * Excel Function:
+ * IMCOS(complexNumber)
+ *
+ * @param array|string $complexNumber the complex number for which you want the cosine
+ * Or can be an array of values
+ *
+ * @return array|string If an array of numbers is passed as an argument, then the returned result will also be an array
+ * with the same dimensions
+ */
+ public static function IMCOS(array|string $complexNumber): array|string
+ {
+ if (is_array($complexNumber)) {
+ return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $complexNumber);
+ }
+
+ try {
+ $complex = new ComplexObject($complexNumber);
+ } catch (ComplexException) {
+ return ExcelError::NAN();
+ }
+
+ return (string) $complex->cos();
+ }
+
+ /**
+ * IMCOSH.
+ *
+ * Returns the hyperbolic cosine of a complex number in x + yi or x + yj text format.
+ *
+ * Excel Function:
+ * IMCOSH(complexNumber)
+ *
+ * @param array|string $complexNumber the complex number for which you want the hyperbolic cosine
+ * Or can be an array of values
+ *
+ * @return array|string If an array of numbers is passed as an argument, then the returned result will also be an array
+ * with the same dimensions
+ */
+ public static function IMCOSH(array|string $complexNumber): array|string
+ {
+ if (is_array($complexNumber)) {
+ return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $complexNumber);
+ }
+
+ try {
+ $complex = new ComplexObject($complexNumber);
+ } catch (ComplexException) {
+ return ExcelError::NAN();
+ }
+
+ return (string) $complex->cosh();
+ }
+
+ /**
+ * IMCOT.
+ *
+ * Returns the cotangent of a complex number in x + yi or x + yj text format.
+ *
+ * Excel Function:
+ * IMCOT(complexNumber)
+ *
+ * @param array|string $complexNumber the complex number for which you want the cotangent
+ * Or can be an array of values
+ *
+ * @return array|string If an array of numbers is passed as an argument, then the returned result will also be an array
+ * with the same dimensions
+ */
+ public static function IMCOT(array|string $complexNumber): array|string
+ {
+ if (is_array($complexNumber)) {
+ return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $complexNumber);
+ }
+
+ try {
+ $complex = new ComplexObject($complexNumber);
+ } catch (ComplexException) {
+ return ExcelError::NAN();
+ }
+
+ return (string) $complex->cot();
+ }
+
+ /**
+ * IMCSC.
+ *
+ * Returns the cosecant of a complex number in x + yi or x + yj text format.
+ *
+ * Excel Function:
+ * IMCSC(complexNumber)
+ *
+ * @param array|string $complexNumber the complex number for which you want the cosecant
+ * Or can be an array of values
+ *
+ * @return array|string If an array of numbers is passed as an argument, then the returned result will also be an array
+ * with the same dimensions
+ */
+ public static function IMCSC(array|string $complexNumber): array|string
+ {
+ if (is_array($complexNumber)) {
+ return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $complexNumber);
+ }
+
+ try {
+ $complex = new ComplexObject($complexNumber);
+ } catch (ComplexException) {
+ return ExcelError::NAN();
+ }
+
+ return (string) $complex->csc();
+ }
+
+ /**
+ * IMCSCH.
+ *
+ * Returns the hyperbolic cosecant of a complex number in x + yi or x + yj text format.
+ *
+ * Excel Function:
+ * IMCSCH(complexNumber)
+ *
+ * @param array|string $complexNumber the complex number for which you want the hyperbolic cosecant
+ * Or can be an array of values
+ *
+ * @return array|string If an array of numbers is passed as an argument, then the returned result will also be an array
+ * with the same dimensions
+ */
+ public static function IMCSCH(array|string $complexNumber): array|string
+ {
+ if (is_array($complexNumber)) {
+ return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $complexNumber);
+ }
+
+ try {
+ $complex = new ComplexObject($complexNumber);
+ } catch (ComplexException) {
+ return ExcelError::NAN();
+ }
+
+ return (string) $complex->csch();
+ }
+
+ /**
+ * IMSIN.
+ *
+ * Returns the sine of a complex number in x + yi or x + yj text format.
+ *
+ * Excel Function:
+ * IMSIN(complexNumber)
+ *
+ * @param array|string $complexNumber the complex number for which you want the sine
+ * Or can be an array of values
+ *
+ * @return array|string If an array of numbers is passed as an argument, then the returned result will also be an array
+ * with the same dimensions
+ */
+ public static function IMSIN(array|string $complexNumber): array|string
+ {
+ if (is_array($complexNumber)) {
+ return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $complexNumber);
+ }
+
+ try {
+ $complex = new ComplexObject($complexNumber);
+ } catch (ComplexException) {
+ return ExcelError::NAN();
+ }
+
+ return (string) $complex->sin();
+ }
+
+ /**
+ * IMSINH.
+ *
+ * Returns the hyperbolic sine of a complex number in x + yi or x + yj text format.
+ *
+ * Excel Function:
+ * IMSINH(complexNumber)
+ *
+ * @param array|string $complexNumber the complex number for which you want the hyperbolic sine
+ * Or can be an array of values
+ *
+ * @return array|string If an array of numbers is passed as an argument, then the returned result will also be an array
+ * with the same dimensions
+ */
+ public static function IMSINH(array|string $complexNumber): array|string
+ {
+ if (is_array($complexNumber)) {
+ return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $complexNumber);
+ }
+
+ try {
+ $complex = new ComplexObject($complexNumber);
+ } catch (ComplexException) {
+ return ExcelError::NAN();
+ }
+
+ return (string) $complex->sinh();
+ }
+
+ /**
+ * IMSEC.
+ *
+ * Returns the secant of a complex number in x + yi or x + yj text format.
+ *
+ * Excel Function:
+ * IMSEC(complexNumber)
+ *
+ * @param array|string $complexNumber the complex number for which you want the secant
+ * Or can be an array of values
+ *
+ * @return array|string If an array of numbers is passed as an argument, then the returned result will also be an array
+ * with the same dimensions
+ */
+ public static function IMSEC(array|string $complexNumber): array|string
+ {
+ if (is_array($complexNumber)) {
+ return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $complexNumber);
+ }
+
+ try {
+ $complex = new ComplexObject($complexNumber);
+ } catch (ComplexException) {
+ return ExcelError::NAN();
+ }
+
+ return (string) $complex->sec();
+ }
+
+ /**
+ * IMSECH.
+ *
+ * Returns the hyperbolic secant of a complex number in x + yi or x + yj text format.
+ *
+ * Excel Function:
+ * IMSECH(complexNumber)
+ *
+ * @param array|string $complexNumber the complex number for which you want the hyperbolic secant
+ * Or can be an array of values
+ *
+ * @return array|string If an array of numbers is passed as an argument, then the returned result will also be an array
+ * with the same dimensions
+ */
+ public static function IMSECH(array|string $complexNumber): array|string
+ {
+ if (is_array($complexNumber)) {
+ return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $complexNumber);
+ }
+
+ try {
+ $complex = new ComplexObject($complexNumber);
+ } catch (ComplexException) {
+ return ExcelError::NAN();
+ }
+
+ return (string) $complex->sech();
+ }
+
+ /**
+ * IMTAN.
+ *
+ * Returns the tangent of a complex number in x + yi or x + yj text format.
+ *
+ * Excel Function:
+ * IMTAN(complexNumber)
+ *
+ * @param array|string $complexNumber the complex number for which you want the tangent
+ * Or can be an array of values
+ *
+ * @return array|string If an array of numbers is passed as an argument, then the returned result will also be an array
+ * with the same dimensions
+ */
+ public static function IMTAN(array|string $complexNumber): array|string
+ {
+ if (is_array($complexNumber)) {
+ return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $complexNumber);
+ }
+
+ try {
+ $complex = new ComplexObject($complexNumber);
+ } catch (ComplexException) {
+ return ExcelError::NAN();
+ }
+
+ return (string) $complex->tan();
+ }
+
+ /**
+ * IMSQRT.
+ *
+ * Returns the square root of a complex number in x + yi or x + yj text format.
+ *
+ * Excel Function:
+ * IMSQRT(complexNumber)
+ *
+ * @param array|string $complexNumber the complex number for which you want the square root
+ * Or can be an array of values
+ *
+ * @return array|string If an array of numbers is passed as an argument, then the returned result will also be an array
+ * with the same dimensions
+ */
+ public static function IMSQRT(array|string $complexNumber): array|string
+ {
+ if (is_array($complexNumber)) {
+ return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $complexNumber);
+ }
+
+ try {
+ $complex = new ComplexObject($complexNumber);
+ } catch (ComplexException) {
+ return ExcelError::NAN();
+ }
+
+ $theta = self::IMARGUMENT($complexNumber);
+ if ($theta === ExcelError::DIV0()) {
+ return '0';
+ }
+
+ return (string) $complex->sqrt();
+ }
+
+ /**
+ * IMLN.
+ *
+ * Returns the natural logarithm of a complex number in x + yi or x + yj text format.
+ *
+ * Excel Function:
+ * IMLN(complexNumber)
+ *
+ * @param array|string $complexNumber the complex number for which you want the natural logarithm
+ * Or can be an array of values
+ *
+ * @return array|string If an array of numbers is passed as an argument, then the returned result will also be an array
+ * with the same dimensions
+ */
+ public static function IMLN(array|string $complexNumber): array|string
+ {
+ if (is_array($complexNumber)) {
+ return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $complexNumber);
+ }
+
+ try {
+ $complex = new ComplexObject($complexNumber);
+ } catch (ComplexException) {
+ return ExcelError::NAN();
+ }
+
+ if ($complex->getReal() == 0.0 && $complex->getImaginary() == 0.0) {
+ return ExcelError::NAN();
+ }
+
+ return (string) $complex->ln();
+ }
+
+ /**
+ * IMLOG10.
+ *
+ * Returns the common logarithm (base 10) of a complex number in x + yi or x + yj text format.
+ *
+ * Excel Function:
+ * IMLOG10(complexNumber)
+ *
+ * @param array|string $complexNumber the complex number for which you want the common logarithm
+ * Or can be an array of values
+ *
+ * @return array|string If an array of numbers is passed as an argument, then the returned result will also be an array
+ * with the same dimensions
+ */
+ public static function IMLOG10(array|string $complexNumber): array|string
+ {
+ if (is_array($complexNumber)) {
+ return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $complexNumber);
+ }
+
+ try {
+ $complex = new ComplexObject($complexNumber);
+ } catch (ComplexException) {
+ return ExcelError::NAN();
+ }
+
+ if ($complex->getReal() == 0.0 && $complex->getImaginary() == 0.0) {
+ return ExcelError::NAN();
+ }
+
+ return (string) $complex->log10();
+ }
+
+ /**
+ * IMLOG2.
+ *
+ * Returns the base-2 logarithm of a complex number in x + yi or x + yj text format.
+ *
+ * Excel Function:
+ * IMLOG2(complexNumber)
+ *
+ * @param array|string $complexNumber the complex number for which you want the base-2 logarithm
+ * Or can be an array of values
+ *
+ * @return array|string If an array of numbers is passed as an argument, then the returned result will also be an array
+ * with the same dimensions
+ */
+ public static function IMLOG2(array|string $complexNumber): array|string
+ {
+ if (is_array($complexNumber)) {
+ return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $complexNumber);
+ }
+
+ try {
+ $complex = new ComplexObject($complexNumber);
+ } catch (ComplexException) {
+ return ExcelError::NAN();
+ }
+
+ if ($complex->getReal() == 0.0 && $complex->getImaginary() == 0.0) {
+ return ExcelError::NAN();
+ }
+
+ return (string) $complex->log2();
+ }
+
+ /**
+ * IMEXP.
+ *
+ * Returns the exponential of a complex number in x + yi or x + yj text format.
+ *
+ * Excel Function:
+ * IMEXP(complexNumber)
+ *
+ * @param array|string $complexNumber the complex number for which you want the exponential
+ * Or can be an array of values
+ *
+ * @return array|string If an array of numbers is passed as an argument, then the returned result will also be an array
+ * with the same dimensions
+ */
+ public static function IMEXP(array|string $complexNumber): array|string
+ {
+ if (is_array($complexNumber)) {
+ return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $complexNumber);
+ }
+
+ try {
+ $complex = new ComplexObject($complexNumber);
+ } catch (ComplexException) {
+ return ExcelError::NAN();
+ }
+
+ return (string) $complex->exp();
+ }
+
+ /**
+ * IMPOWER.
+ *
+ * Returns a complex number in x + yi or x + yj text format raised to a power.
+ *
+ * Excel Function:
+ * IMPOWER(complexNumber,realNumber)
+ *
+ * @param array|string $complexNumber the complex number you want to raise to a power
+ * Or can be an array of values
+ * @param array|float|int|string $realNumber the power to which you want to raise the complex number
+ * Or can be an array of values
+ *
+ * @return array|string If an array of numbers is passed as an argument, then the returned result will also be an array
+ * with the same dimensions
+ */
+ public static function IMPOWER(array|string $complexNumber, array|float|int|string $realNumber): array|string
+ {
+ if (is_array($complexNumber) || is_array($realNumber)) {
+ return self::evaluateArrayArguments([self::class, __FUNCTION__], $complexNumber, $realNumber);
+ }
+
+ try {
+ $complex = new ComplexObject($complexNumber);
+ } catch (ComplexException) {
+ return ExcelError::NAN();
+ }
+
+ if (!is_numeric($realNumber)) {
+ return ExcelError::VALUE();
+ }
+
+ return (string) $complex->pow((float) $realNumber);
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/ComplexOperations.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/ComplexOperations.php
new file mode 100644
index 0000000..61efa84
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/ComplexOperations.php
@@ -0,0 +1,128 @@
+divideby(new ComplexObject($complexDivisor));
+ } catch (ComplexException) {
+ return ExcelError::NAN();
+ }
+ }
+
+ /**
+ * IMSUB.
+ *
+ * Returns the difference of two complex numbers in x + yi or x + yj text format.
+ *
+ * Excel Function:
+ * IMSUB(complexNumber1,complexNumber2)
+ *
+ * @param array|string $complexNumber1 the complex number from which to subtract complexNumber2
+ * Or can be an array of values
+ * @param array|string $complexNumber2 the complex number to subtract from complexNumber1
+ * Or can be an array of values
+ *
+ * @return array|string If an array of numbers is passed as an argument, then the returned result will also be an array
+ * with the same dimensions
+ */
+ public static function IMSUB(array|string $complexNumber1, array|string $complexNumber2): array|string
+ {
+ if (is_array($complexNumber1) || is_array($complexNumber2)) {
+ return self::evaluateArrayArguments([self::class, __FUNCTION__], $complexNumber1, $complexNumber2);
+ }
+
+ try {
+ return (string) (new ComplexObject($complexNumber1))->subtract(new ComplexObject($complexNumber2));
+ } catch (ComplexException) {
+ return ExcelError::NAN();
+ }
+ }
+
+ /**
+ * IMSUM.
+ *
+ * Returns the sum of two or more complex numbers in x + yi or x + yj text format.
+ *
+ * Excel Function:
+ * IMSUM(complexNumber[,complexNumber[,...]])
+ *
+ * @param string ...$complexNumbers Series of complex numbers to add
+ */
+ public static function IMSUM(...$complexNumbers): string
+ {
+ // Return value
+ $returnValue = new ComplexObject(0.0);
+ $aArgs = Functions::flattenArray($complexNumbers);
+
+ try {
+ // Loop through the arguments
+ foreach ($aArgs as $complex) {
+ $returnValue = $returnValue->add(new ComplexObject($complex));
+ }
+ } catch (ComplexException) {
+ return ExcelError::NAN();
+ }
+
+ return (string) $returnValue;
+ }
+
+ /**
+ * IMPRODUCT.
+ *
+ * Returns the product of two or more complex numbers in x + yi or x + yj text format.
+ *
+ * Excel Function:
+ * IMPRODUCT(complexNumber[,complexNumber[,...]])
+ *
+ * @param string ...$complexNumbers Series of complex numbers to multiply
+ */
+ public static function IMPRODUCT(...$complexNumbers): string
+ {
+ // Return value
+ $returnValue = new ComplexObject(1.0);
+ $aArgs = Functions::flattenArray($complexNumbers);
+
+ try {
+ // Loop through the arguments
+ foreach ($aArgs as $complex) {
+ $returnValue = $returnValue->multiply(new ComplexObject($complex));
+ }
+ } catch (ComplexException) {
+ return ExcelError::NAN();
+ }
+
+ return (string) $returnValue;
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/Constants.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/Constants.php
new file mode 100644
index 0000000..a926db6
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/Constants.php
@@ -0,0 +1,11 @@
+ 10) {
+ throw new Exception(ExcelError::NAN());
+ }
+
+ return (int) $places;
+ }
+
+ throw new Exception(ExcelError::VALUE());
+ }
+
+ /**
+ * Formats a number base string value with leading zeroes.
+ *
+ * @param string $value The "number" to pad
+ * @param ?int $places The length that we want to pad this value
+ *
+ * @return string The padded "number"
+ */
+ protected static function nbrConversionFormat(string $value, ?int $places): string
+ {
+ if ($places !== null) {
+ if (strlen($value) <= $places) {
+ return substr(str_pad($value, $places, '0', STR_PAD_LEFT), -10);
+ }
+
+ return ExcelError::NAN();
+ }
+
+ return substr($value, -10);
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/ConvertBinary.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/ConvertBinary.php
new file mode 100644
index 0000000..9c00dcb
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/ConvertBinary.php
@@ -0,0 +1,163 @@
+getMessage();
+ }
+
+ if (strlen($value) == 10 && $value[0] === '1') {
+ // Two's Complement
+ $value = substr($value, -9);
+
+ return '-' . (512 - bindec($value));
+ }
+
+ return (string) bindec($value);
+ }
+
+ /**
+ * toHex.
+ *
+ * Return a binary value as hex.
+ *
+ * Excel Function:
+ * BIN2HEX(x[,places])
+ *
+ * @param array|bool|float|int|string $value The binary number (as a string) that you want to convert. The number
+ * cannot contain more than 10 characters (10 bits). The most significant
+ * bit of number is the sign bit. The remaining 9 bits are magnitude bits.
+ * Negative numbers are represented using two's-complement notation.
+ * If number is not a valid binary number, or if number contains more than
+ * 10 characters (10 bits), BIN2HEX returns the #NUM! error value.
+ * Or can be an array of values
+ * @param null|array|float|int|string $places The number of characters to use. If places is omitted, BIN2HEX uses the
+ * minimum number of characters necessary. Places is useful for padding the
+ * return value with leading 0s (zeros).
+ * If places is not an integer, it is truncated.
+ * If places is nonnumeric, BIN2HEX returns the #VALUE! error value.
+ * If places is negative, BIN2HEX returns the #NUM! error value.
+ * Or can be an array of values
+ *
+ * @return array|string Result, or an error
+ * If an array of numbers is passed as an argument, then the returned result will also be an array
+ * with the same dimensions
+ */
+ public static function toHex($value, $places = null): array|string
+ {
+ if (is_array($value) || is_array($places)) {
+ return self::evaluateArrayArguments([self::class, __FUNCTION__], $value, $places);
+ }
+
+ try {
+ $value = self::validateValue($value);
+ $value = self::validateBinary($value);
+ $places = self::validatePlaces($places);
+ } catch (Exception $e) {
+ return $e->getMessage();
+ }
+
+ if (strlen($value) == 10 && $value[0] === '1') {
+ $high2 = substr($value, 0, 2);
+ $low8 = substr($value, 2);
+ $xarr = ['00' => '00000000', '01' => '00000001', '10' => 'FFFFFFFE', '11' => 'FFFFFFFF'];
+
+ return $xarr[$high2] . strtoupper(substr('0' . dechex((int) bindec($low8)), -2));
+ }
+ $hexVal = (string) strtoupper(dechex((int) bindec($value)));
+
+ return self::nbrConversionFormat($hexVal, $places);
+ }
+
+ /**
+ * toOctal.
+ *
+ * Return a binary value as octal.
+ *
+ * Excel Function:
+ * BIN2OCT(x[,places])
+ *
+ * @param array|bool|float|int|string $value The binary number (as a string) that you want to convert. The number
+ * cannot contain more than 10 characters (10 bits). The most significant
+ * bit of number is the sign bit. The remaining 9 bits are magnitude bits.
+ * Negative numbers are represented using two's-complement notation.
+ * If number is not a valid binary number, or if number contains more than
+ * 10 characters (10 bits), BIN2OCT returns the #NUM! error value.
+ * Or can be an array of values
+ * @param null|array|float|int|string $places The number of characters to use. If places is omitted, BIN2OCT uses the
+ * minimum number of characters necessary. Places is useful for padding the
+ * return value with leading 0s (zeros).
+ * If places is not an integer, it is truncated.
+ * If places is nonnumeric, BIN2OCT returns the #VALUE! error value.
+ * If places is negative, BIN2OCT returns the #NUM! error value.
+ * Or can be an array of values
+ *
+ * @return array|string Result, or an error
+ * If an array of numbers is passed as an argument, then the returned result will also be an array
+ * with the same dimensions
+ */
+ public static function toOctal($value, $places = null): array|string
+ {
+ if (is_array($value) || is_array($places)) {
+ return self::evaluateArrayArguments([self::class, __FUNCTION__], $value, $places);
+ }
+
+ try {
+ $value = self::validateValue($value);
+ $value = self::validateBinary($value);
+ $places = self::validatePlaces($places);
+ } catch (Exception $e) {
+ return $e->getMessage();
+ }
+
+ if (strlen($value) == 10 && $value[0] === '1') { // Two's Complement
+ return str_repeat('7', 6) . strtoupper(decoct((int) bindec("11$value")));
+ }
+ $octVal = (string) decoct((int) bindec($value));
+
+ return self::nbrConversionFormat($octVal, $places);
+ }
+
+ protected static function validateBinary(string $value): string
+ {
+ if ((strlen($value) > preg_match_all('/[01]/', $value)) || (strlen($value) > 10)) {
+ throw new Exception(ExcelError::NAN());
+ }
+
+ return $value;
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/ConvertDecimal.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/ConvertDecimal.php
new file mode 100644
index 0000000..923caa9
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/ConvertDecimal.php
@@ -0,0 +1,213 @@
+ 511, DEC2BIN returns the #NUM! error
+ * value.
+ * If number is nonnumeric, DEC2BIN returns the #VALUE! error value.
+ * If DEC2BIN requires more than places characters, it returns the #NUM!
+ * error value.
+ * Or can be an array of values
+ * @param null|array|float|int|string $places The number of characters to use. If places is omitted, DEC2BIN uses
+ * the minimum number of characters necessary. Places is useful for
+ * padding the return value with leading 0s (zeros).
+ * If places is not an integer, it is truncated.
+ * If places is nonnumeric, DEC2BIN returns the #VALUE! error value.
+ * If places is zero or negative, DEC2BIN returns the #NUM! error value.
+ * Or can be an array of values
+ *
+ * @return array|string Result, or an error
+ * If an array of numbers is passed as an argument, then the returned result will also be an array
+ * with the same dimensions
+ */
+ public static function toBinary($value, $places = null): array|string
+ {
+ if (is_array($value) || is_array($places)) {
+ return self::evaluateArrayArguments([self::class, __FUNCTION__], $value, $places);
+ }
+
+ try {
+ $value = self::validateValue($value);
+ $value = self::validateDecimal($value);
+ $places = self::validatePlaces($places);
+ } catch (Exception $e) {
+ return $e->getMessage();
+ }
+
+ $value = (int) floor((float) $value);
+ if ($value > self::LARGEST_BINARY_IN_DECIMAL || $value < self::SMALLEST_BINARY_IN_DECIMAL) {
+ return ExcelError::NAN();
+ }
+
+ $r = decbin($value);
+ // Two's Complement
+ $r = substr($r, -10);
+
+ return self::nbrConversionFormat($r, $places);
+ }
+
+ /**
+ * toHex.
+ *
+ * Return a decimal value as hex.
+ *
+ * Excel Function:
+ * DEC2HEX(x[,places])
+ *
+ * @param array|bool|float|int|string $value The decimal integer you want to convert. If number is negative,
+ * places is ignored and DEC2HEX returns a 10-character (40-bit)
+ * hexadecimal number in which the most significant bit is the sign
+ * bit. The remaining 39 bits are magnitude bits. Negative numbers
+ * are represented using two's-complement notation.
+ * If number < -549,755,813,888 or if number > 549,755,813,887,
+ * DEC2HEX returns the #NUM! error value.
+ * If number is nonnumeric, DEC2HEX returns the #VALUE! error value.
+ * If DEC2HEX requires more than places characters, it returns the
+ * #NUM! error value.
+ * Or can be an array of values
+ * @param null|array|float|int|string $places The number of characters to use. If places is omitted, DEC2HEX uses
+ * the minimum number of characters necessary. Places is useful for
+ * padding the return value with leading 0s (zeros).
+ * If places is not an integer, it is truncated.
+ * If places is nonnumeric, DEC2HEX returns the #VALUE! error value.
+ * If places is zero or negative, DEC2HEX returns the #NUM! error value.
+ * Or can be an array of values
+ *
+ * @return array|string Result, or an error
+ * If an array of numbers is passed as an argument, then the returned result will also be an array
+ * with the same dimensions
+ */
+ public static function toHex($value, $places = null): array|string
+ {
+ if (is_array($value) || is_array($places)) {
+ return self::evaluateArrayArguments([self::class, __FUNCTION__], $value, $places);
+ }
+
+ try {
+ $value = self::validateValue($value);
+ $value = self::validateDecimal($value);
+ $places = self::validatePlaces($places);
+ } catch (Exception $e) {
+ return $e->getMessage();
+ }
+
+ $value = floor((float) $value);
+ if ($value > self::LARGEST_HEX_IN_DECIMAL || $value < self::SMALLEST_HEX_IN_DECIMAL) {
+ return ExcelError::NAN();
+ }
+ $r = strtoupper(dechex((int) $value));
+ $r = self::hex32bit($value, $r);
+
+ return self::nbrConversionFormat($r, $places);
+ }
+
+ public static function hex32bit(float $value, string $hexstr, bool $force = false): string
+ {
+ if (PHP_INT_SIZE === 4 || $force) {
+ if ($value >= 2 ** 32) {
+ $quotient = (int) ($value / (2 ** 32));
+
+ return strtoupper(substr('0' . dechex($quotient), -2) . $hexstr);
+ }
+ if ($value < -(2 ** 32)) {
+ $quotient = 256 - (int) ceil((-$value) / (2 ** 32));
+
+ return strtoupper(substr('0' . dechex($quotient), -2) . substr("00000000$hexstr", -8));
+ }
+ if ($value < 0) {
+ return "FF$hexstr";
+ }
+ }
+
+ return $hexstr;
+ }
+
+ /**
+ * toOctal.
+ *
+ * Return an decimal value as octal.
+ *
+ * Excel Function:
+ * DEC2OCT(x[,places])
+ *
+ * @param array|bool|float|int|string $value The decimal integer you want to convert. If number is negative,
+ * places is ignored and DEC2OCT returns a 10-character (30-bit)
+ * octal number in which the most significant bit is the sign bit.
+ * The remaining 29 bits are magnitude bits. Negative numbers are
+ * represented using two's-complement notation.
+ * If number < -536,870,912 or if number > 536,870,911, DEC2OCT
+ * returns the #NUM! error value.
+ * If number is nonnumeric, DEC2OCT returns the #VALUE! error value.
+ * If DEC2OCT requires more than places characters, it returns the
+ * #NUM! error value.
+ * Or can be an array of values
+ * @param array|int $places The number of characters to use. If places is omitted, DEC2OCT uses
+ * the minimum number of characters necessary. Places is useful for
+ * padding the return value with leading 0s (zeros).
+ * If places is not an integer, it is truncated.
+ * If places is nonnumeric, DEC2OCT returns the #VALUE! error value.
+ * If places is zero or negative, DEC2OCT returns the #NUM! error value.
+ * Or can be an array of values
+ *
+ * @return array|string Result, or an error
+ * If an array of numbers is passed as an argument, then the returned result will also be an array
+ * with the same dimensions
+ */
+ public static function toOctal($value, $places = null): array|string
+ {
+ if (is_array($value) || is_array($places)) {
+ return self::evaluateArrayArguments([self::class, __FUNCTION__], $value, $places);
+ }
+
+ try {
+ $value = self::validateValue($value);
+ $value = self::validateDecimal($value);
+ $places = self::validatePlaces($places);
+ } catch (Exception $e) {
+ return $e->getMessage();
+ }
+
+ $value = (int) floor((float) $value);
+ if ($value > self::LARGEST_OCTAL_IN_DECIMAL || $value < self::SMALLEST_OCTAL_IN_DECIMAL) {
+ return ExcelError::NAN();
+ }
+ $r = decoct($value);
+ $r = substr($r, -10);
+
+ return self::nbrConversionFormat($r, $places);
+ }
+
+ protected static function validateDecimal(string $value): string
+ {
+ if (strlen($value) > preg_match_all('/[-0123456789.]/', $value)) {
+ throw new Exception(ExcelError::VALUE());
+ }
+
+ return $value;
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/ConvertHex.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/ConvertHex.php
new file mode 100644
index 0000000..0003a9f
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/ConvertHex.php
@@ -0,0 +1,175 @@
+getMessage();
+ }
+
+ $dec = self::toDecimal($value);
+
+ return ConvertDecimal::toBinary($dec, $places);
+ }
+
+ /**
+ * toDecimal.
+ *
+ * Return a hex value as decimal.
+ *
+ * Excel Function:
+ * HEX2DEC(x)
+ *
+ * @param array|bool|float|int|string $value The hexadecimal number you want to convert. This number cannot
+ * contain more than 10 characters (40 bits). The most significant
+ * bit of number is the sign bit. The remaining 39 bits are magnitude
+ * bits. Negative numbers are represented using two's-complement
+ * notation.
+ * If number is not a valid hexadecimal number, HEX2DEC returns the
+ * #NUM! error value.
+ * Or can be an array of values
+ *
+ * @return array|string Result, or an error
+ * If an array of numbers is passed as an argument, then the returned result will also be an array
+ * with the same dimensions
+ */
+ public static function toDecimal($value)
+ {
+ if (is_array($value)) {
+ return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $value);
+ }
+
+ try {
+ $value = self::validateValue($value);
+ $value = self::validateHex($value);
+ } catch (Exception $e) {
+ return $e->getMessage();
+ }
+
+ if (strlen($value) > 10) {
+ return ExcelError::NAN();
+ }
+
+ $binX = '';
+ foreach (str_split($value) as $char) {
+ $binX .= str_pad(base_convert($char, 16, 2), 4, '0', STR_PAD_LEFT);
+ }
+ if (strlen($binX) == 40 && $binX[0] == '1') {
+ for ($i = 0; $i < 40; ++$i) {
+ $binX[$i] = ($binX[$i] == '1' ? '0' : '1');
+ }
+
+ return (string) ((bindec($binX) + 1) * -1);
+ }
+
+ return (string) bindec($binX);
+ }
+
+ /**
+ * toOctal.
+ *
+ * Return a hex value as octal.
+ *
+ * Excel Function:
+ * HEX2OCT(x[,places])
+ *
+ * @param array|bool|float|int|string $value The hexadecimal number you want to convert. Number cannot
+ * contain more than 10 characters. The most significant bit of
+ * number is the sign bit. The remaining 39 bits are magnitude
+ * bits. Negative numbers are represented using two's-complement
+ * notation.
+ * If number is negative, HEX2OCT ignores places and returns a
+ * 10-character octal number.
+ * If number is negative, it cannot be less than FFE0000000, and
+ * if number is positive, it cannot be greater than 1FFFFFFF.
+ * If number is not a valid hexadecimal number, HEX2OCT returns
+ * the #NUM! error value.
+ * If HEX2OCT requires more than places characters, it returns
+ * the #NUM! error value.
+ * Or can be an array of values
+ * @param array|int $places The number of characters to use. If places is omitted, HEX2OCT
+ * uses the minimum number of characters necessary. Places is
+ * useful for padding the return value with leading 0s (zeros).
+ * If places is not an integer, it is truncated.
+ * If places is nonnumeric, HEX2OCT returns the #VALUE! error
+ * value.
+ * If places is negative, HEX2OCT returns the #NUM! error value.
+ * Or can be an array of values
+ *
+ * @return array|string Result, or an error
+ * If an array of numbers is passed as an argument, then the returned result will also be an array
+ * with the same dimensions
+ */
+ public static function toOctal($value, $places = null): array|string
+ {
+ if (is_array($value) || is_array($places)) {
+ return self::evaluateArrayArguments([self::class, __FUNCTION__], $value, $places);
+ }
+
+ try {
+ $value = self::validateValue($value);
+ $value = self::validateHex($value);
+ $places = self::validatePlaces($places);
+ } catch (Exception $e) {
+ return $e->getMessage();
+ }
+
+ $decimal = self::toDecimal($value);
+
+ return ConvertDecimal::toOctal($decimal, $places);
+ }
+
+ protected static function validateHex(string $value): string
+ {
+ if (strlen($value) > preg_match_all('/[0123456789ABCDEF]/', $value)) {
+ throw new Exception(ExcelError::NAN());
+ }
+
+ return $value;
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/ConvertOctal.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/ConvertOctal.php
new file mode 100644
index 0000000..5e3c124
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/ConvertOctal.php
@@ -0,0 +1,174 @@
+getMessage();
+ }
+
+ return ConvertDecimal::toBinary(self::toDecimal($value), $places);
+ }
+
+ /**
+ * toDecimal.
+ *
+ * Return an octal value as decimal.
+ *
+ * Excel Function:
+ * OCT2DEC(x)
+ *
+ * @param array|bool|float|int|string $value The octal number you want to convert. Number may not contain
+ * more than 10 octal characters (30 bits). The most significant
+ * bit of number is the sign bit. The remaining 29 bits are
+ * magnitude bits. Negative numbers are represented using
+ * two's-complement notation.
+ * If number is not a valid octal number, OCT2DEC returns the
+ * #NUM! error value.
+ * Or can be an array of values
+ *
+ * @return array|string Result, or an error
+ * If an array of numbers is passed as an argument, then the returned result will also be an array
+ * with the same dimensions
+ */
+ public static function toDecimal($value)
+ {
+ if (is_array($value)) {
+ return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $value);
+ }
+
+ try {
+ $value = self::validateValue($value);
+ $value = self::validateOctal($value);
+ } catch (Exception $e) {
+ return $e->getMessage();
+ }
+
+ $binX = '';
+ foreach (str_split($value) as $char) {
+ $binX .= str_pad(decbin((int) $char), 3, '0', STR_PAD_LEFT);
+ }
+ if (strlen($binX) == 30 && $binX[0] == '1') {
+ for ($i = 0; $i < 30; ++$i) {
+ $binX[$i] = ($binX[$i] == '1' ? '0' : '1');
+ }
+
+ return (string) ((bindec($binX) + 1) * -1);
+ }
+
+ return (string) bindec($binX);
+ }
+
+ /**
+ * toHex.
+ *
+ * Return an octal value as hex.
+ *
+ * Excel Function:
+ * OCT2HEX(x[,places])
+ *
+ * @param array|bool|float|int|string $value The octal number you want to convert. Number may not contain
+ * more than 10 octal characters (30 bits). The most significant
+ * bit of number is the sign bit. The remaining 29 bits are
+ * magnitude bits. Negative numbers are represented using
+ * two's-complement notation.
+ * If number is negative, OCT2HEX ignores places and returns a
+ * 10-character hexadecimal number.
+ * If number is not a valid octal number, OCT2HEX returns the
+ * #NUM! error value.
+ * If OCT2HEX requires more than places characters, it returns
+ * the #NUM! error value.
+ * Or can be an array of values
+ * @param array|int $places The number of characters to use. If places is omitted, OCT2HEX
+ * uses the minimum number of characters necessary. Places is useful
+ * for padding the return value with leading 0s (zeros).
+ * If places is not an integer, it is truncated.
+ * If places is nonnumeric, OCT2HEX returns the #VALUE! error value.
+ * If places is negative, OCT2HEX returns the #NUM! error value.
+ * Or can be an array of values
+ *
+ * @return array|string Result, or an error
+ * If an array of numbers is passed as an argument, then the returned result will also be an array
+ * with the same dimensions
+ */
+ public static function toHex($value, $places = null): array|string
+ {
+ if (is_array($value) || is_array($places)) {
+ return self::evaluateArrayArguments([self::class, __FUNCTION__], $value, $places);
+ }
+
+ try {
+ $value = self::validateValue($value);
+ $value = self::validateOctal($value);
+ $places = self::validatePlaces($places);
+ } catch (Exception $e) {
+ return $e->getMessage();
+ }
+
+ $hexVal = strtoupper(dechex((int) self::toDecimal($value)));
+ $hexVal = (PHP_INT_SIZE === 4 && strlen($value) === 10 && $value[0] >= '4') ? "FF{$hexVal}" : $hexVal;
+
+ return self::nbrConversionFormat($hexVal, $places);
+ }
+
+ protected static function validateOctal(string $value): string
+ {
+ $numDigits = (int) preg_match_all('/[01234567]/', $value);
+ if (strlen($value) > $numDigits || $numDigits > 10) {
+ throw new Exception(ExcelError::NAN());
+ }
+
+ return $value;
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/ConvertUOM.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/ConvertUOM.php
new file mode 100644
index 0000000..969c270
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/ConvertUOM.php
@@ -0,0 +1,679 @@
+
+ */
+ private static array $conversionUnits = [
+ // Weight and Mass
+ 'g' => ['Group' => self::CATEGORY_WEIGHT_AND_MASS, 'UnitName' => 'Gram', 'AllowPrefix' => true],
+ 'sg' => ['Group' => self::CATEGORY_WEIGHT_AND_MASS, 'UnitName' => 'Slug', 'AllowPrefix' => false],
+ 'lbm' => ['Group' => self::CATEGORY_WEIGHT_AND_MASS, 'UnitName' => 'Pound mass (avoirdupois)', 'AllowPrefix' => false],
+ 'u' => ['Group' => self::CATEGORY_WEIGHT_AND_MASS, 'UnitName' => 'U (atomic mass unit)', 'AllowPrefix' => true],
+ 'ozm' => ['Group' => self::CATEGORY_WEIGHT_AND_MASS, 'UnitName' => 'Ounce mass (avoirdupois)', 'AllowPrefix' => false],
+ 'grain' => ['Group' => self::CATEGORY_WEIGHT_AND_MASS, 'UnitName' => 'Grain', 'AllowPrefix' => false],
+ 'cwt' => ['Group' => self::CATEGORY_WEIGHT_AND_MASS, 'UnitName' => 'U.S. (short) hundredweight', 'AllowPrefix' => false],
+ 'shweight' => ['Group' => self::CATEGORY_WEIGHT_AND_MASS, 'UnitName' => 'U.S. (short) hundredweight', 'AllowPrefix' => false],
+ 'uk_cwt' => ['Group' => self::CATEGORY_WEIGHT_AND_MASS, 'UnitName' => 'Imperial hundredweight', 'AllowPrefix' => false],
+ 'lcwt' => ['Group' => self::CATEGORY_WEIGHT_AND_MASS, 'UnitName' => 'Imperial hundredweight', 'AllowPrefix' => false],
+ 'hweight' => ['Group' => self::CATEGORY_WEIGHT_AND_MASS, 'UnitName' => 'Imperial hundredweight', 'AllowPrefix' => false],
+ 'stone' => ['Group' => self::CATEGORY_WEIGHT_AND_MASS, 'UnitName' => 'Stone', 'AllowPrefix' => false],
+ 'ton' => ['Group' => self::CATEGORY_WEIGHT_AND_MASS, 'UnitName' => 'Ton', 'AllowPrefix' => false],
+ 'uk_ton' => ['Group' => self::CATEGORY_WEIGHT_AND_MASS, 'UnitName' => 'Imperial ton', 'AllowPrefix' => false],
+ 'LTON' => ['Group' => self::CATEGORY_WEIGHT_AND_MASS, 'UnitName' => 'Imperial ton', 'AllowPrefix' => false],
+ 'brton' => ['Group' => self::CATEGORY_WEIGHT_AND_MASS, 'UnitName' => 'Imperial ton', 'AllowPrefix' => false],
+ // Distance
+ 'm' => ['Group' => self::CATEGORY_DISTANCE, 'UnitName' => 'Meter', 'AllowPrefix' => true],
+ 'mi' => ['Group' => self::CATEGORY_DISTANCE, 'UnitName' => 'Statute mile', 'AllowPrefix' => false],
+ 'Nmi' => ['Group' => self::CATEGORY_DISTANCE, 'UnitName' => 'Nautical mile', 'AllowPrefix' => false],
+ 'in' => ['Group' => self::CATEGORY_DISTANCE, 'UnitName' => 'Inch', 'AllowPrefix' => false],
+ 'ft' => ['Group' => self::CATEGORY_DISTANCE, 'UnitName' => 'Foot', 'AllowPrefix' => false],
+ 'yd' => ['Group' => self::CATEGORY_DISTANCE, 'UnitName' => 'Yard', 'AllowPrefix' => false],
+ 'ang' => ['Group' => self::CATEGORY_DISTANCE, 'UnitName' => 'Angstrom', 'AllowPrefix' => true],
+ 'ell' => ['Group' => self::CATEGORY_DISTANCE, 'UnitName' => 'Ell', 'AllowPrefix' => false],
+ 'ly' => ['Group' => self::CATEGORY_DISTANCE, 'UnitName' => 'Light Year', 'AllowPrefix' => false],
+ 'parsec' => ['Group' => self::CATEGORY_DISTANCE, 'UnitName' => 'Parsec', 'AllowPrefix' => false],
+ 'pc' => ['Group' => self::CATEGORY_DISTANCE, 'UnitName' => 'Parsec', 'AllowPrefix' => false],
+ 'Pica' => ['Group' => self::CATEGORY_DISTANCE, 'UnitName' => 'Pica (1/72 in)', 'AllowPrefix' => false],
+ 'Picapt' => ['Group' => self::CATEGORY_DISTANCE, 'UnitName' => 'Pica (1/72 in)', 'AllowPrefix' => false],
+ 'pica' => ['Group' => self::CATEGORY_DISTANCE, 'UnitName' => 'Pica (1/6 in)', 'AllowPrefix' => false],
+ 'survey_mi' => ['Group' => self::CATEGORY_DISTANCE, 'UnitName' => 'U.S survey mile (statute mile)', 'AllowPrefix' => false],
+ // Time
+ 'yr' => ['Group' => self::CATEGORY_TIME, 'UnitName' => 'Year', 'AllowPrefix' => false],
+ 'day' => ['Group' => self::CATEGORY_TIME, 'UnitName' => 'Day', 'AllowPrefix' => false],
+ 'd' => ['Group' => self::CATEGORY_TIME, 'UnitName' => 'Day', 'AllowPrefix' => false],
+ 'hr' => ['Group' => self::CATEGORY_TIME, 'UnitName' => 'Hour', 'AllowPrefix' => false],
+ 'mn' => ['Group' => self::CATEGORY_TIME, 'UnitName' => 'Minute', 'AllowPrefix' => false],
+ 'min' => ['Group' => self::CATEGORY_TIME, 'UnitName' => 'Minute', 'AllowPrefix' => false],
+ 'sec' => ['Group' => self::CATEGORY_TIME, 'UnitName' => 'Second', 'AllowPrefix' => true],
+ 's' => ['Group' => self::CATEGORY_TIME, 'UnitName' => 'Second', 'AllowPrefix' => true],
+ // Pressure
+ 'Pa' => ['Group' => self::CATEGORY_PRESSURE, 'UnitName' => 'Pascal', 'AllowPrefix' => true],
+ 'p' => ['Group' => self::CATEGORY_PRESSURE, 'UnitName' => 'Pascal', 'AllowPrefix' => true],
+ 'atm' => ['Group' => self::CATEGORY_PRESSURE, 'UnitName' => 'Atmosphere', 'AllowPrefix' => true],
+ 'at' => ['Group' => self::CATEGORY_PRESSURE, 'UnitName' => 'Atmosphere', 'AllowPrefix' => true],
+ 'mmHg' => ['Group' => self::CATEGORY_PRESSURE, 'UnitName' => 'mm of Mercury', 'AllowPrefix' => true],
+ 'psi' => ['Group' => self::CATEGORY_PRESSURE, 'UnitName' => 'PSI', 'AllowPrefix' => true],
+ 'Torr' => ['Group' => self::CATEGORY_PRESSURE, 'UnitName' => 'Torr', 'AllowPrefix' => true],
+ // Force
+ 'N' => ['Group' => self::CATEGORY_FORCE, 'UnitName' => 'Newton', 'AllowPrefix' => true],
+ 'dyn' => ['Group' => self::CATEGORY_FORCE, 'UnitName' => 'Dyne', 'AllowPrefix' => true],
+ 'dy' => ['Group' => self::CATEGORY_FORCE, 'UnitName' => 'Dyne', 'AllowPrefix' => true],
+ 'lbf' => ['Group' => self::CATEGORY_FORCE, 'UnitName' => 'Pound force', 'AllowPrefix' => false],
+ 'pond' => ['Group' => self::CATEGORY_FORCE, 'UnitName' => 'Pond', 'AllowPrefix' => true],
+ // Energy
+ 'J' => ['Group' => self::CATEGORY_ENERGY, 'UnitName' => 'Joule', 'AllowPrefix' => true],
+ 'e' => ['Group' => self::CATEGORY_ENERGY, 'UnitName' => 'Erg', 'AllowPrefix' => true],
+ 'c' => ['Group' => self::CATEGORY_ENERGY, 'UnitName' => 'Thermodynamic calorie', 'AllowPrefix' => true],
+ 'cal' => ['Group' => self::CATEGORY_ENERGY, 'UnitName' => 'IT calorie', 'AllowPrefix' => true],
+ 'eV' => ['Group' => self::CATEGORY_ENERGY, 'UnitName' => 'Electron volt', 'AllowPrefix' => true],
+ 'ev' => ['Group' => self::CATEGORY_ENERGY, 'UnitName' => 'Electron volt', 'AllowPrefix' => true],
+ 'HPh' => ['Group' => self::CATEGORY_ENERGY, 'UnitName' => 'Horsepower-hour', 'AllowPrefix' => false],
+ 'hh' => ['Group' => self::CATEGORY_ENERGY, 'UnitName' => 'Horsepower-hour', 'AllowPrefix' => false],
+ 'Wh' => ['Group' => self::CATEGORY_ENERGY, 'UnitName' => 'Watt-hour', 'AllowPrefix' => true],
+ 'wh' => ['Group' => self::CATEGORY_ENERGY, 'UnitName' => 'Watt-hour', 'AllowPrefix' => true],
+ 'flb' => ['Group' => self::CATEGORY_ENERGY, 'UnitName' => 'Foot-pound', 'AllowPrefix' => false],
+ 'BTU' => ['Group' => self::CATEGORY_ENERGY, 'UnitName' => 'BTU', 'AllowPrefix' => false],
+ 'btu' => ['Group' => self::CATEGORY_ENERGY, 'UnitName' => 'BTU', 'AllowPrefix' => false],
+ // Power
+ 'HP' => ['Group' => self::CATEGORY_POWER, 'UnitName' => 'Horsepower', 'AllowPrefix' => false],
+ 'h' => ['Group' => self::CATEGORY_POWER, 'UnitName' => 'Horsepower', 'AllowPrefix' => false],
+ 'W' => ['Group' => self::CATEGORY_POWER, 'UnitName' => 'Watt', 'AllowPrefix' => true],
+ 'w' => ['Group' => self::CATEGORY_POWER, 'UnitName' => 'Watt', 'AllowPrefix' => true],
+ 'PS' => ['Group' => self::CATEGORY_POWER, 'UnitName' => 'Pferdestärke', 'AllowPrefix' => false],
+ // Magnetism
+ 'T' => ['Group' => self::CATEGORY_MAGNETISM, 'UnitName' => 'Tesla', 'AllowPrefix' => true],
+ 'ga' => ['Group' => self::CATEGORY_MAGNETISM, 'UnitName' => 'Gauss', 'AllowPrefix' => true],
+ // Temperature
+ 'C' => ['Group' => self::CATEGORY_TEMPERATURE, 'UnitName' => 'Degrees Celsius', 'AllowPrefix' => false],
+ 'cel' => ['Group' => self::CATEGORY_TEMPERATURE, 'UnitName' => 'Degrees Celsius', 'AllowPrefix' => false],
+ 'F' => ['Group' => self::CATEGORY_TEMPERATURE, 'UnitName' => 'Degrees Fahrenheit', 'AllowPrefix' => false],
+ 'fah' => ['Group' => self::CATEGORY_TEMPERATURE, 'UnitName' => 'Degrees Fahrenheit', 'AllowPrefix' => false],
+ 'K' => ['Group' => self::CATEGORY_TEMPERATURE, 'UnitName' => 'Kelvin', 'AllowPrefix' => false],
+ 'kel' => ['Group' => self::CATEGORY_TEMPERATURE, 'UnitName' => 'Kelvin', 'AllowPrefix' => false],
+ 'Rank' => ['Group' => self::CATEGORY_TEMPERATURE, 'UnitName' => 'Degrees Rankine', 'AllowPrefix' => false],
+ 'Reau' => ['Group' => self::CATEGORY_TEMPERATURE, 'UnitName' => 'Degrees Réaumur', 'AllowPrefix' => false],
+ // Volume
+ 'l' => ['Group' => self::CATEGORY_VOLUME, 'UnitName' => 'Litre', 'AllowPrefix' => true],
+ 'L' => ['Group' => self::CATEGORY_VOLUME, 'UnitName' => 'Litre', 'AllowPrefix' => true],
+ 'lt' => ['Group' => self::CATEGORY_VOLUME, 'UnitName' => 'Litre', 'AllowPrefix' => true],
+ 'tsp' => ['Group' => self::CATEGORY_VOLUME, 'UnitName' => 'Teaspoon', 'AllowPrefix' => false],
+ 'tspm' => ['Group' => self::CATEGORY_VOLUME, 'UnitName' => 'Modern Teaspoon', 'AllowPrefix' => false],
+ 'tbs' => ['Group' => self::CATEGORY_VOLUME, 'UnitName' => 'Tablespoon', 'AllowPrefix' => false],
+ 'oz' => ['Group' => self::CATEGORY_VOLUME, 'UnitName' => 'Fluid Ounce', 'AllowPrefix' => false],
+ 'cup' => ['Group' => self::CATEGORY_VOLUME, 'UnitName' => 'Cup', 'AllowPrefix' => false],
+ 'pt' => ['Group' => self::CATEGORY_VOLUME, 'UnitName' => 'U.S. Pint', 'AllowPrefix' => false],
+ 'us_pt' => ['Group' => self::CATEGORY_VOLUME, 'UnitName' => 'U.S. Pint', 'AllowPrefix' => false],
+ 'uk_pt' => ['Group' => self::CATEGORY_VOLUME, 'UnitName' => 'U.K. Pint', 'AllowPrefix' => false],
+ 'qt' => ['Group' => self::CATEGORY_VOLUME, 'UnitName' => 'Quart', 'AllowPrefix' => false],
+ 'uk_qt' => ['Group' => self::CATEGORY_VOLUME, 'UnitName' => 'Imperial Quart (UK)', 'AllowPrefix' => false],
+ 'gal' => ['Group' => self::CATEGORY_VOLUME, 'UnitName' => 'Gallon', 'AllowPrefix' => false],
+ 'uk_gal' => ['Group' => self::CATEGORY_VOLUME, 'UnitName' => 'Imperial Gallon (UK)', 'AllowPrefix' => false],
+ 'ang3' => ['Group' => self::CATEGORY_VOLUME, 'UnitName' => 'Cubic Angstrom', 'AllowPrefix' => true],
+ 'ang^3' => ['Group' => self::CATEGORY_VOLUME, 'UnitName' => 'Cubic Angstrom', 'AllowPrefix' => true],
+ 'barrel' => ['Group' => self::CATEGORY_VOLUME, 'UnitName' => 'US Oil Barrel', 'AllowPrefix' => false],
+ 'bushel' => ['Group' => self::CATEGORY_VOLUME, 'UnitName' => 'US Bushel', 'AllowPrefix' => false],
+ 'in3' => ['Group' => self::CATEGORY_VOLUME, 'UnitName' => 'Cubic Inch', 'AllowPrefix' => false],
+ 'in^3' => ['Group' => self::CATEGORY_VOLUME, 'UnitName' => 'Cubic Inch', 'AllowPrefix' => false],
+ 'ft3' => ['Group' => self::CATEGORY_VOLUME, 'UnitName' => 'Cubic Foot', 'AllowPrefix' => false],
+ 'ft^3' => ['Group' => self::CATEGORY_VOLUME, 'UnitName' => 'Cubic Foot', 'AllowPrefix' => false],
+ 'ly3' => ['Group' => self::CATEGORY_VOLUME, 'UnitName' => 'Cubic Light Year', 'AllowPrefix' => false],
+ 'ly^3' => ['Group' => self::CATEGORY_VOLUME, 'UnitName' => 'Cubic Light Year', 'AllowPrefix' => false],
+ 'm3' => ['Group' => self::CATEGORY_VOLUME, 'UnitName' => 'Cubic Meter', 'AllowPrefix' => true],
+ 'm^3' => ['Group' => self::CATEGORY_VOLUME, 'UnitName' => 'Cubic Meter', 'AllowPrefix' => true],
+ 'mi3' => ['Group' => self::CATEGORY_VOLUME, 'UnitName' => 'Cubic Mile', 'AllowPrefix' => false],
+ 'mi^3' => ['Group' => self::CATEGORY_VOLUME, 'UnitName' => 'Cubic Mile', 'AllowPrefix' => false],
+ 'yd3' => ['Group' => self::CATEGORY_VOLUME, 'UnitName' => 'Cubic Yard', 'AllowPrefix' => false],
+ 'yd^3' => ['Group' => self::CATEGORY_VOLUME, 'UnitName' => 'Cubic Yard', 'AllowPrefix' => false],
+ 'Nmi3' => ['Group' => self::CATEGORY_VOLUME, 'UnitName' => 'Cubic Nautical Mile', 'AllowPrefix' => false],
+ 'Nmi^3' => ['Group' => self::CATEGORY_VOLUME, 'UnitName' => 'Cubic Nautical Mile', 'AllowPrefix' => false],
+ 'Pica3' => ['Group' => self::CATEGORY_VOLUME, 'UnitName' => 'Cubic Pica', 'AllowPrefix' => false],
+ 'Pica^3' => ['Group' => self::CATEGORY_VOLUME, 'UnitName' => 'Cubic Pica', 'AllowPrefix' => false],
+ 'Picapt3' => ['Group' => self::CATEGORY_VOLUME, 'UnitName' => 'Cubic Pica', 'AllowPrefix' => false],
+ 'Picapt^3' => ['Group' => self::CATEGORY_VOLUME, 'UnitName' => 'Cubic Pica', 'AllowPrefix' => false],
+ 'GRT' => ['Group' => self::CATEGORY_VOLUME, 'UnitName' => 'Gross Registered Ton', 'AllowPrefix' => false],
+ 'regton' => ['Group' => self::CATEGORY_VOLUME, 'UnitName' => 'Gross Registered Ton', 'AllowPrefix' => false],
+ 'MTON' => ['Group' => self::CATEGORY_VOLUME, 'UnitName' => 'Measurement Ton (Freight Ton)', 'AllowPrefix' => false],
+ // Area
+ 'ha' => ['Group' => self::CATEGORY_AREA, 'UnitName' => 'Hectare', 'AllowPrefix' => true],
+ 'uk_acre' => ['Group' => self::CATEGORY_AREA, 'UnitName' => 'International Acre', 'AllowPrefix' => false],
+ 'us_acre' => ['Group' => self::CATEGORY_AREA, 'UnitName' => 'US Survey/Statute Acre', 'AllowPrefix' => false],
+ 'ang2' => ['Group' => self::CATEGORY_AREA, 'UnitName' => 'Square Angstrom', 'AllowPrefix' => true],
+ 'ang^2' => ['Group' => self::CATEGORY_AREA, 'UnitName' => 'Square Angstrom', 'AllowPrefix' => true],
+ 'ar' => ['Group' => self::CATEGORY_AREA, 'UnitName' => 'Are', 'AllowPrefix' => true],
+ 'ft2' => ['Group' => self::CATEGORY_AREA, 'UnitName' => 'Square Feet', 'AllowPrefix' => false],
+ 'ft^2' => ['Group' => self::CATEGORY_AREA, 'UnitName' => 'Square Feet', 'AllowPrefix' => false],
+ 'in2' => ['Group' => self::CATEGORY_AREA, 'UnitName' => 'Square Inches', 'AllowPrefix' => false],
+ 'in^2' => ['Group' => self::CATEGORY_AREA, 'UnitName' => 'Square Inches', 'AllowPrefix' => false],
+ 'ly2' => ['Group' => self::CATEGORY_AREA, 'UnitName' => 'Square Light Years', 'AllowPrefix' => false],
+ 'ly^2' => ['Group' => self::CATEGORY_AREA, 'UnitName' => 'Square Light Years', 'AllowPrefix' => false],
+ 'm2' => ['Group' => self::CATEGORY_AREA, 'UnitName' => 'Square Meters', 'AllowPrefix' => true],
+ 'm^2' => ['Group' => self::CATEGORY_AREA, 'UnitName' => 'Square Meters', 'AllowPrefix' => true],
+ 'Morgen' => ['Group' => self::CATEGORY_AREA, 'UnitName' => 'Morgen', 'AllowPrefix' => false],
+ 'mi2' => ['Group' => self::CATEGORY_AREA, 'UnitName' => 'Square Miles', 'AllowPrefix' => false],
+ 'mi^2' => ['Group' => self::CATEGORY_AREA, 'UnitName' => 'Square Miles', 'AllowPrefix' => false],
+ 'Nmi2' => ['Group' => self::CATEGORY_AREA, 'UnitName' => 'Square Nautical Miles', 'AllowPrefix' => false],
+ 'Nmi^2' => ['Group' => self::CATEGORY_AREA, 'UnitName' => 'Square Nautical Miles', 'AllowPrefix' => false],
+ 'Pica2' => ['Group' => self::CATEGORY_AREA, 'UnitName' => 'Square Pica', 'AllowPrefix' => false],
+ 'Pica^2' => ['Group' => self::CATEGORY_AREA, 'UnitName' => 'Square Pica', 'AllowPrefix' => false],
+ 'Picapt2' => ['Group' => self::CATEGORY_AREA, 'UnitName' => 'Square Pica', 'AllowPrefix' => false],
+ 'Picapt^2' => ['Group' => self::CATEGORY_AREA, 'UnitName' => 'Square Pica', 'AllowPrefix' => false],
+ 'yd2' => ['Group' => self::CATEGORY_AREA, 'UnitName' => 'Square Yards', 'AllowPrefix' => false],
+ 'yd^2' => ['Group' => self::CATEGORY_AREA, 'UnitName' => 'Square Yards', 'AllowPrefix' => false],
+ // Information
+ 'byte' => ['Group' => self::CATEGORY_INFORMATION, 'UnitName' => 'Byte', 'AllowPrefix' => true],
+ 'bit' => ['Group' => self::CATEGORY_INFORMATION, 'UnitName' => 'Bit', 'AllowPrefix' => true],
+ // Speed
+ 'm/s' => ['Group' => self::CATEGORY_SPEED, 'UnitName' => 'Meters per second', 'AllowPrefix' => true],
+ 'm/sec' => ['Group' => self::CATEGORY_SPEED, 'UnitName' => 'Meters per second', 'AllowPrefix' => true],
+ 'm/h' => ['Group' => self::CATEGORY_SPEED, 'UnitName' => 'Meters per hour', 'AllowPrefix' => true],
+ 'm/hr' => ['Group' => self::CATEGORY_SPEED, 'UnitName' => 'Meters per hour', 'AllowPrefix' => true],
+ 'mph' => ['Group' => self::CATEGORY_SPEED, 'UnitName' => 'Miles per hour', 'AllowPrefix' => false],
+ 'admkn' => ['Group' => self::CATEGORY_SPEED, 'UnitName' => 'Admiralty Knot', 'AllowPrefix' => false],
+ 'kn' => ['Group' => self::CATEGORY_SPEED, 'UnitName' => 'Knot', 'AllowPrefix' => false],
+ ];
+
+ /**
+ * Details of the Multiplier prefixes that can be used with Units of Measure in CONVERTUOM().
+ *
+ * @var array
+ */
+ private static array $conversionMultipliers = [
+ 'Y' => ['multiplier' => 1E24, 'name' => 'yotta'],
+ 'Z' => ['multiplier' => 1E21, 'name' => 'zetta'],
+ 'E' => ['multiplier' => 1E18, 'name' => 'exa'],
+ 'P' => ['multiplier' => 1E15, 'name' => 'peta'],
+ 'T' => ['multiplier' => 1E12, 'name' => 'tera'],
+ 'G' => ['multiplier' => 1E9, 'name' => 'giga'],
+ 'M' => ['multiplier' => 1E6, 'name' => 'mega'],
+ 'k' => ['multiplier' => 1E3, 'name' => 'kilo'],
+ 'h' => ['multiplier' => 1E2, 'name' => 'hecto'],
+ 'e' => ['multiplier' => 1E1, 'name' => 'dekao'],
+ 'da' => ['multiplier' => 1E1, 'name' => 'dekao'],
+ 'd' => ['multiplier' => 1E-1, 'name' => 'deci'],
+ 'c' => ['multiplier' => 1E-2, 'name' => 'centi'],
+ 'm' => ['multiplier' => 1E-3, 'name' => 'milli'],
+ 'u' => ['multiplier' => 1E-6, 'name' => 'micro'],
+ 'n' => ['multiplier' => 1E-9, 'name' => 'nano'],
+ 'p' => ['multiplier' => 1E-12, 'name' => 'pico'],
+ 'f' => ['multiplier' => 1E-15, 'name' => 'femto'],
+ 'a' => ['multiplier' => 1E-18, 'name' => 'atto'],
+ 'z' => ['multiplier' => 1E-21, 'name' => 'zepto'],
+ 'y' => ['multiplier' => 1E-24, 'name' => 'yocto'],
+ ];
+
+ /**
+ * Details of the Multiplier prefixes that can be used with Units of Measure in CONVERTUOM().
+ *
+ ** @var array
+ */
+ private static array $binaryConversionMultipliers = [
+ 'Yi' => ['multiplier' => 2 ** 80, 'name' => 'yobi'],
+ 'Zi' => ['multiplier' => 2 ** 70, 'name' => 'zebi'],
+ 'Ei' => ['multiplier' => 2 ** 60, 'name' => 'exbi'],
+ 'Pi' => ['multiplier' => 2 ** 50, 'name' => 'pebi'],
+ 'Ti' => ['multiplier' => 2 ** 40, 'name' => 'tebi'],
+ 'Gi' => ['multiplier' => 2 ** 30, 'name' => 'gibi'],
+ 'Mi' => ['multiplier' => 2 ** 20, 'name' => 'mebi'],
+ 'ki' => ['multiplier' => 2 ** 10, 'name' => 'kibi'],
+ ];
+
+ /**
+ * Details of the Units of measure conversion factors, organised by group.
+ *
+ * @var array>
+ */
+ private static array $unitConversions = [
+ // Conversion uses gram (g) as an intermediate unit
+ self::CATEGORY_WEIGHT_AND_MASS => [
+ 'g' => 1.0,
+ 'sg' => 6.85217658567918E-05,
+ 'lbm' => 2.20462262184878E-03,
+ 'u' => 6.02214179421676E+23,
+ 'ozm' => 3.52739619495804E-02,
+ 'grain' => 1.54323583529414E+01,
+ 'cwt' => 2.20462262184878E-05,
+ 'shweight' => 2.20462262184878E-05,
+ 'uk_cwt' => 1.96841305522212E-05,
+ 'lcwt' => 1.96841305522212E-05,
+ 'hweight' => 1.96841305522212E-05,
+ 'stone' => 1.57473044417770E-04,
+ 'ton' => 1.10231131092439E-06,
+ 'uk_ton' => 9.84206527611061E-07,
+ 'LTON' => 9.84206527611061E-07,
+ 'brton' => 9.84206527611061E-07,
+ ],
+ // Conversion uses meter (m) as an intermediate unit
+ self::CATEGORY_DISTANCE => [
+ 'm' => 1.0,
+ 'mi' => 6.21371192237334E-04,
+ 'Nmi' => 5.39956803455724E-04,
+ 'in' => 3.93700787401575E+01,
+ 'ft' => 3.28083989501312E+00,
+ 'yd' => 1.09361329833771E+00,
+ 'ang' => 1.0E+10,
+ 'ell' => 8.74890638670166E-01,
+ 'ly' => 1.05700083402462E-16,
+ 'parsec' => 3.24077928966473E-17,
+ 'pc' => 3.24077928966473E-17,
+ 'Pica' => 2.83464566929134E+03,
+ 'Picapt' => 2.83464566929134E+03,
+ 'pica' => 2.36220472440945E+02,
+ 'survey_mi' => 6.21369949494950E-04,
+ ],
+ // Conversion uses second (s) as an intermediate unit
+ self::CATEGORY_TIME => [
+ 'yr' => 3.16880878140289E-08,
+ 'day' => 1.15740740740741E-05,
+ 'd' => 1.15740740740741E-05,
+ 'hr' => 2.77777777777778E-04,
+ 'mn' => 1.66666666666667E-02,
+ 'min' => 1.66666666666667E-02,
+ 'sec' => 1.0,
+ 's' => 1.0,
+ ],
+ // Conversion uses Pascal (Pa) as an intermediate unit
+ self::CATEGORY_PRESSURE => [
+ 'Pa' => 1.0,
+ 'p' => 1.0,
+ 'atm' => 9.86923266716013E-06,
+ 'at' => 9.86923266716013E-06,
+ 'mmHg' => 7.50063755419211E-03,
+ 'psi' => 1.45037737730209E-04,
+ 'Torr' => 7.50061682704170E-03,
+ ],
+ // Conversion uses Newton (N) as an intermediate unit
+ self::CATEGORY_FORCE => [
+ 'N' => 1.0,
+ 'dyn' => 1.0E+5,
+ 'dy' => 1.0E+5,
+ 'lbf' => 2.24808923655339E-01,
+ 'pond' => 1.01971621297793E+02,
+ ],
+ // Conversion uses Joule (J) as an intermediate unit
+ self::CATEGORY_ENERGY => [
+ 'J' => 1.0,
+ 'e' => 9.99999519343231E+06,
+ 'c' => 2.39006249473467E-01,
+ 'cal' => 2.38846190642017E-01,
+ 'eV' => 6.24145700000000E+18,
+ 'ev' => 6.24145700000000E+18,
+ 'HPh' => 3.72506430801000E-07,
+ 'hh' => 3.72506430801000E-07,
+ 'Wh' => 2.77777916238711E-04,
+ 'wh' => 2.77777916238711E-04,
+ 'flb' => 2.37304222192651E+01,
+ 'BTU' => 9.47815067349015E-04,
+ 'btu' => 9.47815067349015E-04,
+ ],
+ // Conversion uses Horsepower (HP) as an intermediate unit
+ self::CATEGORY_POWER => [
+ 'HP' => 1.0,
+ 'h' => 1.0,
+ 'W' => 7.45699871582270E+02,
+ 'w' => 7.45699871582270E+02,
+ 'PS' => 1.01386966542400E+00,
+ ],
+ // Conversion uses Tesla (T) as an intermediate unit
+ self::CATEGORY_MAGNETISM => [
+ 'T' => 1.0,
+ 'ga' => 10000.0,
+ ],
+ // Conversion uses litre (l) as an intermediate unit
+ self::CATEGORY_VOLUME => [
+ 'l' => 1.0,
+ 'L' => 1.0,
+ 'lt' => 1.0,
+ 'tsp' => 2.02884136211058E+02,
+ 'tspm' => 2.0E+02,
+ 'tbs' => 6.76280454036860E+01,
+ 'oz' => 3.38140227018430E+01,
+ 'cup' => 4.22675283773038E+00,
+ 'pt' => 2.11337641886519E+00,
+ 'us_pt' => 2.11337641886519E+00,
+ 'uk_pt' => 1.75975398639270E+00,
+ 'qt' => 1.05668820943259E+00,
+ 'uk_qt' => 8.79876993196351E-01,
+ 'gal' => 2.64172052358148E-01,
+ 'uk_gal' => 2.19969248299088E-01,
+ 'ang3' => 1.0E+27,
+ 'ang^3' => 1.0E+27,
+ 'barrel' => 6.28981077043211E-03,
+ 'bushel' => 2.83775932584017E-02,
+ 'in3' => 6.10237440947323E+01,
+ 'in^3' => 6.10237440947323E+01,
+ 'ft3' => 3.53146667214886E-02,
+ 'ft^3' => 3.53146667214886E-02,
+ 'ly3' => 1.18093498844171E-51,
+ 'ly^3' => 1.18093498844171E-51,
+ 'm3' => 1.0E-03,
+ 'm^3' => 1.0E-03,
+ 'mi3' => 2.39912758578928E-13,
+ 'mi^3' => 2.39912758578928E-13,
+ 'yd3' => 1.30795061931439E-03,
+ 'yd^3' => 1.30795061931439E-03,
+ 'Nmi3' => 1.57426214685811E-13,
+ 'Nmi^3' => 1.57426214685811E-13,
+ 'Pica3' => 2.27769904358706E+07,
+ 'Pica^3' => 2.27769904358706E+07,
+ 'Picapt3' => 2.27769904358706E+07,
+ 'Picapt^3' => 2.27769904358706E+07,
+ 'GRT' => 3.53146667214886E-04,
+ 'regton' => 3.53146667214886E-04,
+ 'MTON' => 8.82866668037215E-04,
+ ],
+ // Conversion uses hectare (ha) as an intermediate unit
+ self::CATEGORY_AREA => [
+ 'ha' => 1.0,
+ 'uk_acre' => 2.47105381467165E+00,
+ 'us_acre' => 2.47104393046628E+00,
+ 'ang2' => 1.0E+24,
+ 'ang^2' => 1.0E+24,
+ 'ar' => 1.0E+02,
+ 'ft2' => 1.07639104167097E+05,
+ 'ft^2' => 1.07639104167097E+05,
+ 'in2' => 1.55000310000620E+07,
+ 'in^2' => 1.55000310000620E+07,
+ 'ly2' => 1.11725076312873E-28,
+ 'ly^2' => 1.11725076312873E-28,
+ 'm2' => 1.0E+04,
+ 'm^2' => 1.0E+04,
+ 'Morgen' => 4.0E+00,
+ 'mi2' => 3.86102158542446E-03,
+ 'mi^2' => 3.86102158542446E-03,
+ 'Nmi2' => 2.91553349598123E-03,
+ 'Nmi^2' => 2.91553349598123E-03,
+ 'Pica2' => 8.03521607043214E+10,
+ 'Pica^2' => 8.03521607043214E+10,
+ 'Picapt2' => 8.03521607043214E+10,
+ 'Picapt^2' => 8.03521607043214E+10,
+ 'yd2' => 1.19599004630108E+04,
+ 'yd^2' => 1.19599004630108E+04,
+ ],
+ // Conversion uses bit (bit) as an intermediate unit
+ self::CATEGORY_INFORMATION => [
+ 'bit' => 1.0,
+ 'byte' => 0.125,
+ ],
+ // Conversion uses Meters per Second (m/s) as an intermediate unit
+ self::CATEGORY_SPEED => [
+ 'm/s' => 1.0,
+ 'm/sec' => 1.0,
+ 'm/h' => 3.60E+03,
+ 'm/hr' => 3.60E+03,
+ 'mph' => 2.23693629205440E+00,
+ 'admkn' => 1.94260256941567E+00,
+ 'kn' => 1.94384449244060E+00,
+ ],
+ ];
+
+ /**
+ * getConversionGroups
+ * Returns a list of the different conversion groups for UOM conversions.
+ */
+ public static function getConversionCategories(): array
+ {
+ $conversionGroups = [];
+ foreach (self::$conversionUnits as $conversionUnit) {
+ $conversionGroups[] = $conversionUnit['Group'];
+ }
+
+ return array_merge(array_unique($conversionGroups));
+ }
+
+ /**
+ * getConversionGroupUnits
+ * Returns an array of units of measure, for a specified conversion group, or for all groups.
+ *
+ * @param ?string $category The group whose units of measure you want to retrieve
+ */
+ public static function getConversionCategoryUnits(?string $category = null): array
+ {
+ $conversionGroups = [];
+ foreach (self::$conversionUnits as $conversionUnit => $conversionGroup) {
+ if (($category === null) || ($conversionGroup['Group'] == $category)) {
+ $conversionGroups[$conversionGroup['Group']][] = $conversionUnit;
+ }
+ }
+
+ return $conversionGroups;
+ }
+
+ /**
+ * getConversionGroupUnitDetails.
+ *
+ * @param ?string $category The group whose units of measure you want to retrieve
+ */
+ public static function getConversionCategoryUnitDetails(?string $category = null): array
+ {
+ $conversionGroups = [];
+ foreach (self::$conversionUnits as $conversionUnit => $conversionGroup) {
+ if (($category === null) || ($conversionGroup['Group'] == $category)) {
+ $conversionGroups[$conversionGroup['Group']][] = [
+ 'unit' => $conversionUnit,
+ 'description' => $conversionGroup['UnitName'],
+ ];
+ }
+ }
+
+ return $conversionGroups;
+ }
+
+ /**
+ * getConversionMultipliers
+ * Returns an array of the Multiplier prefixes that can be used with Units of Measure in CONVERTUOM().
+ *
+ * @return mixed[]
+ */
+ public static function getConversionMultipliers(): array
+ {
+ return self::$conversionMultipliers;
+ }
+
+ /**
+ * getBinaryConversionMultipliers
+ * Returns an array of the additional Multiplier prefixes that can be used with Information Units of Measure in CONVERTUOM().
+ *
+ * @return mixed[]
+ */
+ public static function getBinaryConversionMultipliers(): array
+ {
+ return self::$binaryConversionMultipliers;
+ }
+
+ /**
+ * CONVERT.
+ *
+ * Converts a number from one measurement system to another.
+ * For example, CONVERT can translate a table of distances in miles to a table of distances
+ * in kilometers.
+ *
+ * Excel Function:
+ * CONVERT(value,fromUOM,toUOM)
+ *
+ * @param array|float|int|string $value the value in fromUOM to convert
+ * Or can be an array of values
+ * @param array|string $fromUOM the units for value
+ * Or can be an array of values
+ * @param array|string $toUOM the units for the result
+ * Or can be an array of values
+ *
+ * @return array|float|string Result, or a string containing an error
+ * If an array of numbers is passed as an argument, then the returned result will also be an array
+ * with the same dimensions
+ */
+ public static function CONVERT($value, $fromUOM, $toUOM)
+ {
+ if (is_array($value) || is_array($fromUOM) || is_array($toUOM)) {
+ return self::evaluateArrayArguments([self::class, __FUNCTION__], $value, $fromUOM, $toUOM);
+ }
+
+ if (!is_numeric($value)) {
+ return ExcelError::VALUE();
+ }
+
+ try {
+ [$fromUOM, $fromCategory, $fromMultiplier] = self::getUOMDetails($fromUOM);
+ [$toUOM, $toCategory, $toMultiplier] = self::getUOMDetails($toUOM);
+ } catch (Exception) {
+ return ExcelError::NA();
+ }
+
+ if ($fromCategory !== $toCategory) {
+ return ExcelError::NA();
+ }
+
+ // @var float $value
+ $value *= $fromMultiplier;
+
+ if (($fromUOM === $toUOM) && ($fromMultiplier === $toMultiplier)) {
+ // We've already factored $fromMultiplier into the value, so we need
+ // to reverse it again
+ return $value / $fromMultiplier;
+ } elseif ($fromUOM === $toUOM) {
+ return $value / $toMultiplier;
+ } elseif ($fromCategory === self::CATEGORY_TEMPERATURE) {
+ return self::convertTemperature($fromUOM, $toUOM, $value);
+ }
+
+ $baseValue = $value * (1.0 / self::$unitConversions[$fromCategory][$fromUOM]);
+
+ return ($baseValue * self::$unitConversions[$fromCategory][$toUOM]) / $toMultiplier;
+ }
+
+ private static function getUOMDetails(string $uom): array
+ {
+ if (isset(self::$conversionUnits[$uom])) {
+ $unitCategory = self::$conversionUnits[$uom]['Group'];
+
+ return [$uom, $unitCategory, 1.0];
+ }
+
+ // Check 1-character standard metric multiplier prefixes
+ $multiplierType = substr($uom, 0, 1);
+ $uom = substr($uom, 1);
+ if (isset(self::$conversionUnits[$uom], self::$conversionMultipliers[$multiplierType])) {
+ if (self::$conversionUnits[$uom]['AllowPrefix'] === false) {
+ throw new Exception('Prefix not allowed for UoM');
+ }
+ $unitCategory = self::$conversionUnits[$uom]['Group'];
+
+ return [$uom, $unitCategory, self::$conversionMultipliers[$multiplierType]['multiplier']];
+ }
+
+ $multiplierType .= substr($uom, 0, 1);
+ $uom = substr($uom, 1);
+
+ // Check 2-character standard metric multiplier prefixes
+ if (isset(self::$conversionUnits[$uom], self::$conversionMultipliers[$multiplierType])) {
+ if (self::$conversionUnits[$uom]['AllowPrefix'] === false) {
+ throw new Exception('Prefix not allowed for UoM');
+ }
+ $unitCategory = self::$conversionUnits[$uom]['Group'];
+
+ return [$uom, $unitCategory, self::$conversionMultipliers[$multiplierType]['multiplier']];
+ }
+
+ // Check 2-character binary multiplier prefixes
+ if (isset(self::$conversionUnits[$uom], self::$binaryConversionMultipliers[$multiplierType])) {
+ if (self::$conversionUnits[$uom]['AllowPrefix'] === false) {
+ throw new Exception('Prefix not allowed for UoM');
+ }
+ $unitCategory = self::$conversionUnits[$uom]['Group'];
+ if ($unitCategory !== 'Information') {
+ throw new Exception('Binary Prefix is only allowed for Information UoM');
+ }
+
+ return [$uom, $unitCategory, self::$binaryConversionMultipliers[$multiplierType]['multiplier']];
+ }
+
+ throw new Exception('UoM Not Found');
+ }
+
+ protected static function convertTemperature(string $fromUOM, string $toUOM, float|int $value): float|int
+ {
+ $fromUOM = self::resolveTemperatureSynonyms($fromUOM);
+ $toUOM = self::resolveTemperatureSynonyms($toUOM);
+
+ if ($fromUOM === $toUOM) {
+ return $value;
+ }
+
+ // Convert to Kelvin
+ switch ($fromUOM) {
+ case 'F':
+ $value = ($value - 32) / 1.8 + 273.15;
+
+ break;
+ case 'C':
+ $value += 273.15;
+
+ break;
+ case 'Rank':
+ $value /= 1.8;
+
+ break;
+ case 'Reau':
+ $value = $value * 1.25 + 273.15;
+
+ break;
+ }
+
+ // Convert from Kelvin
+ switch ($toUOM) {
+ case 'F':
+ $value = ($value - 273.15) * 1.8 + 32.00;
+
+ break;
+ case 'C':
+ $value -= 273.15;
+
+ break;
+ case 'Rank':
+ $value *= 1.8;
+
+ break;
+ case 'Reau':
+ $value = ($value - 273.15) * 0.80000;
+
+ break;
+ }
+
+ return $value;
+ }
+
+ private static function resolveTemperatureSynonyms(string $uom): string
+ {
+ return match ($uom) {
+ 'fah' => 'F',
+ 'cel' => 'C',
+ 'kel' => 'K',
+ default => $uom,
+ };
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/EngineeringValidations.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/EngineeringValidations.php
new file mode 100644
index 0000000..7e5118f
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/EngineeringValidations.php
@@ -0,0 +1,27 @@
+ 2.2) {
+ return 1 - self::makeFloat(ErfC::ERFC($value));
+ }
+ $sum = $term = $value;
+ $xsqr = ($value * $value);
+ $j = 1;
+ do {
+ $term *= $xsqr / $j;
+ $sum -= $term / (2 * $j + 1);
+ ++$j;
+ $term *= $xsqr / $j;
+ $sum += $term / (2 * $j + 1);
+ ++$j;
+ if ($sum == 0.0) {
+ break;
+ }
+ } while (abs($term / $sum) > Functions::PRECISION);
+
+ return self::TWO_SQRT_PI * $sum;
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/ErfC.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/ErfC.php
new file mode 100644
index 0000000..4365fec
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/ErfC.php
@@ -0,0 +1,77 @@
+ Functions::PRECISION);
+
+ return self::ONE_SQRT_PI * exp(-$value * $value) * $q2;
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Exception.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Exception.php
new file mode 100644
index 0000000..ea893d6
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Exception.php
@@ -0,0 +1,22 @@
+line = $line;
+ $e->file = $file;
+
+ throw $e;
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/ExceptionHandler.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/ExceptionHandler.php
new file mode 100644
index 0000000..890da60
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/ExceptionHandler.php
@@ -0,0 +1,24 @@
+getMessage();
+ }
+
+ $yearFracx = DateTimeExcel\YearFrac::fraction($purchased, $firstPeriod, $basis);
+ if (is_string($yearFracx)) {
+ return $yearFracx;
+ }
+ /** @var float $yearFrac */
+ $yearFrac = $yearFracx;
+
+ $amortiseCoeff = self::getAmortizationCoefficient($rate);
+
+ $rate *= $amortiseCoeff;
+ $rate += self::ROUNDING_ADJUSTMENT;
+ $fNRate = round($yearFrac * $rate * $cost, 0);
+ $cost -= $fNRate;
+ $fRest = $cost - $salvage;
+
+ for ($n = 0; $n < $period; ++$n) {
+ $fNRate = round($rate * $cost, 0);
+ $fRest -= $fNRate;
+
+ if ($fRest < 0.0) {
+ return match ($period - $n) {
+ 1 => round($cost * 0.5, 0),
+ default => 0.0,
+ };
+ }
+ $cost -= $fNRate;
+ }
+
+ return $fNRate;
+ }
+
+ /**
+ * AMORLINC.
+ *
+ * Returns the depreciation for each accounting period.
+ * This function is provided for the French accounting system. If an asset is purchased in
+ * the middle of the accounting period, the prorated depreciation is taken into account.
+ *
+ * Excel Function:
+ * AMORLINC(cost,purchased,firstPeriod,salvage,period,rate[,basis])
+ *
+ * @param mixed $cost The cost of the asset as a float
+ * @param mixed $purchased Date of the purchase of the asset
+ * @param mixed $firstPeriod Date of the end of the first period
+ * @param mixed $salvage The salvage value at the end of the life of the asset
+ * @param mixed $period The period as a float
+ * @param mixed $rate Rate of depreciation as float
+ * @param mixed $basis Integer indicating the type of day count to use.
+ * 0 or omitted US (NASD) 30/360
+ * 1 Actual/actual
+ * 2 Actual/360
+ * 3 Actual/365
+ * 4 European 30/360
+ *
+ * @return float|string (string containing the error type if there is an error)
+ */
+ public static function AMORLINC(
+ mixed $cost,
+ mixed $purchased,
+ mixed $firstPeriod,
+ mixed $salvage,
+ mixed $period,
+ mixed $rate,
+ mixed $basis = FinancialConstants::BASIS_DAYS_PER_YEAR_NASD
+ ): string|float {
+ $cost = Functions::flattenSingleValue($cost);
+ $purchased = Functions::flattenSingleValue($purchased);
+ $firstPeriod = Functions::flattenSingleValue($firstPeriod);
+ $salvage = Functions::flattenSingleValue($salvage);
+ $period = Functions::flattenSingleValue($period);
+ $rate = Functions::flattenSingleValue($rate);
+ $basis = ($basis === null)
+ ? FinancialConstants::BASIS_DAYS_PER_YEAR_NASD
+ : Functions::flattenSingleValue($basis);
+
+ try {
+ $cost = FinancialValidations::validateFloat($cost);
+ $purchased = FinancialValidations::validateDate($purchased);
+ $firstPeriod = FinancialValidations::validateDate($firstPeriod);
+ $salvage = FinancialValidations::validateFloat($salvage);
+ $period = FinancialValidations::validateFloat($period);
+ $rate = FinancialValidations::validateFloat($rate);
+ $basis = FinancialValidations::validateBasis($basis);
+ } catch (Exception $e) {
+ return $e->getMessage();
+ }
+
+ $fOneRate = $cost * $rate;
+ $fCostDelta = $cost - $salvage;
+ // Note, quirky variation for leap years on the YEARFRAC for this function
+ $purchasedYear = DateTimeExcel\DateParts::year($purchased);
+ $yearFracx = DateTimeExcel\YearFrac::fraction($purchased, $firstPeriod, $basis);
+ if (is_string($yearFracx)) {
+ return $yearFracx;
+ }
+ /** @var float $yearFrac */
+ $yearFrac = $yearFracx;
+
+ if (
+ $basis == FinancialConstants::BASIS_DAYS_PER_YEAR_ACTUAL
+ && $yearFrac < 1
+ && DateTimeExcel\Helpers::isLeapYear(Functions::scalar($purchasedYear))
+ ) {
+ $yearFrac *= 365 / 366;
+ }
+
+ $f0Rate = $yearFrac * $rate * $cost;
+ $nNumOfFullPeriods = (int) (($cost - $salvage - $f0Rate) / $fOneRate);
+
+ if ($period == 0) {
+ return $f0Rate;
+ } elseif ($period <= $nNumOfFullPeriods) {
+ return $fOneRate;
+ } elseif ($period == ($nNumOfFullPeriods + 1)) {
+ return $fCostDelta - $fOneRate * $nNumOfFullPeriods - $f0Rate;
+ }
+
+ return 0.0;
+ }
+
+ private static function getAmortizationCoefficient(float $rate): float
+ {
+ // The depreciation coefficients are:
+ // Life of assets (1/rate) Depreciation coefficient
+ // Less than 3 years 1
+ // Between 3 and 4 years 1.5
+ // Between 5 and 6 years 2
+ // More than 6 years 2.5
+ $fUsePer = 1.0 / $rate;
+
+ if ($fUsePer < 3.0) {
+ return 1.0;
+ } elseif ($fUsePer < 4.0) {
+ return 1.5;
+ } elseif ($fUsePer <= 6.0) {
+ return 2.0;
+ }
+
+ return 2.5;
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/CashFlow/CashFlowValidations.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/CashFlow/CashFlowValidations.php
new file mode 100644
index 0000000..f5719b6
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/CashFlow/CashFlowValidations.php
@@ -0,0 +1,41 @@
+getMessage();
+ }
+
+ return self::calculateFutureValue($rate, $numberOfPeriods, $payment, $presentValue, $type);
+ }
+
+ /**
+ * PV.
+ *
+ * Returns the Present Value of a cash flow with constant payments and interest rate (annuities).
+ *
+ * @param mixed $rate Interest rate per period
+ * @param mixed $numberOfPeriods Number of periods as an integer
+ * @param mixed $payment Periodic payment (annuity)
+ * @param mixed $futureValue Future Value
+ * @param mixed $type Payment type: 0 = at the end of each period, 1 = at the beginning of each period
+ *
+ * @return float|string Result, or a string containing an error
+ */
+ public static function presentValue(
+ mixed $rate,
+ mixed $numberOfPeriods,
+ mixed $payment = 0.0,
+ mixed $futureValue = 0.0,
+ mixed $type = FinancialConstants::PAYMENT_END_OF_PERIOD
+ ): string|float {
+ $rate = Functions::flattenSingleValue($rate);
+ $numberOfPeriods = Functions::flattenSingleValue($numberOfPeriods);
+ $payment = ($payment === null) ? 0.0 : Functions::flattenSingleValue($payment);
+ $futureValue = ($futureValue === null) ? 0.0 : Functions::flattenSingleValue($futureValue);
+ $type = ($type === null) ? FinancialConstants::PAYMENT_END_OF_PERIOD : Functions::flattenSingleValue($type);
+
+ try {
+ $rate = CashFlowValidations::validateRate($rate);
+ $numberOfPeriods = CashFlowValidations::validateInt($numberOfPeriods);
+ $payment = CashFlowValidations::validateFloat($payment);
+ $futureValue = CashFlowValidations::validateFutureValue($futureValue);
+ $type = CashFlowValidations::validatePeriodType($type);
+ } catch (Exception $e) {
+ return $e->getMessage();
+ }
+
+ // Validate parameters
+ if ($numberOfPeriods < 0) {
+ return ExcelError::NAN();
+ }
+
+ return self::calculatePresentValue($rate, $numberOfPeriods, $payment, $futureValue, $type);
+ }
+
+ /**
+ * NPER.
+ *
+ * Returns the number of periods for a cash flow with constant periodic payments (annuities), and interest rate.
+ *
+ * @param mixed $rate Interest rate per period
+ * @param mixed $payment Periodic payment (annuity)
+ * @param mixed $presentValue Present Value
+ * @param mixed $futureValue Future Value
+ * @param mixed $type Payment type: 0 = at the end of each period, 1 = at the beginning of each period
+ *
+ * @return float|string Result, or a string containing an error
+ */
+ public static function periods(
+ mixed $rate,
+ mixed $payment,
+ mixed $presentValue,
+ mixed $futureValue = 0.0,
+ mixed $type = FinancialConstants::PAYMENT_END_OF_PERIOD
+ ) {
+ $rate = Functions::flattenSingleValue($rate);
+ $payment = Functions::flattenSingleValue($payment);
+ $presentValue = Functions::flattenSingleValue($presentValue);
+ $futureValue = ($futureValue === null) ? 0.0 : Functions::flattenSingleValue($futureValue);
+ $type = ($type === null) ? FinancialConstants::PAYMENT_END_OF_PERIOD : Functions::flattenSingleValue($type);
+
+ try {
+ $rate = CashFlowValidations::validateRate($rate);
+ $payment = CashFlowValidations::validateFloat($payment);
+ $presentValue = CashFlowValidations::validatePresentValue($presentValue);
+ $futureValue = CashFlowValidations::validateFutureValue($futureValue);
+ $type = CashFlowValidations::validatePeriodType($type);
+ } catch (Exception $e) {
+ return $e->getMessage();
+ }
+
+ // Validate parameters
+ if ($payment == 0.0) {
+ return ExcelError::NAN();
+ }
+
+ return self::calculatePeriods($rate, $payment, $presentValue, $futureValue, $type);
+ }
+
+ private static function calculateFutureValue(
+ float $rate,
+ int $numberOfPeriods,
+ float $payment,
+ float $presentValue,
+ int $type
+ ): float {
+ if ($rate !== null && $rate != 0) {
+ return -$presentValue
+ * (1 + $rate) ** $numberOfPeriods - $payment * (1 + $rate * $type) * ((1 + $rate) ** $numberOfPeriods - 1)
+ / $rate;
+ }
+
+ return -$presentValue - $payment * $numberOfPeriods;
+ }
+
+ private static function calculatePresentValue(
+ float $rate,
+ int $numberOfPeriods,
+ float $payment,
+ float $futureValue,
+ int $type
+ ): float {
+ if ($rate != 0.0) {
+ return (-$payment * (1 + $rate * $type)
+ * (((1 + $rate) ** $numberOfPeriods - 1) / $rate) - $futureValue) / (1 + $rate) ** $numberOfPeriods;
+ }
+
+ return -$futureValue - $payment * $numberOfPeriods;
+ }
+
+ private static function calculatePeriods(
+ float $rate,
+ float $payment,
+ float $presentValue,
+ float $futureValue,
+ int $type
+ ): string|float {
+ if ($rate != 0.0) {
+ if ($presentValue == 0.0) {
+ return ExcelError::NAN();
+ }
+
+ return log(($payment * (1 + $rate * $type) / $rate - $futureValue)
+ / ($presentValue + $payment * (1 + $rate * $type) / $rate)) / log(1 + $rate);
+ }
+
+ return (-$presentValue - $futureValue) / $payment;
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/CashFlow/Constant/Periodic/Cumulative.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/CashFlow/Constant/Periodic/Cumulative.php
new file mode 100644
index 0000000..9435909
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/CashFlow/Constant/Periodic/Cumulative.php
@@ -0,0 +1,138 @@
+getMessage();
+ }
+
+ // Validate parameters
+ if ($start < 1 || $start > $end) {
+ return ExcelError::NAN();
+ }
+
+ // Calculate
+ $interest = 0;
+ for ($per = $start; $per <= $end; ++$per) {
+ $ipmt = Interest::payment($rate, $per, $periods, $presentValue, 0, $type);
+ if (is_string($ipmt)) {
+ return $ipmt;
+ }
+
+ $interest += $ipmt;
+ }
+
+ return $interest;
+ }
+
+ /**
+ * CUMPRINC.
+ *
+ * Returns the cumulative principal paid on a loan between the start and end periods.
+ *
+ * Excel Function:
+ * CUMPRINC(rate,nper,pv,start,end[,type])
+ *
+ * @param mixed $rate The Interest rate
+ * @param mixed $periods The total number of payment periods as an integer
+ * @param mixed $presentValue Present Value
+ * @param mixed $start The first period in the calculation.
+ * Payment periods are numbered beginning with 1.
+ * @param mixed $end the last period in the calculation
+ * @param mixed $type A number 0 or 1 and indicates when payments are due:
+ * 0 or omitted At the end of the period.
+ * 1 At the beginning of the period.
+ */
+ public static function principal(
+ mixed $rate,
+ mixed $periods,
+ mixed $presentValue,
+ mixed $start,
+ mixed $end,
+ mixed $type = FinancialConstants::PAYMENT_END_OF_PERIOD
+ ): string|float|int {
+ $rate = Functions::flattenSingleValue($rate);
+ $periods = Functions::flattenSingleValue($periods);
+ $presentValue = Functions::flattenSingleValue($presentValue);
+ $start = Functions::flattenSingleValue($start);
+ $end = Functions::flattenSingleValue($end);
+ $type = ($type === null) ? FinancialConstants::PAYMENT_END_OF_PERIOD : Functions::flattenSingleValue($type);
+
+ try {
+ $rate = CashFlowValidations::validateRate($rate);
+ $periods = CashFlowValidations::validateInt($periods);
+ $presentValue = CashFlowValidations::validatePresentValue($presentValue);
+ $start = CashFlowValidations::validateInt($start);
+ $end = CashFlowValidations::validateInt($end);
+ $type = CashFlowValidations::validatePeriodType($type);
+ } catch (Exception $e) {
+ return $e->getMessage();
+ }
+
+ // Validate parameters
+ if ($start < 1 || $start > $end) {
+ return ExcelError::VALUE();
+ }
+
+ // Calculate
+ $principal = 0;
+ for ($per = $start; $per <= $end; ++$per) {
+ $ppmt = Payments::interestPayment($rate, $per, $periods, $presentValue, 0, $type);
+ if (is_string($ppmt)) {
+ return $ppmt;
+ }
+
+ $principal += $ppmt;
+ }
+
+ return $principal;
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/CashFlow/Constant/Periodic/Interest.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/CashFlow/Constant/Periodic/Interest.php
new file mode 100644
index 0000000..833c573
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/CashFlow/Constant/Periodic/Interest.php
@@ -0,0 +1,213 @@
+getMessage();
+ }
+
+ // Validate parameters
+ if ($period <= 0 || $period > $numberOfPeriods) {
+ return ExcelError::NAN();
+ }
+
+ // Calculate
+ $interestAndPrincipal = new InterestAndPrincipal(
+ $interestRate,
+ $period,
+ $numberOfPeriods,
+ $presentValue,
+ $futureValue,
+ $type
+ );
+
+ return $interestAndPrincipal->interest();
+ }
+
+ /**
+ * ISPMT.
+ *
+ * Returns the interest payment for an investment based on an interest rate and a constant payment schedule.
+ *
+ * Excel Function:
+ * =ISPMT(interest_rate, period, number_payments, pv)
+ *
+ * @param mixed $interestRate is the interest rate for the investment
+ * @param mixed $period is the period to calculate the interest rate. It must be betweeen 1 and number_payments.
+ * @param mixed $numberOfPeriods is the number of payments for the annuity
+ * @param mixed $principleRemaining is the loan amount or present value of the payments
+ */
+ public static function schedulePayment(mixed $interestRate, mixed $period, mixed $numberOfPeriods, mixed $principleRemaining): string|float
+ {
+ $interestRate = Functions::flattenSingleValue($interestRate);
+ $period = Functions::flattenSingleValue($period);
+ $numberOfPeriods = Functions::flattenSingleValue($numberOfPeriods);
+ $principleRemaining = Functions::flattenSingleValue($principleRemaining);
+
+ try {
+ $interestRate = CashFlowValidations::validateRate($interestRate);
+ $period = CashFlowValidations::validateInt($period);
+ $numberOfPeriods = CashFlowValidations::validateInt($numberOfPeriods);
+ $principleRemaining = CashFlowValidations::validateFloat($principleRemaining);
+ } catch (Exception $e) {
+ return $e->getMessage();
+ }
+
+ // Validate parameters
+ if ($period <= 0 || $period > $numberOfPeriods) {
+ return ExcelError::NAN();
+ }
+
+ // Return value
+ $returnValue = 0;
+
+ // Calculate
+ $principlePayment = ($principleRemaining * 1.0) / ($numberOfPeriods * 1.0);
+ for ($i = 0; $i <= $period; ++$i) {
+ $returnValue = $interestRate * $principleRemaining * -1;
+ $principleRemaining -= $principlePayment;
+ // principle needs to be 0 after the last payment, don't let floating point screw it up
+ if ($i == $numberOfPeriods) {
+ $returnValue = 0.0;
+ }
+ }
+
+ return $returnValue;
+ }
+
+ /**
+ * RATE.
+ *
+ * Returns the interest rate per period of an annuity.
+ * RATE is calculated by iteration and can have zero or more solutions.
+ * If the successive results of RATE do not converge to within 0.0000001 after 20 iterations,
+ * RATE returns the #NUM! error value.
+ *
+ * Excel Function:
+ * RATE(nper,pmt,pv[,fv[,type[,guess]]])
+ *
+ * @param mixed $numberOfPeriods The total number of payment periods in an annuity
+ * @param mixed $payment The payment made each period and cannot change over the life of the annuity.
+ * Typically, pmt includes principal and interest but no other fees or taxes.
+ * @param mixed $presentValue The present value - the total amount that a series of future payments is worth now
+ * @param mixed $futureValue The future value, or a cash balance you want to attain after the last payment is made.
+ * If fv is omitted, it is assumed to be 0 (the future value of a loan,
+ * for example, is 0).
+ * @param mixed $type A number 0 or 1 and indicates when payments are due:
+ * 0 or omitted At the end of the period.
+ * 1 At the beginning of the period.
+ * @param mixed $guess Your guess for what the rate will be.
+ * If you omit guess, it is assumed to be 10 percent.
+ */
+ public static function rate(
+ mixed $numberOfPeriods,
+ mixed $payment,
+ mixed $presentValue,
+ mixed $futureValue = 0.0,
+ mixed $type = FinancialConstants::PAYMENT_END_OF_PERIOD,
+ mixed $guess = 0.1
+ ): string|float {
+ $numberOfPeriods = Functions::flattenSingleValue($numberOfPeriods);
+ $payment = Functions::flattenSingleValue($payment);
+ $presentValue = Functions::flattenSingleValue($presentValue);
+ $futureValue = ($futureValue === null) ? 0.0 : Functions::flattenSingleValue($futureValue);
+ $type = ($type === null) ? FinancialConstants::PAYMENT_END_OF_PERIOD : Functions::flattenSingleValue($type);
+ $guess = ($guess === null) ? 0.1 : Functions::flattenSingleValue($guess);
+
+ try {
+ $numberOfPeriods = CashFlowValidations::validateInt($numberOfPeriods);
+ $payment = CashFlowValidations::validateFloat($payment);
+ $presentValue = CashFlowValidations::validatePresentValue($presentValue);
+ $futureValue = CashFlowValidations::validateFutureValue($futureValue);
+ $type = CashFlowValidations::validatePeriodType($type);
+ $guess = CashFlowValidations::validateFloat($guess);
+ } catch (Exception $e) {
+ return $e->getMessage();
+ }
+
+ $rate = $guess;
+ // rest of code adapted from python/numpy
+ $close = false;
+ $iter = 0;
+ while (!$close && $iter < self::FINANCIAL_MAX_ITERATIONS) {
+ $nextdiff = self::rateNextGuess($rate, $numberOfPeriods, $payment, $presentValue, $futureValue, $type);
+ if (!is_numeric($nextdiff)) {
+ break;
+ }
+ $rate1 = $rate - $nextdiff;
+ $close = abs($rate1 - $rate) < self::FINANCIAL_PRECISION;
+ ++$iter;
+ $rate = $rate1;
+ }
+
+ return $close ? $rate : ExcelError::NAN();
+ }
+
+ private static function rateNextGuess(float $rate, int $numberOfPeriods, float $payment, float $presentValue, float $futureValue, int $type): string|float
+ {
+ if ($rate == 0.0) {
+ return ExcelError::NAN();
+ }
+ $tt1 = ($rate + 1) ** $numberOfPeriods;
+ $tt2 = ($rate + 1) ** ($numberOfPeriods - 1);
+ $numerator = $futureValue + $tt1 * $presentValue + $payment * ($tt1 - 1) * ($rate * $type + 1) / $rate;
+ $denominator = $numberOfPeriods * $tt2 * $presentValue - $payment * ($tt1 - 1)
+ * ($rate * $type + 1) / ($rate * $rate) + $numberOfPeriods
+ * $payment * $tt2 * ($rate * $type + 1) / $rate + $payment * ($tt1 - 1) * $type / $rate;
+ if ($denominator == 0) {
+ return ExcelError::NAN();
+ }
+
+ return $numerator / $denominator;
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/CashFlow/Constant/Periodic/InterestAndPrincipal.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/CashFlow/Constant/Periodic/InterestAndPrincipal.php
new file mode 100644
index 0000000..ea9abb9
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/CashFlow/Constant/Periodic/InterestAndPrincipal.php
@@ -0,0 +1,44 @@
+interest = $interest;
+ $this->principal = $principal;
+ }
+
+ public function interest(): float
+ {
+ return $this->interest;
+ }
+
+ public function principal(): float
+ {
+ return $this->principal;
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/CashFlow/Constant/Periodic/Payments.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/CashFlow/Constant/Periodic/Payments.php
new file mode 100644
index 0000000..41e88f9
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/CashFlow/Constant/Periodic/Payments.php
@@ -0,0 +1,116 @@
+getMessage();
+ }
+
+ // Calculate
+ if ($interestRate != 0.0) {
+ return (-$futureValue - $presentValue * (1 + $interestRate) ** $numberOfPeriods)
+ / (1 + $interestRate * $type) / (((1 + $interestRate) ** $numberOfPeriods - 1) / $interestRate);
+ }
+
+ return (-$presentValue - $futureValue) / $numberOfPeriods;
+ }
+
+ /**
+ * PPMT.
+ *
+ * Returns the interest payment for a given period for an investment based on periodic, constant payments
+ * and a constant interest rate.
+ *
+ * @param mixed $interestRate Interest rate per period
+ * @param mixed $period Period for which we want to find the interest
+ * @param mixed $numberOfPeriods Number of periods
+ * @param mixed $presentValue Present Value
+ * @param mixed $futureValue Future Value
+ * @param mixed $type Payment type: 0 = at the end of each period, 1 = at the beginning of each period
+ *
+ * @return float|string Result, or a string containing an error
+ */
+ public static function interestPayment(
+ mixed $interestRate,
+ mixed $period,
+ mixed $numberOfPeriods,
+ mixed $presentValue,
+ mixed $futureValue = 0,
+ mixed $type = FinancialConstants::PAYMENT_END_OF_PERIOD
+ ): string|float {
+ $interestRate = Functions::flattenSingleValue($interestRate);
+ $period = Functions::flattenSingleValue($period);
+ $numberOfPeriods = Functions::flattenSingleValue($numberOfPeriods);
+ $presentValue = Functions::flattenSingleValue($presentValue);
+ $futureValue = ($futureValue === null) ? 0.0 : Functions::flattenSingleValue($futureValue);
+ $type = ($type === null) ? FinancialConstants::PAYMENT_END_OF_PERIOD : Functions::flattenSingleValue($type);
+
+ try {
+ $interestRate = CashFlowValidations::validateRate($interestRate);
+ $period = CashFlowValidations::validateInt($period);
+ $numberOfPeriods = CashFlowValidations::validateInt($numberOfPeriods);
+ $presentValue = CashFlowValidations::validatePresentValue($presentValue);
+ $futureValue = CashFlowValidations::validateFutureValue($futureValue);
+ $type = CashFlowValidations::validatePeriodType($type);
+ } catch (Exception $e) {
+ return $e->getMessage();
+ }
+
+ // Validate parameters
+ if ($period <= 0 || $period > $numberOfPeriods) {
+ return ExcelError::NAN();
+ }
+
+ // Calculate
+ $interestAndPrincipal = new InterestAndPrincipal(
+ $interestRate,
+ $period,
+ $numberOfPeriods,
+ $presentValue,
+ $futureValue,
+ $type
+ );
+
+ return $interestAndPrincipal->principal();
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/CashFlow/Single.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/CashFlow/Single.php
new file mode 100644
index 0000000..6f60a2a
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/CashFlow/Single.php
@@ -0,0 +1,107 @@
+getMessage();
+ }
+
+ return $principal;
+ }
+
+ /**
+ * PDURATION.
+ *
+ * Calculates the number of periods required for an investment to reach a specified value.
+ *
+ * @param mixed $rate Interest rate per period
+ * @param mixed $presentValue Present Value
+ * @param mixed $futureValue Future Value
+ *
+ * @return float|string Result, or a string containing an error
+ */
+ public static function periods(mixed $rate, mixed $presentValue, mixed $futureValue): string|float
+ {
+ $rate = Functions::flattenSingleValue($rate);
+ $presentValue = Functions::flattenSingleValue($presentValue);
+ $futureValue = Functions::flattenSingleValue($futureValue);
+
+ try {
+ $rate = CashFlowValidations::validateRate($rate);
+ $presentValue = CashFlowValidations::validatePresentValue($presentValue);
+ $futureValue = CashFlowValidations::validateFutureValue($futureValue);
+ } catch (Exception $e) {
+ return $e->getMessage();
+ }
+
+ // Validate parameters
+ if ($rate <= 0.0 || $presentValue <= 0.0 || $futureValue <= 0.0) {
+ return ExcelError::NAN();
+ }
+
+ return (log($futureValue) - log($presentValue)) / log(1 + $rate);
+ }
+
+ /**
+ * RRI.
+ *
+ * Calculates the interest rate required for an investment to grow to a specified future value .
+ *
+ * @param array|float $periods The number of periods over which the investment is made
+ * @param array|float $presentValue Present Value
+ * @param array|float $futureValue Future Value
+ *
+ * @return float|string Result, or a string containing an error
+ */
+ public static function interestRate(array|float $periods = 0.0, array|float $presentValue = 0.0, array|float $futureValue = 0.0): string|float
+ {
+ $periods = Functions::flattenSingleValue($periods);
+ $presentValue = Functions::flattenSingleValue($presentValue);
+ $futureValue = Functions::flattenSingleValue($futureValue);
+
+ try {
+ $periods = CashFlowValidations::validateFloat($periods);
+ $presentValue = CashFlowValidations::validatePresentValue($presentValue);
+ $futureValue = CashFlowValidations::validateFutureValue($futureValue);
+ } catch (Exception $e) {
+ return $e->getMessage();
+ }
+
+ // Validate parameters
+ if ($periods <= 0.0 || $presentValue <= 0.0 || $futureValue < 0.0) {
+ return ExcelError::NAN();
+ }
+
+ return ($futureValue / $presentValue) ** (1 / $periods) - 1;
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/CashFlow/Variable/NonPeriodic.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/CashFlow/Variable/NonPeriodic.php
new file mode 100644
index 0000000..8c6f615
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/CashFlow/Variable/NonPeriodic.php
@@ -0,0 +1,301 @@
+ 1;
+ $datesIsArray = count($dates) > 1;
+ if (!$valuesIsArray && !$datesIsArray) {
+ return ExcelError::NA();
+ }
+ if (count($values) != count($dates)) {
+ return ExcelError::NAN();
+ }
+
+ $datesCount = count($dates);
+ for ($i = 0; $i < $datesCount; ++$i) {
+ try {
+ $dates[$i] = DateTimeExcel\Helpers::getDateValue($dates[$i]);
+ } catch (Exception $e) {
+ return $e->getMessage();
+ }
+ }
+
+ return self::xirrPart2($values);
+ }
+
+ private static function xirrPart2(array &$values): string
+ {
+ $valCount = count($values);
+ $foundpos = false;
+ $foundneg = false;
+ for ($i = 0; $i < $valCount; ++$i) {
+ $fld = $values[$i];
+ if (!is_numeric($fld)) {
+ return ExcelError::VALUE();
+ } elseif ($fld > 0) {
+ $foundpos = true;
+ } elseif ($fld < 0) {
+ $foundneg = true;
+ }
+ }
+ if (!self::bothNegAndPos($foundneg, $foundpos)) {
+ return ExcelError::NAN();
+ }
+
+ return '';
+ }
+
+ private static function xirrPart3(array $values, array $dates, float $x1, float $x2): float|string
+ {
+ $f = self::xnpvOrdered($x1, $values, $dates, false);
+ if ($f < 0.0) {
+ $rtb = $x1;
+ $dx = $x2 - $x1;
+ } else {
+ $rtb = $x2;
+ $dx = $x1 - $x2;
+ }
+
+ $rslt = ExcelError::VALUE();
+ for ($i = 0; $i < self::FINANCIAL_MAX_ITERATIONS; ++$i) {
+ $dx *= 0.5;
+ $x_mid = $rtb + $dx;
+ $f_mid = (float) self::xnpvOrdered($x_mid, $values, $dates, false);
+ if ($f_mid <= 0.0) {
+ $rtb = $x_mid;
+ }
+ if ((abs($f_mid) < self::FINANCIAL_PRECISION) || (abs($dx) < self::FINANCIAL_PRECISION)) {
+ $rslt = $x_mid;
+
+ break;
+ }
+ }
+
+ return $rslt;
+ }
+
+ private static function xirrBisection(array $values, array $dates, float $x1, float $x2): string|float
+ {
+ $rslt = ExcelError::NAN();
+ for ($i = 0; $i < self::FINANCIAL_MAX_ITERATIONS; ++$i) {
+ $rslt = ExcelError::NAN();
+ $f1 = self::xnpvOrdered($x1, $values, $dates, false, true);
+ $f2 = self::xnpvOrdered($x2, $values, $dates, false, true);
+ if (!is_numeric($f1) || !is_numeric($f2)) {
+ break;
+ }
+ $f1 = (float) $f1;
+ $f2 = (float) $f2;
+ if (abs($f1) < self::FINANCIAL_PRECISION && abs($f2) < self::FINANCIAL_PRECISION) {
+ break;
+ }
+ if ($f1 * $f2 > 0) {
+ break;
+ }
+ $rslt = ($x1 + $x2) / 2;
+ $f3 = self::xnpvOrdered($rslt, $values, $dates, false, true);
+ if (!is_float($f3)) {
+ break;
+ }
+ if ($f3 * $f1 < 0) {
+ $x2 = $rslt;
+ } else {
+ $x1 = $rslt;
+ }
+ if (abs($f3) < self::FINANCIAL_PRECISION) {
+ break;
+ }
+ }
+
+ return $rslt;
+ }
+
+ private static function xnpvOrdered(mixed $rate, mixed $values, mixed $dates, bool $ordered = true, bool $capAtNegative1 = false): float|string
+ {
+ $rate = Functions::flattenSingleValue($rate);
+ $values = Functions::flattenArray($values);
+ $dates = Functions::flattenArray($dates);
+ $valCount = count($values);
+
+ try {
+ self::validateXnpv($rate, $values, $dates);
+ if ($capAtNegative1 && $rate <= -1) {
+ $rate = -1.0 + 1.0E-10;
+ }
+ $date0 = DateTimeExcel\Helpers::getDateValue($dates[0]);
+ } catch (Exception $e) {
+ return $e->getMessage();
+ }
+
+ $xnpv = 0.0;
+ for ($i = 0; $i < $valCount; ++$i) {
+ if (!is_numeric($values[$i])) {
+ return ExcelError::VALUE();
+ }
+
+ try {
+ $datei = DateTimeExcel\Helpers::getDateValue($dates[$i]);
+ } catch (Exception $e) {
+ return $e->getMessage();
+ }
+ if ($date0 > $datei) {
+ $dif = $ordered ? ExcelError::NAN() : -((int) DateTimeExcel\Difference::interval($datei, $date0, 'd'));
+ } else {
+ $dif = Functions::scalar(DateTimeExcel\Difference::interval($date0, $datei, 'd'));
+ }
+ if (!is_numeric($dif)) {
+ return $dif;
+ }
+ if ($rate <= -1.0) {
+ $xnpv += -abs($values[$i]) / (-1 - $rate) ** ($dif / 365);
+ } else {
+ $xnpv += $values[$i] / (1 + $rate) ** ($dif / 365);
+ }
+ }
+
+ return is_finite($xnpv) ? $xnpv : ExcelError::VALUE();
+ }
+
+ private static function validateXnpv(mixed $rate, array $values, array $dates): void
+ {
+ if (!is_numeric($rate)) {
+ throw new Exception(ExcelError::VALUE());
+ }
+ $valCount = count($values);
+ if ($valCount != count($dates)) {
+ throw new Exception(ExcelError::NAN());
+ }
+ if ($valCount > 1 && ((min($values) > 0) || (max($values) < 0))) {
+ throw new Exception(ExcelError::NAN());
+ }
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/CashFlow/Variable/Periodic.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/CashFlow/Variable/Periodic.php
new file mode 100644
index 0000000..21e537b
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/CashFlow/Variable/Periodic.php
@@ -0,0 +1,157 @@
+ 0.0) {
+ return ExcelError::VALUE();
+ }
+
+ $f = self::presentValue($x1, $values);
+ if ($f < 0.0) {
+ $rtb = $x1;
+ $dx = $x2 - $x1;
+ } else {
+ $rtb = $x2;
+ $dx = $x1 - $x2;
+ }
+
+ for ($i = 0; $i < self::FINANCIAL_MAX_ITERATIONS; ++$i) {
+ $dx *= 0.5;
+ $x_mid = $rtb + $dx;
+ $f_mid = self::presentValue($x_mid, $values);
+ if ($f_mid <= 0.0) {
+ $rtb = $x_mid;
+ }
+ if ((abs($f_mid) < self::FINANCIAL_PRECISION) || (abs($dx) < self::FINANCIAL_PRECISION)) {
+ return $x_mid;
+ }
+ }
+
+ return ExcelError::VALUE();
+ }
+
+ /**
+ * MIRR.
+ *
+ * Returns the modified internal rate of return for a series of periodic cash flows. MIRR considers both
+ * the cost of the investment and the interest received on reinvestment of cash.
+ *
+ * Excel Function:
+ * MIRR(values,finance_rate, reinvestment_rate)
+ *
+ * @param mixed $values An array or a reference to cells that contain a series of payments and
+ * income occurring at regular intervals.
+ * Payments are negative value, income is positive values.
+ * @param mixed $financeRate The interest rate you pay on the money used in the cash flows
+ * @param mixed $reinvestmentRate The interest rate you receive on the cash flows as you reinvest them
+ *
+ * @return float|string Result, or a string containing an error
+ */
+ public static function modifiedRate(mixed $values, mixed $financeRate, mixed $reinvestmentRate): string|float
+ {
+ if (!is_array($values)) {
+ return ExcelError::DIV0();
+ }
+ $values = Functions::flattenArray($values);
+ $financeRate = Functions::flattenSingleValue($financeRate);
+ $reinvestmentRate = Functions::flattenSingleValue($reinvestmentRate);
+ $n = count($values);
+
+ $rr = 1.0 + $reinvestmentRate;
+ $fr = 1.0 + $financeRate;
+
+ $npvPos = $npvNeg = 0.0;
+ foreach ($values as $i => $v) {
+ if ($v >= 0) {
+ $npvPos += $v / $rr ** $i;
+ } else {
+ $npvNeg += $v / $fr ** $i;
+ }
+ }
+
+ if ($npvNeg === 0.0 || $npvPos === 0.0) {
+ return ExcelError::DIV0();
+ }
+
+ $mirr = ((-$npvPos * $rr ** $n)
+ / ($npvNeg * ($rr))) ** (1.0 / ($n - 1)) - 1.0;
+
+ return is_finite($mirr) ? $mirr : ExcelError::NAN();
+ }
+
+ /**
+ * NPV.
+ *
+ * Returns the Net Present Value of a cash flow series given a discount rate.
+ *
+ * @param array $args
+ */
+ public static function presentValue(mixed $rate, ...$args): int|float
+ {
+ $returnValue = 0;
+
+ $rate = Functions::flattenSingleValue($rate);
+ $aArgs = Functions::flattenArray($args);
+
+ // Calculate
+ $countArgs = count($aArgs);
+ for ($i = 1; $i <= $countArgs; ++$i) {
+ // Is it a numeric value?
+ if (is_numeric($aArgs[$i - 1])) {
+ $returnValue += $aArgs[$i - 1] / (1 + $rate) ** $i;
+ }
+ }
+
+ return $returnValue;
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/Constants.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/Constants.php
new file mode 100644
index 0000000..17740b0
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/Constants.php
@@ -0,0 +1,19 @@
+getMessage();
+ }
+
+ $daysPerYear = Helpers::daysPerYear(Functions::scalar(DateTimeExcel\DateParts::year($settlement)), $basis);
+ if (is_string($daysPerYear)) {
+ return ExcelError::VALUE();
+ }
+ $prev = self::couponFirstPeriodDate($settlement, $maturity, $frequency, self::PERIOD_DATE_PREVIOUS);
+
+ if ($basis === FinancialConstants::BASIS_DAYS_PER_YEAR_ACTUAL) {
+ return abs((float) DateTimeExcel\Days::between($prev, $settlement));
+ }
+
+ return (float) DateTimeExcel\YearFrac::fraction($prev, $settlement, $basis) * $daysPerYear;
+ }
+
+ /**
+ * COUPDAYS.
+ *
+ * Returns the number of days in the coupon period that contains the settlement date.
+ *
+ * Excel Function:
+ * COUPDAYS(settlement,maturity,frequency[,basis])
+ *
+ * @param mixed $settlement The security's settlement date.
+ * The security settlement date is the date after the issue
+ * date when the security is traded to the buyer.
+ * @param mixed $maturity The security's maturity date.
+ * The maturity date is the date when the security expires.
+ * @param mixed $frequency The number of coupon payments per year.
+ * Valid frequency values are:
+ * 1 Annual
+ * 2 Semi-Annual
+ * 4 Quarterly
+ * @param mixed $basis The type of day count to use (int).
+ * 0 or omitted US (NASD) 30/360
+ * 1 Actual/actual
+ * 2 Actual/360
+ * 3 Actual/365
+ * 4 European 30/360
+ */
+ public static function COUPDAYS(
+ mixed $settlement,
+ mixed $maturity,
+ mixed $frequency,
+ mixed $basis = FinancialConstants::BASIS_DAYS_PER_YEAR_NASD
+ ): string|int|float {
+ $settlement = Functions::flattenSingleValue($settlement);
+ $maturity = Functions::flattenSingleValue($maturity);
+ $frequency = Functions::flattenSingleValue($frequency);
+ $basis = ($basis === null)
+ ? FinancialConstants::BASIS_DAYS_PER_YEAR_NASD
+ : Functions::flattenSingleValue($basis);
+
+ try {
+ $settlement = FinancialValidations::validateSettlementDate($settlement);
+ $maturity = FinancialValidations::validateMaturityDate($maturity);
+ self::validateCouponPeriod($settlement, $maturity);
+ $frequency = FinancialValidations::validateFrequency($frequency);
+ $basis = FinancialValidations::validateBasis($basis);
+ } catch (Exception $e) {
+ return $e->getMessage();
+ }
+
+ switch ($basis) {
+ case FinancialConstants::BASIS_DAYS_PER_YEAR_365:
+ // Actual/365
+ return 365 / $frequency;
+ case FinancialConstants::BASIS_DAYS_PER_YEAR_ACTUAL:
+ // Actual/actual
+ if ($frequency == FinancialConstants::FREQUENCY_ANNUAL) {
+ $daysPerYear = (int) Helpers::daysPerYear(Functions::scalar(DateTimeExcel\DateParts::year($settlement)), $basis);
+
+ return $daysPerYear / $frequency;
+ }
+ $prev = self::couponFirstPeriodDate($settlement, $maturity, $frequency, self::PERIOD_DATE_PREVIOUS);
+ $next = self::couponFirstPeriodDate($settlement, $maturity, $frequency, self::PERIOD_DATE_NEXT);
+
+ return $next - $prev;
+ default:
+ // US (NASD) 30/360, Actual/360 or European 30/360
+ return 360 / $frequency;
+ }
+ }
+
+ /**
+ * COUPDAYSNC.
+ *
+ * Returns the number of days from the settlement date to the next coupon date.
+ *
+ * Excel Function:
+ * COUPDAYSNC(settlement,maturity,frequency[,basis])
+ *
+ * @param mixed $settlement The security's settlement date.
+ * The security settlement date is the date after the issue
+ * date when the security is traded to the buyer.
+ * @param mixed $maturity The security's maturity date.
+ * The maturity date is the date when the security expires.
+ * @param mixed $frequency The number of coupon payments per year.
+ * Valid frequency values are:
+ * 1 Annual
+ * 2 Semi-Annual
+ * 4 Quarterly
+ * @param mixed $basis The type of day count to use (int) .
+ * 0 or omitted US (NASD) 30/360
+ * 1 Actual/actual
+ * 2 Actual/360
+ * 3 Actual/365
+ * 4 European 30/360
+ */
+ public static function COUPDAYSNC(
+ mixed $settlement,
+ mixed $maturity,
+ mixed $frequency,
+ mixed $basis = FinancialConstants::BASIS_DAYS_PER_YEAR_NASD
+ ): string|float {
+ $settlement = Functions::flattenSingleValue($settlement);
+ $maturity = Functions::flattenSingleValue($maturity);
+ $frequency = Functions::flattenSingleValue($frequency);
+ $basis = ($basis === null)
+ ? FinancialConstants::BASIS_DAYS_PER_YEAR_NASD
+ : Functions::flattenSingleValue($basis);
+
+ try {
+ $settlement = FinancialValidations::validateSettlementDate($settlement);
+ $maturity = FinancialValidations::validateMaturityDate($maturity);
+ self::validateCouponPeriod($settlement, $maturity);
+ $frequency = FinancialValidations::validateFrequency($frequency);
+ $basis = FinancialValidations::validateBasis($basis);
+ } catch (Exception $e) {
+ return $e->getMessage();
+ }
+
+ /** @var int $daysPerYear */
+ $daysPerYear = Helpers::daysPerYear(Functions::Scalar(DateTimeExcel\DateParts::year($settlement)), $basis);
+ $next = self::couponFirstPeriodDate($settlement, $maturity, $frequency, self::PERIOD_DATE_NEXT);
+
+ if ($basis === FinancialConstants::BASIS_DAYS_PER_YEAR_NASD) {
+ $settlementDate = Date::excelToDateTimeObject($settlement);
+ $settlementEoM = Helpers::isLastDayOfMonth($settlementDate);
+ if ($settlementEoM) {
+ ++$settlement;
+ }
+ }
+
+ return (float) DateTimeExcel\YearFrac::fraction($settlement, $next, $basis) * $daysPerYear;
+ }
+
+ /**
+ * COUPNCD.
+ *
+ * Returns the next coupon date after the settlement date.
+ *
+ * Excel Function:
+ * COUPNCD(settlement,maturity,frequency[,basis])
+ *
+ * @param mixed $settlement The security's settlement date.
+ * The security settlement date is the date after the issue
+ * date when the security is traded to the buyer.
+ * @param mixed $maturity The security's maturity date.
+ * The maturity date is the date when the security expires.
+ * @param mixed $frequency The number of coupon payments per year.
+ * Valid frequency values are:
+ * 1 Annual
+ * 2 Semi-Annual
+ * 4 Quarterly
+ * @param mixed $basis The type of day count to use (int).
+ * 0 or omitted US (NASD) 30/360
+ * 1 Actual/actual
+ * 2 Actual/360
+ * 3 Actual/365
+ * 4 European 30/360
+ *
+ * @return float|string Excel date/time serial value or error message
+ */
+ public static function COUPNCD(
+ mixed $settlement,
+ mixed $maturity,
+ mixed $frequency,
+ mixed $basis = FinancialConstants::BASIS_DAYS_PER_YEAR_NASD
+ ): string|float {
+ $settlement = Functions::flattenSingleValue($settlement);
+ $maturity = Functions::flattenSingleValue($maturity);
+ $frequency = Functions::flattenSingleValue($frequency);
+ $basis = ($basis === null)
+ ? FinancialConstants::BASIS_DAYS_PER_YEAR_NASD
+ : Functions::flattenSingleValue($basis);
+
+ try {
+ $settlement = FinancialValidations::validateSettlementDate($settlement);
+ $maturity = FinancialValidations::validateMaturityDate($maturity);
+ self::validateCouponPeriod($settlement, $maturity);
+ $frequency = FinancialValidations::validateFrequency($frequency);
+ FinancialValidations::validateBasis($basis);
+ } catch (Exception $e) {
+ return $e->getMessage();
+ }
+
+ return self::couponFirstPeriodDate($settlement, $maturity, $frequency, self::PERIOD_DATE_NEXT);
+ }
+
+ /**
+ * COUPNUM.
+ *
+ * Returns the number of coupons payable between the settlement date and maturity date,
+ * rounded up to the nearest whole coupon.
+ *
+ * Excel Function:
+ * COUPNUM(settlement,maturity,frequency[,basis])
+ *
+ * @param mixed $settlement The security's settlement date.
+ * The security settlement date is the date after the issue
+ * date when the security is traded to the buyer.
+ * @param mixed $maturity The security's maturity date.
+ * The maturity date is the date when the security expires.
+ * @param mixed $frequency The number of coupon payments per year.
+ * Valid frequency values are:
+ * 1 Annual
+ * 2 Semi-Annual
+ * 4 Quarterly
+ * @param mixed $basis The type of day count to use (int).
+ * 0 or omitted US (NASD) 30/360
+ * 1 Actual/actual
+ * 2 Actual/360
+ * 3 Actual/365
+ * 4 European 30/360
+ */
+ public static function COUPNUM(
+ mixed $settlement,
+ mixed $maturity,
+ mixed $frequency,
+ mixed $basis = FinancialConstants::BASIS_DAYS_PER_YEAR_NASD
+ ): string|int {
+ $settlement = Functions::flattenSingleValue($settlement);
+ $maturity = Functions::flattenSingleValue($maturity);
+ $frequency = Functions::flattenSingleValue($frequency);
+ $basis = ($basis === null)
+ ? FinancialConstants::BASIS_DAYS_PER_YEAR_NASD
+ : Functions::flattenSingleValue($basis);
+
+ try {
+ $settlement = FinancialValidations::validateSettlementDate($settlement);
+ $maturity = FinancialValidations::validateMaturityDate($maturity);
+ self::validateCouponPeriod($settlement, $maturity);
+ $frequency = FinancialValidations::validateFrequency($frequency);
+ FinancialValidations::validateBasis($basis);
+ } catch (Exception $e) {
+ return $e->getMessage();
+ }
+
+ $yearsBetweenSettlementAndMaturity = DateTimeExcel\YearFrac::fraction(
+ $settlement,
+ $maturity,
+ FinancialConstants::BASIS_DAYS_PER_YEAR_NASD
+ );
+
+ return (int) ceil((float) $yearsBetweenSettlementAndMaturity * $frequency);
+ }
+
+ /**
+ * COUPPCD.
+ *
+ * Returns the previous coupon date before the settlement date.
+ *
+ * Excel Function:
+ * COUPPCD(settlement,maturity,frequency[,basis])
+ *
+ * @param mixed $settlement The security's settlement date.
+ * The security settlement date is the date after the issue
+ * date when the security is traded to the buyer.
+ * @param mixed $maturity The security's maturity date.
+ * The maturity date is the date when the security expires.
+ * @param mixed $frequency The number of coupon payments per year.
+ * Valid frequency values are:
+ * 1 Annual
+ * 2 Semi-Annual
+ * 4 Quarterly
+ * @param mixed $basis The type of day count to use (int).
+ * 0 or omitted US (NASD) 30/360
+ * 1 Actual/actual
+ * 2 Actual/360
+ * 3 Actual/365
+ * 4 European 30/360
+ *
+ * @return float|string Excel date/time serial value or error message
+ */
+ public static function COUPPCD(
+ mixed $settlement,
+ mixed $maturity,
+ mixed $frequency,
+ mixed $basis = FinancialConstants::BASIS_DAYS_PER_YEAR_NASD
+ ): string|float {
+ $settlement = Functions::flattenSingleValue($settlement);
+ $maturity = Functions::flattenSingleValue($maturity);
+ $frequency = Functions::flattenSingleValue($frequency);
+ $basis = ($basis === null)
+ ? FinancialConstants::BASIS_DAYS_PER_YEAR_NASD
+ : Functions::flattenSingleValue($basis);
+
+ try {
+ $settlement = FinancialValidations::validateSettlementDate($settlement);
+ $maturity = FinancialValidations::validateMaturityDate($maturity);
+ self::validateCouponPeriod($settlement, $maturity);
+ $frequency = FinancialValidations::validateFrequency($frequency);
+ FinancialValidations::validateBasis($basis);
+ } catch (Exception $e) {
+ return $e->getMessage();
+ }
+
+ return self::couponFirstPeriodDate($settlement, $maturity, $frequency, self::PERIOD_DATE_PREVIOUS);
+ }
+
+ private static function monthsDiff(DateTime $result, int $months, string $plusOrMinus, int $day, bool $lastDayFlag): void
+ {
+ $result->setDate((int) $result->format('Y'), (int) $result->format('m'), 1);
+ $result->modify("$plusOrMinus $months months");
+ $daysInMonth = (int) $result->format('t');
+ $result->setDate((int) $result->format('Y'), (int) $result->format('m'), $lastDayFlag ? $daysInMonth : min($day, $daysInMonth));
+ }
+
+ private static function couponFirstPeriodDate(float $settlement, float $maturity, int $frequency, bool $next): float
+ {
+ $months = 12 / $frequency;
+
+ $result = Date::excelToDateTimeObject($maturity);
+ $day = (int) $result->format('d');
+ $lastDayFlag = Helpers::isLastDayOfMonth($result);
+
+ while ($settlement < Date::PHPToExcel($result)) {
+ self::monthsDiff($result, $months, '-', $day, $lastDayFlag);
+ }
+ if ($next === true) {
+ self::monthsDiff($result, $months, '+', $day, $lastDayFlag);
+ }
+
+ return (float) Date::PHPToExcel($result);
+ }
+
+ private static function validateCouponPeriod(float $settlement, float $maturity): void
+ {
+ if ($settlement >= $maturity) {
+ throw new Exception(ExcelError::NAN());
+ }
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/Depreciation.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/Depreciation.php
new file mode 100644
index 0000000..6ef1899
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/Depreciation.php
@@ -0,0 +1,265 @@
+getMessage();
+ }
+
+ if ($cost === self::$zeroPointZero) {
+ return 0.0;
+ }
+
+ // Set Fixed Depreciation Rate
+ $fixedDepreciationRate = 1 - ($salvage / $cost) ** (1 / $life);
+ $fixedDepreciationRate = round($fixedDepreciationRate, 3);
+
+ // Loop through each period calculating the depreciation
+ // TODO Handle period value between 0 and 1 (e.g. 0.5)
+ $previousDepreciation = 0;
+ $depreciation = 0;
+ for ($per = 1; $per <= $period; ++$per) {
+ if ($per == 1) {
+ $depreciation = $cost * $fixedDepreciationRate * $month / 12;
+ } elseif ($per == ($life + 1)) {
+ $depreciation = ($cost - $previousDepreciation) * $fixedDepreciationRate * (12 - $month) / 12;
+ } else {
+ $depreciation = ($cost - $previousDepreciation) * $fixedDepreciationRate;
+ }
+ $previousDepreciation += $depreciation;
+ }
+
+ return $depreciation;
+ }
+
+ /**
+ * DDB.
+ *
+ * Returns the depreciation of an asset for a specified period using the
+ * double-declining balance method or some other method you specify.
+ *
+ * Excel Function:
+ * DDB(cost,salvage,life,period[,factor])
+ *
+ * @param mixed $cost Initial cost of the asset
+ * @param mixed $salvage Value at the end of the depreciation.
+ * (Sometimes called the salvage value of the asset)
+ * @param mixed $life Number of periods over which the asset is depreciated.
+ * (Sometimes called the useful life of the asset)
+ * @param mixed $period The period for which you want to calculate the
+ * depreciation. Period must use the same units as life.
+ * @param mixed $factor The rate at which the balance declines.
+ * If factor is omitted, it is assumed to be 2 (the
+ * double-declining balance method).
+ */
+ public static function DDB(mixed $cost, mixed $salvage, mixed $life, mixed $period, mixed $factor = 2.0): float|string
+ {
+ $cost = Functions::flattenSingleValue($cost);
+ $salvage = Functions::flattenSingleValue($salvage);
+ $life = Functions::flattenSingleValue($life);
+ $period = Functions::flattenSingleValue($period);
+ $factor = Functions::flattenSingleValue($factor);
+
+ try {
+ $cost = self::validateCost($cost);
+ $salvage = self::validateSalvage($salvage);
+ $life = self::validateLife($life);
+ $period = self::validatePeriod($period);
+ $factor = self::validateFactor($factor);
+ } catch (Exception $e) {
+ return $e->getMessage();
+ }
+
+ if ($period > $life) {
+ return ExcelError::NAN();
+ }
+
+ // Loop through each period calculating the depreciation
+ // TODO Handling for fractional $period values
+ $previousDepreciation = 0;
+ $depreciation = 0;
+ for ($per = 1; $per <= $period; ++$per) {
+ $depreciation = min(
+ ($cost - $previousDepreciation) * ($factor / $life),
+ ($cost - $salvage - $previousDepreciation)
+ );
+ $previousDepreciation += $depreciation;
+ }
+
+ return $depreciation;
+ }
+
+ /**
+ * SLN.
+ *
+ * Returns the straight-line depreciation of an asset for one period
+ *
+ * @param mixed $cost Initial cost of the asset
+ * @param mixed $salvage Value at the end of the depreciation
+ * @param mixed $life Number of periods over which the asset is depreciated
+ *
+ * @return float|string Result, or a string containing an error
+ */
+ public static function SLN(mixed $cost, mixed $salvage, mixed $life): string|float
+ {
+ $cost = Functions::flattenSingleValue($cost);
+ $salvage = Functions::flattenSingleValue($salvage);
+ $life = Functions::flattenSingleValue($life);
+
+ try {
+ $cost = self::validateCost($cost, true);
+ $salvage = self::validateSalvage($salvage, true);
+ $life = self::validateLife($life, true);
+ } catch (Exception $e) {
+ return $e->getMessage();
+ }
+
+ if ($life === self::$zeroPointZero) {
+ return ExcelError::DIV0();
+ }
+
+ return ($cost - $salvage) / $life;
+ }
+
+ /**
+ * SYD.
+ *
+ * Returns the sum-of-years' digits depreciation of an asset for a specified period.
+ *
+ * @param mixed $cost Initial cost of the asset
+ * @param mixed $salvage Value at the end of the depreciation
+ * @param mixed $life Number of periods over which the asset is depreciated
+ * @param mixed $period Period
+ *
+ * @return float|string Result, or a string containing an error
+ */
+ public static function SYD(mixed $cost, mixed $salvage, mixed $life, mixed $period): string|float
+ {
+ $cost = Functions::flattenSingleValue($cost);
+ $salvage = Functions::flattenSingleValue($salvage);
+ $life = Functions::flattenSingleValue($life);
+ $period = Functions::flattenSingleValue($period);
+
+ try {
+ $cost = self::validateCost($cost, true);
+ $salvage = self::validateSalvage($salvage);
+ $life = self::validateLife($life);
+ $period = self::validatePeriod($period);
+ } catch (Exception $e) {
+ return $e->getMessage();
+ }
+
+ if ($period > $life) {
+ return ExcelError::NAN();
+ }
+
+ $syd = (($cost - $salvage) * ($life - $period + 1) * 2) / ($life * ($life + 1));
+
+ return $syd;
+ }
+
+ private static function validateCost(mixed $cost, bool $negativeValueAllowed = false): float
+ {
+ $cost = FinancialValidations::validateFloat($cost);
+ if ($cost < 0.0 && $negativeValueAllowed === false) {
+ throw new Exception(ExcelError::NAN());
+ }
+
+ return $cost;
+ }
+
+ private static function validateSalvage(mixed $salvage, bool $negativeValueAllowed = false): float
+ {
+ $salvage = FinancialValidations::validateFloat($salvage);
+ if ($salvage < 0.0 && $negativeValueAllowed === false) {
+ throw new Exception(ExcelError::NAN());
+ }
+
+ return $salvage;
+ }
+
+ private static function validateLife(mixed $life, bool $negativeValueAllowed = false): float
+ {
+ $life = FinancialValidations::validateFloat($life);
+ if ($life < 0.0 && $negativeValueAllowed === false) {
+ throw new Exception(ExcelError::NAN());
+ }
+
+ return $life;
+ }
+
+ private static function validatePeriod(mixed $period, bool $negativeValueAllowed = false): float
+ {
+ $period = FinancialValidations::validateFloat($period);
+ if ($period <= 0.0 && $negativeValueAllowed === false) {
+ throw new Exception(ExcelError::NAN());
+ }
+
+ return $period;
+ }
+
+ private static function validateMonth(mixed $month): int
+ {
+ $month = FinancialValidations::validateInt($month);
+ if ($month < 1) {
+ throw new Exception(ExcelError::NAN());
+ }
+
+ return $month;
+ }
+
+ private static function validateFactor(mixed $factor): float
+ {
+ $factor = FinancialValidations::validateFloat($factor);
+ if ($factor <= 0.0) {
+ throw new Exception(ExcelError::NAN());
+ }
+
+ return $factor;
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/Dollar.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/Dollar.php
new file mode 100644
index 0000000..b0581f6
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/Dollar.php
@@ -0,0 +1,127 @@
+getMessage();
+ }
+
+ // Additional parameter validations
+ if ($fraction < 0) {
+ return ExcelError::NAN();
+ }
+ if ($fraction == 0) {
+ return ExcelError::DIV0();
+ }
+
+ $dollars = ($fractionalDollar < 0) ? ceil($fractionalDollar) : floor($fractionalDollar);
+ $cents = fmod($fractionalDollar, 1.0);
+ $cents /= $fraction;
+ $cents *= 10 ** ceil(log10($fraction));
+
+ return $dollars + $cents;
+ }
+
+ /**
+ * DOLLARFR.
+ *
+ * Converts a dollar price expressed as a decimal number into a dollar price
+ * expressed as a fraction.
+ * Fractional dollar numbers are sometimes used for security prices.
+ *
+ * Excel Function:
+ * DOLLARFR(decimal_dollar,fraction)
+ *
+ * @param mixed $decimalDollar Decimal Dollar
+ * Or can be an array of values
+ * @param mixed $fraction Fraction
+ * Or can be an array of values
+ */
+ public static function fractional(mixed $decimalDollar = null, mixed $fraction = 0): array|string|float
+ {
+ if (is_array($decimalDollar) || is_array($fraction)) {
+ return self::evaluateArrayArguments([self::class, __FUNCTION__], $decimalDollar, $fraction);
+ }
+
+ try {
+ $decimalDollar = FinancialValidations::validateFloat(
+ Functions::flattenSingleValue($decimalDollar) ?? 0.0
+ );
+ $fraction = FinancialValidations::validateInt(Functions::flattenSingleValue($fraction));
+ } catch (Exception $e) {
+ return $e->getMessage();
+ }
+
+ // Additional parameter validations
+ if ($fraction < 0) {
+ return ExcelError::NAN();
+ }
+ if ($fraction == 0) {
+ return ExcelError::DIV0();
+ }
+
+ $dollars = ($decimalDollar < 0.0) ? ceil($decimalDollar) : floor($decimalDollar);
+ $cents = fmod($decimalDollar, 1);
+ $cents *= $fraction;
+ $cents *= 10 ** (-ceil(log10($fraction)));
+
+ return $dollars + $cents;
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/FinancialValidations.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/FinancialValidations.php
new file mode 100644
index 0000000..e596fc3
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/FinancialValidations.php
@@ -0,0 +1,122 @@
+ 4)) {
+ throw new Exception(ExcelError::NAN());
+ }
+
+ return $basis;
+ }
+
+ public static function validatePrice(mixed $price): float
+ {
+ $price = self::validateFloat($price);
+ if ($price < 0.0) {
+ throw new Exception(ExcelError::NAN());
+ }
+
+ return $price;
+ }
+
+ public static function validateParValue(mixed $parValue): float
+ {
+ $parValue = self::validateFloat($parValue);
+ if ($parValue < 0.0) {
+ throw new Exception(ExcelError::NAN());
+ }
+
+ return $parValue;
+ }
+
+ public static function validateYield(mixed $yield): float
+ {
+ $yield = self::validateFloat($yield);
+ if ($yield < 0.0) {
+ throw new Exception(ExcelError::NAN());
+ }
+
+ return $yield;
+ }
+
+ public static function validateDiscount(mixed $discount): float
+ {
+ $discount = self::validateFloat($discount);
+ if ($discount <= 0.0) {
+ throw new Exception(ExcelError::NAN());
+ }
+
+ return $discount;
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/Helpers.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/Helpers.php
new file mode 100644
index 0000000..aa28712
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/Helpers.php
@@ -0,0 +1,58 @@
+format('d') === $date->format('t');
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/InterestRate.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/InterestRate.php
new file mode 100644
index 0000000..2916df6
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/InterestRate.php
@@ -0,0 +1,71 @@
+getMessage();
+ }
+
+ if ($nominalRate <= 0 || $periodsPerYear < 1) {
+ return ExcelError::NAN();
+ }
+
+ return ((1 + $nominalRate / $periodsPerYear) ** $periodsPerYear) - 1;
+ }
+
+ /**
+ * NOMINAL.
+ *
+ * Returns the nominal interest rate given the effective rate and the number of compounding payments per year.
+ *
+ * @param mixed $effectiveRate Effective interest rate as a float
+ * @param mixed $periodsPerYear Integer number of compounding payments per year
+ *
+ * @return float|string Result, or a string containing an error
+ */
+ public static function nominal(mixed $effectiveRate = 0, mixed $periodsPerYear = 0): string|float
+ {
+ $effectiveRate = Functions::flattenSingleValue($effectiveRate);
+ $periodsPerYear = Functions::flattenSingleValue($periodsPerYear);
+
+ try {
+ $effectiveRate = FinancialValidations::validateFloat($effectiveRate);
+ $periodsPerYear = FinancialValidations::validateInt($periodsPerYear);
+ } catch (Exception $e) {
+ return $e->getMessage();
+ }
+
+ if ($effectiveRate <= 0 || $periodsPerYear < 1) {
+ return ExcelError::NAN();
+ }
+
+ // Calculate
+ return $periodsPerYear * (($effectiveRate + 1) ** (1 / $periodsPerYear) - 1);
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/Securities/AccruedInterest.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/Securities/AccruedInterest.php
new file mode 100644
index 0000000..eb57abf
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/Securities/AccruedInterest.php
@@ -0,0 +1,151 @@
+getMessage();
+ }
+
+ $daysBetweenIssueAndSettlement = Functions::scalar(YearFrac::fraction($issue, $settlement, $basis));
+ if (!is_numeric($daysBetweenIssueAndSettlement)) {
+ // return date error
+ return $daysBetweenIssueAndSettlement;
+ }
+ $daysBetweenFirstInterestAndSettlement = Functions::scalar(YearFrac::fraction($firstInterest, $settlement, $basis));
+ if (!is_numeric($daysBetweenFirstInterestAndSettlement)) {
+ // return date error
+ return $daysBetweenFirstInterestAndSettlement;
+ }
+
+ return $parValue * $rate * $daysBetweenIssueAndSettlement;
+ }
+
+ /**
+ * ACCRINTM.
+ *
+ * Returns the accrued interest for a security that pays interest at maturity.
+ *
+ * Excel Function:
+ * ACCRINTM(issue,settlement,rate[,par[,basis]])
+ *
+ * @param mixed $issue The security's issue date
+ * @param mixed $settlement The security's settlement (or maturity) date
+ * @param mixed $rate The security's annual coupon rate
+ * @param mixed $parValue The security's par value.
+ * If you omit parValue, ACCRINT uses $1,000.
+ * @param mixed $basis The type of day count to use.
+ * 0 or omitted US (NASD) 30/360
+ * 1 Actual/actual
+ * 2 Actual/360
+ * 3 Actual/365
+ * 4 European 30/360
+ *
+ * @return float|string Result, or a string containing an error
+ */
+ public static function atMaturity(
+ mixed $issue,
+ mixed $settlement,
+ mixed $rate,
+ mixed $parValue = 1000,
+ mixed $basis = FinancialConstants::BASIS_DAYS_PER_YEAR_NASD
+ ) {
+ $issue = Functions::flattenSingleValue($issue);
+ $settlement = Functions::flattenSingleValue($settlement);
+ $rate = Functions::flattenSingleValue($rate);
+ $parValue = ($parValue === null) ? 1000 : Functions::flattenSingleValue($parValue);
+ $basis = ($basis === null)
+ ? FinancialConstants::BASIS_DAYS_PER_YEAR_NASD
+ : Functions::flattenSingleValue($basis);
+
+ try {
+ $issue = SecurityValidations::validateIssueDate($issue);
+ $settlement = SecurityValidations::validateSettlementDate($settlement);
+ SecurityValidations::validateSecurityPeriod($issue, $settlement);
+ $rate = SecurityValidations::validateRate($rate);
+ $parValue = SecurityValidations::validateParValue($parValue);
+ $basis = SecurityValidations::validateBasis($basis);
+ } catch (Exception $e) {
+ return $e->getMessage();
+ }
+
+ $daysBetweenIssueAndSettlement = Functions::scalar(YearFrac::fraction($issue, $settlement, $basis));
+ if (!is_numeric($daysBetweenIssueAndSettlement)) {
+ // return date error
+ return $daysBetweenIssueAndSettlement;
+ }
+
+ return $parValue * $rate * $daysBetweenIssueAndSettlement;
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/Securities/Price.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/Securities/Price.php
new file mode 100644
index 0000000..b07b2c9
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/Securities/Price.php
@@ -0,0 +1,283 @@
+getMessage();
+ }
+
+ $dsc = (float) Coupons::COUPDAYSNC($settlement, $maturity, $frequency, $basis);
+ $e = (float) Coupons::COUPDAYS($settlement, $maturity, $frequency, $basis);
+ $n = (int) Coupons::COUPNUM($settlement, $maturity, $frequency, $basis);
+ $a = (float) Coupons::COUPDAYBS($settlement, $maturity, $frequency, $basis);
+
+ $baseYF = 1.0 + ($yield / $frequency);
+ $rfp = 100 * ($rate / $frequency);
+ $de = $dsc / $e;
+
+ $result = $redemption / $baseYF ** (--$n + $de);
+ for ($k = 0; $k <= $n; ++$k) {
+ $result += $rfp / ($baseYF ** ($k + $de));
+ }
+ $result -= $rfp * ($a / $e);
+
+ return $result;
+ }
+
+ /**
+ * PRICEDISC.
+ *
+ * Returns the price per $100 face value of a discounted security.
+ *
+ * @param mixed $settlement The security's settlement date.
+ * The security settlement date is the date after the issue date when the security
+ * is traded to the buyer.
+ * @param mixed $maturity The security's maturity date.
+ * The maturity date is the date when the security expires.
+ * @param mixed $discount The security's discount rate
+ * @param mixed $redemption The security's redemption value per $100 face value
+ * @param mixed $basis The type of day count to use.
+ * 0 or omitted US (NASD) 30/360
+ * 1 Actual/actual
+ * 2 Actual/360
+ * 3 Actual/365
+ * 4 European 30/360
+ *
+ * @return float|string Result, or a string containing an error
+ */
+ public static function priceDiscounted(
+ mixed $settlement,
+ mixed $maturity,
+ mixed $discount,
+ mixed $redemption,
+ mixed $basis = FinancialConstants::BASIS_DAYS_PER_YEAR_NASD
+ ) {
+ $settlement = Functions::flattenSingleValue($settlement);
+ $maturity = Functions::flattenSingleValue($maturity);
+ $discount = Functions::flattenSingleValue($discount);
+ $redemption = Functions::flattenSingleValue($redemption);
+ $basis = ($basis === null)
+ ? FinancialConstants::BASIS_DAYS_PER_YEAR_NASD
+ : Functions::flattenSingleValue($basis);
+
+ try {
+ $settlement = SecurityValidations::validateSettlementDate($settlement);
+ $maturity = SecurityValidations::validateMaturityDate($maturity);
+ SecurityValidations::validateSecurityPeriod($settlement, $maturity);
+ $discount = SecurityValidations::validateDiscount($discount);
+ $redemption = SecurityValidations::validateRedemption($redemption);
+ $basis = SecurityValidations::validateBasis($basis);
+ } catch (Exception $e) {
+ return $e->getMessage();
+ }
+
+ $daysBetweenSettlementAndMaturity = Functions::scalar(DateTimeExcel\YearFrac::fraction($settlement, $maturity, $basis));
+ if (!is_numeric($daysBetweenSettlementAndMaturity)) {
+ // return date error
+ return $daysBetweenSettlementAndMaturity;
+ }
+
+ return $redemption * (1 - $discount * $daysBetweenSettlementAndMaturity);
+ }
+
+ /**
+ * PRICEMAT.
+ *
+ * Returns the price per $100 face value of a security that pays interest at maturity.
+ *
+ * @param mixed $settlement The security's settlement date.
+ * The security's settlement date is the date after the issue date when the
+ * security is traded to the buyer.
+ * @param mixed $maturity The security's maturity date.
+ * The maturity date is the date when the security expires.
+ * @param mixed $issue The security's issue date
+ * @param mixed $rate The security's interest rate at date of issue
+ * @param mixed $yield The security's annual yield
+ * @param mixed $basis The type of day count to use.
+ * 0 or omitted US (NASD) 30/360
+ * 1 Actual/actual
+ * 2 Actual/360
+ * 3 Actual/365
+ * 4 European 30/360
+ *
+ * @return float|string Result, or a string containing an error
+ */
+ public static function priceAtMaturity(
+ mixed $settlement,
+ mixed $maturity,
+ mixed $issue,
+ mixed $rate,
+ mixed $yield,
+ mixed $basis = FinancialConstants::BASIS_DAYS_PER_YEAR_NASD
+ ) {
+ $settlement = Functions::flattenSingleValue($settlement);
+ $maturity = Functions::flattenSingleValue($maturity);
+ $issue = Functions::flattenSingleValue($issue);
+ $rate = Functions::flattenSingleValue($rate);
+ $yield = Functions::flattenSingleValue($yield);
+ $basis = ($basis === null)
+ ? FinancialConstants::BASIS_DAYS_PER_YEAR_NASD
+ : Functions::flattenSingleValue($basis);
+
+ try {
+ $settlement = SecurityValidations::validateSettlementDate($settlement);
+ $maturity = SecurityValidations::validateMaturityDate($maturity);
+ SecurityValidations::validateSecurityPeriod($settlement, $maturity);
+ $issue = SecurityValidations::validateIssueDate($issue);
+ $rate = SecurityValidations::validateRate($rate);
+ $yield = SecurityValidations::validateYield($yield);
+ $basis = SecurityValidations::validateBasis($basis);
+ } catch (Exception $e) {
+ return $e->getMessage();
+ }
+
+ $daysPerYear = Helpers::daysPerYear(Functions::scalar(DateTimeExcel\DateParts::year($settlement)), $basis);
+ if (!is_numeric($daysPerYear)) {
+ return $daysPerYear;
+ }
+ $daysBetweenIssueAndSettlement = Functions::scalar(DateTimeExcel\YearFrac::fraction($issue, $settlement, $basis));
+ if (!is_numeric($daysBetweenIssueAndSettlement)) {
+ // return date error
+ return $daysBetweenIssueAndSettlement;
+ }
+ $daysBetweenIssueAndSettlement *= $daysPerYear;
+ $daysBetweenIssueAndMaturity = Functions::scalar(DateTimeExcel\YearFrac::fraction($issue, $maturity, $basis));
+ if (!is_numeric($daysBetweenIssueAndMaturity)) {
+ // return date error
+ return $daysBetweenIssueAndMaturity;
+ }
+ $daysBetweenIssueAndMaturity *= $daysPerYear;
+ $daysBetweenSettlementAndMaturity = Functions::scalar(DateTimeExcel\YearFrac::fraction($settlement, $maturity, $basis));
+ if (!is_numeric($daysBetweenSettlementAndMaturity)) {
+ // return date error
+ return $daysBetweenSettlementAndMaturity;
+ }
+ $daysBetweenSettlementAndMaturity *= $daysPerYear;
+
+ return (100 + (($daysBetweenIssueAndMaturity / $daysPerYear) * $rate * 100))
+ / (1 + (($daysBetweenSettlementAndMaturity / $daysPerYear) * $yield))
+ - (($daysBetweenIssueAndSettlement / $daysPerYear) * $rate * 100);
+ }
+
+ /**
+ * RECEIVED.
+ *
+ * Returns the amount received at maturity for a fully invested Security.
+ *
+ * @param mixed $settlement The security's settlement date.
+ * The security settlement date is the date after the issue date when the security
+ * is traded to the buyer.
+ * @param mixed $maturity The security's maturity date.
+ * The maturity date is the date when the security expires.
+ * @param mixed $investment The amount invested in the security
+ * @param mixed $discount The security's discount rate
+ * @param mixed $basis The type of day count to use.
+ * 0 or omitted US (NASD) 30/360
+ * 1 Actual/actual
+ * 2 Actual/360
+ * 3 Actual/365
+ * 4 European 30/360
+ *
+ * @return float|string Result, or a string containing an error
+ */
+ public static function received(
+ mixed $settlement,
+ mixed $maturity,
+ mixed $investment,
+ mixed $discount,
+ mixed $basis = FinancialConstants::BASIS_DAYS_PER_YEAR_NASD
+ ) {
+ $settlement = Functions::flattenSingleValue($settlement);
+ $maturity = Functions::flattenSingleValue($maturity);
+ $investment = Functions::flattenSingleValue($investment);
+ $discount = Functions::flattenSingleValue($discount);
+ $basis = ($basis === null)
+ ? FinancialConstants::BASIS_DAYS_PER_YEAR_NASD
+ : Functions::flattenSingleValue($basis);
+
+ try {
+ $settlement = SecurityValidations::validateSettlementDate($settlement);
+ $maturity = SecurityValidations::validateMaturityDate($maturity);
+ SecurityValidations::validateSecurityPeriod($settlement, $maturity);
+ $investment = SecurityValidations::validateFloat($investment);
+ $discount = SecurityValidations::validateDiscount($discount);
+ $basis = SecurityValidations::validateBasis($basis);
+ } catch (Exception $e) {
+ return $e->getMessage();
+ }
+
+ if ($investment <= 0) {
+ return ExcelError::NAN();
+ }
+ $daysBetweenSettlementAndMaturity = DateTimeExcel\YearFrac::fraction($settlement, $maturity, $basis);
+ if (!is_numeric($daysBetweenSettlementAndMaturity)) {
+ // return date error
+ return Functions::scalar($daysBetweenSettlementAndMaturity);
+ }
+
+ return $investment / (1 - ($discount * $daysBetweenSettlementAndMaturity));
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/Securities/Rates.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/Securities/Rates.php
new file mode 100644
index 0000000..2989a29
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/Securities/Rates.php
@@ -0,0 +1,134 @@
+getMessage();
+ }
+
+ if ($price <= 0.0) {
+ return ExcelError::NAN();
+ }
+
+ $daysBetweenSettlementAndMaturity = Functions::scalar(DateTimeExcel\YearFrac::fraction($settlement, $maturity, $basis));
+ if (!is_numeric($daysBetweenSettlementAndMaturity)) {
+ // return date error
+ return $daysBetweenSettlementAndMaturity;
+ }
+
+ return (1 - $price / $redemption) / $daysBetweenSettlementAndMaturity;
+ }
+
+ /**
+ * INTRATE.
+ *
+ * Returns the interest rate for a fully invested security.
+ *
+ * Excel Function:
+ * INTRATE(settlement,maturity,investment,redemption[,basis])
+ *
+ * @param mixed $settlement The security's settlement date.
+ * The security settlement date is the date after the issue date when the security
+ * is traded to the buyer.
+ * @param mixed $maturity The security's maturity date.
+ * The maturity date is the date when the security expires.
+ * @param mixed $investment the amount invested in the security
+ * @param mixed $redemption the amount to be received at maturity
+ * @param mixed $basis The type of day count to use.
+ * 0 or omitted US (NASD) 30/360
+ * 1 Actual/actual
+ * 2 Actual/360
+ * 3 Actual/365
+ * 4 European 30/360
+ */
+ public static function interest(
+ mixed $settlement,
+ mixed $maturity,
+ mixed $investment,
+ mixed $redemption,
+ mixed $basis = FinancialConstants::BASIS_DAYS_PER_YEAR_NASD
+ ): float|string {
+ $settlement = Functions::flattenSingleValue($settlement);
+ $maturity = Functions::flattenSingleValue($maturity);
+ $investment = Functions::flattenSingleValue($investment);
+ $redemption = Functions::flattenSingleValue($redemption);
+ $basis = ($basis === null)
+ ? FinancialConstants::BASIS_DAYS_PER_YEAR_NASD
+ : Functions::flattenSingleValue($basis);
+
+ try {
+ $settlement = SecurityValidations::validateSettlementDate($settlement);
+ $maturity = SecurityValidations::validateMaturityDate($maturity);
+ SecurityValidations::validateSecurityPeriod($settlement, $maturity);
+ $investment = SecurityValidations::validateFloat($investment);
+ $redemption = SecurityValidations::validateRedemption($redemption);
+ $basis = SecurityValidations::validateBasis($basis);
+ } catch (Exception $e) {
+ return $e->getMessage();
+ }
+
+ if ($investment <= 0) {
+ return ExcelError::NAN();
+ }
+
+ $daysBetweenSettlementAndMaturity = Functions::scalar(DateTimeExcel\YearFrac::fraction($settlement, $maturity, $basis));
+ if (!is_numeric($daysBetweenSettlementAndMaturity)) {
+ // return date error
+ return $daysBetweenSettlementAndMaturity;
+ }
+
+ return (($redemption / $investment) - 1) / ($daysBetweenSettlementAndMaturity);
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/Securities/SecurityValidations.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/Securities/SecurityValidations.php
new file mode 100644
index 0000000..a0804cb
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/Securities/SecurityValidations.php
@@ -0,0 +1,32 @@
+= $maturity) {
+ throw new Exception(ExcelError::NAN());
+ }
+ }
+
+ public static function validateRedemption(mixed $redemption): float
+ {
+ $redemption = self::validateFloat($redemption);
+ if ($redemption <= 0.0) {
+ throw new Exception(ExcelError::NAN());
+ }
+
+ return $redemption;
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/Securities/Yields.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/Securities/Yields.php
new file mode 100644
index 0000000..a4c5a48
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/Securities/Yields.php
@@ -0,0 +1,153 @@
+getMessage();
+ }
+
+ $daysPerYear = Helpers::daysPerYear(Functions::scalar(DateTimeExcel\DateParts::year($settlement)), $basis);
+ if (!is_numeric($daysPerYear)) {
+ return $daysPerYear;
+ }
+ $daysBetweenSettlementAndMaturity = Functions::scalar(DateTimeExcel\YearFrac::fraction($settlement, $maturity, $basis));
+ if (!is_numeric($daysBetweenSettlementAndMaturity)) {
+ // return date error
+ return $daysBetweenSettlementAndMaturity;
+ }
+ $daysBetweenSettlementAndMaturity *= $daysPerYear;
+
+ return (($redemption - $price) / $price) * ($daysPerYear / $daysBetweenSettlementAndMaturity);
+ }
+
+ /**
+ * YIELDMAT.
+ *
+ * Returns the annual yield of a security that pays interest at maturity.
+ *
+ * @param mixed $settlement The security's settlement date.
+ * The security's settlement date is the date after the issue date when the security
+ * is traded to the buyer.
+ * @param mixed $maturity The security's maturity date.
+ * The maturity date is the date when the security expires.
+ * @param mixed $issue The security's issue date
+ * @param mixed $rate The security's interest rate at date of issue
+ * @param mixed $price The security's price per $100 face value
+ * @param mixed $basis The type of day count to use.
+ * 0 or omitted US (NASD) 30/360
+ * 1 Actual/actual
+ * 2 Actual/360
+ * 3 Actual/365
+ * 4 European 30/360
+ *
+ * @return float|string Result, or a string containing an error
+ */
+ public static function yieldAtMaturity(
+ mixed $settlement,
+ mixed $maturity,
+ mixed $issue,
+ mixed $rate,
+ mixed $price,
+ mixed $basis = FinancialConstants::BASIS_DAYS_PER_YEAR_NASD
+ ) {
+ $settlement = Functions::flattenSingleValue($settlement);
+ $maturity = Functions::flattenSingleValue($maturity);
+ $issue = Functions::flattenSingleValue($issue);
+ $rate = Functions::flattenSingleValue($rate);
+ $price = Functions::flattenSingleValue($price);
+ $basis = ($basis === null)
+ ? FinancialConstants::BASIS_DAYS_PER_YEAR_NASD
+ : Functions::flattenSingleValue($basis);
+
+ try {
+ $settlement = SecurityValidations::validateSettlementDate($settlement);
+ $maturity = SecurityValidations::validateMaturityDate($maturity);
+ SecurityValidations::validateSecurityPeriod($settlement, $maturity);
+ $issue = SecurityValidations::validateIssueDate($issue);
+ $rate = SecurityValidations::validateRate($rate);
+ $price = SecurityValidations::validatePrice($price);
+ $basis = SecurityValidations::validateBasis($basis);
+ } catch (Exception $e) {
+ return $e->getMessage();
+ }
+
+ $daysPerYear = Helpers::daysPerYear(Functions::scalar(DateTimeExcel\DateParts::year($settlement)), $basis);
+ if (!is_numeric($daysPerYear)) {
+ return $daysPerYear;
+ }
+ $daysBetweenIssueAndSettlement = Functions::scalar(DateTimeExcel\YearFrac::fraction($issue, $settlement, $basis));
+ if (!is_numeric($daysBetweenIssueAndSettlement)) {
+ // return date error
+ return $daysBetweenIssueAndSettlement;
+ }
+ $daysBetweenIssueAndSettlement *= $daysPerYear;
+ $daysBetweenIssueAndMaturity = Functions::scalar(DateTimeExcel\YearFrac::fraction($issue, $maturity, $basis));
+ if (!is_numeric($daysBetweenIssueAndMaturity)) {
+ // return date error
+ return $daysBetweenIssueAndMaturity;
+ }
+ $daysBetweenIssueAndMaturity *= $daysPerYear;
+ $daysBetweenSettlementAndMaturity = Functions::scalar(DateTimeExcel\YearFrac::fraction($settlement, $maturity, $basis));
+ if (!is_numeric($daysBetweenSettlementAndMaturity)) {
+ // return date error
+ return $daysBetweenSettlementAndMaturity;
+ }
+ $daysBetweenSettlementAndMaturity *= $daysPerYear;
+
+ return ((1 + (($daysBetweenIssueAndMaturity / $daysPerYear) * $rate)
+ - (($price / 100) + (($daysBetweenIssueAndSettlement / $daysPerYear) * $rate)))
+ / (($price / 100) + (($daysBetweenIssueAndSettlement / $daysPerYear) * $rate)))
+ * ($daysPerYear / $daysBetweenSettlementAndMaturity);
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/TreasuryBill.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/TreasuryBill.php
new file mode 100644
index 0000000..699efcc
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Financial/TreasuryBill.php
@@ -0,0 +1,146 @@
+getMessage();
+ }
+
+ if ($discount <= 0) {
+ return ExcelError::NAN();
+ }
+
+ $daysBetweenSettlementAndMaturity = $maturity - $settlement;
+ $daysPerYear = Helpers::daysPerYear(
+ Functions::scalar(DateTimeExcel\DateParts::year($maturity)),
+ FinancialConstants::BASIS_DAYS_PER_YEAR_ACTUAL
+ );
+
+ if ($daysBetweenSettlementAndMaturity > $daysPerYear || $daysBetweenSettlementAndMaturity < 0) {
+ return ExcelError::NAN();
+ }
+
+ return (365 * $discount) / (360 - $discount * $daysBetweenSettlementAndMaturity);
+ }
+
+ /**
+ * TBILLPRICE.
+ *
+ * Returns the price per $100 face value for a Treasury bill.
+ *
+ * @param mixed $settlement The Treasury bill's settlement date.
+ * The Treasury bill's settlement date is the date after the issue date
+ * when the Treasury bill is traded to the buyer.
+ * @param mixed $maturity The Treasury bill's maturity date.
+ * The maturity date is the date when the Treasury bill expires.
+ * @param mixed $discount The Treasury bill's discount rate
+ *
+ * @return float|string Result, or a string containing an error
+ */
+ public static function price(mixed $settlement, mixed $maturity, mixed $discount): string|float
+ {
+ $settlement = Functions::flattenSingleValue($settlement);
+ $maturity = Functions::flattenSingleValue($maturity);
+ $discount = Functions::flattenSingleValue($discount);
+
+ try {
+ $settlement = FinancialValidations::validateSettlementDate($settlement);
+ $maturity = FinancialValidations::validateMaturityDate($maturity);
+ $discount = FinancialValidations::validateFloat($discount);
+ } catch (Exception $e) {
+ return $e->getMessage();
+ }
+
+ if ($discount <= 0) {
+ return ExcelError::NAN();
+ }
+
+ $daysBetweenSettlementAndMaturity = $maturity - $settlement;
+ $daysPerYear = Helpers::daysPerYear(
+ Functions::scalar(DateTimeExcel\DateParts::year($maturity)),
+ FinancialConstants::BASIS_DAYS_PER_YEAR_ACTUAL
+ );
+
+ if ($daysBetweenSettlementAndMaturity > $daysPerYear || $daysBetweenSettlementAndMaturity < 0) {
+ return ExcelError::NAN();
+ }
+
+ $price = 100 * (1 - (($discount * $daysBetweenSettlementAndMaturity) / 360));
+ if ($price < 0.0) {
+ return ExcelError::NAN();
+ }
+
+ return $price;
+ }
+
+ /**
+ * TBILLYIELD.
+ *
+ * Returns the yield for a Treasury bill.
+ *
+ * @param mixed $settlement The Treasury bill's settlement date.
+ * The Treasury bill's settlement date is the date after the issue date when
+ * the Treasury bill is traded to the buyer.
+ * @param mixed $maturity The Treasury bill's maturity date.
+ * The maturity date is the date when the Treasury bill expires.
+ * @param float|string $price The Treasury bill's price per $100 face value
+ */
+ public static function yield(mixed $settlement, mixed $maturity, $price): string|float
+ {
+ $settlement = Functions::flattenSingleValue($settlement);
+ $maturity = Functions::flattenSingleValue($maturity);
+ $price = Functions::flattenSingleValue($price);
+
+ try {
+ $settlement = FinancialValidations::validateSettlementDate($settlement);
+ $maturity = FinancialValidations::validateMaturityDate($maturity);
+ $price = FinancialValidations::validatePrice($price);
+ } catch (Exception $e) {
+ return $e->getMessage();
+ }
+
+ $daysBetweenSettlementAndMaturity = $maturity - $settlement;
+ $daysPerYear = Helpers::daysPerYear(
+ Functions::scalar(DateTimeExcel\DateParts::year($maturity)),
+ FinancialConstants::BASIS_DAYS_PER_YEAR_ACTUAL
+ );
+
+ if ($daysBetweenSettlementAndMaturity > $daysPerYear || $daysBetweenSettlementAndMaturity < 0) {
+ return ExcelError::NAN();
+ }
+
+ return ((100 - $price) / $price) * (360 / $daysBetweenSettlementAndMaturity);
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/FormulaParser.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/FormulaParser.php
new file mode 100644
index 0000000..9868b82
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/FormulaParser.php
@@ -0,0 +1,616 @@
+<';
+ const OPERATORS_POSTFIX = '%';
+
+ /**
+ * Formula.
+ */
+ private string $formula;
+
+ /**
+ * Tokens.
+ *
+ * @var FormulaToken[]
+ */
+ private array $tokens = [];
+
+ /**
+ * Create a new FormulaParser.
+ *
+ * @param ?string $formula Formula to parse
+ */
+ public function __construct(?string $formula = '')
+ {
+ // Check parameters
+ if ($formula === null) {
+ throw new Exception('Invalid parameter passed: formula');
+ }
+
+ // Initialise values
+ $this->formula = trim($formula);
+ // Parse!
+ $this->parseToTokens();
+ }
+
+ /**
+ * Get Formula.
+ */
+ public function getFormula(): string
+ {
+ return $this->formula;
+ }
+
+ /**
+ * Get Token.
+ *
+ * @param int $id Token id
+ */
+ public function getToken(int $id = 0): FormulaToken
+ {
+ if (isset($this->tokens[$id])) {
+ return $this->tokens[$id];
+ }
+
+ throw new Exception("Token with id $id does not exist.");
+ }
+
+ /**
+ * Get Token count.
+ */
+ public function getTokenCount(): int
+ {
+ return count($this->tokens);
+ }
+
+ /**
+ * Get Tokens.
+ *
+ * @return FormulaToken[]
+ */
+ public function getTokens(): array
+ {
+ return $this->tokens;
+ }
+
+ /**
+ * Parse to tokens.
+ */
+ private function parseToTokens(): void
+ {
+ // No attempt is made to verify formulas; assumes formulas are derived from Excel, where
+ // they can only exist if valid; stack overflows/underflows sunk as nulls without exceptions.
+
+ // Check if the formula has a valid starting =
+ $formulaLength = strlen($this->formula);
+ if ($formulaLength < 2 || $this->formula[0] != '=') {
+ return;
+ }
+
+ // Helper variables
+ $tokens1 = $tokens2 = $stack = [];
+ $inString = $inPath = $inRange = $inError = false;
+ $nextToken = null;
+ //$token = $previousToken = null;
+
+ $index = 1;
+ $value = '';
+
+ $ERRORS = ['#NULL!', '#DIV/0!', '#VALUE!', '#REF!', '#NAME?', '#NUM!', '#N/A'];
+ $COMPARATORS_MULTI = ['>=', '<=', '<>'];
+
+ while ($index < $formulaLength) {
+ // state-dependent character evaluation (order is important)
+
+ // double-quoted strings
+ // embeds are doubled
+ // end marks token
+ if ($inString) {
+ if ($this->formula[$index] == self::QUOTE_DOUBLE) {
+ if ((($index + 2) <= $formulaLength) && ($this->formula[$index + 1] == self::QUOTE_DOUBLE)) {
+ $value .= self::QUOTE_DOUBLE;
+ ++$index;
+ } else {
+ $inString = false;
+ $tokens1[] = new FormulaToken($value, FormulaToken::TOKEN_TYPE_OPERAND, FormulaToken::TOKEN_SUBTYPE_TEXT);
+ $value = '';
+ }
+ } else {
+ $value .= $this->formula[$index];
+ }
+ ++$index;
+
+ continue;
+ }
+
+ // single-quoted strings (links)
+ // embeds are double
+ // end does not mark a token
+ if ($inPath) {
+ if ($this->formula[$index] == self::QUOTE_SINGLE) {
+ if ((($index + 2) <= $formulaLength) && ($this->formula[$index + 1] == self::QUOTE_SINGLE)) {
+ $value .= self::QUOTE_SINGLE;
+ ++$index;
+ } else {
+ $inPath = false;
+ }
+ } else {
+ $value .= $this->formula[$index];
+ }
+ ++$index;
+
+ continue;
+ }
+
+ // bracked strings (R1C1 range index or linked workbook name)
+ // no embeds (changed to "()" by Excel)
+ // end does not mark a token
+ if ($inRange) {
+ if ($this->formula[$index] == self::BRACKET_CLOSE) {
+ $inRange = false;
+ }
+ $value .= $this->formula[$index];
+ ++$index;
+
+ continue;
+ }
+
+ // error values
+ // end marks a token, determined from absolute list of values
+ if ($inError) {
+ $value .= $this->formula[$index];
+ ++$index;
+ if (in_array($value, $ERRORS)) {
+ $inError = false;
+ $tokens1[] = new FormulaToken($value, FormulaToken::TOKEN_TYPE_OPERAND, FormulaToken::TOKEN_SUBTYPE_ERROR);
+ $value = '';
+ }
+
+ continue;
+ }
+
+ // scientific notation check
+ if (str_contains(self::OPERATORS_SN, $this->formula[$index])) {
+ if (strlen($value) > 1) {
+ if (preg_match('/^[1-9]{1}(\\.\\d+)?E{1}$/', $this->formula[$index]) != 0) {
+ $value .= $this->formula[$index];
+ ++$index;
+
+ continue;
+ }
+ }
+ }
+
+ // independent character evaluation (order not important)
+
+ // establish state-dependent character evaluations
+ if ($this->formula[$index] == self::QUOTE_DOUBLE) {
+ if ($value !== '') {
+ // unexpected
+ $tokens1[] = new FormulaToken($value, FormulaToken::TOKEN_TYPE_UNKNOWN);
+ $value = '';
+ }
+ $inString = true;
+ ++$index;
+
+ continue;
+ }
+
+ if ($this->formula[$index] == self::QUOTE_SINGLE) {
+ if ($value !== '') {
+ // unexpected
+ $tokens1[] = new FormulaToken($value, FormulaToken::TOKEN_TYPE_UNKNOWN);
+ $value = '';
+ }
+ $inPath = true;
+ ++$index;
+
+ continue;
+ }
+
+ if ($this->formula[$index] == self::BRACKET_OPEN) {
+ $inRange = true;
+ $value .= self::BRACKET_OPEN;
+ ++$index;
+
+ continue;
+ }
+
+ if ($this->formula[$index] == self::ERROR_START) {
+ if ($value !== '') {
+ // unexpected
+ $tokens1[] = new FormulaToken($value, FormulaToken::TOKEN_TYPE_UNKNOWN);
+ $value = '';
+ }
+ $inError = true;
+ $value .= self::ERROR_START;
+ ++$index;
+
+ continue;
+ }
+
+ // mark start and end of arrays and array rows
+ if ($this->formula[$index] == self::BRACE_OPEN) {
+ if ($value !== '') {
+ // unexpected
+ $tokens1[] = new FormulaToken($value, FormulaToken::TOKEN_TYPE_UNKNOWN);
+ $value = '';
+ }
+
+ $tmp = new FormulaToken('ARRAY', FormulaToken::TOKEN_TYPE_FUNCTION, FormulaToken::TOKEN_SUBTYPE_START);
+ $tokens1[] = $tmp;
+ $stack[] = clone $tmp;
+
+ $tmp = new FormulaToken('ARRAYROW', FormulaToken::TOKEN_TYPE_FUNCTION, FormulaToken::TOKEN_SUBTYPE_START);
+ $tokens1[] = $tmp;
+ $stack[] = clone $tmp;
+
+ ++$index;
+
+ continue;
+ }
+
+ if ($this->formula[$index] == self::SEMICOLON) {
+ if ($value !== '') {
+ $tokens1[] = new FormulaToken($value, FormulaToken::TOKEN_TYPE_OPERAND);
+ $value = '';
+ }
+
+ /** @var FormulaToken $tmp */
+ $tmp = array_pop($stack);
+ $tmp->setValue('');
+ $tmp->setTokenSubType(FormulaToken::TOKEN_SUBTYPE_STOP);
+ $tokens1[] = $tmp;
+
+ $tmp = new FormulaToken(',', FormulaToken::TOKEN_TYPE_ARGUMENT);
+ $tokens1[] = $tmp;
+
+ $tmp = new FormulaToken('ARRAYROW', FormulaToken::TOKEN_TYPE_FUNCTION, FormulaToken::TOKEN_SUBTYPE_START);
+ $tokens1[] = $tmp;
+ $stack[] = clone $tmp;
+
+ ++$index;
+
+ continue;
+ }
+
+ if ($this->formula[$index] == self::BRACE_CLOSE) {
+ if ($value !== '') {
+ $tokens1[] = new FormulaToken($value, FormulaToken::TOKEN_TYPE_OPERAND);
+ $value = '';
+ }
+
+ /** @var FormulaToken $tmp */
+ $tmp = array_pop($stack);
+ $tmp->setValue('');
+ $tmp->setTokenSubType(FormulaToken::TOKEN_SUBTYPE_STOP);
+ $tokens1[] = $tmp;
+
+ /** @var FormulaToken $tmp */
+ $tmp = array_pop($stack);
+ $tmp->setValue('');
+ $tmp->setTokenSubType(FormulaToken::TOKEN_SUBTYPE_STOP);
+ $tokens1[] = $tmp;
+
+ ++$index;
+
+ continue;
+ }
+
+ // trim white-space
+ if ($this->formula[$index] == self::WHITESPACE) {
+ if ($value !== '') {
+ $tokens1[] = new FormulaToken($value, FormulaToken::TOKEN_TYPE_OPERAND);
+ $value = '';
+ }
+ $tokens1[] = new FormulaToken('', FormulaToken::TOKEN_TYPE_WHITESPACE);
+ ++$index;
+ while (($this->formula[$index] == self::WHITESPACE) && ($index < $formulaLength)) {
+ ++$index;
+ }
+
+ continue;
+ }
+
+ // multi-character comparators
+ if (($index + 2) <= $formulaLength) {
+ if (in_array(substr($this->formula, $index, 2), $COMPARATORS_MULTI)) {
+ if ($value !== '') {
+ $tokens1[] = new FormulaToken($value, FormulaToken::TOKEN_TYPE_OPERAND);
+ $value = '';
+ }
+ $tokens1[] = new FormulaToken(substr($this->formula, $index, 2), FormulaToken::TOKEN_TYPE_OPERATORINFIX, FormulaToken::TOKEN_SUBTYPE_LOGICAL);
+ $index += 2;
+
+ continue;
+ }
+ }
+
+ // standard infix operators
+ if (str_contains(self::OPERATORS_INFIX, $this->formula[$index])) {
+ if ($value !== '') {
+ $tokens1[] = new FormulaToken($value, FormulaToken::TOKEN_TYPE_OPERAND);
+ $value = '';
+ }
+ $tokens1[] = new FormulaToken($this->formula[$index], FormulaToken::TOKEN_TYPE_OPERATORINFIX);
+ ++$index;
+
+ continue;
+ }
+
+ // standard postfix operators (only one)
+ if (str_contains(self::OPERATORS_POSTFIX, $this->formula[$index])) {
+ if ($value !== '') {
+ $tokens1[] = new FormulaToken($value, FormulaToken::TOKEN_TYPE_OPERAND);
+ $value = '';
+ }
+ $tokens1[] = new FormulaToken($this->formula[$index], FormulaToken::TOKEN_TYPE_OPERATORPOSTFIX);
+ ++$index;
+
+ continue;
+ }
+
+ // start subexpression or function
+ if ($this->formula[$index] == self::PAREN_OPEN) {
+ if ($value !== '') {
+ $tmp = new FormulaToken($value, FormulaToken::TOKEN_TYPE_FUNCTION, FormulaToken::TOKEN_SUBTYPE_START);
+ $tokens1[] = $tmp;
+ $stack[] = clone $tmp;
+ $value = '';
+ } else {
+ $tmp = new FormulaToken('', FormulaToken::TOKEN_TYPE_SUBEXPRESSION, FormulaToken::TOKEN_SUBTYPE_START);
+ $tokens1[] = $tmp;
+ $stack[] = clone $tmp;
+ }
+ ++$index;
+
+ continue;
+ }
+
+ // function, subexpression, or array parameters, or operand unions
+ if ($this->formula[$index] == self::COMMA) {
+ if ($value !== '') {
+ $tokens1[] = new FormulaToken($value, FormulaToken::TOKEN_TYPE_OPERAND);
+ $value = '';
+ }
+
+ /** @var FormulaToken $tmp */
+ $tmp = array_pop($stack);
+ $tmp->setValue('');
+ $tmp->setTokenSubType(FormulaToken::TOKEN_SUBTYPE_STOP);
+ $stack[] = $tmp;
+
+ if ($tmp->getTokenType() == FormulaToken::TOKEN_TYPE_FUNCTION) {
+ $tokens1[] = new FormulaToken(',', FormulaToken::TOKEN_TYPE_OPERATORINFIX, FormulaToken::TOKEN_SUBTYPE_UNION);
+ } else {
+ $tokens1[] = new FormulaToken(',', FormulaToken::TOKEN_TYPE_ARGUMENT);
+ }
+ ++$index;
+
+ continue;
+ }
+
+ // stop subexpression
+ if ($this->formula[$index] == self::PAREN_CLOSE) {
+ if ($value !== '') {
+ $tokens1[] = new FormulaToken($value, FormulaToken::TOKEN_TYPE_OPERAND);
+ $value = '';
+ }
+
+ /** @var FormulaToken $tmp */
+ $tmp = array_pop($stack);
+ $tmp->setValue('');
+ $tmp->setTokenSubType(FormulaToken::TOKEN_SUBTYPE_STOP);
+ $tokens1[] = $tmp;
+
+ ++$index;
+
+ continue;
+ }
+
+ // token accumulation
+ $value .= $this->formula[$index];
+ ++$index;
+ }
+
+ // dump remaining accumulation
+ if ($value !== '') {
+ $tokens1[] = new FormulaToken($value, FormulaToken::TOKEN_TYPE_OPERAND);
+ }
+
+ // move tokenList to new set, excluding unnecessary white-space tokens and converting necessary ones to intersections
+ $tokenCount = count($tokens1);
+ for ($i = 0; $i < $tokenCount; ++$i) {
+ $token = $tokens1[$i];
+ if (isset($tokens1[$i - 1])) {
+ $previousToken = $tokens1[$i - 1];
+ } else {
+ $previousToken = null;
+ }
+ if (isset($tokens1[$i + 1])) {
+ $nextToken = $tokens1[$i + 1];
+ } else {
+ $nextToken = null;
+ }
+
+ if ($token->getTokenType() != FormulaToken::TOKEN_TYPE_WHITESPACE) {
+ $tokens2[] = $token;
+
+ continue;
+ }
+
+ if ($previousToken === null) {
+ continue;
+ }
+
+ if (
+ !(
+ (($previousToken->getTokenType() == FormulaToken::TOKEN_TYPE_FUNCTION) && ($previousToken->getTokenSubType() == FormulaToken::TOKEN_SUBTYPE_STOP))
+ || (($previousToken->getTokenType() == FormulaToken::TOKEN_TYPE_SUBEXPRESSION) && ($previousToken->getTokenSubType() == FormulaToken::TOKEN_SUBTYPE_STOP))
+ || ($previousToken->getTokenType() == FormulaToken::TOKEN_TYPE_OPERAND)
+ )
+ ) {
+ continue;
+ }
+
+ if ($nextToken === null) {
+ continue;
+ }
+
+ if (
+ !(
+ (($nextToken->getTokenType() == FormulaToken::TOKEN_TYPE_FUNCTION) && ($nextToken->getTokenSubType() == FormulaToken::TOKEN_SUBTYPE_START))
+ || (($nextToken->getTokenType() == FormulaToken::TOKEN_TYPE_SUBEXPRESSION) && ($nextToken->getTokenSubType() == FormulaToken::TOKEN_SUBTYPE_START))
+ || ($nextToken->getTokenType() == FormulaToken::TOKEN_TYPE_OPERAND)
+ )
+ ) {
+ continue;
+ }
+
+ $tokens2[] = new FormulaToken($value, FormulaToken::TOKEN_TYPE_OPERATORINFIX, FormulaToken::TOKEN_SUBTYPE_INTERSECTION);
+ }
+
+ // move tokens to final list, switching infix "-" operators to prefix when appropriate, switching infix "+" operators
+ // to noop when appropriate, identifying operand and infix-operator subtypes, and pulling "@" from function names
+ $this->tokens = [];
+
+ $tokenCount = count($tokens2);
+ for ($i = 0; $i < $tokenCount; ++$i) {
+ $token = $tokens2[$i];
+ if (isset($tokens2[$i - 1])) {
+ $previousToken = $tokens2[$i - 1];
+ } else {
+ $previousToken = null;
+ }
+
+ if ($token->getTokenType() == FormulaToken::TOKEN_TYPE_OPERATORINFIX && $token->getValue() == '-') {
+ if ($i == 0) {
+ $token->setTokenType(FormulaToken::TOKEN_TYPE_OPERATORPREFIX);
+ } elseif (
+ (($previousToken?->getTokenType() == FormulaToken::TOKEN_TYPE_FUNCTION)
+ && ($previousToken?->getTokenSubType() == FormulaToken::TOKEN_SUBTYPE_STOP))
+ || (($previousToken?->getTokenType() == FormulaToken::TOKEN_TYPE_SUBEXPRESSION)
+ && ($previousToken?->getTokenSubType() == FormulaToken::TOKEN_SUBTYPE_STOP))
+ || ($previousToken?->getTokenType() == FormulaToken::TOKEN_TYPE_OPERATORPOSTFIX)
+ || ($previousToken?->getTokenType() == FormulaToken::TOKEN_TYPE_OPERAND)
+ ) {
+ $token->setTokenSubType(FormulaToken::TOKEN_SUBTYPE_MATH);
+ } else {
+ $token->setTokenType(FormulaToken::TOKEN_TYPE_OPERATORPREFIX);
+ }
+
+ $this->tokens[] = $token;
+
+ continue;
+ }
+
+ if ($token->getTokenType() == FormulaToken::TOKEN_TYPE_OPERATORINFIX && $token->getValue() == '+') {
+ if ($i == 0) {
+ continue;
+ } elseif (
+ (($previousToken?->getTokenType() == FormulaToken::TOKEN_TYPE_FUNCTION)
+ && ($previousToken?->getTokenSubType() == FormulaToken::TOKEN_SUBTYPE_STOP))
+ || (($previousToken?->getTokenType() == FormulaToken::TOKEN_TYPE_SUBEXPRESSION)
+ && ($previousToken?->getTokenSubType() == FormulaToken::TOKEN_SUBTYPE_STOP))
+ || ($previousToken?->getTokenType() == FormulaToken::TOKEN_TYPE_OPERATORPOSTFIX)
+ || ($previousToken?->getTokenType() == FormulaToken::TOKEN_TYPE_OPERAND)
+ ) {
+ $token->setTokenSubType(FormulaToken::TOKEN_SUBTYPE_MATH);
+ } else {
+ continue;
+ }
+
+ $this->tokens[] = $token;
+
+ continue;
+ }
+
+ if (
+ $token->getTokenType() == FormulaToken::TOKEN_TYPE_OPERATORINFIX
+ && $token->getTokenSubType() == FormulaToken::TOKEN_SUBTYPE_NOTHING
+ ) {
+ if (str_contains('<>=', substr($token->getValue(), 0, 1))) {
+ $token->setTokenSubType(FormulaToken::TOKEN_SUBTYPE_LOGICAL);
+ } elseif ($token->getValue() == '&') {
+ $token->setTokenSubType(FormulaToken::TOKEN_SUBTYPE_CONCATENATION);
+ } else {
+ $token->setTokenSubType(FormulaToken::TOKEN_SUBTYPE_MATH);
+ }
+
+ $this->tokens[] = $token;
+
+ continue;
+ }
+
+ if (
+ $token->getTokenType() == FormulaToken::TOKEN_TYPE_OPERAND
+ && $token->getTokenSubType() == FormulaToken::TOKEN_SUBTYPE_NOTHING
+ ) {
+ if (!is_numeric($token->getValue())) {
+ if (strtoupper($token->getValue()) == 'TRUE' || strtoupper($token->getValue()) == 'FALSE') {
+ $token->setTokenSubType(FormulaToken::TOKEN_SUBTYPE_LOGICAL);
+ } else {
+ $token->setTokenSubType(FormulaToken::TOKEN_SUBTYPE_RANGE);
+ }
+ } else {
+ $token->setTokenSubType(FormulaToken::TOKEN_SUBTYPE_NUMBER);
+ }
+
+ $this->tokens[] = $token;
+
+ continue;
+ }
+
+ if ($token->getTokenType() == FormulaToken::TOKEN_TYPE_FUNCTION) {
+ if ($token->getValue() !== '') {
+ if (str_starts_with($token->getValue(), '@')) {
+ $token->setValue(substr($token->getValue(), 1));
+ }
+ }
+ }
+
+ $this->tokens[] = $token;
+ }
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/FormulaToken.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/FormulaToken.php
new file mode 100644
index 0000000..cc7d48f
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/FormulaToken.php
@@ -0,0 +1,131 @@
+value = $value;
+ $this->tokenType = $tokenType;
+ $this->tokenSubType = $tokenSubType;
+ }
+
+ /**
+ * Get Value.
+ */
+ public function getValue(): string
+ {
+ return $this->value;
+ }
+
+ /**
+ * Set Value.
+ */
+ public function setValue(string $value): void
+ {
+ $this->value = $value;
+ }
+
+ /**
+ * Get Token Type (represented by TOKEN_TYPE_*).
+ */
+ public function getTokenType(): string
+ {
+ return $this->tokenType;
+ }
+
+ /**
+ * Set Token Type (represented by TOKEN_TYPE_*).
+ */
+ public function setTokenType(string $value): void
+ {
+ $this->tokenType = $value;
+ }
+
+ /**
+ * Get Token SubType (represented by TOKEN_SUBTYPE_*).
+ */
+ public function getTokenSubType(): string
+ {
+ return $this->tokenSubType;
+ }
+
+ /**
+ * Set Token SubType (represented by TOKEN_SUBTYPE_*).
+ */
+ public function setTokenSubType(string $value): void
+ {
+ $this->tokenSubType = $value;
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Functions.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Functions.php
new file mode 100644
index 0000000..6b74500
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Functions.php
@@ -0,0 +1,322 @@
+ 0);
+ }
+
+ public static function isValue(mixed $idx): bool
+ {
+ return substr_count($idx, '.') === 0;
+ }
+
+ public static function isCellValue(mixed $idx): bool
+ {
+ return substr_count($idx, '.') > 1;
+ }
+
+ public static function ifCondition(mixed $condition): string
+ {
+ $condition = self::flattenSingleValue($condition);
+
+ if ($condition === '' || $condition === null) {
+ return '=""';
+ }
+ if (!is_string($condition) || !in_array($condition[0], ['>', '<', '='], true)) {
+ $condition = self::operandSpecialHandling($condition);
+ if (is_bool($condition)) {
+ return '=' . ($condition ? 'TRUE' : 'FALSE');
+ } elseif (!is_numeric($condition)) {
+ if ($condition !== '""') { // Not an empty string
+ // Escape any quotes in the string value
+ $condition = (string) preg_replace('/"/ui', '""', $condition);
+ }
+ $condition = Calculation::wrapResult(strtoupper($condition));
+ }
+
+ return str_replace('""""', '""', '=' . $condition);
+ }
+ preg_match('/(=|<[>=]?|>=?)(.*)/', $condition, $matches);
+ [, $operator, $operand] = $matches;
+
+ $operand = self::operandSpecialHandling($operand);
+ if (is_numeric(trim($operand, '"'))) {
+ $operand = trim($operand, '"');
+ } elseif (!is_numeric($operand) && $operand !== 'FALSE' && $operand !== 'TRUE') {
+ $operand = str_replace('"', '""', $operand);
+ $operand = Calculation::wrapResult(strtoupper($operand));
+ }
+
+ return str_replace('""""', '""', $operator . $operand);
+ }
+
+ private static function operandSpecialHandling(mixed $operand): mixed
+ {
+ if (is_numeric($operand) || is_bool($operand)) {
+ return $operand;
+ } elseif (strtoupper($operand) === Calculation::getTRUE() || strtoupper($operand) === Calculation::getFALSE()) {
+ return strtoupper($operand);
+ }
+
+ // Check for percentage
+ if (preg_match('/^\-?\d*\.?\d*\s?\%$/', $operand)) {
+ return ((float) rtrim($operand, '%')) / 100;
+ }
+
+ // Check for dates
+ if (($dateValueOperand = Date::stringToExcel($operand)) !== false) {
+ return $dateValueOperand;
+ }
+
+ return $operand;
+ }
+
+ /**
+ * Convert a multi-dimensional array to a simple 1-dimensional array.
+ *
+ * @param mixed $array Array to be flattened
+ *
+ * @return array Flattened array
+ */
+ public static function flattenArray(mixed $array): array
+ {
+ if (!is_array($array)) {
+ return (array) $array;
+ }
+
+ $flattened = [];
+ $stack = array_values($array);
+
+ while (!empty($stack)) {
+ $value = array_shift($stack);
+
+ if (is_array($value)) {
+ array_unshift($stack, ...array_values($value));
+ } else {
+ $flattened[] = $value;
+ }
+ }
+
+ return $flattened;
+ }
+
+ public static function scalar(mixed $value): mixed
+ {
+ if (!is_array($value)) {
+ return $value;
+ }
+
+ do {
+ $value = array_pop($value);
+ } while (is_array($value));
+
+ return $value;
+ }
+
+ /**
+ * Convert a multi-dimensional array to a simple 1-dimensional array, but retain an element of indexing.
+ *
+ * @param array|mixed $array Array to be flattened
+ *
+ * @return array Flattened array
+ */
+ public static function flattenArrayIndexed($array): array
+ {
+ if (!is_array($array)) {
+ return (array) $array;
+ }
+
+ $arrayValues = [];
+ foreach ($array as $k1 => $value) {
+ if (is_array($value)) {
+ foreach ($value as $k2 => $val) {
+ if (is_array($val)) {
+ foreach ($val as $k3 => $v) {
+ $arrayValues[$k1 . '.' . $k2 . '.' . $k3] = $v;
+ }
+ } else {
+ $arrayValues[$k1 . '.' . $k2] = $val;
+ }
+ }
+ } else {
+ $arrayValues[$k1] = $value;
+ }
+ }
+
+ return $arrayValues;
+ }
+
+ /**
+ * Convert an array to a single scalar value by extracting the first element.
+ *
+ * @param mixed $value Array or scalar value
+ */
+ public static function flattenSingleValue(mixed $value): mixed
+ {
+ while (is_array($value)) {
+ $value = array_shift($value);
+ }
+
+ return $value;
+ }
+
+ public static function expandDefinedName(string $coordinate, Cell $cell): string
+ {
+ $worksheet = $cell->getWorksheet();
+ $spreadsheet = $worksheet->getParentOrThrow();
+ // Uppercase coordinate
+ $pCoordinatex = strtoupper($coordinate);
+ // Eliminate leading equal sign
+ $pCoordinatex = (string) preg_replace('/^=/', '', $pCoordinatex);
+ $defined = $spreadsheet->getDefinedName($pCoordinatex, $worksheet);
+ if ($defined !== null) {
+ $worksheet2 = $defined->getWorkSheet();
+ if (!$defined->isFormula() && $worksheet2 !== null) {
+ $coordinate = "'" . $worksheet2->getTitle() . "'!"
+ . (string) preg_replace('/^=/', '', str_replace('$', '', $defined->getValue()));
+ }
+ }
+
+ return $coordinate;
+ }
+
+ public static function trimTrailingRange(string $coordinate): string
+ {
+ return (string) preg_replace('/:[\\w\$]+$/', '', $coordinate);
+ }
+
+ public static function trimSheetFromCellReference(string $coordinate): string
+ {
+ if (str_contains($coordinate, '!')) {
+ $coordinate = substr($coordinate, strrpos($coordinate, '!') + 1);
+ }
+
+ return $coordinate;
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Information/ErrorValue.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Information/ErrorValue.php
new file mode 100644
index 0000000..dcef439
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Information/ErrorValue.php
@@ -0,0 +1,68 @@
+
+ */
+ public const ERROR_CODES = [
+ 'null' => '#NULL!', // 1
+ 'divisionbyzero' => '#DIV/0!', // 2
+ 'value' => '#VALUE!', // 3
+ 'reference' => '#REF!', // 4
+ 'name' => '#NAME?', // 5
+ 'num' => '#NUM!', // 6
+ 'na' => '#N/A', // 7
+ 'gettingdata' => '#GETTING_DATA', // 8
+ 'spill' => '#SPILL!', // 9
+ 'connect' => '#CONNECT!', //10
+ 'blocked' => '#BLOCKED!', //11
+ 'unknown' => '#UNKNOWN!', //12
+ 'field' => '#FIELD!', //13
+ 'calculation' => '#CALC!', //14
+ ];
+
+ public static function throwError(mixed $value): string
+ {
+ return in_array($value, self::ERROR_CODES, true) ? $value : self::ERROR_CODES['value'];
+ }
+
+ /**
+ * ERROR_TYPE.
+ *
+ * @param mixed $value Value to check
+ */
+ public static function type(mixed $value = ''): array|int|string
+ {
+ if (is_array($value)) {
+ return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $value);
+ }
+
+ $i = 1;
+ foreach (self::ERROR_CODES as $errorCode) {
+ if ($value === $errorCode) {
+ return $i;
+ }
+ ++$i;
+ }
+
+ return self::NA();
+ }
+
+ /**
+ * NULL.
+ *
+ * Returns the error value #NULL!
+ *
+ * @return string #NULL!
+ */
+ public static function null(): string
+ {
+ return self::ERROR_CODES['null'];
+ }
+
+ /**
+ * NaN.
+ *
+ * Returns the error value #NUM!
+ *
+ * @return string #NUM!
+ */
+ public static function NAN(): string
+ {
+ return self::ERROR_CODES['num'];
+ }
+
+ /**
+ * REF.
+ *
+ * Returns the error value #REF!
+ *
+ * @return string #REF!
+ */
+ public static function REF(): string
+ {
+ return self::ERROR_CODES['reference'];
+ }
+
+ /**
+ * NA.
+ *
+ * Excel Function:
+ * =NA()
+ *
+ * Returns the error value #N/A
+ * #N/A is the error value that means "no value is available."
+ *
+ * @return string #N/A!
+ */
+ public static function NA(): string
+ {
+ return self::ERROR_CODES['na'];
+ }
+
+ /**
+ * VALUE.
+ *
+ * Returns the error value #VALUE!
+ *
+ * @return string #VALUE!
+ */
+ public static function VALUE(): string
+ {
+ return self::ERROR_CODES['value'];
+ }
+
+ /**
+ * NAME.
+ *
+ * Returns the error value #NAME?
+ *
+ * @return string #NAME?
+ */
+ public static function NAME(): string
+ {
+ return self::ERROR_CODES['name'];
+ }
+
+ /**
+ * DIV0.
+ *
+ * @return string #DIV/0!
+ */
+ public static function DIV0(): string
+ {
+ return self::ERROR_CODES['divisionbyzero'];
+ }
+
+ /**
+ * CALC.
+ *
+ * @return string #CALC!
+ */
+ public static function CALC(): string
+ {
+ return self::ERROR_CODES['calculation'];
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Information/Value.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Information/Value.php
new file mode 100644
index 0000000..c9a7a0a
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Information/Value.php
@@ -0,0 +1,317 @@
+getCoordinate()) {
+ return false;
+ }
+
+ $cellValue = Functions::trimTrailingRange($value);
+ if (preg_match('/^' . Calculation::CALCULATION_REGEXP_CELLREF . '$/ui', $cellValue) === 1) {
+ [$worksheet, $cellValue] = Worksheet::extractSheetTitle($cellValue, true);
+ if (!empty($worksheet) && $cell->getWorksheet()->getParentOrThrow()->getSheetByName($worksheet) === null) {
+ return false;
+ }
+ [$column, $row] = Coordinate::indexesFromString($cellValue ?? '');
+ if ($column > 16384 || $row > 1048576) {
+ return false;
+ }
+
+ return true;
+ }
+
+ $namedRange = $cell->getWorksheet()->getParentOrThrow()->getNamedRange($value);
+
+ return $namedRange instanceof NamedRange;
+ }
+
+ /**
+ * IS_EVEN.
+ *
+ * @param mixed $value Value to check
+ * Or can be an array of values
+ *
+ * @return array|bool|string If an array of numbers is passed as an argument, then the returned result will also be an array
+ * with the same dimensions
+ */
+ public static function isEven(mixed $value = null): array|string|bool
+ {
+ if (is_array($value)) {
+ return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $value);
+ }
+
+ if ($value === null) {
+ return ExcelError::NAME();
+ } elseif ((is_bool($value)) || ((is_string($value)) && (!is_numeric($value)))) {
+ return ExcelError::VALUE();
+ }
+
+ return ((int) fmod($value, 2)) === 0;
+ }
+
+ /**
+ * IS_ODD.
+ *
+ * @param mixed $value Value to check
+ * Or can be an array of values
+ *
+ * @return array|bool|string If an array of numbers is passed as an argument, then the returned result will also be an array
+ * with the same dimensions
+ */
+ public static function isOdd(mixed $value = null): array|string|bool
+ {
+ if (is_array($value)) {
+ return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $value);
+ }
+
+ if ($value === null) {
+ return ExcelError::NAME();
+ } elseif ((is_bool($value)) || ((is_string($value)) && (!is_numeric($value)))) {
+ return ExcelError::VALUE();
+ }
+
+ return ((int) fmod($value, 2)) !== 0;
+ }
+
+ /**
+ * IS_NUMBER.
+ *
+ * @param mixed $value Value to check
+ * Or can be an array of values
+ *
+ * @return array|bool If an array of numbers is passed as an argument, then the returned result will also be an array
+ * with the same dimensions
+ */
+ public static function isNumber(mixed $value = null): array|bool
+ {
+ if (is_array($value)) {
+ return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $value);
+ }
+
+ if (is_string($value)) {
+ return false;
+ }
+
+ return is_numeric($value);
+ }
+
+ /**
+ * IS_LOGICAL.
+ *
+ * @param mixed $value Value to check
+ * Or can be an array of values
+ *
+ * @return array|bool If an array of numbers is passed as an argument, then the returned result will also be an array
+ * with the same dimensions
+ */
+ public static function isLogical(mixed $value = null): array|bool
+ {
+ if (is_array($value)) {
+ return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $value);
+ }
+
+ return is_bool($value);
+ }
+
+ /**
+ * IS_TEXT.
+ *
+ * @param mixed $value Value to check
+ * Or can be an array of values
+ *
+ * @return array|bool If an array of numbers is passed as an argument, then the returned result will also be an array
+ * with the same dimensions
+ */
+ public static function isText(mixed $value = null): array|bool
+ {
+ if (is_array($value)) {
+ return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $value);
+ }
+
+ return is_string($value) && !ErrorValue::isError($value);
+ }
+
+ /**
+ * IS_NONTEXT.
+ *
+ * @param mixed $value Value to check
+ * Or can be an array of values
+ *
+ * @return array|bool If an array of numbers is passed as an argument, then the returned result will also be an array
+ * with the same dimensions
+ */
+ public static function isNonText(mixed $value = null): array|bool
+ {
+ if (is_array($value)) {
+ return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $value);
+ }
+
+ return !self::isText($value);
+ }
+
+ /**
+ * ISFORMULA.
+ *
+ * @param mixed $cellReference The cell to check
+ * @param ?Cell $cell The current cell (containing this formula)
+ */
+ public static function isFormula(mixed $cellReference = '', ?Cell $cell = null): array|bool|string
+ {
+ if ($cell === null) {
+ return ExcelError::REF();
+ }
+
+ $fullCellReference = Functions::expandDefinedName((string) $cellReference, $cell);
+
+ if (str_contains($cellReference, '!')) {
+ $cellReference = Functions::trimSheetFromCellReference($cellReference);
+ $cellReferences = Coordinate::extractAllCellReferencesInRange($cellReference);
+ if (count($cellReferences) > 1) {
+ return self::evaluateArrayArgumentsSubset([self::class, __FUNCTION__], 1, $cellReferences, $cell);
+ }
+ }
+
+ $fullCellReference = Functions::trimTrailingRange($fullCellReference);
+
+ preg_match('/^' . Calculation::CALCULATION_REGEXP_CELLREF . '$/i', $fullCellReference, $matches);
+
+ $fullCellReference = $matches[6] . $matches[7];
+ $worksheetName = str_replace("''", "'", trim($matches[2], "'"));
+
+ $worksheet = (!empty($worksheetName))
+ ? $cell->getWorksheet()->getParentOrThrow()->getSheetByName($worksheetName)
+ : $cell->getWorksheet();
+
+ return ($worksheet !== null) ? $worksheet->getCell($fullCellReference)->isFormula() : ExcelError::REF();
+ }
+
+ /**
+ * N.
+ *
+ * Returns a value converted to a number
+ *
+ * @param null|mixed $value The value you want converted
+ *
+ * @return number|string N converts values listed in the following table
+ * If value is or refers to N returns
+ * A number That number value
+ * A date The Excel serialized number of that date
+ * TRUE 1
+ * FALSE 0
+ * An error value The error value
+ * Anything else 0
+ */
+ public static function asNumber($value = null)
+ {
+ while (is_array($value)) {
+ $value = array_shift($value);
+ }
+
+ switch (gettype($value)) {
+ case 'double':
+ case 'float':
+ case 'integer':
+ return $value;
+ case 'boolean':
+ return (int) $value;
+ case 'string':
+ // Errors
+ if (($value !== '') && ($value[0] == '#')) {
+ return $value;
+ }
+
+ break;
+ }
+
+ return 0;
+ }
+
+ /**
+ * TYPE.
+ *
+ * Returns a number that identifies the type of a value
+ *
+ * @param null|mixed $value The value you want tested
+ *
+ * @return int N converts values listed in the following table
+ * If value is or refers to N returns
+ * A number 1
+ * Text 2
+ * Logical Value 4
+ * An error value 16
+ * Array or Matrix 64
+ */
+ public static function type($value = null): int
+ {
+ $value = Functions::flattenArrayIndexed($value);
+ if (is_array($value) && (count($value) > 1)) {
+ end($value);
+ $a = key($value);
+ // Range of cells is an error
+ if (Functions::isCellValue($a)) {
+ return 16;
+ // Test for Matrix
+ } elseif (Functions::isMatrixValue($a)) {
+ return 64;
+ }
+ } elseif (empty($value)) {
+ // Empty Cell
+ return 1;
+ }
+
+ $value = Functions::flattenSingleValue($value);
+ if (($value === null) || (is_float($value)) || (is_int($value))) {
+ return 1;
+ } elseif (is_bool($value)) {
+ return 4;
+ } elseif (is_array($value)) {
+ return 64;
+ } elseif (is_string($value)) {
+ // Errors
+ if (($value !== '') && ($value[0] == '#')) {
+ return 16;
+ }
+
+ return 2;
+ }
+
+ return 0;
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Internal/MakeMatrix.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Internal/MakeMatrix.php
new file mode 100644
index 0000000..22c95e8
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Internal/MakeMatrix.php
@@ -0,0 +1,12 @@
+ 0) {
+ $targetValue = Functions::flattenSingleValue($arguments[0]);
+ $argc = count($arguments) - 1;
+ $switchCount = floor($argc / 2);
+ $hasDefaultClause = $argc % 2 !== 0;
+ $defaultClause = $argc % 2 === 0 ? null : $arguments[$argc];
+
+ $switchSatisfied = false;
+ if ($switchCount > 0) {
+ for ($index = 0; $index < $switchCount; ++$index) {
+ if ($targetValue == Functions::flattenSingleValue($arguments[$index * 2 + 1])) {
+ $result = $arguments[$index * 2 + 2];
+ $switchSatisfied = true;
+
+ break;
+ }
+ }
+ }
+
+ if ($switchSatisfied !== true) {
+ $result = $hasDefaultClause ? $defaultClause : ExcelError::NA();
+ }
+ }
+
+ return $result;
+ }
+
+ /**
+ * IFERROR.
+ *
+ * Excel Function:
+ * =IFERROR(testValue,errorpart)
+ *
+ * @param mixed $testValue Value to check, is also the value returned when no error
+ * Or can be an array of values
+ * @param mixed $errorpart Value to return when testValue is an error condition
+ * Note that this can be an array value to be returned
+ *
+ * @return mixed The value of errorpart or testValue determined by error condition
+ * If an array of values is passed as the $testValue argument, then the returned result will also be
+ * an array with the same dimensions
+ */
+ public static function IFERROR(mixed $testValue = '', mixed $errorpart = ''): mixed
+ {
+ if (is_array($testValue)) {
+ return self::evaluateArrayArgumentsSubset([self::class, __FUNCTION__], 1, $testValue, $errorpart);
+ }
+
+ $errorpart = $errorpart ?? '';
+ $testValue = $testValue ?? 0; // this is how Excel handles empty cell
+
+ return self::statementIf(ErrorValue::isError($testValue), $errorpart, $testValue);
+ }
+
+ /**
+ * IFNA.
+ *
+ * Excel Function:
+ * =IFNA(testValue,napart)
+ *
+ * @param mixed $testValue Value to check, is also the value returned when not an NA
+ * Or can be an array of values
+ * @param mixed $napart Value to return when testValue is an NA condition
+ * Note that this can be an array value to be returned
+ *
+ * @return mixed The value of errorpart or testValue determined by error condition
+ * If an array of values is passed as the $testValue argument, then the returned result will also be
+ * an array with the same dimensions
+ */
+ public static function IFNA(mixed $testValue = '', mixed $napart = ''): mixed
+ {
+ if (is_array($testValue)) {
+ return self::evaluateArrayArgumentsSubset([self::class, __FUNCTION__], 1, $testValue, $napart);
+ }
+
+ $napart = $napart ?? '';
+ $testValue = $testValue ?? 0; // this is how Excel handles empty cell
+
+ return self::statementIf(ErrorValue::isNa($testValue), $napart, $testValue);
+ }
+
+ /**
+ * IFS.
+ *
+ * Excel Function:
+ * =IFS(testValue1;returnIfTrue1;testValue2;returnIfTrue2;...;testValue_n;returnIfTrue_n)
+ *
+ * testValue1 ... testValue_n
+ * Conditions to Evaluate
+ * returnIfTrue1 ... returnIfTrue_n
+ * Value returned if corresponding testValue (nth) was true
+ *
+ * @param mixed ...$arguments Statement arguments
+ * Note that this can be an array value to be returned
+ *
+ * @return mixed|string The value of returnIfTrue_n, if testValue_n was true. #N/A if none of testValues was true
+ */
+ public static function IFS(mixed ...$arguments)
+ {
+ $argumentCount = count($arguments);
+
+ if ($argumentCount % 2 != 0) {
+ return ExcelError::NA();
+ }
+ // We use instance of Exception as a falseValue in order to prevent string collision with value in cell
+ $falseValueException = new Exception();
+ for ($i = 0; $i < $argumentCount; $i += 2) {
+ $testValue = ($arguments[$i] === null) ? '' : Functions::flattenSingleValue($arguments[$i]);
+ $returnIfTrue = ($arguments[$i + 1] === null) ? '' : $arguments[$i + 1];
+ $result = self::statementIf($testValue, $returnIfTrue, $falseValueException);
+
+ if ($result !== $falseValueException) {
+ return $result;
+ }
+ }
+
+ return ExcelError::NA();
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Logical/Operations.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Logical/Operations.php
new file mode 100644
index 0000000..16bb5dd
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Logical/Operations.php
@@ -0,0 +1,163 @@
+ $trueValueCount === $count);
+ }
+
+ /**
+ * LOGICAL_OR.
+ *
+ * Returns boolean TRUE if any argument is TRUE; returns FALSE if all arguments are FALSE.
+ *
+ * Excel Function:
+ * =OR(logical1[,logical2[, ...]])
+ *
+ * The arguments must evaluate to logical values such as TRUE or FALSE, or the arguments must be arrays
+ * or references that contain logical values.
+ *
+ * Boolean arguments are treated as True or False as appropriate
+ * Integer or floating point arguments are treated as True, except for 0 or 0.0 which are False
+ * If any argument value is a string, or a Null, the function returns a #VALUE! error, unless the string
+ * holds the value TRUE or FALSE, in which case it is evaluated as the corresponding boolean value
+ *
+ * @param mixed $args Data values
+ *
+ * @return bool|string the logical OR of the arguments
+ */
+ public static function logicalOr(mixed ...$args)
+ {
+ return self::countTrueValues($args, fn (int $trueValueCount): bool => $trueValueCount > 0);
+ }
+
+ /**
+ * LOGICAL_XOR.
+ *
+ * Returns the Exclusive Or logical operation for one or more supplied conditions.
+ * i.e. the Xor function returns TRUE if an odd number of the supplied conditions evaluate to TRUE,
+ * and FALSE otherwise.
+ *
+ * Excel Function:
+ * =XOR(logical1[,logical2[, ...]])
+ *
+ * The arguments must evaluate to logical values such as TRUE or FALSE, or the arguments must be arrays
+ * or references that contain logical values.
+ *
+ * Boolean arguments are treated as True or False as appropriate
+ * Integer or floating point arguments are treated as True, except for 0 or 0.0 which are False
+ * If any argument value is a string, or a Null, the function returns a #VALUE! error, unless the string
+ * holds the value TRUE or FALSE, in which case it is evaluated as the corresponding boolean value
+ *
+ * @param mixed $args Data values
+ *
+ * @return bool|string the logical XOR of the arguments
+ */
+ public static function logicalXor(mixed ...$args)
+ {
+ return self::countTrueValues($args, fn (int $trueValueCount): bool => $trueValueCount % 2 === 1);
+ }
+
+ /**
+ * NOT.
+ *
+ * Returns the boolean inverse of the argument.
+ *
+ * Excel Function:
+ * =NOT(logical)
+ *
+ * The argument must evaluate to a logical value such as TRUE or FALSE
+ *
+ * Boolean arguments are treated as True or False as appropriate
+ * Integer or floating point arguments are treated as True, except for 0 or 0.0 which are False
+ * If any argument value is a string, or a Null, the function returns a #VALUE! error, unless the string
+ * holds the value TRUE or FALSE, in which case it is evaluated as the corresponding boolean value
+ *
+ * @param mixed $logical A value or expression that can be evaluated to TRUE or FALSE
+ * Or can be an array of values
+ *
+ * @return array|bool|string the boolean inverse of the argument
+ * If an array of values is passed as an argument, then the returned result will also be an array
+ * with the same dimensions
+ */
+ public static function NOT(mixed $logical = false): array|bool|string
+ {
+ if (is_array($logical)) {
+ return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $logical);
+ }
+
+ if (is_string($logical)) {
+ $logical = mb_strtoupper($logical, 'UTF-8');
+ if (($logical == 'TRUE') || ($logical == Calculation::getTRUE())) {
+ return false;
+ } elseif (($logical == 'FALSE') || ($logical == Calculation::getFALSE())) {
+ return true;
+ }
+
+ return ExcelError::VALUE();
+ }
+
+ return !$logical;
+ }
+
+ private static function countTrueValues(array $args, callable $func): bool|string
+ {
+ $trueValueCount = 0;
+ $count = 0;
+
+ $aArgs = Functions::flattenArrayIndexed($args);
+ foreach ($aArgs as $k => $arg) {
+ ++$count;
+ // Is it a boolean value?
+ if (is_bool($arg)) {
+ $trueValueCount += $arg;
+ } elseif (is_string($arg)) {
+ $isLiteral = !Functions::isCellValue($k);
+ $arg = mb_strtoupper($arg, 'UTF-8');
+ if ($isLiteral && ($arg == 'TRUE' || $arg == Calculation::getTRUE())) {
+ ++$trueValueCount;
+ } elseif ($isLiteral && ($arg == 'FALSE' || $arg == Calculation::getFALSE())) {
+ //$trueValueCount += 0;
+ } else {
+ --$count;
+ }
+ } elseif (is_int($arg) || is_float($arg)) {
+ $trueValueCount += (int) ($arg != 0);
+ } else {
+ --$count;
+ }
+ }
+
+ return ($count === 0) ? ExcelError::VALUE() : $func($trueValueCount, $count);
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/Address.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/Address.php
new file mode 100644
index 0000000..0a5347b
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/Address.php
@@ -0,0 +1,123 @@
+ '') {
+ if (str_contains($sheetName, ' ') || str_contains($sheetName, '[')) {
+ $sheetName = "'{$sheetName}'";
+ }
+ $sheetName .= '!';
+ }
+
+ return $sheetName;
+ }
+
+ private static function formatAsA1(int $row, int $column, int $relativity, string $sheetName): string
+ {
+ $rowRelative = $columnRelative = '$';
+ if (($relativity == self::ADDRESS_COLUMN_RELATIVE) || ($relativity == self::ADDRESS_RELATIVE)) {
+ $columnRelative = '';
+ }
+ if (($relativity == self::ADDRESS_ROW_RELATIVE) || ($relativity == self::ADDRESS_RELATIVE)) {
+ $rowRelative = '';
+ }
+ $column = Coordinate::stringFromColumnIndex($column);
+
+ return "{$sheetName}{$columnRelative}{$column}{$rowRelative}{$row}";
+ }
+
+ private static function formatAsR1C1(int $row, int $column, int $relativity, string $sheetName): string
+ {
+ if (($relativity == self::ADDRESS_COLUMN_RELATIVE) || ($relativity == self::ADDRESS_RELATIVE)) {
+ $column = "[{$column}]";
+ }
+ if (($relativity == self::ADDRESS_ROW_RELATIVE) || ($relativity == self::ADDRESS_RELATIVE)) {
+ $row = "[{$row}]";
+ }
+ [$rowChar, $colChar] = AddressHelper::getRowAndColumnChars();
+
+ return "{$sheetName}$rowChar{$row}$colChar{$column}";
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/ExcelMatch.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/ExcelMatch.php
new file mode 100644
index 0000000..43e89c9
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/ExcelMatch.php
@@ -0,0 +1,249 @@
+getMessage();
+ }
+
+ // MATCH() is not case sensitive, so we convert lookup value to be lower cased if it's a string type.
+ if (is_string($lookupValue)) {
+ $lookupValue = StringHelper::strToLower($lookupValue);
+ }
+
+ $valueKey = match ($matchType) {
+ self::MATCHTYPE_LARGEST_VALUE => self::matchLargestValue($lookupArray, $lookupValue, $keySet),
+ self::MATCHTYPE_FIRST_VALUE => self::matchFirstValue($lookupArray, $lookupValue),
+ default => self::matchSmallestValue($lookupArray, $lookupValue),
+ };
+
+ if ($valueKey !== null) {
+ return ++$valueKey;
+ }
+
+ // Unsuccessful in finding a match, return #N/A error value
+ return ExcelError::NA();
+ }
+
+ private static function matchFirstValue(array $lookupArray, mixed $lookupValue): int|string|null
+ {
+ if (is_string($lookupValue)) {
+ $valueIsString = true;
+ $wildcard = WildcardMatch::wildcard($lookupValue);
+ } else {
+ $valueIsString = false;
+ $wildcard = '';
+ }
+
+ $valueIsNumeric = is_int($lookupValue) || is_float($lookupValue);
+ foreach ($lookupArray as $i => $lookupArrayValue) {
+ if (
+ $valueIsString
+ && is_string($lookupArrayValue)
+ ) {
+ if (WildcardMatch::compare($lookupArrayValue, $wildcard)) {
+ return $i; // wildcard match
+ }
+ } else {
+ if ($lookupArrayValue === $lookupValue) {
+ return $i; // exact match
+ }
+ if (
+ $valueIsNumeric
+ && (is_float($lookupArrayValue) || is_int($lookupArrayValue))
+ && $lookupArrayValue == $lookupValue
+ ) {
+ return $i; // exact match
+ }
+ }
+ }
+
+ return null;
+ }
+
+ private static function matchLargestValue(array $lookupArray, mixed $lookupValue, array $keySet): mixed
+ {
+ if (is_string($lookupValue)) {
+ if (Functions::getCompatibilityMode() === Functions::COMPATIBILITY_OPENOFFICE) {
+ $wildcard = WildcardMatch::wildcard($lookupValue);
+ foreach (array_reverse($lookupArray) as $i => $lookupArrayValue) {
+ if (is_string($lookupArrayValue) && WildcardMatch::compare($lookupArrayValue, $wildcard)) {
+ return $i;
+ }
+ }
+ } else {
+ foreach ($lookupArray as $i => $lookupArrayValue) {
+ if ($lookupArrayValue === $lookupValue) {
+ return $keySet[$i];
+ }
+ }
+ }
+ }
+ $valueIsNumeric = is_int($lookupValue) || is_float($lookupValue);
+ foreach ($lookupArray as $i => $lookupArrayValue) {
+ if ($valueIsNumeric && (is_int($lookupArrayValue) || is_float($lookupArrayValue))) {
+ if ($lookupArrayValue <= $lookupValue) {
+ return array_search($i, $keySet);
+ }
+ }
+ $typeMatch = gettype($lookupValue) === gettype($lookupArrayValue);
+ if ($typeMatch && ($lookupArrayValue <= $lookupValue)) {
+ return array_search($i, $keySet);
+ }
+ }
+
+ return null;
+ }
+
+ private static function matchSmallestValue(array $lookupArray, mixed $lookupValue): int|string|null
+ {
+ $valueKey = null;
+ if (is_string($lookupValue)) {
+ if (Functions::getCompatibilityMode() === Functions::COMPATIBILITY_OPENOFFICE) {
+ $wildcard = WildcardMatch::wildcard($lookupValue);
+ foreach ($lookupArray as $i => $lookupArrayValue) {
+ if (is_string($lookupArrayValue) && WildcardMatch::compare($lookupArrayValue, $wildcard)) {
+ return $i;
+ }
+ }
+ }
+ }
+
+ $valueIsNumeric = is_int($lookupValue) || is_float($lookupValue);
+ // The basic algorithm is:
+ // Iterate and keep the highest match until the next element is smaller than the searched value.
+ // Return immediately if perfect match is found
+ foreach ($lookupArray as $i => $lookupArrayValue) {
+ $typeMatch = gettype($lookupValue) === gettype($lookupArrayValue);
+ $bothNumeric = $valueIsNumeric && (is_int($lookupArrayValue) || is_float($lookupArrayValue));
+
+ if ($lookupArrayValue === $lookupValue) {
+ // Another "special" case. If a perfect match is found,
+ // the algorithm gives up immediately
+ return $i;
+ }
+ if ($bothNumeric && $lookupValue == $lookupArrayValue) {
+ return $i; // exact match, as above
+ }
+ if (($typeMatch || $bothNumeric) && $lookupArrayValue >= $lookupValue) {
+ $valueKey = $i;
+ } elseif ($typeMatch && $lookupArrayValue < $lookupValue) {
+ //Excel algorithm gives up immediately if the first element is smaller than the searched value
+ break;
+ }
+ }
+
+ return $valueKey;
+ }
+
+ private static function validateLookupValue(mixed $lookupValue): void
+ {
+ // Lookup_value type has to be number, text, or logical values
+ if ((!is_numeric($lookupValue)) && (!is_string($lookupValue)) && (!is_bool($lookupValue))) {
+ throw new Exception(ExcelError::NA());
+ }
+ }
+
+ private static function validateMatchType(mixed $matchType): int
+ {
+ // Match_type is 0, 1 or -1
+ // However Excel accepts other numeric values,
+ // including numeric strings and floats.
+ // It seems to just be interested in the sign.
+ if (!is_numeric($matchType)) {
+ throw new Exception(ExcelError::Value());
+ }
+ if ($matchType > 0) {
+ return self::MATCHTYPE_LARGEST_VALUE;
+ }
+ if ($matchType < 0) {
+ return self::MATCHTYPE_SMALLEST_VALUE;
+ }
+
+ return self::MATCHTYPE_FIRST_VALUE;
+ }
+
+ private static function validateLookupArray(array $lookupArray): void
+ {
+ // Lookup_array should not be empty
+ $lookupArraySize = count($lookupArray);
+ if ($lookupArraySize <= 0) {
+ throw new Exception(ExcelError::NA());
+ }
+ }
+
+ private static function prepareLookupArray(array $lookupArray, mixed $matchType): array
+ {
+ // Lookup_array should contain only number, text, or logical values, or empty (null) cells
+ foreach ($lookupArray as $i => $value) {
+ // check the type of the value
+ if ((!is_numeric($value)) && (!is_string($value)) && (!is_bool($value)) && ($value !== null)) {
+ throw new Exception(ExcelError::NA());
+ }
+ // Convert strings to lowercase for case-insensitive testing
+ if (is_string($value)) {
+ $lookupArray[$i] = StringHelper::strToLower($value);
+ }
+ if (
+ ($value === null)
+ && (($matchType == self::MATCHTYPE_LARGEST_VALUE) || ($matchType == self::MATCHTYPE_SMALLEST_VALUE))
+ ) {
+ unset($lookupArray[$i]);
+ }
+ }
+
+ return $lookupArray;
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/Filter.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/Filter.php
new file mode 100644
index 0000000..e3b6cbe
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/Filter.php
@@ -0,0 +1,72 @@
+ (bool) $matchArray[$index],
+ ARRAY_FILTER_USE_KEY
+ );
+ }
+
+ private static function filterByColumn(array $lookupArray, array $matchArray): array
+ {
+ $lookupArray = Matrix::transpose($lookupArray);
+
+ if (count($matchArray) === 1) {
+ $matchArray = array_pop($matchArray);
+ }
+
+ array_walk(
+ $matchArray,
+ function (&$value): void {
+ $value = [$value];
+ }
+ );
+
+ $result = self::filterByRow($lookupArray, $matchArray);
+
+ return Matrix::transpose($result);
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/Formula.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/Formula.php
new file mode 100644
index 0000000..5c7f405
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/Formula.php
@@ -0,0 +1,41 @@
+getWorksheet()->getParentOrThrow()->getSheetByName($worksheetName)
+ : $cell->getWorksheet();
+
+ if (
+ $worksheet === null
+ || !$worksheet->cellExists($cellReference)
+ || !$worksheet->getCell($cellReference)->isFormula()
+ ) {
+ return ExcelError::NA();
+ }
+
+ return $worksheet->getCell($cellReference)->getValue();
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/HLookup.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/HLookup.php
new file mode 100644
index 0000000..fd83700
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/HLookup.php
@@ -0,0 +1,121 @@
+getMessage();
+ }
+
+ $f = array_keys($lookupArray);
+ $firstRow = reset($f);
+ if ((!is_array($lookupArray[$firstRow])) || ($indexNumber > count($lookupArray))) {
+ return ExcelError::REF();
+ }
+
+ $firstkey = $f[0] - 1;
+ $returnColumn = $firstkey + $indexNumber;
+ $firstColumn = array_shift($f) ?? 1;
+ $rowNumber = self::hLookupSearch($lookupValue, $lookupArray, $firstColumn, $notExactMatch);
+
+ if ($rowNumber !== null) {
+ // otherwise return the appropriate value
+ return $lookupArray[$returnColumn][Coordinate::stringFromColumnIndex($rowNumber)];
+ }
+
+ return ExcelError::NA();
+ }
+
+ /**
+ * @param mixed $lookupValue The value that you want to match in lookup_array
+ * @param int|string $column
+ */
+ private static function hLookupSearch(mixed $lookupValue, array $lookupArray, $column, bool $notExactMatch): ?int
+ {
+ $lookupLower = StringHelper::strToLower((string) $lookupValue);
+
+ $rowNumber = null;
+ foreach ($lookupArray[$column] as $rowKey => $rowData) {
+ // break if we have passed possible keys
+ $bothNumeric = is_numeric($lookupValue) && is_numeric($rowData);
+ $bothNotNumeric = !is_numeric($lookupValue) && !is_numeric($rowData);
+ $cellDataLower = StringHelper::strToLower((string) $rowData);
+
+ if (
+ $notExactMatch
+ && (($bothNumeric && $rowData > $lookupValue) || ($bothNotNumeric && $cellDataLower > $lookupLower))
+ ) {
+ break;
+ }
+
+ $rowNumber = self::checkMatch(
+ $bothNumeric,
+ $bothNotNumeric,
+ $notExactMatch,
+ Coordinate::columnIndexFromString($rowKey),
+ $cellDataLower,
+ $lookupLower,
+ $rowNumber
+ );
+ }
+
+ return $rowNumber;
+ }
+
+ private static function convertLiteralArray(array $lookupArray): array
+ {
+ if (array_key_exists(0, $lookupArray)) {
+ $lookupArray2 = [];
+ $row = 0;
+ foreach ($lookupArray as $arrayVal) {
+ ++$row;
+ if (!is_array($arrayVal)) {
+ $arrayVal = [$arrayVal];
+ }
+ $arrayVal2 = [];
+ foreach ($arrayVal as $key2 => $val2) {
+ $index = Coordinate::stringFromColumnIndex($key2 + 1);
+ $arrayVal2[$index] = $val2;
+ }
+ $lookupArray2[$row] = $arrayVal2;
+ }
+ $lookupArray = $lookupArray2;
+ }
+
+ return $lookupArray;
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/Helpers.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/Helpers.php
new file mode 100644
index 0000000..191144b
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/Helpers.php
@@ -0,0 +1,74 @@
+getWorkSheet();
+ $sheetTitle = ($workSheet === null) ? '' : $workSheet->getTitle();
+ $value = (string) preg_replace('/^=/', '', $namedRange->getValue());
+ self::adjustSheetTitle($sheetTitle, $value);
+ $cellAddress1 = $sheetTitle . $value;
+ $cellAddress = $cellAddress1;
+ $a1 = self::CELLADDRESS_USE_A1;
+ }
+ if (str_contains($cellAddress, ':')) {
+ [$cellAddress1, $cellAddress2] = explode(':', $cellAddress);
+ }
+ $cellAddress = self::convertR1C1($cellAddress1, $cellAddress2, $a1, $baseRow, $baseCol);
+
+ return [$cellAddress1, $cellAddress2, $cellAddress];
+ }
+
+ public static function extractWorksheet(string $cellAddress, Cell $cell): array
+ {
+ $sheetName = '';
+ if (str_contains($cellAddress, '!')) {
+ [$sheetName, $cellAddress] = Worksheet::extractSheetTitle($cellAddress, true);
+ $sheetName = trim($sheetName, "'");
+ }
+
+ $worksheet = ($sheetName !== '')
+ ? $cell->getWorksheet()->getParentOrThrow()->getSheetByName($sheetName)
+ : $cell->getWorksheet();
+
+ return [$cellAddress, $worksheet, $sheetName];
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/Hyperlink.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/Hyperlink.php
new file mode 100644
index 0000000..455442a
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/Hyperlink.php
@@ -0,0 +1,41 @@
+getHyperlink()->setUrl($linkURL);
+ $cell->getHyperlink()->setTooltip($displayName);
+
+ return $displayName;
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/Indirect.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/Indirect.php
new file mode 100644
index 0000000..d53900d
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/Indirect.php
@@ -0,0 +1,128 @@
+getCoordinate());
+
+ try {
+ $a1 = self::a1Format($a1fmt);
+ $cellAddress = self::validateAddress($cellAddress);
+ } catch (Exception $e) {
+ return $e->getMessage();
+ }
+
+ [$cellAddress, $worksheet, $sheetName] = Helpers::extractWorksheet($cellAddress, $cell);
+
+ if (preg_match('/^' . Calculation::CALCULATION_REGEXP_COLUMNRANGE_RELATIVE . '$/miu', $cellAddress, $matches)) {
+ $cellAddress = self::handleRowColumnRanges($worksheet, ...explode(':', $cellAddress));
+ } elseif (preg_match('/^' . Calculation::CALCULATION_REGEXP_ROWRANGE_RELATIVE . '$/miu', $cellAddress, $matches)) {
+ $cellAddress = self::handleRowColumnRanges($worksheet, ...explode(':', $cellAddress));
+ }
+
+ try {
+ [$cellAddress1, $cellAddress2, $cellAddress] = Helpers::extractCellAddresses($cellAddress, $a1, $cell->getWorkSheet(), $sheetName, $baseRow, $baseCol);
+ } catch (Exception) {
+ return ExcelError::REF();
+ }
+
+ if (
+ (!preg_match('/^' . Calculation::CALCULATION_REGEXP_CELLREF . '$/miu', $cellAddress1, $matches))
+ || (($cellAddress2 !== null) && (!preg_match('/^' . Calculation::CALCULATION_REGEXP_CELLREF . '$/miu', $cellAddress2, $matches)))
+ ) {
+ return ExcelError::REF();
+ }
+
+ return self::extractRequiredCells($worksheet, $cellAddress);
+ }
+
+ /**
+ * Extract range values.
+ *
+ * @return array Array of values in range if range contains more than one element.
+ * Otherwise, a single value is returned.
+ */
+ private static function extractRequiredCells(?Worksheet $worksheet, string $cellAddress): array
+ {
+ return Calculation::getInstance($worksheet !== null ? $worksheet->getParent() : null)
+ ->extractCellRange($cellAddress, $worksheet, false);
+ }
+
+ private static function handleRowColumnRanges(?Worksheet $worksheet, string $start, string $end): string
+ {
+ // Being lazy, we're only checking a single row/column to get the max
+ if (ctype_digit($start) && $start <= 1048576) {
+ // Max 16,384 columns for Excel2007
+ $endColRef = ($worksheet !== null) ? $worksheet->getHighestDataColumn((int) $start) : AddressRange::MAX_COLUMN;
+
+ return "A{$start}:{$endColRef}{$end}";
+ } elseif (ctype_alpha($start) && strlen($start) <= 3) {
+ // Max 1,048,576 rows for Excel2007
+ $endRowRef = ($worksheet !== null) ? $worksheet->getHighestDataRow($start) : AddressRange::MAX_ROW;
+
+ return "{$start}1:{$end}{$endRowRef}";
+ }
+
+ return "{$start}:{$end}";
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/Lookup.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/Lookup.php
new file mode 100644
index 0000000..b187620
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/Lookup.php
@@ -0,0 +1,105 @@
+ 1) || (!$hasResultVector && $lookupRows === 2 && $lookupColumns !== 2)) {
+ $lookupVector = Matrix::transpose($lookupVector);
+ $lookupRows = self::rowCount($lookupVector);
+ $lookupColumns = self::columnCount($lookupVector);
+ }
+
+ $resultVector = self::verifyResultVector($resultVector ?? $lookupVector);
+
+ if ($lookupRows === 2 && !$hasResultVector) {
+ $resultVector = array_pop($lookupVector);
+ $lookupVector = array_shift($lookupVector);
+ }
+
+ if ($lookupColumns !== 2) {
+ $lookupVector = self::verifyLookupValues($lookupVector, $resultVector);
+ }
+
+ return VLookup::lookup($lookupValue, $lookupVector, 2);
+ }
+
+ private static function verifyLookupValues(array $lookupVector, array $resultVector): array
+ {
+ foreach ($lookupVector as &$value) {
+ if (is_array($value)) {
+ $k = array_keys($value);
+ $key1 = $key2 = array_shift($k);
+ ++$key2;
+ $dataValue1 = $value[$key1];
+ } else {
+ $key1 = 0;
+ $key2 = 1;
+ $dataValue1 = $value;
+ }
+
+ $dataValue2 = array_shift($resultVector);
+ if (is_array($dataValue2)) {
+ $dataValue2 = array_shift($dataValue2);
+ }
+ $value = [$key1 => $dataValue1, $key2 => $dataValue2];
+ }
+ unset($value);
+
+ return $lookupVector;
+ }
+
+ private static function verifyResultVector(array $resultVector): array
+ {
+ $resultRows = self::rowCount($resultVector);
+ $resultColumns = self::columnCount($resultVector);
+
+ // we correctly orient our results
+ if ($resultRows === 1 && $resultColumns > 1) {
+ $resultVector = Matrix::transpose($resultVector);
+ }
+
+ return $resultVector;
+ }
+
+ private static function rowCount(array $dataArray): int
+ {
+ return count($dataArray);
+ }
+
+ private static function columnCount(array $dataArray): int
+ {
+ $rowKeys = array_keys($dataArray);
+ $row = array_shift($rowKeys);
+
+ return count($dataArray[$row]);
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/LookupBase.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/LookupBase.php
new file mode 100644
index 0000000..7d21cce
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/LookupBase.php
@@ -0,0 +1,64 @@
+ 1
+ && (count($values, COUNT_NORMAL) === 1 || count($values, COUNT_RECURSIVE) === count($values, COUNT_NORMAL));
+ }
+
+ /**
+ * TRANSPOSE.
+ *
+ * @param array|mixed $matrixData A matrix of values
+ */
+ public static function transpose($matrixData): array
+ {
+ $returnMatrix = [];
+ if (!is_array($matrixData)) {
+ $matrixData = [[$matrixData]];
+ }
+
+ $column = 0;
+ foreach ($matrixData as $matrixRow) {
+ $row = 0;
+ foreach ($matrixRow as $matrixCell) {
+ $returnMatrix[$row][$column] = $matrixCell;
+ ++$row;
+ }
+ ++$column;
+ }
+
+ return $returnMatrix;
+ }
+
+ /**
+ * INDEX.
+ *
+ * Uses an index to choose a value from a reference or array
+ *
+ * Excel Function:
+ * =INDEX(range_array, row_num, [column_num], [area_num])
+ *
+ * @param mixed $matrix A range of cells or an array constant
+ * @param mixed $rowNum The row in the array or range from which to return a value.
+ * If row_num is omitted, column_num is required.
+ * Or can be an array of values
+ * @param mixed $columnNum The column in the array or range from which to return a value.
+ * If column_num is omitted, row_num is required.
+ * Or can be an array of values
+ *
+ * TODO Provide support for area_num, currently not supported
+ *
+ * @return mixed the value of a specified cell or array of cells
+ * If an array of values is passed as the $rowNum and/or $columnNum arguments, then the returned result
+ * will also be an array with the same dimensions
+ */
+ public static function index(mixed $matrix, mixed $rowNum = 0, mixed $columnNum = null): mixed
+ {
+ if (is_array($rowNum) || is_array($columnNum)) {
+ return self::evaluateArrayArgumentsSubsetFrom([self::class, __FUNCTION__], 1, $matrix, $rowNum, $columnNum);
+ }
+
+ $rowNum = $rowNum ?? 0;
+ $originalColumnNum = $columnNum;
+ $columnNum = $columnNum ?? 0;
+
+ try {
+ $rowNum = LookupRefValidations::validatePositiveInt($rowNum);
+ $columnNum = LookupRefValidations::validatePositiveInt($columnNum);
+ } catch (Exception $e) {
+ return $e->getMessage();
+ }
+
+ if (!is_array($matrix) || ($rowNum > count($matrix))) {
+ return ExcelError::REF();
+ }
+
+ $rowKeys = array_keys($matrix);
+ $columnKeys = @array_keys($matrix[$rowKeys[0]]);
+
+ if ($columnNum > count($columnKeys)) {
+ return ExcelError::REF();
+ }
+ if ($originalColumnNum === null && 1 < count($columnKeys)) {
+ return ExcelError::REF();
+ }
+
+ if ($columnNum === 0) {
+ return self::extractRowValue($matrix, $rowKeys, $rowNum);
+ }
+
+ $columnNum = $columnKeys[--$columnNum];
+ if ($rowNum === 0) {
+ return array_map(
+ fn ($value): array => [$value],
+ array_column($matrix, $columnNum)
+ );
+ }
+ $rowNum = $rowKeys[--$rowNum];
+
+ return $matrix[$rowNum][$columnNum];
+ }
+
+ private static function extractRowValue(array $matrix, array $rowKeys, int $rowNum): mixed
+ {
+ if ($rowNum === 0) {
+ return $matrix;
+ }
+
+ $rowNum = $rowKeys[--$rowNum];
+ $row = $matrix[$rowNum];
+ if (is_array($row)) {
+ return [$rowNum => $row];
+ }
+
+ return $row;
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/Offset.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/Offset.php
new file mode 100644
index 0000000..260ccc3
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/Offset.php
@@ -0,0 +1,148 @@
+getParent() : null)
+ ->extractCellRange($cellAddress, $worksheet, false);
+ }
+
+ private static function extractWorksheet(?string $cellAddress, Cell $cell): array
+ {
+ $cellAddress = self::assessCellAddress($cellAddress ?? '', $cell);
+
+ $sheetName = '';
+ if (str_contains($cellAddress, '!')) {
+ [$sheetName, $cellAddress] = Worksheet::extractSheetTitle($cellAddress, true);
+ $sheetName = trim($sheetName, "'");
+ }
+
+ $worksheet = ($sheetName !== '')
+ ? $cell->getWorksheet()->getParentOrThrow()->getSheetByName($sheetName)
+ : $cell->getWorksheet();
+
+ return [$cellAddress, $worksheet];
+ }
+
+ private static function assessCellAddress(string $cellAddress, Cell $cell): string
+ {
+ if (preg_match('/^' . Calculation::CALCULATION_REGEXP_DEFINEDNAME . '$/mui', $cellAddress) !== false) {
+ $cellAddress = Functions::expandDefinedName($cellAddress, $cell);
+ }
+
+ return $cellAddress;
+ }
+
+ private static function adjustEndCellColumnForWidth(string $endCellColumn, mixed $width, int $startCellColumn, mixed $columns): int
+ {
+ $endCellColumn = Coordinate::columnIndexFromString($endCellColumn) - 1;
+ if (($width !== null) && (!is_object($width))) {
+ $endCellColumn = $startCellColumn + (int) $width - 1;
+ } else {
+ $endCellColumn += (int) $columns;
+ }
+
+ return $endCellColumn;
+ }
+
+ private static function adustEndCellRowForHeight(mixed $height, int $startCellRow, mixed $rows, mixed $endCellRow): int
+ {
+ if (($height !== null) && (!is_object($height))) {
+ $endCellRow = $startCellRow + (int) $height - 1;
+ } else {
+ $endCellRow += (int) $rows;
+ }
+
+ return $endCellRow;
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/RowColumnInformation.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/RowColumnInformation.php
new file mode 100644
index 0000000..ea3ce44
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/RowColumnInformation.php
@@ -0,0 +1,210 @@
+getColumn()) : 1;
+ }
+
+ /**
+ * COLUMN.
+ *
+ * Returns the column number of the given cell reference
+ * If the cell reference is a range of cells, COLUMN returns the column numbers of each column
+ * in the reference as a horizontal array.
+ * If cell reference is omitted, and the function is being called through the calculation engine,
+ * then it is assumed to be the reference of the cell in which the COLUMN function appears;
+ * otherwise this function returns 1.
+ *
+ * Excel Function:
+ * =COLUMN([cellAddress])
+ *
+ * @param null|array|string $cellAddress A reference to a range of cells for which you want the column numbers
+ *
+ * @return int|int[]
+ */
+ public static function COLUMN($cellAddress = null, ?Cell $cell = null): int|array
+ {
+ if (self::cellAddressNullOrWhitespace($cellAddress)) {
+ return self::cellColumn($cell);
+ }
+
+ if (is_array($cellAddress)) {
+ foreach ($cellAddress as $columnKey => $value) {
+ $columnKey = (string) preg_replace('/[^a-z]/i', '', $columnKey);
+
+ return Coordinate::columnIndexFromString($columnKey);
+ }
+
+ return self::cellColumn($cell);
+ }
+
+ $cellAddress = $cellAddress ?? '';
+ if ($cell != null) {
+ [,, $sheetName] = Helpers::extractWorksheet($cellAddress, $cell);
+ [,, $cellAddress] = Helpers::extractCellAddresses($cellAddress, true, $cell->getWorksheet(), $sheetName);
+ }
+ [, $cellAddress] = Worksheet::extractSheetTitle($cellAddress, true);
+ $cellAddress ??= '';
+
+ if (str_contains($cellAddress, ':')) {
+ [$startAddress, $endAddress] = explode(':', $cellAddress);
+ $startAddress = (string) preg_replace('/[^a-z]/i', '', $startAddress);
+ $endAddress = (string) preg_replace('/[^a-z]/i', '', $endAddress);
+
+ return range(
+ Coordinate::columnIndexFromString($startAddress),
+ Coordinate::columnIndexFromString($endAddress)
+ );
+ }
+
+ $cellAddress = (string) preg_replace('/[^a-z]/i', '', $cellAddress);
+
+ return Coordinate::columnIndexFromString($cellAddress);
+ }
+
+ /**
+ * COLUMNS.
+ *
+ * Returns the number of columns in an array or reference.
+ *
+ * Excel Function:
+ * =COLUMNS(cellAddress)
+ *
+ * @param null|array|string $cellAddress An array or array formula, or a reference to a range of cells
+ * for which you want the number of columns
+ *
+ * @return int|string The number of columns in cellAddress, or a string if arguments are invalid
+ */
+ public static function COLUMNS($cellAddress = null)
+ {
+ if (self::cellAddressNullOrWhitespace($cellAddress)) {
+ return 1;
+ }
+ if (!is_array($cellAddress)) {
+ return ExcelError::VALUE();
+ }
+
+ reset($cellAddress);
+ $isMatrix = (is_numeric(key($cellAddress)));
+ [$columns, $rows] = Calculation::getMatrixDimensions($cellAddress);
+
+ if ($isMatrix) {
+ return $rows;
+ }
+
+ return $columns;
+ }
+
+ private static function cellRow(?Cell $cell): int
+ {
+ return ($cell !== null) ? $cell->getRow() : 1;
+ }
+
+ /**
+ * ROW.
+ *
+ * Returns the row number of the given cell reference
+ * If the cell reference is a range of cells, ROW returns the row numbers of each row in the reference
+ * as a vertical array.
+ * If cell reference is omitted, and the function is being called through the calculation engine,
+ * then it is assumed to be the reference of the cell in which the ROW function appears;
+ * otherwise this function returns 1.
+ *
+ * Excel Function:
+ * =ROW([cellAddress])
+ *
+ * @param null|array|string $cellAddress A reference to a range of cells for which you want the row numbers
+ *
+ * @return int|mixed[]
+ */
+ public static function ROW($cellAddress = null, ?Cell $cell = null): int|array
+ {
+ if (self::cellAddressNullOrWhitespace($cellAddress)) {
+ return self::cellRow($cell);
+ }
+
+ if (is_array($cellAddress)) {
+ foreach ($cellAddress as $rowKey => $rowValue) {
+ foreach ($rowValue as $columnKey => $cellValue) {
+ return (int) preg_replace('/\D/', '', $rowKey);
+ }
+ }
+
+ return self::cellRow($cell);
+ }
+
+ $cellAddress = $cellAddress ?? '';
+ if ($cell !== null) {
+ [,, $sheetName] = Helpers::extractWorksheet($cellAddress, $cell);
+ [,, $cellAddress] = Helpers::extractCellAddresses($cellAddress, true, $cell->getWorksheet(), $sheetName);
+ }
+ [, $cellAddress] = Worksheet::extractSheetTitle($cellAddress, true);
+ $cellAddress ??= '';
+ if (str_contains($cellAddress, ':')) {
+ [$startAddress, $endAddress] = explode(':', $cellAddress);
+ $startAddress = (int) (string) preg_replace('/\D/', '', $startAddress);
+ $endAddress = (int) (string) preg_replace('/\D/', '', $endAddress);
+
+ return array_map(
+ fn ($value): array => [$value],
+ range($startAddress, $endAddress)
+ );
+ }
+ [$cellAddress] = explode(':', $cellAddress);
+
+ return (int) preg_replace('/\D/', '', $cellAddress);
+ }
+
+ /**
+ * ROWS.
+ *
+ * Returns the number of rows in an array or reference.
+ *
+ * Excel Function:
+ * =ROWS(cellAddress)
+ *
+ * @param null|array|string $cellAddress An array or array formula, or a reference to a range of cells
+ * for which you want the number of rows
+ *
+ * @return int|string The number of rows in cellAddress, or a string if arguments are invalid
+ */
+ public static function ROWS($cellAddress = null)
+ {
+ if (self::cellAddressNullOrWhitespace($cellAddress)) {
+ return 1;
+ }
+ if (!is_array($cellAddress)) {
+ return ExcelError::VALUE();
+ }
+
+ reset($cellAddress);
+ $isMatrix = (is_numeric(key($cellAddress)));
+ [$columns, $rows] = Calculation::getMatrixDimensions($cellAddress);
+
+ if ($isMatrix) {
+ return $columns;
+ }
+
+ return $rows;
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/Selection.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/Selection.php
new file mode 100644
index 0000000..53396c9
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/Selection.php
@@ -0,0 +1,51 @@
+ $entryCount)) {
+ return ExcelError::VALUE();
+ }
+
+ if (is_array($chooseArgs[$chosenEntry])) {
+ return Functions::flattenArray($chooseArgs[$chosenEntry]);
+ }
+
+ return $chooseArgs[$chosenEntry];
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/Sort.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/Sort.php
new file mode 100644
index 0000000..9ad47b4
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/Sort.php
@@ -0,0 +1,309 @@
+getMessage();
+ }
+
+ // We want a simple, enumrated array of arrays where we can reference column by its index number.
+ $sortArray = array_values(array_map('array_values', $sortArray));
+
+ return ($byColumn === true)
+ ? self::sortByColumn($sortArray, $sortIndex, $sortOrder)
+ : self::sortByRow($sortArray, $sortIndex, $sortOrder);
+ }
+
+ /**
+ * SORTBY
+ * The SORTBY function sorts the contents of a range or array based on the values in a corresponding range or array.
+ * The returned array is the same shape as the provided array argument.
+ * Both $sortIndex and $sortOrder can be arrays, to provide multi-level sorting.
+ *
+ * @param mixed $sortArray The range of cells being sorted
+ * @param mixed $args
+ * At least one additional argument must be provided, The vector or range to sort on
+ * After that, arguments are passed as pairs:
+ * sort order: ascending or descending
+ * Ascending = 1 (self::ORDER_ASCENDING)
+ * Descending = -1 (self::ORDER_DESCENDING)
+ * additional arrays or ranges for multi-level sorting
+ *
+ * @return mixed The sorted values from the sort range
+ */
+ public static function sortBy(mixed $sortArray, mixed ...$args): mixed
+ {
+ if (!is_array($sortArray)) {
+ // Scalars are always returned "as is"
+ return $sortArray;
+ }
+
+ $sortArray = self::enumerateArrayKeys($sortArray);
+
+ $lookupArraySize = count($sortArray);
+ $argumentCount = count($args);
+
+ try {
+ $sortBy = $sortOrder = [];
+ for ($i = 0; $i < $argumentCount; $i += 2) {
+ $sortBy[] = self::validateSortVector($args[$i], $lookupArraySize);
+ $sortOrder[] = self::validateSortOrder($args[$i + 1] ?? self::ORDER_ASCENDING);
+ }
+ } catch (Exception $e) {
+ return $e->getMessage();
+ }
+
+ return self::processSortBy($sortArray, $sortBy, $sortOrder);
+ }
+
+ private static function enumerateArrayKeys(array $sortArray): array
+ {
+ array_walk(
+ $sortArray,
+ function (&$columns): void {
+ if (is_array($columns)) {
+ $columns = array_values($columns);
+ }
+ }
+ );
+
+ return array_values($sortArray);
+ }
+
+ private static function validateScalarArgumentsForSort(mixed &$sortIndex, mixed &$sortOrder, int $sortArraySize): void
+ {
+ if (is_array($sortIndex) || is_array($sortOrder)) {
+ throw new Exception(ExcelError::VALUE());
+ }
+
+ $sortIndex = self::validatePositiveInt($sortIndex, false);
+
+ if ($sortIndex > $sortArraySize) {
+ throw new Exception(ExcelError::VALUE());
+ }
+
+ $sortOrder = self::validateSortOrder($sortOrder);
+ }
+
+ private static function validateSortVector(mixed $sortVector, int $sortArraySize): array
+ {
+ if (!is_array($sortVector)) {
+ throw new Exception(ExcelError::VALUE());
+ }
+
+ // It doesn't matter if it's a row or a column vectors, it works either way
+ $sortVector = Functions::flattenArray($sortVector);
+ if (count($sortVector) !== $sortArraySize) {
+ throw new Exception(ExcelError::VALUE());
+ }
+
+ return $sortVector;
+ }
+
+ private static function validateSortOrder(mixed $sortOrder): int
+ {
+ $sortOrder = self::validateInt($sortOrder);
+ if (($sortOrder == self::ORDER_ASCENDING || $sortOrder === self::ORDER_DESCENDING) === false) {
+ throw new Exception(ExcelError::VALUE());
+ }
+
+ return $sortOrder;
+ }
+
+ private static function validateArrayArgumentsForSort(array &$sortIndex, mixed &$sortOrder, int $sortArraySize): void
+ {
+ // It doesn't matter if they're row or column vectors, it works either way
+ $sortIndex = Functions::flattenArray($sortIndex);
+ $sortOrder = Functions::flattenArray($sortOrder);
+
+ if (
+ count($sortOrder) === 0 || count($sortOrder) > $sortArraySize
+ || (count($sortOrder) > count($sortIndex))
+ ) {
+ throw new Exception(ExcelError::VALUE());
+ }
+
+ if (count($sortIndex) > count($sortOrder)) {
+ // If $sortOrder has fewer elements than $sortIndex, then the last order element is repeated.
+ $sortOrder = array_merge(
+ $sortOrder,
+ array_fill(0, count($sortIndex) - count($sortOrder), array_pop($sortOrder))
+ );
+ }
+
+ foreach ($sortIndex as $key => &$value) {
+ self::validateScalarArgumentsForSort($value, $sortOrder[$key], $sortArraySize);
+ }
+ }
+
+ private static function prepareSortVectorValues(array $sortVector): array
+ {
+ // Strings should be sorted case-insensitive; with booleans converted to locale-strings
+ return array_map(
+ function ($value) {
+ if (is_bool($value)) {
+ return ($value) ? Calculation::getTRUE() : Calculation::getFALSE();
+ } elseif (is_string($value)) {
+ return StringHelper::strToLower($value);
+ }
+
+ return $value;
+ },
+ $sortVector
+ );
+ }
+
+ /**
+ * @param array[] $sortIndex
+ * @param int[] $sortOrder
+ */
+ private static function processSortBy(array $sortArray, array $sortIndex, array $sortOrder): array
+ {
+ $sortArguments = [];
+ $sortData = [];
+ foreach ($sortIndex as $index => $sortValues) {
+ $sortData[] = $sortValues;
+ $sortArguments[] = self::prepareSortVectorValues($sortValues);
+ $sortArguments[] = $sortOrder[$index] === self::ORDER_ASCENDING ? SORT_ASC : SORT_DESC;
+ }
+
+ $sortVector = self::executeVectorSortQuery($sortData, $sortArguments);
+
+ return self::sortLookupArrayFromVector($sortArray, $sortVector);
+ }
+
+ /**
+ * @param int[] $sortIndex
+ * @param int[] $sortOrder
+ */
+ private static function sortByRow(array $sortArray, array $sortIndex, array $sortOrder): array
+ {
+ $sortVector = self::buildVectorForSort($sortArray, $sortIndex, $sortOrder);
+
+ return self::sortLookupArrayFromVector($sortArray, $sortVector);
+ }
+
+ /**
+ * @param int[] $sortIndex
+ * @param int[] $sortOrder
+ */
+ private static function sortByColumn(array $sortArray, array $sortIndex, array $sortOrder): array
+ {
+ $sortArray = Matrix::transpose($sortArray);
+ $result = self::sortByRow($sortArray, $sortIndex, $sortOrder);
+
+ return Matrix::transpose($result);
+ }
+
+ /**
+ * @param int[] $sortIndex
+ * @param int[] $sortOrder
+ */
+ private static function buildVectorForSort(array $sortArray, array $sortIndex, array $sortOrder): array
+ {
+ $sortArguments = [];
+ $sortData = [];
+ foreach ($sortIndex as $index => $sortIndexValue) {
+ $sortValues = array_column($sortArray, $sortIndexValue - 1);
+ $sortData[] = $sortValues;
+ $sortArguments[] = self::prepareSortVectorValues($sortValues);
+ $sortArguments[] = $sortOrder[$index] === self::ORDER_ASCENDING ? SORT_ASC : SORT_DESC;
+ }
+
+ $sortData = self::executeVectorSortQuery($sortData, $sortArguments);
+
+ return $sortData;
+ }
+
+ private static function executeVectorSortQuery(array $sortData, array $sortArguments): array
+ {
+ $sortData = Matrix::transpose($sortData);
+
+ // We need to set an index that can be retained, as array_multisort doesn't maintain numeric keys.
+ $sortDataIndexed = [];
+ foreach ($sortData as $key => $value) {
+ $sortDataIndexed[Coordinate::stringFromColumnIndex($key + 1)] = $value;
+ }
+ unset($sortData);
+
+ $sortArguments[] = &$sortDataIndexed;
+
+ array_multisort(...$sortArguments);
+
+ // After the sort, we restore the numeric keys that will now be in the correct, sorted order
+ $sortedData = [];
+ foreach (array_keys($sortDataIndexed) as $key) {
+ $sortedData[] = Coordinate::columnIndexFromString($key) - 1;
+ }
+
+ return $sortedData;
+ }
+
+ private static function sortLookupArrayFromVector(array $sortArray, array $sortVector): array
+ {
+ // Building a new array in the correct (sorted) order works; but may be memory heavy for larger arrays
+ $sortedArray = [];
+ foreach ($sortVector as $index) {
+ $sortedArray[] = $sortArray[$index];
+ }
+
+ return $sortedArray;
+
+// uksort(
+// $lookupArray,
+// function (int $a, int $b) use (array $sortVector) {
+// return $sortVector[$a] <=> $sortVector[$b];
+// }
+// );
+//
+// return $lookupArray;
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/Unique.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/Unique.php
new file mode 100644
index 0000000..220be2d
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/Unique.php
@@ -0,0 +1,131 @@
+ count($flattenedLookupVector, COUNT_RECURSIVE) + 1) {
+ // We're looking at a full column check (multiple rows)
+ $transpose = Matrix::transpose($lookupVector);
+ $result = self::uniqueByRow($transpose, $exactlyOnce);
+
+ return (is_array($result)) ? Matrix::transpose($result) : $result;
+ }
+
+ $result = self::countValuesCaseInsensitive($flattenedLookupVector);
+
+ if ($exactlyOnce === true) {
+ $result = self::exactlyOnceFilter($result);
+ }
+
+ if (count($result) === 0) {
+ return ExcelError::CALC();
+ }
+
+ $result = array_keys($result);
+
+ return $result;
+ }
+
+ private static function countValuesCaseInsensitive(array $caseSensitiveLookupValues): array
+ {
+ $caseInsensitiveCounts = array_count_values(
+ array_map(
+ fn (string $value): string => StringHelper::strToUpper($value),
+ $caseSensitiveLookupValues
+ )
+ );
+
+ $caseSensitiveCounts = [];
+ foreach ($caseInsensitiveCounts as $caseInsensitiveKey => $count) {
+ if (is_numeric($caseInsensitiveKey)) {
+ $caseSensitiveCounts[$caseInsensitiveKey] = $count;
+ } else {
+ foreach ($caseSensitiveLookupValues as $caseSensitiveValue) {
+ if ($caseInsensitiveKey === StringHelper::strToUpper($caseSensitiveValue)) {
+ $caseSensitiveCounts[$caseSensitiveValue] = $count;
+
+ break;
+ }
+ }
+ }
+ }
+
+ return $caseSensitiveCounts;
+ }
+
+ private static function exactlyOnceFilter(array $values): array
+ {
+ return array_filter(
+ $values,
+ fn ($value): bool => $value === 1
+ );
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/VLookup.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/VLookup.php
new file mode 100644
index 0000000..247074c
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/VLookup.php
@@ -0,0 +1,117 @@
+getMessage();
+ }
+
+ $f = array_keys($lookupArray);
+ $firstRow = array_pop($f);
+ if ((!is_array($lookupArray[$firstRow])) || ($indexNumber > count($lookupArray[$firstRow]))) {
+ return ExcelError::REF();
+ }
+ $columnKeys = array_keys($lookupArray[$firstRow]);
+ $returnColumn = $columnKeys[--$indexNumber];
+ $firstColumn = array_shift($columnKeys) ?? 1;
+
+ if (!$notExactMatch) {
+ /** @var callable $callable */
+ $callable = [self::class, 'vlookupSort'];
+ uasort($lookupArray, $callable);
+ }
+
+ $rowNumber = self::vLookupSearch($lookupValue, $lookupArray, $firstColumn, $notExactMatch);
+
+ if ($rowNumber !== null) {
+ // return the appropriate value
+ return $lookupArray[$rowNumber][$returnColumn];
+ }
+
+ return ExcelError::NA();
+ }
+
+ private static function vlookupSort(array $a, array $b): int
+ {
+ reset($a);
+ $firstColumn = key($a);
+ $aLower = StringHelper::strToLower((string) $a[$firstColumn]);
+ $bLower = StringHelper::strToLower((string) $b[$firstColumn]);
+
+ if ($aLower == $bLower) {
+ return 0;
+ }
+
+ return ($aLower < $bLower) ? -1 : 1;
+ }
+
+ /**
+ * @param mixed $lookupValue The value that you want to match in lookup_array
+ * @param int|string $column
+ */
+ private static function vLookupSearch(mixed $lookupValue, array $lookupArray, $column, bool $notExactMatch): ?int
+ {
+ $lookupLower = StringHelper::strToLower((string) $lookupValue);
+
+ $rowNumber = null;
+ foreach ($lookupArray as $rowKey => $rowData) {
+ $bothNumeric = is_numeric($lookupValue) && is_numeric($rowData[$column]);
+ $bothNotNumeric = !is_numeric($lookupValue) && !is_numeric($rowData[$column]);
+ $cellDataLower = StringHelper::strToLower((string) $rowData[$column]);
+
+ // break if we have passed possible keys
+ if (
+ $notExactMatch
+ && (($bothNumeric && ($rowData[$column] > $lookupValue))
+ || ($bothNotNumeric && ($cellDataLower > $lookupLower)))
+ ) {
+ break;
+ }
+
+ $rowNumber = self::checkMatch(
+ $bothNumeric,
+ $bothNotNumeric,
+ $notExactMatch,
+ $rowKey,
+ $cellDataLower,
+ $lookupLower,
+ $rowNumber
+ );
+ }
+
+ return $rowNumber;
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Absolute.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Absolute.php
new file mode 100644
index 0000000..03e6139
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Absolute.php
@@ -0,0 +1,37 @@
+getMessage();
+ }
+
+ return abs($number);
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Angle.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Angle.php
new file mode 100644
index 0000000..e7de7aa
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Angle.php
@@ -0,0 +1,63 @@
+getMessage();
+ }
+
+ return rad2deg($number);
+ }
+
+ /**
+ * RADIANS.
+ *
+ * Returns the result of builtin function deg2rad after validating args.
+ *
+ * @param mixed $number Should be numeric, or can be an array of numbers
+ *
+ * @return array|float|string Rounded number
+ * If an array of numbers is passed as the argument, then the returned result will also be an array
+ * with the same dimensions
+ */
+ public static function toRadians(mixed $number): array|string|float
+ {
+ if (is_array($number)) {
+ return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $number);
+ }
+
+ try {
+ $number = Helpers::validateNumericNullBool($number);
+ } catch (Exception $e) {
+ return $e->getMessage();
+ }
+
+ return deg2rad($number);
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Arabic.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Arabic.php
new file mode 100644
index 0000000..98c3e3d
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Arabic.php
@@ -0,0 +1,92 @@
+ 1000,
+ 'D' => 500,
+ 'C' => 100,
+ 'L' => 50,
+ 'X' => 10,
+ 'V' => 5,
+ 'I' => 1,
+ ];
+
+ /**
+ * Recursively calculate the arabic value of a roman numeral.
+ */
+ private static function calculateArabic(array $roman, int &$sum = 0, int $subtract = 0): int
+ {
+ $numeral = array_shift($roman);
+ if (!isset(self::ROMAN_LOOKUP[$numeral])) {
+ throw new Exception('Invalid character detected');
+ }
+
+ $arabic = self::ROMAN_LOOKUP[$numeral];
+ if (count($roman) > 0 && isset(self::ROMAN_LOOKUP[$roman[0]]) && $arabic < self::ROMAN_LOOKUP[$roman[0]]) {
+ $subtract += $arabic;
+ } else {
+ $sum += ($arabic - $subtract);
+ $subtract = 0;
+ }
+
+ if (count($roman) > 0) {
+ self::calculateArabic($roman, $sum, $subtract);
+ }
+
+ return $sum;
+ }
+
+ /**
+ * ARABIC.
+ *
+ * Converts a Roman numeral to an Arabic numeral.
+ *
+ * Excel Function:
+ * ARABIC(text)
+ *
+ * @param string|string[] $roman Should be a string, or can be an array of strings
+ *
+ * @return array|int|string the arabic numberal contrived from the roman numeral
+ * If an array of numbers is passed as the argument, then the returned result will also be an array
+ * with the same dimensions
+ */
+ public static function evaluate(mixed $roman): array|int|string
+ {
+ if (is_array($roman)) {
+ return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $roman);
+ }
+
+ // An empty string should return 0
+ $roman = substr(trim(strtoupper((string) $roman)), 0, 255);
+ if ($roman === '') {
+ return 0;
+ }
+
+ // Convert the roman numeral to an arabic number
+ $negativeNumber = $roman[0] === '-';
+ if ($negativeNumber) {
+ $roman = substr($roman, 1);
+ }
+
+ try {
+ $arabic = self::calculateArabic(str_split($roman));
+ } catch (Exception) {
+ return ExcelError::VALUE(); // Invalid character detected
+ }
+
+ if ($negativeNumber) {
+ $arabic *= -1; // The number should be negative
+ }
+
+ return $arabic;
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Base.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Base.php
new file mode 100644
index 0000000..7eda72c
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Base.php
@@ -0,0 +1,65 @@
+getMessage();
+ }
+
+ return self::calculate($number, $radix, $minLength);
+ }
+
+ private static function calculate(float $number, int $radix, mixed $minLength): string
+ {
+ if ($minLength === null || is_numeric($minLength)) {
+ if ($number < 0 || $number >= 2 ** 53 || $radix < 2 || $radix > 36) {
+ return ExcelError::NAN(); // Numeric range constraints
+ }
+
+ $outcome = strtoupper((string) base_convert("$number", 10, $radix));
+ if ($minLength !== null) {
+ $outcome = str_pad($outcome, (int) $minLength, '0', STR_PAD_LEFT); // String padding
+ }
+
+ return $outcome;
+ }
+
+ return ExcelError::VALUE();
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Ceiling.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Ceiling.php
new file mode 100644
index 0000000..365ec2e
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Ceiling.php
@@ -0,0 +1,165 @@
+getMessage();
+ }
+
+ return self::argumentsOk((float) $number, (float) $significance);
+ }
+
+ /**
+ * CEILING.MATH.
+ *
+ * Round a number down to the nearest integer or to the nearest multiple of significance.
+ *
+ * Excel Function:
+ * CEILING.MATH(number[,significance[,mode]])
+ *
+ * @param mixed $number Number to round
+ * Or can be an array of values
+ * @param mixed $significance Significance
+ * Or can be an array of values
+ * @param array|int $mode direction to round negative numbers
+ * Or can be an array of values
+ *
+ * @return array|float|string Rounded Number, or a string containing an error
+ * If an array of numbers is passed as an argument, then the returned result will also be an array
+ * with the same dimensions
+ */
+ public static function math(mixed $number, mixed $significance = null, $mode = 0): array|string|float
+ {
+ if (is_array($number) || is_array($significance) || is_array($mode)) {
+ return self::evaluateArrayArguments([self::class, __FUNCTION__], $number, $significance, $mode);
+ }
+
+ try {
+ $number = Helpers::validateNumericNullBool($number);
+ $significance = Helpers::validateNumericNullSubstitution($significance, ($number < 0) ? -1 : 1);
+ $mode = Helpers::validateNumericNullSubstitution($mode, null);
+ } catch (Exception $e) {
+ return $e->getMessage();
+ }
+
+ if (empty($significance * $number)) {
+ return 0.0;
+ }
+ if (self::ceilingMathTest((float) $significance, (float) $number, (int) $mode)) {
+ return floor($number / $significance) * $significance;
+ }
+
+ return ceil($number / $significance) * $significance;
+ }
+
+ /**
+ * CEILING.PRECISE.
+ *
+ * Rounds number up, away from zero, to the nearest multiple of significance.
+ *
+ * Excel Function:
+ * CEILING.PRECISE(number[,significance])
+ *
+ * @param mixed $number the number you want to round
+ * Or can be an array of values
+ * @param array|float $significance the multiple to which you want to round
+ * Or can be an array of values
+ *
+ * @return array|float|string Rounded Number, or a string containing an error
+ * If an array of numbers is passed as an argument, then the returned result will also be an array
+ * with the same dimensions
+ */
+ public static function precise(mixed $number, $significance = 1): array|string|float
+ {
+ if (is_array($number) || is_array($significance)) {
+ return self::evaluateArrayArguments([self::class, __FUNCTION__], $number, $significance);
+ }
+
+ try {
+ $number = Helpers::validateNumericNullBool($number);
+ $significance = Helpers::validateNumericNullSubstitution($significance, null);
+ } catch (Exception $e) {
+ return $e->getMessage();
+ }
+
+ if (!$significance) {
+ return 0.0;
+ }
+ $result = $number / abs($significance);
+
+ return ceil($result) * $significance * (($significance < 0) ? -1 : 1);
+ }
+
+ /**
+ * Let CEILINGMATH complexity pass Scrutinizer.
+ */
+ private static function ceilingMathTest(float $significance, float $number, int $mode): bool
+ {
+ return ($significance < 0) || ($number < 0 && !empty($mode));
+ }
+
+ /**
+ * Avoid Scrutinizer problems concerning complexity.
+ */
+ private static function argumentsOk(float $number, float $significance): float|string
+ {
+ if (empty($number * $significance)) {
+ return 0.0;
+ }
+ if (Helpers::returnSign($number) == Helpers::returnSign($significance)) {
+ return ceil($number / $significance) * $significance;
+ }
+
+ return ExcelError::NAN();
+ }
+
+ private static function floorCheck1Arg(): void
+ {
+ $compatibility = Functions::getCompatibilityMode();
+ if ($compatibility === Functions::COMPATIBILITY_EXCEL) {
+ throw new Exception('Excel requires 2 arguments for CEILING');
+ }
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Combinations.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Combinations.php
new file mode 100644
index 0000000..99eb05a
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Combinations.php
@@ -0,0 +1,103 @@
+getMessage();
+ }
+
+ /** @var float */
+ $quotient = Factorial::fact($numObjs);
+ /** @var float */
+ $divisor1 = Factorial::fact($numObjs - $numInSet);
+ /** @var float */
+ $divisor2 = Factorial::fact($numInSet);
+
+ return round($quotient / ($divisor1 * $divisor2));
+ }
+
+ /**
+ * COMBINA.
+ *
+ * Returns the number of combinations for a given number of items. Use COMBIN to
+ * determine the total possible number of groups for a given number of items.
+ *
+ * Excel Function:
+ * COMBINA(numObjs,numInSet)
+ *
+ * @param mixed $numObjs Number of different objects, or can be an array of numbers
+ * @param mixed $numInSet Number of objects in each combination, or can be an array of numbers
+ *
+ * @return array|float|int|string Number of combinations, or a string containing an error
+ * If an array of numbers is passed as the argument, then the returned result will also be an array
+ * with the same dimensions
+ */
+ public static function withRepetition(mixed $numObjs, mixed $numInSet): array|int|string|float
+ {
+ if (is_array($numObjs) || is_array($numInSet)) {
+ return self::evaluateArrayArguments([self::class, __FUNCTION__], $numObjs, $numInSet);
+ }
+
+ try {
+ $numObjs = Helpers::validateNumericNullSubstitution($numObjs, null);
+ $numInSet = Helpers::validateNumericNullSubstitution($numInSet, null);
+ Helpers::validateNotNegative($numInSet);
+ Helpers::validateNotNegative($numObjs);
+ $numObjs = (int) $numObjs;
+ $numInSet = (int) $numInSet;
+ // Microsoft documentation says following is true, but Excel
+ // does not enforce this restriction.
+ //Helpers::validateNotNegative($numObjs - $numInSet);
+ if ($numObjs === 0) {
+ Helpers::validateNotNegative(-$numInSet);
+
+ return 1;
+ }
+ } catch (Exception $e) {
+ return $e->getMessage();
+ }
+
+ /** @var float */
+ $quotient = Factorial::fact($numObjs + $numInSet - 1);
+ /** @var float */
+ $divisor1 = Factorial::fact($numObjs - 1);
+ /** @var float */
+ $divisor2 = Factorial::fact($numInSet);
+
+ return round($quotient / ($divisor1 * $divisor2));
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Exp.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Exp.php
new file mode 100644
index 0000000..ea67d5f
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Exp.php
@@ -0,0 +1,37 @@
+getMessage();
+ }
+
+ return exp($number);
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Factorial.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Factorial.php
new file mode 100644
index 0000000..7bbd4d8
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Factorial.php
@@ -0,0 +1,126 @@
+getMessage();
+ }
+
+ $factLoop = floor($factVal);
+ if ($factVal > $factLoop) {
+ if (Functions::getCompatibilityMode() == Functions::COMPATIBILITY_GNUMERIC) {
+ return Statistical\Distributions\Gamma::gammaValue($factVal + 1);
+ }
+ }
+
+ $factorial = 1;
+ while ($factLoop > 1) {
+ $factorial *= $factLoop--;
+ }
+
+ return $factorial;
+ }
+
+ /**
+ * FACTDOUBLE.
+ *
+ * Returns the double factorial of a number.
+ *
+ * Excel Function:
+ * FACTDOUBLE(factVal)
+ *
+ * @param array|float $factVal Factorial Value, or can be an array of numbers
+ *
+ * @return array|float|int|string Double Factorial, or a string containing an error
+ * If an array of numbers is passed as the argument, then the returned result will also be an array
+ * with the same dimensions
+ */
+ public static function factDouble($factVal): array|string|float|int
+ {
+ if (is_array($factVal)) {
+ return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $factVal);
+ }
+
+ try {
+ $factVal = Helpers::validateNumericNullSubstitution($factVal, 0);
+ Helpers::validateNotNegative($factVal);
+ } catch (Exception $e) {
+ return $e->getMessage();
+ }
+
+ $factLoop = floor($factVal);
+ $factorial = 1;
+ while ($factLoop > 1) {
+ $factorial *= $factLoop;
+ $factLoop -= 2;
+ }
+
+ return $factorial;
+ }
+
+ /**
+ * MULTINOMIAL.
+ *
+ * Returns the ratio of the factorial of a sum of values to the product of factorials.
+ *
+ * @param mixed[] $args An array of mixed values for the Data Series
+ *
+ * @return float|int|string The result, or a string containing an error
+ */
+ public static function multinomial(...$args): string|int|float
+ {
+ $summer = 0;
+ $divisor = 1;
+
+ try {
+ // Loop through arguments
+ foreach (Functions::flattenArray($args) as $argx) {
+ $arg = Helpers::validateNumericNullSubstitution($argx, null);
+ Helpers::validateNotNegative($arg);
+ $arg = (int) $arg;
+ $summer += $arg;
+ $divisor *= self::fact($arg);
+ }
+ } catch (Exception $e) {
+ return $e->getMessage();
+ }
+
+ $summer = self::fact($summer);
+
+ return is_numeric($summer) ? ($summer / $divisor) : ExcelError::VALUE();
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Floor.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Floor.php
new file mode 100644
index 0000000..83cf051
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Floor.php
@@ -0,0 +1,191 @@
+getMessage();
+ }
+
+ return self::argumentsOk((float) $number, (float) $significance);
+ }
+
+ /**
+ * FLOOR.MATH.
+ *
+ * Round a number down to the nearest integer or to the nearest multiple of significance.
+ *
+ * Excel Function:
+ * FLOOR.MATH(number[,significance[,mode]])
+ *
+ * @param mixed $number Number to round
+ * Or can be an array of values
+ * @param mixed $significance Significance
+ * Or can be an array of values
+ * @param mixed $mode direction to round negative numbers
+ * Or can be an array of values
+ *
+ * @return array|float|string Rounded Number, or a string containing an error
+ * If an array of numbers is passed as an argument, then the returned result will also be an array
+ * with the same dimensions
+ */
+ public static function math(mixed $number, mixed $significance = null, mixed $mode = 0)
+ {
+ if (is_array($number) || is_array($significance) || is_array($mode)) {
+ return self::evaluateArrayArguments([self::class, __FUNCTION__], $number, $significance, $mode);
+ }
+
+ try {
+ $number = Helpers::validateNumericNullBool($number);
+ $significance = Helpers::validateNumericNullSubstitution($significance, ($number < 0) ? -1 : 1);
+ $mode = Helpers::validateNumericNullSubstitution($mode, null);
+ } catch (Exception $e) {
+ return $e->getMessage();
+ }
+
+ return self::argsOk((float) $number, (float) $significance, (int) $mode);
+ }
+
+ /**
+ * FLOOR.PRECISE.
+ *
+ * Rounds number down, toward zero, to the nearest multiple of significance.
+ *
+ * Excel Function:
+ * FLOOR.PRECISE(number[,significance])
+ *
+ * @param array|float $number Number to round
+ * Or can be an array of values
+ * @param array|float $significance Significance
+ * Or can be an array of values
+ *
+ * @return array|float|string Rounded Number, or a string containing an error
+ * If an array of numbers is passed as an argument, then the returned result will also be an array
+ * with the same dimensions
+ */
+ public static function precise($number, $significance = 1)
+ {
+ if (is_array($number) || is_array($significance)) {
+ return self::evaluateArrayArguments([self::class, __FUNCTION__], $number, $significance);
+ }
+
+ try {
+ $number = Helpers::validateNumericNullBool($number);
+ $significance = Helpers::validateNumericNullSubstitution($significance, null);
+ } catch (Exception $e) {
+ return $e->getMessage();
+ }
+
+ return self::argumentsOkPrecise((float) $number, (float) $significance);
+ }
+
+ /**
+ * Avoid Scrutinizer problems concerning complexity.
+ */
+ private static function argumentsOkPrecise(float $number, float $significance): string|float
+ {
+ if ($significance == 0.0) {
+ return ExcelError::DIV0();
+ }
+ if ($number == 0.0) {
+ return 0.0;
+ }
+
+ return floor($number / abs($significance)) * abs($significance);
+ }
+
+ /**
+ * Avoid Scrutinizer complexity problems.
+ *
+ * @return float|string Rounded Number, or a string containing an error
+ */
+ private static function argsOk(float $number, float $significance, int $mode): string|float
+ {
+ if (!$significance) {
+ return ExcelError::DIV0();
+ }
+ if (!$number) {
+ return 0.0;
+ }
+ if (self::floorMathTest($number, $significance, $mode)) {
+ return ceil($number / $significance) * $significance;
+ }
+
+ return floor($number / $significance) * $significance;
+ }
+
+ /**
+ * Let FLOORMATH complexity pass Scrutinizer.
+ */
+ private static function floorMathTest(float $number, float $significance, int $mode): bool
+ {
+ return Helpers::returnSign($significance) == -1 || (Helpers::returnSign($number) == -1 && !empty($mode));
+ }
+
+ /**
+ * Avoid Scrutinizer problems concerning complexity.
+ */
+ private static function argumentsOk(float $number, float $significance): string|float
+ {
+ if ($significance == 0.0) {
+ return ExcelError::DIV0();
+ }
+ if ($number == 0.0) {
+ return 0.0;
+ }
+ if (Helpers::returnSign($significance) == 1) {
+ return floor($number / $significance) * $significance;
+ }
+ if (Helpers::returnSign($number) == -1 && Helpers::returnSign($significance) == -1) {
+ return floor($number / $significance) * $significance;
+ }
+
+ return ExcelError::NAN();
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Gcd.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Gcd.php
new file mode 100644
index 0000000..f2aedb6
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Gcd.php
@@ -0,0 +1,65 @@
+getMessage();
+ }
+
+ if (count($arrayArgs) <= 0) {
+ return ExcelError::VALUE();
+ }
+ $gcd = (int) array_pop($arrayArgs);
+ do {
+ $gcd = self::evaluateGCD($gcd, (int) array_pop($arrayArgs));
+ } while (!empty($arrayArgs));
+
+ return $gcd;
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Helpers.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Helpers.php
new file mode 100644
index 0000000..57e05b1
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Helpers.php
@@ -0,0 +1,111 @@
+= 0.
+ */
+ public static function validateNotNegative(float|int $number, ?string $except = null): void
+ {
+ if ($number >= 0) {
+ return;
+ }
+
+ throw new Exception($except ?? ExcelError::NAN());
+ }
+
+ /**
+ * Confirm number > 0.
+ */
+ public static function validatePositive(float|int $number, ?string $except = null): void
+ {
+ if ($number > 0) {
+ return;
+ }
+
+ throw new Exception($except ?? ExcelError::NAN());
+ }
+
+ /**
+ * Confirm number != 0.
+ */
+ public static function validateNotZero(float|int $number): void
+ {
+ if ($number) {
+ return;
+ }
+
+ throw new Exception(ExcelError::DIV0());
+ }
+
+ public static function returnSign(float $number): int
+ {
+ return $number ? (($number > 0) ? 1 : -1) : 0;
+ }
+
+ public static function getEven(float $number): float
+ {
+ $significance = 2 * self::returnSign($number);
+
+ return $significance ? (ceil($number / $significance) * $significance) : 0;
+ }
+
+ /**
+ * Return NAN or value depending on argument.
+ */
+ public static function numberOrNan(float $result): float|string
+ {
+ return is_nan($result) ? ExcelError::NAN() : $result;
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/IntClass.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/IntClass.php
new file mode 100644
index 0000000..76bbced
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/IntClass.php
@@ -0,0 +1,40 @@
+getMessage();
+ }
+
+ return (int) floor($number);
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Lcm.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Lcm.php
new file mode 100644
index 0000000..979b6df
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Lcm.php
@@ -0,0 +1,111 @@
+ 1; --$i) {
+ if (($value % $i) == 0) {
+ $factorArray = array_merge($factorArray, self::factors($value / $i));
+ $factorArray = array_merge($factorArray, self::factors($i));
+ if ($i <= sqrt($value)) {
+ break;
+ }
+ }
+ }
+ if (!empty($factorArray)) {
+ rsort($factorArray);
+
+ return $factorArray;
+ }
+
+ return [(int) $value];
+ }
+
+ /**
+ * LCM.
+ *
+ * Returns the lowest common multiplier of a series of numbers
+ * The least common multiple is the smallest positive integer that is a multiple
+ * of all integer arguments number1, number2, and so on. Use LCM to add fractions
+ * with different denominators.
+ *
+ * Excel Function:
+ * LCM(number1[,number2[, ...]])
+ *
+ * @param mixed ...$args Data values
+ *
+ * @return int|string Lowest Common Multiplier, or a string containing an error
+ */
+ public static function evaluate(mixed ...$args): int|string
+ {
+ try {
+ $arrayArgs = [];
+ $anyZeros = 0;
+ $anyNonNulls = 0;
+ foreach (Functions::flattenArray($args) as $value1) {
+ $anyNonNulls += (int) ($value1 !== null);
+ $value = Helpers::validateNumericNullSubstitution($value1, 1);
+ Helpers::validateNotNegative($value);
+ $arrayArgs[] = (int) $value;
+ $anyZeros += (int) !((bool) $value);
+ }
+ self::testNonNulls($anyNonNulls);
+ if ($anyZeros) {
+ return 0;
+ }
+ } catch (Exception $e) {
+ return $e->getMessage();
+ }
+
+ $returnValue = 1;
+ $allPoweredFactors = [];
+ // Loop through arguments
+ foreach ($arrayArgs as $value) {
+ $myFactors = self::factors(floor($value));
+ $myCountedFactors = array_count_values($myFactors);
+ $myPoweredFactors = [];
+ foreach ($myCountedFactors as $myCountedFactor => $myCountedPower) {
+ $myPoweredFactors[$myCountedFactor] = $myCountedFactor ** $myCountedPower;
+ }
+ self::processPoweredFactors($allPoweredFactors, $myPoweredFactors);
+ }
+ foreach ($allPoweredFactors as $allPoweredFactor) {
+ $returnValue *= (int) $allPoweredFactor;
+ }
+
+ return $returnValue;
+ }
+
+ private static function processPoweredFactors(array &$allPoweredFactors, array &$myPoweredFactors): void
+ {
+ foreach ($myPoweredFactors as $myPoweredValue => $myPoweredFactor) {
+ if (isset($allPoweredFactors[$myPoweredValue])) {
+ if ($allPoweredFactors[$myPoweredValue] < $myPoweredFactor) {
+ $allPoweredFactors[$myPoweredValue] = $myPoweredFactor;
+ }
+ } else {
+ $allPoweredFactors[$myPoweredValue] = $myPoweredFactor;
+ }
+ }
+ }
+
+ private static function testNonNulls(int $anyNonNulls): void
+ {
+ if (!$anyNonNulls) {
+ throw new Exception(ExcelError::VALUE());
+ }
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Logarithms.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Logarithms.php
new file mode 100644
index 0000000..3de0a2b
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Logarithms.php
@@ -0,0 +1,102 @@
+getMessage();
+ }
+
+ return log($number, $base);
+ }
+
+ /**
+ * LOG10.
+ *
+ * Returns the result of builtin function log after validating args.
+ *
+ * @param mixed $number Should be numeric
+ * Or can be an array of values
+ *
+ * @return array|float|string Rounded number
+ * If an array of numbers is passed as an argument, then the returned result will also be an array
+ * with the same dimensions
+ */
+ public static function base10(mixed $number): array|string|float
+ {
+ if (is_array($number)) {
+ return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $number);
+ }
+
+ try {
+ $number = Helpers::validateNumericNullBool($number);
+ Helpers::validatePositive($number);
+ } catch (Exception $e) {
+ return $e->getMessage();
+ }
+
+ return log10($number);
+ }
+
+ /**
+ * LN.
+ *
+ * Returns the result of builtin function log after validating args.
+ *
+ * @param mixed $number Should be numeric
+ * Or can be an array of values
+ *
+ * @return array|float|string Rounded number
+ * If an array of numbers is passed as an argument, then the returned result will also be an array
+ * with the same dimensions
+ */
+ public static function natural(mixed $number): array|string|float
+ {
+ if (is_array($number)) {
+ return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $number);
+ }
+
+ try {
+ $number = Helpers::validateNumericNullBool($number);
+ Helpers::validatePositive($number);
+ } catch (Exception $e) {
+ return $e->getMessage();
+ }
+
+ return log($number);
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/MatrixFunctions.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/MatrixFunctions.php
new file mode 100644
index 0000000..fad0108
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/MatrixFunctions.php
@@ -0,0 +1,179 @@
+getMessage();
+ }
+
+ if ($step === 0) {
+ return array_chunk(
+ array_fill(0, $rows * $columns, $start),
+ max($columns, 1)
+ );
+ }
+
+ return array_chunk(
+ range($start, $start + (($rows * $columns - 1) * $step), $step),
+ max($columns, 1)
+ );
+ }
+
+ /**
+ * MDETERM.
+ *
+ * Returns the matrix determinant of an array.
+ *
+ * Excel Function:
+ * MDETERM(array)
+ *
+ * @param mixed $matrixValues A matrix of values
+ *
+ * @return float|string The result, or a string containing an error
+ */
+ public static function determinant(mixed $matrixValues)
+ {
+ try {
+ $matrix = self::getMatrix($matrixValues);
+
+ return $matrix->determinant();
+ } catch (MatrixException) {
+ return ExcelError::VALUE();
+ } catch (Exception $e) {
+ return $e->getMessage();
+ }
+ }
+
+ /**
+ * MINVERSE.
+ *
+ * Returns the inverse matrix for the matrix stored in an array.
+ *
+ * Excel Function:
+ * MINVERSE(array)
+ *
+ * @param mixed $matrixValues A matrix of values
+ *
+ * @return array|string The result, or a string containing an error
+ */
+ public static function inverse(mixed $matrixValues): array|string
+ {
+ try {
+ $matrix = self::getMatrix($matrixValues);
+
+ return $matrix->inverse()->toArray();
+ } catch (MatrixDiv0Exception) {
+ return ExcelError::NAN();
+ } catch (MatrixException) {
+ return ExcelError::VALUE();
+ } catch (Exception $e) {
+ return $e->getMessage();
+ }
+ }
+
+ /**
+ * MMULT.
+ *
+ * @param mixed $matrixData1 A matrix of values
+ * @param mixed $matrixData2 A matrix of values
+ *
+ * @return array|string The result, or a string containing an error
+ */
+ public static function multiply(mixed $matrixData1, mixed $matrixData2): array|string
+ {
+ try {
+ $matrixA = self::getMatrix($matrixData1);
+ $matrixB = self::getMatrix($matrixData2);
+
+ return $matrixA->multiply($matrixB)->toArray();
+ } catch (MatrixException) {
+ return ExcelError::VALUE();
+ } catch (Exception $e) {
+ return $e->getMessage();
+ }
+ }
+
+ /**
+ * MUnit.
+ *
+ * @param mixed $dimension Number of rows and columns
+ *
+ * @return array|string The result, or a string containing an error
+ */
+ public static function identity(mixed $dimension)
+ {
+ try {
+ $dimension = (int) Helpers::validateNumericNullBool($dimension);
+ Helpers::validatePositive($dimension, ExcelError::VALUE());
+ $matrix = Builder::createIdentityMatrix($dimension, 0)->toArray();
+
+ return $matrix;
+ } catch (Exception $e) {
+ return $e->getMessage();
+ }
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Operations.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Operations.php
new file mode 100644
index 0000000..9c4a6f4
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Operations.php
@@ -0,0 +1,155 @@
+getMessage();
+ }
+
+ if (($dividend < 0.0) && ($divisor > 0.0)) {
+ return $divisor - fmod(abs($dividend), $divisor);
+ }
+ if (($dividend > 0.0) && ($divisor < 0.0)) {
+ return $divisor + fmod($dividend, abs($divisor));
+ }
+
+ return fmod($dividend, $divisor);
+ }
+
+ /**
+ * POWER.
+ *
+ * Computes x raised to the power y.
+ *
+ * @param array|float|int|string $x Or can be an array of values
+ * @param array|float|int|string $y Or can be an array of values
+ *
+ * @return array|float|int|string The result, or a string containing an error
+ * If an array of numbers is passed as an argument, then the returned result will also be an array
+ * with the same dimensions
+ */
+ public static function power(array|float|int|string $x, array|float|int|string $y): array|float|int|string
+ {
+ if (is_array($x) || is_array($y)) {
+ return self::evaluateArrayArguments([self::class, __FUNCTION__], $x, $y);
+ }
+
+ try {
+ $x = Helpers::validateNumericNullBool($x);
+ $y = Helpers::validateNumericNullBool($y);
+ } catch (Exception $e) {
+ return $e->getMessage();
+ }
+
+ // Validate parameters
+ if (!$x && !$y) {
+ return ExcelError::NAN();
+ }
+ if (!$x && $y < 0.0) {
+ return ExcelError::DIV0();
+ }
+
+ // Return
+ $result = $x ** $y;
+
+ return Helpers::numberOrNan($result);
+ }
+
+ /**
+ * PRODUCT.
+ *
+ * PRODUCT returns the product of all the values and cells referenced in the argument list.
+ *
+ * Excel Function:
+ * PRODUCT(value1[,value2[, ...]])
+ *
+ * @param mixed ...$args Data values
+ */
+ public static function product(mixed ...$args): string|float
+ {
+ $args = array_filter(
+ Functions::flattenArray($args),
+ fn ($value): bool => $value !== null
+ );
+
+ // Return value
+ $returnValue = (count($args) === 0) ? 0.0 : 1.0;
+
+ // Loop through arguments
+ foreach ($args as $arg) {
+ // Is it a numeric value?
+ if (is_numeric($arg)) {
+ $returnValue *= $arg;
+ } else {
+ return ExcelError::throwError($arg);
+ }
+ }
+
+ return (float) $returnValue;
+ }
+
+ /**
+ * QUOTIENT.
+ *
+ * QUOTIENT function returns the integer portion of a division. Numerator is the divided number
+ * and denominator is the divisor.
+ *
+ * Excel Function:
+ * QUOTIENT(value1,value2)
+ *
+ * @param mixed $numerator Expect float|int
+ * Or can be an array of values
+ * @param mixed $denominator Expect float|int
+ * Or can be an array of values
+ *
+ * @return array|int|string If an array of numbers is passed as an argument, then the returned result will also be an array
+ * with the same dimensions
+ */
+ public static function quotient(mixed $numerator, mixed $denominator): array|string|int
+ {
+ if (is_array($numerator) || is_array($denominator)) {
+ return self::evaluateArrayArguments([self::class, __FUNCTION__], $numerator, $denominator);
+ }
+
+ try {
+ $numerator = Helpers::validateNumericNullSubstitution($numerator, 0);
+ $denominator = Helpers::validateNumericNullSubstitution($denominator, 0);
+ Helpers::validateNotZero($denominator);
+ } catch (Exception $e) {
+ return $e->getMessage();
+ }
+
+ return (int) ($numerator / $denominator);
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Random.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Random.php
new file mode 100644
index 0000000..5d35167
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Random.php
@@ -0,0 +1,99 @@
+getMessage();
+ }
+
+ return mt_rand($min, $max);
+ }
+
+ /**
+ * RANDARRAY.
+ *
+ * Generates a list of sequential numbers in an array.
+ *
+ * Excel Function:
+ * RANDARRAY([rows],[columns],[start],[step])
+ *
+ * @param mixed $rows the number of rows to return, defaults to 1
+ * @param mixed $columns the number of columns to return, defaults to 1
+ * @param mixed $min the minimum number to be returned, defaults to 0
+ * @param mixed $max the maximum number to be returned, defaults to 1
+ * @param bool $wholeNumber the type of numbers to return:
+ * False - Decimal numbers to 15 decimal places. (default)
+ * True - Whole (integer) numbers
+ *
+ * @return array|string The resulting array, or a string containing an error
+ */
+ public static function randArray(mixed $rows = 1, mixed $columns = 1, mixed $min = 0, mixed $max = 1, bool $wholeNumber = false): string|array
+ {
+ try {
+ $rows = (int) Helpers::validateNumericNullSubstitution($rows, 1);
+ Helpers::validatePositive($rows);
+ $columns = (int) Helpers::validateNumericNullSubstitution($columns, 1);
+ Helpers::validatePositive($columns);
+ $min = Helpers::validateNumericNullSubstitution($min, 1);
+ $max = Helpers::validateNumericNullSubstitution($max, 1);
+
+ if ($max <= $min) {
+ return ExcelError::VALUE();
+ }
+ } catch (Exception $e) {
+ return $e->getMessage();
+ }
+
+ return array_chunk(
+ array_map(
+ function () use ($min, $max, $wholeNumber): int|float {
+ return $wholeNumber
+ ? mt_rand((int) $min, (int) $max)
+ : (mt_rand() / mt_getrandmax()) * ($max - $min) + $min;
+ },
+ array_fill(0, $rows * $columns, $min)
+ ),
+ max($columns, 1)
+ );
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Roman.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Roman.php
new file mode 100644
index 0000000..7c6f8e7
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Roman.php
@@ -0,0 +1,846 @@
+ ['VL'],
+ 46 => ['VLI'],
+ 47 => ['VLII'],
+ 48 => ['VLIII'],
+ 49 => ['VLIV', 'IL'],
+ 95 => ['VC'],
+ 96 => ['VCI'],
+ 97 => ['VCII'],
+ 98 => ['VCIII'],
+ 99 => ['VCIV', 'IC'],
+ 145 => ['CVL'],
+ 146 => ['CVLI'],
+ 147 => ['CVLII'],
+ 148 => ['CVLIII'],
+ 149 => ['CVLIV', 'CIL'],
+ 195 => ['CVC'],
+ 196 => ['CVCI'],
+ 197 => ['CVCII'],
+ 198 => ['CVCIII'],
+ 199 => ['CVCIV', 'CIC'],
+ 245 => ['CCVL'],
+ 246 => ['CCVLI'],
+ 247 => ['CCVLII'],
+ 248 => ['CCVLIII'],
+ 249 => ['CCVLIV', 'CCIL'],
+ 295 => ['CCVC'],
+ 296 => ['CCVCI'],
+ 297 => ['CCVCII'],
+ 298 => ['CCVCIII'],
+ 299 => ['CCVCIV', 'CCIC'],
+ 345 => ['CCCVL'],
+ 346 => ['CCCVLI'],
+ 347 => ['CCCVLII'],
+ 348 => ['CCCVLIII'],
+ 349 => ['CCCVLIV', 'CCCIL'],
+ 395 => ['CCCVC'],
+ 396 => ['CCCVCI'],
+ 397 => ['CCCVCII'],
+ 398 => ['CCCVCIII'],
+ 399 => ['CCCVCIV', 'CCCIC'],
+ 445 => ['CDVL'],
+ 446 => ['CDVLI'],
+ 447 => ['CDVLII'],
+ 448 => ['CDVLIII'],
+ 449 => ['CDVLIV', 'CDIL'],
+ 450 => ['LD'],
+ 451 => ['LDI'],
+ 452 => ['LDII'],
+ 453 => ['LDIII'],
+ 454 => ['LDIV'],
+ 455 => ['LDV'],
+ 456 => ['LDVI'],
+ 457 => ['LDVII'],
+ 458 => ['LDVIII'],
+ 459 => ['LDIX'],
+ 460 => ['LDX'],
+ 461 => ['LDXI'],
+ 462 => ['LDXII'],
+ 463 => ['LDXIII'],
+ 464 => ['LDXIV'],
+ 465 => ['LDXV'],
+ 466 => ['LDXVI'],
+ 467 => ['LDXVII'],
+ 468 => ['LDXVIII'],
+ 469 => ['LDXIX'],
+ 470 => ['LDXX'],
+ 471 => ['LDXXI'],
+ 472 => ['LDXXII'],
+ 473 => ['LDXXIII'],
+ 474 => ['LDXXIV'],
+ 475 => ['LDXXV'],
+ 476 => ['LDXXVI'],
+ 477 => ['LDXXVII'],
+ 478 => ['LDXXVIII'],
+ 479 => ['LDXXIX'],
+ 480 => ['LDXXX'],
+ 481 => ['LDXXXI'],
+ 482 => ['LDXXXII'],
+ 483 => ['LDXXXIII'],
+ 484 => ['LDXXXIV'],
+ 485 => ['LDXXXV'],
+ 486 => ['LDXXXVI'],
+ 487 => ['LDXXXVII'],
+ 488 => ['LDXXXVIII'],
+ 489 => ['LDXXXIX'],
+ 490 => ['LDXL', 'XD'],
+ 491 => ['LDXLI', 'XDI'],
+ 492 => ['LDXLII', 'XDII'],
+ 493 => ['LDXLIII', 'XDIII'],
+ 494 => ['LDXLIV', 'XDIV'],
+ 495 => ['LDVL', 'XDV', 'VD'],
+ 496 => ['LDVLI', 'XDVI', 'VDI'],
+ 497 => ['LDVLII', 'XDVII', 'VDII'],
+ 498 => ['LDVLIII', 'XDVIII', 'VDIII'],
+ 499 => ['LDVLIV', 'XDIX', 'VDIV', 'ID'],
+ 545 => ['DVL'],
+ 546 => ['DVLI'],
+ 547 => ['DVLII'],
+ 548 => ['DVLIII'],
+ 549 => ['DVLIV', 'DIL'],
+ 595 => ['DVC'],
+ 596 => ['DVCI'],
+ 597 => ['DVCII'],
+ 598 => ['DVCIII'],
+ 599 => ['DVCIV', 'DIC'],
+ 645 => ['DCVL'],
+ 646 => ['DCVLI'],
+ 647 => ['DCVLII'],
+ 648 => ['DCVLIII'],
+ 649 => ['DCVLIV', 'DCIL'],
+ 695 => ['DCVC'],
+ 696 => ['DCVCI'],
+ 697 => ['DCVCII'],
+ 698 => ['DCVCIII'],
+ 699 => ['DCVCIV', 'DCIC'],
+ 745 => ['DCCVL'],
+ 746 => ['DCCVLI'],
+ 747 => ['DCCVLII'],
+ 748 => ['DCCVLIII'],
+ 749 => ['DCCVLIV', 'DCCIL'],
+ 795 => ['DCCVC'],
+ 796 => ['DCCVCI'],
+ 797 => ['DCCVCII'],
+ 798 => ['DCCVCIII'],
+ 799 => ['DCCVCIV', 'DCCIC'],
+ 845 => ['DCCCVL'],
+ 846 => ['DCCCVLI'],
+ 847 => ['DCCCVLII'],
+ 848 => ['DCCCVLIII'],
+ 849 => ['DCCCVLIV', 'DCCCIL'],
+ 895 => ['DCCCVC'],
+ 896 => ['DCCCVCI'],
+ 897 => ['DCCCVCII'],
+ 898 => ['DCCCVCIII'],
+ 899 => ['DCCCVCIV', 'DCCCIC'],
+ 945 => ['CMVL'],
+ 946 => ['CMVLI'],
+ 947 => ['CMVLII'],
+ 948 => ['CMVLIII'],
+ 949 => ['CMVLIV', 'CMIL'],
+ 950 => ['LM'],
+ 951 => ['LMI'],
+ 952 => ['LMII'],
+ 953 => ['LMIII'],
+ 954 => ['LMIV'],
+ 955 => ['LMV'],
+ 956 => ['LMVI'],
+ 957 => ['LMVII'],
+ 958 => ['LMVIII'],
+ 959 => ['LMIX'],
+ 960 => ['LMX'],
+ 961 => ['LMXI'],
+ 962 => ['LMXII'],
+ 963 => ['LMXIII'],
+ 964 => ['LMXIV'],
+ 965 => ['LMXV'],
+ 966 => ['LMXVI'],
+ 967 => ['LMXVII'],
+ 968 => ['LMXVIII'],
+ 969 => ['LMXIX'],
+ 970 => ['LMXX'],
+ 971 => ['LMXXI'],
+ 972 => ['LMXXII'],
+ 973 => ['LMXXIII'],
+ 974 => ['LMXXIV'],
+ 975 => ['LMXXV'],
+ 976 => ['LMXXVI'],
+ 977 => ['LMXXVII'],
+ 978 => ['LMXXVIII'],
+ 979 => ['LMXXIX'],
+ 980 => ['LMXXX'],
+ 981 => ['LMXXXI'],
+ 982 => ['LMXXXII'],
+ 983 => ['LMXXXIII'],
+ 984 => ['LMXXXIV'],
+ 985 => ['LMXXXV'],
+ 986 => ['LMXXXVI'],
+ 987 => ['LMXXXVII'],
+ 988 => ['LMXXXVIII'],
+ 989 => ['LMXXXIX'],
+ 990 => ['LMXL', 'XM'],
+ 991 => ['LMXLI', 'XMI'],
+ 992 => ['LMXLII', 'XMII'],
+ 993 => ['LMXLIII', 'XMIII'],
+ 994 => ['LMXLIV', 'XMIV'],
+ 995 => ['LMVL', 'XMV', 'VM'],
+ 996 => ['LMVLI', 'XMVI', 'VMI'],
+ 997 => ['LMVLII', 'XMVII', 'VMII'],
+ 998 => ['LMVLIII', 'XMVIII', 'VMIII'],
+ 999 => ['LMVLIV', 'XMIX', 'VMIV', 'IM'],
+ 1045 => ['MVL'],
+ 1046 => ['MVLI'],
+ 1047 => ['MVLII'],
+ 1048 => ['MVLIII'],
+ 1049 => ['MVLIV', 'MIL'],
+ 1095 => ['MVC'],
+ 1096 => ['MVCI'],
+ 1097 => ['MVCII'],
+ 1098 => ['MVCIII'],
+ 1099 => ['MVCIV', 'MIC'],
+ 1145 => ['MCVL'],
+ 1146 => ['MCVLI'],
+ 1147 => ['MCVLII'],
+ 1148 => ['MCVLIII'],
+ 1149 => ['MCVLIV', 'MCIL'],
+ 1195 => ['MCVC'],
+ 1196 => ['MCVCI'],
+ 1197 => ['MCVCII'],
+ 1198 => ['MCVCIII'],
+ 1199 => ['MCVCIV', 'MCIC'],
+ 1245 => ['MCCVL'],
+ 1246 => ['MCCVLI'],
+ 1247 => ['MCCVLII'],
+ 1248 => ['MCCVLIII'],
+ 1249 => ['MCCVLIV', 'MCCIL'],
+ 1295 => ['MCCVC'],
+ 1296 => ['MCCVCI'],
+ 1297 => ['MCCVCII'],
+ 1298 => ['MCCVCIII'],
+ 1299 => ['MCCVCIV', 'MCCIC'],
+ 1345 => ['MCCCVL'],
+ 1346 => ['MCCCVLI'],
+ 1347 => ['MCCCVLII'],
+ 1348 => ['MCCCVLIII'],
+ 1349 => ['MCCCVLIV', 'MCCCIL'],
+ 1395 => ['MCCCVC'],
+ 1396 => ['MCCCVCI'],
+ 1397 => ['MCCCVCII'],
+ 1398 => ['MCCCVCIII'],
+ 1399 => ['MCCCVCIV', 'MCCCIC'],
+ 1445 => ['MCDVL'],
+ 1446 => ['MCDVLI'],
+ 1447 => ['MCDVLII'],
+ 1448 => ['MCDVLIII'],
+ 1449 => ['MCDVLIV', 'MCDIL'],
+ 1450 => ['MLD'],
+ 1451 => ['MLDI'],
+ 1452 => ['MLDII'],
+ 1453 => ['MLDIII'],
+ 1454 => ['MLDIV'],
+ 1455 => ['MLDV'],
+ 1456 => ['MLDVI'],
+ 1457 => ['MLDVII'],
+ 1458 => ['MLDVIII'],
+ 1459 => ['MLDIX'],
+ 1460 => ['MLDX'],
+ 1461 => ['MLDXI'],
+ 1462 => ['MLDXII'],
+ 1463 => ['MLDXIII'],
+ 1464 => ['MLDXIV'],
+ 1465 => ['MLDXV'],
+ 1466 => ['MLDXVI'],
+ 1467 => ['MLDXVII'],
+ 1468 => ['MLDXVIII'],
+ 1469 => ['MLDXIX'],
+ 1470 => ['MLDXX'],
+ 1471 => ['MLDXXI'],
+ 1472 => ['MLDXXII'],
+ 1473 => ['MLDXXIII'],
+ 1474 => ['MLDXXIV'],
+ 1475 => ['MLDXXV'],
+ 1476 => ['MLDXXVI'],
+ 1477 => ['MLDXXVII'],
+ 1478 => ['MLDXXVIII'],
+ 1479 => ['MLDXXIX'],
+ 1480 => ['MLDXXX'],
+ 1481 => ['MLDXXXI'],
+ 1482 => ['MLDXXXII'],
+ 1483 => ['MLDXXXIII'],
+ 1484 => ['MLDXXXIV'],
+ 1485 => ['MLDXXXV'],
+ 1486 => ['MLDXXXVI'],
+ 1487 => ['MLDXXXVII'],
+ 1488 => ['MLDXXXVIII'],
+ 1489 => ['MLDXXXIX'],
+ 1490 => ['MLDXL', 'MXD'],
+ 1491 => ['MLDXLI', 'MXDI'],
+ 1492 => ['MLDXLII', 'MXDII'],
+ 1493 => ['MLDXLIII', 'MXDIII'],
+ 1494 => ['MLDXLIV', 'MXDIV'],
+ 1495 => ['MLDVL', 'MXDV', 'MVD'],
+ 1496 => ['MLDVLI', 'MXDVI', 'MVDI'],
+ 1497 => ['MLDVLII', 'MXDVII', 'MVDII'],
+ 1498 => ['MLDVLIII', 'MXDVIII', 'MVDIII'],
+ 1499 => ['MLDVLIV', 'MXDIX', 'MVDIV', 'MID'],
+ 1545 => ['MDVL'],
+ 1546 => ['MDVLI'],
+ 1547 => ['MDVLII'],
+ 1548 => ['MDVLIII'],
+ 1549 => ['MDVLIV', 'MDIL'],
+ 1595 => ['MDVC'],
+ 1596 => ['MDVCI'],
+ 1597 => ['MDVCII'],
+ 1598 => ['MDVCIII'],
+ 1599 => ['MDVCIV', 'MDIC'],
+ 1645 => ['MDCVL'],
+ 1646 => ['MDCVLI'],
+ 1647 => ['MDCVLII'],
+ 1648 => ['MDCVLIII'],
+ 1649 => ['MDCVLIV', 'MDCIL'],
+ 1695 => ['MDCVC'],
+ 1696 => ['MDCVCI'],
+ 1697 => ['MDCVCII'],
+ 1698 => ['MDCVCIII'],
+ 1699 => ['MDCVCIV', 'MDCIC'],
+ 1745 => ['MDCCVL'],
+ 1746 => ['MDCCVLI'],
+ 1747 => ['MDCCVLII'],
+ 1748 => ['MDCCVLIII'],
+ 1749 => ['MDCCVLIV', 'MDCCIL'],
+ 1795 => ['MDCCVC'],
+ 1796 => ['MDCCVCI'],
+ 1797 => ['MDCCVCII'],
+ 1798 => ['MDCCVCIII'],
+ 1799 => ['MDCCVCIV', 'MDCCIC'],
+ 1845 => ['MDCCCVL'],
+ 1846 => ['MDCCCVLI'],
+ 1847 => ['MDCCCVLII'],
+ 1848 => ['MDCCCVLIII'],
+ 1849 => ['MDCCCVLIV', 'MDCCCIL'],
+ 1895 => ['MDCCCVC'],
+ 1896 => ['MDCCCVCI'],
+ 1897 => ['MDCCCVCII'],
+ 1898 => ['MDCCCVCIII'],
+ 1899 => ['MDCCCVCIV', 'MDCCCIC'],
+ 1945 => ['MCMVL'],
+ 1946 => ['MCMVLI'],
+ 1947 => ['MCMVLII'],
+ 1948 => ['MCMVLIII'],
+ 1949 => ['MCMVLIV', 'MCMIL'],
+ 1950 => ['MLM'],
+ 1951 => ['MLMI'],
+ 1952 => ['MLMII'],
+ 1953 => ['MLMIII'],
+ 1954 => ['MLMIV'],
+ 1955 => ['MLMV'],
+ 1956 => ['MLMVI'],
+ 1957 => ['MLMVII'],
+ 1958 => ['MLMVIII'],
+ 1959 => ['MLMIX'],
+ 1960 => ['MLMX'],
+ 1961 => ['MLMXI'],
+ 1962 => ['MLMXII'],
+ 1963 => ['MLMXIII'],
+ 1964 => ['MLMXIV'],
+ 1965 => ['MLMXV'],
+ 1966 => ['MLMXVI'],
+ 1967 => ['MLMXVII'],
+ 1968 => ['MLMXVIII'],
+ 1969 => ['MLMXIX'],
+ 1970 => ['MLMXX'],
+ 1971 => ['MLMXXI'],
+ 1972 => ['MLMXXII'],
+ 1973 => ['MLMXXIII'],
+ 1974 => ['MLMXXIV'],
+ 1975 => ['MLMXXV'],
+ 1976 => ['MLMXXVI'],
+ 1977 => ['MLMXXVII'],
+ 1978 => ['MLMXXVIII'],
+ 1979 => ['MLMXXIX'],
+ 1980 => ['MLMXXX'],
+ 1981 => ['MLMXXXI'],
+ 1982 => ['MLMXXXII'],
+ 1983 => ['MLMXXXIII'],
+ 1984 => ['MLMXXXIV'],
+ 1985 => ['MLMXXXV'],
+ 1986 => ['MLMXXXVI'],
+ 1987 => ['MLMXXXVII'],
+ 1988 => ['MLMXXXVIII'],
+ 1989 => ['MLMXXXIX'],
+ 1990 => ['MLMXL', 'MXM'],
+ 1991 => ['MLMXLI', 'MXMI'],
+ 1992 => ['MLMXLII', 'MXMII'],
+ 1993 => ['MLMXLIII', 'MXMIII'],
+ 1994 => ['MLMXLIV', 'MXMIV'],
+ 1995 => ['MLMVL', 'MXMV', 'MVM'],
+ 1996 => ['MLMVLI', 'MXMVI', 'MVMI'],
+ 1997 => ['MLMVLII', 'MXMVII', 'MVMII'],
+ 1998 => ['MLMVLIII', 'MXMVIII', 'MVMIII'],
+ 1999 => ['MLMVLIV', 'MXMIX', 'MVMIV', 'MIM'],
+ 2045 => ['MMVL'],
+ 2046 => ['MMVLI'],
+ 2047 => ['MMVLII'],
+ 2048 => ['MMVLIII'],
+ 2049 => ['MMVLIV', 'MMIL'],
+ 2095 => ['MMVC'],
+ 2096 => ['MMVCI'],
+ 2097 => ['MMVCII'],
+ 2098 => ['MMVCIII'],
+ 2099 => ['MMVCIV', 'MMIC'],
+ 2145 => ['MMCVL'],
+ 2146 => ['MMCVLI'],
+ 2147 => ['MMCVLII'],
+ 2148 => ['MMCVLIII'],
+ 2149 => ['MMCVLIV', 'MMCIL'],
+ 2195 => ['MMCVC'],
+ 2196 => ['MMCVCI'],
+ 2197 => ['MMCVCII'],
+ 2198 => ['MMCVCIII'],
+ 2199 => ['MMCVCIV', 'MMCIC'],
+ 2245 => ['MMCCVL'],
+ 2246 => ['MMCCVLI'],
+ 2247 => ['MMCCVLII'],
+ 2248 => ['MMCCVLIII'],
+ 2249 => ['MMCCVLIV', 'MMCCIL'],
+ 2295 => ['MMCCVC'],
+ 2296 => ['MMCCVCI'],
+ 2297 => ['MMCCVCII'],
+ 2298 => ['MMCCVCIII'],
+ 2299 => ['MMCCVCIV', 'MMCCIC'],
+ 2345 => ['MMCCCVL'],
+ 2346 => ['MMCCCVLI'],
+ 2347 => ['MMCCCVLII'],
+ 2348 => ['MMCCCVLIII'],
+ 2349 => ['MMCCCVLIV', 'MMCCCIL'],
+ 2395 => ['MMCCCVC'],
+ 2396 => ['MMCCCVCI'],
+ 2397 => ['MMCCCVCII'],
+ 2398 => ['MMCCCVCIII'],
+ 2399 => ['MMCCCVCIV', 'MMCCCIC'],
+ 2445 => ['MMCDVL'],
+ 2446 => ['MMCDVLI'],
+ 2447 => ['MMCDVLII'],
+ 2448 => ['MMCDVLIII'],
+ 2449 => ['MMCDVLIV', 'MMCDIL'],
+ 2450 => ['MMLD'],
+ 2451 => ['MMLDI'],
+ 2452 => ['MMLDII'],
+ 2453 => ['MMLDIII'],
+ 2454 => ['MMLDIV'],
+ 2455 => ['MMLDV'],
+ 2456 => ['MMLDVI'],
+ 2457 => ['MMLDVII'],
+ 2458 => ['MMLDVIII'],
+ 2459 => ['MMLDIX'],
+ 2460 => ['MMLDX'],
+ 2461 => ['MMLDXI'],
+ 2462 => ['MMLDXII'],
+ 2463 => ['MMLDXIII'],
+ 2464 => ['MMLDXIV'],
+ 2465 => ['MMLDXV'],
+ 2466 => ['MMLDXVI'],
+ 2467 => ['MMLDXVII'],
+ 2468 => ['MMLDXVIII'],
+ 2469 => ['MMLDXIX'],
+ 2470 => ['MMLDXX'],
+ 2471 => ['MMLDXXI'],
+ 2472 => ['MMLDXXII'],
+ 2473 => ['MMLDXXIII'],
+ 2474 => ['MMLDXXIV'],
+ 2475 => ['MMLDXXV'],
+ 2476 => ['MMLDXXVI'],
+ 2477 => ['MMLDXXVII'],
+ 2478 => ['MMLDXXVIII'],
+ 2479 => ['MMLDXXIX'],
+ 2480 => ['MMLDXXX'],
+ 2481 => ['MMLDXXXI'],
+ 2482 => ['MMLDXXXII'],
+ 2483 => ['MMLDXXXIII'],
+ 2484 => ['MMLDXXXIV'],
+ 2485 => ['MMLDXXXV'],
+ 2486 => ['MMLDXXXVI'],
+ 2487 => ['MMLDXXXVII'],
+ 2488 => ['MMLDXXXVIII'],
+ 2489 => ['MMLDXXXIX'],
+ 2490 => ['MMLDXL', 'MMXD'],
+ 2491 => ['MMLDXLI', 'MMXDI'],
+ 2492 => ['MMLDXLII', 'MMXDII'],
+ 2493 => ['MMLDXLIII', 'MMXDIII'],
+ 2494 => ['MMLDXLIV', 'MMXDIV'],
+ 2495 => ['MMLDVL', 'MMXDV', 'MMVD'],
+ 2496 => ['MMLDVLI', 'MMXDVI', 'MMVDI'],
+ 2497 => ['MMLDVLII', 'MMXDVII', 'MMVDII'],
+ 2498 => ['MMLDVLIII', 'MMXDVIII', 'MMVDIII'],
+ 2499 => ['MMLDVLIV', 'MMXDIX', 'MMVDIV', 'MMID'],
+ 2545 => ['MMDVL'],
+ 2546 => ['MMDVLI'],
+ 2547 => ['MMDVLII'],
+ 2548 => ['MMDVLIII'],
+ 2549 => ['MMDVLIV', 'MMDIL'],
+ 2595 => ['MMDVC'],
+ 2596 => ['MMDVCI'],
+ 2597 => ['MMDVCII'],
+ 2598 => ['MMDVCIII'],
+ 2599 => ['MMDVCIV', 'MMDIC'],
+ 2645 => ['MMDCVL'],
+ 2646 => ['MMDCVLI'],
+ 2647 => ['MMDCVLII'],
+ 2648 => ['MMDCVLIII'],
+ 2649 => ['MMDCVLIV', 'MMDCIL'],
+ 2695 => ['MMDCVC'],
+ 2696 => ['MMDCVCI'],
+ 2697 => ['MMDCVCII'],
+ 2698 => ['MMDCVCIII'],
+ 2699 => ['MMDCVCIV', 'MMDCIC'],
+ 2745 => ['MMDCCVL'],
+ 2746 => ['MMDCCVLI'],
+ 2747 => ['MMDCCVLII'],
+ 2748 => ['MMDCCVLIII'],
+ 2749 => ['MMDCCVLIV', 'MMDCCIL'],
+ 2795 => ['MMDCCVC'],
+ 2796 => ['MMDCCVCI'],
+ 2797 => ['MMDCCVCII'],
+ 2798 => ['MMDCCVCIII'],
+ 2799 => ['MMDCCVCIV', 'MMDCCIC'],
+ 2845 => ['MMDCCCVL'],
+ 2846 => ['MMDCCCVLI'],
+ 2847 => ['MMDCCCVLII'],
+ 2848 => ['MMDCCCVLIII'],
+ 2849 => ['MMDCCCVLIV', 'MMDCCCIL'],
+ 2895 => ['MMDCCCVC'],
+ 2896 => ['MMDCCCVCI'],
+ 2897 => ['MMDCCCVCII'],
+ 2898 => ['MMDCCCVCIII'],
+ 2899 => ['MMDCCCVCIV', 'MMDCCCIC'],
+ 2945 => ['MMCMVL'],
+ 2946 => ['MMCMVLI'],
+ 2947 => ['MMCMVLII'],
+ 2948 => ['MMCMVLIII'],
+ 2949 => ['MMCMVLIV', 'MMCMIL'],
+ 2950 => ['MMLM'],
+ 2951 => ['MMLMI'],
+ 2952 => ['MMLMII'],
+ 2953 => ['MMLMIII'],
+ 2954 => ['MMLMIV'],
+ 2955 => ['MMLMV'],
+ 2956 => ['MMLMVI'],
+ 2957 => ['MMLMVII'],
+ 2958 => ['MMLMVIII'],
+ 2959 => ['MMLMIX'],
+ 2960 => ['MMLMX'],
+ 2961 => ['MMLMXI'],
+ 2962 => ['MMLMXII'],
+ 2963 => ['MMLMXIII'],
+ 2964 => ['MMLMXIV'],
+ 2965 => ['MMLMXV'],
+ 2966 => ['MMLMXVI'],
+ 2967 => ['MMLMXVII'],
+ 2968 => ['MMLMXVIII'],
+ 2969 => ['MMLMXIX'],
+ 2970 => ['MMLMXX'],
+ 2971 => ['MMLMXXI'],
+ 2972 => ['MMLMXXII'],
+ 2973 => ['MMLMXXIII'],
+ 2974 => ['MMLMXXIV'],
+ 2975 => ['MMLMXXV'],
+ 2976 => ['MMLMXXVI'],
+ 2977 => ['MMLMXXVII'],
+ 2978 => ['MMLMXXVIII'],
+ 2979 => ['MMLMXXIX'],
+ 2980 => ['MMLMXXX'],
+ 2981 => ['MMLMXXXI'],
+ 2982 => ['MMLMXXXII'],
+ 2983 => ['MMLMXXXIII'],
+ 2984 => ['MMLMXXXIV'],
+ 2985 => ['MMLMXXXV'],
+ 2986 => ['MMLMXXXVI'],
+ 2987 => ['MMLMXXXVII'],
+ 2988 => ['MMLMXXXVIII'],
+ 2989 => ['MMLMXXXIX'],
+ 2990 => ['MMLMXL', 'MMXM'],
+ 2991 => ['MMLMXLI', 'MMXMI'],
+ 2992 => ['MMLMXLII', 'MMXMII'],
+ 2993 => ['MMLMXLIII', 'MMXMIII'],
+ 2994 => ['MMLMXLIV', 'MMXMIV'],
+ 2995 => ['MMLMVL', 'MMXMV', 'MMVM'],
+ 2996 => ['MMLMVLI', 'MMXMVI', 'MMVMI'],
+ 2997 => ['MMLMVLII', 'MMXMVII', 'MMVMII'],
+ 2998 => ['MMLMVLIII', 'MMXMVIII', 'MMVMIII'],
+ 2999 => ['MMLMVLIV', 'MMXMIX', 'MMVMIV', 'MMIM'],
+ 3045 => ['MMMVL'],
+ 3046 => ['MMMVLI'],
+ 3047 => ['MMMVLII'],
+ 3048 => ['MMMVLIII'],
+ 3049 => ['MMMVLIV', 'MMMIL'],
+ 3095 => ['MMMVC'],
+ 3096 => ['MMMVCI'],
+ 3097 => ['MMMVCII'],
+ 3098 => ['MMMVCIII'],
+ 3099 => ['MMMVCIV', 'MMMIC'],
+ 3145 => ['MMMCVL'],
+ 3146 => ['MMMCVLI'],
+ 3147 => ['MMMCVLII'],
+ 3148 => ['MMMCVLIII'],
+ 3149 => ['MMMCVLIV', 'MMMCIL'],
+ 3195 => ['MMMCVC'],
+ 3196 => ['MMMCVCI'],
+ 3197 => ['MMMCVCII'],
+ 3198 => ['MMMCVCIII'],
+ 3199 => ['MMMCVCIV', 'MMMCIC'],
+ 3245 => ['MMMCCVL'],
+ 3246 => ['MMMCCVLI'],
+ 3247 => ['MMMCCVLII'],
+ 3248 => ['MMMCCVLIII'],
+ 3249 => ['MMMCCVLIV', 'MMMCCIL'],
+ 3295 => ['MMMCCVC'],
+ 3296 => ['MMMCCVCI'],
+ 3297 => ['MMMCCVCII'],
+ 3298 => ['MMMCCVCIII'],
+ 3299 => ['MMMCCVCIV', 'MMMCCIC'],
+ 3345 => ['MMMCCCVL'],
+ 3346 => ['MMMCCCVLI'],
+ 3347 => ['MMMCCCVLII'],
+ 3348 => ['MMMCCCVLIII'],
+ 3349 => ['MMMCCCVLIV', 'MMMCCCIL'],
+ 3395 => ['MMMCCCVC'],
+ 3396 => ['MMMCCCVCI'],
+ 3397 => ['MMMCCCVCII'],
+ 3398 => ['MMMCCCVCIII'],
+ 3399 => ['MMMCCCVCIV', 'MMMCCCIC'],
+ 3445 => ['MMMCDVL'],
+ 3446 => ['MMMCDVLI'],
+ 3447 => ['MMMCDVLII'],
+ 3448 => ['MMMCDVLIII'],
+ 3449 => ['MMMCDVLIV', 'MMMCDIL'],
+ 3450 => ['MMMLD'],
+ 3451 => ['MMMLDI'],
+ 3452 => ['MMMLDII'],
+ 3453 => ['MMMLDIII'],
+ 3454 => ['MMMLDIV'],
+ 3455 => ['MMMLDV'],
+ 3456 => ['MMMLDVI'],
+ 3457 => ['MMMLDVII'],
+ 3458 => ['MMMLDVIII'],
+ 3459 => ['MMMLDIX'],
+ 3460 => ['MMMLDX'],
+ 3461 => ['MMMLDXI'],
+ 3462 => ['MMMLDXII'],
+ 3463 => ['MMMLDXIII'],
+ 3464 => ['MMMLDXIV'],
+ 3465 => ['MMMLDXV'],
+ 3466 => ['MMMLDXVI'],
+ 3467 => ['MMMLDXVII'],
+ 3468 => ['MMMLDXVIII'],
+ 3469 => ['MMMLDXIX'],
+ 3470 => ['MMMLDXX'],
+ 3471 => ['MMMLDXXI'],
+ 3472 => ['MMMLDXXII'],
+ 3473 => ['MMMLDXXIII'],
+ 3474 => ['MMMLDXXIV'],
+ 3475 => ['MMMLDXXV'],
+ 3476 => ['MMMLDXXVI'],
+ 3477 => ['MMMLDXXVII'],
+ 3478 => ['MMMLDXXVIII'],
+ 3479 => ['MMMLDXXIX'],
+ 3480 => ['MMMLDXXX'],
+ 3481 => ['MMMLDXXXI'],
+ 3482 => ['MMMLDXXXII'],
+ 3483 => ['MMMLDXXXIII'],
+ 3484 => ['MMMLDXXXIV'],
+ 3485 => ['MMMLDXXXV'],
+ 3486 => ['MMMLDXXXVI'],
+ 3487 => ['MMMLDXXXVII'],
+ 3488 => ['MMMLDXXXVIII'],
+ 3489 => ['MMMLDXXXIX'],
+ 3490 => ['MMMLDXL', 'MMMXD'],
+ 3491 => ['MMMLDXLI', 'MMMXDI'],
+ 3492 => ['MMMLDXLII', 'MMMXDII'],
+ 3493 => ['MMMLDXLIII', 'MMMXDIII'],
+ 3494 => ['MMMLDXLIV', 'MMMXDIV'],
+ 3495 => ['MMMLDVL', 'MMMXDV', 'MMMVD'],
+ 3496 => ['MMMLDVLI', 'MMMXDVI', 'MMMVDI'],
+ 3497 => ['MMMLDVLII', 'MMMXDVII', 'MMMVDII'],
+ 3498 => ['MMMLDVLIII', 'MMMXDVIII', 'MMMVDIII'],
+ 3499 => ['MMMLDVLIV', 'MMMXDIX', 'MMMVDIV', 'MMMID'],
+ 3545 => ['MMMDVL'],
+ 3546 => ['MMMDVLI'],
+ 3547 => ['MMMDVLII'],
+ 3548 => ['MMMDVLIII'],
+ 3549 => ['MMMDVLIV', 'MMMDIL'],
+ 3595 => ['MMMDVC'],
+ 3596 => ['MMMDVCI'],
+ 3597 => ['MMMDVCII'],
+ 3598 => ['MMMDVCIII'],
+ 3599 => ['MMMDVCIV', 'MMMDIC'],
+ 3645 => ['MMMDCVL'],
+ 3646 => ['MMMDCVLI'],
+ 3647 => ['MMMDCVLII'],
+ 3648 => ['MMMDCVLIII'],
+ 3649 => ['MMMDCVLIV', 'MMMDCIL'],
+ 3695 => ['MMMDCVC'],
+ 3696 => ['MMMDCVCI'],
+ 3697 => ['MMMDCVCII'],
+ 3698 => ['MMMDCVCIII'],
+ 3699 => ['MMMDCVCIV', 'MMMDCIC'],
+ 3745 => ['MMMDCCVL'],
+ 3746 => ['MMMDCCVLI'],
+ 3747 => ['MMMDCCVLII'],
+ 3748 => ['MMMDCCVLIII'],
+ 3749 => ['MMMDCCVLIV', 'MMMDCCIL'],
+ 3795 => ['MMMDCCVC'],
+ 3796 => ['MMMDCCVCI'],
+ 3797 => ['MMMDCCVCII'],
+ 3798 => ['MMMDCCVCIII'],
+ 3799 => ['MMMDCCVCIV', 'MMMDCCIC'],
+ 3845 => ['MMMDCCCVL'],
+ 3846 => ['MMMDCCCVLI'],
+ 3847 => ['MMMDCCCVLII'],
+ 3848 => ['MMMDCCCVLIII'],
+ 3849 => ['MMMDCCCVLIV', 'MMMDCCCIL'],
+ 3895 => ['MMMDCCCVC'],
+ 3896 => ['MMMDCCCVCI'],
+ 3897 => ['MMMDCCCVCII'],
+ 3898 => ['MMMDCCCVCIII'],
+ 3899 => ['MMMDCCCVCIV', 'MMMDCCCIC'],
+ 3945 => ['MMMCMVL'],
+ 3946 => ['MMMCMVLI'],
+ 3947 => ['MMMCMVLII'],
+ 3948 => ['MMMCMVLIII'],
+ 3949 => ['MMMCMVLIV', 'MMMCMIL'],
+ 3950 => ['MMMLM'],
+ 3951 => ['MMMLMI'],
+ 3952 => ['MMMLMII'],
+ 3953 => ['MMMLMIII'],
+ 3954 => ['MMMLMIV'],
+ 3955 => ['MMMLMV'],
+ 3956 => ['MMMLMVI'],
+ 3957 => ['MMMLMVII'],
+ 3958 => ['MMMLMVIII'],
+ 3959 => ['MMMLMIX'],
+ 3960 => ['MMMLMX'],
+ 3961 => ['MMMLMXI'],
+ 3962 => ['MMMLMXII'],
+ 3963 => ['MMMLMXIII'],
+ 3964 => ['MMMLMXIV'],
+ 3965 => ['MMMLMXV'],
+ 3966 => ['MMMLMXVI'],
+ 3967 => ['MMMLMXVII'],
+ 3968 => ['MMMLMXVIII'],
+ 3969 => ['MMMLMXIX'],
+ 3970 => ['MMMLMXX'],
+ 3971 => ['MMMLMXXI'],
+ 3972 => ['MMMLMXXII'],
+ 3973 => ['MMMLMXXIII'],
+ 3974 => ['MMMLMXXIV'],
+ 3975 => ['MMMLMXXV'],
+ 3976 => ['MMMLMXXVI'],
+ 3977 => ['MMMLMXXVII'],
+ 3978 => ['MMMLMXXVIII'],
+ 3979 => ['MMMLMXXIX'],
+ 3980 => ['MMMLMXXX'],
+ 3981 => ['MMMLMXXXI'],
+ 3982 => ['MMMLMXXXII'],
+ 3983 => ['MMMLMXXXIII'],
+ 3984 => ['MMMLMXXXIV'],
+ 3985 => ['MMMLMXXXV'],
+ 3986 => ['MMMLMXXXVI'],
+ 3987 => ['MMMLMXXXVII'],
+ 3988 => ['MMMLMXXXVIII'],
+ 3989 => ['MMMLMXXXIX'],
+ 3990 => ['MMMLMXL', 'MMMXM'],
+ 3991 => ['MMMLMXLI', 'MMMXMI'],
+ 3992 => ['MMMLMXLII', 'MMMXMII'],
+ 3993 => ['MMMLMXLIII', 'MMMXMIII'],
+ 3994 => ['MMMLMXLIV', 'MMMXMIV'],
+ 3995 => ['MMMLMVL', 'MMMXMV', 'MMMVM'],
+ 3996 => ['MMMLMVLI', 'MMMXMVI', 'MMMVMI'],
+ 3997 => ['MMMLMVLII', 'MMMXMVII', 'MMMVMII'],
+ 3998 => ['MMMLMVLIII', 'MMMXMVIII', 'MMMVMIII'],
+ 3999 => ['MMMLMVLIV', 'MMMXMIX', 'MMMVMIV', 'MMMIM'],
+ ];
+
+ private const THOUSANDS = ['', 'M', 'MM', 'MMM'];
+ private const HUNDREDS = ['', 'C', 'CC', 'CCC', 'CD', 'D', 'DC', 'DCC', 'DCCC', 'CM'];
+ private const TENS = ['', 'X', 'XX', 'XXX', 'XL', 'L', 'LX', 'LXX', 'LXXX', 'XC'];
+ private const ONES = ['', 'I', 'II', 'III', 'IV', 'V', 'VI', 'VII', 'VIII', 'IX'];
+ const MAX_ROMAN_VALUE = 3999;
+ const MAX_ROMAN_STYLE = 4;
+
+ private static function valueOk(int $aValue, int $style): string
+ {
+ $origValue = $aValue;
+ $m = \intdiv($aValue, 1000);
+ $aValue %= 1000;
+ $c = \intdiv($aValue, 100);
+ $aValue %= 100;
+ $t = \intdiv($aValue, 10);
+ $aValue %= 10;
+ $result = self::THOUSANDS[$m] . self::HUNDREDS[$c] . self::TENS[$t] . self::ONES[$aValue];
+ if ($style > 0) {
+ if (array_key_exists($origValue, self::VALUES)) {
+ $arr = self::VALUES[$origValue];
+ $idx = min($style, count($arr)) - 1;
+ $result = $arr[$idx];
+ }
+ }
+
+ return $result;
+ }
+
+ private static function styleOk(int $aValue, int $style): string
+ {
+ return ($aValue < 0 || $aValue > self::MAX_ROMAN_VALUE) ? ExcelError::VALUE() : self::valueOk($aValue, $style);
+ }
+
+ public static function calculateRoman(int $aValue, int $style): string
+ {
+ return ($style < 0 || $style > self::MAX_ROMAN_STYLE) ? ExcelError::VALUE() : self::styleOk($aValue, $style);
+ }
+
+ /**
+ * ROMAN.
+ *
+ * Converts a number to Roman numeral
+ *
+ * @param mixed $aValue Number to convert
+ * Or can be an array of numbers
+ * @param mixed $style Number indicating one of five possible forms
+ * Or can be an array of styles
+ *
+ * @return array|string Roman numeral, or a string containing an error
+ * If an array of numbers is passed as an argument, then the returned result will also be an array
+ * with the same dimensions
+ */
+ public static function evaluate(mixed $aValue, mixed $style = 0): array|string
+ {
+ if (is_array($aValue) || is_array($style)) {
+ return self::evaluateArrayArguments([self::class, __FUNCTION__], $aValue, $style);
+ }
+
+ try {
+ $aValue = Helpers::validateNumericNullBool($aValue);
+ if (is_bool($style)) {
+ $style = $style ? 0 : 4;
+ }
+ $style = Helpers::validateNumericNullSubstitution($style, null);
+ } catch (Exception $e) {
+ return $e->getMessage();
+ }
+
+ return self::calculateRoman((int) $aValue, (int) $style);
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Round.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Round.php
new file mode 100644
index 0000000..a573f2a
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Round.php
@@ -0,0 +1,220 @@
+getMessage();
+ }
+
+ return round($number, (int) $precision);
+ }
+
+ /**
+ * ROUNDUP.
+ *
+ * Rounds a number up to a specified number of decimal places
+ *
+ * @param array|float $number Number to round, or can be an array of numbers
+ * @param array|int $digits Number of digits to which you want to round $number, or can be an array of numbers
+ *
+ * @return array|float|string Rounded Number, or a string containing an error
+ * If an array of numbers is passed as the argument, then the returned result will also be an array
+ * with the same dimensions
+ */
+ public static function up($number, $digits): array|string|float
+ {
+ if (is_array($number) || is_array($digits)) {
+ return self::evaluateArrayArguments([self::class, __FUNCTION__], $number, $digits);
+ }
+
+ try {
+ $number = Helpers::validateNumericNullBool($number);
+ $digits = (int) Helpers::validateNumericNullSubstitution($digits, null);
+ } catch (Exception $e) {
+ return $e->getMessage();
+ }
+
+ if ($number == 0.0) {
+ return 0.0;
+ }
+
+ if ($number < 0.0) {
+ return round($number - 0.5 * 0.1 ** $digits + self::ROUNDING_ADJUSTMENT, $digits, PHP_ROUND_HALF_DOWN);
+ }
+
+ return round($number + 0.5 * 0.1 ** $digits - self::ROUNDING_ADJUSTMENT, $digits, PHP_ROUND_HALF_DOWN);
+ }
+
+ /**
+ * ROUNDDOWN.
+ *
+ * Rounds a number down to a specified number of decimal places
+ *
+ * @param array|float $number Number to round, or can be an array of numbers
+ * @param array|int $digits Number of digits to which you want to round $number, or can be an array of numbers
+ *
+ * @return array|float|string Rounded Number, or a string containing an error
+ * If an array of numbers is passed as the argument, then the returned result will also be an array
+ * with the same dimensions
+ */
+ public static function down($number, $digits): array|string|float
+ {
+ if (is_array($number) || is_array($digits)) {
+ return self::evaluateArrayArguments([self::class, __FUNCTION__], $number, $digits);
+ }
+
+ try {
+ $number = Helpers::validateNumericNullBool($number);
+ $digits = (int) Helpers::validateNumericNullSubstitution($digits, null);
+ } catch (Exception $e) {
+ return $e->getMessage();
+ }
+
+ if ($number == 0.0) {
+ return 0.0;
+ }
+
+ if ($number < 0.0) {
+ return round($number + 0.5 * 0.1 ** $digits - self::ROUNDING_ADJUSTMENT, $digits, PHP_ROUND_HALF_UP);
+ }
+
+ return round($number - 0.5 * 0.1 ** $digits + self::ROUNDING_ADJUSTMENT, $digits, PHP_ROUND_HALF_UP);
+ }
+
+ /**
+ * MROUND.
+ *
+ * Rounds a number to the nearest multiple of a specified value
+ *
+ * @param mixed $number Expect float. Number to round, or can be an array of numbers
+ * @param mixed $multiple Expect int. Multiple to which you want to round, or can be an array of numbers.
+ *
+ * @return array|float|int|string Rounded Number, or a string containing an error
+ * If an array of numbers is passed as the argument, then the returned result will also be an array
+ * with the same dimensions
+ */
+ public static function multiple(mixed $number, mixed $multiple): array|string|int|float
+ {
+ if (is_array($number) || is_array($multiple)) {
+ return self::evaluateArrayArguments([self::class, __FUNCTION__], $number, $multiple);
+ }
+
+ try {
+ $number = Helpers::validateNumericNullSubstitution($number, 0);
+ $multiple = Helpers::validateNumericNullSubstitution($multiple, null);
+ } catch (Exception $e) {
+ return $e->getMessage();
+ }
+
+ if ($number == 0 || $multiple == 0) {
+ return 0;
+ }
+ if ((Helpers::returnSign($number)) == (Helpers::returnSign($multiple))) {
+ $multiplier = 1 / $multiple;
+
+ return round($number * $multiplier) / $multiplier;
+ }
+
+ return ExcelError::NAN();
+ }
+
+ /**
+ * EVEN.
+ *
+ * Returns number rounded up to the nearest even integer.
+ * You can use this function for processing items that come in twos. For example,
+ * a packing crate accepts rows of one or two items. The crate is full when
+ * the number of items, rounded up to the nearest two, matches the crate's
+ * capacity.
+ *
+ * Excel Function:
+ * EVEN(number)
+ *
+ * @param array|float $number Number to round, or can be an array of numbers
+ *
+ * @return array|float|string Rounded Number, or a string containing an error
+ * If an array of numbers is passed as the argument, then the returned result will also be an array
+ * with the same dimensions
+ */
+ public static function even($number): array|string|float
+ {
+ if (is_array($number)) {
+ return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $number);
+ }
+
+ try {
+ $number = Helpers::validateNumericNullBool($number);
+ } catch (Exception $e) {
+ return $e->getMessage();
+ }
+
+ return Helpers::getEven($number);
+ }
+
+ /**
+ * ODD.
+ *
+ * Returns number rounded up to the nearest odd integer.
+ *
+ * @param array|float $number Number to round, or can be an array of numbers
+ *
+ * @return array|float|int|string Rounded Number, or a string containing an error
+ * If an array of numbers is passed as the argument, then the returned result will also be an array
+ * with the same dimensions
+ */
+ public static function odd($number): array|string|int|float
+ {
+ if (is_array($number)) {
+ return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $number);
+ }
+
+ try {
+ $number = Helpers::validateNumericNullBool($number);
+ } catch (Exception $e) {
+ return $e->getMessage();
+ }
+
+ $significance = Helpers::returnSign($number);
+ if ($significance == 0) {
+ return 1;
+ }
+
+ $result = ceil($number / $significance) * $significance;
+ if ($result == Helpers::getEven($result)) {
+ $result += $significance;
+ }
+
+ return $result;
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/SeriesSum.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/SeriesSum.php
new file mode 100644
index 0000000..bb10090
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/SeriesSum.php
@@ -0,0 +1,53 @@
+getMessage();
+ }
+
+ return $returnValue;
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Sign.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Sign.php
new file mode 100644
index 0000000..86a5509
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Sign.php
@@ -0,0 +1,38 @@
+getMessage();
+ }
+
+ return Helpers::returnSign($number);
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Sqrt.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Sqrt.php
new file mode 100644
index 0000000..18289f7
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Sqrt.php
@@ -0,0 +1,64 @@
+getMessage();
+ }
+
+ return Helpers::numberOrNan(sqrt($number));
+ }
+
+ /**
+ * SQRTPI.
+ *
+ * Returns the square root of (number * pi).
+ *
+ * @param array|float $number Number, or can be an array of numbers
+ *
+ * @return array|float|string Square Root of Number * Pi, or a string containing an error
+ * If an array of numbers is passed as the argument, then the returned result will also be an array
+ * with the same dimensions
+ */
+ public static function pi($number): array|string|float
+ {
+ if (is_array($number)) {
+ return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $number);
+ }
+
+ try {
+ $number = Helpers::validateNumericNullSubstitution($number, 0);
+ Helpers::validateNotNegative($number);
+ } catch (Exception $e) {
+ return $e->getMessage();
+ }
+
+ return sqrt($number * M_PI);
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Subtotal.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Subtotal.php
new file mode 100644
index 0000000..cfced9e
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Subtotal.php
@@ -0,0 +1,127 @@
+getWorksheet()->getRowDimension($row)->getVisible();
+ },
+ ARRAY_FILTER_USE_KEY
+ );
+ }
+
+ protected static function filterFormulaArgs(mixed $cellReference, mixed $args): array
+ {
+ return array_filter(
+ $args,
+ function ($index) use ($cellReference): bool {
+ $explodeArray = explode('.', $index);
+ $row = $explodeArray[1] ?? '';
+ $column = $explodeArray[2] ?? '';
+ $retVal = true;
+ if ($cellReference->getWorksheet()->cellExists($column . $row)) {
+ //take this cell out if it contains the SUBTOTAL or AGGREGATE functions in a formula
+ $isFormula = $cellReference->getWorksheet()->getCell($column . $row)->isFormula();
+ $cellFormula = !preg_match(
+ '/^=.*\b(SUBTOTAL|AGGREGATE)\s*\(/i',
+ $cellReference->getWorksheet()->getCell($column . $row)->getValue() ?? ''
+ );
+
+ $retVal = !$isFormula || $cellFormula;
+ }
+
+ return $retVal;
+ },
+ ARRAY_FILTER_USE_KEY
+ );
+ }
+
+ /**
+ * @var array
+ */
+ private const CALL_FUNCTIONS = [
+ 1 => [Statistical\Averages::class, 'average'], // 1 and 101
+ [Statistical\Counts::class, 'COUNT'], // 2 and 102
+ [Statistical\Counts::class, 'COUNTA'], // 3 and 103
+ [Statistical\Maximum::class, 'max'], // 4 and 104
+ [Statistical\Minimum::class, 'min'], // 5 and 105
+ [Operations::class, 'product'], // 6 and 106
+ [Statistical\StandardDeviations::class, 'STDEV'], // 7 and 107
+ [Statistical\StandardDeviations::class, 'STDEVP'], // 8 and 108
+ [Sum::class, 'sumIgnoringStrings'], // 9 and 109
+ [Statistical\Variances::class, 'VAR'], // 10 and 110
+ [Statistical\Variances::class, 'VARP'], // 111 and 111
+ ];
+
+ /**
+ * SUBTOTAL.
+ *
+ * Returns a subtotal in a list or database.
+ *
+ * @param mixed $functionType
+ * A number 1 to 11 that specifies which function to
+ * use in calculating subtotals within a range
+ * list
+ * Numbers 101 to 111 shadow the functions of 1 to 11
+ * but ignore any values in the range that are
+ * in hidden rows
+ * @param mixed[] $args A mixed data series of values
+ */
+ public static function evaluate(mixed $functionType, ...$args): float|int|string
+ {
+ $cellReference = array_pop($args);
+ $bArgs = Functions::flattenArrayIndexed($args);
+ $aArgs = [];
+ // int keys must come before string keys for PHP 8.0+
+ // Otherwise, PHP thinks positional args follow keyword
+ // in the subsequent call to call_user_func_array.
+ // Fortunately, order of args is unimportant to Subtotal.
+ foreach ($bArgs as $key => $value) {
+ if (is_int($key)) {
+ $aArgs[$key] = $value;
+ }
+ }
+ foreach ($bArgs as $key => $value) {
+ if (!is_int($key)) {
+ $aArgs[$key] = $value;
+ }
+ }
+
+ try {
+ $subtotal = (int) Helpers::validateNumericNullBool($functionType);
+ } catch (Exception $e) {
+ return $e->getMessage();
+ }
+
+ // Calculate
+ if ($subtotal > 100) {
+ $aArgs = self::filterHiddenArgs($cellReference, $aArgs);
+ $subtotal -= 100;
+ }
+
+ $aArgs = self::filterFormulaArgs($cellReference, $aArgs);
+ if (array_key_exists($subtotal, self::CALL_FUNCTIONS)) {
+ $call = self::CALL_FUNCTIONS[$subtotal];
+
+ return call_user_func_array($call, $aArgs);
+ }
+
+ return ExcelError::VALUE();
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Sum.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Sum.php
new file mode 100644
index 0000000..f939d9e
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Sum.php
@@ -0,0 +1,110 @@
+ $arg) {
+ // Is it a numeric value?
+ if (is_numeric($arg)) {
+ $returnValue += $arg;
+ } elseif (is_bool($arg)) {
+ $returnValue += (int) $arg;
+ } elseif (ErrorValue::isError($arg)) {
+ return $arg;
+ } elseif ($arg !== null && !Functions::isCellValue($k)) {
+ // ignore non-numerics from cell, but fail as literals (except null)
+ return ExcelError::VALUE();
+ }
+ }
+
+ return $returnValue;
+ }
+
+ /**
+ * SUMPRODUCT.
+ *
+ * Excel Function:
+ * SUMPRODUCT(value1[,value2[, ...]])
+ *
+ * @param mixed ...$args Data values
+ *
+ * @return float|int|string The result, or a string containing an error
+ */
+ public static function product(mixed ...$args): string|int|float
+ {
+ $arrayList = $args;
+
+ $wrkArray = Functions::flattenArray(array_shift($arrayList));
+ $wrkCellCount = count($wrkArray);
+
+ for ($i = 0; $i < $wrkCellCount; ++$i) {
+ if ((!is_numeric($wrkArray[$i])) || (is_string($wrkArray[$i]))) {
+ $wrkArray[$i] = 0;
+ }
+ }
+
+ foreach ($arrayList as $matrixData) {
+ $array2 = Functions::flattenArray($matrixData);
+ $count = count($array2);
+ if ($wrkCellCount != $count) {
+ return ExcelError::VALUE();
+ }
+
+ foreach ($array2 as $i => $val) {
+ if ((!is_numeric($val)) || (is_string($val))) {
+ $val = 0;
+ }
+ $wrkArray[$i] *= $val;
+ }
+ }
+
+ return array_sum($wrkArray);
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/SumSquares.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/SumSquares.php
new file mode 100644
index 0000000..b2e9cea
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/SumSquares.php
@@ -0,0 +1,133 @@
+getMessage();
+ }
+
+ return $returnValue;
+ }
+
+ private static function getCount(array $array1, array $array2): int
+ {
+ $count = count($array1);
+ if ($count !== count($array2)) {
+ throw new Exception(ExcelError::NA());
+ }
+
+ return $count;
+ }
+
+ /**
+ * These functions accept only numeric arguments, not even strings which are numeric.
+ */
+ private static function numericNotString(mixed $item): bool
+ {
+ return is_numeric($item) && !is_string($item);
+ }
+
+ /**
+ * SUMX2MY2.
+ *
+ * @param mixed[] $matrixData1 Matrix #1
+ * @param mixed[] $matrixData2 Matrix #2
+ */
+ public static function sumXSquaredMinusYSquared(array $matrixData1, array $matrixData2): string|int|float
+ {
+ try {
+ $array1 = Functions::flattenArray($matrixData1);
+ $array2 = Functions::flattenArray($matrixData2);
+ $count = self::getCount($array1, $array2);
+
+ $result = 0;
+ for ($i = 0; $i < $count; ++$i) {
+ if (self::numericNotString($array1[$i]) && self::numericNotString($array2[$i])) {
+ $result += ($array1[$i] * $array1[$i]) - ($array2[$i] * $array2[$i]);
+ }
+ }
+ } catch (Exception $e) {
+ return $e->getMessage();
+ }
+
+ return $result;
+ }
+
+ /**
+ * SUMX2PY2.
+ *
+ * @param mixed[] $matrixData1 Matrix #1
+ * @param mixed[] $matrixData2 Matrix #2
+ */
+ public static function sumXSquaredPlusYSquared(array $matrixData1, array $matrixData2): string|int|float
+ {
+ try {
+ $array1 = Functions::flattenArray($matrixData1);
+ $array2 = Functions::flattenArray($matrixData2);
+ $count = self::getCount($array1, $array2);
+
+ $result = 0;
+ for ($i = 0; $i < $count; ++$i) {
+ if (self::numericNotString($array1[$i]) && self::numericNotString($array2[$i])) {
+ $result += ($array1[$i] * $array1[$i]) + ($array2[$i] * $array2[$i]);
+ }
+ }
+ } catch (Exception $e) {
+ return $e->getMessage();
+ }
+
+ return $result;
+ }
+
+ /**
+ * SUMXMY2.
+ *
+ * @param mixed[] $matrixData1 Matrix #1
+ * @param mixed[] $matrixData2 Matrix #2
+ */
+ public static function sumXMinusYSquared(array $matrixData1, array $matrixData2): string|int|float
+ {
+ try {
+ $array1 = Functions::flattenArray($matrixData1);
+ $array2 = Functions::flattenArray($matrixData2);
+ $count = self::getCount($array1, $array2);
+
+ $result = 0;
+ for ($i = 0; $i < $count; ++$i) {
+ if (self::numericNotString($array1[$i]) && self::numericNotString($array2[$i])) {
+ $result += ($array1[$i] - $array2[$i]) * ($array1[$i] - $array2[$i]);
+ }
+ }
+ } catch (Exception $e) {
+ return $e->getMessage();
+ }
+
+ return $result;
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Trig/Cosecant.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Trig/Cosecant.php
new file mode 100644
index 0000000..845b6c1
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Trig/Cosecant.php
@@ -0,0 +1,64 @@
+getMessage();
+ }
+
+ return Helpers::verySmallDenominator(1.0, sin($angle));
+ }
+
+ /**
+ * CSCH.
+ *
+ * Returns the hyperbolic cosecant of an angle.
+ *
+ * @param array|float $angle Number, or can be an array of numbers
+ *
+ * @return array|float|string The hyperbolic cosecant of the angle
+ * If an array of numbers is passed as the argument, then the returned result will also be an array
+ * with the same dimensions
+ */
+ public static function csch($angle)
+ {
+ if (is_array($angle)) {
+ return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $angle);
+ }
+
+ try {
+ $angle = Helpers::validateNumericNullBool($angle);
+ } catch (Exception $e) {
+ return $e->getMessage();
+ }
+
+ return Helpers::verySmallDenominator(1.0, sinh($angle));
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Trig/Cosine.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Trig/Cosine.php
new file mode 100644
index 0000000..733e3d6
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Trig/Cosine.php
@@ -0,0 +1,116 @@
+getMessage();
+ }
+
+ return cos($number);
+ }
+
+ /**
+ * COSH.
+ *
+ * Returns the result of builtin function cosh after validating args.
+ *
+ * @param mixed $number Should be numeric, or can be an array of numbers
+ *
+ * @return array|float|string hyperbolic cosine
+ * If an array of numbers is passed as the argument, then the returned result will also be an array
+ * with the same dimensions
+ */
+ public static function cosh(mixed $number): array|string|float
+ {
+ if (is_array($number)) {
+ return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $number);
+ }
+
+ try {
+ $number = Helpers::validateNumericNullBool($number);
+ } catch (Exception $e) {
+ return $e->getMessage();
+ }
+
+ return cosh($number);
+ }
+
+ /**
+ * ACOS.
+ *
+ * Returns the arccosine of a number.
+ *
+ * @param array|float $number Number, or can be an array of numbers
+ *
+ * @return array|float|string The arccosine of the number
+ * If an array of numbers is passed as the argument, then the returned result will also be an array
+ * with the same dimensions
+ */
+ public static function acos($number)
+ {
+ if (is_array($number)) {
+ return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $number);
+ }
+
+ try {
+ $number = Helpers::validateNumericNullBool($number);
+ } catch (Exception $e) {
+ return $e->getMessage();
+ }
+
+ return Helpers::numberOrNan(acos($number));
+ }
+
+ /**
+ * ACOSH.
+ *
+ * Returns the arc inverse hyperbolic cosine of a number.
+ *
+ * @param array|float $number Number, or can be an array of numbers
+ *
+ * @return array|float|string The inverse hyperbolic cosine of the number, or an error string
+ * If an array of numbers is passed as the argument, then the returned result will also be an array
+ * with the same dimensions
+ */
+ public static function acosh($number)
+ {
+ if (is_array($number)) {
+ return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $number);
+ }
+
+ try {
+ $number = Helpers::validateNumericNullBool($number);
+ } catch (Exception $e) {
+ return $e->getMessage();
+ }
+
+ return Helpers::numberOrNan(acosh($number));
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Trig/Cotangent.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Trig/Cotangent.php
new file mode 100644
index 0000000..861159a
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Trig/Cotangent.php
@@ -0,0 +1,118 @@
+getMessage();
+ }
+
+ return Helpers::verySmallDenominator(cos($angle), sin($angle));
+ }
+
+ /**
+ * COTH.
+ *
+ * Returns the hyperbolic cotangent of an angle.
+ *
+ * @param array|float $angle Number, or can be an array of numbers
+ *
+ * @return array|float|string The hyperbolic cotangent of the angle
+ * If an array of numbers is passed as the argument, then the returned result will also be an array
+ * with the same dimensions
+ */
+ public static function coth($angle)
+ {
+ if (is_array($angle)) {
+ return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $angle);
+ }
+
+ try {
+ $angle = Helpers::validateNumericNullBool($angle);
+ } catch (Exception $e) {
+ return $e->getMessage();
+ }
+
+ return Helpers::verySmallDenominator(1.0, tanh($angle));
+ }
+
+ /**
+ * ACOT.
+ *
+ * Returns the arccotangent of a number.
+ *
+ * @param array|float $number Number, or can be an array of numbers
+ *
+ * @return array|float|string The arccotangent of the number
+ * If an array of numbers is passed as the argument, then the returned result will also be an array
+ * with the same dimensions
+ */
+ public static function acot($number): array|string|float
+ {
+ if (is_array($number)) {
+ return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $number);
+ }
+
+ try {
+ $number = Helpers::validateNumericNullBool($number);
+ } catch (Exception $e) {
+ return $e->getMessage();
+ }
+
+ return (M_PI / 2) - atan($number);
+ }
+
+ /**
+ * ACOTH.
+ *
+ * Returns the hyperbolic arccotangent of a number.
+ *
+ * @param array|float $number Number, or can be an array of numbers
+ *
+ * @return array|float|string The hyperbolic arccotangent of the number
+ * If an array of numbers is passed as the argument, then the returned result will also be an array
+ * with the same dimensions
+ */
+ public static function acoth($number)
+ {
+ if (is_array($number)) {
+ return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $number);
+ }
+
+ try {
+ $number = Helpers::validateNumericNullBool($number);
+ } catch (Exception $e) {
+ return $e->getMessage();
+ }
+
+ $result = ($number === 1) ? NAN : (log(($number + 1) / ($number - 1)) / 2);
+
+ return Helpers::numberOrNan($result);
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Trig/Secant.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Trig/Secant.php
new file mode 100644
index 0000000..2d26e5d
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Trig/Secant.php
@@ -0,0 +1,64 @@
+getMessage();
+ }
+
+ return Helpers::verySmallDenominator(1.0, cos($angle));
+ }
+
+ /**
+ * SECH.
+ *
+ * Returns the hyperbolic secant of an angle.
+ *
+ * @param array|float $angle Number, or can be an array of numbers
+ *
+ * @return array|float|string The hyperbolic secant of the angle
+ * If an array of numbers is passed as the argument, then the returned result will also be an array
+ * with the same dimensions
+ */
+ public static function sech($angle)
+ {
+ if (is_array($angle)) {
+ return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $angle);
+ }
+
+ try {
+ $angle = Helpers::validateNumericNullBool($angle);
+ } catch (Exception $e) {
+ return $e->getMessage();
+ }
+
+ return Helpers::verySmallDenominator(1.0, cosh($angle));
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Trig/Sine.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Trig/Sine.php
new file mode 100644
index 0000000..924466e
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Trig/Sine.php
@@ -0,0 +1,116 @@
+getMessage();
+ }
+
+ return sin($angle);
+ }
+
+ /**
+ * SINH.
+ *
+ * Returns the result of builtin function sinh after validating args.
+ *
+ * @param mixed $angle Should be numeric, or can be an array of numbers
+ *
+ * @return array|float|string hyperbolic sine
+ * If an array of numbers is passed as the argument, then the returned result will also be an array
+ * with the same dimensions
+ */
+ public static function sinh(mixed $angle): array|string|float
+ {
+ if (is_array($angle)) {
+ return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $angle);
+ }
+
+ try {
+ $angle = Helpers::validateNumericNullBool($angle);
+ } catch (Exception $e) {
+ return $e->getMessage();
+ }
+
+ return sinh($angle);
+ }
+
+ /**
+ * ASIN.
+ *
+ * Returns the arcsine of a number.
+ *
+ * @param array|float $number Number, or can be an array of numbers
+ *
+ * @return array|float|string The arcsine of the number
+ * If an array of numbers is passed as the argument, then the returned result will also be an array
+ * with the same dimensions
+ */
+ public static function asin($number)
+ {
+ if (is_array($number)) {
+ return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $number);
+ }
+
+ try {
+ $number = Helpers::validateNumericNullBool($number);
+ } catch (Exception $e) {
+ return $e->getMessage();
+ }
+
+ return Helpers::numberOrNan(asin($number));
+ }
+
+ /**
+ * ASINH.
+ *
+ * Returns the inverse hyperbolic sine of a number.
+ *
+ * @param array|float $number Number, or can be an array of numbers
+ *
+ * @return array|float|string The inverse hyperbolic sine of the number
+ * If an array of numbers is passed as the argument, then the returned result will also be an array
+ * with the same dimensions
+ */
+ public static function asinh($number)
+ {
+ if (is_array($number)) {
+ return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $number);
+ }
+
+ try {
+ $number = Helpers::validateNumericNullBool($number);
+ } catch (Exception $e) {
+ return $e->getMessage();
+ }
+
+ return Helpers::numberOrNan(asinh($number));
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Trig/Tangent.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Trig/Tangent.php
new file mode 100644
index 0000000..9d6775f
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Trig/Tangent.php
@@ -0,0 +1,160 @@
+getMessage();
+ }
+
+ return Helpers::verySmallDenominator(sin($angle), cos($angle));
+ }
+
+ /**
+ * TANH.
+ *
+ * Returns the result of builtin function sinh after validating args.
+ *
+ * @param mixed $angle Should be numeric, or can be an array of numbers
+ *
+ * @return array|float|string hyperbolic tangent
+ * If an array of numbers is passed as the argument, then the returned result will also be an array
+ * with the same dimensions
+ */
+ public static function tanh(mixed $angle): array|string|float
+ {
+ if (is_array($angle)) {
+ return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $angle);
+ }
+
+ try {
+ $angle = Helpers::validateNumericNullBool($angle);
+ } catch (Exception $e) {
+ return $e->getMessage();
+ }
+
+ return tanh($angle);
+ }
+
+ /**
+ * ATAN.
+ *
+ * Returns the arctangent of a number.
+ *
+ * @param array|float $number Number, or can be an array of numbers
+ *
+ * @return array|float|string The arctangent of the number
+ * If an array of numbers is passed as the argument, then the returned result will also be an array
+ * with the same dimensions
+ */
+ public static function atan($number)
+ {
+ if (is_array($number)) {
+ return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $number);
+ }
+
+ try {
+ $number = Helpers::validateNumericNullBool($number);
+ } catch (Exception $e) {
+ return $e->getMessage();
+ }
+
+ return Helpers::numberOrNan(atan($number));
+ }
+
+ /**
+ * ATANH.
+ *
+ * Returns the inverse hyperbolic tangent of a number.
+ *
+ * @param array|float $number Number, or can be an array of numbers
+ *
+ * @return array|float|string The inverse hyperbolic tangent of the number
+ * If an array of numbers is passed as the argument, then the returned result will also be an array
+ * with the same dimensions
+ */
+ public static function atanh($number)
+ {
+ if (is_array($number)) {
+ return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $number);
+ }
+
+ try {
+ $number = Helpers::validateNumericNullBool($number);
+ } catch (Exception $e) {
+ return $e->getMessage();
+ }
+
+ return Helpers::numberOrNan(atanh($number));
+ }
+
+ /**
+ * ATAN2.
+ *
+ * This function calculates the arc tangent of the two variables x and y. It is similar to
+ * calculating the arc tangent of y ÷ x, except that the signs of both arguments are used
+ * to determine the quadrant of the result.
+ * The arctangent is the angle from the x-axis to a line containing the origin (0, 0) and a
+ * point with coordinates (xCoordinate, yCoordinate). The angle is given in radians between
+ * -pi and pi, excluding -pi.
+ *
+ * Note that the Excel ATAN2() function accepts its arguments in the reverse order to the standard
+ * PHP atan2() function, so we need to reverse them here before calling the PHP atan() function.
+ *
+ * Excel Function:
+ * ATAN2(xCoordinate,yCoordinate)
+ *
+ * @param mixed $xCoordinate should be float, the x-coordinate of the point, or can be an array of numbers
+ * @param mixed $yCoordinate should be float, the y-coordinate of the point, or can be an array of numbers
+ *
+ * @return array|float|string The inverse tangent of the specified x- and y-coordinates, or a string containing an error
+ * If an array of numbers is passed as one of the arguments, then the returned result will also be an array
+ * with the same dimensions
+ */
+ public static function atan2(mixed $xCoordinate, mixed $yCoordinate): array|string|float
+ {
+ if (is_array($xCoordinate) || is_array($yCoordinate)) {
+ return self::evaluateArrayArguments([self::class, __FUNCTION__], $xCoordinate, $yCoordinate);
+ }
+
+ try {
+ $xCoordinate = Helpers::validateNumericNullBool($xCoordinate);
+ $yCoordinate = Helpers::validateNumericNullBool($yCoordinate);
+ } catch (Exception $e) {
+ return $e->getMessage();
+ }
+
+ if (($xCoordinate == 0) && ($yCoordinate == 0)) {
+ return ExcelError::DIV0();
+ }
+
+ return atan2($yCoordinate, $xCoordinate);
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Trunc.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Trunc.php
new file mode 100644
index 0000000..44aedd2
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig/Trunc.php
@@ -0,0 +1,48 @@
+getMessage();
+ }
+
+ $digits = floor($digits);
+
+ // Truncate
+ $adjust = 10 ** $digits;
+
+ if (($digits > 0) && (rtrim((string) (int) ((abs($value) - abs((int) $value)) * $adjust), '0') < $adjust / 10)) {
+ return $value;
+ }
+
+ return ((int) ($value * $adjust)) / $adjust;
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/AggregateBase.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/AggregateBase.php
new file mode 100644
index 0000000..a10b278
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/AggregateBase.php
@@ -0,0 +1,59 @@
+ $arg) {
+ $arg = self::testAcceptedBoolean($arg, $k);
+ // Is it a numeric value?
+ // Strings containing numeric values are only counted if they are string literals (not cell values)
+ // and then only in MS Excel and in Open Office, not in Gnumeric
+ if ((is_string($arg)) && (!is_numeric($arg)) && (!Functions::isCellValue($k))) {
+ return ExcelError::VALUE();
+ }
+ if (self::isAcceptedCountable($arg, $k)) {
+ $returnValue += abs($arg - $aMean);
+ ++$aCount;
+ }
+ }
+
+ // Return
+ if ($aCount === 0) {
+ return ExcelError::DIV0();
+ }
+
+ return $returnValue / $aCount;
+ }
+
+ /**
+ * AVERAGE.
+ *
+ * Returns the average (arithmetic mean) of the arguments
+ *
+ * Excel Function:
+ * AVERAGE(value1[,value2[, ...]])
+ *
+ * @param mixed ...$args Data values
+ *
+ * @return float|int|string (string if result is an error)
+ */
+ public static function average(mixed ...$args): string|int|float
+ {
+ $returnValue = $aCount = 0;
+
+ // Loop through arguments
+ foreach (Functions::flattenArrayIndexed($args) as $k => $arg) {
+ $arg = self::testAcceptedBoolean($arg, $k);
+ // Is it a numeric value?
+ // Strings containing numeric values are only counted if they are string literals (not cell values)
+ // and then only in MS Excel and in Open Office, not in Gnumeric
+ if ((is_string($arg)) && (!is_numeric($arg)) && (!Functions::isCellValue($k))) {
+ return ExcelError::VALUE();
+ }
+ if (self::isAcceptedCountable($arg, $k)) {
+ $returnValue += $arg;
+ ++$aCount;
+ }
+ }
+
+ // Return
+ if ($aCount > 0) {
+ return $returnValue / $aCount;
+ }
+
+ return ExcelError::DIV0();
+ }
+
+ /**
+ * AVERAGEA.
+ *
+ * Returns the average of its arguments, including numbers, text, and logical values
+ *
+ * Excel Function:
+ * AVERAGEA(value1[,value2[, ...]])
+ *
+ * @param mixed ...$args Data values
+ *
+ * @return float|int|string (string if result is an error)
+ */
+ public static function averageA(mixed ...$args): string|int|float
+ {
+ $returnValue = null;
+
+ $aCount = 0;
+ // Loop through arguments
+ foreach (Functions::flattenArrayIndexed($args) as $k => $arg) {
+ if (is_numeric($arg)) {
+ // do nothing
+ } elseif (is_bool($arg)) {
+ $arg = (int) $arg;
+ } elseif (!Functions::isMatrixValue($k)) {
+ $arg = 0;
+ } else {
+ return ExcelError::VALUE();
+ }
+ $returnValue += $arg;
+ ++$aCount;
+ }
+
+ if ($aCount > 0) {
+ return $returnValue / $aCount;
+ }
+
+ return ExcelError::DIV0();
+ }
+
+ /**
+ * MEDIAN.
+ *
+ * Returns the median of the given numbers. The median is the number in the middle of a set of numbers.
+ *
+ * Excel Function:
+ * MEDIAN(value1[,value2[, ...]])
+ *
+ * @param mixed ...$args Data values
+ *
+ * @return float|string The result, or a string containing an error
+ */
+ public static function median(mixed ...$args): float|string
+ {
+ $aArgs = Functions::flattenArray($args);
+
+ $returnValue = ExcelError::NAN();
+
+ $aArgs = self::filterArguments($aArgs);
+ $valueCount = count($aArgs);
+ if ($valueCount > 0) {
+ sort($aArgs, SORT_NUMERIC);
+ $valueCount = $valueCount / 2;
+ if ($valueCount == floor($valueCount)) {
+ $returnValue = ($aArgs[$valueCount--] + $aArgs[$valueCount]) / 2;
+ } else {
+ $valueCount = floor($valueCount);
+ $returnValue = $aArgs[$valueCount];
+ }
+ }
+
+ return $returnValue;
+ }
+
+ /**
+ * MODE.
+ *
+ * Returns the most frequently occurring, or repetitive, value in an array or range of data
+ *
+ * Excel Function:
+ * MODE(value1[,value2[, ...]])
+ *
+ * @param mixed ...$args Data values
+ *
+ * @return float|string The result, or a string containing an error
+ */
+ public static function mode(mixed ...$args): float|string
+ {
+ $returnValue = ExcelError::NA();
+
+ // Loop through arguments
+ $aArgs = Functions::flattenArray($args);
+ $aArgs = self::filterArguments($aArgs);
+
+ if (!empty($aArgs)) {
+ return self::modeCalc($aArgs);
+ }
+
+ return $returnValue;
+ }
+
+ protected static function filterArguments(array $args): array
+ {
+ return array_filter(
+ $args,
+ function ($value): bool {
+ // Is it a numeric value?
+ return is_numeric($value) && (!is_string($value));
+ }
+ );
+ }
+
+ /**
+ * Special variant of array_count_values that isn't limited to strings and integers,
+ * but can work with floating point numbers as values.
+ */
+ private static function modeCalc(array $data): float|string
+ {
+ $frequencyArray = [];
+ $index = 0;
+ $maxfreq = 0;
+ $maxfreqkey = '';
+ $maxfreqdatum = '';
+ foreach ($data as $datum) {
+ $found = false;
+ ++$index;
+ foreach ($frequencyArray as $key => $value) {
+ if ((string) $value['value'] == (string) $datum) {
+ ++$frequencyArray[$key]['frequency'];
+ $freq = $frequencyArray[$key]['frequency'];
+ if ($freq > $maxfreq) {
+ $maxfreq = $freq;
+ $maxfreqkey = $key;
+ $maxfreqdatum = $datum;
+ } elseif ($freq == $maxfreq) {
+ if ($frequencyArray[$key]['index'] < $frequencyArray[$maxfreqkey]['index']) {
+ $maxfreqkey = $key;
+ $maxfreqdatum = $datum;
+ }
+ }
+ $found = true;
+
+ break;
+ }
+ }
+
+ if ($found === false) {
+ $frequencyArray[] = [
+ 'value' => $datum,
+ 'frequency' => 1,
+ 'index' => $index,
+ ];
+ }
+ }
+
+ if ($maxfreq <= 1) {
+ return ExcelError::NA();
+ }
+
+ return $maxfreqdatum;
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Averages/Mean.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Averages/Mean.php
new file mode 100644
index 0000000..2051675
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Averages/Mean.php
@@ -0,0 +1,126 @@
+ 0)) {
+ $aCount = Counts::COUNT($aArgs);
+ if (Minimum::min($aArgs) > 0) {
+ return $aMean ** (1 / $aCount);
+ }
+ }
+
+ return ExcelError::NAN();
+ }
+
+ /**
+ * HARMEAN.
+ *
+ * Returns the harmonic mean of a data set. The harmonic mean is the reciprocal of the
+ * arithmetic mean of reciprocals.
+ *
+ * Excel Function:
+ * HARMEAN(value1[,value2[, ...]])
+ *
+ * @param mixed ...$args Data values
+ */
+ public static function harmonic(mixed ...$args): string|float|int
+ {
+ // Loop through arguments
+ $aArgs = Functions::flattenArray($args);
+ if (Minimum::min($aArgs) < 0) {
+ return ExcelError::NAN();
+ }
+
+ $returnValue = 0;
+ $aCount = 0;
+ foreach ($aArgs as $arg) {
+ // Is it a numeric value?
+ if ((is_numeric($arg)) && (!is_string($arg))) {
+ if ($arg <= 0) {
+ return ExcelError::NAN();
+ }
+ $returnValue += (1 / $arg);
+ ++$aCount;
+ }
+ }
+
+ // Return
+ if ($aCount > 0) {
+ return 1 / ($returnValue / $aCount);
+ }
+
+ return ExcelError::NA();
+ }
+
+ /**
+ * TRIMMEAN.
+ *
+ * Returns the mean of the interior of a data set. TRIMMEAN calculates the mean
+ * taken by excluding a percentage of data points from the top and bottom tails
+ * of a data set.
+ *
+ * Excel Function:
+ * TRIMEAN(value1[,value2[, ...]], $discard)
+ *
+ * @param mixed $args Data values
+ */
+ public static function trim(mixed ...$args): float|string
+ {
+ $aArgs = Functions::flattenArray($args);
+
+ // Calculate
+ $percent = array_pop($aArgs);
+
+ if ((is_numeric($percent)) && (!is_string($percent))) {
+ if (($percent < 0) || ($percent > 1)) {
+ return ExcelError::NAN();
+ }
+
+ $mArgs = [];
+ foreach ($aArgs as $arg) {
+ // Is it a numeric value?
+ if ((is_numeric($arg)) && (!is_string($arg))) {
+ $mArgs[] = $arg;
+ }
+ }
+
+ $discard = floor(Counts::COUNT($mArgs) * $percent / 2);
+ sort($mArgs);
+
+ for ($i = 0; $i < $discard; ++$i) {
+ array_pop($mArgs);
+ array_shift($mArgs);
+ }
+
+ return Averages::average($mArgs);
+ }
+
+ return ExcelError::VALUE();
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Conditional.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Conditional.php
new file mode 100644
index 0000000..ae98c60
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Conditional.php
@@ -0,0 +1,293 @@
+ $value !== null && $value !== ''
+ );
+
+ $range = array_merge([[self::CONDITION_COLUMN_NAME]], array_chunk($range, 1));
+ $condition = array_merge([[self::CONDITION_COLUMN_NAME]], [[$condition]]);
+
+ return DCount::evaluate($range, null, $condition, false);
+ }
+
+ /**
+ * COUNTIFS.
+ *
+ * Counts the number of cells that contain numbers within the list of arguments
+ *
+ * Excel Function:
+ * COUNTIFS(criteria_range1, criteria1, [criteria_range2, criteria2]…)
+ *
+ * @param mixed $args Pairs of Ranges and Criteria
+ */
+ public static function COUNTIFS(mixed ...$args): int|string
+ {
+ if (empty($args)) {
+ return 0;
+ } elseif (count($args) === 2) {
+ return self::COUNTIF(...$args);
+ }
+
+ $database = self::buildDatabase(...$args);
+ $conditions = self::buildConditionSet(...$args);
+
+ return DCount::evaluate($database, null, $conditions, false);
+ }
+
+ /**
+ * MAXIFS.
+ *
+ * Returns the maximum value within a range of cells that contain numbers within the list of arguments
+ *
+ * Excel Function:
+ * MAXIFS(max_range, criteria_range1, criteria1, [criteria_range2, criteria2]…)
+ *
+ * @param mixed $args Pairs of Ranges and Criteria
+ */
+ public static function MAXIFS(mixed ...$args): null|float|string
+ {
+ if (empty($args)) {
+ return 0.0;
+ }
+
+ $conditions = self::buildConditionSetForValueRange(...$args);
+ $database = self::buildDatabaseWithValueRange(...$args);
+
+ return DMax::evaluate($database, self::VALUE_COLUMN_NAME, $conditions, false);
+ }
+
+ /**
+ * MINIFS.
+ *
+ * Returns the minimum value within a range of cells that contain numbers within the list of arguments
+ *
+ * Excel Function:
+ * MINIFS(min_range, criteria_range1, criteria1, [criteria_range2, criteria2]…)
+ *
+ * @param mixed $args Pairs of Ranges and Criteria
+ */
+ public static function MINIFS(mixed ...$args): null|float|string
+ {
+ if (empty($args)) {
+ return 0.0;
+ }
+
+ $conditions = self::buildConditionSetForValueRange(...$args);
+ $database = self::buildDatabaseWithValueRange(...$args);
+
+ return DMin::evaluate($database, self::VALUE_COLUMN_NAME, $conditions, false);
+ }
+
+ /**
+ * SUMIF.
+ *
+ * Totals the values of cells that contain numbers within the list of arguments
+ *
+ * Excel Function:
+ * SUMIF(range, criteria, [sum_range])
+ *
+ * @param array $range Data values
+ */
+ public static function SUMIF(array $range, mixed $condition, array $sumRange = []): null|float|string
+ {
+ $database = self::databaseFromRangeAndValue($range, $sumRange);
+ $condition = [[self::CONDITION_COLUMN_NAME, self::VALUE_COLUMN_NAME], [$condition, null]];
+
+ return DSum::evaluate($database, self::VALUE_COLUMN_NAME, $condition);
+ }
+
+ /**
+ * SUMIFS.
+ *
+ * Counts the number of cells that contain numbers within the list of arguments
+ *
+ * Excel Function:
+ * SUMIFS(average_range, criteria_range1, criteria1, [criteria_range2, criteria2]…)
+ *
+ * @param mixed $args Pairs of Ranges and Criteria
+ */
+ public static function SUMIFS(mixed ...$args): null|float|string
+ {
+ if (empty($args)) {
+ return 0.0;
+ } elseif (count($args) === 3) {
+ return self::SUMIF($args[1], $args[2], $args[0]);
+ }
+
+ $conditions = self::buildConditionSetForValueRange(...$args);
+ $database = self::buildDatabaseWithValueRange(...$args);
+
+ return DSum::evaluate($database, self::VALUE_COLUMN_NAME, $conditions);
+ }
+
+ /** @param array $args */
+ private static function buildConditionSet(...$args): array
+ {
+ $conditions = self::buildConditions(1, ...$args);
+
+ return array_map(null, ...$conditions);
+ }
+
+ /** @param array $args */
+ private static function buildConditionSetForValueRange(...$args): array
+ {
+ $conditions = self::buildConditions(2, ...$args);
+
+ if (count($conditions) === 1) {
+ return array_map(
+ fn ($value): array => [$value],
+ $conditions[0]
+ );
+ }
+
+ return array_map(null, ...$conditions);
+ }
+
+ /** @param array $args */
+ private static function buildConditions(int $startOffset, ...$args): array
+ {
+ $conditions = [];
+
+ $pairCount = 1;
+ $argumentCount = count($args);
+ for ($argument = $startOffset; $argument < $argumentCount; $argument += 2) {
+ $conditions[] = array_merge([sprintf(self::CONDITIONAL_COLUMN_NAME, $pairCount)], [$args[$argument]]);
+ ++$pairCount;
+ }
+
+ return $conditions;
+ }
+
+ /** @param array $args */
+ private static function buildDatabase(...$args): array
+ {
+ $database = [];
+
+ return self::buildDataSet(0, $database, ...$args);
+ }
+
+ /** @param array $args */
+ private static function buildDatabaseWithValueRange(...$args): array
+ {
+ $database = [];
+ $database[] = array_merge(
+ [self::VALUE_COLUMN_NAME],
+ Functions::flattenArray($args[0])
+ );
+
+ return self::buildDataSet(1, $database, ...$args);
+ }
+
+ /** @param array $args */
+ private static function buildDataSet(int $startOffset, array $database, ...$args): array
+ {
+ $pairCount = 1;
+ $argumentCount = count($args);
+ for ($argument = $startOffset; $argument < $argumentCount; $argument += 2) {
+ $database[] = array_merge(
+ [sprintf(self::CONDITIONAL_COLUMN_NAME, $pairCount)],
+ Functions::flattenArray($args[$argument])
+ );
+ ++$pairCount;
+ }
+
+ return array_map(null, ...$database);
+ }
+
+ private static function databaseFromRangeAndValue(array $range, array $valueRange = []): array
+ {
+ $range = Functions::flattenArray($range);
+
+ $valueRange = Functions::flattenArray($valueRange);
+ if (empty($valueRange)) {
+ $valueRange = $range;
+ }
+
+ $database = array_map(null, array_merge([self::CONDITION_COLUMN_NAME], $range), array_merge([self::VALUE_COLUMN_NAME], $valueRange));
+
+ return $database;
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Confidence.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Confidence.php
new file mode 100644
index 0000000..492438a
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Confidence.php
@@ -0,0 +1,51 @@
+getMessage();
+ }
+
+ if (($alpha <= 0) || ($alpha >= 1) || ($stdDev <= 0) || ($size < 1)) {
+ return ExcelError::NAN();
+ }
+ /** @var float $temp */
+ $temp = Distributions\StandardNormal::inverse(1 - $alpha / 2);
+
+ return Functions::scalar($temp * $stdDev / sqrt($size));
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Counts.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Counts.php
new file mode 100644
index 0000000..20ed634
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Counts.php
@@ -0,0 +1,96 @@
+ $arg) {
+ $arg = self::testAcceptedBoolean($arg, $k);
+ // Is it a numeric value?
+ // Strings containing numeric values are only counted if they are string literals (not cell values)
+ // and then only in MS Excel and in Open Office, not in Gnumeric
+ if (self::isAcceptedCountable($arg, $k, true)) {
+ ++$returnValue;
+ }
+ }
+
+ return $returnValue;
+ }
+
+ /**
+ * COUNTA.
+ *
+ * Counts the number of cells that are not empty within the list of arguments
+ *
+ * Excel Function:
+ * COUNTA(value1[,value2[, ...]])
+ *
+ * @param mixed ...$args Data values
+ */
+ public static function COUNTA(mixed ...$args): int
+ {
+ $returnValue = 0;
+
+ // Loop through arguments
+ $aArgs = Functions::flattenArrayIndexed($args);
+ foreach ($aArgs as $k => $arg) {
+ // Nulls are counted if literals, but not if cell values
+ if ($arg !== null || (!Functions::isCellValue($k))) {
+ ++$returnValue;
+ }
+ }
+
+ return $returnValue;
+ }
+
+ /**
+ * COUNTBLANK.
+ *
+ * Counts the number of empty cells within the list of arguments
+ *
+ * Excel Function:
+ * COUNTBLANK(value1[,value2[, ...]])
+ *
+ * @param mixed $range Data values
+ */
+ public static function COUNTBLANK(mixed $range): int
+ {
+ if ($range === null) {
+ return 1;
+ }
+ if (!is_array($range) || array_key_exists(0, $range)) {
+ throw new CalcException('Must specify range of cells, not any kind of literal');
+ }
+ $returnValue = 0;
+
+ // Loop through arguments
+ $aArgs = Functions::flattenArray($range);
+ foreach ($aArgs as $arg) {
+ // Is it a blank cell?
+ if (($arg === null) || ((is_string($arg)) && ($arg == ''))) {
+ ++$returnValue;
+ }
+ }
+
+ return $returnValue;
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Deviations.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Deviations.php
new file mode 100644
index 0000000..77c0d38
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Deviations.php
@@ -0,0 +1,138 @@
+ $arg) {
+ // Is it a numeric value?
+ if (
+ (is_bool($arg))
+ && ((!Functions::isCellValue($k))
+ || (Functions::getCompatibilityMode() == Functions::COMPATIBILITY_OPENOFFICE))
+ ) {
+ $arg = (int) $arg;
+ }
+ if ((is_numeric($arg)) && (!is_string($arg))) {
+ $returnValue += ($arg - $aMean) ** 2;
+ ++$aCount;
+ }
+ }
+
+ return $aCount === 0 ? ExcelError::VALUE() : $returnValue;
+ }
+
+ /**
+ * KURT.
+ *
+ * Returns the kurtosis of a data set. Kurtosis characterizes the relative peakedness
+ * or flatness of a distribution compared with the normal distribution. Positive
+ * kurtosis indicates a relatively peaked distribution. Negative kurtosis indicates a
+ * relatively flat distribution.
+ *
+ * @param array ...$args Data Series
+ */
+ public static function kurtosis(...$args): string|int|float
+ {
+ $aArgs = Functions::flattenArrayIndexed($args);
+ $mean = Averages::average($aArgs);
+ if (!is_numeric($mean)) {
+ return ExcelError::DIV0();
+ }
+ $stdDev = (float) StandardDeviations::STDEV($aArgs);
+
+ if ($stdDev > 0) {
+ $count = $summer = 0;
+
+ foreach ($aArgs as $k => $arg) {
+ if ((is_bool($arg)) && (!Functions::isMatrixValue($k))) {
+ } else {
+ // Is it a numeric value?
+ if ((is_numeric($arg)) && (!is_string($arg))) {
+ $summer += (($arg - $mean) / $stdDev) ** 4;
+ ++$count;
+ }
+ }
+ }
+
+ if ($count > 3) {
+ return $summer * ($count * ($count + 1)
+ / (($count - 1) * ($count - 2) * ($count - 3))) - (3 * ($count - 1) ** 2
+ / (($count - 2) * ($count - 3)));
+ }
+ }
+
+ return ExcelError::DIV0();
+ }
+
+ /**
+ * SKEW.
+ *
+ * Returns the skewness of a distribution. Skewness characterizes the degree of asymmetry
+ * of a distribution around its mean. Positive skewness indicates a distribution with an
+ * asymmetric tail extending toward more positive values. Negative skewness indicates a
+ * distribution with an asymmetric tail extending toward more negative values.
+ *
+ * @param array ...$args Data Series
+ *
+ * @return float|int|string The result, or a string containing an error
+ */
+ public static function skew(...$args): string|int|float
+ {
+ $aArgs = Functions::flattenArrayIndexed($args);
+ $mean = Averages::average($aArgs);
+ if (!is_numeric($mean)) {
+ return ExcelError::DIV0();
+ }
+ $stdDev = StandardDeviations::STDEV($aArgs);
+ if ($stdDev === 0.0 || is_string($stdDev)) {
+ return ExcelError::DIV0();
+ }
+
+ $count = $summer = 0;
+ // Loop through arguments
+ foreach ($aArgs as $k => $arg) {
+ if ((is_bool($arg)) && (!Functions::isMatrixValue($k))) {
+ } elseif (!is_numeric($arg)) {
+ return ExcelError::VALUE();
+ } else {
+ // Is it a numeric value?
+ if ((is_numeric($arg)) && (!is_string($arg))) {
+ $summer += (($arg - $mean) / $stdDev) ** 3;
+ ++$count;
+ }
+ }
+ }
+
+ if ($count > 2) {
+ return $summer * ($count / (($count - 1) * ($count - 2)));
+ }
+
+ return ExcelError::DIV0();
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Distributions/Beta.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Distributions/Beta.php
new file mode 100644
index 0000000..16817ce
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Distributions/Beta.php
@@ -0,0 +1,279 @@
+getMessage();
+ }
+
+ if ($rMin > $rMax) {
+ $tmp = $rMin;
+ $rMin = $rMax;
+ $rMax = $tmp;
+ }
+ if (($value < $rMin) || ($value > $rMax) || ($alpha <= 0) || ($beta <= 0) || ($rMin == $rMax)) {
+ return ExcelError::NAN();
+ }
+
+ $value -= $rMin;
+ $value /= ($rMax - $rMin);
+
+ return self::incompleteBeta($value, $alpha, $beta);
+ }
+
+ /**
+ * BETAINV.
+ *
+ * Returns the inverse of the Beta distribution.
+ *
+ * @param mixed $probability Float probability at which you want to evaluate the distribution
+ * Or can be an array of values
+ * @param mixed $alpha Parameter to the distribution as a float
+ * Or can be an array of values
+ * @param mixed $beta Parameter to the distribution as a float
+ * Or can be an array of values
+ * @param mixed $rMin Minimum value as a float
+ * Or can be an array of values
+ * @param mixed $rMax Maximum value as a float
+ * Or can be an array of values
+ *
+ * @return array|float|string If an array of numbers is passed as an argument, then the returned result will also be an array
+ * with the same dimensions
+ */
+ public static function inverse(mixed $probability, mixed $alpha, mixed $beta, mixed $rMin = 0.0, mixed $rMax = 1.0): array|string|float
+ {
+ if (is_array($probability) || is_array($alpha) || is_array($beta) || is_array($rMin) || is_array($rMax)) {
+ return self::evaluateArrayArguments([self::class, __FUNCTION__], $probability, $alpha, $beta, $rMin, $rMax);
+ }
+
+ $rMin = $rMin ?? 0.0;
+ $rMax = $rMax ?? 1.0;
+
+ try {
+ $probability = DistributionValidations::validateProbability($probability);
+ $alpha = DistributionValidations::validateFloat($alpha);
+ $beta = DistributionValidations::validateFloat($beta);
+ $rMax = DistributionValidations::validateFloat($rMax);
+ $rMin = DistributionValidations::validateFloat($rMin);
+ } catch (Exception $e) {
+ return $e->getMessage();
+ }
+
+ if ($rMin > $rMax) {
+ $tmp = $rMin;
+ $rMin = $rMax;
+ $rMax = $tmp;
+ }
+ if (($alpha <= 0) || ($beta <= 0) || ($rMin == $rMax) || ($probability <= 0.0)) {
+ return ExcelError::NAN();
+ }
+
+ return self::calculateInverse($probability, $alpha, $beta, $rMin, $rMax);
+ }
+
+ private static function calculateInverse(float $probability, float $alpha, float $beta, float $rMin, float $rMax): string|float
+ {
+ $a = 0;
+ $b = 2;
+ $guess = ($a + $b) / 2;
+
+ $i = 0;
+ while ((($b - $a) > Functions::PRECISION) && (++$i <= self::MAX_ITERATIONS)) {
+ $guess = ($a + $b) / 2;
+ $result = self::distribution($guess, $alpha, $beta);
+ if (($result === $probability) || ($result === 0.0)) {
+ $b = $a;
+ } elseif ($result > $probability) {
+ $b = $guess;
+ } else {
+ $a = $guess;
+ }
+ }
+
+ if ($i === self::MAX_ITERATIONS) {
+ return ExcelError::NA();
+ }
+
+ return round($rMin + $guess * ($rMax - $rMin), 12);
+ }
+
+ /**
+ * Incomplete beta function.
+ *
+ * @author Jaco van Kooten
+ * @author Paul Meagher
+ *
+ * The computation is based on formulas from Numerical Recipes, Chapter 6.4 (W.H. Press et al, 1992).
+ *
+ * @param float $x require 0<=x<=1
+ * @param float $p require p>0
+ * @param float $q require q>0
+ *
+ * @return float 0 if x<0, p<=0, q<=0 or p+q>2.55E305 and 1 if x>1 to avoid errors and over/underflow
+ */
+ public static function incompleteBeta(float $x, float $p, float $q): float
+ {
+ if ($x <= 0.0) {
+ return 0.0;
+ } elseif ($x >= 1.0) {
+ return 1.0;
+ } elseif (($p <= 0.0) || ($q <= 0.0) || (($p + $q) > self::LOG_GAMMA_X_MAX_VALUE)) {
+ return 0.0;
+ }
+
+ $beta_gam = exp((0 - self::logBeta($p, $q)) + $p * log($x) + $q * log(1.0 - $x));
+ if ($x < ($p + 1.0) / ($p + $q + 2.0)) {
+ return $beta_gam * self::betaFraction($x, $p, $q) / $p;
+ }
+
+ return 1.0 - ($beta_gam * self::betaFraction(1 - $x, $q, $p) / $q);
+ }
+
+ // Function cache for logBeta function
+
+ private static float $logBetaCacheP = 0.0;
+
+ private static float $logBetaCacheQ = 0.0;
+
+ private static float $logBetaCacheResult = 0.0;
+
+ /**
+ * The natural logarithm of the beta function.
+ *
+ * @param float $p require p>0
+ * @param float $q require q>0
+ *
+ * @return float 0 if p<=0, q<=0 or p+q>2.55E305 to avoid errors and over/underflow
+ *
+ * @author Jaco van Kooten
+ */
+ private static function logBeta(float $p, float $q): float
+ {
+ if ($p != self::$logBetaCacheP || $q != self::$logBetaCacheQ) {
+ self::$logBetaCacheP = $p;
+ self::$logBetaCacheQ = $q;
+ if (($p <= 0.0) || ($q <= 0.0) || (($p + $q) > self::LOG_GAMMA_X_MAX_VALUE)) {
+ self::$logBetaCacheResult = 0.0;
+ } else {
+ self::$logBetaCacheResult = Gamma::logGamma($p) + Gamma::logGamma($q) - Gamma::logGamma($p + $q);
+ }
+ }
+
+ return self::$logBetaCacheResult;
+ }
+
+ /**
+ * Evaluates of continued fraction part of incomplete beta function.
+ * Based on an idea from Numerical Recipes (W.H. Press et al, 1992).
+ *
+ * @author Jaco van Kooten
+ */
+ private static function betaFraction(float $x, float $p, float $q): float
+ {
+ $c = 1.0;
+ $sum_pq = $p + $q;
+ $p_plus = $p + 1.0;
+ $p_minus = $p - 1.0;
+ $h = 1.0 - $sum_pq * $x / $p_plus;
+ if (abs($h) < self::XMININ) {
+ $h = self::XMININ;
+ }
+ $h = 1.0 / $h;
+ $frac = $h;
+ $m = 1;
+ $delta = 0.0;
+ while ($m <= self::MAX_ITERATIONS && abs($delta - 1.0) > Functions::PRECISION) {
+ $m2 = 2 * $m;
+ // even index for d
+ $d = $m * ($q - $m) * $x / (($p_minus + $m2) * ($p + $m2));
+ $h = 1.0 + $d * $h;
+ if (abs($h) < self::XMININ) {
+ $h = self::XMININ;
+ }
+ $h = 1.0 / $h;
+ $c = 1.0 + $d / $c;
+ if (abs($c) < self::XMININ) {
+ $c = self::XMININ;
+ }
+ $frac *= $h * $c;
+ // odd index for d
+ $d = -($p + $m) * ($sum_pq + $m) * $x / (($p + $m2) * ($p_plus + $m2));
+ $h = 1.0 + $d * $h;
+ if (abs($h) < self::XMININ) {
+ $h = self::XMININ;
+ }
+ $h = 1.0 / $h;
+ $c = 1.0 + $d / $c;
+ if (abs($c) < self::XMININ) {
+ $c = self::XMININ;
+ }
+ $delta = $h * $c;
+ $frac *= $delta;
+ ++$m;
+ }
+
+ return $frac;
+ }
+
+ /*
+ private static function betaValue(float $a, float $b): float
+ {
+ return (Gamma::gammaValue($a) * Gamma::gammaValue($b)) /
+ Gamma::gammaValue($a + $b);
+ }
+
+ private static function regularizedIncompleteBeta(float $value, float $a, float $b): float
+ {
+ return self::incompleteBeta($value, $a, $b) / self::betaValue($a, $b);
+ }
+ */
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Distributions/Binomial.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Distributions/Binomial.php
new file mode 100644
index 0000000..2ce3fd5
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Distributions/Binomial.php
@@ -0,0 +1,231 @@
+getMessage();
+ }
+
+ if (($value < 0) || ($value > $trials)) {
+ return ExcelError::NAN();
+ }
+
+ if ($cumulative) {
+ return self::calculateCumulativeBinomial($value, $trials, $probability);
+ }
+ /** @var float $comb */
+ $comb = Combinations::withoutRepetition($trials, $value);
+
+ return $comb * $probability ** $value
+ * (1 - $probability) ** ($trials - $value);
+ }
+
+ /**
+ * BINOM.DIST.RANGE.
+ *
+ * Returns returns the Binomial Distribution probability for the number of successes from a specified number
+ * of trials falling into a specified range.
+ *
+ * @param mixed $trials Integer number of trials
+ * Or can be an array of values
+ * @param mixed $probability Probability of success on each trial as a float
+ * Or can be an array of values
+ * @param mixed $successes The integer number of successes in trials
+ * Or can be an array of values
+ * @param mixed $limit Upper limit for successes in trials as null, or an integer
+ * If null, then this will indicate the same as the number of Successes
+ * Or can be an array of values
+ *
+ * @return array|float|int|string If an array of numbers is passed as an argument, then the returned result will also be an array
+ * with the same dimensions
+ */
+ public static function range(mixed $trials, mixed $probability, mixed $successes, mixed $limit = null): array|string|float|int
+ {
+ if (is_array($trials) || is_array($probability) || is_array($successes) || is_array($limit)) {
+ return self::evaluateArrayArguments([self::class, __FUNCTION__], $trials, $probability, $successes, $limit);
+ }
+
+ $limit = $limit ?? $successes;
+
+ try {
+ $trials = DistributionValidations::validateInt($trials);
+ $probability = DistributionValidations::validateProbability($probability);
+ $successes = DistributionValidations::validateInt($successes);
+ $limit = DistributionValidations::validateInt($limit);
+ } catch (Exception $e) {
+ return $e->getMessage();
+ }
+
+ if (($successes < 0) || ($successes > $trials)) {
+ return ExcelError::NAN();
+ }
+ if (($limit < 0) || ($limit > $trials) || $limit < $successes) {
+ return ExcelError::NAN();
+ }
+
+ $summer = 0;
+ for ($i = $successes; $i <= $limit; ++$i) {
+ /** @var float $comb */
+ $comb = Combinations::withoutRepetition($trials, $i);
+ $summer += $comb * $probability ** $i
+ * (1 - $probability) ** ($trials - $i);
+ }
+
+ return $summer;
+ }
+
+ /**
+ * NEGBINOMDIST.
+ *
+ * Returns the negative binomial distribution. NEGBINOMDIST returns the probability that
+ * there will be number_f failures before the number_s-th success, when the constant
+ * probability of a success is probability_s. This function is similar to the binomial
+ * distribution, except that the number of successes is fixed, and the number of trials is
+ * variable. Like the binomial, trials are assumed to be independent.
+ *
+ * @param mixed $failures Number of Failures as an integer
+ * Or can be an array of values
+ * @param mixed $successes Threshold number of Successes as an integer
+ * Or can be an array of values
+ * @param mixed $probability Probability of success on each trial as a float
+ * Or can be an array of values
+ *
+ * @return array|float|string The result, or a string containing an error
+ * If an array of numbers is passed as an argument, then the returned result will also be an array
+ * with the same dimensions
+ *
+ * TODO Add support for the cumulative flag not present for NEGBINOMDIST, but introduced for NEGBINOM.DIST
+ * The cumulative default should be false to reflect the behaviour of NEGBINOMDIST
+ */
+ public static function negative(mixed $failures, mixed $successes, mixed $probability): array|string|float
+ {
+ if (is_array($failures) || is_array($successes) || is_array($probability)) {
+ return self::evaluateArrayArguments([self::class, __FUNCTION__], $failures, $successes, $probability);
+ }
+
+ try {
+ $failures = DistributionValidations::validateInt($failures);
+ $successes = DistributionValidations::validateInt($successes);
+ $probability = DistributionValidations::validateProbability($probability);
+ } catch (Exception $e) {
+ return $e->getMessage();
+ }
+
+ if (($failures < 0) || ($successes < 1)) {
+ return ExcelError::NAN();
+ }
+ if (Functions::getCompatibilityMode() == Functions::COMPATIBILITY_GNUMERIC) {
+ if (($failures + $successes - 1) <= 0) {
+ return ExcelError::NAN();
+ }
+ }
+ /** @var float $comb */
+ $comb = Combinations::withoutRepetition($failures + $successes - 1, $successes - 1);
+
+ return $comb
+ * ($probability ** $successes) * ((1 - $probability) ** $failures);
+ }
+
+ /**
+ * BINOM.INV.
+ *
+ * Returns the smallest value for which the cumulative binomial distribution is greater
+ * than or equal to a criterion value
+ *
+ * @param mixed $trials number of Bernoulli trials as an integer
+ * Or can be an array of values
+ * @param mixed $probability probability of a success on each trial as a float
+ * Or can be an array of values
+ * @param mixed $alpha criterion value as a float
+ * Or can be an array of values
+ *
+ * @return array|int|string If an array of numbers is passed as an argument, then the returned result will also be an array
+ * with the same dimensions
+ */
+ public static function inverse(mixed $trials, mixed $probability, mixed $alpha): array|string|int
+ {
+ if (is_array($trials) || is_array($probability) || is_array($alpha)) {
+ return self::evaluateArrayArguments([self::class, __FUNCTION__], $trials, $probability, $alpha);
+ }
+
+ try {
+ $trials = DistributionValidations::validateInt($trials);
+ $probability = DistributionValidations::validateProbability($probability);
+ $alpha = DistributionValidations::validateFloat($alpha);
+ } catch (Exception $e) {
+ return $e->getMessage();
+ }
+
+ if ($trials < 0) {
+ return ExcelError::NAN();
+ } elseif (($alpha < 0.0) || ($alpha > 1.0)) {
+ return ExcelError::NAN();
+ }
+
+ $successes = 0;
+ while ($successes <= $trials) {
+ $result = self::calculateCumulativeBinomial($successes, $trials, $probability);
+ if ($result >= $alpha) {
+ break;
+ }
+ ++$successes;
+ }
+
+ return $successes;
+ }
+
+ private static function calculateCumulativeBinomial(int $value, int $trials, float $probability): float|int
+ {
+ $summer = 0;
+ for ($i = 0; $i <= $value; ++$i) {
+ /** @var float $comb */
+ $comb = Combinations::withoutRepetition($trials, $i);
+ $summer += $comb * $probability ** $i
+ * (1 - $probability) ** ($trials - $i);
+ }
+
+ return $summer;
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Distributions/ChiSquared.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Distributions/ChiSquared.php
new file mode 100644
index 0000000..49b0dfc
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Distributions/ChiSquared.php
@@ -0,0 +1,331 @@
+getMessage();
+ }
+
+ if ($degrees < 1) {
+ return ExcelError::NAN();
+ }
+ if ($value < 0) {
+ if (Functions::getCompatibilityMode() == Functions::COMPATIBILITY_GNUMERIC) {
+ return 1;
+ }
+
+ return ExcelError::NAN();
+ }
+
+ return 1 - (Gamma::incompleteGamma($degrees / 2, $value / 2) / Gamma::gammaValue($degrees / 2));
+ }
+
+ /**
+ * CHIDIST.
+ *
+ * Returns the one-tailed probability of the chi-squared distribution.
+ *
+ * @param mixed $value Float value for which we want the probability
+ * Or can be an array of values
+ * @param mixed $degrees Integer degrees of freedom
+ * Or can be an array of values
+ * @param mixed $cumulative Boolean value indicating if we want the cdf (true) or the pdf (false)
+ * Or can be an array of values
+ *
+ * @return array|float|int|string If an array of numbers is passed as an argument, then the returned result will also be an array
+ * with the same dimensions
+ */
+ public static function distributionLeftTail(mixed $value, mixed $degrees, mixed $cumulative): array|string|int|float
+ {
+ if (is_array($value) || is_array($degrees) || is_array($cumulative)) {
+ return self::evaluateArrayArguments([self::class, __FUNCTION__], $value, $degrees, $cumulative);
+ }
+
+ try {
+ $value = DistributionValidations::validateFloat($value);
+ $degrees = DistributionValidations::validateInt($degrees);
+ $cumulative = DistributionValidations::validateBool($cumulative);
+ } catch (Exception $e) {
+ return $e->getMessage();
+ }
+
+ if ($degrees < 1) {
+ return ExcelError::NAN();
+ }
+ if ($value < 0) {
+ if (Functions::getCompatibilityMode() == Functions::COMPATIBILITY_GNUMERIC) {
+ return 1;
+ }
+
+ return ExcelError::NAN();
+ }
+
+ if ($cumulative === true) {
+ $temp = self::distributionRightTail($value, $degrees);
+
+ return 1 - (is_numeric($temp) ? $temp : 0);
+ }
+
+ return ($value ** (($degrees / 2) - 1) * exp(-$value / 2))
+ / ((2 ** ($degrees / 2)) * Gamma::gammaValue($degrees / 2));
+ }
+
+ /**
+ * CHIINV.
+ *
+ * Returns the inverse of the right-tailed probability of the chi-squared distribution.
+ *
+ * @param mixed $probability Float probability at which you want to evaluate the distribution
+ * Or can be an array of values
+ * @param mixed $degrees Integer degrees of freedom
+ * Or can be an array of values
+ *
+ * @return array|float|string If an array of numbers is passed as an argument, then the returned result will also be an array
+ * with the same dimensions
+ */
+ public static function inverseRightTail(mixed $probability, mixed $degrees)
+ {
+ if (is_array($probability) || is_array($degrees)) {
+ return self::evaluateArrayArguments([self::class, __FUNCTION__], $probability, $degrees);
+ }
+
+ try {
+ $probability = DistributionValidations::validateProbability($probability);
+ $degrees = DistributionValidations::validateInt($degrees);
+ } catch (Exception $e) {
+ return $e->getMessage();
+ }
+
+ if ($degrees < 1) {
+ return ExcelError::NAN();
+ }
+
+ $callback = function ($value) use ($degrees): float {
+ return 1 - (Gamma::incompleteGamma($degrees / 2, $value / 2)
+ / Gamma::gammaValue($degrees / 2));
+ };
+
+ $newtonRaphson = new NewtonRaphson($callback);
+
+ return $newtonRaphson->execute($probability);
+ }
+
+ /**
+ * CHIINV.
+ *
+ * Returns the inverse of the left-tailed probability of the chi-squared distribution.
+ *
+ * @param mixed $probability Float probability at which you want to evaluate the distribution
+ * Or can be an array of values
+ * @param mixed $degrees Integer degrees of freedom
+ * Or can be an array of values
+ *
+ * @return array|float|string If an array of numbers is passed as an argument, then the returned result will also be an array
+ * with the same dimensions
+ */
+ public static function inverseLeftTail(mixed $probability, mixed $degrees): array|string|float
+ {
+ if (is_array($probability) || is_array($degrees)) {
+ return self::evaluateArrayArguments([self::class, __FUNCTION__], $probability, $degrees);
+ }
+
+ try {
+ $probability = DistributionValidations::validateProbability($probability);
+ $degrees = DistributionValidations::validateInt($degrees);
+ } catch (Exception $e) {
+ return $e->getMessage();
+ }
+
+ if ($degrees < 1) {
+ return ExcelError::NAN();
+ }
+
+ return self::inverseLeftTailCalculation($probability, $degrees);
+ }
+
+ /**
+ * CHITEST.
+ *
+ * Uses the chi-square test to calculate the probability that the differences between two supplied data sets
+ * (of observed and expected frequencies), are likely to be simply due to sampling error,
+ * or if they are likely to be real.
+ *
+ * @param mixed $actual an array of observed frequencies
+ * @param mixed $expected an array of expected frequencies
+ */
+ public static function test(mixed $actual, mixed $expected): float|string
+ {
+ $rows = count($actual);
+ $actual = Functions::flattenArray($actual);
+ $expected = Functions::flattenArray($expected);
+ $columns = intdiv(count($actual), $rows);
+
+ $countActuals = count($actual);
+ $countExpected = count($expected);
+ if ($countActuals !== $countExpected || $countActuals === 1) {
+ return ExcelError::NAN();
+ }
+
+ $result = 0.0;
+ for ($i = 0; $i < $countActuals; ++$i) {
+ if ($expected[$i] == 0.0) {
+ return ExcelError::DIV0();
+ } elseif ($expected[$i] < 0.0) {
+ return ExcelError::NAN();
+ }
+ $result += (($actual[$i] - $expected[$i]) ** 2) / $expected[$i];
+ }
+
+ $degrees = self::degrees($rows, $columns);
+
+ $result = Functions::scalar(self::distributionRightTail($result, $degrees));
+
+ return $result;
+ }
+
+ protected static function degrees(int $rows, int $columns): int
+ {
+ if ($rows === 1) {
+ return $columns - 1;
+ } elseif ($columns === 1) {
+ return $rows - 1;
+ }
+
+ return ($columns - 1) * ($rows - 1);
+ }
+
+ private static function inverseLeftTailCalculation(float $probability, int $degrees): float
+ {
+ // bracket the root
+ $min = 0;
+ $sd = sqrt(2.0 * $degrees);
+ $max = 2 * $sd;
+ $s = -1;
+
+ while ($s * self::pchisq($max, $degrees) > $probability * $s) {
+ $min = $max;
+ $max += 2 * $sd;
+ }
+
+ // Find root using bisection
+ $chi2 = 0.5 * ($min + $max);
+
+ while (($max - $min) > self::EPS * $chi2) {
+ if ($s * self::pchisq($chi2, $degrees) > $probability * $s) {
+ $min = $chi2;
+ } else {
+ $max = $chi2;
+ }
+ $chi2 = 0.5 * ($min + $max);
+ }
+
+ return $chi2;
+ }
+
+ private static function pchisq(float $chi2, int $degrees): float
+ {
+ return self::gammp($degrees, 0.5 * $chi2);
+ }
+
+ private static function gammp(int $n, float $x): float
+ {
+ if ($x < 0.5 * $n + 1) {
+ return self::gser($n, $x);
+ }
+
+ return 1 - self::gcf($n, $x);
+ }
+
+ // Return the incomplete gamma function P(n/2,x) evaluated by
+ // series representation. Algorithm from numerical recipe.
+ // Assume that n is a positive integer and x>0, won't check arguments.
+ // Relative error controlled by the eps parameter
+ private static function gser(int $n, float $x): float
+ {
+ /** @var float $gln */
+ $gln = Gamma::ln($n / 2);
+ $a = 0.5 * $n;
+ $ap = $a;
+ $sum = 1.0 / $a;
+ $del = $sum;
+ for ($i = 1; $i < 101; ++$i) {
+ ++$ap;
+ $del = $del * $x / $ap;
+ $sum += $del;
+ if ($del < $sum * self::EPS) {
+ break;
+ }
+ }
+
+ return $sum * exp(-$x + $a * log($x) - $gln);
+ }
+
+ // Return the incomplete gamma function Q(n/2,x) evaluated by
+ // its continued fraction representation. Algorithm from numerical recipe.
+ // Assume that n is a postive integer and x>0, won't check arguments.
+ // Relative error controlled by the eps parameter
+ private static function gcf(int $n, float $x): float
+ {
+ /** @var float $gln */
+ $gln = Gamma::ln($n / 2);
+ $a = 0.5 * $n;
+ $b = $x + 1 - $a;
+ $fpmin = 1.e-300;
+ $c = 1 / $fpmin;
+ $d = 1 / $b;
+ $h = $d;
+ for ($i = 1; $i < 101; ++$i) {
+ $an = -$i * ($i - $a);
+ $b += 2;
+ $d = $an * $d + $b;
+ if (abs($d) < $fpmin) {
+ $d = $fpmin;
+ }
+ $c = $b + $an / $c;
+ if (abs($c) < $fpmin) {
+ $c = $fpmin;
+ }
+ $d = 1 / $d;
+ $del = $d * $c;
+ $h = $h * $del;
+ if (abs($del - 1) < self::EPS) {
+ break;
+ }
+ }
+
+ return $h * exp(-$x + $a * log($x) - $gln);
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Distributions/DistributionValidations.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Distributions/DistributionValidations.php
new file mode 100644
index 0000000..61c62f6
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Distributions/DistributionValidations.php
@@ -0,0 +1,21 @@
+ 1.0) {
+ throw new Exception(ExcelError::NAN());
+ }
+
+ return $probability;
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Distributions/Exponential.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Distributions/Exponential.php
new file mode 100644
index 0000000..5526473
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Distributions/Exponential.php
@@ -0,0 +1,54 @@
+getMessage();
+ }
+
+ if (($value < 0) || ($lambda < 0)) {
+ return ExcelError::NAN();
+ }
+
+ if ($cumulative === true) {
+ return 1 - exp(0 - $value * $lambda);
+ }
+
+ return $lambda * exp(0 - $value * $lambda);
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Distributions/F.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Distributions/F.php
new file mode 100644
index 0000000..aa7a19d
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Distributions/F.php
@@ -0,0 +1,63 @@
+getMessage();
+ }
+
+ if ($value < 0 || $u < 1 || $v < 1) {
+ return ExcelError::NAN();
+ }
+
+ if ($cumulative) {
+ $adjustedValue = ($u * $value) / ($u * $value + $v);
+
+ return Beta::incompleteBeta($adjustedValue, $u / 2, $v / 2);
+ }
+
+ return (Gamma::gammaValue(($v + $u) / 2)
+ / (Gamma::gammaValue($u / 2) * Gamma::gammaValue($v / 2)))
+ * (($u / $v) ** ($u / 2))
+ * (($value ** (($u - 2) / 2)) / ((1 + ($u / $v) * $value) ** (($u + $v) / 2)));
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Distributions/Fisher.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Distributions/Fisher.php
new file mode 100644
index 0000000..9ad10db
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Distributions/Fisher.php
@@ -0,0 +1,72 @@
+getMessage();
+ }
+
+ if (($value <= -1) || ($value >= 1)) {
+ return ExcelError::NAN();
+ }
+
+ return 0.5 * log((1 + $value) / (1 - $value));
+ }
+
+ /**
+ * FISHERINV.
+ *
+ * Returns the inverse of the Fisher transformation. Use this transformation when
+ * analyzing correlations between ranges or arrays of data. If y = FISHER(x), then
+ * FISHERINV(y) = x.
+ *
+ * @param mixed $probability Float probability at which you want to evaluate the distribution
+ * Or can be an array of values
+ *
+ * @return array|float|string If an array of numbers is passed as an argument, then the returned result will also be an array
+ * with the same dimensions
+ */
+ public static function inverse(mixed $probability): array|string|float
+ {
+ if (is_array($probability)) {
+ return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $probability);
+ }
+
+ try {
+ DistributionValidations::validateFloat($probability);
+ } catch (Exception $e) {
+ return $e->getMessage();
+ }
+
+ return (exp(2 * $probability) - 1) / (exp(2 * $probability) + 1);
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Distributions/Gamma.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Distributions/Gamma.php
new file mode 100644
index 0000000..babe937
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Distributions/Gamma.php
@@ -0,0 +1,148 @@
+getMessage();
+ }
+
+ if ((((int) $value) == ((float) $value)) && $value <= 0.0) {
+ return ExcelError::NAN();
+ }
+
+ return self::gammaValue($value);
+ }
+
+ /**
+ * GAMMADIST.
+ *
+ * Returns the gamma distribution.
+ *
+ * @param mixed $value Float Value at which you want to evaluate the distribution
+ * Or can be an array of values
+ * @param mixed $a Parameter to the distribution as a float
+ * Or can be an array of values
+ * @param mixed $b Parameter to the distribution as a float
+ * Or can be an array of values
+ * @param mixed $cumulative Boolean value indicating if we want the cdf (true) or the pdf (false)
+ * Or can be an array of values
+ *
+ * @return array|float|string If an array of numbers is passed as an argument, then the returned result will also be an array
+ * with the same dimensions
+ */
+ public static function distribution(mixed $value, mixed $a, mixed $b, mixed $cumulative)
+ {
+ if (is_array($value) || is_array($a) || is_array($b) || is_array($cumulative)) {
+ return self::evaluateArrayArguments([self::class, __FUNCTION__], $value, $a, $b, $cumulative);
+ }
+
+ try {
+ $value = DistributionValidations::validateFloat($value);
+ $a = DistributionValidations::validateFloat($a);
+ $b = DistributionValidations::validateFloat($b);
+ $cumulative = DistributionValidations::validateBool($cumulative);
+ } catch (Exception $e) {
+ return $e->getMessage();
+ }
+
+ if (($value < 0) || ($a <= 0) || ($b <= 0)) {
+ return ExcelError::NAN();
+ }
+
+ return self::calculateDistribution($value, $a, $b, $cumulative);
+ }
+
+ /**
+ * GAMMAINV.
+ *
+ * Returns the inverse of the Gamma distribution.
+ *
+ * @param mixed $probability Float probability at which you want to evaluate the distribution
+ * Or can be an array of values
+ * @param mixed $alpha Parameter to the distribution as a float
+ * Or can be an array of values
+ * @param mixed $beta Parameter to the distribution as a float
+ * Or can be an array of values
+ *
+ * @return array|float|string If an array of numbers is passed as an argument, then the returned result will also be an array
+ * with the same dimensions
+ */
+ public static function inverse(mixed $probability, mixed $alpha, mixed $beta)
+ {
+ if (is_array($probability) || is_array($alpha) || is_array($beta)) {
+ return self::evaluateArrayArguments([self::class, __FUNCTION__], $probability, $alpha, $beta);
+ }
+
+ try {
+ $probability = DistributionValidations::validateProbability($probability);
+ $alpha = DistributionValidations::validateFloat($alpha);
+ $beta = DistributionValidations::validateFloat($beta);
+ } catch (Exception $e) {
+ return $e->getMessage();
+ }
+
+ if (($alpha <= 0.0) || ($beta <= 0.0)) {
+ return ExcelError::NAN();
+ }
+
+ return self::calculateInverse($probability, $alpha, $beta);
+ }
+
+ /**
+ * GAMMALN.
+ *
+ * Returns the natural logarithm of the gamma function.
+ *
+ * @param mixed $value Float Value at which you want to evaluate the distribution
+ * Or can be an array of values
+ *
+ * @return array|float|string If an array of numbers is passed as an argument, then the returned result will also be an array
+ * with the same dimensions
+ */
+ public static function ln(mixed $value): array|string|float
+ {
+ if (is_array($value)) {
+ return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $value);
+ }
+
+ try {
+ $value = DistributionValidations::validateFloat($value);
+ } catch (Exception $e) {
+ return $e->getMessage();
+ }
+
+ if ($value <= 0) {
+ return ExcelError::NAN();
+ }
+
+ return log(self::gammaValue($value));
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Distributions/GammaBase.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Distributions/GammaBase.php
new file mode 100644
index 0000000..6ce99d8
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Distributions/GammaBase.php
@@ -0,0 +1,388 @@
+ Functions::PRECISION) && (++$i <= self::MAX_ITERATIONS)) {
+ // Apply Newton-Raphson step
+ $result = self::calculateDistribution($x, $alpha, $beta, true);
+ if (!is_float($result)) {
+ return ExcelError::NA();
+ }
+ $error = $result - $probability;
+
+ if ($error == 0.0) {
+ $dx = 0;
+ } elseif ($error < 0.0) {
+ $xLo = $x;
+ } else {
+ $xHi = $x;
+ }
+
+ $pdf = self::calculateDistribution($x, $alpha, $beta, false);
+ // Avoid division by zero
+ if (!is_float($pdf)) {
+ return ExcelError::NA();
+ }
+ if ($pdf !== 0.0) {
+ $dx = $error / $pdf;
+ $xNew = $x - $dx;
+ }
+
+ // If the NR fails to converge (which for example may be the
+ // case if the initial guess is too rough) we apply a bisection
+ // step to determine a more narrow interval around the root.
+ if (($xNew < $xLo) || ($xNew > $xHi) || ($pdf == 0.0)) {
+ $xNew = ($xLo + $xHi) / 2;
+ $dx = $xNew - $x;
+ }
+ $x = $xNew;
+ }
+
+ if ($i === self::MAX_ITERATIONS) {
+ return ExcelError::NA();
+ }
+
+ return $x;
+ }
+
+ //
+ // Implementation of the incomplete Gamma function
+ //
+ public static function incompleteGamma(float $a, float $x): float
+ {
+ static $max = 32;
+ $summer = 0;
+ for ($n = 0; $n <= $max; ++$n) {
+ $divisor = $a;
+ for ($i = 1; $i <= $n; ++$i) {
+ $divisor *= ($a + $i);
+ }
+ $summer += ($x ** $n / $divisor);
+ }
+
+ return $x ** $a * exp(0 - $x) * $summer;
+ }
+
+ //
+ // Implementation of the Gamma function
+ //
+ public static function gammaValue(float $value): float
+ {
+ if ($value == 0.0) {
+ return 0;
+ }
+
+ static $p0 = 1.000000000190015;
+ static $p = [
+ 1 => 76.18009172947146,
+ 2 => -86.50532032941677,
+ 3 => 24.01409824083091,
+ 4 => -1.231739572450155,
+ 5 => 1.208650973866179e-3,
+ 6 => -5.395239384953e-6,
+ ];
+
+ $y = $x = $value;
+ $tmp = $x + 5.5;
+ $tmp -= ($x + 0.5) * log($tmp);
+
+ $summer = $p0;
+ for ($j = 1; $j <= 6; ++$j) {
+ $summer += ($p[$j] / ++$y);
+ }
+
+ return exp(0 - $tmp + log(self::SQRT2PI * $summer / $x));
+ }
+
+ private const LG_D1 = -0.5772156649015328605195174;
+
+ private const LG_D2 = 0.4227843350984671393993777;
+
+ private const LG_D4 = 1.791759469228055000094023;
+
+ private const LG_P1 = [
+ 4.945235359296727046734888,
+ 201.8112620856775083915565,
+ 2290.838373831346393026739,
+ 11319.67205903380828685045,
+ 28557.24635671635335736389,
+ 38484.96228443793359990269,
+ 26377.48787624195437963534,
+ 7225.813979700288197698961,
+ ];
+
+ private const LG_P2 = [
+ 4.974607845568932035012064,
+ 542.4138599891070494101986,
+ 15506.93864978364947665077,
+ 184793.2904445632425417223,
+ 1088204.76946882876749847,
+ 3338152.967987029735917223,
+ 5106661.678927352456275255,
+ 3074109.054850539556250927,
+ ];
+
+ private const LG_P4 = [
+ 14745.02166059939948905062,
+ 2426813.369486704502836312,
+ 121475557.4045093227939592,
+ 2663432449.630976949898078,
+ 29403789566.34553899906876,
+ 170266573776.5398868392998,
+ 492612579337.743088758812,
+ 560625185622.3951465078242,
+ ];
+
+ private const LG_Q1 = [
+ 67.48212550303777196073036,
+ 1113.332393857199323513008,
+ 7738.757056935398733233834,
+ 27639.87074403340708898585,
+ 54993.10206226157329794414,
+ 61611.22180066002127833352,
+ 36351.27591501940507276287,
+ 8785.536302431013170870835,
+ ];
+
+ private const LG_Q2 = [
+ 183.0328399370592604055942,
+ 7765.049321445005871323047,
+ 133190.3827966074194402448,
+ 1136705.821321969608938755,
+ 5267964.117437946917577538,
+ 13467014.54311101692290052,
+ 17827365.30353274213975932,
+ 9533095.591844353613395747,
+ ];
+
+ private const LG_Q4 = [
+ 2690.530175870899333379843,
+ 639388.5654300092398984238,
+ 41355999.30241388052042842,
+ 1120872109.61614794137657,
+ 14886137286.78813811542398,
+ 101680358627.2438228077304,
+ 341747634550.7377132798597,
+ 446315818741.9713286462081,
+ ];
+
+ private const LG_C = [
+ -0.001910444077728,
+ 8.4171387781295e-4,
+ -5.952379913043012e-4,
+ 7.93650793500350248e-4,
+ -0.002777777777777681622553,
+ 0.08333333333333333331554247,
+ 0.0057083835261,
+ ];
+
+ // Rough estimate of the fourth root of logGamma_xBig
+ private const LG_FRTBIG = 2.25e76;
+
+ private const PNT68 = 0.6796875;
+
+ // Function cache for logGamma
+
+ private static float $logGammaCacheResult = 0.0;
+
+ private static float $logGammaCacheX = 0.0;
+
+ /**
+ * logGamma function.
+ *
+ * Original author was Jaco van Kooten. Ported to PHP by Paul Meagher.
+ *
+ * The natural logarithm of the gamma function.
+ * Based on public domain NETLIB (Fortran) code by W. J. Cody and L. Stoltz
+ * Applied Mathematics Division
+ * Argonne National Laboratory
+ * Argonne, IL 60439
+ *
+ * References:
+ *
+ * W. J. Cody and K. E. Hillstrom, 'Chebyshev Approximations for the Natural
+ * Logarithm of the Gamma Function,' Math. Comp. 21, 1967, pp. 198-203.
+ * K. E. Hillstrom, ANL/AMD Program ANLC366S, DGAMMA/DLGAMA, May, 1969.
+ * Hart, Et. Al., Computer Approximations, Wiley and sons, New York, 1968.
+ *
+ *
+ *
+ * From the original documentation:
+ *
+ *
+ * This routine calculates the LOG(GAMMA) function for a positive real argument X.
+ * Computation is based on an algorithm outlined in references 1 and 2.
+ * The program uses rational functions that theoretically approximate LOG(GAMMA)
+ * to at least 18 significant decimal digits. The approximation for X > 12 is from
+ * reference 3, while approximations for X < 12.0 are similar to those in reference
+ * 1, but are unpublished. The accuracy achieved depends on the arithmetic system,
+ * the compiler, the intrinsic functions, and proper selection of the
+ * machine-dependent constants.
+ *
+ *
+ * Error returns:
+ * The program returns the value XINF for X .LE. 0.0 or when overflow would occur.
+ * The computation is believed to be free of underflow and overflow.
+ *
+ *
+ * @version 1.1
+ *
+ * @author Jaco van Kooten
+ *
+ * @return float MAX_VALUE for x < 0.0 or when overflow would occur, i.e. x > 2.55E305
+ */
+ public static function logGamma(float $x): float
+ {
+ if ($x == self::$logGammaCacheX) {
+ return self::$logGammaCacheResult;
+ }
+
+ $y = $x;
+ if ($y > 0.0 && $y <= self::LOG_GAMMA_X_MAX_VALUE) {
+ if ($y <= self::EPS) {
+ $res = -log($y);
+ } elseif ($y <= 1.5) {
+ $res = self::logGamma1($y);
+ } elseif ($y <= 4.0) {
+ $res = self::logGamma2($y);
+ } elseif ($y <= 12.0) {
+ $res = self::logGamma3($y);
+ } else {
+ $res = self::logGamma4($y);
+ }
+ } else {
+ // --------------------------
+ // Return for bad arguments
+ // --------------------------
+ $res = self::MAX_VALUE;
+ }
+
+ // ------------------------------
+ // Final adjustments and return
+ // ------------------------------
+ self::$logGammaCacheX = $x;
+ self::$logGammaCacheResult = $res;
+
+ return $res;
+ }
+
+ private static function logGamma1(float $y): float
+ {
+ // ---------------------
+ // EPS .LT. X .LE. 1.5
+ // ---------------------
+ if ($y < self::PNT68) {
+ $corr = -log($y);
+ $xm1 = $y;
+ } else {
+ $corr = 0.0;
+ $xm1 = $y - 1.0;
+ }
+
+ $xden = 1.0;
+ $xnum = 0.0;
+ if ($y <= 0.5 || $y >= self::PNT68) {
+ for ($i = 0; $i < 8; ++$i) {
+ $xnum = $xnum * $xm1 + self::LG_P1[$i];
+ $xden = $xden * $xm1 + self::LG_Q1[$i];
+ }
+
+ return $corr + $xm1 * (self::LG_D1 + $xm1 * ($xnum / $xden));
+ }
+
+ $xm2 = $y - 1.0;
+ for ($i = 0; $i < 8; ++$i) {
+ $xnum = $xnum * $xm2 + self::LG_P2[$i];
+ $xden = $xden * $xm2 + self::LG_Q2[$i];
+ }
+
+ return $corr + $xm2 * (self::LG_D2 + $xm2 * ($xnum / $xden));
+ }
+
+ private static function logGamma2(float $y): float
+ {
+ // ---------------------
+ // 1.5 .LT. X .LE. 4.0
+ // ---------------------
+ $xm2 = $y - 2.0;
+ $xden = 1.0;
+ $xnum = 0.0;
+ for ($i = 0; $i < 8; ++$i) {
+ $xnum = $xnum * $xm2 + self::LG_P2[$i];
+ $xden = $xden * $xm2 + self::LG_Q2[$i];
+ }
+
+ return $xm2 * (self::LG_D2 + $xm2 * ($xnum / $xden));
+ }
+
+ protected static function logGamma3(float $y): float
+ {
+ // ----------------------
+ // 4.0 .LT. X .LE. 12.0
+ // ----------------------
+ $xm4 = $y - 4.0;
+ $xden = -1.0;
+ $xnum = 0.0;
+ for ($i = 0; $i < 8; ++$i) {
+ $xnum = $xnum * $xm4 + self::LG_P4[$i];
+ $xden = $xden * $xm4 + self::LG_Q4[$i];
+ }
+
+ return self::LG_D4 + $xm4 * ($xnum / $xden);
+ }
+
+ protected static function logGamma4(float $y): float
+ {
+ // ---------------------------------
+ // Evaluate for argument .GE. 12.0
+ // ---------------------------------
+ $res = 0.0;
+ if ($y <= self::LG_FRTBIG) {
+ $res = self::LG_C[6];
+ $ysq = $y * $y;
+ for ($i = 0; $i < 6; ++$i) {
+ $res = $res / $ysq + self::LG_C[$i];
+ }
+ $res /= $y;
+ $corr = log($y);
+ $res = $res + log(self::SQRT2PI) - 0.5 * $corr;
+ $res += $y * ($corr - 1.0);
+ }
+
+ return $res;
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Distributions/HyperGeometric.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Distributions/HyperGeometric.php
new file mode 100644
index 0000000..345ea81
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Distributions/HyperGeometric.php
@@ -0,0 +1,75 @@
+getMessage();
+ }
+
+ if (($sampleSuccesses < 0) || ($sampleSuccesses > $sampleNumber) || ($sampleSuccesses > $populationSuccesses)) {
+ return ExcelError::NAN();
+ }
+ if (($sampleNumber <= 0) || ($sampleNumber > $populationNumber)) {
+ return ExcelError::NAN();
+ }
+ if (($populationSuccesses <= 0) || ($populationSuccesses > $populationNumber)) {
+ return ExcelError::NAN();
+ }
+
+ $successesPopulationAndSample = (float) Combinations::withoutRepetition($populationSuccesses, $sampleSuccesses);
+ $numbersPopulationAndSample = (float) Combinations::withoutRepetition($populationNumber, $sampleNumber);
+ $adjustedPopulationAndSample = (float) Combinations::withoutRepetition(
+ $populationNumber - $populationSuccesses,
+ $sampleNumber - $sampleSuccesses
+ );
+
+ return $successesPopulationAndSample * $adjustedPopulationAndSample / $numbersPopulationAndSample;
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Distributions/LogNormal.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Distributions/LogNormal.php
new file mode 100644
index 0000000..50f02e4
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Distributions/LogNormal.php
@@ -0,0 +1,139 @@
+getMessage();
+ }
+
+ if (($value <= 0) || ($stdDev <= 0)) {
+ return ExcelError::NAN();
+ }
+
+ return StandardNormal::cumulative((log($value) - $mean) / $stdDev);
+ }
+
+ /**
+ * LOGNORM.DIST.
+ *
+ * Returns the lognormal distribution of x, where ln(x) is normally distributed
+ * with parameters mean and standard_dev.
+ *
+ * @param mixed $value Float value for which we want the probability
+ * Or can be an array of values
+ * @param mixed $mean Mean value as a float
+ * Or can be an array of values
+ * @param mixed $stdDev Standard Deviation as a float
+ * Or can be an array of values
+ * @param mixed $cumulative Boolean value indicating if we want the cdf (true) or the pdf (false)
+ * Or can be an array of values
+ *
+ * @return array|float|string The result, or a string containing an error
+ * If an array of numbers is passed as an argument, then the returned result will also be an array
+ * with the same dimensions
+ */
+ public static function distribution(mixed $value, mixed $mean, mixed $stdDev, mixed $cumulative = false)
+ {
+ if (is_array($value) || is_array($mean) || is_array($stdDev) || is_array($cumulative)) {
+ return self::evaluateArrayArguments([self::class, __FUNCTION__], $value, $mean, $stdDev, $cumulative);
+ }
+
+ try {
+ $value = DistributionValidations::validateFloat($value);
+ $mean = DistributionValidations::validateFloat($mean);
+ $stdDev = DistributionValidations::validateFloat($stdDev);
+ $cumulative = DistributionValidations::validateBool($cumulative);
+ } catch (Exception $e) {
+ return $e->getMessage();
+ }
+
+ if (($value <= 0) || ($stdDev <= 0)) {
+ return ExcelError::NAN();
+ }
+
+ if ($cumulative === true) {
+ return StandardNormal::distribution((log($value) - $mean) / $stdDev, true);
+ }
+
+ return (1 / (sqrt(2 * M_PI) * $stdDev * $value))
+ * exp(0 - ((log($value) - $mean) ** 2 / (2 * $stdDev ** 2)));
+ }
+
+ /**
+ * LOGINV.
+ *
+ * Returns the inverse of the lognormal cumulative distribution
+ *
+ * @param mixed $probability Float probability for which we want the value
+ * Or can be an array of values
+ * @param mixed $mean Mean Value as a float
+ * Or can be an array of values
+ * @param mixed $stdDev Standard Deviation as a float
+ * Or can be an array of values
+ *
+ * @return array|float|string The result, or a string containing an error
+ * If an array of numbers is passed as an argument, then the returned result will also be an array
+ * with the same dimensions
+ *
+ * @TODO Try implementing P J Acklam's refinement algorithm for greater
+ * accuracy if I can get my head round the mathematics
+ * (as described at) http://home.online.no/~pjacklam/notes/invnorm/
+ */
+ public static function inverse(mixed $probability, mixed $mean, mixed $stdDev): array|string|float
+ {
+ if (is_array($probability) || is_array($mean) || is_array($stdDev)) {
+ return self::evaluateArrayArguments([self::class, __FUNCTION__], $probability, $mean, $stdDev);
+ }
+
+ try {
+ $probability = DistributionValidations::validateProbability($probability);
+ $mean = DistributionValidations::validateFloat($mean);
+ $stdDev = DistributionValidations::validateFloat($stdDev);
+ } catch (Exception $e) {
+ return $e->getMessage();
+ }
+
+ if ($stdDev <= 0) {
+ return ExcelError::NAN();
+ }
+ /** @var float $inverse */
+ $inverse = StandardNormal::inverse($probability);
+
+ return exp($mean + $stdDev * $inverse);
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Distributions/NewtonRaphson.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Distributions/NewtonRaphson.php
new file mode 100644
index 0000000..647c0c4
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Distributions/NewtonRaphson.php
@@ -0,0 +1,64 @@
+callback = $callback;
+ }
+
+ public function execute(float $probability): string|int|float
+ {
+ $xLo = 100;
+ $xHi = 0;
+
+ $dx = 1;
+ $x = $xNew = 1;
+ $i = 0;
+
+ while ((abs($dx) > Functions::PRECISION) && ($i++ < self::MAX_ITERATIONS)) {
+ // Apply Newton-Raphson step
+ $result = call_user_func($this->callback, $x);
+ $error = $result - $probability;
+
+ if ($error == 0.0) {
+ $dx = 0;
+ } elseif ($error < 0.0) {
+ $xLo = $x;
+ } else {
+ $xHi = $x;
+ }
+
+ // Avoid division by zero
+ if ($result != 0.0) {
+ $dx = $error / $result;
+ $xNew = $x - $dx;
+ }
+
+ // If the NR fails to converge (which for example may be the
+ // case if the initial guess is too rough) we apply a bisection
+ // step to determine a more narrow interval around the root.
+ if (($xNew < $xLo) || ($xNew > $xHi) || ($result == 0.0)) {
+ $xNew = ($xLo + $xHi) / 2;
+ $dx = $xNew - $x;
+ }
+ $x = $xNew;
+ }
+
+ if ($i == self::MAX_ITERATIONS) {
+ return ExcelError::NA();
+ }
+
+ return $x;
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Distributions/Normal.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Distributions/Normal.php
new file mode 100644
index 0000000..8d08d57
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Distributions/Normal.php
@@ -0,0 +1,180 @@
+getMessage();
+ }
+
+ if ($stdDev < 0) {
+ return ExcelError::NAN();
+ }
+
+ if ($cumulative) {
+ return 0.5 * (1 + Engineering\Erf::erfValue(($value - $mean) / ($stdDev * sqrt(2))));
+ }
+
+ return (1 / (self::SQRT2PI * $stdDev)) * exp(0 - (($value - $mean) ** 2 / (2 * ($stdDev * $stdDev))));
+ }
+
+ /**
+ * NORMINV.
+ *
+ * Returns the inverse of the normal cumulative distribution for the specified mean and standard deviation.
+ *
+ * @param mixed $probability Float probability for which we want the value
+ * Or can be an array of values
+ * @param mixed $mean Mean Value as a float
+ * Or can be an array of values
+ * @param mixed $stdDev Standard Deviation as a float
+ * Or can be an array of values
+ *
+ * @return array|float|string The result, or a string containing an error
+ * If an array of numbers is passed as an argument, then the returned result will also be an array
+ * with the same dimensions
+ */
+ public static function inverse(mixed $probability, mixed $mean, mixed $stdDev): array|string|float
+ {
+ if (is_array($probability) || is_array($mean) || is_array($stdDev)) {
+ return self::evaluateArrayArguments([self::class, __FUNCTION__], $probability, $mean, $stdDev);
+ }
+
+ try {
+ $probability = DistributionValidations::validateProbability($probability);
+ $mean = DistributionValidations::validateFloat($mean);
+ $stdDev = DistributionValidations::validateFloat($stdDev);
+ } catch (Exception $e) {
+ return $e->getMessage();
+ }
+
+ if ($stdDev < 0) {
+ return ExcelError::NAN();
+ }
+
+ return (self::inverseNcdf($probability) * $stdDev) + $mean;
+ }
+
+ /*
+ * inverse_ncdf.php
+ * -------------------
+ * begin : Friday, January 16, 2004
+ * copyright : (C) 2004 Michael Nickerson
+ * email : nickersonm@yahoo.com
+ *
+ */
+ private static function inverseNcdf(float $p): float
+ {
+ // Inverse ncdf approximation by Peter J. Acklam, implementation adapted to
+ // PHP by Michael Nickerson, using Dr. Thomas Ziegler's C implementation as
+ // a guide. http://home.online.no/~pjacklam/notes/invnorm/index.html
+ // I have not checked the accuracy of this implementation. Be aware that PHP
+ // will truncate the coeficcients to 14 digits.
+
+ // You have permission to use and distribute this function freely for
+ // whatever purpose you want, but please show common courtesy and give credit
+ // where credit is due.
+
+ // Input paramater is $p - probability - where 0 < p < 1.
+
+ // Coefficients in rational approximations
+ static $a = [
+ 1 => -3.969683028665376e+01,
+ 2 => 2.209460984245205e+02,
+ 3 => -2.759285104469687e+02,
+ 4 => 1.383577518672690e+02,
+ 5 => -3.066479806614716e+01,
+ 6 => 2.506628277459239e+00,
+ ];
+
+ static $b = [
+ 1 => -5.447609879822406e+01,
+ 2 => 1.615858368580409e+02,
+ 3 => -1.556989798598866e+02,
+ 4 => 6.680131188771972e+01,
+ 5 => -1.328068155288572e+01,
+ ];
+
+ static $c = [
+ 1 => -7.784894002430293e-03,
+ 2 => -3.223964580411365e-01,
+ 3 => -2.400758277161838e+00,
+ 4 => -2.549732539343734e+00,
+ 5 => 4.374664141464968e+00,
+ 6 => 2.938163982698783e+00,
+ ];
+
+ static $d = [
+ 1 => 7.784695709041462e-03,
+ 2 => 3.224671290700398e-01,
+ 3 => 2.445134137142996e+00,
+ 4 => 3.754408661907416e+00,
+ ];
+
+ // Define lower and upper region break-points.
+ $p_low = 0.02425; //Use lower region approx. below this
+ $p_high = 1 - $p_low; //Use upper region approx. above this
+
+ if (0 < $p && $p < $p_low) {
+ // Rational approximation for lower region.
+ $q = sqrt(-2 * log($p));
+
+ return ((((($c[1] * $q + $c[2]) * $q + $c[3]) * $q + $c[4]) * $q + $c[5]) * $q + $c[6])
+ / (((($d[1] * $q + $d[2]) * $q + $d[3]) * $q + $d[4]) * $q + 1);
+ } elseif ($p_high < $p && $p < 1) {
+ // Rational approximation for upper region.
+ $q = sqrt(-2 * log(1 - $p));
+
+ return -((((($c[1] * $q + $c[2]) * $q + $c[3]) * $q + $c[4]) * $q + $c[5]) * $q + $c[6])
+ / (((($d[1] * $q + $d[2]) * $q + $d[3]) * $q + $d[4]) * $q + 1);
+ }
+
+ // Rational approximation for central region.
+ $q = $p - 0.5;
+ $r = $q * $q;
+
+ return ((((($a[1] * $r + $a[2]) * $r + $a[3]) * $r + $a[4]) * $r + $a[5]) * $r + $a[6]) * $q
+ / ((((($b[1] * $r + $b[2]) * $r + $b[3]) * $r + $b[4]) * $r + $b[5]) * $r + 1);
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Distributions/Poisson.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Distributions/Poisson.php
new file mode 100644
index 0000000..931568e
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Distributions/Poisson.php
@@ -0,0 +1,66 @@
+getMessage();
+ }
+
+ if (($value < 0) || ($mean < 0)) {
+ return ExcelError::NAN();
+ }
+
+ if ($cumulative) {
+ $summer = 0;
+ $floor = floor($value);
+ for ($i = 0; $i <= $floor; ++$i) {
+ /** @var float $fact */
+ $fact = MathTrig\Factorial::fact($i);
+ $summer += $mean ** $i / $fact;
+ }
+
+ return exp(0 - $mean) * $summer;
+ }
+ /** @var float $fact */
+ $fact = MathTrig\Factorial::fact($value);
+
+ return (exp(0 - $mean) * $mean ** $value) / $fact;
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Distributions/StandardNormal.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Distributions/StandardNormal.php
new file mode 100644
index 0000000..cb2c646
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Distributions/StandardNormal.php
@@ -0,0 +1,158 @@
+getMessage();
+ }
+
+ if (($value < 0) || ($degrees < 1) || ($tails < 1) || ($tails > 2)) {
+ return ExcelError::NAN();
+ }
+
+ return self::calculateDistribution($value, $degrees, $tails);
+ }
+
+ /**
+ * TINV.
+ *
+ * Returns the one-tailed probability of the chi-squared distribution.
+ *
+ * @param mixed $probability Float probability for the function
+ * Or can be an array of values
+ * @param mixed $degrees Integer value for degrees of freedom
+ * Or can be an array of values
+ *
+ * @return array|float|string The result, or a string containing an error
+ * If an array of numbers is passed as an argument, then the returned result will also be an array
+ * with the same dimensions
+ */
+ public static function inverse(mixed $probability, mixed $degrees)
+ {
+ if (is_array($probability) || is_array($degrees)) {
+ return self::evaluateArrayArguments([self::class, __FUNCTION__], $probability, $degrees);
+ }
+
+ try {
+ $probability = DistributionValidations::validateProbability($probability);
+ $degrees = DistributionValidations::validateInt($degrees);
+ } catch (Exception $e) {
+ return $e->getMessage();
+ }
+
+ if ($degrees <= 0) {
+ return ExcelError::NAN();
+ }
+
+ $callback = fn ($value) => self::distribution($value, $degrees, 2);
+
+ $newtonRaphson = new NewtonRaphson($callback);
+
+ return $newtonRaphson->execute($probability);
+ }
+
+ private static function calculateDistribution(float $value, int $degrees, int $tails): float
+ {
+ // tdist, which finds the probability that corresponds to a given value
+ // of t with k degrees of freedom. This algorithm is translated from a
+ // pascal function on p81 of "Statistical Computing in Pascal" by D
+ // Cooke, A H Craven & G M Clark (1985: Edward Arnold (Pubs.) Ltd:
+ // London). The above Pascal algorithm is itself a translation of the
+ // fortran algoritm "AS 3" by B E Cooper of the Atlas Computer
+ // Laboratory as reported in (among other places) "Applied Statistics
+ // Algorithms", editied by P Griffiths and I D Hill (1985; Ellis
+ // Horwood Ltd.; W. Sussex, England).
+ $tterm = $degrees;
+ $ttheta = atan2($value, sqrt($tterm));
+ $tc = cos($ttheta);
+ $ts = sin($ttheta);
+
+ if (($degrees % 2) === 1) {
+ $ti = 3;
+ $tterm = $tc;
+ } else {
+ $ti = 2;
+ $tterm = 1;
+ }
+
+ $tsum = $tterm;
+ while ($ti < $degrees) {
+ $tterm *= $tc * $tc * ($ti - 1) / $ti;
+ $tsum += $tterm;
+ $ti += 2;
+ }
+
+ $tsum *= $ts;
+ if (($degrees % 2) == 1) {
+ $tsum = Functions::M_2DIVPI * ($tsum + $ttheta);
+ }
+
+ $tValue = 0.5 * (1 + $tsum);
+ if ($tails == 1) {
+ return 1 - abs($tValue);
+ }
+
+ return 1 - abs((1 - $tValue) - $tValue);
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Distributions/Weibull.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Distributions/Weibull.php
new file mode 100644
index 0000000..2f20b62
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Distributions/Weibull.php
@@ -0,0 +1,57 @@
+getMessage();
+ }
+
+ if (($value < 0) || ($alpha <= 0) || ($beta <= 0)) {
+ return ExcelError::NAN();
+ }
+
+ if ($cumulative) {
+ return 1 - exp(0 - ($value / $beta) ** $alpha);
+ }
+
+ return ($alpha / $beta ** $alpha) * $value ** ($alpha - 1) * exp(0 - ($value / $beta) ** $alpha);
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/MaxMinBase.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/MaxMinBase.php
new file mode 100644
index 0000000..a722fbd
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/MaxMinBase.php
@@ -0,0 +1,17 @@
+ $returnValue)) {
+ $returnValue = $arg;
+ }
+ }
+ }
+
+ if ($returnValue === null) {
+ return 0;
+ }
+
+ return $returnValue;
+ }
+
+ /**
+ * MAXA.
+ *
+ * Returns the greatest value in a list of arguments, including numbers, text, and logical values
+ *
+ * Excel Function:
+ * MAXA(value1[,value2[, ...]])
+ *
+ * @param mixed ...$args Data values
+ */
+ public static function maxA(mixed ...$args): float|int|string
+ {
+ $returnValue = null;
+
+ // Loop through arguments
+ $aArgs = Functions::flattenArray($args);
+ foreach ($aArgs as $arg) {
+ if (ErrorValue::isError($arg)) {
+ $returnValue = $arg;
+
+ break;
+ }
+ // Is it a numeric value?
+ if ((is_numeric($arg)) || (is_bool($arg)) || ((is_string($arg) && ($arg != '')))) {
+ $arg = self::datatypeAdjustmentAllowStrings($arg);
+ if (($returnValue === null) || ($arg > $returnValue)) {
+ $returnValue = $arg;
+ }
+ }
+ }
+
+ if ($returnValue === null) {
+ return 0;
+ }
+
+ return $returnValue;
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Minimum.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Minimum.php
new file mode 100644
index 0000000..fcb77c6
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Minimum.php
@@ -0,0 +1,85 @@
+getMessage();
+ }
+
+ if (($entry < 0) || ($entry > 1)) {
+ return ExcelError::NAN();
+ }
+
+ $mArgs = self::percentileFilterValues($aArgs);
+ $mValueCount = count($mArgs);
+ if ($mValueCount > 0) {
+ sort($mArgs);
+ $count = Counts::COUNT($mArgs);
+ $index = $entry * ($count - 1);
+ $iBase = floor($index);
+ if ($index == $iBase) {
+ return $mArgs[$index];
+ }
+ $iNext = $iBase + 1;
+ $iProportion = $index - $iBase;
+
+ return $mArgs[$iBase] + (($mArgs[$iNext] - $mArgs[$iBase]) * $iProportion);
+ }
+
+ return ExcelError::NAN();
+ }
+
+ /**
+ * PERCENTRANK.
+ *
+ * Returns the rank of a value in a data set as a percentage of the data set.
+ * Note that the returned rank is simply rounded to the appropriate significant digits,
+ * rather than floored (as MS Excel), so value 3 for a value set of 1, 2, 3, 4 will return
+ * 0.667 rather than 0.666
+ *
+ * @param mixed $valueSet An array of (float) values, or a reference to, a list of numbers
+ * @param mixed $value The number whose rank you want to find
+ * @param mixed $significance The (integer) number of significant digits for the returned percentage value
+ *
+ * @return float|string (string if result is an error)
+ */
+ public static function PERCENTRANK(mixed $valueSet, mixed $value, mixed $significance = 3): string|float
+ {
+ $valueSet = Functions::flattenArray($valueSet);
+ $value = Functions::flattenSingleValue($value);
+ $significance = ($significance === null) ? 3 : Functions::flattenSingleValue($significance);
+
+ try {
+ $value = StatisticalValidations::validateFloat($value);
+ $significance = StatisticalValidations::validateInt($significance);
+ } catch (Exception $e) {
+ return $e->getMessage();
+ }
+
+ $valueSet = self::rankFilterValues($valueSet);
+ $valueCount = count($valueSet);
+ if ($valueCount == 0) {
+ return ExcelError::NA();
+ }
+ sort($valueSet, SORT_NUMERIC);
+
+ $valueAdjustor = $valueCount - 1;
+ if (($value < $valueSet[0]) || ($value > $valueSet[$valueAdjustor])) {
+ return ExcelError::NA();
+ }
+
+ $pos = array_search($value, $valueSet);
+ if ($pos === false) {
+ $pos = 0;
+ $testValue = $valueSet[0];
+ while ($testValue < $value) {
+ $testValue = $valueSet[++$pos];
+ }
+ --$pos;
+ $pos += (($value - $valueSet[$pos]) / ($testValue - $valueSet[$pos]));
+ }
+
+ return round(((float) $pos) / $valueAdjustor, $significance);
+ }
+
+ /**
+ * QUARTILE.
+ *
+ * Returns the quartile of a data set.
+ *
+ * Excel Function:
+ * QUARTILE(value1[,value2[, ...]],entry)
+ *
+ * @param mixed $args Data values
+ *
+ * @return float|string The result, or a string containing an error
+ */
+ public static function QUARTILE(mixed ...$args)
+ {
+ $aArgs = Functions::flattenArray($args);
+ $entry = array_pop($aArgs);
+
+ try {
+ $entry = StatisticalValidations::validateFloat($entry);
+ } catch (Exception $e) {
+ return $e->getMessage();
+ }
+
+ $entry = floor($entry);
+ $entry /= 4;
+ if (($entry < 0) || ($entry > 1)) {
+ return ExcelError::NAN();
+ }
+
+ return self::PERCENTILE($aArgs, $entry);
+ }
+
+ /**
+ * RANK.
+ *
+ * Returns the rank of a number in a list of numbers.
+ *
+ * @param mixed $value The number whose rank you want to find
+ * @param mixed $valueSet An array of float values, or a reference to, a list of numbers
+ * @param mixed $order Order to sort the values in the value set
+ *
+ * @return float|string The result, or a string containing an error (0 = Descending, 1 = Ascending)
+ */
+ public static function RANK(mixed $value, mixed $valueSet, mixed $order = self::RANK_SORT_DESCENDING)
+ {
+ $value = Functions::flattenSingleValue($value);
+ $valueSet = Functions::flattenArray($valueSet);
+ $order = ($order === null) ? self::RANK_SORT_DESCENDING : Functions::flattenSingleValue($order);
+
+ try {
+ $value = StatisticalValidations::validateFloat($value);
+ $order = StatisticalValidations::validateInt($order);
+ } catch (Exception $e) {
+ return $e->getMessage();
+ }
+
+ $valueSet = self::rankFilterValues($valueSet);
+ if ($order === self::RANK_SORT_DESCENDING) {
+ rsort($valueSet, SORT_NUMERIC);
+ } else {
+ sort($valueSet, SORT_NUMERIC);
+ }
+
+ $pos = array_search($value, $valueSet);
+ if ($pos === false) {
+ return ExcelError::NA();
+ }
+
+ return ++$pos;
+ }
+
+ protected static function percentileFilterValues(array $dataSet): array
+ {
+ return array_filter(
+ $dataSet,
+ fn ($value): bool => is_numeric($value) && !is_string($value)
+ );
+ }
+
+ protected static function rankFilterValues(array $dataSet): array
+ {
+ return array_filter(
+ $dataSet,
+ fn ($value): bool => is_numeric($value)
+ );
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Permutations.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Permutations.php
new file mode 100644
index 0000000..06e3b79
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Permutations.php
@@ -0,0 +1,100 @@
+getMessage();
+ }
+
+ if ($numObjs < $numInSet) {
+ return ExcelError::NAN();
+ }
+ /** @var float|int|string */
+ $result1 = MathTrig\Factorial::fact($numObjs);
+ if (is_string($result1)) {
+ return $result1;
+ }
+ /** @var float|int|string */
+ $result2 = MathTrig\Factorial::fact($numObjs - $numInSet);
+ if (is_string($result2)) {
+ return $result2;
+ }
+ $result = round($result1 / $result2);
+
+ return IntOrFloat::evaluate($result);
+ }
+
+ /**
+ * PERMUTATIONA.
+ *
+ * Returns the number of permutations for a given number of objects (with repetitions)
+ * that can be selected from the total objects.
+ *
+ * @param mixed $numObjs Integer number of different objects
+ * Or can be an array of values
+ * @param mixed $numInSet Integer number of objects in each permutation
+ * Or can be an array of values
+ *
+ * @return array|float|int|string Number of permutations, or a string containing an error
+ * If an array of numbers is passed as an argument, then the returned result will also be an array
+ * with the same dimensions
+ */
+ public static function PERMUTATIONA(mixed $numObjs, mixed $numInSet)
+ {
+ if (is_array($numObjs) || is_array($numInSet)) {
+ return self::evaluateArrayArguments([self::class, __FUNCTION__], $numObjs, $numInSet);
+ }
+
+ try {
+ $numObjs = StatisticalValidations::validateInt($numObjs);
+ $numInSet = StatisticalValidations::validateInt($numInSet);
+ } catch (Exception $e) {
+ return $e->getMessage();
+ }
+
+ if ($numObjs < 0 || $numInSet < 0) {
+ return ExcelError::NAN();
+ }
+
+ $result = $numObjs ** $numInSet;
+
+ return IntOrFloat::evaluate($result);
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Size.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Size.php
new file mode 100644
index 0000000..71594bd
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/Size.php
@@ -0,0 +1,97 @@
+= $count) {
+ return ExcelError::NAN();
+ }
+ rsort($mArgs);
+
+ return $mArgs[$entry];
+ }
+
+ return ExcelError::VALUE();
+ }
+
+ /**
+ * SMALL.
+ *
+ * Returns the nth smallest value in a data set. You can use this function to
+ * select a value based on its relative standing.
+ *
+ * Excel Function:
+ * SMALL(value1[,value2[, ...]],entry)
+ *
+ * @param mixed $args Data values
+ *
+ * @return float|string The result, or a string containing an error
+ */
+ public static function small(mixed ...$args)
+ {
+ $aArgs = Functions::flattenArray($args);
+
+ $entry = array_pop($aArgs);
+
+ if ((is_numeric($entry)) && (!is_string($entry))) {
+ $entry = (int) floor($entry);
+
+ $mArgs = self::filter($aArgs);
+ $count = Counts::COUNT($mArgs);
+ --$entry;
+ if ($count === 0 || $entry < 0 || $entry >= $count) {
+ return ExcelError::NAN();
+ }
+ sort($mArgs);
+
+ return $mArgs[$entry];
+ }
+
+ return ExcelError::VALUE();
+ }
+
+ /**
+ * @param mixed[] $args Data values
+ */
+ protected static function filter(array $args): array
+ {
+ $mArgs = [];
+
+ foreach ($args as $arg) {
+ // Is it a numeric value?
+ if ((is_numeric($arg)) && (!is_string($arg))) {
+ $mArgs[] = $arg;
+ }
+ }
+
+ return $mArgs;
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/StandardDeviations.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/StandardDeviations.php
new file mode 100644
index 0000000..3d4ea30
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/StandardDeviations.php
@@ -0,0 +1,89 @@
+getMessage();
+ }
+
+ if ($stdDev <= 0) {
+ return ExcelError::NAN();
+ }
+
+ return ($value - $mean) / $stdDev;
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/StatisticalValidations.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/StatisticalValidations.php
new file mode 100644
index 0000000..59ad7ee
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/StatisticalValidations.php
@@ -0,0 +1,36 @@
+ $value) {
+ if ((is_bool($value)) || (is_string($value)) || ($value === null)) {
+ unset($array1[$key], $array2[$key]);
+ }
+ }
+ }
+
+ /**
+ * @param mixed $array1 should be array, but scalar is made into one
+ * @param mixed $array2 should be array, but scalar is made into one
+ */
+ private static function checkTrendArrays(mixed &$array1, mixed &$array2): void
+ {
+ if (!is_array($array1)) {
+ $array1 = [$array1];
+ }
+ if (!is_array($array2)) {
+ $array2 = [$array2];
+ }
+
+ $array1 = Functions::flattenArray($array1);
+ $array2 = Functions::flattenArray($array2);
+
+ self::filterTrendValues($array1, $array2);
+ self::filterTrendValues($array2, $array1);
+
+ // Reset the array indexes
+ $array1 = array_merge($array1);
+ $array2 = array_merge($array2);
+ }
+
+ protected static function validateTrendArrays(array $yValues, array $xValues): void
+ {
+ $yValueCount = count($yValues);
+ $xValueCount = count($xValues);
+
+ if (($yValueCount === 0) || ($yValueCount !== $xValueCount)) {
+ throw new Exception(ExcelError::NA());
+ } elseif ($yValueCount === 1) {
+ throw new Exception(ExcelError::DIV0());
+ }
+ }
+
+ /**
+ * CORREL.
+ *
+ * Returns covariance, the average of the products of deviations for each data point pair.
+ *
+ * @param mixed $yValues array of mixed Data Series Y
+ * @param null|mixed $xValues array of mixed Data Series X
+ */
+ public static function CORREL(mixed $yValues, $xValues = null): float|string
+ {
+ if (($xValues === null) || (!is_array($yValues)) || (!is_array($xValues))) {
+ return ExcelError::VALUE();
+ }
+
+ try {
+ self::checkTrendArrays($yValues, $xValues);
+ self::validateTrendArrays($yValues, $xValues);
+ } catch (Exception $e) {
+ return $e->getMessage();
+ }
+
+ $bestFitLinear = Trend::calculate(Trend::TREND_LINEAR, $yValues, $xValues);
+
+ return $bestFitLinear->getCorrelation();
+ }
+
+ /**
+ * COVAR.
+ *
+ * Returns covariance, the average of the products of deviations for each data point pair.
+ *
+ * @param mixed[] $yValues array of mixed Data Series Y
+ * @param mixed[] $xValues array of mixed Data Series X
+ */
+ public static function COVAR(array $yValues, array $xValues): float|string
+ {
+ try {
+ self::checkTrendArrays($yValues, $xValues);
+ self::validateTrendArrays($yValues, $xValues);
+ } catch (Exception $e) {
+ return $e->getMessage();
+ }
+
+ $bestFitLinear = Trend::calculate(Trend::TREND_LINEAR, $yValues, $xValues);
+
+ return $bestFitLinear->getCovariance();
+ }
+
+ /**
+ * FORECAST.
+ *
+ * Calculates, or predicts, a future value by using existing values.
+ * The predicted value is a y-value for a given x-value.
+ *
+ * @param mixed $xValue Float value of X for which we want to find Y
+ * Or can be an array of values
+ * @param mixed[] $yValues array of mixed Data Series Y
+ * @param mixed[] $xValues array of mixed Data Series X
+ *
+ * @return array|bool|float|string If an array of numbers is passed as an argument, then the returned result will also be an array
+ * with the same dimensions
+ */
+ public static function FORECAST(mixed $xValue, array $yValues, array $xValues)
+ {
+ if (is_array($xValue)) {
+ return self::evaluateArrayArgumentsSubset([self::class, __FUNCTION__], 1, $xValue, $yValues, $xValues);
+ }
+
+ try {
+ $xValue = StatisticalValidations::validateFloat($xValue);
+ self::checkTrendArrays($yValues, $xValues);
+ self::validateTrendArrays($yValues, $xValues);
+ } catch (Exception $e) {
+ return $e->getMessage();
+ }
+
+ $bestFitLinear = Trend::calculate(Trend::TREND_LINEAR, $yValues, $xValues);
+
+ return $bestFitLinear->getValueOfYForX($xValue);
+ }
+
+ /**
+ * GROWTH.
+ *
+ * Returns values along a predicted exponential Trend
+ *
+ * @param mixed[] $yValues Data Series Y
+ * @param mixed[] $xValues Data Series X
+ * @param mixed[] $newValues Values of X for which we want to find Y
+ * @param mixed $const A logical (boolean) value specifying whether to force the intersect to equal 0 or not
+ *
+ * @return array>>
+ */
+ public static function GROWTH(array $yValues, array $xValues = [], array $newValues = [], mixed $const = true): array
+ {
+ $yValues = Functions::flattenArray($yValues);
+ $xValues = Functions::flattenArray($xValues);
+ $newValues = Functions::flattenArray($newValues);
+ $const = ($const === null) ? true : (bool) Functions::flattenSingleValue($const);
+
+ $bestFitExponential = Trend::calculate(Trend::TREND_EXPONENTIAL, $yValues, $xValues, $const);
+ if (empty($newValues)) {
+ $newValues = $bestFitExponential->getXValues();
+ }
+
+ $returnArray = [];
+ foreach ($newValues as $xValue) {
+ $returnArray[0][] = [$bestFitExponential->getValueOfYForX($xValue)];
+ }
+
+ return $returnArray;
+ }
+
+ /**
+ * INTERCEPT.
+ *
+ * Calculates the point at which a line will intersect the y-axis by using existing x-values and y-values.
+ *
+ * @param mixed[] $yValues Data Series Y
+ * @param mixed[] $xValues Data Series X
+ */
+ public static function INTERCEPT(array $yValues, array $xValues): float|string
+ {
+ try {
+ self::checkTrendArrays($yValues, $xValues);
+ self::validateTrendArrays($yValues, $xValues);
+ } catch (Exception $e) {
+ return $e->getMessage();
+ }
+
+ $bestFitLinear = Trend::calculate(Trend::TREND_LINEAR, $yValues, $xValues);
+
+ return $bestFitLinear->getIntersect();
+ }
+
+ /**
+ * LINEST.
+ *
+ * Calculates the statistics for a line by using the "least squares" method to calculate a straight line
+ * that best fits your data, and then returns an array that describes the line.
+ *
+ * @param mixed[] $yValues Data Series Y
+ * @param null|mixed[] $xValues Data Series X
+ * @param mixed $const A logical (boolean) value specifying whether to force the intersect to equal 0 or not
+ * @param mixed $stats A logical (boolean) value specifying whether to return additional regression statistics
+ *
+ * @return array|string The result, or a string containing an error
+ */
+ public static function LINEST(array $yValues, ?array $xValues = null, mixed $const = true, mixed $stats = false): string|array
+ {
+ $const = ($const === null) ? true : (bool) Functions::flattenSingleValue($const);
+ $stats = ($stats === null) ? false : (bool) Functions::flattenSingleValue($stats);
+ if ($xValues === null) {
+ $xValues = $yValues;
+ }
+
+ try {
+ self::checkTrendArrays($yValues, $xValues);
+ self::validateTrendArrays($yValues, $xValues);
+ } catch (Exception $e) {
+ return $e->getMessage();
+ }
+
+ $bestFitLinear = Trend::calculate(Trend::TREND_LINEAR, $yValues, $xValues, $const);
+
+ if ($stats === true) {
+ return [
+ [
+ $bestFitLinear->getSlope(),
+ $bestFitLinear->getIntersect(),
+ ],
+ [
+ $bestFitLinear->getSlopeSE(),
+ ($const === false) ? ExcelError::NA() : $bestFitLinear->getIntersectSE(),
+ ],
+ [
+ $bestFitLinear->getGoodnessOfFit(),
+ $bestFitLinear->getStdevOfResiduals(),
+ ],
+ [
+ $bestFitLinear->getF(),
+ $bestFitLinear->getDFResiduals(),
+ ],
+ [
+ $bestFitLinear->getSSRegression(),
+ $bestFitLinear->getSSResiduals(),
+ ],
+ ];
+ }
+
+ return [
+ $bestFitLinear->getSlope(),
+ $bestFitLinear->getIntersect(),
+ ];
+ }
+
+ /**
+ * LOGEST.
+ *
+ * Calculates an exponential curve that best fits the X and Y data series,
+ * and then returns an array that describes the line.
+ *
+ * @param mixed[] $yValues Data Series Y
+ * @param null|mixed[] $xValues Data Series X
+ * @param mixed $const A logical (boolean) value specifying whether to force the intersect to equal 0 or not
+ * @param mixed $stats A logical (boolean) value specifying whether to return additional regression statistics
+ *
+ * @return array|string The result, or a string containing an error
+ */
+ public static function LOGEST(array $yValues, ?array $xValues = null, mixed $const = true, mixed $stats = false): string|array
+ {
+ $const = ($const === null) ? true : (bool) Functions::flattenSingleValue($const);
+ $stats = ($stats === null) ? false : (bool) Functions::flattenSingleValue($stats);
+ if ($xValues === null) {
+ $xValues = $yValues;
+ }
+
+ try {
+ self::checkTrendArrays($yValues, $xValues);
+ self::validateTrendArrays($yValues, $xValues);
+ } catch (Exception $e) {
+ return $e->getMessage();
+ }
+
+ foreach ($yValues as $value) {
+ if ($value < 0.0) {
+ return ExcelError::NAN();
+ }
+ }
+
+ $bestFitExponential = Trend::calculate(Trend::TREND_EXPONENTIAL, $yValues, $xValues, $const);
+
+ if ($stats === true) {
+ return [
+ [
+ $bestFitExponential->getSlope(),
+ $bestFitExponential->getIntersect(),
+ ],
+ [
+ $bestFitExponential->getSlopeSE(),
+ ($const === false) ? ExcelError::NA() : $bestFitExponential->getIntersectSE(),
+ ],
+ [
+ $bestFitExponential->getGoodnessOfFit(),
+ $bestFitExponential->getStdevOfResiduals(),
+ ],
+ [
+ $bestFitExponential->getF(),
+ $bestFitExponential->getDFResiduals(),
+ ],
+ [
+ $bestFitExponential->getSSRegression(),
+ $bestFitExponential->getSSResiduals(),
+ ],
+ ];
+ }
+
+ return [
+ $bestFitExponential->getSlope(),
+ $bestFitExponential->getIntersect(),
+ ];
+ }
+
+ /**
+ * RSQ.
+ *
+ * Returns the square of the Pearson product moment correlation coefficient through data points
+ * in known_y's and known_x's.
+ *
+ * @param mixed[] $yValues Data Series Y
+ * @param mixed[] $xValues Data Series X
+ *
+ * @return float|string The result, or a string containing an error
+ */
+ public static function RSQ(array $yValues, array $xValues)
+ {
+ try {
+ self::checkTrendArrays($yValues, $xValues);
+ self::validateTrendArrays($yValues, $xValues);
+ } catch (Exception $e) {
+ return $e->getMessage();
+ }
+
+ $bestFitLinear = Trend::calculate(Trend::TREND_LINEAR, $yValues, $xValues);
+
+ return $bestFitLinear->getGoodnessOfFit();
+ }
+
+ /**
+ * SLOPE.
+ *
+ * Returns the slope of the linear regression line through data points in known_y's and known_x's.
+ *
+ * @param mixed[] $yValues Data Series Y
+ * @param mixed[] $xValues Data Series X
+ *
+ * @return float|string The result, or a string containing an error
+ */
+ public static function SLOPE(array $yValues, array $xValues)
+ {
+ try {
+ self::checkTrendArrays($yValues, $xValues);
+ self::validateTrendArrays($yValues, $xValues);
+ } catch (Exception $e) {
+ return $e->getMessage();
+ }
+
+ $bestFitLinear = Trend::calculate(Trend::TREND_LINEAR, $yValues, $xValues);
+
+ return $bestFitLinear->getSlope();
+ }
+
+ /**
+ * STEYX.
+ *
+ * Returns the standard error of the predicted y-value for each x in the regression.
+ *
+ * @param mixed[] $yValues Data Series Y
+ * @param mixed[] $xValues Data Series X
+ */
+ public static function STEYX(array $yValues, array $xValues): float|string
+ {
+ try {
+ self::checkTrendArrays($yValues, $xValues);
+ self::validateTrendArrays($yValues, $xValues);
+ } catch (Exception $e) {
+ return $e->getMessage();
+ }
+
+ $bestFitLinear = Trend::calculate(Trend::TREND_LINEAR, $yValues, $xValues);
+
+ return $bestFitLinear->getStdevOfResiduals();
+ }
+
+ /**
+ * TREND.
+ *
+ * Returns values along a linear Trend
+ *
+ * @param mixed[] $yValues Data Series Y
+ * @param mixed[] $xValues Data Series X
+ * @param mixed[] $newValues Values of X for which we want to find Y
+ * @param mixed $const A logical (boolean) value specifying whether to force the intersect to equal 0 or not
+ *
+ * @return array>>
+ */
+ public static function TREND(array $yValues, array $xValues = [], array $newValues = [], mixed $const = true): array
+ {
+ $yValues = Functions::flattenArray($yValues);
+ $xValues = Functions::flattenArray($xValues);
+ $newValues = Functions::flattenArray($newValues);
+ $const = ($const === null) ? true : (bool) Functions::flattenSingleValue($const);
+
+ $bestFitLinear = Trend::calculate(Trend::TREND_LINEAR, $yValues, $xValues, $const);
+ if (empty($newValues)) {
+ $newValues = $bestFitLinear->getXValues();
+ }
+
+ $returnArray = [];
+ foreach ($newValues as $xValue) {
+ $returnArray[0][] = [$bestFitLinear->getValueOfYForX($xValue)];
+ }
+
+ return $returnArray;
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/VarianceBase.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/VarianceBase.php
new file mode 100644
index 0000000..d5646cf
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical/VarianceBase.php
@@ -0,0 +1,28 @@
+ 1) {
+ $summerA *= $aCount;
+ $summerB *= $summerB;
+
+ return ($summerA - $summerB) / ($aCount * ($aCount - 1));
+ }
+
+ return $returnValue;
+ }
+
+ /**
+ * VARA.
+ *
+ * Estimates variance based on a sample, including numbers, text, and logical values
+ *
+ * Excel Function:
+ * VARA(value1[,value2[, ...]])
+ *
+ * @param mixed ...$args Data values
+ *
+ * @return float|string (string if result is an error)
+ */
+ public static function VARA(mixed ...$args): string|float
+ {
+ $returnValue = ExcelError::DIV0();
+
+ $summerA = $summerB = 0.0;
+
+ // Loop through arguments
+ $aArgs = Functions::flattenArrayIndexed($args);
+ $aCount = 0;
+ foreach ($aArgs as $k => $arg) {
+ if ((is_string($arg)) && (Functions::isValue($k))) {
+ return ExcelError::VALUE();
+ } elseif ((is_string($arg)) && (!Functions::isMatrixValue($k))) {
+ } else {
+ // Is it a numeric value?
+ if ((is_numeric($arg)) || (is_bool($arg)) || ((is_string($arg) && ($arg != '')))) {
+ $arg = self::datatypeAdjustmentAllowStrings($arg);
+ $summerA += ($arg * $arg);
+ $summerB += $arg;
+ ++$aCount;
+ }
+ }
+ }
+
+ if ($aCount > 1) {
+ $summerA *= $aCount;
+ $summerB *= $summerB;
+
+ return ($summerA - $summerB) / ($aCount * ($aCount - 1));
+ }
+
+ return $returnValue;
+ }
+
+ /**
+ * VARP.
+ *
+ * Calculates variance based on the entire population
+ *
+ * Excel Function:
+ * VARP(value1[,value2[, ...]])
+ *
+ * @param mixed ...$args Data values
+ *
+ * @return float|string (string if result is an error)
+ */
+ public static function VARP(mixed ...$args): float|string
+ {
+ // Return value
+ $returnValue = ExcelError::DIV0();
+
+ $summerA = $summerB = 0.0;
+
+ // Loop through arguments
+ $aArgs = Functions::flattenArray($args);
+ $aCount = 0;
+ foreach ($aArgs as $arg) {
+ $arg = self::datatypeAdjustmentBooleans($arg);
+
+ // Is it a numeric value?
+ if ((is_numeric($arg)) && (!is_string($arg))) {
+ $summerA += ($arg * $arg);
+ $summerB += $arg;
+ ++$aCount;
+ }
+ }
+
+ if ($aCount > 0) {
+ $summerA *= $aCount;
+ $summerB *= $summerB;
+
+ return ($summerA - $summerB) / ($aCount * $aCount);
+ }
+
+ return $returnValue;
+ }
+
+ /**
+ * VARPA.
+ *
+ * Calculates variance based on the entire population, including numbers, text, and logical values
+ *
+ * Excel Function:
+ * VARPA(value1[,value2[, ...]])
+ *
+ * @param mixed ...$args Data values
+ *
+ * @return float|string (string if result is an error)
+ */
+ public static function VARPA(mixed ...$args): string|float
+ {
+ $returnValue = ExcelError::DIV0();
+
+ $summerA = $summerB = 0.0;
+
+ // Loop through arguments
+ $aArgs = Functions::flattenArrayIndexed($args);
+ $aCount = 0;
+ foreach ($aArgs as $k => $arg) {
+ if ((is_string($arg)) && (Functions::isValue($k))) {
+ return ExcelError::VALUE();
+ } elseif ((is_string($arg)) && (!Functions::isMatrixValue($k))) {
+ } else {
+ // Is it a numeric value?
+ if ((is_numeric($arg)) || (is_bool($arg)) || ((is_string($arg) && ($arg != '')))) {
+ $arg = self::datatypeAdjustmentAllowStrings($arg);
+ $summerA += ($arg * $arg);
+ $summerB += $arg;
+ ++$aCount;
+ }
+ }
+ }
+
+ if ($aCount > 0) {
+ $summerA *= $aCount;
+ $summerB *= $summerB;
+
+ return ($summerA - $summerB) / ($aCount * $aCount);
+ }
+
+ return $returnValue;
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/TextData/CaseConvert.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/TextData/CaseConvert.php
new file mode 100644
index 0000000..83cc4ee
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/TextData/CaseConvert.php
@@ -0,0 +1,77 @@
+ 255) {
+ return ExcelError::VALUE();
+ }
+ $result = iconv('UCS-4LE', 'UTF-8', pack('V', $character));
+
+ return ($result === false) ? '' : $result;
+ }
+
+ /**
+ * CODE.
+ *
+ * @param mixed $characters String character to convert to its ASCII value
+ * Or can be an array of values
+ *
+ * @return array|int|string A string if arguments are invalid
+ * If an array of values is passed as the argument, then the returned result will also be an array
+ * with the same dimensions
+ */
+ public static function code(mixed $characters): array|string|int
+ {
+ if (is_array($characters)) {
+ return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $characters);
+ }
+
+ $characters = Helpers::extractString($characters);
+ if ($characters === '') {
+ return ExcelError::VALUE();
+ }
+
+ $character = $characters;
+ if (mb_strlen($characters, 'UTF-8') > 1) {
+ $character = mb_substr($characters, 0, 1, 'UTF-8');
+ }
+
+ return self::unicodeToOrd($character);
+ }
+
+ private static function unicodeToOrd(string $character): int
+ {
+ $retVal = 0;
+ $iconv = iconv('UTF-8', 'UCS-4LE', $character);
+ if ($iconv !== false) {
+ $result = unpack('V', $iconv);
+ if (is_array($result) && isset($result[1])) {
+ $retVal = $result[1];
+ }
+ }
+
+ return $retVal;
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/TextData/Concatenate.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/TextData/Concatenate.php
new file mode 100644
index 0000000..c2281d4
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/TextData/Concatenate.php
@@ -0,0 +1,137 @@
+ DataType::MAX_STRING_LENGTH) {
+ $returnValue = ExcelError::CALC();
+
+ break;
+ }
+ }
+
+ return $returnValue;
+ }
+
+ /**
+ * TEXTJOIN.
+ *
+ * @param mixed $delimiter The delimter to use between the joined arguments
+ * Or can be an array of values
+ * @param mixed $ignoreEmpty true/false Flag indicating whether empty arguments should be skipped
+ * Or can be an array of values
+ * @param mixed $args The values to join
+ *
+ * @return array|string The joined string
+ * If an array of values is passed for the $delimiter or $ignoreEmpty arguments, then the returned result
+ * will also be an array with matching dimensions
+ */
+ public static function TEXTJOIN(mixed $delimiter = '', mixed $ignoreEmpty = true, mixed ...$args): array|string
+ {
+ if (is_array($delimiter) || is_array($ignoreEmpty)) {
+ return self::evaluateArrayArgumentsSubset(
+ [self::class, __FUNCTION__],
+ 2,
+ $delimiter,
+ $ignoreEmpty,
+ ...$args
+ );
+ }
+
+ $delimiter ??= '';
+ $ignoreEmpty ??= true;
+ $aArgs = Functions::flattenArray($args);
+ $returnValue = self::evaluateTextJoinArray($ignoreEmpty, $aArgs);
+
+ $returnValue ??= implode($delimiter, $aArgs);
+ if (StringHelper::countCharacters($returnValue) > DataType::MAX_STRING_LENGTH) {
+ $returnValue = ExcelError::CALC();
+ }
+
+ return $returnValue;
+ }
+
+ private static function evaluateTextJoinArray(bool $ignoreEmpty, array &$aArgs): ?string
+ {
+ foreach ($aArgs as $key => &$arg) {
+ $value = Helpers::extractString($arg);
+ if (ErrorValue::isError($value)) {
+ return $value;
+ }
+
+ if ($ignoreEmpty === true && ((is_string($arg) && trim($arg) === '') || $arg === null)) {
+ unset($aArgs[$key]);
+ } elseif (is_bool($arg)) {
+ $arg = Helpers::convertBooleanValue($arg);
+ }
+ }
+
+ return null;
+ }
+
+ /**
+ * REPT.
+ *
+ * Returns the result of builtin function round after validating args.
+ *
+ * @param mixed $stringValue The value to repeat
+ * Or can be an array of values
+ * @param mixed $repeatCount The number of times the string value should be repeated
+ * Or can be an array of values
+ *
+ * @return array|string The repeated string
+ * If an array of values is passed for the $stringValue or $repeatCount arguments, then the returned result
+ * will also be an array with matching dimensions
+ */
+ public static function builtinREPT(mixed $stringValue, mixed $repeatCount): array|string
+ {
+ if (is_array($stringValue) || is_array($repeatCount)) {
+ return self::evaluateArrayArguments([self::class, __FUNCTION__], $stringValue, $repeatCount);
+ }
+
+ $stringValue = Helpers::extractString($stringValue);
+
+ if (!is_numeric($repeatCount) || $repeatCount < 0) {
+ $returnValue = ExcelError::VALUE();
+ } elseif (ErrorValue::isError($stringValue)) {
+ $returnValue = $stringValue;
+ } else {
+ $returnValue = str_repeat($stringValue, (int) $repeatCount);
+ if (StringHelper::countCharacters($returnValue) > DataType::MAX_STRING_LENGTH) {
+ $returnValue = ExcelError::VALUE(); // note VALUE not CALC
+ }
+ }
+
+ return $returnValue;
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/TextData/Extract.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/TextData/Extract.php
new file mode 100644
index 0000000..32e5b96
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/TextData/Extract.php
@@ -0,0 +1,270 @@
+getMessage();
+ }
+
+ return mb_substr($value, 0, $chars, 'UTF-8');
+ }
+
+ /**
+ * MID.
+ *
+ * @param mixed $value String value from which to extract characters
+ * Or can be an array of values
+ * @param mixed $start Integer offset of the first character that we want to extract
+ * Or can be an array of values
+ * @param mixed $chars The number of characters to extract (as an integer)
+ * Or can be an array of values
+ *
+ * @return array|string The joined string
+ * If an array of values is passed for the $value, $start or $chars arguments, then the returned result
+ * will also be an array with matching dimensions
+ */
+ public static function mid(mixed $value, mixed $start, mixed $chars): array|string
+ {
+ if (is_array($value) || is_array($start) || is_array($chars)) {
+ return self::evaluateArrayArguments([self::class, __FUNCTION__], $value, $start, $chars);
+ }
+
+ try {
+ $value = Helpers::extractString($value);
+ $start = Helpers::extractInt($start, 1);
+ $chars = Helpers::extractInt($chars, 0);
+ } catch (CalcExp $e) {
+ return $e->getMessage();
+ }
+
+ return mb_substr($value, --$start, $chars, 'UTF-8');
+ }
+
+ /**
+ * RIGHT.
+ *
+ * @param mixed $value String value from which to extract characters
+ * Or can be an array of values
+ * @param mixed $chars The number of characters to extract (as an integer)
+ * Or can be an array of values
+ *
+ * @return array|string The joined string
+ * If an array of values is passed for the $value or $chars arguments, then the returned result
+ * will also be an array with matching dimensions
+ */
+ public static function right(mixed $value, mixed $chars = 1): array|string
+ {
+ if (is_array($value) || is_array($chars)) {
+ return self::evaluateArrayArguments([self::class, __FUNCTION__], $value, $chars);
+ }
+
+ try {
+ $value = Helpers::extractString($value);
+ $chars = Helpers::extractInt($chars, 0, 1);
+ } catch (CalcExp $e) {
+ return $e->getMessage();
+ }
+
+ return mb_substr($value, mb_strlen($value, 'UTF-8') - $chars, $chars, 'UTF-8');
+ }
+
+ /**
+ * TEXTBEFORE.
+ *
+ * @param mixed $text the text that you're searching
+ * Or can be an array of values
+ * @param null|array|string $delimiter the text that marks the point before which you want to extract
+ * Multiple delimiters can be passed as an array of string values
+ * @param mixed $instance The instance of the delimiter after which you want to extract the text.
+ * By default, this is the first instance (1).
+ * A negative value means start searching from the end of the text string.
+ * Or can be an array of values
+ * @param mixed $matchMode Determines whether the match is case-sensitive or not.
+ * 0 - Case-sensitive
+ * 1 - Case-insensitive
+ * Or can be an array of values
+ * @param mixed $matchEnd Treats the end of text as a delimiter.
+ * 0 - Don't match the delimiter against the end of the text.
+ * 1 - Match the delimiter against the end of the text.
+ * Or can be an array of values
+ * @param mixed $ifNotFound value to return if no match is found
+ * The default is a #N/A Error
+ * Or can be an array of values
+ *
+ * @return array|string the string extracted from text before the delimiter; or the $ifNotFound value
+ * If an array of values is passed for any of the arguments, then the returned result
+ * will also be an array with matching dimensions
+ */
+ public static function before(mixed $text, $delimiter, mixed $instance = 1, mixed $matchMode = 0, mixed $matchEnd = 0, mixed $ifNotFound = '#N/A'): array|string
+ {
+ if (is_array($text) || is_array($instance) || is_array($matchMode) || is_array($matchEnd) || is_array($ifNotFound)) {
+ return self::evaluateArrayArgumentsIgnore([self::class, __FUNCTION__], 1, $text, $delimiter, $instance, $matchMode, $matchEnd, $ifNotFound);
+ }
+
+ $text = Helpers::extractString($text ?? '');
+ $instance = (int) $instance;
+ $matchMode = (int) $matchMode;
+ $matchEnd = (int) $matchEnd;
+
+ $split = self::validateTextBeforeAfter($text, $delimiter, $instance, $matchMode, $matchEnd, $ifNotFound);
+ if (is_string($split)) {
+ return $split;
+ }
+ if (Helpers::extractString(Functions::flattenSingleValue($delimiter ?? '')) === '') {
+ return ($instance > 0) ? '' : $text;
+ }
+
+ // Adjustment for a match as the first element of the split
+ $flags = self::matchFlags($matchMode);
+ $delimiter = self::buildDelimiter($delimiter);
+ $adjust = preg_match('/^' . $delimiter . "\$/{$flags}", $split[0]);
+ $oddReverseAdjustment = count($split) % 2;
+
+ $split = ($instance < 0)
+ ? array_slice($split, 0, max(count($split) - (abs($instance) * 2 - 1) - $adjust - $oddReverseAdjustment, 0))
+ : array_slice($split, 0, $instance * 2 - 1 - $adjust);
+
+ return implode('', $split);
+ }
+
+ /**
+ * TEXTAFTER.
+ *
+ * @param mixed $text the text that you're searching
+ * @param null|array|string $delimiter the text that marks the point before which you want to extract
+ * Multiple delimiters can be passed as an array of string values
+ * @param mixed $instance The instance of the delimiter after which you want to extract the text.
+ * By default, this is the first instance (1).
+ * A negative value means start searching from the end of the text string.
+ * Or can be an array of values
+ * @param mixed $matchMode Determines whether the match is case-sensitive or not.
+ * 0 - Case-sensitive
+ * 1 - Case-insensitive
+ * Or can be an array of values
+ * @param mixed $matchEnd Treats the end of text as a delimiter.
+ * 0 - Don't match the delimiter against the end of the text.
+ * 1 - Match the delimiter against the end of the text.
+ * Or can be an array of values
+ * @param mixed $ifNotFound value to return if no match is found
+ * The default is a #N/A Error
+ * Or can be an array of values
+ *
+ * @return array|string the string extracted from text before the delimiter; or the $ifNotFound value
+ * If an array of values is passed for any of the arguments, then the returned result
+ * will also be an array with matching dimensions
+ */
+ public static function after(mixed $text, $delimiter, mixed $instance = 1, mixed $matchMode = 0, mixed $matchEnd = 0, mixed $ifNotFound = '#N/A'): array|string
+ {
+ if (is_array($text) || is_array($instance) || is_array($matchMode) || is_array($matchEnd) || is_array($ifNotFound)) {
+ return self::evaluateArrayArgumentsIgnore([self::class, __FUNCTION__], 1, $text, $delimiter, $instance, $matchMode, $matchEnd, $ifNotFound);
+ }
+
+ $text = Helpers::extractString($text ?? '');
+ $instance = (int) $instance;
+ $matchMode = (int) $matchMode;
+ $matchEnd = (int) $matchEnd;
+
+ $split = self::validateTextBeforeAfter($text, $delimiter, $instance, $matchMode, $matchEnd, $ifNotFound);
+ if (is_string($split)) {
+ return $split;
+ }
+ if (Helpers::extractString(Functions::flattenSingleValue($delimiter ?? '')) === '') {
+ return ($instance < 0) ? '' : $text;
+ }
+
+ // Adjustment for a match as the first element of the split
+ $flags = self::matchFlags($matchMode);
+ $delimiter = self::buildDelimiter($delimiter);
+ $adjust = preg_match('/^' . $delimiter . "\$/{$flags}", $split[0]);
+ $oddReverseAdjustment = count($split) % 2;
+
+ $split = ($instance < 0)
+ ? array_slice($split, count($split) - ((int) abs($instance + 1) * 2) - $adjust - $oddReverseAdjustment)
+ : array_slice($split, $instance * 2 - $adjust);
+
+ return implode('', $split);
+ }
+
+ private static function validateTextBeforeAfter(string $text, null|array|string $delimiter, int $instance, int $matchMode, int $matchEnd, mixed $ifNotFound): array|string
+ {
+ $flags = self::matchFlags($matchMode);
+ $delimiter = self::buildDelimiter($delimiter);
+
+ if (preg_match('/' . $delimiter . "/{$flags}", $text) === 0 && $matchEnd === 0) {
+ return $ifNotFound;
+ }
+
+ $split = preg_split('/' . $delimiter . "/{$flags}", $text, 0, PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE);
+ if ($split === false) {
+ return ExcelError::NA();
+ }
+
+ if ($instance === 0 || abs($instance) > StringHelper::countCharacters($text)) {
+ return ExcelError::VALUE();
+ }
+
+ if ($matchEnd === 0 && (abs($instance) > floor(count($split) / 2))) {
+ return ExcelError::NA();
+ } elseif ($matchEnd !== 0 && (abs($instance) - 1 > ceil(count($split) / 2))) {
+ return ExcelError::NA();
+ }
+
+ return $split;
+ }
+
+ /**
+ * @param null|array|string $delimiter the text that marks the point before which you want to extract
+ * Multiple delimiters can be passed as an array of string values
+ */
+ private static function buildDelimiter($delimiter): string
+ {
+ if (is_array($delimiter)) {
+ $delimiter = Functions::flattenArray($delimiter);
+ $quotedDelimiters = array_map(
+ fn ($delimiter): string => preg_quote($delimiter ?? '', '/'),
+ $delimiter
+ );
+ $delimiters = implode('|', $quotedDelimiters);
+
+ return '(' . $delimiters . ')';
+ }
+
+ return '(' . preg_quote($delimiter ?? '', '/') . ')';
+ }
+
+ private static function matchFlags(int $matchMode): string
+ {
+ return ($matchMode === 0) ? 'mu' : 'miu';
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/TextData/Format.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/TextData/Format.php
new file mode 100644
index 0000000..40335ce
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/TextData/Format.php
@@ -0,0 +1,313 @@
+getMessage();
+ }
+
+ $mask = '$#,##0';
+ if ($decimals > 0) {
+ $mask .= '.' . str_repeat('0', $decimals);
+ } else {
+ $round = 10 ** abs($decimals);
+ if ($value < 0) {
+ $round = 0 - $round;
+ }
+ /** @var float|int|string */
+ $value = MathTrig\Round::multiple($value, $round);
+ }
+ $mask = "{$mask};-{$mask}";
+
+ return NumberFormat::toFormattedString($value, $mask);
+ }
+
+ /**
+ * FIXED.
+ *
+ * @param mixed $value The value to format
+ * Or can be an array of values
+ * @param mixed $decimals Integer value for the number of decimal places that should be formatted
+ * Or can be an array of values
+ * @param mixed $noCommas Boolean value indicating whether the value should have thousands separators or not
+ * Or can be an array of values
+ *
+ * @return array|string If an array of values is passed for either of the arguments, then the returned result
+ * will also be an array with matching dimensions
+ */
+ public static function FIXEDFORMAT(mixed $value, mixed $decimals = 2, mixed $noCommas = false): array|string
+ {
+ if (is_array($value) || is_array($decimals) || is_array($noCommas)) {
+ return self::evaluateArrayArguments([self::class, __FUNCTION__], $value, $decimals, $noCommas);
+ }
+
+ try {
+ $value = Helpers::extractFloat($value);
+ $decimals = Helpers::extractInt($decimals, -100, 0, true);
+ } catch (CalcExp $e) {
+ return $e->getMessage();
+ }
+
+ $valueResult = round($value, $decimals);
+ if ($decimals < 0) {
+ $decimals = 0;
+ }
+ if ($noCommas === false) {
+ $valueResult = number_format(
+ $valueResult,
+ $decimals,
+ StringHelper::getDecimalSeparator(),
+ StringHelper::getThousandsSeparator()
+ );
+ }
+
+ return (string) $valueResult;
+ }
+
+ /**
+ * TEXT.
+ *
+ * @param mixed $value The value to format
+ * Or can be an array of values
+ * @param mixed $format A string with the Format mask that should be used
+ * Or can be an array of values
+ *
+ * @return array|string If an array of values is passed for either of the arguments, then the returned result
+ * will also be an array with matching dimensions
+ */
+ public static function TEXTFORMAT(mixed $value, mixed $format): array|string
+ {
+ if (is_array($value) || is_array($format)) {
+ return self::evaluateArrayArguments([self::class, __FUNCTION__], $value, $format);
+ }
+
+ $value = Helpers::extractString($value);
+ $format = Helpers::extractString($format);
+ $format = (string) NumberFormat::convertSystemFormats($format);
+
+ if (!is_numeric($value) && Date::isDateTimeFormatCode($format)) {
+ $value1 = DateTimeExcel\DateValue::fromString($value);
+ $value2 = DateTimeExcel\TimeValue::fromString($value);
+ /** @var float|int|string */
+ $value = (is_numeric($value1) && is_numeric($value2)) ? ($value1 + $value2) : (is_numeric($value1) ? $value2 : $value1);
+ }
+
+ return (string) NumberFormat::toFormattedString($value, $format);
+ }
+
+ /**
+ * @param mixed $value Value to check
+ */
+ private static function convertValue(mixed $value, bool $spacesMeanZero = false): mixed
+ {
+ $value = $value ?? 0;
+ if (is_bool($value)) {
+ if (Functions::getCompatibilityMode() === Functions::COMPATIBILITY_OPENOFFICE) {
+ $value = (int) $value;
+ } else {
+ throw new CalcExp(ExcelError::VALUE());
+ }
+ }
+ if (is_string($value)) {
+ $value = trim($value);
+ if ($spacesMeanZero && $value === '') {
+ $value = 0;
+ }
+ }
+
+ return $value;
+ }
+
+ /**
+ * VALUE.
+ *
+ * @param mixed $value Value to check
+ * Or can be an array of values
+ *
+ * @return array|DateTimeInterface|float|int|string A string if arguments are invalid
+ * If an array of values is passed for the argument, then the returned result
+ * will also be an array with matching dimensions
+ */
+ public static function VALUE(mixed $value = '')
+ {
+ if (is_array($value)) {
+ return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $value);
+ }
+
+ try {
+ $value = self::convertValue($value);
+ } catch (CalcExp $e) {
+ return $e->getMessage();
+ }
+ if (!is_numeric($value)) {
+ $numberValue = str_replace(
+ StringHelper::getThousandsSeparator(),
+ '',
+ trim($value, " \t\n\r\0\x0B" . StringHelper::getCurrencyCode())
+ );
+ if ($numberValue === '') {
+ return ExcelError::VALUE();
+ }
+ if (is_numeric($numberValue)) {
+ return (float) $numberValue;
+ }
+
+ $dateSetting = Functions::getReturnDateType();
+ Functions::setReturnDateType(Functions::RETURNDATE_EXCEL);
+
+ if (str_contains($value, ':')) {
+ $timeValue = Functions::scalar(DateTimeExcel\TimeValue::fromString($value));
+ if ($timeValue !== ExcelError::VALUE()) {
+ Functions::setReturnDateType($dateSetting);
+
+ return $timeValue;
+ }
+ }
+ $dateValue = Functions::scalar(DateTimeExcel\DateValue::fromString($value));
+ if ($dateValue !== ExcelError::VALUE()) {
+ Functions::setReturnDateType($dateSetting);
+
+ return $dateValue;
+ }
+ Functions::setReturnDateType($dateSetting);
+
+ return ExcelError::VALUE();
+ }
+
+ return (float) $value;
+ }
+
+ /**
+ * TEXT.
+ *
+ * @param mixed $value The value to format
+ * Or can be an array of values
+ *
+ * @return array|string If an array of values is passed for either of the arguments, then the returned result
+ * will also be an array with matching dimensions
+ */
+ public static function valueToText(mixed $value, mixed $format = false): array|string
+ {
+ if (is_array($value) || is_array($format)) {
+ return self::evaluateArrayArguments([self::class, __FUNCTION__], $value, $format);
+ }
+
+ $format = (bool) $format;
+
+ if (is_object($value) && $value instanceof RichText) {
+ $value = $value->getPlainText();
+ }
+ if (is_string($value)) {
+ $value = ($format === true) ? Calculation::wrapResult($value) : $value;
+ $value = str_replace("\n", '', $value);
+ } elseif (is_bool($value)) {
+ $value = Calculation::getLocaleBoolean($value ? 'TRUE' : 'FALSE');
+ }
+
+ return (string) $value;
+ }
+
+ private static function getDecimalSeparator(mixed $decimalSeparator): string
+ {
+ return empty($decimalSeparator) ? StringHelper::getDecimalSeparator() : (string) $decimalSeparator;
+ }
+
+ private static function getGroupSeparator(mixed $groupSeparator): string
+ {
+ return empty($groupSeparator) ? StringHelper::getThousandsSeparator() : (string) $groupSeparator;
+ }
+
+ /**
+ * NUMBERVALUE.
+ *
+ * @param mixed $value The value to format
+ * Or can be an array of values
+ * @param mixed $decimalSeparator A string with the decimal separator to use, defaults to locale defined value
+ * Or can be an array of values
+ * @param mixed $groupSeparator A string with the group/thousands separator to use, defaults to locale defined value
+ * Or can be an array of values
+ */
+ public static function NUMBERVALUE(mixed $value = '', mixed $decimalSeparator = null, mixed $groupSeparator = null): array|string|float
+ {
+ if (is_array($value) || is_array($decimalSeparator) || is_array($groupSeparator)) {
+ return self::evaluateArrayArguments([self::class, __FUNCTION__], $value, $decimalSeparator, $groupSeparator);
+ }
+
+ try {
+ $value = self::convertValue($value, true);
+ $decimalSeparator = self::getDecimalSeparator($decimalSeparator);
+ $groupSeparator = self::getGroupSeparator($groupSeparator);
+ } catch (CalcExp $e) {
+ return $e->getMessage();
+ }
+
+ if (!is_numeric($value)) {
+ $decimalPositions = preg_match_all('/' . preg_quote($decimalSeparator, '/') . '/', $value, $matches, PREG_OFFSET_CAPTURE);
+ if ($decimalPositions > 1) {
+ return ExcelError::VALUE();
+ }
+ $decimalOffset = array_pop($matches[0])[1] ?? null;
+ if ($decimalOffset === null || strpos($value, $groupSeparator, $decimalOffset) !== false) {
+ return ExcelError::VALUE();
+ }
+
+ $value = str_replace([$groupSeparator, $decimalSeparator], ['', '.'], $value);
+
+ // Handle the special case of trailing % signs
+ $percentageString = rtrim($value, '%');
+ if (!is_numeric($percentageString)) {
+ return ExcelError::VALUE();
+ }
+
+ $percentageAdjustment = strlen($value) - strlen($percentageString);
+ if ($percentageAdjustment) {
+ $value = (float) $percentageString;
+ $value /= 10 ** ($percentageAdjustment * 2);
+ }
+ }
+
+ return is_array($value) ? ExcelError::VALUE() : (float) $value;
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/TextData/Helpers.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/TextData/Helpers.php
new file mode 100644
index 0000000..15b0467
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/TextData/Helpers.php
@@ -0,0 +1,82 @@
+getMessage();
+ }
+ $returnValue = $left . $newText . $right;
+ if (StringHelper::countCharacters($returnValue) > DataType::MAX_STRING_LENGTH) {
+ $returnValue = ExcelError::VALUE();
+ }
+
+ return $returnValue;
+ }
+
+ /**
+ * SUBSTITUTE.
+ *
+ * @param mixed $text The text string value to modify
+ * Or can be an array of values
+ * @param mixed $fromText The string value that we want to replace in $text
+ * Or can be an array of values
+ * @param mixed $toText The string value that we want to replace with in $text
+ * Or can be an array of values
+ * @param mixed $instance Integer instance Number for the occurrence of frmText to change
+ * Or can be an array of values
+ *
+ * @return array|string If an array of values is passed for either of the arguments, then the returned result
+ * will also be an array with matching dimensions
+ */
+ public static function substitute(mixed $text = '', mixed $fromText = '', mixed $toText = '', mixed $instance = null): array|string
+ {
+ if (is_array($text) || is_array($fromText) || is_array($toText) || is_array($instance)) {
+ return self::evaluateArrayArguments([self::class, __FUNCTION__], $text, $fromText, $toText, $instance);
+ }
+
+ try {
+ $text = Helpers::extractString($text, true);
+ $fromText = Helpers::extractString($fromText, true);
+ $toText = Helpers::extractString($toText, true);
+ if ($instance === null) {
+ $returnValue = str_replace($fromText, $toText, $text);
+ } else {
+ if (is_bool($instance)) {
+ if ($instance === false || Functions::getCompatibilityMode() !== Functions::COMPATIBILITY_OPENOFFICE) {
+ return ExcelError::Value();
+ }
+ $instance = 1;
+ }
+ $instance = Helpers::extractInt($instance, 1, 0, true);
+ $returnValue = self::executeSubstitution($text, $fromText, $toText, $instance);
+ }
+ } catch (CalcExp $e) {
+ return $e->getMessage();
+ }
+ if (StringHelper::countCharacters($returnValue) > DataType::MAX_STRING_LENGTH) {
+ $returnValue = ExcelError::VALUE();
+ }
+
+ return $returnValue;
+ }
+
+ private static function executeSubstitution(string $text, string $fromText, string $toText, int $instance): string
+ {
+ $pos = -1;
+ while ($instance > 0) {
+ $pos = mb_strpos($text, $fromText, $pos + 1, 'UTF-8');
+ if ($pos === false) {
+ return $text;
+ }
+ --$instance;
+ }
+
+ return Functions::scalar(self::REPLACE($text, ++$pos, StringHelper::countCharacters($fromText), $toText));
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/TextData/Search.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/TextData/Search.php
new file mode 100644
index 0000000..ad83f1a
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/TextData/Search.php
@@ -0,0 +1,97 @@
+getMessage();
+ }
+
+ if (StringHelper::countCharacters($haystack) >= $offset) {
+ if (StringHelper::countCharacters($needle) === 0) {
+ return $offset;
+ }
+
+ $pos = mb_strpos($haystack, $needle, --$offset, 'UTF-8');
+ if ($pos !== false) {
+ return ++$pos;
+ }
+ }
+
+ return ExcelError::VALUE();
+ }
+
+ /**
+ * SEARCH (case insensitive search).
+ *
+ * @param mixed $needle The string to look for
+ * Or can be an array of values
+ * @param mixed $haystack The string in which to look
+ * Or can be an array of values
+ * @param mixed $offset Integer offset within $haystack to start searching from
+ * Or can be an array of values
+ *
+ * @return array|int|string The offset where the first occurrence of needle was found in the haystack
+ * If an array of values is passed for the $value or $chars arguments, then the returned result
+ * will also be an array with matching dimensions
+ */
+ public static function insensitive(mixed $needle, mixed $haystack, mixed $offset = 1): array|string|int
+ {
+ if (is_array($needle) || is_array($haystack) || is_array($offset)) {
+ return self::evaluateArrayArguments([self::class, __FUNCTION__], $needle, $haystack, $offset);
+ }
+
+ try {
+ $needle = Helpers::extractString($needle);
+ $haystack = Helpers::extractString($haystack);
+ $offset = Helpers::extractInt($offset, 1, 0, true);
+ } catch (CalcExp $e) {
+ return $e->getMessage();
+ }
+
+ if (StringHelper::countCharacters($haystack) >= $offset) {
+ if (StringHelper::countCharacters($needle) === 0) {
+ return $offset;
+ }
+
+ $pos = mb_stripos($haystack, $needle, --$offset, 'UTF-8');
+ if ($pos !== false) {
+ return ++$pos;
+ }
+ }
+
+ return ExcelError::VALUE();
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/TextData/Text.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/TextData/Text.php
new file mode 100644
index 0000000..44e0cd4
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/TextData/Text.php
@@ -0,0 +1,233 @@
+ $row !== ''
+ ));
+ }
+
+ if ($columnDelimiter !== null) {
+ $delimiter = self::buildDelimiter($columnDelimiter);
+ array_walk(
+ $rows,
+ function (&$row) use ($delimiter, $flags, $ignoreEmpty): void {
+ $row = ($delimiter === '()')
+ ? [$row]
+ : preg_split("/{$delimiter}/{$flags}", $row);
+ /** @var array $row */
+ if ($ignoreEmpty === true) {
+ $row = array_values(array_filter(
+ $row,
+ fn ($value): bool => $value !== ''
+ ));
+ }
+ }
+ );
+ if ($ignoreEmpty === true) {
+ $rows = array_values(array_filter(
+ $rows,
+ fn ($row): bool => $row !== [] && $row !== ['']
+ ));
+ }
+ }
+
+ return self::applyPadding($rows, $padding);
+ }
+
+ private static function applyPadding(array $rows, mixed $padding): array
+ {
+ $columnCount = array_reduce(
+ $rows,
+ fn (int $counter, array $row): int => max($counter, count($row)),
+ 0
+ );
+
+ return array_map(
+ function (array $row) use ($columnCount, $padding): array {
+ return (count($row) < $columnCount)
+ ? array_merge($row, array_fill(0, $columnCount - count($row), $padding))
+ : $row;
+ },
+ $rows
+ );
+ }
+
+ /**
+ * @param null|array|string $delimiter the text that marks the point before which you want to split
+ * Multiple delimiters can be passed as an array of string values
+ */
+ private static function buildDelimiter($delimiter): string
+ {
+ $valueSet = Functions::flattenArray($delimiter);
+
+ if (is_array($delimiter) && count($valueSet) > 1) {
+ $quotedDelimiters = array_map(
+ fn ($delimiter): string => preg_quote($delimiter ?? '', '/'),
+ $valueSet
+ );
+ $delimiters = implode('|', $quotedDelimiters);
+
+ return '(' . $delimiters . ')';
+ }
+
+ return '(' . preg_quote(Functions::flattenSingleValue($delimiter), '/') . ')';
+ }
+
+ private static function matchFlags(bool $matchMode): string
+ {
+ return ($matchMode === true) ? 'miu' : 'mu';
+ }
+
+ public static function fromArray(array $array, int $format = 0): string
+ {
+ $result = [];
+ foreach ($array as $row) {
+ $cells = [];
+ foreach ($row as $cellValue) {
+ $value = ($format === 1) ? self::formatValueMode1($cellValue) : self::formatValueMode0($cellValue);
+ $cells[] = $value;
+ }
+ $result[] = implode(($format === 1) ? ',' : ', ', $cells);
+ }
+
+ $result = implode(($format === 1) ? ';' : ', ', $result);
+
+ return ($format === 1) ? '{' . $result . '}' : $result;
+ }
+
+ private static function formatValueMode0(mixed $cellValue): string
+ {
+ if (is_bool($cellValue)) {
+ return Calculation::getLocaleBoolean($cellValue ? 'TRUE' : 'FALSE');
+ }
+
+ return (string) $cellValue;
+ }
+
+ private static function formatValueMode1(mixed $cellValue): string
+ {
+ if (is_string($cellValue) && ErrorValue::isError($cellValue) === false) {
+ return Calculation::FORMULA_STRING_QUOTE . $cellValue . Calculation::FORMULA_STRING_QUOTE;
+ } elseif (is_bool($cellValue)) {
+ return Calculation::getLocaleBoolean($cellValue ? 'TRUE' : 'FALSE');
+ }
+
+ return (string) $cellValue;
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/TextData/Trim.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/TextData/Trim.php
new file mode 100644
index 0000000..d8f1706
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/TextData/Trim.php
@@ -0,0 +1,50 @@
+branchPruner = $branchPruner;
+ }
+
+ /**
+ * Return the number of entries on the stack.
+ */
+ public function count(): int
+ {
+ return $this->count;
+ }
+
+ /**
+ * Push a new entry onto the stack.
+ */
+ public function push(string $type, mixed $value, ?string $reference = null): void
+ {
+ $stackItem = $this->getStackItem($type, $value, $reference);
+ $this->stack[$this->count++] = $stackItem;
+
+ if ($type === 'Function') {
+ $localeFunction = Calculation::localeFunc($value);
+ if ($localeFunction != $value) {
+ $this->stack[($this->count - 1)]['localeValue'] = $localeFunction;
+ }
+ }
+ }
+
+ public function pushStackItem(array $stackItem): void
+ {
+ $this->stack[$this->count++] = $stackItem;
+ }
+
+ public function getStackItem(string $type, mixed $value, ?string $reference = null): array
+ {
+ $stackItem = [
+ 'type' => $type,
+ 'value' => $value,
+ 'reference' => $reference,
+ ];
+
+ // will store the result under this alias
+ $storeKey = $this->branchPruner->currentCondition();
+ if (isset($storeKey) || $reference === 'NULL') {
+ $stackItem['storeKey'] = $storeKey;
+ }
+
+ // will only run computation if the matching store key is true
+ $onlyIf = $this->branchPruner->currentOnlyIf();
+ if (isset($onlyIf) || $reference === 'NULL') {
+ $stackItem['onlyIf'] = $onlyIf;
+ }
+
+ // will only run computation if the matching store key is false
+ $onlyIfNot = $this->branchPruner->currentOnlyIfNot();
+ if (isset($onlyIfNot) || $reference === 'NULL') {
+ $stackItem['onlyIfNot'] = $onlyIfNot;
+ }
+
+ return $stackItem;
+ }
+
+ /**
+ * Pop the last entry from the stack.
+ */
+ public function pop(): ?array
+ {
+ if ($this->count > 0) {
+ return $this->stack[--$this->count];
+ }
+
+ return null;
+ }
+
+ /**
+ * Return an entry from the stack without removing it.
+ */
+ public function last(int $n = 1): ?array
+ {
+ if ($this->count - $n < 0) {
+ return null;
+ }
+
+ return $this->stack[$this->count - $n];
+ }
+
+ /**
+ * Clear the stack.
+ */
+ public function clear(): void
+ {
+ $this->stack = [];
+ $this->count = 0;
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Web/Service.php b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Web/Service.php
new file mode 100644
index 0000000..5581341
--- /dev/null
+++ b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Web/Service.php
@@ -0,0 +1,73 @@
+ 2048) {
+ return ExcelError::VALUE(); // Invalid URL length
+ }
+
+ if (!preg_match('/^http[s]?:\/\//', $url)) {
+ return ExcelError::VALUE(); // Invalid protocol
+ }
+
+ // Get results from the the webservice
+ $client = Settings::getHttpClient();
+ $requestFactory = Settings::getRequestFactory();
+ $request = $requestFactory->createRequest('GET', $url);
+
+ try {
+ $response = $client->sendRequest($request);
+ } catch (ClientExceptionInterface) {
+ return ExcelError::VALUE(); // cURL error
+ }
+
+ if ($response->getStatusCode() != 200) {
+ return ExcelError::VALUE(); // cURL error
+ }
+
+ $output = $response->getBody()->getContents();
+ if (strlen($output) > 32767) {
+ return ExcelError::VALUE(); // Output not a string or too long
+ }
+
+ return $output;
+ }
+
+ /**
+ * URLENCODE.
+ *
+ * Returns data from a web service on the Internet or Intranet.
+ *
+ * Excel Function:
+ * urlEncode(text)
+ *
+ * @return string the url encoded output
+ */
+ public static function urlEncode(mixed $text): string
+ {
+ if (!is_string($text)) {
+ return ExcelError::VALUE();
+ }
+
+ return str_replace('+', '%20', urlencode($text));
+ }
+}
diff --git a/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/Translations.xlsx b/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/Translations.xlsx
new file mode 100644
index 0000000000000000000000000000000000000000..080d5e7a8eecf953e573fdde76b191e76fcd40ec
GIT binary patch
literal 140431
zcmeEsbwibJvo76@bSm8~4FZaEBi&Nc-5@QEv^3Jv-Ca_P?v~C4EIQAFzxUl|?^9o3
zAO1kVXU)u-nJexalw@JyUO^#1AwfYwy@tBKuRFSchJyNq3%J4u(D(3I=%o|9|{9?m%zSaCF)`tPj`U&oPS{uxrinm0vAn_Q_St
zNu~}W)}~ck{_rg-dAPfOWynldjovG@@bzoCm+fV4`2N&t(jfjDVzAkt*JqLsG+jq
z=YTxlCT?QK3f`oAE;MYlXn3dvPSgo@j&^8lx)5>w&yw^Ggcm95{om_2nB_VZ)9>)Q
zlRB2;@di5H*KLxPLor^sbWY4G>VqvDrS#SFD2C3rhI|;@M9K+PD{7YBNbI)j2aYgq
zE`~LARUqb;+F??W6rYy_Bi^|`D2jZ;#QlBe`K&h0Nft&$CevA!+<|}mhJaE0Nzz+R
zBbS74?&LJ5t?UB>mlF|
zc8*rYc6L@TDxCMp#x9o+>&bWW5pfIrN)87{X`c~UOruy&-KP8zr`RzPx0HBuc#~)W)gqp!FWfpz*gcd?Eu|J@%d3k9pkB>Zz|7
zu&WKRJx%cL951g8k_C(PXI0uYp_J6HhiX|R28u2E9aZ#x$Kg>fNG0N;%htL4QsIdE
zL}VgB5WU;n9*?V^jqzG-*YNjfh$_CU_HOAo**D_=3-*p7cdbhceqlsbx`TXH8%78Y
z<*cs#<7~hiroxTO`q=PN_{Np>?=$o_cc(q9X!?G*-xSJ+_|>c9NPM8j70fTfp66ZI
zMNq_?hyx+9A<@Pa%Uh?0iRYr0iGH2uYh9K10~UluGmbPt>pnO(&XuDQ8p$NA^Clnl
zA`-SW;?m@hKO?K`e;DGCrQ#0BU#`kUS5K}|eJ`I&m&70i2xr@ArP+HP(pu$Jm5W9cEzeG(-_D
zTbP$vM3_$~(Uy`(;OW=N<283Qtx}tRW5!FppLPkCXI4<8b%CZ8XL_=?KHW%}b1di}
zvdvMlGy4)xVK|2xiC}dhpT9&@1nTNpu;6q;gl2!;6(-#4Z#8E2G)~@!91Ax9>7(ax
zW(WVQR=A5eIp8ivke4
zUI3HCP)N`K9{W8Y>}QFIax
z{=+BXs}O=oa5WFr8@5TAL#TgFlX8@0gdeZ<2yLQGM%v6syGX==5rPo662_bnqvx(I
zVqVDJPuy{tPi;H)1MV&3yIUMs8xaL=E)V3Lol^EH@ZLB^M7YG`l>Ufq#SL(B`rql^
zkYfGwC~)ZN=YoPF1oq}%bnj$gYU=F7_V*u-7v4`#)Uiure>Jd1cPvQRfmqoD_j8<4
zmc(X~{MX6V(bxEF7_)v$75V!UK?F3dT=_<29Ez>w9$4ifxANKqvkgTwDzTKhL+9!s?Ui>lmU2Z;!mTm
zD@f!8&EwsFWYZO??>c?|qu0Q7TIrW)@S`w**PHG*Az2}L(Iv48_gUTihXO-w-k*KV
zF(_RLho#ov+p;>W)kDr_mIe-D4e;r|iSD`UKrpLtBC8*|F9aqp5-bH`%LVz71ARVL
z?&?Zgz5m|ef{h3p5y=jYs>Ad`F@|$-NM6y3rC)RE+n##MB%0c1_3V4)5BC~l
zWt0}1|dYWm;F_>SFhoC;cd?*P*S9gXC)6`jH*;fil
zCXVJ2qwcf^>)+9#RmIYHJpMS|O2zvSK<@K-LTzX42>JmBE-mKviE=5W)UXnMfqth?
zA3TBm$*QRKc7X=1Ugj!sGf8$(7EcZFQ15l))y4DiJk13oefz0i4{VT22(8{?vr(F>
zz7P_ViJ&L*7L};a=U-}s3hiW_mJCg7)yaahdF;^HY4rs3wnM02I~&w@z9e)B=j^%)
zZ~qYby1nSTZUhs{VznjdLhhSLPC|eG@i{GXnj_nk1$H(Qd%<7v4|}R&=sQGhq*7u|
ze&}zLciq1tC|&oy|IQ1q4DI~&+KFUr^jFF?mL?C}QWXiYGwzf0qOl>FVlQ`0V`!&<
z_#4tY$zsEl*BJtxd;DkP@d|Qnk+le?^a1m_a0leh&>x8mjlEGcQN@XxpE}iMHJQYT
za?3+<)v;cS4$}*=?3;l>3(wr7wDwC1YOq
zy5{no3kQ0L)xJ&S$c*0Dd!yYjM3`tS)b+7j8LaP7AZStW4pTzSDQJ$c^0eo4U(dVyo2&D-`}4cUv*U}N4n}wHyYu6YE6CaYZRqXjea~E7
z=#DCDZXzoG1e!f}$CJ0kP1MfgSm@5<6q~|cy+wTcdP@Y`alxJtb_nwdweI8T^C
z$ibDXPx97%rd>Qj06fgt4jK(p-&=F)ba^ii$oU7H!|G|1p&~th=n8XrP(`m
zV_$jM4~fTaePHiWakP82P^i;HO*YYH<^O72f#l42ah26c+TS1)x&9|LeLJo+dzZew
zz3^8B#0_T|lNM@h?ilWeI3#4!gIH#UU>Em^$JK;{>t>bbpys$8@uOzrF9=8D_|laU
zAE~>J^pZb+L7={Tj}un`j*}bx`Uh4SC(e#Oj?$7kUBPSIl37MvEJe!Im{Ja2dQrkA
zBTQh!*-1>LROtl&Cph~?rP7_W@=GJNDi79fP1L>o=lhw39rH=#@I_f=@z8xfk!Sm|5Cub_M
zdMbN0z4ae(maxO7-?ci!XLw8ME2@!V9JNrZYR75-RlcGKr_LLZ638&KbdWB1ZDffZ
z6?R+@ppY8uL@OO$wer$Mq>Es~5%$lP*isHqCgr+u3@m&r+LZ7jq^;P;K>@K%KrAeH
z9c3K3N?fu?oK^yfVDvD1f$du2uxyX5S{4>DrsE|1Fg(40DMpqqx`ZTZg6@#5Tns5c
zNtWSY`yTN#As=5C8kNY(1NGOJC9w$VQay}$4tSHbD3!ik(%L(!!f;
zN7+{jPM}WIWC`o5l%2%U`g9lE5s!Wi&ceg))y&X_5W{D$t#(qDT_!^ji_?kMLWVg?QeZo*L@6EUXw
zz-}I|OlTD9vTWZkQo)A1!K(<7DSI%Iau?84vSEa)}rAaXG0v|h^MdWN6t
z@s<7aaL&m8+zhv-ByyC69s1Znb5^zKX+CeYK(}7|Y*>NGH^)V#kMs_ordWQQqQG8+
zsoa;T2x37r2h+M1r>QO0$8E0X$h{7cNp6e})C6x)+S4KWQz7&(Q*f}q#-LF2cXH;X
zizd~<34P@J1Db*ZA>JQ1lHX)DLhy}-H7YB@l(B9U{E@~dOcC!>2hF2-d-puvhY^})
zmBS@{sx(TiLE-p?1#9!?n?J^>z=3r#pK;ynHv{WMpgK-6!_`bG3jh2CO%|62m&ERN?ko@MR!;2HowXY4MN*ADUPv+|`
z`$!tPhx@S+{hJ`gJ3fjF3a2&*^yiA*R`c-7*KwZu##tYb+w;8N&;R=T*bFyDzh;Ty
z;9JNKcf#%0xw3-^*KiBF5m=na*;Apznv@=WR)Hb9JDM+>-1@XkAS018TN
z1MdH30XhG%fJ@P7>{uaSrc1I|Ff0cljPm>p`HW24ysc-WYo~N6yqt}Be9=LR8ya7p
zJX4p^H?yhSfxl8*n=m_dLu
zxV&PuL+2>iTUn>S7B)yG-=f4t_*y8@MoT)8>C30CjJjBw8G8oa%wIIQ9`S1UnW7nz
z`qCc3+TFSsM&B+|&5!gyx5TM82TOfYLcc6wsYuKxI~Qx!ofN+Ka>&ng*52my$H-CH
zV33O;LDPyCH-9e4b;0xxjo*cqnFKLQvG>9ZF4WxkayWr5MVjk(RWnFTnv7I4R-^$=!-5Wp<&W2AUX>8ZX#(;(;MM&O7*}EZzj*QLz=`x>J%<68o)2)szI2>
z#B!i$T?W=v&fDV>!x-iEGgXXD{+T$goiOHIGb2wlYFqFwP#$}${<=92zdA@|I;H>~
zN&eC=zfP^DWTi~LHF%}vJ<@a9O$AGj@9_9%Pr5#kNy(}Ssn9vbV$RmOJJike+T%UNT9)}^~Tf0}DEZzHVAt94y%tE9r6wOCNK@p^z+0&1+|2`R4lr91Vq=r*@>YJ)xMgy6SZ=)
z0`=d;!C?wR3O6sF;tXMQ;r!*GE<+8T=CYnHu2&TOp7&$?Zk7z5uSFk^4SebSZVC;a
z9t%4je)>JOlU|5+Jnip3-)w{Z9wAQ^e)kaI1(%r5>Tg9KAMX9`!7Ew5x3`LZ6Kmmq
zFV^V-(NNRAc+D~2NHHvekNGvPi+MYnYemsB5J%%F=5hq3Vp
zlQbQmZB!ssmp_bNqs^32Z5;JE7(};)aBR5haNAy_uoI)yUUL!8xcFcB%GbJ8`745v
zbL;Op?=pas2TjqFUn^Wzuy;FL$9?EdL&u|-ulH2zMI;IssDfD0JDr_TN6nogD$ksd
zj5hKBrJ7GN*VCeC*MeHOXHUp7sNs^+G6={|EJoNMO|^F_0(^Iq!u|#I;zJB_Zcgt#
zB;8`9x${_mqR0w?yX&4eS71VQ&bHmwJUl7U#0Deo7$mB&Or>b)v2MY4EBf)jkQz
zygVTfPv#PzkyPO%w4T5rnGkCA;BPAz!$xkeQB7bRb+Z}WjKW3efdgQqj*21|z
zl&0eI&Eggp^pPX1Q`B-tiE92C)atrs!mU7bw$zfv`HS!U4^GDM0dl&?RPvZ}ZgrK=#f-v8
zZ5iK5x{JuUFno&nKMf32A}#j`*ocA@s`Bieg#&8RctLmRoW>o`sho`VE!RPcHk^*!
zgAG>H&$*=?VPuNtY1Q?`#cM+3=*eWiY84%7UW*WxGdb&jbn>#uzEmyvw41PR6)elf
z@aZ|?Z4+_%4Nqf!qur_NN|_2FNt%w0Kl!$iJH7Jx6r-*a+&Sm6OVPAfeU-fC3Zv2B
zot01oQF>KD|E^W?K<-AhgzAwhvk^1}+8o~EZHlqa@xrC)7Z-&eK`-%>Do@|)p=*#z
zuBj~Z?pdBN^p%_&+15?p_nazKW7b?1F$`<8gTM>@Z;fm|A@zHALX^$(cDP&TFpt8f@Ugkl1e*}QQ5$6O>ywe**t`ZXQ{-482WJVPrK~(y6Q}T
zL>F#_a%CWf_)5MFg{s#6C1)Pps*+ZqGkh)e5oesx{tL8#l^$P8|6KR
z=b1J(spO17um3CU%OHZ56HLc3ZwqK%fWt)0^9
zhl~>&MMgWO`#4&a`}D@Wj?#J2>SI8%?W|s#Dul#G>#b(MFY$DV1D^}6k3o|8oFKNx
zgXp>zfr@#L)yQkoRO4R8914v{v?FEW?gttL{(!fO|-4P!_**Vm?|
z#K)WWRW909!}Bbs6ODIVwS%jTTL`}P`dr?w+^kI-KQgN81W6K??JxT(PQJ8S&jl~8
zMP8@FE-MSgGvSBW+_DNS-{$lZ?(EB}s+P0ul9{A~ZwuU-d_uraYg}RR%KCQSDTXcb
zH1(wD6nb${L8xxHrVM$ZtG4O2#)O8VmVFK@Mw8*v?VAbek@NCNeeHKbmVFvqoHM_A
zu<}GEt|VgSF5ha+hM4q8Gey&j7L=t#{HQf9xZ<}7K0C9T41YayJ?V7Ou*o&q@RKXa
z1E)mNw81o-#|D|=S%~8CF3upO&Ec|tq?)gSNKTMg!!B}e|Ff>8#EqXTx&A2B5;4J{gUW#BkfUHhml=E(U?menM3
z0aLbWuGP0k@RGYUYq@O>($Q8l>2qkEWKpt?Mtw2x%7@g6x0r(-v5Bw^5px|T_BYMr
zBD|Zzuvl&t`Y|!LudW-yEcb1Y>8XMT^g3Y^1PT8GSV>U0K
zVT(T32bc7ZJ#ALE;zH?|c=4vI0z5SL+C`6E?U#CvC^Y5Y(?5`Vp#=aFnTgo=evE%(
z(Q0(&H9*pC284%o{kW+@ifewml!b0(HoEo00Xces>lFn)yEc2Oa+ufC0j68|_R^`n
zNRSH@DyRdW@j27ZYc8!j!s^0oLP}w@J}bhz1E&$);A{nkB8r#U7wq0cz6U^K>%^j!
zywP_(q2rN1hAo7KcW2t3zkQFlN4OC0`eBA5Q=HZo*IC{yJJzZ*F}&Qq!ZyE0S_F0lo@;RT1Lk-t(>Biw*)
z8YJB0ciLHIO}U_U))c~Zx#^*BI;JlD?Zs^It(Y&%^po(~9cz=z_X9@sZ*O(G>v&2z
zNXhqscF$RGm(z^iP=bN@l64p$D+SqT{in`L1iDS)9tY@5NI-6Ogo89j#{7&&AIH|H
z`ho2PcLp8gVv0>&8jk0%JuKCjiD=K%=pXhxi>>9&O^&Ai05M&~d38LR^#r9u
zQm2w~9egx@#B#9?<~%sH-x2hvkWReKyvXe4rehicdwPVVnV
zsX|&F99Pe9Pc!YjHI|$6Buu44{iP9m4z`r`$yh@vKlTt028)1H$(KdlPXAbebfWud
z_;yGio_K~u*>2o8$}e$7__s>@xRxQgUSkH28=yMUqL(S;-CXn+->Unvr~y;BVQq9_
z2puxMgH^@olylrZv(WUEK&-tU<|UyeO`l6|B8`%@ljG}b8}HD1FWTr@N-|PBh3Ti$~lO(*?jT+Zh$(rBfNIS%G>Yz{4p)LWK5+|5b4XUL${PH
zMq{dTw@d_bqxNk}X}>g+ui16{Cta{xO6{NeMS$&kh#oDgODn&7Ools!4Xc%493hs+
ze-f7PkN-p(wnkTW!*ZKa|7SKzx`Zz@`ut1iOMfa;+EpbsL
zu>5To(cc%_9B3p{BAoP{CVh1qpDj0@%sbi*W8AbFpAK4$N%zfKckM4SZ601g1-DbB
zbh{e>sR$nG*d%ikC&N7^^orAd}P!N18&zZd9iGQX4}r|sME8*J0k&>u78
zS0Hr}weMPJoV1gJw?z)CoL|o5Wwl**k4b8_n>C1pzD7TJ~I{DE=<8o&}TSgT1
zb8O6He=c=N&&bt
zbA7$FU?;kt=hdz_+GaRU=W`7t;PJ3er!bec9Kh(gvn
zb}V*YpnN#TaqOg5^gQaWD7^Z36}c{GLnQ0YN74A|xk;&M4#sbcw;lC_DP8-~(@|X{
zU0dgO^r3I0jJ=#HE1;bC9rr?v2XiWC$xVcT0M^asC=jA-DD*|6095@m6otDZoFh{2Z>P
zx{iN9D!V+nn;$nXJ54RjMcV$*tmOq7net#-NLy)N^o
zkXM0^>=00V%G965T(ETS{rqqz@|Cez|K?CDj2#vThmhkT3;fs6=d
zX$r2w0|w@W@L7ANUH2uB@UCC~E`0?`K_|N7g%#fT63_L&6v_u7mjfvkY65C&rUXF41LYaDzr#{M?Op^bUORj`7O
ztceI*+~2Y$B8T`ej~U%g-k8et?WHy82|#N|OZZ+4OU3wu+u&$)@Vewzf&9DlkX!T2
z7}qwDLiavkro21N8FOg*e1{F`pI&RLVtZM~MoIjb5lQARQ;
z`B9Xt^|H=xt6AlSg|6{tH_GlZlwmF7ypL|ARodH{We}6Xd)t1m_F^|TRyp_wZ>;DM
z@{@3j~o`QkH5jZZM45Q0MppHTt+ckk1*c@`r6s^TCVDu>$#1{RJ
zj$IwO$p%hlp4#iX@XxIMJsX;+b%1dwuJ@`x#dIs%{(V?w4=GG0S5Wrg2hW#v?53@5
z&3ePHcYL(X+A*NJ&ly-Ip7|ZggiUa>*ScllWT)Fk&;tQkh2TV=Ja&Fx8*CIwjJ;p*
z5EIjjEP4J@jl7FT_XZ&Swb_=I7>Djq!8ymHOM4M}j=L#YO!Hr@e?`}uU|GXArK>e=-
zGwyD?DU{B;+9IjI>Z49%>3j02Zg0147H<4Cq!lBbZi6hNXs37!ZyD5|``;bIP-G+n
zAOdDOf(F<(dj1#f4Trf7lm|)D@P4~A)^*&xlKUsTk0$A6;^u}8KnD|Z03CeTQ>^gh
zUhqJyzHDC(|oPLy@P4N3RIzJPWu6E)GxW7EYt{n~r8WqsBZfmmlClGhoa
z8NR257aI*Xu#M|`J=!?})oQ}Nv9~=J*_wfWHe2wC=_0uA2`^A2+o}c
z-T?j9TIbTav&uR6>z>PoQMoNYx1kPno^(ny2Bf#F{0_{1crx-GJZuUN7xF$=5^<|J
z^K8Z9b?jH|B06=Cg^WNu)~-c7lsrBZSD=pZTE5a$%(x}DzdEGi&m783$5wU}N~Ge~
zSdN8gLfM0Q%D3DZdCyPxpE@54#R0;)Mn$eA&(`t{{c&tTL;4UGuEu45*;4T`6)A
za(!RTpol|$cabU&cArNexdyMRuN2Y^
zCF$rWf@_^*<9aS6POP+T&4-H}a@cD2?7>}*&8$&QsL>gE|2dt2lv+R13NGTX0>lJ*
z26#Ps;6%R->-6j^PoWT|o9{aLPk_igOJ^(S-nadG8JmL_qCykSNH8U7=vhzoUNR^L
z3!jLvUjqq(z<~Lim(GZkwST=8Kikg8C)GNCiK9yxOSwK~y5{Nw@Ozu*>n#&dT{@0%
zt0QcKv{0Kv_jfbk^b-0EzU}Ajsym!b@JprB$#~6|i$hw|0q}4+VtB>mD!6^4eJ&7^
z%F&+dfQ+%71#Ao#_dgrM$I5H3&mn0K_+lmd>m8Hvfs85T+#BVOyBiwQnX7yo?`r16
zx7Q$1-~gS5<+i$Poq0G1e6(6=?zt
zn&9^cz#4lUW@tR*0jIC&&6TuJDknFEG<14CL3F_f=ItpGx^(j^$5n?`Kw|*3HgBJl
z1(y-Ma$K}WtJ4Ac!1eO-RPX*GeLk}FuI9N1eh!y?ji5I>aj?61qI&=l
z%(#EtJezB>rU+@Kydqdwuc}L%c(}Dz(t)x^p8p{@FD_i
z{8IBI063{!^_|+bCmOf<@mLoYGooZ{8}9&=nuN@I^o`vD%F464!mmKM+>|8vgB;W|
zmLS|_+3oPs_yOX77GIDruWqydjDJbMhR=5q0Fwui0x9?E#Y0qIAmlV{2{@3DG=Ein
zDLsyas~2E?vu{9KQh>IoZLVZ&I(KDQHO1_22tBwjOr_D1ngUIsp+W~3z(h=2X9UEB
zpZ?a!ZXQs+Lw^U3B8R~+BE#Jcx{4Tm-%)tfLU>>OQ?RjafN|`IM_yfg6AW#wv#?LWxG}z}X`DWW>)A0PSU4OqO@h*
zO{wvpHi~+rnaE#V=zBIhLY|G`Rjk&`>qsXO$gbUNPVAD!Ma7lZoyxxv_Fvm>kpc
z9GtXDTCKjw%%{-0(=0l3^6#k5@7P^hs+}o|;POlLi{NrvY#N=^ON!QN9-9nQeuQK3
zE1hbr?c2Anzi>*@uf9mlZ(wdS-~X5-g8$_~cfG=TAAEb|YEy>F;AW{Cr}f(=>7?3u
zWYQ;zJW@u7a0w80o%DM%SyA(S8rcdh&*4e0B;U{bCOQ3M@J~ZYPnmXhbFG%2qtcF8;0}wgt6o@?YH!|Z(WY%y0L@tXwnPlheP|(Q*f^fV5W{~<`#Opdx
zISk!r_$8RS6Y$n0O9C>Lr06lITTms-CaS6a>eI9^II@~?LA&9*%
zFte@xwEPwGR;!Vr6p!QSW#qsk%QCha-ZUYhd6Q)X2-q;2;_Yv0py`Zq8`RCq`c?7T=9~15}*+
zioe4BI&CdOyG0Nq(9Hk`#6H}Uf!Seyb5Ve7{sFk~8T9mypE6rvpv~G@6F=K9PkAZX
zxZB*AyL_N;)TW~`dk#GV|a%S=GE^2>e1#b6bXBS#xXEPM4r8iGD1`?xW7>mvTpVnWJl%N{$JTe-dcrJslz94Tw9OTX3nN3t7e
z18AiNt4FhETNjCb3x&B_8z8u#0=Ch%<0R{#9Ni}CZOygypO
zluWZ%ntNH|QkVLR8s)I4Di0uu2?UhrZ9HbiBD;HXLaH&->}12o+39h!Kl}nbg$n>4
z;(7nTBSWWJ+61zZJQ^uujV1*6ZI403>VJS|V*OG&x9fim%w$X1x^ZHEVw)29{Blw@
zivrfHCi$-h?g1LuCiWs!Rb>&Qc9Zi$AB$gbXCD88=yU(08aGkG#CgIrUe+p(iVT)V
zYv6?7p$jx3a#XNlo_{&=+W7JY|eLK9C)|s#o|Cs^J
zVkagVKlg6|wf>7ed2@wVn$6jseoq1vT62+@52%r=QCY-{-K2#eBDPL$c$mXlvr|U?
zfk^`Jo|9Hd?Cx+N$AJ+0@h-ri_6NECRsVsM8;)|{$S{gsJg_g1pQ%ar?1*U}d
zqC=|I1|Z&L$E!>`&*Y_M%_mxP5~s)-9>%6KDf->TB9KJ*jKxFjgSsX>x(H4a%2pPN?pSw-qLPgU
zW@kJ`Th<;U>Gd`SgnEK3Y-;5Onv4JzZIEi02kZlx3<|UNoqIkvt@XMrQS$Kg8|d_)GF~Txq9pBixsMv&jW7gaS5dPDsJBc
zG28tMy)Qu_GhSyx=p90(^}r3i2XGVMe}e%|iFO8SmzQ|)VG3?$_UF^nUu}E$;4!}V
zioP<`hil9Aj?Zb<=&}xSTra%dcYb}lM1jW3gUj=A7oOl-#(7^Bx~#pN-~F~x-wM!)
zrL{=RUN`rFynL@Y$IE4)To#~QGNr!SdE6FX!SGZS|3Mm-g$?*$yqnMvCPc_
ze9TwEEXHC&TPb
zy?Qs8h`S`Tx_y>1;MGIi+IzspmOTfD8)p)%@
zke&%#FL{&bqt?CL7BSiC*=9GaQJa3XveFDU33u|3x&3n;GSlS{mg__|d>kMwz&01LK0?a~r%)r-07jnY8342DCABr6KoM*{*zm|b1x^cnH+O}cpx6O3@4+@vxWl4f%
zL#XRtZnl5o-|XosCXl6PD6b{!B3jOs1j336ur<~mCseF1*sI$IIiC&pgr}B3QX4vm
z{+299=-nhb2QRXGe@dmOxQRo``-Xq*)W`jwnqhJpoItnIOFL(*F#|%YB%iMP6JtS%
z*2dRnbjt*!nCX8DUQW3m`7Z@81b`9Ot2;vlDSTr$EOoz_JW(1n0hE?DAL6nfs0gv!
z4~$zGejDTFA+&S0TKRKuq(;z=Fd8^Kr0@xE+xfj^uHw+zP7a0F)!5~+^BZ1!!WdZy
z05(}~9oS@^kV1#zDC8h5u&(^!Ibz^8=FPhXkJjN$j+pC^eAC4sMiRj;mMvq-@rtk_d{$ul1a3NcuG<&R4
zNPzO9>eH2Zj|y(!-R*EiwAJdPnRoW=34KPcGaz3uzW}l&K>~)1YjSrx)COD^_0_ZH
ziE2u9i2JpSZUVox4ABu*45EybwTavZ29gUbC0~y4_KF}$l3V2dE?b8{xyLm?SjMfn
z7wj_EDI#-{J-}mX_0WkZI#{7)tMY)
zSLE-6>o|U9bv&SqoSp(?!m;Yn#QX4a;S_mpPmWRQN1VJ!I6kIv@^a{@cR73L`g7|-
zxMP0C>Ua5qb{vx2TM&tB6wtyRx_?^uRuTe9Ht_#jpLXl!Is5Nx3z1}fpgw!attmj=
zEqvP@|E1SEnE0a=J=ByDZnq^bYn?PtI0Tfp2q-uETd$$DC+kK=KKAAiGoN2uB6~(g&Du_XBEBnbFz^S
zA-8oJ6&gy2qatdZkYMr^;iAE>-bA--R9;@fB9I{JdM`9Mc%
zg-cUVb>(LmKNR)5A;*2D;e59HjD_$lseLA%*!C19AVo^+g(;BYjjVwdMSexXA=Pjm
z3<{E9I5m5VgggOt<+Nco6b-xE_ZpPOA_`}TpC||$Tdc^;ZGmw8%iZ2gVupv+sEaAa
zWQ4mIAfD*Weh>|;G_w~X1M{{DVLTepv7+Se(x3o;69#6WV@Zw-kzpahFx2d8BJVK&
z9sN4C2FZQik*|z=G?w7K35d@%DLpjXMyPZAuGkps&gSOqX
zLWJB$t@)itWOHo!LgG`Y5$HCtMQR-%5|8eQBmd
zENo+q_~u_Nj5&DxZcvQl{WG?5NC9~
z*j|-Df1HHgu(h9@xkEAtNK>r4lk${cMF%4takqsLUc!Wok!7-|bvc$3^
zhNH^s0_G!`FV-QJ&g3o-km1j5fv};;X35T@#5)kwD^5luX0?66@h;%d5ohsda`dG;
zQZuy$A`;IsHy!d0I`B8;WO?t_Ogk%cn#H&*2v?I~MzakowNOTyDdDvdve%_#P--Wn
z(ku@^)Rzs^VnsGj;#>w9G+Vh74
zmiko@+#c_@8gxbNN~&0>QA$#HTId1<9Lgzth>NpFBGVL3)|G)Ja;90$O#eiXmB6si
zPgw*iv|oJF!!7owFsUKfj{x)~6BTWhs^iRe!-+ylgIWl$Nc0>+Q(2dn4YOgu&Kz>I
zBZ0rRo!s4_1+r108|cuwEnV0MtqI?{10=xR$jPLvEtEd+T`G_v8KKF^dGH-^Ee_+=
zsuwT)egOC0hJF7Z7XQ$JH-4jJ@6S4Vjq4%Asa85W84O>YPM{Xn`|^x
z8uoaerzKS^m(-sUzZz3K$yYJ0!)b~SDoC?k-TLt->J}yV`Ktf30eaY~c%@MCyDtq&
z?mc=FlOC(@PDP#H50X{dbhy
zUqT@bD98kvRT?!gV1q=EzA3#PRew`U&vFed8>GdGZq`H%pvW*u_AB{M)3@?4+<^he
z6v*seh{%9)h;F_PpnLq`|5g?8(G*PiXxem)opn-F%UtuT^Z)0~&eCv>48L?aaw{)w&16j>ThvHKZ3(K4wbnQ&g8gq)XGL>D}}i
z(c&?*S~IpHHZR0tw&DEt1X&*>$Kq>Q^gNM0gM;B!v6t7{T`|1#$x_Ydp)ia9IVM-#
zwI?*NtO*XX*-<|J5bLW7hO^)}$vh;^f5&B!Vix~GH3fk5&8nc(VmWo~MN)r*8E=sa
zFw3TNjy3$kehSNid`FheEU-bNFQzBB`KH;(gb$Z)%}z#tg@y5zympJ`%o4SC$Q0(3S~8%6Gb^MKyF|
z#rCAnV3i6Ym-#44gWViqByz;+O1du%JdlfllM_10zn_dGoB&D)e*aDBZjOagJXla8
zY&@{nf+TDlW`o7xT^PF^C3dRV-&9C8YeDegw&Uy+blBR+@aEHh_swXiPJ#5c5%r&R
z%zx9#{^xY3(m~|1yT)!|SXCF5*4^lDN3?*7WEBD1b5n=8elIdm50yb;NG+~2uyzig
zfCNFn$pOQy-_u~%3`5ghZ
z_!4sGSlxRIczcR(A_F_d1Fy5*TcAGn7zO+d)~O+!Lu5_ppNLeJF@*??&6!h!MN~S8
zw@%YQFBQZvm%`3muE`z?h+a52`F#qpg&biLJMc%>rIGIeFZA!k3>u1rpETT|jT))3
z7s&v1#|G40bPgw{g^-r^2{R_3P7!
zqmDWSSG-SgybK~Nk@}a^w;KQ~v3gI-{Mk7$=sdbPl@shLbgX
z&_*0UDm;3zNUDMUSyo}=dXc!ePF0(+if?MsKJuL^0h#RiDuHK65KL&qt#&WO-UWr5
zRREC(ntD~<)b6=c_y+k5zI!vWDn@)EXm1`RAdWfC)k}+R2Bt*Tj(+`slf|9F@{US;
z)2Naf*$g!nrbZX=r07Ux2xM-iQvSvM?R~Fh<2nN2Ea0sPBNCy^vtZzgzFsjxYky5A
z38(H%C?R-HkgpGHC^WF47=RNa^j-_WC0x!n@|H`6P}~D$!G#b^
zi=#APp#e&Z11K$E$7o<8lRAZ1D&Vy`kcRptO;{q_F@JsxG>#hIJq1o_yLpwk>1$8c
z&ICBs)%v4nnyyxVY6}Fs7B}hfH>bjGuEn?)Si-7CfUSF#t|c1?fG;5F+cw*4#SRg^Kt(Xw2NK@2k?ajT0wHBAh-rJG>2uac?zRwUtUO%H8IZ>mKR_F0
zI|qx&6WH3a+YdPwMi}W^M=80CXp6Q&xdgq|Fs7N_;Jca=XKI@m*?0Pi(4j)JHiJEj
zpR?GNOmG*%f5bJ(|x}`@89G1{e1tp&pmUT
z&UMb~Jg?{Tx~|vtI`bo*SScZ%q!_yOGHq`fD3d>Ltit0Kd
zwvC)kLW^rZ(-#$s0>`LtAL!CxRglwsX?7XbY%sw9Ea+{tp#UoTB!
z9%#VJdU2eLU3;e0nSeheu@7K=!&U%bJ|6lx%Sr#yBxIjVO0DB5OKVETr<=}QOG5JX
z(9fhnO>oS;;^d=O7uPb<8|qMmjtw}2efssBEt4p{}=Zn
z4BVrCo$xNT|90u%YgJvs6H^B6MQcu_xFMq4R{`ejQXkFFAmueXCq_84ogf6)#J>#Y
zq`w}h7nUJC!i$OOVp@)Qr5Dzxe>OA;$r_z3PIrOwE#OJX%zs{q?gJds%=S6!?T2S8
zEI!SP8Aq==$GWTMFoNn7A4b$>cvdg8yb~&5Cg*Ridv($Kr+%)M!Ohn~ch83Uf@g-7
zxp+?C^@4xrla|j}&66sx5}4bwhNBPeXWW-S4_Ich|B`@x!=Meg^2dMtqwvSD*t^Nd
zfkuMt;Xx0o6dz)zyFK@V8E~GLk1x9pccP5HKowx
z9JLsGNIk0Sv(N}u7bG0?(j{<=OUi>s|8lZS2E$y46XoJT!?!=1$U3_r!Qk9xg&?{S
zTUVd^;2j$Ahrx=h&X`nARWdk-zERz>%BmS_^-b{Qn$dy;y)ce5`wu~J(S|kt8)x>U
zehLS;V$t+tiu)haBKW1Fx-!f*MMbqwzXmcFvJexi7smU(SjEHKm~m_JNRil+Aksn(
zd5c+%GVha00t&~;nZ5XUKLi+f{X}^=>|*Oe?jz)%_P^Y(i{{Mk5$iCB@wN#S2Q(kq
zAS^-O4t?+!0ctP)QsPwxC61&%0NUMGI%3)ZZu+$l-r!%}FITvFc1p{yLpGP@0)Prw
z$*SlEzEy&naDAA2wR?i?0i^tR*R%IN%`3W`SrRAcrVltl3TZznp$W7_RtDOkj^HDe
zE154j@5!4#6^D9%***
zPJW#!Gog0BJ&N_}NsVUGEnFK8)`;X-h*g=16ufH0sU-1J>p;hopzN@HU!Jgf)1idkg&rP9j5YT4M!jQhO>T=sah3zWyVC
zz9PfKqZ#7E9ASyRAPy}~hO3#63#O|=QDjKebd$JQkk@UM5=&D
zcX3Iie>VtD!evLE&l(aO336OGO{h*Cz@tt;c#FVketodenuc{O0=S&BJ
zvdtBF=%wL+27Bx?P1)?x$9&RV`cr!x*PSY6-<8?)*m?X=glNG;g*-$8yobE)vbxIU
zBCqV#H=iI!9n*dE5z!y#KWP&VyM{MCRzSN{aWr>$G>{u!aU2@__>ieF1Xd2wV8+C#
zJos$RLc^rH%F~8%y=uf@TA{W|!I80oYCn80FC^qJ;=Fn$Bvh!^Af(DEbU*c~1?MM3}e8tUSeQcztjHhegxI#hJo>+tNwzRnAlM
z43WK(#YYjL_N?nwenxl#$}7%-gfFn{2y0!R1}FO|6xD7Z+NQ#}<{gZmJPYiFaR_Q-
zF58QQ;0wLC&S_$g2t^~r=|o7FSjv3Oy$0X!>IN)<-x(&iRX7)PENAMw$Glm6h39r2S-DR}q<6PqSBq@C-j=6Z=3TugaY4B6nf
z<|Bf%kFYP5MugQukUIF2ALCgWrn(dvrlQ!vE|qo&**{qm>k-S1!^FZw&0fOkm~^!=
z7P@JP{|8u@RpSZqsP*Y^u#^==DM{Z<3R$|35RKtfHoglRX^6mt_4Y=JqGtwj|Q?NlJ>rjRg)3l~r=PP`Pney^(7zk}xh25;7T%_|u1NKg*4WTIkv9e2AIh=gOfZ&*kcZA|rhF0A(LvHfzla)O7k2MFWVIKtU+iE1eFRvk
zpG!R|+7|WTRX~t3f^RM9Lzv3`%TVqLZ`QEGai(YP*k!O%@J`yQ6c&04>tacmVT!q2
zLu^cO#zhwG_OPjZRG13as4xPvDvto4lvJIx?%LmZ)?7J$R4bJ=ijZ0&r|)wRLSID1
zSTFkkH_#6FI>N%LFsA?|C*Z9he-UoPUG)VTroum}j=)3=&q7r(O)hsMB{csv71$3W
zcSQ6~fv0TqV-iA7XJ0Io!u-7TVIdtMmb4;e;Ap^GQWmJ0^SSZU)vudiiH^&
zOY4l8QlCF-`*507?waBePqALLTM@KE`vZxm0&W*kXelizKN2*1hr}_fFwuZsObDia
z6B9O4TAjlbb~v%r=Pb)V!#2d97}glL5>>33B3v_M&v2qBPSih6D31$+QJQ{uaM04bszCi=cu9ZvR{4g3fp
z8#=hC2eL6-RulnTc5Y@#i9LE}`pb=Ayqb^Geg^58vHpdG;H0f;6S>6j!wP~jY)PF9
zK7w>aOs4=tUxbiNr_QL%aKZbn!>Bmmu7e2djTJE}U30CNk9zs>zz^+Awm
zPRBKSs9c_Ok@|ToRomSo0#dRnIV?Li7>pu`4F_aAnz($>{!ek(Aki9u6dbG8ZNwx6
z*|7-iw^Or)lRvRfh#Di=v^Gqb?>ZRxIX)3zD>?9pwlZwU;0CTyr>zKMzPO>8!GNM(
zYgXQqcjv`Z2IB8zhP19+a@2mxKHDg>rL~#1o?t;*IoJ0%72&QL$B%}x+X|DB^wL2MdkyVDAvI=RzZ`Mv5hzAjXvdR2>eb$=gK4#m{8ht^DA-8tq6Nzc)A
zk2x}GA_a&0Ly-|AFFqK&!M1+WWQK#&CS6BeAOH3^GW54?;KlSWzNnDH?WU@%m^NPw
zM_PR@Y3=TKHIOE~57w5hPwAwNP#+U`s2FbO8kC;SvRHEh^HcRh7bavunPce$vLW!e
zm}bf!(Tbtq5#5iowSk!Q9Ko1Ti1DN_(ou1?a4>D>@f-oc_l_@L-*n%U=
z?@gqK#T3saF_GIYCmfk&sFSrk095;t`M>Hk;wn6T8xyfJX9U4C$u(WxI)L)vUCi3_Bj)M#cs+|#andd|v>R43$s|za*LLuc+H!1GivmFTxmY5X35^x*n
zOG;ykstlls1h+Tfs+BuynEtAhW%r(w8MrOo>uHBhv_b=~Bb#nU-y#dO=ag1K6r%%g{sU>ao&8F|3?Dx%x=O7iFVtbofm!(2xMLz26yCX
zrKpY-l*_{NR(>Bwz=3<^BH_Tjlttho6~M$3VB*Bf2};DVn3?uw&3J@Pi4PG12SWde
zPQt#l5KP0T#1;r*nETTxG-dYC{Zdhh;sg|_Bt2hP!bDT$3;|wUjl_dtl;z@CyDP%{
zWusyq8u}}sx_lql`YVYr13TFFRMq#SOD`Q9Mjtm-*al%|5qNA!Un(ziLuK9ftuPwk
zW(wHzv1mVrAs+iD&t}0!a1iZUXT2~nf$D@=ts;(8x^3+ZHQp1mkV3j*9}Il)1tGMIi6<
zzj2A-DP2~R!s94Rti)`fH52(_X&dxJ(Jg2g`G)Zv9sojN?hk{{J1;{4EY2b;L+wTa
zKMl=#2+Ft_?Pt;6(H>Igs);9g*{$6{DOl7mXqo{kYk4d
z3EnlL_5Cp%TH>s>>lw0bRAPG`Q6{x;gpH7V?t8sBPDEx?p5_?6X8Z+E?G{dHq<(M5
zt@rWXcKz;7(C$oq&0bH?R&o$bWjAL>U@GXOt77A}gb=bjey>@r+jF2*cE^Z3V`jYP
zmxz9Ty?Y(+XLZZp;%6X+G9=qR)C>J{QmO9!qe9qL?dS9q^6s(9g^9VbfjhIKJzGkh
zw-#le^V!ZBS`H>|SZs_1I={*Bt30Z>J-+5qd_!I7uH8qqR9E&uS>x|!_1K!CLw6$O
zw@)5da6akM)mZNQ>^BiI@|)+w_mPf75h0V-I@$Qg(kU*lVV-8$=>hC?v0?F7k186Z
zSFf|7)-?7L
z;1wPap|NWJN=QnOo#e42b&nMxXx$p2LM;K8>&PHiq3x#+o0KtuEC*KP3vH^84)eus
z{*0Ag4<{{}34(2f0dvsESK@%mA=bRanV+Hc7{lHDP!hP86(NWY_2CT()>zoML&5C?
zDxQd@4FmnOIEHpKNKk2yDOTnr;pG-Ri4;e0&GW$-4F?2z~s4o}2E0a}ID&7Sd
zh%sc!;~QIP0w%x#@2KEnWTw60p&b2M=uv-RtKZe(
z$uk+e=m?3rjbnO}XxgZiq7u-7>MMBc#oyh{9(0o5+Z*bPj0g;$NAkq@O)Of=iUB?RRU<&Gd#oMR3j=_am~)yg9Hj*D{V72N1Q@HZB@)jjYFLBG|#
zbK&5AfD2zgFl$-OCBXlK(pyG7m$b@|(<1{vq+*&i
zCFSCONE7^@?phNsd*^M>$s~E`DSw?N{_2z)wpmTvdqkNhPM+IMBB`DNuNb|USpTxs
z`~J$e-5r``A?wf&kz)tQ^~L^_N>)M#2z>pBn0a=S$Llac9Da8c#nAyo)w_U{z1E>
zFM8|CYk-w=12wU9kKBb>C#G=w0P;;8We)CD7!FOF&46>qhP2Mjn`o1f1cb~C1mNYz
z?QnWk>rx^M4h?O7$Ai*^awl2M;)0zQl%fxW47|Xg$|YK;hsFxTLg}RtoLsYCURHn>
zJ1QrvohZW%9NUx;?0@mz$M&P1gcBMwv5Z{_I7p%6$X*sORKt~_+A#pdaBn7HQ_{OX
z8$Y)+s;H((?toXhZAlz7&5PGD%80v5l#{?ZuS3ATUet4kN_ZBK#%yPCno=pc|T@DQ&c{4v4iwbvcs)lCc
z;qkTFxPPJ)+6@q;P^9wKCdlT<^|J7JA|31OBH1j@bjT@)1kU(YRnzcZem-
zl(p|_Izl5oM?){fTNB_|O&-W8_~EI;dX
z^~pYY=f>LUv!zRKyOX*OgtRO0-_l?_Mn2!W^abM`;Yj+zi(+BE_{$)O;Dn%b@c!ED
zs0Q_cT1zzQi{0(N4>Ik63D(<6T>=^|HvFMVdjvY8n{#N
zAk}YM)uY43a3U{4=@^%akN^04+Xvw9!P90e;jTi+ege9}1CtPJeW2-<#ekn^FA)ms
zCqT}mbB&=WfSJeo3B~Km?18T7pN#hIQr$q5+~Tlsy%=)GRcKwfLW^E0a;wU2dGD8d
z=97`Z^n)E|^J?y9A_rfD^&Oa6lcuhju1$r)`Rd0&fZUz?+Eh;+m$SX3VvwSu&;dWg
z`i!d7mmIRh-|glbHE?`UZ7f$J@cF%hlkYTaDO;%eubhL58`cOHWskk1`^1nOmxlc}
z^QOlkWNfd+$xt^5OH~#`m~+jyKe^hVU{R!q;Hw{{;N{)@$1}}XhT!Ntra6V*$=p;@
zU#Eb?g1|RLR^|rini`d)e2U-AiO1p)bEp-?ABFEd4#%hmpf1m5(Q5N$Uk)k8gsa_o
zGtXl0?CyV$wdwQls_6YwQlZr~S1-6PnsLPB(p*`Dn!Z