├── .github └── workflows │ └── dotnet.yml ├── .gitignore ├── BffAuth0.Server.sln ├── LICENSE ├── README.md ├── server ├── BffAuth0.Server.csproj ├── Controllers │ ├── AccountController.cs │ ├── DirectApiController.cs │ └── UserController.cs ├── Models │ ├── ClaimValue.cs │ └── UserInfo.cs ├── Pages │ ├── Error.cshtml │ ├── Error.cshtml.cs │ └── _Host.cshtml ├── Program.cs ├── Properties │ └── launchSettings.json ├── SecurityHeadersDefinitions.cs ├── Services │ ├── ApplicationBuilderExtensions.cs │ └── EndpointRouteBuilderExtensions.cs ├── appsettings.Development.json ├── appsettings.json └── wwwroot │ ├── 3rdpartylicenses.txt │ ├── favicon.ico │ ├── index.html │ ├── main.82ae5f44278f2c53.js │ ├── polyfills.e11222d749c4225c.js │ ├── runtime.03d9a510341a847f.js │ ├── scripts.1ac6d0d02f230370.js │ └── styles.68dcd7308a413073.css └── ui ├── .eslintignore ├── .eslintrc.base.json ├── .eslintrc.json ├── .gitignore ├── .prettierignore ├── .prettierrc ├── .vscode ├── extensions.json └── settings.json ├── README.md ├── certs ├── Readme.md ├── dev_localhost.key └── dev_localhost.pem ├── e2e ├── .eslintrc.json ├── playwright.config.ts ├── project.json └── src │ └── example.spec.ts ├── jest.config.ts ├── jest.preset.js ├── migrations.json ├── nx.json ├── package-lock.json ├── package.json ├── project.json ├── src ├── app │ ├── app.component.html │ ├── app.component.scss │ ├── app.component.spec.ts │ ├── app.component.ts │ ├── app.config.ts │ ├── app.routes.ts │ ├── call-api │ │ ├── call-api.component.html │ │ ├── call-api.component.scss │ │ ├── call-api.component.spec.ts │ │ └── call-api.component.ts │ ├── getCookie.ts │ ├── home.component.html │ ├── home.component.ts │ └── secure-api.interceptor.ts ├── assets │ └── .gitkeep ├── favicon.ico ├── index.html ├── main.ts ├── styles.scss └── test-setup.ts ├── tsconfig.app.json ├── tsconfig.editor.json ├── tsconfig.json └── tsconfig.spec.json /.github/workflows/dotnet.yml: -------------------------------------------------------------------------------- 1 | 2 | name: .NET and npm build 3 | 4 | on: 5 | push: 6 | branches: [ "main" ] 7 | pull_request: 8 | branches: [ "main" ] 9 | 10 | jobs: 11 | build: 12 | runs-on: ubuntu-latest 13 | 14 | steps: 15 | 16 | - uses: actions/checkout@v4 17 | - name: Setup .NET 18 | uses: actions/setup-dotnet@v4 19 | with: 20 | dotnet-version: 9.0.x 21 | 22 | - name: Restore dependencies 23 | run: dotnet restore 24 | 25 | - name: npm setup 26 | working-directory: ui 27 | run: npm install --force 28 | 29 | - name: ui-nx-build 30 | working-directory: ui 31 | run: npm run build 32 | 33 | - name: Build 34 | run: dotnet build --no-restore 35 | - name: Test 36 | run: dotnet test --no-build --verbosity normal 37 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | ## 4 | ## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore 5 | 6 | # User-specific files 7 | *.rsuser 8 | *.suo 9 | *.user 10 | *.userosscache 11 | *.sln.docstates 12 | 13 | # User-specific files (MonoDevelop/Xamarin Studio) 14 | *.userprefs 15 | 16 | # Mono auto generated files 17 | mono_crash.* 18 | 19 | # Build results 20 | [Dd]ebug/ 21 | [Dd]ebugPublic/ 22 | [Rr]elease/ 23 | [Rr]eleases/ 24 | x64/ 25 | x86/ 26 | [Ww][Ii][Nn]32/ 27 | [Aa][Rr][Mm]/ 28 | [Aa][Rr][Mm]64/ 29 | bld/ 30 | [Bb]in/ 31 | [Oo]bj/ 32 | [Ll]og/ 33 | [Ll]ogs/ 34 | 35 | # Visual Studio 2015/2017 cache/options directory 36 | .vs/ 37 | # Uncomment if you have tasks that create the project's static files in wwwroot 38 | #wwwroot/ 39 | 40 | # Visual Studio 2017 auto generated files 41 | Generated\ Files/ 42 | 43 | # MSTest test Results 44 | [Tt]est[Rr]esult*/ 45 | [Bb]uild[Ll]og.* 46 | 47 | # NUnit 48 | *.VisualState.xml 49 | TestResult.xml 50 | nunit-*.xml 51 | 52 | # Build Results of an ATL Project 53 | [Dd]ebugPS/ 54 | [Rr]eleasePS/ 55 | dlldata.c 56 | 57 | # Benchmark Results 58 | BenchmarkDotNet.Artifacts/ 59 | 60 | # .NET Core 61 | project.lock.json 62 | project.fragment.lock.json 63 | artifacts/ 64 | 65 | # ASP.NET Scaffolding 66 | ScaffoldingReadMe.txt 67 | 68 | # StyleCop 69 | StyleCopReport.xml 70 | 71 | # Files built by Visual Studio 72 | *_i.c 73 | *_p.c 74 | *_h.h 75 | *.ilk 76 | *.meta 77 | *.obj 78 | *.iobj 79 | *.pch 80 | *.pdb 81 | *.ipdb 82 | *.pgc 83 | *.pgd 84 | *.rsp 85 | *.sbr 86 | *.tlb 87 | *.tli 88 | *.tlh 89 | *.tmp 90 | *.tmp_proj 91 | *_wpftmp.csproj 92 | *.log 93 | *.tlog 94 | *.vspscc 95 | *.vssscc 96 | .builds 97 | *.pidb 98 | *.svclog 99 | *.scc 100 | 101 | # Chutzpah Test files 102 | _Chutzpah* 103 | 104 | # Visual C++ cache files 105 | ipch/ 106 | *.aps 107 | *.ncb 108 | *.opendb 109 | *.opensdf 110 | *.sdf 111 | *.cachefile 112 | *.VC.db 113 | *.VC.VC.opendb 114 | 115 | # Visual Studio profiler 116 | *.psess 117 | *.vsp 118 | *.vspx 119 | *.sap 120 | 121 | # Visual Studio Trace Files 122 | *.e2e 123 | 124 | # TFS 2012 Local Workspace 125 | $tf/ 126 | 127 | # Guidance Automation Toolkit 128 | *.gpState 129 | 130 | # ReSharper is a .NET coding add-in 131 | _ReSharper*/ 132 | *.[Rr]e[Ss]harper 133 | *.DotSettings.user 134 | 135 | # TeamCity is a build add-in 136 | _TeamCity* 137 | 138 | # DotCover is a Code Coverage Tool 139 | *.dotCover 140 | 141 | # AxoCover is a Code Coverage Tool 142 | .axoCover/* 143 | !.axoCover/settings.json 144 | 145 | # Coverlet is a free, cross platform Code Coverage Tool 146 | coverage*.json 147 | coverage*.xml 148 | coverage*.info 149 | 150 | # Visual Studio code coverage results 151 | *.coverage 152 | *.coveragexml 153 | 154 | # NCrunch 155 | _NCrunch_* 156 | .*crunch*.local.xml 157 | nCrunchTemp_* 158 | 159 | # MightyMoose 160 | *.mm.* 161 | AutoTest.Net/ 162 | 163 | # Web workbench (sass) 164 | .sass-cache/ 165 | 166 | # Installshield output folder 167 | [Ee]xpress/ 168 | 169 | # DocProject is a documentation generator add-in 170 | DocProject/buildhelp/ 171 | DocProject/Help/*.HxT 172 | DocProject/Help/*.HxC 173 | DocProject/Help/*.hhc 174 | DocProject/Help/*.hhk 175 | DocProject/Help/*.hhp 176 | DocProject/Help/Html2 177 | DocProject/Help/html 178 | 179 | # Click-Once directory 180 | publish/ 181 | 182 | # Publish Web Output 183 | *.[Pp]ublish.xml 184 | *.azurePubxml 185 | # Note: Comment the next line if you want to checkin your web deploy settings, 186 | # but database connection strings (with potential passwords) will be unencrypted 187 | *.pubxml 188 | *.publishproj 189 | 190 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 191 | # checkin your Azure Web App publish settings, but sensitive information contained 192 | # in these scripts will be unencrypted 193 | PublishScripts/ 194 | 195 | # NuGet Packages 196 | *.nupkg 197 | # NuGet Symbol Packages 198 | *.snupkg 199 | # The packages folder can be ignored because of Package Restore 200 | **/[Pp]ackages/* 201 | # except build/, which is used as an MSBuild target. 202 | !**/[Pp]ackages/build/ 203 | # Uncomment if necessary however generally it will be regenerated when needed 204 | #!**/[Pp]ackages/repositories.config 205 | # NuGet v3's project.json files produces more ignorable files 206 | *.nuget.props 207 | *.nuget.targets 208 | 209 | # Microsoft Azure Build Output 210 | csx/ 211 | *.build.csdef 212 | 213 | # Microsoft Azure Emulator 214 | ecf/ 215 | rcf/ 216 | 217 | # Windows Store app package directories and files 218 | AppPackages/ 219 | BundleArtifacts/ 220 | Package.StoreAssociation.xml 221 | _pkginfo.txt 222 | *.appx 223 | *.appxbundle 224 | *.appxupload 225 | 226 | # Visual Studio cache files 227 | # files ending in .cache can be ignored 228 | *.[Cc]ache 229 | # but keep track of directories ending in .cache 230 | !?*.[Cc]ache/ 231 | 232 | # Others 233 | ClientBin/ 234 | ~$* 235 | *~ 236 | *.dbmdl 237 | *.dbproj.schemaview 238 | *.jfm 239 | *.pfx 240 | *.publishsettings 241 | orleans.codegen.cs 242 | 243 | # Including strong name files can present a security risk 244 | # (https://github.com/github/gitignore/pull/2483#issue-259490424) 245 | #*.snk 246 | 247 | # Since there are multiple workflows, uncomment next line to ignore bower_components 248 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 249 | #bower_components/ 250 | 251 | # RIA/Silverlight projects 252 | Generated_Code/ 253 | 254 | # Backup & report files from converting an old project file 255 | # to a newer Visual Studio version. Backup files are not needed, 256 | # because we have git ;-) 257 | _UpgradeReport_Files/ 258 | Backup*/ 259 | UpgradeLog*.XML 260 | UpgradeLog*.htm 261 | ServiceFabricBackup/ 262 | *.rptproj.bak 263 | 264 | # SQL Server files 265 | *.mdf 266 | *.ldf 267 | *.ndf 268 | 269 | # Business Intelligence projects 270 | *.rdl.data 271 | *.bim.layout 272 | *.bim_*.settings 273 | *.rptproj.rsuser 274 | *- [Bb]ackup.rdl 275 | *- [Bb]ackup ([0-9]).rdl 276 | *- [Bb]ackup ([0-9][0-9]).rdl 277 | 278 | # Microsoft Fakes 279 | FakesAssemblies/ 280 | 281 | # GhostDoc plugin setting file 282 | *.GhostDoc.xml 283 | 284 | # Node.js Tools for Visual Studio 285 | .ntvs_analysis.dat 286 | node_modules/ 287 | 288 | # Visual Studio 6 build log 289 | *.plg 290 | 291 | # Visual Studio 6 workspace options file 292 | *.opt 293 | 294 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) 295 | *.vbw 296 | 297 | # Visual Studio 6 auto-generated project file (contains which files were open etc.) 298 | *.vbp 299 | 300 | # Visual Studio 6 workspace and project file (working project files containing files to include in project) 301 | *.dsw 302 | *.dsp 303 | 304 | # Visual Studio 6 technical files 305 | *.ncb 306 | *.aps 307 | 308 | # Visual Studio LightSwitch build output 309 | **/*.HTMLClient/GeneratedArtifacts 310 | **/*.DesktopClient/GeneratedArtifacts 311 | **/*.DesktopClient/ModelManifest.xml 312 | **/*.Server/GeneratedArtifacts 313 | **/*.Server/ModelManifest.xml 314 | _Pvt_Extensions 315 | 316 | # Paket dependency manager 317 | .paket/paket.exe 318 | paket-files/ 319 | 320 | # FAKE - F# Make 321 | .fake/ 322 | 323 | # CodeRush personal settings 324 | .cr/personal 325 | 326 | # Python Tools for Visual Studio (PTVS) 327 | __pycache__/ 328 | *.pyc 329 | 330 | # Cake - Uncomment if you are using it 331 | # tools/** 332 | # !tools/packages.config 333 | 334 | # Tabs Studio 335 | *.tss 336 | 337 | # Telerik's JustMock configuration file 338 | *.jmconfig 339 | 340 | # BizTalk build output 341 | *.btp.cs 342 | *.btm.cs 343 | *.odx.cs 344 | *.xsd.cs 345 | 346 | # OpenCover UI analysis results 347 | OpenCover/ 348 | 349 | # Azure Stream Analytics local run output 350 | ASALocalRun/ 351 | 352 | # MSBuild Binary and Structured Log 353 | *.binlog 354 | 355 | # NVidia Nsight GPU debugger configuration file 356 | *.nvuser 357 | 358 | # MFractors (Xamarin productivity tool) working folder 359 | .mfractor/ 360 | 361 | # Local History for Visual Studio 362 | .localhistory/ 363 | 364 | # Visual Studio History (VSHistory) files 365 | .vshistory/ 366 | 367 | # BeatPulse healthcheck temp database 368 | healthchecksdb 369 | 370 | # Backup folder for Package Reference Convert tool in Visual Studio 2017 371 | MigrationBackup/ 372 | 373 | # Ionide (cross platform F# VS Code tools) working folder 374 | .ionide/ 375 | 376 | # Fody - auto-generated XML schema 377 | FodyWeavers.xsd 378 | 379 | # VS Code files for those working on multiple tools 380 | .vscode/* 381 | !.vscode/settings.json 382 | !.vscode/tasks.json 383 | !.vscode/launch.json 384 | !.vscode/extensions.json 385 | *.code-workspace 386 | 387 | # Local History for Visual Studio Code 388 | .history/ 389 | 390 | # Windows Installer files from build outputs 391 | *.cab 392 | *.msi 393 | *.msix 394 | *.msm 395 | *.msp 396 | 397 | # JetBrains Rider 398 | *.sln.iml 399 | -------------------------------------------------------------------------------- /BffAuth0.Server.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 17 4 | VisualStudioVersion = 17.6.33829.357 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BffAuth0.Server", "server\BffAuth0.Server.csproj", "{586272BB-19BC-4BAB-976F-5DC1E778257E}" 7 | EndProject 8 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{9D8FB767-F7A7-4A5B-A4E9-DC6DB6BCD941}" 9 | ProjectSection(SolutionItems) = preProject 10 | .github\workflows\dotnet.yml = .github\workflows\dotnet.yml 11 | README.md = README.md 12 | EndProjectSection 13 | EndProject 14 | Global 15 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 16 | Debug|Any CPU = Debug|Any CPU 17 | Release|Any CPU = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 20 | {586272BB-19BC-4BAB-976F-5DC1E778257E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 21 | {586272BB-19BC-4BAB-976F-5DC1E778257E}.Debug|Any CPU.Build.0 = Debug|Any CPU 22 | {586272BB-19BC-4BAB-976F-5DC1E778257E}.Release|Any CPU.ActiveCfg = Release|Any CPU 23 | {586272BB-19BC-4BAB-976F-5DC1E778257E}.Release|Any CPU.Build.0 = Release|Any CPU 24 | EndGlobalSection 25 | GlobalSection(SolutionProperties) = preSolution 26 | HideSolutionNode = FALSE 27 | EndGlobalSection 28 | GlobalSection(ExtensibilityGlobals) = postSolution 29 | SolutionGuid = {BD95AC6A-7177-42CE-AB6C-8BFF7958FDC2} 30 | EndGlobalSection 31 | EndGlobal 32 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright (c) 2023 damienbod 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Auth0 BFF security architecture using ASP.NET Core and nx Angular standalone 2 | 3 | [![.NET and npm build](https://github.com/damienbod/bff-auth0-aspnetcore-angular/actions/workflows/dotnet.yml/badge.svg)](https://github.com/damienbod/bff-auth0-aspnetcore-angular/actions/workflows/dotnet.yml) [![License](https://img.shields.io/badge/license-Apache%20License%202.0-blue.svg)](https://github.com/damienbod/bff-auth0-aspnetcore-angular/blob/main/LICENSE) 4 | 5 | [Secure Angular application using Auth0 and ASP.NET Core with BFF](https://damienbod.com/2023/09/18/secure-angular-application-using-auth0-and-asp-net-core-with-bff/) 6 | 7 | ## Debugging 8 | 9 | Start the Angular project from the **ui** folder 10 | 11 | ``` 12 | nx serve --ssl 13 | ``` 14 | 15 | Start the ASP.NET Core project from the **server** folder 16 | 17 | ``` 18 | dotnet run 19 | ``` 20 | 21 | Or just open Visual Studio and run the solution. 22 | 23 | ## Credits and used libraries 24 | 25 | - NetEscapades.AspNetCore.SecurityHeaders 26 | - Yarp.ReverseProxy 27 | - ASP.NET Core 28 | - Angular 29 | - Nx 30 | 31 | ## Angular nx Updates 32 | 33 | ``` 34 | nx migrate latest 35 | 36 | nx migrate --run-migrations=migrations.json 37 | ``` 38 | 39 | ## History 40 | 41 | - 2025-05-02 Update packages 42 | - 2025-02-08 Update packages 43 | - 2024-12-18 Angular 19 44 | - 2024-12-06 .NET 9 45 | - 2024-10-17 Improved security headers performance, updated packages 46 | - 2024-10-06 Updated Angular 18.2.7 47 | - 2024-10-03 Updated packages 48 | - 2024-06-06 Updated packages 49 | - 2024-04-27 Updated build 50 | - 2024-04-14 Updated packages 51 | - 2024-01-14 Updated packages 52 | - 2023-12-31 Open redirect protection added to login 53 | - 2023-11-17 Updated .NET 8 54 | 55 | ## Links 56 | 57 | https://github.com/damienbod/bff-aspnetcore-angular 58 | 59 | https://learn.microsoft.com/en-us/aspnet/core/introduction-to-aspnet-core 60 | 61 | https://nx.dev/getting-started/intro 62 | 63 | https://auth0.com/docs 64 | 65 | https://github.com/isolutionsag/aspnet-react-bff-proxy-example 66 | 67 | https://damienbod.com/2021/04/12/securing-blazor-web-assembly-using-cookies-and-auth0/ 68 | 69 | https://github.com/damienbod/bff-openiddict-aspnetcore-angular 70 | 71 | https://github.com/damienbod/bff-azureadb2c-aspnetcore-angular 72 | 73 | https://github.com/damienbod/bff-aspnetcore-vuejs 74 | 75 | https://github.com/damienbod/bff-MicrosoftEntraExternalID-aspnetcore-angular 76 | -------------------------------------------------------------------------------- /server/BffAuth0.Server.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net9.0 5 | enable 6 | enable 7 | 0dd44301-1358-4874-8431-7ee25d1e84fb 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /server/Controllers/AccountController.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Authentication; 2 | using Microsoft.AspNetCore.Authentication.Cookies; 3 | using Microsoft.AspNetCore.Authentication.OpenIdConnect; 4 | using Microsoft.AspNetCore.Authorization; 5 | using Microsoft.AspNetCore.Mvc; 6 | 7 | namespace BffAuth0.Server.Controllers; 8 | 9 | [Route("api/[controller]")] 10 | public class AccountController : ControllerBase 11 | { 12 | [HttpGet("Login")] 13 | public ActionResult Login(string? returnUrl, string? claimsChallenge) 14 | { 15 | var properties = GetAuthProperties(returnUrl); 16 | 17 | if (claimsChallenge != null) 18 | { 19 | string jsonString = claimsChallenge.Replace("\\", "").Trim('"'); 20 | 21 | properties.Items["claims"] = jsonString; 22 | } 23 | 24 | return Challenge(properties); 25 | } 26 | 27 | // [ValidateAntiForgeryToken] // not needed explicitly due the the Auto global definition. 28 | [IgnoreAntiforgeryToken] // need to apply this to the form post request 29 | [Authorize] 30 | [HttpPost("Logout")] 31 | public IActionResult Logout() 32 | { 33 | return SignOut( 34 | new AuthenticationProperties { RedirectUri = "/" }, 35 | CookieAuthenticationDefaults.AuthenticationScheme, 36 | OpenIdConnectDefaults.AuthenticationScheme); 37 | } 38 | 39 | /// 40 | /// Original src: 41 | /// https://github.com/dotnet/blazor-samples/blob/main/8.0/BlazorWebOidc/BlazorWebOidc/LoginLogoutEndpointRouteBuilderExtensions.cs 42 | /// 43 | private static AuthenticationProperties GetAuthProperties(string? returnUrl) 44 | { 45 | const string pathBase = "/"; 46 | 47 | // Prevent open redirects. 48 | if (string.IsNullOrEmpty(returnUrl)) 49 | { 50 | returnUrl = pathBase; 51 | } 52 | else if (!Uri.IsWellFormedUriString(returnUrl, UriKind.Relative)) 53 | { 54 | returnUrl = new Uri(returnUrl, UriKind.Absolute).PathAndQuery; 55 | } 56 | else if (returnUrl[0] != '/') 57 | { 58 | returnUrl = $"{pathBase}{returnUrl}"; 59 | } 60 | 61 | return new AuthenticationProperties { RedirectUri = returnUrl }; 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /server/Controllers/DirectApiController.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Authentication; 2 | using Microsoft.AspNetCore.Authentication.Cookies; 3 | using Microsoft.AspNetCore.Authorization; 4 | using Microsoft.AspNetCore.Mvc; 5 | 6 | namespace BffAuth0.Server.Controllers; 7 | 8 | [ValidateAntiForgeryToken] 9 | [Authorize(AuthenticationSchemes = CookieAuthenticationDefaults.AuthenticationScheme)] 10 | [ApiController] 11 | [Route("api/[controller]")] 12 | public class DirectApiController : ControllerBase 13 | { 14 | [HttpGet] 15 | public async Task> GetAsync() 16 | { 17 | // if you need a delegated access token for downstream APIs 18 | var accessToken = await HttpContext.GetTokenAsync("access_token"); 19 | 20 | return new List { "some data", "more data", "loads of data" }; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /server/Controllers/UserController.cs: -------------------------------------------------------------------------------- 1 | using BffAuth0.Server.Models; 2 | using Microsoft.AspNetCore.Authorization; 3 | using Microsoft.AspNetCore.Mvc; 4 | 5 | using System.Security.Claims; 6 | 7 | namespace BlazorBffOpenIDConnect.Server.Controllers; 8 | 9 | [Route("api/[controller]")] 10 | [ApiController] 11 | public class UserController : ControllerBase 12 | { 13 | [HttpGet] 14 | [AllowAnonymous] 15 | public IActionResult GetCurrentUser() => Ok(CreateUserInfo(User)); 16 | 17 | private static UserInfo CreateUserInfo(ClaimsPrincipal claimsPrincipal) 18 | { 19 | if (claimsPrincipal == null || claimsPrincipal.Identity == null 20 | || !claimsPrincipal.Identity.IsAuthenticated) 21 | { 22 | return UserInfo.Anonymous; 23 | } 24 | 25 | var userInfo = new UserInfo 26 | { 27 | IsAuthenticated = true 28 | }; 29 | 30 | if (claimsPrincipal.Identity is ClaimsIdentity claimsIdentity) 31 | { 32 | userInfo.NameClaimType = claimsIdentity.NameClaimType; 33 | userInfo.RoleClaimType = claimsIdentity.RoleClaimType; 34 | } 35 | else 36 | { 37 | userInfo.NameClaimType = ClaimTypes.Name; 38 | userInfo.RoleClaimType = ClaimTypes.Role; 39 | } 40 | 41 | if (claimsPrincipal.Claims?.Any() ?? false) 42 | { 43 | // Add just the name claim 44 | var claims = claimsPrincipal.FindAll(userInfo.NameClaimType) 45 | .Select(u => new ClaimValue(userInfo.NameClaimType, u.Value)) 46 | .ToList(); 47 | 48 | // Uncomment this code if you want to send additional claims to the client. 49 | //var claims = claimsPrincipal.Claims.Select(u => new ClaimValue(u.Type, u.Value)) 50 | // .ToList(); 51 | 52 | userInfo.Claims = claims; 53 | } 54 | 55 | return userInfo; 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /server/Models/ClaimValue.cs: -------------------------------------------------------------------------------- 1 | namespace BffAuth0.Server.Models; 2 | 3 | public class ClaimValue 4 | { 5 | public ClaimValue() 6 | { 7 | } 8 | 9 | public ClaimValue(string type, string value) 10 | { 11 | Type = type; 12 | Value = value; 13 | } 14 | 15 | public string Type { get; set; } = string.Empty; 16 | 17 | public string Value { get; set; } = string.Empty; 18 | } -------------------------------------------------------------------------------- /server/Models/UserInfo.cs: -------------------------------------------------------------------------------- 1 | namespace BffAuth0.Server.Models; 2 | 3 | public class UserInfo 4 | { 5 | public static readonly UserInfo Anonymous = new(); 6 | 7 | public bool IsAuthenticated { get; set; } 8 | 9 | public string NameClaimType { get; set; } = string.Empty; 10 | 11 | public string RoleClaimType { get; set; } = string.Empty; 12 | 13 | public ICollection Claims { get; set; } = new List(); 14 | } 15 | -------------------------------------------------------------------------------- /server/Pages/Error.cshtml: -------------------------------------------------------------------------------- 1 | @page 2 | @model BffAuth0.Server.Pages.ErrorModel 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | Error 11 | 12 | 13 | 14 |
15 |
16 |

