From ad46d9f433f762fb524645c1356aa8a6c76647c5 Mon Sep 17 00:00:00 2001 From: angela-tran Date: Tue, 13 Aug 2024 23:10:19 +0000 Subject: [PATCH] Deployed 4f991a5 with MkDocs version: 1.6.0 --- .nojekyll | 0 404.html | 1715 +++++ assets/images/favicon.png | Bin 0 -> 1870 bytes assets/javascripts/bundle.fe8b6f2b.min.js | 29 + assets/javascripts/bundle.fe8b6f2b.min.js.map | 7 + assets/javascripts/lunr/min/lunr.ar.min.js | 1 + assets/javascripts/lunr/min/lunr.da.min.js | 18 + assets/javascripts/lunr/min/lunr.de.min.js | 18 + assets/javascripts/lunr/min/lunr.du.min.js | 18 + assets/javascripts/lunr/min/lunr.el.min.js | 1 + assets/javascripts/lunr/min/lunr.es.min.js | 18 + assets/javascripts/lunr/min/lunr.fi.min.js | 18 + assets/javascripts/lunr/min/lunr.fr.min.js | 18 + assets/javascripts/lunr/min/lunr.he.min.js | 1 + assets/javascripts/lunr/min/lunr.hi.min.js | 1 + assets/javascripts/lunr/min/lunr.hu.min.js | 18 + assets/javascripts/lunr/min/lunr.hy.min.js | 1 + assets/javascripts/lunr/min/lunr.it.min.js | 18 + assets/javascripts/lunr/min/lunr.ja.min.js | 1 + assets/javascripts/lunr/min/lunr.jp.min.js | 1 + assets/javascripts/lunr/min/lunr.kn.min.js | 1 + assets/javascripts/lunr/min/lunr.ko.min.js | 1 + assets/javascripts/lunr/min/lunr.multi.min.js | 1 + assets/javascripts/lunr/min/lunr.nl.min.js | 18 + assets/javascripts/lunr/min/lunr.no.min.js | 18 + assets/javascripts/lunr/min/lunr.pt.min.js | 18 + assets/javascripts/lunr/min/lunr.ro.min.js | 18 + assets/javascripts/lunr/min/lunr.ru.min.js | 18 + assets/javascripts/lunr/min/lunr.sa.min.js | 1 + .../lunr/min/lunr.stemmer.support.min.js | 1 + assets/javascripts/lunr/min/lunr.sv.min.js | 18 + assets/javascripts/lunr/min/lunr.ta.min.js | 1 + assets/javascripts/lunr/min/lunr.te.min.js | 1 + assets/javascripts/lunr/min/lunr.th.min.js | 1 + assets/javascripts/lunr/min/lunr.tr.min.js | 18 + assets/javascripts/lunr/min/lunr.vi.min.js | 1 + assets/javascripts/lunr/min/lunr.zh.min.js | 1 + assets/javascripts/lunr/tinyseg.js | 206 + assets/javascripts/lunr/wordcut.js | 6708 +++++++++++++++++ .../workers/search.b8dbb3d2.min.js | 42 + .../workers/search.b8dbb3d2.min.js.map | 7 + assets/stylesheets/main.3cba04c6.min.css | 1 + assets/stylesheets/main.3cba04c6.min.css.map | 1 + assets/stylesheets/palette.06af60db.min.css | 1 + .../stylesheets/palette.06af60db.min.css.map | 1 + configuration/admin-interface/index.html | 1919 +++++ .../content-security-policy/index.html | 1891 +++++ configuration/data/index.html | 1872 +++++ .../environment-variables/index.html | 2264 ++++++ configuration/index.html | 1865 +++++ configuration/oauth/index.html | 1847 +++++ configuration/rate-limit/index.html | 1845 +++++ configuration/recaptcha/index.html | 1869 +++++ configuration/transit-agency/index.html | 1950 +++++ deployment/azure/index.html | 15 + deployment/hotfix/index.html | 1869 +++++ deployment/index.html | 1837 +++++ deployment/infrastructure/index.html | 2180 ++++++ deployment/release/index.html | 1871 +++++ deployment/rollback/index.html | 1833 +++++ deployment/secrets/index.html | 1828 +++++ deployment/troubleshooting/index.html | 1983 +++++ deployment/workflows/index.html | 1858 +++++ development/application-logic/index.html | 2087 +++++ .../commits-branches-merging/index.html | 1906 +++++ development/docker-dynamic-ports/index.html | 1875 +++++ development/i18n/index.html | 1881 +++++ .../img/docker-desktop-open-in-browser.png | Bin 0 -> 18146 bytes development/img/ports-local-address.png | Bin 0 -> 116329 bytes .../img/vscode-debugger-launch-config.png | Bin 0 -> 45072 bytes development/index.html | 1901 +++++ development/linting-pre-commit/index.html | 1831 +++++ development/models-migrations/index.html | 1821 +++++ development/test-server/index.html | 1824 +++++ enrollment-pathways/agency-cards/index.html | 1880 +++++ enrollment-pathways/index.html | 1869 +++++ enrollment-pathways/low-income/index.html | 1971 +++++ enrollment-pathways/older-adults/index.html | 1832 +++++ enrollment-pathways/veterans/index.html | 1929 +++++ getting-started/development/index.html | 15 + .../docker-dynamic-ports/index.html | 15 + getting-started/documentation/index.html | 1886 +++++ getting-started/img/edit-pencil.png | Bin 0 -> 44841 bytes getting-started/index.html | 1863 +++++ index.html | 1976 +++++ product-and-design/analytics/index.html | 2065 +++++ product-and-design/copy-delivery/index.html | 1882 +++++ product-and-design/copy-style/index.html | 2060 +++++ .../use-cases/enrollment-use-cases/index.html | 1830 +++++ requirements.txt | 6 + search/search_index.json | 1 + sitemap.xml | 198 + sitemap.xml.gz | Bin 0 -> 610 bytes tests/automated-tests/index.html | 1897 +++++ tests/coverage/class_index.html | 1173 +++ tests/coverage/coverage_html_cb_6fb7b396.js | 733 ++ tests/coverage/favicon_32_cb_58284776.png | Bin 0 -> 1732 bytes tests/coverage/function_index.html | 2623 +++++++ tests/coverage/index.html | 542 ++ tests/coverage/keybd_closed_cb_ce680311.png | Bin 0 -> 9004 bytes tests/coverage/status.json | 1 + tests/coverage/style_cb_8e611ae1.css | 337 + .../z_5351a2d360ecd143___init___py.html | 99 + .../z_5351a2d360ecd143_analytics_py.html | 144 + .../coverage/z_5351a2d360ecd143_apps_py.html | 110 + .../coverage/z_5351a2d360ecd143_forms_py.html | 129 + .../coverage/z_5351a2d360ecd143_urls_py.html | 118 + .../coverage/z_5351a2d360ecd143_views_py.html | 394 + .../z_7432a6a7a8e99cb0___init___py.html | 99 + .../coverage/z_7432a6a7a8e99cb0_apps_py.html | 105 + .../coverage/z_7432a6a7a8e99cb0_urls_py.html | 110 + .../coverage/z_7432a6a7a8e99cb0_views_py.html | 111 + .../z_7435199c01eb52ab___init___py.html | 99 + .../z_7435199c01eb52ab_analytics_py.html | 190 + .../coverage/z_7435199c01eb52ab_apps_py.html | 110 + .../z_7435199c01eb52ab_client_py.html | 171 + .../z_7435199c01eb52ab_middleware_py.html | 139 + .../z_7435199c01eb52ab_redirects_py.html | 142 + .../coverage/z_7435199c01eb52ab_urls_py.html | 114 + .../coverage/z_7435199c01eb52ab_views_py.html | 314 + .../z_795c8c28b74e7b9e___init___py.html | 109 + .../z_795c8c28b74e7b9e_secrets_py.html | 198 + .../z_795c8c28b74e7b9e_sentry_py.html | 209 + .../z_795c8c28b74e7b9e_settings_py.html | 454 ++ .../coverage/z_795c8c28b74e7b9e_urls_py.html | 152 + .../coverage/z_795c8c28b74e7b9e_wsgi_py.html | 116 + .../z_8c0b35f1ea7ee6af___init___py.html | 99 + .../coverage/z_8c0b35f1ea7ee6af_admin_py.html | 269 + .../z_8c0b35f1ea7ee6af_analytics_py.html | 272 + .../coverage/z_8c0b35f1ea7ee6af_apps_py.html | 110 + ...c0b35f1ea7ee6af_context_processors_py.html | 193 + .../z_8c0b35f1ea7ee6af_middleware_py.html | 264 + .../z_8c0b35f1ea7ee6af_models_py.html | 527 ++ .../z_8c0b35f1ea7ee6af_recaptcha_py.html | 131 + .../z_8c0b35f1ea7ee6af_session_py.html | 392 + .../coverage/z_8c0b35f1ea7ee6af_urls_py.html | 153 + .../coverage/z_8c0b35f1ea7ee6af_views_py.html | 195 + .../z_8c0b35f1ea7ee6af_widgets_py.html | 142 + .../z_9a5e1802ee124b46___init___py.html | 99 + .../z_9a5e1802ee124b46_formats_py.html | 101 + .../z_d1111b74f8c04d3c___init___py.html | 99 + .../z_d1111b74f8c04d3c_analytics_py.html | 165 + .../coverage/z_d1111b74f8c04d3c_apps_py.html | 110 + .../coverage/z_d1111b74f8c04d3c_forms_py.html | 328 + .../coverage/z_d1111b74f8c04d3c_urls_py.html | 117 + .../z_d1111b74f8c04d3c_verify_py.html | 137 + .../coverage/z_d1111b74f8c04d3c_views_py.html | 271 + .../z_de34693c7b899b5e___init___py.html | 99 + .../z_de34693c7b899b5e_formats_py.html | 104 + .../z_ed7c491f4d53135c___init___py.html | 99 + tests/manual-tests/index.html | 1906 +++++ use-cases/courtesy-cards/index.html | 15 + 152 files changed, 97644 insertions(+) create mode 100644 .nojekyll create mode 100644 404.html create mode 100644 assets/images/favicon.png create mode 100644 assets/javascripts/bundle.fe8b6f2b.min.js create mode 100644 assets/javascripts/bundle.fe8b6f2b.min.js.map create mode 100644 assets/javascripts/lunr/min/lunr.ar.min.js create mode 100644 assets/javascripts/lunr/min/lunr.da.min.js create mode 100644 assets/javascripts/lunr/min/lunr.de.min.js create mode 100644 assets/javascripts/lunr/min/lunr.du.min.js create mode 100644 assets/javascripts/lunr/min/lunr.el.min.js create mode 100644 assets/javascripts/lunr/min/lunr.es.min.js create mode 100644 assets/javascripts/lunr/min/lunr.fi.min.js create mode 100644 assets/javascripts/lunr/min/lunr.fr.min.js create mode 100644 assets/javascripts/lunr/min/lunr.he.min.js create mode 100644 assets/javascripts/lunr/min/lunr.hi.min.js create mode 100644 assets/javascripts/lunr/min/lunr.hu.min.js create mode 100644 assets/javascripts/lunr/min/lunr.hy.min.js create mode 100644 assets/javascripts/lunr/min/lunr.it.min.js create mode 100644 assets/javascripts/lunr/min/lunr.ja.min.js create mode 100644 assets/javascripts/lunr/min/lunr.jp.min.js create mode 100644 assets/javascripts/lunr/min/lunr.kn.min.js create mode 100644 assets/javascripts/lunr/min/lunr.ko.min.js create mode 100644 assets/javascripts/lunr/min/lunr.multi.min.js create mode 100644 assets/javascripts/lunr/min/lunr.nl.min.js create mode 100644 assets/javascripts/lunr/min/lunr.no.min.js create mode 100644 assets/javascripts/lunr/min/lunr.pt.min.js create mode 100644 assets/javascripts/lunr/min/lunr.ro.min.js create mode 100644 assets/javascripts/lunr/min/lunr.ru.min.js create mode 100644 assets/javascripts/lunr/min/lunr.sa.min.js create mode 100644 assets/javascripts/lunr/min/lunr.stemmer.support.min.js create mode 100644 assets/javascripts/lunr/min/lunr.sv.min.js create mode 100644 assets/javascripts/lunr/min/lunr.ta.min.js create mode 100644 assets/javascripts/lunr/min/lunr.te.min.js create mode 100644 assets/javascripts/lunr/min/lunr.th.min.js create mode 100644 assets/javascripts/lunr/min/lunr.tr.min.js create mode 100644 assets/javascripts/lunr/min/lunr.vi.min.js create mode 100644 assets/javascripts/lunr/min/lunr.zh.min.js create mode 100644 assets/javascripts/lunr/tinyseg.js create mode 100644 assets/javascripts/lunr/wordcut.js create mode 100644 assets/javascripts/workers/search.b8dbb3d2.min.js create mode 100644 assets/javascripts/workers/search.b8dbb3d2.min.js.map create mode 100644 assets/stylesheets/main.3cba04c6.min.css create mode 100644 assets/stylesheets/main.3cba04c6.min.css.map create mode 100644 assets/stylesheets/palette.06af60db.min.css create mode 100644 assets/stylesheets/palette.06af60db.min.css.map create mode 100644 configuration/admin-interface/index.html create mode 100644 configuration/content-security-policy/index.html create mode 100644 configuration/data/index.html create mode 100644 configuration/environment-variables/index.html create mode 100644 configuration/index.html create mode 100644 configuration/oauth/index.html create mode 100644 configuration/rate-limit/index.html create mode 100644 configuration/recaptcha/index.html create mode 100644 configuration/transit-agency/index.html create mode 100644 deployment/azure/index.html create mode 100644 deployment/hotfix/index.html create mode 100644 deployment/index.html create mode 100644 deployment/infrastructure/index.html create mode 100644 deployment/release/index.html create mode 100644 deployment/rollback/index.html create mode 100644 deployment/secrets/index.html create mode 100644 deployment/troubleshooting/index.html create mode 100644 deployment/workflows/index.html create mode 100644 development/application-logic/index.html create mode 100644 development/commits-branches-merging/index.html create mode 100644 development/docker-dynamic-ports/index.html create mode 100644 development/i18n/index.html create mode 100644 development/img/docker-desktop-open-in-browser.png create mode 100644 development/img/ports-local-address.png create mode 100644 development/img/vscode-debugger-launch-config.png create mode 100644 development/index.html create mode 100644 development/linting-pre-commit/index.html create mode 100644 development/models-migrations/index.html create mode 100644 development/test-server/index.html create mode 100644 enrollment-pathways/agency-cards/index.html create mode 100644 enrollment-pathways/index.html create mode 100644 enrollment-pathways/low-income/index.html create mode 100644 enrollment-pathways/older-adults/index.html create mode 100644 enrollment-pathways/veterans/index.html create mode 100644 getting-started/development/index.html create mode 100644 getting-started/docker-dynamic-ports/index.html create mode 100644 getting-started/documentation/index.html create mode 100644 getting-started/img/edit-pencil.png create mode 100644 getting-started/index.html create mode 100644 index.html create mode 100644 product-and-design/analytics/index.html create mode 100644 product-and-design/copy-delivery/index.html create mode 100644 product-and-design/copy-style/index.html create mode 100644 product-and-design/use-cases/enrollment-use-cases/index.html create mode 100644 requirements.txt create mode 100644 search/search_index.json create mode 100644 sitemap.xml create mode 100644 sitemap.xml.gz create mode 100644 tests/automated-tests/index.html create mode 100644 tests/coverage/class_index.html create mode 100644 tests/coverage/coverage_html_cb_6fb7b396.js create mode 100644 tests/coverage/favicon_32_cb_58284776.png create mode 100644 tests/coverage/function_index.html create mode 100644 tests/coverage/index.html create mode 100644 tests/coverage/keybd_closed_cb_ce680311.png create mode 100644 tests/coverage/status.json create mode 100644 tests/coverage/style_cb_8e611ae1.css create mode 100644 tests/coverage/z_5351a2d360ecd143___init___py.html create mode 100644 tests/coverage/z_5351a2d360ecd143_analytics_py.html create mode 100644 tests/coverage/z_5351a2d360ecd143_apps_py.html create mode 100644 tests/coverage/z_5351a2d360ecd143_forms_py.html create mode 100644 tests/coverage/z_5351a2d360ecd143_urls_py.html create mode 100644 tests/coverage/z_5351a2d360ecd143_views_py.html create mode 100644 tests/coverage/z_7432a6a7a8e99cb0___init___py.html create mode 100644 tests/coverage/z_7432a6a7a8e99cb0_apps_py.html create mode 100644 tests/coverage/z_7432a6a7a8e99cb0_urls_py.html create mode 100644 tests/coverage/z_7432a6a7a8e99cb0_views_py.html create mode 100644 tests/coverage/z_7435199c01eb52ab___init___py.html create mode 100644 tests/coverage/z_7435199c01eb52ab_analytics_py.html create mode 100644 tests/coverage/z_7435199c01eb52ab_apps_py.html create mode 100644 tests/coverage/z_7435199c01eb52ab_client_py.html create mode 100644 tests/coverage/z_7435199c01eb52ab_middleware_py.html create mode 100644 tests/coverage/z_7435199c01eb52ab_redirects_py.html create mode 100644 tests/coverage/z_7435199c01eb52ab_urls_py.html create mode 100644 tests/coverage/z_7435199c01eb52ab_views_py.html create mode 100644 tests/coverage/z_795c8c28b74e7b9e___init___py.html create mode 100644 tests/coverage/z_795c8c28b74e7b9e_secrets_py.html create mode 100644 tests/coverage/z_795c8c28b74e7b9e_sentry_py.html create mode 100644 tests/coverage/z_795c8c28b74e7b9e_settings_py.html create mode 100644 tests/coverage/z_795c8c28b74e7b9e_urls_py.html create mode 100644 tests/coverage/z_795c8c28b74e7b9e_wsgi_py.html create mode 100644 tests/coverage/z_8c0b35f1ea7ee6af___init___py.html create mode 100644 tests/coverage/z_8c0b35f1ea7ee6af_admin_py.html create mode 100644 tests/coverage/z_8c0b35f1ea7ee6af_analytics_py.html create mode 100644 tests/coverage/z_8c0b35f1ea7ee6af_apps_py.html create mode 100644 tests/coverage/z_8c0b35f1ea7ee6af_context_processors_py.html create mode 100644 tests/coverage/z_8c0b35f1ea7ee6af_middleware_py.html create mode 100644 tests/coverage/z_8c0b35f1ea7ee6af_models_py.html create mode 100644 tests/coverage/z_8c0b35f1ea7ee6af_recaptcha_py.html create mode 100644 tests/coverage/z_8c0b35f1ea7ee6af_session_py.html create mode 100644 tests/coverage/z_8c0b35f1ea7ee6af_urls_py.html create mode 100644 tests/coverage/z_8c0b35f1ea7ee6af_views_py.html create mode 100644 tests/coverage/z_8c0b35f1ea7ee6af_widgets_py.html create mode 100644 tests/coverage/z_9a5e1802ee124b46___init___py.html create mode 100644 tests/coverage/z_9a5e1802ee124b46_formats_py.html create mode 100644 tests/coverage/z_d1111b74f8c04d3c___init___py.html create mode 100644 tests/coverage/z_d1111b74f8c04d3c_analytics_py.html create mode 100644 tests/coverage/z_d1111b74f8c04d3c_apps_py.html create mode 100644 tests/coverage/z_d1111b74f8c04d3c_forms_py.html create mode 100644 tests/coverage/z_d1111b74f8c04d3c_urls_py.html create mode 100644 tests/coverage/z_d1111b74f8c04d3c_verify_py.html create mode 100644 tests/coverage/z_d1111b74f8c04d3c_views_py.html create mode 100644 tests/coverage/z_de34693c7b899b5e___init___py.html create mode 100644 tests/coverage/z_de34693c7b899b5e_formats_py.html create mode 100644 tests/coverage/z_ed7c491f4d53135c___init___py.html create mode 100644 tests/manual-tests/index.html create mode 100644 use-cases/courtesy-cards/index.html diff --git a/.nojekyll b/.nojekyll new file mode 100644 index 000000000..e69de29bb diff --git a/404.html b/404.html new file mode 100644 index 000000000..d1d5d0e7c --- /dev/null +++ b/404.html @@ -0,0 +1,1715 @@ + + + + + + + + + + + + + + + + + + + cal-itp/benefits: documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ +
+ + + + +
+ + +
+ +
+ + + + + + + + + +
+
+ + + +
+
+
+ + + + + + + + + +
+
+
+ + + + +
+
+ +

404 - Not found

+ +
+
+ + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + \ No newline at end of file diff --git a/assets/images/favicon.png b/assets/images/favicon.png new file mode 100644 index 0000000000000000000000000000000000000000..1cf13b9f9d978896599290a74f77d5dbe7d1655c GIT binary patch literal 1870 zcmV-U2eJ5xP)Gc)JR9QMau)O=X#!i9;T z37kk-upj^(fsR36MHs_+1RCI)NNu9}lD0S{B^g8PN?Ww(5|~L#Ng*g{WsqleV}|#l zz8@ri&cTzw_h33bHI+12+kK6WN$h#n5cD8OQt`5kw6p~9H3()bUQ8OS4Q4HTQ=1Ol z_JAocz`fLbT2^{`8n~UAo=#AUOf=SOq4pYkt;XbC&f#7lb$*7=$na!mWCQ`dBQsO0 zLFBSPj*N?#u5&pf2t4XjEGH|=pPQ8xh7tpx;US5Cx_Ju;!O`ya-yF`)b%TEt5>eP1ZX~}sjjA%FJF?h7cX8=b!DZl<6%Cv z*G0uvvU+vmnpLZ2paivG-(cd*y3$hCIcsZcYOGh{$&)A6*XX&kXZd3G8m)G$Zz-LV z^GF3VAW^Mdv!)4OM8EgqRiz~*Cji;uzl2uC9^=8I84vNp;ltJ|q-*uQwGp2ma6cY7 z;`%`!9UXO@fr&Ebapfs34OmS9^u6$)bJxrucutf>`dKPKT%%*d3XlFVKunp9 zasduxjrjs>f8V=D|J=XNZp;_Zy^WgQ$9WDjgY=z@stwiEBm9u5*|34&1Na8BMjjgf3+SHcr`5~>oz1Y?SW^=K z^bTyO6>Gar#P_W2gEMwq)ot3; zREHn~U&Dp0l6YT0&k-wLwYjb?5zGK`W6S2v+K>AM(95m2C20L|3m~rN8dprPr@t)5lsk9Hu*W z?pS990s;Ez=+Rj{x7p``4>+c0G5^pYnB1^!TL=(?HLHZ+HicG{~4F1d^5Awl_2!1jICM-!9eoLhbbT^;yHcefyTAaqRcY zmuctDopPT!%k+}x%lZRKnzykr2}}XfG_ne?nRQO~?%hkzo;@RN{P6o`&mMUWBYMTe z6i8ChtjX&gXl`nvrU>jah)2iNM%JdjqoaeaU%yVn!^70x-flljp6Q5tK}5}&X8&&G zX3fpb3E(!rH=zVI_9Gjl45w@{(ITqngWFe7@9{mX;tO25Z_8 zQHEpI+FkTU#4xu>RkN>b3Tnc3UpWzPXWm#o55GKF09j^Mh~)K7{QqbO_~(@CVq! zS<8954|P8mXN2MRs86xZ&Q4EfM@JB94b=(YGuk)s&^jiSF=t3*oNK3`rD{H`yQ?d; ztE=laAUoZx5?RC8*WKOj`%LXEkgDd>&^Q4M^z`%u0rg-It=hLCVsq!Z%^6eB-OvOT zFZ28TN&cRmgU}Elrnk43)!>Z1FCPL2K$7}gwzIc48NX}#!A1BpJP?#v5wkNprhV** z?Cpalt1oH&{r!o3eSKc&ap)iz2BTn_VV`4>9M^b3;(YY}4>#ML6{~(4mH+?%07*qo IM6N<$f(jP3KmY&$ literal 0 HcmV?d00001 diff --git a/assets/javascripts/bundle.fe8b6f2b.min.js b/assets/javascripts/bundle.fe8b6f2b.min.js new file mode 100644 index 000000000..cf778d428 --- /dev/null +++ b/assets/javascripts/bundle.fe8b6f2b.min.js @@ -0,0 +1,29 @@ +"use strict";(()=>{var Fi=Object.create;var gr=Object.defineProperty;var ji=Object.getOwnPropertyDescriptor;var Wi=Object.getOwnPropertyNames,Dt=Object.getOwnPropertySymbols,Ui=Object.getPrototypeOf,xr=Object.prototype.hasOwnProperty,no=Object.prototype.propertyIsEnumerable;var oo=(e,t,r)=>t in e?gr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,R=(e,t)=>{for(var r in t||(t={}))xr.call(t,r)&&oo(e,r,t[r]);if(Dt)for(var r of Dt(t))no.call(t,r)&&oo(e,r,t[r]);return e};var io=(e,t)=>{var r={};for(var o in e)xr.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(e!=null&&Dt)for(var o of Dt(e))t.indexOf(o)<0&&no.call(e,o)&&(r[o]=e[o]);return r};var yr=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Di=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of Wi(t))!xr.call(e,n)&&n!==r&&gr(e,n,{get:()=>t[n],enumerable:!(o=ji(t,n))||o.enumerable});return e};var Vt=(e,t,r)=>(r=e!=null?Fi(Ui(e)):{},Di(t||!e||!e.__esModule?gr(r,"default",{value:e,enumerable:!0}):r,e));var ao=(e,t,r)=>new Promise((o,n)=>{var i=p=>{try{s(r.next(p))}catch(c){n(c)}},a=p=>{try{s(r.throw(p))}catch(c){n(c)}},s=p=>p.done?o(p.value):Promise.resolve(p.value).then(i,a);s((r=r.apply(e,t)).next())});var co=yr((Er,so)=>{(function(e,t){typeof Er=="object"&&typeof so!="undefined"?t():typeof define=="function"&&define.amd?define(t):t()})(Er,function(){"use strict";function e(r){var o=!0,n=!1,i=null,a={text:!0,search:!0,url:!0,tel:!0,email:!0,password:!0,number:!0,date:!0,month:!0,week:!0,time:!0,datetime:!0,"datetime-local":!0};function s(H){return!!(H&&H!==document&&H.nodeName!=="HTML"&&H.nodeName!=="BODY"&&"classList"in H&&"contains"in H.classList)}function p(H){var mt=H.type,ze=H.tagName;return!!(ze==="INPUT"&&a[mt]&&!H.readOnly||ze==="TEXTAREA"&&!H.readOnly||H.isContentEditable)}function c(H){H.classList.contains("focus-visible")||(H.classList.add("focus-visible"),H.setAttribute("data-focus-visible-added",""))}function l(H){H.hasAttribute("data-focus-visible-added")&&(H.classList.remove("focus-visible"),H.removeAttribute("data-focus-visible-added"))}function f(H){H.metaKey||H.altKey||H.ctrlKey||(s(r.activeElement)&&c(r.activeElement),o=!0)}function u(H){o=!1}function h(H){s(H.target)&&(o||p(H.target))&&c(H.target)}function w(H){s(H.target)&&(H.target.classList.contains("focus-visible")||H.target.hasAttribute("data-focus-visible-added"))&&(n=!0,window.clearTimeout(i),i=window.setTimeout(function(){n=!1},100),l(H.target))}function A(H){document.visibilityState==="hidden"&&(n&&(o=!0),te())}function te(){document.addEventListener("mousemove",J),document.addEventListener("mousedown",J),document.addEventListener("mouseup",J),document.addEventListener("pointermove",J),document.addEventListener("pointerdown",J),document.addEventListener("pointerup",J),document.addEventListener("touchmove",J),document.addEventListener("touchstart",J),document.addEventListener("touchend",J)}function ie(){document.removeEventListener("mousemove",J),document.removeEventListener("mousedown",J),document.removeEventListener("mouseup",J),document.removeEventListener("pointermove",J),document.removeEventListener("pointerdown",J),document.removeEventListener("pointerup",J),document.removeEventListener("touchmove",J),document.removeEventListener("touchstart",J),document.removeEventListener("touchend",J)}function J(H){H.target.nodeName&&H.target.nodeName.toLowerCase()==="html"||(o=!1,ie())}document.addEventListener("keydown",f,!0),document.addEventListener("mousedown",u,!0),document.addEventListener("pointerdown",u,!0),document.addEventListener("touchstart",u,!0),document.addEventListener("visibilitychange",A,!0),te(),r.addEventListener("focus",h,!0),r.addEventListener("blur",w,!0),r.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&r.host?r.host.setAttribute("data-js-focus-visible",""):r.nodeType===Node.DOCUMENT_NODE&&(document.documentElement.classList.add("js-focus-visible"),document.documentElement.setAttribute("data-js-focus-visible",""))}if(typeof window!="undefined"&&typeof document!="undefined"){window.applyFocusVisiblePolyfill=e;var t;try{t=new CustomEvent("focus-visible-polyfill-ready")}catch(r){t=document.createEvent("CustomEvent"),t.initCustomEvent("focus-visible-polyfill-ready",!1,!1,{})}window.dispatchEvent(t)}typeof document!="undefined"&&e(document)})});var Yr=yr((Rt,Kr)=>{/*! + * clipboard.js v2.0.11 + * https://clipboardjs.com/ + * + * Licensed MIT © Zeno Rocha + */(function(t,r){typeof Rt=="object"&&typeof Kr=="object"?Kr.exports=r():typeof define=="function"&&define.amd?define([],r):typeof Rt=="object"?Rt.ClipboardJS=r():t.ClipboardJS=r()})(Rt,function(){return function(){var e={686:function(o,n,i){"use strict";i.d(n,{default:function(){return Ii}});var a=i(279),s=i.n(a),p=i(370),c=i.n(p),l=i(817),f=i.n(l);function u(V){try{return document.execCommand(V)}catch(_){return!1}}var h=function(_){var M=f()(_);return u("cut"),M},w=h;function A(V){var _=document.documentElement.getAttribute("dir")==="rtl",M=document.createElement("textarea");M.style.fontSize="12pt",M.style.border="0",M.style.padding="0",M.style.margin="0",M.style.position="absolute",M.style[_?"right":"left"]="-9999px";var j=window.pageYOffset||document.documentElement.scrollTop;return M.style.top="".concat(j,"px"),M.setAttribute("readonly",""),M.value=V,M}var te=function(_,M){var j=A(_);M.container.appendChild(j);var D=f()(j);return u("copy"),j.remove(),D},ie=function(_){var M=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{container:document.body},j="";return typeof _=="string"?j=te(_,M):_ instanceof HTMLInputElement&&!["text","search","url","tel","password"].includes(_==null?void 0:_.type)?j=te(_.value,M):(j=f()(_),u("copy")),j},J=ie;function H(V){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?H=function(M){return typeof M}:H=function(M){return M&&typeof Symbol=="function"&&M.constructor===Symbol&&M!==Symbol.prototype?"symbol":typeof M},H(V)}var mt=function(){var _=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},M=_.action,j=M===void 0?"copy":M,D=_.container,Y=_.target,ke=_.text;if(j!=="copy"&&j!=="cut")throw new Error('Invalid "action" value, use either "copy" or "cut"');if(Y!==void 0)if(Y&&H(Y)==="object"&&Y.nodeType===1){if(j==="copy"&&Y.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if(j==="cut"&&(Y.hasAttribute("readonly")||Y.hasAttribute("disabled")))throw new Error(`Invalid "target" attribute. You can't cut text from elements with "readonly" or "disabled" attributes`)}else throw new Error('Invalid "target" value, use a valid Element');if(ke)return J(ke,{container:D});if(Y)return j==="cut"?w(Y):J(Y,{container:D})},ze=mt;function Ie(V){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Ie=function(M){return typeof M}:Ie=function(M){return M&&typeof Symbol=="function"&&M.constructor===Symbol&&M!==Symbol.prototype?"symbol":typeof M},Ie(V)}function _i(V,_){if(!(V instanceof _))throw new TypeError("Cannot call a class as a function")}function ro(V,_){for(var M=0;M<_.length;M++){var j=_[M];j.enumerable=j.enumerable||!1,j.configurable=!0,"value"in j&&(j.writable=!0),Object.defineProperty(V,j.key,j)}}function Ai(V,_,M){return _&&ro(V.prototype,_),M&&ro(V,M),V}function Ci(V,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function");V.prototype=Object.create(_&&_.prototype,{constructor:{value:V,writable:!0,configurable:!0}}),_&&br(V,_)}function br(V,_){return br=Object.setPrototypeOf||function(j,D){return j.__proto__=D,j},br(V,_)}function Hi(V){var _=Pi();return function(){var j=Wt(V),D;if(_){var Y=Wt(this).constructor;D=Reflect.construct(j,arguments,Y)}else D=j.apply(this,arguments);return ki(this,D)}}function ki(V,_){return _&&(Ie(_)==="object"||typeof _=="function")?_:$i(V)}function $i(V){if(V===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return V}function Pi(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(V){return!1}}function Wt(V){return Wt=Object.setPrototypeOf?Object.getPrototypeOf:function(M){return M.__proto__||Object.getPrototypeOf(M)},Wt(V)}function vr(V,_){var M="data-clipboard-".concat(V);if(_.hasAttribute(M))return _.getAttribute(M)}var Ri=function(V){Ci(M,V);var _=Hi(M);function M(j,D){var Y;return _i(this,M),Y=_.call(this),Y.resolveOptions(D),Y.listenClick(j),Y}return Ai(M,[{key:"resolveOptions",value:function(){var D=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.action=typeof D.action=="function"?D.action:this.defaultAction,this.target=typeof D.target=="function"?D.target:this.defaultTarget,this.text=typeof D.text=="function"?D.text:this.defaultText,this.container=Ie(D.container)==="object"?D.container:document.body}},{key:"listenClick",value:function(D){var Y=this;this.listener=c()(D,"click",function(ke){return Y.onClick(ke)})}},{key:"onClick",value:function(D){var Y=D.delegateTarget||D.currentTarget,ke=this.action(Y)||"copy",Ut=ze({action:ke,container:this.container,target:this.target(Y),text:this.text(Y)});this.emit(Ut?"success":"error",{action:ke,text:Ut,trigger:Y,clearSelection:function(){Y&&Y.focus(),window.getSelection().removeAllRanges()}})}},{key:"defaultAction",value:function(D){return vr("action",D)}},{key:"defaultTarget",value:function(D){var Y=vr("target",D);if(Y)return document.querySelector(Y)}},{key:"defaultText",value:function(D){return vr("text",D)}},{key:"destroy",value:function(){this.listener.destroy()}}],[{key:"copy",value:function(D){var Y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{container:document.body};return J(D,Y)}},{key:"cut",value:function(D){return w(D)}},{key:"isSupported",value:function(){var D=arguments.length>0&&arguments[0]!==void 0?arguments[0]:["copy","cut"],Y=typeof D=="string"?[D]:D,ke=!!document.queryCommandSupported;return Y.forEach(function(Ut){ke=ke&&!!document.queryCommandSupported(Ut)}),ke}}]),M}(s()),Ii=Ri},828:function(o){var n=9;if(typeof Element!="undefined"&&!Element.prototype.matches){var i=Element.prototype;i.matches=i.matchesSelector||i.mozMatchesSelector||i.msMatchesSelector||i.oMatchesSelector||i.webkitMatchesSelector}function a(s,p){for(;s&&s.nodeType!==n;){if(typeof s.matches=="function"&&s.matches(p))return s;s=s.parentNode}}o.exports=a},438:function(o,n,i){var a=i(828);function s(l,f,u,h,w){var A=c.apply(this,arguments);return l.addEventListener(u,A,w),{destroy:function(){l.removeEventListener(u,A,w)}}}function p(l,f,u,h,w){return typeof l.addEventListener=="function"?s.apply(null,arguments):typeof u=="function"?s.bind(null,document).apply(null,arguments):(typeof l=="string"&&(l=document.querySelectorAll(l)),Array.prototype.map.call(l,function(A){return s(A,f,u,h,w)}))}function c(l,f,u,h){return function(w){w.delegateTarget=a(w.target,f),w.delegateTarget&&h.call(l,w)}}o.exports=p},879:function(o,n){n.node=function(i){return i!==void 0&&i instanceof HTMLElement&&i.nodeType===1},n.nodeList=function(i){var a=Object.prototype.toString.call(i);return i!==void 0&&(a==="[object NodeList]"||a==="[object HTMLCollection]")&&"length"in i&&(i.length===0||n.node(i[0]))},n.string=function(i){return typeof i=="string"||i instanceof String},n.fn=function(i){var a=Object.prototype.toString.call(i);return a==="[object Function]"}},370:function(o,n,i){var a=i(879),s=i(438);function p(u,h,w){if(!u&&!h&&!w)throw new Error("Missing required arguments");if(!a.string(h))throw new TypeError("Second argument must be a String");if(!a.fn(w))throw new TypeError("Third argument must be a Function");if(a.node(u))return c(u,h,w);if(a.nodeList(u))return l(u,h,w);if(a.string(u))return f(u,h,w);throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList")}function c(u,h,w){return u.addEventListener(h,w),{destroy:function(){u.removeEventListener(h,w)}}}function l(u,h,w){return Array.prototype.forEach.call(u,function(A){A.addEventListener(h,w)}),{destroy:function(){Array.prototype.forEach.call(u,function(A){A.removeEventListener(h,w)})}}}function f(u,h,w){return s(document.body,u,h,w)}o.exports=p},817:function(o){function n(i){var a;if(i.nodeName==="SELECT")i.focus(),a=i.value;else if(i.nodeName==="INPUT"||i.nodeName==="TEXTAREA"){var s=i.hasAttribute("readonly");s||i.setAttribute("readonly",""),i.select(),i.setSelectionRange(0,i.value.length),s||i.removeAttribute("readonly"),a=i.value}else{i.hasAttribute("contenteditable")&&i.focus();var p=window.getSelection(),c=document.createRange();c.selectNodeContents(i),p.removeAllRanges(),p.addRange(c),a=p.toString()}return a}o.exports=n},279:function(o){function n(){}n.prototype={on:function(i,a,s){var p=this.e||(this.e={});return(p[i]||(p[i]=[])).push({fn:a,ctx:s}),this},once:function(i,a,s){var p=this;function c(){p.off(i,c),a.apply(s,arguments)}return c._=a,this.on(i,c,s)},emit:function(i){var a=[].slice.call(arguments,1),s=((this.e||(this.e={}))[i]||[]).slice(),p=0,c=s.length;for(p;p{"use strict";/*! + * escape-html + * Copyright(c) 2012-2013 TJ Holowaychuk + * Copyright(c) 2015 Andreas Lubbe + * Copyright(c) 2015 Tiancheng "Timothy" Gu + * MIT Licensed + */var ts=/["'&<>]/;ei.exports=rs;function rs(e){var t=""+e,r=ts.exec(t);if(!r)return t;var o,n="",i=0,a=0;for(i=r.index;i0&&i[i.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!i||c[1]>i[0]&&c[1]=e.length&&(e=void 0),{value:e&&e[o++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function N(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var o=r.call(e),n,i=[],a;try{for(;(t===void 0||t-- >0)&&!(n=o.next()).done;)i.push(n.value)}catch(s){a={error:s}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(a)throw a.error}}return i}function q(e,t,r){if(r||arguments.length===2)for(var o=0,n=t.length,i;o1||s(u,h)})})}function s(u,h){try{p(o[u](h))}catch(w){f(i[0][3],w)}}function p(u){u.value instanceof nt?Promise.resolve(u.value.v).then(c,l):f(i[0][2],u)}function c(u){s("next",u)}function l(u){s("throw",u)}function f(u,h){u(h),i.shift(),i.length&&s(i[0][0],i[0][1])}}function mo(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],r;return t?t.call(e):(e=typeof de=="function"?de(e):e[Symbol.iterator](),r={},o("next"),o("throw"),o("return"),r[Symbol.asyncIterator]=function(){return this},r);function o(i){r[i]=e[i]&&function(a){return new Promise(function(s,p){a=e[i](a),n(s,p,a.done,a.value)})}}function n(i,a,s,p){Promise.resolve(p).then(function(c){i({value:c,done:s})},a)}}function k(e){return typeof e=="function"}function ft(e){var t=function(o){Error.call(o),o.stack=new Error().stack},r=e(t);return r.prototype=Object.create(Error.prototype),r.prototype.constructor=r,r}var zt=ft(function(e){return function(r){e(this),this.message=r?r.length+` errors occurred during unsubscription: +`+r.map(function(o,n){return n+1+") "+o.toString()}).join(` + `):"",this.name="UnsubscriptionError",this.errors=r}});function qe(e,t){if(e){var r=e.indexOf(t);0<=r&&e.splice(r,1)}}var Fe=function(){function e(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}return e.prototype.unsubscribe=function(){var t,r,o,n,i;if(!this.closed){this.closed=!0;var a=this._parentage;if(a)if(this._parentage=null,Array.isArray(a))try{for(var s=de(a),p=s.next();!p.done;p=s.next()){var c=p.value;c.remove(this)}}catch(A){t={error:A}}finally{try{p&&!p.done&&(r=s.return)&&r.call(s)}finally{if(t)throw t.error}}else a.remove(this);var l=this.initialTeardown;if(k(l))try{l()}catch(A){i=A instanceof zt?A.errors:[A]}var f=this._finalizers;if(f){this._finalizers=null;try{for(var u=de(f),h=u.next();!h.done;h=u.next()){var w=h.value;try{fo(w)}catch(A){i=i!=null?i:[],A instanceof zt?i=q(q([],N(i)),N(A.errors)):i.push(A)}}}catch(A){o={error:A}}finally{try{h&&!h.done&&(n=u.return)&&n.call(u)}finally{if(o)throw o.error}}}if(i)throw new zt(i)}},e.prototype.add=function(t){var r;if(t&&t!==this)if(this.closed)fo(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=(r=this._finalizers)!==null&&r!==void 0?r:[]).push(t)}},e.prototype._hasParent=function(t){var r=this._parentage;return r===t||Array.isArray(r)&&r.includes(t)},e.prototype._addParent=function(t){var r=this._parentage;this._parentage=Array.isArray(r)?(r.push(t),r):r?[r,t]:t},e.prototype._removeParent=function(t){var r=this._parentage;r===t?this._parentage=null:Array.isArray(r)&&qe(r,t)},e.prototype.remove=function(t){var r=this._finalizers;r&&qe(r,t),t instanceof e&&t._removeParent(this)},e.EMPTY=function(){var t=new e;return t.closed=!0,t}(),e}();var Tr=Fe.EMPTY;function qt(e){return e instanceof Fe||e&&"closed"in e&&k(e.remove)&&k(e.add)&&k(e.unsubscribe)}function fo(e){k(e)?e():e.unsubscribe()}var $e={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1};var ut={setTimeout:function(e,t){for(var r=[],o=2;o0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(r){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,r)},t.prototype._subscribe=function(r){return this._throwIfClosed(),this._checkFinalizedStatuses(r),this._innerSubscribe(r)},t.prototype._innerSubscribe=function(r){var o=this,n=this,i=n.hasError,a=n.isStopped,s=n.observers;return i||a?Tr:(this.currentObservers=null,s.push(r),new Fe(function(){o.currentObservers=null,qe(s,r)}))},t.prototype._checkFinalizedStatuses=function(r){var o=this,n=o.hasError,i=o.thrownError,a=o.isStopped;n?r.error(i):a&&r.complete()},t.prototype.asObservable=function(){var r=new F;return r.source=this,r},t.create=function(r,o){return new Eo(r,o)},t}(F);var Eo=function(e){re(t,e);function t(r,o){var n=e.call(this)||this;return n.destination=r,n.source=o,n}return t.prototype.next=function(r){var o,n;(n=(o=this.destination)===null||o===void 0?void 0:o.next)===null||n===void 0||n.call(o,r)},t.prototype.error=function(r){var o,n;(n=(o=this.destination)===null||o===void 0?void 0:o.error)===null||n===void 0||n.call(o,r)},t.prototype.complete=function(){var r,o;(o=(r=this.destination)===null||r===void 0?void 0:r.complete)===null||o===void 0||o.call(r)},t.prototype._subscribe=function(r){var o,n;return(n=(o=this.source)===null||o===void 0?void 0:o.subscribe(r))!==null&&n!==void 0?n:Tr},t}(g);var _r=function(e){re(t,e);function t(r){var o=e.call(this)||this;return o._value=r,o}return Object.defineProperty(t.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),t.prototype._subscribe=function(r){var o=e.prototype._subscribe.call(this,r);return!o.closed&&r.next(this._value),o},t.prototype.getValue=function(){var r=this,o=r.hasError,n=r.thrownError,i=r._value;if(o)throw n;return this._throwIfClosed(),i},t.prototype.next=function(r){e.prototype.next.call(this,this._value=r)},t}(g);var Lt={now:function(){return(Lt.delegate||Date).now()},delegate:void 0};var _t=function(e){re(t,e);function t(r,o,n){r===void 0&&(r=1/0),o===void 0&&(o=1/0),n===void 0&&(n=Lt);var i=e.call(this)||this;return i._bufferSize=r,i._windowTime=o,i._timestampProvider=n,i._buffer=[],i._infiniteTimeWindow=!0,i._infiniteTimeWindow=o===1/0,i._bufferSize=Math.max(1,r),i._windowTime=Math.max(1,o),i}return t.prototype.next=function(r){var o=this,n=o.isStopped,i=o._buffer,a=o._infiniteTimeWindow,s=o._timestampProvider,p=o._windowTime;n||(i.push(r),!a&&i.push(s.now()+p)),this._trimBuffer(),e.prototype.next.call(this,r)},t.prototype._subscribe=function(r){this._throwIfClosed(),this._trimBuffer();for(var o=this._innerSubscribe(r),n=this,i=n._infiniteTimeWindow,a=n._buffer,s=a.slice(),p=0;p0?e.prototype.schedule.call(this,r,o):(this.delay=o,this.state=r,this.scheduler.flush(this),this)},t.prototype.execute=function(r,o){return o>0||this.closed?e.prototype.execute.call(this,r,o):this._execute(r,o)},t.prototype.requestAsyncId=function(r,o,n){return n===void 0&&(n=0),n!=null&&n>0||n==null&&this.delay>0?e.prototype.requestAsyncId.call(this,r,o,n):(r.flush(this),0)},t}(vt);var So=function(e){re(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(gt);var Hr=new So(To);var Oo=function(e){re(t,e);function t(r,o){var n=e.call(this,r,o)||this;return n.scheduler=r,n.work=o,n}return t.prototype.requestAsyncId=function(r,o,n){return n===void 0&&(n=0),n!==null&&n>0?e.prototype.requestAsyncId.call(this,r,o,n):(r.actions.push(this),r._scheduled||(r._scheduled=bt.requestAnimationFrame(function(){return r.flush(void 0)})))},t.prototype.recycleAsyncId=function(r,o,n){var i;if(n===void 0&&(n=0),n!=null?n>0:this.delay>0)return e.prototype.recycleAsyncId.call(this,r,o,n);var a=r.actions;o!=null&&((i=a[a.length-1])===null||i===void 0?void 0:i.id)!==o&&(bt.cancelAnimationFrame(o),r._scheduled=void 0)},t}(vt);var Mo=function(e){re(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.flush=function(r){this._active=!0;var o=this._scheduled;this._scheduled=void 0;var n=this.actions,i;r=r||n.shift();do if(i=r.execute(r.state,r.delay))break;while((r=n[0])&&r.id===o&&n.shift());if(this._active=!1,i){for(;(r=n[0])&&r.id===o&&n.shift();)r.unsubscribe();throw i}},t}(gt);var me=new Mo(Oo);var O=new F(function(e){return e.complete()});function Yt(e){return e&&k(e.schedule)}function kr(e){return e[e.length-1]}function Xe(e){return k(kr(e))?e.pop():void 0}function He(e){return Yt(kr(e))?e.pop():void 0}function Bt(e,t){return typeof kr(e)=="number"?e.pop():t}var xt=function(e){return e&&typeof e.length=="number"&&typeof e!="function"};function Gt(e){return k(e==null?void 0:e.then)}function Jt(e){return k(e[ht])}function Xt(e){return Symbol.asyncIterator&&k(e==null?void 0:e[Symbol.asyncIterator])}function Zt(e){return new TypeError("You provided "+(e!==null&&typeof e=="object"?"an invalid object":"'"+e+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}function Gi(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var er=Gi();function tr(e){return k(e==null?void 0:e[er])}function rr(e){return lo(this,arguments,function(){var r,o,n,i;return Nt(this,function(a){switch(a.label){case 0:r=e.getReader(),a.label=1;case 1:a.trys.push([1,,9,10]),a.label=2;case 2:return[4,nt(r.read())];case 3:return o=a.sent(),n=o.value,i=o.done,i?[4,nt(void 0)]:[3,5];case 4:return[2,a.sent()];case 5:return[4,nt(n)];case 6:return[4,a.sent()];case 7:return a.sent(),[3,2];case 8:return[3,10];case 9:return r.releaseLock(),[7];case 10:return[2]}})})}function or(e){return k(e==null?void 0:e.getReader)}function W(e){if(e instanceof F)return e;if(e!=null){if(Jt(e))return Ji(e);if(xt(e))return Xi(e);if(Gt(e))return Zi(e);if(Xt(e))return Lo(e);if(tr(e))return ea(e);if(or(e))return ta(e)}throw Zt(e)}function Ji(e){return new F(function(t){var r=e[ht]();if(k(r.subscribe))return r.subscribe(t);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function Xi(e){return new F(function(t){for(var r=0;r=2;return function(o){return o.pipe(e?b(function(n,i){return e(n,i,o)}):le,Te(1),r?Be(t):zo(function(){return new ir}))}}function Fr(e){return e<=0?function(){return O}:y(function(t,r){var o=[];t.subscribe(T(r,function(n){o.push(n),e=2,!0))}function pe(e){e===void 0&&(e={});var t=e.connector,r=t===void 0?function(){return new g}:t,o=e.resetOnError,n=o===void 0?!0:o,i=e.resetOnComplete,a=i===void 0?!0:i,s=e.resetOnRefCountZero,p=s===void 0?!0:s;return function(c){var l,f,u,h=0,w=!1,A=!1,te=function(){f==null||f.unsubscribe(),f=void 0},ie=function(){te(),l=u=void 0,w=A=!1},J=function(){var H=l;ie(),H==null||H.unsubscribe()};return y(function(H,mt){h++,!A&&!w&&te();var ze=u=u!=null?u:r();mt.add(function(){h--,h===0&&!A&&!w&&(f=Wr(J,p))}),ze.subscribe(mt),!l&&h>0&&(l=new at({next:function(Ie){return ze.next(Ie)},error:function(Ie){A=!0,te(),f=Wr(ie,n,Ie),ze.error(Ie)},complete:function(){w=!0,te(),f=Wr(ie,a),ze.complete()}}),W(H).subscribe(l))})(c)}}function Wr(e,t){for(var r=[],o=2;oe.next(document)),e}function $(e,t=document){return Array.from(t.querySelectorAll(e))}function P(e,t=document){let r=fe(e,t);if(typeof r=="undefined")throw new ReferenceError(`Missing element: expected "${e}" to be present`);return r}function fe(e,t=document){return t.querySelector(e)||void 0}function Re(){var e,t,r,o;return(o=(r=(t=(e=document.activeElement)==null?void 0:e.shadowRoot)==null?void 0:t.activeElement)!=null?r:document.activeElement)!=null?o:void 0}var xa=S(d(document.body,"focusin"),d(document.body,"focusout")).pipe(_e(1),Q(void 0),m(()=>Re()||document.body),G(1));function et(e){return xa.pipe(m(t=>e.contains(t)),K())}function kt(e,t){return C(()=>S(d(e,"mouseenter").pipe(m(()=>!0)),d(e,"mouseleave").pipe(m(()=>!1))).pipe(t?Ht(r=>Me(+!r*t)):le,Q(e.matches(":hover"))))}function Bo(e,t){if(typeof t=="string"||typeof t=="number")e.innerHTML+=t.toString();else if(t instanceof Node)e.appendChild(t);else if(Array.isArray(t))for(let r of t)Bo(e,r)}function x(e,t,...r){let o=document.createElement(e);if(t)for(let n of Object.keys(t))typeof t[n]!="undefined"&&(typeof t[n]!="boolean"?o.setAttribute(n,t[n]):o.setAttribute(n,""));for(let n of r)Bo(o,n);return o}function sr(e){if(e>999){let t=+((e-950)%1e3>99);return`${((e+1e-6)/1e3).toFixed(t)}k`}else return e.toString()}function wt(e){let t=x("script",{src:e});return C(()=>(document.head.appendChild(t),S(d(t,"load"),d(t,"error").pipe(v(()=>$r(()=>new ReferenceError(`Invalid script: ${e}`))))).pipe(m(()=>{}),L(()=>document.head.removeChild(t)),Te(1))))}var Go=new g,ya=C(()=>typeof ResizeObserver=="undefined"?wt("https://unpkg.com/resize-observer-polyfill"):I(void 0)).pipe(m(()=>new ResizeObserver(e=>e.forEach(t=>Go.next(t)))),v(e=>S(Ke,I(e)).pipe(L(()=>e.disconnect()))),G(1));function ce(e){return{width:e.offsetWidth,height:e.offsetHeight}}function ge(e){let t=e;for(;t.clientWidth===0&&t.parentElement;)t=t.parentElement;return ya.pipe(E(r=>r.observe(t)),v(r=>Go.pipe(b(o=>o.target===t),L(()=>r.unobserve(t)))),m(()=>ce(e)),Q(ce(e)))}function Tt(e){return{width:e.scrollWidth,height:e.scrollHeight}}function cr(e){let t=e.parentElement;for(;t&&(e.scrollWidth<=t.scrollWidth&&e.scrollHeight<=t.scrollHeight);)t=(e=t).parentElement;return t?e:void 0}function Jo(e){let t=[],r=e.parentElement;for(;r;)(e.clientWidth>r.clientWidth||e.clientHeight>r.clientHeight)&&t.push(r),r=(e=r).parentElement;return t.length===0&&t.push(document.documentElement),t}function Ue(e){return{x:e.offsetLeft,y:e.offsetTop}}function Xo(e){let t=e.getBoundingClientRect();return{x:t.x+window.scrollX,y:t.y+window.scrollY}}function Zo(e){return S(d(window,"load"),d(window,"resize")).pipe(Le(0,me),m(()=>Ue(e)),Q(Ue(e)))}function pr(e){return{x:e.scrollLeft,y:e.scrollTop}}function De(e){return S(d(e,"scroll"),d(window,"scroll"),d(window,"resize")).pipe(Le(0,me),m(()=>pr(e)),Q(pr(e)))}var en=new g,Ea=C(()=>I(new IntersectionObserver(e=>{for(let t of e)en.next(t)},{threshold:0}))).pipe(v(e=>S(Ke,I(e)).pipe(L(()=>e.disconnect()))),G(1));function tt(e){return Ea.pipe(E(t=>t.observe(e)),v(t=>en.pipe(b(({target:r})=>r===e),L(()=>t.unobserve(e)),m(({isIntersecting:r})=>r))))}function tn(e,t=16){return De(e).pipe(m(({y:r})=>{let o=ce(e),n=Tt(e);return r>=n.height-o.height-t}),K())}var lr={drawer:P("[data-md-toggle=drawer]"),search:P("[data-md-toggle=search]")};function rn(e){return lr[e].checked}function Je(e,t){lr[e].checked!==t&&lr[e].click()}function Ve(e){let t=lr[e];return d(t,"change").pipe(m(()=>t.checked),Q(t.checked))}function wa(e,t){switch(e.constructor){case HTMLInputElement:return e.type==="radio"?/^Arrow/.test(t):!0;case HTMLSelectElement:case HTMLTextAreaElement:return!0;default:return e.isContentEditable}}function Ta(){return S(d(window,"compositionstart").pipe(m(()=>!0)),d(window,"compositionend").pipe(m(()=>!1))).pipe(Q(!1))}function on(){let e=d(window,"keydown").pipe(b(t=>!(t.metaKey||t.ctrlKey)),m(t=>({mode:rn("search")?"search":"global",type:t.key,claim(){t.preventDefault(),t.stopPropagation()}})),b(({mode:t,type:r})=>{if(t==="global"){let o=Re();if(typeof o!="undefined")return!wa(o,r)}return!0}),pe());return Ta().pipe(v(t=>t?O:e))}function xe(){return new URL(location.href)}function pt(e,t=!1){if(B("navigation.instant")&&!t){let r=x("a",{href:e.href});document.body.appendChild(r),r.click(),r.remove()}else location.href=e.href}function nn(){return new g}function an(){return location.hash.slice(1)}function sn(e){let t=x("a",{href:e});t.addEventListener("click",r=>r.stopPropagation()),t.click()}function Sa(e){return S(d(window,"hashchange"),e).pipe(m(an),Q(an()),b(t=>t.length>0),G(1))}function cn(e){return Sa(e).pipe(m(t=>fe(`[id="${t}"]`)),b(t=>typeof t!="undefined"))}function $t(e){let t=matchMedia(e);return ar(r=>t.addListener(()=>r(t.matches))).pipe(Q(t.matches))}function pn(){let e=matchMedia("print");return S(d(window,"beforeprint").pipe(m(()=>!0)),d(window,"afterprint").pipe(m(()=>!1))).pipe(Q(e.matches))}function Nr(e,t){return e.pipe(v(r=>r?t():O))}function zr(e,t){return new F(r=>{let o=new XMLHttpRequest;return o.open("GET",`${e}`),o.responseType="blob",o.addEventListener("load",()=>{o.status>=200&&o.status<300?(r.next(o.response),r.complete()):r.error(new Error(o.statusText))}),o.addEventListener("error",()=>{r.error(new Error("Network error"))}),o.addEventListener("abort",()=>{r.complete()}),typeof(t==null?void 0:t.progress$)!="undefined"&&(o.addEventListener("progress",n=>{var i;if(n.lengthComputable)t.progress$.next(n.loaded/n.total*100);else{let a=(i=o.getResponseHeader("Content-Length"))!=null?i:0;t.progress$.next(n.loaded/+a*100)}}),t.progress$.next(5)),o.send(),()=>o.abort()})}function Ne(e,t){return zr(e,t).pipe(v(r=>r.text()),m(r=>JSON.parse(r)),G(1))}function ln(e,t){let r=new DOMParser;return zr(e,t).pipe(v(o=>o.text()),m(o=>r.parseFromString(o,"text/html")),G(1))}function mn(e,t){let r=new DOMParser;return zr(e,t).pipe(v(o=>o.text()),m(o=>r.parseFromString(o,"text/xml")),G(1))}function fn(){return{x:Math.max(0,scrollX),y:Math.max(0,scrollY)}}function un(){return S(d(window,"scroll",{passive:!0}),d(window,"resize",{passive:!0})).pipe(m(fn),Q(fn()))}function dn(){return{width:innerWidth,height:innerHeight}}function hn(){return d(window,"resize",{passive:!0}).pipe(m(dn),Q(dn()))}function bn(){return z([un(),hn()]).pipe(m(([e,t])=>({offset:e,size:t})),G(1))}function mr(e,{viewport$:t,header$:r}){let o=t.pipe(Z("size")),n=z([o,r]).pipe(m(()=>Ue(e)));return z([r,t,n]).pipe(m(([{height:i},{offset:a,size:s},{x:p,y:c}])=>({offset:{x:a.x-p,y:a.y-c+i},size:s})))}function Oa(e){return d(e,"message",t=>t.data)}function Ma(e){let t=new g;return t.subscribe(r=>e.postMessage(r)),t}function vn(e,t=new Worker(e)){let r=Oa(t),o=Ma(t),n=new g;n.subscribe(o);let i=o.pipe(X(),ne(!0));return n.pipe(X(),Pe(r.pipe(U(i))),pe())}var La=P("#__config"),St=JSON.parse(La.textContent);St.base=`${new URL(St.base,xe())}`;function ye(){return St}function B(e){return St.features.includes(e)}function Ee(e,t){return typeof t!="undefined"?St.translations[e].replace("#",t.toString()):St.translations[e]}function Se(e,t=document){return P(`[data-md-component=${e}]`,t)}function ae(e,t=document){return $(`[data-md-component=${e}]`,t)}function _a(e){let t=P(".md-typeset > :first-child",e);return d(t,"click",{once:!0}).pipe(m(()=>P(".md-typeset",e)),m(r=>({hash:__md_hash(r.innerHTML)})))}function gn(e){if(!B("announce.dismiss")||!e.childElementCount)return O;if(!e.hidden){let t=P(".md-typeset",e);__md_hash(t.innerHTML)===__md_get("__announce")&&(e.hidden=!0)}return C(()=>{let t=new g;return t.subscribe(({hash:r})=>{e.hidden=!0,__md_set("__announce",r)}),_a(e).pipe(E(r=>t.next(r)),L(()=>t.complete()),m(r=>R({ref:e},r)))})}function Aa(e,{target$:t}){return t.pipe(m(r=>({hidden:r!==e})))}function xn(e,t){let r=new g;return r.subscribe(({hidden:o})=>{e.hidden=o}),Aa(e,t).pipe(E(o=>r.next(o)),L(()=>r.complete()),m(o=>R({ref:e},o)))}function Pt(e,t){return t==="inline"?x("div",{class:"md-tooltip md-tooltip--inline",id:e,role:"tooltip"},x("div",{class:"md-tooltip__inner md-typeset"})):x("div",{class:"md-tooltip",id:e,role:"tooltip"},x("div",{class:"md-tooltip__inner md-typeset"}))}function yn(...e){return x("div",{class:"md-tooltip2",role:"tooltip"},x("div",{class:"md-tooltip2__inner md-typeset"},e))}function En(e,t){if(t=t?`${t}_annotation_${e}`:void 0,t){let r=t?`#${t}`:void 0;return x("aside",{class:"md-annotation",tabIndex:0},Pt(t),x("a",{href:r,class:"md-annotation__index",tabIndex:-1},x("span",{"data-md-annotation-id":e})))}else return x("aside",{class:"md-annotation",tabIndex:0},Pt(t),x("span",{class:"md-annotation__index",tabIndex:-1},x("span",{"data-md-annotation-id":e})))}function wn(e){return x("button",{class:"md-clipboard md-icon",title:Ee("clipboard.copy"),"data-clipboard-target":`#${e} > code`})}function qr(e,t){let r=t&2,o=t&1,n=Object.keys(e.terms).filter(p=>!e.terms[p]).reduce((p,c)=>[...p,x("del",null,c)," "],[]).slice(0,-1),i=ye(),a=new URL(e.location,i.base);B("search.highlight")&&a.searchParams.set("h",Object.entries(e.terms).filter(([,p])=>p).reduce((p,[c])=>`${p} ${c}`.trim(),""));let{tags:s}=ye();return x("a",{href:`${a}`,class:"md-search-result__link",tabIndex:-1},x("article",{class:"md-search-result__article md-typeset","data-md-score":e.score.toFixed(2)},r>0&&x("div",{class:"md-search-result__icon md-icon"}),r>0&&x("h1",null,e.title),r<=0&&x("h2",null,e.title),o>0&&e.text.length>0&&e.text,e.tags&&e.tags.map(p=>{let c=s?p in s?`md-tag-icon md-tag--${s[p]}`:"md-tag-icon":"";return x("span",{class:`md-tag ${c}`},p)}),o>0&&n.length>0&&x("p",{class:"md-search-result__terms"},Ee("search.result.term.missing"),": ",...n)))}function Tn(e){let t=e[0].score,r=[...e],o=ye(),n=r.findIndex(l=>!`${new URL(l.location,o.base)}`.includes("#")),[i]=r.splice(n,1),a=r.findIndex(l=>l.scoreqr(l,1)),...p.length?[x("details",{class:"md-search-result__more"},x("summary",{tabIndex:-1},x("div",null,p.length>0&&p.length===1?Ee("search.result.more.one"):Ee("search.result.more.other",p.length))),...p.map(l=>qr(l,1)))]:[]];return x("li",{class:"md-search-result__item"},c)}function Sn(e){return x("ul",{class:"md-source__facts"},Object.entries(e).map(([t,r])=>x("li",{class:`md-source__fact md-source__fact--${t}`},typeof r=="number"?sr(r):r)))}function Qr(e){let t=`tabbed-control tabbed-control--${e}`;return x("div",{class:t,hidden:!0},x("button",{class:"tabbed-button",tabIndex:-1,"aria-hidden":"true"}))}function On(e){return x("div",{class:"md-typeset__scrollwrap"},x("div",{class:"md-typeset__table"},e))}function Ca(e){var o;let t=ye(),r=new URL(`../${e.version}/`,t.base);return x("li",{class:"md-version__item"},x("a",{href:`${r}`,class:"md-version__link"},e.title,((o=t.version)==null?void 0:o.alias)&&e.aliases.length>0&&x("span",{class:"md-version__alias"},e.aliases[0])))}function Mn(e,t){var o;let r=ye();return e=e.filter(n=>{var i;return!((i=n.properties)!=null&&i.hidden)}),x("div",{class:"md-version"},x("button",{class:"md-version__current","aria-label":Ee("select.version")},t.title,((o=r.version)==null?void 0:o.alias)&&t.aliases.length>0&&x("span",{class:"md-version__alias"},t.aliases[0])),x("ul",{class:"md-version__list"},e.map(Ca)))}var Ha=0;function ka(e){let t=z([et(e),kt(e)]).pipe(m(([o,n])=>o||n),K()),r=C(()=>Jo(e)).pipe(oe(De),ct(1),m(()=>Xo(e)));return t.pipe(Ae(o=>o),v(()=>z([t,r])),m(([o,n])=>({active:o,offset:n})),pe())}function $a(e,t){let{content$:r,viewport$:o}=t,n=`__tooltip2_${Ha++}`;return C(()=>{let i=new g,a=new _r(!1);i.pipe(X(),ne(!1)).subscribe(a);let s=a.pipe(Ht(c=>Me(+!c*250,Hr)),K(),v(c=>c?r:O),E(c=>c.id=n),pe());z([i.pipe(m(({active:c})=>c)),s.pipe(v(c=>kt(c,250)),Q(!1))]).pipe(m(c=>c.some(l=>l))).subscribe(a);let p=a.pipe(b(c=>c),ee(s,o),m(([c,l,{size:f}])=>{let u=e.getBoundingClientRect(),h=u.width/2;if(l.role==="tooltip")return{x:h,y:8+u.height};if(u.y>=f.height/2){let{height:w}=ce(l);return{x:h,y:-16-w}}else return{x:h,y:16+u.height}}));return z([s,i,p]).subscribe(([c,{offset:l},f])=>{c.style.setProperty("--md-tooltip-host-x",`${l.x}px`),c.style.setProperty("--md-tooltip-host-y",`${l.y}px`),c.style.setProperty("--md-tooltip-x",`${f.x}px`),c.style.setProperty("--md-tooltip-y",`${f.y}px`),c.classList.toggle("md-tooltip2--top",f.y<0),c.classList.toggle("md-tooltip2--bottom",f.y>=0)}),a.pipe(b(c=>c),ee(s,(c,l)=>l),b(c=>c.role==="tooltip")).subscribe(c=>{let l=ce(P(":scope > *",c));c.style.setProperty("--md-tooltip-width",`${l.width}px`),c.style.setProperty("--md-tooltip-tail","0px")}),a.pipe(K(),be(me),ee(s)).subscribe(([c,l])=>{l.classList.toggle("md-tooltip2--active",c)}),z([a.pipe(b(c=>c)),s]).subscribe(([c,l])=>{l.role==="dialog"?(e.setAttribute("aria-controls",n),e.setAttribute("aria-haspopup","dialog")):e.setAttribute("aria-describedby",n)}),a.pipe(b(c=>!c)).subscribe(()=>{e.removeAttribute("aria-controls"),e.removeAttribute("aria-describedby"),e.removeAttribute("aria-haspopup")}),ka(e).pipe(E(c=>i.next(c)),L(()=>i.complete()),m(c=>R({ref:e},c)))})}function lt(e,{viewport$:t},r=document.body){return $a(e,{content$:new F(o=>{let n=e.title,i=yn(n);return o.next(i),e.removeAttribute("title"),r.append(i),()=>{i.remove(),e.setAttribute("title",n)}}),viewport$:t})}function Pa(e,t){let r=C(()=>z([Zo(e),De(t)])).pipe(m(([{x:o,y:n},i])=>{let{width:a,height:s}=ce(e);return{x:o-i.x+a/2,y:n-i.y+s/2}}));return et(e).pipe(v(o=>r.pipe(m(n=>({active:o,offset:n})),Te(+!o||1/0))))}function Ln(e,t,{target$:r}){let[o,n]=Array.from(e.children);return C(()=>{let i=new g,a=i.pipe(X(),ne(!0));return i.subscribe({next({offset:s}){e.style.setProperty("--md-tooltip-x",`${s.x}px`),e.style.setProperty("--md-tooltip-y",`${s.y}px`)},complete(){e.style.removeProperty("--md-tooltip-x"),e.style.removeProperty("--md-tooltip-y")}}),tt(e).pipe(U(a)).subscribe(s=>{e.toggleAttribute("data-md-visible",s)}),S(i.pipe(b(({active:s})=>s)),i.pipe(_e(250),b(({active:s})=>!s))).subscribe({next({active:s}){s?e.prepend(o):o.remove()},complete(){e.prepend(o)}}),i.pipe(Le(16,me)).subscribe(({active:s})=>{o.classList.toggle("md-tooltip--active",s)}),i.pipe(ct(125,me),b(()=>!!e.offsetParent),m(()=>e.offsetParent.getBoundingClientRect()),m(({x:s})=>s)).subscribe({next(s){s?e.style.setProperty("--md-tooltip-0",`${-s}px`):e.style.removeProperty("--md-tooltip-0")},complete(){e.style.removeProperty("--md-tooltip-0")}}),d(n,"click").pipe(U(a),b(s=>!(s.metaKey||s.ctrlKey))).subscribe(s=>{s.stopPropagation(),s.preventDefault()}),d(n,"mousedown").pipe(U(a),ee(i)).subscribe(([s,{active:p}])=>{var c;if(s.button!==0||s.metaKey||s.ctrlKey)s.preventDefault();else if(p){s.preventDefault();let l=e.parentElement.closest(".md-annotation");l instanceof HTMLElement?l.focus():(c=Re())==null||c.blur()}}),r.pipe(U(a),b(s=>s===o),Ge(125)).subscribe(()=>e.focus()),Pa(e,t).pipe(E(s=>i.next(s)),L(()=>i.complete()),m(s=>R({ref:e},s)))})}function Ra(e){return e.tagName==="CODE"?$(".c, .c1, .cm",e):[e]}function Ia(e){let t=[];for(let r of Ra(e)){let o=[],n=document.createNodeIterator(r,NodeFilter.SHOW_TEXT);for(let i=n.nextNode();i;i=n.nextNode())o.push(i);for(let i of o){let a;for(;a=/(\(\d+\))(!)?/.exec(i.textContent);){let[,s,p]=a;if(typeof p=="undefined"){let c=i.splitText(a.index);i=c.splitText(s.length),t.push(c)}else{i.textContent=s,t.push(i);break}}}}return t}function _n(e,t){t.append(...Array.from(e.childNodes))}function fr(e,t,{target$:r,print$:o}){let n=t.closest("[id]"),i=n==null?void 0:n.id,a=new Map;for(let s of Ia(t)){let[,p]=s.textContent.match(/\((\d+)\)/);fe(`:scope > li:nth-child(${p})`,e)&&(a.set(p,En(p,i)),s.replaceWith(a.get(p)))}return a.size===0?O:C(()=>{let s=new g,p=s.pipe(X(),ne(!0)),c=[];for(let[l,f]of a)c.push([P(".md-typeset",f),P(`:scope > li:nth-child(${l})`,e)]);return o.pipe(U(p)).subscribe(l=>{e.hidden=!l,e.classList.toggle("md-annotation-list",l);for(let[f,u]of c)l?_n(f,u):_n(u,f)}),S(...[...a].map(([,l])=>Ln(l,t,{target$:r}))).pipe(L(()=>s.complete()),pe())})}function An(e){if(e.nextElementSibling){let t=e.nextElementSibling;if(t.tagName==="OL")return t;if(t.tagName==="P"&&!t.children.length)return An(t)}}function Cn(e,t){return C(()=>{let r=An(e);return typeof r!="undefined"?fr(r,e,t):O})}var Hn=Vt(Yr());var Fa=0;function kn(e){if(e.nextElementSibling){let t=e.nextElementSibling;if(t.tagName==="OL")return t;if(t.tagName==="P"&&!t.children.length)return kn(t)}}function ja(e){return ge(e).pipe(m(({width:t})=>({scrollable:Tt(e).width>t})),Z("scrollable"))}function $n(e,t){let{matches:r}=matchMedia("(hover)"),o=C(()=>{let n=new g,i=n.pipe(Fr(1));n.subscribe(({scrollable:c})=>{c&&r?e.setAttribute("tabindex","0"):e.removeAttribute("tabindex")});let a=[];if(Hn.default.isSupported()&&(e.closest(".copy")||B("content.code.copy")&&!e.closest(".no-copy"))){let c=e.closest("pre");c.id=`__code_${Fa++}`;let l=wn(c.id);c.insertBefore(l,e),B("content.tooltips")&&a.push(lt(l,{viewport$}))}let s=e.closest(".highlight");if(s instanceof HTMLElement){let c=kn(s);if(typeof c!="undefined"&&(s.classList.contains("annotate")||B("content.code.annotate"))){let l=fr(c,e,t);a.push(ge(s).pipe(U(i),m(({width:f,height:u})=>f&&u),K(),v(f=>f?l:O)))}}return $(":scope > span[id]",e).length&&e.classList.add("md-code__content"),ja(e).pipe(E(c=>n.next(c)),L(()=>n.complete()),m(c=>R({ref:e},c)),Pe(...a))});return B("content.lazy")?tt(e).pipe(b(n=>n),Te(1),v(()=>o)):o}function Wa(e,{target$:t,print$:r}){let o=!0;return S(t.pipe(m(n=>n.closest("details:not([open])")),b(n=>e===n),m(()=>({action:"open",reveal:!0}))),r.pipe(b(n=>n||!o),E(()=>o=e.open),m(n=>({action:n?"open":"close"}))))}function Pn(e,t){return C(()=>{let r=new g;return r.subscribe(({action:o,reveal:n})=>{e.toggleAttribute("open",o==="open"),n&&e.scrollIntoView()}),Wa(e,t).pipe(E(o=>r.next(o)),L(()=>r.complete()),m(o=>R({ref:e},o)))})}var Rn=".node circle,.node ellipse,.node path,.node polygon,.node rect{fill:var(--md-mermaid-node-bg-color);stroke:var(--md-mermaid-node-fg-color)}marker{fill:var(--md-mermaid-edge-color)!important}.edgeLabel .label rect{fill:#0000}.label{color:var(--md-mermaid-label-fg-color);font-family:var(--md-mermaid-font-family)}.label foreignObject{line-height:normal;overflow:visible}.label div .edgeLabel{color:var(--md-mermaid-label-fg-color)}.edgeLabel,.edgeLabel rect,.label div .edgeLabel{background-color:var(--md-mermaid-label-bg-color)}.edgeLabel,.edgeLabel rect{fill:var(--md-mermaid-label-bg-color);color:var(--md-mermaid-edge-color)}.edgePath .path,.flowchart-link{stroke:var(--md-mermaid-edge-color);stroke-width:.05rem}.edgePath .arrowheadPath{fill:var(--md-mermaid-edge-color);stroke:none}.cluster rect{fill:var(--md-default-fg-color--lightest);stroke:var(--md-default-fg-color--lighter)}.cluster span{color:var(--md-mermaid-label-fg-color);font-family:var(--md-mermaid-font-family)}g #flowchart-circleEnd,g #flowchart-circleStart,g #flowchart-crossEnd,g #flowchart-crossStart,g #flowchart-pointEnd,g #flowchart-pointStart{stroke:none}g.classGroup line,g.classGroup rect{fill:var(--md-mermaid-node-bg-color);stroke:var(--md-mermaid-node-fg-color)}g.classGroup text{fill:var(--md-mermaid-label-fg-color);font-family:var(--md-mermaid-font-family)}.classLabel .box{fill:var(--md-mermaid-label-bg-color);background-color:var(--md-mermaid-label-bg-color);opacity:1}.classLabel .label{fill:var(--md-mermaid-label-fg-color);font-family:var(--md-mermaid-font-family)}.node .divider{stroke:var(--md-mermaid-node-fg-color)}.relation{stroke:var(--md-mermaid-edge-color)}.cardinality{fill:var(--md-mermaid-label-fg-color);font-family:var(--md-mermaid-font-family)}.cardinality text{fill:inherit!important}defs #classDiagram-compositionEnd,defs #classDiagram-compositionStart,defs #classDiagram-dependencyEnd,defs #classDiagram-dependencyStart,defs #classDiagram-extensionEnd,defs #classDiagram-extensionStart{fill:var(--md-mermaid-edge-color)!important;stroke:var(--md-mermaid-edge-color)!important}defs #classDiagram-aggregationEnd,defs #classDiagram-aggregationStart{fill:var(--md-mermaid-label-bg-color)!important;stroke:var(--md-mermaid-edge-color)!important}g.stateGroup rect{fill:var(--md-mermaid-node-bg-color);stroke:var(--md-mermaid-node-fg-color)}g.stateGroup .state-title{fill:var(--md-mermaid-label-fg-color)!important;font-family:var(--md-mermaid-font-family)}g.stateGroup .composit{fill:var(--md-mermaid-label-bg-color)}.nodeLabel,.nodeLabel p{color:var(--md-mermaid-label-fg-color);font-family:var(--md-mermaid-font-family)}a .nodeLabel{text-decoration:underline}.node circle.state-end,.node circle.state-start,.start-state{fill:var(--md-mermaid-edge-color);stroke:none}.end-state-inner,.end-state-outer{fill:var(--md-mermaid-edge-color)}.end-state-inner,.node circle.state-end{stroke:var(--md-mermaid-label-bg-color)}.transition{stroke:var(--md-mermaid-edge-color)}[id^=state-fork] rect,[id^=state-join] rect{fill:var(--md-mermaid-edge-color)!important;stroke:none!important}.statediagram-cluster.statediagram-cluster .inner{fill:var(--md-default-bg-color)}.statediagram-cluster rect{fill:var(--md-mermaid-node-bg-color);stroke:var(--md-mermaid-node-fg-color)}.statediagram-state rect.divider{fill:var(--md-default-fg-color--lightest);stroke:var(--md-default-fg-color--lighter)}defs #statediagram-barbEnd{stroke:var(--md-mermaid-edge-color)}.attributeBoxEven,.attributeBoxOdd{fill:var(--md-mermaid-node-bg-color);stroke:var(--md-mermaid-node-fg-color)}.entityBox{fill:var(--md-mermaid-label-bg-color);stroke:var(--md-mermaid-node-fg-color)}.entityLabel{fill:var(--md-mermaid-label-fg-color);font-family:var(--md-mermaid-font-family)}.relationshipLabelBox{fill:var(--md-mermaid-label-bg-color);fill-opacity:1;background-color:var(--md-mermaid-label-bg-color);opacity:1}.relationshipLabel{fill:var(--md-mermaid-label-fg-color)}.relationshipLine{stroke:var(--md-mermaid-edge-color)}defs #ONE_OR_MORE_END *,defs #ONE_OR_MORE_START *,defs #ONLY_ONE_END *,defs #ONLY_ONE_START *,defs #ZERO_OR_MORE_END *,defs #ZERO_OR_MORE_START *,defs #ZERO_OR_ONE_END *,defs #ZERO_OR_ONE_START *{stroke:var(--md-mermaid-edge-color)!important}defs #ZERO_OR_MORE_END circle,defs #ZERO_OR_MORE_START circle{fill:var(--md-mermaid-label-bg-color)}.actor{fill:var(--md-mermaid-sequence-actor-bg-color);stroke:var(--md-mermaid-sequence-actor-border-color)}text.actor>tspan{fill:var(--md-mermaid-sequence-actor-fg-color);font-family:var(--md-mermaid-font-family)}line{stroke:var(--md-mermaid-sequence-actor-line-color)}.actor-man circle,.actor-man line{fill:var(--md-mermaid-sequence-actorman-bg-color);stroke:var(--md-mermaid-sequence-actorman-line-color)}.messageLine0,.messageLine1{stroke:var(--md-mermaid-sequence-message-line-color)}.note{fill:var(--md-mermaid-sequence-note-bg-color);stroke:var(--md-mermaid-sequence-note-border-color)}.loopText,.loopText>tspan,.messageText,.noteText>tspan{stroke:none;font-family:var(--md-mermaid-font-family)!important}.messageText{fill:var(--md-mermaid-sequence-message-fg-color)}.loopText,.loopText>tspan{fill:var(--md-mermaid-sequence-loop-fg-color)}.noteText>tspan{fill:var(--md-mermaid-sequence-note-fg-color)}#arrowhead path{fill:var(--md-mermaid-sequence-message-line-color);stroke:none}.loopLine{fill:var(--md-mermaid-sequence-loop-bg-color);stroke:var(--md-mermaid-sequence-loop-border-color)}.labelBox{fill:var(--md-mermaid-sequence-label-bg-color);stroke:none}.labelText,.labelText>span{fill:var(--md-mermaid-sequence-label-fg-color);font-family:var(--md-mermaid-font-family)}.sequenceNumber{fill:var(--md-mermaid-sequence-number-fg-color)}rect.rect{fill:var(--md-mermaid-sequence-box-bg-color);stroke:none}rect.rect+text.text{fill:var(--md-mermaid-sequence-box-fg-color)}defs #sequencenumber{fill:var(--md-mermaid-sequence-number-bg-color)!important}";var Br,Da=0;function Va(){return typeof mermaid=="undefined"||mermaid instanceof Element?wt("https://unpkg.com/mermaid@10/dist/mermaid.min.js"):I(void 0)}function In(e){return e.classList.remove("mermaid"),Br||(Br=Va().pipe(E(()=>mermaid.initialize({startOnLoad:!1,themeCSS:Rn,sequence:{actorFontSize:"16px",messageFontSize:"16px",noteFontSize:"16px"}})),m(()=>{}),G(1))),Br.subscribe(()=>ao(this,null,function*(){e.classList.add("mermaid");let t=`__mermaid_${Da++}`,r=x("div",{class:"mermaid"}),o=e.textContent,{svg:n,fn:i}=yield mermaid.render(t,o),a=r.attachShadow({mode:"closed"});a.innerHTML=n,e.replaceWith(r),i==null||i(a)})),Br.pipe(m(()=>({ref:e})))}var Fn=x("table");function jn(e){return e.replaceWith(Fn),Fn.replaceWith(On(e)),I({ref:e})}function Na(e){let t=e.find(r=>r.checked)||e[0];return S(...e.map(r=>d(r,"change").pipe(m(()=>P(`label[for="${r.id}"]`))))).pipe(Q(P(`label[for="${t.id}"]`)),m(r=>({active:r})))}function Wn(e,{viewport$:t,target$:r}){let o=P(".tabbed-labels",e),n=$(":scope > input",e),i=Qr("prev");e.append(i);let a=Qr("next");return e.append(a),C(()=>{let s=new g,p=s.pipe(X(),ne(!0));z([s,ge(e),tt(e)]).pipe(U(p),Le(1,me)).subscribe({next([{active:c},l]){let f=Ue(c),{width:u}=ce(c);e.style.setProperty("--md-indicator-x",`${f.x}px`),e.style.setProperty("--md-indicator-width",`${u}px`);let h=pr(o);(f.xh.x+l.width)&&o.scrollTo({left:Math.max(0,f.x-16),behavior:"smooth"})},complete(){e.style.removeProperty("--md-indicator-x"),e.style.removeProperty("--md-indicator-width")}}),z([De(o),ge(o)]).pipe(U(p)).subscribe(([c,l])=>{let f=Tt(o);i.hidden=c.x<16,a.hidden=c.x>f.width-l.width-16}),S(d(i,"click").pipe(m(()=>-1)),d(a,"click").pipe(m(()=>1))).pipe(U(p)).subscribe(c=>{let{width:l}=ce(o);o.scrollBy({left:l*c,behavior:"smooth"})}),r.pipe(U(p),b(c=>n.includes(c))).subscribe(c=>c.click()),o.classList.add("tabbed-labels--linked");for(let c of n){let l=P(`label[for="${c.id}"]`);l.replaceChildren(x("a",{href:`#${l.htmlFor}`,tabIndex:-1},...Array.from(l.childNodes))),d(l.firstElementChild,"click").pipe(U(p),b(f=>!(f.metaKey||f.ctrlKey)),E(f=>{f.preventDefault(),f.stopPropagation()})).subscribe(()=>{history.replaceState({},"",`#${l.htmlFor}`),l.click()})}return B("content.tabs.link")&&s.pipe(Ce(1),ee(t)).subscribe(([{active:c},{offset:l}])=>{let f=c.innerText.trim();if(c.hasAttribute("data-md-switching"))c.removeAttribute("data-md-switching");else{let u=e.offsetTop-l.y;for(let w of $("[data-tabs]"))for(let A of $(":scope > input",w)){let te=P(`label[for="${A.id}"]`);if(te!==c&&te.innerText.trim()===f){te.setAttribute("data-md-switching",""),A.click();break}}window.scrollTo({top:e.offsetTop-u});let h=__md_get("__tabs")||[];__md_set("__tabs",[...new Set([f,...h])])}}),s.pipe(U(p)).subscribe(()=>{for(let c of $("audio, video",e))c.pause()}),Na(n).pipe(E(c=>s.next(c)),L(()=>s.complete()),m(c=>R({ref:e},c)))}).pipe(Qe(se))}function Un(e,{viewport$:t,target$:r,print$:o}){return S(...$(".annotate:not(.highlight)",e).map(n=>Cn(n,{target$:r,print$:o})),...$("pre:not(.mermaid) > code",e).map(n=>$n(n,{target$:r,print$:o})),...$("pre.mermaid",e).map(n=>In(n)),...$("table:not([class])",e).map(n=>jn(n)),...$("details",e).map(n=>Pn(n,{target$:r,print$:o})),...$("[data-tabs]",e).map(n=>Wn(n,{viewport$:t,target$:r})),...$("[title]",e).filter(()=>B("content.tooltips")).map(n=>lt(n,{viewport$:t})))}function za(e,{alert$:t}){return t.pipe(v(r=>S(I(!0),I(!1).pipe(Ge(2e3))).pipe(m(o=>({message:r,active:o})))))}function Dn(e,t){let r=P(".md-typeset",e);return C(()=>{let o=new g;return o.subscribe(({message:n,active:i})=>{e.classList.toggle("md-dialog--active",i),r.textContent=n}),za(e,t).pipe(E(n=>o.next(n)),L(()=>o.complete()),m(n=>R({ref:e},n)))})}var qa=0;function Qa(e,t){document.body.append(e);let{width:r}=ce(e);e.style.setProperty("--md-tooltip-width",`${r}px`),e.remove();let o=cr(t),n=typeof o!="undefined"?De(o):I({x:0,y:0}),i=S(et(t),kt(t)).pipe(K());return z([i,n]).pipe(m(([a,s])=>{let{x:p,y:c}=Ue(t),l=ce(t),f=t.closest("table");return f&&t.parentElement&&(p+=f.offsetLeft+t.parentElement.offsetLeft,c+=f.offsetTop+t.parentElement.offsetTop),{active:a,offset:{x:p-s.x+l.width/2-r/2,y:c-s.y+l.height+8}}}))}function Vn(e){let t=e.title;if(!t.length)return O;let r=`__tooltip_${qa++}`,o=Pt(r,"inline"),n=P(".md-typeset",o);return n.innerHTML=t,C(()=>{let i=new g;return i.subscribe({next({offset:a}){o.style.setProperty("--md-tooltip-x",`${a.x}px`),o.style.setProperty("--md-tooltip-y",`${a.y}px`)},complete(){o.style.removeProperty("--md-tooltip-x"),o.style.removeProperty("--md-tooltip-y")}}),S(i.pipe(b(({active:a})=>a)),i.pipe(_e(250),b(({active:a})=>!a))).subscribe({next({active:a}){a?(e.insertAdjacentElement("afterend",o),e.setAttribute("aria-describedby",r),e.removeAttribute("title")):(o.remove(),e.removeAttribute("aria-describedby"),e.setAttribute("title",t))},complete(){o.remove(),e.removeAttribute("aria-describedby"),e.setAttribute("title",t)}}),i.pipe(Le(16,me)).subscribe(({active:a})=>{o.classList.toggle("md-tooltip--active",a)}),i.pipe(ct(125,me),b(()=>!!e.offsetParent),m(()=>e.offsetParent.getBoundingClientRect()),m(({x:a})=>a)).subscribe({next(a){a?o.style.setProperty("--md-tooltip-0",`${-a}px`):o.style.removeProperty("--md-tooltip-0")},complete(){o.style.removeProperty("--md-tooltip-0")}}),Qa(o,e).pipe(E(a=>i.next(a)),L(()=>i.complete()),m(a=>R({ref:e},a)))}).pipe(Qe(se))}function Ka({viewport$:e}){if(!B("header.autohide"))return I(!1);let t=e.pipe(m(({offset:{y:n}})=>n),Ye(2,1),m(([n,i])=>[nMath.abs(i-n.y)>100),m(([,[n]])=>n),K()),o=Ve("search");return z([e,o]).pipe(m(([{offset:n},i])=>n.y>400&&!i),K(),v(n=>n?r:I(!1)),Q(!1))}function Nn(e,t){return C(()=>z([ge(e),Ka(t)])).pipe(m(([{height:r},o])=>({height:r,hidden:o})),K((r,o)=>r.height===o.height&&r.hidden===o.hidden),G(1))}function zn(e,{header$:t,main$:r}){return C(()=>{let o=new g,n=o.pipe(X(),ne(!0));o.pipe(Z("active"),We(t)).subscribe(([{active:a},{hidden:s}])=>{e.classList.toggle("md-header--shadow",a&&!s),e.hidden=s});let i=ue($("[title]",e)).pipe(b(()=>B("content.tooltips")),oe(a=>Vn(a)));return r.subscribe(o),t.pipe(U(n),m(a=>R({ref:e},a)),Pe(i.pipe(U(n))))})}function Ya(e,{viewport$:t,header$:r}){return mr(e,{viewport$:t,header$:r}).pipe(m(({offset:{y:o}})=>{let{height:n}=ce(e);return{active:o>=n}}),Z("active"))}function qn(e,t){return C(()=>{let r=new g;r.subscribe({next({active:n}){e.classList.toggle("md-header__title--active",n)},complete(){e.classList.remove("md-header__title--active")}});let o=fe(".md-content h1");return typeof o=="undefined"?O:Ya(o,t).pipe(E(n=>r.next(n)),L(()=>r.complete()),m(n=>R({ref:e},n)))})}function Qn(e,{viewport$:t,header$:r}){let o=r.pipe(m(({height:i})=>i),K()),n=o.pipe(v(()=>ge(e).pipe(m(({height:i})=>({top:e.offsetTop,bottom:e.offsetTop+i})),Z("bottom"))));return z([o,n,t]).pipe(m(([i,{top:a,bottom:s},{offset:{y:p},size:{height:c}}])=>(c=Math.max(0,c-Math.max(0,a-p,i)-Math.max(0,c+p-s)),{offset:a-i,height:c,active:a-i<=p})),K((i,a)=>i.offset===a.offset&&i.height===a.height&&i.active===a.active))}function Ba(e){let t=__md_get("__palette")||{index:e.findIndex(o=>matchMedia(o.getAttribute("data-md-color-media")).matches)},r=Math.max(0,Math.min(t.index,e.length-1));return I(...e).pipe(oe(o=>d(o,"change").pipe(m(()=>o))),Q(e[r]),m(o=>({index:e.indexOf(o),color:{media:o.getAttribute("data-md-color-media"),scheme:o.getAttribute("data-md-color-scheme"),primary:o.getAttribute("data-md-color-primary"),accent:o.getAttribute("data-md-color-accent")}})),G(1))}function Kn(e){let t=$("input",e),r=x("meta",{name:"theme-color"});document.head.appendChild(r);let o=x("meta",{name:"color-scheme"});document.head.appendChild(o);let n=$t("(prefers-color-scheme: light)");return C(()=>{let i=new g;return i.subscribe(a=>{if(document.body.setAttribute("data-md-color-switching",""),a.color.media==="(prefers-color-scheme)"){let s=matchMedia("(prefers-color-scheme: light)"),p=document.querySelector(s.matches?"[data-md-color-media='(prefers-color-scheme: light)']":"[data-md-color-media='(prefers-color-scheme: dark)']");a.color.scheme=p.getAttribute("data-md-color-scheme"),a.color.primary=p.getAttribute("data-md-color-primary"),a.color.accent=p.getAttribute("data-md-color-accent")}for(let[s,p]of Object.entries(a.color))document.body.setAttribute(`data-md-color-${s}`,p);for(let s=0;sa.key==="Enter"),ee(i,(a,s)=>s)).subscribe(({index:a})=>{a=(a+1)%t.length,t[a].click(),t[a].focus()}),i.pipe(m(()=>{let a=Se("header"),s=window.getComputedStyle(a);return o.content=s.colorScheme,s.backgroundColor.match(/\d+/g).map(p=>(+p).toString(16).padStart(2,"0")).join("")})).subscribe(a=>r.content=`#${a}`),i.pipe(be(se)).subscribe(()=>{document.body.removeAttribute("data-md-color-switching")}),Ba(t).pipe(U(n.pipe(Ce(1))),st(),E(a=>i.next(a)),L(()=>i.complete()),m(a=>R({ref:e},a)))})}function Yn(e,{progress$:t}){return C(()=>{let r=new g;return r.subscribe(({value:o})=>{e.style.setProperty("--md-progress-value",`${o}`)}),t.pipe(E(o=>r.next({value:o})),L(()=>r.complete()),m(o=>({ref:e,value:o})))})}var Gr=Vt(Yr());function Ga(e){e.setAttribute("data-md-copying","");let t=e.closest("[data-copy]"),r=t?t.getAttribute("data-copy"):e.innerText;return e.removeAttribute("data-md-copying"),r.trimEnd()}function Bn({alert$:e}){Gr.default.isSupported()&&new F(t=>{new Gr.default("[data-clipboard-target], [data-clipboard-text]",{text:r=>r.getAttribute("data-clipboard-text")||Ga(P(r.getAttribute("data-clipboard-target")))}).on("success",r=>t.next(r))}).pipe(E(t=>{t.trigger.focus()}),m(()=>Ee("clipboard.copied"))).subscribe(e)}function Gn(e,t){return e.protocol=t.protocol,e.hostname=t.hostname,e}function Ja(e,t){let r=new Map;for(let o of $("url",e)){let n=P("loc",o),i=[Gn(new URL(n.textContent),t)];r.set(`${i[0]}`,i);for(let a of $("[rel=alternate]",o)){let s=a.getAttribute("href");s!=null&&i.push(Gn(new URL(s),t))}}return r}function ur(e){return mn(new URL("sitemap.xml",e)).pipe(m(t=>Ja(t,new URL(e))),ve(()=>I(new Map)))}function Xa(e,t){if(!(e.target instanceof Element))return O;let r=e.target.closest("a");if(r===null)return O;if(r.target||e.metaKey||e.ctrlKey)return O;let o=new URL(r.href);return o.search=o.hash="",t.has(`${o}`)?(e.preventDefault(),I(new URL(r.href))):O}function Jn(e){let t=new Map;for(let r of $(":scope > *",e.head))t.set(r.outerHTML,r);return t}function Xn(e){for(let t of $("[href], [src]",e))for(let r of["href","src"]){let o=t.getAttribute(r);if(o&&!/^(?:[a-z]+:)?\/\//i.test(o)){t[r]=t[r];break}}return I(e)}function Za(e){for(let o of["[data-md-component=announce]","[data-md-component=container]","[data-md-component=header-topic]","[data-md-component=outdated]","[data-md-component=logo]","[data-md-component=skip]",...B("navigation.tabs.sticky")?["[data-md-component=tabs]"]:[]]){let n=fe(o),i=fe(o,e);typeof n!="undefined"&&typeof i!="undefined"&&n.replaceWith(i)}let t=Jn(document);for(let[o,n]of Jn(e))t.has(o)?t.delete(o):document.head.appendChild(n);for(let o of t.values()){let n=o.getAttribute("name");n!=="theme-color"&&n!=="color-scheme"&&o.remove()}let r=Se("container");return je($("script",r)).pipe(v(o=>{let n=e.createElement("script");if(o.src){for(let i of o.getAttributeNames())n.setAttribute(i,o.getAttribute(i));return o.replaceWith(n),new F(i=>{n.onload=()=>i.complete()})}else return n.textContent=o.textContent,o.replaceWith(n),O}),X(),ne(document))}function Zn({location$:e,viewport$:t,progress$:r}){let o=ye();if(location.protocol==="file:")return O;let n=ur(o.base);I(document).subscribe(Xn);let i=d(document.body,"click").pipe(We(n),v(([p,c])=>Xa(p,c)),pe()),a=d(window,"popstate").pipe(m(xe),pe());i.pipe(ee(t)).subscribe(([p,{offset:c}])=>{history.replaceState(c,""),history.pushState(null,"",p)}),S(i,a).subscribe(e);let s=e.pipe(Z("pathname"),v(p=>ln(p,{progress$:r}).pipe(ve(()=>(pt(p,!0),O)))),v(Xn),v(Za),pe());return S(s.pipe(ee(e,(p,c)=>c)),s.pipe(v(()=>e),Z("pathname"),v(()=>e),Z("hash")),e.pipe(K((p,c)=>p.pathname===c.pathname&&p.hash===c.hash),v(()=>i),E(()=>history.back()))).subscribe(p=>{var c,l;history.state!==null||!p.hash?window.scrollTo(0,(l=(c=history.state)==null?void 0:c.y)!=null?l:0):(history.scrollRestoration="auto",sn(p.hash),history.scrollRestoration="manual")}),e.subscribe(()=>{history.scrollRestoration="manual"}),d(window,"beforeunload").subscribe(()=>{history.scrollRestoration="auto"}),t.pipe(Z("offset"),_e(100)).subscribe(({offset:p})=>{history.replaceState(p,"")}),s}var ri=Vt(ti());function oi(e){let t=e.separator.split("|").map(n=>n.replace(/(\(\?[!=<][^)]+\))/g,"").length===0?"\uFFFD":n).join("|"),r=new RegExp(t,"img"),o=(n,i,a)=>`${i}${a}`;return n=>{n=n.replace(/[\s*+\-:~^]+/g," ").trim();let i=new RegExp(`(^|${e.separator}|)(${n.replace(/[|\\{}()[\]^$+*?.-]/g,"\\$&").replace(r,"|")})`,"img");return a=>(0,ri.default)(a).replace(i,o).replace(/<\/mark>(\s+)]*>/img,"$1")}}function It(e){return e.type===1}function dr(e){return e.type===3}function ni(e,t){let r=vn(e);return S(I(location.protocol!=="file:"),Ve("search")).pipe(Ae(o=>o),v(()=>t)).subscribe(({config:o,docs:n})=>r.next({type:0,data:{config:o,docs:n,options:{suggest:B("search.suggest")}}})),r}function ii({document$:e}){let t=ye(),r=Ne(new URL("../versions.json",t.base)).pipe(ve(()=>O)),o=r.pipe(m(n=>{let[,i]=t.base.match(/([^/]+)\/?$/);return n.find(({version:a,aliases:s})=>a===i||s.includes(i))||n[0]}));r.pipe(m(n=>new Map(n.map(i=>[`${new URL(`../${i.version}/`,t.base)}`,i]))),v(n=>d(document.body,"click").pipe(b(i=>!i.metaKey&&!i.ctrlKey),ee(o),v(([i,a])=>{if(i.target instanceof Element){let s=i.target.closest("a");if(s&&!s.target&&n.has(s.href)){let p=s.href;return!i.target.closest(".md-version")&&n.get(p)===a?O:(i.preventDefault(),I(p))}}return O}),v(i=>ur(new URL(i)).pipe(m(a=>{let p=xe().href.replace(t.base,i);return a.has(p.split("#")[0])?new URL(p):new URL(i)})))))).subscribe(n=>pt(n,!0)),z([r,o]).subscribe(([n,i])=>{P(".md-header__topic").appendChild(Mn(n,i))}),e.pipe(v(()=>o)).subscribe(n=>{var a;let i=__md_get("__outdated",sessionStorage);if(i===null){i=!0;let s=((a=t.version)==null?void 0:a.default)||"latest";Array.isArray(s)||(s=[s]);e:for(let p of s)for(let c of n.aliases.concat(n.version))if(new RegExp(p,"i").test(c)){i=!1;break e}__md_set("__outdated",i,sessionStorage)}if(i)for(let s of ae("outdated"))s.hidden=!1})}function ns(e,{worker$:t}){let{searchParams:r}=xe();r.has("q")&&(Je("search",!0),e.value=r.get("q"),e.focus(),Ve("search").pipe(Ae(i=>!i)).subscribe(()=>{let i=xe();i.searchParams.delete("q"),history.replaceState({},"",`${i}`)}));let o=et(e),n=S(t.pipe(Ae(It)),d(e,"keyup"),o).pipe(m(()=>e.value),K());return z([n,o]).pipe(m(([i,a])=>({value:i,focus:a})),G(1))}function ai(e,{worker$:t}){let r=new g,o=r.pipe(X(),ne(!0));z([t.pipe(Ae(It)),r],(i,a)=>a).pipe(Z("value")).subscribe(({value:i})=>t.next({type:2,data:i})),r.pipe(Z("focus")).subscribe(({focus:i})=>{i&&Je("search",i)}),d(e.form,"reset").pipe(U(o)).subscribe(()=>e.focus());let n=P("header [for=__search]");return d(n,"click").subscribe(()=>e.focus()),ns(e,{worker$:t}).pipe(E(i=>r.next(i)),L(()=>r.complete()),m(i=>R({ref:e},i)),G(1))}function si(e,{worker$:t,query$:r}){let o=new g,n=tn(e.parentElement).pipe(b(Boolean)),i=e.parentElement,a=P(":scope > :first-child",e),s=P(":scope > :last-child",e);Ve("search").subscribe(l=>s.setAttribute("role",l?"list":"presentation")),o.pipe(ee(r),Ur(t.pipe(Ae(It)))).subscribe(([{items:l},{value:f}])=>{switch(l.length){case 0:a.textContent=f.length?Ee("search.result.none"):Ee("search.result.placeholder");break;case 1:a.textContent=Ee("search.result.one");break;default:let u=sr(l.length);a.textContent=Ee("search.result.other",u)}});let p=o.pipe(E(()=>s.innerHTML=""),v(({items:l})=>S(I(...l.slice(0,10)),I(...l.slice(10)).pipe(Ye(4),Vr(n),v(([f])=>f)))),m(Tn),pe());return p.subscribe(l=>s.appendChild(l)),p.pipe(oe(l=>{let f=fe("details",l);return typeof f=="undefined"?O:d(f,"toggle").pipe(U(o),m(()=>f))})).subscribe(l=>{l.open===!1&&l.offsetTop<=i.scrollTop&&i.scrollTo({top:l.offsetTop})}),t.pipe(b(dr),m(({data:l})=>l)).pipe(E(l=>o.next(l)),L(()=>o.complete()),m(l=>R({ref:e},l)))}function is(e,{query$:t}){return t.pipe(m(({value:r})=>{let o=xe();return o.hash="",r=r.replace(/\s+/g,"+").replace(/&/g,"%26").replace(/=/g,"%3D"),o.search=`q=${r}`,{url:o}}))}function ci(e,t){let r=new g,o=r.pipe(X(),ne(!0));return r.subscribe(({url:n})=>{e.setAttribute("data-clipboard-text",e.href),e.href=`${n}`}),d(e,"click").pipe(U(o)).subscribe(n=>n.preventDefault()),is(e,t).pipe(E(n=>r.next(n)),L(()=>r.complete()),m(n=>R({ref:e},n)))}function pi(e,{worker$:t,keyboard$:r}){let o=new g,n=Se("search-query"),i=S(d(n,"keydown"),d(n,"focus")).pipe(be(se),m(()=>n.value),K());return o.pipe(We(i),m(([{suggest:s},p])=>{let c=p.split(/([\s-]+)/);if(s!=null&&s.length&&c[c.length-1]){let l=s[s.length-1];l.startsWith(c[c.length-1])&&(c[c.length-1]=l)}else c.length=0;return c})).subscribe(s=>e.innerHTML=s.join("").replace(/\s/g," ")),r.pipe(b(({mode:s})=>s==="search")).subscribe(s=>{switch(s.type){case"ArrowRight":e.innerText.length&&n.selectionStart===n.value.length&&(n.value=e.innerText);break}}),t.pipe(b(dr),m(({data:s})=>s)).pipe(E(s=>o.next(s)),L(()=>o.complete()),m(()=>({ref:e})))}function li(e,{index$:t,keyboard$:r}){let o=ye();try{let n=ni(o.search,t),i=Se("search-query",e),a=Se("search-result",e);d(e,"click").pipe(b(({target:p})=>p instanceof Element&&!!p.closest("a"))).subscribe(()=>Je("search",!1)),r.pipe(b(({mode:p})=>p==="search")).subscribe(p=>{let c=Re();switch(p.type){case"Enter":if(c===i){let l=new Map;for(let f of $(":first-child [href]",a)){let u=f.firstElementChild;l.set(f,parseFloat(u.getAttribute("data-md-score")))}if(l.size){let[[f]]=[...l].sort(([,u],[,h])=>h-u);f.click()}p.claim()}break;case"Escape":case"Tab":Je("search",!1),i.blur();break;case"ArrowUp":case"ArrowDown":if(typeof c=="undefined")i.focus();else{let l=[i,...$(":not(details) > [href], summary, details[open] [href]",a)],f=Math.max(0,(Math.max(0,l.indexOf(c))+l.length+(p.type==="ArrowUp"?-1:1))%l.length);l[f].focus()}p.claim();break;default:i!==Re()&&i.focus()}}),r.pipe(b(({mode:p})=>p==="global")).subscribe(p=>{switch(p.type){case"f":case"s":case"/":i.focus(),i.select(),p.claim();break}});let s=ai(i,{worker$:n});return S(s,si(a,{worker$:n,query$:s})).pipe(Pe(...ae("search-share",e).map(p=>ci(p,{query$:s})),...ae("search-suggest",e).map(p=>pi(p,{worker$:n,keyboard$:r}))))}catch(n){return e.hidden=!0,Ke}}function mi(e,{index$:t,location$:r}){return z([t,r.pipe(Q(xe()),b(o=>!!o.searchParams.get("h")))]).pipe(m(([o,n])=>oi(o.config)(n.searchParams.get("h"))),m(o=>{var a;let n=new Map,i=document.createNodeIterator(e,NodeFilter.SHOW_TEXT);for(let s=i.nextNode();s;s=i.nextNode())if((a=s.parentElement)!=null&&a.offsetHeight){let p=s.textContent,c=o(p);c.length>p.length&&n.set(s,c)}for(let[s,p]of n){let{childNodes:c}=x("span",null,p);s.replaceWith(...Array.from(c))}return{ref:e,nodes:n}}))}function as(e,{viewport$:t,main$:r}){let o=e.closest(".md-grid"),n=o.offsetTop-o.parentElement.offsetTop;return z([r,t]).pipe(m(([{offset:i,height:a},{offset:{y:s}}])=>(a=a+Math.min(n,Math.max(0,s-i))-n,{height:a,locked:s>=i+n})),K((i,a)=>i.height===a.height&&i.locked===a.locked))}function Jr(e,o){var n=o,{header$:t}=n,r=io(n,["header$"]);let i=P(".md-sidebar__scrollwrap",e),{y:a}=Ue(i);return C(()=>{let s=new g,p=s.pipe(X(),ne(!0)),c=s.pipe(Le(0,me));return c.pipe(ee(t)).subscribe({next([{height:l},{height:f}]){i.style.height=`${l-2*a}px`,e.style.top=`${f}px`},complete(){i.style.height="",e.style.top=""}}),c.pipe(Ae()).subscribe(()=>{for(let l of $(".md-nav__link--active[href]",e)){if(!l.clientHeight)continue;let f=l.closest(".md-sidebar__scrollwrap");if(typeof f!="undefined"){let u=l.offsetTop-f.offsetTop,{height:h}=ce(f);f.scrollTo({top:u-h/2})}}}),ue($("label[tabindex]",e)).pipe(oe(l=>d(l,"click").pipe(be(se),m(()=>l),U(p)))).subscribe(l=>{let f=P(`[id="${l.htmlFor}"]`);P(`[aria-labelledby="${l.id}"]`).setAttribute("aria-expanded",`${f.checked}`)}),as(e,r).pipe(E(l=>s.next(l)),L(()=>s.complete()),m(l=>R({ref:e},l)))})}function fi(e,t){if(typeof t!="undefined"){let r=`https://api.github.com/repos/${e}/${t}`;return Ct(Ne(`${r}/releases/latest`).pipe(ve(()=>O),m(o=>({version:o.tag_name})),Be({})),Ne(r).pipe(ve(()=>O),m(o=>({stars:o.stargazers_count,forks:o.forks_count})),Be({}))).pipe(m(([o,n])=>R(R({},o),n)))}else{let r=`https://api.github.com/users/${e}`;return Ne(r).pipe(m(o=>({repositories:o.public_repos})),Be({}))}}function ui(e,t){let r=`https://${e}/api/v4/projects/${encodeURIComponent(t)}`;return Ne(r).pipe(ve(()=>O),m(({star_count:o,forks_count:n})=>({stars:o,forks:n})),Be({}))}function di(e){let t=e.match(/^.+github\.com\/([^/]+)\/?([^/]+)?/i);if(t){let[,r,o]=t;return fi(r,o)}if(t=e.match(/^.+?([^/]*gitlab[^/]+)\/(.+?)\/?$/i),t){let[,r,o]=t;return ui(r,o)}return O}var ss;function cs(e){return ss||(ss=C(()=>{let t=__md_get("__source",sessionStorage);if(t)return I(t);if(ae("consent").length){let o=__md_get("__consent");if(!(o&&o.github))return O}return di(e.href).pipe(E(o=>__md_set("__source",o,sessionStorage)))}).pipe(ve(()=>O),b(t=>Object.keys(t).length>0),m(t=>({facts:t})),G(1)))}function hi(e){let t=P(":scope > :last-child",e);return C(()=>{let r=new g;return r.subscribe(({facts:o})=>{t.appendChild(Sn(o)),t.classList.add("md-source__repository--active")}),cs(e).pipe(E(o=>r.next(o)),L(()=>r.complete()),m(o=>R({ref:e},o)))})}function ps(e,{viewport$:t,header$:r}){return ge(document.body).pipe(v(()=>mr(e,{header$:r,viewport$:t})),m(({offset:{y:o}})=>({hidden:o>=10})),Z("hidden"))}function bi(e,t){return C(()=>{let r=new g;return r.subscribe({next({hidden:o}){e.hidden=o},complete(){e.hidden=!1}}),(B("navigation.tabs.sticky")?I({hidden:!1}):ps(e,t)).pipe(E(o=>r.next(o)),L(()=>r.complete()),m(o=>R({ref:e},o)))})}function ls(e,{viewport$:t,header$:r}){let o=new Map,n=$(".md-nav__link",e);for(let s of n){let p=decodeURIComponent(s.hash.substring(1)),c=fe(`[id="${p}"]`);typeof c!="undefined"&&o.set(s,c)}let i=r.pipe(Z("height"),m(({height:s})=>{let p=Se("main"),c=P(":scope > :first-child",p);return s+.8*(c.offsetTop-p.offsetTop)}),pe());return ge(document.body).pipe(Z("height"),v(s=>C(()=>{let p=[];return I([...o].reduce((c,[l,f])=>{for(;p.length&&o.get(p[p.length-1]).tagName>=f.tagName;)p.pop();let u=f.offsetTop;for(;!u&&f.parentElement;)f=f.parentElement,u=f.offsetTop;let h=f.offsetParent;for(;h;h=h.offsetParent)u+=h.offsetTop;return c.set([...p=[...p,l]].reverse(),u)},new Map))}).pipe(m(p=>new Map([...p].sort(([,c],[,l])=>c-l))),We(i),v(([p,c])=>t.pipe(jr(([l,f],{offset:{y:u},size:h})=>{let w=u+h.height>=Math.floor(s.height);for(;f.length;){let[,A]=f[0];if(A-c=u&&!w)f=[l.pop(),...f];else break}return[l,f]},[[],[...p]]),K((l,f)=>l[0]===f[0]&&l[1]===f[1])))))).pipe(m(([s,p])=>({prev:s.map(([c])=>c),next:p.map(([c])=>c)})),Q({prev:[],next:[]}),Ye(2,1),m(([s,p])=>s.prev.length{let i=new g,a=i.pipe(X(),ne(!0));if(i.subscribe(({prev:s,next:p})=>{for(let[c]of p)c.classList.remove("md-nav__link--passed"),c.classList.remove("md-nav__link--active");for(let[c,[l]]of s.entries())l.classList.add("md-nav__link--passed"),l.classList.toggle("md-nav__link--active",c===s.length-1)}),B("toc.follow")){let s=S(t.pipe(_e(1),m(()=>{})),t.pipe(_e(250),m(()=>"smooth")));i.pipe(b(({prev:p})=>p.length>0),We(o.pipe(be(se))),ee(s)).subscribe(([[{prev:p}],c])=>{let[l]=p[p.length-1];if(l.offsetHeight){let f=cr(l);if(typeof f!="undefined"){let u=l.offsetTop-f.offsetTop,{height:h}=ce(f);f.scrollTo({top:u-h/2,behavior:c})}}})}return B("navigation.tracking")&&t.pipe(U(a),Z("offset"),_e(250),Ce(1),U(n.pipe(Ce(1))),st({delay:250}),ee(i)).subscribe(([,{prev:s}])=>{let p=xe(),c=s[s.length-1];if(c&&c.length){let[l]=c,{hash:f}=new URL(l.href);p.hash!==f&&(p.hash=f,history.replaceState({},"",`${p}`))}else p.hash="",history.replaceState({},"",`${p}`)}),ls(e,{viewport$:t,header$:r}).pipe(E(s=>i.next(s)),L(()=>i.complete()),m(s=>R({ref:e},s)))})}function ms(e,{viewport$:t,main$:r,target$:o}){let n=t.pipe(m(({offset:{y:a}})=>a),Ye(2,1),m(([a,s])=>a>s&&s>0),K()),i=r.pipe(m(({active:a})=>a));return z([i,n]).pipe(m(([a,s])=>!(a&&s)),K(),U(o.pipe(Ce(1))),ne(!0),st({delay:250}),m(a=>({hidden:a})))}function gi(e,{viewport$:t,header$:r,main$:o,target$:n}){let i=new g,a=i.pipe(X(),ne(!0));return i.subscribe({next({hidden:s}){e.hidden=s,s?(e.setAttribute("tabindex","-1"),e.blur()):e.removeAttribute("tabindex")},complete(){e.style.top="",e.hidden=!0,e.removeAttribute("tabindex")}}),r.pipe(U(a),Z("height")).subscribe(({height:s})=>{e.style.top=`${s+16}px`}),d(e,"click").subscribe(s=>{s.preventDefault(),window.scrollTo({top:0})}),ms(e,{viewport$:t,main$:o,target$:n}).pipe(E(s=>i.next(s)),L(()=>i.complete()),m(s=>R({ref:e},s)))}function xi({document$:e,viewport$:t}){e.pipe(v(()=>$(".md-ellipsis")),oe(r=>tt(r).pipe(U(e.pipe(Ce(1))),b(o=>o),m(()=>r),Te(1))),b(r=>r.offsetWidth{let o=r.innerText,n=r.closest("a")||r;return n.title=o,B("content.tooltips")?lt(n,{viewport$:t}).pipe(U(e.pipe(Ce(1))),L(()=>n.removeAttribute("title"))):O})).subscribe(),B("content.tooltips")&&e.pipe(v(()=>$(".md-status")),oe(r=>lt(r,{viewport$:t}))).subscribe()}function yi({document$:e,tablet$:t}){e.pipe(v(()=>$(".md-toggle--indeterminate")),E(r=>{r.indeterminate=!0,r.checked=!1}),oe(r=>d(r,"change").pipe(Dr(()=>r.classList.contains("md-toggle--indeterminate")),m(()=>r))),ee(t)).subscribe(([r,o])=>{r.classList.remove("md-toggle--indeterminate"),o&&(r.checked=!1)})}function fs(){return/(iPad|iPhone|iPod)/.test(navigator.userAgent)}function Ei({document$:e}){e.pipe(v(()=>$("[data-md-scrollfix]")),E(t=>t.removeAttribute("data-md-scrollfix")),b(fs),oe(t=>d(t,"touchstart").pipe(m(()=>t)))).subscribe(t=>{let r=t.scrollTop;r===0?t.scrollTop=1:r+t.offsetHeight===t.scrollHeight&&(t.scrollTop=r-1)})}function wi({viewport$:e,tablet$:t}){z([Ve("search"),t]).pipe(m(([r,o])=>r&&!o),v(r=>I(r).pipe(Ge(r?400:100))),ee(e)).subscribe(([r,{offset:{y:o}}])=>{if(r)document.body.setAttribute("data-md-scrolllock",""),document.body.style.top=`-${o}px`;else{let n=-1*parseInt(document.body.style.top,10);document.body.removeAttribute("data-md-scrolllock"),document.body.style.top="",n&&window.scrollTo(0,n)}})}Object.entries||(Object.entries=function(e){let t=[];for(let r of Object.keys(e))t.push([r,e[r]]);return t});Object.values||(Object.values=function(e){let t=[];for(let r of Object.keys(e))t.push(e[r]);return t});typeof Element!="undefined"&&(Element.prototype.scrollTo||(Element.prototype.scrollTo=function(e,t){typeof e=="object"?(this.scrollLeft=e.left,this.scrollTop=e.top):(this.scrollLeft=e,this.scrollTop=t)}),Element.prototype.replaceWith||(Element.prototype.replaceWith=function(...e){let t=this.parentNode;if(t){e.length===0&&t.removeChild(this);for(let r=e.length-1;r>=0;r--){let o=e[r];typeof o=="string"?o=document.createTextNode(o):o.parentNode&&o.parentNode.removeChild(o),r?t.insertBefore(this.previousSibling,o):t.replaceChild(o,this)}}}));function us(){return location.protocol==="file:"?wt(`${new URL("search/search_index.js",Xr.base)}`).pipe(m(()=>__index),G(1)):Ne(new URL("search/search_index.json",Xr.base))}document.documentElement.classList.remove("no-js");document.documentElement.classList.add("js");var ot=Yo(),jt=nn(),Ot=cn(jt),Zr=on(),Oe=bn(),hr=$t("(min-width: 960px)"),Si=$t("(min-width: 1220px)"),Oi=pn(),Xr=ye(),Mi=document.forms.namedItem("search")?us():Ke,eo=new g;Bn({alert$:eo});var to=new g;B("navigation.instant")&&Zn({location$:jt,viewport$:Oe,progress$:to}).subscribe(ot);var Ti;((Ti=Xr.version)==null?void 0:Ti.provider)==="mike"&&ii({document$:ot});S(jt,Ot).pipe(Ge(125)).subscribe(()=>{Je("drawer",!1),Je("search",!1)});Zr.pipe(b(({mode:e})=>e==="global")).subscribe(e=>{switch(e.type){case"p":case",":let t=fe("link[rel=prev]");typeof t!="undefined"&&pt(t);break;case"n":case".":let r=fe("link[rel=next]");typeof r!="undefined"&&pt(r);break;case"Enter":let o=Re();o instanceof HTMLLabelElement&&o.click()}});xi({viewport$:Oe,document$:ot});yi({document$:ot,tablet$:hr});Ei({document$:ot});wi({viewport$:Oe,tablet$:hr});var rt=Nn(Se("header"),{viewport$:Oe}),Ft=ot.pipe(m(()=>Se("main")),v(e=>Qn(e,{viewport$:Oe,header$:rt})),G(1)),ds=S(...ae("consent").map(e=>xn(e,{target$:Ot})),...ae("dialog").map(e=>Dn(e,{alert$:eo})),...ae("header").map(e=>zn(e,{viewport$:Oe,header$:rt,main$:Ft})),...ae("palette").map(e=>Kn(e)),...ae("progress").map(e=>Yn(e,{progress$:to})),...ae("search").map(e=>li(e,{index$:Mi,keyboard$:Zr})),...ae("source").map(e=>hi(e))),hs=C(()=>S(...ae("announce").map(e=>gn(e)),...ae("content").map(e=>Un(e,{viewport$:Oe,target$:Ot,print$:Oi})),...ae("content").map(e=>B("search.highlight")?mi(e,{index$:Mi,location$:jt}):O),...ae("header-title").map(e=>qn(e,{viewport$:Oe,header$:rt})),...ae("sidebar").map(e=>e.getAttribute("data-md-type")==="navigation"?Nr(Si,()=>Jr(e,{viewport$:Oe,header$:rt,main$:Ft})):Nr(hr,()=>Jr(e,{viewport$:Oe,header$:rt,main$:Ft}))),...ae("tabs").map(e=>bi(e,{viewport$:Oe,header$:rt})),...ae("toc").map(e=>vi(e,{viewport$:Oe,header$:rt,main$:Ft,target$:Ot})),...ae("top").map(e=>gi(e,{viewport$:Oe,header$:rt,main$:Ft,target$:Ot})))),Li=ot.pipe(v(()=>hs),Pe(ds),G(1));Li.subscribe();window.document$=ot;window.location$=jt;window.target$=Ot;window.keyboard$=Zr;window.viewport$=Oe;window.tablet$=hr;window.screen$=Si;window.print$=Oi;window.alert$=eo;window.progress$=to;window.component$=Li;})(); +//# sourceMappingURL=bundle.fe8b6f2b.min.js.map + diff --git a/assets/javascripts/bundle.fe8b6f2b.min.js.map b/assets/javascripts/bundle.fe8b6f2b.min.js.map new file mode 100644 index 000000000..82635852a --- /dev/null +++ b/assets/javascripts/bundle.fe8b6f2b.min.js.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["node_modules/focus-visible/dist/focus-visible.js", "node_modules/clipboard/dist/clipboard.js", "node_modules/escape-html/index.js", "src/templates/assets/javascripts/bundle.ts", "node_modules/rxjs/node_modules/tslib/tslib.es6.js", "node_modules/rxjs/src/internal/util/isFunction.ts", "node_modules/rxjs/src/internal/util/createErrorClass.ts", "node_modules/rxjs/src/internal/util/UnsubscriptionError.ts", "node_modules/rxjs/src/internal/util/arrRemove.ts", "node_modules/rxjs/src/internal/Subscription.ts", "node_modules/rxjs/src/internal/config.ts", "node_modules/rxjs/src/internal/scheduler/timeoutProvider.ts", "node_modules/rxjs/src/internal/util/reportUnhandledError.ts", "node_modules/rxjs/src/internal/util/noop.ts", "node_modules/rxjs/src/internal/NotificationFactories.ts", "node_modules/rxjs/src/internal/util/errorContext.ts", "node_modules/rxjs/src/internal/Subscriber.ts", "node_modules/rxjs/src/internal/symbol/observable.ts", "node_modules/rxjs/src/internal/util/identity.ts", "node_modules/rxjs/src/internal/util/pipe.ts", "node_modules/rxjs/src/internal/Observable.ts", "node_modules/rxjs/src/internal/util/lift.ts", "node_modules/rxjs/src/internal/operators/OperatorSubscriber.ts", "node_modules/rxjs/src/internal/scheduler/animationFrameProvider.ts", "node_modules/rxjs/src/internal/util/ObjectUnsubscribedError.ts", "node_modules/rxjs/src/internal/Subject.ts", "node_modules/rxjs/src/internal/BehaviorSubject.ts", "node_modules/rxjs/src/internal/scheduler/dateTimestampProvider.ts", "node_modules/rxjs/src/internal/ReplaySubject.ts", "node_modules/rxjs/src/internal/scheduler/Action.ts", "node_modules/rxjs/src/internal/scheduler/intervalProvider.ts", "node_modules/rxjs/src/internal/scheduler/AsyncAction.ts", "node_modules/rxjs/src/internal/Scheduler.ts", "node_modules/rxjs/src/internal/scheduler/AsyncScheduler.ts", "node_modules/rxjs/src/internal/scheduler/async.ts", "node_modules/rxjs/src/internal/scheduler/QueueAction.ts", "node_modules/rxjs/src/internal/scheduler/QueueScheduler.ts", "node_modules/rxjs/src/internal/scheduler/queue.ts", "node_modules/rxjs/src/internal/scheduler/AnimationFrameAction.ts", "node_modules/rxjs/src/internal/scheduler/AnimationFrameScheduler.ts", "node_modules/rxjs/src/internal/scheduler/animationFrame.ts", "node_modules/rxjs/src/internal/observable/empty.ts", "node_modules/rxjs/src/internal/util/isScheduler.ts", "node_modules/rxjs/src/internal/util/args.ts", "node_modules/rxjs/src/internal/util/isArrayLike.ts", "node_modules/rxjs/src/internal/util/isPromise.ts", "node_modules/rxjs/src/internal/util/isInteropObservable.ts", "node_modules/rxjs/src/internal/util/isAsyncIterable.ts", "node_modules/rxjs/src/internal/util/throwUnobservableError.ts", "node_modules/rxjs/src/internal/symbol/iterator.ts", "node_modules/rxjs/src/internal/util/isIterable.ts", "node_modules/rxjs/src/internal/util/isReadableStreamLike.ts", "node_modules/rxjs/src/internal/observable/innerFrom.ts", "node_modules/rxjs/src/internal/util/executeSchedule.ts", "node_modules/rxjs/src/internal/operators/observeOn.ts", "node_modules/rxjs/src/internal/operators/subscribeOn.ts", "node_modules/rxjs/src/internal/scheduled/scheduleObservable.ts", "node_modules/rxjs/src/internal/scheduled/schedulePromise.ts", "node_modules/rxjs/src/internal/scheduled/scheduleArray.ts", "node_modules/rxjs/src/internal/scheduled/scheduleIterable.ts", "node_modules/rxjs/src/internal/scheduled/scheduleAsyncIterable.ts", "node_modules/rxjs/src/internal/scheduled/scheduleReadableStreamLike.ts", "node_modules/rxjs/src/internal/scheduled/scheduled.ts", "node_modules/rxjs/src/internal/observable/from.ts", "node_modules/rxjs/src/internal/observable/of.ts", "node_modules/rxjs/src/internal/observable/throwError.ts", "node_modules/rxjs/src/internal/util/EmptyError.ts", "node_modules/rxjs/src/internal/util/isDate.ts", "node_modules/rxjs/src/internal/operators/map.ts", "node_modules/rxjs/src/internal/util/mapOneOrManyArgs.ts", "node_modules/rxjs/src/internal/util/argsArgArrayOrObject.ts", "node_modules/rxjs/src/internal/util/createObject.ts", "node_modules/rxjs/src/internal/observable/combineLatest.ts", "node_modules/rxjs/src/internal/operators/mergeInternals.ts", "node_modules/rxjs/src/internal/operators/mergeMap.ts", "node_modules/rxjs/src/internal/operators/mergeAll.ts", "node_modules/rxjs/src/internal/operators/concatAll.ts", "node_modules/rxjs/src/internal/observable/concat.ts", "node_modules/rxjs/src/internal/observable/defer.ts", "node_modules/rxjs/src/internal/observable/fromEvent.ts", "node_modules/rxjs/src/internal/observable/fromEventPattern.ts", "node_modules/rxjs/src/internal/observable/timer.ts", "node_modules/rxjs/src/internal/observable/merge.ts", "node_modules/rxjs/src/internal/observable/never.ts", "node_modules/rxjs/src/internal/util/argsOrArgArray.ts", "node_modules/rxjs/src/internal/operators/filter.ts", "node_modules/rxjs/src/internal/observable/zip.ts", "node_modules/rxjs/src/internal/operators/audit.ts", "node_modules/rxjs/src/internal/operators/auditTime.ts", "node_modules/rxjs/src/internal/operators/bufferCount.ts", "node_modules/rxjs/src/internal/operators/catchError.ts", "node_modules/rxjs/src/internal/operators/scanInternals.ts", "node_modules/rxjs/src/internal/operators/combineLatest.ts", "node_modules/rxjs/src/internal/operators/combineLatestWith.ts", "node_modules/rxjs/src/internal/operators/debounce.ts", "node_modules/rxjs/src/internal/operators/debounceTime.ts", "node_modules/rxjs/src/internal/operators/defaultIfEmpty.ts", "node_modules/rxjs/src/internal/operators/take.ts", "node_modules/rxjs/src/internal/operators/ignoreElements.ts", "node_modules/rxjs/src/internal/operators/mapTo.ts", "node_modules/rxjs/src/internal/operators/delayWhen.ts", "node_modules/rxjs/src/internal/operators/delay.ts", "node_modules/rxjs/src/internal/operators/distinctUntilChanged.ts", "node_modules/rxjs/src/internal/operators/distinctUntilKeyChanged.ts", "node_modules/rxjs/src/internal/operators/throwIfEmpty.ts", "node_modules/rxjs/src/internal/operators/endWith.ts", "node_modules/rxjs/src/internal/operators/finalize.ts", "node_modules/rxjs/src/internal/operators/first.ts", "node_modules/rxjs/src/internal/operators/takeLast.ts", "node_modules/rxjs/src/internal/operators/merge.ts", "node_modules/rxjs/src/internal/operators/mergeWith.ts", "node_modules/rxjs/src/internal/operators/repeat.ts", "node_modules/rxjs/src/internal/operators/scan.ts", "node_modules/rxjs/src/internal/operators/share.ts", "node_modules/rxjs/src/internal/operators/shareReplay.ts", "node_modules/rxjs/src/internal/operators/skip.ts", "node_modules/rxjs/src/internal/operators/skipUntil.ts", "node_modules/rxjs/src/internal/operators/startWith.ts", "node_modules/rxjs/src/internal/operators/switchMap.ts", "node_modules/rxjs/src/internal/operators/takeUntil.ts", "node_modules/rxjs/src/internal/operators/takeWhile.ts", "node_modules/rxjs/src/internal/operators/tap.ts", "node_modules/rxjs/src/internal/operators/throttle.ts", "node_modules/rxjs/src/internal/operators/throttleTime.ts", "node_modules/rxjs/src/internal/operators/withLatestFrom.ts", "node_modules/rxjs/src/internal/operators/zip.ts", "node_modules/rxjs/src/internal/operators/zipWith.ts", "src/templates/assets/javascripts/browser/document/index.ts", "src/templates/assets/javascripts/browser/element/_/index.ts", "src/templates/assets/javascripts/browser/element/focus/index.ts", "src/templates/assets/javascripts/browser/element/hover/index.ts", "src/templates/assets/javascripts/utilities/h/index.ts", "src/templates/assets/javascripts/utilities/round/index.ts", "src/templates/assets/javascripts/browser/script/index.ts", "src/templates/assets/javascripts/browser/element/size/_/index.ts", "src/templates/assets/javascripts/browser/element/size/content/index.ts", "src/templates/assets/javascripts/browser/element/offset/_/index.ts", "src/templates/assets/javascripts/browser/element/offset/content/index.ts", "src/templates/assets/javascripts/browser/element/visibility/index.ts", "src/templates/assets/javascripts/browser/toggle/index.ts", "src/templates/assets/javascripts/browser/keyboard/index.ts", "src/templates/assets/javascripts/browser/location/_/index.ts", "src/templates/assets/javascripts/browser/location/hash/index.ts", "src/templates/assets/javascripts/browser/media/index.ts", "src/templates/assets/javascripts/browser/request/index.ts", "src/templates/assets/javascripts/browser/viewport/offset/index.ts", "src/templates/assets/javascripts/browser/viewport/size/index.ts", "src/templates/assets/javascripts/browser/viewport/_/index.ts", "src/templates/assets/javascripts/browser/viewport/at/index.ts", "src/templates/assets/javascripts/browser/worker/index.ts", "src/templates/assets/javascripts/_/index.ts", "src/templates/assets/javascripts/components/_/index.ts", "src/templates/assets/javascripts/components/announce/index.ts", "src/templates/assets/javascripts/components/consent/index.ts", "src/templates/assets/javascripts/templates/tooltip/index.tsx", "src/templates/assets/javascripts/templates/annotation/index.tsx", "src/templates/assets/javascripts/templates/clipboard/index.tsx", "src/templates/assets/javascripts/templates/search/index.tsx", "src/templates/assets/javascripts/templates/source/index.tsx", "src/templates/assets/javascripts/templates/tabbed/index.tsx", "src/templates/assets/javascripts/templates/table/index.tsx", "src/templates/assets/javascripts/templates/version/index.tsx", "src/templates/assets/javascripts/components/tooltip2/index.ts", "src/templates/assets/javascripts/components/content/annotation/_/index.ts", "src/templates/assets/javascripts/components/content/annotation/list/index.ts", "src/templates/assets/javascripts/components/content/annotation/block/index.ts", "src/templates/assets/javascripts/components/content/code/_/index.ts", "src/templates/assets/javascripts/components/content/details/index.ts", "src/templates/assets/javascripts/components/content/mermaid/index.css", "src/templates/assets/javascripts/components/content/mermaid/index.ts", "src/templates/assets/javascripts/components/content/table/index.ts", "src/templates/assets/javascripts/components/content/tabs/index.ts", "src/templates/assets/javascripts/components/content/_/index.ts", "src/templates/assets/javascripts/components/dialog/index.ts", "src/templates/assets/javascripts/components/tooltip/index.ts", "src/templates/assets/javascripts/components/header/_/index.ts", "src/templates/assets/javascripts/components/header/title/index.ts", "src/templates/assets/javascripts/components/main/index.ts", "src/templates/assets/javascripts/components/palette/index.ts", "src/templates/assets/javascripts/components/progress/index.ts", "src/templates/assets/javascripts/integrations/clipboard/index.ts", "src/templates/assets/javascripts/integrations/sitemap/index.ts", "src/templates/assets/javascripts/integrations/instant/index.ts", "src/templates/assets/javascripts/integrations/search/highlighter/index.ts", "src/templates/assets/javascripts/integrations/search/worker/message/index.ts", "src/templates/assets/javascripts/integrations/search/worker/_/index.ts", "src/templates/assets/javascripts/integrations/version/index.ts", "src/templates/assets/javascripts/components/search/query/index.ts", "src/templates/assets/javascripts/components/search/result/index.ts", "src/templates/assets/javascripts/components/search/share/index.ts", "src/templates/assets/javascripts/components/search/suggest/index.ts", "src/templates/assets/javascripts/components/search/_/index.ts", "src/templates/assets/javascripts/components/search/highlight/index.ts", "src/templates/assets/javascripts/components/sidebar/index.ts", "src/templates/assets/javascripts/components/source/facts/github/index.ts", "src/templates/assets/javascripts/components/source/facts/gitlab/index.ts", "src/templates/assets/javascripts/components/source/facts/_/index.ts", "src/templates/assets/javascripts/components/source/_/index.ts", "src/templates/assets/javascripts/components/tabs/index.ts", "src/templates/assets/javascripts/components/toc/index.ts", "src/templates/assets/javascripts/components/top/index.ts", "src/templates/assets/javascripts/patches/ellipsis/index.ts", "src/templates/assets/javascripts/patches/indeterminate/index.ts", "src/templates/assets/javascripts/patches/scrollfix/index.ts", "src/templates/assets/javascripts/patches/scrolllock/index.ts", "src/templates/assets/javascripts/polyfills/index.ts"], + "sourcesContent": ["(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? factory() :\n typeof define === 'function' && define.amd ? define(factory) :\n (factory());\n}(this, (function () { 'use strict';\n\n /**\n * Applies the :focus-visible polyfill at the given scope.\n * A scope in this case is either the top-level Document or a Shadow Root.\n *\n * @param {(Document|ShadowRoot)} scope\n * @see https://github.com/WICG/focus-visible\n */\n function applyFocusVisiblePolyfill(scope) {\n var hadKeyboardEvent = true;\n var hadFocusVisibleRecently = false;\n var hadFocusVisibleRecentlyTimeout = null;\n\n var inputTypesAllowlist = {\n text: true,\n search: true,\n url: true,\n tel: true,\n email: true,\n password: true,\n number: true,\n date: true,\n month: true,\n week: true,\n time: true,\n datetime: true,\n 'datetime-local': true\n };\n\n /**\n * Helper function for legacy browsers and iframes which sometimes focus\n * elements like document, body, and non-interactive SVG.\n * @param {Element} el\n */\n function isValidFocusTarget(el) {\n if (\n el &&\n el !== document &&\n el.nodeName !== 'HTML' &&\n el.nodeName !== 'BODY' &&\n 'classList' in el &&\n 'contains' in el.classList\n ) {\n return true;\n }\n return false;\n }\n\n /**\n * Computes whether the given element should automatically trigger the\n * `focus-visible` class being added, i.e. whether it should always match\n * `:focus-visible` when focused.\n * @param {Element} el\n * @return {boolean}\n */\n function focusTriggersKeyboardModality(el) {\n var type = el.type;\n var tagName = el.tagName;\n\n if (tagName === 'INPUT' && inputTypesAllowlist[type] && !el.readOnly) {\n return true;\n }\n\n if (tagName === 'TEXTAREA' && !el.readOnly) {\n return true;\n }\n\n if (el.isContentEditable) {\n return true;\n }\n\n return false;\n }\n\n /**\n * Add the `focus-visible` class to the given element if it was not added by\n * the author.\n * @param {Element} el\n */\n function addFocusVisibleClass(el) {\n if (el.classList.contains('focus-visible')) {\n return;\n }\n el.classList.add('focus-visible');\n el.setAttribute('data-focus-visible-added', '');\n }\n\n /**\n * Remove the `focus-visible` class from the given element if it was not\n * originally added by the author.\n * @param {Element} el\n */\n function removeFocusVisibleClass(el) {\n if (!el.hasAttribute('data-focus-visible-added')) {\n return;\n }\n el.classList.remove('focus-visible');\n el.removeAttribute('data-focus-visible-added');\n }\n\n /**\n * If the most recent user interaction was via the keyboard;\n * and the key press did not include a meta, alt/option, or control key;\n * then the modality is keyboard. Otherwise, the modality is not keyboard.\n * Apply `focus-visible` to any current active element and keep track\n * of our keyboard modality state with `hadKeyboardEvent`.\n * @param {KeyboardEvent} e\n */\n function onKeyDown(e) {\n if (e.metaKey || e.altKey || e.ctrlKey) {\n return;\n }\n\n if (isValidFocusTarget(scope.activeElement)) {\n addFocusVisibleClass(scope.activeElement);\n }\n\n hadKeyboardEvent = true;\n }\n\n /**\n * If at any point a user clicks with a pointing device, ensure that we change\n * the modality away from keyboard.\n * This avoids the situation where a user presses a key on an already focused\n * element, and then clicks on a different element, focusing it with a\n * pointing device, while we still think we're in keyboard modality.\n * @param {Event} e\n */\n function onPointerDown(e) {\n hadKeyboardEvent = false;\n }\n\n /**\n * On `focus`, add the `focus-visible` class to the target if:\n * - the target received focus as a result of keyboard navigation, or\n * - the event target is an element that will likely require interaction\n * via the keyboard (e.g. a text box)\n * @param {Event} e\n */\n function onFocus(e) {\n // Prevent IE from focusing the document or HTML element.\n if (!isValidFocusTarget(e.target)) {\n return;\n }\n\n if (hadKeyboardEvent || focusTriggersKeyboardModality(e.target)) {\n addFocusVisibleClass(e.target);\n }\n }\n\n /**\n * On `blur`, remove the `focus-visible` class from the target.\n * @param {Event} e\n */\n function onBlur(e) {\n if (!isValidFocusTarget(e.target)) {\n return;\n }\n\n if (\n e.target.classList.contains('focus-visible') ||\n e.target.hasAttribute('data-focus-visible-added')\n ) {\n // To detect a tab/window switch, we look for a blur event followed\n // rapidly by a visibility change.\n // If we don't see a visibility change within 100ms, it's probably a\n // regular focus change.\n hadFocusVisibleRecently = true;\n window.clearTimeout(hadFocusVisibleRecentlyTimeout);\n hadFocusVisibleRecentlyTimeout = window.setTimeout(function() {\n hadFocusVisibleRecently = false;\n }, 100);\n removeFocusVisibleClass(e.target);\n }\n }\n\n /**\n * If the user changes tabs, keep track of whether or not the previously\n * focused element had .focus-visible.\n * @param {Event} e\n */\n function onVisibilityChange(e) {\n if (document.visibilityState === 'hidden') {\n // If the tab becomes active again, the browser will handle calling focus\n // on the element (Safari actually calls it twice).\n // If this tab change caused a blur on an element with focus-visible,\n // re-apply the class when the user switches back to the tab.\n if (hadFocusVisibleRecently) {\n hadKeyboardEvent = true;\n }\n addInitialPointerMoveListeners();\n }\n }\n\n /**\n * Add a group of listeners to detect usage of any pointing devices.\n * These listeners will be added when the polyfill first loads, and anytime\n * the window is blurred, so that they are active when the window regains\n * focus.\n */\n function addInitialPointerMoveListeners() {\n document.addEventListener('mousemove', onInitialPointerMove);\n document.addEventListener('mousedown', onInitialPointerMove);\n document.addEventListener('mouseup', onInitialPointerMove);\n document.addEventListener('pointermove', onInitialPointerMove);\n document.addEventListener('pointerdown', onInitialPointerMove);\n document.addEventListener('pointerup', onInitialPointerMove);\n document.addEventListener('touchmove', onInitialPointerMove);\n document.addEventListener('touchstart', onInitialPointerMove);\n document.addEventListener('touchend', onInitialPointerMove);\n }\n\n function removeInitialPointerMoveListeners() {\n document.removeEventListener('mousemove', onInitialPointerMove);\n document.removeEventListener('mousedown', onInitialPointerMove);\n document.removeEventListener('mouseup', onInitialPointerMove);\n document.removeEventListener('pointermove', onInitialPointerMove);\n document.removeEventListener('pointerdown', onInitialPointerMove);\n document.removeEventListener('pointerup', onInitialPointerMove);\n document.removeEventListener('touchmove', onInitialPointerMove);\n document.removeEventListener('touchstart', onInitialPointerMove);\n document.removeEventListener('touchend', onInitialPointerMove);\n }\n\n /**\n * When the polfyill first loads, assume the user is in keyboard modality.\n * If any event is received from a pointing device (e.g. mouse, pointer,\n * touch), turn off keyboard modality.\n * This accounts for situations where focus enters the page from the URL bar.\n * @param {Event} e\n */\n function onInitialPointerMove(e) {\n // Work around a Safari quirk that fires a mousemove on whenever the\n // window blurs, even if you're tabbing out of the page. \u00AF\\_(\u30C4)_/\u00AF\n if (e.target.nodeName && e.target.nodeName.toLowerCase() === 'html') {\n return;\n }\n\n hadKeyboardEvent = false;\n removeInitialPointerMoveListeners();\n }\n\n // For some kinds of state, we are interested in changes at the global scope\n // only. For example, global pointer input, global key presses and global\n // visibility change should affect the state at every scope:\n document.addEventListener('keydown', onKeyDown, true);\n document.addEventListener('mousedown', onPointerDown, true);\n document.addEventListener('pointerdown', onPointerDown, true);\n document.addEventListener('touchstart', onPointerDown, true);\n document.addEventListener('visibilitychange', onVisibilityChange, true);\n\n addInitialPointerMoveListeners();\n\n // For focus and blur, we specifically care about state changes in the local\n // scope. This is because focus / blur events that originate from within a\n // shadow root are not re-dispatched from the host element if it was already\n // the active element in its own scope:\n scope.addEventListener('focus', onFocus, true);\n scope.addEventListener('blur', onBlur, true);\n\n // We detect that a node is a ShadowRoot by ensuring that it is a\n // DocumentFragment and also has a host property. This check covers native\n // implementation and polyfill implementation transparently. If we only cared\n // about the native implementation, we could just check if the scope was\n // an instance of a ShadowRoot.\n if (scope.nodeType === Node.DOCUMENT_FRAGMENT_NODE && scope.host) {\n // Since a ShadowRoot is a special kind of DocumentFragment, it does not\n // have a root element to add a class to. So, we add this attribute to the\n // host element instead:\n scope.host.setAttribute('data-js-focus-visible', '');\n } else if (scope.nodeType === Node.DOCUMENT_NODE) {\n document.documentElement.classList.add('js-focus-visible');\n document.documentElement.setAttribute('data-js-focus-visible', '');\n }\n }\n\n // It is important to wrap all references to global window and document in\n // these checks to support server-side rendering use cases\n // @see https://github.com/WICG/focus-visible/issues/199\n if (typeof window !== 'undefined' && typeof document !== 'undefined') {\n // Make the polyfill helper globally available. This can be used as a signal\n // to interested libraries that wish to coordinate with the polyfill for e.g.,\n // applying the polyfill to a shadow root:\n window.applyFocusVisiblePolyfill = applyFocusVisiblePolyfill;\n\n // Notify interested libraries of the polyfill's presence, in case the\n // polyfill was loaded lazily:\n var event;\n\n try {\n event = new CustomEvent('focus-visible-polyfill-ready');\n } catch (error) {\n // IE11 does not support using CustomEvent as a constructor directly:\n event = document.createEvent('CustomEvent');\n event.initCustomEvent('focus-visible-polyfill-ready', false, false, {});\n }\n\n window.dispatchEvent(event);\n }\n\n if (typeof document !== 'undefined') {\n // Apply the polyfill to the global document, so that no JavaScript\n // coordination is required to use the polyfill in the top-level document:\n applyFocusVisiblePolyfill(document);\n }\n\n})));\n", "/*!\n * clipboard.js v2.0.11\n * https://clipboardjs.com/\n *\n * Licensed MIT \u00A9 Zeno Rocha\n */\n(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"ClipboardJS\"] = factory();\n\telse\n\t\troot[\"ClipboardJS\"] = factory();\n})(this, function() {\nreturn /******/ (function() { // webpackBootstrap\n/******/ \tvar __webpack_modules__ = ({\n\n/***/ 686:\n/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n\n// EXPORTS\n__webpack_require__.d(__webpack_exports__, {\n \"default\": function() { return /* binding */ clipboard; }\n});\n\n// EXTERNAL MODULE: ./node_modules/tiny-emitter/index.js\nvar tiny_emitter = __webpack_require__(279);\nvar tiny_emitter_default = /*#__PURE__*/__webpack_require__.n(tiny_emitter);\n// EXTERNAL MODULE: ./node_modules/good-listener/src/listen.js\nvar listen = __webpack_require__(370);\nvar listen_default = /*#__PURE__*/__webpack_require__.n(listen);\n// EXTERNAL MODULE: ./node_modules/select/src/select.js\nvar src_select = __webpack_require__(817);\nvar select_default = /*#__PURE__*/__webpack_require__.n(src_select);\n;// CONCATENATED MODULE: ./src/common/command.js\n/**\n * Executes a given operation type.\n * @param {String} type\n * @return {Boolean}\n */\nfunction command(type) {\n try {\n return document.execCommand(type);\n } catch (err) {\n return false;\n }\n}\n;// CONCATENATED MODULE: ./src/actions/cut.js\n\n\n/**\n * Cut action wrapper.\n * @param {String|HTMLElement} target\n * @return {String}\n */\n\nvar ClipboardActionCut = function ClipboardActionCut(target) {\n var selectedText = select_default()(target);\n command('cut');\n return selectedText;\n};\n\n/* harmony default export */ var actions_cut = (ClipboardActionCut);\n;// CONCATENATED MODULE: ./src/common/create-fake-element.js\n/**\n * Creates a fake textarea element with a value.\n * @param {String} value\n * @return {HTMLElement}\n */\nfunction createFakeElement(value) {\n var isRTL = document.documentElement.getAttribute('dir') === 'rtl';\n var fakeElement = document.createElement('textarea'); // Prevent zooming on iOS\n\n fakeElement.style.fontSize = '12pt'; // Reset box model\n\n fakeElement.style.border = '0';\n fakeElement.style.padding = '0';\n fakeElement.style.margin = '0'; // Move element out of screen horizontally\n\n fakeElement.style.position = 'absolute';\n fakeElement.style[isRTL ? 'right' : 'left'] = '-9999px'; // Move element to the same position vertically\n\n var yPosition = window.pageYOffset || document.documentElement.scrollTop;\n fakeElement.style.top = \"\".concat(yPosition, \"px\");\n fakeElement.setAttribute('readonly', '');\n fakeElement.value = value;\n return fakeElement;\n}\n;// CONCATENATED MODULE: ./src/actions/copy.js\n\n\n\n/**\n * Create fake copy action wrapper using a fake element.\n * @param {String} target\n * @param {Object} options\n * @return {String}\n */\n\nvar fakeCopyAction = function fakeCopyAction(value, options) {\n var fakeElement = createFakeElement(value);\n options.container.appendChild(fakeElement);\n var selectedText = select_default()(fakeElement);\n command('copy');\n fakeElement.remove();\n return selectedText;\n};\n/**\n * Copy action wrapper.\n * @param {String|HTMLElement} target\n * @param {Object} options\n * @return {String}\n */\n\n\nvar ClipboardActionCopy = function ClipboardActionCopy(target) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {\n container: document.body\n };\n var selectedText = '';\n\n if (typeof target === 'string') {\n selectedText = fakeCopyAction(target, options);\n } else if (target instanceof HTMLInputElement && !['text', 'search', 'url', 'tel', 'password'].includes(target === null || target === void 0 ? void 0 : target.type)) {\n // If input type doesn't support `setSelectionRange`. Simulate it. https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/setSelectionRange\n selectedText = fakeCopyAction(target.value, options);\n } else {\n selectedText = select_default()(target);\n command('copy');\n }\n\n return selectedText;\n};\n\n/* harmony default export */ var actions_copy = (ClipboardActionCopy);\n;// CONCATENATED MODULE: ./src/actions/default.js\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\n\n\n/**\n * Inner function which performs selection from either `text` or `target`\n * properties and then executes copy or cut operations.\n * @param {Object} options\n */\n\nvar ClipboardActionDefault = function ClipboardActionDefault() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n // Defines base properties passed from constructor.\n var _options$action = options.action,\n action = _options$action === void 0 ? 'copy' : _options$action,\n container = options.container,\n target = options.target,\n text = options.text; // Sets the `action` to be performed which can be either 'copy' or 'cut'.\n\n if (action !== 'copy' && action !== 'cut') {\n throw new Error('Invalid \"action\" value, use either \"copy\" or \"cut\"');\n } // Sets the `target` property using an element that will be have its content copied.\n\n\n if (target !== undefined) {\n if (target && _typeof(target) === 'object' && target.nodeType === 1) {\n if (action === 'copy' && target.hasAttribute('disabled')) {\n throw new Error('Invalid \"target\" attribute. Please use \"readonly\" instead of \"disabled\" attribute');\n }\n\n if (action === 'cut' && (target.hasAttribute('readonly') || target.hasAttribute('disabled'))) {\n throw new Error('Invalid \"target\" attribute. You can\\'t cut text from elements with \"readonly\" or \"disabled\" attributes');\n }\n } else {\n throw new Error('Invalid \"target\" value, use a valid Element');\n }\n } // Define selection strategy based on `text` property.\n\n\n if (text) {\n return actions_copy(text, {\n container: container\n });\n } // Defines which selection strategy based on `target` property.\n\n\n if (target) {\n return action === 'cut' ? actions_cut(target) : actions_copy(target, {\n container: container\n });\n }\n};\n\n/* harmony default export */ var actions_default = (ClipboardActionDefault);\n;// CONCATENATED MODULE: ./src/clipboard.js\nfunction clipboard_typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { clipboard_typeof = function _typeof(obj) { return typeof obj; }; } else { clipboard_typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return clipboard_typeof(obj); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (clipboard_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\n\n\n\n\n\n/**\n * Helper function to retrieve attribute value.\n * @param {String} suffix\n * @param {Element} element\n */\n\nfunction getAttributeValue(suffix, element) {\n var attribute = \"data-clipboard-\".concat(suffix);\n\n if (!element.hasAttribute(attribute)) {\n return;\n }\n\n return element.getAttribute(attribute);\n}\n/**\n * Base class which takes one or more elements, adds event listeners to them,\n * and instantiates a new `ClipboardAction` on each click.\n */\n\n\nvar Clipboard = /*#__PURE__*/function (_Emitter) {\n _inherits(Clipboard, _Emitter);\n\n var _super = _createSuper(Clipboard);\n\n /**\n * @param {String|HTMLElement|HTMLCollection|NodeList} trigger\n * @param {Object} options\n */\n function Clipboard(trigger, options) {\n var _this;\n\n _classCallCheck(this, Clipboard);\n\n _this = _super.call(this);\n\n _this.resolveOptions(options);\n\n _this.listenClick(trigger);\n\n return _this;\n }\n /**\n * Defines if attributes would be resolved using internal setter functions\n * or custom functions that were passed in the constructor.\n * @param {Object} options\n */\n\n\n _createClass(Clipboard, [{\n key: \"resolveOptions\",\n value: function resolveOptions() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n this.action = typeof options.action === 'function' ? options.action : this.defaultAction;\n this.target = typeof options.target === 'function' ? options.target : this.defaultTarget;\n this.text = typeof options.text === 'function' ? options.text : this.defaultText;\n this.container = clipboard_typeof(options.container) === 'object' ? options.container : document.body;\n }\n /**\n * Adds a click event listener to the passed trigger.\n * @param {String|HTMLElement|HTMLCollection|NodeList} trigger\n */\n\n }, {\n key: \"listenClick\",\n value: function listenClick(trigger) {\n var _this2 = this;\n\n this.listener = listen_default()(trigger, 'click', function (e) {\n return _this2.onClick(e);\n });\n }\n /**\n * Defines a new `ClipboardAction` on each click event.\n * @param {Event} e\n */\n\n }, {\n key: \"onClick\",\n value: function onClick(e) {\n var trigger = e.delegateTarget || e.currentTarget;\n var action = this.action(trigger) || 'copy';\n var text = actions_default({\n action: action,\n container: this.container,\n target: this.target(trigger),\n text: this.text(trigger)\n }); // Fires an event based on the copy operation result.\n\n this.emit(text ? 'success' : 'error', {\n action: action,\n text: text,\n trigger: trigger,\n clearSelection: function clearSelection() {\n if (trigger) {\n trigger.focus();\n }\n\n window.getSelection().removeAllRanges();\n }\n });\n }\n /**\n * Default `action` lookup function.\n * @param {Element} trigger\n */\n\n }, {\n key: \"defaultAction\",\n value: function defaultAction(trigger) {\n return getAttributeValue('action', trigger);\n }\n /**\n * Default `target` lookup function.\n * @param {Element} trigger\n */\n\n }, {\n key: \"defaultTarget\",\n value: function defaultTarget(trigger) {\n var selector = getAttributeValue('target', trigger);\n\n if (selector) {\n return document.querySelector(selector);\n }\n }\n /**\n * Allow fire programmatically a copy action\n * @param {String|HTMLElement} target\n * @param {Object} options\n * @returns Text copied.\n */\n\n }, {\n key: \"defaultText\",\n\n /**\n * Default `text` lookup function.\n * @param {Element} trigger\n */\n value: function defaultText(trigger) {\n return getAttributeValue('text', trigger);\n }\n /**\n * Destroy lifecycle.\n */\n\n }, {\n key: \"destroy\",\n value: function destroy() {\n this.listener.destroy();\n }\n }], [{\n key: \"copy\",\n value: function copy(target) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {\n container: document.body\n };\n return actions_copy(target, options);\n }\n /**\n * Allow fire programmatically a cut action\n * @param {String|HTMLElement} target\n * @returns Text cutted.\n */\n\n }, {\n key: \"cut\",\n value: function cut(target) {\n return actions_cut(target);\n }\n /**\n * Returns the support of the given action, or all actions if no action is\n * given.\n * @param {String} [action]\n */\n\n }, {\n key: \"isSupported\",\n value: function isSupported() {\n var action = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ['copy', 'cut'];\n var actions = typeof action === 'string' ? [action] : action;\n var support = !!document.queryCommandSupported;\n actions.forEach(function (action) {\n support = support && !!document.queryCommandSupported(action);\n });\n return support;\n }\n }]);\n\n return Clipboard;\n}((tiny_emitter_default()));\n\n/* harmony default export */ var clipboard = (Clipboard);\n\n/***/ }),\n\n/***/ 828:\n/***/ (function(module) {\n\nvar DOCUMENT_NODE_TYPE = 9;\n\n/**\n * A polyfill for Element.matches()\n */\nif (typeof Element !== 'undefined' && !Element.prototype.matches) {\n var proto = Element.prototype;\n\n proto.matches = proto.matchesSelector ||\n proto.mozMatchesSelector ||\n proto.msMatchesSelector ||\n proto.oMatchesSelector ||\n proto.webkitMatchesSelector;\n}\n\n/**\n * Finds the closest parent that matches a selector.\n *\n * @param {Element} element\n * @param {String} selector\n * @return {Function}\n */\nfunction closest (element, selector) {\n while (element && element.nodeType !== DOCUMENT_NODE_TYPE) {\n if (typeof element.matches === 'function' &&\n element.matches(selector)) {\n return element;\n }\n element = element.parentNode;\n }\n}\n\nmodule.exports = closest;\n\n\n/***/ }),\n\n/***/ 438:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar closest = __webpack_require__(828);\n\n/**\n * Delegates event to a selector.\n *\n * @param {Element} element\n * @param {String} selector\n * @param {String} type\n * @param {Function} callback\n * @param {Boolean} useCapture\n * @return {Object}\n */\nfunction _delegate(element, selector, type, callback, useCapture) {\n var listenerFn = listener.apply(this, arguments);\n\n element.addEventListener(type, listenerFn, useCapture);\n\n return {\n destroy: function() {\n element.removeEventListener(type, listenerFn, useCapture);\n }\n }\n}\n\n/**\n * Delegates event to a selector.\n *\n * @param {Element|String|Array} [elements]\n * @param {String} selector\n * @param {String} type\n * @param {Function} callback\n * @param {Boolean} useCapture\n * @return {Object}\n */\nfunction delegate(elements, selector, type, callback, useCapture) {\n // Handle the regular Element usage\n if (typeof elements.addEventListener === 'function') {\n return _delegate.apply(null, arguments);\n }\n\n // Handle Element-less usage, it defaults to global delegation\n if (typeof type === 'function') {\n // Use `document` as the first parameter, then apply arguments\n // This is a short way to .unshift `arguments` without running into deoptimizations\n return _delegate.bind(null, document).apply(null, arguments);\n }\n\n // Handle Selector-based usage\n if (typeof elements === 'string') {\n elements = document.querySelectorAll(elements);\n }\n\n // Handle Array-like based usage\n return Array.prototype.map.call(elements, function (element) {\n return _delegate(element, selector, type, callback, useCapture);\n });\n}\n\n/**\n * Finds closest match and invokes callback.\n *\n * @param {Element} element\n * @param {String} selector\n * @param {String} type\n * @param {Function} callback\n * @return {Function}\n */\nfunction listener(element, selector, type, callback) {\n return function(e) {\n e.delegateTarget = closest(e.target, selector);\n\n if (e.delegateTarget) {\n callback.call(element, e);\n }\n }\n}\n\nmodule.exports = delegate;\n\n\n/***/ }),\n\n/***/ 879:\n/***/ (function(__unused_webpack_module, exports) {\n\n/**\n * Check if argument is a HTML element.\n *\n * @param {Object} value\n * @return {Boolean}\n */\nexports.node = function(value) {\n return value !== undefined\n && value instanceof HTMLElement\n && value.nodeType === 1;\n};\n\n/**\n * Check if argument is a list of HTML elements.\n *\n * @param {Object} value\n * @return {Boolean}\n */\nexports.nodeList = function(value) {\n var type = Object.prototype.toString.call(value);\n\n return value !== undefined\n && (type === '[object NodeList]' || type === '[object HTMLCollection]')\n && ('length' in value)\n && (value.length === 0 || exports.node(value[0]));\n};\n\n/**\n * Check if argument is a string.\n *\n * @param {Object} value\n * @return {Boolean}\n */\nexports.string = function(value) {\n return typeof value === 'string'\n || value instanceof String;\n};\n\n/**\n * Check if argument is a function.\n *\n * @param {Object} value\n * @return {Boolean}\n */\nexports.fn = function(value) {\n var type = Object.prototype.toString.call(value);\n\n return type === '[object Function]';\n};\n\n\n/***/ }),\n\n/***/ 370:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar is = __webpack_require__(879);\nvar delegate = __webpack_require__(438);\n\n/**\n * Validates all params and calls the right\n * listener function based on its target type.\n *\n * @param {String|HTMLElement|HTMLCollection|NodeList} target\n * @param {String} type\n * @param {Function} callback\n * @return {Object}\n */\nfunction listen(target, type, callback) {\n if (!target && !type && !callback) {\n throw new Error('Missing required arguments');\n }\n\n if (!is.string(type)) {\n throw new TypeError('Second argument must be a String');\n }\n\n if (!is.fn(callback)) {\n throw new TypeError('Third argument must be a Function');\n }\n\n if (is.node(target)) {\n return listenNode(target, type, callback);\n }\n else if (is.nodeList(target)) {\n return listenNodeList(target, type, callback);\n }\n else if (is.string(target)) {\n return listenSelector(target, type, callback);\n }\n else {\n throw new TypeError('First argument must be a String, HTMLElement, HTMLCollection, or NodeList');\n }\n}\n\n/**\n * Adds an event listener to a HTML element\n * and returns a remove listener function.\n *\n * @param {HTMLElement} node\n * @param {String} type\n * @param {Function} callback\n * @return {Object}\n */\nfunction listenNode(node, type, callback) {\n node.addEventListener(type, callback);\n\n return {\n destroy: function() {\n node.removeEventListener(type, callback);\n }\n }\n}\n\n/**\n * Add an event listener to a list of HTML elements\n * and returns a remove listener function.\n *\n * @param {NodeList|HTMLCollection} nodeList\n * @param {String} type\n * @param {Function} callback\n * @return {Object}\n */\nfunction listenNodeList(nodeList, type, callback) {\n Array.prototype.forEach.call(nodeList, function(node) {\n node.addEventListener(type, callback);\n });\n\n return {\n destroy: function() {\n Array.prototype.forEach.call(nodeList, function(node) {\n node.removeEventListener(type, callback);\n });\n }\n }\n}\n\n/**\n * Add an event listener to a selector\n * and returns a remove listener function.\n *\n * @param {String} selector\n * @param {String} type\n * @param {Function} callback\n * @return {Object}\n */\nfunction listenSelector(selector, type, callback) {\n return delegate(document.body, selector, type, callback);\n}\n\nmodule.exports = listen;\n\n\n/***/ }),\n\n/***/ 817:\n/***/ (function(module) {\n\nfunction select(element) {\n var selectedText;\n\n if (element.nodeName === 'SELECT') {\n element.focus();\n\n selectedText = element.value;\n }\n else if (element.nodeName === 'INPUT' || element.nodeName === 'TEXTAREA') {\n var isReadOnly = element.hasAttribute('readonly');\n\n if (!isReadOnly) {\n element.setAttribute('readonly', '');\n }\n\n element.select();\n element.setSelectionRange(0, element.value.length);\n\n if (!isReadOnly) {\n element.removeAttribute('readonly');\n }\n\n selectedText = element.value;\n }\n else {\n if (element.hasAttribute('contenteditable')) {\n element.focus();\n }\n\n var selection = window.getSelection();\n var range = document.createRange();\n\n range.selectNodeContents(element);\n selection.removeAllRanges();\n selection.addRange(range);\n\n selectedText = selection.toString();\n }\n\n return selectedText;\n}\n\nmodule.exports = select;\n\n\n/***/ }),\n\n/***/ 279:\n/***/ (function(module) {\n\nfunction E () {\n // Keep this empty so it's easier to inherit from\n // (via https://github.com/lipsmack from https://github.com/scottcorgan/tiny-emitter/issues/3)\n}\n\nE.prototype = {\n on: function (name, callback, ctx) {\n var e = this.e || (this.e = {});\n\n (e[name] || (e[name] = [])).push({\n fn: callback,\n ctx: ctx\n });\n\n return this;\n },\n\n once: function (name, callback, ctx) {\n var self = this;\n function listener () {\n self.off(name, listener);\n callback.apply(ctx, arguments);\n };\n\n listener._ = callback\n return this.on(name, listener, ctx);\n },\n\n emit: function (name) {\n var data = [].slice.call(arguments, 1);\n var evtArr = ((this.e || (this.e = {}))[name] || []).slice();\n var i = 0;\n var len = evtArr.length;\n\n for (i; i < len; i++) {\n evtArr[i].fn.apply(evtArr[i].ctx, data);\n }\n\n return this;\n },\n\n off: function (name, callback) {\n var e = this.e || (this.e = {});\n var evts = e[name];\n var liveEvents = [];\n\n if (evts && callback) {\n for (var i = 0, len = evts.length; i < len; i++) {\n if (evts[i].fn !== callback && evts[i].fn._ !== callback)\n liveEvents.push(evts[i]);\n }\n }\n\n // Remove event from queue to prevent memory leak\n // Suggested by https://github.com/lazd\n // Ref: https://github.com/scottcorgan/tiny-emitter/commit/c6ebfaa9bc973b33d110a84a307742b7cf94c953#commitcomment-5024910\n\n (liveEvents.length)\n ? e[name] = liveEvents\n : delete e[name];\n\n return this;\n }\n};\n\nmodule.exports = E;\nmodule.exports.TinyEmitter = E;\n\n\n/***/ })\n\n/******/ \t});\n/************************************************************************/\n/******/ \t// The module cache\n/******/ \tvar __webpack_module_cache__ = {};\n/******/ \t\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(__webpack_module_cache__[moduleId]) {\n/******/ \t\t\treturn __webpack_module_cache__[moduleId].exports;\n/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = __webpack_module_cache__[moduleId] = {\n/******/ \t\t\t// no module.id needed\n/******/ \t\t\t// no module.loaded needed\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/ \t\n/******/ \t\t// Execute the module function\n/******/ \t\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n/******/ \t\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/ \t\n/************************************************************************/\n/******/ \t/* webpack/runtime/compat get default export */\n/******/ \t!function() {\n/******/ \t\t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t\t__webpack_require__.n = function(module) {\n/******/ \t\t\tvar getter = module && module.__esModule ?\n/******/ \t\t\t\tfunction() { return module['default']; } :\n/******/ \t\t\t\tfunction() { return module; };\n/******/ \t\t\t__webpack_require__.d(getter, { a: getter });\n/******/ \t\t\treturn getter;\n/******/ \t\t};\n/******/ \t}();\n/******/ \t\n/******/ \t/* webpack/runtime/define property getters */\n/******/ \t!function() {\n/******/ \t\t// define getter functions for harmony exports\n/******/ \t\t__webpack_require__.d = function(exports, definition) {\n/******/ \t\t\tfor(var key in definition) {\n/******/ \t\t\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n/******/ \t\t\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n/******/ \t\t\t\t}\n/******/ \t\t\t}\n/******/ \t\t};\n/******/ \t}();\n/******/ \t\n/******/ \t/* webpack/runtime/hasOwnProperty shorthand */\n/******/ \t!function() {\n/******/ \t\t__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }\n/******/ \t}();\n/******/ \t\n/************************************************************************/\n/******/ \t// module exports must be returned from runtime so entry inlining is disabled\n/******/ \t// startup\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(686);\n/******/ })()\n.default;\n});", "/*!\n * escape-html\n * Copyright(c) 2012-2013 TJ Holowaychuk\n * Copyright(c) 2015 Andreas Lubbe\n * Copyright(c) 2015 Tiancheng \"Timothy\" Gu\n * MIT Licensed\n */\n\n'use strict';\n\n/**\n * Module variables.\n * @private\n */\n\nvar matchHtmlRegExp = /[\"'&<>]/;\n\n/**\n * Module exports.\n * @public\n */\n\nmodule.exports = escapeHtml;\n\n/**\n * Escape special characters in the given string of html.\n *\n * @param {string} string The string to escape for inserting into HTML\n * @return {string}\n * @public\n */\n\nfunction escapeHtml(string) {\n var str = '' + string;\n var match = matchHtmlRegExp.exec(str);\n\n if (!match) {\n return str;\n }\n\n var escape;\n var html = '';\n var index = 0;\n var lastIndex = 0;\n\n for (index = match.index; index < str.length; index++) {\n switch (str.charCodeAt(index)) {\n case 34: // \"\n escape = '"';\n break;\n case 38: // &\n escape = '&';\n break;\n case 39: // '\n escape = ''';\n break;\n case 60: // <\n escape = '<';\n break;\n case 62: // >\n escape = '>';\n break;\n default:\n continue;\n }\n\n if (lastIndex !== index) {\n html += str.substring(lastIndex, index);\n }\n\n lastIndex = index + 1;\n html += escape;\n }\n\n return lastIndex !== index\n ? html + str.substring(lastIndex, index)\n : html;\n}\n", "/*\n * Copyright (c) 2016-2024 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport \"focus-visible\"\n\nimport {\n EMPTY,\n NEVER,\n Observable,\n Subject,\n defer,\n delay,\n filter,\n map,\n merge,\n mergeWith,\n shareReplay,\n switchMap\n} from \"rxjs\"\n\nimport { configuration, feature } from \"./_\"\nimport {\n at,\n getActiveElement,\n getOptionalElement,\n requestJSON,\n setLocation,\n setToggle,\n watchDocument,\n watchKeyboard,\n watchLocation,\n watchLocationTarget,\n watchMedia,\n watchPrint,\n watchScript,\n watchViewport\n} from \"./browser\"\nimport {\n getComponentElement,\n getComponentElements,\n mountAnnounce,\n mountBackToTop,\n mountConsent,\n mountContent,\n mountDialog,\n mountHeader,\n mountHeaderTitle,\n mountPalette,\n mountProgress,\n mountSearch,\n mountSearchHiglight,\n mountSidebar,\n mountSource,\n mountTableOfContents,\n mountTabs,\n watchHeader,\n watchMain\n} from \"./components\"\nimport {\n SearchIndex,\n setupClipboardJS,\n setupInstantNavigation,\n setupVersionSelector\n} from \"./integrations\"\nimport {\n patchEllipsis,\n patchIndeterminate,\n patchScrollfix,\n patchScrolllock\n} from \"./patches\"\nimport \"./polyfills\"\n\n/* ----------------------------------------------------------------------------\n * Functions - @todo refactor\n * ------------------------------------------------------------------------- */\n\n/**\n * Fetch search index\n *\n * @returns Search index observable\n */\nfunction fetchSearchIndex(): Observable {\n if (location.protocol === \"file:\") {\n return watchScript(\n `${new URL(\"search/search_index.js\", config.base)}`\n )\n .pipe(\n // @ts-ignore - @todo fix typings\n map(() => __index),\n shareReplay(1)\n )\n } else {\n return requestJSON(\n new URL(\"search/search_index.json\", config.base)\n )\n }\n}\n\n/* ----------------------------------------------------------------------------\n * Application\n * ------------------------------------------------------------------------- */\n\n/* Yay, JavaScript is available */\ndocument.documentElement.classList.remove(\"no-js\")\ndocument.documentElement.classList.add(\"js\")\n\n/* Set up navigation observables and subjects */\nconst document$ = watchDocument()\nconst location$ = watchLocation()\nconst target$ = watchLocationTarget(location$)\nconst keyboard$ = watchKeyboard()\n\n/* Set up media observables */\nconst viewport$ = watchViewport()\nconst tablet$ = watchMedia(\"(min-width: 960px)\")\nconst screen$ = watchMedia(\"(min-width: 1220px)\")\nconst print$ = watchPrint()\n\n/* Retrieve search index, if search is enabled */\nconst config = configuration()\nconst index$ = document.forms.namedItem(\"search\")\n ? fetchSearchIndex()\n : NEVER\n\n/* Set up Clipboard.js integration */\nconst alert$ = new Subject()\nsetupClipboardJS({ alert$ })\n\n/* Set up progress indicator */\nconst progress$ = new Subject()\n\n/* Set up instant navigation, if enabled */\nif (feature(\"navigation.instant\"))\n setupInstantNavigation({ location$, viewport$, progress$ })\n .subscribe(document$)\n\n/* Set up version selector */\nif (config.version?.provider === \"mike\")\n setupVersionSelector({ document$ })\n\n/* Always close drawer and search on navigation */\nmerge(location$, target$)\n .pipe(\n delay(125)\n )\n .subscribe(() => {\n setToggle(\"drawer\", false)\n setToggle(\"search\", false)\n })\n\n/* Set up global keyboard handlers */\nkeyboard$\n .pipe(\n filter(({ mode }) => mode === \"global\")\n )\n .subscribe(key => {\n switch (key.type) {\n\n /* Go to previous page */\n case \"p\":\n case \",\":\n const prev = getOptionalElement(\"link[rel=prev]\")\n if (typeof prev !== \"undefined\")\n setLocation(prev)\n break\n\n /* Go to next page */\n case \"n\":\n case \".\":\n const next = getOptionalElement(\"link[rel=next]\")\n if (typeof next !== \"undefined\")\n setLocation(next)\n break\n\n /* Expand navigation, see https://bit.ly/3ZjG5io */\n case \"Enter\":\n const active = getActiveElement()\n if (active instanceof HTMLLabelElement)\n active.click()\n }\n })\n\n/* Set up patches */\npatchEllipsis({ viewport$, document$ })\npatchIndeterminate({ document$, tablet$ })\npatchScrollfix({ document$ })\npatchScrolllock({ viewport$, tablet$ })\n\n/* Set up header and main area observable */\nconst header$ = watchHeader(getComponentElement(\"header\"), { viewport$ })\nconst main$ = document$\n .pipe(\n map(() => getComponentElement(\"main\")),\n switchMap(el => watchMain(el, { viewport$, header$ })),\n shareReplay(1)\n )\n\n/* Set up control component observables */\nconst control$ = merge(\n\n /* Consent */\n ...getComponentElements(\"consent\")\n .map(el => mountConsent(el, { target$ })),\n\n /* Dialog */\n ...getComponentElements(\"dialog\")\n .map(el => mountDialog(el, { alert$ })),\n\n /* Header */\n ...getComponentElements(\"header\")\n .map(el => mountHeader(el, { viewport$, header$, main$ })),\n\n /* Color palette */\n ...getComponentElements(\"palette\")\n .map(el => mountPalette(el)),\n\n /* Progress bar */\n ...getComponentElements(\"progress\")\n .map(el => mountProgress(el, { progress$ })),\n\n /* Search */\n ...getComponentElements(\"search\")\n .map(el => mountSearch(el, { index$, keyboard$ })),\n\n /* Repository information */\n ...getComponentElements(\"source\")\n .map(el => mountSource(el))\n)\n\n/* Set up content component observables */\nconst content$ = defer(() => merge(\n\n /* Announcement bar */\n ...getComponentElements(\"announce\")\n .map(el => mountAnnounce(el)),\n\n /* Content */\n ...getComponentElements(\"content\")\n .map(el => mountContent(el, { viewport$, target$, print$ })),\n\n /* Search highlighting */\n ...getComponentElements(\"content\")\n .map(el => feature(\"search.highlight\")\n ? mountSearchHiglight(el, { index$, location$ })\n : EMPTY\n ),\n\n /* Header title */\n ...getComponentElements(\"header-title\")\n .map(el => mountHeaderTitle(el, { viewport$, header$ })),\n\n /* Sidebar */\n ...getComponentElements(\"sidebar\")\n .map(el => el.getAttribute(\"data-md-type\") === \"navigation\"\n ? at(screen$, () => mountSidebar(el, { viewport$, header$, main$ }))\n : at(tablet$, () => mountSidebar(el, { viewport$, header$, main$ }))\n ),\n\n /* Navigation tabs */\n ...getComponentElements(\"tabs\")\n .map(el => mountTabs(el, { viewport$, header$ })),\n\n /* Table of contents */\n ...getComponentElements(\"toc\")\n .map(el => mountTableOfContents(el, {\n viewport$, header$, main$, target$\n })),\n\n /* Back-to-top button */\n ...getComponentElements(\"top\")\n .map(el => mountBackToTop(el, { viewport$, header$, main$, target$ }))\n))\n\n/* Set up component observables */\nconst component$ = document$\n .pipe(\n switchMap(() => content$),\n mergeWith(control$),\n shareReplay(1)\n )\n\n/* Subscribe to all components */\ncomponent$.subscribe()\n\n/* ----------------------------------------------------------------------------\n * Exports\n * ------------------------------------------------------------------------- */\n\nwindow.document$ = document$ /* Document observable */\nwindow.location$ = location$ /* Location subject */\nwindow.target$ = target$ /* Location target observable */\nwindow.keyboard$ = keyboard$ /* Keyboard observable */\nwindow.viewport$ = viewport$ /* Viewport observable */\nwindow.tablet$ = tablet$ /* Media tablet observable */\nwindow.screen$ = screen$ /* Media screen observable */\nwindow.print$ = print$ /* Media print observable */\nwindow.alert$ = alert$ /* Alert subject */\nwindow.progress$ = progress$ /* Progress indicator subject */\nwindow.component$ = component$ /* Component observable */\n", "/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || Array.prototype.slice.call(from));\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n", "/**\n * Returns true if the object is a function.\n * @param value The value to check\n */\nexport function isFunction(value: any): value is (...args: any[]) => any {\n return typeof value === 'function';\n}\n", "/**\n * Used to create Error subclasses until the community moves away from ES5.\n *\n * This is because compiling from TypeScript down to ES5 has issues with subclassing Errors\n * as well as other built-in types: https://github.com/Microsoft/TypeScript/issues/12123\n *\n * @param createImpl A factory function to create the actual constructor implementation. The returned\n * function should be a named function that calls `_super` internally.\n */\nexport function createErrorClass(createImpl: (_super: any) => any): T {\n const _super = (instance: any) => {\n Error.call(instance);\n instance.stack = new Error().stack;\n };\n\n const ctorFunc = createImpl(_super);\n ctorFunc.prototype = Object.create(Error.prototype);\n ctorFunc.prototype.constructor = ctorFunc;\n return ctorFunc;\n}\n", "import { createErrorClass } from './createErrorClass';\n\nexport interface UnsubscriptionError extends Error {\n readonly errors: any[];\n}\n\nexport interface UnsubscriptionErrorCtor {\n /**\n * @deprecated Internal implementation detail. Do not construct error instances.\n * Cannot be tagged as internal: https://github.com/ReactiveX/rxjs/issues/6269\n */\n new (errors: any[]): UnsubscriptionError;\n}\n\n/**\n * An error thrown when one or more errors have occurred during the\n * `unsubscribe` of a {@link Subscription}.\n */\nexport const UnsubscriptionError: UnsubscriptionErrorCtor = createErrorClass(\n (_super) =>\n function UnsubscriptionErrorImpl(this: any, errors: (Error | string)[]) {\n _super(this);\n this.message = errors\n ? `${errors.length} errors occurred during unsubscription:\n${errors.map((err, i) => `${i + 1}) ${err.toString()}`).join('\\n ')}`\n : '';\n this.name = 'UnsubscriptionError';\n this.errors = errors;\n }\n);\n", "/**\n * Removes an item from an array, mutating it.\n * @param arr The array to remove the item from\n * @param item The item to remove\n */\nexport function arrRemove(arr: T[] | undefined | null, item: T) {\n if (arr) {\n const index = arr.indexOf(item);\n 0 <= index && arr.splice(index, 1);\n }\n}\n", "import { isFunction } from './util/isFunction';\nimport { UnsubscriptionError } from './util/UnsubscriptionError';\nimport { SubscriptionLike, TeardownLogic, Unsubscribable } from './types';\nimport { arrRemove } from './util/arrRemove';\n\n/**\n * Represents a disposable resource, such as the execution of an Observable. A\n * Subscription has one important method, `unsubscribe`, that takes no argument\n * and just disposes the resource held by the subscription.\n *\n * Additionally, subscriptions may be grouped together through the `add()`\n * method, which will attach a child Subscription to the current Subscription.\n * When a Subscription is unsubscribed, all its children (and its grandchildren)\n * will be unsubscribed as well.\n *\n * @class Subscription\n */\nexport class Subscription implements SubscriptionLike {\n /** @nocollapse */\n public static EMPTY = (() => {\n const empty = new Subscription();\n empty.closed = true;\n return empty;\n })();\n\n /**\n * A flag to indicate whether this Subscription has already been unsubscribed.\n */\n public closed = false;\n\n private _parentage: Subscription[] | Subscription | null = null;\n\n /**\n * The list of registered finalizers to execute upon unsubscription. Adding and removing from this\n * list occurs in the {@link #add} and {@link #remove} methods.\n */\n private _finalizers: Exclude[] | null = null;\n\n /**\n * @param initialTeardown A function executed first as part of the finalization\n * process that is kicked off when {@link #unsubscribe} is called.\n */\n constructor(private initialTeardown?: () => void) {}\n\n /**\n * Disposes the resources held by the subscription. May, for instance, cancel\n * an ongoing Observable execution or cancel any other type of work that\n * started when the Subscription was created.\n * @return {void}\n */\n unsubscribe(): void {\n let errors: any[] | undefined;\n\n if (!this.closed) {\n this.closed = true;\n\n // Remove this from it's parents.\n const { _parentage } = this;\n if (_parentage) {\n this._parentage = null;\n if (Array.isArray(_parentage)) {\n for (const parent of _parentage) {\n parent.remove(this);\n }\n } else {\n _parentage.remove(this);\n }\n }\n\n const { initialTeardown: initialFinalizer } = this;\n if (isFunction(initialFinalizer)) {\n try {\n initialFinalizer();\n } catch (e) {\n errors = e instanceof UnsubscriptionError ? e.errors : [e];\n }\n }\n\n const { _finalizers } = this;\n if (_finalizers) {\n this._finalizers = null;\n for (const finalizer of _finalizers) {\n try {\n execFinalizer(finalizer);\n } catch (err) {\n errors = errors ?? [];\n if (err instanceof UnsubscriptionError) {\n errors = [...errors, ...err.errors];\n } else {\n errors.push(err);\n }\n }\n }\n }\n\n if (errors) {\n throw new UnsubscriptionError(errors);\n }\n }\n }\n\n /**\n * Adds a finalizer to this subscription, so that finalization will be unsubscribed/called\n * when this subscription is unsubscribed. If this subscription is already {@link #closed},\n * because it has already been unsubscribed, then whatever finalizer is passed to it\n * will automatically be executed (unless the finalizer itself is also a closed subscription).\n *\n * Closed Subscriptions cannot be added as finalizers to any subscription. Adding a closed\n * subscription to a any subscription will result in no operation. (A noop).\n *\n * Adding a subscription to itself, or adding `null` or `undefined` will not perform any\n * operation at all. (A noop).\n *\n * `Subscription` instances that are added to this instance will automatically remove themselves\n * if they are unsubscribed. Functions and {@link Unsubscribable} objects that you wish to remove\n * will need to be removed manually with {@link #remove}\n *\n * @param teardown The finalization logic to add to this subscription.\n */\n add(teardown: TeardownLogic): void {\n // Only add the finalizer if it's not undefined\n // and don't add a subscription to itself.\n if (teardown && teardown !== this) {\n if (this.closed) {\n // If this subscription is already closed,\n // execute whatever finalizer is handed to it automatically.\n execFinalizer(teardown);\n } else {\n if (teardown instanceof Subscription) {\n // We don't add closed subscriptions, and we don't add the same subscription\n // twice. Subscription unsubscribe is idempotent.\n if (teardown.closed || teardown._hasParent(this)) {\n return;\n }\n teardown._addParent(this);\n }\n (this._finalizers = this._finalizers ?? []).push(teardown);\n }\n }\n }\n\n /**\n * Checks to see if a this subscription already has a particular parent.\n * This will signal that this subscription has already been added to the parent in question.\n * @param parent the parent to check for\n */\n private _hasParent(parent: Subscription) {\n const { _parentage } = this;\n return _parentage === parent || (Array.isArray(_parentage) && _parentage.includes(parent));\n }\n\n /**\n * Adds a parent to this subscription so it can be removed from the parent if it\n * unsubscribes on it's own.\n *\n * NOTE: THIS ASSUMES THAT {@link _hasParent} HAS ALREADY BEEN CHECKED.\n * @param parent The parent subscription to add\n */\n private _addParent(parent: Subscription) {\n const { _parentage } = this;\n this._parentage = Array.isArray(_parentage) ? (_parentage.push(parent), _parentage) : _parentage ? [_parentage, parent] : parent;\n }\n\n /**\n * Called on a child when it is removed via {@link #remove}.\n * @param parent The parent to remove\n */\n private _removeParent(parent: Subscription) {\n const { _parentage } = this;\n if (_parentage === parent) {\n this._parentage = null;\n } else if (Array.isArray(_parentage)) {\n arrRemove(_parentage, parent);\n }\n }\n\n /**\n * Removes a finalizer from this subscription that was previously added with the {@link #add} method.\n *\n * Note that `Subscription` instances, when unsubscribed, will automatically remove themselves\n * from every other `Subscription` they have been added to. This means that using the `remove` method\n * is not a common thing and should be used thoughtfully.\n *\n * If you add the same finalizer instance of a function or an unsubscribable object to a `Subscription` instance\n * more than once, you will need to call `remove` the same number of times to remove all instances.\n *\n * All finalizer instances are removed to free up memory upon unsubscription.\n *\n * @param teardown The finalizer to remove from this subscription\n */\n remove(teardown: Exclude): void {\n const { _finalizers } = this;\n _finalizers && arrRemove(_finalizers, teardown);\n\n if (teardown instanceof Subscription) {\n teardown._removeParent(this);\n }\n }\n}\n\nexport const EMPTY_SUBSCRIPTION = Subscription.EMPTY;\n\nexport function isSubscription(value: any): value is Subscription {\n return (\n value instanceof Subscription ||\n (value && 'closed' in value && isFunction(value.remove) && isFunction(value.add) && isFunction(value.unsubscribe))\n );\n}\n\nfunction execFinalizer(finalizer: Unsubscribable | (() => void)) {\n if (isFunction(finalizer)) {\n finalizer();\n } else {\n finalizer.unsubscribe();\n }\n}\n", "import { Subscriber } from './Subscriber';\nimport { ObservableNotification } from './types';\n\n/**\n * The {@link GlobalConfig} object for RxJS. It is used to configure things\n * like how to react on unhandled errors.\n */\nexport const config: GlobalConfig = {\n onUnhandledError: null,\n onStoppedNotification: null,\n Promise: undefined,\n useDeprecatedSynchronousErrorHandling: false,\n useDeprecatedNextContext: false,\n};\n\n/**\n * The global configuration object for RxJS, used to configure things\n * like how to react on unhandled errors. Accessible via {@link config}\n * object.\n */\nexport interface GlobalConfig {\n /**\n * A registration point for unhandled errors from RxJS. These are errors that\n * cannot were not handled by consuming code in the usual subscription path. For\n * example, if you have this configured, and you subscribe to an observable without\n * providing an error handler, errors from that subscription will end up here. This\n * will _always_ be called asynchronously on another job in the runtime. This is because\n * we do not want errors thrown in this user-configured handler to interfere with the\n * behavior of the library.\n */\n onUnhandledError: ((err: any) => void) | null;\n\n /**\n * A registration point for notifications that cannot be sent to subscribers because they\n * have completed, errored or have been explicitly unsubscribed. By default, next, complete\n * and error notifications sent to stopped subscribers are noops. However, sometimes callers\n * might want a different behavior. For example, with sources that attempt to report errors\n * to stopped subscribers, a caller can configure RxJS to throw an unhandled error instead.\n * This will _always_ be called asynchronously on another job in the runtime. This is because\n * we do not want errors thrown in this user-configured handler to interfere with the\n * behavior of the library.\n */\n onStoppedNotification: ((notification: ObservableNotification, subscriber: Subscriber) => void) | null;\n\n /**\n * The promise constructor used by default for {@link Observable#toPromise toPromise} and {@link Observable#forEach forEach}\n * methods.\n *\n * @deprecated As of version 8, RxJS will no longer support this sort of injection of a\n * Promise constructor. If you need a Promise implementation other than native promises,\n * please polyfill/patch Promise as you see appropriate. Will be removed in v8.\n */\n Promise?: PromiseConstructorLike;\n\n /**\n * If true, turns on synchronous error rethrowing, which is a deprecated behavior\n * in v6 and higher. This behavior enables bad patterns like wrapping a subscribe\n * call in a try/catch block. It also enables producer interference, a nasty bug\n * where a multicast can be broken for all observers by a downstream consumer with\n * an unhandled error. DO NOT USE THIS FLAG UNLESS IT'S NEEDED TO BUY TIME\n * FOR MIGRATION REASONS.\n *\n * @deprecated As of version 8, RxJS will no longer support synchronous throwing\n * of unhandled errors. All errors will be thrown on a separate call stack to prevent bad\n * behaviors described above. Will be removed in v8.\n */\n useDeprecatedSynchronousErrorHandling: boolean;\n\n /**\n * If true, enables an as-of-yet undocumented feature from v5: The ability to access\n * `unsubscribe()` via `this` context in `next` functions created in observers passed\n * to `subscribe`.\n *\n * This is being removed because the performance was severely problematic, and it could also cause\n * issues when types other than POJOs are passed to subscribe as subscribers, as they will likely have\n * their `this` context overwritten.\n *\n * @deprecated As of version 8, RxJS will no longer support altering the\n * context of next functions provided as part of an observer to Subscribe. Instead,\n * you will have access to a subscription or a signal or token that will allow you to do things like\n * unsubscribe and test closed status. Will be removed in v8.\n */\n useDeprecatedNextContext: boolean;\n}\n", "import type { TimerHandle } from './timerHandle';\ntype SetTimeoutFunction = (handler: () => void, timeout?: number, ...args: any[]) => TimerHandle;\ntype ClearTimeoutFunction = (handle: TimerHandle) => void;\n\ninterface TimeoutProvider {\n setTimeout: SetTimeoutFunction;\n clearTimeout: ClearTimeoutFunction;\n delegate:\n | {\n setTimeout: SetTimeoutFunction;\n clearTimeout: ClearTimeoutFunction;\n }\n | undefined;\n}\n\nexport const timeoutProvider: TimeoutProvider = {\n // When accessing the delegate, use the variable rather than `this` so that\n // the functions can be called without being bound to the provider.\n setTimeout(handler: () => void, timeout?: number, ...args) {\n const { delegate } = timeoutProvider;\n if (delegate?.setTimeout) {\n return delegate.setTimeout(handler, timeout, ...args);\n }\n return setTimeout(handler, timeout, ...args);\n },\n clearTimeout(handle) {\n const { delegate } = timeoutProvider;\n return (delegate?.clearTimeout || clearTimeout)(handle as any);\n },\n delegate: undefined,\n};\n", "import { config } from '../config';\nimport { timeoutProvider } from '../scheduler/timeoutProvider';\n\n/**\n * Handles an error on another job either with the user-configured {@link onUnhandledError},\n * or by throwing it on that new job so it can be picked up by `window.onerror`, `process.on('error')`, etc.\n *\n * This should be called whenever there is an error that is out-of-band with the subscription\n * or when an error hits a terminal boundary of the subscription and no error handler was provided.\n *\n * @param err the error to report\n */\nexport function reportUnhandledError(err: any) {\n timeoutProvider.setTimeout(() => {\n const { onUnhandledError } = config;\n if (onUnhandledError) {\n // Execute the user-configured error handler.\n onUnhandledError(err);\n } else {\n // Throw so it is picked up by the runtime's uncaught error mechanism.\n throw err;\n }\n });\n}\n", "/* tslint:disable:no-empty */\nexport function noop() { }\n", "import { CompleteNotification, NextNotification, ErrorNotification } from './types';\n\n/**\n * A completion object optimized for memory use and created to be the\n * same \"shape\" as other notifications in v8.\n * @internal\n */\nexport const COMPLETE_NOTIFICATION = (() => createNotification('C', undefined, undefined) as CompleteNotification)();\n\n/**\n * Internal use only. Creates an optimized error notification that is the same \"shape\"\n * as other notifications.\n * @internal\n */\nexport function errorNotification(error: any): ErrorNotification {\n return createNotification('E', undefined, error) as any;\n}\n\n/**\n * Internal use only. Creates an optimized next notification that is the same \"shape\"\n * as other notifications.\n * @internal\n */\nexport function nextNotification(value: T) {\n return createNotification('N', value, undefined) as NextNotification;\n}\n\n/**\n * Ensures that all notifications created internally have the same \"shape\" in v8.\n *\n * TODO: This is only exported to support a crazy legacy test in `groupBy`.\n * @internal\n */\nexport function createNotification(kind: 'N' | 'E' | 'C', value: any, error: any) {\n return {\n kind,\n value,\n error,\n };\n}\n", "import { config } from '../config';\n\nlet context: { errorThrown: boolean; error: any } | null = null;\n\n/**\n * Handles dealing with errors for super-gross mode. Creates a context, in which\n * any synchronously thrown errors will be passed to {@link captureError}. Which\n * will record the error such that it will be rethrown after the call back is complete.\n * TODO: Remove in v8\n * @param cb An immediately executed function.\n */\nexport function errorContext(cb: () => void) {\n if (config.useDeprecatedSynchronousErrorHandling) {\n const isRoot = !context;\n if (isRoot) {\n context = { errorThrown: false, error: null };\n }\n cb();\n if (isRoot) {\n const { errorThrown, error } = context!;\n context = null;\n if (errorThrown) {\n throw error;\n }\n }\n } else {\n // This is the general non-deprecated path for everyone that\n // isn't crazy enough to use super-gross mode (useDeprecatedSynchronousErrorHandling)\n cb();\n }\n}\n\n/**\n * Captures errors only in super-gross mode.\n * @param err the error to capture\n */\nexport function captureError(err: any) {\n if (config.useDeprecatedSynchronousErrorHandling && context) {\n context.errorThrown = true;\n context.error = err;\n }\n}\n", "import { isFunction } from './util/isFunction';\nimport { Observer, ObservableNotification } from './types';\nimport { isSubscription, Subscription } from './Subscription';\nimport { config } from './config';\nimport { reportUnhandledError } from './util/reportUnhandledError';\nimport { noop } from './util/noop';\nimport { nextNotification, errorNotification, COMPLETE_NOTIFICATION } from './NotificationFactories';\nimport { timeoutProvider } from './scheduler/timeoutProvider';\nimport { captureError } from './util/errorContext';\n\n/**\n * Implements the {@link Observer} interface and extends the\n * {@link Subscription} class. While the {@link Observer} is the public API for\n * consuming the values of an {@link Observable}, all Observers get converted to\n * a Subscriber, in order to provide Subscription-like capabilities such as\n * `unsubscribe`. Subscriber is a common type in RxJS, and crucial for\n * implementing operators, but it is rarely used as a public API.\n *\n * @class Subscriber\n */\nexport class Subscriber extends Subscription implements Observer {\n /**\n * A static factory for a Subscriber, given a (potentially partial) definition\n * of an Observer.\n * @param next The `next` callback of an Observer.\n * @param error The `error` callback of an\n * Observer.\n * @param complete The `complete` callback of an\n * Observer.\n * @return A Subscriber wrapping the (partially defined)\n * Observer represented by the given arguments.\n * @nocollapse\n * @deprecated Do not use. Will be removed in v8. There is no replacement for this\n * method, and there is no reason to be creating instances of `Subscriber` directly.\n * If you have a specific use case, please file an issue.\n */\n static create(next?: (x?: T) => void, error?: (e?: any) => void, complete?: () => void): Subscriber {\n return new SafeSubscriber(next, error, complete);\n }\n\n /** @deprecated Internal implementation detail, do not use directly. Will be made internal in v8. */\n protected isStopped: boolean = false;\n /** @deprecated Internal implementation detail, do not use directly. Will be made internal in v8. */\n protected destination: Subscriber | Observer; // this `any` is the escape hatch to erase extra type param (e.g. R)\n\n /**\n * @deprecated Internal implementation detail, do not use directly. Will be made internal in v8.\n * There is no reason to directly create an instance of Subscriber. This type is exported for typings reasons.\n */\n constructor(destination?: Subscriber | Observer) {\n super();\n if (destination) {\n this.destination = destination;\n // Automatically chain subscriptions together here.\n // if destination is a Subscription, then it is a Subscriber.\n if (isSubscription(destination)) {\n destination.add(this);\n }\n } else {\n this.destination = EMPTY_OBSERVER;\n }\n }\n\n /**\n * The {@link Observer} callback to receive notifications of type `next` from\n * the Observable, with a value. The Observable may call this method 0 or more\n * times.\n * @param {T} [value] The `next` value.\n * @return {void}\n */\n next(value?: T): void {\n if (this.isStopped) {\n handleStoppedNotification(nextNotification(value), this);\n } else {\n this._next(value!);\n }\n }\n\n /**\n * The {@link Observer} callback to receive notifications of type `error` from\n * the Observable, with an attached `Error`. Notifies the Observer that\n * the Observable has experienced an error condition.\n * @param {any} [err] The `error` exception.\n * @return {void}\n */\n error(err?: any): void {\n if (this.isStopped) {\n handleStoppedNotification(errorNotification(err), this);\n } else {\n this.isStopped = true;\n this._error(err);\n }\n }\n\n /**\n * The {@link Observer} callback to receive a valueless notification of type\n * `complete` from the Observable. Notifies the Observer that the Observable\n * has finished sending push-based notifications.\n * @return {void}\n */\n complete(): void {\n if (this.isStopped) {\n handleStoppedNotification(COMPLETE_NOTIFICATION, this);\n } else {\n this.isStopped = true;\n this._complete();\n }\n }\n\n unsubscribe(): void {\n if (!this.closed) {\n this.isStopped = true;\n super.unsubscribe();\n this.destination = null!;\n }\n }\n\n protected _next(value: T): void {\n this.destination.next(value);\n }\n\n protected _error(err: any): void {\n try {\n this.destination.error(err);\n } finally {\n this.unsubscribe();\n }\n }\n\n protected _complete(): void {\n try {\n this.destination.complete();\n } finally {\n this.unsubscribe();\n }\n }\n}\n\n/**\n * This bind is captured here because we want to be able to have\n * compatibility with monoid libraries that tend to use a method named\n * `bind`. In particular, a library called Monio requires this.\n */\nconst _bind = Function.prototype.bind;\n\nfunction bind any>(fn: Fn, thisArg: any): Fn {\n return _bind.call(fn, thisArg);\n}\n\n/**\n * Internal optimization only, DO NOT EXPOSE.\n * @internal\n */\nclass ConsumerObserver implements Observer {\n constructor(private partialObserver: Partial>) {}\n\n next(value: T): void {\n const { partialObserver } = this;\n if (partialObserver.next) {\n try {\n partialObserver.next(value);\n } catch (error) {\n handleUnhandledError(error);\n }\n }\n }\n\n error(err: any): void {\n const { partialObserver } = this;\n if (partialObserver.error) {\n try {\n partialObserver.error(err);\n } catch (error) {\n handleUnhandledError(error);\n }\n } else {\n handleUnhandledError(err);\n }\n }\n\n complete(): void {\n const { partialObserver } = this;\n if (partialObserver.complete) {\n try {\n partialObserver.complete();\n } catch (error) {\n handleUnhandledError(error);\n }\n }\n }\n}\n\nexport class SafeSubscriber extends Subscriber {\n constructor(\n observerOrNext?: Partial> | ((value: T) => void) | null,\n error?: ((e?: any) => void) | null,\n complete?: (() => void) | null\n ) {\n super();\n\n let partialObserver: Partial>;\n if (isFunction(observerOrNext) || !observerOrNext) {\n // The first argument is a function, not an observer. The next\n // two arguments *could* be observers, or they could be empty.\n partialObserver = {\n next: (observerOrNext ?? undefined) as (((value: T) => void) | undefined),\n error: error ?? undefined,\n complete: complete ?? undefined,\n };\n } else {\n // The first argument is a partial observer.\n let context: any;\n if (this && config.useDeprecatedNextContext) {\n // This is a deprecated path that made `this.unsubscribe()` available in\n // next handler functions passed to subscribe. This only exists behind a flag\n // now, as it is *very* slow.\n context = Object.create(observerOrNext);\n context.unsubscribe = () => this.unsubscribe();\n partialObserver = {\n next: observerOrNext.next && bind(observerOrNext.next, context),\n error: observerOrNext.error && bind(observerOrNext.error, context),\n complete: observerOrNext.complete && bind(observerOrNext.complete, context),\n };\n } else {\n // The \"normal\" path. Just use the partial observer directly.\n partialObserver = observerOrNext;\n }\n }\n\n // Wrap the partial observer to ensure it's a full observer, and\n // make sure proper error handling is accounted for.\n this.destination = new ConsumerObserver(partialObserver);\n }\n}\n\nfunction handleUnhandledError(error: any) {\n if (config.useDeprecatedSynchronousErrorHandling) {\n captureError(error);\n } else {\n // Ideal path, we report this as an unhandled error,\n // which is thrown on a new call stack.\n reportUnhandledError(error);\n }\n}\n\n/**\n * An error handler used when no error handler was supplied\n * to the SafeSubscriber -- meaning no error handler was supplied\n * do the `subscribe` call on our observable.\n * @param err The error to handle\n */\nfunction defaultErrorHandler(err: any) {\n throw err;\n}\n\n/**\n * A handler for notifications that cannot be sent to a stopped subscriber.\n * @param notification The notification being sent\n * @param subscriber The stopped subscriber\n */\nfunction handleStoppedNotification(notification: ObservableNotification, subscriber: Subscriber) {\n const { onStoppedNotification } = config;\n onStoppedNotification && timeoutProvider.setTimeout(() => onStoppedNotification(notification, subscriber));\n}\n\n/**\n * The observer used as a stub for subscriptions where the user did not\n * pass any arguments to `subscribe`. Comes with the default error handling\n * behavior.\n */\nexport const EMPTY_OBSERVER: Readonly> & { closed: true } = {\n closed: true,\n next: noop,\n error: defaultErrorHandler,\n complete: noop,\n};\n", "/**\n * Symbol.observable or a string \"@@observable\". Used for interop\n *\n * @deprecated We will no longer be exporting this symbol in upcoming versions of RxJS.\n * Instead polyfill and use Symbol.observable directly *or* use https://www.npmjs.com/package/symbol-observable\n */\nexport const observable: string | symbol = (() => (typeof Symbol === 'function' && Symbol.observable) || '@@observable')();\n", "/**\n * This function takes one parameter and just returns it. Simply put,\n * this is like `(x: T): T => x`.\n *\n * ## Examples\n *\n * This is useful in some cases when using things like `mergeMap`\n *\n * ```ts\n * import { interval, take, map, range, mergeMap, identity } from 'rxjs';\n *\n * const source$ = interval(1000).pipe(take(5));\n *\n * const result$ = source$.pipe(\n * map(i => range(i)),\n * mergeMap(identity) // same as mergeMap(x => x)\n * );\n *\n * result$.subscribe({\n * next: console.log\n * });\n * ```\n *\n * Or when you want to selectively apply an operator\n *\n * ```ts\n * import { interval, take, identity } from 'rxjs';\n *\n * const shouldLimit = () => Math.random() < 0.5;\n *\n * const source$ = interval(1000);\n *\n * const result$ = source$.pipe(shouldLimit() ? take(5) : identity);\n *\n * result$.subscribe({\n * next: console.log\n * });\n * ```\n *\n * @param x Any value that is returned by this function\n * @returns The value passed as the first parameter to this function\n */\nexport function identity(x: T): T {\n return x;\n}\n", "import { identity } from './identity';\nimport { UnaryFunction } from '../types';\n\nexport function pipe(): typeof identity;\nexport function pipe(fn1: UnaryFunction): UnaryFunction;\nexport function pipe(fn1: UnaryFunction, fn2: UnaryFunction): UnaryFunction;\nexport function pipe(fn1: UnaryFunction, fn2: UnaryFunction, fn3: UnaryFunction): UnaryFunction;\nexport function pipe(\n fn1: UnaryFunction,\n fn2: UnaryFunction,\n fn3: UnaryFunction,\n fn4: UnaryFunction\n): UnaryFunction;\nexport function pipe(\n fn1: UnaryFunction,\n fn2: UnaryFunction,\n fn3: UnaryFunction,\n fn4: UnaryFunction,\n fn5: UnaryFunction\n): UnaryFunction;\nexport function pipe(\n fn1: UnaryFunction,\n fn2: UnaryFunction,\n fn3: UnaryFunction,\n fn4: UnaryFunction,\n fn5: UnaryFunction,\n fn6: UnaryFunction\n): UnaryFunction;\nexport function pipe(\n fn1: UnaryFunction,\n fn2: UnaryFunction,\n fn3: UnaryFunction,\n fn4: UnaryFunction,\n fn5: UnaryFunction,\n fn6: UnaryFunction,\n fn7: UnaryFunction\n): UnaryFunction;\nexport function pipe(\n fn1: UnaryFunction,\n fn2: UnaryFunction,\n fn3: UnaryFunction,\n fn4: UnaryFunction,\n fn5: UnaryFunction,\n fn6: UnaryFunction,\n fn7: UnaryFunction,\n fn8: UnaryFunction\n): UnaryFunction;\nexport function pipe(\n fn1: UnaryFunction,\n fn2: UnaryFunction,\n fn3: UnaryFunction,\n fn4: UnaryFunction,\n fn5: UnaryFunction,\n fn6: UnaryFunction,\n fn7: UnaryFunction,\n fn8: UnaryFunction,\n fn9: UnaryFunction\n): UnaryFunction;\nexport function pipe(\n fn1: UnaryFunction,\n fn2: UnaryFunction,\n fn3: UnaryFunction,\n fn4: UnaryFunction,\n fn5: UnaryFunction,\n fn6: UnaryFunction,\n fn7: UnaryFunction,\n fn8: UnaryFunction,\n fn9: UnaryFunction,\n ...fns: UnaryFunction[]\n): UnaryFunction;\n\n/**\n * pipe() can be called on one or more functions, each of which can take one argument (\"UnaryFunction\")\n * and uses it to return a value.\n * It returns a function that takes one argument, passes it to the first UnaryFunction, and then\n * passes the result to the next one, passes that result to the next one, and so on. \n */\nexport function pipe(...fns: Array>): UnaryFunction {\n return pipeFromArray(fns);\n}\n\n/** @internal */\nexport function pipeFromArray(fns: Array>): UnaryFunction {\n if (fns.length === 0) {\n return identity as UnaryFunction;\n }\n\n if (fns.length === 1) {\n return fns[0];\n }\n\n return function piped(input: T): R {\n return fns.reduce((prev: any, fn: UnaryFunction) => fn(prev), input as any);\n };\n}\n", "import { Operator } from './Operator';\nimport { SafeSubscriber, Subscriber } from './Subscriber';\nimport { isSubscription, Subscription } from './Subscription';\nimport { TeardownLogic, OperatorFunction, Subscribable, Observer } from './types';\nimport { observable as Symbol_observable } from './symbol/observable';\nimport { pipeFromArray } from './util/pipe';\nimport { config } from './config';\nimport { isFunction } from './util/isFunction';\nimport { errorContext } from './util/errorContext';\n\n/**\n * A representation of any set of values over any amount of time. This is the most basic building block\n * of RxJS.\n *\n * @class Observable\n */\nexport class Observable implements Subscribable {\n /**\n * @deprecated Internal implementation detail, do not use directly. Will be made internal in v8.\n */\n source: Observable | undefined;\n\n /**\n * @deprecated Internal implementation detail, do not use directly. Will be made internal in v8.\n */\n operator: Operator | undefined;\n\n /**\n * @constructor\n * @param {Function} subscribe the function that is called when the Observable is\n * initially subscribed to. This function is given a Subscriber, to which new values\n * can be `next`ed, or an `error` method can be called to raise an error, or\n * `complete` can be called to notify of a successful completion.\n */\n constructor(subscribe?: (this: Observable, subscriber: Subscriber) => TeardownLogic) {\n if (subscribe) {\n this._subscribe = subscribe;\n }\n }\n\n // HACK: Since TypeScript inherits static properties too, we have to\n // fight against TypeScript here so Subject can have a different static create signature\n /**\n * Creates a new Observable by calling the Observable constructor\n * @owner Observable\n * @method create\n * @param {Function} subscribe? the subscriber function to be passed to the Observable constructor\n * @return {Observable} a new observable\n * @nocollapse\n * @deprecated Use `new Observable()` instead. Will be removed in v8.\n */\n static create: (...args: any[]) => any = (subscribe?: (subscriber: Subscriber) => TeardownLogic) => {\n return new Observable(subscribe);\n };\n\n /**\n * Creates a new Observable, with this Observable instance as the source, and the passed\n * operator defined as the new observable's operator.\n * @method lift\n * @param operator the operator defining the operation to take on the observable\n * @return a new observable with the Operator applied\n * @deprecated Internal implementation detail, do not use directly. Will be made internal in v8.\n * If you have implemented an operator using `lift`, it is recommended that you create an\n * operator by simply returning `new Observable()` directly. See \"Creating new operators from\n * scratch\" section here: https://rxjs.dev/guide/operators\n */\n lift(operator?: Operator): Observable {\n const observable = new Observable();\n observable.source = this;\n observable.operator = operator;\n return observable;\n }\n\n subscribe(observerOrNext?: Partial> | ((value: T) => void)): Subscription;\n /** @deprecated Instead of passing separate callback arguments, use an observer argument. Signatures taking separate callback arguments will be removed in v8. Details: https://rxjs.dev/deprecations/subscribe-arguments */\n subscribe(next?: ((value: T) => void) | null, error?: ((error: any) => void) | null, complete?: (() => void) | null): Subscription;\n /**\n * Invokes an execution of an Observable and registers Observer handlers for notifications it will emit.\n *\n * Use it when you have all these Observables, but still nothing is happening.\n *\n * `subscribe` is not a regular operator, but a method that calls Observable's internal `subscribe` function. It\n * might be for example a function that you passed to Observable's constructor, but most of the time it is\n * a library implementation, which defines what will be emitted by an Observable, and when it be will emitted. This means\n * that calling `subscribe` is actually the moment when Observable starts its work, not when it is created, as it is often\n * the thought.\n *\n * Apart from starting the execution of an Observable, this method allows you to listen for values\n * that an Observable emits, as well as for when it completes or errors. You can achieve this in two\n * of the following ways.\n *\n * The first way is creating an object that implements {@link Observer} interface. It should have methods\n * defined by that interface, but note that it should be just a regular JavaScript object, which you can create\n * yourself in any way you want (ES6 class, classic function constructor, object literal etc.). In particular, do\n * not attempt to use any RxJS implementation details to create Observers - you don't need them. Remember also\n * that your object does not have to implement all methods. If you find yourself creating a method that doesn't\n * do anything, you can simply omit it. Note however, if the `error` method is not provided and an error happens,\n * it will be thrown asynchronously. Errors thrown asynchronously cannot be caught using `try`/`catch`. Instead,\n * use the {@link onUnhandledError} configuration option or use a runtime handler (like `window.onerror` or\n * `process.on('error)`) to be notified of unhandled errors. Because of this, it's recommended that you provide\n * an `error` method to avoid missing thrown errors.\n *\n * The second way is to give up on Observer object altogether and simply provide callback functions in place of its methods.\n * This means you can provide three functions as arguments to `subscribe`, where the first function is equivalent\n * of a `next` method, the second of an `error` method and the third of a `complete` method. Just as in case of an Observer,\n * if you do not need to listen for something, you can omit a function by passing `undefined` or `null`,\n * since `subscribe` recognizes these functions by where they were placed in function call. When it comes\n * to the `error` function, as with an Observer, if not provided, errors emitted by an Observable will be thrown asynchronously.\n *\n * You can, however, subscribe with no parameters at all. This may be the case where you're not interested in terminal events\n * and you also handled emissions internally by using operators (e.g. using `tap`).\n *\n * Whichever style of calling `subscribe` you use, in both cases it returns a Subscription object.\n * This object allows you to call `unsubscribe` on it, which in turn will stop the work that an Observable does and will clean\n * up all resources that an Observable used. Note that cancelling a subscription will not call `complete` callback\n * provided to `subscribe` function, which is reserved for a regular completion signal that comes from an Observable.\n *\n * Remember that callbacks provided to `subscribe` are not guaranteed to be called asynchronously.\n * It is an Observable itself that decides when these functions will be called. For example {@link of}\n * by default emits all its values synchronously. Always check documentation for how given Observable\n * will behave when subscribed and if its default behavior can be modified with a `scheduler`.\n *\n * #### Examples\n *\n * Subscribe with an {@link guide/observer Observer}\n *\n * ```ts\n * import { of } from 'rxjs';\n *\n * const sumObserver = {\n * sum: 0,\n * next(value) {\n * console.log('Adding: ' + value);\n * this.sum = this.sum + value;\n * },\n * error() {\n * // We actually could just remove this method,\n * // since we do not really care about errors right now.\n * },\n * complete() {\n * console.log('Sum equals: ' + this.sum);\n * }\n * };\n *\n * of(1, 2, 3) // Synchronously emits 1, 2, 3 and then completes.\n * .subscribe(sumObserver);\n *\n * // Logs:\n * // 'Adding: 1'\n * // 'Adding: 2'\n * // 'Adding: 3'\n * // 'Sum equals: 6'\n * ```\n *\n * Subscribe with functions ({@link deprecations/subscribe-arguments deprecated})\n *\n * ```ts\n * import { of } from 'rxjs'\n *\n * let sum = 0;\n *\n * of(1, 2, 3).subscribe(\n * value => {\n * console.log('Adding: ' + value);\n * sum = sum + value;\n * },\n * undefined,\n * () => console.log('Sum equals: ' + sum)\n * );\n *\n * // Logs:\n * // 'Adding: 1'\n * // 'Adding: 2'\n * // 'Adding: 3'\n * // 'Sum equals: 6'\n * ```\n *\n * Cancel a subscription\n *\n * ```ts\n * import { interval } from 'rxjs';\n *\n * const subscription = interval(1000).subscribe({\n * next(num) {\n * console.log(num)\n * },\n * complete() {\n * // Will not be called, even when cancelling subscription.\n * console.log('completed!');\n * }\n * });\n *\n * setTimeout(() => {\n * subscription.unsubscribe();\n * console.log('unsubscribed!');\n * }, 2500);\n *\n * // Logs:\n * // 0 after 1s\n * // 1 after 2s\n * // 'unsubscribed!' after 2.5s\n * ```\n *\n * @param {Observer|Function} observerOrNext (optional) Either an observer with methods to be called,\n * or the first of three possible handlers, which is the handler for each value emitted from the subscribed\n * Observable.\n * @param {Function} error (optional) A handler for a terminal event resulting from an error. If no error handler is provided,\n * the error will be thrown asynchronously as unhandled.\n * @param {Function} complete (optional) A handler for a terminal event resulting from successful completion.\n * @return {Subscription} a subscription reference to the registered handlers\n * @method subscribe\n */\n subscribe(\n observerOrNext?: Partial> | ((value: T) => void) | null,\n error?: ((error: any) => void) | null,\n complete?: (() => void) | null\n ): Subscription {\n const subscriber = isSubscriber(observerOrNext) ? observerOrNext : new SafeSubscriber(observerOrNext, error, complete);\n\n errorContext(() => {\n const { operator, source } = this;\n subscriber.add(\n operator\n ? // We're dealing with a subscription in the\n // operator chain to one of our lifted operators.\n operator.call(subscriber, source)\n : source\n ? // If `source` has a value, but `operator` does not, something that\n // had intimate knowledge of our API, like our `Subject`, must have\n // set it. We're going to just call `_subscribe` directly.\n this._subscribe(subscriber)\n : // In all other cases, we're likely wrapping a user-provided initializer\n // function, so we need to catch errors and handle them appropriately.\n this._trySubscribe(subscriber)\n );\n });\n\n return subscriber;\n }\n\n /** @internal */\n protected _trySubscribe(sink: Subscriber): TeardownLogic {\n try {\n return this._subscribe(sink);\n } catch (err) {\n // We don't need to return anything in this case,\n // because it's just going to try to `add()` to a subscription\n // above.\n sink.error(err);\n }\n }\n\n /**\n * Used as a NON-CANCELLABLE means of subscribing to an observable, for use with\n * APIs that expect promises, like `async/await`. You cannot unsubscribe from this.\n *\n * **WARNING**: Only use this with observables you *know* will complete. If the source\n * observable does not complete, you will end up with a promise that is hung up, and\n * potentially all of the state of an async function hanging out in memory. To avoid\n * this situation, look into adding something like {@link timeout}, {@link take},\n * {@link takeWhile}, or {@link takeUntil} amongst others.\n *\n * #### Example\n *\n * ```ts\n * import { interval, take } from 'rxjs';\n *\n * const source$ = interval(1000).pipe(take(4));\n *\n * async function getTotal() {\n * let total = 0;\n *\n * await source$.forEach(value => {\n * total += value;\n * console.log('observable -> ' + value);\n * });\n *\n * return total;\n * }\n *\n * getTotal().then(\n * total => console.log('Total: ' + total)\n * );\n *\n * // Expected:\n * // 'observable -> 0'\n * // 'observable -> 1'\n * // 'observable -> 2'\n * // 'observable -> 3'\n * // 'Total: 6'\n * ```\n *\n * @param next a handler for each value emitted by the observable\n * @return a promise that either resolves on observable completion or\n * rejects with the handled error\n */\n forEach(next: (value: T) => void): Promise;\n\n /**\n * @param next a handler for each value emitted by the observable\n * @param promiseCtor a constructor function used to instantiate the Promise\n * @return a promise that either resolves on observable completion or\n * rejects with the handled error\n * @deprecated Passing a Promise constructor will no longer be available\n * in upcoming versions of RxJS. This is because it adds weight to the library, for very\n * little benefit. If you need this functionality, it is recommended that you either\n * polyfill Promise, or you create an adapter to convert the returned native promise\n * to whatever promise implementation you wanted. Will be removed in v8.\n */\n forEach(next: (value: T) => void, promiseCtor: PromiseConstructorLike): Promise;\n\n forEach(next: (value: T) => void, promiseCtor?: PromiseConstructorLike): Promise {\n promiseCtor = getPromiseCtor(promiseCtor);\n\n return new promiseCtor((resolve, reject) => {\n const subscriber = new SafeSubscriber({\n next: (value) => {\n try {\n next(value);\n } catch (err) {\n reject(err);\n subscriber.unsubscribe();\n }\n },\n error: reject,\n complete: resolve,\n });\n this.subscribe(subscriber);\n }) as Promise;\n }\n\n /** @internal */\n protected _subscribe(subscriber: Subscriber): TeardownLogic {\n return this.source?.subscribe(subscriber);\n }\n\n /**\n * An interop point defined by the es7-observable spec https://github.com/zenparsing/es-observable\n * @method Symbol.observable\n * @return {Observable} this instance of the observable\n */\n [Symbol_observable]() {\n return this;\n }\n\n /* tslint:disable:max-line-length */\n pipe(): Observable;\n pipe(op1: OperatorFunction): Observable;\n pipe(op1: OperatorFunction, op2: OperatorFunction): Observable;\n pipe(op1: OperatorFunction, op2: OperatorFunction, op3: OperatorFunction): Observable;\n pipe(\n op1: OperatorFunction,\n op2: OperatorFunction,\n op3: OperatorFunction,\n op4: OperatorFunction\n ): Observable;\n pipe(\n op1: OperatorFunction,\n op2: OperatorFunction,\n op3: OperatorFunction,\n op4: OperatorFunction,\n op5: OperatorFunction\n ): Observable;\n pipe(\n op1: OperatorFunction,\n op2: OperatorFunction,\n op3: OperatorFunction,\n op4: OperatorFunction,\n op5: OperatorFunction,\n op6: OperatorFunction\n ): Observable;\n pipe(\n op1: OperatorFunction,\n op2: OperatorFunction,\n op3: OperatorFunction,\n op4: OperatorFunction,\n op5: OperatorFunction,\n op6: OperatorFunction,\n op7: OperatorFunction\n ): Observable;\n pipe(\n op1: OperatorFunction,\n op2: OperatorFunction,\n op3: OperatorFunction,\n op4: OperatorFunction,\n op5: OperatorFunction,\n op6: OperatorFunction,\n op7: OperatorFunction,\n op8: OperatorFunction\n ): Observable;\n pipe(\n op1: OperatorFunction,\n op2: OperatorFunction,\n op3: OperatorFunction,\n op4: OperatorFunction,\n op5: OperatorFunction,\n op6: OperatorFunction,\n op7: OperatorFunction,\n op8: OperatorFunction,\n op9: OperatorFunction\n ): Observable;\n pipe(\n op1: OperatorFunction,\n op2: OperatorFunction,\n op3: OperatorFunction,\n op4: OperatorFunction,\n op5: OperatorFunction,\n op6: OperatorFunction,\n op7: OperatorFunction,\n op8: OperatorFunction,\n op9: OperatorFunction,\n ...operations: OperatorFunction[]\n ): Observable;\n /* tslint:enable:max-line-length */\n\n /**\n * Used to stitch together functional operators into a chain.\n * @method pipe\n * @return {Observable} the Observable result of all of the operators having\n * been called in the order they were passed in.\n *\n * ## Example\n *\n * ```ts\n * import { interval, filter, map, scan } from 'rxjs';\n *\n * interval(1000)\n * .pipe(\n * filter(x => x % 2 === 0),\n * map(x => x + x),\n * scan((acc, x) => acc + x)\n * )\n * .subscribe(x => console.log(x));\n * ```\n */\n pipe(...operations: OperatorFunction[]): Observable {\n return pipeFromArray(operations)(this);\n }\n\n /* tslint:disable:max-line-length */\n /** @deprecated Replaced with {@link firstValueFrom} and {@link lastValueFrom}. Will be removed in v8. Details: https://rxjs.dev/deprecations/to-promise */\n toPromise(): Promise;\n /** @deprecated Replaced with {@link firstValueFrom} and {@link lastValueFrom}. Will be removed in v8. Details: https://rxjs.dev/deprecations/to-promise */\n toPromise(PromiseCtor: typeof Promise): Promise;\n /** @deprecated Replaced with {@link firstValueFrom} and {@link lastValueFrom}. Will be removed in v8. Details: https://rxjs.dev/deprecations/to-promise */\n toPromise(PromiseCtor: PromiseConstructorLike): Promise;\n /* tslint:enable:max-line-length */\n\n /**\n * Subscribe to this Observable and get a Promise resolving on\n * `complete` with the last emission (if any).\n *\n * **WARNING**: Only use this with observables you *know* will complete. If the source\n * observable does not complete, you will end up with a promise that is hung up, and\n * potentially all of the state of an async function hanging out in memory. To avoid\n * this situation, look into adding something like {@link timeout}, {@link take},\n * {@link takeWhile}, or {@link takeUntil} amongst others.\n *\n * @method toPromise\n * @param [promiseCtor] a constructor function used to instantiate\n * the Promise\n * @return A Promise that resolves with the last value emit, or\n * rejects on an error. If there were no emissions, Promise\n * resolves with undefined.\n * @deprecated Replaced with {@link firstValueFrom} and {@link lastValueFrom}. Will be removed in v8. Details: https://rxjs.dev/deprecations/to-promise\n */\n toPromise(promiseCtor?: PromiseConstructorLike): Promise {\n promiseCtor = getPromiseCtor(promiseCtor);\n\n return new promiseCtor((resolve, reject) => {\n let value: T | undefined;\n this.subscribe(\n (x: T) => (value = x),\n (err: any) => reject(err),\n () => resolve(value)\n );\n }) as Promise;\n }\n}\n\n/**\n * Decides between a passed promise constructor from consuming code,\n * A default configured promise constructor, and the native promise\n * constructor and returns it. If nothing can be found, it will throw\n * an error.\n * @param promiseCtor The optional promise constructor to passed by consuming code\n */\nfunction getPromiseCtor(promiseCtor: PromiseConstructorLike | undefined) {\n return promiseCtor ?? config.Promise ?? Promise;\n}\n\nfunction isObserver(value: any): value is Observer {\n return value && isFunction(value.next) && isFunction(value.error) && isFunction(value.complete);\n}\n\nfunction isSubscriber(value: any): value is Subscriber {\n return (value && value instanceof Subscriber) || (isObserver(value) && isSubscription(value));\n}\n", "import { Observable } from '../Observable';\nimport { Subscriber } from '../Subscriber';\nimport { OperatorFunction } from '../types';\nimport { isFunction } from './isFunction';\n\n/**\n * Used to determine if an object is an Observable with a lift function.\n */\nexport function hasLift(source: any): source is { lift: InstanceType['lift'] } {\n return isFunction(source?.lift);\n}\n\n/**\n * Creates an `OperatorFunction`. Used to define operators throughout the library in a concise way.\n * @param init The logic to connect the liftedSource to the subscriber at the moment of subscription.\n */\nexport function operate(\n init: (liftedSource: Observable, subscriber: Subscriber) => (() => void) | void\n): OperatorFunction {\n return (source: Observable) => {\n if (hasLift(source)) {\n return source.lift(function (this: Subscriber, liftedSource: Observable) {\n try {\n return init(liftedSource, this);\n } catch (err) {\n this.error(err);\n }\n });\n }\n throw new TypeError('Unable to lift unknown Observable type');\n };\n}\n", "import { Subscriber } from '../Subscriber';\n\n/**\n * Creates an instance of an `OperatorSubscriber`.\n * @param destination The downstream subscriber.\n * @param onNext Handles next values, only called if this subscriber is not stopped or closed. Any\n * error that occurs in this function is caught and sent to the `error` method of this subscriber.\n * @param onError Handles errors from the subscription, any errors that occur in this handler are caught\n * and send to the `destination` error handler.\n * @param onComplete Handles completion notification from the subscription. Any errors that occur in\n * this handler are sent to the `destination` error handler.\n * @param onFinalize Additional teardown logic here. This will only be called on teardown if the\n * subscriber itself is not already closed. This is called after all other teardown logic is executed.\n */\nexport function createOperatorSubscriber(\n destination: Subscriber,\n onNext?: (value: T) => void,\n onComplete?: () => void,\n onError?: (err: any) => void,\n onFinalize?: () => void\n): Subscriber {\n return new OperatorSubscriber(destination, onNext, onComplete, onError, onFinalize);\n}\n\n/**\n * A generic helper for allowing operators to be created with a Subscriber and\n * use closures to capture necessary state from the operator function itself.\n */\nexport class OperatorSubscriber extends Subscriber {\n /**\n * Creates an instance of an `OperatorSubscriber`.\n * @param destination The downstream subscriber.\n * @param onNext Handles next values, only called if this subscriber is not stopped or closed. Any\n * error that occurs in this function is caught and sent to the `error` method of this subscriber.\n * @param onError Handles errors from the subscription, any errors that occur in this handler are caught\n * and send to the `destination` error handler.\n * @param onComplete Handles completion notification from the subscription. Any errors that occur in\n * this handler are sent to the `destination` error handler.\n * @param onFinalize Additional finalization logic here. This will only be called on finalization if the\n * subscriber itself is not already closed. This is called after all other finalization logic is executed.\n * @param shouldUnsubscribe An optional check to see if an unsubscribe call should truly unsubscribe.\n * NOTE: This currently **ONLY** exists to support the strange behavior of {@link groupBy}, where unsubscription\n * to the resulting observable does not actually disconnect from the source if there are active subscriptions\n * to any grouped observable. (DO NOT EXPOSE OR USE EXTERNALLY!!!)\n */\n constructor(\n destination: Subscriber,\n onNext?: (value: T) => void,\n onComplete?: () => void,\n onError?: (err: any) => void,\n private onFinalize?: () => void,\n private shouldUnsubscribe?: () => boolean\n ) {\n // It's important - for performance reasons - that all of this class's\n // members are initialized and that they are always initialized in the same\n // order. This will ensure that all OperatorSubscriber instances have the\n // same hidden class in V8. This, in turn, will help keep the number of\n // hidden classes involved in property accesses within the base class as\n // low as possible. If the number of hidden classes involved exceeds four,\n // the property accesses will become megamorphic and performance penalties\n // will be incurred - i.e. inline caches won't be used.\n //\n // The reasons for ensuring all instances have the same hidden class are\n // further discussed in this blog post from Benedikt Meurer:\n // https://benediktmeurer.de/2018/03/23/impact-of-polymorphism-on-component-based-frameworks-like-react/\n super(destination);\n this._next = onNext\n ? function (this: OperatorSubscriber, value: T) {\n try {\n onNext(value);\n } catch (err) {\n destination.error(err);\n }\n }\n : super._next;\n this._error = onError\n ? function (this: OperatorSubscriber, err: any) {\n try {\n onError(err);\n } catch (err) {\n // Send any errors that occur down stream.\n destination.error(err);\n } finally {\n // Ensure finalization.\n this.unsubscribe();\n }\n }\n : super._error;\n this._complete = onComplete\n ? function (this: OperatorSubscriber) {\n try {\n onComplete();\n } catch (err) {\n // Send any errors that occur down stream.\n destination.error(err);\n } finally {\n // Ensure finalization.\n this.unsubscribe();\n }\n }\n : super._complete;\n }\n\n unsubscribe() {\n if (!this.shouldUnsubscribe || this.shouldUnsubscribe()) {\n const { closed } = this;\n super.unsubscribe();\n // Execute additional teardown if we have any and we didn't already do so.\n !closed && this.onFinalize?.();\n }\n }\n}\n", "import { Subscription } from '../Subscription';\n\ninterface AnimationFrameProvider {\n schedule(callback: FrameRequestCallback): Subscription;\n requestAnimationFrame: typeof requestAnimationFrame;\n cancelAnimationFrame: typeof cancelAnimationFrame;\n delegate:\n | {\n requestAnimationFrame: typeof requestAnimationFrame;\n cancelAnimationFrame: typeof cancelAnimationFrame;\n }\n | undefined;\n}\n\nexport const animationFrameProvider: AnimationFrameProvider = {\n // When accessing the delegate, use the variable rather than `this` so that\n // the functions can be called without being bound to the provider.\n schedule(callback) {\n let request = requestAnimationFrame;\n let cancel: typeof cancelAnimationFrame | undefined = cancelAnimationFrame;\n const { delegate } = animationFrameProvider;\n if (delegate) {\n request = delegate.requestAnimationFrame;\n cancel = delegate.cancelAnimationFrame;\n }\n const handle = request((timestamp) => {\n // Clear the cancel function. The request has been fulfilled, so\n // attempting to cancel the request upon unsubscription would be\n // pointless.\n cancel = undefined;\n callback(timestamp);\n });\n return new Subscription(() => cancel?.(handle));\n },\n requestAnimationFrame(...args) {\n const { delegate } = animationFrameProvider;\n return (delegate?.requestAnimationFrame || requestAnimationFrame)(...args);\n },\n cancelAnimationFrame(...args) {\n const { delegate } = animationFrameProvider;\n return (delegate?.cancelAnimationFrame || cancelAnimationFrame)(...args);\n },\n delegate: undefined,\n};\n", "import { createErrorClass } from './createErrorClass';\n\nexport interface ObjectUnsubscribedError extends Error {}\n\nexport interface ObjectUnsubscribedErrorCtor {\n /**\n * @deprecated Internal implementation detail. Do not construct error instances.\n * Cannot be tagged as internal: https://github.com/ReactiveX/rxjs/issues/6269\n */\n new (): ObjectUnsubscribedError;\n}\n\n/**\n * An error thrown when an action is invalid because the object has been\n * unsubscribed.\n *\n * @see {@link Subject}\n * @see {@link BehaviorSubject}\n *\n * @class ObjectUnsubscribedError\n */\nexport const ObjectUnsubscribedError: ObjectUnsubscribedErrorCtor = createErrorClass(\n (_super) =>\n function ObjectUnsubscribedErrorImpl(this: any) {\n _super(this);\n this.name = 'ObjectUnsubscribedError';\n this.message = 'object unsubscribed';\n }\n);\n", "import { Operator } from './Operator';\nimport { Observable } from './Observable';\nimport { Subscriber } from './Subscriber';\nimport { Subscription, EMPTY_SUBSCRIPTION } from './Subscription';\nimport { Observer, SubscriptionLike, TeardownLogic } from './types';\nimport { ObjectUnsubscribedError } from './util/ObjectUnsubscribedError';\nimport { arrRemove } from './util/arrRemove';\nimport { errorContext } from './util/errorContext';\n\n/**\n * A Subject is a special type of Observable that allows values to be\n * multicasted to many Observers. Subjects are like EventEmitters.\n *\n * Every Subject is an Observable and an Observer. You can subscribe to a\n * Subject, and you can call next to feed values as well as error and complete.\n */\nexport class Subject extends Observable implements SubscriptionLike {\n closed = false;\n\n private currentObservers: Observer[] | null = null;\n\n /** @deprecated Internal implementation detail, do not use directly. Will be made internal in v8. */\n observers: Observer[] = [];\n /** @deprecated Internal implementation detail, do not use directly. Will be made internal in v8. */\n isStopped = false;\n /** @deprecated Internal implementation detail, do not use directly. Will be made internal in v8. */\n hasError = false;\n /** @deprecated Internal implementation detail, do not use directly. Will be made internal in v8. */\n thrownError: any = null;\n\n /**\n * Creates a \"subject\" by basically gluing an observer to an observable.\n *\n * @nocollapse\n * @deprecated Recommended you do not use. Will be removed at some point in the future. Plans for replacement still under discussion.\n */\n static create: (...args: any[]) => any = (destination: Observer, source: Observable): AnonymousSubject => {\n return new AnonymousSubject(destination, source);\n };\n\n constructor() {\n // NOTE: This must be here to obscure Observable's constructor.\n super();\n }\n\n /** @deprecated Internal implementation detail, do not use directly. Will be made internal in v8. */\n lift(operator: Operator): Observable {\n const subject = new AnonymousSubject(this, this);\n subject.operator = operator as any;\n return subject as any;\n }\n\n /** @internal */\n protected _throwIfClosed() {\n if (this.closed) {\n throw new ObjectUnsubscribedError();\n }\n }\n\n next(value: T) {\n errorContext(() => {\n this._throwIfClosed();\n if (!this.isStopped) {\n if (!this.currentObservers) {\n this.currentObservers = Array.from(this.observers);\n }\n for (const observer of this.currentObservers) {\n observer.next(value);\n }\n }\n });\n }\n\n error(err: any) {\n errorContext(() => {\n this._throwIfClosed();\n if (!this.isStopped) {\n this.hasError = this.isStopped = true;\n this.thrownError = err;\n const { observers } = this;\n while (observers.length) {\n observers.shift()!.error(err);\n }\n }\n });\n }\n\n complete() {\n errorContext(() => {\n this._throwIfClosed();\n if (!this.isStopped) {\n this.isStopped = true;\n const { observers } = this;\n while (observers.length) {\n observers.shift()!.complete();\n }\n }\n });\n }\n\n unsubscribe() {\n this.isStopped = this.closed = true;\n this.observers = this.currentObservers = null!;\n }\n\n get observed() {\n return this.observers?.length > 0;\n }\n\n /** @internal */\n protected _trySubscribe(subscriber: Subscriber): TeardownLogic {\n this._throwIfClosed();\n return super._trySubscribe(subscriber);\n }\n\n /** @internal */\n protected _subscribe(subscriber: Subscriber): Subscription {\n this._throwIfClosed();\n this._checkFinalizedStatuses(subscriber);\n return this._innerSubscribe(subscriber);\n }\n\n /** @internal */\n protected _innerSubscribe(subscriber: Subscriber) {\n const { hasError, isStopped, observers } = this;\n if (hasError || isStopped) {\n return EMPTY_SUBSCRIPTION;\n }\n this.currentObservers = null;\n observers.push(subscriber);\n return new Subscription(() => {\n this.currentObservers = null;\n arrRemove(observers, subscriber);\n });\n }\n\n /** @internal */\n protected _checkFinalizedStatuses(subscriber: Subscriber) {\n const { hasError, thrownError, isStopped } = this;\n if (hasError) {\n subscriber.error(thrownError);\n } else if (isStopped) {\n subscriber.complete();\n }\n }\n\n /**\n * Creates a new Observable with this Subject as the source. You can do this\n * to create custom Observer-side logic of the Subject and conceal it from\n * code that uses the Observable.\n * @return {Observable} Observable that the Subject casts to\n */\n asObservable(): Observable {\n const observable: any = new Observable();\n observable.source = this;\n return observable;\n }\n}\n\n/**\n * @class AnonymousSubject\n */\nexport class AnonymousSubject extends Subject {\n constructor(\n /** @deprecated Internal implementation detail, do not use directly. Will be made internal in v8. */\n public destination?: Observer,\n source?: Observable\n ) {\n super();\n this.source = source;\n }\n\n next(value: T) {\n this.destination?.next?.(value);\n }\n\n error(err: any) {\n this.destination?.error?.(err);\n }\n\n complete() {\n this.destination?.complete?.();\n }\n\n /** @internal */\n protected _subscribe(subscriber: Subscriber): Subscription {\n return this.source?.subscribe(subscriber) ?? EMPTY_SUBSCRIPTION;\n }\n}\n", "import { Subject } from './Subject';\nimport { Subscriber } from './Subscriber';\nimport { Subscription } from './Subscription';\n\n/**\n * A variant of Subject that requires an initial value and emits its current\n * value whenever it is subscribed to.\n *\n * @class BehaviorSubject\n */\nexport class BehaviorSubject extends Subject {\n constructor(private _value: T) {\n super();\n }\n\n get value(): T {\n return this.getValue();\n }\n\n /** @internal */\n protected _subscribe(subscriber: Subscriber): Subscription {\n const subscription = super._subscribe(subscriber);\n !subscription.closed && subscriber.next(this._value);\n return subscription;\n }\n\n getValue(): T {\n const { hasError, thrownError, _value } = this;\n if (hasError) {\n throw thrownError;\n }\n this._throwIfClosed();\n return _value;\n }\n\n next(value: T): void {\n super.next((this._value = value));\n }\n}\n", "import { TimestampProvider } from '../types';\n\ninterface DateTimestampProvider extends TimestampProvider {\n delegate: TimestampProvider | undefined;\n}\n\nexport const dateTimestampProvider: DateTimestampProvider = {\n now() {\n // Use the variable rather than `this` so that the function can be called\n // without being bound to the provider.\n return (dateTimestampProvider.delegate || Date).now();\n },\n delegate: undefined,\n};\n", "import { Subject } from './Subject';\nimport { TimestampProvider } from './types';\nimport { Subscriber } from './Subscriber';\nimport { Subscription } from './Subscription';\nimport { dateTimestampProvider } from './scheduler/dateTimestampProvider';\n\n/**\n * A variant of {@link Subject} that \"replays\" old values to new subscribers by emitting them when they first subscribe.\n *\n * `ReplaySubject` has an internal buffer that will store a specified number of values that it has observed. Like `Subject`,\n * `ReplaySubject` \"observes\" values by having them passed to its `next` method. When it observes a value, it will store that\n * value for a time determined by the configuration of the `ReplaySubject`, as passed to its constructor.\n *\n * When a new subscriber subscribes to the `ReplaySubject` instance, it will synchronously emit all values in its buffer in\n * a First-In-First-Out (FIFO) manner. The `ReplaySubject` will also complete, if it has observed completion; and it will\n * error if it has observed an error.\n *\n * There are two main configuration items to be concerned with:\n *\n * 1. `bufferSize` - This will determine how many items are stored in the buffer, defaults to infinite.\n * 2. `windowTime` - The amount of time to hold a value in the buffer before removing it from the buffer.\n *\n * Both configurations may exist simultaneously. So if you would like to buffer a maximum of 3 values, as long as the values\n * are less than 2 seconds old, you could do so with a `new ReplaySubject(3, 2000)`.\n *\n * ### Differences with BehaviorSubject\n *\n * `BehaviorSubject` is similar to `new ReplaySubject(1)`, with a couple of exceptions:\n *\n * 1. `BehaviorSubject` comes \"primed\" with a single value upon construction.\n * 2. `ReplaySubject` will replay values, even after observing an error, where `BehaviorSubject` will not.\n *\n * @see {@link Subject}\n * @see {@link BehaviorSubject}\n * @see {@link shareReplay}\n */\nexport class ReplaySubject extends Subject {\n private _buffer: (T | number)[] = [];\n private _infiniteTimeWindow = true;\n\n /**\n * @param bufferSize The size of the buffer to replay on subscription\n * @param windowTime The amount of time the buffered items will stay buffered\n * @param timestampProvider An object with a `now()` method that provides the current timestamp. This is used to\n * calculate the amount of time something has been buffered.\n */\n constructor(\n private _bufferSize = Infinity,\n private _windowTime = Infinity,\n private _timestampProvider: TimestampProvider = dateTimestampProvider\n ) {\n super();\n this._infiniteTimeWindow = _windowTime === Infinity;\n this._bufferSize = Math.max(1, _bufferSize);\n this._windowTime = Math.max(1, _windowTime);\n }\n\n next(value: T): void {\n const { isStopped, _buffer, _infiniteTimeWindow, _timestampProvider, _windowTime } = this;\n if (!isStopped) {\n _buffer.push(value);\n !_infiniteTimeWindow && _buffer.push(_timestampProvider.now() + _windowTime);\n }\n this._trimBuffer();\n super.next(value);\n }\n\n /** @internal */\n protected _subscribe(subscriber: Subscriber): Subscription {\n this._throwIfClosed();\n this._trimBuffer();\n\n const subscription = this._innerSubscribe(subscriber);\n\n const { _infiniteTimeWindow, _buffer } = this;\n // We use a copy here, so reentrant code does not mutate our array while we're\n // emitting it to a new subscriber.\n const copy = _buffer.slice();\n for (let i = 0; i < copy.length && !subscriber.closed; i += _infiniteTimeWindow ? 1 : 2) {\n subscriber.next(copy[i] as T);\n }\n\n this._checkFinalizedStatuses(subscriber);\n\n return subscription;\n }\n\n private _trimBuffer() {\n const { _bufferSize, _timestampProvider, _buffer, _infiniteTimeWindow } = this;\n // If we don't have an infinite buffer size, and we're over the length,\n // use splice to truncate the old buffer values off. Note that we have to\n // double the size for instances where we're not using an infinite time window\n // because we're storing the values and the timestamps in the same array.\n const adjustedBufferSize = (_infiniteTimeWindow ? 1 : 2) * _bufferSize;\n _bufferSize < Infinity && adjustedBufferSize < _buffer.length && _buffer.splice(0, _buffer.length - adjustedBufferSize);\n\n // Now, if we're not in an infinite time window, remove all values where the time is\n // older than what is allowed.\n if (!_infiniteTimeWindow) {\n const now = _timestampProvider.now();\n let last = 0;\n // Search the array for the first timestamp that isn't expired and\n // truncate the buffer up to that point.\n for (let i = 1; i < _buffer.length && (_buffer[i] as number) <= now; i += 2) {\n last = i;\n }\n last && _buffer.splice(0, last + 1);\n }\n }\n}\n", "import { Scheduler } from '../Scheduler';\nimport { Subscription } from '../Subscription';\nimport { SchedulerAction } from '../types';\n\n/**\n * A unit of work to be executed in a `scheduler`. An action is typically\n * created from within a {@link SchedulerLike} and an RxJS user does not need to concern\n * themselves about creating and manipulating an Action.\n *\n * ```ts\n * class Action extends Subscription {\n * new (scheduler: Scheduler, work: (state?: T) => void);\n * schedule(state?: T, delay: number = 0): Subscription;\n * }\n * ```\n *\n * @class Action\n */\nexport class Action extends Subscription {\n constructor(scheduler: Scheduler, work: (this: SchedulerAction, state?: T) => void) {\n super();\n }\n /**\n * Schedules this action on its parent {@link SchedulerLike} for execution. May be passed\n * some context object, `state`. May happen at some point in the future,\n * according to the `delay` parameter, if specified.\n * @param {T} [state] Some contextual data that the `work` function uses when\n * called by the Scheduler.\n * @param {number} [delay] Time to wait before executing the work, where the\n * time unit is implicit and defined by the Scheduler.\n * @return {void}\n */\n public schedule(state?: T, delay: number = 0): Subscription {\n return this;\n }\n}\n", "import type { TimerHandle } from './timerHandle';\ntype SetIntervalFunction = (handler: () => void, timeout?: number, ...args: any[]) => TimerHandle;\ntype ClearIntervalFunction = (handle: TimerHandle) => void;\n\ninterface IntervalProvider {\n setInterval: SetIntervalFunction;\n clearInterval: ClearIntervalFunction;\n delegate:\n | {\n setInterval: SetIntervalFunction;\n clearInterval: ClearIntervalFunction;\n }\n | undefined;\n}\n\nexport const intervalProvider: IntervalProvider = {\n // When accessing the delegate, use the variable rather than `this` so that\n // the functions can be called without being bound to the provider.\n setInterval(handler: () => void, timeout?: number, ...args) {\n const { delegate } = intervalProvider;\n if (delegate?.setInterval) {\n return delegate.setInterval(handler, timeout, ...args);\n }\n return setInterval(handler, timeout, ...args);\n },\n clearInterval(handle) {\n const { delegate } = intervalProvider;\n return (delegate?.clearInterval || clearInterval)(handle as any);\n },\n delegate: undefined,\n};\n", "import { Action } from './Action';\nimport { SchedulerAction } from '../types';\nimport { Subscription } from '../Subscription';\nimport { AsyncScheduler } from './AsyncScheduler';\nimport { intervalProvider } from './intervalProvider';\nimport { arrRemove } from '../util/arrRemove';\nimport { TimerHandle } from './timerHandle';\n\nexport class AsyncAction extends Action {\n public id: TimerHandle | undefined;\n public state?: T;\n // @ts-ignore: Property has no initializer and is not definitely assigned\n public delay: number;\n protected pending: boolean = false;\n\n constructor(protected scheduler: AsyncScheduler, protected work: (this: SchedulerAction, state?: T) => void) {\n super(scheduler, work);\n }\n\n public schedule(state?: T, delay: number = 0): Subscription {\n if (this.closed) {\n return this;\n }\n\n // Always replace the current state with the new state.\n this.state = state;\n\n const id = this.id;\n const scheduler = this.scheduler;\n\n //\n // Important implementation note:\n //\n // Actions only execute once by default, unless rescheduled from within the\n // scheduled callback. This allows us to implement single and repeat\n // actions via the same code path, without adding API surface area, as well\n // as mimic traditional recursion but across asynchronous boundaries.\n //\n // However, JS runtimes and timers distinguish between intervals achieved by\n // serial `setTimeout` calls vs. a single `setInterval` call. An interval of\n // serial `setTimeout` calls can be individually delayed, which delays\n // scheduling the next `setTimeout`, and so on. `setInterval` attempts to\n // guarantee the interval callback will be invoked more precisely to the\n // interval period, regardless of load.\n //\n // Therefore, we use `setInterval` to schedule single and repeat actions.\n // If the action reschedules itself with the same delay, the interval is not\n // canceled. If the action doesn't reschedule, or reschedules with a\n // different delay, the interval will be canceled after scheduled callback\n // execution.\n //\n if (id != null) {\n this.id = this.recycleAsyncId(scheduler, id, delay);\n }\n\n // Set the pending flag indicating that this action has been scheduled, or\n // has recursively rescheduled itself.\n this.pending = true;\n\n this.delay = delay;\n // If this action has already an async Id, don't request a new one.\n this.id = this.id ?? this.requestAsyncId(scheduler, this.id, delay);\n\n return this;\n }\n\n protected requestAsyncId(scheduler: AsyncScheduler, _id?: TimerHandle, delay: number = 0): TimerHandle {\n return intervalProvider.setInterval(scheduler.flush.bind(scheduler, this), delay);\n }\n\n protected recycleAsyncId(_scheduler: AsyncScheduler, id?: TimerHandle, delay: number | null = 0): TimerHandle | undefined {\n // If this action is rescheduled with the same delay time, don't clear the interval id.\n if (delay != null && this.delay === delay && this.pending === false) {\n return id;\n }\n // Otherwise, if the action's delay time is different from the current delay,\n // or the action has been rescheduled before it's executed, clear the interval id\n if (id != null) {\n intervalProvider.clearInterval(id);\n }\n\n return undefined;\n }\n\n /**\n * Immediately executes this action and the `work` it contains.\n * @return {any}\n */\n public execute(state: T, delay: number): any {\n if (this.closed) {\n return new Error('executing a cancelled action');\n }\n\n this.pending = false;\n const error = this._execute(state, delay);\n if (error) {\n return error;\n } else if (this.pending === false && this.id != null) {\n // Dequeue if the action didn't reschedule itself. Don't call\n // unsubscribe(), because the action could reschedule later.\n // For example:\n // ```\n // scheduler.schedule(function doWork(counter) {\n // /* ... I'm a busy worker bee ... */\n // var originalAction = this;\n // /* wait 100ms before rescheduling the action */\n // setTimeout(function () {\n // originalAction.schedule(counter + 1);\n // }, 100);\n // }, 1000);\n // ```\n this.id = this.recycleAsyncId(this.scheduler, this.id, null);\n }\n }\n\n protected _execute(state: T, _delay: number): any {\n let errored: boolean = false;\n let errorValue: any;\n try {\n this.work(state);\n } catch (e) {\n errored = true;\n // HACK: Since code elsewhere is relying on the \"truthiness\" of the\n // return here, we can't have it return \"\" or 0 or false.\n // TODO: Clean this up when we refactor schedulers mid-version-8 or so.\n errorValue = e ? e : new Error('Scheduled action threw falsy error');\n }\n if (errored) {\n this.unsubscribe();\n return errorValue;\n }\n }\n\n unsubscribe() {\n if (!this.closed) {\n const { id, scheduler } = this;\n const { actions } = scheduler;\n\n this.work = this.state = this.scheduler = null!;\n this.pending = false;\n\n arrRemove(actions, this);\n if (id != null) {\n this.id = this.recycleAsyncId(scheduler, id, null);\n }\n\n this.delay = null!;\n super.unsubscribe();\n }\n }\n}\n", "import { Action } from './scheduler/Action';\nimport { Subscription } from './Subscription';\nimport { SchedulerLike, SchedulerAction } from './types';\nimport { dateTimestampProvider } from './scheduler/dateTimestampProvider';\n\n/**\n * An execution context and a data structure to order tasks and schedule their\n * execution. Provides a notion of (potentially virtual) time, through the\n * `now()` getter method.\n *\n * Each unit of work in a Scheduler is called an `Action`.\n *\n * ```ts\n * class Scheduler {\n * now(): number;\n * schedule(work, delay?, state?): Subscription;\n * }\n * ```\n *\n * @class Scheduler\n * @deprecated Scheduler is an internal implementation detail of RxJS, and\n * should not be used directly. Rather, create your own class and implement\n * {@link SchedulerLike}. Will be made internal in v8.\n */\nexport class Scheduler implements SchedulerLike {\n public static now: () => number = dateTimestampProvider.now;\n\n constructor(private schedulerActionCtor: typeof Action, now: () => number = Scheduler.now) {\n this.now = now;\n }\n\n /**\n * A getter method that returns a number representing the current time\n * (at the time this function was called) according to the scheduler's own\n * internal clock.\n * @return {number} A number that represents the current time. May or may not\n * have a relation to wall-clock time. May or may not refer to a time unit\n * (e.g. milliseconds).\n */\n public now: () => number;\n\n /**\n * Schedules a function, `work`, for execution. May happen at some point in\n * the future, according to the `delay` parameter, if specified. May be passed\n * some context object, `state`, which will be passed to the `work` function.\n *\n * The given arguments will be processed an stored as an Action object in a\n * queue of actions.\n *\n * @param {function(state: ?T): ?Subscription} work A function representing a\n * task, or some unit of work to be executed by the Scheduler.\n * @param {number} [delay] Time to wait before executing the work, where the\n * time unit is implicit and defined by the Scheduler itself.\n * @param {T} [state] Some contextual data that the `work` function uses when\n * called by the Scheduler.\n * @return {Subscription} A subscription in order to be able to unsubscribe\n * the scheduled work.\n */\n public schedule(work: (this: SchedulerAction, state?: T) => void, delay: number = 0, state?: T): Subscription {\n return new this.schedulerActionCtor(this, work).schedule(state, delay);\n }\n}\n", "import { Scheduler } from '../Scheduler';\nimport { Action } from './Action';\nimport { AsyncAction } from './AsyncAction';\nimport { TimerHandle } from './timerHandle';\n\nexport class AsyncScheduler extends Scheduler {\n public actions: Array> = [];\n /**\n * A flag to indicate whether the Scheduler is currently executing a batch of\n * queued actions.\n * @type {boolean}\n * @internal\n */\n public _active: boolean = false;\n /**\n * An internal ID used to track the latest asynchronous task such as those\n * coming from `setTimeout`, `setInterval`, `requestAnimationFrame`, and\n * others.\n * @type {any}\n * @internal\n */\n public _scheduled: TimerHandle | undefined;\n\n constructor(SchedulerAction: typeof Action, now: () => number = Scheduler.now) {\n super(SchedulerAction, now);\n }\n\n public flush(action: AsyncAction): void {\n const { actions } = this;\n\n if (this._active) {\n actions.push(action);\n return;\n }\n\n let error: any;\n this._active = true;\n\n do {\n if ((error = action.execute(action.state, action.delay))) {\n break;\n }\n } while ((action = actions.shift()!)); // exhaust the scheduler queue\n\n this._active = false;\n\n if (error) {\n while ((action = actions.shift()!)) {\n action.unsubscribe();\n }\n throw error;\n }\n }\n}\n", "import { AsyncAction } from './AsyncAction';\nimport { AsyncScheduler } from './AsyncScheduler';\n\n/**\n *\n * Async Scheduler\n *\n * Schedule task as if you used setTimeout(task, duration)\n *\n * `async` scheduler schedules tasks asynchronously, by putting them on the JavaScript\n * event loop queue. It is best used to delay tasks in time or to schedule tasks repeating\n * in intervals.\n *\n * If you just want to \"defer\" task, that is to perform it right after currently\n * executing synchronous code ends (commonly achieved by `setTimeout(deferredTask, 0)`),\n * better choice will be the {@link asapScheduler} scheduler.\n *\n * ## Examples\n * Use async scheduler to delay task\n * ```ts\n * import { asyncScheduler } from 'rxjs';\n *\n * const task = () => console.log('it works!');\n *\n * asyncScheduler.schedule(task, 2000);\n *\n * // After 2 seconds logs:\n * // \"it works!\"\n * ```\n *\n * Use async scheduler to repeat task in intervals\n * ```ts\n * import { asyncScheduler } from 'rxjs';\n *\n * function task(state) {\n * console.log(state);\n * this.schedule(state + 1, 1000); // `this` references currently executing Action,\n * // which we reschedule with new state and delay\n * }\n *\n * asyncScheduler.schedule(task, 3000, 0);\n *\n * // Logs:\n * // 0 after 3s\n * // 1 after 4s\n * // 2 after 5s\n * // 3 after 6s\n * ```\n */\n\nexport const asyncScheduler = new AsyncScheduler(AsyncAction);\n\n/**\n * @deprecated Renamed to {@link asyncScheduler}. Will be removed in v8.\n */\nexport const async = asyncScheduler;\n", "import { AsyncAction } from './AsyncAction';\nimport { Subscription } from '../Subscription';\nimport { QueueScheduler } from './QueueScheduler';\nimport { SchedulerAction } from '../types';\nimport { TimerHandle } from './timerHandle';\n\nexport class QueueAction extends AsyncAction {\n constructor(protected scheduler: QueueScheduler, protected work: (this: SchedulerAction, state?: T) => void) {\n super(scheduler, work);\n }\n\n public schedule(state?: T, delay: number = 0): Subscription {\n if (delay > 0) {\n return super.schedule(state, delay);\n }\n this.delay = delay;\n this.state = state;\n this.scheduler.flush(this);\n return this;\n }\n\n public execute(state: T, delay: number): any {\n return delay > 0 || this.closed ? super.execute(state, delay) : this._execute(state, delay);\n }\n\n protected requestAsyncId(scheduler: QueueScheduler, id?: TimerHandle, delay: number = 0): TimerHandle {\n // If delay exists and is greater than 0, or if the delay is null (the\n // action wasn't rescheduled) but was originally scheduled as an async\n // action, then recycle as an async action.\n\n if ((delay != null && delay > 0) || (delay == null && this.delay > 0)) {\n return super.requestAsyncId(scheduler, id, delay);\n }\n\n // Otherwise flush the scheduler starting with this action.\n scheduler.flush(this);\n\n // HACK: In the past, this was returning `void`. However, `void` isn't a valid\n // `TimerHandle`, and generally the return value here isn't really used. So the\n // compromise is to return `0` which is both \"falsy\" and a valid `TimerHandle`,\n // as opposed to refactoring every other instanceo of `requestAsyncId`.\n return 0;\n }\n}\n", "import { AsyncScheduler } from './AsyncScheduler';\n\nexport class QueueScheduler extends AsyncScheduler {\n}\n", "import { QueueAction } from './QueueAction';\nimport { QueueScheduler } from './QueueScheduler';\n\n/**\n *\n * Queue Scheduler\n *\n * Put every next task on a queue, instead of executing it immediately\n *\n * `queue` scheduler, when used with delay, behaves the same as {@link asyncScheduler} scheduler.\n *\n * When used without delay, it schedules given task synchronously - executes it right when\n * it is scheduled. However when called recursively, that is when inside the scheduled task,\n * another task is scheduled with queue scheduler, instead of executing immediately as well,\n * that task will be put on a queue and wait for current one to finish.\n *\n * This means that when you execute task with `queue` scheduler, you are sure it will end\n * before any other task scheduled with that scheduler will start.\n *\n * ## Examples\n * Schedule recursively first, then do something\n * ```ts\n * import { queueScheduler } from 'rxjs';\n *\n * queueScheduler.schedule(() => {\n * queueScheduler.schedule(() => console.log('second')); // will not happen now, but will be put on a queue\n *\n * console.log('first');\n * });\n *\n * // Logs:\n * // \"first\"\n * // \"second\"\n * ```\n *\n * Reschedule itself recursively\n * ```ts\n * import { queueScheduler } from 'rxjs';\n *\n * queueScheduler.schedule(function(state) {\n * if (state !== 0) {\n * console.log('before', state);\n * this.schedule(state - 1); // `this` references currently executing Action,\n * // which we reschedule with new state\n * console.log('after', state);\n * }\n * }, 0, 3);\n *\n * // In scheduler that runs recursively, you would expect:\n * // \"before\", 3\n * // \"before\", 2\n * // \"before\", 1\n * // \"after\", 1\n * // \"after\", 2\n * // \"after\", 3\n *\n * // But with queue it logs:\n * // \"before\", 3\n * // \"after\", 3\n * // \"before\", 2\n * // \"after\", 2\n * // \"before\", 1\n * // \"after\", 1\n * ```\n */\n\nexport const queueScheduler = new QueueScheduler(QueueAction);\n\n/**\n * @deprecated Renamed to {@link queueScheduler}. Will be removed in v8.\n */\nexport const queue = queueScheduler;\n", "import { AsyncAction } from './AsyncAction';\nimport { AnimationFrameScheduler } from './AnimationFrameScheduler';\nimport { SchedulerAction } from '../types';\nimport { animationFrameProvider } from './animationFrameProvider';\nimport { TimerHandle } from './timerHandle';\n\nexport class AnimationFrameAction extends AsyncAction {\n constructor(protected scheduler: AnimationFrameScheduler, protected work: (this: SchedulerAction, state?: T) => void) {\n super(scheduler, work);\n }\n\n protected requestAsyncId(scheduler: AnimationFrameScheduler, id?: TimerHandle, delay: number = 0): TimerHandle {\n // If delay is greater than 0, request as an async action.\n if (delay !== null && delay > 0) {\n return super.requestAsyncId(scheduler, id, delay);\n }\n // Push the action to the end of the scheduler queue.\n scheduler.actions.push(this);\n // If an animation frame has already been requested, don't request another\n // one. If an animation frame hasn't been requested yet, request one. Return\n // the current animation frame request id.\n return scheduler._scheduled || (scheduler._scheduled = animationFrameProvider.requestAnimationFrame(() => scheduler.flush(undefined)));\n }\n\n protected recycleAsyncId(scheduler: AnimationFrameScheduler, id?: TimerHandle, delay: number = 0): TimerHandle | undefined {\n // If delay exists and is greater than 0, or if the delay is null (the\n // action wasn't rescheduled) but was originally scheduled as an async\n // action, then recycle as an async action.\n if (delay != null ? delay > 0 : this.delay > 0) {\n return super.recycleAsyncId(scheduler, id, delay);\n }\n // If the scheduler queue has no remaining actions with the same async id,\n // cancel the requested animation frame and set the scheduled flag to\n // undefined so the next AnimationFrameAction will request its own.\n const { actions } = scheduler;\n if (id != null && actions[actions.length - 1]?.id !== id) {\n animationFrameProvider.cancelAnimationFrame(id as number);\n scheduler._scheduled = undefined;\n }\n // Return undefined so the action knows to request a new async id if it's rescheduled.\n return undefined;\n }\n}\n", "import { AsyncAction } from './AsyncAction';\nimport { AsyncScheduler } from './AsyncScheduler';\n\nexport class AnimationFrameScheduler extends AsyncScheduler {\n public flush(action?: AsyncAction): void {\n this._active = true;\n // The async id that effects a call to flush is stored in _scheduled.\n // Before executing an action, it's necessary to check the action's async\n // id to determine whether it's supposed to be executed in the current\n // flush.\n // Previous implementations of this method used a count to determine this,\n // but that was unsound, as actions that are unsubscribed - i.e. cancelled -\n // are removed from the actions array and that can shift actions that are\n // scheduled to be executed in a subsequent flush into positions at which\n // they are executed within the current flush.\n const flushId = this._scheduled;\n this._scheduled = undefined;\n\n const { actions } = this;\n let error: any;\n action = action || actions.shift()!;\n\n do {\n if ((error = action.execute(action.state, action.delay))) {\n break;\n }\n } while ((action = actions[0]) && action.id === flushId && actions.shift());\n\n this._active = false;\n\n if (error) {\n while ((action = actions[0]) && action.id === flushId && actions.shift()) {\n action.unsubscribe();\n }\n throw error;\n }\n }\n}\n", "import { AnimationFrameAction } from './AnimationFrameAction';\nimport { AnimationFrameScheduler } from './AnimationFrameScheduler';\n\n/**\n *\n * Animation Frame Scheduler\n *\n * Perform task when `window.requestAnimationFrame` would fire\n *\n * When `animationFrame` scheduler is used with delay, it will fall back to {@link asyncScheduler} scheduler\n * behaviour.\n *\n * Without delay, `animationFrame` scheduler can be used to create smooth browser animations.\n * It makes sure scheduled task will happen just before next browser content repaint,\n * thus performing animations as efficiently as possible.\n *\n * ## Example\n * Schedule div height animation\n * ```ts\n * // html:
\n * import { animationFrameScheduler } from 'rxjs';\n *\n * const div = document.querySelector('div');\n *\n * animationFrameScheduler.schedule(function(height) {\n * div.style.height = height + \"px\";\n *\n * this.schedule(height + 1); // `this` references currently executing Action,\n * // which we reschedule with new state\n * }, 0, 0);\n *\n * // You will see a div element growing in height\n * ```\n */\n\nexport const animationFrameScheduler = new AnimationFrameScheduler(AnimationFrameAction);\n\n/**\n * @deprecated Renamed to {@link animationFrameScheduler}. Will be removed in v8.\n */\nexport const animationFrame = animationFrameScheduler;\n", "import { Observable } from '../Observable';\nimport { SchedulerLike } from '../types';\n\n/**\n * A simple Observable that emits no items to the Observer and immediately\n * emits a complete notification.\n *\n * Just emits 'complete', and nothing else.\n *\n * ![](empty.png)\n *\n * A simple Observable that only emits the complete notification. It can be used\n * for composing with other Observables, such as in a {@link mergeMap}.\n *\n * ## Examples\n *\n * Log complete notification\n *\n * ```ts\n * import { EMPTY } from 'rxjs';\n *\n * EMPTY.subscribe({\n * next: () => console.log('Next'),\n * complete: () => console.log('Complete!')\n * });\n *\n * // Outputs\n * // Complete!\n * ```\n *\n * Emit the number 7, then complete\n *\n * ```ts\n * import { EMPTY, startWith } from 'rxjs';\n *\n * const result = EMPTY.pipe(startWith(7));\n * result.subscribe(x => console.log(x));\n *\n * // Outputs\n * // 7\n * ```\n *\n * Map and flatten only odd numbers to the sequence `'a'`, `'b'`, `'c'`\n *\n * ```ts\n * import { interval, mergeMap, of, EMPTY } from 'rxjs';\n *\n * const interval$ = interval(1000);\n * const result = interval$.pipe(\n * mergeMap(x => x % 2 === 1 ? of('a', 'b', 'c') : EMPTY),\n * );\n * result.subscribe(x => console.log(x));\n *\n * // Results in the following to the console:\n * // x is equal to the count on the interval, e.g. (0, 1, 2, 3, ...)\n * // x will occur every 1000ms\n * // if x % 2 is equal to 1, print a, b, c (each on its own)\n * // if x % 2 is not equal to 1, nothing will be output\n * ```\n *\n * @see {@link Observable}\n * @see {@link NEVER}\n * @see {@link of}\n * @see {@link throwError}\n */\nexport const EMPTY = new Observable((subscriber) => subscriber.complete());\n\n/**\n * @param scheduler A {@link SchedulerLike} to use for scheduling\n * the emission of the complete notification.\n * @deprecated Replaced with the {@link EMPTY} constant or {@link scheduled} (e.g. `scheduled([], scheduler)`). Will be removed in v8.\n */\nexport function empty(scheduler?: SchedulerLike) {\n return scheduler ? emptyScheduled(scheduler) : EMPTY;\n}\n\nfunction emptyScheduled(scheduler: SchedulerLike) {\n return new Observable((subscriber) => scheduler.schedule(() => subscriber.complete()));\n}\n", "import { SchedulerLike } from '../types';\nimport { isFunction } from './isFunction';\n\nexport function isScheduler(value: any): value is SchedulerLike {\n return value && isFunction(value.schedule);\n}\n", "import { SchedulerLike } from '../types';\nimport { isFunction } from './isFunction';\nimport { isScheduler } from './isScheduler';\n\nfunction last(arr: T[]): T | undefined {\n return arr[arr.length - 1];\n}\n\nexport function popResultSelector(args: any[]): ((...args: unknown[]) => unknown) | undefined {\n return isFunction(last(args)) ? args.pop() : undefined;\n}\n\nexport function popScheduler(args: any[]): SchedulerLike | undefined {\n return isScheduler(last(args)) ? args.pop() : undefined;\n}\n\nexport function popNumber(args: any[], defaultValue: number): number {\n return typeof last(args) === 'number' ? args.pop()! : defaultValue;\n}\n", "export const isArrayLike = ((x: any): x is ArrayLike => x && typeof x.length === 'number' && typeof x !== 'function');", "import { isFunction } from \"./isFunction\";\n\n/**\n * Tests to see if the object is \"thennable\".\n * @param value the object to test\n */\nexport function isPromise(value: any): value is PromiseLike {\n return isFunction(value?.then);\n}\n", "import { InteropObservable } from '../types';\nimport { observable as Symbol_observable } from '../symbol/observable';\nimport { isFunction } from './isFunction';\n\n/** Identifies an input as being Observable (but not necessary an Rx Observable) */\nexport function isInteropObservable(input: any): input is InteropObservable {\n return isFunction(input[Symbol_observable]);\n}\n", "import { isFunction } from './isFunction';\n\nexport function isAsyncIterable(obj: any): obj is AsyncIterable {\n return Symbol.asyncIterator && isFunction(obj?.[Symbol.asyncIterator]);\n}\n", "/**\n * Creates the TypeError to throw if an invalid object is passed to `from` or `scheduled`.\n * @param input The object that was passed.\n */\nexport function createInvalidObservableTypeError(input: any) {\n // TODO: We should create error codes that can be looked up, so this can be less verbose.\n return new TypeError(\n `You provided ${\n input !== null && typeof input === 'object' ? 'an invalid object' : `'${input}'`\n } where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.`\n );\n}\n", "export function getSymbolIterator(): symbol {\n if (typeof Symbol !== 'function' || !Symbol.iterator) {\n return '@@iterator' as any;\n }\n\n return Symbol.iterator;\n}\n\nexport const iterator = getSymbolIterator();\n", "import { iterator as Symbol_iterator } from '../symbol/iterator';\nimport { isFunction } from './isFunction';\n\n/** Identifies an input as being an Iterable */\nexport function isIterable(input: any): input is Iterable {\n return isFunction(input?.[Symbol_iterator]);\n}\n", "import { ReadableStreamLike } from '../types';\nimport { isFunction } from './isFunction';\n\nexport async function* readableStreamLikeToAsyncGenerator(readableStream: ReadableStreamLike): AsyncGenerator {\n const reader = readableStream.getReader();\n try {\n while (true) {\n const { value, done } = await reader.read();\n if (done) {\n return;\n }\n yield value!;\n }\n } finally {\n reader.releaseLock();\n }\n}\n\nexport function isReadableStreamLike(obj: any): obj is ReadableStreamLike {\n // We don't want to use instanceof checks because they would return\n // false for instances from another Realm, like an + +
+

In order to support an Agency Cards deployment, the Transit Provider produces a list of eligible users +(CSV format) that is loaded into an instance of Eligibility Server running in the Transit Provider’s cloud.

+

Cal-ITP makes the hashfields tool to facilitate masking user data before it leaves Transit Provider on-premises systems.

+

The complete system architecture looks like:

+
flowchart LR
+    rider((User's browser))
+    api[Eligibility Server]
+    data[Hashed Agency Card data]
+    cardsystem[Data source]
+
+    rider --> Benefits
+
+    subgraph CDT Azure
+        Benefits
+    end
+
+    Benefits --> api
+
+    subgraph Transit Provider cloud
+        api --> data
+    end
+
+    subgraph Transit Provider on-prem
+        cardsystem --> hashfields
+    end
+
+    hashfields --> data
+

Notes:

+ +

Process

+
sequenceDiagram
+    actor Rider
+    participant Benefits as Benefits app
+    participant elig_server as Eligibility Server
+    participant cc_data as Hashed data
+    participant Data Source
+    participant Littlepay
+
+    Data Source-->>cc_data: exports nightly
+    cc_data-->>elig_server: gets loaded on Server start
+
+    Rider->>Benefits: visits site
+    Benefits-->>elig_server: passes entered Agency Card details
+    elig_server-->>Benefits: confirms eligibility
+
+    Benefits-->>Littlepay: enrollment start
+    Rider->>Littlepay: enters payment card details
+    Littlepay-->>Benefits: enrollment complete
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ + + + + + + + + + \ No newline at end of file diff --git a/enrollment-pathways/index.html b/enrollment-pathways/index.html new file mode 100644 index 000000000..ccae9c8e1 --- /dev/null +++ b/enrollment-pathways/index.html @@ -0,0 +1,1869 @@ + + + + + + + + + + + + + + + + + + + + + + + + + Introduction - cal-itp/benefits: documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + + + + +
+
+ + + +
+
+
+ + + + + + + + + +
+
+
+ + + + +
+
+ + + + + + + +

Enrollment pathways

+

This section describes in more detail some of the different enrollment pathways with current or planned support in the Benefits application.

+

Current work

+

We do sprint planning and track day-to-day work on our Project Board.

+

See our Milestones for current work tracked against specific features and different enrollment pathways.

+

Product roadmap

+

Our product roadmap captures what we’re currently building, what we’ve built, and what we plan to build in the future. We update it at the end of each quarter or when priorities change.

+
timeline
+    title Cal-ITP Benefits Product Roadmap
+%% Cal-ITP Benefits Epics (2024)
+          section 2024
+
+          Q1<br>Complete
+          : Benefits admin tool (Foundation)
+          : SBMTD - Launch Reduced Fare Mobility ID enrollment pathway
+          : Migrate to Littlepay Backoffice API
+
+          Q2<br>Complete
+          : Support for expiring benefits (low-income)
+          : Improved UX for agency card enrollment
+          : Improved UX for application error states
+
+          Q3<br>Now
+          : Deploy low-income riders enrollment pathway
+          : Benefits admin tool (Agency users)
+          : Benefits admin tool (In-person eligibility verification)
+
+          Q4<br>Next
+          : Release Medicare cardholder enrollment pathway
+          : Benefits admin tool (Agency configuration)
+          : Support eligibility verification for disabled Veterans
+
+%% Cal-ITP Benefits Epics (2025)
+          section 2025
+
+          Q1
+          : Support benefits reciprocity between CA transit agencies
+          : Implement evolved organizing principles for app UX
+
+          Q2
+          : Support for multiple transit processors
+          : Integration with all MSA transit processors
+
+%%{
+    init: {
+        'logLevel': 'debug',
+        'theme': 'default' ,
+        'themeVariables': {
+            'cScale0': '#ffa500', 'cScaleLabel0': '#000000',
+            'cScale1': '#ffff00', 'cScaleLabel1': '#000000',
+            'cScale2': '#ffff00', 'cScaleLabel2': '#000000',
+            'cScale3': '#008000', 'cScaleLabel3': '#ffffff',
+            'cScale4': '#0000ff', 'cScaleLabel4': '#ffffff',
+            'cScale5': '#4b0082', 'cScaleLabel5': '#ffffff',
+            'cScale6': '#000000', 'cScaleLabel6': '#ffffff'
+        }
+    }
+}%%
+ + + + + + + + + + + + + + + + + + +
+
+ + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + \ No newline at end of file diff --git a/enrollment-pathways/low-income/index.html b/enrollment-pathways/low-income/index.html new file mode 100644 index 000000000..30aedaa52 --- /dev/null +++ b/enrollment-pathways/low-income/index.html @@ -0,0 +1,1971 @@ + + + + + + + + + + + + + + + + + + + + + + + + + Low-income - cal-itp/benefits: documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + + + + +
+
+ + + +
+
+
+ + + + + + + + + +
+
+
+ + + + +
+
+ + + + + + + +

Low-income

+

Overview

+

This use case describes a feature in the Cal-ITP Benefits app that allows Californians to verify their active participation in the CalFresh Program—as a proxy for low-income status—to receive reduced fares for transit when paying by contactless debit or credit card at participating transit operators in California.

+

Actor: A person who uses public transit in California. For benefit eligibility, a “low-income rider” is a person who has received CalFresh benefits in any of the previous three months.

+

Goal: To verify a transit rider’s financial need so they receive reduced fares when paying by contactless debit or credit card.

+

Precondition: The California transit operator offers fixed route service, has installed and tested validator hardware necessary to collect fares using contactless payment on bus or rail lines, and the operator has a policy in place to offer a transit discount to low-income riders.

+

Basic Flow

+
sequenceDiagram
+autonumber
+%% Low-income Rider Enrollment Pathway
+    actor Transit Rider
+    participant Benefits as Benefits app
+    participant IdG as Identity Gateway
+    participant Login.gov
+    participant CDSS
+    participant Littlepay
+Transit Rider->>Benefits: visits benefits.calitp.org
+    activate Benefits
+Benefits-->>IdG: eligibility verification
+    activate IdG
+Transit Rider->>Login.gov: account authentication
+    activate Login.gov
+IdG-->>Login.gov: requests required PII
+    activate Login.gov
+    Note right of Login.gov: first name<br>last name<br>Social Security number<br>date of birth
+Login.gov-->>IdG: returns required PII
+    deactivate Login.gov
+IdG-->>CDSS: check Calfresh enrollment status
+    activate CDSS
+CDSS-->>IdG: return Calfresh enrollment status
+    deactivate CDSS
+IdG-->>Benefits: eligibility response
+    deactivate IdG
+    deactivate Login.gov
+Benefits-->>Littlepay: payment enrollment start
+    activate Littlepay
+Transit Rider->>Littlepay: provides debit or credit card details
+Littlepay-->>Benefits: payment method enrollment confirmation
+    deactivate Littlepay
+    deactivate Benefits
+
    +
  1. +

    The transit rider visits the web application at benefits.calitp.org in a browser on their desktop computer.

    +
  2. +
  3. +

    The transit rider chooses the transit operator that serves their area.

    +
  4. +
  5. +

    The transit rider chooses to verify their eligibility as a participant in the CalFresh Program.

    +
  6. +
  7. +

    The transit rider authenticates with their existing Login.gov account or, if they don’t have one, creates a Login.gov account.

    +
  8. +
  9. +

    The Cal-ITP Benefits app interfaces with the California Department of Technology Identity Gateway (IdG) to verify benefit eligibility. The IdG uses personal information shared by Login.gov to verify CalFresh participation status.

    +
  10. +
  11. +

    The IdG uses the response provided by the California Department of Social Services (CDSS) to determine the rider’s eligibility for a transit benefit.

    +
  12. +
  13. +

    The IdG then passes the response from CDSS as low-income status = TRUE to the Cal-ITP Benefits app to indicate the person is eligible for a benefit.

    +
  14. +
  15. +

    The transit rider provides the debit or credit card details they use to pay for transit to Littlepay, the transit processor that facilitates transit fare collection.

    +
  16. +
  17. +

    The app registers the low-income benefit with the transit rider’s debit or credit card.

    +
  18. +
+

Alternative Flows

+
    +
  • Suppose the transit rider does not have a desktop computer. In this case, they open the web application at benefits.calitp.org in a mobile browser on their iOS or Android tablet or mobile device to complete enrollment using the basic flow.
  • +
+
    +
  • Suppose the transit rider cannot authenticate with Login.gov, or will not create an account. In either case, the app cannot determine their CalFresh Program participation status and they cannot enroll their contactless debit or credit card for a reduced fare.
  • +
+
    +
  • Suppose the IdG returns a status of FALSE for CalFresh Program participation status. In that case, the Cal-ITP Benefits app will not allow the transit rider to enroll their contactless debit or credit card for a reduced fare.
  • +
+
    +
  • Suppose the debit or credit card expires or is canceled by the issuer. In that case, the transit rider must repeat the basic flow to register a new debit or credit card.
  • +
+
    +
  • When the initial transit benefit enrollment period ends after one year from the date of enrollment, the transit rider must repeat the basic flow to re-enroll.
  • +
+
    +
  • Suppose the transit rider attempts to re-enroll for a transit benefit as a CalFresh Program participant three months after their enrollment period started. The app will inform them they must wait re-enroll within 14 days of the benefit expiration.
  • +
+
    +
  • Suppose the transit rider doesn’t re-enroll for a transit benefit after one year, but continues paying for transit using the card they registered. The transit operator will charge the rider full fare.
  • +
+
    +
  • If the transit rider uses more than one debit or credit card to pay for transit, they repeat the basic flow for each card.
  • +
+

Postcondition

+

The transit rider receives a fare reduction each time they use the debit or credit card they registered to pay for transit rides. The number of times they can use the card to pay for transit is unlimited, but the benefit expires one year after enrollment.

+

Benefits

+
    +
  • The transit rider no longer needs cash to pay for transit rides.
  • +
+
    +
  • The transit rider doesn’t have to lock up funds on a closed-loop card offered by the transit agency.
  • +
+
    +
  • The transit rider pays for transit rides with their debit or credit card, just as they do for groceries, a cup of coffee, or any other good or service.
  • +
+
    +
  • The transit rider can enroll in a transit benefit from home when convenient; they do not have to visit a transit agency in person.
  • +
+
    +
  • The transit rider does not have to prove income eligibility with the transit agency. The app simply uses their participation in the CalFresh program to confirm eligibility for a transit benefit.
  • +
+
    +
  • The transit agency doesn’t have to craft and policy for a low-icome discount; they simply use the approach implemented in the Cal-ITP Benefits application. As more agencies adopt the application, they also adopt a standard policy for transit benefits.
  • +
+
    +
  • Secure state and federal solutions manage the transit rider’s personal identifiable information (PII): Login.gov and the California Department of Technology Identity Gateway (IdG). Transit riders do not have to share personal information with local transit operators.
  • +
+
    +
  • Benefit enrollment takes minutes rather than days or weeks.
  • +
+
    +
  • Benefit enrollment doesn’t require online accounts with private companies.
  • +
+

Example Scenario

+

A CalFresh Program participant uses public transit regularly. They don’t have a car and depend on buses to get to appointments and do errands that take too long to use their bicycle. Even though this person already qualifies for benefits from the California Department of Social Services, they had to navigate another extensive, in-person eligibility process with different requirements to qualify for reduced fares from their local transit agency. They now receive a 50% fare reduction but have to pay for transit rides using the closed loop card provided by the operator to receive the reduced fare. It’s frustrating and inconvenient to reload this closed loop card in $10 payments every week, especially because they sometimes they could use the money tied up on the card to make ends meet. In summary, this person pays for daily expenses using three forms of payment: their Electronic Benefits Transfer (EBT) card for eligible items, their agency card for transportation, and their bank card (or cash) for everything else.

+

The transit operator serving their region of California implements contactless payments on fixed bus routes throughout the service area. This rider uses benefits.calitp.org on their mobile device to confirm their participation in the CalFresh Program offered by CDSS and registers their debit card for reduced fares. They tap to pay when boarding buses in their area and are automatically charged the reduced fare. While they still need to manage funds on their EBT card and their bank card, they no longer need to use their transit operator card to pay for transit. Best of all, they have complete access to all funds in their weekly budget. If other expenses are higher one week, they can allocate additional funds to those areas and ride transit less.

+ + + + + + + + + + + + + + + +
+
+ + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + \ No newline at end of file diff --git a/enrollment-pathways/older-adults/index.html b/enrollment-pathways/older-adults/index.html new file mode 100644 index 000000000..65d106b43 --- /dev/null +++ b/enrollment-pathways/older-adults/index.html @@ -0,0 +1,1832 @@ + + + + + + + + + + + + + + + + + + + + + + + + + Older adults - cal-itp/benefits: documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + + + + +
+
+ + + +
+
+
+ + + + + + + + + +
+
+
+ + + + +
+
+ + + + + + + +

Older adults

+

One Benefits application use case is for riders age 65 years and older. The Benefits application verifies the person’s age to confirm eligibility and allows those eligible to enroll their contactless payment card for their transit benefit.

+

Currently, the app uses Login.gov’s Identity Assurance Level 2 (IAL2) to confirm age, which requires a person to have a Social Security number, a valid state-issued ID card and a phone number with a phone plan associated with the person’s name. Adding ways to confirm eligibility for people without a Social Security number, for people who are part of a transit agency benefit program are on the roadmap.

+

Demonstration

+

Here’s a video showing what the flow looks like, having older adults confirm eligibility via Login.gov and enroll via Littlepay:

+ + +

Process

+
sequenceDiagram
+    actor Rider
+    participant Benefits as Benefits app
+    participant IdG as Identity Gateway
+    participant Login.gov
+    participant Littlepay
+
+    Rider->>Benefits: visits site
+    Benefits-->>IdG: identity proofing
+    IdG-->>Login.gov: identity proofing
+    Rider->>Login.gov: enters SSN and ID
+    Login.gov-->>IdG: eligibility verification
+    IdG-->>Benefits: eligibility verification
+    Benefits-->>Littlepay: enrollment start
+    Rider->>Littlepay: enters payment card details
+    Littlepay-->>Benefits: enrollment complete
+ + + + + + + + + + + + + + + +
+
+ + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + \ No newline at end of file diff --git a/enrollment-pathways/veterans/index.html b/enrollment-pathways/veterans/index.html new file mode 100644 index 000000000..0a5ff2741 --- /dev/null +++ b/enrollment-pathways/veterans/index.html @@ -0,0 +1,1929 @@ + + + + + + + + + + + + + + + + + + + + + + + + + Veterans - cal-itp/benefits: documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + + + + +
+
+ + + +
+
+
+ + + + + + + + + +
+
+
+ + + + +
+
+ + + + + + + +

Veterans

+

Overview

+

This use case describes a feature in the Cal-ITP Benefits app that allows US veterans who use public transit to verify their veteran status and receive reduced fares when paying by contactless debit or credit card at participating transit providers in California.

+

Actor: A US veteran who uses public transit in California. For benefit eligibility, a veteran is defined as “a person who served in the active military, naval, or air service, and was discharged or released therefrom under conditions other than dishonorable.” (source)

+

Goal: To verify a transit rider’s veteran status and enable the rider to receive reduced fares when paying by contactless debit or credit card.

+

Precondition: The California transit provider delivering fixed route service has installed and tested validator hardware necessary to collect fares using contactless payment on bus or rail lines, and the provider has a policy to offer a transit discount for US veterans.

+

Demonstration

+

Here’s a video showing what the flow looks like, having veterans confirm eligibility via Login.gov and enroll via Littlepay:

+ + +

Basic flow

+
sequenceDiagram
+%% Veteran Enrollment Pathway
+    actor Transit Rider
+    participant Benefits as Benefits app
+    participant IdG as Identity Gateway
+    participant Login.gov
+    participant VA.gov
+    participant Littlepay
+Transit Rider->>Benefits: visits benefits.calitp.org
+    activate Benefits
+Benefits-->>IdG: eligibility verification
+    activate IdG
+Transit Rider->>Login.gov: account authentication
+    activate Login.gov
+IdG-->>Login.gov: requests required PII
+    activate Login.gov
+    Note right of Login.gov: transit rider first name<br>transit rider last name<br>home address<br>date of birth
+Login.gov-->>IdG: returns required PII
+    deactivate Login.gov
+IdG-->>VA.gov: check veteran status
+    activate VA.gov
+VA.gov-->>IdG: return veteran status
+    deactivate VA.gov
+IdG-->>Benefits: eligibility response
+    deactivate IdG
+    deactivate Login.gov
+Benefits-->>Littlepay: payment enrollment start
+    activate Littlepay
+Transit Rider->>Littlepay: provides debit or credit card details
+Littlepay-->>Benefits: payment method enrollment confirmation
+    deactivate Littlepay
+    deactivate Benefits
+
    +
  1. The transit rider visits the web application at benefits.calitp.org in a browser on their desktop computer.
  2. +
  3. The transit rider chooses the transit provider that serves their area.
  4. +
  5. The transit rider selects the option to receive a reduced fare for veterans.
  6. +
  7. The transit rider authenticates with their existing Login.gov account or creates a Login.gov account if they don’t have one.
  8. +
  9. The Cal-ITP Benefits app interfaces with the California Department of Technology Identity Gateway (IdG) to verify benefit eligibility. The IdG requests the required personal information to verify veteran status from Login.gov.
  10. +
  11. The IdG utilizes the Veteran Confirmation API provided by the US Department of Veterans Affairs to determine the rider’s veteran status.
  12. +
  13. The IdG passes the response from VA.gov as veteran status = TRUE to the Cal-ITP Benefits app to indicate the person is eligible for a benefit.
  14. +
  15. The transit rider provides the debit or credit card details they use to pay for transit to Littlepay, the transit processor that facilitates transit fare collection.
  16. +
  17. The app registers the veteran benefit with the transit rider’s debit or credit card.
  18. +
+

Alternative flows

+
    +
  • If the transit rider does not have a desktop computer, they can open the web application at benefits.calitp.org in a mobile browser on their iOS or Android tablet or mobile device to complete enrollment using the basic flow.
  • +
  • Suppose the transit rider cannot authenticate with Login.gov, or will not create an account. In either case, the app cannot determine their veteran status and, thus, cannot enroll their contactless debit or credit card for a reduced fare.
  • +
  • If VA.gov determines the person does not meet the definition of a veteran (IdG returns a veteran status of FALSE), the Cal-ITP Benefits app will not allow the transit rider to enroll their contactless debit or credit card for a reduced fare.
  • +
  • If the debit or credit card expires or is canceled by the issuer, the transit rider must repeat the basic flow to register a new debit or credit card.
  • +
  • If the transit rider uses more than one debit or credit card to pay for transit, they repeat the basic flow for each card.
  • +
+

Postcondition

+

The transit rider receives a fare reduction each time they use the debit or credit card they registered to pay for transit rides. The number of times they can use the card to pay for transit is unlimited and the benefit never expires.

+

Benefits

+
    +
  • The transit rider no longer needs cash to pay for transit rides.
  • +
  • The transit rider doesn’t have to lock up funds on a closed-loop card offered by the transit provider.
  • +
  • The transit rider pays for transit rides with their debit or credit card, just as they pay for any other good or service that accepts contactless payment.
  • +
  • The transit rider can enroll in a transit benefit from home when convenient; they do not have to visit a transit provider in person.
  • +
  • Secure state and federal solutions manage the transit rider’s personal identifiable information (PII): Login.gov and the California Department of Technology Identity Gateway (IdG). Transit riders do not have to share personal information with local transit agencies.
  • +
  • Benefits enrollment takes minutes rather than days or weeks.
  • +
+

Example scenario

+

A veteran in California uses public transit regularly. They don’t have a car and depend on buses to get to appointments and do errands that take too long to use their bicycle. They receive a 50% fare reduction for being a US veteran but have to pay for transit rides using the closed loop card provided by the agency to receive the reduced fare. It’s frustrating and inconvenient to reload this agency card in $10 payments every week, especially because they sometimes need the money tied up on the card to pay for groceries and medication.

+

The transit provider serving their part of California implements contactless payments on fixed bus routes throughout the service area. This rider uses benefits.calitp.org to confirm their veteran status and register their debit card for reduced fares. They tap to pay when boarding buses in their area and are automatically charged the reduced fare. They no longer need to carry one card to pay for transit and another for other purchases. Best of all, they have complete access to all funds in their weekly budget. If food and medication costs are higher one week, they can allocate additional funds to those areas and ride transit less.

+ + + + + + + + + + + + + + + +
+
+ + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + \ No newline at end of file diff --git a/getting-started/development/index.html b/getting-started/development/index.html new file mode 100644 index 000000000..3d49f43ef --- /dev/null +++ b/getting-started/development/index.html @@ -0,0 +1,15 @@ + + + + + + Redirecting... + + + + + + +Redirecting... + + diff --git a/getting-started/docker-dynamic-ports/index.html b/getting-started/docker-dynamic-ports/index.html new file mode 100644 index 000000000..7f1c251e9 --- /dev/null +++ b/getting-started/docker-dynamic-ports/index.html @@ -0,0 +1,15 @@ + + + + + + Redirecting... + + + + + + +Redirecting... + + diff --git a/getting-started/documentation/index.html b/getting-started/documentation/index.html new file mode 100644 index 000000000..a856c8c26 --- /dev/null +++ b/getting-started/documentation/index.html @@ -0,0 +1,1886 @@ + + + + + + + + + + + + + + + + + + + + + + + + + Documentation - cal-itp/benefits: documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + + + + +
+
+ + + +
+
+
+ + + + + + + + + +
+
+
+ + + + +
+
+ + + + + + + +

Documentation

+

This website is built using mkdocs from the contents of the main (default) branch.

+

The mkdocs.yml file in the repository root configures the build process, including the available plugins.

+

Editing

+

All content lives under the docs/ directory in the repository.

+

To add new sections/articles, create new directories and files under the docs/ directory, in Markdown format.

+

The pencil icon is a shortcut to quickly edit the content of the page you are viewing on the website:

+

Screenshot showing edit pencil

+

Above: Screenshot showing the edit pencil circled in red

+

Features

+ +
    +
  • +

    Mermaid

    +

    Use code fences with mermaid type to render Mermaid diagrams within docs. For example, this markdown:

    +
    ```mermaid
    +graph LR
    +    Start --> Stop
    +```
    +
    +

    Yields this diagram:

    +
    graph LR
    +    Start --> Stop
    +
  • +
+

Running locally

+

The documentation website can be run locally using Docker Compose:

+
# from inside the .devcontainer/ directory
+docker compose up docs
+
+

The site is served from http://localhost at a port dynamically assigned by Docker. See +Docker dynamic ports for more information.

+

The website is automatically rebuilt as changes are made to docs/ files.

+

In the Devcontainer

+

When running the Devcontainer, the docs site is automatically started.

+

See Docker dynamic ports for more information on accessing the site on localhost.

+

Deploying

+

A GitHub Action watches for pushes to main, and uses +mhausenblas/mkdocs-deploy-gh-pages to build the mkdocs content, force-pushing to the gh-pages +branch. At that point, GitHub Pages redeploys the docs site.

+ + + + + + + + + + + + + + + +
+
+ + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + \ No newline at end of file diff --git a/getting-started/img/edit-pencil.png b/getting-started/img/edit-pencil.png new file mode 100644 index 0000000000000000000000000000000000000000..79a9c75e803be6a6bd860a0a0eddd48c2ade976e GIT binary patch literal 44841 zcmd4&^PmF^ndjF?DFL18qbMvo8} z{h8PEx?cam_kH{Rud=(aH@5AEeNs-m2(pZR___6M`y?YB4iKifKKnemy$`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!6;_PEy$wU=zCI z$yjZ;NwxvVc=xO}qD(*4)JHE)O6Ksp%cE~B*$2amZbI;Gzd zxxfOSlXO8+o$0{Ql0Yrq2y-c?Yk zM?2(3&a4a|RcLZ7uenqc7eQ@`+nuAyank;L(nm8Rg?~+R2fEz>WTgOq{?YUDHOx_$Of$Xu2-tFV1ub>Z#qHr(khMTJLJ%p# zU~yH!^d8XHegJZh1|4Ax&4Rcp6%P%`4%q>bO?Jr-@7SbWYEe{@ek9O$1Y%y{c%qm4 zCQ|K0leyX@vR6vOc60DX!NGtlsg;6`MvsQxUBpO!rL6kj<>bBp#<=?ND;20P?);GA zB~Ha@vRt$QEZ;g@e}{qzd&)iq)hsF!tIjE^&~(cFjyndlX$JFX8_LF;@|UIUKyvHCQEJV-Z*s*g8u85Nr;tDQRQ_vlzR2^{ zvQ&r%#`|b9*IbOI#akAcP#%}UirdvL1_4E!;vpq&QL#R?H@0g^C9E{$4hEujlABq@ z^{&X=n`Q+)EN&CH>tjqAf3A9H%G?s)g1oIh21tKAkHIQ|XO2y5X0BV0zZ^(SDn^rE zh5*){M%o#4{5aR~U(jPCqxIyT0TNje+JbdEFYO8zOb6YROqgkM>kpP(0fQ6~X8P|Q e8Pys%d6??d%68Q(`tup^qoZM{Uao2v{=Wd66AnoL literal 0 HcmV?d00001 diff --git a/getting-started/index.html b/getting-started/index.html new file mode 100644 index 000000000..e6a8d50bd --- /dev/null +++ b/getting-started/index.html @@ -0,0 +1,1863 @@ + + + + + + + + + + + + + + + + + + + + + + + + + Local setup - cal-itp/benefits: documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + + + + +
+
+ + + +
+
+
+ + + + + + + + + +
+
+
+ + + + +
+
+ + + + + + + +

Local setup

+

Running the Benefits application in a local, non-production environment requires Docker.

+

The following commands should be run in a terminal program like bash.

+

Clone the repository

+
git clone https://github.com/cal-itp/benefits
+
+

Create an environment file

+

The application is configured with defaults to run locally, but an .env file is required to run with Docker Compose. Start from the existing sample:

+
cp .env.sample .env
+
+

E.g. to change the localhost port from the default 8000 to 9000, add the following line to your .env file:

+
DJANGO_LOCAL_PORT=9000
+
+

See Configuration for more details on supported environment variables and their settings.

+

Run the build script

+

This builds the runtime and devcontainer images:

+
bin/build.sh
+
+

If you need all layers to rebuild, use:

+
docker compose build --no-cache client
+
+

Start the client

+

The optional -d flag will start in detatched mode and allow you to continue using the terminal session.

+
docker compose up -d client
+
+

Otherwise attach your terminal to the container’s terminal, showing the startup and runtime output:

+
docker compose up client
+
+

After initialization, the client is running running on http://localhost:8000 by default.

+

The backend administrative interface can be accessed at the /admin route using the superuser account you setup as part of initialization.

+

By default, sample values are used to initialize Django. Alternatively you may:

+
    +
  • Set environment variable values to use instead of the default sample values
  • +
+

Stop the running services with:

+
docker compose down
+
+ + + + + + + + + + + + + + + +
+
+ + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + \ No newline at end of file diff --git a/index.html b/index.html new file mode 100644 index 000000000..23e743c25 --- /dev/null +++ b/index.html @@ -0,0 +1,1976 @@ + + + + + + + + + + + + + + + + + + + + + + + Project overview - cal-itp/benefits: documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + + + + +
+
+ + + +
+
+
+ + + + + + + + + +
+
+
+ + + + +
+
+ + + + + + + +

Project overview

+

This website provides technical documentation for the benefits application from the +California Integrated Travel Project (Cal-ITP).

+

Cal-ITP Benefits - Landing - Laptop+Mobile

+

Cal-ITP Benefits is a web application that enables digital eligibility verification and enrollment for transit benefits onto transit riders’ existing contactless debit and credit cards.

+

The development of this publicly-accessible client is being managed by Caltrans’ California Integrated Travel Project (Cal-ITP), in partnership with the California Department of Technology (CDT). From the Cal-ITP site:

+
+

Our Cal-ITP Benefits web application streamlines the process for transit riders to instantly qualify for and receive discounts, starting with Monterey-Salinas Transit (MST), which offers a half-price Senior Fare. Now older adults (65+) who are able to electronically verify their identity are able to access MST’s reduced fares without the hassle of paperwork.

+

We worked with state partners on this product launch, and next we’re working to bring youth, lower-income riders, veterans, people with disabilities, and others the same instant access to free or reduced fares across all California transit providers, without having to prove eligibility to each agency.

+
+

Adoption by transit agencies

+

The following California transit agencies have launched Cal-ITP Benefits for their riders, with the following enrollment pathway options:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Transit agencyOlder adultsAgency cardVeteransLow-incomeInitial agency launch
Monterey-Salinas TransitLiveLiveLive12/2021
Santa Barbara Metropolitan Transit DistrictLiveLive 10/2023
Sacramento Regional Transit DistrictIn test   
+

Supported enrollment pathways

+

The Cal-ITP Benefits app supports the following enrollment pathways that use the corresponding eligibility verification methods:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Enrollment pathwayEligibility verificationStatusLaunch
Older adultsLogin.gov ID ProofedLive08/2022
Agency cardsEligibility APILive11/2022
VeteransVeteran Confirmation APILive09/2023
Low-incomeCalFresh Confirm APILive07/2024
+

Read more about each enrollment pathway.

+

Technical and security details

+

benefits is a Django 5 web application. The application talks to one or more Eligibility Verification APIs or claims providers. These APIs and the application itself are +designed for privacy and security of user information:

+
    +
  • The API communicates with signed and encrypted JSON Web Tokens containing only the most necessary of user data for the purpose of eligibility verification
  • +
  • The application requires no user accounts and stores no information about the user
  • +
  • Interaction with the application is anonymous, with only minimal event tracking for usage and problem analysis
  • +
+

Running the application locally is possible with Docker and Docker Compose. Hosting information.

+

The user interface and content is available in both English and Spanish. Additional language support is possible via Django’s +i18n and l10n features.

+

The application communicates with external services like Littlepay via API calls and others like the Identity Gateway via redirects, both over the public internet. See all the system interconnections.

+

Infrastructure

+

The Benefits application is deployed to Microsoft Azure. Traffic is encrypted between the user and the application, as well as between the application and external systems.

+

The network is managed by the California Department of Technology (CDT), who provide a firewall and distributed denial-of-service (DDoS) protection.

+

You can find more technical details on our infrastructure page.

+

Data storage

+

The Benefits application doesn’t collect or store any user data directly, and we minimize the information exchanged between systems. The following information is temporarily stored in an encrypted session in the user’s browser:

+
    +
  • The user’s progress through an enrollment pathway
  • +
  • Credentials for interacting with the eligibility verification services
  • +
+

Sensitive user information exists in the following places:

+ +

None of that information is accessible to the Benefits system/team.

+

Learn more about the security/privacy practices of some of our third-party integrations:

+ +

Benefits collects analytics on usage, without any identifying information. You can find more details on our analytics page.

+

Practices

+

Dependabot immediately notifies the team of vulnerabilities in application dependencies.

+

Upon doing new major integrations, features, or architectural changes, the Benefits team has a penetration test performed by a third party to ensure the security of the system.

+

All code changes are reviewed by at least one other member of the engineering team, which is enforced through branch protections.

+ + + + + + + + + + + + + + + +
+
+ + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + \ No newline at end of file diff --git a/product-and-design/analytics/index.html b/product-and-design/analytics/index.html new file mode 100644 index 000000000..e8fb20825 --- /dev/null +++ b/product-and-design/analytics/index.html @@ -0,0 +1,2065 @@ + + + + + + + + + + + + + + + + + + + + + + + + + Analytics - cal-itp/benefits: documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + + + + +
+
+ + + +
+
+
+ + + + + + + + + +
+
+
+ + + + +
+
+ + + + + + + +

Analytics

+

The Cal-ITP Benefits application, currently live at https://benefits.calitp.org/, uses Amplitude to collect specific user and event data properties to analyze application usage.

+

Information not collected

+

The following user attributes are not collected:

+
    +
  • IP address
  • +
  • Designated Market Area (DMA)
  • +
+

See the Amplitude analytics code on GitHub.

+

User information collected

+

A combination of default and application-specific custom user properties are collected for each user who visits the Benefits web application.

+

Default Amplitude user properties collected

+

The following attributes are collected from the browser of every user who visits the application, provided the browser does not block the tracking library:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
User propertyDescriptionExample value(s)
CarrierThe device’s carrier.Verizon
CountryCountry of the event. This is pulled using GeoIP.United States
CityCity of the event. This is pulled using GeoIP.San Francisco
Device familyFamily of the device.Apple iPhone, Samsung Galaxy Tablet, Windows
Device typeSpecific type of device.Apple iPhone 6, Samsung Galaxy Note 4, Windows
LanguageLanguage of the device.English
LibraryLibrary used to send the event.Amplitude-iOS/3.2.1, HTTP/1.0
OSOperating system is the name of the user’s mobile operating system or browser. Operating system version is the version of the users’ mobile operating system or browser.iOS 9.1, Chrome 46
PlatformPlatform of the product.Web
RegionRegion (e.g. state, province, county) of the event. This is pulled using GeoIP.California
Start versionFirst version of the application identified for the user.1.0.0
VersionCurrent verison of the application identified for the user1.0.0
+

Read more about each property on the Amplitude documentation.

+

Custom user properties collected

+

The following custom user attributes are collected when the user performs specific actions on the application, like selecing an eligibility type or transit agency:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
User propertyDescriptionExample value(s)
eligibility_typesEligibility type chosen by user [veteran]
eligibility_verifierEligibility verifier used by user VA.gov - Veteran (MST)
referrerURL that the event came from https://benefits.calitp.org/help/
referring_domainDomain that the event came from benefits.calitp.org
transit_agencyAgency chosen by the user Monterey-Salinas Transit
user_agentUser’s browser agent Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36
+

Event information collected

+

Information is collected on key user actions on the app, called events. Read about each event on the Amplitude event documentation for Benefits. Each event is categorized within one of four categories: core, authentication, eligibility or enrollment.

+

Core events

+

These events track when a user clicks on a link on the application.

+
    +
  • changed language
  • +
  • clicked link
  • +
  • viewed page
  • +
+

Read more on each of these events on the Amplitude event documentation for Benefits, filtered by Core.

+

Authentication events

+

These events track the progress of a user going through the authentication process of both signing in and optionally signing out.

+
    +
  • canceled sign in
  • +
  • finished sign in
  • +
  • finished sign out
  • +
  • started sign in
  • +
  • started sign out
  • +
+

Read more on each of these events on the Amplitude event documentation for Benefits, filtered by Authentication.

+

Eligibility events

+

These events track the progress of a user choosing an eligibility verifier and completing eligibility verification.

+
    +
  • returned eligibility
  • +
  • selected eligibility verifier
  • +
  • started eligibility
  • +
+

Read more on each of these events on the Amplitude event documentation for Benefits, filtered by Eligibility.

+

Enrollment events

+

These events track the progress of a user who has successfully verified their eligibility and is enrolling their payment card with the system.

+
    +
  • closed payment connection
  • +
  • returned enrollment
  • +
  • started payment connection
  • +
+

Read more on each of these events on the Amplitude event documentation for Benefits, filtered by Enrollment.

+

Key metrics

+

Various key metrics are collected and analyzed, including:

+
    +
  • Number of users who successfully completed authentication: Users who started sign in, finished sign in
  • +
  • Number of users who successfully verified eligibility: Users who completed the above and selected eligibility verifier, started eligibility, returned eligibility with a status of True
  • +
  • Numbers of users who successfully completed enrollment: Users who completed all of the above and started payment connection, closed payment connection and returned enrollment with a status of Success
  • +
+ + + + + + + + + + + + + + + +
+
+ + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + \ No newline at end of file diff --git a/product-and-design/copy-delivery/index.html b/product-and-design/copy-delivery/index.html new file mode 100644 index 000000000..06f872c15 --- /dev/null +++ b/product-and-design/copy-delivery/index.html @@ -0,0 +1,1882 @@ + + + + + + + + + + + + + + + + + + + + + + + + + Copy delivery process - cal-itp/benefits: documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + + + + +
+
+ + + +
+
+
+ + + + + + + + + +
+
+
+ + + + +
+
+ + + + + + + +

Copy delivery process

+

The locale folder in this repository contain the django.po message files for English and Spanish translation strings for the Benefits application.

+

Translation strings include all application copy, including:

+
    +
  • All application copy
  • +
  • Image and illustration alt tags
  • +
  • Page titles used in the browser tab
  • +
  • In-line link URLs
  • +
  • Error messages (like no script, no cookies warnings)
  • +
+

Cal-ITP Benefits Application Copy

+

The human-readable version of the English and Spanish translation strings for the application are delivered to Design and Engineering by Product, and live at this link: Cal-ITP Benefits Application Copy.

+

By tabs:

+
    +
  • EN-USA tab contains all copy for English, which each row representing a page. This copy uses a sample agency, called California State Transit (CST) with an Agency Card. This copy is used in Figma.
  • +
  • forTranslation and All Agencies tab contains the English and Spanish translation side by side, with agency-specific copy.
  • +
+

Copy delivery process responsibilities

+

Product

+
    +
  • Engage with product stakeholders to get the information necessary for copy writing.
  • +
  • Engage with copy writers to get the English language copy drafted, proofed and ready for design.
  • +
  • Engage with client editorial/communications team to ensure English language and Spanish language copy are edited according to client style guides.
  • +
  • Engage all necessary stakeholders to get English language copy approved and ready for design.
  • +
  • Compile copy in Cal-ITP Benefits Application Copy, ready to be used by Design, so Design can sync the spreadsheet to Figma.
  • +
  • Engage with the translation agency, iBabbleOn, to get Spanish translations ready for Engineering.
  • +
  • Transfer translations from iBabbleOn to the spreadsheet, in proper format.
  • +
  • Ensure English and Spanish copy is ready for Engineering.
  • +
+

Design

+ +

Engineering

+
    +
  • Use copy from the English and Spanish language tabs of the spreadsheet, and turning it into code in django.po message files. Developer-specific instructions in the Django message files technical documentation.
  • +
  • Ensure the messages accurately reflect the spreadsheet and Figma designs.
  • +
+ + + + + + + + + + + + + + + +
+
+ + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + \ No newline at end of file diff --git a/product-and-design/copy-style/index.html b/product-and-design/copy-style/index.html new file mode 100644 index 000000000..2ded030e5 --- /dev/null +++ b/product-and-design/copy-style/index.html @@ -0,0 +1,2060 @@ + + + + + + + + + + + + + + + + + + + + + + + + + Copy terms and style - cal-itp/benefits: documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + + + + +
+
+ + + +
+
+
+ + + + + + + + + +
+
+
+ + + + +
+
+ + + + + + + +

Copy terms and style

+

Use the following terms and style rules for Benefits application English and Spanish copy. Refer to the Cal-ITP Editorial Style Guide and Language Matters: Cal-ITP Terminology for further guidance.

+

Terms

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
UseEnglishSpanishDo not useUsage
agency cardagency cardtarjeta de agenciaAgency Card (don’t capitalize both words) 
benefit optionbenefit optionopción de beneficio  
Cal-ITPCalifornia Integrated Travel ProjectCalifornia Integrated Travel Project (Proyecto Integrado de Viaje de California, o Cal-ITP por sus siglas en inglés)  
Cal-ITP BenefitsCal-ITP BenefitsCal-ITP BenefitsDo not translate Cal-ITP Benefits 
California Department of TransportationCalifornia Department of TransportationDepartamento de Transporte de California  
California Department of TechnologyCalifornia Department of TechnologyDepartamento de Tecnología de California  
connectsconnectsconecta  
contactless cardcontactless cardtarjeta sin contactopayment card, cashless, tap-to-pay, touchless 
enrollenrollinscribirseapply 
enrollment processenrollment processproceso de inscripción  
GitHubGitHubGitHubGithub 
LittlepayLittlepayLittlepayLittlePay 
Older AdultOlder Adultadultos mayoresSenior 
public transportationpublic transportationtransporte público  
reduced farereduced faretarifa reducidadiscounted 
Social Security numberSocial Security numbernúmero de Seguro Socialsocial security number 
state-issued ID cardstate-issued ID cardtarjeta de identificación emitida por el estadodriver’s license 
tap to ridetap to ridetoque para viajar  
transit agencytransit agencyagencia de tránsitobus agency, light rail agency, transit authorityRefer to Language Matters: Cal-ITP Terminology
transit benefittransit benefitbeneficio de tránsitodiscount, fare discounts, reduced-fare“Older adult transit benefit”, “Veteran transit benefit”
transit providertransit providerproveedor de transporte  
US VeteranUS VeteranVeterano de EE. UU.U.S. Veteran, US veteranNote: This currently goes against Cal-ITP Editorial Style Guide
verifyverifyverifique  
+

Style

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 RuleExamples 
CapitalizationAlways sentence-case body text, headlines, questions on Help page.Unable to confirm eligibility | Cal-ITP Benefits 
In English, names of pages are capitalized.Return HomePrevious Page
In Spanish, names of pages are not capitalized.Volver al inicioPágina anterior
Refer to Cal-ITP Editorial Style Guide  
Images, illustrationsAlways write an alt tag, unless Design determines the visual is purely decorative and has no substantive meaning.  
LinksNever link to “here”. Use a descriptive title for the page.  
TenseFor Spanish, use usted/formal case for all copy.  
NumbersRefer to Cal-ITP Editorial Style Guide  
SpacingRefer to Cal-ITP Editorial Style Guide  
PunctuationRefer to Cal-ITP Editorial Style Guide 
+ + + + + + + + + + + + + + + +
+
+ + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + \ No newline at end of file diff --git a/product-and-design/use-cases/enrollment-use-cases/index.html b/product-and-design/use-cases/enrollment-use-cases/index.html new file mode 100644 index 000000000..8a10a75f1 --- /dev/null +++ b/product-and-design/use-cases/enrollment-use-cases/index.html @@ -0,0 +1,1830 @@ + + + + + + + + + + + + + + + + + + + + + + + + + Enrollment use cases - cal-itp/benefits: documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + + + + +
+
+ + + +
+
+
+ + + + + + + + + +
+
+
+ + + + +
+
+ + + + + + + +

Enrollment use cases

+ +

The use cases documented on this page focus on how the system is supposed to work from the perspective of the end user.

+

Use case: Enroll contactless card to receive transit benefit

+

Primary Actor: Transit rider

+

Systems: Benefits app, transit processor

+

Preconditions:

+
    +
  • Transit rider has confirmed their eligibility with the Benefits app
  • +
  • Transit rider has their contactless card information available
  • +
  • Benefits app is able to contact the transit processor
  • +
+

Trigger: Transit rider initiates the enrollment phase

+

Basic flow:

+
    +
  1. Transit rider enters their contactless card information
  2. +
  3. Benefits app passes that information to the transit processor to enroll the card
  4. +
  5. Transit processor successfully enrolls card
  6. +
+

Alternate flows:

+
    +
  • +

    3a. Transit processor returns with one of the following errors: card verification failed, token is invalid, or general server error

    +
      +
    • 3a1. Transit rider chooses to retry, starting back at initiating the enrollment phase
    • +
    • 3b1. Transit rider leaves the Benefits app
    • +
    +
  • +
+

Postconditions:

+
    +
  • Transit rider’s contactless card is enrolled to receive the transit benefit
  • +
+ + + + + + + + + + + + + + + +
+
+ + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + \ No newline at end of file diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 000000000..b761aded8 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,6 @@ +mdx_truly_sane_lists +mkdocs==1.6.0 +mkdocs-awesome-pages-plugin +mkdocs-macros-plugin +mkdocs-material==9.5.31 +mkdocs-redirects diff --git a/search/search_index.json b/search/search_index.json new file mode 100644 index 000000000..279b6945b --- /dev/null +++ b/search/search_index.json @@ -0,0 +1 @@ +{"config":{"lang":["en"],"separator":"[\\s\\-]+","pipeline":["stopWordFilter"]},"docs":[{"location":"","title":"Project overview","text":"

This website provides technical documentation for the benefits application from the California Integrated Travel Project (Cal-ITP).

Cal-ITP Benefits is a web application that enables digital eligibility verification and enrollment for transit benefits onto transit riders\u2019 existing contactless debit and credit cards.

The development of this publicly-accessible client is being managed by Caltrans\u2019 California Integrated Travel Project (Cal-ITP), in partnership with the California Department of Technology (CDT). From the Cal-ITP site:

Our Cal-ITP Benefits web application streamlines the process for transit riders to instantly qualify for and receive discounts, starting with Monterey-Salinas Transit (MST), which offers a half-price Senior Fare. Now older adults (65+) who are able to electronically verify their identity are able to access MST\u2019s reduced fares without the hassle of paperwork.

We worked with state partners on this product launch, and next we\u2019re working to bring youth, lower-income riders, veterans, people with disabilities, and others the same instant access to free or reduced fares across all California transit providers, without having to prove eligibility to each agency.

"},{"location":"#adoption-by-transit-agencies","title":"Adoption by transit agencies","text":"

The following California transit agencies have launched Cal-ITP Benefits for their riders, with the following enrollment pathway options:

Transit agency Older adults Agency card Veterans Low-income Initial agency launch Monterey-Salinas Transit Live Live Live 12/2021 Santa Barbara Metropolitan Transit District Live Live 10/2023 Sacramento Regional Transit District In test"},{"location":"#supported-enrollment-pathways","title":"Supported enrollment pathways","text":"

The Cal-ITP Benefits app supports the following enrollment pathways that use the corresponding eligibility verification methods:

Enrollment pathway Eligibility verification Status Launch Older adults Login.gov ID Proofed Live 08/2022 Agency cards Eligibility API Live 11/2022 Veterans Veteran Confirmation API Live 09/2023 Low-income CalFresh Confirm API Live 07/2024

Read more about each enrollment pathway.

"},{"location":"#technical-and-security-details","title":"Technical and security details","text":"

benefits is a Django 5 web application. The application talks to one or more Eligibility Verification APIs or claims providers. These APIs and the application itself are designed for privacy and security of user information:

  • The API communicates with signed and encrypted JSON Web Tokens containing only the most necessary of user data for the purpose of eligibility verification
  • The application requires no user accounts and stores no information about the user
  • Interaction with the application is anonymous, with only minimal event tracking for usage and problem analysis

Running the application locally is possible with Docker and Docker Compose. Hosting information.

The user interface and content is available in both English and Spanish. Additional language support is possible via Django\u2019s i18n and l10n features.

The application communicates with external services like Littlepay via API calls and others like the Identity Gateway via redirects, both over the public internet. See all the system interconnections.

"},{"location":"#infrastructure","title":"Infrastructure","text":"

The Benefits application is deployed to Microsoft Azure. Traffic is encrypted between the user and the application, as well as between the application and external systems.

The network is managed by the California Department of Technology (CDT), who provide a firewall and distributed denial-of-service (DDoS) protection.

You can find more technical details on our infrastructure page.

"},{"location":"#data-storage","title":"Data storage","text":"

The Benefits application doesn\u2019t collect or store any user data directly, and we minimize the information exchanged between systems. The following information is temporarily stored in an encrypted session in the user\u2019s browser:

  • The user\u2019s progress through an enrollment pathway
  • Credentials for interacting with the eligibility verification services

Sensitive user information exists in the following places:

  • To enroll in a senior discount, users need to provide personal information to Login.gov.
  • Users need to provide their credit or debit card information to our transit processor (Littlepay) to enroll in a discount.

None of that information is accessible to the Benefits system/team.

Learn more about the security/privacy practices of some of our third-party integrations:

  • Amplitude
  • Littlepay
  • Login.gov

Benefits collects analytics on usage, without any identifying information. You can find more details on our analytics page.

"},{"location":"#practices","title":"Practices","text":"

Dependabot immediately notifies the team of vulnerabilities in application dependencies.

Upon doing new major integrations, features, or architectural changes, the Benefits team has a penetration test performed by a third party to ensure the security of the system.

All code changes are reviewed by at least one other member of the engineering team, which is enforced through branch protections.

"},{"location":"configuration/","title":"Configuring the Benefits app","text":"

The Getting Started section and sample configuration values in the repository give enough detail to run the app locally, but further configuration is required before many of the integrations and features are active.

There are two primary components of the application configuration:

  • Overall app settings in environment variables
  • Content and more specific configurations in the data migration file

Many (but not all) of the environment variables are read into Django settings during application startup.

The model objects defined in the data migration file are also loaded into and seed Django\u2019s database at application startup time.

See the Setting secrets section for how to set secret values for a deployment.

"},{"location":"configuration/#django-settings","title":"Django settings","text":"

Settings file

benefits/settings.py

Django docs

Django settings

The Django entrypoint for production runs is defined in benefits/wsgi.py.

This file names the module that tells Django which settings file to use:

import os\n\nos.environ.setdefault(\"DJANGO_SETTINGS_MODULE\", \"benefits.settings\")\n

Elsewhere, e.g. in manage.py, this same environment variable is set to ensure benefits.settings are loaded for every app command and run.

"},{"location":"configuration/#using-configuration-in-app-code","title":"Using configuration in app code","text":"

Django docs

Using settings in Python code

From within the application, the Django settings object and the Django models are the two interfaces for application code to read configuration data.

Rather than importing the app\u2019s settings module, Django recommends importing the django.conf.settings object, which provides an abstraction and better handles default values:

from django.config import settings\n\n# ...\n\nif settings.DEBUG:\n    # do something when debug is enabled\nelse:\n    # do something else when debug is disabled\n

Through the Django model framework, benefits.core.models instances are used to access the configuration data:

from benefits.core.models import TransitAgency\n\nagency = TransitAgency.objects.get(short_name=\"ABC\")\n\nif agency.active:\n    # do something when this agency is active\nelse:\n    # do something when this agency is inactive\n
"},{"location":"configuration/admin-interface/","title":"Admin interface","text":"

Django docs

The Django admin site

The configuration values that can be stored in the application database are managed directly in the Django Admin interface at the /admin endpoint.

Single sign-on authentication is supported by the admin interface using django-google-sso.

"},{"location":"configuration/admin-interface/#environment-variables","title":"Environment variables","text":"

django-google-sso docs

All settings for django-google-sso

settings.py

Configuration of django-google-sso in Benefits settings

These environment variables must be set in your .env file to use the admin interface locally:

"},{"location":"configuration/admin-interface/#google_sso_client_id","title":"GOOGLE_SSO_CLIENT_ID","text":"

The Google OAuth 2.0 Web Application Client ID.

"},{"location":"configuration/admin-interface/#google_sso_project_id","title":"GOOGLE_SSO_PROJECT_ID","text":"

The Google OAuth 2.0 Project ID.

"},{"location":"configuration/admin-interface/#google_sso_client_secret","title":"GOOGLE_SSO_CLIENT_SECRET","text":"

The Google OAuth 2.0 Web Application Client Secret.

"},{"location":"configuration/admin-interface/#google_sso_allowable_domains","title":"GOOGLE_SSO_ALLOWABLE_DOMAINS","text":"

List of domains that will be allowed to create users.

"},{"location":"configuration/admin-interface/#google_sso_staff_list","title":"GOOGLE_SSO_STAFF_LIST","text":"

List of emails that will be created as staff.

\u201cStaff\u201d refers to Django\u2019s concept of a user with is_staff set to True, which means they can log in, and also to the Cal-ITP Benefits concept of a user who should have a \u201cCal-ITP staff\u201d level of access to configuration values.

"},{"location":"configuration/admin-interface/#google_sso_superuser_list","title":"GOOGLE_SSO_SUPERUSER_LIST","text":"

List of emails that will be created as superuser.

"},{"location":"configuration/admin-interface/#to-add-a-new-user","title":"To add a new user:","text":"
  • Add the user\u2019s email to either GOOGLE_SSO_STAFF_LIST or GOOGLE_SSO_SUPERUSER_LIST depending on what permissions they should have.
    • The email must be from a domain that is in the GOOGLE_SSO_ALLOWABLE_DOMAINS list.
  • Restart the Benefits application so that Django settings are re-loaded.
  • Have the user log in to the admin interface with their Google account.
"},{"location":"configuration/content-security-policy/","title":"Configuring the Content Security Policy","text":"

MDN docs

The Mozilla Developer Network has more on Content Security Policy

The HTTP Content-Security-Policy response header allows web site administrators to control resources the user agent is allowed to load for a given page.

With a few exceptions, policies mostly involve specifying server origins and script endpoints. This helps guard against cross-site scripting attacks

Strict CSP

Benefits configures a Strict Content Security Policy. Read more about Strict CSP from Google: https://csp.withgoogle.com/docs/strict-csp.html.

"},{"location":"configuration/content-security-policy/#django-csp","title":"django-csp","text":"

django-csp docs

Configuring django-csp

Benefits uses the open source django-csp library for helping to configure the correct response headers.

"},{"location":"configuration/content-security-policy/#environment-variables","title":"Environment Variables","text":""},{"location":"configuration/content-security-policy/#django_csp_connect_src","title":"DJANGO_CSP_CONNECT_SRC","text":"

Comma-separated list of URIs. Configures the connect-src Content Security Policy directive.

"},{"location":"configuration/content-security-policy/#django_csp_font_src","title":"DJANGO_CSP_FONT_SRC","text":"

Comma-separated list of URIs. Configures the font-src Content Security Policy directive.

"},{"location":"configuration/content-security-policy/#django_csp_frame_src","title":"DJANGO_CSP_FRAME_SRC","text":"

Comma-separated list of URIs. Configures the frame-src Content Security Policy directive.

"},{"location":"configuration/content-security-policy/#django_csp_script_src","title":"DJANGO_CSP_SCRIPT_SRC","text":"

Comma-separated list of URIs. Configures the script-src Content Security Policy directive.

"},{"location":"configuration/content-security-policy/#django_csp_style_src","title":"DJANGO_CSP_STYLE_SRC","text":"

Comma-separated list of URIs. Configures the style-src Content Security Policy directive.

"},{"location":"configuration/data/","title":"Configuration data","text":"

Sample data fixtures

benefits/core/migrations/local_fixtures.json

Django docs

How to provide initial data for models

"},{"location":"configuration/data/#introduction","title":"Introduction","text":"

The app\u2019s model classes are defined in benefits/core/models.py.

Migrations are run as the application starts up. See the bin/init.sh script.

The sample values provided in the repository are sufficient to run the app locally and interact with e.g. the sample Transit Agencies. Django fixtures are used to load the database with sample data when running locally.

During the deployment process, some environment-specific values are set in environment variables and read dynamically at runtime. Most configuration values are managed directly in the Django Admin interface at the /admin endpoint.

"},{"location":"configuration/data/#sample-data","title":"Sample data","text":"

The sample data included in the repository is enough to bootstrap the application with basic functionality:

  • Multiple transit agency configurations
  • Multiple eligibility verification pathways
  • With and without authentication required before eligibility verification
  • In concert with the sample eligibility server, verification with test user data
"},{"location":"configuration/data/#not-included","title":"Not included","text":"

Some configuration data is not available with the samples in the repository:

  • OAuth configuration to enable authentication (read more about OAuth configuration)
  • reCAPTCHA configuration for user-submitted forms
  • Transit processor configuration for the enrollment phase
  • Amplitude configuration for capturing analytics events
"},{"location":"configuration/data/#rebuilding-the-configuration-database-locally","title":"Rebuilding the configuration database locally","text":"

A local Django database will be initialized upon first startup of the devcontainer.

To rebuild the local Django database, run the bin/reset_db.sh script from within the repository root, inside the devcontainer:

bin/reset_db.sh\n

See the Django Environment Variables section for details about how to configure the local database rebuild.

"},{"location":"configuration/environment-variables/","title":"Environment variables","text":"

The first steps of the Getting Started guide mention creating an .env file.

The sections below outline in more detail the application environment variables that you may want to override, and their purpose. In Azure App Services, this is more generally called the \u201cconfiguration\u201d.

See other topic pages in this section for more specific environment variable configurations.

Multiline environment variables

Although Docker, bash, etc. support multiline values directly in e.g. an .env file:

multi_line_value='first line\nsecond line\nthird line'\n

The VS Code Python extension does not parse multiline values: https://code.visualstudio.com/docs/python/environments#_environment-variables

When specifying multiline values for local usage, use the literal newline character \\n but maintain the single quote wrapper:

multi_line_value='first line\\nsecond line\\third line'\n

A quick bash script to convert direct multiline values to their literal newline character equivalent is:

echo \"${multi_line_value//$'\\n'/\\\\n}\"\n
"},{"location":"configuration/environment-variables/#amplitude","title":"Amplitude","text":"

Amplitude API docs

Read more at https://developers.amplitude.com/docs/http-api-v2#request-format

"},{"location":"configuration/environment-variables/#analytics_key","title":"ANALYTICS_KEY","text":"

Deployment configuration

You may change this setting when deploying the app to a non-localhost domain

Amplitude API key for the project where the app will direct events.

If blank or an invalid key, analytics events aren\u2019t captured (though may still be logged).

"},{"location":"configuration/environment-variables/#django","title":"Django","text":""},{"location":"configuration/environment-variables/#django_allowed_hosts","title":"DJANGO_ALLOWED_HOSTS","text":"

Deployment configuration

You must change this setting when deploying the app to a non-localhost domain

Django docs

Settings: ALLOWS_HOSTS

A list of strings representing the host/domain names that this Django site can serve.

"},{"location":"configuration/environment-variables/#django_db_dir","title":"DJANGO_DB_DIR","text":"

Deployment configuration

You may change this setting when deploying the app to a non-localhost domain

The directory where Django creates its Sqlite database file. Must exist and be writable by the Django process.

By default, the base project directory (i.e. the root of the repository).

"},{"location":"configuration/environment-variables/#django_db_file","title":"DJANGO_DB_FILE","text":"

Local configuration

This setting only affects the app running on localhost

The name of the Django database file to use locally (during both normal app startup and for resetting the database).

By default, django.db.

"},{"location":"configuration/environment-variables/#django_db_fixtures","title":"DJANGO_DB_FIXTURES","text":"

Local configuration

This setting only affects the app running on localhost

A path, relative to the repository root, of Django data fixtures to load when resetting the database.

The file must end in fixtures.json for the script to process it correctly.

By default, benefits/core/migrations/local_fixtures.json.

"},{"location":"configuration/environment-variables/#django_db_reset","title":"DJANGO_DB_RESET","text":"

Local configuration

This setting only affects the app running on localhost

Boolean:

  • True (default): deletes the existing database file and runs fresh Django migrations.
  • False: Django uses the existing database file.
"},{"location":"configuration/environment-variables/#django_debug","title":"DJANGO_DEBUG","text":"

Deployment configuration

Do not enable this in production

Django docs

Settings: DEBUG

Boolean:

  • True: the application is launched with debug mode turned on, allows pausing on breakpoints in the code, changes how static files are served
  • False (default): the application is launched with debug mode turned off, similar to how it runs in production
"},{"location":"configuration/environment-variables/#django_local_port","title":"DJANGO_LOCAL_PORT","text":"

Local configuration

This setting only affects the app running on localhost

The port used to serve the Django application from the host machine (that is running the application container).

i.e. if you are running the app in Docker on your local machine, this is the port that the app will be accessible from at http://localhost:$DJANGO_LOCAL_PORT

From inside the container, the app is always listening on port 8000.

"},{"location":"configuration/environment-variables/#django_log_level","title":"DJANGO_LOG_LEVEL","text":"

Deployment configuration

You may change this setting when deploying the app to a non-localhost domain

Django docs

Settings: LOGGING_CONFIG

The log level used in the application\u2019s logging configuration.

By default the application sends logs to stdout.

"},{"location":"configuration/environment-variables/#django_secret_key","title":"DJANGO_SECRET_KEY","text":"

Deployment configuration

You must change this setting when deploying the app to a non-localhost domain

Django docs

Settings: SECRET_KEY

Django\u2019s primary secret, keep this safe!

"},{"location":"configuration/environment-variables/#django_superuser_email","title":"DJANGO_SUPERUSER_EMAIL","text":"

Local configuration

This setting only affects the app running on localhost

The email address of the Django Admin superuser created when resetting the database.

"},{"location":"configuration/environment-variables/#django_superuser_password","title":"DJANGO_SUPERUSER_PASSWORD","text":"

Local configuration

This setting only affects the app running on localhost

The password of the Django Admin superuser created when resetting the database.

"},{"location":"configuration/environment-variables/#django_superuser_username","title":"DJANGO_SUPERUSER_USERNAME","text":"

Local configuration

This setting only affects the app running on localhost

The username of the Django Admin superuser created when resetting the database.

"},{"location":"configuration/environment-variables/#django_trusted_origins","title":"DJANGO_TRUSTED_ORIGINS","text":"

Deployment configuration

You must change this setting when deploying the app to a non-localhost domain

Django docs

Settings: CSRF_TRUSTED_ORIGINS

Comma-separated list of hosts which are trusted origins for unsafe requests (e.g. POST)

"},{"location":"configuration/environment-variables/#healthcheck_user_agents","title":"HEALTHCHECK_USER_AGENTS","text":"

Deployment configuration

You must change this setting when deploying the app to a non-localhost domain

Comma-separated list of User-Agent strings which, when present as an HTTP header, should only receive healthcheck responses. Used by our HealthcheckUserAgents middleware.

"},{"location":"configuration/environment-variables/#requests-configuration","title":"requests configuration","text":"

requests docs

Docs for timeouts

"},{"location":"configuration/environment-variables/#requests_connect_timeout","title":"REQUESTS_CONNECT_TIMEOUT","text":"

The number of seconds requests will wait for the client to establish a connection to a remote machine. Defaults to 3 seconds.

"},{"location":"configuration/environment-variables/#requests_read_timeout","title":"REQUESTS_READ_TIMEOUT","text":"

The number of seconds the client will wait for the server to send a response. Defaults to 1 second.

"},{"location":"configuration/environment-variables/#cypress-tests","title":"Cypress tests","text":"

Cypress docs

CYPRESS_* variables

"},{"location":"configuration/environment-variables/#cypress_baseurl","title":"CYPRESS_baseUrl","text":"

The base URL for the (running) application, against which all Cypress .visit() etc. commands are run.

When Cypress is running inside the devcontainer, this should be http://localhost:8000. When Cypress is running outside the devcontainer, check the DJANGO_LOCAL_PORT.

"},{"location":"configuration/environment-variables/#sentry","title":"Sentry","text":""},{"location":"configuration/environment-variables/#sentry_dsn","title":"SENTRY_DSN","text":"

Sentry docs

Data Source Name (DSN)

Enables sending events to Sentry.

"},{"location":"configuration/environment-variables/#sentry_environment","title":"SENTRY_ENVIRONMENT","text":"

Sentry docs

environment config value

Segments errors by which deployment they occur in. This defaults to dev, and can be set to match one of the environment names.

local may also be used for local testing of the Sentry integration.

"},{"location":"configuration/environment-variables/#sentry_report_uri","title":"SENTRY_REPORT_URI","text":"

Sentry docs

Security Policy Reporting

Collect information on Content-Security-Policy (CSP) violations. Read more about CSP configuration in Benefits.

To enable report collection, set this env var to the authenticated Sentry endpoint.

"},{"location":"configuration/environment-variables/#sentry_traces_sample_rate","title":"SENTRY_TRACES_SAMPLE_RATE","text":"

Sentry docs

traces_sample_rate

Control the volume of transactions sent to Sentry. Value must be a float in the range [0.0, 1.0].

The default is 0.0 (i.e. no transactions are tracked).

"},{"location":"configuration/oauth/","title":"OAuth settings","text":"

Benefits can be configured to require users to authenticate with an OAuth Open ID Connect (OIDC) provider, before allowing the user to begin the Eligibility Verification process.

This section describes the related settings and how to configure the application to enable this feature.

"},{"location":"configuration/oauth/#authlib","title":"Authlib","text":"

Authlib docs

Read more about configuring Authlib for Django

Benefits uses the open-source Authlib for OAuth and OIDC client implementation. See the Authlib docs for more details about what features are available. Specifically, from Authlib we:

  1. Create an OAuth client using the Django configuration
  2. Call client.authorize_redirect() to send the user into the OIDC server\u2019s authentication flow, with our authorization callback URL
  3. Upon the user returning from the OIDC Server with an access token, call client.authorize_access_token() to get a validated id token from the OIDC server
"},{"location":"configuration/oauth/#django-configuration","title":"Django configuration","text":"

OAuth settings are configured as instances of the ClaimsProvider model and EnrollmentFlow model.

The data migration file contains sample values for a ClaimsProvider and EnrollmentFlow configuration. You can set values for a real Open ID Connect provider in environment variables so that they are used instead of the sample values.

"},{"location":"configuration/oauth/#django-usage","title":"Django usage","text":"

The benefits.oauth.client module defines helpers for registering OAuth clients, and creating instances for use in e.g. views.

  • oauth is an authlib.integrations.django_client.OAuth instance

Consumers call benefits.oauth.client.create_client(oauth, flow) with an EnrollmentFlow to obtain an Authlib client instance. If a client for the flow has not been registered yet, _register_provider(oauth_registry, flow) uses data from the given EnrollmentFlow to register the client into this instance and returns the client object.

"},{"location":"configuration/rate-limit/","title":"Configuring Rate Limiting","text":"

The benefits application has a simple, single-configuration Rate Limit that acts per-IP to limit the number of consecutive requests in a given time period, via nginx limit_req_zone and limit_req directives.

The configured rate limit is 12 requests/minute, or 1 request/5 seconds:

limit_req_zone $limit zone=rate_limit:10m rate=12r/m;\n
"},{"location":"configuration/rate-limit/#http-method-selection","title":"HTTP method selection","text":"

An NGINX map variable lists HTTP methods that will be rate limited:

map $request_method $limit {\n    default         \"\";\n    POST            $binary_remote_addr;\n}\n

The default means don\u2019t apply a rate limit.

To add a new method, add a new line:

map $request_method $limit {\n    default         \"\";\n    OPTIONS         $binary_remote_addr;\n    POST            $binary_remote_addr;\n}\n
"},{"location":"configuration/rate-limit/#app-path-selection","title":"App path selection","text":"

The limit_req is applied to an NGINX location block with a case-insensitive regex to match paths:

location ~* ^/(eligibility/confirm)$ {\n    limit_req zone=rate_limit;\n    # config...\n}\n

To add a new path, add a regex OR | with the new path (omitting the leading slash):

location ~* ^/(eligibility/confirm|new/path)$ {\n    limit_req zone=rate_limit;\n    # config...\n}\n
"},{"location":"configuration/recaptcha/","title":"Configuring reCAPTCHA","text":"

reCAPTCHA docs

See the reCAPTCHA Developer\u2019s Guide for more information

reCAPTCHA v3 is a free Google-provided service that helps protect the app from spam and abuse by using advanced risk analysis techniques to tell humans and bots apart.

reCAPTCHA is applied to all forms in the Benefits app that collect user-provided information. Version 3 works silently in the background, with no additional interaction required by the user.

"},{"location":"configuration/recaptcha/#environment-variables","title":"Environment variables","text":"

Warning

The following environment variables are all required to activate the reCAPTCHA feature

"},{"location":"configuration/recaptcha/#django_recaptcha_api_url","title":"DJANGO_RECAPTCHA_API_URL","text":"

URL to the reCAPTCHA JavaScript API library.

By default, https://www.google.com/recaptcha/api.js

"},{"location":"configuration/recaptcha/#django_recaptcha_site_key","title":"DJANGO_RECAPTCHA_SITE_KEY","text":"

Site key for the reCAPTCHA configuration.

"},{"location":"configuration/recaptcha/#django_recaptcha_secret_key","title":"DJANGO_RECAPTCHA_SECRET_KEY","text":"

Secret key for the reCAPTCHA configuration.

"},{"location":"configuration/recaptcha/#django_recaptcha_verify_url","title":"DJANGO_RECAPTCHA_VERIFY_URL","text":"

reCAPTCHA docs

Verifying the user\u2019s response

URL for the reCAPTCHA verify service.

By default, https://www.google.com/recaptcha/api/siteverify

"},{"location":"configuration/transit-agency/","title":"Configuring a new transit agency","text":"

Before starting any configuration, the Cal-ITP team and transit agency staff should have a kickoff meeting to confirm that information provided is complete, implementation plan is feasible, and any approvals needed have been obtained.

Then, the following steps are done by the Cal-ITP team to configure a new transit agency in the Benefits application.

Note that a TransitAgency model requires:

  • a list of supported EligibilityTypes
  • a list of EnrollmentFlowss available to the agency\u2019s users
  • a TransitProcessor for enrolling the user\u2019s contactless card for discounts
  • an info_url and phone for users to contact customer service
  • an SVG or PNG file of the transit agency\u2019s logo
  • HTML templates for various buttons, text and other user interface elements of the flow, including:
    • index_template: Required for agencies - Text for agency direct entry page
    • eligibility_index_template: Required for agencies - Text for Eligibility Index page
    • selection_label_template: Required for enrollment flows - Text and optional modals for the radio button form on the Eligibility Index page
    • eligibility_start_template: Required for enrollment flows - Text and optional custom styles for call to action button on the Eligibility Start page
    • enrollment_success_template: Required for agencies - Text for Enrollment Success page
    • help_template: Required for agencies - Agency-specific help questions and answers
    • sign_out_button_template: Required for claims providers - Sign out link button, used on any page after sign in
    • sign_out_link_template: Required for claims providers - Sign out link text, used on any page after sign in

Also note that these steps assume the transit agency is using Littlepay as their transit processor. Support for integration with other transit processors may be added in the future.

"},{"location":"configuration/transit-agency/#configuration-for-development-and-testing","title":"Configuration for development and testing","text":"

For development and testing, only a Littlepay customer group is needed since there is no need to interact with any discount product. (We don\u2019t have a way to tap a card against the QA system to trigger a discount and therefore have no reason to associate the group with any product.)

"},{"location":"configuration/transit-agency/#steps","title":"Steps","text":"
  1. Cal-ITP uses the transit agency\u2019s Littlepay merchant ID to create a customer group in the Littlepay QA environment for each type of eligibility (e.g. senior).
  2. For each group that\u2019s created, a group ID will be returned and should be set as the group_id on a new EligibilityType in the Benefits database. (See Configuration data for more on loading the database.)
  3. Cal-ITP creates a new EnrollmentFlow in the database for each supported eligibility type. This will require configuration for either API-based verification or verification through an OAuth Open ID Connect claims provider (e.g. sandbox Login.gov) \u2013 either way, this resource should be meant for testing.
  4. Cal-ITP creates a new TransitAgency in the database and associates it with the new EligibilityTypes and EnrollmentFlows as well as the existing Littlepay TransitProcessor.
"},{"location":"configuration/transit-agency/#configuration-for-production-validation","title":"Configuration for production validation","text":"

For production validation, both a customer group and discount product are needed. The customer group used here is a temporary one for testing only. Production validation is done against the Benefits test environment to avoid disruption of the production environment.

"},{"location":"configuration/transit-agency/#steps_1","title":"Steps","text":"
  1. Transit agency staff creates the discount product in production Littlepay (if it does not already exist).
  2. Transit agency staff takes a screenshot of the discount product in the Merchant Portal, making sure the browser URL is visible, and sends that to Cal-ITP.
  3. Cal-ITP creates a customer group for testing purposes in production Littlepay.
  4. Cal-ITP associates the group with the product.
  5. Cal-ITP creates a new EligibilityType for testing purposes in the Benefits database and sets the group_id to the ID of the newly-created group.
  6. Cal-ITP creates a new EnrollmentFlow with configuration for a testing environment to ensure successful eligibility verification. (For example, use sandbox Login.gov instead of production Login.gov.)
  7. Cal-ITP creates a new TransitProcessor for testing purposes with configuration for production Littlepay.
  8. Cal-ITP updates the existing TransitAgency (created previously) with associations to the eligibility types, enrollment flows, and transit processor that were just created for testing.

At this point, Cal-ITP and transit agency staff can coordinate to do on-the-ground testing where a live card is tapped on a live payment validator.

"},{"location":"configuration/transit-agency/#production-validation-testing","title":"Production validation testing","text":"
  1. Transit agency staff (or Cal-ITP staff) does live test in the field.
  2. Transit agency staff uses the Merchant Portal to verify the taps and discounts were successful.
  3. Cal-ITP uses logs from Azure to verify the user was associated to the customer group.
  4. Cal-ITP verifies that Amplitude analytic events are being sent.
"},{"location":"configuration/transit-agency/#configuration-for-production","title":"Configuration for production","text":"

Once production validation is done, the transit agency can be added to the production Benefits database.

"},{"location":"configuration/transit-agency/#steps_2","title":"Steps","text":"
  1. Cal-ITP creates a customer group for production use in production Littlepay.
  2. Cal-ITP associates the group with the discount product created previously during production validation.
  3. Cal-ITP sets that group\u2019s ID as the group_id for a new EligibilityType in the Benefits database.
  4. Cal-ITP creates a new EnrollmentFlow with configuration for the production eligibility verification system.
  5. Cal-ITP creates a new TransitAgency in the database with proper associations to eligibility types, enrollment flows, and transit processor.
"},{"location":"configuration/transit-agency/#cleanup","title":"Cleanup","text":"

At this point, the customer group that was created in production Littlepay for testing purposes can be deleted. The temporary production validation objects in the Benefits database can also be deleted.

  1. Remove the association between the test customer group and discount product.
  2. Delete the test customer group.
  3. Remove temporary EligibilityTypes, EnrollmentFlows, and TransitProcessor that were created in the Benefits test environment.
"},{"location":"deployment/","title":"Overview","text":"

The Benefits app is currently deployed into a Microsoft Azure account provided by California Department of Technology (CDT)\u2019s Office of Enterprise Technology (OET), a.k.a. the \u201cDevSecOps\u201d team. More specifically, it uses custom containers on Azure App Service. More about the infrastructure.

"},{"location":"deployment/#deployment-process","title":"Deployment process","text":"

The Django application gets built into a Docker image with NGINX and Gunicorn. SQLite is used within that same container to store configuration data; there is no external database.

The application is deployed to an Azure Web App Container using three separate environments for dev, test, and prod.

The Deploy workflow is responsible for building that branch\u2019s image and pushing to GitHub Container Registry (GHCR). It also deploys to the Azure Web App, telling Azure to restart the app and pull the latest image.

You can view what Git commit is deployed for a given environment by visitng the URL path /static/sha.txt.

"},{"location":"deployment/#configuration","title":"Configuration","text":"

Sensitive configuration settings are maintained as Application Configuration variables in Azure, referencing Azure Key Vault secrets. Other non-sensitive configuration is maintained directly in the configuration database via the Django Admin.

"},{"location":"deployment/#docker-images","title":"Docker images","text":"

Docker images for each of the deploy branches are available from GitHub Container Registry (GHCR):

  • Repository Package page
  • Image path: ghcr.io/cal-itp/benefits
"},{"location":"deployment/hotfix/","title":"Making a hotfix release","text":"

This list outlines the manual steps needed to make a hotfix release of the benefits app.

If main contains in-progress work that is not yet ready for a release but a simple code fix is needed in production, a separate process to test the changes before deploying to production must be undertaken. This is called a hotfix release. Typically, a hotfix release involves a simple code change that can be quickly implemented, in contrast to a rollback release, which generally requires more complex code changes which take more time to implement.

Start a new Release on Github

"},{"location":"deployment/hotfix/#0-create-a-temporary-hotfix-branch-from-the-latest-release-tag","title":"0. Create a temporary hotfix branch from the latest release tag","text":"
git checkout -b <hotfix-branch> <release-tag>\n

Replace <hotfix-branch> with the hotfix branch name and <release-tag> with the latest release tag.

"},{"location":"deployment/hotfix/#1-fix-whatever-issue-is-wrong-using-the-hotfix-branch","title":"1. Fix whatever issue is wrong using the hotfix branch","text":"

Commit the code changes that fix the issue that prompted the hotfix.

"},{"location":"deployment/hotfix/#2-tag-the-head-of-the-hotfix-branch-with-a-release-tag","title":"2. Tag the HEAD of the hotfix branch with a release tag","text":"
git tag -a YYYY.0M.R\n

Git will open your default text editor and prompt you for the tag annotation. For the tag annotation, use the release tag version and close the text editor.

"},{"location":"deployment/hotfix/#3-push-the-tag-to-github-to-kick-off-the-hotfix","title":"3. Push the tag to GitHub to kick off the hotfix","text":"
git push origin YYYY.0M.R\n
"},{"location":"deployment/hotfix/#4-generate-release-notes","title":"4. Generate release notes","text":"

Edit release notes with additional context, images, animations, etc. as-needed and link to the Release process issue.

"},{"location":"deployment/hotfix/#5-merge-into-main-for-the-next-release","title":"5. Merge into main for the next release","text":"

Create a PR to merge the changes from the hotfix branch into main for the next release.

"},{"location":"deployment/infrastructure/","title":"Infrastructure","text":"

The infrastructure is configured as code via Terraform, for various reasons.

"},{"location":"deployment/infrastructure/#getting-started","title":"Getting started","text":"

Since the Benefits app is deployed into a Microsoft Azure account provided by the California Department of Technology (CDT)\u2019s Office of Enterprise Technology (OET) team, you\u2019ll need to request access from them to the CDT Digital CA directory so you can get into the Azure portal, and to the California Department of Technology directory so you can access Azure DevOps.

The Azure portal is where you can view the infrastructure resources for Benefits. Azure DevOps is where our infrastructure pipeline is run to build and deploy those infrastructure resources.

"},{"location":"deployment/infrastructure/#environments","title":"Environments","text":"

Within the CDT Digital CA directory, there are two Subscriptions, with Resource Groups under each. (Refer to Azure\u2019s documentation for switching directories.)

Each of our environments corresponds to a single Resource Group, Terraform Workspace, and branch.

Environment Subscription Resource Group Workspace Branch Dev CDT/ODI Development RG-CDT-PUB-VIP-CALITP-D-001 dev main Test CDT/ODI Development RG-CDT-PUB-VIP-CALITP-T-001 test test Prod CDT/ODI Production RG-CDT-PUB-VIP-CALITP-P-001 default prod

All resources in these Resource Groups should be reflected in Terraform in this repository. The exceptions are:

  • Secrets, such as values under Key Vault. prevent_destroy is used on these Resources.
  • Things managed by DevSecOps
"},{"location":"deployment/infrastructure/#ownership","title":"Ownership","text":"

The following things in Azure are managed by the California Department of Technology (CDT)\u2019s DevSecOps (OET) team:

  • Subcriptions
  • Resource Groups
  • Networking
  • Front Door
    • Web Application Firewall (WAF)
    • Distributed denial-of-service (DDoS) protection
  • IAM
  • Service connections

You\u2019ll see these referenced in Terraform as data sources, meaning they are managed outside of Terraform.

"},{"location":"deployment/infrastructure/#architecture","title":"Architecture","text":"

These diagrams show a high-level view of the architecture per environment, including some external systems (e.g. analytics, error monitoring, eligibility servers).

"},{"location":"deployment/infrastructure/#benefits-application","title":"Benefits application","text":"
flowchart LR\n    internet[Public internet]\n    frontdoor[Front Door]\n    django[Django application]\n    interconnections[Other system interconnections]\n\n    internet --> Cloudflare\n    Cloudflare --> frontdoor\n    django <--> interconnections\n\n    subgraph Azure\n        frontdoor --> NGINX\n\n        subgraph App Service\n            subgraph Custom container\n                direction TB\n                NGINX --> django\n            end\n        end\n    end

Front Door also includes the Web Application Firewall (WAF) and handles TLS termination. Front Door is managed by the DevSecOps team.

"},{"location":"deployment/infrastructure/#system-interconnections","title":"System interconnections","text":"
flowchart LR\n    benefits[Benefits application]\n    style benefits stroke-width:5px\n    recaptcha[Google reCAPTCHA]\n    rider((User's browser))\n    idg[Identity Gateway]\n    elig_server[Eligibility Server]\n    ac_data[(Agency Card data)]\n    cookies[(Cookies)]\n\n    benefits -->|Errors| sentry\n    elig_server -->|Errors| sentry\n\n    rider --> benefits\n    rider -->|Credentials and identity proofing| Login.gov\n    rider --> recaptcha\n    rider -->|Payment card info| Littlepay\n    rider -->|Events| Amplitude\n    rider -->|Session| cookies\n\n    benefits --> idg\n    benefits <--> recaptcha\n    benefits -->|Events| Amplitude\n    benefits -->|Group enrollment| Littlepay\n    benefits --> elig_server\n\n    subgraph \"Agency Cards (e.g. MST Courtesy Cards)\"\n    elig_server --> ac_data\n    end\n\n    idg --> Login.gov\n    Login.gov -->|User attributes| idg\n    idg -->|User attributes| benefits
"},{"location":"deployment/infrastructure/#naming-conventions","title":"Naming conventions","text":"

The DevSecOps team sets the following naming convention for Resources:

<<Resource Type>>-<<Department>>-<<Public/Private>>-<<Project Category>>-<<Project Name>>-<<Region>><<OS Type>>-<<Environment>>-<<Sequence Number>>\n
"},{"location":"deployment/infrastructure/#sample-names","title":"Sample Names","text":"
  • RG-CDT-PUB-VIP-BNSCN-E-D-001
  • ASP-CDT-PUB-VIP-BNSCN-EL-P-001
  • AS-CDT-PUB-VIP-BNSCN-EL-D-001
"},{"location":"deployment/infrastructure/#resource-types","title":"Resource Types","text":"

Use the following shorthand for conveying the Resource Type as part of the Resource Name:

Resource Convention App Service AS App Service Plan ASP Virtual Network VNET Resource Group RG Virtual Machine VM Database DB Subnet SNET Front Door FD"},{"location":"deployment/infrastructure/#making-changes","title":"Making changes","text":""},{"location":"deployment/infrastructure/#set-up-for-local-development","title":"Set up for local development","text":"
  1. Get access to the Azure account through the DevSecOps team.
  2. Install dependencies:

    • Azure CLI
    • Terraform - see exact version in deploy.yml
  3. Authenticate using the Azure CLI.

    az login\n
  4. Outside the dev container, navigate to the terraform/ directory.

  5. Initialize Terraform. You can also use this script later to switch between environments.

    ./init.sh <env>\n
  6. Create a local terraform.tfvars file (ignored by git) from the sample; fill in the *_OBJECT_ID variables with values from the Azure Pipeline definition.

"},{"location":"deployment/infrastructure/#development-process","title":"Development process","text":"

When configuration changes to infrastructure resources are needed, they should be made to the resource definitions in Terraform and submitted via pull request.

  1. Make changes to Terraform files.
  2. Preview the changes, as necessary.

    terraform plan\n
  3. Submit the changes via pull request.

Azure tags

For Azure resources, you need to ignore changes to tags, since they are automatically created by an Azure Policy managed by CDT.

lifecycle {\n    ignore_changes = [tags]\n}\n
"},{"location":"deployment/infrastructure/#infrastructure-pipeline","title":"Infrastructure pipeline","text":"

When code is pushed to any branch on GitHub, our infrastructure pipeline in Azure DevOps runs terraform plan. When the pull request is merged into main, the pipeline runs terraform apply.

While other automation for this project is done through GitHub Actions, we use an Azure Pipeline for a couple of reasons:

  • Easier authentication with the Azure API using a service connnection
  • Log output is hidden, avoiding accidentally leaking secrets
"},{"location":"deployment/infrastructure/#azure-environment-setup","title":"Azure environment setup","text":"

These steps were followed when setting up our Azure deployment for the first time:

  • CDT team creates the resources that they own
  • terraform apply
  • Set up Slack notifications by creating a Slack email for the #notify-benefits channel, then setting it as a Secret in the Key Vault named slack-benefits-notify-email
  • Set required App Service configuration and configuration by setting values in Key Vault (the mapping is defined in app_service.tf)

This is not a complete step-by-step guide; more a list of things to remember. This may be useful as part of incident response.

"},{"location":"deployment/release/","title":"Making a regular release","text":"

This list outlines the manual steps needed to make a new release of the benefits app.

A release is made by pushing an annotated tag. The name of the tag must use the version number format mentioned below. This kicks off a deployment to the production environment and creates a GitHub release. The version number for the app and the release will be the tag\u2019s name. More details on the deployment steps can be found under Workflows.

The list of releases can be found on the repository Releases page on GitHub.

Start a new Release on Github

"},{"location":"deployment/release/#0-decide-on-the-new-version-number","title":"0. Decide on the new version number","text":"

A new release implies a new version.

benefits uses the CalVer versioning scheme, where version numbers look like: YYYY.0M.R

  • YYYY is the 4-digit year of the release; e.g. 2021, 2022
  • 0M is the 2-digit, 0-padded month of the release; e.g. 02 is February, 12 is December.
  • R is the 1-based release counter for the given year and month; e.g. 1 for the first release of the month, 2 for the second, and so on.

Version numbers for release candidates append -rcR, where R is the 1-based release counter for the anticipated release. For example, the first release candidate for the 2024.01.1 release would be 2024.01.1-rc1.

"},{"location":"deployment/release/#1-create-a-release-candidate-tag-on-main-and-push-it","title":"1. Create a release candidate tag on main and push it","text":"
git fetch\ngit checkout main\ngit reset --hard origin/main\ngit tag -a YYYY.0M.R-rcR\n

Git will open your default text editor and prompt you for the tag annotation. For the tag annotation, use the release candidate version. Finally, after closing the text editor:

git push origin YYYY.0M.R-rcR\n

This builds a new package and deploys to the Azure test environments. No GitHub release is created for release candidates.

"},{"location":"deployment/release/#2-create-a-release-tag-on-main-and-push-it","title":"2. Create a release tag on main and push it","text":"
git fetch\ngit checkout main\ngit reset --hard origin/main\ngit tag -a YYYY.0M.R\n

Git will open your default text editor and prompt you for the tag annotation. For the tag annotation, use the title of the Release process issue that kicked off the release. Finally, after closing the text editor:

git push origin YYYY.0M.R\n

This builds the package and deploys to the Azure production environments. A GitHub release is created.

"},{"location":"deployment/release/#3-generate-release-notes","title":"3. Generate release notes","text":"

Edit release notes with additional context, images, animations, etc. as-needed and link to the Release process issue.

"},{"location":"deployment/rollback/","title":"Making a rollback release","text":"

This list outlines the manual steps needed to make a rollback of the benefits app.

If a change is deployed to the app that makes it fail to start, making a rollback will deploy the app to a known working state again.

Start a new Release on Github

"},{"location":"deployment/rollback/#0-create-a-release-tag-on-the-commit-associated-with-the-last-known-good-release-tag","title":"0. Create a release tag on the commit associated with the last known good release tag","text":"
git tag -a YYYY.0M.R <commit-hash>\n

Replace YYYY.0M.R with the rollback version and <commit-hash> with the hash of the commit associated with the last known good release tag. Git will open your default text editor and prompt you for the tag annotation. For the tag annotation, use the version of the release tag for the rollback and close the text editor.

"},{"location":"deployment/rollback/#1-push-the-tag-to-github-to-kick-off-the-rollback","title":"1. Push the tag to GitHub to kick off the rollback","text":"
git push origin YYYY.0M.R\n
"},{"location":"deployment/rollback/#2-generate-release-notes","title":"2. Generate release notes","text":"

Edit release notes with additional context, images, animations, etc. as-needed and link to the Release process issue.

"},{"location":"deployment/secrets/","title":"Setting secrets","text":"

Secret values used by the Benefits application (such as API keys, private keys, certificates, etc.) are stored in an Azure Key Vault for each environment.

To set a secret, you can use the Azure portal or the Azure CLI.

There are helper scripts under terraform/secrets which build up the Azure CLI command, given some inputs. The usage is as follows:

First, make sure you are set up for local development and that you are in the terraform/secrets directory.

cd terraform/secrets\n

To set a secret by providing a value:

./value.sh <environment_letter> <secret_name> <secret_value>\n

where environment_letter is D for development, T for test, and P for production.

To set a secret by providing the path of a file containing the secret (useful for multi-line secrets):

./file.sh <environment_letter> <secret_name> <file_path>\n

To verify the value of a secret, you can use the helper script named read.sh.

./read.sh <environment_letter> <secret_name>\n
"},{"location":"deployment/secrets/#refreshing-secrets","title":"Refreshing secrets","text":"

To make sure the Benefits application uses the latest secret values in Key Vault, you will need to make a change to the app service\u2019s configuration. If you don\u2019t do this step, the application will instead use cached values, which may not be what you expect. See the Azure docs for more details.

The steps are:

  1. After setting new secret values, go to the App Service configuration in Azure Portal, and change the value of the setting named change_me_to_refresh_secrets.
  2. Save your changes.

The effects of following those steps should be:

  • A restart of the App Service is triggered.
  • The next time that our Azure infrastructure pipeline is run, the value of change_me_to_refresh_secrets is set back to the value defined in our Terraform file for the App Service resource.
"},{"location":"deployment/troubleshooting/","title":"Troubleshooting","text":""},{"location":"deployment/troubleshooting/#tools","title":"Tools","text":""},{"location":"deployment/troubleshooting/#monitoring","title":"Monitoring","text":"

We have ping tests set up to notify about availability of each environment. Alerts go to #benefits-notify.

"},{"location":"deployment/troubleshooting/#logs","title":"Logs","text":""},{"location":"deployment/troubleshooting/#azure-app-service-logs","title":"Azure App Service Logs","text":"

Open the Logs for the environment you are interested in. The following tables are likely of interest:

  • AppServiceConsoleLogs: stdout and stderr coming from the container
  • AppServiceHTTPLogs: requests coming through App Service
  • AppServicePlatformLogs: deployment information

For some pre-defined queries, click Queries, then Group by: Query type, and look under Query pack queries.

"},{"location":"deployment/troubleshooting/#live-tail","title":"Live tail","text":"

After setting up the Azure CLI, you can use the following command to stream live logs:

az webapp log tail --resource-group RG-CDT-PUB-VIP-CALITP-P-001 --name AS-CDT-PUB-VIP-CALITP-P-001 2>&1 | grep -v /healthcheck\n
"},{"location":"deployment/troubleshooting/#scm","title":"SCM","text":"

https://as-cdt-pub-vip-calitp-p-001-dev.scm.azurewebsites.net/api/logs/docker

"},{"location":"deployment/troubleshooting/#sentry","title":"Sentry","text":"

Cal-ITP\u2019s Sentry instance collects both errors (\u201cIssues\u201d) and app performance info.

Alerts are sent to #benefits-notify in Slack. Others can be configured.

You can troubleshoot Sentry itself by turning on debug mode and visiting /error/.

"},{"location":"deployment/troubleshooting/#specific-issues","title":"Specific issues","text":"

This section serves as the runbook for Benefits.

"},{"location":"deployment/troubleshooting/#terraform-lock","title":"Terraform lock","text":"

General info

If Terraform commands fail (locally or in the Pipeline) due to an Error acquiring the state lock:

  1. Check the Lock Info for the Created timestamp. If it\u2019s in the past ten minutes or so, that probably means Terraform is still running elsewhere, and you should wait (stop here).
  2. Are any Pipeline runs stuck? If so, cancel that build, and try re-running the Terraform command.
  3. Do any engineers have a Terrafrom command running locally? You\u2019ll need to ask them. For example: They may have started an apply and it\u2019s sitting waiting for them to approve it. They will need to (gracefully) exit for the lock to be released.
  4. If none of the steps above identified the source of the lock, and especially if the Created time is more than ten minutes ago, that probably means the last Terraform command didn\u2019t release the lock. You\u2019ll need to grab the ID from the Lock Info output and force unlock.
"},{"location":"deployment/troubleshooting/#app-fails-to-start","title":"App fails to start","text":"

If the container fails to start, you should see a downtime alert. Assuming this app version was working in another environment, the issue is likely due to misconfiguration. Some things you can do:

  • Check the logs
  • Ensure the environment variables and configuration data are set properly.
  • Turn on debugging
  • Force-push/revert the environment branch back to the old version to roll back
"},{"location":"deployment/troubleshooting/#littlepay-api-issue","title":"Littlepay API issue","text":"

Littlepay API issues may show up as:

  • The monitor failing
  • The Connect your card button doesn\u2019t work

A common problem that causes Littlepay API failures is that the certificate expired. To resolve:

  1. Reach out to support@littlepay.com
  2. Receive a new certificate
  3. Put that certificate into the configuration data and/or the GitHub Actions secrets
"},{"location":"deployment/troubleshooting/#eligibility-server","title":"Eligibility Server","text":"

If the Benefits application gets a 403 error when trying to make API calls to the Eligibility Server, it may be because the outbound IP addresses changed, and the Eligibility Server firewall is still restricting access to the old IP ranges.

  1. Grab the outbound_ip_ranges output values from the most recent Benefit deployment to the relevant environment.
  2. Update the IP ranges
    1. Go to the Eligibility Server Pipeline
    2. Click Edit
    3. Click Variables
    4. Update the relevant variable with the new list of CIDRs

Note there is nightly downtime as the Eligibility Server restarts and loads new data.

"},{"location":"deployment/workflows/","title":"Workflows","text":"

The GitHub Actions deployment workflow configuration lives at .github/workflows/deploy.yml.

Info

The entire process from GitHub commit to full redeploy of the application can take from around 5 minutes to 10 minutes or more depending on the deploy environment. Have patience!

"},{"location":"deployment/workflows/#deployment-steps","title":"Deployment steps","text":"

The workflow is triggered with a push to the main branch or when a release candidate or release tag is created on any branch. It also responds to the workflow_dispatch event to allow manually triggering via the GitHub Actions UI.

When a deployment workflow runs, the following steps are taken:

"},{"location":"deployment/workflows/#1-checkout-code","title":"1. Checkout code","text":"

From the tip of the corresponding branch (e.g. main) or the tagged commit

"},{"location":"deployment/workflows/#2-authenticate-to-ghcr","title":"2. Authenticate to GHCR","text":"

Using the github.actor and built-in GITHUB_TOKEN secret

"},{"location":"deployment/workflows/#3-build-and-push-image-to-github-container-registry-ghcr","title":"3. Build and push image to GitHub Container Registry (GHCR)","text":"

Build the root Dockerfile, tagging with the SHA from the HEAD commit or tagged commit.

Push this image:tag into GHCR.

"},{"location":"deployment/workflows/#4-app-service-deploy","title":"4. App Service deploy","text":"

Push the new image:tag to the Azure App Service instance.

"},{"location":"development/","title":"VS Code with devcontainers","text":"

Info

VS Code with Devcontainers is the recommended development setup

Warning

You must build the base Docker image benefits_client:latest before running the devcontainer. See Local Setup

"},{"location":"development/#install-the-remote-containers-extension","title":"Install the Remote - Containers extension","text":"

VS Code can be used together with Docker via the Remote - Containers extension to enable a container-based development environment. This repository includes a .devcontainer.json file that configures remote container development and debugging.

"},{"location":"development/#open-the-repository-with-vs-code","title":"Open the repository with VS Code","text":"

With the Remote - Containers extension enabled, open the folder containing this repository inside Visual Studio Code.

You should receive a prompt in the Visual Studio Code window; click Reopen in Container to run the development environment inside a container.

If you do not receive a prompt, or when you feel like starting from a fresh environment:

  1. Ctrl/Cmd + Shift + P to bring up the command palette in Visual Studio Code
  2. Type Remote-Containers to filter the commands
  3. Select Rebuild and Reopen in Container to completely rebuild the devcontainer
  4. Select Reopen in Container to reopen the most recent devcontainer build
"},{"location":"development/#attach-a-debugger","title":"Attach a debugger","text":"

Once running inside a container, press F5 to attach a debugger to the client, running on http://localhost at a port dynamically assigned by Docker. See Docker dynamic ports for more information.

Add breakpoints in the code and browse the local site to trigger a pause. Press F5 to continue execution from the breakpoint.

"},{"location":"development/#changing-launch-configuration","title":"Changing launch configuration","text":"

By default, the application is launched with DJANGO_DEBUG=True, causing Django to provide additional logging and error output and to relax certain security settings.

Alternatively, you may attach to an instance launched with DJANGO_DEBUG=False, to allow debugging the app in a state more similar to production.

In VS Code, press Ctrl/Cmd + Shift + D to open the Run and Debug pane, where you can select between the various configurations (disregard the duplicate entry, selecting either will work):

The environment can also be overridden for the debug session by editing the configuration in .vscode/launch.json, where any of the supported environment variables may be specified in the env block. For example, to test the app with reCAPTCHA environment variables:

{\n    \"name\": \"Django: Benefits Client\",\n    \"type\": \"python\",\n    \"request\": \"launch\",\n    \"program\": \"${workspaceFolder}/manage.py\",\n    \"args\": [\"runserver\", \"--insecure\", \"0.0.0.0:8000\"],\n    \"django\": true,\n    \"env\": {\n        // existing field...\n        \"DJANGO_DEBUG\": \"true\",\n        // add these 2 entries with the values for reCAPTCHA\n        \"DJANGO_RECAPTCHA_SITE_KEY\": \"<SITE KEY HERE>\",\n        \"DJANGO_RECAPTCHA_SECRET_KEY\": \"<SECRET KEY HERE>\"\n    }\n}\n

See #1071 for more examples and context.

"},{"location":"development/#exiting-devcontainers","title":"Exiting devcontainers","text":"

To close out of the container and re-open the directory locally in Visual Studio Code:

  1. Ctrl/Cmd + Shift + P to bring up the command palette in Visual Studio Code
  2. Type Remote-Containers to filter the commands
  3. Select Reopen Locally
"},{"location":"development/application-logic/","title":"Application logic","text":"

See also

More specific user flow diagrams: Enrollment pathways

This page describes how Cal-ITP Benefits defines user flows through the following high-level phases:

  1. Initial setup
  2. Identity proofing
  3. Eligibility verification
  4. Enrollment
flowchart LR\n    start((Start))\n    entry[Initial setup]\n    identity[Identity proofing]\n    eligibility[Eligibility verification]\n    enrollment[Enrollment]\n    complete((End))\n    style complete stroke-width:2px\n\n    start --> entry\n    entry --> identity\n    identity --> eligibility\n    eligibility --> enrollment\n    enrollment --> complete

The structure of the source code in benefits/ generally follows from these phases:

  • benefits/core/ implements shared logic and models, and defines the user\u2019s entrypoint into the app
  • benefits/oauth/ implements identity proofing
  • benefits/eligibility/ implements eligibility verification
  • benefits/enrollment/ implements enrollment

Each of these directories contains a standalone Django app registered in the settings.

All of the common logic and database models and migrations are defined in benefits.core, and this app is imported by the other apps.

"},{"location":"development/application-logic/#django-request-pipeline","title":"Django request pipeline","text":"

Each request to the Benefits app is ultimately a Django request and goes through the Django HTTP request pipeline.

Benefits uses middleware to pre- and post-process requests for (view) access control, session configuration, and analytics. Benefits also uses context processors to enrich the Django template context with data needed for rendering on the front-end.

Key supporting files

benefits/core/context_processors.py

benefits/core/middleware.py

In general, the flow of a Django request looks like:

flowchart LR\n    user((User))\n    style user stroke-width:2px\n\n    pre_middleware[Request middleware]\n    view_middleware[View-specific middleware]\n    context[Context processors]\n    view[View function]\n    post_middleware[Response middleware]\n\n    user -- Request --> pre_middleware\n    pre_middleware -- Request --> view_middleware\n    view_middleware -- Request --> context\n    context -- Request --> view\n    view -- Response --> post_middleware\n    post_middleware -- Response --> user
"},{"location":"development/application-logic/#initial-setup","title":"Initial setup","text":"

In this phase, the user makes the initial selections that will configure the rest of their journey.

Entrypoint

benefits/core/views.py

Key supporting files

benefits/core/models.py

benefits/core/session.py

flowchart LR\n    session[(session)]\n    analytics[[analytics]]\n\n    start((Start))\n    pick_agency[\"`Agency picker\n    modal`\"]\n    agency((\"`Agency\n    selected`\"))\n    eligibility((\"`Eligibility type\n    selected`\"))\n    next>\"`_Next phase_`\"]\n    style next stroke-width:2px\n\n    start -- \"1a. Lands on index\" --> pick_agency\n    start -- \"1b. Lands on agency index\" --> agency\n    %% invisible links help with diagram layout\n    start ~~~ session\n    start ~~~ agency\n\n    pick_agency -- 2. Chooses agency --> agency\n    agency -- 3. Chooses enrollment pathway --> eligibility\n\n    eligibility -- 4. continue --> next\n\n    agency -. update -.-o session\n    eligibility -. update -.-o session\n    eligibility -. selected eligibility verifier -.-o analytics

Depending upon the choice of enrollment pathway, the Next phase above may be:

  • Identity proofing, for all flows that require user PII (such as for verifying age).
  • Eligibility verification, for Agency card flows that require a physical card from the transit agency.
"},{"location":"development/application-logic/#identity-proofing","title":"Identity proofing","text":"

In this phase, Cal-ITP Benefits takes the user through an OpenID Connect (OIDC) flow as a Client (the Relying Party or RP) of the CDT Identity Gateway (the Identity Provider or IDP), via Login.gov.

The CDT Identity Gateway transforms PII from Login.gov into anonymized boolean claims that are later used in eligibility verification.

Entrypoint

benefits/oauth/views.py

Key supporting files

benefits/oauth/client.py

benefits/oauth/redirects.py

flowchart LR\n    session[(session)]\n    analytics[[analytics]]\n\n    start((Initial setup))\n    style start stroke-dasharray: 5 5\n\n    benefits[Benefits app]\n    idg[[\"`CDT\n    Identity Gateway`\"]]\n    logingov[[Login.gov]]\n    claims((Claims received))\n\n    next>\"`_Eligibility\n    verification_`\"]\n    style next stroke-width:2px\n\n    start -- 1. Clicks login button --> benefits\n    %% invisible links help with diagram layout\n    start ~~~ session\n\n    benefits -- 2. OIDC authorize_redirect --> idg\n    benefits -. started sign in  -.-o analytics\n\n    idg <-. \"3. PII exchange\" .-> logingov\n    idg -- 4. OIDC token authorization --> claims\n\n    claims -- 5. continue --> next\n    claims -. update .-o session\n    claims -. finished sign in -.-o analytics
"},{"location":"development/application-logic/#eligibility-verification","title":"Eligibility verification","text":"

In this phase, Cal-ITP Benefits verifies the user\u2019s claims using one of two methods:

  • Claims validation, using claims previously stored in the user\u2019s session during Identity proofing
  • Eligibility API verification, using non-PII claims provided by the user in an HTML form submission

Entrypoint

benefits/eligibility/views.py

Key supporting files

benefits/eligibility/verify.py

flowchart LR\n    session[(session)]\n    analytics[[analytics]]\n\n    start((\"`Previous\n    phase`\"))\n    style start stroke-dasharray: 5 5\n\n    claims[Session claims check]\n    form[HTTP form POST]\n    server[[Eligibility Verification server]]\n    eligible{Eligible?}\n\n    next>\"`_Enrollment_`\"]\n    style next stroke-width:2px\n\n    stop{{Stop}}\n\n    start -- Eligibility API verification --> form\n    form -- Eligibility API call --> server\n    form -. started eligibility -.-o analytics\n    server --> eligible\n\n    start -- Claims validation --> claims\n    session -.-o claims\n    claims --> eligible\n    claims -. started eligibility -.-o analytics\n\n    eligible -- Yes --> next\n    eligible -- No --> stop\n    eligible -. update .-o session\n    eligible -. returned eligibility -.-o analytics
"},{"location":"development/application-logic/#enrollment","title":"Enrollment","text":"

In this final phase, the user registers their contactless payment card with a concession group configured within the transit processor (Littlepay).

Cal-ITP Benefits never processes, transmits, nor stores the user\u2019s payment card details.

Entrypoint

benefits/enrollment/views.py

Supporting packages

cal-itp/littlepay

sequenceDiagram\nautonumber\n%% Enrollment phase\n    actor user as User\n    participant benefits as Benefits app\n    participant littlepay as Littlepay\n    participant analytics as Analytics\n\nuser->>benefits: starts enrollment phase\n    activate user\nbenefits-->>user: display enrollment index\nuser->>littlepay: GET tokenization lib (AJAX)\nlittlepay-->>user: tokenization lib .js\nuser->>benefits: GET card tokenization access token (AJAX)\n    deactivate user\n    activate benefits\nbenefits->>littlepay: GET API access token\nlittlepay-->>benefits: access token\nbenefits->>littlepay: GET card tokenization access token\nlittlepay-->>benefits: access token\nbenefits-->>user: access token\n    deactivate benefits\n    activate user\nuser->>user: click to initiate payment card collection\nuser-->>user: display Littlepay overlay\nuser-->>analytics: started payment connection\nuser->>littlepay: provides debit or credit card details\nlittlepay-->>user: card token\nuser-->>analytics: closed payment connection\nuser->>benefits: POST back card token\n    deactivate user\n    activate benefits\nbenefits->>littlepay: GET API access token\nlittlepay-->>benefits: access token\nbenefits->>littlepay: GET funding source from card token\nlittlepay-->>benefits: funding source\nbenefits->>littlepay: enroll funding source in group\nbenefits-->>analytics: returned enrollment\n    deactivate benefits
"},{"location":"development/commits-branches-merging/","title":"Commits, branches, and merging","text":""},{"location":"development/commits-branches-merging/#commits","title":"Commits","text":"

This project enforces the Conventional Commits style for commit message formatting:

<type>[(optional-scope)]: <description>\n\n[optional body]\n

Where <type> indicates the nature of the commit, one of a list of possible values:

  • build - related to the build or compile process
  • chore - administrative tasks, cleanups, dev environment
  • ci - related to automated builds/tests etc.
  • docs - updates to the documentation
  • feat - new code, features, or interfaces
  • fix - bug fixes
  • perf - performance improvements
  • refactor - non-breaking logic refactors
  • revert - undo a prior change
  • style - code style and formatting
  • test - having to do with testing of any kind

E.g.

git commit -m \"feat(eligibility/urls): add path for start\"\n
"},{"location":"development/commits-branches-merging/#branches","title":"Branches","text":"

The default GitHub branch is main. All new feature work should be in the form of Pull Requests (PR) that target main as their base.

In addition to main, the repository has three other long-lived branches:

  • test and prod are read-only (no longer actively used) and correspond to the Test and Production deploy environments, respectively. The last release using these branches was 2024.07.1.
  • gh-pages hosts the compiled documentation, and is always forced-pushed by the docs build process.
"},{"location":"development/commits-branches-merging/#protection-rules","title":"Protection rules","text":"

Branch protection rules are in place on main to:

  • Prevent branch deletion
  • Restrict force-pushing, where appropriate
  • Require passing status checks before merging into the target branch is allowed

Branch protection rules are in place on test and prod to:

  • Prevent branch deletion
  • Lock the branch, making it read-only so that users cannot push to the branch since the branch is no longer used
"},{"location":"development/commits-branches-merging/#pr-branches","title":"PR branches","text":"

PR branches are typically named with a conventional type prefix, a slash /, and then descriptor in lower-dashed-case:

<type>/<lower-dashed-descriptor>\n

E.g.

git checkout -b feat/flow-multi-select\n

and

git checkout -b refactor/flow-model\n

PR branches are deleted once their PR is merged.

"},{"location":"development/commits-branches-merging/#merging","title":"Merging","text":"

Merging of PRs should be done using the merge commit strategy. The PR author should utilize git rebase -i to ensure their PR commit history is clean, logical, and free of typos.

When merging a PR into main, it is customary to format the merge commit message like:

Title of PR (#number)\n

instead of the default:

Merge pull request #number from source-repo/source-branch\n
"},{"location":"development/docker-dynamic-ports/","title":"Docker dynamic ports","text":"

Docker dynamically assigns host machine ports that map into container application ports.

"},{"location":"development/docker-dynamic-ports/#inside-the-devcontainer","title":"Inside the Devcontainer","text":"

Info

The Devcontainer can bind to a single container\u2019s port(s) and present those to your localhost machine via VS Code. Other services started along with the Devcontainer are not visible in VS Code. See Outside the Devconatiner for how to find information on those.

Once started with F5, the benefits Django application runs on port 8000 inside the Devcontainer. To find the localhost address, look on the PORTS tab in VS Code\u2019s Terminal window. The Local Address corresponding to the record where 8000 is in the Port column is where the site is accessible on your host machine.

Replace 0.0.0.0 with localhost and use the same port number shown in the Local Address column. This is highlighted by the red box in the image below:

"},{"location":"development/docker-dynamic-ports/#outside-the-devcontainer","title":"Outside the Devcontainer","text":"

When running a docker compose ... command, or in other scenarios outside of the Devcontainer, there are multiple ways to find the http://localhost port corresponding to the service in question.

"},{"location":"development/docker-dynamic-ports/#docker-desktop","title":"Docker Desktop","text":"

The Docker Desktop application shows information about running containers and services/groups, including information about bound ports. In most cases, the application provides a button to launch a container/service directly in your browser when a port binding is available.

In the Containers / Apps tab, expand the service group if needed to find the container in question, where you should see labels indicating the container is RUNNING and bound to PORT: XYZ.

Hover over the container in question, and click the Open in Browser button to launch the app in your web browser.

"},{"location":"development/docker-dynamic-ports/#docker-cli-commands","title":"Docker CLI commands","text":"

Using the docker command line interface, you can find the bound port(s) of running containers.

docker ps -f name=<service>\n

e.g. for the docs service:

docker ps -f name=docs\n

This prints output like the following:

CONTAINER ID   IMAGE                 COMMAND                  CREATED         STATUS         PORTS                     NAMES\n0d5b2e1fb910   benefits_client:dev   \"mkdocs serve --dev-\u2026\"   2 minutes ago   Up 2 minutes   0.0.0.0:62093->8000/tcp   benefits_docs_1\n

Looking at the PORTS column:

PORTS\n0.0.0.0:62093->8000/tcp\n

We can see that locally, port 62093 is bound to the container port 8000.

In this case, entering http://localhost:62093 in the web browser navigates to the docs site homepage.

"},{"location":"development/i18n/","title":"Django message files","text":"

Django docs

Internationalization and localization

Translation

Message files

English messages: benefits/locale/en/LC_MESSAGES/django.po

The Cal-ITP Benefits application is fully internationalized and available in both English and Spanish.

It uses Django\u2019s built-in support for translation using message files, which contain entries of msgid/msgstr pairs. The msgid is referenced in source code so that Django takes care of showing the msgstr for the user\u2019s language.

"},{"location":"development/i18n/#updating-message-files","title":"Updating message files","text":"

Django has a utility command called makemessages to help maintain message files. It ensures that msgids in the message files are actually used somewhere in source code and also detects new msgids.

There is a helper script that runs this command with some arguments: bin/makemessages.sh

bin/makemessages.sh\n

Developers should use this script to update message files in a consistent way.

"},{"location":"development/i18n/#workflow","title":"Workflow","text":""},{"location":"development/i18n/#updating-english","title":"Updating English","text":"

Add English copy to templates directly first. Then, run the helper script, bin/makemessages.sh, so Django can update the django.po files for English and Spanish with the new copy.

"},{"location":"development/i18n/#updating-spanish","title":"Updating Spanish","text":"

Find the English copy in the Spanish django.po file as a msgid, and add the corresponding Spanish translation as the msgstr. Again, run the helper script for formatting and bin/init.sh to confirm the translation is rendered properly.

"},{"location":"development/i18n/#adding-agency-specific-copy","title":"Adding agency-specific copy","text":"

When templates have different copy per agency, create a new template for that agency-specific copy to live in. See the example of the MST-specific agency index page file, named index--mst.html. Include the agency-specific template file name in the migration object, as done here for MST, with eligibility_index_template=\"eligibility/index--mst.html\".

"},{"location":"development/i18n/#fuzzy-strings","title":"Fuzzy strings","text":"

From Django docs:

makemessages sometimes generates translation entries marked as fuzzy, e.g. when translations are inferred from previously translated strings.

Usually, the inferred translation is not correct, so make sure to review the msgstr and fix it if necessary. Then, remove the commented lines starting with #, fuzzy (otherwise the entry will not be used).

"},{"location":"development/linting-pre-commit/","title":"Linting and pre-commit","text":""},{"location":"development/linting-pre-commit/#formatting","title":"Formatting","text":"

black provides Python code formatting via the [ms-python.python][python] VS Code extension.

prettier provides code formatting for front-end (CSS/JavaScript) via the esbenp.prettier-vscode VS Code extension.

See the .vscode/settings.json file for more information on how this is configured in the devcontainer.

"},{"location":"development/linting-pre-commit/#linting","title":"Linting","text":"

flake8 provides Python code linting via the [ms-python.python][python] VS Code extension.

See the .vscode/settings.json file for more information on how this is configured in the devcontainer.

"},{"location":"development/linting-pre-commit/#pre-commit","title":"pre-commit","text":"

This repository uses pre-commit hooks to check and format code. The .pre-commit-config.yaml file defines a number of pre-commit hooks, including black, flake8, line ending and whitespace checkers, and more.

pre-commit is installed and activated within the devcontainer and runs automatically with each commit.

Branch protection rules on the environment branches in GitHub ensure that pre-commit checks have passed before a merge is allowed. See the workflow file at .github/workflows/pre-commit.yml.

"},{"location":"development/models-migrations/","title":"Django models and migrations","text":"

Models and migrations

benefits/core/models.py

benefits/core/migrations/0001_initial.py

Cal-ITP Benefits defines a number of models in the core application, used throughout the codebase to configure different parts of the UI and logic.

The Cal-ITP Benefits database is a simple Sqlite database that mostly acts as a read-only configuration store. Runtime configuration changes can be persisted via Django\u2019s Admin interface.

"},{"location":"development/models-migrations/#updating-models","title":"Updating models","text":"

When models are updated, new migrations must be generated to reflect those changes into the configuration database.

A simple helper script exists to generate migrations based on the current state of models in the local directory:

bin/makemigrations.sh

bin/makemigrations.sh\n

This script:

  1. Runs the django makemigrations command
  2. Formats the newly regenerated migration file with black

Commit the new migration file along with the model changes.

"},{"location":"development/test-server/","title":"Test Eligibility Verification server","text":"

A basic eligibility verification server is available for testing. The server code is available on GitHub, with its own set of documentation.

"},{"location":"development/test-server/#running-locally","title":"Running locally","text":"
docker compose up [-d] server\n

The optional -d flag will start in detatched mode and allow you to continue using the terminal session. Otherwise your terminal will be attached to the container\u2019s terminal, showing the startup and runtime output.

The API server is running on http://localhost at a port dynamically assigned by Docker. See Docker dynamic ports for more information on accessing the server on localhost.

From within another Compose service container, the server is at http://server:5000 using the service-forwarding features of Compose.

In either case, the endpoint /verify serves as the Eligibility Verification API endpoint.

"},{"location":"development/test-server/#in-the-devcontainer","title":"In the Devcontainer","text":"

When running the Devcontainer, the server is automatically started.

See Docker dynamic ports for more information on accessing the server on localhost.

The server is accessible from within the Devcontainer at its Compose service address: http://server:5000.

"},{"location":"enrollment-pathways/","title":"Enrollment pathways","text":"

This section describes in more detail some of the different enrollment pathways with current or planned support in the Benefits application.

"},{"location":"enrollment-pathways/#current-work","title":"Current work","text":"

We do sprint planning and track day-to-day work on our Project Board.

See our Milestones for current work tracked against specific features and different enrollment pathways.

"},{"location":"enrollment-pathways/#product-roadmap","title":"Product roadmap","text":"

Our product roadmap captures what we\u2019re currently building, what we\u2019ve built, and what we plan to build in the future. We update it at the end of each quarter or when priorities change.

timeline\n    title Cal-ITP Benefits Product Roadmap\n%% Cal-ITP Benefits Epics (2024)\n          section 2024\n\n          Q1<br>Complete\n          : Benefits admin tool (Foundation)\n          : SBMTD - Launch Reduced Fare Mobility ID enrollment pathway\n          : Migrate to Littlepay Backoffice API\n\n          Q2<br>Complete\n          : Support for expiring benefits (low-income)\n          : Improved UX for agency card enrollment\n          : Improved UX for application error states\n\n          Q3<br>Now\n          : Deploy low-income riders enrollment pathway\n          : Benefits admin tool (Agency users)\n          : Benefits admin tool (In-person eligibility verification)\n\n          Q4<br>Next\n          : Release Medicare cardholder enrollment pathway\n          : Benefits admin tool (Agency configuration)\n          : Support eligibility verification for disabled Veterans\n\n%% Cal-ITP Benefits Epics (2025)\n          section 2025\n\n          Q1\n          : Support benefits reciprocity between CA transit agencies\n          : Implement evolved organizing principles for app UX\n\n          Q2\n          : Support for multiple transit processors\n          : Integration with all MSA transit processors\n\n%%{\n    init: {\n        'logLevel': 'debug',\n        'theme': 'default' ,\n        'themeVariables': {\n            'cScale0': '#ffa500', 'cScaleLabel0': '#000000',\n            'cScale1': '#ffff00', 'cScaleLabel1': '#000000',\n            'cScale2': '#ffff00', 'cScaleLabel2': '#000000',\n            'cScale3': '#008000', 'cScaleLabel3': '#ffffff',\n            'cScale4': '#0000ff', 'cScaleLabel4': '#ffffff',\n            'cScale5': '#4b0082', 'cScaleLabel5': '#ffffff',\n            'cScale6': '#000000', 'cScaleLabel6': '#ffffff'\n        }\n    }\n}%%
"},{"location":"enrollment-pathways/agency-cards/","title":"Agency Cards","text":"

Agency Cards is a generic term for reduced fare programs offered by Transit Providers, such as the Courtesy Card program from Monterey-Salinas Transit (MST).

Agency cards are different from our other use cases in that eligibility verification happens on the agency side (offline) rather than through the Benefits app, and the Benefits app then checks for a valid Agency Card via an Eligibility API call.

"},{"location":"enrollment-pathways/agency-cards/#demonstration","title":"Demonstration","text":"

Here\u2019s a video showing what the flow looks like, having agency cardholders confirm eligibility via the Eligibility Server and enroll via Littlepay:

"},{"location":"enrollment-pathways/agency-cards/#architecture","title":"Architecture","text":"

In order to support an Agency Cards deployment, the Transit Provider produces a list of eligible users (CSV format) that is loaded into an instance of Eligibility Server running in the Transit Provider\u2019s cloud.

Cal-ITP makes the hashfields tool to facilitate masking user data before it leaves Transit Provider on-premises systems.

The complete system architecture looks like:

flowchart LR\n    rider((User's browser))\n    api[Eligibility Server]\n    data[Hashed Agency Card data]\n    cardsystem[Data source]\n\n    rider --> Benefits\n\n    subgraph CDT Azure\n        Benefits\n    end\n\n    Benefits --> api\n\n    subgraph Transit Provider cloud\n        api --> data\n    end\n\n    subgraph Transit Provider on-prem\n        cardsystem --> hashfields\n    end\n\n    hashfields --> data

Notes:

  • Eligibility Server source code
  • hashfields source code
  • More details about the Benefits architecture
  • In MST, the Data Source is Velocity, the system MST uses to manage and print Courtesy Cards
"},{"location":"enrollment-pathways/agency-cards/#process","title":"Process","text":"
sequenceDiagram\n    actor Rider\n    participant Benefits as Benefits app\n    participant elig_server as Eligibility Server\n    participant cc_data as Hashed data\n    participant Data Source\n    participant Littlepay\n\n    Data Source-->>cc_data: exports nightly\n    cc_data-->>elig_server: gets loaded on Server start\n\n    Rider->>Benefits: visits site\n    Benefits-->>elig_server: passes entered Agency Card details\n    elig_server-->>Benefits: confirms eligibility\n\n    Benefits-->>Littlepay: enrollment start\n    Rider->>Littlepay: enters payment card details\n    Littlepay-->>Benefits: enrollment complete
"},{"location":"enrollment-pathways/low-income/","title":"Low-income","text":""},{"location":"enrollment-pathways/low-income/#overview","title":"Overview","text":"

This use case describes a feature in the Cal-ITP Benefits app that allows Californians to verify their active participation in the CalFresh Program\u2014as a proxy for low-income status\u2014to receive reduced fares for transit when paying by contactless debit or credit card at participating transit operators in California.

Actor:\u00a0A person who uses public transit in California. For benefit eligibility, a \u201clow-income rider\u201d is a person who has received CalFresh benefits in any of the previous three months.

Goal:\u00a0To verify a transit rider\u2019s financial need so they receive reduced fares when paying by contactless debit or credit card.

Precondition:\u00a0The California transit operator offers fixed route service, has installed and tested validator hardware necessary to collect fares using contactless payment on bus or rail lines, and the operator has a policy in place to offer a transit discount to low-income riders.

"},{"location":"enrollment-pathways/low-income/#basic-flow","title":"Basic Flow","text":"
sequenceDiagram\nautonumber\n%% Low-income Rider Enrollment Pathway\n    actor Transit Rider\n    participant Benefits as Benefits app\n    participant IdG as Identity Gateway\n    participant Login.gov\n    participant CDSS\n    participant Littlepay\nTransit Rider->>Benefits: visits benefits.calitp.org\n    activate Benefits\nBenefits-->>IdG: eligibility verification\n    activate IdG\nTransit Rider->>Login.gov: account authentication\n    activate Login.gov\nIdG-->>Login.gov: requests required PII\n    activate Login.gov\n    Note right of Login.gov: first name<br>last name<br>Social Security number<br>date of birth\nLogin.gov-->>IdG: returns required PII\n    deactivate Login.gov\nIdG-->>CDSS: check Calfresh enrollment status\n    activate CDSS\nCDSS-->>IdG: return Calfresh enrollment status\n    deactivate CDSS\nIdG-->>Benefits: eligibility response\n    deactivate IdG\n    deactivate Login.gov\nBenefits-->>Littlepay: payment enrollment start\n    activate Littlepay\nTransit Rider->>Littlepay: provides debit or credit card details\nLittlepay-->>Benefits: payment method enrollment confirmation\n    deactivate Littlepay\n    deactivate Benefits
  1. The transit rider visits the web application at benefits.calitp.org in a browser on their desktop computer.

  2. The transit rider chooses the transit operator that serves their area.

  3. The transit rider chooses to verify their eligibility as a participant in the CalFresh Program.

  4. The transit rider authenticates with their existing\u00a0Login.gov\u00a0account or, if they don\u2019t have one, creates a\u00a0Login.gov\u00a0account.

  5. The Cal-ITP Benefits app interfaces with the California Department of Technology Identity Gateway (IdG) to verify benefit eligibility. The IdG uses personal information shared by Login.gov to verify CalFresh participation status.

  6. The IdG uses the\u00a0response provided by the California Department of Social Services (CDSS) to determine the rider\u2019s eligibility for a transit benefit.

  7. The IdG then passes the response from CDSS as low-income status = TRUE to the Cal-ITP Benefits app to indicate the person is eligible for a benefit.

  8. The transit rider provides the debit or credit card details they use to pay for transit to Littlepay, the transit processor that facilitates transit fare collection.

  9. The app registers the low-income benefit with the transit rider\u2019s debit or credit card.

"},{"location":"enrollment-pathways/low-income/#alternative-flows","title":"Alternative Flows","text":"
  • Suppose the transit rider does not have a desktop computer. In this case, they open the web application at benefits.calitp.org in a mobile browser on their iOS or Android tablet or mobile device to complete enrollment using the basic flow.
  • Suppose the transit rider cannot authenticate with Login.gov, or will not create an account. In either case, the app cannot determine their CalFresh Program participation status and they cannot enroll their contactless debit or credit card for a reduced fare.
  • Suppose the IdG returns a status of FALSE for CalFresh Program participation status. In that case, the Cal-ITP Benefits app will not allow the transit rider to enroll their contactless debit or credit card for a reduced fare.
  • Suppose the debit or credit card expires or is canceled by the issuer. In that case, the transit rider must repeat the basic flow to register a new debit or credit card.
  • When the initial transit benefit enrollment period ends after one year from the date of enrollment, the transit rider must repeat the basic flow to re-enroll.
  • Suppose the transit rider attempts to re-enroll for a transit benefit as a CalFresh Program participant three months after their enrollment period started. The app will inform them they must wait re-enroll within 14 days of the benefit expiration.
  • Suppose the transit rider doesn\u2019t re-enroll for a transit benefit after one year, but continues paying for transit using the card they registered. The transit operator will charge the rider full fare.
  • If the transit rider uses more than one debit or credit card to pay for transit, they repeat the basic flow for each card.
"},{"location":"enrollment-pathways/low-income/#postcondition","title":"Postcondition","text":"

The transit rider receives a fare reduction each time they use the debit or credit card they registered to pay for transit rides. The number of times they can use the card to pay for transit is unlimited, but the benefit expires one year after enrollment.

"},{"location":"enrollment-pathways/low-income/#benefits","title":"Benefits","text":"
  • The transit rider no longer needs cash to pay for transit rides.
  • The transit rider doesn\u2019t have to lock up funds on a closed-loop card offered by the transit agency.
  • The transit rider pays for transit rides with their debit or credit card, just as they do for groceries, a cup of coffee, or any other good or service.
  • The transit rider can enroll in a transit benefit from home when convenient; they do not have to visit a transit agency in person.
  • The transit rider does not have to prove income eligibility with the transit agency. The app simply uses their participation in the CalFresh program to confirm eligibility for a transit benefit.
  • The transit agency doesn\u2019t have to craft and policy for a low-icome discount; they simply use the approach implemented in the Cal-ITP Benefits application. As more agencies adopt the application, they also adopt a standard policy for transit benefits.
  • Secure state and federal solutions manage the transit rider\u2019s personal identifiable information (PII):\u00a0Login.gov\u00a0and the California Department of Technology Identity Gateway (IdG). Transit riders do not have to share personal information with local transit operators.
  • Benefit enrollment takes minutes rather than days or weeks.
  • Benefit enrollment doesn\u2019t require online accounts with private companies.
"},{"location":"enrollment-pathways/low-income/#example-scenario","title":"Example Scenario","text":"

A CalFresh Program participant uses public transit regularly. They don\u2019t have a car and depend on buses to get to appointments and do errands that take too long to use their bicycle. Even though this person already qualifies for benefits from the California Department of Social Services, they had to navigate another extensive, in-person eligibility process with different requirements to qualify for reduced fares from their local transit agency. They now receive a 50% fare reduction but have to pay for transit rides using the closed loop card provided by the operator to receive the reduced fare. It\u2019s frustrating and inconvenient to reload this closed loop card in $10 payments every week, especially because they sometimes they could use the money tied up on the card to make ends meet. In summary, this person pays for daily expenses using three forms of payment: their Electronic Benefits Transfer (EBT) card for eligible items, their agency card for transportation, and their bank card (or cash) for everything else.

The transit operator serving their region of California implements contactless payments on fixed bus routes throughout the service area. This rider uses benefits.calitp.org on their mobile device to confirm their participation in the CalFresh Program offered by CDSS and registers their debit card for reduced fares. They tap to pay when boarding buses in their area and are automatically charged the reduced fare. While they still need to manage funds on their EBT card and their bank card, they no longer need to use their transit operator card to pay for transit. Best of all, they have complete access to all funds in their weekly budget. If other expenses are higher one week, they can allocate additional funds to those areas and ride transit less.

"},{"location":"enrollment-pathways/older-adults/","title":"Older adults","text":"

One Benefits application use case is for riders age 65 years and older. The Benefits application verifies the person\u2019s age to confirm eligibility and allows those eligible to enroll their contactless payment card for their transit benefit.

Currently, the app uses Login.gov\u2019s Identity Assurance Level 2 (IAL2) to confirm age, which requires a person to have a Social Security number, a valid state-issued ID card and a phone number with a phone plan associated with the person\u2019s name. Adding ways to confirm eligibility for people without a Social Security number, for people who are part of a transit agency benefit program are on the roadmap.

"},{"location":"enrollment-pathways/older-adults/#demonstration","title":"Demonstration","text":"

Here\u2019s a video showing what the flow looks like, having older adults confirm eligibility via Login.gov and enroll via Littlepay:

"},{"location":"enrollment-pathways/older-adults/#process","title":"Process","text":"
sequenceDiagram\n    actor Rider\n    participant Benefits as Benefits app\n    participant IdG as Identity Gateway\n    participant Login.gov\n    participant Littlepay\n\n    Rider->>Benefits: visits site\n    Benefits-->>IdG: identity proofing\n    IdG-->>Login.gov: identity proofing\n    Rider->>Login.gov: enters SSN and ID\n    Login.gov-->>IdG: eligibility verification\n    IdG-->>Benefits: eligibility verification\n    Benefits-->>Littlepay: enrollment start\n    Rider->>Littlepay: enters payment card details\n    Littlepay-->>Benefits: enrollment complete
"},{"location":"enrollment-pathways/veterans/","title":"Veterans","text":""},{"location":"enrollment-pathways/veterans/#overview","title":"Overview","text":"

This use case describes a feature in the Cal-ITP Benefits app that allows US veterans who use public transit to verify their veteran status and receive reduced fares when paying by contactless debit or credit card at participating transit providers in California.

Actor:\u00a0A US veteran who uses public transit in California. For benefit eligibility, a veteran is defined as \u201ca person who served in the active military, naval, or air service, and was discharged or released therefrom under conditions other than dishonorable.\u201d (source)

Goal:\u00a0To verify a transit rider\u2019s veteran status and enable the rider to receive reduced fares when paying by contactless debit or credit card.

Precondition:\u00a0The California transit provider delivering fixed route service has installed and tested validator hardware necessary to collect fares using contactless payment on bus or rail lines, and the provider has a policy to offer a transit discount for US veterans.

"},{"location":"enrollment-pathways/veterans/#demonstration","title":"Demonstration","text":"

Here\u2019s a video showing what the flow looks like, having veterans confirm eligibility via Login.gov and enroll via Littlepay:

"},{"location":"enrollment-pathways/veterans/#basic-flow","title":"Basic flow","text":"
sequenceDiagram\n%% Veteran Enrollment Pathway\n    actor Transit Rider\n    participant Benefits as Benefits app\n    participant IdG as Identity Gateway\n    participant Login.gov\n    participant VA.gov\n    participant Littlepay\nTransit Rider->>Benefits: visits benefits.calitp.org\n    activate Benefits\nBenefits-->>IdG: eligibility verification\n    activate IdG\nTransit Rider->>Login.gov: account authentication\n    activate Login.gov\nIdG-->>Login.gov: requests required PII\n    activate Login.gov\n    Note right of Login.gov: transit rider first name<br>transit rider last name<br>home address<br>date of birth\nLogin.gov-->>IdG: returns required PII\n    deactivate Login.gov\nIdG-->>VA.gov: check veteran status\n    activate VA.gov\nVA.gov-->>IdG: return veteran status\n    deactivate VA.gov\nIdG-->>Benefits: eligibility response\n    deactivate IdG\n    deactivate Login.gov\nBenefits-->>Littlepay: payment enrollment start\n    activate Littlepay\nTransit Rider->>Littlepay: provides debit or credit card details\nLittlepay-->>Benefits: payment method enrollment confirmation\n    deactivate Littlepay\n    deactivate Benefits
  1. The transit rider visits the web application at\u00a0benefits.calitp.org\u00a0in a browser on their desktop computer.
  2. The transit rider chooses the transit provider that serves their area.
  3. The transit rider selects the option to receive a reduced fare for veterans.
  4. The transit rider authenticates with their existing\u00a0Login.gov\u00a0account or creates a\u00a0Login.gov\u00a0account if they don\u2019t have one.
  5. The Cal-ITP Benefits app interfaces with the\u00a0California Department of Technology\u00a0Identity Gateway (IdG) to verify benefit eligibility. The IdG requests the required personal information to verify veteran status from\u00a0Login.gov.
  6. The IdG utilizes the\u00a0Veteran Confirmation API\u00a0provided by the US Department of Veterans Affairs to determine the rider\u2019s veteran status.
  7. The IdG passes the response from VA.gov as veteran status = TRUE to the Cal-ITP Benefits app to indicate the person is eligible for a benefit.
  8. The transit rider provides the debit or credit card details they use to pay for transit to Littlepay, the transit processor that facilitates transit fare collection.
  9. The app registers the veteran benefit with the transit rider\u2019s debit or credit card.
"},{"location":"enrollment-pathways/veterans/#alternative-flows","title":"Alternative flows","text":"
  • If the transit rider does not have a desktop computer, they can open the web application at benefits.calitp.org\u00a0in a mobile browser on their iOS or Android tablet or mobile device to complete enrollment using the basic flow.
  • Suppose the transit rider cannot authenticate with\u00a0Login.gov, or will not create an account. In either case, the app cannot determine their veteran status and, thus, cannot enroll their contactless debit or credit card for a reduced fare.
  • If VA.gov determines the person does not meet the definition of a veteran (IdG returns a veteran status of FALSE), the Cal-ITP Benefits app will not allow the transit rider to enroll their contactless debit or credit card for a reduced fare.
  • If the debit or credit card expires or is canceled by the issuer, the transit rider must repeat the basic flow to register a new debit or credit card.
  • If the transit rider uses more than one debit or credit card to pay for transit, they repeat the basic flow for each card.
"},{"location":"enrollment-pathways/veterans/#postcondition","title":"Postcondition","text":"

The transit rider receives a fare reduction each time they use the debit or credit card they registered to pay for transit rides. The number of times they can use the card to pay for transit is unlimited and the benefit never expires.

"},{"location":"enrollment-pathways/veterans/#benefits","title":"Benefits","text":"
  • The transit rider no longer needs cash to pay for transit rides.
  • The transit rider doesn\u2019t have to lock up funds on a closed-loop card offered by the transit provider.
  • The transit rider pays for transit rides with their debit or credit card, just as they pay for any other good or service that accepts contactless payment.
  • The transit rider can enroll in a transit benefit from home when convenient; they do not have to visit a transit provider in person.
  • Secure state and federal solutions manage the transit rider\u2019s personal identifiable information (PII):\u00a0Login.gov\u00a0and the California Department of Technology Identity Gateway (IdG). Transit riders do not have to share personal information with local transit agencies.
  • Benefits enrollment takes minutes rather than days or weeks.
"},{"location":"enrollment-pathways/veterans/#example-scenario","title":"Example scenario","text":"

A veteran in California uses public transit regularly. They don\u2019t have a car and depend on buses to get to appointments and do errands that take too long to use their bicycle. They receive a 50% fare reduction for being a US veteran but have to pay for transit rides using the closed loop card provided by the agency to receive the reduced fare. It\u2019s frustrating and inconvenient to reload this agency card in $10 payments every week, especially because they sometimes need the money tied up on the card to pay for groceries and medication.

The transit provider serving their part of California implements contactless payments on fixed bus routes throughout the service area. This rider uses\u00a0benefits.calitp.org\u00a0to confirm their veteran status and register their debit card for reduced fares. They tap to pay when boarding buses in their area and are automatically charged the reduced fare. They no longer need to carry one card to pay for transit and another for other purchases. Best of all, they have complete access to all funds in their weekly budget. If food and medication costs are higher one week, they can allocate additional funds to those areas and ride transit less.

"},{"location":"getting-started/","title":"Local setup","text":"

Running the Benefits application in a local, non-production environment requires Docker.

The following commands should be run in a terminal program like bash.

"},{"location":"getting-started/#clone-the-repository","title":"Clone the repository","text":"
git clone https://github.com/cal-itp/benefits\n
"},{"location":"getting-started/#create-an-environment-file","title":"Create an environment file","text":"

The application is configured with defaults to run locally, but an .env file is required to run with Docker Compose. Start from the existing sample:

cp .env.sample .env\n

E.g. to change the localhost port from the default 8000 to 9000, add the following line to your .env file:

DJANGO_LOCAL_PORT=9000\n

See Configuration for more details on supported environment variables and their settings.

"},{"location":"getting-started/#run-the-build-script","title":"Run the build script","text":"

This builds the runtime and devcontainer images:

bin/build.sh\n

If you need all layers to rebuild, use:

docker compose build --no-cache client\n
"},{"location":"getting-started/#start-the-client","title":"Start the client","text":"

The optional -d flag will start in detatched mode and allow you to continue using the terminal session.

docker compose up -d client\n

Otherwise attach your terminal to the container\u2019s terminal, showing the startup and runtime output:

docker compose up client\n

After initialization, the client is running running on http://localhost:8000 by default.

The backend administrative interface can be accessed at the /admin route using the superuser account you setup as part of initialization.

By default, sample values are used to initialize Django. Alternatively you may:

  • Set environment variable values to use instead of the default sample values

Stop the running services with:

docker compose down\n
"},{"location":"getting-started/documentation/","title":"Documentation","text":"

This website is built using mkdocs from the contents of the main (default) branch.

The mkdocs.yml file in the repository root configures the build process, including the available plugins.

"},{"location":"getting-started/documentation/#editing","title":"Editing","text":"

All content lives under the docs/ directory in the repository.

To add new sections/articles, create new directories and files under the docs/ directory, in Markdown format.

The pencil icon is a shortcut to quickly edit the content of the page you are viewing on the website:

Above: Screenshot showing the edit pencil circled in red

"},{"location":"getting-started/documentation/#features","title":"Features","text":"
  • Material for MkDocs: Reference

    See mkdocs.yml for enabled plugins/features

  • Mermaid

    Use code fences with mermaid type to render Mermaid diagrams within docs. For example, this markdown:

    ```mermaid\ngraph LR\n    Start --> Stop\n```\n

    Yields this diagram:

    graph LR\n    Start --> Stop
"},{"location":"getting-started/documentation/#running-locally","title":"Running locally","text":"

The documentation website can be run locally using Docker Compose:

# from inside the .devcontainer/ directory\ndocker compose up docs\n

The site is served from http://localhost at a port dynamically assigned by Docker. See Docker dynamic ports for more information.

The website is automatically rebuilt as changes are made to docs/ files.

"},{"location":"getting-started/documentation/#in-the-devcontainer","title":"In the Devcontainer","text":"

When running the Devcontainer, the docs site is automatically started.

See Docker dynamic ports for more information on accessing the site on localhost.

"},{"location":"getting-started/documentation/#deploying","title":"Deploying","text":"

A GitHub Action watches for pushes to main, and uses mhausenblas/mkdocs-deploy-gh-pages to build the mkdocs content, force-pushing to the gh-pages branch. At that point, GitHub Pages redeploys the docs site.

"},{"location":"product-and-design/analytics/","title":"Analytics","text":"

The Cal-ITP Benefits application, currently live at https://benefits.calitp.org/, uses Amplitude to collect specific user and event data properties to analyze application usage.

"},{"location":"product-and-design/analytics/#information-not-collected","title":"Information not collected","text":"

The following user attributes are not collected:

  • IP address
  • Designated Market Area (DMA)

See the Amplitude analytics code on GitHub.

"},{"location":"product-and-design/analytics/#user-information-collected","title":"User information collected","text":"

A combination of default and application-specific custom user properties are collected for each user who visits the Benefits web application.

"},{"location":"product-and-design/analytics/#default-amplitude-user-properties-collected","title":"Default Amplitude user properties collected","text":"

The following attributes are collected from the browser of every user who visits the application, provided the browser does not block the tracking library:

User property Description Example value(s) Carrier The device\u2019s carrier. Verizon Country Country of the event. This is pulled using GeoIP. United States City City of the event. This is pulled using GeoIP. San Francisco Device family Family of the device. Apple iPhone, Samsung Galaxy Tablet, Windows Device type Specific type of device. Apple iPhone 6, Samsung Galaxy Note 4, Windows Language Language of the device. English Library Library used to send the event. Amplitude-iOS/3.2.1, HTTP/1.0 OS Operating system is the name of the user\u2019s mobile operating system or browser. Operating system version is the version of the users\u2019 mobile operating system or browser. iOS 9.1, Chrome 46 Platform Platform of the product. Web Region Region (e.g. state, province, county) of the event. This is pulled using GeoIP. California Start version First version of the application identified for the user. 1.0.0 Version Current verison of the application identified for the user 1.0.0

Read more about each property on the Amplitude documentation.

"},{"location":"product-and-design/analytics/#custom-user-properties-collected","title":"Custom user properties collected","text":"

The following custom user attributes are collected when the user performs specific actions on the application, like selecing an eligibility type or transit agency:

User property Description Example value(s) eligibility_types Eligibility type chosen by user\u00a0 [veteran] eligibility_verifier Eligibility verifier used by user\u00a0 VA.gov - Veteran (MST) referrer URL that the event came from\u00a0 https://benefits.calitp.org/help/ referring_domain Domain that the event came from\u00a0 benefits.calitp.org transit_agency Agency chosen by the user\u00a0 Monterey-Salinas Transit user_agent User\u2019s browser agent\u00a0 Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36"},{"location":"product-and-design/analytics/#event-information-collected","title":"Event information collected","text":"

Information is collected on key user actions on the app, called events. Read about each event on the Amplitude event documentation for Benefits. Each event is categorized within one of four categories: core, authentication, eligibility or enrollment.

"},{"location":"product-and-design/analytics/#core-events","title":"Core events","text":"

These events track when a user clicks on a link on the application.

  • changed language
  • clicked link
  • viewed page

Read more on each of these events on the Amplitude event documentation for Benefits, filtered by Core.

"},{"location":"product-and-design/analytics/#authentication-events","title":"Authentication events","text":"

These events track the progress of a user going through the authentication process of both signing in and optionally signing out.

  • canceled sign in
  • finished sign in
  • finished sign out
  • started sign in
  • started sign out

Read more on each of these events on the Amplitude event documentation for Benefits, filtered by Authentication.

"},{"location":"product-and-design/analytics/#eligibility-events","title":"Eligibility events","text":"

These events track the progress of a user choosing an eligibility verifier and completing eligibility verification.

  • returned eligibility
  • selected eligibility verifier
  • started eligibility

Read more on each of these events on the Amplitude event documentation for Benefits, filtered by Eligibility.

"},{"location":"product-and-design/analytics/#enrollment-events","title":"Enrollment events","text":"

These events track the progress of a user who has successfully verified their eligibility and is enrolling their payment card with the system.

  • closed payment connection
  • returned enrollment
  • started payment connection

Read more on each of these events on the Amplitude event documentation for Benefits, filtered by Enrollment.

"},{"location":"product-and-design/analytics/#key-metrics","title":"Key metrics","text":"

Various key metrics are collected and analyzed, including:

  • Number of users who successfully completed authentication: Users who started sign in, finished sign in
  • Number of users who successfully verified eligibility: Users who completed the above and selected eligibility verifier, started eligibility, returned eligibility with a status of True
  • Numbers of users who successfully completed enrollment: Users who completed all of the above and started payment connection, closed payment connection and returned enrollment with a status of Success
"},{"location":"product-and-design/copy-delivery/","title":"Copy delivery process","text":"

The locale folder in this repository contain the django.po message files for English and Spanish translation strings for the Benefits application.

Translation strings include all application copy, including:

  • All application copy
  • Image and illustration alt tags
  • Page titles used in the browser tab
  • In-line link URLs
  • Error messages (like no script, no cookies warnings)
"},{"location":"product-and-design/copy-delivery/#cal-itp-benefits-application-copy","title":"Cal-ITP Benefits Application Copy","text":"

The human-readable version of the English and Spanish translation strings for the application are delivered to Design and Engineering by Product, and live at this link: Cal-ITP Benefits Application Copy.

By tabs:

  • EN-USA tab contains all copy for English, which each row representing a page. This copy uses a sample agency, called California State Transit (CST) with an Agency Card. This copy is used in Figma.
  • forTranslation and All Agencies tab contains the English and Spanish translation side by side, with agency-specific copy.
"},{"location":"product-and-design/copy-delivery/#copy-delivery-process-responsibilities","title":"Copy delivery process responsibilities","text":""},{"location":"product-and-design/copy-delivery/#product","title":"Product","text":"
  • Engage with product stakeholders to get the information necessary for copy writing.
  • Engage with copy writers to get the English language copy drafted, proofed and ready for design.
  • Engage with client editorial/communications team to ensure English language and Spanish language copy are edited according to client style guides.
  • Engage all necessary stakeholders to get English language copy approved and ready for design.
  • Compile copy in Cal-ITP Benefits Application Copy, ready to be used by Design, so Design can sync the spreadsheet to Figma.
  • Engage with the translation agency, iBabbleOn, to get Spanish translations ready for Engineering.
  • Transfer translations from iBabbleOn to the spreadsheet, in proper format.
  • Ensure English and Spanish copy is ready for Engineering.
"},{"location":"product-and-design/copy-delivery/#design","title":"Design","text":"
  • Sync copy from Cal-ITP Benefits Application Copy into Figma.
  • Ensure the string is in the appropriate column (e.g. Subtitle, ButtonLabel)
"},{"location":"product-and-design/copy-delivery/#engineering","title":"Engineering","text":"
  • Use copy from the English and Spanish language tabs of the spreadsheet, and turning it into code in django.po message files. Developer-specific instructions in the Django message files technical documentation.
  • Ensure the messages accurately reflect the spreadsheet and Figma designs.
"},{"location":"product-and-design/copy-style/","title":"Copy terms and style","text":"

Use the following terms and style rules for Benefits application English and Spanish copy. Refer to the Cal-ITP Editorial Style Guide and Language Matters: Cal-ITP Terminology for further guidance.

"},{"location":"product-and-design/copy-style/#terms","title":"Terms","text":"Use English Spanish Do not use Usage agency card agency card tarjeta de agencia Agency Card (don\u2019t capitalize both words) benefit option benefit option opci\u00f3n de beneficio Cal-ITP California Integrated Travel Project California Integrated Travel Project (Proyecto Integrado de Viaje de California, o Cal-ITP por sus siglas en ingl\u00e9s) Cal-ITP Benefits Cal-ITP Benefits Cal-ITP Benefits Do not translate Cal-ITP Benefits California Department of Transportation California Department of Transportation Departamento de Transporte de California California Department of Technology California Department of Technology Departamento de Tecnolog\u00eda de California connects connects conecta contactless card contactless card tarjeta sin contacto payment card, cashless, tap-to-pay, touchless enroll enroll inscribirse apply enrollment process enrollment process proceso de inscripci\u00f3n GitHub GitHub GitHub Github Littlepay Littlepay Littlepay LittlePay Older Adult Older Adult adultos mayores Senior public transportation public transportation transporte p\u00fablico reduced fare reduced fare tarifa reducida discounted Social Security number Social Security number n\u00famero de Seguro Social social security number state-issued ID card state-issued ID card tarjeta de identificaci\u00f3n emitida por el estado driver\u2019s license tap to ride tap to ride toque para viajar transit agency transit agency agencia de tr\u00e1nsito bus agency, light rail agency, transit authority Refer to Language Matters: Cal-ITP Terminology transit benefit transit benefit beneficio de tr\u00e1nsito discount, fare discounts, reduced-fare \u201cOlder adult transit benefit\u201d, \u201cVeteran transit benefit\u201d transit provider transit provider proveedor de transporte US Veteran US Veteran Veterano de EE. UU. U.S. Veteran, US veteran Note: This currently goes against Cal-ITP Editorial Style Guide verify verify verifique"},{"location":"product-and-design/copy-style/#style","title":"Style","text":"Rule Examples Capitalization Always sentence-case body text, headlines, questions on Help page. Unable to confirm eligibility | Cal-ITP Benefits In English, names of pages are capitalized. Return Home Previous Page In Spanish, names of pages are not capitalized. Volver al inicio P\u00e1gina anterior Refer to Cal-ITP Editorial Style Guide Images, illustrations Always write an alt tag, unless Design determines the visual is purely decorative and has no substantive meaning. Links Never link to \u201chere\u201d. Use a descriptive title for the page. Tense For Spanish, use usted/formal case for all copy. Numbers Refer to Cal-ITP Editorial Style Guide Spacing Refer to Cal-ITP Editorial Style Guide Punctuation Refer to Cal-ITP Editorial Style Guide"},{"location":"product-and-design/use-cases/enrollment-use-cases/","title":"Enrollment use cases","text":"

The use cases documented on this page focus on how the system is supposed to work from the perspective of the end user.

"},{"location":"product-and-design/use-cases/enrollment-use-cases/#use-case-enroll-contactless-card-to-receive-transit-benefit","title":"Use case: Enroll contactless card to receive transit benefit","text":"

Primary Actor: Transit rider

Systems: Benefits app, transit processor

Preconditions:

  • Transit rider has confirmed their eligibility with the Benefits app
  • Transit rider has their contactless card information available
  • Benefits app is able to contact the transit processor

Trigger: Transit rider initiates the enrollment phase

Basic flow:

  1. Transit rider enters their contactless card information
  2. Benefits app passes that information to the transit processor to enroll the card
  3. Transit processor successfully enrolls card

Alternate flows:

  • 3a. Transit processor returns with one of the following errors: card verification failed, token is invalid, or general server error

    • 3a1. Transit rider chooses to retry, starting back at initiating the enrollment phase
    • 3b1. Transit rider leaves the Benefits app

Postconditions:

  • Transit rider\u2019s contactless card is enrolled to receive the transit benefit
"},{"location":"tests/automated-tests/","title":"Automated tests","text":""},{"location":"tests/automated-tests/#cypress","title":"Cypress","text":"

Feature and user interface tests are implemented with cypress and can be found in the tests/cypress directory in the repository.

See the cypress Command Line guide for more information.

"},{"location":"tests/automated-tests/#running","title":"Running","text":"

These are instructions for running cypress locally on your machine, without the devcontainer. These steps will install cypress and its dependencies on your machine. Make sure to run these commands in a Terminal.

  1. Ensure you have Node.js and NPM available on your local machine:

    node -v\nnpm -v\n

    If not, install Node.js locally.

  2. Start the local eligibility verification server:

    docker compose up --detach server\n
  3. Start the the application:

    docker compose run --detach --service-ports client bin/test_start.sh\n
  4. Change into the cypress directory:

    cd tests/cypress\n
  5. Install all packages and cypress. Verify cypress installation succeeds:

    npm install\n
  6. Run cypress with test environment variables and configuration variables:

    CYPRESS_baseUrl=http://localhost:8000 npm run cypress:open\n

See tests/cypress/package.json for more cypress scripts.

As of Cypress 12.5.1 with Firefox 109, there is a CSRF issue that prevents the tests from passing; unclear if this is a bug in Cypress or what. Use one of the other browser options.

"},{"location":"tests/automated-tests/#pytest","title":"Pytest","text":"

The tests done at a request/unit level are run via pytest-django.

To run locally, start the Devcontainer and run:

tests/pytest/run.sh\n

The helper script:

  1. Runs the tests with pytest
  2. Calculates test coverage with coverage
  3. Generates a coverage report in HTML in the app\u2019s static/ directory

The report can be viewed by launching the app and navigating to http://localhost:$DJANGO_LOCAL_PORT/static/coverage/index.html

The report files include a local .gitignore file, so the entire directory is hidden from source control.

"},{"location":"tests/automated-tests/#latest-coverage-report","title":"Latest coverage report","text":"

We also make the latest (from main) coverage report available online here: Coverage report

"},{"location":"tests/manual-tests/","title":"Manual tests","text":"

This page lists manual testing scripts for various flows.

"},{"location":"tests/manual-tests/#getting-started-using-test-credentials","title":"Getting started: Using test credentials","text":"

In order to fully test the app, you will need to use test credentials, which are available here: Benefits Test Data.

Important: Please do not use your personal accounts for Login.gov, ID.me, etc. to complete your review.

"},{"location":"tests/manual-tests/#logingov-and-veteran-confirmation-api","title":"Login.gov and Veteran Confirmation API","text":"

To test the Login.gov (Older adult) and Veteran Confirmation API (Veteran) enrollment pathway flows, you will need an e-mail address, a real cell phone and test account yml files from the Benefits Test Data document.

Read the Login.gov Testing identity proofing documentation for complete instructions. In summary, once you click Get started with Login.gov, follow these instructions:

  1. Before you get started, download the proofing-senior.yml (or any other yml file for the specific user you are testing) from the Benefits Test Data document. For example, if you are testing the Veteran flow, or a non-senior flow, download the proofing-veteran.yml or proofing-nonsenior.yml files respectively.
  2. Click Create an account.
  3. Create a test email address, like yourname+older_adult@compiler.la. Gmail supports adding suffixes to your email address.
  4. Select English (default) and check I read and accept the Login.gov Rules of Use.
  5. Check your email for a confirmation link and click it.
  6. Go through the password and authentication method setup flows. Make sure to select Text or voice message. Selecting Backup codes is useful if you plan to use this account again. Make sure to save your password, as you will need to enter it at the very end.
  7. Enter your real cell phone number.
  8. Check your text messages for a message from Login.gov. The message should specify idp.int.identitysandbox.gov.
  9. Enter the code into the browser.
  10. Save the backup codes, if selected.
  11. Click Continue until you reach the How would you like to add your ID? part of the flow.
  12. Click Upload photos.
  13. Upload the .yml files you downloaded in the first step for both the front and back of the ID. Click Continue.
  14. For Enter your Social Security number, enter a number that starts with 900 or 666. DO NOT ENTER YOUR PERSONAL SOCIAL SECURITY NUMBER.
  15. At this point, the Verify your information page should show the data you have in the .yml file you uploaded. Double-check that the age (date of birth) is accurate.
  16. Verify your phone again.
  17. Re-enter your password. You should be redirected back to the Benefits application.
"},{"location":"tests/manual-tests/#agency-cards","title":"Agency cards","text":"

To test the agency card enrollment pathway, use the following test credentials:

  • Courtesy Cards (MST)
  • Reduced Fare Mobility ID (SBMTD)
"},{"location":"tests/manual-tests/#littlepay","title":"Littlepay","text":"

To test the Littlepay card enrollment flow, use the test Visa credentials in the Benefits Test Data document, along with any fake name, any CVV and an expiration date in the future.

"},{"location":"tests/manual-tests/#keyboard-testing","title":"Keyboard testing","text":"

Keyboard testing refers to test the app on a desktop/laptop machine without using a mouse/trackpad. To do so, use Tab to focus on a button or link, and Enter to select a button or link.

Make sure:

  • All links and buttons have a visible indication that the targeted item is focused.
  • All modals close by pressing Escape.
  • The skip nav, a link with the text Skip to main content / Saltar al contenido principal should appear on the first tab press.
"},{"location":"tests/manual-tests/#spanish-translation-testing","title":"Spanish translation testing","text":"
  1. Open the test environment Benefits application in the test environment using a supported browser.
  2. Click the Espa\u00f1ol button on the right side of the application header, to switch the application language to Spanish.
  3. Click Elija su Proveedor and choose Monterey-Salinas Transit as your transit agency.
  4. Follow the Adulto mayor / Older adult enrollment pathway to completion using test data. You will need a cell phone, a test Login.gov account and test Littlepay card credentials.
  5. Follow the Veterano de EE. UU. / Veterans enrollment pathway to completion using test data. You will need a cell phone, a test Login.gov account and test Littlepay card credentials.
  6. Follow the Tarjeta de cortes\u00eda de MST / Courtesy Card pathway to completion using test data. You will need test Courtesy Card credentials and test Littlepay card credentials.
  7. Click Ayuda in the footer to review the Help page.
  8. Jot down any issues or notes during the review. Highlight any proposed changes on the forTranslation tab in the Cal-ITP Benefits Application Copy spreadsheet. Use the comment feature in Google Sheets to share your feedback. Please mention Andy Walker and Machiko Yasuda in each comment.
"}]} \ No newline at end of file diff --git a/sitemap.xml b/sitemap.xml new file mode 100644 index 000000000..0987a6aaa --- /dev/null +++ b/sitemap.xml @@ -0,0 +1,198 @@ + + + + https://docs.calitp.org/benefits/ + 2024-08-13 + daily + + + https://docs.calitp.org/benefits/configuration/ + 2024-08-13 + daily + + + https://docs.calitp.org/benefits/configuration/admin-interface/ + 2024-08-13 + daily + + + https://docs.calitp.org/benefits/configuration/content-security-policy/ + 2024-08-13 + daily + + + https://docs.calitp.org/benefits/configuration/data/ + 2024-08-13 + daily + + + https://docs.calitp.org/benefits/configuration/environment-variables/ + 2024-08-13 + daily + + + https://docs.calitp.org/benefits/configuration/oauth/ + 2024-08-13 + daily + + + https://docs.calitp.org/benefits/configuration/rate-limit/ + 2024-08-13 + daily + + + https://docs.calitp.org/benefits/configuration/recaptcha/ + 2024-08-13 + daily + + + https://docs.calitp.org/benefits/configuration/transit-agency/ + 2024-08-13 + daily + + + https://docs.calitp.org/benefits/deployment/ + 2024-08-13 + daily + + + https://docs.calitp.org/benefits/deployment/hotfix/ + 2024-08-13 + daily + + + https://docs.calitp.org/benefits/deployment/infrastructure/ + 2024-08-13 + daily + + + https://docs.calitp.org/benefits/deployment/release/ + 2024-08-13 + daily + + + https://docs.calitp.org/benefits/deployment/rollback/ + 2024-08-13 + daily + + + https://docs.calitp.org/benefits/deployment/secrets/ + 2024-08-13 + daily + + + https://docs.calitp.org/benefits/deployment/troubleshooting/ + 2024-08-13 + daily + + + https://docs.calitp.org/benefits/deployment/workflows/ + 2024-08-13 + daily + + + https://docs.calitp.org/benefits/development/ + 2024-08-13 + daily + + + https://docs.calitp.org/benefits/development/application-logic/ + 2024-08-13 + daily + + + https://docs.calitp.org/benefits/development/commits-branches-merging/ + 2024-08-13 + daily + + + https://docs.calitp.org/benefits/development/docker-dynamic-ports/ + 2024-08-13 + daily + + + https://docs.calitp.org/benefits/development/i18n/ + 2024-08-13 + daily + + + https://docs.calitp.org/benefits/development/linting-pre-commit/ + 2024-08-13 + daily + + + https://docs.calitp.org/benefits/development/models-migrations/ + 2024-08-13 + daily + + + https://docs.calitp.org/benefits/development/test-server/ + 2024-08-13 + daily + + + https://docs.calitp.org/benefits/enrollment-pathways/ + 2024-08-13 + daily + + + https://docs.calitp.org/benefits/enrollment-pathways/agency-cards/ + 2024-08-13 + daily + + + https://docs.calitp.org/benefits/enrollment-pathways/low-income/ + 2024-08-13 + daily + + + https://docs.calitp.org/benefits/enrollment-pathways/older-adults/ + 2024-08-13 + daily + + + https://docs.calitp.org/benefits/enrollment-pathways/veterans/ + 2024-08-13 + daily + + + https://docs.calitp.org/benefits/getting-started/ + 2024-08-13 + daily + + + https://docs.calitp.org/benefits/getting-started/documentation/ + 2024-08-13 + daily + + + https://docs.calitp.org/benefits/product-and-design/analytics/ + 2024-08-13 + daily + + + https://docs.calitp.org/benefits/product-and-design/copy-delivery/ + 2024-08-13 + daily + + + https://docs.calitp.org/benefits/product-and-design/copy-style/ + 2024-08-13 + daily + + + https://docs.calitp.org/benefits/product-and-design/use-cases/enrollment-use-cases/ + 2024-08-13 + daily + + + https://docs.calitp.org/benefits/tests/automated-tests/ + 2024-08-13 + daily + + + https://docs.calitp.org/benefits/tests/manual-tests/ + 2024-08-13 + daily + + \ No newline at end of file diff --git a/sitemap.xml.gz b/sitemap.xml.gz new file mode 100644 index 0000000000000000000000000000000000000000..42148a55b03aefcfd17a47655d857452fa75d8dd GIT binary patch literal 610 zcmV-o0-gOIiwFn+qPk`R|8r?{Wo=<_E_iKh0M(eWa@#NrhW9*$&pRzU?cnxoXX_KR z4*-*pgbPJ7AY?~xU&zii?%JUzXpzW+$WJ&B_@Tqg`w&+bNOBZH{h%y2>&C^<@k+=53l+&U6W;wt))NhViv zBtMzq4iR~xjdBp4U1Fdtxr^Eemb zK4(!`ZUg$7`L&Jtx@;d`Fy^xOjQdFmrKs|~)ioD$N8Sjx&x4Ab>dsn=wMVROK<<_v z%b)ma^os1llwcsQ?FWmMxTf7c89|NOnQBb9!szY+V+33`$EYz)-Cc58i4DOzH`RPW zUNAAHSzFxt(E`$6VXDSx@12M9z`+{2R&Ym2Pa_%w&oOAmhA>94=JN{*&OPgbu{)Go zs;&Yo7z~lB;W)c{>3?nu=b+81gA`oAN?mFoL7aqqwT10-ne;i5mYK;QdX*`nE$*?Z wf`W>F<(JRN<$lYoNVHy#k_XV!>h9yE^A3 + + + + + + + + + + + + + + + + + + + + + + + Automated tests - cal-itp/benefits: documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + + + + +
+
+ + + +
+
+
+ + + + + + + + + +
+
+
+ + + + +
+
+ + + + + + + +

Automated tests

+

Cypress

+

Feature and user interface tests are implemented with cypress and can be found in the +tests/cypress directory in the repository.

+

See the cypress Command Line guide for more information.

+

Running

+

These are instructions for running cypress locally on your machine, without the devcontainer. These steps +will install cypress and its dependencies on your machine. Make sure to run these commands in a Terminal.

+
    +
  1. +

    Ensure you have Node.js and NPM available on your local machine:

    +
    node -v
    +npm -v
    +
    +

    If not, install Node.js locally.

    +
  2. +
  3. +

    Start the local eligibility verification server:

    +
    docker compose up --detach server
    +
    +
  4. +
  5. +

    Start the the application:

    +
    docker compose run --detach --service-ports client bin/test_start.sh
    +
    +
  6. +
  7. +

    Change into the cypress directory:

    +
    cd tests/cypress
    +
    +
  8. +
  9. +

    Install all packages and cypress. Verify cypress installation succeeds:

    +
    npm install
    +
    +
  10. +
  11. +

    Run cypress with test environment variables and configuration variables:

    +
    CYPRESS_baseUrl=http://localhost:8000 npm run cypress:open
    +
    +
  12. +
+

See tests/cypress/package.json for more cypress scripts.

+

As of Cypress 12.5.1 with Firefox 109, there is a CSRF issue that prevents the tests from passing; unclear if this is a bug in Cypress or what. Use one of the other browser options.

+

Pytest

+

The tests done at a request/unit level are run via pytest-django.

+

To run locally, start the Devcontainer and run:

+
tests/pytest/run.sh
+
+

The helper script:

+
    +
  1. Runs the tests with pytest
  2. +
  3. Calculates test coverage with coverage
  4. +
  5. Generates a coverage report in HTML in the app’s static/ directory
  6. +
+

The report can be viewed by launching the app and navigating to http://localhost:$DJANGO_LOCAL_PORT/static/coverage/index.html

+

The report files include a local .gitignore file, so the entire directory is hidden from source control.

+

Latest coverage report

+

We also make the latest (from main) coverage report available online here: Coverage report

+ + + + + + + + + + + + + + + +
+
+ + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + \ No newline at end of file diff --git a/tests/coverage/class_index.html b/tests/coverage/class_index.html new file mode 100644 index 000000000..3e15b83dc --- /dev/null +++ b/tests/coverage/class_index.html @@ -0,0 +1,1173 @@ + + + + + Coverage report + + + + + +
+
+

Coverage report: + 93% +

+ +
+ +
+ + +
+
+

+ Files + Functions + Classes +

+

+ coverage.py v7.6.1, + created at 2024-08-13 23:09 +0000 +

+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Fileclassstatementsmissingexcludedbranchespartialcoverage
benefits/__init__.py(no class)6200067%
benefits/core/__init__.py(no class)00000100%
benefits/core/admin.pyClaimsProviderAdmin001300100%
benefits/core/admin.pyEligibilityTypeAdmin001200100%
benefits/core/admin.pySortableEnrollmentFlowAdmin002400100%
benefits/core/admin.pyTransitProcessorAdmin001200100%
benefits/core/admin.pyTransitAgencyAdmin002000100%
benefits/core/admin.py(no class)3302540100%
benefits/core/analytics.pyEvent270000100%
benefits/core/analytics.pyViewedPageEvent80000100%
benefits/core/analytics.pyChangedLanguageEvent20000100%
benefits/core/analytics.pyClient2719016223%
benefits/core/analytics.py(no class)32102194%
benefits/core/apps.pyCoreAppConfig00000100%
benefits/core/apps.py(no class)50000100%
benefits/core/context_processors.py(no class)382012194%
benefits/core/middleware.pyAgencySessionRequired50020100%
benefits/core/middleware.pyEligibleSessionRequired50020100%
benefits/core/middleware.pyDebugSession220000%
benefits/core/middleware.pyHealthcheck40020100%
benefits/core/middleware.pyHealthcheckUserAgents5004189%
benefits/core/middleware.pyFlowSessionRequired50020100%
benefits/core/middleware.pyViewedPageEvent60000100%
benefits/core/middleware.pyChangedLanguageEvent70040100%
benefits/core/middleware.pyLoginRequired40020100%
benefits/core/middleware.pyRecaptchaEnabled3102160%
benefits/core/middleware.pyIndexOrAgencyIndexOrigin40020100%
benefits/core/middleware.py(no class)410000100%
benefits/core/models.pySecretNameField40000100%
benefits/core/models.pyPemData11204087%
benefits/core/models.pyClaimsProvider30000100%
benefits/core/models.pyEligibilityType2300140100%
benefits/core/models.pyEnrollmentFlow16106191%
benefits/core/models.pyEnrollmentFlow.Meta00000100%
benefits/core/models.pyTransitProcessor10000100%
benefits/core/models.pyTransitAgency230020100%
benefits/core/models.py(no class)13900400100%
benefits/core/recaptcha.py(no class)13506158%
benefits/core/session.py(no class)1421040099%
benefits/core/urls.pyTransitAgencyPathConverter120020100%
benefits/core/urls.py(no class)120000100%
benefits/core/views.py(no class)5300320100%
benefits/core/widgets.pyFormControlTextInput6104270%
benefits/core/widgets.pyFlowRadioSelect9002191%
benefits/core/widgets.py(no class)100000100%
benefits/eligibility/__init__.py(no class)00000100%
benefits/eligibility/analytics.pyEligibilityEvent30000100%
benefits/eligibility/analytics.pySelectedVerifierEvent110000%
benefits/eligibility/analytics.pyStartedEligibilityEvent10000100%
benefits/eligibility/analytics.pyReturnedEligibilityEvent6004280%
benefits/eligibility/analytics.py(no class)19300084%
benefits/eligibility/apps.pyEligibilityAppConfig00000100%
benefits/eligibility/apps.py(no class)50000100%
benefits/eligibility/forms.pyEnrollmentFlowSelectionForm10106188%
benefits/eligibility/forms.pyEligibilityVerificationForm251014195%
benefits/eligibility/forms.pyCSTAgencyCard10000100%
benefits/eligibility/forms.pyMSTCourtesyCard10000100%
benefits/eligibility/forms.pySBMTDMobilityPass10000100%
benefits/eligibility/forms.py(no class)270000100%
benefits/eligibility/urls.py(no class)40000100%
benefits/eligibility/verify.py(no class)160060100%
benefits/eligibility/views.py(no class)1022058397%
benefits/enrollment/__init__.py(no class)00000100%
benefits/enrollment/analytics.pyReturnedEnrollmentEvent5104267%
benefits/enrollment/analytics.pyFailedAccessTokenRequestEvent3002180%
benefits/enrollment/analytics.py(no class)13300077%
benefits/enrollment/apps.pyEnrollmentAppConfig00000100%
benefits/enrollment/apps.py(no class)50000100%
benefits/enrollment/forms.pyCardTokenizeSuccessForm00000100%
benefits/enrollment/forms.pyCardTokenizeFailForm30000100%
benefits/enrollment/forms.py(no class)90000100%
benefits/enrollment/urls.py(no class)40000100%
benefits/enrollment/views.py(no class)1531056299%
benefits/in_person/__init__.py(no class)00000100%
benefits/in_person/apps.pyInPersonConfig00000100%
benefits/in_person/apps.py(no class)40000100%
benefits/in_person/urls.py(no class)50000100%
benefits/in_person/views.py(no class)70000100%
benefits/locale/__init__.py(no class)00000100%
benefits/locale/en/__init__.py(no class)00000100%
benefits/locale/en/formats.py(no class)10000100%
benefits/locale/es/__init__.py(no class)00000100%
benefits/locale/es/formats.py(no class)10000100%
benefits/oauth/__init__.py(no class)00000100%
benefits/oauth/analytics.pyOAuthEvent40020100%
benefits/oauth/analytics.pyOAuthErrorEvent20000100%
benefits/oauth/analytics.pyStartedSignInEvent110000%
benefits/oauth/analytics.pyCanceledSignInEvent110000%
benefits/oauth/analytics.pyFinishedSignInEvent30020100%
benefits/oauth/analytics.pyStartedSignOutEvent110000%
benefits/oauth/analytics.pyFinishedSignOutEvent220000%
benefits/oauth/analytics.py(no class)27500081%
benefits/oauth/apps.pyOAuthAppConfig00000100%
benefits/oauth/apps.py(no class)50000100%
benefits/oauth/client.py(no class)240040100%
benefits/oauth/middleware.pyFlowUsesClaimsVerificationSessionRequired130060100%
benefits/oauth/middleware.py(no class)100000100%
benefits/oauth/redirects.py(no class)220020100%
benefits/oauth/urls.py(no class)40000100%
benefits/oauth/views.py(no class)1251042298%
benefits/secrets.pySecretNameValidator30000100%
benefits/secrets.py(no class)458010180%
benefits/sentry.py(no class)5712014179%
benefits/settings.py(no class)1196024890%
benefits/urls.py(no class)22702167%
benefits/wsgi.py(no class)440000%
Total 1675981064663693%
+

+ No items found using the specified filter. +

+
+ + + diff --git a/tests/coverage/coverage_html_cb_6fb7b396.js b/tests/coverage/coverage_html_cb_6fb7b396.js new file mode 100644 index 000000000..1face13de --- /dev/null +++ b/tests/coverage/coverage_html_cb_6fb7b396.js @@ -0,0 +1,733 @@ +// Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 +// For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt + +// Coverage.py HTML report browser code. +/*jslint browser: true, sloppy: true, vars: true, plusplus: true, maxerr: 50, indent: 4 */ +/*global coverage: true, document, window, $ */ + +coverage = {}; + +// General helpers +function debounce(callback, wait) { + let timeoutId = null; + return function(...args) { + clearTimeout(timeoutId); + timeoutId = setTimeout(() => { + callback.apply(this, args); + }, wait); + }; +}; + +function checkVisible(element) { + const rect = element.getBoundingClientRect(); + const viewBottom = Math.max(document.documentElement.clientHeight, window.innerHeight); + const viewTop = 30; + return !(rect.bottom < viewTop || rect.top >= viewBottom); +} + +function on_click(sel, fn) { + const elt = document.querySelector(sel); + if (elt) { + elt.addEventListener("click", fn); + } +} + +// Helpers for table sorting +function getCellValue(row, column = 0) { + const cell = row.cells[column] // nosemgrep: eslint.detect-object-injection + if (cell.childElementCount == 1) { + var child = cell.firstElementChild; + if (child.tagName === "A") { + child = child.firstElementChild; + } + if (child instanceof HTMLDataElement && child.value) { + return child.value; + } + } + return cell.innerText || cell.textContent; +} + +function rowComparator(rowA, rowB, column = 0) { + let valueA = getCellValue(rowA, column); + let valueB = getCellValue(rowB, column); + if (!isNaN(valueA) && !isNaN(valueB)) { + return valueA - valueB; + } + return valueA.localeCompare(valueB, undefined, {numeric: true}); +} + +function sortColumn(th) { + // Get the current sorting direction of the selected header, + // clear state on other headers and then set the new sorting direction. + const currentSortOrder = th.getAttribute("aria-sort"); + [...th.parentElement.cells].forEach(header => header.setAttribute("aria-sort", "none")); + var direction; + if (currentSortOrder === "none") { + direction = th.dataset.defaultSortOrder || "ascending"; + } + else if (currentSortOrder === "ascending") { + direction = "descending"; + } + else { + direction = "ascending"; + } + th.setAttribute("aria-sort", direction); + + const column = [...th.parentElement.cells].indexOf(th) + + // Sort all rows and afterwards append them in order to move them in the DOM. + Array.from(th.closest("table").querySelectorAll("tbody tr")) + .sort((rowA, rowB) => rowComparator(rowA, rowB, column) * (direction === "ascending" ? 1 : -1)) + .forEach(tr => tr.parentElement.appendChild(tr)); + + // Save the sort order for next time. + if (th.id !== "region") { + let th_id = "file"; // Sort by file if we don't have a column id + let current_direction = direction; + const stored_list = localStorage.getItem(coverage.INDEX_SORT_STORAGE); + if (stored_list) { + ({th_id, direction} = JSON.parse(stored_list)) + } + localStorage.setItem(coverage.INDEX_SORT_STORAGE, JSON.stringify({ + "th_id": th.id, + "direction": current_direction + })); + if (th.id !== th_id || document.getElementById("region")) { + // Sort column has changed, unset sorting by function or class. + localStorage.setItem(coverage.SORTED_BY_REGION, JSON.stringify({ + "by_region": false, + "region_direction": current_direction + })); + } + } + else { + // Sort column has changed to by function or class, remember that. + localStorage.setItem(coverage.SORTED_BY_REGION, JSON.stringify({ + "by_region": true, + "region_direction": direction + })); + } +} + +// Find all the elements with data-shortcut attribute, and use them to assign a shortcut key. +coverage.assign_shortkeys = function () { + document.querySelectorAll("[data-shortcut]").forEach(element => { + document.addEventListener("keypress", event => { + if (event.target.tagName.toLowerCase() === "input") { + return; // ignore keypress from search filter + } + if (event.key === element.dataset.shortcut) { + element.click(); + } + }); + }); +}; + +// Create the events for the filter box. +coverage.wire_up_filter = function () { + // Populate the filter and hide100 inputs if there are saved values for them. + const saved_filter_value = localStorage.getItem(coverage.FILTER_STORAGE); + if (saved_filter_value) { + document.getElementById("filter").value = saved_filter_value; + } + const saved_hide100_value = localStorage.getItem(coverage.HIDE100_STORAGE); + if (saved_hide100_value) { + document.getElementById("hide100").checked = JSON.parse(saved_hide100_value); + } + + // Cache elements. + const table = document.querySelector("table.index"); + const table_body_rows = table.querySelectorAll("tbody tr"); + const no_rows = document.getElementById("no_rows"); + + // Observe filter keyevents. + const filter_handler = (event => { + // Keep running total of each metric, first index contains number of shown rows + const totals = new Array(table.rows[0].cells.length).fill(0); + // Accumulate the percentage as fraction + totals[totals.length - 1] = { "numer": 0, "denom": 0 }; // nosemgrep: eslint.detect-object-injection + + var text = document.getElementById("filter").value; + // Store filter value + localStorage.setItem(coverage.FILTER_STORAGE, text); + const casefold = (text === text.toLowerCase()); + const hide100 = document.getElementById("hide100").checked; + // Store hide value. + localStorage.setItem(coverage.HIDE100_STORAGE, JSON.stringify(hide100)); + + // Hide / show elements. + table_body_rows.forEach(row => { + var show = false; + // Check the text filter. + for (let column = 0; column < totals.length; column++) { + cell = row.cells[column]; + if (cell.classList.contains("name")) { + var celltext = cell.textContent; + if (casefold) { + celltext = celltext.toLowerCase(); + } + if (celltext.includes(text)) { + show = true; + } + } + } + + // Check the "hide covered" filter. + if (show && hide100) { + const [numer, denom] = row.cells[row.cells.length - 1].dataset.ratio.split(" "); + show = (numer !== denom); + } + + if (!show) { + // hide + row.classList.add("hidden"); + return; + } + + // show + row.classList.remove("hidden"); + totals[0]++; + + for (let column = 0; column < totals.length; column++) { + // Accumulate dynamic totals + cell = row.cells[column] // nosemgrep: eslint.detect-object-injection + if (cell.classList.contains("name")) { + continue; + } + if (column === totals.length - 1) { + // Last column contains percentage + const [numer, denom] = cell.dataset.ratio.split(" "); + totals[column]["numer"] += parseInt(numer, 10); // nosemgrep: eslint.detect-object-injection + totals[column]["denom"] += parseInt(denom, 10); // nosemgrep: eslint.detect-object-injection + } + else { + totals[column] += parseInt(cell.textContent, 10); // nosemgrep: eslint.detect-object-injection + } + } + }); + + // Show placeholder if no rows will be displayed. + if (!totals[0]) { + // Show placeholder, hide table. + no_rows.style.display = "block"; + table.style.display = "none"; + return; + } + + // Hide placeholder, show table. + no_rows.style.display = null; + table.style.display = null; + + const footer = table.tFoot.rows[0]; + // Calculate new dynamic sum values based on visible rows. + for (let column = 0; column < totals.length; column++) { + // Get footer cell element. + const cell = footer.cells[column]; // nosemgrep: eslint.detect-object-injection + if (cell.classList.contains("name")) { + continue; + } + + // Set value into dynamic footer cell element. + if (column === totals.length - 1) { + // Percentage column uses the numerator and denominator, + // and adapts to the number of decimal places. + const match = /\.([0-9]+)/.exec(cell.textContent); + const places = match ? match[1].length : 0; + const { numer, denom } = totals[column]; // nosemgrep: eslint.detect-object-injection + cell.dataset.ratio = `${numer} ${denom}`; + // Check denom to prevent NaN if filtered files contain no statements + cell.textContent = denom + ? `${(numer * 100 / denom).toFixed(places)}%` + : `${(100).toFixed(places)}%`; + } + else { + cell.textContent = totals[column]; // nosemgrep: eslint.detect-object-injection + } + } + }); + + document.getElementById("filter").addEventListener("input", debounce(filter_handler)); + document.getElementById("hide100").addEventListener("input", debounce(filter_handler)); + + // Trigger change event on setup, to force filter on page refresh + // (filter value may still be present). + document.getElementById("filter").dispatchEvent(new Event("input")); + document.getElementById("hide100").dispatchEvent(new Event("input")); +}; +coverage.FILTER_STORAGE = "COVERAGE_FILTER_VALUE"; +coverage.HIDE100_STORAGE = "COVERAGE_HIDE100_VALUE"; + +// Set up the click-to-sort columns. +coverage.wire_up_sorting = function () { + document.querySelectorAll("[data-sortable] th[aria-sort]").forEach( + th => th.addEventListener("click", e => sortColumn(e.target)) + ); + + // Look for a localStorage item containing previous sort settings: + let th_id = "file", direction = "ascending"; + const stored_list = localStorage.getItem(coverage.INDEX_SORT_STORAGE); + if (stored_list) { + ({th_id, direction} = JSON.parse(stored_list)); + } + let by_region = false, region_direction = "ascending"; + const sorted_by_region = localStorage.getItem(coverage.SORTED_BY_REGION); + if (sorted_by_region) { + ({ + by_region, + region_direction + } = JSON.parse(sorted_by_region)); + } + + const region_id = "region"; + if (by_region && document.getElementById(region_id)) { + direction = region_direction; + } + // If we are in a page that has a column with id of "region", sort on + // it if the last sort was by function or class. + let th; + if (document.getElementById(region_id)) { + th = document.getElementById(by_region ? region_id : th_id); + } + else { + th = document.getElementById(th_id); + } + th.setAttribute("aria-sort", direction === "ascending" ? "descending" : "ascending"); + th.click() +}; + +coverage.INDEX_SORT_STORAGE = "COVERAGE_INDEX_SORT_2"; +coverage.SORTED_BY_REGION = "COVERAGE_SORT_REGION"; + +// Loaded on index.html +coverage.index_ready = function () { + coverage.assign_shortkeys(); + coverage.wire_up_filter(); + coverage.wire_up_sorting(); + + on_click(".button_prev_file", coverage.to_prev_file); + on_click(".button_next_file", coverage.to_next_file); + + on_click(".button_show_hide_help", coverage.show_hide_help); +}; + +// -- pyfile stuff -- + +coverage.LINE_FILTERS_STORAGE = "COVERAGE_LINE_FILTERS"; + +coverage.pyfile_ready = function () { + // If we're directed to a particular line number, highlight the line. + var frag = location.hash; + if (frag.length > 2 && frag[1] === "t") { + document.querySelector(frag).closest(".n").classList.add("highlight"); + coverage.set_sel(parseInt(frag.substr(2), 10)); + } + else { + coverage.set_sel(0); + } + + on_click(".button_toggle_run", coverage.toggle_lines); + on_click(".button_toggle_mis", coverage.toggle_lines); + on_click(".button_toggle_exc", coverage.toggle_lines); + on_click(".button_toggle_par", coverage.toggle_lines); + + on_click(".button_next_chunk", coverage.to_next_chunk_nicely); + on_click(".button_prev_chunk", coverage.to_prev_chunk_nicely); + on_click(".button_top_of_page", coverage.to_top); + on_click(".button_first_chunk", coverage.to_first_chunk); + + on_click(".button_prev_file", coverage.to_prev_file); + on_click(".button_next_file", coverage.to_next_file); + on_click(".button_to_index", coverage.to_index); + + on_click(".button_show_hide_help", coverage.show_hide_help); + + coverage.filters = undefined; + try { + coverage.filters = localStorage.getItem(coverage.LINE_FILTERS_STORAGE); + } catch(err) {} + + if (coverage.filters) { + coverage.filters = JSON.parse(coverage.filters); + } + else { + coverage.filters = {run: false, exc: true, mis: true, par: true}; + } + + for (cls in coverage.filters) { + coverage.set_line_visibilty(cls, coverage.filters[cls]); // nosemgrep: eslint.detect-object-injection + } + + coverage.assign_shortkeys(); + coverage.init_scroll_markers(); + coverage.wire_up_sticky_header(); + + document.querySelectorAll("[id^=ctxs]").forEach( + cbox => cbox.addEventListener("click", coverage.expand_contexts) + ); + + // Rebuild scroll markers when the window height changes. + window.addEventListener("resize", coverage.build_scroll_markers); +}; + +coverage.toggle_lines = function (event) { + const btn = event.target.closest("button"); + const category = btn.value + const show = !btn.classList.contains("show_" + category); + coverage.set_line_visibilty(category, show); + coverage.build_scroll_markers(); + coverage.filters[category] = show; + try { + localStorage.setItem(coverage.LINE_FILTERS_STORAGE, JSON.stringify(coverage.filters)); + } catch(err) {} +}; + +coverage.set_line_visibilty = function (category, should_show) { + const cls = "show_" + category; + const btn = document.querySelector(".button_toggle_" + category); + if (btn) { + if (should_show) { + document.querySelectorAll("#source ." + category).forEach(e => e.classList.add(cls)); + btn.classList.add(cls); + } + else { + document.querySelectorAll("#source ." + category).forEach(e => e.classList.remove(cls)); + btn.classList.remove(cls); + } + } +}; + +// Return the nth line div. +coverage.line_elt = function (n) { + return document.getElementById("t" + n)?.closest("p"); +}; + +// Set the selection. b and e are line numbers. +coverage.set_sel = function (b, e) { + // The first line selected. + coverage.sel_begin = b; + // The next line not selected. + coverage.sel_end = (e === undefined) ? b+1 : e; +}; + +coverage.to_top = function () { + coverage.set_sel(0, 1); + coverage.scroll_window(0); +}; + +coverage.to_first_chunk = function () { + coverage.set_sel(0, 1); + coverage.to_next_chunk(); +}; + +coverage.to_prev_file = function () { + window.location = document.getElementById("prevFileLink").href; +} + +coverage.to_next_file = function () { + window.location = document.getElementById("nextFileLink").href; +} + +coverage.to_index = function () { + location.href = document.getElementById("indexLink").href; +} + +coverage.show_hide_help = function () { + const helpCheck = document.getElementById("help_panel_state") + helpCheck.checked = !helpCheck.checked; +} + +// Return a string indicating what kind of chunk this line belongs to, +// or null if not a chunk. +coverage.chunk_indicator = function (line_elt) { + const classes = line_elt?.className; + if (!classes) { + return null; + } + const match = classes.match(/\bshow_\w+\b/); + if (!match) { + return null; + } + return match[0]; +}; + +coverage.to_next_chunk = function () { + const c = coverage; + + // Find the start of the next colored chunk. + var probe = c.sel_end; + var chunk_indicator, probe_line; + while (true) { + probe_line = c.line_elt(probe); + if (!probe_line) { + return; + } + chunk_indicator = c.chunk_indicator(probe_line); + if (chunk_indicator) { + break; + } + probe++; + } + + // There's a next chunk, `probe` points to it. + var begin = probe; + + // Find the end of this chunk. + var next_indicator = chunk_indicator; + while (next_indicator === chunk_indicator) { + probe++; + probe_line = c.line_elt(probe); + next_indicator = c.chunk_indicator(probe_line); + } + c.set_sel(begin, probe); + c.show_selection(); +}; + +coverage.to_prev_chunk = function () { + const c = coverage; + + // Find the end of the prev colored chunk. + var probe = c.sel_begin-1; + var probe_line = c.line_elt(probe); + if (!probe_line) { + return; + } + var chunk_indicator = c.chunk_indicator(probe_line); + while (probe > 1 && !chunk_indicator) { + probe--; + probe_line = c.line_elt(probe); + if (!probe_line) { + return; + } + chunk_indicator = c.chunk_indicator(probe_line); + } + + // There's a prev chunk, `probe` points to its last line. + var end = probe+1; + + // Find the beginning of this chunk. + var prev_indicator = chunk_indicator; + while (prev_indicator === chunk_indicator) { + probe--; + if (probe <= 0) { + return; + } + probe_line = c.line_elt(probe); + prev_indicator = c.chunk_indicator(probe_line); + } + c.set_sel(probe+1, end); + c.show_selection(); +}; + +// Returns 0, 1, or 2: how many of the two ends of the selection are on +// the screen right now? +coverage.selection_ends_on_screen = function () { + if (coverage.sel_begin === 0) { + return 0; + } + + const begin = coverage.line_elt(coverage.sel_begin); + const end = coverage.line_elt(coverage.sel_end-1); + + return ( + (checkVisible(begin) ? 1 : 0) + + (checkVisible(end) ? 1 : 0) + ); +}; + +coverage.to_next_chunk_nicely = function () { + if (coverage.selection_ends_on_screen() === 0) { + // The selection is entirely off the screen: + // Set the top line on the screen as selection. + + // This will select the top-left of the viewport + // As this is most likely the span with the line number we take the parent + const line = document.elementFromPoint(0, 0).parentElement; + if (line.parentElement !== document.getElementById("source")) { + // The element is not a source line but the header or similar + coverage.select_line_or_chunk(1); + } + else { + // We extract the line number from the id + coverage.select_line_or_chunk(parseInt(line.id.substring(1), 10)); + } + } + coverage.to_next_chunk(); +}; + +coverage.to_prev_chunk_nicely = function () { + if (coverage.selection_ends_on_screen() === 0) { + // The selection is entirely off the screen: + // Set the lowest line on the screen as selection. + + // This will select the bottom-left of the viewport + // As this is most likely the span with the line number we take the parent + const line = document.elementFromPoint(document.documentElement.clientHeight-1, 0).parentElement; + if (line.parentElement !== document.getElementById("source")) { + // The element is not a source line but the header or similar + coverage.select_line_or_chunk(coverage.lines_len); + } + else { + // We extract the line number from the id + coverage.select_line_or_chunk(parseInt(line.id.substring(1), 10)); + } + } + coverage.to_prev_chunk(); +}; + +// Select line number lineno, or if it is in a colored chunk, select the +// entire chunk +coverage.select_line_or_chunk = function (lineno) { + var c = coverage; + var probe_line = c.line_elt(lineno); + if (!probe_line) { + return; + } + var the_indicator = c.chunk_indicator(probe_line); + if (the_indicator) { + // The line is in a highlighted chunk. + // Search backward for the first line. + var probe = lineno; + var indicator = the_indicator; + while (probe > 0 && indicator === the_indicator) { + probe--; + probe_line = c.line_elt(probe); + if (!probe_line) { + break; + } + indicator = c.chunk_indicator(probe_line); + } + var begin = probe + 1; + + // Search forward for the last line. + probe = lineno; + indicator = the_indicator; + while (indicator === the_indicator) { + probe++; + probe_line = c.line_elt(probe); + indicator = c.chunk_indicator(probe_line); + } + + coverage.set_sel(begin, probe); + } + else { + coverage.set_sel(lineno); + } +}; + +coverage.show_selection = function () { + // Highlight the lines in the chunk + document.querySelectorAll("#source .highlight").forEach(e => e.classList.remove("highlight")); + for (let probe = coverage.sel_begin; probe < coverage.sel_end; probe++) { + coverage.line_elt(probe).querySelector(".n").classList.add("highlight"); + } + + coverage.scroll_to_selection(); +}; + +coverage.scroll_to_selection = function () { + // Scroll the page if the chunk isn't fully visible. + if (coverage.selection_ends_on_screen() < 2) { + const element = coverage.line_elt(coverage.sel_begin); + coverage.scroll_window(element.offsetTop - 60); + } +}; + +coverage.scroll_window = function (to_pos) { + window.scroll({top: to_pos, behavior: "smooth"}); +}; + +coverage.init_scroll_markers = function () { + // Init some variables + coverage.lines_len = document.querySelectorAll("#source > p").length; + + // Build html + coverage.build_scroll_markers(); +}; + +coverage.build_scroll_markers = function () { + const temp_scroll_marker = document.getElementById("scroll_marker") + if (temp_scroll_marker) temp_scroll_marker.remove(); + // Don't build markers if the window has no scroll bar. + if (document.body.scrollHeight <= window.innerHeight) { + return; + } + + const marker_scale = window.innerHeight / document.body.scrollHeight; + const line_height = Math.min(Math.max(3, window.innerHeight / coverage.lines_len), 10); + + let previous_line = -99, last_mark, last_top; + + const scroll_marker = document.createElement("div"); + scroll_marker.id = "scroll_marker"; + document.getElementById("source").querySelectorAll( + "p.show_run, p.show_mis, p.show_exc, p.show_exc, p.show_par" + ).forEach(element => { + const line_top = Math.floor(element.offsetTop * marker_scale); + const line_number = parseInt(element.querySelector(".n a").id.substr(1)); + + if (line_number === previous_line + 1) { + // If this solid missed block just make previous mark higher. + last_mark.style.height = `${line_top + line_height - last_top}px`; + } + else { + // Add colored line in scroll_marker block. + last_mark = document.createElement("div"); + last_mark.id = `m${line_number}`; + last_mark.classList.add("marker"); + last_mark.style.height = `${line_height}px`; + last_mark.style.top = `${line_top}px`; + scroll_marker.append(last_mark); + last_top = line_top; + } + + previous_line = line_number; + }); + + // Append last to prevent layout calculation + document.body.append(scroll_marker); +}; + +coverage.wire_up_sticky_header = function () { + const header = document.querySelector("header"); + const header_bottom = ( + header.querySelector(".content h2").getBoundingClientRect().top - + header.getBoundingClientRect().top + ); + + function updateHeader() { + if (window.scrollY > header_bottom) { + header.classList.add("sticky"); + } + else { + header.classList.remove("sticky"); + } + } + + window.addEventListener("scroll", updateHeader); + updateHeader(); +}; + +coverage.expand_contexts = function (e) { + var ctxs = e.target.parentNode.querySelector(".ctxs"); + + if (!ctxs.classList.contains("expanded")) { + var ctxs_text = ctxs.textContent; + var width = Number(ctxs_text[0]); + ctxs.textContent = ""; + for (var i = 1; i < ctxs_text.length; i += width) { + key = ctxs_text.substring(i, i + width).trim(); + ctxs.appendChild(document.createTextNode(contexts[key])); + ctxs.appendChild(document.createElement("br")); + } + ctxs.classList.add("expanded"); + } +}; + +document.addEventListener("DOMContentLoaded", () => { + if (document.body.classList.contains("indexfile")) { + coverage.index_ready(); + } + else { + coverage.pyfile_ready(); + } +}); diff --git a/tests/coverage/favicon_32_cb_58284776.png b/tests/coverage/favicon_32_cb_58284776.png new file mode 100644 index 0000000000000000000000000000000000000000..8649f0475d8d20793b2ec431fe25a186a414cf10 GIT binary patch literal 1732 zcmV;#20QtQP)K2KOkBOVxIZChq#W-v7@TU%U6P(wycKT1hUJUToW3ke1U1ONa4 z000000000000000bb)GRa9mqwR9|UWHy;^RUrt?IT__Y0J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-6ka1SJgGAS-Us5EN)r#dUX%>wQZLa2ytPCtMKp)Ob z*xcu38Z&d5<-NBS)@jRD+*!W*cf-m_wmxDEqBf?czI%3U0J$Xik;lA`jg}VH?(S(V zE!M3;X2B8w0TnnW&6(8;_Uc)WD;Ms6PKP+s(sFgO!}B!^ES~GDt4qLPxwYB)^7)XA zZwo9zDy-B0B+jT6V=!=bo(zs_8{eBA78gT9GH$(DVhz;4VAYwz+bOIdZ-PNb|I&rl z^XG=vFLF)1{&nT2*0vMz#}7^9hXzzf&ZdKlEj{LihP;|;Ywqn35ajP?H?7t|i-Un% z&&kxee@9B{nwgv1+S-~0)E1{ob1^Wn`F2isurqThKK=3%&;`@{0{!D- z&CSj80t;uPu&FaJFtSXKH#ajgGj}=sEad7US6jP0|Db@0j)?(5@sf<7`~a9>s;wCa zm^)spe{uxGFmrJYI9cOh7s$>8Npkt-5EWB1UKc`{W{y5Ce$1+nM9Cr;);=Ju#N^62OSlJMn7omiUgP&ErsYzT~iGxcW aE(`!K@+CXylaC4j0000 + + + + Coverage report + + + + + +
+
+

Coverage report: + 93% +

+ +
+ +
+ + +
+
+

+ Files + Functions + Classes +

+

+ coverage.py v7.6.1, + created at 2024-08-13 23:09 +0000 +

+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Filefunctionstatementsmissingexcludedbranchespartialcoverage
benefits/__init__.py(no function)6200067%
benefits/core/__init__.py(no function)00000100%
benefits/core/admin.pyClaimsProviderAdmin.get_exclude00400100%
benefits/core/admin.pyClaimsProviderAdmin.get_readonly_fields00900100%
benefits/core/admin.pyEligibilityTypeAdmin.get_exclude00400100%
benefits/core/admin.pyEligibilityTypeAdmin.get_readonly_fields00800100%
benefits/core/admin.pySortableEnrollmentFlowAdmin.get_exclude001200100%
benefits/core/admin.pySortableEnrollmentFlowAdmin.get_readonly_fields001200100%
benefits/core/admin.pyTransitProcessorAdmin.get_exclude00400100%
benefits/core/admin.pyTransitProcessorAdmin.get_readonly_fields00800100%
benefits/core/admin.pyTransitAgencyAdmin.get_exclude001100100%
benefits/core/admin.pyTransitAgencyAdmin.get_readonly_fields00900100%
benefits/core/admin.pypre_login_user30000100%
benefits/core/admin.pyadd_google_sso_userinfo120020100%
benefits/core/admin.pyadd_staff_user_to_group30020100%
benefits/core/admin.py(no function)1502500100%
benefits/core/analytics.pyEvent.__init__240000100%
benefits/core/analytics.pyEvent.__str__10000100%
benefits/core/analytics.pyEvent.update_event_properties10000100%
benefits/core/analytics.pyEvent.update_user_properties10000100%
benefits/core/analytics.pyViewedPageEvent.__init__80000100%
benefits/core/analytics.pyChangedLanguageEvent.__init__20000100%
benefits/core/analytics.pyClient.__init__40000100%
benefits/core/analytics.pyClient._payload330400%
benefits/core/analytics.pyClient.send2016012219%
benefits/core/analytics.pysend_event3102160%
benefits/core/analytics.py(no function)290000100%
benefits/core/apps.py(no function)50000100%
benefits/core/context_processors.pyunique_values10000100%
benefits/core/context_processors.py_agency_context10020100%
benefits/core/context_processors.pyagency40020100%
benefits/core/context_processors.pyactive_agencies20020100%
benefits/core/context_processors.pyanalytics10000100%
benefits/core/context_processors.pyauthentication80040100%
benefits/core/context_processors.pydebug110000%
benefits/core/context_processors.pyenrollment50000100%
benefits/core/context_processors.pyorigin4102167%
benefits/core/context_processors.py(no function)110000100%
benefits/core/middleware.pyuser_error10000100%
benefits/core/middleware.pyAgencySessionRequired.process_request50020100%
benefits/core/middleware.pyEligibleSessionRequired.process_request50020100%
benefits/core/middleware.pyDebugSession.process_request220000%
benefits/core/middleware.pyHealthcheck.__init__10000100%
benefits/core/middleware.pyHealthcheck.__call__30020100%
benefits/core/middleware.pyHealthcheckUserAgents.process_request5004189%
benefits/core/middleware.pyFlowSessionRequired.process_request50020100%
benefits/core/middleware.pyViewedPageEvent.process_response60000100%
benefits/core/middleware.pyChangedLanguageEvent.process_view70040100%
benefits/core/middleware.pyLoginRequired.process_view40020100%
benefits/core/middleware.pyRecaptchaEnabled.process_request3102160%
benefits/core/middleware.pyIndexOrAgencyIndexOrigin.process_request40020100%
benefits/core/middleware.py(no function)400000100%
benefits/core/models.pySecretNameField.__init__40000100%
benefits/core/models.pyPemData.__str__10000100%
benefits/core/models.pyPemData.data10204086%
benefits/core/models.pyClaimsProvider.supports_sign_out10000100%
benefits/core/models.pyClaimsProvider.client_id10000100%
benefits/core/models.pyClaimsProvider.__str__10000100%
benefits/core/models.pyEligibilityType.__str__10000100%
benefits/core/models.pyEligibilityType.get20000100%
benefits/core/models.pyEligibilityType.get_many20000100%
benefits/core/models.pyEligibilityType.get_names30040100%
benefits/core/models.pyEligibilityType.clean1500100100%
benefits/core/models.pyEnrollmentFlow.__str__10000100%
benefits/core/models.pyEnrollmentFlow.eligibility_api_auth_key3102160%
benefits/core/models.pyEnrollmentFlow.eligibility_api_public_key_data10000100%
benefits/core/models.pyEnrollmentFlow.uses_claims_verification10000100%
benefits/core/models.pyEnrollmentFlow.eligibility_form_instance50020100%
benefits/core/models.pyEnrollmentFlow.by_id20000100%
benefits/core/models.pyEnrollmentFlow.claims_scheme30020100%
benefits/core/models.pyTransitProcessor.__str__10000100%
benefits/core/models.pyTransitAgency.__str__10000100%
benefits/core/models.pyTransitAgency.get_type_id40020100%
benefits/core/models.pyTransitAgency.supports_type10000100%
benefits/core/models.pyTransitAgency.types_to_verify40000100%
benefits/core/models.pyTransitAgency.type_names_to_verify10000100%
benefits/core/models.pyTransitAgency.index_url10000100%
benefits/core/models.pyTransitAgency.eligibility_index_url10000100%
benefits/core/models.pyTransitAgency.eligibility_api_public_key_url10000100%
benefits/core/models.pyTransitAgency.eligibility_api_private_key_data10000100%
benefits/core/models.pyTransitAgency.eligibility_api_public_key_data10000100%
benefits/core/models.pyTransitAgency.transit_processor_client_secret10000100%
benefits/core/models.pyTransitAgency.by_id20000100%
benefits/core/models.pyTransitAgency.by_slug20000100%
benefits/core/models.pyTransitAgency.all_active20000100%
benefits/core/models.py(no function)13900400100%
benefits/core/recaptcha.pyhas_error10020100%
benefits/core/recaptcha.pyverify7504127%
benefits/core/recaptcha.py(no function)50000100%
benefits/core/session.pyagency40000100%
benefits/core/session.pyactive_agency20000100%
benefits/core/session.pycontext_dict110000%
benefits/core/session.pydebug10000100%
benefits/core/session.pydid50020100%
benefits/core/session.pyeligibility40020100%
benefits/core/session.pyeligible10000100%
benefits/core/session.pyenrollment_expiry40020100%
benefits/core/session.pyenrollment_reenrollment50020100%
benefits/core/session.pyenrollment_token10000100%
benefits/core/session.pyenrollment_token_expiry10000100%
benefits/core/session.pyenrollment_token_valid50020100%
benefits/core/session.pylanguage10000100%
benefits/core/session.pylogged_in10000100%
benefits/core/session.pylogout10000100%
benefits/core/session.pyoauth_token10000100%
benefits/core/session.pyoauth_claim10000100%
benefits/core/session.pyorigin10000100%
benefits/core/session.pyreset160020100%
benefits/core/session.pystart50020100%
benefits/core/session.pyuid50020100%
benefits/core/session.pyupdate2700240100%
benefits/core/session.pyflow40000100%
benefits/core/session.py(no function)450000100%
benefits/core/urls.pyTransitAgencyPathConverter.to_python80020100%
benefits/core/urls.pyTransitAgencyPathConverter.to_url40000100%
benefits/core/urls.py(no function)120000100%
benefits/core/views.pyindex20000100%
benefits/core/views.pyagency_index30000100%
benefits/core/views.pyagency_public_key10000100%
benefits/core/views.pyhelp10000100%
benefits/core/views.pybad_request20000100%
benefits/core/views.pycsrf_failure20000100%
benefits/core/views.pypage_not_found20000100%
benefits/core/views.pyserver_error20000100%
benefits/core/views.pylogged_out10000100%
benefits/core/views.py(no function)3700320100%
benefits/core/widgets.pyFormControlTextInput.__init__6104270%
benefits/core/widgets.pyFlowRadioSelect.__init__20000100%
benefits/core/widgets.pyFlowRadioSelect.__deepcopy__30000100%
benefits/core/widgets.pyFlowRadioSelect.create_option4002183%
benefits/core/widgets.py(no function)100000100%
benefits/eligibility/__init__.py(no function)00000100%
benefits/eligibility/analytics.pyEligibilityEvent.__init__30000100%
benefits/eligibility/analytics.pySelectedVerifierEvent.__init__110000%
benefits/eligibility/analytics.pyStartedEligibilityEvent.__init__10000100%
benefits/eligibility/analytics.pyReturnedEligibilityEvent.__init__6004280%
benefits/eligibility/analytics.pyselected_verifier110000%
benefits/eligibility/analytics.pystarted_eligibility10000100%
benefits/eligibility/analytics.pyreturned_error110000%
benefits/eligibility/analytics.pyreturned_fail110000%
benefits/eligibility/analytics.pyreturned_success10000100%
benefits/eligibility/analytics.py(no function)140000100%
benefits/eligibility/apps.py(no function)50000100%
benefits/eligibility/forms.pyEnrollmentFlowSelectionForm.__init__80040100%
benefits/eligibility/forms.pyEnrollmentFlowSelectionForm.clean2102150%
benefits/eligibility/forms.pyEligibilityVerificationForm.__init__2300120100%
benefits/eligibility/forms.pyEligibilityVerificationForm.clean2102150%
benefits/eligibility/forms.pyCSTAgencyCard.__init__10000100%
benefits/eligibility/forms.pyMSTCourtesyCard.__init__10000100%
benefits/eligibility/forms.pySBMTDMobilityPass.__init__10000100%
benefits/eligibility/forms.py(no function)270000100%
benefits/eligibility/urls.py(no function)40000100%
benefits/eligibility/verify.pyeligibility_from_api80040100%
benefits/eligibility/verify.pyeligibility_from_oauth30020100%
benefits/eligibility/verify.py(no function)50000100%
benefits/eligibility/views.pyindex242010288%
benefits/eligibility/views.pystart30000100%
benefits/eligibility/views.pyconfirm340018198%
benefits/eligibility/views.pyverified30000100%
benefits/eligibility/views.pyunverified50000100%
benefits/eligibility/views.py(no function)3300300100%
benefits/enrollment/__init__.py(no function)00000100%
benefits/enrollment/analytics.pyReturnedEnrollmentEvent.__init__5104267%
benefits/enrollment/analytics.pyFailedAccessTokenRequestEvent.__init__3002180%
benefits/enrollment/analytics.pyreturned_error10000100%
benefits/enrollment/analytics.pyreturned_retry110000%
benefits/enrollment/analytics.pyreturned_success110000%
benefits/enrollment/analytics.pyfailed_access_token_request110000%
benefits/enrollment/analytics.py(no function)90000100%
benefits/enrollment/apps.py(no function)50000100%
benefits/enrollment/forms.pyCardTokenizeFailForm.__init__30000100%
benefits/enrollment/forms.py(no function)90000100%
benefits/enrollment/urls.py(no function)40000100%
benefits/enrollment/views.pytoken220060100%
benefits/enrollment/views.pyindex5500220100%
benefits/enrollment/views.py_get_group_funding_source7004191%
benefits/enrollment/views.py_is_expired10000100%
benefits/enrollment/views.py_is_within_reenrollment_window10000100%
benefits/enrollment/views.py_calculate_expiry40000100%
benefits/enrollment/views.pyreenrollment_error8104183%
benefits/enrollment/views.pyretry20000100%
benefits/enrollment/views.pysystem_error30000100%
benefits/enrollment/views.pysuccess90020100%
benefits/enrollment/views.py(no function)4100180100%
benefits/in_person/__init__.py(no function)00000100%
benefits/in_person/apps.py(no function)40000100%
benefits/in_person/urls.py(no function)50000100%
benefits/in_person/views.pyeligibility10000100%
benefits/in_person/views.pyenrollment10000100%
benefits/in_person/views.py(no function)50000100%
benefits/locale/__init__.py(no function)00000100%
benefits/locale/en/__init__.py(no function)00000100%
benefits/locale/en/formats.py(no function)10000100%
benefits/locale/es/__init__.py(no function)00000100%
benefits/locale/es/formats.py(no function)10000100%
benefits/oauth/__init__.py(no function)00000100%
benefits/oauth/analytics.pyOAuthEvent.__init__40020100%
benefits/oauth/analytics.pyOAuthErrorEvent.__init__20000100%
benefits/oauth/analytics.pyStartedSignInEvent.__init__110000%
benefits/oauth/analytics.pyCanceledSignInEvent.__init__110000%
benefits/oauth/analytics.pyFinishedSignInEvent.__init__30020100%
benefits/oauth/analytics.pyStartedSignOutEvent.__init__110000%
benefits/oauth/analytics.pyFinishedSignOutEvent.__init__220000%
benefits/oauth/analytics.pyerror10000100%
benefits/oauth/analytics.pystarted_sign_in110000%
benefits/oauth/analytics.pycanceled_sign_in110000%
benefits/oauth/analytics.pyfinished_sign_in110000%
benefits/oauth/analytics.pystarted_sign_out110000%
benefits/oauth/analytics.pyfinished_sign_out110000%
benefits/oauth/analytics.py(no function)210000100%
benefits/oauth/apps.py(no function)50000100%
benefits/oauth/client.py_client_kwargs20000100%
benefits/oauth/client.py_server_metadata_url10000100%
benefits/oauth/client.py_authorize_params40020100%
benefits/oauth/client.py_register_provider30000100%
benefits/oauth/client.pycreate_client40020100%
benefits/oauth/client.py(no function)100000100%
benefits/oauth/middleware.pyFlowUsesClaimsVerificationSessionRequired.process_request130060100%
benefits/oauth/middleware.py(no function)100000100%
benefits/oauth/redirects.pydeauthorize_redirect110000100%
benefits/oauth/redirects.pygenerate_redirect_uri40020100%
benefits/oauth/redirects.py(no function)70000100%
benefits/oauth/urls.py(no function)40000100%
benefits/oauth/views.py_oauth_client_or_error_redirect130040100%
benefits/oauth/views.pylogin240080100%
benefits/oauth/views.pyauthorize380016198%
benefits/oauth/views.pycancel20000100%
benefits/oauth/views.pylogout12102186%
benefits/oauth/views.pypost_logout30000100%
benefits/oauth/views.pysystem_error30000100%
benefits/oauth/views.py(no function)3000120100%
benefits/secrets.pySecretNameValidator.__init__30000100%
benefits/secrets.pyget_secret_by_name210060100%
benefits/secrets.py(no function)24804161%
benefits/sentry.pygit_available110000%
benefits/sentry.pyis_git_directory220200%
benefits/sentry.pyget_git_revision_hash110000%
benefits/sentry.pyget_sha_file_path220000%
benefits/sentry.pyget_sha_from_file50040100%
benefits/sentry.pyget_release60040100%
benefits/sentry.pyget_denylist220000%
benefits/sentry.pyget_traces_sample_rate100020100%
benefits/sentry.pyconfigure8402150%
benefits/sentry.py(no function)200000100%
benefits/settings.py_filter_empty10020100%
benefits/settings.pyRUNTIME_ENVIRONMENT80060100%
benefits/settings.py(no function)1106016889%
benefits/urls.pytrigger_error110000%
benefits/urls.pytest_secret220000%
benefits/urls.py(no function)19402176%
benefits/wsgi.py(no function)440000%
Total 1675981064663693%
+

+ No items found using the specified filter. +

+
+ + + diff --git a/tests/coverage/index.html b/tests/coverage/index.html new file mode 100644 index 000000000..23e9fdfea --- /dev/null +++ b/tests/coverage/index.html @@ -0,0 +1,542 @@ + + + + + Coverage report + + + + + +
+
+

Coverage report: + 93% +

+ +
+ +
+ + +
+
+

+ Files + Functions + Classes +

+

+ coverage.py v7.6.1, + created at 2024-08-13 23:09 +0000 +

+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Filestatementsmissingexcludedbranchespartialcoverage
benefits/__init__.py6200067%
benefits/core/__init__.py00000100%
benefits/core/admin.py33010640100%
benefits/core/analytics.py9620018369%
benefits/core/apps.py50000100%
benefits/core/context_processors.py382012194%
benefits/core/middleware.py913022296%
benefits/core/models.py2203066199%
benefits/core/recaptcha.py13506158%
benefits/core/session.py1421040099%
benefits/core/urls.py240020100%
benefits/core/views.py5300320100%
benefits/core/widgets.py25106387%
benefits/eligibility/__init__.py00000100%
benefits/eligibility/analytics.py30404282%
benefits/eligibility/apps.py50000100%
benefits/eligibility/forms.py652020295%
benefits/eligibility/urls.py40000100%
benefits/eligibility/verify.py160060100%
benefits/eligibility/views.py1022058397%
benefits/enrollment/__init__.py00000100%
benefits/enrollment/analytics.py21406374%
benefits/enrollment/apps.py50000100%
benefits/enrollment/forms.py120000100%
benefits/enrollment/urls.py40000100%
benefits/enrollment/views.py1531056299%
benefits/in_person/__init__.py00000100%
benefits/in_person/apps.py40000100%
benefits/in_person/urls.py50000100%
benefits/in_person/views.py70000100%
benefits/locale/__init__.py00000100%
benefits/locale/en/__init__.py00000100%
benefits/locale/en/formats.py10000100%
benefits/locale/es/__init__.py00000100%
benefits/locale/es/formats.py10000100%
benefits/oauth/__init__.py00000100%
benefits/oauth/analytics.py411004078%
benefits/oauth/apps.py50000100%
benefits/oauth/client.py240040100%
benefits/oauth/middleware.py230060100%
benefits/oauth/redirects.py220020100%
benefits/oauth/urls.py40000100%
benefits/oauth/views.py1251042298%
benefits/secrets.py488010181%
benefits/sentry.py5712014179%
benefits/settings.py1196024890%
benefits/urls.py22702167%
benefits/wsgi.py440000%
Total1675981064663693%
+

+ No items found using the specified filter. +

+
+ + + diff --git a/tests/coverage/keybd_closed_cb_ce680311.png b/tests/coverage/keybd_closed_cb_ce680311.png new file mode 100644 index 0000000000000000000000000000000000000000..ba119c47df81ed2bbd27a06988abf700139c4f99 GIT binary patch literal 9004 zcmeHLc{tSF+aIY=A^R4_poB4tZAN2XC;O7M(inrW3}(h&Q4}dl*&-65$i9^&vW6_# zcM4g`Qix=GhkBl;=lwnJ@Ap2}^}hc-b6vBXb3XUyzR%~}_c`-Dw+!?&>5p(90RRB> zXe~7($~PP3eT?=X<@3~Q1w84vX~IoSx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z%X7`2YaG_y|wA!7|s?k;A&WNMLMTZEzCaE^d??E&u?f=ejQBR~|< z)=thyP2(p8r6mt?Ad}tXAP_GvF9|P630I;$1cpQ+Ay7C34hK^ZV3H4kjPV8&NP>G5 zKRDEIBrFl{M#j4mfP0)68&?mqJP1S?2mU0djAGTjDV;wZ?6vplNn~3Hn$nP>%!dMi zz@bnC7zzi&k&s{QDWkf&zgrVXKUJjY3Gv3bL0}S4h>OdgEJ$Q^&p-VAr3J}^a*+rz z!jW7(h*+GuCyqcC{MD(Ovj^!{pB^OKUe|uy&bD?CN>KZrf3?v>>l*xSvnQiH-o^ViN$%FRdm9url;%(*jf5H$*S)8;i0xWHdl>$p);nH9v0)YfW?Vz$! zNCeUbi9`NEg(i^57y=fzM@1o*z*Bf6?QCV>2p9}(BLlYsOCfMjFv1pw1mlo)Py{8v zppw{MDfEeWN+n>Ne~oI7%9cU}mz0r3!es2gNF0t5jkGipjIo2lz;-e)7}Ul_#!eDv zw;#>kI>;#-pyfeu3Fsd^2F@6=oh#8r9;A!G0`-mm7%{=S;Ec(bJ=I_`FodKGQVNEY zmXwr4{9*jpDl%4{ggQZ5Ac z%wYTdl*!1c5^)%^E78Q&)ma|27c6j(a=)g4sGrp$r{jv>>M2 z6y)E5|Aooe!PSfKzvKA>`a6pfK3=E8vL14ksP&f=>gOP?}rG6ye@9ZR3 zJF*vsh*P$w390i!FV~~_Hv6t2Zl<4VUi|rNja#boFt{%q~xGb z(2petq9A*_>~B*>?d?Olx^lmYg4)}sH2>G42RE; literal 0 HcmV?d00001 diff --git a/tests/coverage/status.json b/tests/coverage/status.json new file mode 100644 index 000000000..0f481b47c --- /dev/null +++ b/tests/coverage/status.json @@ -0,0 +1 @@ +{"note":"This file is an internal implementation detail to speed up HTML report generation. Its format can change at any time. You might be looking for the JSON report: https://coverage.rtfd.io/cmd.html#cmd-json","format":5,"version":"7.6.1","globals":"ffb579a4832bbb3cf1e03201b5515b94","files":{"z_795c8c28b74e7b9e___init___py":{"hash":"8ea99b54df572e1d85ad0f8072e218a9","index":{"url":"z_795c8c28b74e7b9e___init___py.html","file":"benefits/__init__.py","description":"","nums":{"precision":0,"n_files":1,"n_statements":6,"n_excluded":0,"n_missing":2,"n_branches":0,"n_partial_branches":0,"n_missing_branches":0}}},"z_8c0b35f1ea7ee6af___init___py":{"hash":"ca2411bb2d5283cba14da3ce60f5feec","index":{"url":"z_8c0b35f1ea7ee6af___init___py.html","file":"benefits/core/__init__.py","description":"","nums":{"precision":0,"n_files":1,"n_statements":0,"n_excluded":0,"n_missing":0,"n_branches":0,"n_partial_branches":0,"n_missing_branches":0}}},"z_8c0b35f1ea7ee6af_admin_py":{"hash":"85e3e1a09bd6373f6f8b9397ef3ac367","index":{"url":"z_8c0b35f1ea7ee6af_admin_py.html","file":"benefits/core/admin.py","description":"","nums":{"precision":0,"n_files":1,"n_statements":33,"n_excluded":106,"n_missing":0,"n_branches":4,"n_partial_branches":0,"n_missing_branches":0}}},"z_8c0b35f1ea7ee6af_analytics_py":{"hash":"689cafc344e4ac4391d081ff6e260325","index":{"url":"z_8c0b35f1ea7ee6af_analytics_py.html","file":"benefits/core/analytics.py","description":"","nums":{"precision":0,"n_files":1,"n_statements":96,"n_excluded":0,"n_missing":20,"n_branches":18,"n_partial_branches":3,"n_missing_branches":15}}},"z_8c0b35f1ea7ee6af_apps_py":{"hash":"111cf54e0e9a0d39adb3053888c96855","index":{"url":"z_8c0b35f1ea7ee6af_apps_py.html","file":"benefits/core/apps.py","description":"","nums":{"precision":0,"n_files":1,"n_statements":5,"n_excluded":0,"n_missing":0,"n_branches":0,"n_partial_branches":0,"n_missing_branches":0}}},"z_8c0b35f1ea7ee6af_context_processors_py":{"hash":"f5409308437ba5f8dbe5a033a1dbc1cd","index":{"url":"z_8c0b35f1ea7ee6af_context_processors_py.html","file":"benefits/core/context_processors.py","description":"","nums":{"precision":0,"n_files":1,"n_statements":38,"n_excluded":0,"n_missing":2,"n_branches":12,"n_partial_branches":1,"n_missing_branches":1}}},"z_8c0b35f1ea7ee6af_middleware_py":{"hash":"ef7fad6782183cf3274a4f05df4386ef","index":{"url":"z_8c0b35f1ea7ee6af_middleware_py.html","file":"benefits/core/middleware.py","description":"","nums":{"precision":0,"n_files":1,"n_statements":91,"n_excluded":0,"n_missing":3,"n_branches":22,"n_partial_branches":2,"n_missing_branches":2}}},"z_8c0b35f1ea7ee6af_models_py":{"hash":"198d794fa4872b64a06a7d6780c84d23","index":{"url":"z_8c0b35f1ea7ee6af_models_py.html","file":"benefits/core/models.py","description":"","nums":{"precision":0,"n_files":1,"n_statements":220,"n_excluded":0,"n_missing":3,"n_branches":66,"n_partial_branches":1,"n_missing_branches":1}}},"z_8c0b35f1ea7ee6af_recaptcha_py":{"hash":"cb0a6590387c3115b2eab487c3ab03c1","index":{"url":"z_8c0b35f1ea7ee6af_recaptcha_py.html","file":"benefits/core/recaptcha.py","description":"","nums":{"precision":0,"n_files":1,"n_statements":13,"n_excluded":0,"n_missing":5,"n_branches":6,"n_partial_branches":1,"n_missing_branches":3}}},"z_8c0b35f1ea7ee6af_session_py":{"hash":"9c19dd8f5764830b83dfb03a1bf93d7f","index":{"url":"z_8c0b35f1ea7ee6af_session_py.html","file":"benefits/core/session.py","description":"","nums":{"precision":0,"n_files":1,"n_statements":142,"n_excluded":0,"n_missing":1,"n_branches":40,"n_partial_branches":0,"n_missing_branches":0}}},"z_8c0b35f1ea7ee6af_urls_py":{"hash":"45556782f2029356e91839a9063bb94c","index":{"url":"z_8c0b35f1ea7ee6af_urls_py.html","file":"benefits/core/urls.py","description":"","nums":{"precision":0,"n_files":1,"n_statements":24,"n_excluded":0,"n_missing":0,"n_branches":2,"n_partial_branches":0,"n_missing_branches":0}}},"z_8c0b35f1ea7ee6af_views_py":{"hash":"8a4d9375c4ed0dc5b0d8f931442998b3","index":{"url":"z_8c0b35f1ea7ee6af_views_py.html","file":"benefits/core/views.py","description":"","nums":{"precision":0,"n_files":1,"n_statements":53,"n_excluded":0,"n_missing":0,"n_branches":32,"n_partial_branches":0,"n_missing_branches":0}}},"z_8c0b35f1ea7ee6af_widgets_py":{"hash":"2c42e2b8be09a28fa62d69b35b16d57d","index":{"url":"z_8c0b35f1ea7ee6af_widgets_py.html","file":"benefits/core/widgets.py","description":"","nums":{"precision":0,"n_files":1,"n_statements":25,"n_excluded":0,"n_missing":1,"n_branches":6,"n_partial_branches":3,"n_missing_branches":3}}},"z_d1111b74f8c04d3c___init___py":{"hash":"ca2411bb2d5283cba14da3ce60f5feec","index":{"url":"z_d1111b74f8c04d3c___init___py.html","file":"benefits/eligibility/__init__.py","description":"","nums":{"precision":0,"n_files":1,"n_statements":0,"n_excluded":0,"n_missing":0,"n_branches":0,"n_partial_branches":0,"n_missing_branches":0}}},"z_d1111b74f8c04d3c_analytics_py":{"hash":"6541eb45b260e2ef4582225ad9b7e27a","index":{"url":"z_d1111b74f8c04d3c_analytics_py.html","file":"benefits/eligibility/analytics.py","description":"","nums":{"precision":0,"n_files":1,"n_statements":30,"n_excluded":0,"n_missing":4,"n_branches":4,"n_partial_branches":2,"n_missing_branches":2}}},"z_d1111b74f8c04d3c_apps_py":{"hash":"c75b85808c19f55ca2a7aae7b736fd75","index":{"url":"z_d1111b74f8c04d3c_apps_py.html","file":"benefits/eligibility/apps.py","description":"","nums":{"precision":0,"n_files":1,"n_statements":5,"n_excluded":0,"n_missing":0,"n_branches":0,"n_partial_branches":0,"n_missing_branches":0}}},"z_d1111b74f8c04d3c_forms_py":{"hash":"c87e1c054179cf4818913a9d711df8cc","index":{"url":"z_d1111b74f8c04d3c_forms_py.html","file":"benefits/eligibility/forms.py","description":"","nums":{"precision":0,"n_files":1,"n_statements":65,"n_excluded":0,"n_missing":2,"n_branches":20,"n_partial_branches":2,"n_missing_branches":2}}},"z_d1111b74f8c04d3c_urls_py":{"hash":"d1fd70212fdd0ff0ed480f53f62db126","index":{"url":"z_d1111b74f8c04d3c_urls_py.html","file":"benefits/eligibility/urls.py","description":"","nums":{"precision":0,"n_files":1,"n_statements":4,"n_excluded":0,"n_missing":0,"n_branches":0,"n_partial_branches":0,"n_missing_branches":0}}},"z_d1111b74f8c04d3c_verify_py":{"hash":"96da23e66bde129909f011c8651d4aac","index":{"url":"z_d1111b74f8c04d3c_verify_py.html","file":"benefits/eligibility/verify.py","description":"","nums":{"precision":0,"n_files":1,"n_statements":16,"n_excluded":0,"n_missing":0,"n_branches":6,"n_partial_branches":0,"n_missing_branches":0}}},"z_d1111b74f8c04d3c_views_py":{"hash":"36a663980961feec83e0b6796a7d43fd","index":{"url":"z_d1111b74f8c04d3c_views_py.html","file":"benefits/eligibility/views.py","description":"","nums":{"precision":0,"n_files":1,"n_statements":102,"n_excluded":0,"n_missing":2,"n_branches":58,"n_partial_branches":3,"n_missing_branches":3}}},"z_5351a2d360ecd143___init___py":{"hash":"ca2411bb2d5283cba14da3ce60f5feec","index":{"url":"z_5351a2d360ecd143___init___py.html","file":"benefits/enrollment/__init__.py","description":"","nums":{"precision":0,"n_files":1,"n_statements":0,"n_excluded":0,"n_missing":0,"n_branches":0,"n_partial_branches":0,"n_missing_branches":0}}},"z_5351a2d360ecd143_analytics_py":{"hash":"7dd8cba5593b42666b82084064547138","index":{"url":"z_5351a2d360ecd143_analytics_py.html","file":"benefits/enrollment/analytics.py","description":"","nums":{"precision":0,"n_files":1,"n_statements":21,"n_excluded":0,"n_missing":4,"n_branches":6,"n_partial_branches":3,"n_missing_branches":3}}},"z_5351a2d360ecd143_apps_py":{"hash":"17ac8fff1a331df72326e20181816ea5","index":{"url":"z_5351a2d360ecd143_apps_py.html","file":"benefits/enrollment/apps.py","description":"","nums":{"precision":0,"n_files":1,"n_statements":5,"n_excluded":0,"n_missing":0,"n_branches":0,"n_partial_branches":0,"n_missing_branches":0}}},"z_5351a2d360ecd143_forms_py":{"hash":"524d6fdf9658b84f6dd670d415041395","index":{"url":"z_5351a2d360ecd143_forms_py.html","file":"benefits/enrollment/forms.py","description":"","nums":{"precision":0,"n_files":1,"n_statements":12,"n_excluded":0,"n_missing":0,"n_branches":0,"n_partial_branches":0,"n_missing_branches":0}}},"z_5351a2d360ecd143_urls_py":{"hash":"4fe61c3a4961d2dec6c0ed27ea0b1614","index":{"url":"z_5351a2d360ecd143_urls_py.html","file":"benefits/enrollment/urls.py","description":"","nums":{"precision":0,"n_files":1,"n_statements":4,"n_excluded":0,"n_missing":0,"n_branches":0,"n_partial_branches":0,"n_missing_branches":0}}},"z_5351a2d360ecd143_views_py":{"hash":"e81253b97370d7a132722da06fcd56d5","index":{"url":"z_5351a2d360ecd143_views_py.html","file":"benefits/enrollment/views.py","description":"","nums":{"precision":0,"n_files":1,"n_statements":153,"n_excluded":0,"n_missing":1,"n_branches":56,"n_partial_branches":2,"n_missing_branches":2}}},"z_7432a6a7a8e99cb0___init___py":{"hash":"ca2411bb2d5283cba14da3ce60f5feec","index":{"url":"z_7432a6a7a8e99cb0___init___py.html","file":"benefits/in_person/__init__.py","description":"","nums":{"precision":0,"n_files":1,"n_statements":0,"n_excluded":0,"n_missing":0,"n_branches":0,"n_partial_branches":0,"n_missing_branches":0}}},"z_7432a6a7a8e99cb0_apps_py":{"hash":"e0e7cbd276b2c069a1675a5126ee5627","index":{"url":"z_7432a6a7a8e99cb0_apps_py.html","file":"benefits/in_person/apps.py","description":"","nums":{"precision":0,"n_files":1,"n_statements":4,"n_excluded":0,"n_missing":0,"n_branches":0,"n_partial_branches":0,"n_missing_branches":0}}},"z_7432a6a7a8e99cb0_urls_py":{"hash":"bab17901bcf2ea7a70f2f54beebc1ec5","index":{"url":"z_7432a6a7a8e99cb0_urls_py.html","file":"benefits/in_person/urls.py","description":"","nums":{"precision":0,"n_files":1,"n_statements":5,"n_excluded":0,"n_missing":0,"n_branches":0,"n_partial_branches":0,"n_missing_branches":0}}},"z_7432a6a7a8e99cb0_views_py":{"hash":"8c648c01b2df3bac50ba54d5c747fdd9","index":{"url":"z_7432a6a7a8e99cb0_views_py.html","file":"benefits/in_person/views.py","description":"","nums":{"precision":0,"n_files":1,"n_statements":7,"n_excluded":0,"n_missing":0,"n_branches":0,"n_partial_branches":0,"n_missing_branches":0}}},"z_ed7c491f4d53135c___init___py":{"hash":"ca2411bb2d5283cba14da3ce60f5feec","index":{"url":"z_ed7c491f4d53135c___init___py.html","file":"benefits/locale/__init__.py","description":"","nums":{"precision":0,"n_files":1,"n_statements":0,"n_excluded":0,"n_missing":0,"n_branches":0,"n_partial_branches":0,"n_missing_branches":0}}},"z_9a5e1802ee124b46___init___py":{"hash":"ca2411bb2d5283cba14da3ce60f5feec","index":{"url":"z_9a5e1802ee124b46___init___py.html","file":"benefits/locale/en/__init__.py","description":"","nums":{"precision":0,"n_files":1,"n_statements":0,"n_excluded":0,"n_missing":0,"n_branches":0,"n_partial_branches":0,"n_missing_branches":0}}},"z_9a5e1802ee124b46_formats_py":{"hash":"c9fa54263d6abfbdd38b0730c5bc50be","index":{"url":"z_9a5e1802ee124b46_formats_py.html","file":"benefits/locale/en/formats.py","description":"","nums":{"precision":0,"n_files":1,"n_statements":1,"n_excluded":0,"n_missing":0,"n_branches":0,"n_partial_branches":0,"n_missing_branches":0}}},"z_de34693c7b899b5e___init___py":{"hash":"ca2411bb2d5283cba14da3ce60f5feec","index":{"url":"z_de34693c7b899b5e___init___py.html","file":"benefits/locale/es/__init__.py","description":"","nums":{"precision":0,"n_files":1,"n_statements":0,"n_excluded":0,"n_missing":0,"n_branches":0,"n_partial_branches":0,"n_missing_branches":0}}},"z_de34693c7b899b5e_formats_py":{"hash":"4b1168db91b8428e231359be0d7e6f5f","index":{"url":"z_de34693c7b899b5e_formats_py.html","file":"benefits/locale/es/formats.py","description":"","nums":{"precision":0,"n_files":1,"n_statements":1,"n_excluded":0,"n_missing":0,"n_branches":0,"n_partial_branches":0,"n_missing_branches":0}}},"z_7435199c01eb52ab___init___py":{"hash":"ca2411bb2d5283cba14da3ce60f5feec","index":{"url":"z_7435199c01eb52ab___init___py.html","file":"benefits/oauth/__init__.py","description":"","nums":{"precision":0,"n_files":1,"n_statements":0,"n_excluded":0,"n_missing":0,"n_branches":0,"n_partial_branches":0,"n_missing_branches":0}}},"z_7435199c01eb52ab_analytics_py":{"hash":"ff8e276ac77cbb24c1dcd82e47861c1b","index":{"url":"z_7435199c01eb52ab_analytics_py.html","file":"benefits/oauth/analytics.py","description":"","nums":{"precision":0,"n_files":1,"n_statements":41,"n_excluded":0,"n_missing":10,"n_branches":4,"n_partial_branches":0,"n_missing_branches":0}}},"z_7435199c01eb52ab_apps_py":{"hash":"36402fe1dabb1d904a68b06a2e55cf2c","index":{"url":"z_7435199c01eb52ab_apps_py.html","file":"benefits/oauth/apps.py","description":"","nums":{"precision":0,"n_files":1,"n_statements":5,"n_excluded":0,"n_missing":0,"n_branches":0,"n_partial_branches":0,"n_missing_branches":0}}},"z_7435199c01eb52ab_client_py":{"hash":"7adce4516066965569663371d363148e","index":{"url":"z_7435199c01eb52ab_client_py.html","file":"benefits/oauth/client.py","description":"","nums":{"precision":0,"n_files":1,"n_statements":24,"n_excluded":0,"n_missing":0,"n_branches":4,"n_partial_branches":0,"n_missing_branches":0}}},"z_7435199c01eb52ab_middleware_py":{"hash":"e12feadfda78ef775b7fb218422c22d7","index":{"url":"z_7435199c01eb52ab_middleware_py.html","file":"benefits/oauth/middleware.py","description":"","nums":{"precision":0,"n_files":1,"n_statements":23,"n_excluded":0,"n_missing":0,"n_branches":6,"n_partial_branches":0,"n_missing_branches":0}}},"z_7435199c01eb52ab_redirects_py":{"hash":"4332f54b4130709ba2a9614352da674f","index":{"url":"z_7435199c01eb52ab_redirects_py.html","file":"benefits/oauth/redirects.py","description":"","nums":{"precision":0,"n_files":1,"n_statements":22,"n_excluded":0,"n_missing":0,"n_branches":2,"n_partial_branches":0,"n_missing_branches":0}}},"z_7435199c01eb52ab_urls_py":{"hash":"c694f6983b7e09946c2ef56b5542c846","index":{"url":"z_7435199c01eb52ab_urls_py.html","file":"benefits/oauth/urls.py","description":"","nums":{"precision":0,"n_files":1,"n_statements":4,"n_excluded":0,"n_missing":0,"n_branches":0,"n_partial_branches":0,"n_missing_branches":0}}},"z_7435199c01eb52ab_views_py":{"hash":"a88a04543332f363042acf97bc3f3133","index":{"url":"z_7435199c01eb52ab_views_py.html","file":"benefits/oauth/views.py","description":"","nums":{"precision":0,"n_files":1,"n_statements":125,"n_excluded":0,"n_missing":1,"n_branches":42,"n_partial_branches":2,"n_missing_branches":2}}},"z_795c8c28b74e7b9e_secrets_py":{"hash":"e55de5175e8a40675e4c117656f9141c","index":{"url":"z_795c8c28b74e7b9e_secrets_py.html","file":"benefits/secrets.py","description":"","nums":{"precision":0,"n_files":1,"n_statements":48,"n_excluded":0,"n_missing":8,"n_branches":10,"n_partial_branches":1,"n_missing_branches":3}}},"z_795c8c28b74e7b9e_sentry_py":{"hash":"006ad6a6b21f60510149b41c448f1a5c","index":{"url":"z_795c8c28b74e7b9e_sentry_py.html","file":"benefits/sentry.py","description":"","nums":{"precision":0,"n_files":1,"n_statements":57,"n_excluded":0,"n_missing":12,"n_branches":14,"n_partial_branches":1,"n_missing_branches":3}}},"z_795c8c28b74e7b9e_settings_py":{"hash":"ebf02d70eeb13752519156a826e50c95","index":{"url":"z_795c8c28b74e7b9e_settings_py.html","file":"benefits/settings.py","description":"","nums":{"precision":0,"n_files":1,"n_statements":119,"n_excluded":0,"n_missing":6,"n_branches":24,"n_partial_branches":8,"n_missing_branches":8}}},"z_795c8c28b74e7b9e_urls_py":{"hash":"65376c94cf2882a65fc2660defcc8110","index":{"url":"z_795c8c28b74e7b9e_urls_py.html","file":"benefits/urls.py","description":"","nums":{"precision":0,"n_files":1,"n_statements":22,"n_excluded":0,"n_missing":7,"n_branches":2,"n_partial_branches":1,"n_missing_branches":1}}},"z_795c8c28b74e7b9e_wsgi_py":{"hash":"303877fd038268714536fb50d4f2ea25","index":{"url":"z_795c8c28b74e7b9e_wsgi_py.html","file":"benefits/wsgi.py","description":"","nums":{"precision":0,"n_files":1,"n_statements":4,"n_excluded":0,"n_missing":4,"n_branches":0,"n_partial_branches":0,"n_missing_branches":0}}}}} \ No newline at end of file diff --git a/tests/coverage/style_cb_8e611ae1.css b/tests/coverage/style_cb_8e611ae1.css new file mode 100644 index 000000000..3cdaf05a3 --- /dev/null +++ b/tests/coverage/style_cb_8e611ae1.css @@ -0,0 +1,337 @@ +@charset "UTF-8"; +/* Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 */ +/* For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt */ +/* Don't edit this .css file. Edit the .scss file instead! */ +html, body, h1, h2, h3, p, table, td, th { margin: 0; padding: 0; border: 0; font-weight: inherit; font-style: inherit; font-size: 100%; font-family: inherit; vertical-align: baseline; } + +body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; font-size: 1em; background: #fff; color: #000; } + +@media (prefers-color-scheme: dark) { body { background: #1e1e1e; } } + +@media (prefers-color-scheme: dark) { body { color: #eee; } } + +html > body { font-size: 16px; } + +a:active, a:focus { outline: 2px dashed #007acc; } + +p { font-size: .875em; line-height: 1.4em; } + +table { border-collapse: collapse; } + +td { vertical-align: top; } + +table tr.hidden { display: none !important; } + +p#no_rows { display: none; font-size: 1.15em; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; } + +a.nav { text-decoration: none; color: inherit; } + +a.nav:hover { text-decoration: underline; color: inherit; } + +.hidden { display: none; } + +header { background: #f8f8f8; width: 100%; z-index: 2; border-bottom: 1px solid #ccc; } + +@media (prefers-color-scheme: dark) { header { background: black; } } + +@media (prefers-color-scheme: dark) { header { border-color: #333; } } + +header .content { padding: 1rem 3.5rem; } + +header h2 { margin-top: .5em; font-size: 1em; } + +header h2 a.button { font-family: inherit; font-size: inherit; border: 1px solid; border-radius: .2em; background: #eee; color: inherit; text-decoration: none; padding: .1em .5em; margin: 1px calc(.1em + 1px); cursor: pointer; border-color: #ccc; } + +@media (prefers-color-scheme: dark) { header h2 a.button { background: #333; } } + +@media (prefers-color-scheme: dark) { header h2 a.button { border-color: #444; } } + +header h2 a.button.current { border: 2px solid; background: #fff; border-color: #999; cursor: default; } + +@media (prefers-color-scheme: dark) { header h2 a.button.current { background: #1e1e1e; } } + +@media (prefers-color-scheme: dark) { header h2 a.button.current { border-color: #777; } } + +header p.text { margin: .5em 0 -.5em; color: #666; font-style: italic; } + +@media (prefers-color-scheme: dark) { header p.text { color: #aaa; } } + +header.sticky { position: fixed; left: 0; right: 0; height: 2.5em; } + +header.sticky .text { display: none; } + +header.sticky h1, header.sticky h2 { font-size: 1em; margin-top: 0; display: inline-block; } + +header.sticky .content { padding: 0.5rem 3.5rem; } + +header.sticky .content p { font-size: 1em; } + +header.sticky ~ #source { padding-top: 6.5em; } + +main { position: relative; z-index: 1; } + +footer { margin: 1rem 3.5rem; } + +footer .content { padding: 0; color: #666; font-style: italic; } + +@media (prefers-color-scheme: dark) { footer .content { color: #aaa; } } + +#index { margin: 1rem 0 0 3.5rem; } + +h1 { font-size: 1.25em; display: inline-block; } + +#filter_container { float: right; margin: 0 2em 0 0; line-height: 1.66em; } + +#filter_container #filter { width: 10em; padding: 0.2em 0.5em; border: 2px solid #ccc; background: #fff; color: #000; } + +@media (prefers-color-scheme: dark) { #filter_container #filter { border-color: #444; } } + +@media (prefers-color-scheme: dark) { #filter_container #filter { background: #1e1e1e; } } + +@media (prefers-color-scheme: dark) { #filter_container #filter { color: #eee; } } + +#filter_container #filter:focus { border-color: #007acc; } + +#filter_container :disabled ~ label { color: #ccc; } + +@media (prefers-color-scheme: dark) { #filter_container :disabled ~ label { color: #444; } } + +#filter_container label { font-size: .875em; color: #666; } + +@media (prefers-color-scheme: dark) { #filter_container label { color: #aaa; } } + +header button { font-family: inherit; font-size: inherit; border: 1px solid; border-radius: .2em; background: #eee; color: inherit; text-decoration: none; padding: .1em .5em; margin: 1px calc(.1em + 1px); cursor: pointer; border-color: #ccc; } + +@media (prefers-color-scheme: dark) { header button { background: #333; } } + +@media (prefers-color-scheme: dark) { header button { border-color: #444; } } + +header button:active, header button:focus { outline: 2px dashed #007acc; } + +header button.run { background: #eeffee; } + +@media (prefers-color-scheme: dark) { header button.run { background: #373d29; } } + +header button.run.show_run { background: #dfd; border: 2px solid #00dd00; margin: 0 .1em; } + +@media (prefers-color-scheme: dark) { header button.run.show_run { background: #373d29; } } + +header button.mis { background: #ffeeee; } + +@media (prefers-color-scheme: dark) { header button.mis { background: #4b1818; } } + +header button.mis.show_mis { background: #fdd; border: 2px solid #ff0000; margin: 0 .1em; } + +@media (prefers-color-scheme: dark) { header button.mis.show_mis { background: #4b1818; } } + +header button.exc { background: #f7f7f7; } + +@media (prefers-color-scheme: dark) { header button.exc { background: #333; } } + +header button.exc.show_exc { background: #eee; border: 2px solid #808080; margin: 0 .1em; } + +@media (prefers-color-scheme: dark) { header button.exc.show_exc { background: #333; } } + +header button.par { background: #ffffd5; } + +@media (prefers-color-scheme: dark) { header button.par { background: #650; } } + +header button.par.show_par { background: #ffa; border: 2px solid #bbbb00; margin: 0 .1em; } + +@media (prefers-color-scheme: dark) { header button.par.show_par { background: #650; } } + +#help_panel, #source p .annotate.long { display: none; position: absolute; z-index: 999; background: #ffffcc; border: 1px solid #888; border-radius: .2em; color: #333; padding: .25em .5em; } + +#source p .annotate.long { white-space: normal; float: right; top: 1.75em; right: 1em; height: auto; } + +#help_panel_wrapper { float: right; position: relative; } + +#keyboard_icon { margin: 5px; } + +#help_panel_state { display: none; } + +#help_panel { top: 25px; right: 0; padding: .75em; border: 1px solid #883; color: #333; } + +#help_panel .keyhelp p { margin-top: .75em; } + +#help_panel .legend { font-style: italic; margin-bottom: 1em; } + +.indexfile #help_panel { width: 25em; } + +.pyfile #help_panel { width: 18em; } + +#help_panel_state:checked ~ #help_panel { display: block; } + +kbd { border: 1px solid black; border-color: #888 #333 #333 #888; padding: .1em .35em; font-family: SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-weight: bold; background: #eee; border-radius: 3px; } + +#source { padding: 1em 0 1em 3.5rem; font-family: SFMono-Regular, Menlo, Monaco, Consolas, monospace; } + +#source p { position: relative; white-space: pre; } + +#source p * { box-sizing: border-box; } + +#source p .n { float: left; text-align: right; width: 3.5rem; box-sizing: border-box; margin-left: -3.5rem; padding-right: 1em; color: #999; user-select: none; } + +@media (prefers-color-scheme: dark) { #source p .n { color: #777; } } + +#source p .n.highlight { background: #ffdd00; } + +#source p .n a { scroll-margin-top: 6em; text-decoration: none; color: #999; } + +@media (prefers-color-scheme: dark) { #source p .n a { color: #777; } } + +#source p .n a:hover { text-decoration: underline; color: #999; } + +@media (prefers-color-scheme: dark) { #source p .n a:hover { color: #777; } } + +#source p .t { display: inline-block; width: 100%; box-sizing: border-box; margin-left: -.5em; padding-left: 0.3em; border-left: 0.2em solid #fff; } + +@media (prefers-color-scheme: dark) { #source p .t { border-color: #1e1e1e; } } + +#source p .t:hover { background: #f2f2f2; } + +@media (prefers-color-scheme: dark) { #source p .t:hover { background: #282828; } } + +#source p .t:hover ~ .r .annotate.long { display: block; } + +#source p .t .com { color: #008000; font-style: italic; line-height: 1px; } + +@media (prefers-color-scheme: dark) { #source p .t .com { color: #6a9955; } } + +#source p .t .key { font-weight: bold; line-height: 1px; } + +#source p .t .str { color: #0451a5; } + +@media (prefers-color-scheme: dark) { #source p .t .str { color: #9cdcfe; } } + +#source p.mis .t { border-left: 0.2em solid #ff0000; } + +#source p.mis.show_mis .t { background: #fdd; } + +@media (prefers-color-scheme: dark) { #source p.mis.show_mis .t { background: #4b1818; } } + +#source p.mis.show_mis .t:hover { background: #f2d2d2; } + +@media (prefers-color-scheme: dark) { #source p.mis.show_mis .t:hover { background: #532323; } } + +#source p.run .t { border-left: 0.2em solid #00dd00; } + +#source p.run.show_run .t { background: #dfd; } + +@media (prefers-color-scheme: dark) { #source p.run.show_run .t { background: #373d29; } } + +#source p.run.show_run .t:hover { background: #d2f2d2; } + +@media (prefers-color-scheme: dark) { #source p.run.show_run .t:hover { background: #404633; } } + +#source p.exc .t { border-left: 0.2em solid #808080; } + +#source p.exc.show_exc .t { background: #eee; } + +@media (prefers-color-scheme: dark) { #source p.exc.show_exc .t { background: #333; } } + +#source p.exc.show_exc .t:hover { background: #e2e2e2; } + +@media (prefers-color-scheme: dark) { #source p.exc.show_exc .t:hover { background: #3c3c3c; } } + +#source p.par .t { border-left: 0.2em solid #bbbb00; } + +#source p.par.show_par .t { background: #ffa; } + +@media (prefers-color-scheme: dark) { #source p.par.show_par .t { background: #650; } } + +#source p.par.show_par .t:hover { background: #f2f2a2; } + +@media (prefers-color-scheme: dark) { #source p.par.show_par .t:hover { background: #6d5d0c; } } + +#source p .r { position: absolute; top: 0; right: 2.5em; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; } + +#source p .annotate { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; color: #666; padding-right: .5em; } + +@media (prefers-color-scheme: dark) { #source p .annotate { color: #ddd; } } + +#source p .annotate.short:hover ~ .long { display: block; } + +#source p .annotate.long { width: 30em; right: 2.5em; } + +#source p input { display: none; } + +#source p input ~ .r label.ctx { cursor: pointer; border-radius: .25em; } + +#source p input ~ .r label.ctx::before { content: "▶ "; } + +#source p input ~ .r label.ctx:hover { background: #e8f4ff; color: #666; } + +@media (prefers-color-scheme: dark) { #source p input ~ .r label.ctx:hover { background: #0f3a42; } } + +@media (prefers-color-scheme: dark) { #source p input ~ .r label.ctx:hover { color: #aaa; } } + +#source p input:checked ~ .r label.ctx { background: #d0e8ff; color: #666; border-radius: .75em .75em 0 0; padding: 0 .5em; margin: -.25em 0; } + +@media (prefers-color-scheme: dark) { #source p input:checked ~ .r label.ctx { background: #056; } } + +@media (prefers-color-scheme: dark) { #source p input:checked ~ .r label.ctx { color: #aaa; } } + +#source p input:checked ~ .r label.ctx::before { content: "▼ "; } + +#source p input:checked ~ .ctxs { padding: .25em .5em; overflow-y: scroll; max-height: 10.5em; } + +#source p label.ctx { color: #999; display: inline-block; padding: 0 .5em; font-size: .8333em; } + +@media (prefers-color-scheme: dark) { #source p label.ctx { color: #777; } } + +#source p .ctxs { display: block; max-height: 0; overflow-y: hidden; transition: all .2s; padding: 0 .5em; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; white-space: nowrap; background: #d0e8ff; border-radius: .25em; margin-right: 1.75em; text-align: right; } + +@media (prefers-color-scheme: dark) { #source p .ctxs { background: #056; } } + +#index { font-family: SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-size: 0.875em; } + +#index table.index { margin-left: -.5em; } + +#index td, #index th { text-align: right; padding: .25em .5em; border-bottom: 1px solid #eee; } + +@media (prefers-color-scheme: dark) { #index td, #index th { border-color: #333; } } + +#index td.name, #index th.name { text-align: left; width: auto; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; min-width: 15em; } + +#index th { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; font-style: italic; color: #333; cursor: pointer; } + +@media (prefers-color-scheme: dark) { #index th { color: #ddd; } } + +#index th:hover { background: #eee; } + +@media (prefers-color-scheme: dark) { #index th:hover { background: #333; } } + +#index th .arrows { color: #666; font-size: 85%; font-family: sans-serif; font-style: normal; pointer-events: none; } + +#index th[aria-sort="ascending"], #index th[aria-sort="descending"] { white-space: nowrap; background: #eee; padding-left: .5em; } + +@media (prefers-color-scheme: dark) { #index th[aria-sort="ascending"], #index th[aria-sort="descending"] { background: #333; } } + +#index th[aria-sort="ascending"] .arrows::after { content: " ▲"; } + +#index th[aria-sort="descending"] .arrows::after { content: " ▼"; } + +#index td.name { font-size: 1.15em; } + +#index td.name a { text-decoration: none; color: inherit; } + +#index td.name .no-noun { font-style: italic; } + +#index tr.total td, #index tr.total_dynamic td { font-weight: bold; border-top: 1px solid #ccc; border-bottom: none; } + +#index tr.region:hover { background: #eee; } + +@media (prefers-color-scheme: dark) { #index tr.region:hover { background: #333; } } + +#index tr.region:hover td.name { text-decoration: underline; color: inherit; } + +#scroll_marker { position: fixed; z-index: 3; right: 0; top: 0; width: 16px; height: 100%; background: #fff; border-left: 1px solid #eee; will-change: transform; } + +@media (prefers-color-scheme: dark) { #scroll_marker { background: #1e1e1e; } } + +@media (prefers-color-scheme: dark) { #scroll_marker { border-color: #333; } } + +#scroll_marker .marker { background: #ccc; position: absolute; min-height: 3px; width: 100%; } + +@media (prefers-color-scheme: dark) { #scroll_marker .marker { background: #444; } } diff --git a/tests/coverage/z_5351a2d360ecd143___init___py.html b/tests/coverage/z_5351a2d360ecd143___init___py.html new file mode 100644 index 000000000..ba2bd7085 --- /dev/null +++ b/tests/coverage/z_5351a2d360ecd143___init___py.html @@ -0,0 +1,99 @@ + + + + + Coverage for benefits/enrollment/__init__.py: 100% + + + + + +
+
+

+ Coverage for benefits/enrollment/__init__.py: + 100% +

+ +

+ 0 statements   + + + + +

+

+ « prev     + ^ index     + » next +       + coverage.py v7.6.1, + created at 2024-08-13 23:09 +0000 +

+ +
+
+
+
+ + + diff --git a/tests/coverage/z_5351a2d360ecd143_analytics_py.html b/tests/coverage/z_5351a2d360ecd143_analytics_py.html new file mode 100644 index 000000000..77656927a --- /dev/null +++ b/tests/coverage/z_5351a2d360ecd143_analytics_py.html @@ -0,0 +1,144 @@ + + + + + Coverage for benefits/enrollment/analytics.py: 74% + + + + + +
+
+

+ Coverage for benefits/enrollment/analytics.py: + 74% +

+ +

+ 21 statements   + + + + +

+

+ « prev     + ^ index     + » next +       + coverage.py v7.6.1, + created at 2024-08-13 23:09 +0000 +

+ +
+
+
+

1""" 

+

2The enrollment application: analytics implementation. 

+

3""" 

+

4 

+

5from benefits.core import analytics as core 

+

6 

+

7 

+

8class ReturnedEnrollmentEvent(core.Event): 

+

9 """Analytics event representing the end of transit processor enrollment request.""" 

+

10 

+

11 def __init__(self, request, status, error=None, payment_group=None): 

+

12 super().__init__(request, "returned enrollment") 

+

13 if str(status).lower() in ("error", "retry", "success"): 13 ↛ 15line 13 didn't jump to line 15 because the condition on line 13 was always true

+

14 self.update_event_properties(status=status, error=error) 

+

15 if payment_group is not None: 15 ↛ 16line 15 didn't jump to line 16 because the condition on line 15 was never true

+

16 self.update_event_properties(payment_group=payment_group) 

+

17 

+

18 

+

19class FailedAccessTokenRequestEvent(core.Event): 

+

20 """Analytics event representing a failure to acquire an access token for card tokenization.""" 

+

21 

+

22 def __init__(self, request, status_code=None): 

+

23 super().__init__(request, "failed access token request") 

+

24 if status_code is not None: 24 ↛ exitline 24 didn't return from function '__init__' because the condition on line 24 was always true

+

25 self.update_event_properties(status_code=status_code) 

+

26 

+

27 

+

28def returned_error(request, error): 

+

29 """Send the "returned enrollment" analytics event with an error status and message.""" 

+

30 core.send_event(ReturnedEnrollmentEvent(request, status="error", error=error)) 

+

31 

+

32 

+

33def returned_retry(request): 

+

34 """Send the "returned enrollment" analytics event with a retry status.""" 

+

35 core.send_event(ReturnedEnrollmentEvent(request, status="retry")) 

+

36 

+

37 

+

38def returned_success(request, payment_group): 

+

39 """Send the "returned enrollment" analytics event with a success status.""" 

+

40 core.send_event(ReturnedEnrollmentEvent(request, status="success", payment_group=payment_group)) 

+

41 

+

42 

+

43def failed_access_token_request(request, status_code=None): 

+

44 """Send the "failed access token request" analytics event with the response status code.""" 

+

45 core.send_event(FailedAccessTokenRequestEvent(request, status_code=status_code)) 

+
+ + + diff --git a/tests/coverage/z_5351a2d360ecd143_apps_py.html b/tests/coverage/z_5351a2d360ecd143_apps_py.html new file mode 100644 index 000000000..a1cdb00d9 --- /dev/null +++ b/tests/coverage/z_5351a2d360ecd143_apps_py.html @@ -0,0 +1,110 @@ + + + + + Coverage for benefits/enrollment/apps.py: 100% + + + + + +
+
+

+ Coverage for benefits/enrollment/apps.py: + 100% +

+ +

+ 5 statements   + + + + +

+

+ « prev     + ^ index     + » next +       + coverage.py v7.6.1, + created at 2024-08-13 23:09 +0000 +

+ +
+
+
+

1""" 

+

2The enrollment application: Allows user to enroll payment device for benefits. 

+

3""" 

+

4 

+

5from django.apps import AppConfig 

+

6 

+

7 

+

8class EnrollmentAppConfig(AppConfig): 

+

9 name = "benefits.enrollment" 

+

10 label = "enrollment" 

+

11 verbose_name = "Benefits Enrollment" 

+
+ + + diff --git a/tests/coverage/z_5351a2d360ecd143_forms_py.html b/tests/coverage/z_5351a2d360ecd143_forms_py.html new file mode 100644 index 000000000..309bea23b --- /dev/null +++ b/tests/coverage/z_5351a2d360ecd143_forms_py.html @@ -0,0 +1,129 @@ + + + + + Coverage for benefits/enrollment/forms.py: 100% + + + + + +
+
+

+ Coverage for benefits/enrollment/forms.py: + 100% +

+ +

+ 12 statements   + + + + +

+

+ « prev     + ^ index     + » next +       + coverage.py v7.6.1, + created at 2024-08-13 23:09 +0000 +

+ +
+
+
+

1""" 

+

2The enrollment application: Form definitions for results from Hosted Card Verification Flow. 

+

3""" 

+

4 

+

5from django import forms 

+

6 

+

7 

+

8class CardTokenizeSuccessForm(forms.Form): 

+

9 """Form to bring client card token back to server.""" 

+

10 

+

11 action_url = "enrollment:index" 

+

12 id = "form-card-tokenize-success" 

+

13 method = "POST" 

+

14 

+

15 # hidden input with no label 

+

16 card_token = forms.CharField(widget=forms.HiddenInput(), label="") 

+

17 

+

18 

+

19class CardTokenizeFailForm(forms.Form): 

+

20 """Form to indicate card tokenization failure to server.""" 

+

21 

+

22 method = "POST" 

+

23 

+

24 def __init__(self, action_url, id, *args, **kwargs): 

+

25 # init super with an empty data dict 

+

26 # binds and makes immutable this form's data 

+

27 # since there are no form fields, the form is also marked as valid 

+

28 super().__init__({}, *args, **kwargs) 

+

29 self.id = id 

+

30 self.action_url = action_url 

+
+ + + diff --git a/tests/coverage/z_5351a2d360ecd143_urls_py.html b/tests/coverage/z_5351a2d360ecd143_urls_py.html new file mode 100644 index 000000000..62c4d6e4b --- /dev/null +++ b/tests/coverage/z_5351a2d360ecd143_urls_py.html @@ -0,0 +1,118 @@ + + + + + Coverage for benefits/enrollment/urls.py: 100% + + + + + +
+
+

+ Coverage for benefits/enrollment/urls.py: + 100% +

+ +

+ 4 statements   + + + + +

+

+ « prev     + ^ index     + » next +       + coverage.py v7.6.1, + created at 2024-08-13 23:09 +0000 +

+ +
+
+
+

1""" 

+

2The enrollment application: URLConf for the benefits enrollment flow. 

+

3""" 

+

4 

+

5from django.urls import path 

+

6 

+

7from . import views 

+

8 

+

9 

+

10app_name = "enrollment" 

+

11urlpatterns = [ 

+

12 # /enrollment 

+

13 path("", views.index, name="index"), 

+

14 path("token", views.token, name="token"), 

+

15 path("reenrollment-error", views.reenrollment_error, name="reenrollment-error"), 

+

16 path("retry", views.retry, name="retry"), 

+

17 path("success", views.success, name="success"), 

+

18 path("error", views.system_error, name="system-error"), 

+

19] 

+
+ + + diff --git a/tests/coverage/z_5351a2d360ecd143_views_py.html b/tests/coverage/z_5351a2d360ecd143_views_py.html new file mode 100644 index 000000000..b09b025de --- /dev/null +++ b/tests/coverage/z_5351a2d360ecd143_views_py.html @@ -0,0 +1,394 @@ + + + + + Coverage for benefits/enrollment/views.py: 99% + + + + + +
+
+

+ Coverage for benefits/enrollment/views.py: + 99% +

+ +

+ 153 statements   + + + + +

+

+ « prev     + ^ index     + » next +       + coverage.py v7.6.1, + created at 2024-08-13 23:09 +0000 +

+ +
+
+
+

1""" 

+

2The enrollment application: view definitions for the benefits enrollment flow. 

+

3""" 

+

4 

+

5import logging 

+

6from datetime import timedelta 

+

7 

+

8from django.http import JsonResponse 

+

9from django.template.response import TemplateResponse 

+

10from django.urls import reverse 

+

11from django.utils import timezone 

+

12from django.utils.decorators import decorator_from_middleware 

+

13from littlepay.api.client import Client 

+

14from requests.exceptions import HTTPError 

+

15import sentry_sdk 

+

16 

+

17from benefits.core import session 

+

18from benefits.core.middleware import EligibleSessionRequired, FlowSessionRequired, pageview_decorator 

+

19from benefits.core.views import ROUTE_LOGGED_OUT, ROUTE_SERVER_ERROR 

+

20 

+

21from . import analytics, forms 

+

22 

+

23ROUTE_INDEX = "enrollment:index" 

+

24ROUTE_REENROLLMENT_ERROR = "enrollment:reenrollment-error" 

+

25ROUTE_RETRY = "enrollment:retry" 

+

26ROUTE_SUCCESS = "enrollment:success" 

+

27ROUTE_SYSTEM_ERROR = "enrollment:system-error" 

+

28ROUTE_TOKEN = "enrollment:token" 

+

29 

+

30TEMPLATE_RETRY = "enrollment/retry.html" 

+

31TEMPLATE_SYSTEM_ERROR = "enrollment/system_error.html" 

+

32 

+

33 

+

34logger = logging.getLogger(__name__) 

+

35 

+

36 

+

37@decorator_from_middleware(EligibleSessionRequired) 

+

38def token(request): 

+

39 """View handler for the enrollment auth token.""" 

+

40 if not session.enrollment_token_valid(request): 

+

41 agency = session.agency(request) 

+

42 

+

43 try: 

+

44 client = Client( 

+

45 base_url=agency.transit_processor.api_base_url, 

+

46 client_id=agency.transit_processor_client_id, 

+

47 client_secret=agency.transit_processor_client_secret, 

+

48 audience=agency.transit_processor_audience, 

+

49 ) 

+

50 client.oauth.ensure_active_token(client.token) 

+

51 response = client.request_card_tokenization_access() 

+

52 except Exception as e: 

+

53 logger.debug("Error occurred while requesting access token", exc_info=e) 

+

54 sentry_sdk.capture_exception(e) 

+

55 

+

56 if isinstance(e, HTTPError): 

+

57 status_code = e.response.status_code 

+

58 

+

59 if status_code >= 500: 

+

60 redirect = reverse(ROUTE_SYSTEM_ERROR) 

+

61 else: 

+

62 redirect = reverse(ROUTE_SERVER_ERROR) 

+

63 else: 

+

64 status_code = None 

+

65 redirect = reverse(ROUTE_SERVER_ERROR) 

+

66 

+

67 analytics.failed_access_token_request(request, status_code) 

+

68 

+

69 data = {"redirect": redirect} 

+

70 return JsonResponse(data) 

+

71 else: 

+

72 session.update( 

+

73 request, enrollment_token=response.get("access_token"), enrollment_token_exp=response.get("expires_at") 

+

74 ) 

+

75 

+

76 data = {"token": session.enrollment_token(request)} 

+

77 

+

78 return JsonResponse(data) 

+

79 

+

80 

+

81@decorator_from_middleware(EligibleSessionRequired) 

+

82def index(request): 

+

83 """View handler for the enrollment landing page.""" 

+

84 session.update(request, origin=reverse(ROUTE_INDEX)) 

+

85 

+

86 agency = session.agency(request) 

+

87 eligibility = session.eligibility(request) 

+

88 

+

89 # POST back after transit processor form, process card token 

+

90 if request.method == "POST": 

+

91 form = forms.CardTokenizeSuccessForm(request.POST) 

+

92 if not form.is_valid(): 

+

93 raise Exception("Invalid card token form") 

+

94 

+

95 card_token = form.cleaned_data.get("card_token") 

+

96 

+

97 client = Client( 

+

98 base_url=agency.transit_processor.api_base_url, 

+

99 client_id=agency.transit_processor_client_id, 

+

100 client_secret=agency.transit_processor_client_secret, 

+

101 audience=agency.transit_processor_audience, 

+

102 ) 

+

103 client.oauth.ensure_active_token(client.token) 

+

104 

+

105 funding_source = client.get_funding_source_by_token(card_token) 

+

106 group_id = eligibility.group_id 

+

107 

+

108 try: 

+

109 group_funding_source = _get_group_funding_source( 

+

110 client=client, group_id=group_id, funding_source_id=funding_source.id 

+

111 ) 

+

112 

+

113 already_enrolled = group_funding_source is not None 

+

114 

+

115 if eligibility.supports_expiration: 

+

116 # set expiry on session 

+

117 if already_enrolled and group_funding_source.expiry_date is not None: 

+

118 session.update(request, enrollment_expiry=group_funding_source.expiry_date) 

+

119 else: 

+

120 session.update(request, enrollment_expiry=_calculate_expiry(eligibility.expiration_days)) 

+

121 

+

122 if not already_enrolled: 

+

123 # enroll user with an expiration date, return success 

+

124 client.link_concession_group_funding_source( 

+

125 group_id=group_id, funding_source_id=funding_source.id, expiry=session.enrollment_expiry(request) 

+

126 ) 

+

127 return success(request) 

+

128 else: # already_enrolled 

+

129 if group_funding_source.expiry_date is None: 

+

130 # update expiration of existing enrollment, return success 

+

131 client.update_concession_group_funding_source_expiry( 

+

132 group_id=group_id, 

+

133 funding_source_id=funding_source.id, 

+

134 expiry=session.enrollment_expiry(request), 

+

135 ) 

+

136 return success(request) 

+

137 else: 

+

138 is_expired = _is_expired(group_funding_source.expiry_date) 

+

139 is_within_reenrollment_window = _is_within_reenrollment_window( 

+

140 group_funding_source.expiry_date, session.enrollment_reenrollment(request) 

+

141 ) 

+

142 

+

143 if is_expired or is_within_reenrollment_window: 

+

144 # update expiration of existing enrollment, return success 

+

145 client.update_concession_group_funding_source_expiry( 

+

146 group_id=group_id, 

+

147 funding_source_id=funding_source.id, 

+

148 expiry=session.enrollment_expiry(request), 

+

149 ) 

+

150 return success(request) 

+

151 else: 

+

152 # re-enrollment error, return enrollment error with expiration and reenrollment_date 

+

153 return reenrollment_error(request) 

+

154 else: # eligibility does not support expiration 

+

155 if not already_enrolled: 

+

156 # enroll user with no expiration date, return success 

+

157 client.link_concession_group_funding_source(group_id=group_id, funding_source_id=funding_source.id) 

+

158 return success(request) 

+

159 else: # already_enrolled 

+

160 if group_funding_source.expiry_date is None: 

+

161 # no action, return success 

+

162 return success(request) 

+

163 else: 

+

164 # remove expiration date, return success 

+

165 raise NotImplementedError("Removing expiration date is currently not supported") 

+

166 

+

167 except HTTPError as e: 

+

168 if e.response.status_code >= 500: 

+

169 analytics.returned_error(request, str(e)) 

+

170 sentry_sdk.capture_exception(e) 

+

171 

+

172 return system_error(request) 

+

173 else: 

+

174 analytics.returned_error(request, str(e)) 

+

175 raise Exception(f"{e}: {e.response.json()}") 

+

176 except Exception as e: 

+

177 analytics.returned_error(request, str(e)) 

+

178 raise e 

+

179 

+

180 # GET enrollment index 

+

181 else: 

+

182 tokenize_retry_form = forms.CardTokenizeFailForm(ROUTE_RETRY, "form-card-tokenize-fail-retry") 

+

183 tokenize_server_error_form = forms.CardTokenizeFailForm(ROUTE_SERVER_ERROR, "form-card-tokenize-fail-server-error") 

+

184 tokenize_system_error_form = forms.CardTokenizeFailForm(ROUTE_SYSTEM_ERROR, "form-card-tokenize-fail-system-error") 

+

185 tokenize_success_form = forms.CardTokenizeSuccessForm(auto_id=True, label_suffix="") 

+

186 

+

187 # mapping from Django's I18N LANGUAGE_CODE to Littlepay's overlay language code 

+

188 overlay_language = {"en": "en", "es": "es-419"}.get(request.LANGUAGE_CODE, "en") 

+

189 

+

190 context = { 

+

191 "forms": [tokenize_retry_form, tokenize_server_error_form, tokenize_system_error_form, tokenize_success_form], 

+

192 "cta_button": "tokenize_card", 

+

193 "card_tokenize_env": agency.transit_processor.card_tokenize_env, 

+

194 "card_tokenize_func": agency.transit_processor.card_tokenize_func, 

+

195 "card_tokenize_url": agency.transit_processor.card_tokenize_url, 

+

196 "token_field": "card_token", 

+

197 "form_retry": tokenize_retry_form.id, 

+

198 "form_server_error": tokenize_server_error_form.id, 

+

199 "form_success": tokenize_success_form.id, 

+

200 "form_system_error": tokenize_system_error_form.id, 

+

201 "overlay_language": overlay_language, 

+

202 } 

+

203 

+

204 logger.debug(f'card_tokenize_url: {context["card_tokenize_url"]}') 

+

205 

+

206 return TemplateResponse(request, eligibility.enrollment_index_template, context) 

+

207 

+

208 

+

209def _get_group_funding_source(client: Client, group_id, funding_source_id): 

+

210 group_funding_sources = client.get_concession_group_linked_funding_sources(group_id) 

+

211 matching_group_funding_source = None 

+

212 for group_funding_source in group_funding_sources: 

+

213 if group_funding_source.id == funding_source_id: 213 ↛ 212line 213 didn't jump to line 212 because the condition on line 213 was always true

+

214 matching_group_funding_source = group_funding_source 

+

215 break 

+

216 

+

217 return matching_group_funding_source 

+

218 

+

219 

+

220def _is_expired(expiry_date): 

+

221 """Returns whether the passed in datetime is expired or not.""" 

+

222 return expiry_date <= timezone.now() 

+

223 

+

224 

+

225def _is_within_reenrollment_window(expiry_date, enrollment_reenrollment_date): 

+

226 """Returns if we are currently within the reenrollment window.""" 

+

227 return enrollment_reenrollment_date <= timezone.now() < expiry_date 

+

228 

+

229 

+

230def _calculate_expiry(expiration_days): 

+

231 """Returns the expiry datetime, which should be midnight in our configured timezone of the (N + 1)th day from now, 

+

232 where N is expiration_days.""" 

+

233 default_time_zone = timezone.get_default_timezone() 

+

234 expiry_date = timezone.localtime(timezone=default_time_zone) + timedelta(days=expiration_days + 1) 

+

235 expiry_datetime = expiry_date.replace(hour=0, minute=0, second=0, microsecond=0) 

+

236 

+

237 return expiry_datetime 

+

238 

+

239 

+

240@decorator_from_middleware(EligibleSessionRequired) 

+

241def reenrollment_error(request): 

+

242 """View handler for a re-enrollment attempt that is not yet within the re-enrollment window.""" 

+

243 eligibility = session.eligibility(request) 

+

244 flow = session.flow(request) 

+

245 

+

246 if eligibility.reenrollment_error_template is None: 

+

247 raise Exception(f"Re-enrollment error with null template on: {eligibility.label}") 

+

248 

+

249 if session.logged_in(request) and flow.claims_provider.supports_sign_out: 249 ↛ 252line 249 didn't jump to line 252 because the condition on line 249 was never true

+

250 # overwrite origin for a logged in user 

+

251 # if they click the logout button, they are taken to the new route 

+

252 session.update(request, origin=reverse(ROUTE_LOGGED_OUT)) 

+

253 

+

254 analytics.returned_error(request, "Re-enrollment error.") 

+

255 

+

256 return TemplateResponse(request, eligibility.reenrollment_error_template) 

+

257 

+

258 

+

259@decorator_from_middleware(EligibleSessionRequired) 

+

260def retry(request): 

+

261 """View handler for a recoverable failure condition.""" 

+

262 analytics.returned_retry(request) 

+

263 return TemplateResponse(request, TEMPLATE_RETRY) 

+

264 

+

265 

+

266@decorator_from_middleware(EligibleSessionRequired) 

+

267def system_error(request): 

+

268 """View handler for an enrollment system error.""" 

+

269 

+

270 # overwrite origin so that CTA takes user to agency index 

+

271 agency = session.agency(request) 

+

272 session.update(request, origin=agency.index_url) 

+

273 

+

274 return TemplateResponse(request, TEMPLATE_SYSTEM_ERROR) 

+

275 

+

276 

+

277@pageview_decorator 

+

278@decorator_from_middleware(EligibleSessionRequired) 

+

279@decorator_from_middleware(FlowSessionRequired) 

+

280def success(request): 

+

281 """View handler for the final success page.""" 

+

282 request.path = "/enrollment/success" 

+

283 session.update(request, origin=reverse(ROUTE_SUCCESS)) 

+

284 

+

285 eligibility = session.eligibility(request) 

+

286 flow = session.flow(request) 

+

287 

+

288 if session.logged_in(request) and flow.claims_provider.supports_sign_out: 

+

289 # overwrite origin for a logged in user 

+

290 # if they click the logout button, they are taken to the new route 

+

291 session.update(request, origin=reverse(ROUTE_LOGGED_OUT)) 

+

292 

+

293 analytics.returned_success(request, eligibility.group_id) 

+

294 context = {"redirect_to": request.path} 

+

295 return TemplateResponse(request, eligibility.enrollment_success_template, context) 

+
+ + + diff --git a/tests/coverage/z_7432a6a7a8e99cb0___init___py.html b/tests/coverage/z_7432a6a7a8e99cb0___init___py.html new file mode 100644 index 000000000..485045833 --- /dev/null +++ b/tests/coverage/z_7432a6a7a8e99cb0___init___py.html @@ -0,0 +1,99 @@ + + + + + Coverage for benefits/in_person/__init__.py: 100% + + + + + +
+
+

+ Coverage for benefits/in_person/__init__.py: + 100% +

+ +

+ 0 statements   + + + + +

+

+ « prev     + ^ index     + » next +       + coverage.py v7.6.1, + created at 2024-08-13 23:09 +0000 +

+ +
+
+
+
+ + + diff --git a/tests/coverage/z_7432a6a7a8e99cb0_apps_py.html b/tests/coverage/z_7432a6a7a8e99cb0_apps_py.html new file mode 100644 index 000000000..2fa0c29f9 --- /dev/null +++ b/tests/coverage/z_7432a6a7a8e99cb0_apps_py.html @@ -0,0 +1,105 @@ + + + + + Coverage for benefits/in_person/apps.py: 100% + + + + + +
+
+

+ Coverage for benefits/in_person/apps.py: + 100% +

+ +

+ 4 statements   + + + + +

+

+ « prev     + ^ index     + » next +       + coverage.py v7.6.1, + created at 2024-08-13 23:09 +0000 +

+ +
+
+
+

1from django.apps import AppConfig 

+

2 

+

3 

+

4class InPersonConfig(AppConfig): 

+

5 name = "benefits.in_person" 

+

6 label = "in_person" 

+
+ + + diff --git a/tests/coverage/z_7432a6a7a8e99cb0_urls_py.html b/tests/coverage/z_7432a6a7a8e99cb0_urls_py.html new file mode 100644 index 000000000..7f40faf97 --- /dev/null +++ b/tests/coverage/z_7432a6a7a8e99cb0_urls_py.html @@ -0,0 +1,110 @@ + + + + + Coverage for benefits/in_person/urls.py: 100% + + + + + +
+
+

+ Coverage for benefits/in_person/urls.py: + 100% +

+ +

+ 5 statements   + + + + +

+

+ « prev     + ^ index     + » next +       + coverage.py v7.6.1, + created at 2024-08-13 23:09 +0000 +

+ +
+
+
+

1from django.urls import path 

+

2 

+

3from benefits.core.admin import admin 

+

4from . import views 

+

5 

+

6 

+

7app_name = "in_person" 

+

8urlpatterns = [ 

+

9 path("eligibility/", admin.site.admin_view(views.eligibility), name="eligibility"), 

+

10 path("enrollment/", admin.site.admin_view(views.enrollment), name="enrollment"), 

+

11] 

+
+ + + diff --git a/tests/coverage/z_7432a6a7a8e99cb0_views_py.html b/tests/coverage/z_7432a6a7a8e99cb0_views_py.html new file mode 100644 index 000000000..784d7fa24 --- /dev/null +++ b/tests/coverage/z_7432a6a7a8e99cb0_views_py.html @@ -0,0 +1,111 @@ + + + + + Coverage for benefits/in_person/views.py: 100% + + + + + +
+
+

+ Coverage for benefits/in_person/views.py: + 100% +

+ +

+ 7 statements   + + + + +

+

+ « prev     + ^ index     + » next +       + coverage.py v7.6.1, + created at 2024-08-13 23:09 +0000 +

+ +
+
+
+

1from django.template.response import TemplateResponse 

+

2 

+

3ROUTE_ELIGIBILITY = "in_person:eligibility" 

+

4ROUTE_ENROLLMENT = "in_person:enrollment" 

+

5 

+

6 

+

7def eligibility(request): 

+

8 return TemplateResponse(request, "in_person/eligibility.html") 

+

9 

+

10 

+

11def enrollment(request): 

+

12 return TemplateResponse(request, "in_person/enrollment.html") 

+
+ + + diff --git a/tests/coverage/z_7435199c01eb52ab___init___py.html b/tests/coverage/z_7435199c01eb52ab___init___py.html new file mode 100644 index 000000000..5e8dc0dcc --- /dev/null +++ b/tests/coverage/z_7435199c01eb52ab___init___py.html @@ -0,0 +1,99 @@ + + + + + Coverage for benefits/oauth/__init__.py: 100% + + + + + +
+
+

+ Coverage for benefits/oauth/__init__.py: + 100% +

+ +

+ 0 statements   + + + + +

+

+ « prev     + ^ index     + » next +       + coverage.py v7.6.1, + created at 2024-08-13 23:09 +0000 +

+ +
+
+
+
+ + + diff --git a/tests/coverage/z_7435199c01eb52ab_analytics_py.html b/tests/coverage/z_7435199c01eb52ab_analytics_py.html new file mode 100644 index 000000000..b62ab0849 --- /dev/null +++ b/tests/coverage/z_7435199c01eb52ab_analytics_py.html @@ -0,0 +1,190 @@ + + + + + Coverage for benefits/oauth/analytics.py: 78% + + + + + +
+
+

+ Coverage for benefits/oauth/analytics.py: + 78% +

+ +

+ 41 statements   + + + + +

+

+ « prev     + ^ index     + » next +       + coverage.py v7.6.1, + created at 2024-08-13 23:09 +0000 +

+ +
+
+
+

1""" 

+

2The oauth application: analytics implementation. 

+

3""" 

+

4 

+

5from benefits.core import analytics as core, session 

+

6 

+

7 

+

8class OAuthEvent(core.Event): 

+

9 """Base OAuth analytics event.""" 

+

10 

+

11 def __init__(self, request, event_type): 

+

12 super().__init__(request, event_type) 

+

13 verifier = session.flow(request) 

+

14 if verifier and verifier.uses_claims_verification: 

+

15 self.update_event_properties(auth_provider=verifier.claims_provider.client_name) 

+

16 

+

17 

+

18class OAuthErrorEvent(OAuthEvent): 

+

19 """Analytics event representing an error using an OAuth client.""" 

+

20 

+

21 def __init__(self, request, message, operation): 

+

22 super().__init__(request, "oauth error") 

+

23 self.update_event_properties(message=message, operation=operation) 

+

24 

+

25 

+

26class StartedSignInEvent(OAuthEvent): 

+

27 """Analytics event representing the beginning of the OAuth sign in flow.""" 

+

28 

+

29 def __init__(self, request): 

+

30 super().__init__(request, "started sign in") 

+

31 

+

32 

+

33class CanceledSignInEvent(OAuthEvent): 

+

34 """Analytics event representing the canceling of application sign in.""" 

+

35 

+

36 def __init__(self, request): 

+

37 super().__init__(request, "canceled sign in") 

+

38 

+

39 

+

40class FinishedSignInEvent(OAuthEvent): 

+

41 """Analytics event representing the end of the OAuth sign in flow.""" 

+

42 

+

43 def __init__(self, request, error=None): 

+

44 super().__init__(request, "finished sign in") 

+

45 if error is not None: 

+

46 self.update_event_properties(error_code=error) 

+

47 

+

48 

+

49class StartedSignOutEvent(OAuthEvent): 

+

50 """Analytics event representing the beginning of application sign out.""" 

+

51 

+

52 def __init__(self, request): 

+

53 super().__init__(request, "started sign out") 

+

54 

+

55 

+

56class FinishedSignOutEvent(OAuthEvent): 

+

57 """Analytics event representing the end of application sign out.""" 

+

58 

+

59 def __init__(self, request): 

+

60 super().__init__(request, "finished sign out") 

+

61 self.update_event_properties(origin=session.origin(request)) 

+

62 

+

63 

+

64def error(request, message, operation): 

+

65 """Send the "oauth error" analytics event, specifying the message and operation""" 

+

66 core.send_event(OAuthErrorEvent(request, message, operation)) 

+

67 

+

68 

+

69def started_sign_in(request): 

+

70 """Send the "started sign in" analytics event.""" 

+

71 core.send_event(StartedSignInEvent(request)) 

+

72 

+

73 

+

74def canceled_sign_in(request): 

+

75 """Send the "canceled sign in" analytics event.""" 

+

76 core.send_event(CanceledSignInEvent(request)) 

+

77 

+

78 

+

79def finished_sign_in(request, error=None): 

+

80 """Send the "finished sign in" analytics event.""" 

+

81 core.send_event(FinishedSignInEvent(request, error)) 

+

82 

+

83 

+

84def started_sign_out(request): 

+

85 """Send the "started signed out" analytics event.""" 

+

86 core.send_event(StartedSignOutEvent(request)) 

+

87 

+

88 

+

89def finished_sign_out(request): 

+

90 """Send the "finished sign out" analytics event.""" 

+

91 core.send_event(FinishedSignOutEvent(request)) 

+
+ + + diff --git a/tests/coverage/z_7435199c01eb52ab_apps_py.html b/tests/coverage/z_7435199c01eb52ab_apps_py.html new file mode 100644 index 000000000..900308194 --- /dev/null +++ b/tests/coverage/z_7435199c01eb52ab_apps_py.html @@ -0,0 +1,110 @@ + + + + + Coverage for benefits/oauth/apps.py: 100% + + + + + +
+
+

+ Coverage for benefits/oauth/apps.py: + 100% +

+ +

+ 5 statements   + + + + +

+

+ « prev     + ^ index     + » next +       + coverage.py v7.6.1, + created at 2024-08-13 23:09 +0000 +

+ +
+
+
+

1""" 

+

2The oauth application: Implements OAuth-based authentication 

+

3""" 

+

4 

+

5from django.apps import AppConfig 

+

6 

+

7 

+

8class OAuthAppConfig(AppConfig): 

+

9 name = "benefits.oauth" 

+

10 label = "oauth" 

+

11 verbose_name = "Benefits OAuth" 

+
+ + + diff --git a/tests/coverage/z_7435199c01eb52ab_client_py.html b/tests/coverage/z_7435199c01eb52ab_client_py.html new file mode 100644 index 000000000..32fe9c1bf --- /dev/null +++ b/tests/coverage/z_7435199c01eb52ab_client_py.html @@ -0,0 +1,171 @@ + + + + + Coverage for benefits/oauth/client.py: 100% + + + + + +
+
+

+ Coverage for benefits/oauth/client.py: + 100% +

+ +

+ 24 statements   + + + + +

+

+ « prev     + ^ index     + » next +       + coverage.py v7.6.1, + created at 2024-08-13 23:09 +0000 +

+ +
+
+
+

1""" 

+

2The oauth application: helpers for working with OAuth clients. 

+

3""" 

+

4 

+

5import logging 

+

6 

+

7from authlib.integrations.django_client import OAuth 

+

8 

+

9from benefits.core import models 

+

10 

+

11logger = logging.getLogger(__name__) 

+

12 

+

13oauth = OAuth() 

+

14 

+

15 

+

16def _client_kwargs(scope=None): 

+

17 """ 

+

18 Generate the OpenID Connect client_kwargs, with optional extra scope(s). 

+

19 

+

20 `scope` should be a space-separated list of scopes to add. 

+

21 """ 

+

22 scopes = ["openid", scope] if scope else ["openid"] 

+

23 return {"code_challenge_method": "S256", "scope": " ".join(scopes), "prompt": "login"} 

+

24 

+

25 

+

26def _server_metadata_url(authority): 

+

27 """ 

+

28 Generate the OpenID Connect server_metadata_url for an OAuth authority server. 

+

29 

+

30 `authority` should be a fully qualified HTTPS domain name, e.g. https://example.com. 

+

31 """ 

+

32 return f"{authority}/.well-known/openid-configuration" 

+

33 

+

34 

+

35def _authorize_params(scheme): 

+

36 if scheme is not None: 

+

37 params = {"scheme": scheme} 

+

38 else: 

+

39 params = None 

+

40 

+

41 return params 

+

42 

+

43 

+

44def _register_provider(oauth_registry: OAuth, flow: models.EnrollmentFlow): 

+

45 """ 

+

46 Register OAuth clients into the given registry, using configuration from ClaimsProvider and EnrollmentFlow models. 

+

47 

+

48 Adapted from https://stackoverflow.com/a/64174413. 

+

49 """ 

+

50 logger.debug(f"Registering OAuth client: {flow.claims_provider.client_name}") 

+

51 

+

52 client = oauth_registry.register( 

+

53 flow.claims_provider.client_name, 

+

54 client_id=flow.claims_provider.client_id, 

+

55 server_metadata_url=_server_metadata_url(flow.claims_provider.authority), 

+

56 client_kwargs=_client_kwargs(flow.claims_scope), 

+

57 authorize_params=_authorize_params(flow.claims_scheme), 

+

58 ) 

+

59 

+

60 return client 

+

61 

+

62 

+

63def create_client(oauth_registry: OAuth, flow: models.EnrollmentFlow): 

+

64 """ 

+

65 Returns an OAuth client, registering it if needed. 

+

66 """ 

+

67 client = oauth_registry.create_client(flow.claims_provider.client_name) 

+

68 

+

69 if client is None: 

+

70 client = _register_provider(oauth_registry, flow) 

+

71 

+

72 return client 

+
+ + + diff --git a/tests/coverage/z_7435199c01eb52ab_middleware_py.html b/tests/coverage/z_7435199c01eb52ab_middleware_py.html new file mode 100644 index 000000000..3fb480e83 --- /dev/null +++ b/tests/coverage/z_7435199c01eb52ab_middleware_py.html @@ -0,0 +1,139 @@ + + + + + Coverage for benefits/oauth/middleware.py: 100% + + + + + +
+
+

+ Coverage for benefits/oauth/middleware.py: + 100% +

+ +

+ 23 statements   + + + + +

+

+ « prev     + ^ index     + » next +       + coverage.py v7.6.1, + created at 2024-08-13 23:09 +0000 +

+ +
+
+
+

1import logging 

+

2 

+

3from django.shortcuts import redirect 

+

4import sentry_sdk 

+

5 

+

6from benefits.core import session 

+

7from benefits.core.middleware import FlowSessionRequired, user_error 

+

8 

+

9from . import analytics 

+

10from .redirects import ROUTE_SYSTEM_ERROR 

+

11 

+

12 

+

13logger = logging.getLogger(__name__) 

+

14 

+

15 

+

16class FlowUsesClaimsVerificationSessionRequired(FlowSessionRequired): 

+

17 """Middleware raises an exception for sessions lacking an enrollment flow that uses claims verification.""" 

+

18 

+

19 def process_request(self, request): 

+

20 result = super().process_request(request) 

+

21 if result: 

+

22 # from the base middleware class, the session didn't have an enrollment flow 

+

23 return result 

+

24 

+

25 flow = session.flow(request) 

+

26 

+

27 if flow.uses_claims_verification: 

+

28 # all good, the chosen flow is configured correctly 

+

29 return None 

+

30 elif not (flow.eligibility_api_url or flow.eligibility_form_class): 

+

31 # the chosen flow doesn't have Eligibility API config OR claims provider config 

+

32 # this is likely a misconfiguration on the backend, not a user error 

+

33 message = f"Flow with no API or claims config: {flow.name} (id={flow.id})" 

+

34 analytics.error(request, message=message, operation=request.path) 

+

35 sentry_sdk.capture_exception(Exception(message)) 

+

36 return redirect(ROUTE_SYSTEM_ERROR) 

+

37 else: 

+

38 # the chosen flow was for Eligibility API 

+

39 logger.debug("Session not configured with enrollment flow that uses claims verification") 

+

40 return user_error(request) 

+
+ + + diff --git a/tests/coverage/z_7435199c01eb52ab_redirects_py.html b/tests/coverage/z_7435199c01eb52ab_redirects_py.html new file mode 100644 index 000000000..77c1a1dfc --- /dev/null +++ b/tests/coverage/z_7435199c01eb52ab_redirects_py.html @@ -0,0 +1,142 @@ + + + + + Coverage for benefits/oauth/redirects.py: 100% + + + + + +
+
+

+ Coverage for benefits/oauth/redirects.py: + 100% +

+ +

+ 22 statements   + + + + +

+

+ « prev     + ^ index     + » next +       + coverage.py v7.6.1, + created at 2024-08-13 23:09 +0000 +

+ +
+
+
+

1from django.shortcuts import redirect 

+

2from django.utils.http import urlencode 

+

3 

+

4import sentry_sdk 

+

5 

+

6from . import analytics 

+

7 

+

8ROUTE_SYSTEM_ERROR = "oauth:system-error" 

+

9 

+

10 

+

11def deauthorize_redirect(request, oauth_client, token, redirect_uri): 

+

12 """Helper implements OIDC signout via the `end_session_endpoint`.""" 

+

13 

+

14 # Authlib has not yet implemented `end_session_endpoint` as the OIDC Session Management 1.0 spec is still in draft 

+

15 # See https://github.com/lepture/authlib/issues/331#issuecomment-827295954 for more 

+

16 # 

+

17 # The implementation here was adapted from the same ticket: https://github.com/lepture/authlib/issues/331#issue-838728145 

+

18 try: 

+

19 metadata = oauth_client.load_server_metadata() 

+

20 except Exception as ex: 

+

21 analytics.error(request, message=str(ex), operation="load_server_metadata") 

+

22 sentry_sdk.capture_exception(ex) 

+

23 return redirect(ROUTE_SYSTEM_ERROR) 

+

24 

+

25 end_session_endpoint = metadata.get("end_session_endpoint") 

+

26 

+

27 params = dict(id_token_hint=token, post_logout_redirect_uri=redirect_uri) 

+

28 encoded_params = urlencode(params) 

+

29 end_session_url = f"{end_session_endpoint}?{encoded_params}" 

+

30 

+

31 return redirect(end_session_url) 

+

32 

+

33 

+

34def generate_redirect_uri(request, redirect_path): 

+

35 redirect_uri = str(request.build_absolute_uri(redirect_path)).lower() 

+

36 

+

37 # this is a temporary hack to ensure redirect URIs are HTTPS when the app is deployed 

+

38 # see https://github.com/cal-itp/benefits/issues/442 for more context 

+

39 # this follow-up is needed while we address the hosting architecture 

+

40 if not redirect_uri.startswith("http://localhost"): 

+

41 redirect_uri = redirect_uri.replace("http://", "https://") 

+

42 

+

43 return redirect_uri 

+
+ + + diff --git a/tests/coverage/z_7435199c01eb52ab_urls_py.html b/tests/coverage/z_7435199c01eb52ab_urls_py.html new file mode 100644 index 000000000..664be5623 --- /dev/null +++ b/tests/coverage/z_7435199c01eb52ab_urls_py.html @@ -0,0 +1,114 @@ + + + + + Coverage for benefits/oauth/urls.py: 100% + + + + + +
+
+

+ Coverage for benefits/oauth/urls.py: + 100% +

+ +

+ 4 statements   + + + + +

+

+ « prev     + ^ index     + » next +       + coverage.py v7.6.1, + created at 2024-08-13 23:09 +0000 +

+ +
+
+
+

1from django.urls import path 

+

2 

+

3from . import views 

+

4 

+

5 

+

6app_name = "oauth" 

+

7urlpatterns = [ 

+

8 # /oauth 

+

9 path("login", views.login, name="login"), 

+

10 path("authorize", views.authorize, name="authorize"), 

+

11 path("cancel", views.cancel, name="cancel"), 

+

12 path("logout", views.logout, name="logout"), 

+

13 path("post_logout", views.post_logout, name="post_logout"), 

+

14 path("error", views.system_error, name="system-error"), 

+

15] 

+
+ + + diff --git a/tests/coverage/z_7435199c01eb52ab_views_py.html b/tests/coverage/z_7435199c01eb52ab_views_py.html new file mode 100644 index 000000000..72bda6bde --- /dev/null +++ b/tests/coverage/z_7435199c01eb52ab_views_py.html @@ -0,0 +1,314 @@ + + + + + Coverage for benefits/oauth/views.py: 98% + + + + + +
+
+

+ Coverage for benefits/oauth/views.py: + 98% +

+ +

+ 125 statements   + + + + +

+

+ « prev     + ^ index     + » next +       + coverage.py v7.6.1, + created at 2024-08-13 23:09 +0000 +

+ +
+
+
+

1import logging 

+

2 

+

3from django.shortcuts import redirect 

+

4from django.template.response import TemplateResponse 

+

5from django.urls import reverse 

+

6from django.utils.decorators import decorator_from_middleware 

+

7import sentry_sdk 

+

8 

+

9from benefits.core import models, session 

+

10from benefits.core.middleware import AgencySessionRequired 

+

11from . import analytics, redirects 

+

12from .client import oauth, create_client 

+

13from .middleware import FlowUsesClaimsVerificationSessionRequired 

+

14 

+

15 

+

16logger = logging.getLogger(__name__) 

+

17 

+

18 

+

19ROUTE_AUTH = "oauth:authorize" 

+

20ROUTE_CONFIRM = "eligibility:confirm" 

+

21ROUTE_UNVERIFIED = "eligibility:unverified" 

+

22ROUTE_POST_LOGOUT = "oauth:post_logout" 

+

23 

+

24TEMPLATE_SYSTEM_ERROR = "oauth/system_error.html" 

+

25 

+

26 

+

27def _oauth_client_or_error_redirect(request, flow: models.EnrollmentFlow): 

+

28 """Calls `benefits.oauth.client.create_client()`. 

+

29 

+

30 If a client is created successfully, return it; Otherwise, return a redirect response to the `oauth:system-error` route. 

+

31 """ 

+

32 

+

33 oauth_client = None 

+

34 exception = None 

+

35 

+

36 try: 

+

37 oauth_client = create_client(oauth, flow) 

+

38 except Exception as ex: 

+

39 exception = ex 

+

40 

+

41 if not oauth_client and not exception: 

+

42 exception = Exception(f"oauth_client not registered: {flow.claims_provider.client_name}") 

+

43 

+

44 if exception: 

+

45 analytics.error(request, message=str(exception), operation="init") 

+

46 sentry_sdk.capture_exception(exception) 

+

47 return redirect(redirects.ROUTE_SYSTEM_ERROR) 

+

48 

+

49 return oauth_client 

+

50 

+

51 

+

52@decorator_from_middleware(FlowUsesClaimsVerificationSessionRequired) 

+

53def login(request): 

+

54 """View implementing OIDC authorize_redirect.""" 

+

55 flow = session.flow(request) 

+

56 

+

57 oauth_client_result = _oauth_client_or_error_redirect(request, flow) 

+

58 

+

59 if hasattr(oauth_client_result, "authorize_redirect"): 

+

60 # this looks like an oauth_client since it has the method we need 

+

61 oauth_client = oauth_client_result 

+

62 else: 

+

63 # this does not look like an oauth_client, it's an error redirect 

+

64 return oauth_client_result 

+

65 

+

66 route = reverse(ROUTE_AUTH) 

+

67 redirect_uri = redirects.generate_redirect_uri(request, route) 

+

68 

+

69 logger.debug(f"OAuth authorize_redirect with redirect_uri: {redirect_uri}") 

+

70 

+

71 analytics.started_sign_in(request) 

+

72 exception = None 

+

73 result = None 

+

74 

+

75 try: 

+

76 result = oauth_client.authorize_redirect(request, redirect_uri) 

+

77 except Exception as ex: 

+

78 exception = ex 

+

79 

+

80 if result and result.status_code >= 400: 

+

81 exception = Exception(f"authorize_redirect error response [{result.status_code}]: {result.content.decode()}") 

+

82 elif result is None: 

+

83 exception = Exception("authorize_redirect returned None") 

+

84 

+

85 if exception: 

+

86 analytics.error(request, message=str(exception), operation="authorize_redirect") 

+

87 sentry_sdk.capture_exception(exception) 

+

88 result = redirect(redirects.ROUTE_SYSTEM_ERROR) 

+

89 

+

90 return result 

+

91 

+

92 

+

93@decorator_from_middleware(FlowUsesClaimsVerificationSessionRequired) 

+

94def authorize(request): 

+

95 """View implementing OIDC token authorization.""" 

+

96 flow = session.flow(request) 

+

97 

+

98 oauth_client_result = _oauth_client_or_error_redirect(request, flow) 

+

99 

+

100 if hasattr(oauth_client_result, "authorize_access_token"): 

+

101 # this looks like an oauth_client since it has the method we need 

+

102 oauth_client = oauth_client_result 

+

103 else: 

+

104 # this does not look like an oauth_client, it's an error redirect 

+

105 return oauth_client_result 

+

106 

+

107 logger.debug("Attempting to authorize OAuth access token") 

+

108 token = None 

+

109 exception = None 

+

110 

+

111 try: 

+

112 token = oauth_client.authorize_access_token(request) 

+

113 except Exception as ex: 

+

114 exception = ex 

+

115 

+

116 if token is None: 

+

117 logger.warning("Could not authorize OAuth access token") 

+

118 exception = Exception("oauth_client.authorize_access_token returned None") 

+

119 

+

120 if exception: 

+

121 analytics.error(request, message=str(exception), operation="authorize_access_token") 

+

122 sentry_sdk.capture_exception(exception) 

+

123 return redirect(redirects.ROUTE_SYSTEM_ERROR) 

+

124 

+

125 logger.debug("OAuth access token authorized") 

+

126 

+

127 # We store the id_token in the user's session. This is the minimal amount of information needed later to log the user out. 

+

128 id_token = token["id_token"] 

+

129 

+

130 # We store the returned claim in case it can be used later in eligibility verification. 

+

131 flow_claim = flow.claims_claim 

+

132 stored_claim = None 

+

133 

+

134 error_claim = None 

+

135 

+

136 if flow_claim: 136 ↛ 151line 136 didn't jump to line 151 because the condition on line 136 was always true

+

137 userinfo = token.get("userinfo") 

+

138 

+

139 if userinfo: 

+

140 claim_value = userinfo.get(flow_claim) 

+

141 # the claim comes back in userinfo like { "claim": "1" | "0" } 

+

142 claim_value = int(claim_value) if claim_value else None 

+

143 if claim_value is None: 

+

144 logger.warning(f"userinfo did not contain: {flow_claim}") 

+

145 elif claim_value == 1: 

+

146 # if userinfo contains our claim and the flag is 1 (true), store the *claim* 

+

147 stored_claim = flow_claim 

+

148 elif claim_value >= 10: 

+

149 error_claim = claim_value 

+

150 

+

151 session.update(request, oauth_token=id_token, oauth_claim=stored_claim) 

+

152 analytics.finished_sign_in(request, error=error_claim) 

+

153 

+

154 return redirect(ROUTE_CONFIRM) 

+

155 

+

156 

+

157@decorator_from_middleware(FlowUsesClaimsVerificationSessionRequired) 

+

158def cancel(request): 

+

159 """View implementing cancellation of OIDC authorization.""" 

+

160 

+

161 analytics.canceled_sign_in(request) 

+

162 

+

163 return redirect(ROUTE_UNVERIFIED) 

+

164 

+

165 

+

166@decorator_from_middleware(FlowUsesClaimsVerificationSessionRequired) 

+

167def logout(request): 

+

168 """View implementing OIDC and application sign out.""" 

+

169 flow = session.flow(request) 

+

170 

+

171 oauth_client_result = _oauth_client_or_error_redirect(request, flow) 

+

172 

+

173 if hasattr(oauth_client_result, "load_server_metadata"): 173 ↛ 179line 173 didn't jump to line 179 because the condition on line 173 was always true

+

174 # this looks like an oauth_client since it has the method we need 

+

175 # (called in redirects.deauthorize_redirect) 

+

176 oauth_client = oauth_client_result 

+

177 else: 

+

178 # this does not look like an oauth_client, it's an error redirect 

+

179 return oauth_client_result 

+

180 

+

181 analytics.started_sign_out(request) 

+

182 

+

183 # overwrite the oauth session token, the user is signed out of the app 

+

184 token = session.oauth_token(request) 

+

185 session.logout(request) 

+

186 

+

187 route = reverse(ROUTE_POST_LOGOUT) 

+

188 redirect_uri = redirects.generate_redirect_uri(request, route) 

+

189 

+

190 logger.debug(f"OAuth end_session_endpoint with redirect_uri: {redirect_uri}") 

+

191 

+

192 # send the user through the end_session_endpoint, redirecting back to 

+

193 # the post_logout route 

+

194 return redirects.deauthorize_redirect(request, oauth_client, token, redirect_uri) 

+

195 

+

196 

+

197@decorator_from_middleware(FlowUsesClaimsVerificationSessionRequired) 

+

198def post_logout(request): 

+

199 """View routes the user to their origin after sign out.""" 

+

200 

+

201 analytics.finished_sign_out(request) 

+

202 

+

203 origin = session.origin(request) 

+

204 return redirect(origin) 

+

205 

+

206 

+

207@decorator_from_middleware(AgencySessionRequired) 

+

208def system_error(request): 

+

209 """View handler for an oauth system error.""" 

+

210 

+

211 # overwrite origin so that CTA takes user to agency index 

+

212 agency = session.agency(request) 

+

213 session.update(request, origin=agency.index_url) 

+

214 

+

215 return TemplateResponse(request, TEMPLATE_SYSTEM_ERROR) 

+
+ + + diff --git a/tests/coverage/z_795c8c28b74e7b9e___init___py.html b/tests/coverage/z_795c8c28b74e7b9e___init___py.html new file mode 100644 index 000000000..86a54d94e --- /dev/null +++ b/tests/coverage/z_795c8c28b74e7b9e___init___py.html @@ -0,0 +1,109 @@ + + + + + Coverage for benefits/__init__.py: 67% + + + + + +
+
+

+ Coverage for benefits/__init__.py: + 67% +

+ +

+ 6 statements   + + + + +

+

+ « prev     + ^ index     + » next +       + coverage.py v7.6.1, + created at 2024-08-13 23:09 +0000 +

+ +
+
+
+

1from importlib.metadata import version, PackageNotFoundError 

+

2 

+

3try: 

+

4 __version__ = version("benefits") 

+

5except PackageNotFoundError: 

+

6 # package is not installed 

+

7 pass 

+

8 

+

9 

+

10VERSION = __version__ 

+
+ + + diff --git a/tests/coverage/z_795c8c28b74e7b9e_secrets_py.html b/tests/coverage/z_795c8c28b74e7b9e_secrets_py.html new file mode 100644 index 000000000..855e384c0 --- /dev/null +++ b/tests/coverage/z_795c8c28b74e7b9e_secrets_py.html @@ -0,0 +1,198 @@ + + + + + Coverage for benefits/secrets.py: 81% + + + + + +
+
+

+ Coverage for benefits/secrets.py: + 81% +

+ +

+ 48 statements   + + + + +

+

+ « prev     + ^ index     + » next +       + coverage.py v7.6.1, + created at 2024-08-13 23:09 +0000 +

+ +
+
+
+

1import logging 

+

2import os 

+

3import re 

+

4import sys 

+

5 

+

6from azure.core.exceptions import ClientAuthenticationError 

+

7from azure.identity import DefaultAzureCredential 

+

8from azure.keyvault.secrets import SecretClient 

+

9from django.conf import settings 

+

10from django.core.validators import RegexValidator 

+

11 

+

12logger = logging.getLogger(__name__) 

+

13 

+

14 

+

15KEY_VAULT_URL = "https://kv-cdt-pub-calitp-{env}-001.vault.azure.net/" 

+

16 

+

17 

+

18class SecretNameValidator(RegexValidator): 

+

19 """RegexValidator that validates a secret name. 

+

20 

+

21 Azure KeyVault currently enforces the following rules: 

+

22 

+

23 * The value must be between 1 and 127 characters long. 

+

24 * Secret names can only contain alphanumeric characters and dashes. 

+

25 

+

26 Read more about Azure KeyVault naming rules: 

+

27 https://learn.microsoft.com/en-us/azure/azure-resource-manager/management/resource-name-rules#microsoftkeyvault 

+

28 

+

29 Read more about Django validators: 

+

30 https://docs.djangoproject.com/en/5.0/ref/validators/#module-django.core.validators 

+

31 """ 

+

32 

+

33 def __init__(self, *args, **kwargs): 

+

34 kwargs["regex"] = re.compile(r"^[-a-zA-Z0-9]{1,127}$", re.ASCII) 

+

35 kwargs["message"] = ( 

+

36 "Enter a valid secret name of between 1-127 alphanumeric ASCII characters and the hyphen character only." 

+

37 ) 

+

38 super().__init__(*args, **kwargs) 

+

39 

+

40 

+

41NAME_VALIDATOR = SecretNameValidator() 

+

42 

+

43 

+

44def get_secret_by_name(secret_name, client=None): 

+

45 """Read a value from the secret store, currently Azure KeyVault. 

+

46 

+

47 When `settings.RUNTIME_ENVIRONMENT() == "local"`, reads from the environment instead. 

+

48 """ 

+

49 NAME_VALIDATOR(secret_name) 

+

50 

+

51 runtime_env = settings.RUNTIME_ENVIRONMENT() 

+

52 

+

53 if runtime_env == "local": 

+

54 logger.debug("Runtime environment is local, reading from environment instead of Azure KeyVault.") 

+

55 # environment variable names cannot contain the hyphen character 

+

56 # assume the variable name is the same but with underscores instead 

+

57 env_secret_name = secret_name.replace("-", "_") 

+

58 secret_value = os.environ.get(env_secret_name) 

+

59 # we have to replace literal newlines here with the actual newline character 

+

60 # to support local environment variables values that span multiple lines (e.g. PEM keys/certs) 

+

61 # because the VS Code Python extension doesn't support multiline environment variables 

+

62 # https://code.visualstudio.com/docs/python/environments#_environment-variables 

+

63 return secret_value.replace("\\n", "\n") 

+

64 

+

65 elif client is None: 

+

66 # construct the KeyVault URL from the runtime environment 

+

67 # see https://docs.calitp.org/benefits/deployment/infrastructure/#environments 

+

68 # and https://github.com/cal-itp/benefits/blob/main/terraform/key_vault.tf 

+

69 vault_url = KEY_VAULT_URL.format(env=runtime_env[0]) 

+

70 logger.debug(f"Configuring Azure KeyVault secrets client for: {vault_url}") 

+

71 

+

72 credential = DefaultAzureCredential() 

+

73 client = SecretClient(vault_url=vault_url, credential=credential) 

+

74 

+

75 secret_value = None 

+

76 

+

77 if client is not None: 

+

78 try: 

+

79 secret = client.get_secret(secret_name) 

+

80 secret_value = secret.value 

+

81 except ClientAuthenticationError: 

+

82 logger.error("Could not authenticate to Azure KeyVault") 

+

83 else: 

+

84 logger.error("Azure KeyVault SecretClient was not configured") 

+

85 

+

86 return secret_value 

+

87 

+

88 

+

89if __name__ == "__main__": 89 ↛ 90line 89 didn't jump to line 90 because the condition on line 89 was never true

+

90 args = sys.argv[1:] 

+

91 if len(args) < 1: 

+

92 print("Provide the name of the secret to read") 

+

93 exit(1) 

+

94 

+

95 secret_name = args[0] 

+

96 secret_value = get_secret_by_name(secret_name) 

+

97 

+

98 print(f"[{settings.RUNTIME_ENVIRONMENT()}] {secret_name}: {secret_value}") 

+

99 exit(0) 

+
+ + + diff --git a/tests/coverage/z_795c8c28b74e7b9e_sentry_py.html b/tests/coverage/z_795c8c28b74e7b9e_sentry_py.html new file mode 100644 index 000000000..794799a7d --- /dev/null +++ b/tests/coverage/z_795c8c28b74e7b9e_sentry_py.html @@ -0,0 +1,209 @@ + + + + + Coverage for benefits/sentry.py: 79% + + + + + +
+
+

+ Coverage for benefits/sentry.py: + 79% +

+ +

+ 57 statements   + + + + +

+

+ « prev     + ^ index     + » next +       + coverage.py v7.6.1, + created at 2024-08-13 23:09 +0000 +

+ +
+
+
+

1import logging 

+

2import shutil 

+

3import os 

+

4import subprocess 

+

5 

+

6from django.conf import settings 

+

7import sentry_sdk 

+

8from sentry_sdk.integrations.django import DjangoIntegration 

+

9from sentry_sdk.scrubber import EventScrubber, DEFAULT_DENYLIST 

+

10 

+

11from benefits import VERSION 

+

12 

+

13logger = logging.getLogger(__name__) 

+

14 

+

15SENTRY_CSP_REPORT_URI = None 

+

16 

+

17 

+

18def git_available(): 

+

19 return bool(shutil.which("git")) 

+

20 

+

21 

+

22# https://stackoverflow.com/a/24584384/358804 

+

23def is_git_directory(path="."): 

+

24 with open(os.devnull, "w") as dev_null: 

+

25 return subprocess.call(["git", "-C", path, "status"], stderr=dev_null, stdout=dev_null) == 0 

+

26 

+

27 

+

28# https://stackoverflow.com/a/21901260/358804 

+

29def get_git_revision_hash(): 

+

30 return subprocess.check_output(["git", "rev-parse", "HEAD"]).decode("ascii").strip() 

+

31 

+

32 

+

33def get_sha_file_path(): 

+

34 current_file = os.path.dirname(os.path.abspath(__file__)) 

+

35 return os.path.join(current_file, "..", "static", "sha.txt") 

+

36 

+

37 

+

38def get_sha_from_file(): 

+

39 sha_path = get_sha_file_path() 

+

40 if os.path.isfile(sha_path): 

+

41 with open(sha_path) as f: 

+

42 return f.read().strip() 

+

43 else: 

+

44 return None 

+

45 

+

46 

+

47def get_release() -> str: 

+

48 """Returns the first available: the SHA from Git, the value from sha.txt, or the VERSION.""" 

+

49 

+

50 if git_available() and is_git_directory(): 

+

51 return get_git_revision_hash() 

+

52 else: 

+

53 sha = get_sha_from_file() 

+

54 if sha: 

+

55 return sha 

+

56 else: 

+

57 # one of the above *should* always be available, but including this just in case 

+

58 return VERSION 

+

59 

+

60 

+

61def get_denylist(): 

+

62 # custom denylist 

+

63 denylist = DEFAULT_DENYLIST + ["sub", "name"] 

+

64 return denylist 

+

65 

+

66 

+

67def get_traces_sample_rate(): 

+

68 try: 

+

69 rate = float(os.environ.get("SENTRY_TRACES_SAMPLE_RATE", "0.0")) 

+

70 if rate < 0.0 or rate > 1.0: 

+

71 logger.warning("SENTRY_TRACES_SAMPLE_RATE was not in the range [0.0, 1.0], defaulting to 0.0") 

+

72 rate = 0.0 

+

73 else: 

+

74 logger.info(f"SENTRY_TRACES_SAMPLE_RATE set to: {rate}") 

+

75 except ValueError: 

+

76 logger.warning("SENTRY_TRACES_SAMPLE_RATE did not parse to float, defaulting to 0.0") 

+

77 rate = 0.0 

+

78 

+

79 return rate 

+

80 

+

81 

+

82def configure(): 

+

83 sentry_dsn = os.environ.get("SENTRY_DSN") 

+

84 sentry_environment = os.environ.get("SENTRY_ENVIRONMENT", settings.RUNTIME_ENVIRONMENT()) 

+

85 

+

86 if sentry_dsn: 86 ↛ 87line 86 didn't jump to line 87 because the condition on line 86 was never true

+

87 release = get_release() 

+

88 logger.info(f"Enabling Sentry for environment '{sentry_environment}', release '{release}'...") 

+

89 

+

90 # https://docs.sentry.io/platforms/python/configuration/ 

+

91 sentry_sdk.init( 

+

92 dsn=sentry_dsn, 

+

93 integrations=[ 

+

94 DjangoIntegration(), 

+

95 ], 

+

96 traces_sample_rate=get_traces_sample_rate(), 

+

97 environment=sentry_environment, 

+

98 release=release, 

+

99 in_app_include=["benefits"], 

+

100 # send_default_pii must be False (the default) for a custom EventScrubber/denylist 

+

101 # https://docs.sentry.io/platforms/python/data-management/sensitive-data/#event_scrubber 

+

102 send_default_pii=False, 

+

103 event_scrubber=EventScrubber(denylist=get_denylist(), recursive=True), 

+

104 ) 

+

105 

+

106 # override the module-level variable when configuration happens, if set 

+

107 global SENTRY_CSP_REPORT_URI 

+

108 SENTRY_CSP_REPORT_URI = os.environ.get("SENTRY_REPORT_URI", "") 

+

109 else: 

+

110 logger.info("SENTRY_DSN not set, so won't send events") 

+
+ + + diff --git a/tests/coverage/z_795c8c28b74e7b9e_settings_py.html b/tests/coverage/z_795c8c28b74e7b9e_settings_py.html new file mode 100644 index 000000000..ae97827e8 --- /dev/null +++ b/tests/coverage/z_795c8c28b74e7b9e_settings_py.html @@ -0,0 +1,454 @@ + + + + + Coverage for benefits/settings.py: 90% + + + + + +
+
+

+ Coverage for benefits/settings.py: + 90% +

+ +

+ 119 statements   + + + + +

+

+ « prev     + ^ index     + » next +       + coverage.py v7.6.1, + created at 2024-08-13 23:09 +0000 +

+ +
+
+
+

1""" 

+

2Django settings for benefits project. 

+

3""" 

+

4 

+

5import os 

+

6 

+

7from django.conf import settings 

+

8 

+

9from benefits import sentry 

+

10 

+

11 

+

12def _filter_empty(ls): 

+

13 return [s for s in ls if s] 

+

14 

+

15 

+

16# Build paths inside the project like this: os.path.join(BASE_DIR, ...) 

+

17BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) 

+

18 

+

19# SECURITY WARNING: keep the secret key used in production secret! 

+

20SECRET_KEY = os.environ.get("DJANGO_SECRET_KEY", "secret") 

+

21 

+

22# SECURITY WARNING: don't run with debug turned on in production! 

+

23DEBUG = os.environ.get("DJANGO_DEBUG", "False").lower() == "true" 

+

24 

+

25ALLOWED_HOSTS = _filter_empty(os.environ.get("DJANGO_ALLOWED_HOSTS", "localhost").split(",")) 

+

26 

+

27 

+

28def RUNTIME_ENVIRONMENT(): 

+

29 """Helper calculates the current runtime environment from ALLOWED_HOSTS.""" 

+

30 

+

31 # usage of django.conf.settings.ALLOWED_HOSTS here (rather than the module variable directly) 

+

32 # is to ensure dynamic calculation, e.g. for unit tests and elsewhere this setting is needed 

+

33 env = "local" 

+

34 if "dev-benefits.calitp.org" in settings.ALLOWED_HOSTS: 

+

35 env = "dev" 

+

36 elif "test-benefits.calitp.org" in settings.ALLOWED_HOSTS: 

+

37 env = "test" 

+

38 elif "benefits.calitp.org" in settings.ALLOWED_HOSTS: 

+

39 env = "prod" 

+

40 return env 

+

41 

+

42 

+

43# Application definition 

+

44 

+

45INSTALLED_APPS = [ 

+

46 "django.contrib.admin", 

+

47 "django.contrib.auth", 

+

48 "django.contrib.contenttypes", 

+

49 "django.contrib.messages", 

+

50 "django.contrib.sessions", 

+

51 "django.contrib.staticfiles", 

+

52 "adminsortable2", 

+

53 "django_google_sso", 

+

54 "benefits.core", 

+

55 "benefits.enrollment", 

+

56 "benefits.eligibility", 

+

57 "benefits.oauth", 

+

58 "benefits.in_person", 

+

59] 

+

60 

+

61GOOGLE_SSO_CLIENT_ID = os.environ.get("GOOGLE_SSO_CLIENT_ID", "secret") 

+

62GOOGLE_SSO_PROJECT_ID = os.environ.get("GOOGLE_SSO_PROJECT_ID", "benefits-admin") 

+

63GOOGLE_SSO_CLIENT_SECRET = os.environ.get("GOOGLE_SSO_CLIENT_SECRET", "secret") 

+

64GOOGLE_SSO_ALLOWABLE_DOMAINS = _filter_empty(os.environ.get("GOOGLE_SSO_ALLOWABLE_DOMAINS", "compiler.la").split(",")) 

+

65GOOGLE_SSO_STAFF_LIST = _filter_empty(os.environ.get("GOOGLE_SSO_STAFF_LIST", "").split(",")) 

+

66GOOGLE_SSO_SUPERUSER_LIST = _filter_empty(os.environ.get("GOOGLE_SSO_SUPERUSER_LIST", "").split(",")) 

+

67GOOGLE_SSO_LOGO_URL = "/static/img/icon/google_sso_logo.svg" 

+

68GOOGLE_SSO_SAVE_ACCESS_TOKEN = True 

+

69GOOGLE_SSO_PRE_LOGIN_CALLBACK = "benefits.core.admin.pre_login_user" 

+

70GOOGLE_SSO_SCOPES = [ 

+

71 "openid", 

+

72 "https://www.googleapis.com/auth/userinfo.email", 

+

73 "https://www.googleapis.com/auth/userinfo.profile", 

+

74] 

+

75 

+

76MIDDLEWARE = [ 

+

77 "django.middleware.security.SecurityMiddleware", 

+

78 "django.contrib.sessions.middleware.SessionMiddleware", 

+

79 "django.contrib.messages.middleware.MessageMiddleware", 

+

80 "django.middleware.locale.LocaleMiddleware", 

+

81 "benefits.core.middleware.Healthcheck", 

+

82 "benefits.core.middleware.HealthcheckUserAgents", 

+

83 "django.middleware.common.CommonMiddleware", 

+

84 "django.middleware.csrf.CsrfViewMiddleware", 

+

85 "django.middleware.clickjacking.XFrameOptionsMiddleware", 

+

86 "csp.middleware.CSPMiddleware", 

+

87 "benefits.core.middleware.ChangedLanguageEvent", 

+

88 "django.contrib.auth.middleware.AuthenticationMiddleware", 

+

89 "django.contrib.messages.middleware.MessageMiddleware", 

+

90] 

+

91 

+

92if DEBUG: 92 ↛ 93line 92 didn't jump to line 93 because the condition on line 92 was never true

+

93 MIDDLEWARE.append("benefits.core.middleware.DebugSession") 

+

94 

+

95HEALTHCHECK_USER_AGENTS = _filter_empty(os.environ.get("HEALTHCHECK_USER_AGENTS", "").split(",")) 

+

96 

+

97CSRF_COOKIE_AGE = None 

+

98CSRF_COOKIE_SAMESITE = "Strict" 

+

99CSRF_COOKIE_HTTPONLY = True 

+

100CSRF_TRUSTED_ORIGINS = _filter_empty(os.environ.get("DJANGO_TRUSTED_ORIGINS", "http://localhost,http://127.0.0.1").split(",")) 

+

101 

+

102# With `Strict`, the user loses their Django session between leaving our app to 

+

103# sign in with OAuth, and coming back into our app from the OAuth redirect. 

+

104# This is because `Strict` disallows our cookie being sent from an external 

+

105# domain and so the session cookie is lost. 

+

106# 

+

107# `Lax` allows the cookie to travel with the user and be sent back to us by the 

+

108# OAuth server, as long as the request is "safe" i.e. GET 

+

109SESSION_COOKIE_SAMESITE = "Lax" 

+

110SESSION_ENGINE = "django.contrib.sessions.backends.signed_cookies" 

+

111SESSION_EXPIRE_AT_BROWSER_CLOSE = True 

+

112SESSION_COOKIE_NAME = "_benefitssessionid" 

+

113 

+

114if not DEBUG: 114 ↛ 119line 114 didn't jump to line 119 because the condition on line 114 was always true

+

115 CSRF_COOKIE_SECURE = True 

+

116 CSRF_FAILURE_VIEW = "benefits.core.views.csrf_failure" 

+

117 SESSION_COOKIE_SECURE = True 

+

118 

+

119SECURE_BROWSER_XSS_FILTER = True 

+

120 

+

121# required so that cross-origin pop-ups (like the enrollment overlay) have access to parent window context 

+

122# https://github.com/cal-itp/benefits/pull/793 

+

123SECURE_CROSS_ORIGIN_OPENER_POLICY = "same-origin-allow-popups" 

+

124 

+

125# the NGINX reverse proxy sits in front of the application in deployed environments 

+

126# SSL terminates before getting to Django, and NGINX adds this header to indicate 

+

127# if the original request was secure or not 

+

128# 

+

129# See https://docs.djangoproject.com/en/5.0/ref/settings/#secure-proxy-ssl-header 

+

130if not DEBUG: 130 ↛ 133line 130 didn't jump to line 133 because the condition on line 130 was always true

+

131 SECURE_PROXY_SSL_HEADER = ("HTTP_X_FORWARDED_PROTO", "https") 

+

132 

+

133ROOT_URLCONF = "benefits.urls" 

+

134 

+

135template_ctx_processors = [ 

+

136 "django.template.context_processors.request", 

+

137 "django.contrib.auth.context_processors.auth", 

+

138 "django.contrib.messages.context_processors.messages", 

+

139 "benefits.core.context_processors.agency", 

+

140 "benefits.core.context_processors.active_agencies", 

+

141 "benefits.core.context_processors.analytics", 

+

142 "benefits.core.context_processors.authentication", 

+

143 "benefits.core.context_processors.enrollment", 

+

144 "benefits.core.context_processors.origin", 

+

145] 

+

146 

+

147if DEBUG: 147 ↛ 148line 147 didn't jump to line 148 because the condition on line 147 was never true

+

148 template_ctx_processors.extend( 

+

149 [ 

+

150 "django.template.context_processors.debug", 

+

151 "benefits.core.context_processors.debug", 

+

152 ] 

+

153 ) 

+

154 

+

155TEMPLATES = [ 

+

156 { 

+

157 "BACKEND": "django.template.backends.django.DjangoTemplates", 

+

158 "DIRS": [os.path.join(BASE_DIR, "benefits", "templates")], 

+

159 "APP_DIRS": True, 

+

160 "OPTIONS": { 

+

161 "context_processors": template_ctx_processors, 

+

162 }, 

+

163 }, 

+

164] 

+

165 

+

166WSGI_APPLICATION = "benefits.wsgi.application" 

+

167 

+

168DATABASE_DIR = os.environ.get("DJANGO_DB_DIR", BASE_DIR) 

+

169DATABASES = { 

+

170 "default": { 

+

171 "ENGINE": "django.db.backends.sqlite3", 

+

172 "NAME": os.path.join(DATABASE_DIR, os.environ.get("DJANGO_DB_FILE", "django.db")), 

+

173 } 

+

174} 

+

175 

+

176# Password validation 

+

177 

+

178AUTH_PASSWORD_VALIDATORS = [ 

+

179 { 

+

180 "NAME": "django.contrib.auth.password_validation.UserAttributeSimilarityValidator", 

+

181 }, 

+

182 { 

+

183 "NAME": "django.contrib.auth.password_validation.MinimumLengthValidator", 

+

184 }, 

+

185 { 

+

186 "NAME": "django.contrib.auth.password_validation.CommonPasswordValidator", 

+

187 }, 

+

188 { 

+

189 "NAME": "django.contrib.auth.password_validation.NumericPasswordValidator", 

+

190 }, 

+

191] 

+

192 

+

193 

+

194# Internationalization 

+

195 

+

196LANGUAGE_CODE = "en" 

+

197 

+

198LANGUAGE_COOKIE_HTTPONLY = True 

+

199LANGUAGE_COOKIE_SAMESITE = "Strict" 

+

200LANGUAGE_COOKIE_SECURE = True 

+

201 

+

202LANGUAGES = [("en", "English"), ("es", "Español")] 

+

203 

+

204LOCALE_PATHS = [os.path.join(BASE_DIR, "benefits", "locale")] 

+

205 

+

206USE_I18N = True 

+

207 

+

208# See https://docs.djangoproject.com/en/5.0/ref/settings/#std-setting-TIME_ZONE 

+

209# > Note that this isn’t necessarily the time zone of the server. 

+

210# > When USE_TZ is True, this is the default time zone that Django will use to display datetimes in templates 

+

211# > and to interpret datetimes entered in forms. 

+

212TIME_ZONE = "America/Los_Angeles" 

+

213USE_TZ = True 

+

214 

+

215# https://docs.djangoproject.com/en/5.0/topics/i18n/formatting/#creating-custom-format-files 

+

216FORMAT_MODULE_PATH = [ 

+

217 "benefits.locale", 

+

218] 

+

219 

+

220# Static files (CSS, JavaScript, Images) 

+

221 

+

222STATIC_URL = "/static/" 

+

223STATICFILES_DIRS = [os.path.join(BASE_DIR, "benefits", "static")] 

+

224# use Manifest Static Files Storage by default 

+

225STORAGES = { 

+

226 "staticfiles": { 

+

227 "BACKEND": os.environ.get( 

+

228 "DJANGO_STATICFILES_STORAGE", "django.contrib.staticfiles.storage.ManifestStaticFilesStorage" 

+

229 ) 

+

230 } 

+

231} 

+

232STATIC_ROOT = os.path.join(BASE_DIR, "static") 

+

233 

+

234# Logging configuration 

+

235LOG_LEVEL = os.environ.get("DJANGO_LOG_LEVEL", "DEBUG" if DEBUG else "WARNING") 

+

236LOGGING = { 

+

237 "version": 1, 

+

238 "disable_existing_loggers": False, 

+

239 "formatters": { 

+

240 "default": { 

+

241 "format": "[{asctime}] {levelname} {name}:{lineno} {message}", 

+

242 "datefmt": "%d/%b/%Y %H:%M:%S", 

+

243 "style": "{", 

+

244 }, 

+

245 }, 

+

246 "handlers": { 

+

247 "console": { 

+

248 "class": "logging.StreamHandler", 

+

249 "formatter": "default", 

+

250 }, 

+

251 }, 

+

252 "root": { 

+

253 "handlers": ["console"], 

+

254 "level": LOG_LEVEL, 

+

255 }, 

+

256 "loggers": { 

+

257 "django": { 

+

258 "handlers": ["console"], 

+

259 "propagate": False, 

+

260 }, 

+

261 }, 

+

262} 

+

263 

+

264sentry.configure() 

+

265 

+

266# Analytics configuration 

+

267 

+

268ANALYTICS_KEY = os.environ.get("ANALYTICS_KEY") 

+

269 

+

270# reCAPTCHA configuration 

+

271 

+

272RECAPTCHA_API_URL = os.environ.get("DJANGO_RECAPTCHA_API_URL", "https://www.google.com/recaptcha/api.js") 

+

273RECAPTCHA_SITE_KEY = os.environ.get("DJANGO_RECAPTCHA_SITE_KEY") 

+

274RECAPTCHA_API_KEY_URL = f"{RECAPTCHA_API_URL}?render={RECAPTCHA_SITE_KEY}" 

+

275RECAPTCHA_SECRET_KEY = os.environ.get("DJANGO_RECAPTCHA_SECRET_KEY") 

+

276RECAPTCHA_VERIFY_URL = os.environ.get("DJANGO_RECAPTCHA_VERIFY_URL", "https://www.google.com/recaptcha/api/siteverify") 

+

277RECAPTCHA_ENABLED = all((RECAPTCHA_API_URL, RECAPTCHA_SITE_KEY, RECAPTCHA_SECRET_KEY, RECAPTCHA_VERIFY_URL)) 

+

278 

+

279# Content Security Policy 

+

280# Configuration docs at https://django-csp.readthedocs.io/en/latest/configuration.html 

+

281 

+

282# In particular, note that the inner single-quotes are required! 

+

283# https://django-csp.readthedocs.io/en/latest/configuration.html#policy-settings 

+

284 

+

285CSP_BASE_URI = ["'none'"] 

+

286 

+

287CSP_DEFAULT_SRC = ["'self'"] 

+

288 

+

289CSP_CONNECT_SRC = ["'self'", "https://api.amplitude.com/"] 

+

290env_connect_src = _filter_empty(os.environ.get("DJANGO_CSP_CONNECT_SRC", "").split(",")) 

+

291CSP_CONNECT_SRC.extend(env_connect_src) 

+

292 

+

293CSP_FONT_SRC = ["'self'", "https://california.azureedge.net/", "https://fonts.gstatic.com/"] 

+

294env_font_src = _filter_empty(os.environ.get("DJANGO_CSP_FONT_SRC", "").split(",")) 

+

295CSP_FONT_SRC.extend(env_font_src) 

+

296 

+

297CSP_FRAME_ANCESTORS = ["'none'"] 

+

298 

+

299CSP_FRAME_SRC = ["'none'"] 

+

300env_frame_src = _filter_empty(os.environ.get("DJANGO_CSP_FRAME_SRC", "").split(",")) 

+

301if RECAPTCHA_ENABLED: 301 ↛ 302line 301 didn't jump to line 302 because the condition on line 301 was never true

+

302 env_frame_src.append("https://www.google.com") 

+

303if len(env_frame_src) > 0: 303 ↛ 304line 303 didn't jump to line 304 because the condition on line 303 was never true

+

304 CSP_FRAME_SRC = env_frame_src 

+

305 

+

306CSP_IMG_SRC = [ 

+

307 "'self'", 

+

308 "data:", 

+

309 "*.googleusercontent.com", 

+

310] 

+

311 

+

312# Configuring strict Content Security Policy 

+

313# https://django-csp.readthedocs.io/en/latest/nonce.html 

+

314CSP_INCLUDE_NONCE_IN = ["script-src"] 

+

315 

+

316CSP_OBJECT_SRC = ["'none'"] 

+

317 

+

318if sentry.SENTRY_CSP_REPORT_URI: 318 ↛ 319line 318 didn't jump to line 319 because the condition on line 318 was never true

+

319 CSP_REPORT_URI = [sentry.SENTRY_CSP_REPORT_URI] 

+

320 

+

321CSP_SCRIPT_SRC = [ 

+

322 "'self'", 

+

323 "https://cdn.amplitude.com/libs/", 

+

324 "https://cdn.jsdelivr.net/", 

+

325 "*.littlepay.com", 

+

326 "https://code.jquery.com/jquery-3.6.0.min.js", 

+

327] 

+

328env_script_src = _filter_empty(os.environ.get("DJANGO_CSP_SCRIPT_SRC", "").split(",")) 

+

329CSP_SCRIPT_SRC.extend(env_script_src) 

+

330if RECAPTCHA_ENABLED: 330 ↛ 331line 330 didn't jump to line 331 because the condition on line 330 was never true

+

331 CSP_SCRIPT_SRC.extend(["https://www.google.com/recaptcha/", "https://www.gstatic.com/recaptcha/releases/"]) 

+

332 

+

333CSP_STYLE_SRC = [ 

+

334 "'self'", 

+

335 "'unsafe-inline'", 

+

336 "https://california.azureedge.net/", 

+

337 "https://fonts.googleapis.com/css", 

+

338] 

+

339env_style_src = _filter_empty(os.environ.get("DJANGO_CSP_STYLE_SRC", "").split(",")) 

+

340CSP_STYLE_SRC.extend(env_style_src) 

+

341 

+

342# Configuration for requests 

+

343# https://requests.readthedocs.io/en/latest/user/advanced/#timeouts 

+

344 

+

345try: 

+

346 REQUESTS_CONNECT_TIMEOUT = int(os.environ.get("REQUESTS_CONNECT_TIMEOUT")) 

+

347except Exception: 

+

348 REQUESTS_CONNECT_TIMEOUT = 3 

+

349 

+

350try: 

+

351 REQUESTS_READ_TIMEOUT = int(os.environ.get("REQUESTS_READ_TIMEOUT")) 

+

352except Exception: 

+

353 REQUESTS_READ_TIMEOUT = 20 

+

354 

+

355REQUESTS_TIMEOUT = (REQUESTS_CONNECT_TIMEOUT, REQUESTS_READ_TIMEOUT) 

+
+ + + diff --git a/tests/coverage/z_795c8c28b74e7b9e_urls_py.html b/tests/coverage/z_795c8c28b74e7b9e_urls_py.html new file mode 100644 index 000000000..c0ecb4adc --- /dev/null +++ b/tests/coverage/z_795c8c28b74e7b9e_urls_py.html @@ -0,0 +1,152 @@ + + + + + Coverage for benefits/urls.py: 67% + + + + + +
+
+

+ Coverage for benefits/urls.py: + 67% +

+ +

+ 22 statements   + + + + +

+

+ « prev     + ^ index     + » next +       + coverage.py v7.6.1, + created at 2024-08-13 23:09 +0000 +

+ +
+
+
+

1""" 

+

2benefits URL Configuration 

+

3 

+

4The `urlpatterns` list routes URLs to views. For more information please see: 

+

5 https://docs.djangoproject.com/en/5.0/topics/http/urls/ 

+

6""" 

+

7 

+

8import logging 

+

9 

+

10from django.conf import settings 

+

11from django.contrib import admin 

+

12from django.http import HttpResponse 

+

13from django.urls import include, path 

+

14 

+

15logger = logging.getLogger(__name__) 

+

16 

+

17handler400 = "benefits.core.views.bad_request" 

+

18handler403 = "benefits.core.views.bad_request" 

+

19handler404 = "benefits.core.views.page_not_found" 

+

20handler500 = "benefits.core.views.server_error" 

+

21 

+

22urlpatterns = [ 

+

23 path("", include("benefits.core.urls")), 

+

24 path("eligibility/", include("benefits.eligibility.urls")), 

+

25 path("enrollment/", include("benefits.enrollment.urls")), 

+

26 path("i18n/", include("django.conf.urls.i18n")), 

+

27 path("oauth/", include("benefits.oauth.urls")), 

+

28 path("in_person/", include("benefits.in_person.urls")), 

+

29] 

+

30 

+

31if settings.DEBUG: 31 ↛ 35line 31 didn't jump to line 35 because the condition on line 31 was never true

+

32 # based on 

+

33 # https://docs.sentry.io/platforms/python/guides/django/#verify 

+

34 

+

35 def trigger_error(request): 

+

36 raise RuntimeError("Test error") 

+

37 

+

38 urlpatterns.append(path("error/", trigger_error)) 

+

39 

+

40 # simple route to read a pre-defined "secret" 

+

41 # this "secret" does not contain sensitive information 

+

42 # and is only configured in the dev environment for testing/debugging 

+

43 

+

44 def test_secret(request): 

+

45 from benefits.secrets import get_secret_by_name 

+

46 

+

47 return HttpResponse(get_secret_by_name("testsecret")) 

+

48 

+

49 urlpatterns.append(path("testsecret/", test_secret)) 

+

50 

+

51logger.debug("Register admin urls") 

+

52urlpatterns.append(path("admin/", admin.site.urls)) 

+

53urlpatterns.append(path("google_sso/", include("django_google_sso.urls", namespace="django_google_sso"))) 

+
+ + + diff --git a/tests/coverage/z_795c8c28b74e7b9e_wsgi_py.html b/tests/coverage/z_795c8c28b74e7b9e_wsgi_py.html new file mode 100644 index 000000000..7010bb9f0 --- /dev/null +++ b/tests/coverage/z_795c8c28b74e7b9e_wsgi_py.html @@ -0,0 +1,116 @@ + + + + + Coverage for benefits/wsgi.py: 0% + + + + + +
+
+

+ Coverage for benefits/wsgi.py: + 0% +

+ +

+ 4 statements   + + + + +

+

+ « prev     + ^ index     + » next +       + coverage.py v7.6.1, + created at 2024-08-13 23:09 +0000 +

+ +
+
+
+

1""" 

+

2WSGI config for benefits project. 

+

3 

+

4It exposes the WSGI callable as a module-level variable named ``application``. 

+

5 

+

6For more information on this file, see 

+

7https://docs.djangoproject.com/en/3.0/howto/deployment/wsgi/ 

+

8""" 

+

9 

+

10import os 

+

11 

+

12from django.core.wsgi import get_wsgi_application 

+

13 

+

14 

+

15os.environ.setdefault("DJANGO_SETTINGS_MODULE", "benefits.settings") 

+

16 

+

17application = get_wsgi_application() 

+
+ + + diff --git a/tests/coverage/z_8c0b35f1ea7ee6af___init___py.html b/tests/coverage/z_8c0b35f1ea7ee6af___init___py.html new file mode 100644 index 000000000..84fa29241 --- /dev/null +++ b/tests/coverage/z_8c0b35f1ea7ee6af___init___py.html @@ -0,0 +1,99 @@ + + + + + Coverage for benefits/core/__init__.py: 100% + + + + + +
+
+

+ Coverage for benefits/core/__init__.py: + 100% +

+ +

+ 0 statements   + + + + +

+

+ « prev     + ^ index     + » next +       + coverage.py v7.6.1, + created at 2024-08-13 23:09 +0000 +

+ +
+
+
+
+ + + diff --git a/tests/coverage/z_8c0b35f1ea7ee6af_admin_py.html b/tests/coverage/z_8c0b35f1ea7ee6af_admin_py.html new file mode 100644 index 000000000..386911625 --- /dev/null +++ b/tests/coverage/z_8c0b35f1ea7ee6af_admin_py.html @@ -0,0 +1,269 @@ + + + + + Coverage for benefits/core/admin.py: 100% + + + + + +
+
+

+ Coverage for benefits/core/admin.py: + 100% +

+ +

+ 33 statements   + + + + +

+

+ « prev     + ^ index     + » next +       + coverage.py v7.6.1, + created at 2024-08-13 23:09 +0000 +

+ +
+
+
+

1""" 

+

2The core application: Admin interface configuration. 

+

3""" 

+

4 

+

5import logging 

+

6import requests 

+

7 

+

8from adminsortable2.admin import SortableAdminMixin 

+

9from django.conf import settings 

+

10from django.contrib import admin 

+

11from django.contrib.auth.models import Group 

+

12from . import models 

+

13 

+

14logger = logging.getLogger(__name__) 

+

15 

+

16 

+

17GOOGLE_USER_INFO_URL = "https://www.googleapis.com/oauth2/v3/userinfo" 

+

18STAFF_GROUP_NAME = "Cal-ITP" 

+

19 

+

20logger.debug("Register models with admin site") 

+

21admin.site.register(models.PemData) 

+

22 

+

23 

+

24@admin.register(models.ClaimsProvider) 

+

25class ClaimsProviderAdmin(admin.ModelAdmin): # pragma: no cover 

+

26 def get_exclude(self, request, obj=None): 

+

27 if not request.user.is_superuser: 

+

28 return ["client_id_secret_name"] 

+

29 else: 

+

30 return super().get_exclude(request, obj) 

+

31 

+

32 def get_readonly_fields(self, request, obj=None): 

+

33 if not request.user.is_superuser: 

+

34 return [ 

+

35 "sign_out_button_template", 

+

36 "sign_out_link_template", 

+

37 "authority", 

+

38 "scheme", 

+

39 ] 

+

40 else: 

+

41 return super().get_readonly_fields(request, obj) 

+

42 

+

43 

+

44@admin.register(models.EligibilityType) 

+

45class EligibilityTypeAdmin(admin.ModelAdmin): # pragma: no cover 

+

46 def get_exclude(self, request, obj=None): 

+

47 if not request.user.is_superuser: 

+

48 return [] 

+

49 else: 

+

50 return super().get_exclude(request, obj) 

+

51 

+

52 def get_readonly_fields(self, request, obj=None): 

+

53 if not request.user.is_superuser: 

+

54 return [ 

+

55 "enrollment_index_template", 

+

56 "reenrollment_error_template", 

+

57 "enrollment_success_template", 

+

58 ] 

+

59 else: 

+

60 return super().get_readonly_fields(request, obj) 

+

61 

+

62 

+

63@admin.register(models.EnrollmentFlow) 

+

64class SortableEnrollmentFlowAdmin(SortableAdminMixin, admin.ModelAdmin): # pragma: no cover 

+

65 def get_exclude(self, request, obj=None): 

+

66 if not request.user.is_superuser: 

+

67 return [ 

+

68 "eligibility_api_auth_header", 

+

69 "eligibility_api_auth_key_secret_name", 

+

70 "eligibility_api_public_key", 

+

71 "eligibility_api_jwe_cek_enc", 

+

72 "eligibility_api_jwe_encryption_alg", 

+

73 "eligibility_api_jws_signing_alg", 

+

74 "eligibility_form_class", 

+

75 ] 

+

76 else: 

+

77 return super().get_exclude(request, obj) 

+

78 

+

79 def get_readonly_fields(self, request, obj=None): 

+

80 if not request.user.is_superuser: 

+

81 return [ 

+

82 "claims_provider", 

+

83 "eligibility_api_url", 

+

84 "eligibility_start_template", 

+

85 "eligibility_unverified_template", 

+

86 "help_template", 

+

87 "selection_label_template", 

+

88 "claims_scheme_override", 

+

89 ] 

+

90 else: 

+

91 return super().get_readonly_fields(request, obj) 

+

92 

+

93 

+

94@admin.register(models.TransitProcessor) 

+

95class TransitProcessorAdmin(admin.ModelAdmin): # pragma: no cover 

+

96 def get_exclude(self, request, obj=None): 

+

97 if not request.user.is_superuser: 

+

98 return [] 

+

99 else: 

+

100 return super().get_exclude(request, obj) 

+

101 

+

102 def get_readonly_fields(self, request, obj=None): 

+

103 if not request.user.is_superuser: 

+

104 return [ 

+

105 "card_tokenize_url", 

+

106 "card_tokenize_func", 

+

107 "card_tokenize_env", 

+

108 ] 

+

109 else: 

+

110 return super().get_readonly_fields(request, obj) 

+

111 

+

112 

+

113@admin.register(models.TransitAgency) 

+

114class TransitAgencyAdmin(admin.ModelAdmin): # pragma: no cover 

+

115 def get_exclude(self, request, obj=None): 

+

116 if not request.user.is_superuser: 

+

117 return [ 

+

118 "eligibility_api_private_key", 

+

119 "eligibility_api_public_key", 

+

120 "eligibility_api_jws_signing_alg", 

+

121 "transit_processor_client_id", 

+

122 "transit_processor_client_secret_name", 

+

123 "transit_processor_audience", 

+

124 ] 

+

125 else: 

+

126 return super().get_exclude(request, obj) 

+

127 

+

128 def get_readonly_fields(self, request, obj=None): 

+

129 if not request.user.is_superuser: 

+

130 return [ 

+

131 "eligibility_api_id", 

+

132 "transit_processor", 

+

133 "index_template", 

+

134 "eligibility_index_template", 

+

135 ] 

+

136 else: 

+

137 return super().get_readonly_fields(request, obj) 

+

138 

+

139 

+

140def pre_login_user(user, request): 

+

141 logger.debug(f"Running pre-login callback for user: {user.username}") 

+

142 add_google_sso_userinfo(user, request) 

+

143 add_staff_user_to_group(user, request) 

+

144 

+

145 

+

146def add_google_sso_userinfo(user, request): 

+

147 token = request.session.get("google_sso_access_token") 

+

148 if token: 

+

149 headers = { 

+

150 "Authorization": f"Bearer {token}", 

+

151 } 

+

152 

+

153 # Request Google user info to get name and email 

+

154 response = requests.get(GOOGLE_USER_INFO_URL, headers=headers, timeout=settings.REQUESTS_TIMEOUT) 

+

155 user_data = response.json() 

+

156 logger.debug(f"Updating user data from Google for user with email: {user_data['email']}") 

+

157 

+

158 user.first_name = user_data["given_name"] 

+

159 user.last_name = user_data["family_name"] 

+

160 user.username = user_data["email"] 

+

161 user.email = user_data["email"] 

+

162 user.save() 

+

163 else: 

+

164 logger.warning("google_sso_access_token not found in session.") 

+

165 

+

166 

+

167def add_staff_user_to_group(user, request): 

+

168 if user.email in settings.GOOGLE_SSO_STAFF_LIST: 

+

169 staff_group = Group.objects.get(name=STAFF_GROUP_NAME) 

+

170 user.groups.add(staff_group) 

+
+ + + diff --git a/tests/coverage/z_8c0b35f1ea7ee6af_analytics_py.html b/tests/coverage/z_8c0b35f1ea7ee6af_analytics_py.html new file mode 100644 index 000000000..ff523d5cb --- /dev/null +++ b/tests/coverage/z_8c0b35f1ea7ee6af_analytics_py.html @@ -0,0 +1,272 @@ + + + + + Coverage for benefits/core/analytics.py: 69% + + + + + +
+
+

+ Coverage for benefits/core/analytics.py: + 69% +

+ +

+ 96 statements   + + + + +

+

+ « prev     + ^ index     + » next +       + coverage.py v7.6.1, + created at 2024-08-13 23:09 +0000 +

+ +
+
+
+

1""" 

+

2The core application: analytics implementation. 

+

3""" 

+

4 

+

5import itertools 

+

6import json 

+

7import logging 

+

8import re 

+

9import time 

+

10import uuid 

+

11 

+

12from django.conf import settings 

+

13import requests 

+

14 

+

15from benefits import VERSION 

+

16from benefits.core.models import EligibilityType 

+

17from . import session 

+

18 

+

19 

+

20logger = logging.getLogger(__name__) 

+

21 

+

22 

+

23class Event: 

+

24 """Base analytics event of a given type, including attributes from request's session.""" 

+

25 

+

26 _counter = itertools.count() 

+

27 _domain_re = re.compile(r"^(?:https?:\/\/)?(?:[^@\n]+@)?(?:www\.)?([^:\/\n?]+)", re.IGNORECASE) 

+

28 

+

29 def __init__(self, request, event_type, **kwargs): 

+

30 self.app_version = VERSION 

+

31 # device_id is generated based on the user_id, and both are set explicitly (per session) 

+

32 self.device_id = session.did(request) 

+

33 self.event_properties = {} 

+

34 self.event_type = str(event_type).lower() 

+

35 self.insert_id = str(uuid.uuid4()) 

+

36 self.language = session.language(request) 

+

37 # Amplitude tracks sessions using the start time as the session_id 

+

38 self.session_id = session.start(request) 

+

39 self.time = int(time.time() * 1000) 

+

40 # Although Amplitude advises *against* setting user_id for anonymous users, here a value is set on anonymous 

+

41 # users anyway, as the users never sign-in and become de-anonymized to this app / Amplitude. 

+

42 self.user_id = session.uid(request) 

+

43 self.user_properties = {} 

+

44 self.__dict__.update(kwargs) 

+

45 

+

46 agency = session.agency(request) 

+

47 agency_name = agency.long_name if agency else None 

+

48 flow = session.flow(request) 

+

49 verifier_name = flow.name if flow else None 

+

50 eligibility_types = session.eligibility(request) 

+

51 eligibility_types = EligibilityType.get_names(eligibility_types) if eligibility_types else None 

+

52 

+

53 self.update_event_properties( 

+

54 path=request.path, 

+

55 transit_agency=agency_name, 

+

56 eligibility_types=eligibility_types, 

+

57 eligibility_verifier=verifier_name, 

+

58 ) 

+

59 

+

60 uagent = request.headers.get("user-agent") 

+

61 

+

62 ref = request.headers.get("referer") 

+

63 match = Event._domain_re.match(ref) if ref else None 

+

64 refdom = match.group(1) if match else None 

+

65 

+

66 self.update_user_properties( 

+

67 referrer=ref, 

+

68 referring_domain=refdom, 

+

69 user_agent=uagent, 

+

70 transit_agency=agency_name, 

+

71 eligibility_types=eligibility_types, 

+

72 eligibility_verifier=verifier_name, 

+

73 ) 

+

74 

+

75 # event is initialized, consume next counter 

+

76 self.event_id = next(Event._counter) 

+

77 

+

78 def __str__(self): 

+

79 return json.dumps(self.__dict__) 

+

80 

+

81 def update_event_properties(self, **kwargs): 

+

82 """Merge kwargs into the self.event_properties dict.""" 

+

83 self.event_properties.update(kwargs) 

+

84 

+

85 def update_user_properties(self, **kwargs): 

+

86 """Merge kwargs into the self.user_properties dict.""" 

+

87 self.user_properties.update(kwargs) 

+

88 

+

89 

+

90class ViewedPageEvent(Event): 

+

91 """Analytics event representing a single page view.""" 

+

92 

+

93 def __init__(self, request): 

+

94 super().__init__(request, "viewed page") 

+

95 # Add UTM codes 

+

96 utm_campaign = request.GET.get("utm_campaign") 

+

97 utm_source = request.GET.get("utm_source") 

+

98 utm_medium = request.GET.get("utm_medium") 

+

99 utm_content = request.GET.get("utm_content") 

+

100 utm_id = request.GET.get("utm_id") 

+

101 self.update_event_properties( 

+

102 utm_campaign=utm_campaign, utm_source=utm_source, utm_medium=utm_medium, utm_content=utm_content, utm_id=utm_id 

+

103 ) 

+

104 self.update_user_properties( 

+

105 utm_campaign=utm_campaign, utm_source=utm_source, utm_medium=utm_medium, utm_content=utm_content, utm_id=utm_id 

+

106 ) 

+

107 

+

108 

+

109class ChangedLanguageEvent(Event): 

+

110 """Analytics event representing a change in the app's language.""" 

+

111 

+

112 def __init__(self, request, new_lang): 

+

113 super().__init__(request, "changed language") 

+

114 self.update_event_properties(language=new_lang) 

+

115 

+

116 

+

117class Client: 

+

118 """Analytics API client""" 

+

119 

+

120 def __init__(self, api_key): 

+

121 self.api_key = api_key 

+

122 self.headers = {"Accept": "*/*", "Content-type": "application/json"} 

+

123 self.url = "https://api2.amplitude.com/2/httpapi" 

+

124 logger.debug(f"Initialize Client for {self.url}") 

+

125 

+

126 def _payload(self, events): 

+

127 if not isinstance(events, list): 

+

128 events = [events] 

+

129 return {"api_key": self.api_key, "events": [e.__dict__ for e in events]} 

+

130 

+

131 def send(self, event): 

+

132 """Send an analytics event.""" 

+

133 if not isinstance(event, Event): 133 ↛ 134line 133 didn't jump to line 134 because the condition on line 133 was never true

+

134 raise ValueError("event must be an Event instance") 

+

135 

+

136 if not self.api_key: 136 ↛ 140line 136 didn't jump to line 140 because the condition on line 136 was always true

+

137 logger.warning(f"api_key is not configured, cannot send event: {event}") 

+

138 return 

+

139 

+

140 try: 

+

141 payload = self._payload(event) 

+

142 logger.debug(f"Sending event payload: {payload}") 

+

143 

+

144 r = requests.post( 

+

145 self.url, 

+

146 headers=self.headers, 

+

147 json=payload, 

+

148 timeout=settings.REQUESTS_TIMEOUT, 

+

149 ) 

+

150 if r.status_code == 200: 

+

151 logger.debug(f"Event sent successfully: {r.json()}") 

+

152 elif r.status_code == 400: 

+

153 logger.error(f"Event request was invalid: {r.json()}") 

+

154 elif r.status_code == 413: 

+

155 logger.error(f"Event payload was too large: {r.json()}") 

+

156 elif r.status_code == 429: 

+

157 logger.error(f"Event contained too many requests for some users: {r.json()}") 

+

158 else: 

+

159 logger.error(f"Failed to send event: {r.json()}") 

+

160 

+

161 except Exception: 

+

162 logger.error(f"Failed to send event: {event}") 

+

163 

+

164 

+

165client = Client(settings.ANALYTICS_KEY) 

+

166 

+

167 

+

168def send_event(event): 

+

169 """Send an analytics event.""" 

+

170 if isinstance(event, Event): 170 ↛ 173line 170 didn't jump to line 173 because the condition on line 170 was always true

+

171 client.send(event) 

+

172 else: 

+

173 raise ValueError("event must be an Event instance") 

+
+ + + diff --git a/tests/coverage/z_8c0b35f1ea7ee6af_apps_py.html b/tests/coverage/z_8c0b35f1ea7ee6af_apps_py.html new file mode 100644 index 000000000..cc90cf018 --- /dev/null +++ b/tests/coverage/z_8c0b35f1ea7ee6af_apps_py.html @@ -0,0 +1,110 @@ + + + + + Coverage for benefits/core/apps.py: 100% + + + + + +
+
+

+ Coverage for benefits/core/apps.py: + 100% +

+ +

+ 5 statements   + + + + +

+

+ « prev     + ^ index     + » next +       + coverage.py v7.6.1, + created at 2024-08-13 23:09 +0000 +

+ +
+
+
+

1""" 

+

2The core application: Houses base templates and reusable models and components. 

+

3""" 

+

4 

+

5from django.apps import AppConfig 

+

6 

+

7 

+

8class CoreAppConfig(AppConfig): 

+

9 name = "benefits.core" 

+

10 label = "core" 

+

11 verbose_name = "Core" 

+
+ + + diff --git a/tests/coverage/z_8c0b35f1ea7ee6af_context_processors_py.html b/tests/coverage/z_8c0b35f1ea7ee6af_context_processors_py.html new file mode 100644 index 000000000..8669b25fe --- /dev/null +++ b/tests/coverage/z_8c0b35f1ea7ee6af_context_processors_py.html @@ -0,0 +1,193 @@ + + + + + Coverage for benefits/core/context_processors.py: 94% + + + + + +
+
+

+ Coverage for benefits/core/context_processors.py: + 94% +

+ +

+ 38 statements   + + + + +

+

+ « prev     + ^ index     + » next +       + coverage.py v7.6.1, + created at 2024-08-13 23:09 +0000 +

+ +
+
+
+

1""" 

+

2The core application: context processors for enriching request context data. 

+

3""" 

+

4 

+

5from django.conf import settings 

+

6 

+

7from . import models, session 

+

8 

+

9 

+

10def unique_values(original_list): 

+

11 # dict.fromkeys gets the unique values and preserves order 

+

12 return list(dict.fromkeys(original_list)) 

+

13 

+

14 

+

15def _agency_context(agency: models.TransitAgency): 

+

16 return { 

+

17 "eligibility_index_url": agency.eligibility_index_url, 

+

18 "help_templates": unique_values([f.help_template for f in agency.enrollment_flows.all() if f.help_template]), 

+

19 "info_url": agency.info_url, 

+

20 "long_name": agency.long_name, 

+

21 "phone": agency.phone, 

+

22 "short_name": agency.short_name, 

+

23 "slug": agency.slug, 

+

24 } 

+

25 

+

26 

+

27def agency(request): 

+

28 """Context processor adds some information about the active agency to the request context.""" 

+

29 agency = session.agency(request) 

+

30 

+

31 if agency is None: 

+

32 return {} 

+

33 

+

34 return {"agency": _agency_context(agency)} 

+

35 

+

36 

+

37def active_agencies(request): 

+

38 """Context processor adds some information about all active agencies to the request context.""" 

+

39 agencies = models.TransitAgency.all_active() 

+

40 

+

41 return {"active_agencies": [_agency_context(agency) for agency in agencies]} 

+

42 

+

43 

+

44def analytics(request): 

+

45 """Context processor adds some analytics information to request context.""" 

+

46 return {"analytics": {"api_key": settings.ANALYTICS_KEY, "uid": session.uid(request), "did": session.did(request)}} 

+

47 

+

48 

+

49def authentication(request): 

+

50 """Context processor adds authentication information to request context.""" 

+

51 flow = session.flow(request) 

+

52 

+

53 if flow: 

+

54 data = { 

+

55 "logged_in": session.logged_in(request), 

+

56 } 

+

57 

+

58 if flow.uses_claims_verification: 

+

59 data["sign_out_button_template"] = flow.claims_provider.sign_out_button_template 

+

60 data["sign_out_link_template"] = flow.claims_provider.sign_out_link_template 

+

61 

+

62 return {"authentication": data} 

+

63 else: 

+

64 return {} 

+

65 

+

66 

+

67def debug(request): 

+

68 """Context processor adds debug information to request context.""" 

+

69 return {"debug": session.context_dict(request)} 

+

70 

+

71 

+

72def enrollment(request): 

+

73 """Context processor adds enrollment information to request context.""" 

+

74 eligibility = session.eligibility(request) 

+

75 expiry = session.enrollment_expiry(request) 

+

76 reenrollment = session.enrollment_reenrollment(request) 

+

77 

+

78 data = { 

+

79 "expires": expiry, 

+

80 "reenrollment": reenrollment, 

+

81 "supports_expiration": eligibility.supports_expiration if eligibility else False, 

+

82 } 

+

83 

+

84 return {"enrollment": data} 

+

85 

+

86 

+

87def origin(request): 

+

88 """Context processor adds session.origin to request context.""" 

+

89 origin = session.origin(request) 

+

90 

+

91 if origin: 91 ↛ 94line 91 didn't jump to line 94 because the condition on line 91 was always true

+

92 return {"origin": origin} 

+

93 else: 

+

94 return {} 

+
+ + + diff --git a/tests/coverage/z_8c0b35f1ea7ee6af_middleware_py.html b/tests/coverage/z_8c0b35f1ea7ee6af_middleware_py.html new file mode 100644 index 000000000..2594f6ea4 --- /dev/null +++ b/tests/coverage/z_8c0b35f1ea7ee6af_middleware_py.html @@ -0,0 +1,264 @@ + + + + + Coverage for benefits/core/middleware.py: 96% + + + + + +
+
+

+ Coverage for benefits/core/middleware.py: + 96% +

+ +

+ 91 statements   + + + + +

+

+ « prev     + ^ index     + » next +       + coverage.py v7.6.1, + created at 2024-08-13 23:09 +0000 +

+ +
+
+
+

1""" 

+

2The core application: middleware definitions for request/response cycle. 

+

3""" 

+

4 

+

5import logging 

+

6 

+

7from django.conf import settings 

+

8from django.http import HttpResponse 

+

9from django.shortcuts import redirect 

+

10from django.template.response import TemplateResponse 

+

11from django.urls import reverse 

+

12from django.utils.decorators import decorator_from_middleware 

+

13from django.utils.deprecation import MiddlewareMixin 

+

14from django.views import i18n 

+

15 

+

16from . import analytics, recaptcha, session 

+

17 

+

18 

+

19logger = logging.getLogger(__name__) 

+

20 

+

21HEALTHCHECK_PATH = "/healthcheck" 

+

22ROUTE_INDEX = "core:index" 

+

23TEMPLATE_USER_ERROR = "200-user-error.html" 

+

24 

+

25 

+

26def user_error(request): 

+

27 return TemplateResponse(request, TEMPLATE_USER_ERROR) 

+

28 

+

29 

+

30class AgencySessionRequired(MiddlewareMixin): 

+

31 """Middleware raises an exception for sessions lacking an agency configuration.""" 

+

32 

+

33 def process_request(self, request): 

+

34 if session.active_agency(request): 

+

35 logger.debug("Session configured with agency") 

+

36 return None 

+

37 else: 

+

38 logger.debug("Session not configured with agency") 

+

39 return user_error(request) 

+

40 

+

41 

+

42class EligibleSessionRequired(MiddlewareMixin): 

+

43 """Middleware raises an exception for sessions lacking confirmed eligibility.""" 

+

44 

+

45 def process_request(self, request): 

+

46 if session.eligible(request): 

+

47 logger.debug("Session has confirmed eligibility") 

+

48 return None 

+

49 else: 

+

50 logger.debug("Session has no confirmed eligibility") 

+

51 return user_error(request) 

+

52 

+

53 

+

54class DebugSession(MiddlewareMixin): 

+

55 """Middleware to configure debug context in the request session.""" 

+

56 

+

57 def process_request(self, request): 

+

58 session.update(request, debug=settings.DEBUG) 

+

59 return None 

+

60 

+

61 

+

62class Healthcheck: 

+

63 """Middleware intercepts and accepts /healthcheck requests.""" 

+

64 

+

65 def __init__(self, get_response): 

+

66 self.get_response = get_response 

+

67 

+

68 def __call__(self, request): 

+

69 if request.path == HEALTHCHECK_PATH: 

+

70 return HttpResponse("Healthy", content_type="text/plain") 

+

71 return self.get_response(request) 

+

72 

+

73 

+

74class HealthcheckUserAgents(MiddlewareMixin): 

+

75 """Middleware to return healthcheck for user agents specified in HEALTHCHECK_USER_AGENTS.""" 

+

76 

+

77 def process_request(self, request): 

+

78 if hasattr(request, "META"): 78 ↛ 83line 78 didn't jump to line 83 because the condition on line 78 was always true

+

79 user_agent = request.META.get("HTTP_USER_AGENT", "") 

+

80 if user_agent in settings.HEALTHCHECK_USER_AGENTS: 

+

81 return HttpResponse("Healthy", content_type="text/plain") 

+

82 

+

83 return self.get_response(request) 

+

84 

+

85 

+

86class FlowSessionRequired(MiddlewareMixin): 

+

87 """Middleware raises an exception for sessions lacking a configured enrollment flow.""" 

+

88 

+

89 def process_request(self, request): 

+

90 if session.flow(request): 

+

91 logger.debug("Session configured with enrollment flow") 

+

92 return None 

+

93 else: 

+

94 logger.debug("Session not configured with enrollment flow") 

+

95 return user_error(request) 

+

96 

+

97 

+

98class ViewedPageEvent(MiddlewareMixin): 

+

99 """Middleware sends an analytics event for page views.""" 

+

100 

+

101 def process_response(self, request, response): 

+

102 event = analytics.ViewedPageEvent(request) 

+

103 try: 

+

104 analytics.send_event(event) 

+

105 except Exception: 

+

106 logger.warning(f"Failed to send event: {event}") 

+

107 finally: 

+

108 return response 

+

109 

+

110 

+

111pageview_decorator = decorator_from_middleware(ViewedPageEvent) 

+

112 

+

113 

+

114class ChangedLanguageEvent(MiddlewareMixin): 

+

115 """Middleware hooks into django.views.i18n.set_language to send an analytics event.""" 

+

116 

+

117 def process_view(self, request, view_func, view_args, view_kwargs): 

+

118 if view_func == i18n.set_language: 

+

119 new_lang = request.POST.get("language") 

+

120 if new_lang: 

+

121 event = analytics.ChangedLanguageEvent(request, new_lang) 

+

122 analytics.send_event(event) 

+

123 else: 

+

124 logger.warning("i18n.set_language POST without language") 

+

125 return None 

+

126 

+

127 

+

128class LoginRequired(MiddlewareMixin): 

+

129 """Middleware that checks whether a user is logged in.""" 

+

130 

+

131 def process_view(self, request, view_func, view_args, view_kwargs): 

+

132 # only require login if flow uses claims verification 

+

133 flow = session.flow(request) 

+

134 if not flow or not flow.uses_claims_verification or session.logged_in(request): 

+

135 # pass through 

+

136 return None 

+

137 

+

138 return redirect("oauth:login") 

+

139 

+

140 

+

141class RecaptchaEnabled(MiddlewareMixin): 

+

142 """Middleware configures the request with required reCAPTCHA settings.""" 

+

143 

+

144 def process_request(self, request): 

+

145 if settings.RECAPTCHA_ENABLED: 145 ↛ 146line 145 didn't jump to line 146

+

146 request.recaptcha = { 

+

147 "data_field": recaptcha.DATA_FIELD, 

+

148 "script_api": settings.RECAPTCHA_API_KEY_URL, 

+

149 "site_key": settings.RECAPTCHA_SITE_KEY, 

+

150 } 

+

151 return None 

+

152 

+

153 

+

154class IndexOrAgencyIndexOrigin(MiddlewareMixin): 

+

155 """Middleware sets the session.origin to either the core:index or core:agency_index depending on agency config.""" 

+

156 

+

157 def process_request(self, request): 

+

158 if session.active_agency(request): 

+

159 session.update(request, origin=session.agency(request).index_url) 

+

160 else: 

+

161 session.update(request, origin=reverse(ROUTE_INDEX)) 

+

162 return None 

+

163 

+

164 

+

165index_or_agencyindex_origin_decorator = decorator_from_middleware(IndexOrAgencyIndexOrigin) 

+
+ + + diff --git a/tests/coverage/z_8c0b35f1ea7ee6af_models_py.html b/tests/coverage/z_8c0b35f1ea7ee6af_models_py.html new file mode 100644 index 000000000..f7b92fe61 --- /dev/null +++ b/tests/coverage/z_8c0b35f1ea7ee6af_models_py.html @@ -0,0 +1,527 @@ + + + + + Coverage for benefits/core/models.py: 99% + + + + + +
+
+

+ Coverage for benefits/core/models.py: + 99% +

+ +

+ 220 statements   + + + + +

+

+ « prev     + ^ index     + » next +       + coverage.py v7.6.1, + created at 2024-08-13 23:09 +0000 +

+ +
+
+
+

1""" 

+

2The core application: Common model definitions. 

+

3""" 

+

4 

+

5from functools import cached_property 

+

6import importlib 

+

7import logging 

+

8 

+

9from django.conf import settings 

+

10from django.core.exceptions import ValidationError 

+

11from django.db import models 

+

12from django.urls import reverse 

+

13 

+

14import requests 

+

15 

+

16from benefits.secrets import NAME_VALIDATOR, get_secret_by_name 

+

17 

+

18 

+

19logger = logging.getLogger(__name__) 

+

20 

+

21 

+

22class SecretNameField(models.SlugField): 

+

23 """Field that stores the name of a secret held in a secret store. 

+

24 

+

25 The secret value itself MUST NEVER be stored in this field. 

+

26 """ 

+

27 

+

28 description = """Field that stores the name of a secret held in a secret store. 

+

29 

+

30 Secret names must be between 1-127 alphanumeric ASCII characters or hyphen characters. 

+

31 

+

32 The secret value itself MUST NEVER be stored in this field. 

+

33 """ 

+

34 

+

35 def __init__(self, *args, **kwargs): 

+

36 kwargs["validators"] = [NAME_VALIDATOR] 

+

37 # although the validator also checks for a max length of 127 

+

38 # this setting enforces the length at the database column level as well 

+

39 kwargs["max_length"] = 127 

+

40 # the default is False, but this is more explicit 

+

41 kwargs["allow_unicode"] = False 

+

42 super().__init__(*args, **kwargs) 

+

43 

+

44 

+

45class PemData(models.Model): 

+

46 """API Certificate or Key in PEM format.""" 

+

47 

+

48 id = models.AutoField(primary_key=True) 

+

49 # Human description of the PEM data 

+

50 label = models.TextField() 

+

51 # The name of a secret with data in utf-8 encoded PEM text format 

+

52 text_secret_name = SecretNameField(null=True, blank=True) 

+

53 # Public URL hosting the utf-8 encoded PEM text 

+

54 remote_url = models.TextField(null=True, blank=True) 

+

55 

+

56 def __str__(self): 

+

57 return self.label 

+

58 

+

59 @cached_property 

+

60 def data(self): 

+

61 """ 

+

62 Attempts to get data from `remote_url` or `text_secret_name`, with the latter taking precendence if both are defined. 

+

63 """ 

+

64 remote_data = None 

+

65 secret_data = None 

+

66 

+

67 if self.remote_url: 

+

68 remote_data = requests.get(self.remote_url, timeout=settings.REQUESTS_TIMEOUT).text 

+

69 if self.text_secret_name: 

+

70 try: 

+

71 secret_data = get_secret_by_name(self.text_secret_name) 

+

72 except Exception: 

+

73 secret_data = None 

+

74 

+

75 return secret_data if secret_data is not None else remote_data 

+

76 

+

77 

+

78class ClaimsProvider(models.Model): 

+

79 """An entity that provides claims for eligibility verification.""" 

+

80 

+

81 id = models.AutoField(primary_key=True) 

+

82 sign_out_button_template = models.TextField(null=True, blank=True, help_text="Template that renders sign-out button") 

+

83 sign_out_link_template = models.TextField(null=True, blank=True, help_text="Template that renders sign-out link") 

+

84 client_name = models.TextField(help_text="Unique identifier used to register this claims provider with Authlib registry") 

+

85 client_id_secret_name = SecretNameField( 

+

86 help_text="The name of the secret containing the client ID for this claims provider" 

+

87 ) 

+

88 authority = models.TextField(help_text="The fully qualified HTTPS domain name for an OAuth authority server") 

+

89 scheme = models.TextField(help_text="The authentication scheme to use") 

+

90 

+

91 @property 

+

92 def supports_sign_out(self): 

+

93 return bool(self.sign_out_button_template) or bool(self.sign_out_link_template) 

+

94 

+

95 @property 

+

96 def client_id(self): 

+

97 return get_secret_by_name(self.client_id_secret_name) 

+

98 

+

99 def __str__(self) -> str: 

+

100 return self.client_name 

+

101 

+

102 

+

103class EligibilityType(models.Model): 

+

104 """A single conditional eligibility type.""" 

+

105 

+

106 id = models.AutoField(primary_key=True) 

+

107 name = models.TextField() 

+

108 label = models.TextField() 

+

109 group_id = models.TextField() 

+

110 supports_expiration = models.BooleanField(default=False) 

+

111 expiration_days = models.PositiveSmallIntegerField(null=True, blank=True) 

+

112 expiration_reenrollment_days = models.PositiveSmallIntegerField(null=True, blank=True) 

+

113 enrollment_index_template = models.TextField(default="enrollment/index.html") 

+

114 reenrollment_error_template = models.TextField(null=True, blank=True) 

+

115 enrollment_success_template = models.TextField(default="enrollment/success.html") 

+

116 

+

117 def __str__(self): 

+

118 return self.label 

+

119 

+

120 @staticmethod 

+

121 def get(id): 

+

122 """Get an EligibilityType instance by its id.""" 

+

123 logger.debug(f"Get {EligibilityType.__name__} by id: {id}") 

+

124 return EligibilityType.objects.get(pk=id) 

+

125 

+

126 @staticmethod 

+

127 def get_many(ids): 

+

128 """Get a list of EligibilityType instances from a list of ids.""" 

+

129 logger.debug(f"Get {EligibilityType.__name__} list by ids: {ids}") 

+

130 return EligibilityType.objects.filter(id__in=ids) 

+

131 

+

132 @staticmethod 

+

133 def get_names(eligibility_types): 

+

134 """Convert a list of EligibilityType to a list of their names""" 

+

135 if isinstance(eligibility_types, EligibilityType): 

+

136 eligibility_types = [eligibility_types] 

+

137 return [t.name for t in eligibility_types if isinstance(t, EligibilityType)] 

+

138 

+

139 def clean(self): 

+

140 supports_expiration = self.supports_expiration 

+

141 expiration_days = self.expiration_days 

+

142 expiration_reenrollment_days = self.expiration_reenrollment_days 

+

143 reenrollment_error_template = self.reenrollment_error_template 

+

144 

+

145 if supports_expiration: 

+

146 errors = {} 

+

147 message = "When support_expiration is True, this value must be greater than 0." 

+

148 if expiration_days is None or expiration_days <= 0: 

+

149 errors.update(expiration_days=ValidationError(message)) 

+

150 if expiration_reenrollment_days is None or expiration_reenrollment_days <= 0: 

+

151 errors.update(expiration_reenrollment_days=ValidationError(message)) 

+

152 if reenrollment_error_template is None: 

+

153 errors.update(reenrollment_error_template=ValidationError("Required when supports expiration is True.")) 

+

154 

+

155 if errors: 

+

156 raise ValidationError(errors) 

+

157 

+

158 

+

159class EnrollmentFlow(models.Model): 

+

160 """Represents a user journey through the Benefits app for a single eligibility type.""" 

+

161 

+

162 id = models.AutoField(primary_key=True) 

+

163 name = models.TextField( 

+

164 help_text="Primary internal system name for this EnrollmentFlow instance, e.g. in analytics and Eligibility API requests." # noqa: 501 

+

165 ) 

+

166 display_order = models.PositiveSmallIntegerField(default=0, blank=False, null=False) 

+

167 eligibility_type = models.ForeignKey(EligibilityType, on_delete=models.PROTECT) 

+

168 claims_provider = models.ForeignKey( 

+

169 ClaimsProvider, 

+

170 on_delete=models.PROTECT, 

+

171 null=True, 

+

172 blank=True, 

+

173 help_text="An entity that provides claims for eligibility verification for this flow.", 

+

174 ) 

+

175 claims_scope = models.TextField( 

+

176 null=True, 

+

177 blank=True, 

+

178 help_text="A space-separated list of identifiers used to specify what access privileges are being requested", 

+

179 ) 

+

180 claims_claim = models.TextField( 

+

181 null=True, blank=True, help_text="The name of the claim (name/value pair) that is used to verify eligibility" 

+

182 ) 

+

183 claims_scheme_override = models.TextField( 

+

184 help_text="The authentication scheme to use (Optional). If blank, defaults to the value in Claims providers", 

+

185 default=None, 

+

186 null=True, 

+

187 blank=True, 

+

188 verbose_name="Claims scheme", 

+

189 ) 

+

190 eligibility_api_url = models.TextField( 

+

191 null=True, blank=True, help_text="Fully qualified URL for an Eligibility API server used by this flow." 

+

192 ) 

+

193 eligibility_api_auth_header = models.TextField( 

+

194 null=True, 

+

195 blank=True, 

+

196 help_text="The auth header to send in Eligibility API requests for this flow.", 

+

197 ) 

+

198 eligibility_api_auth_key_secret_name = SecretNameField( 

+

199 null=True, 

+

200 blank=True, 

+

201 help_text="The name of a secret containing the value of the auth header to send in Eligibility API requests for this flow.", # noqa: 501 

+

202 ) 

+

203 eligibility_api_public_key = models.ForeignKey( 

+

204 PemData, 

+

205 related_name="+", 

+

206 on_delete=models.PROTECT, 

+

207 null=True, 

+

208 blank=True, 

+

209 help_text="The public key used to encrypt Eligibility API requests and to verify signed Eligibility API responses for this flow.", # noqa: E501 

+

210 ) 

+

211 eligibility_api_jwe_cek_enc = models.TextField( 

+

212 null=True, 

+

213 blank=True, 

+

214 help_text="The JWE-compatible Content Encryption Key (CEK) key-length and mode to use in Eligibility API requests for this flow.", # noqa: E501 

+

215 ) 

+

216 eligibility_api_jwe_encryption_alg = models.TextField( 

+

217 null=True, 

+

218 blank=True, 

+

219 help_text="The JWE-compatible encryption algorithm to use in Eligibility API requests for this flow.", 

+

220 ) 

+

221 eligibility_api_jws_signing_alg = models.TextField( 

+

222 null=True, 

+

223 blank=True, 

+

224 help_text="The JWS-compatible signing algorithm to use in Eligibility API requests for this flow.", 

+

225 ) 

+

226 selection_label_template = models.TextField( 

+

227 help_text="Path to a Django template that defines the end-user UI for selecting this flow among other options." 

+

228 ) 

+

229 eligibility_start_template = models.TextField( 

+

230 default="eligibility/start.html", help_text="Path to a Django template for the informational page of this flow." 

+

231 ) 

+

232 eligibility_form_class = models.TextField( 

+

233 null=True, 

+

234 blank=True, 

+

235 help_text="The fully qualified Python path of a form class used by this flow, e.g. benefits.eligibility.forms.FormClass", # noqa: E501 

+

236 ) 

+

237 eligibility_unverified_template = models.TextField( 

+

238 default="eligibility/unverified.html", 

+

239 help_text="Path to a Django template that defines the page when a user fails eligibility verification for this flow.", 

+

240 ) 

+

241 help_template = models.TextField( 

+

242 null=True, 

+

243 blank=True, 

+

244 help_text="Path to a Django template that defines the help text for this enrollment flow, used in building the dynamic help page for an agency", # noqa: E501 

+

245 ) 

+

246 

+

247 class Meta: 

+

248 ordering = ["display_order"] 

+

249 

+

250 def __str__(self): 

+

251 return self.name 

+

252 

+

253 @property 

+

254 def eligibility_api_auth_key(self): 

+

255 if self.eligibility_api_auth_key_secret_name is not None: 255 ↛ 258line 255 didn't jump to line 258 because the condition on line 255 was always true

+

256 return get_secret_by_name(self.eligibility_api_auth_key_secret_name) 

+

257 else: 

+

258 return None 

+

259 

+

260 @property 

+

261 def eligibility_api_public_key_data(self): 

+

262 """This flow's Eligibility API public key as a string.""" 

+

263 return self.eligibility_api_public_key.data 

+

264 

+

265 @property 

+

266 def uses_claims_verification(self): 

+

267 """True if this flow verifies via the claims provider and has a scope and claim. False otherwise.""" 

+

268 return self.claims_provider is not None and bool(self.claims_scope) and bool(self.claims_claim) 

+

269 

+

270 def eligibility_form_instance(self, *args, **kwargs): 

+

271 """Return an instance of this flow's EligibilityForm, or None.""" 

+

272 if not bool(self.eligibility_form_class): 

+

273 return None 

+

274 

+

275 # inspired by https://stackoverflow.com/a/30941292 

+

276 module_name, class_name = self.eligibility_form_class.rsplit(".", 1) 

+

277 FormClass = getattr(importlib.import_module(module_name), class_name) 

+

278 

+

279 return FormClass(*args, **kwargs) 

+

280 

+

281 @staticmethod 

+

282 def by_id(id): 

+

283 """Get an EnrollmentFlow instance by its ID.""" 

+

284 logger.debug(f"Get {EnrollmentFlow.__name__} by id: {id}") 

+

285 return EnrollmentFlow.objects.get(id=id) 

+

286 

+

287 @property 

+

288 def claims_scheme(self): 

+

289 if not self.claims_scheme_override: 

+

290 return self.claims_provider.scheme 

+

291 return self.claims_scheme_override 

+

292 

+

293 

+

294class TransitProcessor(models.Model): 

+

295 """An entity that applies transit agency fare rules to rider transactions.""" 

+

296 

+

297 id = models.AutoField(primary_key=True) 

+

298 name = models.TextField(help_text="Primary internal display name for this TransitProcessor instance, e.g. in the Admin.") 

+

299 api_base_url = models.TextField(help_text="The absolute base URL for the TransitProcessor's API, including https://.") 

+

300 card_tokenize_url = models.TextField( 

+

301 help_text="The absolute URL for the client-side card tokenization library provided by the TransitProcessor." 

+

302 ) 

+

303 card_tokenize_func = models.TextField( 

+

304 help_text="The function from the card tokenization library to call on the client to initiate the process." 

+

305 ) 

+

306 card_tokenize_env = models.TextField(help_text="The environment in which card tokenization is occurring.") 

+

307 

+

308 def __str__(self): 

+

309 return self.name 

+

310 

+

311 

+

312class TransitAgency(models.Model): 

+

313 """An agency offering transit service.""" 

+

314 

+

315 id = models.AutoField(primary_key=True) 

+

316 active = models.BooleanField(default=False, help_text="Determines if this Agency is enabled for users") 

+

317 eligibility_types = models.ManyToManyField(EligibilityType) 

+

318 enrollment_flows = models.ManyToManyField(EnrollmentFlow) 

+

319 slug = models.TextField(help_text="Used for URL navigation for this agency, e.g. the agency homepage url is /{slug}") 

+

320 short_name = models.TextField(help_text="The user-facing short name for this agency. Often an uppercase acronym.") 

+

321 long_name = models.TextField( 

+

322 help_text="The user-facing long name for this agency. Often the short_name acronym, spelled out." 

+

323 ) 

+

324 info_url = models.URLField(help_text="URL of a website/page with more information about the agency's discounts") 

+

325 phone = models.TextField(help_text="Agency customer support phone number") 

+

326 index_template = models.TextField(help_text="The template used for this agency's landing page") 

+

327 eligibility_index_template = models.TextField(help_text="The template used for this agency's eligibility landing page") 

+

328 eligibility_api_id = models.TextField(help_text="The identifier for this agency used in Eligibility API calls.") 

+

329 eligibility_api_private_key = models.ForeignKey( 

+

330 PemData, 

+

331 related_name="+", 

+

332 on_delete=models.PROTECT, 

+

333 help_text="Private key used to sign Eligibility API tokens created on behalf of this Agency.", 

+

334 ) 

+

335 eligibility_api_public_key = models.ForeignKey( 

+

336 PemData, 

+

337 related_name="+", 

+

338 on_delete=models.PROTECT, 

+

339 help_text="Public key corresponding to the agency's private key, used by Eligibility Verification servers to encrypt responses.", # noqa: E501 

+

340 ) 

+

341 eligibility_api_jws_signing_alg = models.TextField( 

+

342 help_text="The JWS-compatible signing algorithm used in Eligibility API calls." 

+

343 ) 

+

344 transit_processor = models.ForeignKey(TransitProcessor, on_delete=models.PROTECT) 

+

345 transit_processor_audience = models.TextField( 

+

346 help_text="This agency's audience value used to access the TransitProcessor's API.", default="" 

+

347 ) 

+

348 transit_processor_client_id = models.TextField( 

+

349 help_text="This agency's client_id value used to access the TransitProcessor's API.", default="" 

+

350 ) 

+

351 transit_processor_client_secret_name = SecretNameField( 

+

352 help_text="The name of the secret containing this agency's client_secret value used to access the TransitProcessor's API.", # noqa: E501 

+

353 default="", 

+

354 ) 

+

355 

+

356 def __str__(self): 

+

357 return self.long_name 

+

358 

+

359 def get_type_id(self, name): 

+

360 """Get the id of the EligibilityType identified by the given name for this agency.""" 

+

361 eligibility = self.eligibility_types.all().filter(name=name) 

+

362 if eligibility.count() == 1: 

+

363 return eligibility[0].id 

+

364 else: 

+

365 raise Exception("name does not correspond to a single eligibility type for agency") 

+

366 

+

367 def supports_type(self, eligibility_type): 

+

368 """True if the eligibility_type is one of this agency's types. False otherwise.""" 

+

369 return isinstance(eligibility_type, EligibilityType) and eligibility_type in self.eligibility_types.all() 

+

370 

+

371 def types_to_verify(self, flow: EnrollmentFlow): 

+

372 """List of eligibility types to verify for this agency.""" 

+

373 # compute set intersection of agency and flow type ids 

+

374 agency_types = set(self.eligibility_types.values_list("id", flat=True)) 

+

375 flow_types = {flow.eligibility_type.id} 

+

376 supported_types = list(agency_types & flow_types) 

+

377 return EligibilityType.get_many(supported_types) 

+

378 

+

379 def type_names_to_verify(self, flow: EnrollmentFlow): 

+

380 """List of names of the eligibility types to check for this agency.""" 

+

381 return EligibilityType.get_names(self.types_to_verify(flow)) 

+

382 

+

383 @property 

+

384 def index_url(self): 

+

385 """Public-facing URL to the TransitAgency's landing page.""" 

+

386 return reverse("core:agency_index", args=[self.slug]) 

+

387 

+

388 @property 

+

389 def eligibility_index_url(self): 

+

390 """Public facing URL to the TransitAgency's eligibility page.""" 

+

391 return reverse("eligibility:agency_index", args=[self.slug]) 

+

392 

+

393 @property 

+

394 def eligibility_api_public_key_url(self): 

+

395 """Public-facing URL to the TransitAgency's public key.""" 

+

396 return reverse("core:agency_public_key", args=[self.slug]) 

+

397 

+

398 @property 

+

399 def eligibility_api_private_key_data(self): 

+

400 """This Agency's private key as a string.""" 

+

401 return self.eligibility_api_private_key.data 

+

402 

+

403 @property 

+

404 def eligibility_api_public_key_data(self): 

+

405 """This Agency's public key as a string.""" 

+

406 return self.eligibility_api_public_key.data 

+

407 

+

408 @property 

+

409 def transit_processor_client_secret(self): 

+

410 return get_secret_by_name(self.transit_processor_client_secret_name) 

+

411 

+

412 @staticmethod 

+

413 def by_id(id): 

+

414 """Get a TransitAgency instance by its ID.""" 

+

415 logger.debug(f"Get {TransitAgency.__name__} by id: {id}") 

+

416 return TransitAgency.objects.get(id=id) 

+

417 

+

418 @staticmethod 

+

419 def by_slug(slug): 

+

420 """Get a TransitAgency instance by its slug.""" 

+

421 logger.debug(f"Get {TransitAgency.__name__} by slug: {slug}") 

+

422 return TransitAgency.objects.filter(slug=slug).first() 

+

423 

+

424 @staticmethod 

+

425 def all_active(): 

+

426 """Get all TransitAgency instances marked active.""" 

+

427 logger.debug(f"Get all active {TransitAgency.__name__}") 

+

428 return TransitAgency.objects.filter(active=True) 

+
+ + + diff --git a/tests/coverage/z_8c0b35f1ea7ee6af_recaptcha_py.html b/tests/coverage/z_8c0b35f1ea7ee6af_recaptcha_py.html new file mode 100644 index 000000000..450272283 --- /dev/null +++ b/tests/coverage/z_8c0b35f1ea7ee6af_recaptcha_py.html @@ -0,0 +1,131 @@ + + + + + Coverage for benefits/core/recaptcha.py: 58% + + + + + +
+
+

+ Coverage for benefits/core/recaptcha.py: + 58% +

+ +

+ 13 statements   + + + + +

+

+ « prev     + ^ index     + » next +       + coverage.py v7.6.1, + created at 2024-08-13 23:09 +0000 +

+ +
+
+
+

1""" 

+

2The core application: helpers to work with reCAPTCHA. 

+

3""" 

+

4 

+

5import requests 

+

6 

+

7from django.conf import settings 

+

8 

+

9 

+

10DATA_FIELD = "g-recaptcha-response" 

+

11 

+

12 

+

13def has_error(form) -> bool: 

+

14 """True if the given form has a reCAPTCHA error. False otherwise.""" 

+

15 return any([s for (_, v) in form.errors.items() for s in v if "reCAPTCHA" in s]) 

+

16 

+

17 

+

18def verify(form_data: dict) -> bool: 

+

19 """ 

+

20 Check with Google reCAPTCHA if the given response is a valid user. 

+

21 See https://developers.google.com/recaptcha/docs/verify 

+

22 """ 

+

23 if not settings.RECAPTCHA_ENABLED: 23 ↛ 26line 23 didn't jump to line 26 because the condition on line 23 was always true

+

24 return True 

+

25 

+

26 if not form_data or DATA_FIELD not in form_data: 

+

27 return False 

+

28 

+

29 payload = dict(secret=settings.RECAPTCHA_SECRET_KEY, response=form_data[DATA_FIELD]) 

+

30 response = requests.post(settings.RECAPTCHA_VERIFY_URL, payload, timeout=settings.REQUESTS_TIMEOUT).json() 

+

31 

+

32 return bool(response["success"]) 

+
+ + + diff --git a/tests/coverage/z_8c0b35f1ea7ee6af_session_py.html b/tests/coverage/z_8c0b35f1ea7ee6af_session_py.html new file mode 100644 index 000000000..e4e9a7fcf --- /dev/null +++ b/tests/coverage/z_8c0b35f1ea7ee6af_session_py.html @@ -0,0 +1,392 @@ + + + + + Coverage for benefits/core/session.py: 99% + + + + + +
+
+

+ Coverage for benefits/core/session.py: + 99% +

+ +

+ 142 statements   + + + + +

+

+ « prev     + ^ index     + » next +       + coverage.py v7.6.1, + created at 2024-08-13 23:09 +0000 +

+ +
+
+
+

1""" 

+

2The core application: helpers to work with request sessions. 

+

3""" 

+

4 

+

5from datetime import datetime, timedelta, timezone 

+

6import hashlib 

+

7import logging 

+

8import time 

+

9import uuid 

+

10 

+

11from django.urls import reverse 

+

12 

+

13from . import models 

+

14 

+

15 

+

16logger = logging.getLogger(__name__) 

+

17 

+

18 

+

19_AGENCY = "agency" 

+

20_DEBUG = "debug" 

+

21_DID = "did" 

+

22_ELIGIBILITY = "eligibility" 

+

23_ENROLLMENT_TOKEN = "enrollment_token" 

+

24_ENROLLMENT_TOKEN_EXP = "enrollment_token_expiry" 

+

25_ENROLLMENT_EXP = "enrollment_expiry" 

+

26_FLOW = "flow" 

+

27_LANG = "lang" 

+

28_OAUTH_CLAIM = "oauth_claim" 

+

29_OAUTH_TOKEN = "oauth_token" 

+

30_ORIGIN = "origin" 

+

31_START = "start" 

+

32_UID = "uid" 

+

33 

+

34 

+

35def agency(request): 

+

36 """Get the agency from the request's session, or None""" 

+

37 try: 

+

38 return models.TransitAgency.by_id(request.session[_AGENCY]) 

+

39 except (KeyError, models.TransitAgency.DoesNotExist): 

+

40 return None 

+

41 

+

42 

+

43def active_agency(request): 

+

44 """True if the request's session is configured with an active agency. False otherwise.""" 

+

45 a = agency(request) 

+

46 return a and a.active 

+

47 

+

48 

+

49def context_dict(request): 

+

50 """The request's session context as a dict.""" 

+

51 return { 

+

52 _AGENCY: agency(request).slug if active_agency(request) else None, 

+

53 _DEBUG: debug(request), 

+

54 _DID: did(request), 

+

55 _FLOW: flow(request), 

+

56 _ELIGIBILITY: eligibility(request), 

+

57 _ENROLLMENT_EXP: enrollment_expiry(request), 

+

58 _ENROLLMENT_TOKEN: enrollment_token(request), 

+

59 _ENROLLMENT_TOKEN_EXP: enrollment_token_expiry(request), 

+

60 _LANG: language(request), 

+

61 _OAUTH_TOKEN: oauth_token(request), 

+

62 _OAUTH_CLAIM: oauth_claim(request), 

+

63 _ORIGIN: origin(request), 

+

64 _START: start(request), 

+

65 _UID: uid(request), 

+

66 } 

+

67 

+

68 

+

69def debug(request): 

+

70 """Get the DEBUG flag from the request's session.""" 

+

71 return bool(request.session.get(_DEBUG, False)) 

+

72 

+

73 

+

74def did(request): 

+

75 """ 

+

76 Get the session's device ID, a hashed version of the unique ID. If unset, 

+

77 the session is reset to initialize a value. 

+

78 

+

79 This value, like UID, is randomly generated per session and is needed for 

+

80 Amplitude to accurately track that a sequence of events came from a unique 

+

81 user. 

+

82 

+

83 See more: https://help.amplitude.com/hc/en-us/articles/115003135607-Track-unique-users-in-Amplitude 

+

84 """ 

+

85 d = request.session.get(_DID) 

+

86 if not d: 

+

87 reset(request) 

+

88 d = request.session.get(_DID) 

+

89 return str(d) 

+

90 

+

91 

+

92def eligibility(request): 

+

93 """Get the confirmed models.EligibilityType from the request's session, or None""" 

+

94 eligibility = request.session.get(_ELIGIBILITY) 

+

95 if eligibility: 

+

96 return models.EligibilityType.get(eligibility) 

+

97 else: 

+

98 return None 

+

99 

+

100 

+

101def eligible(request): 

+

102 """True if the request's session is configured with an active agency and has confirmed eligibility. False otherwise.""" 

+

103 return active_agency(request) and agency(request).supports_type(eligibility(request)) 

+

104 

+

105 

+

106def enrollment_expiry(request): 

+

107 """Get the expiry date for a user's enrollment from session, or None.""" 

+

108 expiry = request.session.get(_ENROLLMENT_EXP) 

+

109 if expiry: 

+

110 return datetime.fromtimestamp(expiry, tz=timezone.utc) 

+

111 else: 

+

112 return None 

+

113 

+

114 

+

115def enrollment_reenrollment(request): 

+

116 """Get the reenrollment date for a user's enrollment from session, or None.""" 

+

117 expiry = enrollment_expiry(request) 

+

118 elig = eligibility(request) 

+

119 

+

120 if elig and elig.supports_expiration and expiry: 

+

121 return expiry - timedelta(days=elig.expiration_reenrollment_days) 

+

122 else: 

+

123 return None 

+

124 

+

125 

+

126def enrollment_token(request): 

+

127 """Get the enrollment token from the request's session, or None.""" 

+

128 return request.session.get(_ENROLLMENT_TOKEN) 

+

129 

+

130 

+

131def enrollment_token_expiry(request): 

+

132 """Get the enrollment token's expiry time from the request's session, or None.""" 

+

133 return request.session.get(_ENROLLMENT_TOKEN_EXP) 

+

134 

+

135 

+

136def enrollment_token_valid(request): 

+

137 """True if the request's session is configured with a valid token. False otherwise.""" 

+

138 if bool(enrollment_token(request)): 

+

139 exp = enrollment_token_expiry(request) 

+

140 # ensure token does not expire in the next 5 seconds 

+

141 valid = exp is None or exp > (time.time() + 5) 

+

142 return valid 

+

143 else: 

+

144 return False 

+

145 

+

146 

+

147def language(request): 

+

148 """Get the language configured for the request.""" 

+

149 return request.LANGUAGE_CODE 

+

150 

+

151 

+

152def logged_in(request): 

+

153 """Check if the current session has an OAuth token.""" 

+

154 return bool(oauth_token(request)) 

+

155 

+

156 

+

157def logout(request): 

+

158 """Reset the session claims and tokens.""" 

+

159 update(request, oauth_claim=False, oauth_token=False, enrollment_token=False) 

+

160 

+

161 

+

162def oauth_token(request): 

+

163 """Get the oauth token from the request's session, or None""" 

+

164 return request.session.get(_OAUTH_TOKEN) 

+

165 

+

166 

+

167def oauth_claim(request): 

+

168 """Get the oauth claim from the request's session, or None""" 

+

169 return request.session.get(_OAUTH_CLAIM) 

+

170 

+

171 

+

172def origin(request): 

+

173 """Get the origin for the request's session, or the default core:index.""" 

+

174 return request.session.get(_ORIGIN, reverse("core:index")) 

+

175 

+

176 

+

177def reset(request): 

+

178 """Reset the session for the request.""" 

+

179 logger.debug("Reset session") 

+

180 request.session[_AGENCY] = None 

+

181 request.session[_FLOW] = None 

+

182 request.session[_ELIGIBILITY] = None 

+

183 request.session[_ORIGIN] = reverse("core:index") 

+

184 request.session[_ENROLLMENT_EXP] = None 

+

185 request.session[_ENROLLMENT_TOKEN] = None 

+

186 request.session[_ENROLLMENT_TOKEN_EXP] = None 

+

187 request.session[_OAUTH_TOKEN] = None 

+

188 request.session[_OAUTH_CLAIM] = None 

+

189 

+

190 if _UID not in request.session or not request.session[_UID]: 

+

191 logger.debug("Reset session time and uid") 

+

192 request.session[_START] = int(time.time() * 1000) 

+

193 u = str(uuid.uuid4()) 

+

194 request.session[_UID] = u 

+

195 request.session[_DID] = str(uuid.UUID(hashlib.sha512(bytes(u, "utf8")).hexdigest()[:32])) 

+

196 

+

197 

+

198def start(request): 

+

199 """ 

+

200 Get the start time from the request's session, as integer milliseconds since 

+

201 Epoch. If unset, the session is reset to initialize a value. 

+

202 

+

203 Once started, does not reset after subsequent calls to session.reset() or 

+

204 session.start(). This value is needed for Amplitude to accurately track 

+

205 sessions. 

+

206 

+

207 See more: https://help.amplitude.com/hc/en-us/articles/115002323627-Tracking-Sessions 

+

208 """ 

+

209 s = request.session.get(_START) 

+

210 if not s: 

+

211 reset(request) 

+

212 s = request.session.get(_START) 

+

213 return s 

+

214 

+

215 

+

216def uid(request): 

+

217 """ 

+

218 Get the session's unique ID, a randomly generated UUID4 string. If unset, 

+

219 the session is reset to initialize a value. 

+

220 

+

221 This value, like DID, is needed for Amplitude to accurately track that a 

+

222 sequence of events came from a unique user. 

+

223 

+

224 See more: https://help.amplitude.com/hc/en-us/articles/115003135607-Track-unique-users-in-Amplitude 

+

225 

+

226 Although Amplitude advises *against* setting user_id for anonymous users, 

+

227 here a value is set on anonymous users anyway, as the users never sign-in 

+

228 and become de-anonymized to this app / Amplitude. 

+

229 """ 

+

230 u = request.session.get(_UID) 

+

231 if not u: 

+

232 reset(request) 

+

233 u = request.session.get(_UID) 

+

234 return u 

+

235 

+

236 

+

237def update( 

+

238 request, 

+

239 agency=None, 

+

240 debug=None, 

+

241 flow=None, 

+

242 eligibility_types=None, 

+

243 enrollment_expiry=None, 

+

244 enrollment_token=None, 

+

245 enrollment_token_exp=None, 

+

246 oauth_token=None, 

+

247 oauth_claim=None, 

+

248 origin=None, 

+

249): 

+

250 """Update the request's session with non-null values.""" 

+

251 if agency is not None and isinstance(agency, models.TransitAgency): 

+

252 request.session[_AGENCY] = agency.id 

+

253 if debug is not None: 

+

254 request.session[_DEBUG] = debug 

+

255 if eligibility_types is not None and isinstance(eligibility_types, list): 

+

256 if len(eligibility_types) > 1: 

+

257 raise NotImplementedError("Multiple eligibilities are not supported at this time.") 

+

258 elif len(eligibility_types) == 1: 

+

259 # get the eligibility corresponding to the session's agency 

+

260 a = models.TransitAgency.by_id(request.session[_AGENCY]) 

+

261 t = str(eligibility_types[0]).strip() 

+

262 request.session[_ELIGIBILITY] = a.get_type_id(t) 

+

263 else: 

+

264 # empty list, clear session eligibility 

+

265 request.session[_ELIGIBILITY] = None 

+

266 if isinstance(enrollment_expiry, datetime): 

+

267 if enrollment_expiry.tzinfo is None or enrollment_expiry.tzinfo.utcoffset(enrollment_expiry) is None: 

+

268 # this is a naive datetime instance, update tzinfo for UTC 

+

269 # see notes under https://docs.python.org/3/library/datetime.html#datetime.datetime.timestamp 

+

270 # > There is no method to obtain the POSIX timestamp directly from a naive datetime instance representing UTC time. 

+

271 # > If your application uses this convention and your system timezone is not set to UTC, you can obtain the POSIX 

+

272 # > timestamp by supplying tzinfo=timezone.utc 

+

273 enrollment_expiry = enrollment_expiry.replace(tzinfo=timezone.utc) 

+

274 request.session[_ENROLLMENT_EXP] = enrollment_expiry.timestamp() 

+

275 if enrollment_token is not None: 

+

276 request.session[_ENROLLMENT_TOKEN] = enrollment_token 

+

277 request.session[_ENROLLMENT_TOKEN_EXP] = enrollment_token_exp 

+

278 if oauth_token is not None: 

+

279 request.session[_OAUTH_TOKEN] = oauth_token 

+

280 if oauth_claim is not None: 

+

281 request.session[_OAUTH_CLAIM] = oauth_claim 

+

282 if origin is not None: 

+

283 request.session[_ORIGIN] = origin 

+

284 if flow is not None and isinstance(flow, models.EnrollmentFlow): 

+

285 request.session[_FLOW] = flow.id 

+

286 

+

287 

+

288def flow(request) -> models.EnrollmentFlow | None: 

+

289 """Get the EnrollmentFlow from the request's session, or None""" 

+

290 try: 

+

291 return models.EnrollmentFlow.by_id(request.session[_FLOW]) 

+

292 except (KeyError, models.EnrollmentFlow.DoesNotExist): 

+

293 return None 

+
+ + + diff --git a/tests/coverage/z_8c0b35f1ea7ee6af_urls_py.html b/tests/coverage/z_8c0b35f1ea7ee6af_urls_py.html new file mode 100644 index 000000000..24930c667 --- /dev/null +++ b/tests/coverage/z_8c0b35f1ea7ee6af_urls_py.html @@ -0,0 +1,153 @@ + + + + + Coverage for benefits/core/urls.py: 100% + + + + + +
+
+

+ Coverage for benefits/core/urls.py: + 100% +

+ +

+ 24 statements   + + + + +

+

+ « prev     + ^ index     + » next +       + coverage.py v7.6.1, + created at 2024-08-13 23:09 +0000 +

+ +
+
+
+

1""" 

+

2The core application: URLConf for the root of the webapp. 

+

3""" 

+

4 

+

5import logging 

+

6 

+

7from django.urls import path, register_converter 

+

8 

+

9from . import models, views 

+

10 

+

11 

+

12logger = logging.getLogger(__name__) 

+

13 

+

14 

+

15class TransitAgencyPathConverter: 

+

16 """Path converter to parse valid TransitAgency objects from URL paths.""" 

+

17 

+

18 # used to test the url fragment, determines if this PathConverter is used 

+

19 regex = "[a-zA-Z]{3,5}" 

+

20 

+

21 def to_python(self, value): 

+

22 """Determine if the matched fragment corresponds to an active Agency.""" 

+

23 value = str(value).lower() 

+

24 logger.debug(f"Matched fragment from path: {value}") 

+

25 

+

26 agency = models.TransitAgency.by_slug(value) 

+

27 if agency and agency.active: 

+

28 logger.debug("Path fragment is an active agency") 

+

29 return agency 

+

30 else: 

+

31 logger.error("Path fragment is not an active agency") 

+

32 raise ValueError("value") 

+

33 

+

34 def to_url(self, agency): 

+

35 """Convert the Agency back into a string for a URL.""" 

+

36 try: 

+

37 return agency.slug 

+

38 except AttributeError: 

+

39 return str(agency) 

+

40 

+

41 

+

42logger.debug(f"Register path converter: {TransitAgencyPathConverter.__name__}") 

+

43register_converter(TransitAgencyPathConverter, "agency") 

+

44 

+

45app_name = "core" 

+

46 

+

47urlpatterns = [ 

+

48 path("", views.index, name="index"), 

+

49 path("help", views.help, name="help"), 

+

50 path("<agency:agency>", views.agency_index, name="agency_index"), 

+

51 path("<agency:agency>/publickey", views.agency_public_key, name="agency_public_key"), 

+

52 path("logged_out", views.logged_out, name="logged_out"), 

+

53 path("error", views.server_error, name="server-error"), 

+

54] 

+
+ + + diff --git a/tests/coverage/z_8c0b35f1ea7ee6af_views_py.html b/tests/coverage/z_8c0b35f1ea7ee6af_views_py.html new file mode 100644 index 000000000..fcf239677 --- /dev/null +++ b/tests/coverage/z_8c0b35f1ea7ee6af_views_py.html @@ -0,0 +1,195 @@ + + + + + Coverage for benefits/core/views.py: 100% + + + + + +
+
+

+ Coverage for benefits/core/views.py: + 100% +

+ +

+ 53 statements   + + + + +

+

+ « prev     + ^ index     + » next +       + coverage.py v7.6.1, + created at 2024-08-13 23:09 +0000 +

+ +
+
+
+

1""" 

+

2The core application: view definition for the root of the webapp. 

+

3""" 

+

4 

+

5from django.http import HttpResponse, HttpResponseBadRequest, HttpResponseNotFound, HttpResponseServerError 

+

6from django.template import loader 

+

7from django.template.response import TemplateResponse 

+

8 

+

9from . import models, session 

+

10from .middleware import pageview_decorator, index_or_agencyindex_origin_decorator 

+

11 

+

12ROUTE_ELIGIBILITY = "eligibility:index" 

+

13ROUTE_HELP = "core:help" 

+

14ROUTE_LOGGED_OUT = "core:logged_out" 

+

15ROUTE_SERVER_ERROR = "core:server-error" 

+

16 

+

17TEMPLATE_INDEX = "core/index.html" 

+

18TEMPLATE_AGENCY = "core/agency-index.html" 

+

19TEMPLATE_HELP = "core/help.html" 

+

20TEMPLATE_LOGGED_OUT = "core/logged-out.html" 

+

21 

+

22TEMPLATE_BAD_REQUEST = "400.html" 

+

23TEMPLATE_NOT_FOUND = "404.html" 

+

24TEMPLATE_SERVER_ERROR = "500.html" 

+

25 

+

26 

+

27@pageview_decorator 

+

28def index(request): 

+

29 """View handler for the main entry page.""" 

+

30 session.reset(request) 

+

31 

+

32 return TemplateResponse(request, TEMPLATE_INDEX) 

+

33 

+

34 

+

35@pageview_decorator 

+

36def agency_index(request, agency: models.TransitAgency): 

+

37 """View handler for an agency entry page.""" 

+

38 session.reset(request) 

+

39 session.update(request, agency=agency, origin=agency.index_url) 

+

40 

+

41 return TemplateResponse(request, agency.index_template) 

+

42 

+

43 

+

44@pageview_decorator 

+

45def agency_public_key(request, agency: models.TransitAgency): 

+

46 """View handler returns an agency's public key as plain text.""" 

+

47 return HttpResponse(agency.eligibility_api_public_key_data, content_type="text/plain") 

+

48 

+

49 

+

50@pageview_decorator 

+

51def help(request): 

+

52 """View handler for the help page.""" 

+

53 return TemplateResponse(request, TEMPLATE_HELP) 

+

54 

+

55 

+

56@pageview_decorator 

+

57@index_or_agencyindex_origin_decorator 

+

58def bad_request(request, exception, template_name=TEMPLATE_BAD_REQUEST): 

+

59 """View handler for HTTP 400 Bad Request responses.""" 

+

60 t = loader.get_template(template_name) 

+

61 

+

62 return HttpResponseBadRequest(t.render(request=request)) 

+

63 

+

64 

+

65@pageview_decorator 

+

66@index_or_agencyindex_origin_decorator 

+

67def csrf_failure(request, reason): 

+

68 """ 

+

69 View handler for CSRF_FAILURE_VIEW with custom data. 

+

70 """ 

+

71 t = loader.get_template(TEMPLATE_BAD_REQUEST) 

+

72 

+

73 return HttpResponseNotFound(t.render(request=request)) 

+

74 

+

75 

+

76@pageview_decorator 

+

77@index_or_agencyindex_origin_decorator 

+

78def page_not_found(request, exception, template_name=TEMPLATE_NOT_FOUND): 

+

79 """View handler for HTTP 404 Not Found responses.""" 

+

80 t = loader.get_template(template_name) 

+

81 

+

82 return HttpResponseNotFound(t.render(request=request)) 

+

83 

+

84 

+

85@pageview_decorator 

+

86@index_or_agencyindex_origin_decorator 

+

87def server_error(request, template_name=TEMPLATE_SERVER_ERROR): 

+

88 """View handler for HTTP 500 Server Error responses.""" 

+

89 t = loader.get_template(template_name) 

+

90 

+

91 return HttpResponseServerError(t.render(request=request)) 

+

92 

+

93 

+

94def logged_out(request): 

+

95 """View handler for the final log out confirmation message.""" 

+

96 return TemplateResponse(request, TEMPLATE_LOGGED_OUT) 

+
+ + + diff --git a/tests/coverage/z_8c0b35f1ea7ee6af_widgets_py.html b/tests/coverage/z_8c0b35f1ea7ee6af_widgets_py.html new file mode 100644 index 000000000..960202634 --- /dev/null +++ b/tests/coverage/z_8c0b35f1ea7ee6af_widgets_py.html @@ -0,0 +1,142 @@ + + + + + Coverage for benefits/core/widgets.py: 87% + + + + + +
+
+

+ Coverage for benefits/core/widgets.py: + 87% +

+ +

+ 25 statements   + + + + +

+

+ « prev     + ^ index     + » next +       + coverage.py v7.6.1, + created at 2024-08-13 23:09 +0000 +

+ +
+
+
+

1""" 

+

2The core application: Helper form widgets. 

+

3""" 

+

4 

+

5import copy 

+

6from django.forms import widgets 

+

7 

+

8 

+

9class FormControlTextInput(widgets.TextInput): 

+

10 """A styled text input.""" 

+

11 

+

12 def __init__(self, pattern=None, placeholder=None, **kwargs): 

+

13 super().__init__(**kwargs) 

+

14 

+

15 self.attrs.update({"class": "form-control"}) 

+

16 if pattern: 16 ↛ 17line 16 didn't jump to line 17 because the condition on line 16 was never true

+

17 self.attrs.update({"pattern": pattern}) 

+

18 if placeholder: 18 ↛ exitline 18 didn't return from function '__init__' because the condition on line 18 was always true

+

19 self.attrs.update({"placeholder": placeholder}) 

+

20 

+

21 

+

22class FlowRadioSelect(widgets.RadioSelect): 

+

23 """A radio select input styled for the Enrollment Flow.""" 

+

24 

+

25 template_name = "core/widgets/flow-radio-select.html" 

+

26 option_template_name = "core/widgets/flow-radio-select-option.html" 

+

27 

+

28 def __init__(self, selection_label_templates=(), *args, **kwargs): 

+

29 super().__init__(*args, **kwargs) 

+

30 self.selection_label_templates = list(selection_label_templates) 

+

31 

+

32 def __deepcopy__(self, memo): 

+

33 obj = super().__deepcopy__(memo) 

+

34 obj.selection_label_templates = copy.copy(self.selection_label_templates) 

+

35 return obj 

+

36 

+

37 def create_option(self, name, value, label, selected, index, subindex, attrs): 

+

38 option = super().create_option(name, value, label, selected, index, subindex, attrs) 

+

39 # this implementation does not support groups from ChoiceWidget.optgroups 

+

40 if value in self.selection_label_templates: 40 ↛ 43line 40 didn't jump to line 43 because the condition on line 40 was always true

+

41 option.update({"selection_label_template": self.selection_label_templates[value]}) 

+

42 

+

43 return option 

+
+ + + diff --git a/tests/coverage/z_9a5e1802ee124b46___init___py.html b/tests/coverage/z_9a5e1802ee124b46___init___py.html new file mode 100644 index 000000000..0f341f638 --- /dev/null +++ b/tests/coverage/z_9a5e1802ee124b46___init___py.html @@ -0,0 +1,99 @@ + + + + + Coverage for benefits/locale/en/__init__.py: 100% + + + + + +
+
+

+ Coverage for benefits/locale/en/__init__.py: + 100% +

+ +

+ 0 statements   + + + + +

+

+ « prev     + ^ index     + » next +       + coverage.py v7.6.1, + created at 2024-08-13 23:09 +0000 +

+ +
+
+
+
+ + + diff --git a/tests/coverage/z_9a5e1802ee124b46_formats_py.html b/tests/coverage/z_9a5e1802ee124b46_formats_py.html new file mode 100644 index 000000000..057212f82 --- /dev/null +++ b/tests/coverage/z_9a5e1802ee124b46_formats_py.html @@ -0,0 +1,101 @@ + + + + + Coverage for benefits/locale/en/formats.py: 100% + + + + + +
+
+

+ Coverage for benefits/locale/en/formats.py: + 100% +

+ +

+ 1 statements   + + + + +

+

+ « prev     + ^ index     + » next +       + coverage.py v7.6.1, + created at 2024-08-13 23:09 +0000 +

+ +
+
+
+

1# https://docs.djangoproject.com/en/5.0/ref/templates/builtins/#date-and-time-formatting-specifiers 

+

2DATE_FORMAT = "F j, Y" 

+
+ + + diff --git a/tests/coverage/z_d1111b74f8c04d3c___init___py.html b/tests/coverage/z_d1111b74f8c04d3c___init___py.html new file mode 100644 index 000000000..8b874f81d --- /dev/null +++ b/tests/coverage/z_d1111b74f8c04d3c___init___py.html @@ -0,0 +1,99 @@ + + + + + Coverage for benefits/eligibility/__init__.py: 100% + + + + + +
+
+

+ Coverage for benefits/eligibility/__init__.py: + 100% +

+ +

+ 0 statements   + + + + +

+

+ « prev     + ^ index     + » next +       + coverage.py v7.6.1, + created at 2024-08-13 23:09 +0000 +

+ +
+
+
+
+ + + diff --git a/tests/coverage/z_d1111b74f8c04d3c_analytics_py.html b/tests/coverage/z_d1111b74f8c04d3c_analytics_py.html new file mode 100644 index 000000000..03f47ff9f --- /dev/null +++ b/tests/coverage/z_d1111b74f8c04d3c_analytics_py.html @@ -0,0 +1,165 @@ + + + + + Coverage for benefits/eligibility/analytics.py: 82% + + + + + +
+
+

+ Coverage for benefits/eligibility/analytics.py: + 82% +

+ +

+ 30 statements   + + + + +

+

+ « prev     + ^ index     + » next +       + coverage.py v7.6.1, + created at 2024-08-13 23:09 +0000 +

+ +
+
+
+

1""" 

+

2The eligibility application: analytics implementation. 

+

3""" 

+

4 

+

5from benefits.core import analytics as core 

+

6 

+

7 

+

8class EligibilityEvent(core.Event): 

+

9 """Base analytics event for eligibility verification.""" 

+

10 

+

11 def __init__(self, request, event_type, eligibility_types): 

+

12 super().__init__(request, event_type) 

+

13 # overwrite core.Event eligibility_types 

+

14 self.update_event_properties(eligibility_types=eligibility_types) 

+

15 self.update_user_properties(eligibility_types=eligibility_types) 

+

16 

+

17 

+

18class SelectedVerifierEvent(EligibilityEvent): 

+

19 """Analytics event representing the user selecting an eligibility verifier.""" 

+

20 

+

21 def __init__(self, request, eligibility_types): 

+

22 super().__init__(request, "selected eligibility verifier", eligibility_types) 

+

23 

+

24 

+

25class StartedEligibilityEvent(EligibilityEvent): 

+

26 """Analytics event representing the beginning of an eligibility verification check.""" 

+

27 

+

28 def __init__(self, request, eligibility_types): 

+

29 super().__init__(request, "started eligibility", eligibility_types) 

+

30 

+

31 

+

32class ReturnedEligibilityEvent(EligibilityEvent): 

+

33 """Analytics event representing the end of an eligibility verification check.""" 

+

34 

+

35 def __init__(self, request, eligibility_types, status, error=None): 

+

36 super().__init__(request, "returned eligibility", eligibility_types) 

+

37 status = str(status).lower() 

+

38 if status in ("error", "fail", "success"): 38 ↛ 40line 38 didn't jump to line 40 because the condition on line 38 was always true

+

39 self.update_event_properties(status=status, error=error) 

+

40 if status == "success": 40 ↛ exitline 40 didn't return from function '__init__' because the condition on line 40 was always true

+

41 self.update_user_properties(eligibility_types=eligibility_types) 

+

42 

+

43 

+

44def selected_verifier(request, eligibility_types): 

+

45 """Send the "selected eligibility verifier" analytics event.""" 

+

46 core.send_event(SelectedVerifierEvent(request, eligibility_types)) 

+

47 

+

48 

+

49def started_eligibility(request, eligibility_types): 

+

50 """Send the "started eligibility" analytics event.""" 

+

51 core.send_event(StartedEligibilityEvent(request, eligibility_types)) 

+

52 

+

53 

+

54def returned_error(request, eligibility_types, error): 

+

55 """Send the "returned eligibility" analytics event with an error status.""" 

+

56 core.send_event(ReturnedEligibilityEvent(request, eligibility_types, status="error", error=error)) 

+

57 

+

58 

+

59def returned_fail(request, eligibility_types): 

+

60 """Send the "returned eligibility" analytics event with a fail status.""" 

+

61 core.send_event(ReturnedEligibilityEvent(request, eligibility_types, status="fail")) 

+

62 

+

63 

+

64def returned_success(request, eligibility_types): 

+

65 """Send the "returned eligibility" analytics event with a success status.""" 

+

66 core.send_event(ReturnedEligibilityEvent(request, eligibility_types, status="success")) 

+
+ + + diff --git a/tests/coverage/z_d1111b74f8c04d3c_apps_py.html b/tests/coverage/z_d1111b74f8c04d3c_apps_py.html new file mode 100644 index 000000000..5b509844d --- /dev/null +++ b/tests/coverage/z_d1111b74f8c04d3c_apps_py.html @@ -0,0 +1,110 @@ + + + + + Coverage for benefits/eligibility/apps.py: 100% + + + + + +
+
+

+ Coverage for benefits/eligibility/apps.py: + 100% +

+ +

+ 5 statements   + + + + +

+

+ « prev     + ^ index     + » next +       + coverage.py v7.6.1, + created at 2024-08-13 23:09 +0000 +

+ +
+
+
+

1""" 

+

2The eligibility application: Verifies eligibility for benefits. 

+

3""" 

+

4 

+

5from django.apps import AppConfig 

+

6 

+

7 

+

8class EligibilityAppConfig(AppConfig): 

+

9 name = "benefits.eligibility" 

+

10 label = "eligibility" 

+

11 verbose_name = "Eligibility Verification" 

+
+ + + diff --git a/tests/coverage/z_d1111b74f8c04d3c_forms_py.html b/tests/coverage/z_d1111b74f8c04d3c_forms_py.html new file mode 100644 index 000000000..1379f59ac --- /dev/null +++ b/tests/coverage/z_d1111b74f8c04d3c_forms_py.html @@ -0,0 +1,328 @@ + + + + + Coverage for benefits/eligibility/forms.py: 95% + + + + + +
+
+

+ Coverage for benefits/eligibility/forms.py: + 95% +

+ +

+ 65 statements   + + + + +

+

+ « prev     + ^ index     + » next +       + coverage.py v7.6.1, + created at 2024-08-13 23:09 +0000 +

+ +
+
+
+

1""" 

+

2The eligibility application: Form definition for the eligibility verification flow. 

+

3""" 

+

4 

+

5import logging 

+

6 

+

7from django import forms 

+

8from django.utils.translation import gettext_lazy as _ 

+

9 

+

10from benefits.core import models, recaptcha, widgets 

+

11 

+

12logger = logging.getLogger(__name__) 

+

13 

+

14 

+

15class EnrollmentFlowSelectionForm(forms.Form): 

+

16 """Form to capture enrollment flow selection.""" 

+

17 

+

18 action_url = "eligibility:index" 

+

19 id = "form-flow-selection" 

+

20 method = "POST" 

+

21 

+

22 flow = forms.ChoiceField(label="", widget=widgets.FlowRadioSelect) 

+

23 # sets label to empty string so the radio_select template can override the label style 

+

24 submit_value = _("Choose this benefit") 

+

25 

+

26 def __init__(self, agency: models.TransitAgency, *args, **kwargs): 

+

27 super().__init__(*args, **kwargs) 

+

28 flows = agency.enrollment_flows.all() 

+

29 

+

30 self.classes = "col-lg-8" 

+

31 # second element is not used since we render the whole label using selection_label_template, 

+

32 # therefore set to None 

+

33 flow_field = self.fields["flow"] 

+

34 flow_field.choices = [(f.id, None) for f in flows] 

+

35 flow_field.widget.selection_label_templates = {f.id: f.selection_label_template for f in flows} 

+

36 flow_field.widget.attrs.update({"data-custom-validity": _("Please choose a transit benefit.")}) 

+

37 self.use_custom_validity = True 

+

38 

+

39 def clean(self): 

+

40 if not recaptcha.verify(self.data): 40 ↛ 41line 40 didn't jump to line 41 because the condition on line 40 was never true

+

41 raise forms.ValidationError("reCAPTCHA failed") 

+

42 

+

43 

+

44class EligibilityVerificationForm(forms.Form): 

+

45 """Form to collect eligibility verification details.""" 

+

46 

+

47 action_url = "eligibility:confirm" 

+

48 id = "form-eligibility-verification" 

+

49 method = "POST" 

+

50 

+

51 submit_value = _("Find my record") 

+

52 submitting_value = _("Checking") 

+

53 

+

54 def __init__( 

+

55 self, 

+

56 title, 

+

57 headline, 

+

58 blurb, 

+

59 name_label, 

+

60 name_placeholder, 

+

61 name_help_text, 

+

62 sub_label, 

+

63 sub_placeholder, 

+

64 sub_help_text, 

+

65 name_max_length=None, 

+

66 sub_input_mode=None, 

+

67 sub_max_length=None, 

+

68 sub_pattern=None, 

+

69 sub_custom_validity=None, 

+

70 name_custom_validity=None, 

+

71 *args, 

+

72 **kwargs, 

+

73 ): 

+

74 """Initialize a new EligibilityVerification form. 

+

75 

+

76 Args: 

+

77 title (str): The page (i.e. tab) title for the form's page. 

+

78 

+

79 headline (str): The <h1> on the form's page. 

+

80 

+

81 blurb (str): Intro <p> on the form's page. 

+

82 

+

83 name_label (str): Label for the name form field. 

+

84 

+

85 name_placeholder (str): Field placeholder for the name form field. 

+

86 

+

87 name_help_text (str): Extra help text for the name form field. 

+

88 

+

89 sub_label (str): Label for the sub form field. 

+

90 

+

91 sub_placeholder (str): Field placeholder for the sub form field. 

+

92 

+

93 sub_help_text (str): Extra help text for the sub form field. 

+

94 

+

95 name_max_length (int): The maximum length accepted for the 'name' API field before sending an API request 

+

96 

+

97 sub_input_mode (str): Input mode can be "numeric", "tel", "search", etc. to override default "text" keyboard on 

+

98 mobile devices 

+

99 

+

100 sub_max_length (int): The maximum length accepted for the 'sub' API field before sending an API request 

+

101 

+

102 sub_pattern (str): A regular expression used to validate the 'sub' API field before sending an API request 

+

103 

+

104 Extra args and kwargs are passed through to the underlying django.forms.Form. 

+

105 """ 

+

106 super().__init__(auto_id=True, label_suffix="", *args, **kwargs) 

+

107 

+

108 self.title = title 

+

109 self.headline = headline 

+

110 self.blurb = blurb 

+

111 

+

112 self.classes = "col-lg-6" 

+

113 sub_widget = widgets.FormControlTextInput(placeholder=sub_placeholder) 

+

114 if sub_pattern: 

+

115 sub_widget.attrs.update({"pattern": sub_pattern}) 

+

116 if sub_input_mode: 

+

117 sub_widget.attrs.update({"inputmode": sub_input_mode}) 

+

118 if sub_max_length: 

+

119 sub_widget.attrs.update({"maxlength": sub_max_length}) 

+

120 if sub_custom_validity: 

+

121 sub_widget.attrs.update({"data-custom-validity": sub_custom_validity}) 

+

122 self.use_custom_validity = True 

+

123 

+

124 self.fields["sub"] = forms.CharField( 

+

125 label=sub_label, 

+

126 widget=sub_widget, 

+

127 help_text=sub_help_text, 

+

128 ) 

+

129 

+

130 name_widget = widgets.FormControlTextInput(placeholder=name_placeholder) 

+

131 if name_max_length: 

+

132 name_widget.attrs.update({"maxlength": name_max_length}) 

+

133 if name_custom_validity: 

+

134 name_widget.attrs.update({"data-custom-validity": name_custom_validity}) 

+

135 self.use_custom_validity = True 

+

136 

+

137 self.fields["name"] = forms.CharField(label=name_label, widget=name_widget, help_text=name_help_text) 

+

138 

+

139 def clean(self): 

+

140 if not recaptcha.verify(self.data): 140 ↛ 141line 140 didn't jump to line 141 because the condition on line 140 was never true

+

141 raise forms.ValidationError("reCAPTCHA failed") 

+

142 

+

143 

+

144class CSTAgencyCard(EligibilityVerificationForm): 

+

145 """EligibilityVerification form for the CST Agency Card.""" 

+

146 

+

147 def __init__(self, *args, **kwargs): 

+

148 super().__init__( 

+

149 title=_("Agency card information"), 

+

150 headline=_("Let’s find the record of your transit benefit."), 

+

151 blurb=_( 

+

152 "We use the information on your CST Agency Card to find the record of your transit benefit in our system." 

+

153 ), 

+

154 name_label=_("Last Name"), 

+

155 name_placeholder="Hernandez-Demarcos", 

+

156 name_help_text=_( 

+

157 "Please enter your last name the same way it is printed on your card, including capital letters and hyphens." 

+

158 ), 

+

159 sub_label=_("Agency Card number"), 

+

160 sub_help_text=_("This is a 5-digit number on the front and back of your card."), 

+

161 sub_placeholder="12345", 

+

162 name_max_length=255, 

+

163 sub_input_mode="numeric", 

+

164 sub_max_length=5, 

+

165 sub_pattern=r"\d{5}", 

+

166 sub_custom_validity=_("Please enter a 5-digit number."), 

+

167 name_custom_validity=_("Please enter your last name."), 

+

168 *args, 

+

169 **kwargs, 

+

170 ) 

+

171 

+

172 

+

173class MSTCourtesyCard(EligibilityVerificationForm): 

+

174 """EligibilityVerification form for the MST Courtesy Card.""" 

+

175 

+

176 def __init__(self, *args, **kwargs): 

+

177 super().__init__( 

+

178 title=_("Agency card information"), 

+

179 headline=_("Let’s find the record of your transit benefit."), 

+

180 blurb=_( 

+

181 "We use the information on your MST Courtesy Card to find the record of your transit benefit in our system." 

+

182 ), 

+

183 name_label=_("Last Name"), 

+

184 name_placeholder="Garcia", 

+

185 name_help_text=_( 

+

186 "Please enter your last name the same way it is printed on your card, including capital letters and hyphens." 

+

187 ), 

+

188 sub_label=_("Courtesy Card number"), 

+

189 sub_help_text=_("This is a 5-digit number on the front and back of your card."), 

+

190 sub_placeholder="12345", 

+

191 name_max_length=255, 

+

192 sub_input_mode="numeric", 

+

193 sub_max_length=5, 

+

194 sub_pattern=r"\d{5}", 

+

195 sub_custom_validity=_("Please enter a 5-digit number."), 

+

196 name_custom_validity=_("Please enter your last name."), 

+

197 *args, 

+

198 **kwargs, 

+

199 ) 

+

200 

+

201 

+

202class SBMTDMobilityPass(EligibilityVerificationForm): 

+

203 """EligibilityVerification form for the SBMTD Reduced Fare Mobility ID.""" 

+

204 

+

205 def __init__(self, *args, **kwargs): 

+

206 super().__init__( 

+

207 title=_("Agency card information"), 

+

208 headline=_("Let’s find the record of your transit benefit."), 

+

209 blurb=_( 

+

210 "We use the information on your SBMTD Reduced Fare Mobility ID card to find the record of your transit " 

+

211 + "benefit in our system." 

+

212 ), 

+

213 name_label=_("Last Name"), 

+

214 name_placeholder="Garcia", 

+

215 name_help_text=_( 

+

216 "Please enter your last name the same way it is printed on your card, including capital letters and hyphens." 

+

217 ), 

+

218 sub_label=_("Reduced Fare Mobility ID card number"), 

+

219 sub_help_text=_("This is a 4-digit number on the back of your card."), 

+

220 sub_placeholder="1234", 

+

221 name_max_length=255, 

+

222 sub_input_mode="numeric", 

+

223 sub_max_length=4, 

+

224 sub_pattern=r"\d{4}", 

+

225 sub_custom_validity=_("Please enter a 4-digit number."), 

+

226 name_custom_validity=_("Please enter your last name."), 

+

227 *args, 

+

228 **kwargs, 

+

229 ) 

+
+ + + diff --git a/tests/coverage/z_d1111b74f8c04d3c_urls_py.html b/tests/coverage/z_d1111b74f8c04d3c_urls_py.html new file mode 100644 index 000000000..e88adf2b0 --- /dev/null +++ b/tests/coverage/z_d1111b74f8c04d3c_urls_py.html @@ -0,0 +1,117 @@ + + + + + Coverage for benefits/eligibility/urls.py: 100% + + + + + +
+
+

+ Coverage for benefits/eligibility/urls.py: + 100% +

+ +

+ 4 statements   + + + + +

+

+ « prev     + ^ index     + » next +       + coverage.py v7.6.1, + created at 2024-08-13 23:09 +0000 +

+ +
+
+
+

1""" 

+

2The eligibility application: URLConf for the eligibility verification flow. 

+

3""" 

+

4 

+

5from django.urls import path 

+

6 

+

7from . import views 

+

8 

+

9 

+

10app_name = "eligibility" 

+

11urlpatterns = [ 

+

12 # /eligibility 

+

13 path("", views.index, name="index"), 

+

14 path("<agency:agency>", views.index, name="agency_index"), 

+

15 path("start", views.start, name="start"), 

+

16 path("confirm", views.confirm, name="confirm"), 

+

17 path("unverified", views.unverified, name="unverified"), 

+

18] 

+
+ + + diff --git a/tests/coverage/z_d1111b74f8c04d3c_verify_py.html b/tests/coverage/z_d1111b74f8c04d3c_verify_py.html new file mode 100644 index 000000000..d24b54e73 --- /dev/null +++ b/tests/coverage/z_d1111b74f8c04d3c_verify_py.html @@ -0,0 +1,137 @@ + + + + + Coverage for benefits/eligibility/verify.py: 100% + + + + + +
+
+

+ Coverage for benefits/eligibility/verify.py: + 100% +

+ +

+ 16 statements   + + + + +

+

+ « prev     + ^ index     + » next +       + coverage.py v7.6.1, + created at 2024-08-13 23:09 +0000 +

+ +
+
+
+

1from django.conf import settings 

+

2 

+

3from eligibility_api.client import Client 

+

4 

+

5from benefits.core import models 

+

6 

+

7 

+

8def eligibility_from_api(flow: models.EnrollmentFlow, form, agency: models.TransitAgency): 

+

9 sub, name = form.cleaned_data.get("sub"), form.cleaned_data.get("name") 

+

10 

+

11 client = Client( 

+

12 verify_url=flow.eligibility_api_url, 

+

13 headers={flow.eligibility_api_auth_header: flow.eligibility_api_auth_key}, 

+

14 issuer=settings.ALLOWED_HOSTS[0], 

+

15 agency=agency.eligibility_api_id, 

+

16 jws_signing_alg=agency.eligibility_api_jws_signing_alg, 

+

17 client_private_key=agency.eligibility_api_private_key_data, 

+

18 jwe_encryption_alg=flow.eligibility_api_jwe_encryption_alg, 

+

19 jwe_cek_enc=flow.eligibility_api_jwe_cek_enc, 

+

20 server_public_key=flow.eligibility_api_public_key_data, 

+

21 timeout=settings.REQUESTS_TIMEOUT, 

+

22 ) 

+

23 

+

24 response = client.verify(sub, name, agency.type_names_to_verify(flow)) 

+

25 

+

26 if response.error and any(response.error): 

+

27 return None 

+

28 elif any(response.eligibility): 

+

29 return list(response.eligibility) 

+

30 else: 

+

31 return [] 

+

32 

+

33 

+

34def eligibility_from_oauth(flow: models.EnrollmentFlow, oauth_claim, agency: models.TransitAgency): 

+

35 if flow.uses_claims_verification and flow.claims_claim == oauth_claim: 

+

36 return agency.type_names_to_verify(flow) 

+

37 else: 

+

38 return [] 

+
+ + + diff --git a/tests/coverage/z_d1111b74f8c04d3c_views_py.html b/tests/coverage/z_d1111b74f8c04d3c_views_py.html new file mode 100644 index 000000000..c4e802595 --- /dev/null +++ b/tests/coverage/z_d1111b74f8c04d3c_views_py.html @@ -0,0 +1,271 @@ + + + + + Coverage for benefits/eligibility/views.py: 97% + + + + + +
+
+

+ Coverage for benefits/eligibility/views.py: + 97% +

+ +

+ 102 statements   + + + + +

+

+ « prev     + ^ index     + » next +       + coverage.py v7.6.1, + created at 2024-08-13 23:09 +0000 +

+ +
+
+
+

1""" 

+

2The eligibility application: view definitions for the eligibility verification flow. 

+

3""" 

+

4 

+

5from django.contrib import messages 

+

6from django.shortcuts import redirect 

+

7from django.template.response import TemplateResponse 

+

8from django.urls import reverse 

+

9from django.utils.decorators import decorator_from_middleware 

+

10 

+

11from benefits.core import recaptcha, session 

+

12from benefits.core.middleware import AgencySessionRequired, LoginRequired, RecaptchaEnabled, FlowSessionRequired 

+

13from benefits.core.models import EnrollmentFlow 

+

14from . import analytics, forms, verify 

+

15 

+

16 

+

17ROUTE_CORE_INDEX = "core:index" 

+

18ROUTE_INDEX = "eligibility:index" 

+

19ROUTE_START = "eligibility:start" 

+

20ROUTE_LOGIN = "oauth:login" 

+

21ROUTE_CONFIRM = "eligibility:confirm" 

+

22ROUTE_UNVERIFIED = "eligibility:unverified" 

+

23ROUTE_ENROLLMENT = "enrollment:index" 

+

24 

+

25TEMPLATE_CONFIRM = "eligibility/confirm.html" 

+

26 

+

27 

+

28@decorator_from_middleware(RecaptchaEnabled) 

+

29def index(request, agency=None): 

+

30 """View handler for the enrollment flow selection form.""" 

+

31 

+

32 if agency is None: 32 ↛ 40line 32 didn't jump to line 40 because the condition on line 32 was always true

+

33 # see if session has an agency 

+

34 agency = session.agency(request) 

+

35 if agency is None: 

+

36 return TemplateResponse(request, "200-user-error.html") 

+

37 else: 

+

38 session.update(request, eligibility_types=[], origin=agency.index_url) 

+

39 else: 

+

40 session.update(request, agency=agency, eligibility_types=[], origin=reverse(ROUTE_CORE_INDEX)) 

+

41 

+

42 # clear any prior OAuth token as the user is choosing their desired flow 

+

43 # this may or may not require OAuth, with a different set of scope/claims than what is already stored 

+

44 session.logout(request) 

+

45 

+

46 context = {"form": forms.EnrollmentFlowSelectionForm(agency=agency)} 

+

47 

+

48 if request.method == "POST": 

+

49 form = forms.EnrollmentFlowSelectionForm(data=request.POST, agency=agency) 

+

50 

+

51 if form.is_valid(): 

+

52 flow_id = form.cleaned_data.get("flow") 

+

53 flow = EnrollmentFlow.objects.get(id=flow_id) 

+

54 session.update(request, flow=flow) 

+

55 

+

56 types_to_verify = agency.type_names_to_verify(flow) 

+

57 analytics.selected_verifier(request, types_to_verify) 

+

58 

+

59 eligibility_start = reverse(ROUTE_START) 

+

60 response = redirect(eligibility_start) 

+

61 else: 

+

62 # form was not valid, allow for correction/resubmission 

+

63 if recaptcha.has_error(form): 63 ↛ 64line 63 didn't jump to line 64 because the condition on line 63 was never true

+

64 messages.error(request, "Recaptcha failed. Please try again.") 

+

65 context["form"] = form 

+

66 response = TemplateResponse(request, agency.eligibility_index_template, context) 

+

67 else: 

+

68 response = TemplateResponse(request, agency.eligibility_index_template, context) 

+

69 

+

70 return response 

+

71 

+

72 

+

73@decorator_from_middleware(AgencySessionRequired) 

+

74@decorator_from_middleware(FlowSessionRequired) 

+

75def start(request): 

+

76 """View handler for the eligibility verification getting started screen.""" 

+

77 session.update(request, eligibility_types=[], origin=reverse(ROUTE_START)) 

+

78 

+

79 flow = session.flow(request) 

+

80 

+

81 return TemplateResponse(request, flow.eligibility_start_template) 

+

82 

+

83 

+

84@decorator_from_middleware(AgencySessionRequired) 

+

85@decorator_from_middleware(LoginRequired) 

+

86@decorator_from_middleware(RecaptchaEnabled) 

+

87@decorator_from_middleware(FlowSessionRequired) 

+

88def confirm(request): 

+

89 """View handler for the eligibility verification form.""" 

+

90 

+

91 # GET from an already verified user, no need to verify again 

+

92 if request.method == "GET" and session.eligible(request): 

+

93 eligibility = session.eligibility(request) 

+

94 return verified(request, [eligibility.name]) 

+

95 

+

96 unverified_view = reverse(ROUTE_UNVERIFIED) 

+

97 

+

98 agency = session.agency(request) 

+

99 flow = session.flow(request) 

+

100 types_to_verify = agency.type_names_to_verify(flow) 

+

101 

+

102 # GET for OAuth verification 

+

103 if request.method == "GET" and flow.uses_claims_verification: 

+

104 analytics.started_eligibility(request, types_to_verify) 

+

105 

+

106 verified_types = verify.eligibility_from_oauth(flow, session.oauth_claim(request), agency) 

+

107 if verified_types: 

+

108 return verified(request, verified_types) 

+

109 else: 

+

110 return redirect(unverified_view) 

+

111 

+

112 form = flow.eligibility_form_instance() 

+

113 

+

114 # GET/POST for Eligibility API verification 

+

115 context = {"form": form} 

+

116 

+

117 # GET from an unverified user, present the form 

+

118 if request.method == "GET": 

+

119 session.update(request, origin=reverse(ROUTE_CONFIRM)) 

+

120 return TemplateResponse(request, TEMPLATE_CONFIRM, context) 

+

121 # POST form submission, process form data, make Eligibility Verification API call 

+

122 elif request.method == "POST": 122 ↛ exitline 122 didn't return from function 'confirm' because the condition on line 122 was always true

+

123 analytics.started_eligibility(request, types_to_verify) 

+

124 

+

125 form = flow.eligibility_form_instance(data=request.POST) 

+

126 # form was not valid, allow for correction/resubmission 

+

127 if not form.is_valid(): 

+

128 if recaptcha.has_error(form): 

+

129 messages.error(request, "Recaptcha failed. Please try again.") 

+

130 context["form"] = form 

+

131 return TemplateResponse(request, TEMPLATE_CONFIRM, context) 

+

132 

+

133 # form is valid, make Eligibility Verification request to get the verified types 

+

134 verified_types = verify.eligibility_from_api(flow, form, agency) 

+

135 

+

136 # form was not valid, allow for correction/resubmission 

+

137 if verified_types is None: 

+

138 analytics.returned_error(request, types_to_verify, form.errors) 

+

139 context["form"] = form 

+

140 return TemplateResponse(request, TEMPLATE_CONFIRM, context) 

+

141 # no types were verified 

+

142 elif len(verified_types) == 0: 

+

143 return redirect(unverified_view) 

+

144 # type(s) were verified 

+

145 else: 

+

146 return verified(request, verified_types) 

+

147 

+

148 

+

149@decorator_from_middleware(AgencySessionRequired) 

+

150@decorator_from_middleware(LoginRequired) 

+

151def verified(request, verified_types): 

+

152 """View handler for the verified eligibility page.""" 

+

153 

+

154 analytics.returned_success(request, verified_types) 

+

155 

+

156 session.update(request, eligibility_types=verified_types) 

+

157 

+

158 return redirect(ROUTE_ENROLLMENT) 

+

159 

+

160 

+

161@decorator_from_middleware(AgencySessionRequired) 

+

162@decorator_from_middleware(FlowSessionRequired) 

+

163def unverified(request): 

+

164 """View handler for the unverified eligibility page.""" 

+

165 

+

166 agency = session.agency(request) 

+

167 flow = session.flow(request) 

+

168 types_to_verify = agency.type_names_to_verify(flow) 

+

169 

+

170 analytics.returned_fail(request, types_to_verify) 

+

171 

+

172 return TemplateResponse(request, flow.eligibility_unverified_template) 

+
+ + + diff --git a/tests/coverage/z_de34693c7b899b5e___init___py.html b/tests/coverage/z_de34693c7b899b5e___init___py.html new file mode 100644 index 000000000..185084a65 --- /dev/null +++ b/tests/coverage/z_de34693c7b899b5e___init___py.html @@ -0,0 +1,99 @@ + + + + + Coverage for benefits/locale/es/__init__.py: 100% + + + + + +
+
+

+ Coverage for benefits/locale/es/__init__.py: + 100% +

+ +

+ 0 statements   + + + + +

+

+ « prev     + ^ index     + » next +       + coverage.py v7.6.1, + created at 2024-08-13 23:09 +0000 +

+ +
+
+
+
+ + + diff --git a/tests/coverage/z_de34693c7b899b5e_formats_py.html b/tests/coverage/z_de34693c7b899b5e_formats_py.html new file mode 100644 index 000000000..538518c75 --- /dev/null +++ b/tests/coverage/z_de34693c7b899b5e_formats_py.html @@ -0,0 +1,104 @@ + + + + + Coverage for benefits/locale/es/formats.py: 100% + + + + + +
+
+

+ Coverage for benefits/locale/es/formats.py: + 100% +

+ +

+ 1 statements   + + + + +

+

+ « prev     + ^ index     + » next +       + coverage.py v7.6.1, + created at 2024-08-13 23:09 +0000 +

+ +
+
+
+

1# Both “d” and “e” are backslash-escaped, because otherwise each is a format string 

+

2# that displays the day and the timezone name, respectively. 

+

3# Instead we want the literal word "de" 

+

4# https://docs.djangoproject.com/en/5.0/ref/templates/builtins/#date-and-time-formatting-specifiers 

+

5DATE_FORMAT = r"j \d\e F \d\e Y" 

+
+ + + diff --git a/tests/coverage/z_ed7c491f4d53135c___init___py.html b/tests/coverage/z_ed7c491f4d53135c___init___py.html new file mode 100644 index 000000000..84b755236 --- /dev/null +++ b/tests/coverage/z_ed7c491f4d53135c___init___py.html @@ -0,0 +1,99 @@ + + + + + Coverage for benefits/locale/__init__.py: 100% + + + + + +
+
+

+ Coverage for benefits/locale/__init__.py: + 100% +

+ +

+ 0 statements   + + + + +

+

+ « prev     + ^ index     + » next +       + coverage.py v7.6.1, + created at 2024-08-13 23:09 +0000 +

+ +
+
+
+
+ + + diff --git a/tests/manual-tests/index.html b/tests/manual-tests/index.html new file mode 100644 index 000000000..f21eaf577 --- /dev/null +++ b/tests/manual-tests/index.html @@ -0,0 +1,1906 @@ + + + + + + + + + + + + + + + + + + + + + + + + + Manual tests - cal-itp/benefits: documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + + + + +
+
+ + + +
+
+
+ + + + + + + + + +
+
+
+ + + + +
+
+ + + + + + + +

Manual tests

+

This page lists manual testing scripts for various flows.

+

Getting started: Using test credentials

+

In order to fully test the app, you will need to use test credentials, which are available here: Benefits Test Data.

+
+

Important: Please do not use your personal accounts for Login.gov, ID.me, etc. to complete your review.

+
+

Login.gov and Veteran Confirmation API

+

To test the Login.gov (Older adult) and Veteran Confirmation API (Veteran) enrollment pathway flows, you will need an e-mail address, a real cell phone and test account yml files from the Benefits Test Data document.

+

Read the Login.gov Testing identity proofing documentation for complete instructions. In summary, once you click Get started with Login.gov, follow these instructions:

+
    +
  1. Before you get started, download the proofing-senior.yml (or any other yml file for the specific user you are testing) from the Benefits Test Data document. For example, if you are testing the Veteran flow, or a non-senior flow, download the proofing-veteran.yml or proofing-nonsenior.yml files respectively.
  2. +
  3. Click Create an account.
  4. +
  5. Create a test email address, like yourname+older_adult@compiler.la. Gmail supports adding suffixes to your email address.
  6. +
  7. Select English (default) and check I read and accept the Login.gov Rules of Use.
  8. +
  9. Check your email for a confirmation link and click it.
  10. +
  11. Go through the password and authentication method setup flows. Make sure to select Text or voice message. Selecting Backup codes is useful if you plan to use this account again. Make sure to save your password, as you will need to enter it at the very end.
  12. +
  13. Enter your real cell phone number.
  14. +
  15. Check your text messages for a message from Login.gov. The message should specify idp.int.identitysandbox.gov.
  16. +
  17. Enter the code into the browser.
  18. +
  19. Save the backup codes, if selected.
  20. +
  21. Click Continue until you reach the How would you like to add your ID? part of the flow.
  22. +
  23. Click Upload photos.
  24. +
  25. Upload the .yml files you downloaded in the first step for both the front and back of the ID. Click Continue.
  26. +
  27. For Enter your Social Security number, enter a number that starts with 900 or 666. DO NOT ENTER YOUR PERSONAL SOCIAL SECURITY NUMBER.
  28. +
  29. At this point, the Verify your information page should show the data you have in the .yml file you uploaded. Double-check that the age (date of birth) is accurate.
  30. +
  31. Verify your phone again.
  32. +
  33. Re-enter your password. You should be redirected back to the Benefits application.
  34. +
+

Agency cards

+

To test the agency card enrollment pathway, use the following test credentials:

+ +

Littlepay

+

To test the Littlepay card enrollment flow, use the test Visa credentials in the Benefits Test Data document, along with any fake name, any CVV and an expiration date in the future.

+

Keyboard testing

+

Keyboard testing refers to test the app on a desktop/laptop machine without using a mouse/trackpad. To do so, use Tab to focus on a button or link, and Enter to select a button or link.

+

Make sure:

+
    +
  • All links and buttons have a visible indication that the targeted item is focused.
  • +
  • All modals close by pressing Escape.
  • +
  • The skip nav, a link with the text Skip to main content / Saltar al contenido principal should appear on the first tab press.
  • +
+

Spanish translation testing

+
    +
  1. Open the test environment Benefits application in the test environment using a supported browser.
  2. +
  3. Click the Español button on the right side of the application header, to switch the application language to Spanish.
  4. +
  5. Click Elija su Proveedor and choose Monterey-Salinas Transit as your transit agency.
  6. +
  7. Follow the Adulto mayor / Older adult enrollment pathway to completion using test data. You will need a cell phone, a test Login.gov account and test Littlepay card credentials.
  8. +
  9. Follow the Veterano de EE. UU. / Veterans enrollment pathway to completion using test data. You will need a cell phone, a test Login.gov account and test Littlepay card credentials.
  10. +
  11. Follow the Tarjeta de cortesía de MST / Courtesy Card pathway to completion using test data. You will need test Courtesy Card credentials and test Littlepay card credentials.
  12. +
  13. Click Ayuda in the footer to review the Help page.
  14. +
  15. Jot down any issues or notes during the review. Highlight any proposed changes on the forTranslation tab in the Cal-ITP Benefits Application Copy spreadsheet. Use the comment feature in Google Sheets to share your feedback. Please mention Andy Walker and Machiko Yasuda in each comment.
  16. +
+ + + + + + + + + + + + + + + +
+
+ + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + \ No newline at end of file diff --git a/use-cases/courtesy-cards/index.html b/use-cases/courtesy-cards/index.html new file mode 100644 index 000000000..b5a89b65c --- /dev/null +++ b/use-cases/courtesy-cards/index.html @@ -0,0 +1,15 @@ + + + + + + Redirecting... + + + + + + +Redirecting... + +

Architecture