Error.

17 |

An error occurred while processing your request.

18 | 19 | @if (Model.ShowRequestId) 20 | { 21 |

22 | Request ID: @Model.RequestId 23 |

24 | } 25 | 26 |

Development Mode

27 |

28 | Swapping to the Development environment displays detailed information about the error that occurred. 29 |

30 |

31 | The Development environment shouldn't be enabled for deployed applications. 32 | It can result in displaying sensitive information from exceptions to end users. 33 | For local debugging, enable the Development environment by setting the ASPNETCORE_ENVIRONMENT environment variable to Development 34 | and restarting the app. 35 |

36 |
37 |
38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /server/Pages/Error.cshtml.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Mvc; 2 | using Microsoft.AspNetCore.Mvc.RazorPages; 3 | using System.Diagnostics; 4 | 5 | namespace BffAuth0.Server.Pages; 6 | 7 | [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)] 8 | public class ErrorModel : PageModel 9 | { 10 | public string? RequestId { get; set; } 11 | 12 | public bool ShowRequestId => !string.IsNullOrEmpty(RequestId); 13 | 14 | public void OnGet() 15 | { 16 | RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /server/Pages/_Host.cshtml: -------------------------------------------------------------------------------- 1 | @page "/" 2 | @namespace BlazorBffAzureAD.Pages 3 | @using System.Net; 4 | @using NetEscapades.AspNetCore.SecurityHeaders; 5 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers 6 | @addTagHelper *, NetEscapades.AspNetCore.SecurityHeaders.TagHelpers 7 | @inject IHostEnvironment hostEnvironment 8 | @inject IConfiguration config 9 | @inject Microsoft.AspNetCore.Antiforgery.IAntiforgery antiForgery 10 | @{ 11 | Layout = null; 12 | 13 | var source = ""; 14 | if (hostEnvironment.IsDevelopment()) 15 | { 16 | var httpClient = new HttpClient(); 17 | source = await httpClient.GetStringAsync($"{config["UiDevServerUrl"]}/index.html"); 18 | } 19 | else 20 | { 21 | source = System.IO.File.ReadAllText($"{System.IO.Directory.GetCurrentDirectory()}{@"/wwwroot/index.html"}"); 22 | } 23 | 24 | var nonce = HttpContext.GetNonce(); 25 | 26 | // The nonce is passed to the client through the HTML to avoid sync issues between tabs 27 | source = source.Replace("**PLACEHOLDER_NONCE_SERVER**", nonce); 28 | 29 | if (hostEnvironment.IsDevelopment()) 30 | { 31 | // do nothing in development, Angular > 18.1.0 adds the nonce automatically 32 | } 33 | else 34 | { 35 | // Angular release build does not add any nonce to the scripts, so we need to add it manually 36 | var nonceScript = $" 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /server/wwwroot/polyfills.e11222d749c4225c.js: -------------------------------------------------------------------------------- 1 | "use strict";(self.webpackChunkui=self.webpackChunkui||[]).push([[461],{935:()=>{!function(t){const n=t.performance;function i(L){n&&n.mark&&n.mark(L)}function o(L,T){n&&n.measure&&n.measure(L,T)}i("Zone");const c=t.__Zone_symbol_prefix||"__zone_symbol__";function a(L){return c+L}const y=!0===t[a("forceDuplicateZoneCheck")];if(t.Zone){if(y||"function"!=typeof t.Zone.__symbol__)throw new Error("Zone already loaded.");return t.Zone}let d=(()=>{class L{static#e=this.__symbol__=a;static assertZonePatched(){if(t.Promise!==se.ZoneAwarePromise)throw new Error("Zone.js has detected that ZoneAwarePromise `(window|global).Promise` has been overwritten.\nMost likely cause is that a Promise polyfill has been loaded after Zone.js (Polyfilling Promise api is not necessary when zone.js is loaded. If you must load one, do so before loading zone.js.)")}static get root(){let e=L.current;for(;e.parent;)e=e.parent;return e}static get current(){return U.zone}static get currentTask(){return oe}static __load_patch(e,r,k=!1){if(se.hasOwnProperty(e)){if(!k&&y)throw Error("Already loaded patch: "+e)}else if(!t["__Zone_disable_"+e]){const C="Zone:"+e;i(C),se[e]=r(t,L,z),o(C,C)}}get parent(){return this._parent}get name(){return this._name}constructor(e,r){this._parent=e,this._name=r?r.name||"unnamed":"",this._properties=r&&r.properties||{},this._zoneDelegate=new v(this,this._parent&&this._parent._zoneDelegate,r)}get(e){const r=this.getZoneWith(e);if(r)return r._properties[e]}getZoneWith(e){let r=this;for(;r;){if(r._properties.hasOwnProperty(e))return r;r=r._parent}return null}fork(e){if(!e)throw new Error("ZoneSpec required!");return this._zoneDelegate.fork(this,e)}wrap(e,r){if("function"!=typeof e)throw new Error("Expecting function got: "+e);const k=this._zoneDelegate.intercept(this,e,r),C=this;return function(){return C.runGuarded(k,this,arguments,r)}}run(e,r,k,C){U={parent:U,zone:this};try{return this._zoneDelegate.invoke(this,e,r,k,C)}finally{U=U.parent}}runGuarded(e,r=null,k,C){U={parent:U,zone:this};try{try{return this._zoneDelegate.invoke(this,e,r,k,C)}catch($){if(this._zoneDelegate.handleError(this,$))throw $}}finally{U=U.parent}}runTask(e,r,k){if(e.zone!=this)throw new Error("A task can only be run in the zone of creation! (Creation: "+(e.zone||J).name+"; Execution: "+this.name+")");if(e.state===x&&(e.type===Q||e.type===P))return;const C=e.state!=E;C&&e._transitionTo(E,j),e.runCount++;const $=oe;oe=e,U={parent:U,zone:this};try{e.type==P&&e.data&&!e.data.isPeriodic&&(e.cancelFn=void 0);try{return this._zoneDelegate.invokeTask(this,e,r,k)}catch(u){if(this._zoneDelegate.handleError(this,u))throw u}}finally{e.state!==x&&e.state!==h&&(e.type==Q||e.data&&e.data.isPeriodic?C&&e._transitionTo(j,E):(e.runCount=0,this._updateTaskCount(e,-1),C&&e._transitionTo(x,E,x))),U=U.parent,oe=$}}scheduleTask(e){if(e.zone&&e.zone!==this){let k=this;for(;k;){if(k===e.zone)throw Error(`can not reschedule task to ${this.name} which is descendants of the original zone ${e.zone.name}`);k=k.parent}}e._transitionTo(X,x);const r=[];e._zoneDelegates=r,e._zone=this;try{e=this._zoneDelegate.scheduleTask(this,e)}catch(k){throw e._transitionTo(h,X,x),this._zoneDelegate.handleError(this,k),k}return e._zoneDelegates===r&&this._updateTaskCount(e,1),e.state==X&&e._transitionTo(j,X),e}scheduleMicroTask(e,r,k,C){return this.scheduleTask(new p(I,e,r,k,C,void 0))}scheduleMacroTask(e,r,k,C,$){return this.scheduleTask(new p(P,e,r,k,C,$))}scheduleEventTask(e,r,k,C,$){return this.scheduleTask(new p(Q,e,r,k,C,$))}cancelTask(e){if(e.zone!=this)throw new Error("A task can only be cancelled in the zone of creation! (Creation: "+(e.zone||J).name+"; Execution: "+this.name+")");if(e.state===j||e.state===E){e._transitionTo(G,j,E);try{this._zoneDelegate.cancelTask(this,e)}catch(r){throw e._transitionTo(h,G),this._zoneDelegate.handleError(this,r),r}return this._updateTaskCount(e,-1),e._transitionTo(x,G),e.runCount=0,e}}_updateTaskCount(e,r){const k=e._zoneDelegates;-1==r&&(e._zoneDelegates=null);for(let C=0;CL.hasTask(e,r),onScheduleTask:(L,T,e,r)=>L.scheduleTask(e,r),onInvokeTask:(L,T,e,r,k,C)=>L.invokeTask(e,r,k,C),onCancelTask:(L,T,e,r)=>L.cancelTask(e,r)};class v{constructor(T,e,r){this._taskCounts={microTask:0,macroTask:0,eventTask:0},this.zone=T,this._parentDelegate=e,this._forkZS=r&&(r&&r.onFork?r:e._forkZS),this._forkDlgt=r&&(r.onFork?e:e._forkDlgt),this._forkCurrZone=r&&(r.onFork?this.zone:e._forkCurrZone),this._interceptZS=r&&(r.onIntercept?r:e._interceptZS),this._interceptDlgt=r&&(r.onIntercept?e:e._interceptDlgt),this._interceptCurrZone=r&&(r.onIntercept?this.zone:e._interceptCurrZone),this._invokeZS=r&&(r.onInvoke?r:e._invokeZS),this._invokeDlgt=r&&(r.onInvoke?e:e._invokeDlgt),this._invokeCurrZone=r&&(r.onInvoke?this.zone:e._invokeCurrZone),this._handleErrorZS=r&&(r.onHandleError?r:e._handleErrorZS),this._handleErrorDlgt=r&&(r.onHandleError?e:e._handleErrorDlgt),this._handleErrorCurrZone=r&&(r.onHandleError?this.zone:e._handleErrorCurrZone),this._scheduleTaskZS=r&&(r.onScheduleTask?r:e._scheduleTaskZS),this._scheduleTaskDlgt=r&&(r.onScheduleTask?e:e._scheduleTaskDlgt),this._scheduleTaskCurrZone=r&&(r.onScheduleTask?this.zone:e._scheduleTaskCurrZone),this._invokeTaskZS=r&&(r.onInvokeTask?r:e._invokeTaskZS),this._invokeTaskDlgt=r&&(r.onInvokeTask?e:e._invokeTaskDlgt),this._invokeTaskCurrZone=r&&(r.onInvokeTask?this.zone:e._invokeTaskCurrZone),this._cancelTaskZS=r&&(r.onCancelTask?r:e._cancelTaskZS),this._cancelTaskDlgt=r&&(r.onCancelTask?e:e._cancelTaskDlgt),this._cancelTaskCurrZone=r&&(r.onCancelTask?this.zone:e._cancelTaskCurrZone),this._hasTaskZS=null,this._hasTaskDlgt=null,this._hasTaskDlgtOwner=null,this._hasTaskCurrZone=null;const k=r&&r.onHasTask;(k||e&&e._hasTaskZS)&&(this._hasTaskZS=k?r:b,this._hasTaskDlgt=e,this._hasTaskDlgtOwner=this,this._hasTaskCurrZone=T,r.onScheduleTask||(this._scheduleTaskZS=b,this._scheduleTaskDlgt=e,this._scheduleTaskCurrZone=this.zone),r.onInvokeTask||(this._invokeTaskZS=b,this._invokeTaskDlgt=e,this._invokeTaskCurrZone=this.zone),r.onCancelTask||(this._cancelTaskZS=b,this._cancelTaskDlgt=e,this._cancelTaskCurrZone=this.zone))}fork(T,e){return this._forkZS?this._forkZS.onFork(this._forkDlgt,this.zone,T,e):new d(T,e)}intercept(T,e,r){return this._interceptZS?this._interceptZS.onIntercept(this._interceptDlgt,this._interceptCurrZone,T,e,r):e}invoke(T,e,r,k,C){return this._invokeZS?this._invokeZS.onInvoke(this._invokeDlgt,this._invokeCurrZone,T,e,r,k,C):e.apply(r,k)}handleError(T,e){return!this._handleErrorZS||this._handleErrorZS.onHandleError(this._handleErrorDlgt,this._handleErrorCurrZone,T,e)}scheduleTask(T,e){let r=e;if(this._scheduleTaskZS)this._hasTaskZS&&r._zoneDelegates.push(this._hasTaskDlgtOwner),r=this._scheduleTaskZS.onScheduleTask(this._scheduleTaskDlgt,this._scheduleTaskCurrZone,T,e),r||(r=e);else if(e.scheduleFn)e.scheduleFn(e);else{if(e.type!=I)throw new Error("Task is missing scheduleFn.");R(e)}return r}invokeTask(T,e,r,k){return this._invokeTaskZS?this._invokeTaskZS.onInvokeTask(this._invokeTaskDlgt,this._invokeTaskCurrZone,T,e,r,k):e.callback.apply(r,k)}cancelTask(T,e){let r;if(this._cancelTaskZS)r=this._cancelTaskZS.onCancelTask(this._cancelTaskDlgt,this._cancelTaskCurrZone,T,e);else{if(!e.cancelFn)throw Error("Task is not cancelable");r=e.cancelFn(e)}return r}hasTask(T,e){try{this._hasTaskZS&&this._hasTaskZS.onHasTask(this._hasTaskDlgt,this._hasTaskCurrZone,T,e)}catch(r){this.handleError(T,r)}}_updateTaskCount(T,e){const r=this._taskCounts,k=r[T],C=r[T]=k+e;if(C<0)throw new Error("More tasks executed then were scheduled.");0!=k&&0!=C||this.hasTask(this.zone,{microTask:r.microTask>0,macroTask:r.macroTask>0,eventTask:r.eventTask>0,change:T})}}class p{constructor(T,e,r,k,C,$){if(this._zone=null,this.runCount=0,this._zoneDelegates=null,this._state="notScheduled",this.type=T,this.source=e,this.data=k,this.scheduleFn=C,this.cancelFn=$,!r)throw new Error("callback is not defined");this.callback=r;const u=this;this.invoke=T===Q&&k&&k.useG?p.invokeTask:function(){return p.invokeTask.call(t,u,this,arguments)}}static invokeTask(T,e,r){T||(T=this),te++;try{return T.runCount++,T.zone.runTask(T,e,r)}finally{1==te&&_(),te--}}get zone(){return this._zone}get state(){return this._state}cancelScheduleRequest(){this._transitionTo(x,X)}_transitionTo(T,e,r){if(this._state!==e&&this._state!==r)throw new Error(`${this.type} '${this.source}': can not transition to '${T}', expecting state '${e}'${r?" or '"+r+"'":""}, was '${this._state}'.`);this._state=T,T==x&&(this._zoneDelegates=null)}toString(){return this.data&&typeof this.data.handleId<"u"?this.data.handleId.toString():Object.prototype.toString.call(this)}toJSON(){return{type:this.type,state:this.state,source:this.source,zone:this.zone.name,runCount:this.runCount}}}const M=a("setTimeout"),O=a("Promise"),N=a("then");let K,B=[],H=!1;function q(L){if(K||t[O]&&(K=t[O].resolve(0)),K){let T=K[N];T||(T=K.then),T.call(K,L)}else t[M](L,0)}function R(L){0===te&&0===B.length&&q(_),L&&B.push(L)}function _(){if(!H){for(H=!0;B.length;){const L=B;B=[];for(let T=0;TU,onUnhandledError:W,microtaskDrainDone:W,scheduleMicroTask:R,showUncaughtError:()=>!d[a("ignoreConsoleErrorUncaughtError")],patchEventTarget:()=>[],patchOnProperties:W,patchMethod:()=>W,bindArguments:()=>[],patchThen:()=>W,patchMacroTask:()=>W,patchEventPrototype:()=>W,isIEOrEdge:()=>!1,getGlobalObjects:()=>{},ObjectDefineProperty:()=>W,ObjectGetOwnPropertyDescriptor:()=>{},ObjectCreate:()=>{},ArraySlice:()=>[],patchClass:()=>W,wrapWithCurrentZone:()=>W,filterProperties:()=>[],attachOriginToPatched:()=>W,_redefineProperty:()=>W,patchCallbacks:()=>W,nativeScheduleMicroTask:q};let U={parent:null,zone:new d(null,null)},oe=null,te=0;function W(){}o("Zone","Zone"),t.Zone=d}(globalThis);const fe=Object.getOwnPropertyDescriptor,pe=Object.defineProperty,be=Object.getPrototypeOf,De=Object.create,ct=Array.prototype.slice,Ze="addEventListener",Oe="removeEventListener",Ne=Zone.__symbol__(Ze),Ie=Zone.__symbol__(Oe),ce="true",ae="false",me=Zone.__symbol__("");function Me(t,n){return Zone.current.wrap(t,n)}function Le(t,n,i,o,c){return Zone.current.scheduleMacroTask(t,n,i,o,c)}const A=Zone.__symbol__,Pe=typeof window<"u",_e=Pe?window:void 0,Y=Pe&&_e||globalThis,at="removeAttribute";function je(t,n){for(let i=t.length-1;i>=0;i--)"function"==typeof t[i]&&(t[i]=Me(t[i],n+"_"+i));return t}function Fe(t){return!t||!1!==t.writable&&!("function"==typeof t.get&&typeof t.set>"u")}const Be=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope,we=!("nw"in Y)&&typeof Y.process<"u"&&"[object process]"==={}.toString.call(Y.process),Ae=!we&&!Be&&!(!Pe||!_e.HTMLElement),Ue=typeof Y.process<"u"&&"[object process]"==={}.toString.call(Y.process)&&!Be&&!(!Pe||!_e.HTMLElement),Re={},We=function(t){if(!(t=t||Y.event))return;let n=Re[t.type];n||(n=Re[t.type]=A("ON_PROPERTY"+t.type));const i=this||t.target||Y,o=i[n];let c;return Ae&&i===_e&&"error"===t.type?(c=o&&o.call(this,t.message,t.filename,t.lineno,t.colno,t.error),!0===c&&t.preventDefault()):(c=o&&o.apply(this,arguments),null!=c&&!c&&t.preventDefault()),c};function qe(t,n,i){let o=fe(t,n);if(!o&&i&&fe(i,n)&&(o={enumerable:!0,configurable:!0}),!o||!o.configurable)return;const c=A("on"+n+"patched");if(t.hasOwnProperty(c)&&t[c])return;delete o.writable,delete o.value;const a=o.get,y=o.set,d=n.slice(2);let b=Re[d];b||(b=Re[d]=A("ON_PROPERTY"+d)),o.set=function(v){let p=this;!p&&t===Y&&(p=Y),p&&("function"==typeof p[b]&&p.removeEventListener(d,We),y&&y.call(p,null),p[b]=v,"function"==typeof v&&p.addEventListener(d,We,!1))},o.get=function(){let v=this;if(!v&&t===Y&&(v=Y),!v)return null;const p=v[b];if(p)return p;if(a){let M=a.call(this);if(M)return o.set.call(this,M),"function"==typeof v[at]&&v.removeAttribute(n),M}return null},pe(t,n,o),t[c]=!0}function Xe(t,n,i){if(n)for(let o=0;ofunction(y,d){const b=i(y,d);return b.cbIdx>=0&&"function"==typeof d[b.cbIdx]?Le(b.name,d[b.cbIdx],b,c):a.apply(y,d)})}function ue(t,n){t[A("OriginalDelegate")]=n}let ze=!1,He=!1;function ht(){if(ze)return He;ze=!0;try{const t=_e.navigator.userAgent;(-1!==t.indexOf("MSIE ")||-1!==t.indexOf("Trident/")||-1!==t.indexOf("Edge/"))&&(He=!0)}catch{}return He}Zone.__load_patch("ZoneAwarePromise",(t,n,i)=>{const o=Object.getOwnPropertyDescriptor,c=Object.defineProperty,y=i.symbol,d=[],b=!1!==t[y("DISABLE_WRAPPING_UNCAUGHT_PROMISE_REJECTION")],v=y("Promise"),p=y("then"),M="__creationTrace__";i.onUnhandledError=u=>{if(i.showUncaughtError()){const l=u&&u.rejection;l?console.error("Unhandled Promise rejection:",l instanceof Error?l.message:l,"; Zone:",u.zone.name,"; Task:",u.task&&u.task.source,"; Value:",l,l instanceof Error?l.stack:void 0):console.error(u)}},i.microtaskDrainDone=()=>{for(;d.length;){const u=d.shift();try{u.zone.runGuarded(()=>{throw u.throwOriginal?u.rejection:u})}catch(l){N(l)}}};const O=y("unhandledPromiseRejectionHandler");function N(u){i.onUnhandledError(u);try{const l=n[O];"function"==typeof l&&l.call(this,u)}catch{}}function B(u){return u&&u.then}function H(u){return u}function K(u){return e.reject(u)}const q=y("state"),R=y("value"),_=y("finally"),J=y("parentPromiseValue"),x=y("parentPromiseState"),X="Promise.then",j=null,E=!0,G=!1,h=0;function I(u,l){return s=>{try{z(u,l,s)}catch(f){z(u,!1,f)}}}const P=function(){let u=!1;return function(s){return function(){u||(u=!0,s.apply(null,arguments))}}},Q="Promise resolved with itself",se=y("currentTaskTrace");function z(u,l,s){const f=P();if(u===s)throw new TypeError(Q);if(u[q]===j){let g=null;try{("object"==typeof s||"function"==typeof s)&&(g=s&&s.then)}catch(w){return f(()=>{z(u,!1,w)})(),u}if(l!==G&&s instanceof e&&s.hasOwnProperty(q)&&s.hasOwnProperty(R)&&s[q]!==j)oe(s),z(u,s[q],s[R]);else if(l!==G&&"function"==typeof g)try{g.call(s,f(I(u,l)),f(I(u,!1)))}catch(w){f(()=>{z(u,!1,w)})()}else{u[q]=l;const w=u[R];if(u[R]=s,u[_]===_&&l===E&&(u[q]=u[x],u[R]=u[J]),l===G&&s instanceof Error){const m=n.currentTask&&n.currentTask.data&&n.currentTask.data[M];m&&c(s,se,{configurable:!0,enumerable:!1,writable:!0,value:m})}for(let m=0;m{try{const S=u[R],D=!!s&&_===s[_];D&&(s[J]=S,s[x]=w);const Z=l.run(m,void 0,D&&m!==K&&m!==H?[]:[S]);z(s,!0,Z)}catch(S){z(s,!1,S)}},s)}const L=function(){},T=t.AggregateError;class e{static toString(){return"function ZoneAwarePromise() { [native code] }"}static resolve(l){return l instanceof e?l:z(new this(null),E,l)}static reject(l){return z(new this(null),G,l)}static withResolvers(){const l={};return l.promise=new e((s,f)=>{l.resolve=s,l.reject=f}),l}static any(l){if(!l||"function"!=typeof l[Symbol.iterator])return Promise.reject(new T([],"All promises were rejected"));const s=[];let f=0;try{for(let m of l)f++,s.push(e.resolve(m))}catch{return Promise.reject(new T([],"All promises were rejected"))}if(0===f)return Promise.reject(new T([],"All promises were rejected"));let g=!1;const w=[];return new e((m,S)=>{for(let D=0;D{g||(g=!0,m(Z))},Z=>{w.push(Z),f--,0===f&&(g=!0,S(new T(w,"All promises were rejected")))})})}static race(l){let s,f,g=new this((S,D)=>{s=S,f=D});function w(S){s(S)}function m(S){f(S)}for(let S of l)B(S)||(S=this.resolve(S)),S.then(w,m);return g}static all(l){return e.allWithCallback(l)}static allSettled(l){return(this&&this.prototype instanceof e?this:e).allWithCallback(l,{thenCallback:f=>({status:"fulfilled",value:f}),errorCallback:f=>({status:"rejected",reason:f})})}static allWithCallback(l,s){let f,g,w=new this((Z,V)=>{f=Z,g=V}),m=2,S=0;const D=[];for(let Z of l){B(Z)||(Z=this.resolve(Z));const V=S;try{Z.then(F=>{D[V]=s?s.thenCallback(F):F,m--,0===m&&f(D)},F=>{s?(D[V]=s.errorCallback(F),m--,0===m&&f(D)):g(F)})}catch(F){g(F)}m++,S++}return m-=2,0===m&&f(D),w}constructor(l){const s=this;if(!(s instanceof e))throw new Error("Must be an instanceof Promise.");s[q]=j,s[R]=[];try{const f=P();l&&l(f(I(s,E)),f(I(s,G)))}catch(f){z(s,!1,f)}}get[Symbol.toStringTag](){return"Promise"}get[Symbol.species](){return e}then(l,s){let f=this.constructor?.[Symbol.species];(!f||"function"!=typeof f)&&(f=this.constructor||e);const g=new f(L),w=n.current;return this[q]==j?this[R].push(w,g,l,s):te(this,w,g,l,s),g}catch(l){return this.then(null,l)}finally(l){let s=this.constructor?.[Symbol.species];(!s||"function"!=typeof s)&&(s=e);const f=new s(L);f[_]=_;const g=n.current;return this[q]==j?this[R].push(g,f,l,l):te(this,g,f,l,l),f}}e.resolve=e.resolve,e.reject=e.reject,e.race=e.race,e.all=e.all;const r=t[v]=t.Promise;t.Promise=e;const k=y("thenPatched");function C(u){const l=u.prototype,s=o(l,"then");if(s&&(!1===s.writable||!s.configurable))return;const f=l.then;l[p]=f,u.prototype.then=function(g,w){return new e((S,D)=>{f.call(this,S,D)}).then(g,w)},u[k]=!0}return i.patchThen=C,r&&(C(r),le(t,"fetch",u=>function $(u){return function(l,s){let f=u.apply(l,s);if(f instanceof e)return f;let g=f.constructor;return g[k]||C(g),f}}(u))),Promise[n.__symbol__("uncaughtPromiseErrors")]=d,e}),Zone.__load_patch("toString",t=>{const n=Function.prototype.toString,i=A("OriginalDelegate"),o=A("Promise"),c=A("Error"),a=function(){if("function"==typeof this){const v=this[i];if(v)return"function"==typeof v?n.call(v):Object.prototype.toString.call(v);if(this===Promise){const p=t[o];if(p)return n.call(p)}if(this===Error){const p=t[c];if(p)return n.call(p)}}return n.call(this)};a[i]=n,Function.prototype.toString=a;const y=Object.prototype.toString;Object.prototype.toString=function(){return"function"==typeof Promise&&this instanceof Promise?"[object Promise]":y.call(this)}});let Ee=!1;if(typeof window<"u")try{const t=Object.defineProperty({},"passive",{get:function(){Ee=!0}});window.addEventListener("test",t,t),window.removeEventListener("test",t,t)}catch{Ee=!1}const dt={useG:!0},ne={},Ye={},$e=new RegExp("^"+me+"(\\w+)(true|false)$"),Je=A("propagationStopped");function Ke(t,n){const i=(n?n(t):t)+ae,o=(n?n(t):t)+ce,c=me+i,a=me+o;ne[t]={},ne[t][ae]=c,ne[t][ce]=a}function _t(t,n,i,o){const c=o&&o.add||Ze,a=o&&o.rm||Oe,y=o&&o.listeners||"eventListeners",d=o&&o.rmAll||"removeAllListeners",b=A(c),v="."+c+":",p="prependListener",M="."+p+":",O=function(R,_,J){if(R.isRemoved)return;const x=R.callback;let X;"object"==typeof x&&x.handleEvent&&(R.callback=E=>x.handleEvent(E),R.originalDelegate=x);try{R.invoke(R,_,[J])}catch(E){X=E}const j=R.options;return j&&"object"==typeof j&&j.once&&_[a].call(_,J.type,R.originalDelegate?R.originalDelegate:R.callback,j),X};function N(R,_,J){if(!(_=_||t.event))return;const x=R||_.target||t,X=x[ne[_.type][J?ce:ae]];if(X){const j=[];if(1===X.length){const E=O(X[0],x,_);E&&j.push(E)}else{const E=X.slice();for(let G=0;G{throw G})}}}const B=function(R){return N(this,R,!1)},H=function(R){return N(this,R,!0)};function K(R,_){if(!R)return!1;let J=!0;_&&void 0!==_.useG&&(J=_.useG);const x=_&&_.vh;let X=!0;_&&void 0!==_.chkDup&&(X=_.chkDup);let j=!1;_&&void 0!==_.rt&&(j=_.rt);let E=R;for(;E&&!E.hasOwnProperty(c);)E=be(E);if(!E&&R[c]&&(E=R),!E||E[b])return!1;const G=_&&_.eventNameToString,h={},I=E[b]=E[c],P=E[A(a)]=E[a],Q=E[A(y)]=E[y],se=E[A(d)]=E[d];let z;_&&_.prepend&&(z=E[A(_.prepend)]=E[_.prepend]);const e=J?function(s){if(!h.isExisting)return I.call(h.target,h.eventName,h.capture?H:B,h.options)}:function(s){return I.call(h.target,h.eventName,s.invoke,h.options)},r=J?function(s){if(!s.isRemoved){const f=ne[s.eventName];let g;f&&(g=f[s.capture?ce:ae]);const w=g&&s.target[g];if(w)for(let m=0;m{ie.zone.cancelTask(ie)},{once:!0})),h.target=null,ve&&(ve.taskData=null),nt&&(ee.once=!0),!Ee&&"boolean"==typeof ie.options||(ie.options=ee),ie.target=D,ie.capture=Ge,ie.eventName=Z,F&&(ie.originalDelegate=V),S?ye.unshift(ie):ye.push(ie),m?D:void 0}};return E[c]=l(I,v,e,r,j),z&&(E[p]=l(z,M,function(s){return z.call(h.target,h.eventName,s.invoke,h.options)},r,j,!0)),E[a]=function(){const s=this||t;let f=arguments[0];_&&_.transferEventName&&(f=_.transferEventName(f));const g=arguments[2],w=!!g&&("boolean"==typeof g||g.capture),m=arguments[1];if(!m)return P.apply(this,arguments);if(x&&!x(P,m,s,arguments))return;const S=ne[f];let D;S&&(D=S[w?ce:ae]);const Z=D&&s[D];if(Z)for(let V=0;Vfunction(c,a){c[Je]=!0,o&&o.apply(c,a)})}function Tt(t,n,i,o,c){const a=Zone.__symbol__(o);if(n[a])return;const y=n[a]=n[o];n[o]=function(d,b,v){return b&&b.prototype&&c.forEach(function(p){const M=`${i}.${o}::`+p,O=b.prototype;try{if(O.hasOwnProperty(p)){const N=t.ObjectGetOwnPropertyDescriptor(O,p);N&&N.value?(N.value=t.wrapWithCurrentZone(N.value,M),t._redefineProperty(b.prototype,p,N)):O[p]&&(O[p]=t.wrapWithCurrentZone(O[p],M))}else O[p]&&(O[p]=t.wrapWithCurrentZone(O[p],M))}catch{}}),y.call(n,d,b,v)},t.attachOriginToPatched(n[o],y)}function et(t,n,i){if(!i||0===i.length)return n;const o=i.filter(a=>a.target===t);if(!o||0===o.length)return n;const c=o[0].ignoreProperties;return n.filter(a=>-1===c.indexOf(a))}function tt(t,n,i,o){t&&Xe(t,et(t,n,i),o)}function xe(t){return Object.getOwnPropertyNames(t).filter(n=>n.startsWith("on")&&n.length>2).map(n=>n.substring(2))}Zone.__load_patch("util",(t,n,i)=>{const o=xe(t);i.patchOnProperties=Xe,i.patchMethod=le,i.bindArguments=je,i.patchMacroTask=ut;const c=n.__symbol__("BLACK_LISTED_EVENTS"),a=n.__symbol__("UNPATCHED_EVENTS");t[a]&&(t[c]=t[a]),t[c]&&(n[c]=n[a]=t[c]),i.patchEventPrototype=Et,i.patchEventTarget=_t,i.isIEOrEdge=ht,i.ObjectDefineProperty=pe,i.ObjectGetOwnPropertyDescriptor=fe,i.ObjectCreate=De,i.ArraySlice=ct,i.patchClass=ge,i.wrapWithCurrentZone=Me,i.filterProperties=et,i.attachOriginToPatched=ue,i._redefineProperty=Object.defineProperty,i.patchCallbacks=Tt,i.getGlobalObjects=()=>({globalSources:Ye,zoneSymbolEventNames:ne,eventNames:o,isBrowser:Ae,isMix:Ue,isNode:we,TRUE_STR:ce,FALSE_STR:ae,ZONE_SYMBOL_PREFIX:me,ADD_EVENT_LISTENER_STR:Ze,REMOVE_EVENT_LISTENER_STR:Oe})});const Ce=A("zoneTask");function Te(t,n,i,o){let c=null,a=null;i+=o;const y={};function d(v){const p=v.data;return p.args[0]=function(){return v.invoke.apply(this,arguments)},p.handleId=c.apply(t,p.args),v}function b(v){return a.call(t,v.data.handleId)}c=le(t,n+=o,v=>function(p,M){if("function"==typeof M[0]){const O={isPeriodic:"Interval"===o,delay:"Timeout"===o||"Interval"===o?M[1]||0:void 0,args:M},N=M[0];M[0]=function(){try{return N.apply(this,arguments)}finally{O.isPeriodic||("number"==typeof O.handleId?delete y[O.handleId]:O.handleId&&(O.handleId[Ce]=null))}};const B=Le(n,M[0],O,d,b);if(!B)return B;const H=B.data.handleId;return"number"==typeof H?y[H]=B:H&&(H[Ce]=B),H&&H.ref&&H.unref&&"function"==typeof H.ref&&"function"==typeof H.unref&&(B.ref=H.ref.bind(H),B.unref=H.unref.bind(H)),"number"==typeof H||H?H:B}return v.apply(t,M)}),a=le(t,i,v=>function(p,M){const O=M[0];let N;"number"==typeof O?N=y[O]:(N=O&&O[Ce],N||(N=O)),N&&"string"==typeof N.type?"notScheduled"!==N.state&&(N.cancelFn&&N.data.isPeriodic||0===N.runCount)&&("number"==typeof O?delete y[O]:O&&(O[Ce]=null),N.zone.cancelTask(N)):v.apply(t,M)})}Zone.__load_patch("legacy",t=>{const n=t[Zone.__symbol__("legacyPatch")];n&&n()}),Zone.__load_patch("timers",t=>{const n="set",i="clear";Te(t,n,i,"Timeout"),Te(t,n,i,"Interval"),Te(t,n,i,"Immediate")}),Zone.__load_patch("requestAnimationFrame",t=>{Te(t,"request","cancel","AnimationFrame"),Te(t,"mozRequest","mozCancel","AnimationFrame"),Te(t,"webkitRequest","webkitCancel","AnimationFrame")}),Zone.__load_patch("blocking",(t,n)=>{const i=["alert","prompt","confirm"];for(let o=0;ofunction(b,v){return n.current.run(a,t,v,d)})}),Zone.__load_patch("EventTarget",(t,n,i)=>{(function kt(t,n){n.patchEventPrototype(t,n)})(t,i),function gt(t,n){if(Zone[n.symbol("patchEventTarget")])return;const{eventNames:i,zoneSymbolEventNames:o,TRUE_STR:c,FALSE_STR:a,ZONE_SYMBOL_PREFIX:y}=n.getGlobalObjects();for(let b=0;b{ge("MutationObserver"),ge("WebKitMutationObserver")}),Zone.__load_patch("IntersectionObserver",(t,n,i)=>{ge("IntersectionObserver")}),Zone.__load_patch("FileReader",(t,n,i)=>{ge("FileReader")}),Zone.__load_patch("on_property",(t,n,i)=>{!function yt(t,n){if(we&&!Ue||Zone[t.symbol("patchEvents")])return;const i=n.__Zone_ignore_on_properties;let o=[];if(Ae){const c=window;o=o.concat(["Document","SVGElement","Element","HTMLElement","HTMLBodyElement","HTMLMediaElement","HTMLFrameSetElement","HTMLFrameElement","HTMLIFrameElement","HTMLMarqueeElement","Worker"]);const a=function ft(){try{const t=_e.navigator.userAgent;if(-1!==t.indexOf("MSIE ")||-1!==t.indexOf("Trident/"))return!0}catch{}return!1}()?[{target:c,ignoreProperties:["error"]}]:[];tt(c,xe(c),i&&i.concat(a),be(c))}o=o.concat(["XMLHttpRequest","XMLHttpRequestEventTarget","IDBIndex","IDBRequest","IDBOpenDBRequest","IDBDatabase","IDBTransaction","IDBCursor","WebSocket"]);for(let c=0;c{!function mt(t,n){const{isBrowser:i,isMix:o}=n.getGlobalObjects();(i||o)&&t.customElements&&"customElements"in t&&n.patchCallbacks(n,t.customElements,"customElements","define",["connectedCallback","disconnectedCallback","adoptedCallback","attributeChangedCallback","formAssociatedCallback","formDisabledCallback","formResetCallback","formStateRestoreCallback"])}(t,i)}),Zone.__load_patch("XHR",(t,n)=>{!function b(v){const p=v.XMLHttpRequest;if(!p)return;const M=p.prototype;let N=M[Ne],B=M[Ie];if(!N){const h=v.XMLHttpRequestEventTarget;if(h){const I=h.prototype;N=I[Ne],B=I[Ie]}}const H="readystatechange",K="scheduled";function q(h){const I=h.data,P=I.target;P[a]=!1,P[d]=!1;const Q=P[c];N||(N=P[Ne],B=P[Ie]),Q&&B.call(P,H,Q);const se=P[c]=()=>{if(P.readyState===P.DONE)if(!I.aborted&&P[a]&&h.state===K){const U=P[n.__symbol__("loadfalse")];if(0!==P.status&&U&&U.length>0){const oe=h.invoke;h.invoke=function(){const te=P[n.__symbol__("loadfalse")];for(let W=0;Wfunction(h,I){return h[o]=0==I[2],h[y]=I[1],J.apply(h,I)}),X=A("fetchTaskAborting"),j=A("fetchTaskScheduling"),E=le(M,"send",()=>function(h,I){if(!0===n.current[j]||h[o])return E.apply(h,I);{const P={target:h,url:h[y],isPeriodic:!1,args:I,aborted:!1},Q=Le("XMLHttpRequest.send",R,P,q,_);h&&!0===h[d]&&!P.aborted&&Q.state===K&&Q.invoke()}}),G=le(M,"abort",()=>function(h,I){const P=function O(h){return h[i]}(h);if(P&&"string"==typeof P.type){if(null==P.cancelFn||P.data&&P.data.aborted)return;P.zone.cancelTask(P)}else if(!0===n.current[X])return G.apply(h,I)})}(t);const i=A("xhrTask"),o=A("xhrSync"),c=A("xhrListener"),a=A("xhrScheduled"),y=A("xhrURL"),d=A("xhrErrorBeforeScheduled")}),Zone.__load_patch("geolocation",t=>{t.navigator&&t.navigator.geolocation&&function lt(t,n){const i=t.constructor.name;for(let o=0;o{const b=function(){return d.apply(this,je(arguments,i+"."+c))};return ue(b,d),b})(a)}}}(t.navigator.geolocation,["getCurrentPosition","watchPosition"])}),Zone.__load_patch("PromiseRejectionEvent",(t,n)=>{function i(o){return function(c){Qe(t,o).forEach(y=>{const d=t.PromiseRejectionEvent;if(d){const b=new d(o,{promise:c.promise,reason:c.rejection});y.invoke(b)}})}}t.PromiseRejectionEvent&&(n[A("unhandledPromiseRejectionHandler")]=i("unhandledrejection"),n[A("rejectionHandledHandler")]=i("rejectionhandled"))}),Zone.__load_patch("queueMicrotask",(t,n,i)=>{!function pt(t,n){n.patchMethod(t,"queueMicrotask",i=>function(o,c){Zone.current.scheduleMicroTask("queueMicrotask",c[0])})}(t,i)})}},fe=>{fe(fe.s=935)}]); -------------------------------------------------------------------------------- /server/wwwroot/runtime.03d9a510341a847f.js: -------------------------------------------------------------------------------- 1 | (()=>{"use strict";var e,v={},_={};function n(e){var l=_[e];if(void 0!==l)return l.exports;var r=_[e]={exports:{}};return v[e](r,r.exports,n),r.exports}n.m=v,e=[],n.O=(l,r,o,f)=>{if(!r){var c=1/0;for(a=0;a=f)&&Object.keys(n.O).every(p=>n.O[p](r[u]))?r.splice(u--,1):(i=!1,f0&&e[a-1][2]>f;a--)e[a]=e[a-1];e[a]=[r,o,f]},n.o=(e,l)=>Object.prototype.hasOwnProperty.call(e,l),(()=>{var e={121:0};n.O.j=o=>0===e[o];var l=(o,f)=>{var u,s,[a,c,i]=f,t=0;if(a.some(h=>0!==e[h])){for(u in c)n.o(c,u)&&(n.m[u]=c[u]);if(i)var d=i(n)}for(o&&o(f);tU.has(i)&&U.get(i).get(e)||null,remove(i,e){if(!U.has(i))return;const t=U.get(i);t.delete(e),0===t.size&&U.delete(i)}},Et="transitionend",ci=i=>(i&&window.CSS&&window.CSS.escape&&(i=i.replace(/#([^\s"#']+)/g,(e,t)=>`#${CSS.escape(t)}`)),i),hi=i=>{i.dispatchEvent(new Event(Et))},ie=i=>!(!i||"object"!=typeof i)&&(void 0!==i.jquery&&(i=i[0]),void 0!==i.nodeType),ae=i=>ie(i)?i.jquery?i[0]:i:"string"==typeof i&&i.length>0?document.querySelector(ci(i)):null,Ce=i=>{if(!ie(i)||0===i.getClientRects().length)return!1;const e="visible"===getComputedStyle(i).getPropertyValue("visibility"),t=i.closest("details:not([open])");if(!t)return e;if(t!==i){const n=i.closest("summary");if(n&&n.parentNode!==t||null===n)return!1}return e},le=i=>!i||i.nodeType!==Node.ELEMENT_NODE||!!i.classList.contains("disabled")||(void 0!==i.disabled?i.disabled:i.hasAttribute("disabled")&&"false"!==i.getAttribute("disabled")),di=i=>{if(!document.documentElement.attachShadow)return null;if("function"==typeof i.getRootNode){const e=i.getRootNode();return e instanceof ShadowRoot?e:null}return i instanceof ShadowRoot?i:i.parentNode?di(i.parentNode):null},et=()=>{},ui=()=>window.jQuery&&!document.body.hasAttribute("data-bs-no-jquery")?window.jQuery:null,At=[],B=()=>"rtl"===document.documentElement.dir,z=i=>{var e;e=()=>{const t=ui();if(t){const n=i.NAME,s=t.fn[n];t.fn[n]=i.jQueryInterface,t.fn[n].Constructor=i,t.fn[n].noConflict=()=>(t.fn[n]=s,i.jQueryInterface)}},"loading"===document.readyState?(At.length||document.addEventListener("DOMContentLoaded",()=>{for(const t of At)t()}),At.push(e)):e()},M=(i,e=[],t=i)=>"function"==typeof i?i(...e):t,fi=(i,e,t=!0)=>{if(!t)return void M(i);const n=(r=>{if(!r)return 0;let{transitionDuration:a,transitionDelay:c}=window.getComputedStyle(r);const d=Number.parseFloat(a),u=Number.parseFloat(c);return d||u?(a=a.split(",")[0],c=c.split(",")[0],1e3*(Number.parseFloat(a)+Number.parseFloat(c))):0})(e)+5;let s=!1;const o=({target:r})=>{r===e&&(s=!0,e.removeEventListener(Et,o),M(i))};e.addEventListener(Et,o),setTimeout(()=>{s||hi(e)},n)},Tt=(i,e,t,n)=>{const s=i.length;let o=i.indexOf(e);return-1===o?!t&&n?i[s-1]:i[0]:(o+=t?1:-1,n&&(o=(o+s)%s),i[Math.max(0,Math.min(o,s-1))])},is=/[^.]*(?=\..*)\.|.*/,ns=/\..*/,ss=/::\d+$/,Ct={};let pi=1;const mi={mouseenter:"mouseover",mouseleave:"mouseout"},os=new Set(["click","dblclick","mouseup","mousedown","contextmenu","mousewheel","DOMMouseScroll","mouseover","mouseout","mousemove","selectstart","selectend","keydown","keypress","keyup","orientationchange","touchstart","touchmove","touchend","touchcancel","pointerdown","pointermove","pointerup","pointerleave","pointercancel","gesturestart","gesturechange","gestureend","focus","blur","change","reset","select","submit","focusin","focusout","load","unload","beforeunload","resize","move","DOMContentLoaded","readystatechange","error","abort","scroll"]);function gi(i,e){return e&&`${e}::${pi++}`||i.uidEvent||pi++}function _i(i){const e=gi(i);return i.uidEvent=e,Ct[e]=Ct[e]||{},Ct[e]}function bi(i,e,t=null){return Object.values(i).find(n=>n.callable===e&&n.delegationSelector===t)}function vi(i,e,t){const n="string"==typeof e,s=n?t:e||t;let o=wi(i);return os.has(o)||(o=i),[n,s,o]}function yi(i,e,t,n,s){if("string"!=typeof e||!i)return;let[o,r,a]=vi(e,t,n);var g;e in mi&&(g=r,r=function(m){if(!m.relatedTarget||m.relatedTarget!==m.delegateTarget&&!m.delegateTarget.contains(m.relatedTarget))return g.call(this,m)});const c=_i(i),d=c[a]||(c[a]={}),u=bi(d,r,o?t:null);if(u)return void(u.oneOff=u.oneOff&&s);const h=gi(r,e.replace(is,"")),b=o?function(p,g,m){return function _(C){const k=p.querySelectorAll(g);for(let{target:y}=C;y&&y!==this;y=y.parentNode)for(const E of k)if(E===y)return xt(C,{delegateTarget:y}),_.oneOff&&l.off(p,C.type,g,m),m.apply(y,[C])}}(i,t,r):function(p,g){return function m(_){return xt(_,{delegateTarget:p}),m.oneOff&&l.off(p,_.type,g),g.apply(p,[_])}}(i,r);b.delegationSelector=o?t:null,b.callable=r,b.oneOff=s,b.uidEvent=h,d[h]=b,i.addEventListener(a,b,o)}function Ot(i,e,t,n,s){const o=bi(e[t],n,s);o&&(i.removeEventListener(t,o,!!s),delete e[t][o.uidEvent])}function rs(i,e,t,n){const s=e[t]||{};for(const[o,r]of Object.entries(s))o.includes(n)&&Ot(i,e,t,r.callable,r.delegationSelector)}function wi(i){return i=i.replace(ns,""),mi[i]||i}const l={on(i,e,t,n){yi(i,e,t,n,!1)},one(i,e,t,n){yi(i,e,t,n,!0)},off(i,e,t,n){if("string"!=typeof e||!i)return;const[s,o,r]=vi(e,t,n),a=r!==e,c=_i(i),d=c[r]||{},u=e.startsWith(".");if(void 0===o){if(u)for(const h of Object.keys(c))rs(i,c,h,e.slice(1));for(const[h,b]of Object.entries(d)){const p=h.replace(ss,"");a&&!e.includes(p)||Ot(i,c,r,b.callable,b.delegationSelector)}}else{if(!Object.keys(d).length)return;Ot(i,c,r,o,s?t:null)}},trigger(i,e,t){if("string"!=typeof e||!i)return null;const n=ui();let s=null,o=!0,r=!0,a=!1;e!==wi(e)&&n&&(s=n.Event(e,t),n(i).trigger(s),o=!s.isPropagationStopped(),r=!s.isImmediatePropagationStopped(),a=s.isDefaultPrevented());const c=xt(new Event(e,{bubbles:o,cancelable:!0}),t);return a&&c.preventDefault(),r&&i.dispatchEvent(c),c.defaultPrevented&&s&&s.preventDefault(),c}};function xt(i,e={}){for(const[t,n]of Object.entries(e))try{i[t]=n}catch{Object.defineProperty(i,t,{configurable:!0,get:()=>n})}return i}function Ei(i){if("true"===i)return!0;if("false"===i)return!1;if(i===Number(i).toString())return Number(i);if(""===i||"null"===i)return null;if("string"!=typeof i)return i;try{return JSON.parse(decodeURIComponent(i))}catch{return i}}function kt(i){return i.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}const ne={setDataAttribute(i,e,t){i.setAttribute(`data-bs-${kt(e)}`,t)},removeDataAttribute(i,e){i.removeAttribute(`data-bs-${kt(e)}`)},getDataAttributes(i){if(!i)return{};const e={},t=Object.keys(i.dataset).filter(n=>n.startsWith("bs")&&!n.startsWith("bsConfig"));for(const n of t){let s=n.replace(/^bs/,"");s=s.charAt(0).toLowerCase()+s.slice(1,s.length),e[s]=Ei(i.dataset[n])}return e},getDataAttribute:(i,e)=>Ei(i.getAttribute(`data-bs-${kt(e)}`))};class Re{static get Default(){return{}}static get DefaultType(){return{}}static get NAME(){throw new Error('You have to implement the static method "NAME", for each component!')}_getConfig(e){return e=this._mergeConfigObj(e),e=this._configAfterMerge(e),this._typeCheckConfig(e),e}_configAfterMerge(e){return e}_mergeConfigObj(e,t){const n=ie(t)?ne.getDataAttribute(t,"config"):{};return{...this.constructor.Default,..."object"==typeof n?n:{},...ie(t)?ne.getDataAttributes(t):{},..."object"==typeof e?e:{}}}_typeCheckConfig(e,t=this.constructor.DefaultType){for(const[s,o]of Object.entries(t)){const r=e[s],a=ie(r)?"element":null==(n=r)?`${n}`:Object.prototype.toString.call(n).match(/\s([a-z]+)/i)[1].toLowerCase();if(!new RegExp(o).test(a))throw new TypeError(`${this.constructor.NAME.toUpperCase()}: Option "${s}" provided type "${a}" but expected type "${o}".`)}var n}}class Y extends Re{constructor(e,t){super(),(e=ae(e))&&(this._element=e,this._config=this._getConfig(t),fe.set(this._element,this.constructor.DATA_KEY,this))}dispose(){fe.remove(this._element,this.constructor.DATA_KEY),l.off(this._element,this.constructor.EVENT_KEY);for(const e of Object.getOwnPropertyNames(this))this[e]=null}_queueCallback(e,t,n=!0){fi(e,t,n)}_getConfig(e){return e=this._mergeConfigObj(e,this._element),e=this._configAfterMerge(e),this._typeCheckConfig(e),e}static getInstance(e){return fe.get(ae(e),this.DATA_KEY)}static getOrCreateInstance(e,t={}){return this.getInstance(e)||new this(e,"object"==typeof t?t:null)}static get VERSION(){return"5.3.3"}static get DATA_KEY(){return`bs.${this.NAME}`}static get EVENT_KEY(){return`.${this.DATA_KEY}`}static eventName(e){return`${e}${this.EVENT_KEY}`}}const Lt=i=>{let e=i.getAttribute("data-bs-target");if(!e||"#"===e){let t=i.getAttribute("href");if(!t||!t.includes("#")&&!t.startsWith("."))return null;t.includes("#")&&!t.startsWith("#")&&(t=`#${t.split("#")[1]}`),e=t&&"#"!==t?t.trim():null}return e?e.split(",").map(t=>ci(t)).join(","):null},f={find:(i,e=document.documentElement)=>[].concat(...Element.prototype.querySelectorAll.call(e,i)),findOne:(i,e=document.documentElement)=>Element.prototype.querySelector.call(e,i),children:(i,e)=>[].concat(...i.children).filter(t=>t.matches(e)),parents(i,e){const t=[];let n=i.parentNode.closest(e);for(;n;)t.push(n),n=n.parentNode.closest(e);return t},prev(i,e){let t=i.previousElementSibling;for(;t;){if(t.matches(e))return[t];t=t.previousElementSibling}return[]},next(i,e){let t=i.nextElementSibling;for(;t;){if(t.matches(e))return[t];t=t.nextElementSibling}return[]},focusableChildren(i){const e=["a","button","input","textarea","select","details","[tabindex]",'[contenteditable="true"]'].map(t=>`${t}:not([tabindex^="-"])`).join(",");return this.find(e,i).filter(t=>!le(t)&&Ce(t))},getSelectorFromElement(i){const e=Lt(i);return e&&f.findOne(e)?e:null},getElementFromSelector(i){const e=Lt(i);return e?f.findOne(e):null},getMultipleElementsFromSelector(i){const e=Lt(i);return e?f.find(e):[]}},tt=(i,e="hide")=>{const n=i.NAME;l.on(document,`click.dismiss${i.EVENT_KEY}`,`[data-bs-dismiss="${n}"]`,function(s){if(["A","AREA"].includes(this.tagName)&&s.preventDefault(),le(this))return;const o=f.getElementFromSelector(this)||this.closest(`.${n}`);i.getOrCreateInstance(o)[e]()})},Ai=".bs.alert",as=`close${Ai}`,ls=`closed${Ai}`;class qe extends Y{static get NAME(){return"alert"}close(){if(l.trigger(this._element,as).defaultPrevented)return;this._element.classList.remove("show");const e=this._element.classList.contains("fade");this._queueCallback(()=>this._destroyElement(),this._element,e)}_destroyElement(){this._element.remove(),l.trigger(this._element,ls),this.dispose()}static jQueryInterface(e){return this.each(function(){const t=qe.getOrCreateInstance(this);if("string"==typeof e){if(void 0===t[e]||e.startsWith("_")||"constructor"===e)throw new TypeError(`No method named "${e}"`);t[e](this)}})}}tt(qe,"close"),z(qe);const Ti='[data-bs-toggle="button"]';class Ve extends Y{static get NAME(){return"button"}toggle(){this._element.setAttribute("aria-pressed",this._element.classList.toggle("active"))}static jQueryInterface(e){return this.each(function(){const t=Ve.getOrCreateInstance(this);"toggle"===e&&t[e]()})}}l.on(document,"click.bs.button.data-api",Ti,i=>{i.preventDefault();const e=i.target.closest(Ti);Ve.getOrCreateInstance(e).toggle()}),z(Ve);const Oe=".bs.swipe",cs=`touchstart${Oe}`,hs=`touchmove${Oe}`,ds=`touchend${Oe}`,us=`pointerdown${Oe}`,fs=`pointerup${Oe}`,ps={endCallback:null,leftCallback:null,rightCallback:null},ms={endCallback:"(function|null)",leftCallback:"(function|null)",rightCallback:"(function|null)"};class it extends Re{constructor(e,t){super(),this._element=e,e&&it.isSupported()&&(this._config=this._getConfig(t),this._deltaX=0,this._supportPointerEvents=!!window.PointerEvent,this._initEvents())}static get Default(){return ps}static get DefaultType(){return ms}static get NAME(){return"swipe"}dispose(){l.off(this._element,Oe)}_start(e){this._supportPointerEvents?this._eventIsPointerPenTouch(e)&&(this._deltaX=e.clientX):this._deltaX=e.touches[0].clientX}_end(e){this._eventIsPointerPenTouch(e)&&(this._deltaX=e.clientX-this._deltaX),this._handleSwipe(),M(this._config.endCallback)}_move(e){this._deltaX=e.touches&&e.touches.length>1?0:e.touches[0].clientX-this._deltaX}_handleSwipe(){const e=Math.abs(this._deltaX);if(e<=40)return;const t=e/this._deltaX;this._deltaX=0,t&&M(t>0?this._config.rightCallback:this._config.leftCallback)}_initEvents(){this._supportPointerEvents?(l.on(this._element,us,e=>this._start(e)),l.on(this._element,fs,e=>this._end(e)),this._element.classList.add("pointer-event")):(l.on(this._element,cs,e=>this._start(e)),l.on(this._element,hs,e=>this._move(e)),l.on(this._element,ds,e=>this._end(e)))}_eventIsPointerPenTouch(e){return this._supportPointerEvents&&("pen"===e.pointerType||"touch"===e.pointerType)}static isSupported(){return"ontouchstart"in document.documentElement||navigator.maxTouchPoints>0}}const ce=".bs.carousel",Ci=".data-api",Ke="next",xe="prev",ke="left",nt="right",gs=`slide${ce}`,St=`slid${ce}`,_s=`keydown${ce}`,bs=`mouseenter${ce}`,vs=`mouseleave${ce}`,ys=`dragstart${ce}`,ws=`load${ce}${Ci}`,Es=`click${ce}${Ci}`,Oi="carousel",st="active",xi=".active",ki=".carousel-item",As=xi+ki,Ts={ArrowLeft:nt,ArrowRight:ke},Cs={interval:5e3,keyboard:!0,pause:"hover",ride:!1,touch:!0,wrap:!0},Os={interval:"(number|boolean)",keyboard:"boolean",pause:"(string|boolean)",ride:"(boolean|string)",touch:"boolean",wrap:"boolean"};class Le extends Y{constructor(e,t){super(e,t),this._interval=null,this._activeElement=null,this._isSliding=!1,this.touchTimeout=null,this._swipeHelper=null,this._indicatorsElement=f.findOne(".carousel-indicators",this._element),this._addEventListeners(),this._config.ride===Oi&&this.cycle()}static get Default(){return Cs}static get DefaultType(){return Os}static get NAME(){return"carousel"}next(){this._slide(Ke)}nextWhenVisible(){!document.hidden&&Ce(this._element)&&this.next()}prev(){this._slide(xe)}pause(){this._isSliding&&hi(this._element),this._clearInterval()}cycle(){this._clearInterval(),this._updateInterval(),this._interval=setInterval(()=>this.nextWhenVisible(),this._config.interval)}_maybeEnableCycle(){this._config.ride&&(this._isSliding?l.one(this._element,St,()=>this.cycle()):this.cycle())}to(e){const t=this._getItems();if(e>t.length-1||e<0)return;if(this._isSliding)return void l.one(this._element,St,()=>this.to(e));const n=this._getItemIndex(this._getActive());n!==e&&this._slide(e>n?Ke:xe,t[e])}dispose(){this._swipeHelper&&this._swipeHelper.dispose(),super.dispose()}_configAfterMerge(e){return e.defaultInterval=e.interval,e}_addEventListeners(){this._config.keyboard&&l.on(this._element,_s,e=>this._keydown(e)),"hover"===this._config.pause&&(l.on(this._element,bs,()=>this.pause()),l.on(this._element,vs,()=>this._maybeEnableCycle())),this._config.touch&&it.isSupported()&&this._addTouchEventListeners()}_addTouchEventListeners(){for(const t of f.find(".carousel-item img",this._element))l.on(t,ys,n=>n.preventDefault());this._swipeHelper=new it(this._element,{leftCallback:()=>this._slide(this._directionToOrder(ke)),rightCallback:()=>this._slide(this._directionToOrder(nt)),endCallback:()=>{"hover"===this._config.pause&&(this.pause(),this.touchTimeout&&clearTimeout(this.touchTimeout),this.touchTimeout=setTimeout(()=>this._maybeEnableCycle(),500+this._config.interval))}})}_keydown(e){if(/input|textarea/i.test(e.target.tagName))return;const t=Ts[e.key];t&&(e.preventDefault(),this._slide(this._directionToOrder(t)))}_getItemIndex(e){return this._getItems().indexOf(e)}_setActiveIndicatorElement(e){if(!this._indicatorsElement)return;const t=f.findOne(xi,this._indicatorsElement);t.classList.remove(st),t.removeAttribute("aria-current");const n=f.findOne(`[data-bs-slide-to="${e}"]`,this._indicatorsElement);n&&(n.classList.add(st),n.setAttribute("aria-current","true"))}_updateInterval(){const e=this._activeElement||this._getActive();if(!e)return;const t=Number.parseInt(e.getAttribute("data-bs-interval"),10);this._config.interval=t||this._config.defaultInterval}_slide(e,t=null){if(this._isSliding)return;const n=this._getActive(),s=e===Ke,o=t||Tt(this._getItems(),n,s,this._config.wrap);if(o===n)return;const r=this._getItemIndex(o),a=h=>l.trigger(this._element,h,{relatedTarget:o,direction:this._orderToDirection(e),from:this._getItemIndex(n),to:r});if(a(gs).defaultPrevented||!n||!o)return;const c=!!this._interval;this.pause(),this._isSliding=!0,this._setActiveIndicatorElement(r),this._activeElement=o;const d=s?"carousel-item-start":"carousel-item-end",u=s?"carousel-item-next":"carousel-item-prev";o.classList.add(u),n.classList.add(d),o.classList.add(d),this._queueCallback(()=>{o.classList.remove(d,u),o.classList.add(st),n.classList.remove(st,u,d),this._isSliding=!1,a(St)},n,this._isAnimated()),c&&this.cycle()}_isAnimated(){return this._element.classList.contains("slide")}_getActive(){return f.findOne(As,this._element)}_getItems(){return f.find(ki,this._element)}_clearInterval(){this._interval&&(clearInterval(this._interval),this._interval=null)}_directionToOrder(e){return B()?e===ke?xe:Ke:e===ke?Ke:xe}_orderToDirection(e){return B()?e===xe?ke:nt:e===xe?nt:ke}static jQueryInterface(e){return this.each(function(){const t=Le.getOrCreateInstance(this,e);if("number"!=typeof e){if("string"==typeof e){if(void 0===t[e]||e.startsWith("_")||"constructor"===e)throw new TypeError(`No method named "${e}"`);t[e]()}}else t.to(e)})}}l.on(document,Es,"[data-bs-slide], [data-bs-slide-to]",function(i){const e=f.getElementFromSelector(this);if(!e||!e.classList.contains(Oi))return;i.preventDefault();const t=Le.getOrCreateInstance(e),n=this.getAttribute("data-bs-slide-to");return n?(t.to(n),void t._maybeEnableCycle()):"next"===ne.getDataAttribute(this,"slide")?(t.next(),void t._maybeEnableCycle()):(t.prev(),void t._maybeEnableCycle())}),l.on(window,ws,()=>{const i=f.find('[data-bs-ride="carousel"]');for(const e of i)Le.getOrCreateInstance(e)}),z(Le);const Xe=".bs.collapse",xs=`show${Xe}`,ks=`shown${Xe}`,Ls=`hide${Xe}`,Ss=`hidden${Xe}`,Ds=`click${Xe}.data-api`,Dt="show",Se="collapse",ot="collapsing",$s=`:scope .${Se} .${Se}`,$t='[data-bs-toggle="collapse"]',Is={parent:null,toggle:!0},Ns={parent:"(null|element)",toggle:"boolean"};class De extends Y{constructor(e,t){super(e,t),this._isTransitioning=!1,this._triggerArray=[];const n=f.find($t);for(const s of n){const o=f.getSelectorFromElement(s),r=f.find(o).filter(a=>a===this._element);null!==o&&r.length&&this._triggerArray.push(s)}this._initializeChildren(),this._config.parent||this._addAriaAndCollapsedClass(this._triggerArray,this._isShown()),this._config.toggle&&this.toggle()}static get Default(){return Is}static get DefaultType(){return Ns}static get NAME(){return"collapse"}toggle(){this._isShown()?this.hide():this.show()}show(){if(this._isTransitioning||this._isShown())return;let e=[];if(this._config.parent&&(e=this._getFirstLevelChildren(".collapse.show, .collapse.collapsing").filter(s=>s!==this._element).map(s=>De.getOrCreateInstance(s,{toggle:!1}))),e.length&&e[0]._isTransitioning||l.trigger(this._element,xs).defaultPrevented)return;for(const s of e)s.hide();const t=this._getDimension();this._element.classList.remove(Se),this._element.classList.add(ot),this._element.style[t]=0,this._addAriaAndCollapsedClass(this._triggerArray,!0),this._isTransitioning=!0;const n=`scroll${t[0].toUpperCase()+t.slice(1)}`;this._queueCallback(()=>{this._isTransitioning=!1,this._element.classList.remove(ot),this._element.classList.add(Se,Dt),this._element.style[t]="",l.trigger(this._element,ks)},this._element,!0),this._element.style[t]=`${this._element[n]}px`}hide(){if(this._isTransitioning||!this._isShown()||l.trigger(this._element,Ls).defaultPrevented)return;const e=this._getDimension();this._element.style[e]=`${this._element.getBoundingClientRect()[e]}px`,this._element.classList.add(ot),this._element.classList.remove(Se,Dt);for(const t of this._triggerArray){const n=f.getElementFromSelector(t);n&&!this._isShown(n)&&this._addAriaAndCollapsedClass([t],!1)}this._isTransitioning=!0,this._element.style[e]="",this._queueCallback(()=>{this._isTransitioning=!1,this._element.classList.remove(ot),this._element.classList.add(Se),l.trigger(this._element,Ss)},this._element,!0)}_isShown(e=this._element){return e.classList.contains(Dt)}_configAfterMerge(e){return e.toggle=!!e.toggle,e.parent=ae(e.parent),e}_getDimension(){return this._element.classList.contains("collapse-horizontal")?"width":"height"}_initializeChildren(){if(!this._config.parent)return;const e=this._getFirstLevelChildren($t);for(const t of e){const n=f.getElementFromSelector(t);n&&this._addAriaAndCollapsedClass([t],this._isShown(n))}}_getFirstLevelChildren(e){const t=f.find($s,this._config.parent);return f.find(e,this._config.parent).filter(n=>!t.includes(n))}_addAriaAndCollapsedClass(e,t){if(e.length)for(const n of e)n.classList.toggle("collapsed",!t),n.setAttribute("aria-expanded",t)}static jQueryInterface(e){const t={};return"string"==typeof e&&/show|hide/.test(e)&&(t.toggle=!1),this.each(function(){const n=De.getOrCreateInstance(this,t);if("string"==typeof e){if(void 0===n[e])throw new TypeError(`No method named "${e}"`);n[e]()}})}}l.on(document,Ds,$t,function(i){("A"===i.target.tagName||i.delegateTarget&&"A"===i.delegateTarget.tagName)&&i.preventDefault();for(const e of f.getMultipleElementsFromSelector(this))De.getOrCreateInstance(e,{toggle:!1}).toggle()}),z(De);var $="top",j="bottom",F="right",I="left",rt="auto",$e=[$,j,F,I],pe="start",Ie="end",Li="clippingParents",It="viewport",Ne="popper",Si="reference",Nt=$e.reduce(function(i,e){return i.concat([e+"-"+pe,e+"-"+Ie])},[]),Pt=[].concat($e,[rt]).reduce(function(i,e){return i.concat([e,e+"-"+pe,e+"-"+Ie])},[]),Di="beforeRead",Ii="afterRead",Ni="beforeMain",Mi="afterMain",ji="beforeWrite",Hi="afterWrite",Wi=[Di,"read",Ii,Ni,"main",Mi,ji,"write",Hi];function Z(i){return i?(i.nodeName||"").toLowerCase():null}function H(i){if(null==i)return window;if("[object Window]"!==i.toString()){var e=i.ownerDocument;return e&&e.defaultView||window}return i}function me(i){return i instanceof H(i).Element||i instanceof Element}function R(i){return i instanceof H(i).HTMLElement||i instanceof HTMLElement}function Mt(i){return typeof ShadowRoot<"u"&&(i instanceof H(i).ShadowRoot||i instanceof ShadowRoot)}const jt={name:"applyStyles",enabled:!0,phase:"write",fn:function(i){var e=i.state;Object.keys(e.elements).forEach(function(t){var n=e.styles[t]||{},s=e.attributes[t]||{},o=e.elements[t];R(o)&&Z(o)&&(Object.assign(o.style,n),Object.keys(s).forEach(function(r){var a=s[r];!1===a?o.removeAttribute(r):o.setAttribute(r,!0===a?"":a)}))})},effect:function(i){var e=i.state,t={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,t.popper),e.styles=t,e.elements.arrow&&Object.assign(e.elements.arrow.style,t.arrow),function(){Object.keys(e.elements).forEach(function(n){var s=e.elements[n],o=e.attributes[n]||{},r=Object.keys(e.styles.hasOwnProperty(n)?e.styles[n]:t[n]).reduce(function(a,c){return a[c]="",a},{});R(s)&&Z(s)&&(Object.assign(s.style,r),Object.keys(o).forEach(function(a){s.removeAttribute(a)}))})}},requires:["computeStyles"]};function J(i){return i.split("-")[0]}var ge=Math.max,at=Math.min,Pe=Math.round;function Ft(){var i=navigator.userAgentData;return null!=i&&i.brands&&Array.isArray(i.brands)?i.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function Bi(){return!/^((?!chrome|android).)*safari/i.test(Ft())}function Me(i,e,t){void 0===e&&(e=!1),void 0===t&&(t=!1);var n=i.getBoundingClientRect(),s=1,o=1;e&&R(i)&&(s=i.offsetWidth>0&&Pe(n.width)/i.offsetWidth||1,o=i.offsetHeight>0&&Pe(n.height)/i.offsetHeight||1);var r=(me(i)?H(i):window).visualViewport,a=!Bi()&&t,c=(n.left+(a&&r?r.offsetLeft:0))/s,d=(n.top+(a&&r?r.offsetTop:0))/o,u=n.width/s,h=n.height/o;return{width:u,height:h,top:d,right:c+u,bottom:d+h,left:c,x:c,y:d}}function Ht(i){var e=Me(i),t=i.offsetWidth,n=i.offsetHeight;return Math.abs(e.width-t)<=1&&(t=e.width),Math.abs(e.height-n)<=1&&(n=e.height),{x:i.offsetLeft,y:i.offsetTop,width:t,height:n}}function zi(i,e){var t=e.getRootNode&&e.getRootNode();if(i.contains(e))return!0;if(t&&Mt(t)){var n=e;do{if(n&&i.isSameNode(n))return!0;n=n.parentNode||n.host}while(n)}return!1}function se(i){return H(i).getComputedStyle(i)}function Ps(i){return["table","td","th"].indexOf(Z(i))>=0}function he(i){return((me(i)?i.ownerDocument:i.document)||window.document).documentElement}function lt(i){return"html"===Z(i)?i:i.assignedSlot||i.parentNode||(Mt(i)?i.host:null)||he(i)}function Ri(i){return R(i)&&"fixed"!==se(i).position?i.offsetParent:null}function Ue(i){for(var e=H(i),t=Ri(i);t&&Ps(t)&&"static"===se(t).position;)t=Ri(t);return t&&("html"===Z(t)||"body"===Z(t)&&"static"===se(t).position)?e:t||function(n){var s=/firefox/i.test(Ft());if(/Trident/i.test(Ft())&&R(n)&&"fixed"===se(n).position)return null;var o=lt(n);for(Mt(o)&&(o=o.host);R(o)&&["html","body"].indexOf(Z(o))<0;){var r=se(o);if("none"!==r.transform||"none"!==r.perspective||"paint"===r.contain||-1!==["transform","perspective"].indexOf(r.willChange)||s&&"filter"===r.willChange||s&&r.filter&&"none"!==r.filter)return o;o=o.parentNode}return null}(i)||e}function Wt(i){return["top","bottom"].indexOf(i)>=0?"x":"y"}function Ye(i,e,t){return ge(i,at(e,t))}function qi(i){return Object.assign({},{top:0,right:0,bottom:0,left:0},i)}function Vi(i,e){return e.reduce(function(t,n){return t[n]=i,t},{})}const Ki={name:"arrow",enabled:!0,phase:"main",fn:function(i){var e,O,T,t=i.state,n=i.name,s=i.options,o=t.elements.arrow,r=t.modifiersData.popperOffsets,a=J(t.placement),c=Wt(a),d=[I,F].indexOf(a)>=0?"height":"width";if(o&&r){var u=(T=t,qi("number"!=typeof(O="function"==typeof(O=s.padding)?O(Object.assign({},T.rects,{placement:T.placement})):O)?O:Vi(O,$e))),h=Ht(o),b="y"===c?$:I,p="y"===c?j:F,g=t.rects.reference[d]+t.rects.reference[c]-r[c]-t.rects.popper[d],m=r[c]-t.rects.reference[c],_=Ue(o),C=_?"y"===c?_.clientHeight||0:_.clientWidth||0:0,v=C/2-h[d]/2+(g/2-m/2),w=Ye(u[b],v,C-h[d]-u[p]);t.modifiersData[n]=((e={})[c]=w,e.centerOffset=w-v,e)}},effect:function(i){var e=i.state,t=i.options.element,n=void 0===t?"[data-popper-arrow]":t;null!=n&&("string"!=typeof n||(n=e.elements.popper.querySelector(n)))&&zi(e.elements.popper,n)&&(e.elements.arrow=n)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function je(i){return i.split("-")[1]}var Ms={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Xi(i){var e,t=i.popper,n=i.popperRect,s=i.placement,o=i.variation,r=i.offsets,a=i.position,c=i.gpuAcceleration,d=i.adaptive,u=i.roundOffsets,h=i.isFixed,b=r.x,p=void 0===b?0:b,g=r.y,m=void 0===g?0:g,_="function"==typeof u?u({x:p,y:m}):{x:p,y:m};p=_.x,m=_.y;var C=r.hasOwnProperty("x"),k=r.hasOwnProperty("y"),y=I,E=$,v=window;if(d){var w=Ue(t),A="clientHeight",O="clientWidth";w===H(t)&&"static"!==se(w=he(t)).position&&"absolute"===a&&(A="scrollHeight",O="scrollWidth"),(s===$||(s===I||s===F)&&o===Ie)&&(E=j,m-=(h&&w===v&&v.visualViewport?v.visualViewport.height:w[A])-n.height,m*=c?1:-1),s!==I&&(s!==$&&s!==j||o!==Ie)||(y=F,p-=(h&&w===v&&v.visualViewport?v.visualViewport.width:w[O])-n.width,p*=c?1:-1)}var T,G,N,K,L,S=Object.assign({position:a},d&&Ms),W=!0===u?(G={x:p,y:m},N=H(t),K=G.y,{x:Pe(G.x*(L=N.devicePixelRatio||1))/L||0,y:Pe(K*L)/L||0}):{x:p,y:m};return p=W.x,m=W.y,Object.assign({},S,c?((T={})[E]=k?"0":"",T[y]=C?"0":"",T.transform=(v.devicePixelRatio||1)<=1?"translate("+p+"px, "+m+"px)":"translate3d("+p+"px, "+m+"px, 0)",T):((e={})[E]=k?m+"px":"",e[y]=C?p+"px":"",e.transform="",e))}const Bt={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(i){var e=i.state,t=i.options,n=t.gpuAcceleration,s=void 0===n||n,o=t.adaptive,r=void 0===o||o,a=t.roundOffsets,c=void 0===a||a,d={placement:J(e.placement),variation:je(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:s,isFixed:"fixed"===e.options.strategy};null!=e.modifiersData.popperOffsets&&(e.styles.popper=Object.assign({},e.styles.popper,Xi(Object.assign({},d,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:r,roundOffsets:c})))),null!=e.modifiersData.arrow&&(e.styles.arrow=Object.assign({},e.styles.arrow,Xi(Object.assign({},d,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:c})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})},data:{}};var ct={passive:!0};const zt={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(i){var e=i.state,t=i.instance,n=i.options,s=n.scroll,o=void 0===s||s,r=n.resize,a=void 0===r||r,c=H(e.elements.popper),d=[].concat(e.scrollParents.reference,e.scrollParents.popper);return o&&d.forEach(function(u){u.addEventListener("scroll",t.update,ct)}),a&&c.addEventListener("resize",t.update,ct),function(){o&&d.forEach(function(u){u.removeEventListener("scroll",t.update,ct)}),a&&c.removeEventListener("resize",t.update,ct)}},data:{}};var js={left:"right",right:"left",bottom:"top",top:"bottom"};function ht(i){return i.replace(/left|right|bottom|top/g,function(e){return js[e]})}var Fs={start:"end",end:"start"};function Ui(i){return i.replace(/start|end/g,function(e){return Fs[e]})}function Rt(i){var e=H(i);return{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function qt(i){return Me(he(i)).left+Rt(i).scrollLeft}function Vt(i){var e=se(i);return/auto|scroll|overlay|hidden/.test(e.overflow+e.overflowY+e.overflowX)}function Yi(i){return["html","body","#document"].indexOf(Z(i))>=0?i.ownerDocument.body:R(i)&&Vt(i)?i:Yi(lt(i))}function Qe(i,e){var t;void 0===e&&(e=[]);var n=Yi(i),s=n===(null==(t=i.ownerDocument)?void 0:t.body),o=H(n),r=s?[o].concat(o.visualViewport||[],Vt(n)?n:[]):n,a=e.concat(r);return s?a:a.concat(Qe(lt(r)))}function Kt(i){return Object.assign({},i,{left:i.x,top:i.y,right:i.x+i.width,bottom:i.y+i.height})}function Qi(i,e,t){return e===It?Kt(function(n,s){var o=H(n),r=he(n),a=o.visualViewport,c=r.clientWidth,d=r.clientHeight,u=0,h=0;if(a){c=a.width,d=a.height;var b=Bi();(b||!b&&"fixed"===s)&&(u=a.offsetLeft,h=a.offsetTop)}return{width:c,height:d,x:u+qt(n),y:h}}(i,t)):me(e)?((o=Me(n=e,!1,"fixed"===t)).top=o.top+n.clientTop,o.left=o.left+n.clientLeft,o.bottom=o.top+n.clientHeight,o.right=o.left+n.clientWidth,o.width=n.clientWidth,o.height=n.clientHeight,o.x=o.left,o.y=o.top,o):Kt(function(n){var s,o=he(n),r=Rt(n),a=null==(s=n.ownerDocument)?void 0:s.body,c=ge(o.scrollWidth,o.clientWidth,a?a.scrollWidth:0,a?a.clientWidth:0),d=ge(o.scrollHeight,o.clientHeight,a?a.scrollHeight:0,a?a.clientHeight:0),u=-r.scrollLeft+qt(n),h=-r.scrollTop;return"rtl"===se(a||o).direction&&(u+=ge(o.clientWidth,a?a.clientWidth:0)-c),{width:c,height:d,x:u,y:h}}(he(i)));var n,o}function Gi(i){var e,t=i.reference,n=i.element,s=i.placement,o=s?J(s):null,r=s?je(s):null,a=t.x+t.width/2-n.width/2,c=t.y+t.height/2-n.height/2;switch(o){case $:e={x:a,y:t.y-n.height};break;case j:e={x:a,y:t.y+t.height};break;case F:e={x:t.x+t.width,y:c};break;case I:e={x:t.x-n.width,y:c};break;default:e={x:t.x,y:t.y}}var d=o?Wt(o):null;if(null!=d){var u="y"===d?"height":"width";switch(r){case pe:e[d]=e[d]-(t[u]/2-n[u]/2);break;case Ie:e[d]=e[d]+(t[u]/2-n[u]/2)}}return e}function Fe(i,e){void 0===e&&(e={});var N,V,K,L,x,P,X,ee,te,D,n=e.placement,s=void 0===n?i.placement:n,o=e.strategy,r=void 0===o?i.strategy:o,a=e.boundary,c=void 0===a?Li:a,d=e.rootBoundary,u=void 0===d?It:d,h=e.elementContext,b=void 0===h?Ne:h,p=e.altBoundary,g=void 0!==p&&p,m=e.padding,_=void 0===m?0:m,C=qi("number"!=typeof _?_:Vi(_,$e)),y=i.rects.popper,E=i.elements[g?b===Ne?Si:Ne:b],v=(N=me(E)?E:E.contextElement||he(i.elements.popper),K=u,L=r,ee="clippingParents"===(V=c)?(P=Qe(lt(x=N)),me(X=["absolute","fixed"].indexOf(se(x).position)>=0&&R(x)?Ue(x):x)?P.filter(function(ue){return me(ue)&&zi(ue,X)&&"body"!==Z(ue)}):[]):[].concat(V),D=(te=[].concat(ee,[K])).reduce(function(x,P){var X=Qi(N,P,L);return x.top=ge(X.top,x.top),x.right=at(X.right,x.right),x.bottom=at(X.bottom,x.bottom),x.left=ge(X.left,x.left),x},Qi(N,te[0],L)),D.width=D.right-D.left,D.height=D.bottom-D.top,D.x=D.left,D.y=D.top,D),w=Me(i.elements.reference),A=Gi({reference:w,element:y,strategy:"absolute",placement:s}),O=Kt(Object.assign({},y,A)),T=b===Ne?O:w,S={top:v.top-T.top+C.top,bottom:T.bottom-v.bottom+C.bottom,left:v.left-T.left+C.left,right:T.right-v.right+C.right},W=i.modifiersData.offset;if(b===Ne&&W){var G=W[s];Object.keys(S).forEach(function(N){var V=[F,j].indexOf(N)>=0?1:-1,K=[$,j].indexOf(N)>=0?"y":"x";S[N]+=G[K]*V})}return S}const Zi={name:"flip",enabled:!0,phase:"main",fn:function(i){var e=i.state,t=i.options,n=i.name;if(!e.modifiersData[n]._skip){for(var s=t.mainAxis,o=void 0===s||s,r=t.altAxis,a=void 0===r||r,c=t.fallbackPlacements,d=t.padding,u=t.boundary,h=t.rootBoundary,b=t.altBoundary,p=t.flipVariations,g=void 0===p||p,m=t.allowedAutoPlacements,_=e.options.placement,C=J(_),k=c||(C!==_&&g?function(x){if(J(x)===rt)return[];var P=ht(x);return[Ui(x),P,Ui(P)]}(_):[ht(_)]),y=[_].concat(k).reduce(function(x,P){return x.concat(J(P)===rt?function Hs(i,e){void 0===e&&(e={});var s=e.boundary,o=e.rootBoundary,r=e.padding,a=e.flipVariations,c=e.allowedAutoPlacements,d=void 0===c?Pt:c,u=je(e.placement),h=u?a?Nt:Nt.filter(function(g){return je(g)===u}):$e,b=h.filter(function(g){return d.indexOf(g)>=0});0===b.length&&(b=h);var p=b.reduce(function(g,m){return g[m]=Fe(i,{placement:m,boundary:s,rootBoundary:o,padding:r})[J(m)],g},{});return Object.keys(p).sort(function(g,m){return p[g]-p[m]})}(e,{placement:P,boundary:u,rootBoundary:h,padding:d,flipVariations:g,allowedAutoPlacements:m}):P)},[]),E=e.rects.reference,v=e.rects.popper,w=new Map,A=!0,O=y[0],T=0;T=0,V=N?"width":"height",K=Fe(e,{placement:S,boundary:u,rootBoundary:h,altBoundary:b,padding:d}),L=N?G?F:I:G?j:$;E[V]>v[V]&&(L=ht(L));var ee=ht(L),te=[];if(o&&te.push(K[W]<=0),a&&te.push(K[L]<=0,K[ee]<=0),te.every(function(x){return x})){O=S,A=!1;break}w.set(S,te)}if(A)for(var Be=function(x){var P=y.find(function(X){var ue=w.get(X);if(ue)return ue.slice(0,x).every(function(vt){return vt})});if(P)return O=P,"break"},D=g?3:1;D>0&&"break"!==Be(D);D--);e.placement!==O&&(e.modifiersData[n]._skip=!0,e.placement=O,e.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function Ji(i,e,t){return void 0===t&&(t={x:0,y:0}),{top:i.top-e.height-t.y,right:i.right-e.width+t.x,bottom:i.bottom-e.height+t.y,left:i.left-e.width-t.x}}function en(i){return[$,F,j,I].some(function(e){return i[e]>=0})}const tn={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(i){var e=i.state,t=i.name,n=e.rects.reference,s=e.rects.popper,o=e.modifiersData.preventOverflow,r=Fe(e,{elementContext:"reference"}),a=Fe(e,{altBoundary:!0}),c=Ji(r,n),d=Ji(a,s,o),u=en(c),h=en(d);e.modifiersData[t]={referenceClippingOffsets:c,popperEscapeOffsets:d,isReferenceHidden:u,hasPopperEscaped:h},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":h})}},nn={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(i){var e=i.state,n=i.name,s=i.options.offset,o=void 0===s?[0,0]:s,r=Pt.reduce(function(u,h){return u[h]=(p=e.rects,g=o,m=J(b=h),_=[I,$].indexOf(m)>=0?-1:1,k=(k=(C="function"==typeof g?g(Object.assign({},p,{placement:b})):g)[0])||0,y=((y=C[1])||0)*_,[I,F].indexOf(m)>=0?{x:y,y:k}:{x:k,y}),u;var b,p,g,m,_,C,k,y},{}),a=r[e.placement],d=a.y;null!=e.modifiersData.popperOffsets&&(e.modifiersData.popperOffsets.x+=a.x,e.modifiersData.popperOffsets.y+=d),e.modifiersData[n]=r}},Xt={name:"popperOffsets",enabled:!0,phase:"read",fn:function(i){var e=i.state;e.modifiersData[i.name]=Gi({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})},data:{}},sn={name:"preventOverflow",enabled:!0,phase:"main",fn:function(i){var li,ts,e=i.state,t=i.options,n=i.name,s=t.mainAxis,o=void 0===s||s,r=t.altAxis,a=void 0!==r&&r,b=t.tether,p=void 0===b||b,g=t.tetherOffset,m=void 0===g?0:g,_=Fe(e,{boundary:t.boundary,rootBoundary:t.rootBoundary,padding:t.padding,altBoundary:t.altBoundary}),C=J(e.placement),k=je(e.placement),y=!k,E=Wt(C),v="x"===E?"y":"x",w=e.modifiersData.popperOffsets,A=e.rects.reference,O=e.rects.popper,T="function"==typeof m?m(Object.assign({},e.rects,{placement:e.placement})):m,S="number"==typeof T?{mainAxis:T,altAxis:T}:Object.assign({mainAxis:0,altAxis:0},T),W=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,G={x:0,y:0};if(w){if(o){var N,V="y"===E?$:I,K="y"===E?j:F,L="y"===E?"height":"width",ee=w[E],te=ee+_[V],Be=ee-_[K],D=p?-O[L]/2:0,x=k===pe?A[L]:O[L],P=k===pe?-O[L]:-A[L],X=e.elements.arrow,ue=p&&X?Ht(X):{width:0,height:0},vt=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},qn=vt[V],Vn=vt[K],yt=Ye(0,A[L],ue[L]),mr=y?A[L]/2-D-yt-qn-S.mainAxis:x-yt-qn-S.mainAxis,gr=y?-A[L]/2+D+yt+Vn+S.mainAxis:P+yt+Vn+S.mainAxis,ri=e.elements.arrow&&Ue(e.elements.arrow),_r=ri?"y"===E?ri.clientTop||0:ri.clientLeft||0:0,Kn=null!=(N=W?.[E])?N:0,br=ee+gr-Kn,Xn=Ye(p?at(te,ee+mr-Kn-_r):te,ee,p?ge(Be,br):Be);w[E]=Xn,G[E]=Xn-ee}if(a){var Un,Te=w[v],wt="y"===v?"height":"width",Yn=Te+_["x"===E?$:I],Qn=Te-_["x"===E?j:F],ai=-1!==[$,I].indexOf(C),Gn=null!=(Un=W?.[v])?Un:0,Zn=ai?Yn:Te-A[wt]-O[wt]-Gn+S.altAxis,Jn=ai?Te+A[wt]+O[wt]-Gn-S.altAxis:Qn,es=p&&ai?(ts=Ye(Zn,Te,li=Jn))>li?li:ts:Ye(p?Zn:Yn,Te,p?Jn:Qn);w[v]=es,G[v]=es-Te}e.modifiersData[n]=G}},requiresIfExists:["offset"]};function Ws(i,e,t){void 0===t&&(t=!1);var n,s,h,b,p,g,o=R(e),r=R(e)&&(b=(h=e).getBoundingClientRect(),p=Pe(b.width)/h.offsetWidth||1,g=Pe(b.height)/h.offsetHeight||1,1!==p||1!==g),a=he(e),c=Me(i,r,t),d={scrollLeft:0,scrollTop:0},u={x:0,y:0};return(o||!o&&!t)&&(("body"!==Z(e)||Vt(a))&&(d=(n=e)!==H(n)&&R(n)?{scrollLeft:(s=n).scrollLeft,scrollTop:s.scrollTop}:Rt(n)),R(e)?((u=Me(e,!0)).x+=e.clientLeft,u.y+=e.clientTop):a&&(u.x=qt(a))),{x:c.left+d.scrollLeft-u.x,y:c.top+d.scrollTop-u.y,width:c.width,height:c.height}}function Bs(i){var e=new Map,t=new Set,n=[];function s(o){t.add(o.name),[].concat(o.requires||[],o.requiresIfExists||[]).forEach(function(r){if(!t.has(r)){var a=e.get(r);a&&s(a)}}),n.push(o)}return i.forEach(function(o){e.set(o.name,o)}),i.forEach(function(o){t.has(o.name)||s(o)}),n}var on={placement:"bottom",modifiers:[],strategy:"absolute"};function rn(){for(var i=arguments.length,e=new Array(i),t=0;tNumber.parseInt(t,10)):"function"==typeof e?t=>e(t,this._element):e}_getPopperConfig(){const e={placement:this._getPlacement(),modifiers:[{name:"preventOverflow",options:{boundary:this._config.boundary}},{name:"offset",options:{offset:this._getOffset()}}]};return(this._inNavbar||"static"===this._config.display)&&(ne.setDataAttribute(this._menu,"popper","static"),e.modifiers=[{name:"applyStyles",enabled:!1}]),{...e,...M(this._config.popperConfig,[e])}}_selectMenuItem({key:e,target:t}){const n=f.find(".dropdown-menu .dropdown-item:not(.disabled):not(:disabled)",this._menu).filter(s=>Ce(s));n.length&&Tt(n,t,e===cn,!n.includes(t)).focus()}static jQueryInterface(e){return this.each(function(){const t=Q.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===t[e])throw new TypeError(`No method named "${e}"`);t[e]()}})}static clearMenus(e){if(2===e.button||"keyup"===e.type&&"Tab"!==e.key)return;const t=f.find(Qs);for(const n of t){const s=Q.getInstance(n);if(!s||!1===s._config.autoClose)continue;const o=e.composedPath(),r=o.includes(s._menu);if(o.includes(s._element)||"inside"===s._config.autoClose&&!r||"outside"===s._config.autoClose&&r||s._menu.contains(e.target)&&("keyup"===e.type&&"Tab"===e.key||/input|select|option|textarea|form/i.test(e.target.tagName)))continue;const a={relatedTarget:s._element};"click"===e.type&&(a.clickEvent=e),s._completeHide(a)}}static dataApiKeydownHandler(e){const t=/input|textarea/i.test(e.target.tagName),n="Escape"===e.key,s=[qs,cn].includes(e.key);if(!s&&!n||t&&!n)return;e.preventDefault();const o=this.matches(be)?this:f.prev(this,be)[0]||f.next(this,be)[0]||f.findOne(be,e.delegateTarget.parentNode),r=Q.getOrCreateInstance(o);if(s)return e.stopPropagation(),r.show(),void r._selectMenuItem(e);r._isShown()&&(e.stopPropagation(),r.hide(),o.focus())}}l.on(document,dn,be,Q.dataApiKeydownHandler),l.on(document,dn,ut,Q.dataApiKeydownHandler),l.on(document,hn,Q.clearMenus),l.on(document,Ys,Q.clearMenus),l.on(document,hn,be,function(i){i.preventDefault(),Q.getOrCreateInstance(this).toggle()}),z(Q);const un="backdrop",pn=`mousedown.bs.${un}`,oo={className:"modal-backdrop",clickCallback:null,isAnimated:!1,isVisible:!0,rootElement:"body"},ro={className:"string",clickCallback:"(function|null)",isAnimated:"boolean",isVisible:"boolean",rootElement:"(element|string)"};class mn extends Re{constructor(e){super(),this._config=this._getConfig(e),this._isAppended=!1,this._element=null}static get Default(){return oo}static get DefaultType(){return ro}static get NAME(){return un}show(e){if(!this._config.isVisible)return void M(e);this._append();this._getElement().classList.add("show"),this._emulateAnimation(()=>{M(e)})}hide(e){this._config.isVisible?(this._getElement().classList.remove("show"),this._emulateAnimation(()=>{this.dispose(),M(e)})):M(e)}dispose(){this._isAppended&&(l.off(this._element,pn),this._element.remove(),this._isAppended=!1)}_getElement(){if(!this._element){const e=document.createElement("div");e.className=this._config.className,this._config.isAnimated&&e.classList.add("fade"),this._element=e}return this._element}_configAfterMerge(e){return e.rootElement=ae(e.rootElement),e}_append(){if(this._isAppended)return;const e=this._getElement();this._config.rootElement.append(e),l.on(e,pn,()=>{M(this._config.clickCallback)}),this._isAppended=!0}_emulateAnimation(e){fi(e,this._getElement(),this._config.isAnimated)}}const ft=".bs.focustrap",ao=`focusin${ft}`,lo=`keydown.tab${ft}`,gn="backward",co={autofocus:!0,trapElement:null},ho={autofocus:"boolean",trapElement:"element"};class _n extends Re{constructor(e){super(),this._config=this._getConfig(e),this._isActive=!1,this._lastTabNavDirection=null}static get Default(){return co}static get DefaultType(){return ho}static get NAME(){return"focustrap"}activate(){this._isActive||(this._config.autofocus&&this._config.trapElement.focus(),l.off(document,ft),l.on(document,ao,e=>this._handleFocusin(e)),l.on(document,lo,e=>this._handleKeydown(e)),this._isActive=!0)}deactivate(){this._isActive&&(this._isActive=!1,l.off(document,ft))}_handleFocusin(e){const{trapElement:t}=this._config;if(e.target===document||e.target===t||t.contains(e.target))return;const n=f.focusableChildren(t);0===n.length?t.focus():this._lastTabNavDirection===gn?n[n.length-1].focus():n[0].focus()}_handleKeydown(e){"Tab"===e.key&&(this._lastTabNavDirection=e.shiftKey?gn:"forward")}}const bn=".fixed-top, .fixed-bottom, .is-fixed, .sticky-top",vn=".sticky-top",pt="padding-right",yn="margin-right";class Qt{constructor(){this._element=document.body}getWidth(){const e=document.documentElement.clientWidth;return Math.abs(window.innerWidth-e)}hide(){const e=this.getWidth();this._disableOverFlow(),this._setElementAttributes(this._element,pt,t=>t+e),this._setElementAttributes(bn,pt,t=>t+e),this._setElementAttributes(vn,yn,t=>t-e)}reset(){this._resetElementAttributes(this._element,"overflow"),this._resetElementAttributes(this._element,pt),this._resetElementAttributes(bn,pt),this._resetElementAttributes(vn,yn)}isOverflowing(){return this.getWidth()>0}_disableOverFlow(){this._saveInitialAttribute(this._element,"overflow"),this._element.style.overflow="hidden"}_setElementAttributes(e,t,n){const s=this.getWidth();this._applyManipulationCallback(e,o=>{if(o!==this._element&&window.innerWidth>o.clientWidth+s)return;this._saveInitialAttribute(o,t);const r=window.getComputedStyle(o).getPropertyValue(t);o.style.setProperty(t,`${n(Number.parseFloat(r))}px`)})}_saveInitialAttribute(e,t){const n=e.style.getPropertyValue(t);n&&ne.setDataAttribute(e,t,n)}_resetElementAttributes(e,t){this._applyManipulationCallback(e,n=>{const s=ne.getDataAttribute(n,t);null!==s?(ne.removeDataAttribute(n,t),n.style.setProperty(t,s)):n.style.removeProperty(t)})}_applyManipulationCallback(e,t){if(ie(e))t(e);else for(const n of f.find(e,this._element))t(n)}}const q=".bs.modal",uo=`hide${q}`,fo=`hidePrevented${q}`,wn=`hidden${q}`,En=`show${q}`,po=`shown${q}`,mo=`resize${q}`,go=`click.dismiss${q}`,_o=`mousedown.dismiss${q}`,bo=`keydown.dismiss${q}`,vo=`click${q}.data-api`,An="modal-open",Gt="modal-static",yo={backdrop:!0,focus:!0,keyboard:!0},wo={backdrop:"(boolean|string)",focus:"boolean",keyboard:"boolean"};class ve extends Y{constructor(e,t){super(e,t),this._dialog=f.findOne(".modal-dialog",this._element),this._backdrop=this._initializeBackDrop(),this._focustrap=this._initializeFocusTrap(),this._isShown=!1,this._isTransitioning=!1,this._scrollBar=new Qt,this._addEventListeners()}static get Default(){return yo}static get DefaultType(){return wo}static get NAME(){return"modal"}toggle(e){return this._isShown?this.hide():this.show(e)}show(e){this._isShown||this._isTransitioning||l.trigger(this._element,En,{relatedTarget:e}).defaultPrevented||(this._isShown=!0,this._isTransitioning=!0,this._scrollBar.hide(),document.body.classList.add(An),this._adjustDialog(),this._backdrop.show(()=>this._showElement(e)))}hide(){this._isShown&&!this._isTransitioning&&(l.trigger(this._element,uo).defaultPrevented||(this._isShown=!1,this._isTransitioning=!0,this._focustrap.deactivate(),this._element.classList.remove("show"),this._queueCallback(()=>this._hideModal(),this._element,this._isAnimated())))}dispose(){l.off(window,q),l.off(this._dialog,q),this._backdrop.dispose(),this._focustrap.deactivate(),super.dispose()}handleUpdate(){this._adjustDialog()}_initializeBackDrop(){return new mn({isVisible:!!this._config.backdrop,isAnimated:this._isAnimated()})}_initializeFocusTrap(){return new _n({trapElement:this._element})}_showElement(e){document.body.contains(this._element)||document.body.append(this._element),this._element.style.display="block",this._element.removeAttribute("aria-hidden"),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),this._element.scrollTop=0;const t=f.findOne(".modal-body",this._dialog);t&&(t.scrollTop=0),this._element.classList.add("show"),this._queueCallback(()=>{this._config.focus&&this._focustrap.activate(),this._isTransitioning=!1,l.trigger(this._element,po,{relatedTarget:e})},this._dialog,this._isAnimated())}_addEventListeners(){l.on(this._element,bo,e=>{"Escape"===e.key&&(this._config.keyboard?this.hide():this._triggerBackdropTransition())}),l.on(window,mo,()=>{this._isShown&&!this._isTransitioning&&this._adjustDialog()}),l.on(this._element,_o,e=>{l.one(this._element,go,t=>{this._element===e.target&&this._element===t.target&&("static"!==this._config.backdrop?this._config.backdrop&&this.hide():this._triggerBackdropTransition())})})}_hideModal(){this._element.style.display="none",this._element.setAttribute("aria-hidden",!0),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._isTransitioning=!1,this._backdrop.hide(()=>{document.body.classList.remove(An),this._resetAdjustments(),this._scrollBar.reset(),l.trigger(this._element,wn)})}_isAnimated(){return this._element.classList.contains("fade")}_triggerBackdropTransition(){if(l.trigger(this._element,fo).defaultPrevented)return;const e=this._element.scrollHeight>document.documentElement.clientHeight,t=this._element.style.overflowY;"hidden"===t||this._element.classList.contains(Gt)||(e||(this._element.style.overflowY="hidden"),this._element.classList.add(Gt),this._queueCallback(()=>{this._element.classList.remove(Gt),this._queueCallback(()=>{this._element.style.overflowY=t},this._dialog)},this._dialog),this._element.focus())}_adjustDialog(){const e=this._element.scrollHeight>document.documentElement.clientHeight,t=this._scrollBar.getWidth(),n=t>0;if(n&&!e){const s=B()?"paddingLeft":"paddingRight";this._element.style[s]=`${t}px`}if(!n&&e){const s=B()?"paddingRight":"paddingLeft";this._element.style[s]=`${t}px`}}_resetAdjustments(){this._element.style.paddingLeft="",this._element.style.paddingRight=""}static jQueryInterface(e,t){return this.each(function(){const n=ve.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===n[e])throw new TypeError(`No method named "${e}"`);n[e](t)}})}}l.on(document,vo,'[data-bs-toggle="modal"]',function(i){const e=f.getElementFromSelector(this);["A","AREA"].includes(this.tagName)&&i.preventDefault(),l.one(e,En,n=>{n.defaultPrevented||l.one(e,wn,()=>{Ce(this)&&this.focus()})});const t=f.findOne(".modal.show");t&&ve.getInstance(t).hide(),ve.getOrCreateInstance(e).toggle(this)}),tt(ve),z(ve);const oe=".bs.offcanvas",Cn=".data-api",Eo=`load${oe}${Cn}`,xn="showing",Ln=".offcanvas.show",Ao=`show${oe}`,To=`shown${oe}`,Co=`hide${oe}`,Sn=`hidePrevented${oe}`,Dn=`hidden${oe}`,Oo=`resize${oe}`,xo=`click${oe}${Cn}`,ko=`keydown.dismiss${oe}`,Lo={backdrop:!0,keyboard:!0,scroll:!1},So={backdrop:"(boolean|string)",keyboard:"boolean",scroll:"boolean"};class re extends Y{constructor(e,t){super(e,t),this._isShown=!1,this._backdrop=this._initializeBackDrop(),this._focustrap=this._initializeFocusTrap(),this._addEventListeners()}static get Default(){return Lo}static get DefaultType(){return So}static get NAME(){return"offcanvas"}toggle(e){return this._isShown?this.hide():this.show(e)}show(e){this._isShown||l.trigger(this._element,Ao,{relatedTarget:e}).defaultPrevented||(this._isShown=!0,this._backdrop.show(),this._config.scroll||(new Qt).hide(),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),this._element.classList.add(xn),this._queueCallback(()=>{this._config.scroll&&!this._config.backdrop||this._focustrap.activate(),this._element.classList.add("show"),this._element.classList.remove(xn),l.trigger(this._element,To,{relatedTarget:e})},this._element,!0))}hide(){this._isShown&&(l.trigger(this._element,Co).defaultPrevented||(this._focustrap.deactivate(),this._element.blur(),this._isShown=!1,this._element.classList.add("hiding"),this._backdrop.hide(),this._queueCallback(()=>{this._element.classList.remove("show","hiding"),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._config.scroll||(new Qt).reset(),l.trigger(this._element,Dn)},this._element,!0)))}dispose(){this._backdrop.dispose(),this._focustrap.deactivate(),super.dispose()}_initializeBackDrop(){const e=!!this._config.backdrop;return new mn({className:"offcanvas-backdrop",isVisible:e,isAnimated:!0,rootElement:this._element.parentNode,clickCallback:e?()=>{"static"!==this._config.backdrop?this.hide():l.trigger(this._element,Sn)}:null})}_initializeFocusTrap(){return new _n({trapElement:this._element})}_addEventListeners(){l.on(this._element,ko,e=>{"Escape"===e.key&&(this._config.keyboard?this.hide():l.trigger(this._element,Sn))})}static jQueryInterface(e){return this.each(function(){const t=re.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===t[e]||e.startsWith("_")||"constructor"===e)throw new TypeError(`No method named "${e}"`);t[e](this)}})}}l.on(document,xo,'[data-bs-toggle="offcanvas"]',function(i){const e=f.getElementFromSelector(this);if(["A","AREA"].includes(this.tagName)&&i.preventDefault(),le(this))return;l.one(e,Dn,()=>{Ce(this)&&this.focus()});const t=f.findOne(Ln);t&&t!==e&&re.getInstance(t).hide(),re.getOrCreateInstance(e).toggle(this)}),l.on(window,Eo,()=>{for(const i of f.find(Ln))re.getOrCreateInstance(i).show()}),l.on(window,Oo,()=>{for(const i of f.find("[aria-modal][class*=show][class*=offcanvas-]"))"fixed"!==getComputedStyle(i).position&&re.getOrCreateInstance(i).hide()}),tt(re),z(re);const $n={"*":["class","dir","id","lang","role",/^aria-[\w-]*$/i],a:["target","href","title","rel"],area:[],b:[],br:[],col:[],code:[],dd:[],div:[],dl:[],dt:[],em:[],hr:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],i:[],img:["src","srcset","alt","title","width","height"],li:[],ol:[],p:[],pre:[],s:[],small:[],span:[],sub:[],sup:[],strong:[],u:[],ul:[]},Do=new Set(["background","cite","href","itemtype","longdesc","poster","src","xlink:href"]),$o=/^(?!javascript:)(?:[a-z0-9+.-]+:|[^&:/?#]*(?:[/?#]|$))/i,Io=(i,e)=>{const t=i.nodeName.toLowerCase();return e.includes(t)?!Do.has(t)||!!$o.test(i.nodeValue):e.filter(n=>n instanceof RegExp).some(n=>n.test(t))},No={allowList:$n,content:{},extraClass:"",html:!1,sanitize:!0,sanitizeFn:null,template:"
"},Po={allowList:"object",content:"object",extraClass:"(string|function)",html:"boolean",sanitize:"boolean",sanitizeFn:"(null|function)",template:"string"},Mo={entry:"(string|element|function|null)",selector:"(string|element)"};class jo extends Re{constructor(e){super(),this._config=this._getConfig(e)}static get Default(){return No}static get DefaultType(){return Po}static get NAME(){return"TemplateFactory"}getContent(){return Object.values(this._config.content).map(e=>this._resolvePossibleFunction(e)).filter(Boolean)}hasContent(){return this.getContent().length>0}changeContent(e){return this._checkContent(e),this._config.content={...this._config.content,...e},this}toHtml(){const e=document.createElement("div");e.innerHTML=this._maybeSanitize(this._config.template);for(const[s,o]of Object.entries(this._config.content))this._setContent(e,o,s);const t=e.children[0],n=this._resolvePossibleFunction(this._config.extraClass);return n&&t.classList.add(...n.split(" ")),t}_typeCheckConfig(e){super._typeCheckConfig(e),this._checkContent(e.content)}_checkContent(e){for(const[t,n]of Object.entries(e))super._typeCheckConfig({selector:t,entry:n},Mo)}_setContent(e,t,n){const s=f.findOne(n,e);s&&((t=this._resolvePossibleFunction(t))?ie(t)?this._putElementInTemplate(ae(t),s):this._config.html?s.innerHTML=this._maybeSanitize(t):s.textContent=t:s.remove())}_maybeSanitize(e){return this._config.sanitize?function(t,n,s){if(!t.length)return t;if(s&&"function"==typeof s)return s(t);const o=(new window.DOMParser).parseFromString(t,"text/html"),r=[].concat(...o.body.querySelectorAll("*"));for(const a of r){const c=a.nodeName.toLowerCase();if(!Object.keys(n).includes(c)){a.remove();continue}const d=[].concat(...a.attributes),u=[].concat(n["*"]||[],n[c]||[]);for(const h of d)Io(h,u)||a.removeAttribute(h.nodeName)}return o.body.innerHTML}(e,this._config.allowList,this._config.sanitizeFn):e}_resolvePossibleFunction(e){return M(e,[this])}_putElementInTemplate(e,t){if(this._config.html)return t.innerHTML="",void t.append(e);t.textContent=e.textContent}}const Fo=new Set(["sanitize","allowList","sanitizeFn"]),Zt="fade",mt="show",Nn="hide.bs.modal",Ge="hover",Jt="focus",Ho={AUTO:"auto",TOP:"top",RIGHT:B()?"left":"right",BOTTOM:"bottom",LEFT:B()?"right":"left"},Wo={allowList:$n,animation:!0,boundary:"clippingParents",container:!1,customClass:"",delay:0,fallbackPlacements:["top","right","bottom","left"],html:!1,offset:[0,6],placement:"top",popperConfig:null,sanitize:!0,sanitizeFn:null,selector:!1,template:'',title:"",trigger:"hover focus"},Bo={allowList:"object",animation:"boolean",boundary:"(string|element)",container:"(string|element|boolean)",customClass:"(string|function)",delay:"(number|object)",fallbackPlacements:"array",html:"boolean",offset:"(array|string|function)",placement:"(string|function)",popperConfig:"(null|object|function)",sanitize:"boolean",sanitizeFn:"(null|function)",selector:"(string|boolean)",template:"string",title:"(string|element|function)",trigger:"string"};class ye extends Y{constructor(e,t){if(void 0===an)throw new TypeError("Bootstrap's tooltips require Popper (https://popper.js.org)");super(e,t),this._isEnabled=!0,this._timeout=0,this._isHovered=null,this._activeTrigger={},this._popper=null,this._templateFactory=null,this._newContent=null,this.tip=null,this._setListeners(),this._config.selector||this._fixTitle()}static get Default(){return Wo}static get DefaultType(){return Bo}static get NAME(){return"tooltip"}enable(){this._isEnabled=!0}disable(){this._isEnabled=!1}toggleEnabled(){this._isEnabled=!this._isEnabled}toggle(){this._isEnabled&&(this._activeTrigger.click=!this._activeTrigger.click,this._isShown()?this._leave():this._enter())}dispose(){clearTimeout(this._timeout),l.off(this._element.closest(".modal"),Nn,this._hideModalHandler),this._element.getAttribute("data-bs-original-title")&&this._element.setAttribute("title",this._element.getAttribute("data-bs-original-title")),this._disposePopper(),super.dispose()}show(){if("none"===this._element.style.display)throw new Error("Please use show on visible elements");if(!this._isWithContent()||!this._isEnabled)return;const e=l.trigger(this._element,this.constructor.eventName("show")),t=(di(this._element)||this._element.ownerDocument.documentElement).contains(this._element);if(e.defaultPrevented||!t)return;this._disposePopper();const n=this._getTipElement();this._element.setAttribute("aria-describedby",n.getAttribute("id"));const{container:s}=this._config;if(this._element.ownerDocument.documentElement.contains(this.tip)||(s.append(n),l.trigger(this._element,this.constructor.eventName("inserted"))),this._popper=this._createPopper(n),n.classList.add(mt),"ontouchstart"in document.documentElement)for(const o of[].concat(...document.body.children))l.on(o,"mouseover",et);this._queueCallback(()=>{l.trigger(this._element,this.constructor.eventName("shown")),!1===this._isHovered&&this._leave(),this._isHovered=!1},this.tip,this._isAnimated())}hide(){if(this._isShown()&&!l.trigger(this._element,this.constructor.eventName("hide")).defaultPrevented){if(this._getTipElement().classList.remove(mt),"ontouchstart"in document.documentElement)for(const e of[].concat(...document.body.children))l.off(e,"mouseover",et);this._activeTrigger.click=!1,this._activeTrigger[Jt]=!1,this._activeTrigger[Ge]=!1,this._isHovered=null,this._queueCallback(()=>{this._isWithActiveTrigger()||(this._isHovered||this._disposePopper(),this._element.removeAttribute("aria-describedby"),l.trigger(this._element,this.constructor.eventName("hidden")))},this.tip,this._isAnimated())}}update(){this._popper&&this._popper.update()}_isWithContent(){return!!this._getTitle()}_getTipElement(){return this.tip||(this.tip=this._createTipElement(this._newContent||this._getContentForTemplate())),this.tip}_createTipElement(e){const t=this._getTemplateFactory(e).toHtml();if(!t)return null;t.classList.remove(Zt,mt),t.classList.add(`bs-${this.constructor.NAME}-auto`);const n=(s=>{do{s+=Math.floor(1e6*Math.random())}while(document.getElementById(s));return s})(this.constructor.NAME).toString();return t.setAttribute("id",n),this._isAnimated()&&t.classList.add(Zt),t}setContent(e){this._newContent=e,this._isShown()&&(this._disposePopper(),this.show())}_getTemplateFactory(e){return this._templateFactory?this._templateFactory.changeContent(e):this._templateFactory=new jo({...this._config,content:e,extraClass:this._resolvePossibleFunction(this._config.customClass)}),this._templateFactory}_getContentForTemplate(){return{".tooltip-inner":this._getTitle()}}_getTitle(){return this._resolvePossibleFunction(this._config.title)||this._element.getAttribute("data-bs-original-title")}_initializeOnDelegatedTarget(e){return this.constructor.getOrCreateInstance(e.delegateTarget,this._getDelegateConfig())}_isAnimated(){return this._config.animation||this.tip&&this.tip.classList.contains(Zt)}_isShown(){return this.tip&&this.tip.classList.contains(mt)}_createPopper(e){const t=M(this._config.placement,[this,e,this._element]),n=Ho[t.toUpperCase()];return Ut(this._element,e,this._getPopperConfig(n))}_getOffset(){const{offset:e}=this._config;return"string"==typeof e?e.split(",").map(t=>Number.parseInt(t,10)):"function"==typeof e?t=>e(t,this._element):e}_resolvePossibleFunction(e){return M(e,[this._element])}_getPopperConfig(e){const t={placement:e,modifiers:[{name:"flip",options:{fallbackPlacements:this._config.fallbackPlacements}},{name:"offset",options:{offset:this._getOffset()}},{name:"preventOverflow",options:{boundary:this._config.boundary}},{name:"arrow",options:{element:`.${this.constructor.NAME}-arrow`}},{name:"preSetPlacement",enabled:!0,phase:"beforeMain",fn:n=>{this._getTipElement().setAttribute("data-popper-placement",n.state.placement)}}]};return{...t,...M(this._config.popperConfig,[t])}}_setListeners(){const e=this._config.trigger.split(" ");for(const t of e)if("click"===t)l.on(this._element,this.constructor.eventName("click"),this._config.selector,n=>{this._initializeOnDelegatedTarget(n).toggle()});else if("manual"!==t){const n=this.constructor.eventName(t===Ge?"mouseenter":"focusin"),s=this.constructor.eventName(t===Ge?"mouseleave":"focusout");l.on(this._element,n,this._config.selector,o=>{const r=this._initializeOnDelegatedTarget(o);r._activeTrigger["focusin"===o.type?Jt:Ge]=!0,r._enter()}),l.on(this._element,s,this._config.selector,o=>{const r=this._initializeOnDelegatedTarget(o);r._activeTrigger["focusout"===o.type?Jt:Ge]=r._element.contains(o.relatedTarget),r._leave()})}this._hideModalHandler=()=>{this._element&&this.hide()},l.on(this._element.closest(".modal"),Nn,this._hideModalHandler)}_fixTitle(){const e=this._element.getAttribute("title");e&&(this._element.getAttribute("aria-label")||this._element.textContent.trim()||this._element.setAttribute("aria-label",e),this._element.setAttribute("data-bs-original-title",e),this._element.removeAttribute("title"))}_enter(){this._isShown()||this._isHovered?this._isHovered=!0:(this._isHovered=!0,this._setTimeout(()=>{this._isHovered&&this.show()},this._config.delay.show))}_leave(){this._isWithActiveTrigger()||(this._isHovered=!1,this._setTimeout(()=>{this._isHovered||this.hide()},this._config.delay.hide))}_setTimeout(e,t){clearTimeout(this._timeout),this._timeout=setTimeout(e,t)}_isWithActiveTrigger(){return Object.values(this._activeTrigger).includes(!0)}_getConfig(e){const t=ne.getDataAttributes(this._element);for(const n of Object.keys(t))Fo.has(n)&&delete t[n];return e={...t,..."object"==typeof e&&e?e:{}},e=this._mergeConfigObj(e),e=this._configAfterMerge(e),this._typeCheckConfig(e),e}_configAfterMerge(e){return e.container=!1===e.container?document.body:ae(e.container),"number"==typeof e.delay&&(e.delay={show:e.delay,hide:e.delay}),"number"==typeof e.title&&(e.title=e.title.toString()),"number"==typeof e.content&&(e.content=e.content.toString()),e}_getDelegateConfig(){const e={};for(const[t,n]of Object.entries(this._config))this.constructor.Default[t]!==n&&(e[t]=n);return e.selector=!1,e.trigger="manual",e}_disposePopper(){this._popper&&(this._popper.destroy(),this._popper=null),this.tip&&(this.tip.remove(),this.tip=null)}static jQueryInterface(e){return this.each(function(){const t=ye.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===t[e])throw new TypeError(`No method named "${e}"`);t[e]()}})}}z(ye);const zo={...ye.Default,content:"",offset:[0,8],placement:"right",template:'',trigger:"click"},Ro={...ye.DefaultType,content:"(null|string|element|function)"};class gt extends ye{static get Default(){return zo}static get DefaultType(){return Ro}static get NAME(){return"popover"}_isWithContent(){return this._getTitle()||this._getContent()}_getContentForTemplate(){return{".popover-header":this._getTitle(),".popover-body":this._getContent()}}_getContent(){return this._resolvePossibleFunction(this._config.content)}static jQueryInterface(e){return this.each(function(){const t=gt.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===t[e])throw new TypeError(`No method named "${e}"`);t[e]()}})}}z(gt);const ei=".bs.scrollspy",qo=`activate${ei}`,Pn=`click${ei}`,Vo=`load${ei}.data-api`,We="active",ti="[href]",Mn=".nav-link",Ko=`${Mn}, .nav-item > ${Mn}, .list-group-item`,Xo={offset:null,rootMargin:"0px 0px -25%",smoothScroll:!1,target:null,threshold:[.1,.5,1]},Uo={offset:"(number|null)",rootMargin:"string",smoothScroll:"boolean",target:"element",threshold:"array"};class Ze extends Y{constructor(e,t){super(e,t),this._targetLinks=new Map,this._observableSections=new Map,this._rootElement="visible"===getComputedStyle(this._element).overflowY?null:this._element,this._activeTarget=null,this._observer=null,this._previousScrollData={visibleEntryTop:0,parentScrollTop:0},this.refresh()}static get Default(){return Xo}static get DefaultType(){return Uo}static get NAME(){return"scrollspy"}refresh(){this._initializeTargetsAndObservables(),this._maybeEnableSmoothScroll(),this._observer?this._observer.disconnect():this._observer=this._getNewObserver();for(const e of this._observableSections.values())this._observer.observe(e)}dispose(){this._observer.disconnect(),super.dispose()}_configAfterMerge(e){return e.target=ae(e.target)||document.body,e.rootMargin=e.offset?`${e.offset}px 0px -30%`:e.rootMargin,"string"==typeof e.threshold&&(e.threshold=e.threshold.split(",").map(t=>Number.parseFloat(t))),e}_maybeEnableSmoothScroll(){this._config.smoothScroll&&(l.off(this._config.target,Pn),l.on(this._config.target,Pn,ti,e=>{const t=this._observableSections.get(e.target.hash);if(t){e.preventDefault();const n=this._rootElement||window,s=t.offsetTop-this._element.offsetTop;if(n.scrollTo)return void n.scrollTo({top:s,behavior:"smooth"});n.scrollTop=s}}))}_getNewObserver(){return new IntersectionObserver(t=>this._observerCallback(t),{root:this._rootElement,threshold:this._config.threshold,rootMargin:this._config.rootMargin})}_observerCallback(e){const t=r=>this._targetLinks.get(`#${r.target.id}`),n=r=>{this._previousScrollData.visibleEntryTop=r.target.offsetTop,this._process(t(r))},s=(this._rootElement||document.documentElement).scrollTop,o=s>=this._previousScrollData.parentScrollTop;this._previousScrollData.parentScrollTop=s;for(const r of e){if(!r.isIntersecting){this._activeTarget=null,this._clearActiveClass(t(r));continue}const a=r.target.offsetTop>=this._previousScrollData.visibleEntryTop;if(o&&a){if(n(r),!s)return}else o||a||n(r)}}_initializeTargetsAndObservables(){this._targetLinks=new Map,this._observableSections=new Map;const e=f.find(ti,this._config.target);for(const t of e){if(!t.hash||le(t))continue;const n=f.findOne(decodeURI(t.hash),this._element);Ce(n)&&(this._targetLinks.set(decodeURI(t.hash),t),this._observableSections.set(t.hash,n))}}_process(e){this._activeTarget!==e&&(this._clearActiveClass(this._config.target),this._activeTarget=e,e.classList.add(We),this._activateParents(e),l.trigger(this._element,qo,{relatedTarget:e}))}_activateParents(e){if(e.classList.contains("dropdown-item"))f.findOne(".dropdown-toggle",e.closest(".dropdown")).classList.add(We);else for(const t of f.parents(e,".nav, .list-group"))for(const n of f.prev(t,Ko))n.classList.add(We)}_clearActiveClass(e){e.classList.remove(We);const t=f.find(`${ti}.${We}`,e);for(const n of t)n.classList.remove(We)}static jQueryInterface(e){return this.each(function(){const t=Ze.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===t[e]||e.startsWith("_")||"constructor"===e)throw new TypeError(`No method named "${e}"`);t[e]()}})}}l.on(window,Vo,()=>{for(const i of f.find('[data-bs-spy="scroll"]'))Ze.getOrCreateInstance(i)}),z(Ze);const we=".bs.tab",Yo=`hide${we}`,Qo=`hidden${we}`,Go=`show${we}`,Zo=`shown${we}`,Jo=`click${we}`,er=`keydown${we}`,tr=`load${we}`,ir="ArrowLeft",jn="ArrowRight",nr="ArrowUp",Fn="ArrowDown",ii="Home",Hn="End",Ee="active",ni="show",Bn=".dropdown-toggle",si=`:not(${Bn})`,zn='[data-bs-toggle="tab"], [data-bs-toggle="pill"], [data-bs-toggle="list"]',oi=`.nav-link${si}, .list-group-item${si}, [role="tab"]${si}, ${zn}`,sr=`.${Ee}[data-bs-toggle="tab"], .${Ee}[data-bs-toggle="pill"], .${Ee}[data-bs-toggle="list"]`;class Ae extends Y{constructor(e){super(e),this._parent=this._element.closest('.list-group, .nav, [role="tablist"]'),this._parent&&(this._setInitialAttributes(this._parent,this._getChildren()),l.on(this._element,er,t=>this._keydown(t)))}static get NAME(){return"tab"}show(){const e=this._element;if(this._elemIsActive(e))return;const t=this._getActiveElem(),n=t?l.trigger(t,Yo,{relatedTarget:e}):null;l.trigger(e,Go,{relatedTarget:t}).defaultPrevented||n&&n.defaultPrevented||(this._deactivate(t,e),this._activate(e,t))}_activate(e,t){e&&(e.classList.add(Ee),this._activate(f.getElementFromSelector(e)),this._queueCallback(()=>{"tab"===e.getAttribute("role")?(e.removeAttribute("tabindex"),e.setAttribute("aria-selected",!0),this._toggleDropDown(e,!0),l.trigger(e,Zo,{relatedTarget:t})):e.classList.add(ni)},e,e.classList.contains("fade")))}_deactivate(e,t){e&&(e.classList.remove(Ee),e.blur(),this._deactivate(f.getElementFromSelector(e)),this._queueCallback(()=>{"tab"===e.getAttribute("role")?(e.setAttribute("aria-selected",!1),e.setAttribute("tabindex","-1"),this._toggleDropDown(e,!1),l.trigger(e,Qo,{relatedTarget:t})):e.classList.remove(ni)},e,e.classList.contains("fade")))}_keydown(e){if(![ir,jn,nr,Fn,ii,Hn].includes(e.key))return;e.stopPropagation(),e.preventDefault();const t=this._getChildren().filter(s=>!le(s));let n;if([ii,Hn].includes(e.key))n=t[e.key===ii?0:t.length-1];else{const s=[jn,Fn].includes(e.key);n=Tt(t,e.target,s,!0)}n&&(n.focus({preventScroll:!0}),Ae.getOrCreateInstance(n).show())}_getChildren(){return f.find(oi,this._parent)}_getActiveElem(){return this._getChildren().find(e=>this._elemIsActive(e))||null}_setInitialAttributes(e,t){this._setAttributeIfNotExists(e,"role","tablist");for(const n of t)this._setInitialAttributesOnChild(n)}_setInitialAttributesOnChild(e){e=this._getInnerElement(e);const t=this._elemIsActive(e),n=this._getOuterElement(e);e.setAttribute("aria-selected",t),n!==e&&this._setAttributeIfNotExists(n,"role","presentation"),t||e.setAttribute("tabindex","-1"),this._setAttributeIfNotExists(e,"role","tab"),this._setInitialAttributesOnTargetPanel(e)}_setInitialAttributesOnTargetPanel(e){const t=f.getElementFromSelector(e);t&&(this._setAttributeIfNotExists(t,"role","tabpanel"),e.id&&this._setAttributeIfNotExists(t,"aria-labelledby",`${e.id}`))}_toggleDropDown(e,t){const n=this._getOuterElement(e);if(!n.classList.contains("dropdown"))return;const s=(o,r)=>{const a=f.findOne(o,n);a&&a.classList.toggle(r,t)};s(Bn,Ee),s(".dropdown-menu",ni),n.setAttribute("aria-expanded",t)}_setAttributeIfNotExists(e,t,n){e.hasAttribute(t)||e.setAttribute(t,n)}_elemIsActive(e){return e.classList.contains(Ee)}_getInnerElement(e){return e.matches(oi)?e:f.findOne(oi,e)}_getOuterElement(e){return e.closest(".nav-item, .list-group-item")||e}static jQueryInterface(e){return this.each(function(){const t=Ae.getOrCreateInstance(this);if("string"==typeof e){if(void 0===t[e]||e.startsWith("_")||"constructor"===e)throw new TypeError(`No method named "${e}"`);t[e]()}})}}l.on(document,Jo,zn,function(i){["A","AREA"].includes(this.tagName)&&i.preventDefault(),le(this)||Ae.getOrCreateInstance(this).show()}),l.on(window,tr,()=>{for(const i of f.find(sr))Ae.getOrCreateInstance(i)}),z(Ae);const de=".bs.toast",or=`mouseover${de}`,rr=`mouseout${de}`,ar=`focusin${de}`,lr=`focusout${de}`,cr=`hide${de}`,hr=`hidden${de}`,dr=`show${de}`,ur=`shown${de}`,_t="show",bt="showing",fr={animation:"boolean",autohide:"boolean",delay:"number"},pr={animation:!0,autohide:!0,delay:5e3};class Je extends Y{constructor(e,t){super(e,t),this._timeout=null,this._hasMouseInteraction=!1,this._hasKeyboardInteraction=!1,this._setListeners()}static get Default(){return pr}static get DefaultType(){return fr}static get NAME(){return"toast"}show(){l.trigger(this._element,dr).defaultPrevented||(this._clearTimeout(),this._config.animation&&this._element.classList.add("fade"),this._element.classList.remove("hide"),this._element.classList.add(_t,bt),this._queueCallback(()=>{this._element.classList.remove(bt),l.trigger(this._element,ur),this._maybeScheduleHide()},this._element,this._config.animation))}hide(){this.isShown()&&(l.trigger(this._element,cr).defaultPrevented||(this._element.classList.add(bt),this._queueCallback(()=>{this._element.classList.add("hide"),this._element.classList.remove(bt,_t),l.trigger(this._element,hr)},this._element,this._config.animation)))}dispose(){this._clearTimeout(),this.isShown()&&this._element.classList.remove(_t),super.dispose()}isShown(){return this._element.classList.contains(_t)}_maybeScheduleHide(){this._config.autohide&&(this._hasMouseInteraction||this._hasKeyboardInteraction||(this._timeout=setTimeout(()=>{this.hide()},this._config.delay)))}_onInteraction(e,t){switch(e.type){case"mouseover":case"mouseout":this._hasMouseInteraction=t;break;case"focusin":case"focusout":this._hasKeyboardInteraction=t}if(t)return void this._clearTimeout();const n=e.relatedTarget;this._element===n||this._element.contains(n)||this._maybeScheduleHide()}_setListeners(){l.on(this._element,or,e=>this._onInteraction(e,!0)),l.on(this._element,rr,e=>this._onInteraction(e,!1)),l.on(this._element,ar,e=>this._onInteraction(e,!0)),l.on(this._element,lr,e=>this._onInteraction(e,!1))}_clearTimeout(){clearTimeout(this._timeout),this._timeout=null}static jQueryInterface(e){return this.each(function(){const t=Je.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===t[e])throw new TypeError(`No method named "${e}"`);t[e](this)}})}}return tt(Je),z(Je),{Alert:qe,Button:Ve,Carousel:Le,Collapse:De,Dropdown:Q,Modal:ve,Offcanvas:re,Popover:gt,ScrollSpy:Ze,Tab:Ae,Toast:Je,Tooltip:ye}}); -------------------------------------------------------------------------------- /ui/.eslintignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | -------------------------------------------------------------------------------- /ui/.eslintrc.base.json: -------------------------------------------------------------------------------- 1 | { 2 | "root": true, 3 | "ignorePatterns": ["**/*"], 4 | "plugins": ["@nx"], 5 | "overrides": [ 6 | { 7 | "files": ["*.ts", "*.tsx", "*.js", "*.jsx"], 8 | "rules": { 9 | "@nx/enforce-module-boundaries": [ 10 | "error", 11 | { 12 | "enforceBuildableLibDependency": true, 13 | "allow": [], 14 | "depConstraints": [ 15 | { 16 | "sourceTag": "*", 17 | "onlyDependOnLibsWithTags": ["*"] 18 | } 19 | ] 20 | } 21 | ] 22 | } 23 | }, 24 | { 25 | "files": ["*.ts", "*.tsx"], 26 | "extends": ["plugin:@nx/typescript"], 27 | "rules": {} 28 | }, 29 | { 30 | "files": ["*.js", "*.jsx"], 31 | "extends": ["plugin:@nx/javascript"], 32 | "rules": {} 33 | } 34 | ] 35 | } 36 | -------------------------------------------------------------------------------- /ui/.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "ignorePatterns": ["!**/*"], 3 | "overrides": [ 4 | { 5 | "files": ["*.ts"], 6 | "extends": [ 7 | "plugin:@nx/angular", 8 | "plugin:@angular-eslint/template/process-inline-templates" 9 | ], 10 | "rules": { 11 | "@angular-eslint/directive-selector": [ 12 | "error", 13 | { 14 | "type": "attribute", 15 | "prefix": "app", 16 | "style": "camelCase" 17 | } 18 | ], 19 | "@angular-eslint/component-selector": [ 20 | "error", 21 | { 22 | "type": "element", 23 | "prefix": "app", 24 | "style": "kebab-case" 25 | } 26 | ], 27 | "@angular-eslint/prefer-standalone": "off" 28 | } 29 | }, 30 | { 31 | "files": ["*.html"], 32 | "extends": ["plugin:@nx/angular-template"], 33 | "rules": {} 34 | } 35 | ], 36 | "extends": ["./.eslintrc.base.json"] 37 | } 38 | -------------------------------------------------------------------------------- /ui/.gitignore: -------------------------------------------------------------------------------- 1 | # See http://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | # compiled output 4 | dist 5 | tmp 6 | /out-tsc 7 | 8 | # dependencies 9 | node_modules 10 | 11 | # IDEs and editors 12 | /.idea 13 | .project 14 | .classpath 15 | .c9/ 16 | *.launch 17 | .settings/ 18 | *.sublime-workspace 19 | 20 | # IDE - VSCode 21 | .vscode/* 22 | !.vscode/settings.json 23 | !.vscode/tasks.json 24 | !.vscode/launch.json 25 | !.vscode/extensions.json 26 | 27 | # misc 28 | /.sass-cache 29 | /connect.lock 30 | /coverage 31 | /libpeerconnection.log 32 | npm-debug.log 33 | yarn-error.log 34 | testem.log 35 | /typings 36 | 37 | # System Files 38 | .DS_Store 39 | Thumbs.db 40 | 41 | .angular 42 | 43 | .nx/cache 44 | .nx/workspace-data -------------------------------------------------------------------------------- /ui/.prettierignore: -------------------------------------------------------------------------------- 1 | # Add files here to ignore them from prettier formatting 2 | /dist 3 | /coverage 4 | .angular 5 | 6 | /.nx/cache 7 | /.nx/workspace-data -------------------------------------------------------------------------------- /ui/.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "singleQuote": true 3 | } 4 | -------------------------------------------------------------------------------- /ui/.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": [ 3 | "nrwl.angular-console", 4 | "esbenp.prettier-vscode", 5 | "firsttris.vscode-jest-runner", 6 | "ms-playwright.playwright", 7 | "dbaeumer.vscode-eslint" 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /ui/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "editor.defaultFormatter": "esbenp.prettier-vscode", 3 | "[typescript]": { 4 | "editor.defaultFormatter": "esbenp.prettier-vscode" 5 | }, 6 | "[json]": { 7 | "editor.defaultFormatter": "esbenp.prettier-vscode" 8 | }, 9 | "[jsonc]": { 10 | "editor.defaultFormatter": "esbenp.prettier-vscode" 11 | }, 12 | "[javascript]": { 13 | "editor.defaultFormatter": "esbenp.prettier-vscode" 14 | }, 15 | "[html]": { 16 | "editor.defaultFormatter": "esbenp.prettier-vscode" 17 | }, 18 | "[less]": { 19 | "editor.defaultFormatter": "esbenp.prettier-vscode" 20 | }, 21 | "editor.codeActionsOnSave": { 22 | "source.organizeImports": "explicit", 23 | "source.fixAll.eslint": "explicit" 24 | }, 25 | "editor.formatOnSave": true, 26 | "editor.formatOnPaste": true 27 | } 28 | -------------------------------------------------------------------------------- /ui/README.md: -------------------------------------------------------------------------------- 1 | # ui 2 | 3 | 4 | 5 | ✨ **This workspace has been generated by [Nx, a Smart, fast and extensible build system.](https://nx.dev)** ✨ 6 | 7 | 8 | ## Start the app 9 | 10 | To start the development server run `nx serve ui`. Open your browser and navigate to http://localhost:4200/. Happy coding! 11 | 12 | 13 | ## Generate code 14 | 15 | If you happen to use Nx plugins, you can leverage code generators that might come with it. 16 | 17 | Run `nx list` to get a list of available plugins and whether they have generators. Then run `nx list ` to see what generators are available. 18 | 19 | Learn more about [Nx generators on the docs](https://nx.dev/plugin-features/use-code-generators). 20 | 21 | ## Running tasks 22 | 23 | To execute tasks with Nx use the following syntax: 24 | 25 | ``` 26 | nx <...options> 27 | ``` 28 | 29 | You can also run multiple targets: 30 | 31 | ``` 32 | nx run-many -t 33 | ``` 34 | 35 | ..or add `-p` to filter specific projects 36 | 37 | ``` 38 | nx run-many -t -p 39 | ``` 40 | 41 | Targets can be defined in the `package.json` or `projects.json`. Learn more [in the docs](https://nx.dev/core-features/run-tasks). 42 | 43 | ## Want better Editor Integration? 44 | 45 | Have a look at the [Nx Console extensions](https://nx.dev/nx-console). It provides autocomplete support, a UI for exploring and running tasks & generators, and more! Available for VSCode, IntelliJ and comes with a LSP for Vim users. 46 | 47 | ## Ready to deploy? 48 | 49 | Just run `nx build demoapp` to build the application. The build artifacts will be stored in the `dist/` directory, ready to be deployed. 50 | 51 | ## Set up CI! 52 | 53 | Nx comes with local caching already built-in (check your `nx.json`). On CI you might want to go a step further. 54 | 55 | - [Set up remote caching](https://nx.dev/core-features/share-your-cache) 56 | - [Set up task distribution across multiple machines](https://nx.dev/core-features/distribute-task-execution) 57 | - [Learn more how to setup CI](https://nx.dev/recipes/ci) 58 | 59 | ## Connect with us! 60 | 61 | - [Join the community](https://nx.dev/community) 62 | - [Subscribe to the Nx Youtube Channel](https://www.youtube.com/@nxdevtools) 63 | - [Follow us on Twitter](https://twitter.com/nxdevtools) 64 | -------------------------------------------------------------------------------- /ui/certs/Readme.md: -------------------------------------------------------------------------------- 1 | This certificate is only an example. Please use your own. 2 | 3 | Double click the pfx on a windows mc and use the 1234 password to install. 4 | 5 | Add the certificates to the nx project for example in the **/certs** folder 6 | 7 | Update the nx project.json file: 8 | 9 | ```json 10 | "serve": { 11 | "executor": "@angular-devkit/build-angular:dev-server", 12 | "options": { 13 | "browserTarget": "ui:build", 14 | "sslKey": "certs/dev_localhost.key", 15 | "sslCert": "certs/dev_localhost.pem", 16 | "port": 4201 17 | }, 18 | ``` 19 | -------------------------------------------------------------------------------- /ui/certs/dev_localhost.key: -------------------------------------------------------------------------------- 1 | -----BEGIN RSA PRIVATE KEY----- 2 | MIICXQIBAAKBgQCs7HI0KWqXEjH1fxXdkgVHg+1UgbtBhwkeZ3WhBsTGcwlqGUmzqlhKiR2hTd9G 3 | dMhQm1tFeU9qAMpmglxR+XgoZoEv9uoXw/TeegdKvn1V3exTxeULIDGJOXK6wQ1M+4FLMr7zBWlM 4 | hWmqcbYTHHVwwYd+ycDRHU3NAIxDfMUSQQIDAQABAoGAIB8z/7iJ0lJQ8XeQCj6ruGMrXP1UWZHK 5 | AdnaIfVt7CdGYm0cIcHM8NuTo3khtqbO5xpU1Az60YggEPa6S4f558kGBIg4PQVxgE/Kv77ptGAk 6 | rZG9FaCyIibGMh5aJLtxG0Fh1FGnuK1Xk1BKXtaGRUkZpKGg4rMJ9w3qp/T5vLkCQQDe+FiMqY2s 7 | pxHEz+h3NJ0H2T81FCx2upf1fjTVtlQnJ7Gds6eZT0zwa3z1bSw+VkxICERY8C43bzPUJUgPIyLX 8 | AkEAxooyVkJHmxlcIvZfrZPvQs+2GOXpWVnyjNUWf8t9G2MsmkdGIkp7oJhi5obpdNR+3jQe0xyr 9 | Dvy1hbHuGp5opwJBALO6Zc5EogGozgbiPBVSoL2B3ZRQhaLSt8jYCYi3JtBFC8P927wVkwQ88IX4 10 | kXBSKbzqhQVX3Tkr9xArWRFylhMCQFmigt9WxSVM6cAPI1smctrjE/9hrVxds5fJjILdx/nZaIWu 11 | sAdDQVVb9yrEthm85hpDxbbiNohppzpY/nqeEfkCQQDInS/pP5dYTUxFV+/YweK+6smN2v+dYZAi 12 | 5KShWRl5fwpl+mdJT3aziRb/kfYkhGPQMO06OnGzjNKt7Rg0Z8mD 13 | -----END RSA PRIVATE KEY----- 14 | -------------------------------------------------------------------------------- /ui/certs/dev_localhost.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIICQDCCAamgAwIBAgIJAIKGapdMCt4NMA0GCSqGSIb3DQEBCwUAMBQxEjAQBgNVBAMTCWxvY2Fs 3 | aG9zdDAeFw0yMDAyMjAyMjU3MjFaFw0zMDAyMjEyMjU3MjFaMBQxEjAQBgNVBAMTCWxvY2FsaG9z 4 | dDCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEArOxyNClqlxIx9X8V3ZIFR4PtVIG7QYcJHmd1 5 | oQbExnMJahlJs6pYSokdoU3fRnTIUJtbRXlPagDKZoJcUfl4KGaBL/bqF8P03noHSr59Vd3sU8Xl 6 | CyAxiTlyusENTPuBSzK+8wVpTIVpqnG2Exx1cMGHfsnA0R1NzQCMQ3zFEkECAwEAAaOBmTCBljAS 7 | BgNVHRMBAf8ECDAGAQH/AgEDMA4GA1UdDwEB/wQEAwIB/jAUBgNVHREEDTALgglsb2NhbGhvc3Qw 8 | OwYDVR0lBDQwMgYIKwYBBQUHAwEGCCsGAQUFBwMCBggrBgEFBQcDAwYIKwYBBQUHAwQGCCsGAQUF 9 | BwMIMB0GA1UdDgQWBBQaVighscgq5k8BjEzeSsZp+6RxITANBgkqhkiG9w0BAQsFAAOBgQBXH/Sq 10 | jekwz+O0eG0zA2MA2LSwt7OELi54vATFYkXO45IO5frRagUTWDkx85/Vfm9OcdfoaHD1UzPkGBU0 11 | BPsnN3SGCB3Pk5jSRaXIBBiqByDFiP+G6EYmUYhLxB3FpJp6S5KlnQtdtLkl3KuT8KBtc9haro+e 12 | lDlUx5s/FM3SJw== 13 | -----END CERTIFICATE----- 14 | -------------------------------------------------------------------------------- /ui/e2e/.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": ["plugin:playwright/recommended", "../.eslintrc.base.json"], 3 | "ignorePatterns": ["!**/*"], 4 | "overrides": [ 5 | { 6 | "files": ["*.ts", "*.tsx", "*.js", "*.jsx"], 7 | "rules": {} 8 | }, 9 | { 10 | "files": ["*.ts", "*.tsx"], 11 | "rules": {} 12 | }, 13 | { 14 | "files": ["*.js", "*.jsx"], 15 | "rules": {} 16 | }, 17 | { 18 | "files": ["src/**/*.{ts,js,tsx,jsx}"], 19 | "rules": {} 20 | } 21 | ] 22 | } 23 | -------------------------------------------------------------------------------- /ui/e2e/playwright.config.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from '@playwright/test'; 2 | import { nxE2EPreset } from '@nx/playwright/preset'; 3 | 4 | import { workspaceRoot } from '@nx/devkit'; 5 | 6 | // For CI, you may want to set BASE_URL to the deployed application. 7 | const baseURL = process.env['BASE_URL'] || 'http://localhost:4200'; 8 | 9 | /** 10 | * Read environment variables from file. 11 | * https://github.com/motdotla/dotenv 12 | */ 13 | // require('dotenv').config(); 14 | 15 | /** 16 | * See https://playwright.dev/docs/test-configuration. 17 | */ 18 | export default defineConfig({ 19 | ...nxE2EPreset(__filename, { testDir: './src' }), 20 | /* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */ 21 | use: { 22 | baseURL, 23 | /* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */ 24 | trace: 'on-first-retry', 25 | }, 26 | /* Run your local dev server before starting the tests */ 27 | webServer: { 28 | command: 'npx nx serve ui', 29 | url: 'http://localhost:4200', 30 | reuseExistingServer: !process.env.CI, 31 | cwd: workspaceRoot, 32 | }, 33 | }); 34 | -------------------------------------------------------------------------------- /ui/e2e/project.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "e2e", 3 | "$schema": "../node_modules/nx/schemas/project-schema.json", 4 | "sourceRoot": "e2e/src", 5 | "targets": { 6 | "e2e": { 7 | "executor": "@nx/playwright:playwright", 8 | "outputs": ["{workspaceRoot}/dist/.playwright/e2e"], 9 | "options": { 10 | "config": "e2e/playwright.config.ts" 11 | } 12 | }, 13 | "lint": { 14 | "executor": "@nx/eslint:lint", 15 | "outputs": ["{options.outputFile}"] 16 | } 17 | }, 18 | "implicitDependencies": ["ui"] 19 | } 20 | -------------------------------------------------------------------------------- /ui/e2e/src/example.spec.ts: -------------------------------------------------------------------------------- 1 | import { test, expect } from '@playwright/test'; 2 | 3 | test('has title', async ({ page }) => { 4 | await page.goto('/'); 5 | 6 | // Expect h1 to contain a substring. 7 | expect(await page.locator('h1').innerText()).toContain('Welcome'); 8 | }); 9 | -------------------------------------------------------------------------------- /ui/jest.config.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | export default { 3 | displayName: 'ui', 4 | preset: './jest.preset.js', 5 | setupFilesAfterEnv: ['/src/test-setup.ts'], 6 | coverageDirectory: './coverage/ui', 7 | transform: { 8 | '^.+\\.(ts|mjs|js|html)$': [ 9 | 'jest-preset-angular', 10 | { 11 | tsconfig: '/tsconfig.spec.json', 12 | stringifyContentPathRegex: '\\.(html|svg)$', 13 | }, 14 | ], 15 | }, 16 | transformIgnorePatterns: ['node_modules/(?!.*\\.mjs$)'], 17 | snapshotSerializers: [ 18 | 'jest-preset-angular/build/serializers/no-ng-attributes', 19 | 'jest-preset-angular/build/serializers/ng-snapshot', 20 | 'jest-preset-angular/build/serializers/html-comment', 21 | ], 22 | testMatch: [ 23 | '/src/**/__tests__/**/*.[jt]s?(x)', 24 | '/src/**/*(*.)@(spec|test).[jt]s?(x)', 25 | ], 26 | }; 27 | -------------------------------------------------------------------------------- /ui/jest.preset.js: -------------------------------------------------------------------------------- 1 | const nxPreset = require('@nx/jest/preset').default; 2 | 3 | module.exports = { ...nxPreset }; 4 | -------------------------------------------------------------------------------- /ui/migrations.json: -------------------------------------------------------------------------------- 1 | { 2 | "migrations": [ 3 | { 4 | "version": "20.3.0-beta.1", 5 | "description": "Update ESLint flat config to include .cjs, .mjs, .cts, and .mts files in overrides (if needed)", 6 | "implementation": "./src/migrations/update-20-3-0/add-file-extensions-to-overrides", 7 | "package": "@nx/eslint", 8 | "name": "add-file-extensions-to-overrides" 9 | }, 10 | { 11 | "cli": "nx", 12 | "version": "20.3.0-beta.2", 13 | "description": "If workspace includes Module Federation projects, ensure the new @nx/module-federation package is installed.", 14 | "factory": "./src/migrations/update-20-3-0/ensure-nx-module-federation-package", 15 | "package": "@nx/angular", 16 | "name": "ensure-nx-module-federation-package" 17 | }, 18 | { 19 | "cli": "nx", 20 | "version": "20.4.0-beta.1", 21 | "requires": { "@angular/core": ">=19.1.0" }, 22 | "description": "Update the @angular/cli package version to ~19.1.0.", 23 | "factory": "./src/migrations/update-20-4-0/update-angular-cli", 24 | "package": "@nx/angular", 25 | "name": "update-angular-cli-version-19-1-0" 26 | } 27 | ] 28 | } 29 | -------------------------------------------------------------------------------- /ui/nx.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "./node_modules/nx/schemas/nx-schema.json", 3 | "targetDefaults": { 4 | "build": { 5 | "dependsOn": ["^build"], 6 | "inputs": ["production", "^production"], 7 | "cache": true 8 | }, 9 | "lint": { 10 | "inputs": [ 11 | "default", 12 | "{workspaceRoot}/.eslintrc.json", 13 | "{workspaceRoot}/.eslintignore" 14 | ], 15 | "cache": true 16 | }, 17 | "e2e": { 18 | "inputs": ["default", "^production"], 19 | "cache": true 20 | }, 21 | "@nx/jest:jest": { 22 | "inputs": ["default", "^production", "{workspaceRoot}/jest.preset.js"], 23 | "cache": true, 24 | "options": { 25 | "passWithNoTests": true 26 | }, 27 | "configurations": { 28 | "ci": { 29 | "ci": true, 30 | "codeCoverage": true 31 | } 32 | } 33 | } 34 | }, 35 | "namedInputs": { 36 | "default": ["{projectRoot}/**/*", "sharedGlobals"], 37 | "production": [ 38 | "default", 39 | "!{projectRoot}/**/?(*.)+(spec|test).[jt]s?(x)?(.snap)", 40 | "!{projectRoot}/tsconfig.spec.json", 41 | "!{projectRoot}/jest.config.[jt]s", 42 | "!{projectRoot}/src/test-setup.[jt]s", 43 | "!{projectRoot}/test-setup.[jt]s", 44 | "!{projectRoot}/.eslintrc.json" 45 | ], 46 | "sharedGlobals": [] 47 | }, 48 | "generators": { 49 | "@nx/angular:application": { 50 | "style": "scss", 51 | "linter": "eslint", 52 | "unitTestRunner": "jest", 53 | "e2eTestRunner": "playwright" 54 | }, 55 | "@nx/angular:library": { 56 | "linter": "eslint", 57 | "unitTestRunner": "jest" 58 | }, 59 | "@nx/angular:component": { 60 | "style": "scss" 61 | } 62 | }, 63 | "defaultProject": "ui", 64 | "nxCloudAccessToken": "NGJmZDYwYzItOTg1NS00ZTYyLWFkMmYtMDk1YWRlN2EzNjJifHJlYWQtd3JpdGU=", 65 | "useLegacyCache": true 66 | } 67 | -------------------------------------------------------------------------------- /ui/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ui", 3 | "version": "0.0.11", 4 | "license": "MIT", 5 | "scripts": { 6 | "start": "nx serve --ssl", 7 | "build": "nx build", 8 | "test": "nx test" 9 | }, 10 | "private": true, 11 | "dependencies": { 12 | "@angular/animations": "19.1.5", 13 | "@angular/common": "19.1.5", 14 | "@angular/compiler": "19.1.5", 15 | "@angular/core": "19.1.5", 16 | "@angular/forms": "19.1.5", 17 | "@angular/platform-browser": "19.1.5", 18 | "@angular/platform-browser-dynamic": "19.1.5", 19 | "@angular/router": "19.1.5", 20 | "@nx/angular": "20.4.2", 21 | "bootstrap": "^5.3.3", 22 | "rxjs": "~7.8.0", 23 | "tslib": "^2.3.0", 24 | "zone.js": "0.15.0" 25 | }, 26 | "devDependencies": { 27 | "@angular-devkit/build-angular": "19.1.6", 28 | "@angular-devkit/core": "19.1.6", 29 | "@angular-devkit/schematics": "19.1.6", 30 | "@angular-eslint/eslint-plugin": "19.0.2", 31 | "@angular-eslint/eslint-plugin-template": "19.0.2", 32 | "@angular-eslint/template-parser": "19.0.2", 33 | "@angular/cli": "~19.1.0", 34 | "@angular/compiler-cli": "19.1.5", 35 | "@angular/language-service": "19.1.5", 36 | "@nx/eslint": "20.4.2", 37 | "@nx/eslint-plugin": "20.4.2", 38 | "@nx/jest": "20.4.2", 39 | "@nx/js": "20.4.2", 40 | "@nx/playwright": "20.4.2", 41 | "@nx/workspace": "20.4.2", 42 | "@playwright/test": "^1.36.0", 43 | "@schematics/angular": "19.1.6", 44 | "@types/jest": "29.5.13", 45 | "@types/node": "^18.16.9", 46 | "@typescript-eslint/eslint-plugin": "7.16.0", 47 | "@typescript-eslint/parser": "7.16.0", 48 | "@typescript-eslint/utils": "^7.16.0", 49 | "eslint": "8.57.0", 50 | "eslint-config-prettier": "9.0.0", 51 | "eslint-plugin-playwright": "^0.15.3", 52 | "jest": "29.7.0", 53 | "jest-environment-jsdom": "29.7.0", 54 | "jest-preset-angular": "14.4.2", 55 | "nx": "20.4.2", 56 | "prettier": "^2.6.2", 57 | "ts-jest": "^29.1.0", 58 | "ts-node": "10.9.1", 59 | "typescript": "5.7.3" 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /ui/project.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ui", 3 | "$schema": "node_modules/nx/schemas/project-schema.json", 4 | "projectType": "application", 5 | "prefix": "app", 6 | "sourceRoot": "./src", 7 | "tags": [], 8 | "targets": { 9 | "build": { 10 | "executor": "@angular-devkit/build-angular:browser", 11 | "outputs": ["{options.outputPath}"], 12 | "options": { 13 | "outputPath": "../server/wwwroot", 14 | "index": "./src/index.html", 15 | "main": "./src/main.ts", 16 | "polyfills": ["zone.js"], 17 | "tsConfig": "./tsconfig.app.json", 18 | "assets": ["./src/favicon.ico", "./src/assets"], 19 | "styles": [ 20 | "node_modules/bootstrap/dist/css/bootstrap.min.css", 21 | "./src/styles.scss" 22 | ], 23 | "scripts": [ 24 | "node_modules/bootstrap/dist/js/bootstrap.bundle.min.js" 25 | ] 26 | }, 27 | "configurations": { 28 | "production": { 29 | "budgets": [ 30 | { 31 | "type": "initial", 32 | "maximumWarning": "500kb", 33 | "maximumError": "1mb" 34 | }, 35 | { 36 | "type": "anyComponentStyle", 37 | "maximumWarning": "2kb", 38 | "maximumError": "4kb" 39 | } 40 | ], 41 | "outputHashing": "all" 42 | }, 43 | "development": { 44 | "buildOptimizer": false, 45 | "optimization": false, 46 | "vendorChunk": true, 47 | "extractLicenses": false, 48 | "sourceMap": true, 49 | "namedChunks": true 50 | } 51 | }, 52 | "defaultConfiguration": "production" 53 | }, 54 | "serve": { 55 | "executor": "@angular-devkit/build-angular:dev-server", 56 | "options": { 57 | "sslKey": "certs/dev_localhost.key", 58 | "sslCert": "certs/dev_localhost.pem", 59 | "port": 4201, 60 | "buildTarget": "ui:build" 61 | }, 62 | "configurations": { 63 | "production": { 64 | "buildTarget": "ui:build:production" 65 | }, 66 | "development": { 67 | "buildTarget": "ui:build:development" 68 | } 69 | }, 70 | "defaultConfiguration": "development" 71 | }, 72 | "extract-i18n": { 73 | "executor": "@angular-devkit/build-angular:extract-i18n", 74 | "options": { 75 | "buildTarget": "ui:build" 76 | } 77 | }, 78 | "lint": { 79 | "executor": "@nx/eslint:lint", 80 | "outputs": ["{options.outputFile}"], 81 | "options": { 82 | "lintFilePatterns": ["./src"] 83 | } 84 | }, 85 | "test": { 86 | "executor": "@nx/jest:jest", 87 | "outputs": ["{workspaceRoot}/coverage/{projectName}"], 88 | "options": { 89 | "jestConfig": "jest.config.ts" 90 | } 91 | } 92 | } 93 | } 94 | -------------------------------------------------------------------------------- /ui/src/app/app.component.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /ui/src/app/app.component.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damienbod/bff-auth0-aspnetcore-angular/0437c25ed440a32d4dbc720205ef93094f816504/ui/src/app/app.component.scss -------------------------------------------------------------------------------- /ui/src/app/app.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed } from '@angular/core/testing'; 2 | import { AppComponent } from './app.component'; 3 | import { NxWelcomeComponent } from './nx-welcome.component'; 4 | import { RouterTestingModule } from '@angular/router/testing'; 5 | 6 | describe('AppComponent', () => { 7 | beforeEach(async () => { 8 | await TestBed.configureTestingModule({ 9 | imports: [AppComponent, NxWelcomeComponent, RouterTestingModule], 10 | }).compileComponents(); 11 | }); 12 | 13 | it('should render title', () => { 14 | const fixture = TestBed.createComponent(AppComponent); 15 | fixture.detectChanges(); 16 | const compiled = fixture.nativeElement as HTMLElement; 17 | expect(compiled.querySelector('h1')?.textContent).toContain( 18 | 'Welcome ui' 19 | ); 20 | }); 21 | 22 | it(`should have as title 'ui'`, () => { 23 | const fixture = TestBed.createComponent(AppComponent); 24 | const app = fixture.componentInstance; 25 | expect(app.title).toEqual('ui'); 26 | }); 27 | }); 28 | -------------------------------------------------------------------------------- /ui/src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | import { RouterModule } from '@angular/router'; 3 | import { HomeComponent } from './home.component'; 4 | 5 | @Component({ 6 | imports: [HomeComponent, RouterModule], 7 | selector: 'app-root', 8 | templateUrl: './app.component.html', 9 | styleUrls: ['./app.component.scss'] 10 | }) 11 | export class AppComponent { 12 | title = 'ui'; 13 | } 14 | -------------------------------------------------------------------------------- /ui/src/app/app.config.ts: -------------------------------------------------------------------------------- 1 | import { provideHttpClient, withInterceptors } from '@angular/common/http'; 2 | import { ApplicationConfig, CSP_NONCE } from '@angular/core'; 3 | import { secureApiInterceptor } from './secure-api.interceptor'; 4 | 5 | import { 6 | provideRouter, 7 | withEnabledBlockingInitialNavigation, 8 | } from '@angular/router'; 9 | import { appRoutes } from './app.routes'; 10 | 11 | const nonce = ( 12 | document.querySelector('meta[name="CSP_NONCE"]') as HTMLMetaElement 13 | )?.content; 14 | 15 | export const appConfig: ApplicationConfig = { 16 | providers: [ 17 | provideRouter(appRoutes, withEnabledBlockingInitialNavigation()), 18 | provideHttpClient(withInterceptors([secureApiInterceptor])), 19 | { 20 | provide: CSP_NONCE, 21 | useValue: nonce, 22 | }, 23 | ], 24 | }; 25 | -------------------------------------------------------------------------------- /ui/src/app/app.routes.ts: -------------------------------------------------------------------------------- 1 | import { Route } from '@angular/router'; 2 | import { CallApiComponent } from './call-api/call-api.component'; 3 | 4 | export const appRoutes: Route[] = [ 5 | { 6 | path: 'call-api', 7 | component: CallApiComponent 8 | } 9 | ]; -------------------------------------------------------------------------------- /ui/src/app/call-api/call-api.component.html: -------------------------------------------------------------------------------- 1 |

Data from API:

2 | 3 |
4 | 5 |
6 | 7 |
8 | 9 |
{{ dataFromAzureProtectedApi$ | async | json }}
10 | -------------------------------------------------------------------------------- /ui/src/app/call-api/call-api.component.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damienbod/bff-auth0-aspnetcore-angular/0437c25ed440a32d4dbc720205ef93094f816504/ui/src/app/call-api/call-api.component.scss -------------------------------------------------------------------------------- /ui/src/app/call-api/call-api.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | import { CallApiComponent } from './call-api.component'; 3 | 4 | describe('CallApiComponent', () => { 5 | let component: CallApiComponent; 6 | let fixture: ComponentFixture; 7 | 8 | beforeEach(async () => { 9 | await TestBed.configureTestingModule({ 10 | imports: [CallApiComponent], 11 | }).compileComponents(); 12 | 13 | fixture = TestBed.createComponent(CallApiComponent); 14 | component = fixture.componentInstance; 15 | fixture.detectChanges(); 16 | }); 17 | 18 | it('should create', () => { 19 | expect(component).toBeTruthy(); 20 | }); 21 | }); 22 | -------------------------------------------------------------------------------- /ui/src/app/call-api/call-api.component.ts: -------------------------------------------------------------------------------- 1 | import { CommonModule } from '@angular/common'; 2 | import { HttpClient } from '@angular/common/http'; 3 | import { Component, OnInit, inject } from '@angular/core'; 4 | import { Observable } from 'rxjs'; 5 | 6 | @Component({ 7 | selector: 'app-call-api', 8 | imports: [CommonModule], 9 | templateUrl: './call-api.component.html', 10 | styleUrl: './call-api.component.scss' 11 | }) 12 | 13 | export class CallApiComponent { 14 | 15 | private readonly httpClient = inject(HttpClient); 16 | dataFromAzureProtectedApi$: Observable; 17 | 18 | getDirectApiData() { 19 | this.dataFromAzureProtectedApi$ = this.httpClient.get( 20 | `${this.getCurrentHost()}/api/DirectApi` 21 | ); 22 | } 23 | 24 | private getCurrentHost() { 25 | const host = window.location.host; 26 | const url = `${window.location.protocol}//${host}`; 27 | 28 | return url; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /ui/src/app/getCookie.ts: -------------------------------------------------------------------------------- 1 | export const getCookie = (cookieName: string) => { 2 | const name = `${cookieName}=`; 3 | const decodedCookie = decodeURIComponent(document.cookie); 4 | const ca = decodedCookie.split(";"); 5 | for (let i = 0; i < ca.length; i += 1) { 6 | let c = ca[i]; 7 | while (c.charAt(0) === " ") { 8 | c = c.substring(1); 9 | } 10 | if (c.indexOf(name) === 0) { 11 | return c.substring(name.length, c.length); 12 | } 13 | } 14 | return ""; 15 | }; 16 | -------------------------------------------------------------------------------- /ui/src/app/home.component.html: -------------------------------------------------------------------------------- 1 |

BFF Auth0 Security architecture with Angular nx

2 | 3 | 6 |
7 | 14 |
15 | 16 |
17 | 18 |

User profile:

19 |
{{ userProfileClaims | json }}
20 |
21 | 22 | 23 | 26 | 27 | 28 |
29 | -------------------------------------------------------------------------------- /ui/src/app/home.component.ts: -------------------------------------------------------------------------------- 1 | import { CommonModule } from '@angular/common'; 2 | import { HttpClient } from '@angular/common/http'; 3 | import { Component, OnInit, inject } from '@angular/core'; 4 | import { Observable } from 'rxjs'; 5 | 6 | interface Claim { 7 | type: string; 8 | value: string; 9 | } 10 | 11 | interface UserProfile { 12 | isAuthenticated: boolean; 13 | nameClaimType: string; 14 | roleClaimType: string; 15 | claims: Claim[]; 16 | } 17 | 18 | @Component({ 19 | selector: 'app-home', 20 | templateUrl: 'home.component.html', 21 | imports: [CommonModule] 22 | }) 23 | export class HomeComponent implements OnInit { 24 | private readonly httpClient = inject(HttpClient); 25 | dataFromAzureProtectedApi$: Observable; 26 | dataGraphApiCalls$: Observable; 27 | userProfileClaims$: Observable; 28 | 29 | ngOnInit() { 30 | console.info('home component'); 31 | this.getUserProfile(); 32 | } 33 | 34 | getUserProfile() { 35 | this.userProfileClaims$ = this.httpClient.get( 36 | `${this.getCurrentHost()}/api/User` 37 | ); 38 | } 39 | 40 | getDirectApiData() { 41 | this.dataFromAzureProtectedApi$ = this.httpClient.get( 42 | `${this.getCurrentHost()}/api/DirectApi` 43 | ); 44 | } 45 | 46 | private getCurrentHost() { 47 | const host = window.location.host; 48 | const url = `${window.location.protocol}//${host}`; 49 | 50 | return url; 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /ui/src/app/secure-api.interceptor.ts: -------------------------------------------------------------------------------- 1 | import { HttpHandlerFn, HttpRequest } from '@angular/common/http'; 2 | import { getCookie } from './getCookie'; 3 | 4 | export function secureApiInterceptor( 5 | request: HttpRequest, 6 | next: HttpHandlerFn 7 | ) { 8 | const secureRoutes = [getApiUrl()]; 9 | 10 | if (!secureRoutes.find((x) => request.url.startsWith(x))) { 11 | return next(request); 12 | } 13 | 14 | request = request.clone({ 15 | headers: request.headers.set( 16 | 'X-XSRF-TOKEN', 17 | getCookie('XSRF-RequestToken') 18 | ), 19 | }); 20 | 21 | return next(request); 22 | } 23 | 24 | function getApiUrl() { 25 | const backendHost = getCurrentHost(); 26 | 27 | return `${backendHost}/api/`; 28 | } 29 | 30 | function getCurrentHost() { 31 | const host = window.location.host; 32 | const url = `${window.location.protocol}//${host}`; 33 | return url; 34 | } 35 | -------------------------------------------------------------------------------- /ui/src/assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damienbod/bff-auth0-aspnetcore-angular/0437c25ed440a32d4dbc720205ef93094f816504/ui/src/assets/.gitkeep -------------------------------------------------------------------------------- /ui/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/damienbod/bff-auth0-aspnetcore-angular/0437c25ed440a32d4dbc720205ef93094f816504/ui/src/favicon.ico -------------------------------------------------------------------------------- /ui/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | ui 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /ui/src/main.ts: -------------------------------------------------------------------------------- 1 | import { bootstrapApplication } from '@angular/platform-browser'; 2 | import { appConfig } from './app/app.config'; 3 | import { AppComponent } from './app/app.component'; 4 | 5 | bootstrapApplication(AppComponent, appConfig).catch((err) => 6 | console.error(err) 7 | ); 8 | -------------------------------------------------------------------------------- /ui/src/styles.scss: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | -------------------------------------------------------------------------------- /ui/src/test-setup.ts: -------------------------------------------------------------------------------- 1 | // @ts-expect-error https://thymikee.github.io/jest-preset-angular/docs/getting-started/test-environment 2 | globalThis.ngJest = { 3 | testEnvironmentOptions: { 4 | errorOnUnknownElements: true, 5 | errorOnUnknownProperties: true, 6 | }, 7 | }; 8 | import 'jest-preset-angular/setup-jest'; 9 | -------------------------------------------------------------------------------- /ui/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "./dist/out-tsc", 5 | "types": [] 6 | }, 7 | "files": ["src/main.ts"], 8 | "include": ["src/**/*.d.ts"], 9 | "exclude": ["jest.config.ts", "src/**/*.test.ts", "src/**/*.spec.ts"] 10 | } 11 | -------------------------------------------------------------------------------- /ui/tsconfig.editor.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "include": ["src/**/*.ts"], 4 | "compilerOptions": { 5 | "types": ["jest", "node"] 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /ui/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "rootDir": ".", 4 | "sourceMap": true, 5 | "declaration": false, 6 | "moduleResolution": "node", 7 | "emitDecoratorMetadata": true, 8 | "experimentalDecorators": true, 9 | "importHelpers": true, 10 | "target": "es2022", 11 | "module": "esnext", 12 | "lib": ["es2020", "dom"], 13 | "skipLibCheck": true, 14 | "skipDefaultLibCheck": true, 15 | "baseUrl": ".", 16 | "paths": {}, 17 | "useDefineForClassFields": false, 18 | "forceConsistentCasingInFileNames": true, 19 | "strict": false, 20 | "noImplicitOverride": true, 21 | "noPropertyAccessFromIndexSignature": true, 22 | "noImplicitReturns": true, 23 | "noFallthroughCasesInSwitch": true 24 | }, 25 | "files": [], 26 | "include": [], 27 | "references": [ 28 | { 29 | "path": "./tsconfig.app.json" 30 | }, 31 | { 32 | "path": "./tsconfig.spec.json" 33 | }, 34 | { 35 | "path": "./tsconfig.editor.json" 36 | } 37 | ], 38 | "compileOnSave": false, 39 | "exclude": ["node_modules", "tmp"], 40 | "angularCompilerOptions": { 41 | "enableI18nLegacyMessageIdFormat": false, 42 | "strictInjectionParameters": true, 43 | "strictInputAccessModifiers": true, 44 | "strictTemplates": true 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /ui/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "./dist/out-tsc", 5 | "module": "commonjs", 6 | "target": "es2016", 7 | "types": ["jest", "node"] 8 | }, 9 | "files": ["src/test-setup.ts"], 10 | "include": [ 11 | "jest.config.ts", 12 | "src/**/*.test.ts", 13 | "src/**/*.spec.ts", 14 | "src/**/*.d.ts" 15 | ] 16 | } 17 | --------------------------------------------------------------------------------